:root {
  --ground: #F3F4F6;
  --surface: #FFFFFF;
  --ink: #15171C;
  --sub: #4B5260;
  --line: #E2E5EA;
  --line-soft: #EEF0F3;
  --control: #C9CDD4;
  --gleam: #E8A33D;
  --gleam-soft: #F6E3BF;
  --gleam-ink: #5A3A05;
  --ok: #1F7A4D;
  --ok-soft: #E6F4EC;
  --ok-ink: #17573A;
  --bad: #B42318;
  --bad-soft: #FDECEA;
  --bad-ink: #8A1A12;
  --info-soft: #E3ECF8;
  --info-ink: #1D3D6B;
  --hero: #15171C;
  --hero-ink: #FFFFFF;
  --hero-sub: #C9CDD4;
  --primary: #15171C;
  --primary-ink: #FFFFFF;
  --tabs-h: 65px;   /* 下のタブの高さ（safe-area の分は含まない）。話す画面の入力欄はこの上に置く */
  --kb: 0px;        /* iPhone のキーボードの高さ（app.js が visualViewport から付け直す） */
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'IBM Plex Sans JP', 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0E0F12;
    --surface: #1A1C21;
    --ink: #F1F2F4;
    --sub: #A9AFBA;
    --line: #2B2E35;
    --line-soft: #24272D;
    --control: #454A54;
    --gleam: #F0B456;
    --gleam-soft: #3D2E14;
    --gleam-ink: #F6D9A4;
    --ok: #5CC28E;
    --ok-soft: #12301F;
    --ok-ink: #A6E2C2;
    --bad: #FF8A7E;
    --bad-soft: #3A1714;
    --bad-ink: #FFC2BA;
    --info-soft: #18263A;
    --info-ink: #B9CFEF;
    --hero: #24272E;
    --hero-ink: #FFFFFF;
    --hero-sub: #B4BAC4;
    --primary: #F1F2F4;
    --primary-ink: #15171C;
  }
}
:root[data-theme="dark"] {
    --ground: #0E0F12;
    --surface: #1A1C21;
    --ink: #F1F2F4;
    --sub: #A9AFBA;
    --line: #2B2E35;
    --line-soft: #24272D;
    --control: #454A54;
    --gleam: #F0B456;
    --gleam-soft: #3D2E14;
    --gleam-ink: #F6D9A4;
    --ok: #5CC28E;
    --ok-soft: #12301F;
    --ok-ink: #A6E2C2;
    --bad: #FF8A7E;
    --bad-soft: #3A1714;
    --bad-ink: #FFC2BA;
    --info-soft: #18263A;
    --info-ink: #B9CFEF;
    --hero: #24272E;
    --hero-ink: #FFFFFF;
    --hero-sub: #B4BAC4;
    --primary: #F1F2F4;
    --primary-ink: #15171C;
  }


* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.app { max-width: 560px; margin: 0 auto; min-height: 100dvh; }
.view { padding: calc(env(safe-area-inset-top) + 20px) 16px calc(env(safe-area-inset-bottom) + var(--tabs-h) + 35px); display: flex; flex-direction: column; gap: 12px; outline: none; }

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 0 4px 4px; }
.head .eyebrow { font-size: 13px; color: var(--sub); }
.head h1 { margin: 2px 0 0; font-size: 28px; font-weight: 700; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .04em; font-size: 15px; }
.brand::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--gleam); box-shadow: 0 0 0 4px var(--gleam-soft); }

.panel { background: var(--surface); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.panel-label { font-size: 12px; color: var(--sub); margin: 0; font-weight: 400; }
.muted { color: var(--sub); font-size: 14px; }
.plain { text-decoration: none; }
.block { display: block; }
.mono { font-family: var(--mono); }

.status { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.status div { display: flex; flex-direction: column; gap: 4px; }
.status span:first-child { font-size: 12px; color: var(--sub); }
.status b { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.status .ok { color: var(--ok); }
.status .bad { color: var(--bad); }

.hero { text-decoration: none; background: var(--hero); color: var(--hero-ink); border-radius: 20px; padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.hero .sub { font-size: 13px; color: var(--hero-sub); }
.hero .big { display: flex; align-items: baseline; gap: 8px; }
.hero .big b { font-family: var(--mono); font-size: 48px; line-height: 1; }
.hero .big span { font-size: 17px; font-weight: 500; }
.hero .list { font-size: 14px; line-height: 1.6; color: var(--hero-sub); }
.hero .pill { align-self: flex-start; background: var(--gleam); color: #15171C; font-weight: 700; font-size: 15px; border-radius: 999px; padding: 10px 18px; }
.hero.calm .big b { font-size: 32px; }

.alert-link { text-decoration: none; background: var(--bad-soft); border-radius: 16px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; min-height: 64px; }
.alert-link .t { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.alert-link .t b { font-size: 15px; color: var(--bad-ink); }
.alert-link .t span { font-size: 13px; color: var(--bad-ink); opacity: .85; }
.alert-link.normal { background: var(--surface); }
.alert-link.normal .t b, .alert-link.normal .t span { color: var(--ink); }

.counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.counts div { display: flex; flex-direction: column; gap: 2px; }
.counts b { font-family: var(--mono); font-size: 24px; }
.counts span { font-size: 12px; color: var(--sub); }

.card { background: var(--surface); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card .meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card h2 { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.45; }
.card p { margin: 0; font-size: 15px; line-height: 1.65; white-space: pre-line; }
.card pre.code { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--ground); font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.card dl { margin: 0; display: grid; grid-template-columns: 76px minmax(0, 1fr); row-gap: 4px; column-gap: 8px; font-size: 14px; }
.card dt { color: var(--sub); }
.card dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.card ul { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.7; }
.card .sec { font-size: 13px; color: var(--sub); margin: 4px 0 0; font-weight: 500; }

.tag { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 10px; background: var(--gleam-soft); color: var(--gleam-ink); white-space: nowrap; }
.tag.high { background: var(--bad-soft); color: var(--bad-ink); }
.tag.ok { background: var(--ok-soft); color: var(--ok-ink); }
.tag.info { background: var(--info-soft); color: var(--info-ink); }
.tag.dark { background: var(--primary); color: var(--primary-ink); }
.tag.mute { background: var(--line); color: var(--sub); }
.tag.warn { background: var(--gleam-soft); color: var(--gleam-ink); }
.by { font-size: 12px; color: var(--sub); }

.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.btn { min-height: 44px; border-radius: 12px; border: 1px solid var(--control); background: var(--surface); font-size: 15px; font-weight: 500; padding: 0 12px; }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); font-weight: 700; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.btn.wide { width: 100%; min-height: 52px; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: default; }

.options { display: flex; flex-direction: column; gap: 8px; }
.option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--control); border-radius: 14px; background: var(--surface); min-height: 64px; text-align: left; }
.option input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--ink); }
.option:has(input:checked) { border: 2px solid var(--ink); padding: 11px 13px; }
.option b { display: block; font-size: 15px; }
.option span { display: block; font-size: 13px; color: var(--sub); line-height: 1.5; margin-top: 2px; }

.note { display: flex; flex-direction: column; gap: 8px; }
textarea { width: 100%; border: 1px solid var(--control); border-radius: 12px; padding: 12px; font-size: 16px; line-height: 1.6; resize: vertical; background: var(--surface); }
.decided { display: flex; align-items: center; justify-content: space-between; background: var(--ground); border-radius: 12px; padding: 4px 4px 4px 12px; }
.decided b { font-size: 14px; }
.link-btn { min-height: 44px; border: 0; background: transparent; color: var(--sub); text-decoration: underline; padding: 0 10px; font-size: 14px; }

.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--line); border-radius: 12px; padding: 3px; }
.segmented a { min-height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 10px; text-decoration: none; color: var(--sub); font-size: 14px; }
.segmented a[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 700; }

