/* =====================================================================
   THE POAi — チャット画面(1画面アプリ)
   デザインは仕様書「アナスタアプリ仕様_画像02」に合わせる。主役は POA のマーク。
   ===================================================================== */
/* THE POAi: 明るいオレンジ(ログイン)× 黄〜桃のグラデーション(チャット)× 琥珀ブラウン(通話)。
   トークン名は従来のまま(lacquer=主色、brass=アクセント)にして、各画面のクラスはそのまま使う。 */
:root {
  --ink: #2B1D0C;
  --ink-2: #66492A;
  --ink-3: #94744F;
  --line: #F0DDC2;
  --line-2: #FAEEDC;
  --porcelain: #FFF8EE;
  --paper: #FFFFFF;
  --lacquer: #8A5300;
  --lacquer-2: #A86500;
  --lacquer-soft: #FFF0D6;
  --brass: #B77100;
  --brass-2: #FFA300;
  --brass-soft: #FFF1DC;
  --rust: #C23A1C;
  --rust-soft: #FDE7DF;
  /* 相談の一覧の区分(計画書 docs/plan-poai-feedback-I.md 3.5): スタッフ=青・AI=橙 */
  --conv-staff: #2F5F8F;
  --conv-ai: #B5651D;
  --ok: #4C7A1E;
  --user-bubble: #FF9700;
  --user-ink: #2B1D0C;
  --on-accent: #FFFFFF;
  /* THE POAi 固有の色 */
  --poa-orange: #FFA300;
  --poa-orange-2: #FF9700;
  --poa-amber: #B77100;
  --poa-amber-2: #CD8E29;
  --poa-olive: #93700F;
  --poa-cream: #FCE7D2;
  --poa-gold: #F3C14B;
  --poa-peach: #FFD38A;
  --poa-mark: #000000;
  --chat-top: #FFE7A6;
  --chat-bottom: #FFB89C;
  --shadow-1: 0 1px 2px rgba(120, 70, 0, .07), 0 6px 18px rgba(120, 70, 0, .07);
  --shadow-2: 0 18px 48px rgba(90, 50, 0, .2);
  --sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "Noto Serif CJK JP", "Source Han Serif JP", "BIZ UDPMincho", serif;
  --brand-font: "Helvetica Neue", Helvetica, Arial, var(--sans);
  --side-w: 272px;
  --drawer-w: 408px;
  --col: 760px;
  --fs: 15.5px;
  color-scheme: light;
}
html[data-font="large"] { --fs: 17.5px; }

html[data-theme="dark"] {
  --ink: #FBEEDC; --ink-2: #D9BE98; --ink-3: #A88A64; --line: #4A3420; --line-2: #36261A;
  --porcelain: #1B130B; --paper: #271B10; --lacquer: #FFB547; --lacquer-2: #FFC46E; --lacquer-soft: #3A2814;
  --brass: #FFB547; --brass-2: #FFC46E; --brass-soft: #34230F; --rust: #FF9B80; --rust-soft: #3E1F16; --ok: #A8D27A; --conv-staff: #8DB4DC; --conv-ai: #E8A066;
  --user-bubble: #E88A00; --user-ink: #1B130B; --on-accent: #1B130B;
  --poa-mark: #FBEEDC; --chat-top: #2C1E0C; --chat-bottom: #3A1F16; --poa-cream: #3A2A1A;
  --shadow-1: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25); --shadow-2: 0 18px 48px rgba(0,0,0,.5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --ink: #FBEEDC; --ink-2: #D9BE98; --ink-3: #A88A64; --line: #4A3420; --line-2: #36261A;
    --porcelain: #1B130B; --paper: #271B10; --lacquer: #FFB547; --lacquer-2: #FFC46E; --lacquer-soft: #3A2814;
    --brass: #FFB547; --brass-2: #FFC46E; --brass-soft: #34230F; --rust: #FF9B80; --rust-soft: #3E1F16; --ok: #A8D27A; --conv-staff: #8DB4DC; --conv-ai: #E8A066;
    --user-bubble: #E88A00; --user-ink: #1B130B; --on-accent: #1B130B;
    --poa-mark: #FBEEDC; --chat-top: #2C1E0C; --chat-bottom: #3A1F16; --poa-cream: #3A2A1A;
    --shadow-1: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25); --shadow-2: 0 18px 48px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}

/* ---------- 基本 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body.cx-body { margin: 0; font-family: var(--sans); font-size: var(--fs); line-height: 1.75; color: var(--ink); background: var(--porcelain); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; opacity: .5; }
a { color: var(--lacquer-2); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--brass-2); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { display: block; flex: 0 0 auto; }
input[type=text], input:not([type]), input[type=number], input[type=email], input[type=tel], input[type=password], input[type=search], input[type=url], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: var(--paper);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--lacquer-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lacquer-2) 18%, transparent); }

.icon-btn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--ink-2); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.badge { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; background: var(--brass); color: var(--on-accent); font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; }
.badge-quiet { background: var(--lacquer-soft); color: var(--lacquer-2); }
.link-btn { color: var(--ink-3); font-size: 13px; }
.link-btn:hover { color: var(--ink); text-decoration: underline; }

/* ---------- 印章(コンシェルジュの印) ---------- */
.seal { display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 50%; font-family: var(--serif); color: var(--brass); background: var(--paper); border: 1px solid color-mix(in srgb, var(--brass) 55%, transparent); box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px color-mix(in srgb, var(--brass) 30%, transparent); line-height: 1; }
.seal-sm { width: 32px; height: 32px; font-size: 15px; }
.seal-lg { width: 76px; height: 76px; font-size: 34px; box-shadow: inset 0 0 0 5px var(--paper), inset 0 0 0 6px color-mix(in srgb, var(--brass) 35%, transparent); }

/* ---------- 全体の骨組み ---------- */
.cx { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; transition: grid-template-columns .22s ease; }
.cx[data-side="closed"] { grid-template-columns: 0 minmax(0, 1fr); }
.cx[data-side="closed"] .cx-side { visibility: hidden; }
.cx-scrim, .drawer-scrim { display: none; }

/* ---------- 会話の一覧 ---------- */
.cx-side { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--paper); border-right: 1px solid var(--line); }
.cx-side-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 8px 18px; }
.cx-brand { font-weight: 700; letter-spacing: .02em; color: var(--ink); text-decoration: none; font-size: 15px; }
.cx-brand span { font-family: var(--serif); font-weight: 500; color: var(--brass); margin-left: 2px; }
.cx-new { display: flex; align-items: center; gap: 8px; margin: 6px 12px 10px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; background: var(--paper); transition: border-color .15s, background .15s; }
.cx-new:hover { border-color: var(--lacquer-2); background: var(--lacquer-soft); }
.cx-convs { flex: 1; overflow-y: auto; padding: 2px 8px 12px; }
.conv { position: relative; display: flex; align-items: center; border-radius: 10px; }
.conv:hover, .conv:focus-within { background: var(--line-2); }
.conv.is-current { background: var(--lacquer-soft); }
.conv.is-current::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--brass); }
.conv-link { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; padding: 9px 4px 9px 12px; color: var(--ink); text-decoration: none; font-size: 14px; }
.conv-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-when { flex: 0 0 auto; font-size: 11.5px; color: var(--ink-3); }
.conv-more { display: grid; place-items: center; width: 30px; height: 30px; margin-right: 4px; border-radius: 8px; color: var(--ink-3); opacity: 0; }
.conv:hover .conv-more, .conv:focus-within .conv-more, .conv.is-current .conv-more { opacity: 1; }
.conv-more:hover { background: var(--paper); color: var(--ink); }
.conv-rename { flex: 1; margin: 4px; padding: 6px 10px; font-size: 14px; }
.cx-side-empty { padding: 10px 12px; color: var(--ink-3); font-size: 13px; }
.cx-side-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); }
.cx-me { display: grid; text-align: left; min-width: 0; padding: 4px 6px; border-radius: 8px; }
.cx-me:hover { background: var(--line-2); }
.cx-me-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-me-plan { font-size: 11.5px; color: var(--ink-3); }

.conv-menu { position: fixed; z-index: 60; min-width: 168px; padding: 6px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-2); }
.conv-menu button { display: block; width: 100%; text-align: left; padding: 8px 12px; border-radius: 8px; font-size: 14px; }
.conv-menu button:hover, .conv-menu button:focus-visible { background: var(--line-2); }
.conv-menu button[data-conv-action="archive"] { color: var(--rust); }

/* ---------- 上部バー ---------- */
.cx-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.cx-top { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 14px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--porcelain) 88%, transparent); backdrop-filter: saturate(1.2) blur(10px); }
.cx[data-side="open"] .cx-side-toggle { display: none; }
.cx-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cx-who-text { display: grid; line-height: 1.25; min-width: 0; }
.cx-who-name { font-family: var(--serif); font-weight: 600; font-size: 17px; letter-spacing: .06em; }
.cx-who-title { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-topic { flex: 1; min-width: 0; margin: 0 0 0 10px; padding-left: 14px; border-left: 1px solid var(--line); color: var(--ink-2); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-topic:empty { border-left: 0; }
.cx-top-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.balance-chip { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); margin-right: 4px; }
.balance-chip .ic { color: var(--brass); }
.balance-chip:hover { border-color: var(--brass-2); }
.cmd-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 12px; margin-left: 4px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); color: var(--ink-2); font-size: 13.5px; }
.cmd-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.cmd-btn kbd { font-family: var(--sans); font-size: 11px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; line-height: 18px; }

