/* HostDuet オーナーのアプリ (v0: 受信箱・下書き・ログイン・招待を受ける画面・通知の行)。見本 (relvetia の報告 2026-11-26-owner-app/mock/app.css) から、2 画面に要る所だけを写した。
   色と字はホームページ (site/style.css) の token をそのまま使う。site の約束 (枠・罫線・影・角丸・gradient を使わない) を守り、押せる所だけ面 (--raised / --accent) で区別する (設計書 §7-3)。
   M3 からは規則だけ借りる: 押せる所は 48px 以上・主操作は Filled 1 つ・色だけで状態を伝えない。 */
:root {
  --u: 8px;
  --bg: #0f0e0c;
  --plane: #1a1815;
  --text: #ede8e0;
  --muted: #a8a093;
  --faint: #948c80;
  --accent: #e0aa62;
  --on-accent: #17130d;
  --raised: #2a2622;
  --raised-2: #3a352d;
  --mine: #3b2f20;
  --danger: #ff8f7a;     /* site の token (緊急だけに使う)。色だけで伝えないよう ▲ と「緊急」の語も残す */
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-md: 16px;
  --fs-body: 17px;
  --fs-lg: 20px;
  --tap: 48px;
  --sans: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", "Helvetica Neue", Arial, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", sans-serif;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--fs-body)/1.7 var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
h1, h2, p, fieldset { margin: 0; padding: 0; }
h1, h2 { text-wrap: balance; }
fieldset { border: 0; min-width: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nw { white-space: nowrap; }  /* 和文の最後の句を包む (最後の行が 1〜2 字にならないように) */
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }

/* ── 骨組み ── */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: var(--u);
  padding: calc(env(safe-area-inset-top) + var(--u)) calc(env(safe-area-inset-right) + 16px) var(--u) calc(env(safe-area-inset-left) + 16px);
  min-height: 56px; max-width: 720px; margin: 0 auto; background: var(--bg); }   /* 広い幅でも本文 (main) と同じ列に揃える */
.logo { font-size: var(--fs-lg); font-weight: 600; line-height: 1.3; }
main { display: flex; flex-direction: column; gap: calc(var(--u) * 2); max-width: 720px; margin: 0 auto;
  padding: var(--u) calc(env(safe-area-inset-right) + 16px) calc(env(safe-area-inset-bottom) + 32px) calc(env(safe-area-inset-left) + 16px); }
main:focus { outline: none; }
.stack { display: flex; flex-direction: column; gap: calc(var(--u) * 2); }   /* p + p の margin を使わず gap で間をとる */
.stack.tight { gap: var(--u); }
h2 { font-size: var(--fs-md); font-weight: 600; color: var(--muted); line-height: 1.4; }
h2.count { font-variant-numeric: tabular-nums; }

/* ── ボタン。主 = Filled (accent)、副 = 面 (raised)、弱 = 文字だけ。どれも 48px 以上 ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--u); min-height: var(--tap); min-width: var(--tap);
  padding: 0 20px; border: 0; border-radius: 0; font: 600 var(--fs-md)/1.3 var(--sans); cursor: pointer; text-decoration: none; }
.btn.filled { background: var(--accent); color: var(--on-accent); }
.btn.tonal { background: var(--raised); color: var(--text); }
.btn.text { background: none; color: var(--text); text-decoration: underline; text-underline-offset: .35em; text-decoration-color: var(--faint); padding: 0 12px; }
.btn:disabled { opacity: .45; cursor: default; }
/* 押した手応え。tap の既定の反応を消している (body) ので、面の色を 1 段変える。縮むのは動きを減らす設定でないときだけ (下の media) */
.btn.filled:active:not(:disabled) { filter: brightness(.88); }
.btn.tonal:active:not(:disabled) { background: var(--raised-2); }
.btn.text:active:not(:disabled) { background: var(--raised); }
.err { font-size: var(--fs-sm); color: var(--text); }   /* 欄の下に出す直し方。緊急の色 (--danger) は使わない */
.err::before { content: "! "; font-weight: 700; color: var(--accent); }
.actions { display: flex; flex-direction: column; gap: var(--u); padding-top: var(--u); }
.actions .btn.text { align-self: flex-start; }
.row { display: flex; flex-wrap: wrap; gap: var(--u); align-items: center; }
.row > .btn.text:first-child { margin-left: -12px; }   /* 文字だけのボタン (ログアウト・通知をやめる) の字を本文の左端に揃える */
@media (min-width: 600px) { .actions { flex-direction: row; flex-wrap: wrap; align-items: center; } }

/* 空の受信箱の「読み直す」(見本の chip の形) */
.chip { flex: none; min-height: var(--tap); padding: 0 12px; border: 0; background: var(--plane); color: var(--muted); font: 500 var(--fs-sm)/1 var(--sans); cursor: pointer; }
.chip:active { background: var(--raised); }