.timeline { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: 16px; }
.timeline li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.timeline li:last-child { border-bottom: 0; }
.timeline time { font-family: var(--mono); font-size: 13px; color: var(--sub); padding-top: 2px; }
.timeline .ev { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.timeline .ev span { font-size: 14px; line-height: 1.55; }
.timeline .ev a { font-size: 13px; color: var(--sub); }

.flow { display: flex; flex-direction: column; }
.step { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 12px; }
.step .step-rail { display: flex; flex-direction: column; align-items: center; }
.step .dot { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 12px; font-weight: 700; border: 2px solid var(--control); color: var(--sub); background: var(--surface); }
.step.done .dot { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.step.now .dot { background: var(--gleam); border-color: var(--gleam); color: #15171C; box-shadow: 0 0 0 4px var(--gleam-soft); }
.step .bar { flex: 1; width: 2px; min-height: 22px; background: var(--control); }
.step.done .bar { background: var(--primary); }
.step .txt { display: flex; flex-direction: column; gap: 2px; padding-bottom: 14px; }
.step .txt b { font-size: 15px; }
.step.next .txt b { color: var(--sub); }
.step .txt span { font-size: 13px; color: var(--sub); line-height: 1.5; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 16px; border: 1px solid var(--control); border-radius: 999px; background: var(--surface); font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); font-weight: 700; }
.row { display: flex; gap: 8px; }
.row .btn { flex: 1; }
.icon-btn { width: 48px; min-height: 48px; border: 1px solid var(--control); border-radius: 12px; background: var(--surface); display: flex; align-items: center; justify-content: center; }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.req { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; line-height: 1.5; }
.req:last-child { border-bottom: 0; }

.empty { text-align: center; padding: 32px 16px; color: var(--sub); font-size: 15px; background: var(--surface); border-radius: 16px; }
.error { background: var(--bad-soft); color: var(--bad-ink); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
/* 最終更新：画面の末尾（.view の下余白がタブバーと safe-area の分を取っている） */
.stamp { margin: 4px 0 0; text-align: center; color: var(--sub); font-size: 12px; }
.stamp.bad { color: var(--bad); }
.back { align-self: flex-start; min-height: 44px; display: flex; align-items: center; gap: 4px; text-decoration: none; font-size: 15px; }
.back svg, .alert-link svg, .status svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; box-sizing: border-box; height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 8px max(12px, calc((100vw - 560px) / 2)) calc(env(safe-area-inset-bottom) + 8px); }
.tabs a { position: relative; text-decoration: none; color: var(--sub); display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; min-height: 48px; justify-content: center; }
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--gleam); color: #15171C; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 5px; font-family: var(--mono); }
.badge[hidden] { display: none; }

/* ボタンが4つ以上のときは2列に（注文カードなど） */
.actions.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.actions.grid2 .btn { width: 100%; min-height: 48px; }

/* 進み具合 */
.segmented.three { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(max-content, 1fr); overflow-x: auto; scrollbar-width: none; }
.segmented.three a { padding: 0 10px; white-space: nowrap; }
.prog { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: inherit; }
.prog:last-child { border-bottom: 0; }
.prog-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 15px; }
.prog-head b { font-weight: 600; line-height: 1.4; }
.bar-track { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--gleam); transition: width .4s ease; }
.bar-fill.waiting { background: var(--sub); }
.bar-fill.queued { background: var(--sub); opacity: .35; }
.bar-fill.done { background: var(--ok, #2f9e6a); }
.prog-sub { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--sub); }
.bar-fill.held, .bar-fill.paused { background: var(--sub); opacity: .6; }
/* runner の様子（経過・最後にしたこと・順番など） */
.prog-info { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: var(--sub); overflow-wrap: anywhere; }
/* 保留・中断の行：<a> の下に「再開」を並べる */
.prog-item { border-bottom: 1px solid var(--line-soft); padding-bottom: 12px; }
.prog-item:last-child { border-bottom: 0; }
.prog-item > .prog { border-bottom: 0; padding-bottom: 8px; }
.prog-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.prog-act .btn { min-width: 96px; }
.runner-line { display: flex; padding: 8px 0 4px; }
.prog.queued-line { flex-direction: row; justify-content: space-between; align-items: center; min-height: 44px; font-size: 14px; color: var(--sub); }
.prog.queued-line svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; }
.req.col { flex-direction: column; align-items: stretch; }
.req-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-label[href] { text-decoration: none; }
/* カードの画像 */
.card img.shot { width: 100%; max-height: 360px; object-fit: contain; object-position: top; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: zoom-in; }
.card img.shot.zoom { max-height: none; cursor: zoom-out; }