/* ---------- お知らせ ---------- */
.cx-alerts { display: grid; gap: 8px; padding: 0 20px; }
.cx-alerts:not(:empty) { padding-top: 12px; }
.alert { max-width: var(--col); width: 100%; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 10px 14px; border-radius: 12px; background: var(--lacquer-soft); color: var(--lacquer-2); font-size: 13.5px; }
.alert-warn { background: var(--rust-soft); color: var(--rust); }
.alert-action { flex: 0 0 auto; padding: 6px 12px; border-radius: 8px; background: var(--rust); color: var(--on-accent); text-decoration: none; font-weight: 600; }

/* ---------- 会話本文 ---------- */
.cx-scroll { flex: 1; min-height: 0; overflow-y: auto; scroll-behavior: smooth; overscroll-behavior: contain; }
.thread { max-width: calc(var(--col) + 48px); margin: 0 auto; padding: 28px 24px 24px; display: flex; flex-direction: column; gap: 18px; min-height: 100%; }

.empty { margin: auto 0; padding: 4vh 0 2vh; display: flex; flex-direction: column; align-items: flex-start; animation: cx-rise .7s cubic-bezier(.2,.7,.2,1) both; }
.empty-hello { margin: 22px 0 4px; font-family: var(--serif); font-size: clamp(26px, 4.2vw, 38px); line-height: 1.35; letter-spacing: .04em; color: var(--ink); }
.empty-title { margin: 0 0 14px; font-family: var(--serif); font-weight: 500; font-size: clamp(16px, 2vw, 19px); color: var(--brass); letter-spacing: .08em; }
.empty-lead { margin: 0 0 26px; max-width: 34em; color: var(--ink-2); }
.starters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; }
.starter { display: grid; gap: 2px; text-align: left; padding: 14px 16px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); transition: border-color .15s, transform .15s, box-shadow .15s; }
.starter:hover { border-color: var(--brass-2); box-shadow: var(--shadow-1); transform: translateY(-1px); }
.starter-label { font-weight: 600; font-size: 14.5px; }
.starter-text { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.day-sep { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 12px; }
.day-sep::before, .day-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.m { display: flex; gap: 12px; align-items: flex-start; }
.m-body { min-width: 0; }
.m-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.m-name { font-family: var(--serif); font-weight: 600; font-size: 14px; letter-spacing: .06em; }
.m-time { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.m-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.m-meta { margin-top: 4px; font-size: 11px; color: var(--ink-3); }
.m-ai .m-avatar { margin-top: 2px; }
.m-ai .m-body { flex: 1; max-width: 66ch; }
.m-ai .m-text { line-height: 1.95; }
.m-ai.is-new { animation: cx-rise .45s ease-out both; }

.m-user { justify-content: flex-end; }
.m-user .m-body { display: flex; flex-direction: column; align-items: flex-end; max-width: min(80%, 56ch); }
.m-user .m-text { padding: 10px 15px; border-radius: 18px 18px 6px 18px; background: var(--user-bubble); color: var(--user-ink); }
.m-user .m-time { margin-top: 3px; }
.pending-user { opacity: .75; }

.m-desk .m-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brass-soft); color: var(--brass); }
.m-desk .m-body { flex: 1; padding: 10px 14px; border-radius: 4px 14px 14px 14px; background: var(--brass-soft); }
.m-desk .m-name { color: var(--brass); font-family: var(--sans); font-size: 12px; letter-spacing: .02em; }

.notice { margin-left: 44px; align-self: flex-start; padding: 6px 12px; border-radius: 8px; background: var(--rust-soft); color: var(--rust); font-size: 13px; }

/* 考え中 */
.m.thinking .m-body { display: inline-flex; align-items: center; gap: 10px; padding-top: 5px; color: var(--ink-2); font-size: 14px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--brass); opacity: .25; animation: cx-dot 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
.request-timeout .m-body { padding: 10px 14px; border-radius: 12px; background: var(--rust-soft); color: var(--rust); font-size: 14px; }

