/* Layout: two modes, switched in the top bar.
   利用モード (the entry, everyone): the apps, full width, no side menu.
   開発モード: left menu (chats titled by topic, settings at the bottom) | one working area.
   Below 960px the left menu becomes a chip row. */
:root {
  /* 会社ごとの背景色は nav.js が ORGS から上書きする */
  --bg: #4f2683;
  --on-bg: #e9e1f3;
  --surface: #ffffff;
  --surface-2: #f5f7fa;
  --ink: #14213d;
  --muted: #5a6578;
  --line: #dbe1ea;
  --navy: #14213d;
  --on-navy: #ffffff;
  --teal: #0f766e;
  --orange: #c9701a;
  --ok: #1b8a57;
  --ok-bg: #e4f4ec;
  --warn: #b8620f;
  --warn-bg: #fdf0e0;
  --bad: #c0352b;
  --bad-bg: #fdecea;
  --info: #2457a6;
  --info-bg: #e6eefb;
  --bubble-user: #e9eef7;
  --font-ui: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-ui); font-size: 14px; line-height: 1.6; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
h1, h2, h3 { margin: 0; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

.app { height: 100%; display: grid; grid-template-rows: auto auto minmax(0, 1fr); padding-inline: 16px; padding-block: 12px; gap: 10px; }
.vision { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 12px; color: var(--on-bg); }
.vision b { color: var(--info); background: var(--info-bg); padding: 1px 8px; border-radius: 4px; font-weight: 700; letter-spacing: .04em; }
.vision .tools { margin-left: auto; display: flex; gap: 6px; }
.vision button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 6px; padding: 3px 10px; font-size: 12px; }
.vision button:hover { border-color: var(--teal); }

.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.logo { font-weight: 700; letter-spacing: .08em; display: flex; align-items: center; gap: 8px; }
.logo img { width: 28px; height: 28px; border-radius: 7px; display: block; }
.company { padding-left: 10px; border-left: 1px solid var(--line); font-weight: 700; }
.company small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; line-height: 1.2; }
.acct { margin-left: auto; position: relative; }
.acct > button { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 3px 10px 3px 4px; }
.acct > button:hover { border-color: var(--teal); }
.acct small { display: block; color: var(--muted); font-size: 11px; line-height: 1.2; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: var(--on-navy); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 280px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(20, 33, 61, .14); padding: 6px; }
.menu h3 { font-size: 11px; color: var(--muted); font-weight: 500; padding: 6px 8px; }
.menu button.u { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: none; text-align: left; padding: 6px 8px; border-radius: 6px; }
.menu button.u:hover { background: var(--surface-2); }
.menu button.u[aria-current="true"] { background: var(--info-bg); }
.menu .perm { border-top: 1px solid var(--line); margin-top: 6px; padding: 8px; font-size: 12px; color: var(--muted); }

.main { min-height: 0; display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 10px; }
.col { min-height: 0; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; }
.scroll { overflow-y: auto; min-height: 0; flex: 1; }