/* 話す */
.talk { display: flex; flex-direction: column; gap: 10px; }
/* 「秘書が考えています」の後ろの空き。高さは入力欄に合わせて app.js が付け直す（これは測れないときの値） */
.talk-spacer { flex: none; height: 220px; }
.bubble { max-width: 86%; padding: 10px 13px; border-radius: 16px; font-size: 15px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.me { align-self: flex-end; background: var(--hero); color: var(--hero-ink); border-bottom-right-radius: 6px; }
.bubble.sec { align-self: flex-start; background: var(--surface); border-bottom-left-radius: 6px; }
.bubble img { display: block; width: 100%; margin-top: 8px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: zoom-in; }
.bubble time { display: block; font-size: 11px; color: var(--sub); margin-top: 4px; }
.bubble.me time { color: inherit; opacity: .7; text-align: right; }
.talk-typing { align-self: flex-start; font-size: 13px; color: var(--sub); padding: 4px 8px; }
/* 入力まわりは画面の下（タブの上）に固定。上から 引用・添付・切り替えの1行・入力の行。
   入力の行は左に📎🎤、右下（親指の届く所）に「送る」 */
.talk-box { position: fixed; z-index: 5; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + var(--tabs-h)); padding: 6px max(12px, calc((100vw - 560px) / 2)) 8px; background: var(--ground); display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); }
.talk-input { display: flex; gap: 6px; align-items: flex-end; }
.talk-input textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 160px; padding: 10px 12px; resize: none; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.talk-input .icon-btn { width: 44px; min-height: 44px; flex: none; }
.talk-input .send-btn { min-height: 44px; min-width: 88px; flex: none; }
/* キーボードが出ている間：タブを隠し、入力欄をキーボードのすぐ上へ */
body.kb-open .tabs { display: none; }
body.kb-open .talk-box { bottom: var(--kb); }
.mode-row { display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.mode-row::-webkit-scrollbar { display: none; }
.mode-label { flex: none; font-size: 12px; color: var(--sub); padding-right: 2px; }
.chip.sm { flex: none; min-height: 44px; padding: 0 12px; font-size: 13px; white-space: nowrap; }
.chip.memo[aria-pressed="true"] { background: var(--gleam); border-color: var(--gleam); color: #15171C; }
/* 聞き取り中。文字色は --bad-soft（明るい地では白に近く、ダークでは濃い色になり、どちらも読める） */
.icon-btn.listening { background: var(--bad); border-color: var(--bad); color: var(--bad-soft); animation: pulse 1s ease-in-out infinite; }
.icon-btn:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.talk-hint { font-size: 12px; color: var(--sub); padding: 0 4px; }
.quote-bar { display: flex; align-items: center; gap: 4px; background: var(--surface); border-left: 3px solid var(--gleam); border-radius: 8px; padding-left: 10px; font-size: 13px; color: var(--sub); }
.quote-bar .q { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-bar[hidden], .att-tray[hidden], .talk-hint[hidden], .req-strip[hidden] { display: none; }
/* 送る前の添付（×は 44px の押せる範囲を角にはみ出させる） */
.att-tray { display: flex; gap: 14px; overflow-x: auto; padding: 14px 14px 0 2px; }
.att-chip { position: relative; flex: none; height: 56px; min-width: 56px; max-width: 160px; display: flex; align-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.att-chip img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; }
.att-chip .att-name { padding: 0 12px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-x { flex: none; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; color: var(--ink); }
.att-chip .att-x { position: absolute; top: -14px; right: -14px; }
.att-x svg { width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
/* 吹き出しの添付 */
.att-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bubble .att-list img.att-img { flex: 1 1 140px; width: auto; max-width: 100%; max-height: 240px; margin-top: 0; object-fit: cover; }
.att-file { display: inline-flex; align-items: center; max-width: 100%; min-height: 44px; padding: 0 12px; border-radius: 999px; background: color-mix(in srgb, currentColor 14%, transparent); font-size: 13px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-file.gone { opacity: .7; }
.lightbox { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .88); display: flex; align-items: center; justify-content: center; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); cursor: zoom-out; outline: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
/* 秘書の吹き出しの🔊 */
.bubble-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 0 -10px -8px 0; }
.speak-btn { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--sub); display: flex; align-items: center; justify-content: center; }
.speak-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.speak-btn[aria-pressed="true"] { color: var(--gleam); animation: pulse 1.2s ease-in-out infinite; }
/* 依頼・メモの控え（自分の側に、点線の枠で会話と見分ける） */
.bubble.receipt { background: var(--surface); color: var(--ink); border: 1.5px dashed var(--control); display: flex; flex-direction: column; gap: 2px; font-size: 13px; white-space: normal; }
.bubble.receipt .receipt-text { color: var(--sub); }
/* 話す画面の上：頼んだことの進み具合（横に並べ、はみ出したら横スクロール） */
.req-strip { position: sticky; top: 0; z-index: 4; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: calc(env(safe-area-inset-top) + 6px) 16px 6px; background: var(--ground); }
.req-strip::-webkit-scrollbar { display: none; }
.req-chip { flex: none; display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--surface); font-size: 13px; text-decoration: none; white-space: nowrap; }
.req-chip .tag { padding: 2px 8px; font-size: 11px; }
.talk-note { margin: 0; text-align: center; font-size: 12px; color: var(--sub); }
/* ホームの「中身が見える」欄 */
.home-list { list-style: none; margin: 0; padding: 0; }
.home-list li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0 0; border-top: 1px solid var(--line-soft); }
.home-list li:first-child { border-top: 0; padding-top: 0; }
.home-list p { margin: 0; font-size: 14px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.home-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.home-foot .quote-btn { margin-left: auto; padding-right: 0; }

.card dd a.ext { color: var(--gleam-ink, inherit); text-decoration: underline; text-underline-offset: 3px; }
.card .assure { font-size: 13px; color: var(--sub); background: var(--ground); border-radius: 10px; padding: 8px 10px; }

/* 長い文は2〜3行で畳む（押すと全部） */
.card p.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.card dd.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
/* 承認：決めたものは薄く重ねる */
.stack { display: flex; flex-direction: column; gap: 12px; }
.past-head { margin: 8px 4px 0; }
.stack.past .card { opacity: .55; transform: scale(.98); }
.stack.past .card + .card { margin-top: -6px; }
.stack.past .card.ghost h2 { font-size: 15px; }

/* 秘書のいま */
.sec-line { flex-direction: row; align-items: center; gap: 10px; font-size: 14px; }
.sec-line .muted { margin-left: auto; font-size: 12px; }
.sec-line .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sub); flex: none; }
.sec-line.busy .dot { background: var(--gleam); animation: pulse 1.2s ease-in-out infinite; }
.sec-line.stale .dot { background: var(--bad, #c0392b); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.talk-typing::after { content: ''; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* 右上の秘書（丸いからだと目だけの相棒。avatar.js） */
.lamp { position: fixed; top: calc(env(safe-area-inset-top) + 14px); right: max(12px, calc((100vw - 560px) / 2 + 10px)); z-index: 20;
  width: 56px; height: 56px; border: 0; background: transparent; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.head { padding-right: 64px; }
.buddy { --c1: var(--gleam); --c2: #F7C978; --beat: 1s; --lx: 0px; --ly: 0px;
  position: absolute; inset: 0; display: block; }
.buddy-body { position: absolute; left: 10px; top: 10px; width: 36px; height: 36px; transform-origin: 50% 100%;
  animation: buddy-breathe 4.2s ease-in-out infinite; }
.buddy-blob { position: absolute; inset: 0; border-radius: 46% 54% 50% 50% / 52% 48% 52% 48%;
  background: radial-gradient(circle at 35% 30%, var(--c2), var(--c1) 70%);
  box-shadow: inset 0 -3px 6px rgba(0,0,0,.10), 0 2px 8px color-mix(in srgb, var(--c1) 35%, transparent);
  animation: buddy-morph 7s ease-in-out infinite; transition: background .6s, filter .6s; }
.buddy-shadow { position: absolute; left: 16px; bottom: 6px; width: 24px; height: 4px; border-radius: 50%;
  background: rgba(0,0,0,.12); filter: blur(1px); transition: transform .3s; }
.buddy-eyes { position: absolute; inset: 0; display: flex; justify-content: center; gap: 7px; padding-top: 11px;
  transform: translate(var(--lx), var(--ly)); transition: transform .35s cubic-bezier(.3,.7,.3,1); }
.buddy-eyes i { width: 5px; height: 11px; border-radius: 3px; background: #2A2016; transform-origin: 50% 60%;
  transition: transform .14s, height .2s, border-radius .2s; }
.buddy.blink .buddy-eyes i { transform: scaleY(.12); }
.buddy-think { position: absolute; right: 0; top: 2px; width: 18px; height: 8px; display: none; gap: 2px; }
.buddy-think i { width: 4px; height: 4px; border-radius: 50%; background: var(--sub); opacity: .25; animation: buddy-dot 1.2s infinite; }
.buddy-think i:nth-child(2) { animation-delay: .2s; } .buddy-think i:nth-child(3) { animation-delay: .4s; }
.buddy-ping { position: absolute; right: 6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: #E5484D;
  box-shadow: 0 0 0 2px var(--ground); display: none; }

/* 考え中：目が上、横に「…」 */
.buddy.m-chat .buddy-eyes { transform: translate(3px, -3px); }
.buddy.m-chat .buddy-think { display: flex; }
.buddy.m-chat .buddy-body { animation: buddy-tilt 2.4s ease-in-out infinite; }
/* 作業中：目を細めて弾む（並行が多いほど速い） */
.buddy.m-task .buddy-eyes i { transform: scaleY(.45); }
.buddy.m-task .buddy-body { animation: buddy-hop var(--beat) cubic-bezier(.4,0,.6,1) infinite; }
.buddy.m-task .buddy-shadow { animation: buddy-shadow var(--beat) cubic-bezier(.4,0,.6,1) infinite; }
/* 巡回中：読むように目が左右へ */
.buddy.m-patrol .buddy-eyes { animation: buddy-read 2.8s ease-in-out infinite; }
.buddy.m-patrol .buddy-eyes i { transform: scaleY(.7); }
/* あなたの番：赤い点、ときどき跳ねて呼ぶ */
.buddy.m-you .buddy-ping { display: block; animation: buddy-ping 1.6s ease-out infinite; }
.buddy.m-you .buddy-body { animation: buddy-call 2.2s ease-in-out infinite; }
.buddy.m-you .buddy-eyes i { height: 12px; }
/* 止まっているかも：かしげて、目が「ー ー」 */
.buddy.m-stuck { --c1: #D98A3A; --c2: #EDB77A; }
.buddy.m-stuck .buddy-body { animation: none; transform: rotate(-12deg); }
.buddy.m-stuck .buddy-eyes i { height: 3px; border-radius: 2px; margin-top: 4px; }
.buddy.m-stuck .buddy-blob { animation: buddy-morph 3s ease-in-out infinite; }
/* 連絡なし：目を閉じて、色が抜けて沈む */
.buddy.m-off .buddy-blob { filter: grayscale(1) brightness(.85); opacity: .7; }
.buddy.m-off .buddy-body { animation: buddy-sleep 5s ease-in-out infinite; }
.buddy.m-off .buddy-eyes i { height: 2px; border-radius: 2px; margin-top: 5px; }

@keyframes buddy-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.04, .97); } }
@keyframes buddy-morph { 0%, 100% { border-radius: 46% 54% 50% 50% / 52% 48% 52% 48%; }
  33% { border-radius: 52% 48% 46% 54% / 48% 54% 46% 52%; } 66% { border-radius: 48% 52% 54% 46% / 54% 46% 50% 50%; } }
@keyframes buddy-hop { 0%, 100% { transform: translateY(0) scale(1.06, .92); } 45% { transform: translateY(-6px) scale(.96, 1.05); }
  60% { transform: translateY(-6px) scale(1, 1); } }
@keyframes buddy-shadow { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.7); opacity: .6; } }
@keyframes buddy-tilt { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(6deg); } }
@keyframes buddy-read { 0%, 100% { transform: translate(-3px, 1px); } 50% { transform: translate(3px, 1px); } }
@keyframes buddy-call { 0%, 70%, 100% { transform: translateY(0); } 78% { transform: translateY(-7px) scale(.96, 1.05); } 86% { transform: translateY(0) scale(1.05, .95); } }
@keyframes buddy-ping { 0% { box-shadow: 0 0 0 0 rgba(229,72,77,.5); } 100% { box-shadow: 0 0 0 8px rgba(229,72,77,0); } }
@keyframes buddy-dot { 0%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
@keyframes buddy-sleep { 0%, 100% { transform: translateY(2px) scale(1.03, .96); } 50% { transform: translateY(3px) scale(1.05, .94); } }
@media (prefers-reduced-motion: reduce) { .buddy * { animation: none !important; } }

.lamp-count { position: absolute; left: 0; bottom: 2px; font: 700 10px/1 "IBM Plex Mono", monospace; background: var(--ink); color: var(--surface);
  border-radius: 8px; padding: 2px 5px; }
.lamp.open::after { content: attr(data-tip); position: absolute; top: 58px; right: 0; width: max-content; max-width: min(80vw, 320px); white-space: normal;
  text-align: left; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12); }