/* 候補カード */
.cards-wrap { margin-left: 44px; display: grid; gap: 6px; }
.cards { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 248px); gap: 10px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.card { scroll-snap-align: start; display: flex; flex-direction: column; gap: 3px; padding: 14px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.card-photo { width: calc(100% + 28px); margin: -14px -14px 8px; height: 120px; object-fit: cover; border-radius: 14px 14px 0 0; }
.card-name { margin: 0 0 2px; font-size: 14.5px; line-height: 1.45; font-weight: 700; }
.card-price { font-size: 18px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.card-price small { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-left: 2px; }
.card-sub, .card-rating { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.card-rating { color: var(--brass); font-weight: 600; }
.card-link { margin-top: auto; padding-top: 10px; font-size: 13.5px; font-weight: 600; }
.card-action { margin-top: auto; padding-top: 10px; }
.card-action button { width: 100%; padding: 8px 12px; border-radius: 10px; background: var(--lacquer); color: var(--on-accent); font-weight: 600; font-size: 13.5px; }
.card-ask { margin-top: 6px; align-self: flex-start; font-size: 12.5px; color: var(--ink-3); border-bottom: 1px dotted currentColor; }
.card-ask:hover { color: var(--brass); }
.sample { font-size: 12px; color: var(--ink-3); }

/* ---------- 入力欄 ---------- */
.cx-dock { padding: 8px 20px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, transparent, var(--porcelain) 18px); }
.cx-dock-inner { max-width: var(--col); margin: 0 auto; display: grid; gap: 8px; }
.case-pill { justify-self: start; display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: var(--brass-soft); color: var(--brass); font-size: 12.5px; font-weight: 600; }
.case-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brass); box-shadow: 0 0 0 0 color-mix(in srgb, var(--brass) 50%, transparent); animation: cx-pulse 2.4s infinite; }
.memory-note { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 8px 12px; border-radius: 12px; background: var(--paper); border: 1px solid color-mix(in srgb, var(--brass) 35%, var(--line)); font-size: 13px; color: var(--ink-2); animation: cx-rise .35s ease-out both; }
.memory-note b { color: var(--ink); font-weight: 600; }
.memory-note .ic { color: var(--brass); width: 16px; height: 16px; }
.memory-note button { color: var(--lacquer-2); font-weight: 600; font-size: 12.5px; }
.memory-note button:hover { text-decoration: underline; }
.memory-note .mn-close { margin-left: auto; color: var(--ink-3); }
.suggest { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.suggest::-webkit-scrollbar { display: none; }
.suggest-chip { flex: 0 0 auto; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-size: 13px; color: var(--ink-2); white-space: nowrap; transition: border-color .15s, color .15s; }
.suggest-chip:hover { border-color: var(--lacquer-2); color: var(--ink); }
.suggest-desk { border-style: dashed; border-color: color-mix(in srgb, var(--brass) 55%, transparent); color: var(--brass); }

.composer { display: grid; gap: 4px; padding: 10px 10px 8px 16px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-1); transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: color-mix(in srgb, var(--lacquer-2) 55%, var(--line)); box-shadow: var(--shadow-1), 0 0 0 4px color-mix(in srgb, var(--lacquer-2) 10%, transparent); }
.composer textarea { border: 0; padding: 6px 0 0; background: transparent; resize: none; min-height: 28px; max-height: 40vh; line-height: 1.7; box-shadow: none; }
.composer textarea:focus { box-shadow: none; }
.composer-bar { display: flex; align-items: center; gap: 10px; }
.loc { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px 0 7px; border-radius: 999px; font-size: 12.5px; color: var(--ink-3); border: 1px solid transparent; }
.loc .ic { width: 16px; height: 16px; }
.loc:hover { background: var(--line-2); color: var(--ink); }
.loc[aria-pressed="true"] { background: var(--lacquer-soft); color: var(--lacquer-2); border-color: color-mix(in srgb, var(--lacquer-2) 30%, transparent); }
.composer-hint { font-size: 11.5px; color: var(--ink-3); }
.composer-count { font-size: 11.5px; color: var(--rust); font-variant-numeric: tabular-nums; }
.send { margin-left: auto; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--lacquer); color: var(--on-accent); transition: transform .1s, background .15s; }
.send:hover { background: var(--lacquer-2); }
.send:active { transform: scale(.96); }
.composer.busy .send { opacity: .5; }
.cost { margin: 0; text-align: center; font-size: 11.5px; color: var(--ink-3); }
.cost b { color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- 右のパネル ---------- */
.drawer { position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: min(var(--drawer-w), 100vw); display: flex; flex-direction: column; background: var(--paper); border-left: 1px solid var(--line); box-shadow: var(--shadow-2); transform: translateX(104%); transition: transform .26s cubic-bezier(.2,.7,.2,1); }
.drawer:not(.is-open) { visibility: hidden; box-shadow: none; transition: transform .26s cubic-bezier(.2,.7,.2,1), visibility 0s .26s, box-shadow 0s .26s; }
.drawer.is-open { transform: none; }
.drawer-scrim { position: fixed; inset: 0; z-index: 39; background: rgba(40, 22, 0, .28); opacity: 0; pointer-events: none; transition: opacity .2s; display: block; }
.drawer-scrim.is-open { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--line); }
.drawer-tabs { flex: 1; display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--porcelain); }
.drawer-tabs button { flex: 1; padding: 6px 4px; border-radius: 9px; font-size: 13px; color: var(--ink-2); }
.drawer-tabs button[aria-selected="true"] { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px; }
.panel { display: grid; gap: 14px; align-content: start; }
.panel-h { margin: 6px 0 0; font-size: 13px; color: var(--ink-3); font-weight: 600; }
.panel-note { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.panel-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-links { display: flex; flex-wrap: wrap; gap: 6px 16px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }

.pass { position: relative; overflow: hidden; padding: 20px; border-radius: 18px; color: #FFF8EE; background: radial-gradient(120% 140% at 100% 0%, #D08A1A 0%, #B77100 50%, #8A5300 100%); }
.pass::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; border: 1px solid rgba(255, 211, 138, .45); }
.pass-who { font-size: 12.5px; opacity: .8; }
.pass-amount { margin-top: 10px; font-size: 32px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.pass-avail { font-size: 12px; opacity: .78; margin-top: 2px; }
.pass-other { margin-top: 10px; font-size: 13px; }
.pass-card { margin-top: 14px; display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; font-weight: 600; color: #FFD38A; white-space: nowrap; }
.pass-card span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pass-method { margin-top: 8px; font-family: var(--serif); font-size: 19px; line-height: 1.45; }

.btn-quiet { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2); background: var(--paper); text-decoration: none; }
.btn-quiet .ic { width: 16px; height: 16px; }
.btn-quiet:hover { border-color: var(--ink-3); color: var(--ink); }
.btn-link { justify-self: start; }
.btn-primary { padding: 10px 18px; border-radius: 12px; background: var(--lacquer); color: var(--on-accent); font-weight: 600; }
.btn-primary:hover { background: var(--lacquer-2); }
.btn-brass { width: 100%; padding: 9px 14px; border-radius: 10px; background: var(--brass); color: var(--on-accent); font-weight: 600; }
.btn-danger-quiet { color: var(--rust); font-size: 13px; font-weight: 600; }
.btn-danger-quiet:hover { text-decoration: underline; }

.stat { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.stat strong { font-size: 22px; color: var(--ink); font-variant-numeric: tabular-nums; }
.kyc { display: grid; gap: 4px; font-size: 13.5px; }
.tx { display: grid; gap: 4px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tx div { display: flex; justify-content: space-between; gap: 10px; color: var(--ink-2); padding: 4px 0; border-bottom: 1px dashed var(--line-2); }

/* ---------- コンシェルジュデスク ---------- */
.operator-desk { display: grid; gap: 12px; }
.operator-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.operator-head strong { display: block; font-family: var(--serif); font-size: 17px; letter-spacing: .05em; }
.operator-head div > span { display: block; font-size: 12.5px; color: var(--ink-3); }
.demo-badge { flex: 0 0 auto; padding: 2px 9px; border-radius: 999px; background: var(--brass-soft); color: var(--brass); font-size: 11px; font-weight: 700; }
.desk-empty { margin: 0; font-size: 13px; color: var(--ink-3); }
.operator-case { padding: 14px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--brass) 40%, var(--line)); background: var(--paper); font-size: 13.5px; scroll-margin-top: 16px; }
.operator-case.is-flash { animation: cx-flash 1.6s ease-out; }
.case-title-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.case-title-row > div { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.concierge-mark { padding: 2px 8px; border-radius: 999px; background: var(--brass); color: var(--on-accent); font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.case-status { flex: 0 0 auto; padding: 3px 10px; border-radius: 999px; background: var(--brass-soft); color: var(--brass); font-size: 11.5px; font-weight: 700; }
.status-completed { background: var(--lacquer-soft); color: var(--ok); }
.progress-rail { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 14px 0 10px; }
.progress-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 10.5px; color: var(--ink-3); text-align: center; }
.progress-step::before { content: ""; position: absolute; top: 7px; right: 50%; width: 100%; height: 2px; background: var(--line); }
.progress-step:first-child::before { display: none; }
.progress-step i { position: relative; z-index: 1; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); background: var(--paper); }
.progress-step.done::before, .progress-step.current::before { background: var(--brass); }
.progress-step.done i { background: var(--brass); border-color: var(--brass); }
.progress-step.current { color: var(--brass); font-weight: 700; }
.progress-step.current i { border-color: var(--brass); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brass) 18%, transparent); }
.progress-step span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-summary { color: var(--ink-2); }
.desk-message { margin-top: 6px; padding: 7px 10px; border-left: 3px solid var(--brass); background: var(--brass-soft); border-radius: 0 8px 8px 0; white-space: pre-wrap; }
.demo-advance { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding: 10px; border-radius: 10px; background: var(--brass-soft); }
.demo-advance span, .desk-note { font-size: 11.5px; color: var(--ink-3); margin: 0; }
.operator-desk button[type=submit] { padding: 8px 14px; border-radius: 10px; background: var(--lacquer); color: var(--on-accent); font-weight: 600; font-size: 13.5px; }
.demo-advance button[type=submit], .payment-confirm-form button[type=submit] { background: var(--brass) !important; color: var(--on-accent) !important; }
.payment-card { margin-top: 12px; padding: 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--brass) 45%, var(--line)); }
.payment-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.payment-head span { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--brass-soft); color: var(--brass); }
.payment-merchant { margin-top: 8px; font-weight: 700; }
.payment-description { font-size: 12.5px; color: var(--ink-3); }
.payment-amount { margin: 6px 0 10px; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.payment-confirm-form { display: grid; gap: 8px; }
.payment-method { padding: 8px 10px; border-radius: 8px; background: var(--porcelain); font-weight: 600; }
.payment-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; }
.payment-consent input, .rating-stars input { width: auto; }
.rating-box { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.rating-form { display: grid; gap: 8px; }
.rating-stars { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.rating-stars input { position: absolute; opacity: 0; }
.rating-stars span { display: inline-block; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); font-size: 12px; cursor: pointer; }
.rating-stars input:checked + span { background: var(--brass-soft); border-color: var(--brass); color: var(--brass); }
.rating-stars input:focus-visible + span { outline: 2px solid var(--brass-2); }
.desk-request { border-top: 1px solid var(--line); padding-top: 12px; }
.desk-request summary { cursor: pointer; font-weight: 600; color: var(--lacquer-2); font-size: 14px; }
.operator-form { display: grid; gap: 8px; margin-top: 10px; }
.inline-error { padding: 10px 12px; border-radius: 10px; background: var(--rust-soft); color: var(--rust); font-size: 13px; }

/* ---------- 覚えていること ---------- */
.memory { display: grid; gap: 16px; }
.mem-intro h2 { margin: 0 0 4px; font-family: var(--serif); font-size: 18px; font-weight: 600; letter-spacing: .04em; }
.mem-intro p { margin: 0; font-size: 13px; color: var(--ink-2); }
.mem-consent { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--porcelain); font-size: 13.5px; }
.mem-consent small { display: block; color: var(--ink-3); font-size: 12px; }
.mem-group { display: grid; gap: 8px; }
.mem-group-h { display: flex; align-items: baseline; justify-content: space-between; margin: 0; font-size: 13px; color: var(--ink-3); font-weight: 600; }
.mem-items { display: flex; flex-wrap: wrap; gap: 6px; }
.mem-item { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 6px 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-size: 13.5px; }
.mem-item.is-dislike { border-style: dashed; color: var(--ink-2); }
.mem-item.is-pinned { border-color: color-mix(in srgb, var(--brass) 55%, var(--line)); }
.mem-item.is-weak .mem-val { color: var(--ink-3); }
.mem-pol { font-size: 10.5px; padding: 1px 6px; border-radius: 999px; background: var(--lacquer-soft); color: var(--lacquer-2); font-weight: 700; }
.mem-item.is-dislike .mem-pol { background: var(--rust-soft); color: var(--rust); }
.mem-item.is-neutral .mem-pol { background: var(--porcelain); color: var(--ink-3); }
.mem-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mem-item button { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--ink-3); }
.mem-item button:hover { background: var(--line-2); color: var(--ink); }
.mem-item button .ic { width: 14px; height: 14px; }
.mem-edit { display: grid; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--porcelain); }
.mem-edit-meta { font-size: 12px; color: var(--ink-3); }
.mem-edit-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mem-edit-row select, .mem-edit-row input[type=text] { flex: 1; min-width: 0; }
.mem-edit-row input[type=text] { flex: 2.2; }
.mem-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.mem-check input { width: auto; }
.mem-add { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.mem-add h3 { margin: 0; font-size: 13px; color: var(--ink-3); }
.mem-empty { padding: 14px; border-radius: 12px; background: var(--porcelain); font-size: 13px; color: var(--ink-2); }
.mem-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }

