/* ============================================================
   AI Inbox（公開デモ版） — ダッシュボードUI
   デザイン参照:
     - レイアウト・配色: maintenance.nextflow-app.com デモ
       （canvas #f4f7f6 / surface白 / green-700 #087f5b / radius 14 / Inter+Noto Sans JP）
     - アニメーション規範: github.com/emilkowalski/skills
       transform+opacityのみ / 入場ease-out / UIは300ms以内 /
       ボタン押下100-160ms scale(0.97) / scale(0)禁止 / トーストはtransitionのみ
   モバイル: サイドバー=オフキャンバスドロワー、受信箱=一覧⇄詳細のスタック遷移
   ============================================================ */

:root {
  --green-700: #087f5b; --green-600: #0b966a; --green-100: #dff7ed; --green-50: #effaf6;
  --amber-600: #b96c0d; --amber-100: #fff1cf;
  --red-600: #c2413b;   --red-100: #fee9e7;
  --blue-600: #276b91;  --blue-100: #e8f3f9;
  --navy-900: #10333a;
  --ink: #182b2f; --muted: #64757a;
  --line: #dce5e3; --line-strong: #c8d6d3;
  --surface: #ffffff; --canvas: #f4f7f6;
  --shadow-sm: 0 1px 2px rgba(8,35,38,0.05), 0 4px 12px rgba(8,35,38,0.04);
  --radius-sm: 8px; --radius-md: 14px; --radius-lg: 22px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --focus-ring: rgba(11, 150, 106, 0.22);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

/* キーボード操作の可視化（マウス操作時は出さない） */
:focus-visible { outline: 2px solid var(--green-600); outline-offset: 2px; border-radius: 6px; }

body {
  font-family: Inter, "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background: var(--canvas); color: var(--ink);
  font-size: 13.5px; line-height: 1.65;
}
button, input, textarea, select { font-family: inherit; }

/* ===== デモ告知リボン（公開デモ版のみ） ===== */
.demo-ribbon {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  background: var(--navy-900); color: #fff;
  padding: 8px 16px; font-size: 12px; line-height: 1.5;
  text-align: center; flex-wrap: wrap;
}
.demo-ribbon[hidden] { display: none; }
.demo-ribbon b { color: var(--green-100); }
.demo-ribbon-close {
  border: 1px solid rgba(255,255,255,0.4); background: transparent; color: #fff;
  border-radius: 7px; padding: 3px 11px; font-size: 11px; font-weight: 700; cursor: pointer;
  flex: 0 0 auto;
  transition: background-color 150ms ease, transform 100ms var(--ease-out);
}
.demo-ribbon-close:hover { background: rgba(255,255,255,0.14); }
.demo-ribbon-close:active { transform: scale(0.96); }

/* ===== シェル ===== */
/* リボン表示中はその分だけシェルの高さを詰める */
.app-shell { display: grid; grid-template-columns: 236px 1fr; height: 100vh; height: 100dvh; }
body:has(.demo-ribbon:not([hidden])) .app-shell { height: calc(100dvh - 37px); }
.main-col { display: flex; flex-direction: column; min-width: 0; }

/* ===== サイドバー ===== */
.sidebar {
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 20px 14px 14px;
  overflow-y: auto;
}
.drawer-overlay { display: none; }

.brand { display: flex; align-items: center; gap: 10px; margin: 0 6px 20px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  background: var(--green-700); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; letter-spacing: 0.02em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-weight: 800; font-size: 15px; letter-spacing: 0.01em; }
.brand-sub { font-size: 10px; color: var(--muted); letter-spacing: 0.08em; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-eyebrow {
  font-size: 9.5px; font-weight: 700; color: var(--muted);
  letter-spacing: 0.14em; text-transform: uppercase;
  margin: 14px 10px 4px;
}
.nav-eyebrow:first-child { margin-top: 0; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: transparent; border: none; cursor: pointer;
  padding: 9px 10px; border-radius: 9px;
  color: var(--muted); font-size: 13px; font-weight: 600; text-align: left;
  transition: background-color 150ms ease, color 150ms ease, transform 100ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .nav-item:hover { background: var(--green-50); color: var(--ink); }
}
.nav-item.is-active { background: var(--green-100); color: var(--green-700); }
.nav-item:active { transform: scale(0.98); }
.nav-icon { width: 17px; height: 17px; flex: 0 0 auto; }
.nav-item span:not(.nav-count) { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-count {
  font-size: 10.5px; font-weight: 800; min-width: 20px; text-align: center;
  background: var(--green-700); color: #fff; border-radius: 999px; padding: 1px 6px; flex: 0 0 auto;
}
.nav-count[data-zero="true"] { background: var(--line); color: var(--muted); }

/* サイドバーのラベル行（Gmail風） */
.nav-label { font-weight: 600; }
.nav-label .label-dot { width: 10px; height: 10px; border-radius: 3.5px; flex: 0 0 auto; }
.nav-label .label-count { font-size: 10.5px; color: var(--muted); flex: 0 0 auto; font-weight: 700; }
.nav-label.is-active .label-count { color: inherit; }

.sidebar-foot { padding: 10px 6px 0; }
.demo-note { font-size: 10px; color: var(--muted); line-height: 1.5; }

/* ===== トップバー ===== */
.topbar {
  height: 56px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 0 18px;
  flex: 0 0 auto;
}
.menu-btn {
  display: none; border: none; background: transparent; color: var(--ink);
  width: 38px; height: 38px; border-radius: 9px; cursor: pointer;
  align-items: center; justify-content: center;
  transition: background-color 150ms ease, transform 100ms var(--ease-out);
}
.menu-btn:active { transform: scale(0.95); }
.topbar-title { font-weight: 700; font-size: 14px; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 9px; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 9px; background: var(--green-100); color: var(--green-700);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-meta b { font-size: 12px; }
.user-meta small { font-size: 10px; color: var(--muted); }

/* ===== ワークスペース / ビュー ===== */
.workspace { flex: 1; overflow-y: auto; min-height: 0; -webkit-overflow-scrolling: touch; }
.view { display: none; padding: 26px 28px 40px; animation: view-enter 220ms var(--ease-out) both; }
.view.is-active { display: block; }
#view-inbox.is-active { display: flex; flex-direction: column; height: 100%; }

@keyframes view-enter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  display: block; font-size: 10px; font-weight: 800; color: var(--green-700);
  letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 4px;
}
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: 0.01em; }
.page-head.compact { margin-bottom: 14px; }
.page-lead { margin: 4px 0 0; color: var(--muted); font-size: 12px; max-width: 720px; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin: 26px 0 12px; }
.section-head h2 { margin: 0; font-size: 16px; font-weight: 800; }
.link-btn {
  border: none; background: none; color: var(--green-700); font-size: 12px; font-weight: 700;
  cursor: pointer; padding: 4px 6px; border-radius: 6px;
  transition: background-color 150ms ease;
}
@media (hover: hover) and (pointer: fine) { .link-btn:hover { background: var(--green-50); } }

.hint-text { font-size: 11.5px; color: var(--muted); margin-top: 12px; line-height: 1.6; }

/* ===== カード共通 ===== */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
}

/* ===== KPIカード ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi-grid.cols3 { grid-template-columns: repeat(3, 1fr); }
.kpi-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); padding: 16px 18px;
  animation: kpi-enter 220ms var(--ease-out) both;
  width: 100%; text-align: left; font: inherit; color: inherit; display: block;
}
@keyframes kpi-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.kpi-top { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.kpi-icon {
  width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  background: var(--green-100); color: var(--green-700); flex: 0 0 auto;
}
.kpi-icon.amber { background: var(--amber-100); color: var(--amber-600); }
.kpi-icon.red { background: var(--red-100); color: var(--red-600); }
.kpi-icon.blue { background: var(--blue-100); color: var(--blue-600); }
.kpi-label { font-size: 12px; font-weight: 700; }
.kpi-value { display: block; font-size: 32px; font-weight: 800; line-height: 1.1; letter-spacing: -0.01em; }
.kpi-sub { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ===== 案件カード ===== */
.project-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.project-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); padding: 16px 18px; cursor: pointer;
  transition: border-color 150ms ease, transform 150ms var(--ease-out);
  animation: kpi-enter 220ms var(--ease-out) both;
  width: 100%; text-align: left; font: inherit; color: inherit; display: block;
}
@media (hover: hover) and (pointer: fine) {
  .project-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
}
.project-card:active { transform: scale(0.99); }
.project-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.project-name { font-weight: 800; font-size: 13.5px; }
.project-meta { font-size: 11.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.project-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.project-open-count { font-size: 11.5px; font-weight: 700; color: var(--green-700); }
.project-open-count.zero { color: var(--muted); font-weight: 500; }
.arrow { color: var(--muted); font-weight: 700; }

/* ===== ステータスピル / バッジ ===== */
.pill { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.st-active   { background: var(--blue-100); color: var(--blue-600); }
.st-estimate { background: var(--amber-100); color: var(--amber-600); }
.st-closing  { background: var(--green-100); color: var(--green-700); }
.st-done     { background: #eef1f0; color: var(--muted); }
.pill.open   { background: var(--amber-100); color: var(--amber-600); }
.pill.done   { background: var(--green-100); color: var(--green-700); }

.pt { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.pt-client   { background: var(--blue-100); color: var(--blue-600); }
.pt-subcon   { background: var(--amber-100); color: var(--amber-600); }
.pt-worker   { background: #f0ebfa; color: #6741d9; }
.pt-internal { background: #eef1f0; color: var(--muted); }
.pt-unknown  { background: var(--green-100); color: var(--green-700); }

.future-chip {
  display: inline-block; font-size: 9.5px; font-weight: 700; color: var(--muted);
  border: 1px dashed var(--line-strong); border-radius: 999px; padding: 1px 8px; margin-left: 6px;
}

/* ラベルチップ（Gmail風） */
.label-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 9.5px; font-weight: 700; padding: 2px 8px; border-radius: 6px;
  border: 1px solid transparent; white-space: nowrap;
}
.label-chip .x { cursor: pointer; opacity: 0.7; font-weight: 800; }
.label-chip .x:hover { opacity: 1; }

/* ===== テーブル ===== */
.table-card { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 560px; }
.data-table th, .data-table td { padding: 11px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table th {
  font-size: 10.5px; color: var(--muted); font-weight: 700; letter-spacing: 0.06em;
  background: var(--surface); position: sticky; top: 0;
}
.data-table td.strong { font-weight: 700; }
.data-table tbody tr { transition: background-color 150ms ease; }
@media (hover: hover) and (pointer: fine) {
  .data-table tbody tr.clickable:hover { background: var(--green-50); cursor: pointer; }
}
.channel-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.channel-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.id-chip {
  display: inline-block; font-size: 10px; color: var(--muted);
  background: var(--canvas); border: 1px solid var(--line); border-radius: 5px;
  padding: 1px 7px; margin: 1px 3px 1px 0; white-space: nowrap;
}
.note-cell { color: var(--muted); font-size: 11.5px; }
.kintone-id { font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; color: var(--muted); }
.rule-chip {
  display: inline-block; font-size: 10.5px; color: var(--ink);
  background: var(--canvas); border: 1px solid var(--line); border-radius: 6px;
  padding: 2px 9px; margin: 2px 4px 2px 0; white-space: nowrap;
  font-family: "SFMono-Regular", Consolas, monospace;
}

/* ===== チャネル設定 ===== */
.channel-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.channel-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 6px;
  animation: kpi-enter 220ms var(--ease-out) both;
}
.channel-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.channel-name { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 13.5px; }
.channel-account { font-size: 12px; }
.channel-note { font-size: 11px; color: var(--muted); }
.channel-card .btn { align-self: flex-start; margin-top: 6px; }

.conn-badge { font-size: 10px; font-weight: 800; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.conn-badge.on { background: var(--green-100); color: var(--green-700); }
.conn-badge.off { background: #eef1f0; color: var(--muted); }

/* ===== 受信箱 ===== */
.inbox-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Gmail風検索 */
.inbox-search { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.inbox-search input {
  flex: 1; min-width: 240px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  padding: 9px 14px; font-size: 12.5px; color: var(--ink);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.inbox-search input:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px var(--focus-ring); }
.search-meta { font-size: 11.5px; color: var(--muted); font-weight: 700; white-space: nowrap; }

.filter-tabs { display: flex; gap: 4px; background: #e9efed; padding: 3px; border-radius: 10px; }
.tab {
  border: none; background: transparent; cursor: pointer;
  padding: 6px 14px; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: var(--muted);
  transition: background-color 150ms ease, color 150ms ease;
}
.tab.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(8,35,38,0.08); }
.tab span { margin-left: 4px; opacity: 0.75; }

.chip-row { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  padding: 5px 13px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: var(--muted);
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
@media (hover: hover) and (pointer: fine) { .chip:hover { border-color: var(--line-strong); } }
.chip.is-active { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.chip.label-filter { display: inline-flex; align-items: center; gap: 6px; }

/* Gmail同様: 一覧は全幅・1行=1件。クリックで詳細が一覧を置き換える（← 戻る付き） */
.inbox-grid { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.thread-list { overflow-y: auto; padding: 4px 0; }
.inbox-grid .thread-detail { display: none; }
.inbox-grid.detail-open .thread-list { display: none; }
.inbox-grid.detail-open .thread-detail { display: flex; flex: 1; }
.back-btn { display: inline-block; }

/* 行は button 要素（キーボードで開ける）。button既定スタイルを打ち消す */
.thread-item {
  display: grid;
  grid-template-columns: 56px 200px auto minmax(0, 1fr) 74px;
  align-items: center; gap: 10px;
  width: 100%; text-align: left; font: inherit; color: inherit;
  background: transparent; border: none;
  padding: 8px 16px; cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background-color 150ms ease;
  animation: thread-enter 200ms var(--ease-out) both;
}
.thread-item:focus-visible { outline-offset: -2px; }

/* チャネルチップ（一覧の視認性を上げる: ドット→名前入りチップ） */
.ch-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; padding: 3px 0; border-radius: 6px;
  font-size: 9.5px; font-weight: 800; color: #fff; letter-spacing: 0.04em;
  white-space: nowrap;
}
.thread-item:last-child { border-bottom: none; }
@keyframes thread-enter {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (hover: hover) and (pointer: fine) { .thread-item:hover { background: var(--canvas); } }
.thread-item.is-selected { background: var(--green-50); }

.thread-contact {
  font-size: 12.5px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.thread-badges { display: flex; gap: 4px; align-items: center; white-space: nowrap; }
.thread-line {
  display: flex; align-items: baseline; gap: 6px; min-width: 0;
  font-size: 12px; overflow: hidden; white-space: nowrap;
}
.thread-line .subj { font-weight: 700; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
.thread-line .prev { color: var(--muted); flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.draft-ind {
  font-size: 11px; font-weight: 800; color: var(--green-700);
  background: var(--green-100); border-radius: 6px; padding: 1px 7px;
}
.attach-ind { font-size: 12px; color: var(--muted); }
.attach-ind .n { font-size: 10px; font-weight: 700; }
.thread-time { font-size: 10.5px; color: var(--muted); text-align: right; }
.badge-draft {
  font-size: 9.5px; font-weight: 700; padding: 2px 8px; border-radius: 6px;
  background: var(--green-100); color: var(--green-700);
}
.project-chip {
  font-size: 9.5px; font-weight: 600; color: var(--muted);
  background: var(--canvas); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px;
  max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.thread-list-empty { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* 警告バナー（④接続ミスの保険） */
.alert-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--amber-100); border: 1px solid #ecd9a8; color: var(--amber-600);
  border-radius: var(--radius-md); padding: 11px 16px; margin-bottom: 16px;
  font-size: 12.5px; font-weight: 700;
  animation: kpi-enter 220ms var(--ease-out) both;
}
.alert-banner .alert-mark { font-weight: 800; flex: 0 0 auto; }
.alert-banner .alert-text { flex: 1 1 240px; min-width: 0; }
.alert-banner .btn { flex: 0 0 auto; }
.health-badge { font-size: 10px; font-weight: 800; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.health-badge.warn { background: var(--amber-100); color: var(--amber-600); }
.last-inbound { font-size: 10.5px; color: var(--muted); }

/* 詳細ペイン */
.thread-detail { overflow-y: auto; display: flex; flex-direction: column; }
.empty-state {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--muted); gap: 10px; padding: 40px; min-height: 300px;
}
.empty-icon { width: 40px; height: 40px; opacity: 0.35; }
.empty-state p { margin: 0; font-size: 12.5px; }

.detail-header {
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.back-btn {
  display: inline-block; align-self: flex-start;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 8px; padding: 5px 12px; font-size: 12px; font-weight: 700; cursor: pointer;
  transition: background-color 150ms ease, transform 100ms var(--ease-out);
  margin-bottom: 8px;
}
.back-btn:active { transform: scale(0.97); }
.detail-title { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.detail-title .name { font-size: 15px; font-weight: 800; }
.detail-title .meta { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px 8px; align-items: center; flex-wrap: wrap; }
.detail-actions-top { display: flex; gap: 8px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }
.label-picker {
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted);
  font-size: 11.5px; font-weight: 700; padding: 5px 8px; cursor: pointer; max-width: 130px;
}

.detail-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 13px; flex: 1; }
.msg { max-width: 80%; padding: 10px 13px; border-radius: 12px; font-size: 13px; white-space: pre-wrap; line-height: 1.65; }
.msg.partner { background: var(--canvas); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.staff { background: var(--navy-900); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg-time { font-size: 10px; margin-top: 4px; opacity: 0.65; }

/* ===== 添付（画像サムネイル・ファイル） ===== */
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.thumb {
  width: 108px; height: 82px; border-radius: 9px; overflow: hidden;
  border: 1px solid var(--line); background: var(--canvas); cursor: pointer;
  padding: 0; display: block; position: relative;
  transition: transform 150ms var(--ease-out), border-color 150ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .thumb:hover { border-color: var(--green-600); transform: translateY(-1px); }
}
.thumb:active { transform: scale(0.98); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .thumb-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(16,51,58,0.72); color: #fff;
  font-size: 9px; padding: 3px 6px; text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 9px;
  padding: 8px 12px; font-size: 11.5px; font-weight: 700; color: var(--ink);
  cursor: pointer; max-width: 240px;
  transition: background-color 150ms ease, transform 100ms var(--ease-out);
}
.file-chip:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { .file-chip:hover { background: var(--canvas); } }
.file-chip .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip .fsize { font-weight: 500; color: var(--muted); font-size: 10.5px; flex: 0 0 auto; }

.draft-attach-note {
  font-size: 10.5px; color: var(--green-700); font-weight: 700;
  margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}

/* ライトボックス（画像拡大） */
.lightbox {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(11,38,44,0.82);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 200ms var(--ease-out);
}
/* hidden 属性を .lightbox の display:flex より優先させる（付けないとタブ順・a11yツリーに残る） */
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox-inner {
  max-width: min(960px, 92vw); max-height: 88vh; display: flex; flex-direction: column; gap: 10px;
  transform: scale(0.97);
  transition: transform 200ms var(--ease-out);
}
.lightbox.is-open .lightbox-inner { transform: scale(1); }
.lightbox img {
  max-width: 100%; max-height: 76vh; object-fit: contain;
  border-radius: var(--radius-md); background: #fff; display: block;
}
.lightbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #fff; }
.lightbox-name { font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox-close {
  border: 1px solid rgba(255,255,255,0.35); background: transparent; color: #fff;
  border-radius: 8px; padding: 6px 13px; font-size: 12px; font-weight: 700; cursor: pointer;
  flex: 0 0 auto;
  transition: background-color 150ms ease, transform 100ms var(--ease-out);
}
.lightbox-close:active { transform: scale(0.97); }
.auto-ack-note {
  align-self: center; font-size: 10.5px; color: var(--muted);
  background: var(--green-50); border-radius: 999px; padding: 3px 12px; text-align: center;
}

/* AI下書きカード */
.draft-card {
  margin: 0 20px 18px; border: 1px solid var(--green-100); background: var(--green-50);
  border-radius: var(--radius-md); padding: 15px 17px;
  animation: draft-mount 200ms var(--ease-out) both;
}
@keyframes draft-mount {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}
.draft-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.draft-card-head .label {
  font-size: 10px; font-weight: 800; color: var(--green-700);
  letter-spacing: 0.12em; text-transform: uppercase;
}
.confidence { font-size: 9.5px; padding: 2px 8px; border-radius: 6px; font-weight: 700; }
.confidence.high { background: var(--green-100); color: var(--green-700); }
.confidence.medium { background: var(--amber-100); color: var(--amber-600); }
.confidence.low { background: var(--red-100); color: var(--red-600); }

.draft-textarea, .settings-card textarea {
  width: 100%; min-height: 130px; resize: vertical;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  padding: 10px 12px; font-size: 13px; line-height: 1.65; color: var(--ink);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.draft-textarea:focus, .settings-card textarea:focus, .settings-card select:focus, .search-input:focus, .label-picker:focus {
  outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px var(--focus-ring);
}
.draft-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ===== かんたん作成（Gmail「Help me write」相当: ざっくり書く→AIが敬語に） ===== */
.polish-row { display: flex; gap: 8px; }
.polish-row input {
  flex: 1; min-width: 0;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
  padding: 8px 12px; font-size: 12.5px; color: var(--ink);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.polish-row input:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px var(--focus-ring); }
.polish-row .btn { flex: 0 0 auto; }
.polish-hint { font-size: 10.5px; color: var(--muted); }

/* ===== チャネル別コンポーザー（各チャネルのネイティブUIに寄せる） ===== */
.composer { margin: 0 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.composer .draft-textarea { min-height: 90px; }
.composer-note {
  font-size: 11px; color: var(--muted);
  background: var(--canvas); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px;
}

/* ===== チャネル別メッセージ表示（ネイティブUIに寄せる） ===== */

/* LINE: トーク画面（青地・白/緑バブル・時刻と既読はバブルの脇） */
.thread-detail[data-channel="line"] .detail-body { background: #dfe8f4; }
.line-row { display: flex; align-items: flex-end; gap: 6px; }
.line-row.self { justify-content: flex-end; }
.line-row .msg { max-width: 72%; }
.thread-detail[data-channel="line"] .msg.partner { background: #ffffff; border-color: #ffffff; box-shadow: 0 1px 1px rgba(8,35,38,0.08); }
.thread-detail[data-channel="line"] .msg.staff { background: #06C755; color: #073b1f; }
.line-status { font-size: 9px; color: #6b7f99; line-height: 1.5; text-align: right; flex: 0 0 auto; white-space: nowrap; }
.thread-detail[data-channel="line"] .auto-ack-note { background: rgba(255,255,255,0.7); }

/* メール: Gmail風のメッセージカード（バブルではなくブロック） */
.email-subject { font-size: 15px; font-weight: 800; padding-bottom: 4px; }
.email-msg { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.email-msg.self { border-left: 3px solid var(--green-600); }
.em-head {
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 9px 14px; background: var(--canvas); border-bottom: 1px solid var(--line);
  font-size: 11px; color: var(--muted);
}
.em-head b { color: var(--ink); font-size: 11.5px; }
.em-body { padding: 12px 14px; font-size: 13px; white-space: pre-wrap; line-height: 1.7; }

/* Chatwork: 行形式（角アバター・名前+時刻・自分の発言は薄黄色） */
.cw-row { display: flex; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.cw-row:last-of-type { border-bottom: none; }
.cw-row.cw-self { background: #fdf6e0; border-radius: 8px; padding: 10px 10px; }
.cw-avatar {
  width: 30px; height: 30px; border-radius: 6px; flex: 0 0 auto;
  background: #e8595d; color: #fff; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.cw-row.cw-self .cw-avatar { background: var(--navy-900); }
.cw-main { min-width: 0; flex: 1; }
.cw-head { display: flex; gap: 8px; align-items: baseline; font-size: 11px; color: var(--muted); }
.cw-head b { color: var(--ink); font-size: 12px; }
.cw-body { font-size: 12.5px; white-space: pre-wrap; line-height: 1.7; margin-top: 2px; }

/* 電話: 通話ログ（録音バー＋文字起こし） */
.phone-msg { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.ph-head {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 14px; background: var(--navy-900); color: #fff; font-size: 11.5px; font-weight: 700;
}
.ph-play {
  width: 24px; height: 24px; border-radius: 50%; background: #fff; color: var(--navy-900);
  display: flex; align-items: center; justify-content: center; font-size: 10px; flex: 0 0 auto;
}
.ph-body { padding: 12px 14px; font-size: 12.5px; white-space: pre-wrap; line-height: 1.7; }
.ph-label { font-size: 10px; color: var(--muted); padding: 0 14px 10px; }

/* フォーム: 回答チケット */
.form-ticket { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.ft-head {
  padding: 9px 14px; background: var(--green-50); border-bottom: 1px solid var(--green-100);
  font-size: 11px; font-weight: 800; color: var(--green-700); letter-spacing: 0.08em;
}
.ft-row { display: flex; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.ft-row:last-child { border-bottom: none; }
.ft-row .k { width: 82px; flex: 0 0 auto; font-size: 11px; color: var(--muted); font-weight: 700; }
.ft-row .v { flex: 1; font-size: 12.5px; white-space: pre-wrap; line-height: 1.7; }

/* ===== AI編集アクション行（拡張可能なテキスト編集） ===== */
.ai-edit-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ai-edit-label { font-size: 10px; font-weight: 800; color: var(--green-700); letter-spacing: 0.08em; }
.ai-edit-btn {
  border: 1px solid var(--green-100); background: var(--surface); color: var(--green-700);
  border-radius: 999px; padding: 4px 12px; font-size: 11px; font-weight: 700; cursor: pointer;
  transition: background-color 150ms ease, transform 100ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .ai-edit-btn:hover { background: var(--green-50); } }
.ai-edit-btn:active { transform: scale(0.96); }

/* メール: 宛先/件名フィールド付きの作成画面風 */
.composer-email { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px 16px; background: var(--surface); }
.email-field { display: flex; gap: 10px; font-size: 12px; align-items: baseline; padding: 4px 0; border-bottom: 1px solid var(--line); }
.email-field .k { width: 40px; color: var(--muted); font-weight: 700; font-size: 11px; flex: 0 0 auto; }
.email-field .v { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-email .draft-textarea { border: none; padding: 10px 0 0; border-radius: 0; }
.composer-email .draft-textarea:focus { box-shadow: none; }

/* LINE: トーク画面風（丸い入力欄＋緑の送信） */
.thread-detail[data-channel="line"] .msg.partner { background: #eef9f1; border-color: #cdeeda; }
.thread-detail[data-channel="line"] .msg.staff { background: #06C755; color: #fff; }
.composer-line .draft-textarea { border-radius: 18px; min-height: 56px; }
.composer-line .btn.primary { background: #06C755; border-radius: 999px; padding: 9px 22px; }

/* Chatwork: [To]チップ付き */
.thread-detail[data-channel="chatwork"] .msg.partner { background: #fdf3f2; border-color: #f4d8d5; }
.to-chip {
  align-self: flex-start; font-size: 11px; font-weight: 700;
  background: #fdf1f0; color: #c2413b; border: 1px solid #f2d3d0;
  border-radius: 6px; padding: 3px 10px;
}

/* ===== ボタン ===== */
.btn {
  border: none; cursor: pointer; border-radius: 9px;
  padding: 9px 17px; font-size: 12.5px; font-weight: 700;
  transition: filter 150ms ease, background-color 150ms ease, transform 100ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--green-700); color: #fff; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
@media (hover: hover) and (pointer: fine) { .btn.secondary:hover { background: var(--canvas); } }
.btn.ghost-danger { background: transparent; color: var(--red-600); border: 1px solid transparent; }
@media (hover: hover) and (pointer: fine) { .btn.ghost-danger:hover { background: var(--red-100); } }
.btn.sm { padding: 6px 12px; font-size: 11.5px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ===== 検索 ===== */
.search-input {
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 13px;
  font-size: 12.5px; background: var(--surface); color: var(--ink); min-width: 230px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

/* ===== 設定 ===== */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-card { padding: 20px; }
.settings-card.span2 { grid-column: span 2; }
.settings-card h3 { margin: 0 0 5px; font-size: 14px; font-weight: 800; }
.card-lead { font-size: 11.5px; color: var(--muted); margin: 0 0 13px; }
.settings-card label { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; margin: 12px 0 5px; }
.settings-card textarea { min-height: 72px; }
.settings-card select {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--ink); padding: 9px 11px; font-size: 12.5px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.settings-actions { margin-top: 14px; }

/* ===== 案件詳細: タイムライン ===== */
.timeline { padding: 6px 0; }
.tl-day {
  font-size: 10px; font-weight: 800; color: var(--muted);
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 12px 18px 6px; border-bottom: 1px solid var(--line);
}
.tl-item {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) 74px;
  gap: 10px; align-items: start;
  padding: 10px 18px; border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background-color 150ms ease;
  animation: thread-enter 200ms var(--ease-out) both;
}
.tl-item:focus-visible { outline-offset: -2px; }
.tl-open {
  border: 1px solid var(--line); background: var(--surface); color: var(--green-700);
  border-radius: 7px; padding: 3px 9px; font-size: 11px; font-weight: 700; cursor: pointer;
  transition: background-color 150ms ease;
}
@media (hover: hover) and (pointer: fine) { .tl-open:hover { background: var(--green-50); } }
.row-open {
  border: 1px solid var(--line); background: var(--surface); color: var(--green-700);
  border-radius: 7px; padding: 3px 10px; font-size: 11px; font-weight: 700; cursor: pointer;
  transition: background-color 150ms ease;
}
@media (hover: hover) and (pointer: fine) { .row-open:hover { background: var(--green-50); } }
.tl-item:last-child { border-bottom: none; }
@media (hover: hover) and (pointer: fine) { .tl-item:hover { background: var(--green-50); } }
.tl-content { min-width: 0; }
.tl-sender { font-size: 12px; font-weight: 800; }
.tl-sender .tl-self { color: var(--green-700); }
.tl-text { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tl-thumbs { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.tl-thumbs .thumb { width: 72px; height: 54px; }
.tl-time { font-size: 10.5px; color: var(--muted); text-align: right; }

/* 案件詳細: 写真ギャラリー */
.gallery-card { padding: 16px 18px; }
.gallery-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.gallery-grid .thumb { width: 128px; height: 96px; }
.gallery-empty { font-size: 12px; color: var(--muted); padding: 8px 0; }
.gallery-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ===== 承認キュー ===== */
.kpi-card.clickable { cursor: pointer; transition: border-color 150ms ease, transform 150ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .kpi-card.clickable:hover { border-color: var(--line-strong); transform: translateY(-1px); }
}
.kpi-card.clickable:active { transform: scale(0.99); }

.queue-modal {
  position: fixed; inset: 0; z-index: 65;
  background: rgba(11,38,44,0.5);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.queue-modal[hidden] { display: none; }
.queue-card {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: 0 20px 60px rgba(5,28,32,0.28);
  width: min(720px, 94vw); max-height: 90vh; overflow-y: auto;
  padding: 22px 24px; display: flex; flex-direction: column; gap: 14px;
  animation: draft-mount 200ms var(--ease-out) both;
}
.queue-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.queue-head h2 { margin: 0; font-size: 18px; font-weight: 800; }
.queue-head-right { display: flex; align-items: center; gap: 10px; }
.queue-progress { font-size: 12.5px; font-weight: 800; color: var(--green-700); background: var(--green-50); border-radius: 999px; padding: 4px 13px; }
.queue-body { display: flex; flex-direction: column; gap: 10px; }
.queue-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.queue-meta .name { font-size: 14px; font-weight: 800; }
.queue-msg {
  background: var(--canvas); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 14px; font-size: 12.5px; white-space: pre-wrap; line-height: 1.6;
  max-height: 150px; overflow-y: auto;
}
.queue-draft-label {
  font-size: 10px; font-weight: 800; color: var(--green-700);
  letter-spacing: 0.12em; text-transform: uppercase;
  display: flex; align-items: center; justify-content: space-between;
}
.queue-body .draft-textarea { min-height: 150px; background: var(--green-50); border-color: var(--green-100); }
.queue-body .draft-textarea:focus { background: var(--surface); }
.queue-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.queue-keys { font-size: 10.5px; color: var(--muted); }

/* ===== トースト（transitionのみ・keyframes不使用） ===== */
.toast-region {
  position: fixed; right: 24px; bottom: 24px; z-index: 60;
  display: flex; flex-direction: column-reverse; gap: 8px; pointer-events: none;
}
.toast {
  background: var(--navy-900); color: #fff; padding: 11px 17px; border-radius: 10px;
  font-size: 12.5px; font-weight: 700; box-shadow: 0 8px 24px rgba(5,28,32,0.24);
  opacity: 0; transform: translateY(100%);
  transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out);
  pointer-events: auto; max-width: 86vw;
  display: flex; align-items: center; gap: 14px;
}
.toast-undo {
  border: 1px solid rgba(255,255,255,0.4); background: transparent; color: #fff;
  border-radius: 7px; padding: 4px 12px; font-size: 11.5px; font-weight: 800; cursor: pointer;
  flex: 0 0 auto;
  transition: background-color 150ms ease, transform 100ms var(--ease-out);
}
.toast-undo:hover { background: rgba(255,255,255,0.14); }
.toast-undo:active { transform: scale(0.96); }
.toast.is-mounted { opacity: 1; transform: translateY(0); }
.toast.is-leaving { transition-duration: 180ms; opacity: 0; transform: translateY(6px); }

/* ===== reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .view, .kpi-card, .project-card, .channel-card, .thread-item, .draft-card, .toast, .btn, .nav-item, .sidebar {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ===== レスポンシブ（タブレット） ===== */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .project-cards, .channel-cards { grid-template-columns: 1fr; }
  .kpi-grid.cols3 { grid-template-columns: 1fr; }
}

/* ===== レスポンシブ（モバイル: ドロワー + 一覧⇄詳細スタック） ===== */
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }

  /* サイドバー → オフキャンバスドロワー（transformのみでアニメーション） */
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(280px, 82vw); z-index: 50;
    transform: translateX(-102%);
    transition: transform 220ms var(--ease-out);
    box-shadow: none;
  }
  .app-shell.drawer-open .sidebar { transform: translateX(0); box-shadow: 0 0 60px rgba(5,28,32,0.3); }
  .drawer-overlay {
    display: block; position: fixed; inset: 0; z-index: 40;
    background: rgba(11,38,44,0.4); opacity: 0; pointer-events: none;
    transition: opacity 220ms ease;
  }
  .app-shell.drawer-open .drawer-overlay { opacity: 1; pointer-events: auto; }

  .menu-btn { display: flex; }
  .user-meta small { display: none; }
  .topbar { padding: 0 12px; }

  .view { padding: 16px 14px 32px; }
  .page-head h1 { font-size: 18px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-value { font-size: 26px; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-card.span2 { grid-column: span 1; }
  .search-input { min-width: 0; width: 100%; }
  .page-head .btn { width: 100%; }
  .filter-tabs { width: 100%; }
  .filter-tabs .tab { flex: 1; text-align: center; }

  /* 受信箱: モバイルは1件=2行（相手+時刻 / 件名+バッジ）に折り返す */
  .thread-item {
    grid-template-columns: 56px minmax(0, 1fr) 74px;
    grid-template-areas: "dot name time" ". line line" ". badges badges";
    row-gap: 3px; padding: 10px 14px;
  }
  .thumb { width: 88px; height: 68px; }
  .lightbox { padding: 12px; }
  .thread-item .ch-chip { grid-area: dot; align-self: start; }
  .thread-contact { grid-area: name; }
  .thread-time { grid-area: time; }
  .thread-line { grid-area: line; }
  .thread-badges { grid-area: badges; flex-wrap: wrap; white-space: normal; }
  .thread-list { max-height: none; }
  /* 件名がある行は件名を優先（本文プレビューで件名が潰れるのを防ぐ） */
  .thread-line .subj + .prev { display: none; }
  /* スレッドを開いている間は一覧用のフィルタUIを畳んで本文の領域を確保する */
  #view-inbox.detail-open .page-head,
  #view-inbox.detail-open .inbox-search,
  #view-inbox.detail-open .chip-row { display: none; }
  .detail-header { flex-direction: column; }
  .detail-actions-top { justify-content: flex-start; }
  .msg { max-width: 92%; }
  .draft-card { margin: 0 12px 14px; }
  .composer { margin: 0 12px 16px; }
  .polish-row { flex-direction: column; }
  .inbox-head-actions { width: 100%; }
  .inbox-head-actions .btn { flex: 1; }
  .tl-item { grid-template-columns: 48px minmax(0, 1fr) 60px; padding: 10px 12px; }
  .gallery-grid .thumb { width: 96px; height: 72px; }
  .queue-card { padding: 16px 14px; }
  .queue-actions .btn { flex: 1; }
  .toast-region { right: 12px; bottom: 12px; left: 12px; align-items: center; }
}