/* メール（秘書が送ったものと返信） */
.card.mail > summary { list-style: none; cursor: pointer; display: grid; gap: 4px; }
.card.mail > summary::-webkit-details-marker { display: none; }
.card.mail .tag { justify-self: start; }
.card.mail .tag.ok { background: #E7F6EE; color: #17804B; }
.card.mail .reply { border-left: 3px solid var(--line); padding: 4px 0 4px 10px; margin-top: 10px; }
.card.mail .reply p { margin: 2px 0 0; }
.card.mail .sent { margin-top: 10px; }
.card.mail .sent pre { white-space: pre-wrap; font: inherit; font-size: 13px; background: var(--ground); padding: 10px; border-radius: 8px; }

/* 読み込み中の骨組み */
.skeleton { display: grid; gap: 12px; }
.sk { border-radius: 10px; background: linear-gradient(90deg, var(--line-soft), var(--line), var(--line-soft)); background-size: 200% 100%; animation: sk 1.2s ease-in-out infinite; }
.sk-eyebrow { width: 30%; height: 12px; } .sk-title { width: 55%; height: 28px; } .sk-card { height: 96px; } .sk-card.short { height: 56px; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }

/* 流れ（見張り役） */
.watchlist { display: grid; gap: 8px; }
.watchrow { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; }
.watchrow b { font-weight: 500; display: block; }
.tag.warn { background: #FFF1D6; color: #8A5300; }
.flowbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--sub); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.flowlog { list-style: none; margin: 0; padding: 0; font-size: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.fl { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 7px 12px; border-top: 1px solid var(--line-soft); }
.fl:first-child { border-top: 0; }
.fl time { font-family: var(--mono); font-size: 12px; color: var(--sub); min-width: 3.2em; font-variant-numeric: tabular-nums; }
.fl code { font-family: var(--mono); font-size: 12px; background: var(--line-soft); border-radius: 4px; padding: 0 5px; }
.fl .dir, .fl .job { color: var(--sub); font-size: 12px; }
.fl .path, .fl .k { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.fl .note { color: var(--sub); }
.fl .st.invalid, .fl .err { color: #C0392B; }
.fl .st.retry { color: #8A5300; }
.fl.trace.write code { background: var(--gleam-soft); color: var(--gleam-ink); }
.fl.trace[class*="watch:"] { background: rgba(229, 72, 77, .07); }

/* 机向け（横幅 1100px 以上）：左にメニュー・真ん中に画面・右に秘書の様子 */
.rail { display: none; }
@media (min-width: 1100px) {
  body.wide { --pl: max(24px, calc((100vw - 1296px) / 2)); }
  body.wide .app { max-width: none; width: 720px; margin: 0 0 0 calc(var(--pl) + 244px); }
  body.wide .view { padding: 32px 0 48px; }
  body.wide .head { padding-right: 4px; }
  body.wide .tabs { top: 0; bottom: 0; right: auto; left: var(--pl); width: 220px; height: auto; display: flex; flex-direction: column; gap: 4px;
    padding: 32px 12px; border-top: 0; border-right: 1px solid var(--line); background: transparent; }
  body.wide .tabs a { flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 15px; min-height: 44px; padding: 0 12px; border-radius: 10px; }
  body.wide .tabs a[aria-current="page"] { background: var(--surface); box-shadow: 0 1px 0 var(--line); }
  body.wide .tabs a:hover { background: var(--surface); }
  body.wide .badge { position: static; margin-left: auto; }
  body.wide .talk-box { left: calc(var(--pl) + 244px); right: auto; width: 720px; bottom: 0; padding: 8px 0 16px; }
  body.wide .rail { display: flex; flex-direction: column; gap: 12px; position: fixed; top: 0; bottom: 0; left: calc(var(--pl) + 244px + 720px + 32px); width: 300px;
    padding: 32px 0 24px; overflow-y: auto; }
  body.wide .rail .lamp { position: relative; top: auto; right: auto; width: 84px; height: 84px; }
  body.wide .rail .buddy { transform: scale(1.4); transform-origin: 0 0; }
  .rail h3 { margin: 12px 0 0; font-size: 12px; color: var(--sub); font-weight: 500; letter-spacing: .04em; }
  .rail-status { margin: 0; font-size: 14px; line-height: 1.6; }
  .rail-you, .rail-watch { display: block; text-decoration: none; border-radius: 10px; padding: 10px 12px; font-weight: 700; font-size: 14px; }
  .rail-you { background: var(--gleam-soft); color: var(--gleam-ink); }
  .rail-watch { background: rgba(229, 72, 77, .12); color: #C0392B; }
  .rail-flows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
  .rail-flows .empty { color: var(--sub); font-size: 13px; }
  .rail-more { font-size: 13px; color: var(--sub); }
  body.wide .lamp.open::after { left: 0; right: auto; top: 90px; }
}

/* 10/22 精査：数字と時刻は折り返さない（「8%・たった今」が縦に割れていた） */
.prog-sub span:last-child, .sec-line .muted { white-space: nowrap; flex-shrink: 0; }
.prog-sub { gap: 8px; }
/* 右の欄の仕事は1行ずつ（題名と状態だけ。中身は真ん中の画面で見る） */
.rail-flows .rail-flow { display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; padding: 6px 0; border-bottom: 1px solid var(--line); }
.rail-flows .rail-flow b { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-flows .rail-flow .tag { flex-shrink: 0; }
.rail-flows { grid-template-columns: minmax(0, 1fr); }
.rail-flows li { min-width: 0; }
.card > .flow { margin-top: 16px; }
.hero .list { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* 止まっているかも（長く更新の無い進行中・許可待ち） */
.bar-fill.stale { background: var(--control); }
.tag.bad { background: rgba(229, 72, 77, .12); color: #C0392B; }
.prog-act .muted { font-size: 13px; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: inherit; }
.prog-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

/* ---------- 10/22 夜：Duet に寄せた窓口（ホーム＝スレッド・いま何をしているか・朝のまとめ・図のカード・仕事の画面） ---------- */
:root { --local-soft: #DCEFEF; --local-ink: #0F5F5F; --claude-soft: #F6E3DA; --claude-ink: #8A4B2F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --local-soft: #12393A; --local-ink: #9BD8D6; --claude-soft: #3B2720; --claude-ink: #F0B9A0; } }
:root[data-theme="dark"] { --local-soft: #12393A; --local-ink: #9BD8D6; --claude-soft: #3B2720; --claude-ink: #F0B9A0; }

/* 絵ことば */
.verb { display: inline-flex; gap: 2px; align-items: center; color: currentColor; flex-shrink: 0; }
.verb svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.verb.sm svg { width: 16px; height: 16px; }
.plan { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 4px 0 10px; }
.plan-tile { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 14px; background: var(--bad-soft); color: var(--bad-ink); }
.plan-tile.free { background: var(--line-soft); color: var(--ink); }
.plan-tile.no { background: var(--line-soft); color: var(--sub); text-decoration: line-through; }
.plan-tile b { font-size: 13px; }
.plan-tile span { font-size: 12px; color: var(--sub); overflow-wrap: anywhere; }
details.code-more { margin: 4px 0 8px; }
details.code-more summary { cursor: pointer; font-size: 13px; color: var(--sub); min-height: 32px; display: flex; align-items: center; }
.job-head { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 4px 2px; font-size: 15px; }
.job-head:first-child { margin-top: 0; }

/* ホームの頭：いま何をしているか */
.home-top { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.now-bar { display: flex; align-items: center; gap: 8px; padding-right: 60px; }   /* 右上の相棒の場所を空ける */
body.wide .now-bar { padding-right: 0; }
.now-what { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.now-line { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; }
.now-btn { flex-shrink: 0; min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 22px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: 14px; font-weight: 700; text-decoration: none; box-sizing: border-box; }
.now-btn.dark { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.now-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* 朝のまとめ */
.brief { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.brief-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.brief-greet { margin: 0; font-size: 15px; line-height: 1.7; }
.brief-alert { display: flex; gap: 8px; align-items: center; color: var(--bad-ink); background: var(--bad-soft); border-radius: 12px; padding: 8px 10px; text-decoration: none; font-size: 14px; }
.brief-alert svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.brief-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.brief-counts a { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 14px; background: var(--line-soft); color: var(--ink); text-decoration: none; min-height: 44px; }
.brief-counts a.hot { background: var(--gleam-soft); color: var(--gleam-ink); }
.brief-counts b { font-size: 22px; line-height: 1.1; }
.brief-counts span { font-size: 12px; }
.brief-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.5; }
.brief-list li { display: flex; gap: 8px; }
.brief-list .k { flex-shrink: 0; width: 3.2em; font-weight: 700; color: var(--sub); }
.brief-list .k.hot { color: var(--gleam-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brief-list .k.hot { color: var(--gleam); } }
:root[data-theme="dark"] .brief-list .k.hot { color: var(--gleam); }

/* 仕事の画面 */
.work-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.work-counts div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; }
.work-counts div.bad { background: var(--bad-soft); color: var(--bad-ink); border-color: transparent; }
.work-counts b { font-size: 20px; }
.work-counts span { font-size: 12px; }
.by-chip { flex-shrink: 0; font-size: 11px; border-radius: 10px; padding: 2px 8px; background: var(--line-soft); color: var(--sub); white-space: nowrap; align-self: flex-start; }
.by-chip.local { background: var(--local-soft); color: var(--local-ink); }
.by-chip.claude { background: var(--claude-soft); color: var(--claude-ink); }
.prog-head { gap: 8px; }
.step { grid-template-columns: 28px minmax(0, 1fr) auto; }
.step .txt b { display: inline-flex; align-items: center; gap: 6px; }
.steer { display: flex; flex-direction: column; gap: 8px; }
.steer textarea { width: 100%; box-sizing: border-box; border-radius: 12px; border: 1px solid var(--line); padding: 10px 12px; font: inherit; font-size: 16px; background: var(--surface); color: var(--ink); }
.steer .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.btn.danger { color: var(--bad); border-color: var(--bad-soft); }
.home-top { position: sticky; top: 0; z-index: 4; background: var(--ground); padding: 8px 0; margin: -8px 0 6px; }
.brief-slot { margin-top: 10px; }
.prog-head b { flex: 1; min-width: 0; }

/* 順番のあるカード：前が決まるまで押せない */
.card.locked { opacity: .6; }
.lock-note { font-size: 13px; color: var(--sub); background: var(--line-soft); border-radius: 10px; padding: 10px 12px; }
.job-tools { display: inline-flex; align-items: center; gap: 10px; }
.btn.sm { min-height: 36px; font-size: 13px; padding: 0 12px; }

/* 誰の話から出たカードか */
.origin { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 6px 0 2px; padding: 6px 10px; border-radius: 10px; font-size: 13px; }
.origin b { font-size: 12px; }
.origin.you { background: var(--ok-soft); color: var(--ok-ink); }
.origin.outside { background: var(--info-soft); color: var(--info-ink); }
.origin.task { background: var(--line-soft); color: var(--sub); }
.origin.secretary, .origin.builder { background: var(--gleam-soft); color: var(--gleam-ink); }

/* 終わった仕事の結果 */
.prog-result { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 6px; font-size: 13px; color: var(--sub); min-width: 0; }
.prog-result > span:first-child { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.card.result { border-left: 4px solid var(--ok-ink); }
.card.result.bad { border-left-color: var(--bad, #c0392b); }
.result-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.result-sum { font-size: 15px; line-height: 1.7; margin: 6px 0 10px; overflow-wrap: anywhere; }
.result-remain { background: var(--gleam-soft); color: var(--gleam-ink); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.result-remain ul, .result-points ul { margin: 6px 0 0; padding-left: 1.2em; }
.result-remain li, .result-points li { margin: 4px 0; line-height: 1.6; overflow-wrap: anywhere; }
.result-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 10px 0; }
.result-imgs .thumb { display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; min-width: 0; }
.result-imgs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--line-soft); }
.result-imgs .thumb span { font-size: 12px; color: var(--sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.result ul.result-files { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 8px; }
.file-row { border: 1px solid var(--line-soft); border-radius: 12px; padding: 8px 10px; min-width: 0; }
.file-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.file-name { display: flex; flex-direction: column; flex: 1 1 180px; min-width: 0; }
.file-name b, .file-name .muted { overflow-wrap: anywhere; }
.file-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.file-view { margin-top: 8px; max-height: 60vh; overflow: auto; border-top: 1px solid var(--line-soft); padding-top: 8px; }
.md-lite { font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.md-lite h4, .md-lite h5 { margin: 10px 0 4px; }
.md-lite ul { padding-left: 1.2em; margin: 4px 0; }
.result-points summary, details.fold > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
section[aria-label="仕事の中身"] .prog-result { display: none; }   /* 中身の画面では下の「結果」に出す */

/* 届いたメール */
.brief-mail { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 8px 0 2px; padding: 8px 10px; border-radius: 12px;
  background: var(--line-soft); color: inherit; text-decoration: none; min-width: 0; }
.mail-chips { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.tag.hot { background: var(--gleam-soft); color: var(--gleam-ink); }
.tag.ok { background: var(--ok-soft); color: var(--ok-ink); }

/* 会話：相談の印と、そのまま使う文（返信文） */
.consult-tag { display: inline-block; margin: 0 6px 4px 0; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--gleam-soft); color: var(--gleam-ink); }
.draft-block { margin: 8px 0; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--bg, #fff); overflow: hidden; }
.draft-block pre { margin: 0; padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 14px; line-height: 1.7; }
.draft-foot { display: flex; justify-content: flex-end; padding: 4px 8px; border-top: 1px solid var(--line-soft); }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; }

/* 伴走 */
.cmp-link { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; color: inherit; text-decoration: none; }
.cmp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.cmp-nav { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; margin: 10px 0 6px; }
.cmp-nav span { font-weight: 700; overflow-wrap: anywhere; }
.cmp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.cmp-ask { font-size: 15px; line-height: 1.7; background: var(--gleam-soft); color: var(--gleam-ink); border-radius: 12px; padding: 10px 12px; margin: 6px 0 10px; overflow-wrap: anywhere; }
.cmp-shot img { display: block; width: 100%; max-height: 260px; object-fit: contain; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--line-soft); }
.cmp-cands { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 10px 0; }
.cmp-cand { display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 12px; border: 2px solid var(--line-soft); background: none; color: inherit; text-align: left; font: inherit; cursor: pointer; min-width: 0; }
.cmp-cand.on { border-color: var(--gleam); background: var(--gleam-soft); }
.cmp-cand img, .cmp-noimg { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--line-soft); display: grid; place-items: center; font-size: 12px; color: var(--sub); }
.cmp-cand b { font-size: 13px; overflow-wrap: anywhere; }
.cmp-cand .muted { font-size: 12px; overflow-wrap: anywhere; }
.cmp-path { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 8px; align-items: center; margin: 6px 0; font-size: 13px; }
.cmp-path .k { color: var(--sub); }
.cmp-path code { overflow-wrap: anywhere; word-break: break-all; font-size: 12px; }
.cmp-path-acts { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.cmp-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cmp-list { margin: 6px 0 0; padding-left: 0; list-style: none; display: grid; gap: 4px; }
.cmp-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; min-width: 0; }
.cmp-list li.now { background: var(--gleam-soft); }
.cmp-list .linklike { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere; min-width: 0; }
/* 常駐アプリの右下の小窓 */
html.mini .tabs, html.mini .buddy, html.mini .lamp, html.mini .rail, html.mini .stamp { display: none !important; }
html.mini .view { padding: 8px 10px 16px; }
html.mini .card { padding: 12px; }

/* ホーム（入口） */
.hub-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.hub-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hub-list a { color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.hub-note { display: block; color: var(--sub); text-decoration: none; font-size: 14px; }
.hub-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.hub-links a { padding: 8px 12px; border-radius: 999px; background: var(--line-soft); color: inherit; text-decoration: none; font-size: 14px; }
.stale-note { flex-direction: column; align-items: flex-start; }
.stale-note details.own summary { cursor: pointer; color: var(--sub); font-size: 13px; padding: 4px 0; }

/* カードの添付と、めくって見る */
.card-atts { margin: 10px 0; display: grid; gap: 8px; }
.att-row { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; align-items: start; border: 1px solid var(--line-soft); border-radius: 12px; padding: 8px; }
.att-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; background: var(--line-soft); cursor: pointer; }
.att-thumb.none { display: grid; place-items: center; font-size: 12px; color: var(--sub); cursor: default; }
.att-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.att-info b { overflow-wrap: anywhere; }
.att-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.viewer { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, .88); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; color: #fff; }
.viewer-bar { display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; }
.viewer-bar b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-stage { display: grid; place-items: center; overflow: auto; padding: 8px; }
.viewer-img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; border-radius: 4px; }
.viewer-nav { display: flex; justify-content: center; gap: 16px; padding: 8px 12px calc(env(safe-area-inset-bottom) + 12px); }
.viewer .btn { color: #111; background: #fff; border-color: #fff; min-width: 72px; }
.att-thumb { border: 1px solid var(--line-soft); }

/* 決めごとボード（10/24）：流れの図・各段の［始める］［保留］と期日・1問ずつ送る質問 */
.bd-flow { list-style: none; margin: 0; padding: 0; position: relative; }
.bd-node { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; position: relative; padding: 10px 0; }
.bd-node:not(:last-child)::before { content: ''; position: absolute; left: 10px; top: 28px; bottom: -10px; width: 2px; background: var(--line); }
.bd-dot { width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--control); background: var(--surface); box-sizing: border-box; z-index: 1; }
.bd-node.s-doing .bd-dot { border-color: var(--info-ink); background: var(--info-soft); box-shadow: 0 0 0 4px var(--info-soft); }
.bd-node.s-waiting .bd-dot { border-color: var(--gleam); background: var(--gleam-soft); }
.bd-node.s-held .bd-dot { border-style: dashed; border-color: var(--sub); }
.bd-node.s-done .bd-dot { border-color: var(--ok); background: var(--ok); }
.bd-node.s-done .bd-body > .bd-top b { color: var(--sub); }
.bd-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.bd-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bd-top a.tag { text-decoration: none; }
.bd-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.bd-due { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--sub); }
.bd-due input, .bd-row input[type=date] { font: inherit; padding: 4px 6px; border: 1px solid var(--control); border-radius: 8px; background: var(--surface); color: var(--ink); }
.bd-q { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.bd-q.answered { opacity: .8; }
.bd-ask { font-weight: 700; margin: 0; }
.bd-suggest { margin: 0; font-size: 13px; color: var(--gleam-ink); background: var(--gleam-soft); border-radius: 8px; padding: 4px 8px; align-self: flex-start; }
.bd-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.bd-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bd-row input[type=range] { flex: 1 1 160px; min-width: 0; }
.bd-row textarea { flex: 1 1 200px; min-width: 0; font: inherit; }
.bd-val { min-width: 3em; }
.bd-answer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.small { font-size: 12px; }
.sec-title { font-size: 15px; font-weight: 700; margin: 16px 0 8px; }
.card .sec-title { margin-top: 0; }

/* ---------- 届いたメール：全部出して、教える（2026-10-26） ---------- */
.timeline li.day-sep { display: block; padding: 10px 16px 4px; border-bottom: 0; font-size: 12px; font-weight: 700; color: var(--sub); }
.mail-inbox .mail-subj { font-weight: 700; overflow-wrap: anywhere; }
.mail-inbox .mail-state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.mail-inbox .mail-why { color: var(--sub); font-size: 13px; }
.linklike { background: none; border: 0; padding: 4px 0; color: var(--sub); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.teach { display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 8px 10px; border-radius: 12px; background: var(--ground); }
.teach-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.teach-scope { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--sub); }
.teach-scope input { width: 18px; height: 18px; }
.rule-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rule-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.rule-list li .btn { margin-left: auto; }

/* ---------- 手順書と声かけ ---------- */
.rb-panel { border: 1px solid var(--gleam); }
.rb-item { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.rb-item:first-of-type { border-top: 0; padding-top: 0; }
.rb-nudge { margin: 0; font-size: 14px; font-weight: 700; }
.rb-item.late .rb-nudge { color: var(--bad-ink); }
.rb-title { font-size: 15px; line-height: 1.5; color: inherit; overflow-wrap: anywhere; }
.rb-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.rb-acts .btn { display: inline-flex; align-items: center; text-decoration: none; }
.rb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.rb-md .md-lite { font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.rb-md .md-lite h4 { margin: 14px 0 4px; font-size: 16px; }
.rb-md .md-lite h5 { margin: 12px 0 2px; font-size: 15px; }
.rb-md .md-lite p { margin: 4px 0; }
.rb-md .md-lite ul { margin: 4px 0; padding-left: 1.3em; }

/* ---------- プロジェクトの図 ---------- */
.pj-link { color: inherit; text-decoration: none; gap: 6px; }
.pj-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--line); gap: 2px; }
.pj-seg.done { background: var(--ok); } .pj-seg.now { background: #3B6FB6; } .pj-seg.next { background: var(--gleam); }
.pj-seg.later { background: var(--control); } .pj-seg.plan { background: var(--line); }
.pj-lede { margin: 0 4px; line-height: 1.6; }
.pj-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 12px; padding: 0 4px; }
.pj-key { display: inline-flex; align-items: center; gap: 4px; }
.pj-key::before { content: ''; width: 10px; height: 10px; border-radius: 3px; border: 2px solid var(--control); }
.pj-key.done::before { background: var(--ok-soft); border-color: var(--ok); }
.pj-key.now::before { background: var(--info-soft); border-color: #3B6FB6; }
.pj-key.next::before { background: var(--gleam-soft); border-color: var(--gleam); }
.pj-key.later::before { border-style: dashed; }
.pj-key.plan::before { border-style: dotted; }
.pj-key.live::before { background: #3B6FB6; border-color: #3B6FB6; border-radius: 50%; }
.pj-group { display: flex; flex-direction: column; gap: 8px; }
.pj-gtitle { margin: 8px 4px 0; font-size: 15px; display: flex; gap: 8px; align-items: baseline; }
.pj-gid { font-family: var(--mono); font-size: 12px; color: var(--sub); }
.pj-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pj-cell.open { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 0; }
.pj-block { position: relative; background: var(--surface); border-radius: 14px; padding: 10px 10px 8px; display: flex; flex-direction: column; gap: 4px;
  border: 2px solid var(--line); cursor: pointer; min-height: 104px; }
.pj-block.done { border-color: color-mix(in srgb, var(--ok) 55%, transparent); background: color-mix(in srgb, var(--ok-soft) 45%, var(--surface)); }
.pj-block.now { border-color: #3B6FB6; }
.pj-block.next { border-color: var(--gleam); }
.pj-block.later { border-style: dashed; }
.pj-block.plan { border-style: dotted; border-color: var(--control); }
.pj-block.live { box-shadow: 0 0 0 3px color-mix(in srgb, #3B6FB6 30%, transparent); }
.pj-block.live::after { content: ''; position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: #3B6FB6; animation: pj-pulse 1.6s ease-in-out infinite; }
@keyframes pj-pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .pj-block.live::after { animation: none; } }
.pj-block.open { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.pj-top { display: flex; gap: 6px; align-items: center; padding-right: 14px; }
.pj-id { font-family: var(--mono); font-size: 12px; color: var(--sub); }
.pj-ver { font-size: 11px; border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; color: var(--sub); }
.pj-label { font-size: 14px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.pj-foot { margin-top: auto; display: flex; align-items: center; gap: 6px; }
.pj-foot .tag { padding: 2px 8px; font-size: 11px; }
.pj-by { font-size: 11px; color: var(--sub); }
.pj-icons { margin-left: auto; display: flex; gap: 2px; }
.pj-ico { position: relative; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--sub); display: grid; place-items: center; padding: 0; }
.pj-ico:hover { background: var(--ground); }
.pj-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pj-ico.has, .pj-ico.memo { color: var(--ink); }
.pj-ico.memo.due { color: var(--gleam-ink); background: var(--gleam-soft); }
.pj-ico span { position: absolute; top: 0; right: 0; min-width: 14px; height: 14px; border-radius: 7px; background: var(--ink); color: var(--surface); font-size: 10px; line-height: 14px; text-align: center; }
.pj-dot { position: absolute; left: -3px; top: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--gleam); border: 2px solid var(--surface); }
.pj-detail { background: var(--surface); border: 2px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.pj-detail p { margin: 0; line-height: 1.6; }
.pj-flows, .pj-books, .pj-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pj-books li, .pj-notes li { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.pj-form { display: flex; flex-direction: column; gap: 6px; }
.pj-form textarea { width: 100%; border: 1px solid var(--control); border-radius: 10px; padding: 8px 10px; background: var(--surface); resize: vertical; }
.row-end { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.teach[hidden] { display: none; }
.md-lite ol { margin: 4px 0; padding-left: 1.4em; }
.md-lite li > ul, .md-lite li > ol { margin: 2px 0 4px; }
.md-lite .md-note { background: var(--gleam-soft); color: var(--gleam-ink); border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.md-lite li { overflow-wrap: anywhere; }


/* ============================================================ 見た目の決まり（10/28 永田）
   1. 線ではなく面：枠線・区切り線は引かない。まとまりは面の濃さと間で分ける。線はデータの流れだけ。
   2. 丸：記号は丸。角ばった札で囲まない。生き物っぽい形は秘書だけ。角丸は小さめ。
   3. 形で語る：状態は色・動き・量で。文字は名前と数。説明文は置かない（見出しの上の説明も出さない）。
   4. 表に出すのは今効くものだけ：明るい・暗いなどの設定は、秘書を押すと開く面の中。
   5. 1画面の主役は1つ。ボタンは右寄せ、主役のボタンは右端。 */
.tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 0; box-shadow: 0 -1px 0 color-mix(in srgb, var(--ink) 6%, transparent); }
.head .eyebrow { display: none; }
.panel { border-radius: 10px; }
.card { border-radius: 10px; position: relative; }
.btn { border-radius: 8px; border: 0; background: var(--line-soft); }
.btn.primary { background: var(--primary); }
.btn.danger { background: var(--bad-soft); color: var(--bad-ink); }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.actions .btn { min-width: 88px; }
.actions .btn.primary { order: 9; }
.actions.grid2 { display: flex; }
.timeline li, .req, .prog, .prog-item, .home-list li, .fl, .rb-item, .rail-flows .rail-flow { border-color: transparent !important; }
.rb-panel { border: 0; box-shadow: inset 3px 0 0 var(--gleam); }
.card.result { border-left: 0; box-shadow: inset 3px 0 0 var(--ok-ink); }
.card.result.bad { box-shadow: inset 3px 0 0 var(--bad); }
.option:has(input:checked) { border: 0; padding: 12px 14px; box-shadow: inset 0 0 0 2px var(--ink); }

/* タブの中の切り替え（今日・判断・進行中・手順書／計画・伴走／いま・履歴） */
.mode { display: flex; gap: 2px; background: var(--line-soft); border-radius: 999px; padding: 3px; width: max-content; max-width: 100%; overflow-x: auto; margin: 0 0 4px; scrollbar-width: none; }
.mode a { flex: none; text-decoration: none; color: var(--sub); font-size: 13.5px; font-weight: 500; padding: 6px 14px; border-radius: 999px; }
.mode a[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

/* カード右上の「⋯」：教師・監査に見直しを頼む（頼んだときだけ。毎回は見せない） */
.kebab { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--sub);
  font-size: 18px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.kebab:hover, .kebab:focus-visible, .kebab[aria-expanded="true"] { background: var(--line-soft); color: var(--ink); }
.card .meta { padding-right: 34px; }
.kmenu { position: absolute; z-index: 40; background: var(--surface); border-radius: 10px; box-shadow: 0 8px 28px rgba(0, 0, 0, .2); padding: 4px; min-width: 228px; display: grid; }
.kmenu button { display: flex; gap: 10px; align-items: center; border: 0; background: transparent; color: var(--ink); text-align: left; padding: 10px; border-radius: 8px;
  cursor: pointer; font: inherit; font-size: 14px; }
.kmenu button:hover, .kmenu button:focus-visible { background: var(--line-soft); }
.kmenu svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; color: #6D55C9; }
.kmenu small { display: block; color: var(--sub); font-size: 12px; }
.rv { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, #6D55C9 12%, var(--surface)); }
.rv svg { width: 16px; height: 16px; flex: none; fill: none; stroke: #6D55C9; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rv b { color: #6D55C9; }
.rv.err { background: var(--bad-soft); color: var(--bad-ink); }

/* 秘書を押すと開く面（設定はここだけ） */
.lamp.open::after { display: none; }
.sheet-bg { position: fixed; inset: 0; z-index: 45; background: rgba(0, 0, 0, .28); }
.sheet { position: fixed; z-index: 46; left: 50%; bottom: 0; transform: translateX(-50%); width: min(440px, 100%); background: var(--surface); border-radius: 14px 14px 0 0;
  padding: 18px 20px calc(22px + env(safe-area-inset-bottom)); display: grid; gap: 16px; box-shadow: 0 -8px 30px rgba(0, 0, 0, .18); }
@media (min-width: 720px) { .sheet { top: 76px; bottom: auto; left: auto; right: 24px; transform: none; width: 320px; border-radius: 12px; } }
.sheet-me { display: grid; gap: 4px; } .sheet-me b { font-size: 16px; } .sheet-me span { font-size: 13.5px; color: var(--sub); line-height: 1.6; }
.sheet-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--sub); }
.dots { display: flex; gap: 6px; }
.dots button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--line-soft); color: var(--sub); cursor: pointer; display: grid; place-items: center; }
.dots svg { width: 18px; height: 18px; }
.dots button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
/* 残っていた枠線を面に（見た目の決まり 1） */
.brief, .now-what, .now-btn, .option, .chip, .icon-btn, .work-counts div, .flowlog, .pj-ver, .att-chip, .card img.shot, .bubble img { border-color: transparent !important; }
.brief { border-radius: 10px; }
.now-what, .now-btn:not(.dark), .chip:not([aria-pressed="true"]):not(.on), .icon-btn, .option { background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.home-top .now-what, .home-top .now-btn:not(.dark) { box-shadow: none; }
.work-counts div { background: var(--surface); }
.bubble.receipt { border: 0; background: var(--line-soft); }
textarea, .steer textarea, .pj-form textarea { border-color: transparent; background: var(--line-soft); }
body.wide .tabs { border-right: 0; }
.dots svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kmenu { background: color-mix(in srgb, var(--ink) 5%, var(--surface)); }

/* チャットの中身：書式・選ぶカード・アイコンつきの行（10/28 永田：絵・アイコン・文字の強弱。そこから次へ） */
.bubble .md-p { margin: 0 0 6px; } .bubble .md-p:last-of-type { margin-bottom: 0; }
.bubble .md-h { font-weight: 700; font-size: 15.5px; margin: 6px 0 4px; }
.bubble .md-list { margin: 4px 0 8px; padding-left: 1.3em; display: grid; gap: 3px; }
.bubble b { font-weight: 700; }
.bubble a { color: inherit; text-underline-offset: 3px; }
.ci { width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--surface); display: grid; place-items: center; color: var(--ink); }
.ci svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.choice, .cards { display: grid; gap: 6px; margin: 8px 0 4px; }
.w-ask { font-size: 14px; margin-bottom: 2px; }
.choice .opt, .cards .row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; border-radius: 10px;
  background: var(--ground); padding: 10px 12px; font: inherit; color: var(--ink); text-decoration: none; cursor: pointer; min-height: 52px; }
.choice .opt:hover, .cards .row:hover { background: var(--line-soft); }
.choice .opt > span:not(.ci), .cards .row > span:not(.ci):not(.go) { flex: 1; min-width: 0; display: grid; gap: 1px; }
.choice small, .cards small { color: var(--sub); font-size: 12.5px; line-height: 1.45; }
.choice .tick { width: 22px; height: 22px; flex: none; border-radius: 50%; background: transparent; }
.choice .opt.picked { background: var(--ground); box-shadow: inset 0 0 0 2px var(--ink); }
.choice .opt.picked .tick { background: var(--ink); position: relative; }
.choice .opt.picked .tick::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--surface); font-size: 13px; font-style: normal; }
.choice.done .opt:not(.picked), .cards.done .row:not(.picked) { opacity: .45; }
.choice .opt:disabled, .cards .row:disabled { cursor: default; }
.cards .go { color: var(--sub); display: grid; } .cards .go svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.cards .row.picked { box-shadow: inset 0 0 0 2px var(--ink); }
.cards .row-msg { color: var(--sub); font-size: 12px; margin: -2px 0 2px 60px; }
.cards .row-msg:empty { display: none; }

/* ============================================================ 動き → いま（10/28 永田）。線ではなく面、文字は名前と数 */
:root { --local: #1F9D6B; --local-tint: #DDF3E9; --cloud: #D9643A; --cloud-tint: #FBE6DC; --kid: #C98A1B; --kid-tint: #F8EDD5; --watch: #6D55C9; --watch-tint: #ECE7FB; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --local: #4CC48E; --local-tint: #143326; --cloud: #F08A62; --cloud-tint: #3A2219; --kid: #E3AA45; --kid-tint: #36290F; --watch: #A792F2; --watch-tint: #251F3C; } }
:root[data-theme="dark"] { --local: #4CC48E; --local-tint: #143326; --cloud: #F08A62; --cloud-tint: #3A2219; --kid: #E3AA45; --kid-tint: #36290F; --watch: #A792F2; --watch-tint: #251F3C; }
.mo-peers { display: flex; flex-wrap: wrap; gap: 6px; }
.mo-peers .peer { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 999px; padding: 4px 12px 4px 4px; font-size: 13px; }
.mo-peers .peer .ci { width: 28px; height: 28px; background: var(--ground); } .mo-peers .peer .ci svg { width: 15px; height: 15px; }
.mo-peers .peer small { color: var(--sub); font-family: var(--mono); }
.mo-peers .peer.live .ci { background: var(--cloud-tint); color: var(--cloud); }
.mo-wall { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--line-soft); border-radius: 10px; padding: 8px 12px; }
.mo-wall .ci { width: 30px; height: 30px; } .mo-wall .mo-wall-n { margin-left: auto; font-family: var(--mono); font-size: 13px; }
.mo-wall small { width: 100%; color: var(--sub); font-size: 12px; }
.mo-wall.hot { background: var(--bad-soft); color: var(--bad-ink); }
.mo-watchers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mo-watchers .watcher { display: flex; gap: 10px; align-items: flex-start; background: var(--watch-tint); border-radius: 10px; padding: 10px 12px; text-decoration: none; color: var(--ink); min-width: 0; }
.mo-watchers .watcher .ci { width: 30px; height: 30px; color: var(--watch); } .mo-watchers .watcher > span { display: grid; gap: 2px; min-width: 0; }
.mo-watchers .watcher b { color: var(--watch); font-size: 13.5px; } .mo-watchers .watcher small { font-size: 12px; color: var(--sub); line-height: 1.5; overflow-wrap: anywhere; }
.mo-watchers .watcher.on { box-shadow: inset 0 0 0 2px var(--watch); }
.mo-watchers .watcher.on small { color: var(--ink); }
@media (max-width: 420px) { .mo-watchers { grid-template-columns: 1fr; } }
.mo-sec { background: var(--surface); border-radius: 12px; padding: 14px; display: grid; gap: 12px; }
.mo-sec-head { display: flex; align-items: center; gap: 12px; }
.mo-face { position: relative; width: 56px; height: 56px; flex: none; } .mo-face .buddy { inset: 0; }
.mo-sec-head > span:last-child { display: grid; gap: 2px; min-width: 0; } .mo-sec-head b { font-size: 16px; } .mo-sec-head small { color: var(--sub); font-size: 13px; }
.mo-engs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.eng { display: flex; align-items: center; gap: 10px; background: var(--ground); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.eng > span:last-child { display: grid; min-width: 0; } .eng b { font-size: 13.5px; } .eng small { font-size: 12px; color: var(--sub); }
.eng .ring { position: relative; width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; }
.eng .ring i { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--line); }
.eng .ring b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 700 10px var(--mono); color: #fff; }
.eng.cloud .ring b { background: var(--cloud); } .eng.local .ring b { background: var(--local); }
.eng.busy .ring i { border-color: transparent; border-top-color: currentColor; border-right-color: currentColor; animation: eng-spin 1.1s linear infinite; }
.eng.cloud { color: var(--cloud); } .eng.local { color: var(--local); } .eng > span:last-child { color: var(--ink); }
@keyframes eng-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .eng.busy .ring i { animation: none; } }
.mo-kids, .mo-jobs { display: grid; gap: 4px; }
.mo-kids .kid, .mo-jobs .job { display: flex; align-items: center; gap: 10px; background: var(--ground); border-radius: 8px; padding: 7px 10px; font-size: 13.5px; min-width: 0; }
.mo-kids .kid b { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mo-kids .kid small, .mo-jobs .job small { color: var(--sub); font-size: 12px; white-space: nowrap; }
.mo-kids .kid .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); flex: none; }
.mo-kids .kid.live { background: var(--kid-tint); } .mo-kids .kid.live .dot { background: var(--kid); animation: buddy-dot 1.2s infinite; }
.mo-jobs .job span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mo-jobs .job.live { background: var(--cloud-tint); }
.mo-pc { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 2px 4px; flex-wrap: wrap; }
.mo-pc .dot { width: 8px; height: 8px; border-radius: 50%; } .mo-pc .dot.ok { background: var(--ok); } .mo-pc .dot.bad { background: var(--bad); }
.mo-pc small { color: var(--sub); }
/* 動き → 履歴の頭：どの頭で処理したか */
.eng-panel { gap: 14px; }
.eng-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.eng-kpis div { display: grid; gap: 2px; } .eng-kpis b { font: 700 24px/1.1 var(--mono); } .eng-kpis span { font-size: 12px; color: var(--sub); }
.eng-kpis .local { color: var(--local); } .eng-kpis .cloud { color: var(--cloud); } .eng-kpis .kid { color: var(--kid); } .eng-kpis .bad { color: var(--bad); }
@media (max-width: 480px) { .eng-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.eng-bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.eng-bars .col { flex: 1; display: flex; flex-direction: column-reverse; height: 100%; min-width: 0; }
.eng-bars i { display: block; width: 100%; } .eng-bars i:first-child { border-radius: 0 0 2px 2px; } .eng-bars i:last-child { border-top-left-radius: 2px; border-top-right-radius: 2px; }
.eng-bars .local, .eng-legend .local { background: var(--local); } .eng-bars .cloud, .eng-legend .cloud { background: var(--cloud); } .eng-bars .kid, .eng-legend .kid { background: var(--kid); }
.eng-legend { display: flex; gap: 14px; align-items: center; font-size: 12px; color: var(--sub); flex-wrap: wrap; }
.eng-legend span { display: inline-flex; align-items: center; gap: 6px; } .eng-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.eng-legend small { margin-left: auto; }
.sheet-more { display: grid; gap: 6px; } .sheet-more .panel { padding: 0; background: transparent; }
.mo-wall b { text-decoration: none; }
/* 返答ボタンと、①②ごとの選択肢（10/29 永田） */
.foot-acts { display: inline-flex; gap: 2px; }
.reply-btn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.choices { display: grid; gap: 10px; margin: 8px 0 4px; } .choices .choice { margin: 0; }
.choice.pills { gap: 6px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { border: 0; border-radius: 999px; background: var(--ground); color: var(--ink); font: inherit; font-size: 14px; padding: 8px 14px; min-height: 38px; cursor: pointer; }
.pill:hover { background: var(--line-soft); }
.pill.picked { background: var(--ink); color: var(--surface); }
.choice.done .pill:not(.picked) { opacity: .45; }
.quote-bar { flex-wrap: wrap; }
.quote-choices { width: 100%; } .quote-choices .choices { margin: 4px 0 0; } .quote-choices .pill { background: var(--ground); color: var(--ink); }
.quote-bar { border-left: 0; box-shadow: inset 3px 0 0 var(--gleam); padding: 4px 4px 4px 12px; }
/* 履歴のグラフ（時系列：日付の目盛り・縦の目盛り・押すと内訳） */
.eng-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.eng-head .eng-legend small { display: none; }
.seg2 { display: inline-flex; background: var(--line-soft); border-radius: 999px; padding: 2px; gap: 2px; }
.seg2 button { border: 0; background: transparent; color: var(--sub); font: inherit; font-size: 12.5px; padding: 4px 12px; border-radius: 999px; cursor: pointer; }
.seg2 button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.eng-plot { display: grid; grid-template-columns: 34px minmax(0, 1fr); grid-template-rows: 150px auto; column-gap: 6px; }
.eng-y { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; font: 11px var(--mono); color: var(--sub); }
.eng-y span { line-height: 1; transform: translateY(-4px); } .eng-y span:last-child { transform: translateY(4px); }
.eng-area { position: relative; height: 150px; }
.eng-grid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.eng-grid i { display: block; height: 1px; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.eng-area .eng-bars { position: absolute; inset: 0; height: auto; gap: 2px; }
.eng-bars .col { border: 0; padding: 0; background: transparent; cursor: pointer; border-radius: 2px; }
.eng-bars .col:hover, .eng-bars .col.on { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.eng-bars .col.none { cursor: default; }
.eng-x { display: flex; gap: 2px; font: 11px var(--mono); color: var(--sub); margin-top: 6px; }
.eng-x span { flex: 1; min-width: 0; white-space: nowrap; overflow: visible; text-align: center; }
.eng-detail { margin: 0; font-size: 13px; color: var(--ink); min-height: 1.4em; }
/* 許可待ち（どの画面でも下に出る。10/31 永田） */
.permit-bar { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); width: min(620px, calc(100% - 20px));
  bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 10px); background: var(--surface); border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .18), inset 3px 0 0 #E5484D; padding: 10px 12px 10px 14px;
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: center; }
.permit-bar[hidden] { display: none; }
body.on-talk .permit-bar { bottom: auto; top: calc(env(safe-area-inset-top) + 64px); }
body.wide .permit-bar { bottom: 18px; left: calc(var(--pl, 24px) + 244px + 360px); }
body.wide.on-talk .permit-bar { bottom: auto; top: 20px; }
.pb-dot { width: 10px; height: 10px; border-radius: 50%; background: #E5484D; animation: buddy-ping 1.6s ease-out infinite; }
.pb-t { display: grid; gap: 1px; text-decoration: none; color: var(--ink); min-width: 0; }
.pb-t b { font-size: 14px; } .pb-t span { font-size: 12.5px; color: var(--sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-acts { grid-column: 1 / -1; display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.pb-acts .btn { min-height: 36px; }
.pb-msg { grid-column: 1 / -1; color: var(--sub); font-size: 12px; } .pb-msg:empty { display: none; }
.eng-bars.fine { gap: 0; } .eng-bars.fine .col { border-radius: 0; }
.eng-toggles { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- 話題で絞る（11/1 永田：同時に進む会話を、特定の話だけ続けられるように） ---- */
.topic-bar { position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; overflow-x: auto; padding: 8px 56px 8px 2px;
  background: var(--ground); scrollbar-width: none; }
.topic-bar::-webkit-scrollbar { display: none; }
.topic-bar[hidden], .topic-note[hidden] { display: none; }
.topic-chip { flex: none; font: inherit; font-size: 13px; border: 0; border-radius: 999px; padding: 5px 12px;
  background: var(--surface); color: var(--sub); cursor: pointer; }
.topic-chip[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); }
.topic-note { font-size: 12px; color: var(--sub); margin: 0 2px 8px; }
.topic-tag { display: table; font: inherit; font-size: 11px; line-height: 1.4; border: 0; border-radius: 999px;
  padding: 1px 8px; margin: 0 0 4px; background: var(--line-soft); color: var(--sub); cursor: pointer; white-space: nowrap; }
.bubble.me .topic-tag { background: rgba(255, 255, 255, .14); color: var(--hero-sub); }
.bubble[hidden] { display: none; }

/* ---- 許可待ちを会話の中に（何をしたいのか・どの仕事か・中身ごと） ---- */
.permit-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.bubble.permit { white-space: normal; box-shadow: inset 3px 0 0 #E5484D; max-width: 92%; }
.bubble.permit.decided { box-shadow: none; opacity: .7; }
.pm-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--sub); margin-bottom: 2px; }
.pm-title { font-weight: 600; margin-bottom: 4px; }
.pm-code { margin: 6px 0; padding: 8px 10px; border-radius: 8px; background: var(--line-soft); font: 12px/1.5 var(--mono);
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 180px; overflow: auto; }
.pm-rows { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 13px; margin: 6px 0; }
.pm-row { display: contents; }
.pm-row span { color: var(--sub); }
.pm-row b { font-weight: 500; overflow-wrap: anywhere; }
.pm-note { width: 100%; font: inherit; font-size: 14px; border: 0; border-radius: 8px; padding: 8px; margin-top: 6px; background: var(--line-soft); color: var(--ink); }
.pm-note[hidden] { display: none; }
.pm-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-top: 8px; }
.pm-done { font-size: 13px; color: var(--sub); }
.pm-msg { display: block; font-size: 12px; color: var(--bad); min-height: 0; }

/* ---- チャットのフォルダの行：押すと中のファイルが広がる（写しはコンソールに置いてある） ---- */
.cards .row[aria-expanded="true"] .go svg { transform: rotate(90deg); }
.cards .row .go svg { transition: transform .15s; }
.row-files { display: grid; gap: 2px; margin: 2px 0 6px 46px; }
.row-files[hidden] { display: none; }
.row-file { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; border-radius: 8px;
  padding: 6px 8px; background: transparent; color: inherit; font: inherit; font-size: 14px; cursor: pointer; }
.row-file:hover { background: var(--line-soft); }
.row-file .ci { width: 26px; height: 26px; }
.row-file > span:not(.ci) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-file small, .row-more { color: var(--sub); font-size: 12px; }