/* ---------- 設定 ---------- */
.settings { display: grid; gap: 18px; }
.settings fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: 14px; }
.settings legend { margin-bottom: 4px; font-family: var(--serif); font-size: 16px; font-weight: 600; letter-spacing: .04em; }
.field { display: grid; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { font-size: 12px; color: var(--ink-3); }
.seg { display: flex; padding: 3px; border-radius: 12px; background: var(--porcelain); }
.seg label { flex: 1; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 6px 4px; border-radius: 9px; text-align: center; font-size: 13px; color: var(--ink-2); }
.seg input:checked + span { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg input:focus-visible + span { outline: 2px solid var(--brass-2); }
.switch-row { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: 14px; }
.switch-row input[type=checkbox] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { flex: 0 0 auto; position: relative; width: 40px; height: 24px; margin-top: 1px; border-radius: 999px; background: var(--line); transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch-row input:checked + .switch { background: var(--lacquer-2); }
.switch-row input:checked + .switch::after { transform: translateX(16px); }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--brass-2); outline-offset: 2px; }
.switch-text small { display: block; font-size: 12px; color: var(--ink-3); }

/* ---------- メニュー(Ctrl+K) ---------- */
.palette { position: fixed; inset: 0; z-index: 70; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(40, 22, 0, .32); }
.palette-box { width: min(560px, 100%); overflow: hidden; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-2); animation: cx-pop .16s ease-out both; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.palette-input input { border: 0; padding: 4px 0; font-size: 16px; background: transparent; box-shadow: none; }
.palette-input input:focus { box-shadow: none; }
.palette-list { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow-y: auto; }
.palette-list .pal-group { padding: 8px 10px 4px; font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.palette-list [role=option] { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; font-size: 14px; cursor: pointer; }
.palette-list [role=option] .ic { width: 18px; height: 18px; color: var(--ink-3); }
.palette-list [role=option] .pal-hint { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.palette-list [role=option][aria-selected="true"] { background: var(--lacquer-soft); }
.palette-list [role=option][aria-selected="true"] .ic { color: var(--lacquer-2); }
.palette-list .pal-empty { padding: 14px 10px; font-size: 13px; color: var(--ink-3); }
.palette-foot { margin: 0; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-3); }

/* ---------- 通知 ---------- */
.toast { position: fixed; z-index: 80; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: min(520px, calc(100vw - 32px)); display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--porcelain); font-size: 13.5px; box-shadow: var(--shadow-2); animation: cx-rise .2s ease-out both; }
.toast.is-error { background: var(--rust); color: var(--on-accent); }
.toast button { color: inherit; font-weight: 700; text-decoration: underline; }

/* ---------- 動き ---------- */
@keyframes cx-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes cx-pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes cx-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes cx-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brass) 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
@keyframes cx-flash { 0% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brass) 40%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- 画面幅 ---------- */
@media (max-width: 980px) {
  .cmd-btn span, .cmd-btn kbd { display: none; }
  .cmd-btn { padding: 0 9px; }
  .cx-topic { display: none; }
}
@media (max-width: 860px) {
  .cx, .cx[data-side="closed"], .cx[data-side="open"] { grid-template-columns: minmax(0, 1fr); }
  .cx-side { position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); visibility: hidden; transform: translateX(-102%); transition: transform .24s cubic-bezier(.2,.7,.2,1), visibility 0s .24s; box-shadow: var(--shadow-2); }
  .cx[data-mobile-side="open"] .cx-side { visibility: visible; transform: none; transition: transform .24s cubic-bezier(.2,.7,.2,1); }
  .cx-scrim { display: block; position: fixed; inset: 0; z-index: 49; background: rgba(40, 22, 0, .3); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .cx[data-mobile-side="open"] .cx-scrim { opacity: 1; pointer-events: auto; }
  .cx[data-side] .cx-side-toggle { display: inline-grid; }
  .cx-top { padding: 0 8px; gap: 6px; }
  .cx-who-title { display: none; }
  .thread { padding: 20px 14px 16px; }
  .cards-wrap, .notice { margin-left: 0; }
  .cx-dock { padding-left: 10px; padding-right: 10px; }
  .composer-hint { display: none; }
  .drawer { width: 100vw; }
}
@media (max-width: 560px) {
  .hide-xs { display: none; }
  .balance-chip { padding: 0 10px; font-size: 12.5px; }
  .balance-chip .ic { display: none; }
  .starters { grid-template-columns: 1fr; }
  .m-ai .m-avatar { display: none; }
  .m-user .m-body { max-width: 88%; }
  .loc span { display: none; }
  .loc { padding: 0 7px; }
  .cost-rule { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* =====================================================================
   ページ(予約・アカウント・記憶)と入口(ログイン・登録・エラー)
   チャット画面と同じトークンを使う。クラス名は pg- / gate- / bk- で分ける。
   ===================================================================== */
body.pg-body, body.gate-body { height: auto; min-height: 100%; }
.btn-danger { padding: 10px 18px; border-radius: 12px; background: transparent; border: 1px solid color-mix(in srgb, var(--rust) 55%, transparent); color: var(--rust); font-weight: 600; }
.btn-danger:hover { background: var(--rust-soft); }
.btn-primary, .btn-quiet, .btn-danger, .btn-brass { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-brass { width: auto; }
.btn-wide { width: 100%; }
.field-error { color: var(--rust); font-size: 13px; }

/* ---------- ページの枠 ---------- */
.pg-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 18px; height: 60px; padding: 0 max(18px, calc((100vw - 900px) / 2 + 20px)); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--porcelain) 90%, transparent); backdrop-filter: saturate(1.2) blur(10px); }
.pg-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.pg-brand-text { font-weight: 700; letter-spacing: .02em; font-size: 15px; }
.pg-brand-text span { font-family: var(--serif); font-weight: 500; color: var(--brass); }
.pg-nav { display: flex; gap: 4px; margin-left: auto; }
.pg-nav a { padding: 7px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-size: 14px; }
.pg-nav a:hover { background: var(--line-2); color: var(--ink); }
.pg-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; background: var(--paper); box-shadow: inset 0 -2px 0 var(--brass); }
.pg-main { max-width: 900px; margin: 0 auto; padding: 36px 20px 72px; display: grid; gap: 18px; }
.pg-main.is-narrow { max-width: 680px; }
.pg-head { display: grid; gap: 6px; margin-bottom: 6px; }
.pg-crumb { margin: 0; font-size: 13px; color: var(--ink-3); }
.pg-crumb a { color: var(--ink-3); }
.pg-title { margin: 0; font-family: var(--serif); font-weight: 600; font-size: clamp(24px, 3.4vw, 32px); line-height: 1.35; letter-spacing: .04em; }
.pg-lead { margin: 0; color: var(--ink-2); max-width: 40em; }
.pg-note { padding: 12px 16px; border-radius: 12px; font-size: 14px; background: var(--lacquer-soft); color: var(--lacquer-2); }
.pg-note.is-warn { background: var(--rust-soft); color: var(--rust); }
.pg-note.is-brass { background: var(--brass-soft); color: var(--brass); }
.pg-note.is-ok { background: var(--lacquer-soft); color: var(--lacquer-2); }
.pg-card { padding: 22px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); display: grid; gap: 14px; align-content: start; }
.pg-card-h { margin: 0; font-family: var(--serif); font-size: 18px; font-weight: 600; letter-spacing: .04em; }
.pg-card-h small { display: block; margin-top: 2px; font-family: var(--sans); font-size: 13px; font-weight: 400; color: var(--ink-3); letter-spacing: 0; }
.pg-card p { margin: 0; }
.pg-muted { color: var(--ink-3); font-size: 13px; }
.pg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pg-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.pg-links { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; }