/* left menu */
.side { padding: 12px; gap: 6px; overflow-y: auto; }
.group-label { font-size: 11px; color: var(--muted); letter-spacing: .06em; margin: 8px 4px 2px; }
.navlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.navlist button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 6px; border: 0; background: none; text-align: left; padding: 7px 10px; border-radius: 6px; }
.navlist button:hover { background: var(--surface-2); }
.navlist button[aria-current="page"] { background: var(--navy); color: var(--on-navy); font-weight: 700; }
.count { font-size: 11px; background: var(--bad); color: #fff; border-radius: 999px; min-width: 18px; text-align: center; line-height: 18px; padding: 0 5px; }
.side-bottom { margin-top: auto; border-top: 1px solid var(--line); padding-top: 4px; display: flex; flex-direction: column; gap: 6px; }
.side-foot { font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 8px; }
.newchat { width: 100%; padding: 8px 12px; white-space: nowrap; }
.navlist.threads button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main.full { grid-template-columns: minmax(0, 1fr); }
.chat.static { padding: 0; }

/* top bar: mode switch */
.modesw { display: flex; border: 1px solid var(--line); border-radius: 8px; padding: 2px; gap: 2px; background: var(--surface-2); }
.modesw button { border: 0; background: none; border-radius: 6px; padding: 3px 14px; font-size: 13px; display: flex; align-items: center; gap: 6px; min-height: 30px; }
.modesw button[aria-pressed="true"] { background: var(--navy); color: var(--on-navy); font-weight: 700; }

/* generic */
.pad { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.ph { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.ph h2 { font-size: 17px; }
.btn { border: 0; border-radius: 6px; padding: 6px 14px; font-weight: 700; background: var(--navy); color: var(--on-navy); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); font-weight: 500; }
.btn.ghost:hover:not([disabled]) { border-color: var(--teal); }
.btn.danger { background: var(--surface); color: var(--bad); border: 1px solid var(--bad); }
.btn.sm { padding: 2px 10px; font-size: 12px; }
.tag { font-size: 11px; border-radius: 4px; padding: 0 7px; line-height: 20px; white-space: nowrap; display: inline-block; }
.tag.prod { background: var(--ok-bg); color: var(--ok); }
.tag.dev { background: var(--info-bg); color: var(--info); }
.tag.check { background: var(--warn-bg); color: var(--warn); }
.tag.ready { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); line-height: 18px; }
.tag.pending { background: var(--warn-bg); color: var(--warn); }
.tag.new { background: var(--teal); color: #fff; }
.chip { font-size: 12px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 0 9px; white-space: nowrap; display: inline-block; }
.chips-row { display: flex; flex-wrap: wrap; gap: 4px; }
.box { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.box.pad-s { padding: 12px 14px; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; }
.note { font-size: 12px; color: var(--muted); }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; min-width: 420px; }
th { text-align: left; color: var(--muted); font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 12px; }
td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr.alert td { background: var(--bad-bg); }
.j { font-size: 11px; border-radius: 4px; padding: 0 6px; font-weight: 700; white-space: nowrap; display: inline-block; }
.j.alert { color: var(--bad); }
.j.ok { color: var(--ok); }
.j.warn { color: var(--warn); }
.j.info { color: var(--info); }
tr.sel td { background: var(--info-bg); }
.field { display: grid; gap: 3px; }
.field label, .lbl { font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea, select.sel, textarea.ta { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: var(--surface); color: var(--ink); font: inherit; width: 100%; min-width: 0; }
textarea.ta { min-height: 120px; resize: vertical; line-height: 1.6; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { border: 1px solid transparent; border-bottom: 0; background: none; padding: 5px 14px; border-radius: 6px 6px 0 0; font-size: 13px; color: var(--muted); margin-bottom: -1px; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 700; border-color: var(--line); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card { border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.card h3 { font-size: 14px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.card p { margin: 0; font-size: 12px; color: var(--muted); flex: 1; }
.card .foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 28px; font-size: 12px; }
.cards.thumbs { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.cards.thumbs .card { padding: 10px 10px 14px; gap: 8px; }
.cards.thumbs .card > :not(.thumb) { margin-left: 4px; margin-right: 4px; }
.cards.thumbs .btn.open { min-width: 96px; min-height: 40px; padding: 8px 22px; font-size: 14px; }
.cards.thumbs .card:hover, .cards.thumbs .card:focus-within { border-color: #b9c4d4; box-shadow: 0 6px 18px rgba(20, 33, 61, .10); }
.cards.thumbs .btn.open:hover { background: #22345c; box-shadow: 0 3px 10px rgba(20, 33, 61, .22); }
.thumb { --s: .36; aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); position: relative; user-select: none; }
.thumb::after { content: ""; position: absolute; inset: auto 0 0 0; height: 30%; background: linear-gradient(transparent, var(--surface)); }
.thumb-in { width: 760px; padding: 0 20px 20px; transform: scale(var(--s)); transform-origin: 0 0; }
.thumb-bar { display: flex; align-items: center; gap: 10px; margin: 0 -20px 14px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 15px; }
.thumb-bar img { width: 22px; height: 22px; border-radius: 5px; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.matrix input[type="checkbox"], .chk input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--teal); }

/* dev chat */
.dv { min-height: 0; display: flex; flex-direction: column; flex: 1; }
.dv-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.dv-head .t { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pill { border-radius: 999px; padding: 1px 10px; font-size: 12px; background: var(--info-bg); color: var(--info); }
.chat { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.msg { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 0 10px; align-items: start; }
.msg .body { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.msg .who-l { font-size: 11px; color: var(--muted); }
.msg .av { width: 30px; height: 30px; border-radius: 8px; display: block; object-fit: cover; }
.msg .av.sk { border-radius: 50%; background: var(--navy); color: var(--on-navy); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.msg.user .bubble { background: var(--bubble-user); }
.msg .bubble { width: fit-content; max-width: 100%; }
.msg .bubble.wide { width: 100%; max-width: none; }
.bubble { padding: 9px 13px; border: 1px solid var(--line); border-radius: 0 12px 12px 12px; background: var(--surface); text-wrap: pretty; }
.msg.andy { width: 100%; }
.lead { margin: 8px 0 0; }
.avail { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-size: 13px; }
.avail li { display: grid; grid-template-columns: 120px 76px minmax(0, 1fr); gap: 8px; padding: 6px 10px; border-top: 1px solid var(--line); align-items: baseline; }
.avail li:first-child { border-top: 0; }
.avail .st { font-size: 11px; border-radius: 4px; text-align: center; font-weight: 700; line-height: 20px; }
.avail .st.ok { background: var(--ok-bg); color: var(--ok); }
.avail .st.part { background: var(--warn-bg); color: var(--warn); }
.avail .st.ng { background: var(--bad-bg); color: var(--bad); }
.spec { margin: 8px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 13px; }
.spec dt { color: var(--info); font-weight: 700; white-space: nowrap; }
.spec dd { margin: 0; min-width: 0; }
.appcard { margin-top: 10px; display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.appcard .play { width: 30px; height: 30px; border-radius: 6px; background: var(--navy); color: var(--on-navy); display: grid; place-items: center; font-size: 12px; flex: none; }
.appcard strong { display: block; }
.appcard small { color: var(--muted); }
.appcard button { margin-left: auto; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 3px 10px; white-space: nowrap; font-size: 12px; }
.gate { margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.gate header { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-weight: 700; font-size: 13px; }
.gate header span { font-weight: 400; color: var(--muted); font-size: 12px; }
.gate ol { list-style: none; margin: 0; padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.gate li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; font-size: 13px; }
.mark { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: var(--line); }
.mark.ok { background: var(--ok); }
.mark.warn { background: var(--warn); }
.gate li small { color: var(--muted); margin-left: 6px; }
.fixnote { margin: 4px 0 0 0; padding: 4px 8px; background: var(--warn-bg); color: var(--warn); border-radius: 6px; font-size: 12px; }
.approve { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border-top: 1px solid var(--line); font-size: 13px; }
.sys { align-self: center; font-size: 12px; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 3px 12px; text-align: center; display: flex; flex-wrap: wrap; gap: 4px 10px; justify-content: center; align-items: center; }
.sys.good { color: var(--ok); background: var(--ok-bg); }
.sys.bad { color: var(--bad); background: var(--bad-bg); }
.composer { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.composer .hint { margin: 0; font-size: 12px; color: var(--info); background: var(--info-bg); border-radius: 6px; padding: 4px 10px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.composer .hint button { border: 0; background: none; color: var(--info); text-decoration: underline; padding: 0; font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 2px 12px; font-size: 12px; }
.chips button:hover { border-color: var(--teal); }
.inputrow { display: flex; gap: 8px; }
.inputrow input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--surface); color: var(--ink); font: inherit; }
.inputrow input:disabled { opacity: .7; }
.send { width: 38px; border: 0; border-radius: 8px; background: var(--teal); color: #fff; font-size: 16px; flex: none; }

/* preview component */
.pvbody { padding-top: 12px; display: grid; gap: 10px; }
.filters, .settings { display: grid; gap: 10px; max-width: 460px; }

/* approval */
.stepper { display: flex; flex-wrap: wrap; gap: 8px; }
.stepper button { flex: 1; min-width: 150px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 12px; }
.stepper button[aria-current="step"] { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.stepper b { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.stepper .done b { color: var(--ok); }
.chk { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; font-size: 13px; }
.chk input { margin-top: 3px; flex: none; }
.reasonbox { display: grid; gap: 4px; }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; min-width: 0; }
pre.req { margin: 0; white-space: pre-wrap; font: inherit; font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }

/* modal + toast */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(20, 33, 61, .45); display: grid; place-items: center; padding: 16px; }
.modal-card { background: var(--surface); border-radius: 12px; width: min(620px, 100%); max-height: calc(100% - 8px); display: flex; flex-direction: column; box-shadow: 0 16px 48px rgba(20, 33, 61, .3); }
.modal-card.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mb { padding: 14px 16px; overflow-y: auto; display: grid; gap: 12px; }
.mf { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--navy); color: var(--on-navy); border-radius: 999px; padding: 6px 16px; font-size: 13px; z-index: 60; max-width: calc(100% - 32px); }

@media (max-width: 960px) {
  .main { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .side { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 8px; align-items: center; }
  .side .group-label, .side .side-foot { display: none; }
  .side-bottom { display: contents; }
  .navlist.threads button span { max-width: 14em; }
  .navlist { flex-direction: row; gap: 6px; }
  .navlist button { white-space: nowrap; border: 1px solid var(--line); }
  .spec { grid-template-columns: 1fr; }
  .avail li { grid-template-columns: 1fr; gap: 2px; }
  .pad { padding: 14px 12px; }
  .vision .desc, .dv-head .note { display: none; }
  .app { padding-inline: 10px; padding-block: 8px; gap: 8px; }
  .chat { padding: 10px; }
  .appcard { flex-wrap: wrap; }
  .appcard button { margin-left: 0; }
  .msg { grid-template-columns: 26px minmax(0, 1fr); gap: 0 8px; }
  .msg .av { width: 26px; height: 26px; }
}
.barbg { display: inline-block; vertical-align: middle; width: 120px; height: 8px; border-radius: 4px; background: var(--line); margin-right: 8px; overflow: hidden; }
.barfill { height: 100%; background: var(--teal); }
.barfill.hot { background: var(--bad); }
.cell { width: 40px; height: 32px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; }
.cell.日 { background: var(--info-bg); color: var(--info); }
.cell.夜 { background: var(--navy); color: var(--on-navy); }
.cell.休 { background: var(--surface-2); color: var(--muted); }
.cell.sel { outline: 2px solid var(--teal); outline-offset: 1px; }
.stack { display: grid; }
.stack > * { grid-area: 1 / 1; }
.sizer { visibility: hidden; }
.typed.streaming::after { content: "▍"; color: var(--muted); margin-left: 1px; }
@media (prefers-reduced-motion: no-preference) {
  .typed.streaming::after { animation: blink 1s steps(2, start) infinite; }
  @keyframes blink { to { visibility: hidden; } }
  .msg, .sys { animation: rise .25s ease-out; }
  .cards.thumbs .card { transition: transform .2s ease-out, box-shadow .2s ease-out, border-color .2s ease-out; }
  .cards.thumbs .card:hover, .cards.thumbs .card:focus-within { transform: translateY(-3px); }
  .cards.thumbs .thumb-in { transition: transform .35s ease-out; }
  .cards.thumbs .card:hover .thumb-in { transform: scale(calc(var(--s) * 1.04)); }
  .cards.thumbs .btn.open { transition: transform .15s ease-out, background-color .15s ease-out, box-shadow .15s ease-out; }
  .cards.thumbs .btn.open:hover { transform: translateY(-1px); }
  .cards.thumbs .btn.open:active { transform: translateY(0) scale(.97); box-shadow: none; }
  @keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}

/* ---- (元デモのアプリ画面用スタイル。見積アプリは estimate.css) ---- */
.frow { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.frow .field { flex: 1 1 160px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; font-size: 12px; background: var(--surface-2); }
.basis { margin-top: 8px; display: grid; gap: 4px; }
.lead { margin: 8px 0 0; font-size: 13px; }
.hbvt td.pm { text-align: center; color: var(--muted); }
.hbvt td.pm.p { color: var(--bad); font-weight: 700; }
.hbvt th, .hbvt td { padding: 6px 6px; }
.detail { margin-top: 12px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin: 10px 0; }
.kv div { border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; background: var(--surface-2); }
.kv small { display: block; font-size: 11px; color: var(--muted); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.ctitle { font-size: 12px; font-weight: 700; color: var(--muted); margin: 8px 0 4px; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .thr { stroke: var(--bad); stroke-width: 1; stroke-dasharray: 4 3; }
.chart .tick { font-size: 9px; fill: var(--muted); font-family: var(--font-mono); }
.chart .val { font-size: 10px; fill: var(--ink); font-family: var(--font-mono); font-weight: 700; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin: 10px 0; }
.stat { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: var(--surface-2); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.stat b { font-size: 18px; }
.stat small { font-size: 11px; color: var(--muted); }
.two { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(300px, 2fr); gap: 16px; }
.dxl { margin: 0; padding-left: 18px; font-size: 13px; display: grid; gap: 2px; }
.dxl li.acute { color: var(--bad); font-weight: 700; }
.dxl li.acute .note { color: var(--bad); font-weight: 400; }
.bill td.nw { white-space: nowrap; vertical-align: top; }
.bill td.num { vertical-align: top; }
.bill .line { padding: 2px 0; }
.bill .line.flag { background: var(--bad-bg); border-radius: 6px; padding: 4px 8px; margin: 2px 0; }
.bill .why { font-size: 12px; margin-top: 2px; }
.bill .basis { color: var(--muted); }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }

/* ---- public demo additions: vision links / org menu / app frame / ANDY-touched marks ---- */
.vision .vlink { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 6px; padding: 3px 10px; font-size: 12px; text-decoration: none; }
.vision .vlink:hover { border-color: var(--teal); }
.menu .org-label { font-size: 11px; color: var(--muted); padding: 8px 8px 2px; border-top: 1px solid var(--line); margin-top: 4px; }
.menu .org-label:first-of-type { border-top: 0; margin-top: 0; }
.menu .org-label small { font-weight: 400; }
.menu { width: 300px; max-height: calc(100vh - 120px); overflow-y: auto; }
.frame { position: fixed; inset: 0; z-index: 40; background: var(--surface); display: flex; flex-direction: column; }
.frame-bar { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.frame-bar h2 { font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.frame-bar .frame-note { margin-left: auto; }
.frame-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.frame-body > :not(.est) { padding: 12px 16px 96px; max-width: 1100px; width: 100%; margin: 0 auto; }
.frame-body > .est { flex: 1; min-height: 0; }
textarea.by-andy { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); background: #f1fbf8; }
.by-andy-tag { margin-left: 8px; }
@media (max-width: 960px) { .frame-bar .frame-note { display: none; } .frame-body > :not(.est) { padding: 10px 10px 96px; } }

/* 2026-11-15: demo bar stays visible above the app frame / review fixes */
.frame { top: var(--frame-top, 0px); border-top-left-radius: 10px; border-top-right-radius: 10px; }
.frame-banner { padding: 8px 16px; font-size: 14px; font-weight: 700; line-height: 1.5; border-bottom: 1px solid var(--line); }
.frame-banner.preview { background: var(--warn-bg); color: #7a4100; }
.frame-banner.ok { background: var(--ok-bg); color: #11603b; }
.vision .vlink.vcta { background: #caf1a2; color: #111; border-color: #caf1a2; font-weight: 700; }
.vision .vlink.vcta:hover { background: #dbf7bd; }
.stages { display: inline-block; margin-left: 8px; font-size: 12px; font-weight: 700; color: var(--info); background: var(--info-bg); border-radius: 4px; padding: 0 6px; line-height: 20px; vertical-align: 1px; }
.gate li small { display: block; margin-left: 0; }
textarea.ta::placeholder { color: #9aa3b0; }
.reason-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.done { display: grid; gap: 16px; }
.done-head { display: flex; gap: 14px; align-items: center; }
.done-head img { width: 56px; height: 56px; border-radius: 50%; border: 2px solid #caf1a2; flex: none; }
.done-head p { font-size: 16px; line-height: 1.7; margin: 0; }
.done-acts { display: grid; gap: 10px; }
.done-acts .btn { min-height: 48px; padding: 10px 18px; font-size: 16px; width: 100%; }
.done-back { margin: 0; text-align: center; font-size: 14px; }
.done-back a { color: var(--muted); margin: 0 8px; }
.vision .vlink, .vision button { white-space: nowrap; }
@media (max-width: 760px) {
  .vision b { display: none; }
  .vision .tools { margin-left: 0; width: 100%; }
  .vision .vlink, .vision button { padding: 4px 9px; }
  .sp-hide { display: none; }
}