/* ── 一覧 (list item。card にしない) ── */
.list { display: flex; flex-direction: column; gap: 4px; }
.item { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 14px 16px; min-height: 72px; background: var(--plane); color: var(--text);
  font-size: var(--fs-md); text-decoration: none; }
.item:active { background: var(--raised); }
.item .head { display: flex; align-items: baseline; gap: var(--u); font-size: var(--fs-sm); color: var(--muted); }
.item .head .who { color: var(--text); font-weight: 600; }
.item .head .when { margin-left: auto; flex: none; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.item .quote { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.6; }
.item .note { font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }

/* 状態の札。いつも語と印で (色だけにしない) */
.tag { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; padding: 1px 7px; background: var(--raised-2); color: var(--text); line-height: 1.6; }
.tag.urgent { background: var(--danger); color: var(--bg); font-size: var(--fs-sm); font-weight: 700; }  /* 緊急だけ --danger の面。▲ と「緊急」の語でも伝える */
.tag.wait::before { content: "●"; color: var(--accent); }

.empty { padding: calc(var(--u) * 4) 0; color: var(--muted); text-align: center; }
div.empty { display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 2); }
.info { padding: 10px 14px; background: var(--plane); font-size: var(--fs-sm); color: var(--muted); }
.info::before { content: "ⓘ "; color: var(--accent); }

/* ── 下書きの画面 ── */
.back { display: inline-flex; align-items: center; gap: 4px; min-height: var(--tap); margin-left: -12px; padding: 0 12px; color: var(--text); text-decoration: none; font-size: var(--fs-md); }
.meta { font-size: var(--fs-sm); color: var(--muted); }
.label { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.bubble { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-md); line-height: 1.75; padding: 12px 14px; background: var(--raised); }
.bubble.guest { background: var(--mine); }
.hint { font-size: var(--fs-xs); color: var(--muted); line-height: 1.6; }
textarea, input[type="text"] { width: 100%; font: 400 var(--fs-md)/1.75 var(--sans); color: var(--text); background: var(--raised); border: 0; padding: 12px 14px; border-radius: 0; }
textarea { min-height: 240px; resize: vertical; }
textarea:focus, input[type="text"]:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.count { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.deadline { font-size: var(--fs-sm); color: var(--text); font-variant-numeric: tabular-nums; }
.deadline::before { content: "◷ "; color: var(--accent); }

/* 結果の帯 (画面の上に残る。消えない) */
.status { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--raised); }
.status strong { font-size: var(--fs-lg); line-height: 1.4; }
.status .row { padding-top: 4px; }
.status.ok strong::before { content: "✓ "; color: var(--accent); }
.status.warn strong::before { content: "? "; color: var(--accent); }
.status.skip strong::before { content: "– "; }
.status.busy strong::before { content: "… "; }

/* 設定の行 (通知)。帯と同じ並びで、面は一覧と同じ --plane */
.panel { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--plane); }
.panel strong { font-size: var(--fs-md); line-height: 1.5; }
.panel .row { padding-top: 4px; }

/* ── snackbar と bottom sheet ── */
.snack { position: fixed; z-index: 9; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 16px); padding: 14px 16px;
  background: var(--text); color: var(--bg); font-size: var(--fs-md); font-weight: 600; }
@media (min-width: 840px) { .snack { left: 24px; right: auto; width: 480px; bottom: 24px; } }
.scrim { position: fixed; inset: 0; z-index: 10; background: rgba(0, 0, 0, .6); }
.sheet { position: fixed; z-index: 11; left: 0; right: 0; bottom: 0; max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px;
  padding: 20px 16px calc(env(safe-area-inset-bottom) + 16px); background: var(--plane); }
.sheet h2 { font-size: var(--fs-lg); color: var(--text); }
.sheet p { font-size: var(--fs-sm); }
.reasons { display: flex; flex-direction: column; gap: 4px; }
.reasons label { display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: 0 12px; background: var(--raised); font-size: var(--fs-md); cursor: pointer; }
.reasons input[type="radio"] { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
[hidden] { display: none !important; }

/* 動き。動きを減らす設定では何も動かさない (出入りは瞬間。.out は app.js がその設定のとき付けない) */
@media (prefers-reduced-motion: no-preference) {
  .btn { transition: transform 100ms ease-out; }
  .btn:active:not(:disabled) { transform: scale(.97); }
  .snack:not([hidden]) { animation: up .18s ease-out; }
  .snack.out { animation: down .15s ease-out forwards; }
  .sheet:not([hidden]) { animation: rise .2s ease-out; }
  .sheet.out { animation: sink .15s ease-out forwards; }
  .scrim:not([hidden]) { animation: show .2s ease-out; }
  .scrim.out { animation: fade .15s ease-out forwards; }
  @keyframes up { from { transform: translateY(8px); opacity: 0; } }
  @keyframes down { to { transform: translateY(8px); opacity: 0; } }
  @keyframes rise { from { transform: translateY(100%); } }
  @keyframes sink { to { transform: translateY(100%); } }
  @keyframes show { from { opacity: 0; } }
  @keyframes fade { to { opacity: 0; } }
}