.pg-dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; }
.pg-dl dt, .pg-dl dd { margin: 0; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.pg-dl dt { padding-right: 24px; color: var(--ink-3); font-size: 13.5px; }
.pg-dl dd { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pg-dl dt:last-of-type, .pg-dl dd:last-of-type { border-bottom: 0; }
.copy-btn { margin-left: 8px; font-size: 12px; color: var(--lacquer-2); text-decoration: underline; text-underline-offset: 3px; }

.st { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--porcelain); color: var(--ink-2); }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st.tone-ok { background: var(--lacquer-soft); color: var(--ok); }
.st.tone-wait { background: var(--brass-soft); color: var(--brass); }
.st.tone-warn { background: var(--rust-soft); color: var(--rust); }
.st.tone-off { background: var(--porcelain); color: var(--ink-3); }

/* ---------- 予約一覧 ---------- */
.bk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bk-item { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 16px 18px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.bk-item:hover { border-color: color-mix(in srgb, var(--brass) 45%, var(--line)); box-shadow: var(--shadow-1); }
.bk-item.is-past { opacity: .72; }
.bk-date { display: grid; justify-items: center; padding: 8px 0; border-right: 1px solid var(--line); line-height: 1.15; }
.bk-date small { font-size: 11.5px; color: var(--ink-3); }
.bk-date b { font-family: var(--serif); font-size: 28px; font-weight: 600; }
.bk-name { margin: 0 0 2px; font-size: 16px; font-weight: 700; line-height: 1.45; }
.bk-meta { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bk-side { display: grid; justify-items: end; gap: 6px; text-align: right; }
.bk-amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.pg-pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-3); }

.pg-empty { display: grid; justify-items: center; gap: 12px; padding: 48px 20px; text-align: center; border-radius: 18px; border: 1px dashed var(--line); background: var(--paper); }
.pg-empty p { margin: 0; color: var(--ink-2); max-width: 30em; }

/* ---------- 予約内容の確認 ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); counter-reset: step; }
.steps li { position: relative; display: grid; justify-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); text-align: center; counter-increment: step; }
.steps li::before { content: counter(step); position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--paper); font-weight: 700; font-size: 13px; }
.steps li::after { content: ""; position: absolute; top: 14px; right: 50%; width: 100%; height: 1.5px; background: var(--line); }
.steps li:first-child::after { display: none; }
.steps li.is-done { color: var(--ink-2); }
.steps li.is-done::before { content: "✓"; background: var(--lacquer); border-color: var(--lacquer); color: var(--on-accent); }
.steps li.is-done::after, .steps li.is-current::after { background: var(--lacquer); }
.steps li.is-current { color: var(--ink); font-weight: 700; }
.steps li.is-current::before { border-color: var(--brass); color: var(--brass); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brass) 16%, transparent); }
.steps li.is-skip::before { content: "—"; }

.stay { position: relative; overflow: hidden; padding: 24px; border-radius: 20px; color: #FFF8EE; background: radial-gradient(120% 140% at 100% 0%, #D08A1A 0%, #B77100 50%, #8A5300 100%); display: grid; gap: 14px; }
.stay::after { content: ""; position: absolute; right: -50px; top: -50px; width: 170px; height: 170px; border-radius: 50%; border: 1px solid rgba(255, 211, 138, .45); }
.stay-name { margin: 0; font-family: var(--sans); font-size: 22px; font-weight: 600; letter-spacing: .03em; line-height: 1.45; }
.stay-dates { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid rgba(255,255,255,.14); border-bottom: 1px solid rgba(255,255,255,.14); }
.stay-dates div { display: grid; gap: 2px; }
.stay-dates small { font-size: 11.5px; opacity: .72; }
.stay-dates b { font-size: 17px; font-variant-numeric: tabular-nums; }
.stay-nights { padding: 3px 10px; border-radius: 999px; border: 1px solid rgba(255, 211, 138, .6); color: #FFD38A; font-size: 12px; white-space: nowrap; }
.stay-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.stay-amount { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stay-amount small { display: block; font-size: 11.5px; font-weight: 400; opacity: .72; }
.pay-box { min-height: 120px; padding: 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--paper); }
.pg-form { display: grid; gap: 14px; }
.pg-form .field input, .pg-form .field select, .pg-form .field textarea { width: 100%; }
.pg-form .field textarea { resize: vertical; line-height: 1.7; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--porcelain); font-size: 14px; cursor: pointer; }
.check input { flex: none; width: auto; margin-top: 4px; accent-color: var(--lacquer-2); }
.check small { display: block; color: var(--ink-3); font-size: 12.5px; }
.aside-list { margin: 0; padding-left: 1.1em; color: var(--ink-2); font-size: 13.5px; display: grid; gap: 6px; }

/* ---------- アカウント ---------- */
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt { display: grid; gap: 4px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--porcelain); }
.opt.is-on { border-color: color-mix(in srgb, var(--lacquer-2) 45%, var(--line)); background: var(--paper); }
.opt-name { font-weight: 700; }
.opt small { color: var(--ink-3); font-size: 12.5px; }
.danger-zone { border-color: color-mix(in srgb, var(--rust) 30%, var(--line)); }
.credit-list { list-style: none; margin: 0 0 12px; padding: 0; }
.credit-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); }
.credit-at { color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.credit-amt { font-variant-numeric: tabular-nums; }
.credit-amt.is-plus { color: var(--lacquer-2); }
.mem-chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- 入口(ログイン・登録・エラー) ---------- */
.gate { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 40px 18px; }
.gate-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.gate-card { width: min(440px, 100%); padding: 32px 30px; border-radius: 22px; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-1); display: grid; gap: 16px; animation: cx-rise .5s cubic-bezier(.2,.7,.2,1) both; }
.gate.is-wide .gate-card { width: min(640px, 100%); }
.gate-title { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 24px; line-height: 1.45; letter-spacing: .04em; }
.gate-lead { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.gate-mark { font-family: var(--serif); font-size: 52px; line-height: 1; color: var(--brass); letter-spacing: .06em; }
.gate-form { display: grid; gap: 12px; }
.gate-form input:not([type=checkbox]), .gate-form select { padding: 11px 14px; }
.gate-below { width: min(440px, 100%); display: grid; gap: 6px; text-align: center; font-size: 13px; color: var(--ink-3); }
.gate.is-wide .gate-below { width: min(640px, 100%); }
.gate-below p { margin: 0; }
.gate-sep { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 12px; }
.gate-sep::before, .gate-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.code-input { font-size: 26px !important; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; padding-left: calc(14px + .5em) !important; }
.devcode { padding: 10px 14px; border-radius: 12px; background: var(--brass-soft); color: var(--brass); font-size: 13.5px; }
.devcode b { font-size: 16px; letter-spacing: .2em; }
.gate-ref { font-size: 12px; color: var(--ink-3); }
.reg-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.reg-steps li { padding: 4px 10px; border-radius: 999px; background: var(--porcelain); color: var(--ink-3); font-size: 12px; }
.reg-steps li.is-current { background: var(--lacquer-soft); color: var(--lacquer-2); font-weight: 700; }
.terms-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.terms-list li { position: relative; padding-left: 22px; color: var(--ink-2); font-size: 14px; }
.terms-list li::before { content: ""; position: absolute; left: 4px; top: .75em; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--brass); }

@media (max-width: 760px) {
  .pg-top { gap: 10px; padding: 0 12px; }
  .pg-brand-text { display: none; }
  .pg-nav { gap: 0; }
  .pg-nav a { padding: 7px 9px; font-size: 13.5px; }
  .pg-main { padding: 24px 14px 56px; }
  .pg-grid, .opt-grid, .form-2 { grid-template-columns: 1fr; }
  .bk-item { grid-template-columns: 58px minmax(0, 1fr); gap: 12px; }
  .bk-side { grid-column: 1 / -1; grid-auto-flow: column; justify-content: space-between; justify-items: start; text-align: left; }
  .bk-date b { font-size: 22px; }
  .steps li { font-size: 11px; }
  .stay { padding: 20px; }
  .stay-dates b { font-size: 15px; }
  .gate-card { padding: 26px 20px; }
  .pg-dl { grid-template-columns: 1fr; }
  .pg-dl dt { padding-bottom: 0; border-bottom: 0; }
}
/* 並べたボタンの高さを揃える */
.pg-actions .btn-quiet, .gate-card .btn-quiet { padding: 10px 16px; font-size: 14px; border-radius: 12px; }

/* ---------- 添付ファイル・音声入力 ---------- */
.tool-btn { position: relative; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: var(--ink-3); cursor: pointer; transition: background .15s, color .15s; }
.tool-btn .ic { width: 19px; height: 19px; }
.tool-btn:hover { background: var(--line-2); color: var(--ink); }
.tool-btn:focus-within { outline: 2px solid var(--brass-2); outline-offset: 2px; }
.tool-btn.is-listening { color: var(--on-accent); background: var(--rust); }
.tool-btn.is-listening::after { content: ""; position: absolute; inset: -4px; border-radius: 13px; border: 2px solid var(--rust); opacity: .6; animation: cx-listen 1.4s ease-out infinite; }
@keyframes cx-listen { from { transform: scale(.9); opacity: .7; } to { transform: scale(1.25); opacity: 0; } }

.attach-tray { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 6px; }
.att-chip { position: relative; display: flex; align-items: center; gap: 8px; max-width: 260px; padding: 6px 30px 6px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--porcelain); }
.att-chip.is-error { border-color: color-mix(in srgb, var(--rust) 45%, var(--line)); background: var(--rust-soft); }
.att-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; }
.att-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: var(--paper); color: var(--brass); flex: 0 0 auto; }
.att-info { display: grid; min-width: 0; gap: 1px; }
.att-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-meta { font-size: 11px; color: var(--ink-3); }
.att-chip.is-error .att-meta { color: var(--rust); }
.att-bar { display: block; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 2px; }
.att-bar i { display: block; height: 100%; background: var(--lacquer-2); transition: width .2s; }
.att-remove { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--ink-3); }
.att-remove:hover { background: var(--line); color: var(--ink); }
.att-remove .ic { width: 14px; height: 14px; }
.attach-prompts { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.attach-prompts::-webkit-scrollbar { display: none; }

.drop-zone { position: absolute; inset: 60px 0 0; z-index: 30; display: grid; place-items: center; padding: 24px; background: color-mix(in srgb, var(--porcelain) 82%, transparent); backdrop-filter: blur(3px); pointer-events: none; }
.drop-card { display: grid; justify-items: center; gap: 6px; padding: 34px 44px; border-radius: 22px; border: 2px dashed color-mix(in srgb, var(--brass) 60%, transparent); background: var(--paper); color: var(--ink-2); text-align: center; }
.drop-card .ic { width: 30px; height: 30px; color: var(--brass); }
.drop-card p { margin: 0; font-family: var(--serif); font-size: 18px; color: var(--ink); }
.drop-card small { font-size: 12px; color: var(--ink-3); }

.m-attachments { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-bottom: 6px; max-width: 100%; }
.m-att-img { display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); }
.m-att-img img { display: block; width: auto; height: auto; max-width: min(240px, 60vw); max-height: 200px; object-fit: cover; }
.m-att-file { display: inline-flex; align-items: center; gap: 8px; max-width: 280px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); text-decoration: none; font-size: 13px; }
.m-att-file .ic { width: 18px; height: 18px; color: var(--brass); flex: 0 0 auto; }
.m-att-file:hover { border-color: var(--brass-2); }
.m-att-file.is-expired { color: var(--ink-3); }
.m-att-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.m-att-meta { flex: 0 0 auto; font-size: 11px; color: var(--ink-3); }
.empty-hint { margin: -14px 0 24px; font-size: 13px; color: var(--ink-3); max-width: 34em; }
@media (max-width: 560px) { .att-chip { max-width: 100%; } .m-att-img img { max-width: 70vw; } }

/* ---------- ご用件メニュー(最初の画面) ----------
   ホテルの館内案内板のように、1枚の盤面に用件を並べる。各用件の印章は、あいさつの印章と同じ意匠。 */
.topic-menu { width: 100%; }
.topic-step { width: 100%; }
.topic-q { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-family: var(--serif); font-weight: 500; font-size: 17px; letter-spacing: .04em; color: var(--ink); outline: none; }
.topic-seal { display: inline-grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; font-family: var(--serif); font-size: 17px; line-height: 1; color: var(--brass); background: var(--paper); border: 1px solid color-mix(in srgb, var(--brass) 55%, transparent); box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 3px color-mix(in srgb, var(--brass) 28%, transparent); transition: background-color .15s, color .15s; }
.topic-seal-sm { width: 30px; height: 30px; font-size: 14px; }
.topic-seal-xs { width: 22px; height: 22px; font-size: 11.5px; box-shadow: none; }

.topic-cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 16px; background: var(--paper); overflow: hidden; }
.topic-cat { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 14px 16px; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line-2); cursor: pointer; transition: background-color .15s; }
.topic-cat:nth-child(odd) { border-right: 1px solid var(--line-2); }
.topic-cat:nth-last-child(-n+2):nth-child(odd), .topic-cat:last-child { border-bottom: 0; }
.topic-cat:hover, .topic-cat:focus-visible { background: var(--lacquer-soft); }
.topic-cat:hover .topic-seal, .topic-cat:focus-visible .topic-seal { background: var(--brass-soft); }
.topic-cat:focus-visible, .topic-sub:focus-visible, .topic-back:focus-visible { outline: 2px solid var(--lacquer-2); outline-offset: -2px; }
.topic-cat-text { display: grid; gap: 1px; min-width: 0; }
.topic-cat-label { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.topic-cat-lead { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }

.topic-subs { display: grid; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); overflow: hidden; }
.topic-sub { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center; padding: 12px 18px; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line-2); cursor: pointer; transition: background-color .15s; }
.topic-sub:last-child { border-bottom: 0; }
.topic-sub::after { content: "›"; grid-row: 1 / span 2; grid-column: 2; font-size: 18px; color: var(--ink-3); }
.topic-sub:hover, .topic-sub:focus-visible { background: var(--lacquer-soft); }
.topic-sub-label { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.topic-sub-hint { grid-column: 1; font-size: 12.5px; color: var(--ink-3); }
.topic-sub[data-topic-sub="other"] .topic-sub-label { font-weight: 500; color: var(--ink-2); }

.topic-back { margin: 0 0 10px -6px; padding: 4px 6px; border-radius: 8px; background: transparent; border: 0; font-size: 13px; color: var(--ink-3); cursor: pointer; }
.topic-back:hover { color: var(--ink); }
.topic-skip, .topic-free, .topic-note { margin: 12px 0 0; font-size: 13px; color: var(--ink-3); }
.topic-skip .link-btn { margin-left: 6px; color: var(--brass); }
.topic-note { padding-left: 10px; border-left: 2px solid color-mix(in srgb, var(--brass) 45%, transparent); }
.topic-step .starters { margin-top: 2px; }

/* 入力欄の上の「いまのご用件」 */
.topic-chip { justify-self: start; display: inline-flex; align-items: center; gap: 7px; max-width: 100%; margin-top: 2px; padding: 3px 6px 3px 4px; border-radius: 999px; background: var(--brass-soft); font-size: 12.5px; color: var(--ink-2); }
.topic-chip[hidden] { display: none; }
.topic-chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-chip-x { width: 20px; height: 20px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-3); font-size: 14px; line-height: 1; cursor: pointer; }
.topic-chip-x:hover { color: var(--ink); background: color-mix(in srgb, var(--brass) 15%, transparent); }

/* 話題の外の検索を提案するチップ */
.suggest-switch { border-color: color-mix(in srgb, var(--lacquer-2) 55%, transparent); color: var(--lacquer); background: var(--lacquer-soft); }

/* サイドバーの会話一覧の印章 */
.conv-seal { flex: 0 0 auto; align-self: center; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--brass) 45%, transparent); font-family: var(--serif); font-size: 10px; line-height: 1; color: var(--brass); }

/* 相談の一覧の区分・状態・最後の文(計画書 docs/plan-poai-feedback-I.md 3.5)。
   行: 左の丸(右下に印)| 題・when / 最後の文・札。区分は行の帯(薄い地+左の縁 3px)と丸の縁の色 */
.conv-link { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "seal title when" "seal last state"; column-gap: 8px; row-gap: 2px; align-items: center; }
/* 丸は 2 行の行に合わせて 26px(印が字を隠さない大きさ。アプリの丸と同じ考え) */
.conv-link .conv-seal { grid-area: seal; position: relative; width: 26px; height: 26px; font-size: 13px; }
/* 丸の中の分類の絵 16px(計画書 docs/plan-poai-feedback-72.md 3.3)。線の SVG を mask にして currentColor(今の字の色)で塗る。
   mask 非対応のブラウザでは ::before を作らず、丸の縁だけになる */
.conv-seal--dining, .topic-seal--dining { --conv-icon: url(../img/topics/dining.svg); }
.conv-seal--stay, .topic-seal--stay { --conv-icon: url(../img/topics/stay.svg); }
.conv-seal--nearby, .topic-seal--nearby { --conv-icon: url(../img/topics/nearby.svg); }
.conv-seal--health, .topic-seal--health { --conv-icon: url(../img/topics/health.svg); }
.conv-seal--life, .topic-seal--life { --conv-icon: url(../img/topics/life.svg); }
.conv-seal--worry, .topic-seal--worry { --conv-icon: url(../img/topics/worry.svg); }
.conv-seal--gift, .topic-seal--gift { --conv-icon: url(../img/topics/gift.svg); }
.conv-seal--writing, .topic-seal--writing { --conv-icon: url(../img/topics/writing.svg); }
.conv-seal--other, .topic-seal--other { --conv-icon: url(../img/topics/other.svg); }
@supports ((mask-image: url("")) or (-webkit-mask-image: url(""))) {
  .conv-link .conv-seal::before { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--conv-icon) center / contain no-repeat; mask: var(--conv-icon) center / contain no-repeat; }
  .topic-seal::before { content: ""; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--conv-icon) center / contain no-repeat; mask: var(--conv-icon) center / contain no-repeat; }
  .topic-seal-sm::before { width: 16px; height: 16px; }
  .topic-seal-xs::before { width: 13px; height: 13px; }
}
.conv-link .conv-title { grid-area: title; }
.conv-link .conv-when { grid-area: when; justify-self: end; }
.conv-last { grid-area: last; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--ink-3); }
.conv-state { grid-area: state; justify-self: end; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 600; line-height: 1.5; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.conv-state--unread { background: var(--rust-soft); color: var(--rust); }
.conv-mark { position: absolute; right: -7px; bottom: -6px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 7px; font-family: var(--sans); font-size: 9px; font-weight: 700; line-height: 14px; text-align: center; background: var(--ink-3); color: var(--paper); box-shadow: 0 0 0 1.5px var(--paper); }
.conv-mark--unread { background: var(--rust); color: var(--paper); }   /* 明るい表示は白字・暗い表示は濃い地の色の字(明るい --rust の上で読める) */
.conv--staff { --conv-c: var(--conv-staff); }
.conv--ai { --conv-c: var(--conv-ai); }
/* 区分のある行は、ホバー・選択の時も区分の帯と左の縁を保つ。選択は同じ色の少し濃い地と太字で示し、既存の橙の線(::before)は出さない。
   区分の無い行の選択・ホバーは既存の .conv:hover・.conv.is-current のまま(暗い表示は変数で切り替わる) */
.conv.conv--staff, .conv.conv--ai { background: color-mix(in srgb, var(--conv-c) 8%, transparent); box-shadow: inset 3px 0 0 var(--conv-c); }
.conv.conv--staff:hover, .conv.conv--staff:focus-within, .conv.conv--ai:hover, .conv.conv--ai:focus-within { background: color-mix(in srgb, var(--conv-c) 13%, transparent); }
.conv.conv--staff.is-current, .conv.conv--ai.is-current { background: color-mix(in srgb, var(--conv-c) 18%, transparent); }
.conv.conv--staff.is-current::before, .conv.conv--ai.is-current::before { content: none; }
.conv.conv--staff.is-current .conv-title, .conv.conv--ai.is-current .conv-title { font-weight: 700; }
.conv--staff .conv-seal { border-color: var(--conv-staff); color: var(--conv-staff); }
.conv--ai .conv-seal { border-color: var(--conv-ai); color: var(--conv-ai); }

@media (max-width: 560px) {
  .topic-cats { grid-template-columns: 1fr; }
  .topic-cat:nth-child(odd) { border-right: 0; }
  .topic-cat:nth-last-child(-n+2):nth-child(odd) { border-bottom: 1px solid var(--line-2); }
  .topic-cat:last-child { border-bottom: 0; }
  .topic-cat { padding: 12px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .topic-cat, .topic-sub, .topic-seal { transition: none; }
}

/* =====================================================================
   THE POAi デザイン(仕様書の見た目に合わせる上書き)
   機能・クラス名は変えず、見た目だけをここで差し替える。
   ===================================================================== */

/* ---------- POA マーク ----------
   従来の「印章」(コンシェルジュ名の頭文字)は、マークに置き換える。JSが作る .seal もそのまま対象になる。 */
.poa-mark { display: inline-block; flex: 0 0 auto; width: 1em; height: .78em; background: var(--poa-mark); -webkit-mask: url(../img/poa-mark.svg) center / contain no-repeat; mask: url(../img/poa-mark.svg) center / contain no-repeat; }
.seal { position: relative; font-size: 0 !important; color: transparent; background: var(--poa-orange); border: 0; box-shadow: inset 0 0 0 1px rgba(120, 70, 0, .12); }
.seal::before { content: ""; position: absolute; inset: 22% 16% 24%; background: #000; -webkit-mask: url(../img/poa-mark.svg) center / contain no-repeat; mask: url(../img/poa-mark.svg) center / contain no-repeat; }
.seal-lg { width: 92px; height: 92px; box-shadow: 0 0 0 6px color-mix(in srgb, var(--poa-orange) 22%, transparent); }

/* ワードマーク「THE POAi」 */
.poa-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-family: var(--brand-font); font-weight: 500; font-size: 17px; letter-spacing: .03em; white-space: nowrap; }
.poa-brand .poa-mark { font-size: 30px; }
.poa-brand b { font-weight: 500; }
.poa-brand small { font-family: var(--sans); font-size: 11px; font-weight: 600; color: var(--ink-3); letter-spacing: .04em; }

/* ---------- 骨組み ---------- */
body.cx-body { background: var(--porcelain); }
.cx-side { background: var(--paper); border-right-color: var(--line); }
.cx-side-head { padding: 14px 12px 10px 16px; }
.cx-new { border-color: transparent; background: var(--poa-orange); color: #2B1D0C; box-shadow: 0 2px 0 rgba(140, 80, 0, .18); }
.cx-new:hover { background: var(--poa-orange-2); border-color: transparent; }
.conv.is-current { background: var(--brass-soft); }
.conv.is-current::before { background: var(--poa-orange); }
.conv-seal, .topic-seal { border-color: color-mix(in srgb, var(--poa-amber) 50%, transparent); color: var(--poa-amber); }

/* 上部バー: 白地に「POAi」 */
.cx-top { background: color-mix(in srgb, var(--paper) 94%, transparent); border-bottom-color: var(--line); }
.cx-who-name { font-family: var(--brand-font); font-weight: 600; letter-spacing: .04em; }
.balance-chip .ic { color: var(--poa-amber); }
.balance-chip:hover { border-color: var(--poa-orange); }

/* 音声通話ボタン(上部バー) */
.call-btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px 0 10px; margin-right: 4px; border-radius: 999px; background: var(--poa-amber); color: #FFF8EE; font-size: 13.5px; font-weight: 700; box-shadow: 0 2px 0 rgba(90, 50, 0, .25); transition: background .15s, transform .1s; }
.call-btn:hover { background: #A36400; }
.call-btn:active { transform: translateY(1px); }
.call-btn .ic { width: 18px; height: 18px; }
.call-btn .call-dot { width: 7px; height: 7px; border-radius: 50%; background: #8BE04A; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.call-btn[data-open="0"] .call-dot { background: #D9B98A; }

/* ---------- 会話の背景(黄 → 桃のグラデーション) ---------- */
.cx-main { background: linear-gradient(180deg, var(--chat-top) 0%, color-mix(in srgb, var(--chat-top) 45%, var(--chat-bottom)) 55%, var(--chat-bottom) 100%); }
.cx-dock { background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--chat-bottom) 70%, transparent) 22px); }
.drop-zone { background: color-mix(in srgb, var(--chat-top) 80%, transparent); }

/* 日付の区切り: オリーブのチップ */
.day-sep { justify-content: center; }
.day-sep::before, .day-sep::after { display: none; }
.day-sep span { padding: 2px 12px; border-radius: 999px; background: var(--poa-olive); color: #FFF8EE; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; }

/* AI(コンシェルジュ)の発言: 白い吹き出し、時刻は吹き出しの右下(外側) */
.m-ai:not(.thinking):not(.request-timeout) .m-body { flex: 0 1 auto; max-width: min(80%, 64ch); display: grid; grid-template-columns: minmax(0, auto) auto; column-gap: 8px; align-items: end; justify-items: start; }
.m-ai .m-head { grid-column: 1 / -1; margin-bottom: 3px; }
.m-ai .m-text { grid-column: 1; padding: 11px 15px; border-radius: 6px 18px 18px 18px; background: var(--paper); color: var(--ink); line-height: 1.85; box-shadow: 0 1px 2px rgba(120, 70, 0, .08); }
.m-ai .m-text + .m-time { grid-column: 2; margin-bottom: 2px; }
.m-ai .m-meta { grid-column: 1 / -1; margin-top: 4px; color: color-mix(in srgb, var(--ink-3) 85%, var(--poa-amber)); }
.m.thinking .m-body { padding: 9px 15px; border-radius: 6px 18px 18px 18px; background: color-mix(in srgb, var(--paper) 85%, transparent); }
.m-name { font-family: var(--sans); font-weight: 700; font-size: 12.5px; letter-spacing: .03em; color: var(--ink-2); }
.m-time { color: #9A5E12; font-size: 11px; white-space: nowrap; }
html[data-theme="dark"] .m-time { color: var(--ink-3); }

/* 自分の発言: オレンジの吹き出し、時刻は左下 */
.m-user .m-body { display: grid; grid-template-columns: auto minmax(0, auto); column-gap: 8px; align-items: end; justify-items: end; max-width: min(82%, 58ch); }
.m-user .m-attachments { grid-column: 1 / -1; }
.m-user .m-text { grid-column: 2; grid-row: 2; padding: 11px 15px; border-radius: 18px 6px 18px 18px; background: var(--user-bubble); color: var(--user-ink); box-shadow: 0 1px 2px rgba(140, 70, 0, .14); }
.m-user .m-time { grid-column: 1; grid-row: 2; margin: 0 0 2px; }
.m-user .m-body > .m-text:first-child { grid-row: 1; }
.m-user .m-body > .m-text:first-child + .m-time { grid-row: 1; }

/* スタッフ(コンシェルジュデスク)の発言: 白い吹き出し+琥珀のラベル */
.m-desk .m-avatar { background: var(--poa-amber); color: #FFF8EE; }
.m-desk .m-body { flex: 0 1 auto; max-width: min(78%, 62ch); padding: 10px 15px; border-radius: 6px 18px 18px 18px; background: var(--paper); box-shadow: 0 1px 2px rgba(120, 70, 0, .08); }
.m-desk .m-name { color: var(--poa-amber); }

.notice { background: color-mix(in srgb, var(--paper) 70%, var(--rust-soft)); }
.dots i { background: var(--poa-amber); }

/* 最初の画面 */
.empty-hello { font-family: var(--sans); font-weight: 700; letter-spacing: .02em; }
.empty-title { font-family: var(--sans); font-weight: 600; color: var(--poa-amber); letter-spacing: .04em; }
.topic-q { font-family: var(--sans); font-weight: 700; }
.topic-cats, .topic-subs { border-color: transparent; box-shadow: var(--shadow-1); }
.topic-cat:hover, .topic-cat:focus-visible, .topic-sub:hover, .topic-sub:focus-visible { background: var(--brass-soft); }
.starter { border-color: transparent; box-shadow: 0 1px 2px rgba(120, 70, 0, .08); }
.starter:hover { border-color: var(--poa-orange); }

/* 候補カード */
.card { border-color: transparent; box-shadow: 0 1px 2px rgba(120, 70, 0, .1); }
.card-action button { background: var(--poa-amber); color: #FFF8EE; }

/* ---------- 入力欄 ---------- */
.composer { border-radius: 22px; border-color: color-mix(in srgb, #A0522D 45%, transparent); }
.composer:focus-within { border-color: var(--poa-amber); box-shadow: var(--shadow-1), 0 0 0 4px color-mix(in srgb, var(--poa-orange) 22%, transparent); }
.send { border-radius: 50%; background: var(--poa-orange-2); color: #2B1D0C; }
.send:hover { background: var(--poa-orange); }
.suggest-chip { border-color: transparent; background: color-mix(in srgb, var(--paper) 88%, transparent); }
.suggest-chip:hover { border-color: var(--poa-orange); }
.suggest-desk { border: 1px dashed var(--poa-amber); color: var(--poa-amber); }
.case-pill { background: var(--paper); color: var(--poa-amber); }
.cost { color: color-mix(in srgb, var(--ink-3) 80%, var(--poa-amber)); }

/* ---------- 右のパネル・ボタン ---------- */
.btn-primary { background: var(--poa-amber); color: #FFF8EE; }
.btn-primary:hover { background: #A36400; }
.btn-brass { background: var(--poa-orange); color: #2B1D0C; }
.drawer-tabs button[aria-selected="true"] { box-shadow: inset 0 -2px 0 var(--poa-orange), 0 1px 2px rgba(0,0,0,.06); }
.switch-row input:checked + .switch { background: var(--poa-orange-2); }
.concierge-mark { background: var(--poa-amber); color: #FFF8EE; }
.operator-desk button[type=submit] { background: var(--poa-amber); color: #FFF8EE; }
.demo-advance button[type=submit], .payment-confirm-form button[type=submit] { background: var(--poa-orange) !important; color: #2B1D0C !important; }
.toast { background: #3A2610; color: #FFF8EE; }
html[data-theme="dark"] .btn-primary, html[data-theme="dark"] .call-btn, html[data-theme="dark"] .operator-desk button[type=submit], html[data-theme="dark"] .card-action button { background: var(--poa-orange); color: #1B130B; }

/* ---------- スマートフォンの下部バー(AI相談 / 通話 / ウォレット) ---------- */
.cx-tabbar { display: none; }
@media (max-width: 860px) {
  .cx-tabbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 6px 22px calc(6px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); }
  .cx-tabbar .tab { display: grid; justify-items: center; gap: 1px; padding: 4px 8px; border-radius: 12px; color: var(--ink); font-size: 10.5px; font-weight: 600; text-decoration: none; }
  .cx-tabbar .tab:first-child { justify-self: start; }
  .cx-tabbar .tab:last-child { justify-self: end; }
  .cx-tabbar .tab-ic { display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid currentColor; border-radius: 50%; font-family: var(--brand-font); font-weight: 700; font-size: 14px; line-height: 1; }
  .cx-tabbar .tab-ic.is-square { border-radius: 9px; width: 40px; }
  .cx-tabbar .tab-call .tab-ic { width: 46px; height: 46px; border: 0; background: var(--poa-amber); color: #FFF8EE; box-shadow: 0 3px 0 rgba(90, 50, 0, .25); }
  html[data-theme="dark"] .cx-tabbar .tab-call .tab-ic { background: var(--poa-orange); color: #1B130B; }
  .cx-tabbar .tab-call .tab-ic .ic { width: 22px; height: 22px; }
  .cx-dock { padding-bottom: 8px; }
  .call-btn { display: none; }
}

/* ---------- ページ(予約・アカウント)と入口(ログイン・登録) ---------- */
.pg-top { background: color-mix(in srgb, var(--paper) 94%, transparent); }
.pg-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--poa-orange); }
.pg-title, .pg-card-h, .gate-title, .settings legend, .mem-intro h2, .operator-head strong { font-family: var(--sans); font-weight: 700; letter-spacing: .02em; }
.pg-card { border-color: transparent; box-shadow: var(--shadow-1); }
.bk-date b { font-family: var(--brand-font); }
.steps li.is-done::before { background: var(--poa-amber); border-color: var(--poa-amber); color: #FFF8EE; }
.steps li.is-done::after, .steps li.is-current::after { background: var(--poa-amber); }

/* 入口: 仕様書の「初期ログイン画面」— オレンジの地に白い帯、上に THE POAi とマーク */
body.gate-body { background: var(--poa-orange); }
.gate { position: relative; gap: 18px; background: linear-gradient(90deg, transparent calc(50% - 250px), var(--paper) calc(50% - 250px), var(--paper) calc(50% + 250px), transparent calc(50% + 250px)); }
.gate.is-wide { background: linear-gradient(90deg, transparent calc(50% - 360px), var(--paper) calc(50% - 360px), var(--paper) calc(50% + 360px), transparent calc(50% + 360px)); }
.gate-brand { flex-direction: column; gap: 14px; color: var(--poa-mark); font-family: var(--brand-font); font-size: 30px; font-weight: 400; letter-spacing: .02em; }
.gate-brand .poa-mark { font-size: 120px; }
.gate-card { border: 0; box-shadow: none; background: transparent; padding: 8px 30px 18px; }
.gate-title { text-align: center; font-size: 20px; }
.gate-lead { text-align: center; }
.gate-form > label.field:only-of-type .field-label { text-align: center; font-weight: 500; font-size: 14px; color: var(--ink); }
.gate-form input:not([type=checkbox]), .gate-form select { background: #FFE4DC; border-color: color-mix(in srgb, #A0522D 40%, transparent); border-radius: 6px; }
.gate-form input:focus { border-color: var(--poa-amber); box-shadow: 0 0 0 3px color-mix(in srgb, var(--poa-orange) 30%, transparent); }
.gate-card .btn-primary { background: var(--poa-orange); color: #2B1D0C; border-radius: 999px; font-weight: 700; }
.gate-card .btn-primary:hover { background: var(--poa-orange-2); }
.gate-card .btn-quiet { border-radius: 999px; }
.gate-mark { color: var(--poa-amber); font-family: var(--brand-font); }
.gate-below a { color: var(--ink-2); }
.devcode { background: var(--brass-soft); color: var(--poa-amber); }
html[data-theme="dark"] body.gate-body { background: #6B4200; }
html[data-theme="dark"] .gate-form input:not([type=checkbox]) { background: #3A2618; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) body.gate-body { background: #6B4200; }
  html:not([data-theme]) .gate-form input:not([type=checkbox]) { background: #3A2618; }
}
@media (max-width: 560px) {
  .gate { background: linear-gradient(90deg, transparent 9%, var(--paper) 9%, var(--paper) 91%, transparent 91%); padding: 32px 10% 40px; }
  .gate-card { padding: 4px 6px 12px; }
  .gate-brand .poa-mark { font-size: 96px; }
}

/* 設定パネル: オペレーターからの着信の通知 */
.push-box { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.push-box .panel-h { margin: 0; }

/* 通知をオンにする案内(会話画面の上) */
.push-nudge { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; margin: 12px auto 4px; max-width: 760px; padding: 12px 14px;
  border-radius: 16px; background: linear-gradient(135deg, #FFF1D6, #FFE2B0); color: #2B1D0C; box-shadow: 0 6px 18px rgba(140, 80, 0, .12); }
.push-nudge[hidden] { display: none; }
.push-nudge-icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #2B1D0C; color: #FFA300; }
.push-nudge-text { display: grid; gap: 2px; font-size: 13px; line-height: 1.55; min-width: 0; }
.push-nudge-text b { font-size: 14px; }
.push-nudge-on { border: 0; border-radius: 999px; padding: 9px 14px; background: #2B1D0C; color: #fff; font-weight: 700; font-size: 13px; white-space: nowrap; cursor: pointer; }
.push-nudge-x { border: 0; background: transparent; color: #6B4E2C; font-size: 20px; line-height: 1; padding: 4px 6px; cursor: pointer; }
@media (max-width: 560px) {
  .push-nudge { grid-template-columns: auto 1fr auto; margin: 10px 10px 4px; }
  .push-nudge-on { grid-column: 2 / 4; grid-row: 2; justify-self: start; }
  .push-nudge-x { grid-column: 3; grid-row: 1; align-self: start; }
}
:root[data-theme="dark"] .push-nudge { background: #3A2A12; color: #FFF1D6; }
:root[data-theme="dark"] .push-nudge-x { color: #E8CFA6; }

/* 送信の取り消し(計画書 docs/plan-poai-feedback-16.md 3.6): 取り消した文は灰色・斜体、取消の操作は小さい文字のリンクの見た目 */
.m-user .m-text.is-retracted { background: transparent; color: var(--ink-3); font-style: italic; box-shadow: none; border: 1px dashed color-mix(in srgb, var(--ink-3) 60%, transparent); }
.m-user .m-retract { grid-column: 1 / -1; justify-self: end; margin: 2px 2px 0; }
.m-retract-btn { border: 0; background: transparent; padding: 0; color: var(--ink-3); font-size: 11.5px; text-decoration: underline; cursor: pointer; }
.m-retract-btn:hover, .m-retract-btn:focus-visible { color: var(--ink-2); }
.m-retract-btn:disabled { opacity: .5; cursor: default; }
