/* HKMAC hands-on — a phone worksheet for a Saturday class in Kwun Tong.
 * Same family as /workshop/: deep navy ink, photography, hairline borders,
 * Noto Sans TC, signature easing. Replaces the slate dashboard.
 * Palette: cream paper · navy ink · one cyan accent. No gold / mint / orange / violet.
 */
:root {
  --ink: #0b1f4a;            /* deep navy — brand ink, text + primary */
  --ink-2: #1b3068;          /* softer navy for subheads */
  --muted: #6a7587;          /* warm-leaning muted slate */
  --paper: #f5f1e9;          /* warm cream paper (page) */
  --paper-2: #efe8db;        /* deeper paper for zones */
  --card: #fffaf1;           /* warm near-white card */
  --prompt-bg: #fbf7ef;      /* prompt paper */
  --line: rgba(11, 31, 74, .14);     /* navy hairline */
  --line-soft: rgba(11, 31, 74, .08);
  --accent: #0891b2;         /* cyan — the single accent */
  --accent-2: #0a5d6e;
  --accent-soft: rgba(8, 145, 178, .12);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --max: 720px;
  --ease: cubic-bezier(.22, 1, .36, 1);   /* brand easing */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 1.0625rem;
  font-weight: 500;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: calc(var(--safe-b) + 2.5rem);
  overflow-x: hidden;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, textarea { font-family: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- thin frosted top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 80;
  background: rgba(245, 241, 233, .82);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line-soft);
  padding: calc(.55rem + var(--safe-t)) 1rem .55rem;
}
.topbar-inner {
  max-width: var(--max); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
}
.brand {
  color: var(--ink); font-weight: 900; font-size: .98rem;
  letter-spacing: -.01em; text-decoration: none;
}
.brand .brand-sep { color: var(--muted); font-weight: 500; margin: 0 .15rem; }
.brand .brand-gem { color: var(--accent); font-weight: 700; }
.top-links { display: flex; align-items: center; gap: .85rem; }
.top-links a {
  color: var(--ink-2); font-weight: 700; font-size: .92rem; text-decoration: none;
}
.top-links a:hover { color: var(--accent); }

/* ---------- shell ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.1rem; }

/* ---------- quiet hero (no 3-step wizard) ---------- */
.hero { padding: 1.7rem 0 .3rem; }
.kicker {
  font-size: .72rem; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent);
}
.hero h1 {
  font-size: clamp(1.7rem, 7vw, 2.3rem);
  font-weight: 900; letter-spacing: -.03em; line-height: 1.12;
  color: var(--ink); margin: .5rem 0 .55rem;
}
.hero p { color: var(--muted); font-weight: 500; font-size: 1rem; max-width: 32ch; }

/* ---------- session switcher: compact segmented 1–8 ---------- */
.seg-label {
  font-size: .72rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin: 1.2rem 0 .45rem;
}
.sess-switch {
  display: flex; gap: .35rem;
}
.sess-switch .chip {
  flex: 1 1 0; min-width: 0;
  height: 42px; padding: 0; border-radius: 11px;
  border: 1px solid var(--line); background: var(--card);
  color: var(--ink); font-weight: 700; font-size: .98rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s, border-color .2s, transform .15s var(--ease);
}
.sess-switch .chip:hover { border-color: var(--accent); }
.sess-switch .chip:active { transform: scale(.95); }
.sess-switch .chip.active {
  background: var(--ink); color: #fff; border-color: var(--ink);
}
.sess-switch .chip.pending { color: var(--muted); }
.sess-switch .chip.pending.active { color: #fff; }

/* ---------- current session: photo header ---------- */
.sess-head {
  position: relative; overflow: hidden;
  border-radius: var(--radius);
  margin: .65rem 0 1.15rem;
  min-height: 232px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 16px 40px rgba(11, 31, 74, .18);
}
.sess-cover {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.sess-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7, 12, 24, .12) 0%, rgba(7, 12, 24, .42) 46%, rgba(7, 12, 24, .9) 100%);
}
.sess-body {
  position: relative; z-index: 1;
  padding: 1.3rem 1.2rem 1.3rem;
  min-height: 232px;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.sess-meta {
  font-size: .8rem; font-weight: 700; letter-spacing: .04em;
  color: #bfe3f0;
}
.sess-head h2 {
  font-size: clamp(1.5rem, 6vw, 1.95rem);
  font-weight: 900; letter-spacing: -.02em; line-height: 1.1;
  margin: .2rem 0 .15rem;
}
.sess-catch { font-size: 1.02rem; font-weight: 700; color: #a6dcec; }
.sess-blurb {
  margin-top: .25rem; font-size: .92rem; font-weight: 500;
  color: rgba(255, 255, 255, .85); max-width: 34ch;
}
.verbs { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .6rem; }
.verbs span {
  font-size: .73rem; font-weight: 700;
  padding: .2rem .6rem; border-radius: 999px;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22);
}
.badge-pending {
  align-self: flex-start; margin-top: .6rem;
  font-size: .73rem; font-weight: 700; padding: .22rem .65rem; border-radius: 999px;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .26);
}

/* ---------- path: 3 equal segments ---------- */
.path-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem;
  margin: 0 0 1.15rem;
}
.path-row .chip {
  height: 44px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--card);
  color: var(--ink); font-weight: 700; font-size: .96rem;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s, border-color .2s, transform .15s var(--ease);
}
.path-row .chip:hover { border-color: var(--accent); }
.path-row .chip:active { transform: scale(.97); }
.path-row .chip.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}

/* ---------- rule: one quiet line ---------- */
.rule {
  font-size: .86rem; font-weight: 500; color: var(--muted);
  line-height: 1.55; margin: 0 .1rem 1.3rem;
}
.rule strong { color: var(--ink-2); font-weight: 700; }

/* ---------- featured prompt card ---------- */
.card.featured {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.15rem 1.25rem;
  box-shadow: 0 10px 30px rgba(11, 31, 74, .06);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  margin-bottom: .55rem;
}
.path-tag {
  font-size: .74rem; font-weight: 700; letter-spacing: .04em;
  color: var(--accent);
}
.card-no { font-size: .74rem; font-weight: 700; color: var(--muted); }
.card-title {
  font-size: 1.3rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.25;
  color: var(--ink); margin-bottom: .35rem;
}
.why {
  font-size: .95rem; font-weight: 500; color: var(--muted);
  line-height: 1.55; margin-bottom: .95rem;
}

/* template / example toggle */
.toggle {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px;
  padding: .2rem; background: var(--paper); margin-bottom: .7rem;
}
.toggle button {
  border: 0; background: transparent; cursor: pointer;
  font-weight: 700; font-size: .9rem; color: var(--muted);
  padding: .42rem .95rem; border-radius: 999px; min-height: 34px;
  transition: background .2s var(--ease), color .2s;
}
.toggle button.active { background: var(--accent-soft); color: var(--accent-2); }
.mode-hint {
  font-size: .84rem; font-weight: 500; color: var(--muted);
  margin: -.25rem 0 .85rem; line-height: 1.5;
}

/* prompt on paper — readable, not a terminal */
.prompt-box {
  background: var(--prompt-bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1rem 1rem;
  font-family: var(--font);
  font-size: .98rem;
  line-height: 1.72;
  font-weight: 500;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-height: 46vh; overflow: auto;
  margin-bottom: 1rem;
  -webkit-user-select: text; user-select: text;
}

.prompt-foot { display: flex; flex-direction: column; align-items: stretch; gap: .5rem; }
.btn-primary {
  width: 100%; min-height: 54px; border: 0; border-radius: 13px;
  background: var(--ink); color: #fff;
  font-weight: 700; font-size: 1.03rem; letter-spacing: .01em;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  transition: background .2s var(--ease), transform .15s var(--ease), box-shadow .2s;
}
.btn-primary:hover { background: var(--ink-2); }
.btn-primary:active { transform: scale(.985); }
.btn-primary.copied { background: var(--accent); }
.btn-quiet {
  align-self: center; border: 0; background: transparent;
  color: var(--accent-2); font-weight: 700; font-size: .88rem;
  cursor: pointer; padding: .2rem .4rem; text-decoration: none;
  min-height: 36px;
}
.btn-quiet:hover { color: var(--accent); }

/* ---------- other prompts: compact list ---------- */
.list-section { margin-top: 1.5rem; }
.list-title-h {
  display: flex; align-items: baseline; gap: .5rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: .35rem;
}
.list-count {
  font-size: .72rem; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); padding: .1rem .45rem; border-radius: 999px;
}
.prompt-list { list-style: none; }
.prompt-list li { border-top: 1px solid var(--line-soft); }
.list-row {
  width: 100%; display: flex; align-items: center; gap: .75rem;
  background: transparent; border: 0; cursor: pointer; text-align: left;
  padding: .8rem .15rem;
  transition: background .2s var(--ease);
}
.list-row:hover { background: rgba(11, 31, 74, .035); }
.list-no {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  background: var(--paper-2); color: var(--muted);
  font-size: .78rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.list-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.list-title-text {
  font-size: .98rem; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.list-why-text {
  font-size: .82rem; font-weight: 500; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.list-path { flex: 0 0 auto; font-size: .72rem; font-weight: 700; color: var(--accent); }

.empty {
  background: var(--card); border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 1.4rem 1.15rem; text-align: center;
  font-weight: 500; color: var(--muted); line-height: 1.6;
}
.empty a { color: var(--accent); font-weight: 700; text-decoration: none; }

/* ---------- bot: quiet text link + panel (ids preserved for prompt-bot.js) ---------- */
.bot-wrap { margin-top: 2.4rem; }
.bot-link {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .92rem; font-weight: 700; color: var(--accent);
  padding: .15rem 0; text-decoration: none;
}
.bot-link::-webkit-details-marker { display: none; }
.bot-link::after {
  content: ""; width: .5rem; height: .5rem; margin-left: .1rem;
  border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg); transition: transform .2s var(--ease); margin-top: -.2rem;
}
.bot-wrap[open] .bot-link::after { transform: rotate(225deg); margin-top: .15rem; }
.bot-link-sub { color: var(--muted); font-weight: 500; }

.bot-panel {
  margin-top: .7rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.bot-head { background: var(--paper-2); padding: 1.05rem 1.15rem; border-bottom: 1px solid var(--line-soft); }
.bot-head h2 { font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.bot-head p { font-size: .92rem; font-weight: 500; color: var(--muted); margin-top: .2rem; }
.bot-badge {
  display: inline-block; margin-top: .5rem;
  background: var(--accent-soft); color: var(--accent-2);
  font-weight: 700; font-size: .8rem; padding: .25rem .65rem; border-radius: 999px;
}
.bot-mode-switch, .bot-lock, .bot-input-row {
  display: flex; flex-wrap: wrap; gap: .45rem; padding: .8rem 1.05rem;
  align-items: center; border-top: 1px solid var(--line-soft);
}
.bot-mode-switch .label { font-size: .9rem; font-weight: 700; color: var(--muted); }
.bot-mode-switch button, .bot-send, .bot-reset {
  font-weight: 700; padding: .55rem .9rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); cursor: pointer;
  color: var(--ink); min-height: 42px;
  transition: background .2s var(--ease), color .2s, border-color .2s;
}
.bot-mode-switch button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.bot-mode-switch button.active.ai { background: var(--accent); border-color: var(--accent); }
.bot-status { font-size: .84rem; font-weight: 700; color: var(--muted); width: 100%; }
.bot-status.on { color: var(--accent-2); }
.bot-lock { background: var(--paper); display: block; }
.bot-lock h3 { font-size: 1.02rem; font-weight: 700; color: var(--ink); }
.bot-lock p { font-weight: 500; color: var(--muted); margin: .3rem 0 .6rem; line-height: 1.5; }
.bot-lock-row { display: flex; flex-wrap: wrap; gap: .45rem; }
.bot-lock-row input, .bot-input-row textarea, .bot-input-row input {
  flex: 1 1 160px; font-weight: 500; font-size: 1rem;
  padding: .7rem .85rem; border-radius: 11px; border: 1px solid var(--line);
  background: var(--card);
}
.bot-send { background: var(--ink); color: #fff; border-color: var(--ink); }
.bot-send:disabled { opacity: .45; }
.bot-reset { background: var(--paper-2); border-color: transparent; }
#botNewSession { background: var(--accent); color: #fff; border-color: var(--accent); }
.bot-log {
  max-height: 44vh; overflow-y: auto; padding: 1rem 1.05rem;
  background: var(--paper); display: flex; flex-direction: column; gap: .65rem;
}
.bot-msg { max-width: 94%; padding: .75rem .95rem; border-radius: 14px; font-weight: 500; line-height: 1.55; }
.bot-msg.bot { align-self: flex-start; background: var(--card); border: 1px solid var(--line-soft); color: var(--ink); }
.bot-msg.user { align-self: flex-end; background: var(--ink); color: #fff; }
.bot-msg .who { display: block; font-size: .76rem; font-weight: 700; opacity: .65; margin-bottom: .2rem; }
.bot-choices { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.bot-choices button {
  font-weight: 700; padding: .55rem .8rem; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); min-height: 40px;
  transition: border-color .2s, background .2s;
}
.bot-choices button:hover { border-color: var(--accent); background: var(--accent-soft); }
.bot-result { display: none; padding: 1.05rem; background: var(--paper-2); border-top: 1px solid var(--line-soft); }
.bot-result.show { display: block; }
.bot-result h3 { color: var(--ink); font-size: 1.02rem; font-weight: 700; margin-bottom: .55rem; }
#botDecisionLabel { color: var(--muted); font-weight: 700; }
.bot-loading {
  display: none; align-items: center; gap: .6rem;
  padding: .8rem 1.05rem; font-weight: 700; color: var(--accent-2);
  border-top: 1px solid var(--line-soft); background: var(--accent-soft);
}
.bot-loading.show { display: flex; }
.bot-spinner {
  width: 1.3rem; height: 1.3rem; border-radius: 50%;
  border: 2.5px solid var(--accent-soft); border-top-color: var(--accent);
  animation: spin .75s linear infinite;
}
.bot-msg.thinking {
  display: flex; align-items: center; gap: .55rem;
  background: var(--paper-2); border-style: dashed; color: var(--muted);
}
.mini-spinner {
  width: 1rem; height: 1rem; border-radius: 50%;
  border: 2.5px solid var(--line); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.bot-dots span {
  display: inline-block; width: .34rem; height: .34rem; margin-left: .14rem;
  border-radius: 50%; background: var(--accent); animation: dot 1.2s ease-in-out infinite;
}
.bot-dots span:nth-child(2) { animation-delay: .15s; }
.bot-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .35; } 40% { opacity: 1; } }
.bot-result .actions { display: grid; grid-template-columns: 1fr; gap: .5rem; margin-top: .9rem; }
.bot-result .btn-copy, .bot-result .btn-gemini {
  min-height: 48px; border-radius: 12px; font-weight: 700; font-size: .98rem;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: background .2s var(--ease);
}
.bot-result .btn-copy { background: var(--ink); color: #fff; border: 0; }
.bot-result .btn-copy.copied { background: var(--accent); }
.bot-result .btn-gemini { background: var(--card); color: var(--ink); border: 1px solid var(--line); }

/* ---------- site map + footer ---------- */
.site-map {
  display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: 2.4rem;
}
.site-map a {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: .85rem .95rem; text-decoration: none;
  font-weight: 700; color: var(--ink); font-size: .94rem;
  transition: border-color .2s var(--ease), transform .15s var(--ease);
}
.site-map a:hover { border-color: var(--accent); transform: translateY(-1px); }
.site-map a small { display: block; font-weight: 500; font-size: .8rem; color: var(--muted); margin-top: .12rem; }
.page-foot {
  margin-top: 1.6rem; padding-top: 1.1rem; border-top: 1px solid var(--line-soft);
  font-weight: 500; color: var(--muted); font-size: .86rem; line-height: 1.7;
}
.page-foot a { color: var(--accent); font-weight: 700; text-decoration: none; }

/* ---------- toast (bottom-center, no sticky bar above) ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-b) + 1.3rem);
  transform: translateX(-50%) translateY(140%);
  background: var(--ink); color: #fff; font-weight: 700; font-size: .92rem;
  padding: .72rem 1.15rem; border-radius: 999px; z-index: 200;
  max-width: 90vw; text-align: center; pointer-events: none;
  box-shadow: 0 14px 34px rgba(11, 31, 74, .28);
  transition: transform .25s var(--ease);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- W2 flow: 通關四步 · 數位生產線 · 人工核對 ---------- */
.flow { margin: -.35rem 0 1.15rem; }
.flow[hidden] { display: none; }
.flow-title {
  font-size: .72rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: .45rem;
}
.flow-steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; }
.flow-steps li {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: .6rem .55rem .65rem;
  display: flex; flex-direction: column; gap: .12rem;
}
.flow-no {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); color: #fff;
  font-size: .74rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: .25rem;
}
.flow-steps li:last-child .flow-no { background: var(--accent); }
.flow-t { font-size: .84rem; font-weight: 700; color: var(--ink); line-height: 1.3; }
.flow-d { font-size: .7rem; font-weight: 500; color: var(--muted); line-height: 1.45; }

/* pipeline strip — 摘要 → 計劃 → 寫嘢 */
.pline { display: flex; align-items: stretch; gap: .3rem; margin: 0 0 1.1rem; }
.pline-node {
  flex: 1 1 0; min-width: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  padding: .6rem .3rem .55rem; border-radius: var(--radius-sm);
  border: 1px dashed var(--line); background: var(--paper-2); color: var(--muted);
  transition: border-color .2s var(--ease), background .2s var(--ease), color .2s;
}
.pline-node .pline-no {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid currentColor; font-size: .72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.pline-node .pline-t { font-size: .92rem; font-weight: 700; letter-spacing: .02em; }
.pline-node:not(:disabled):hover { border-color: var(--accent); color: var(--accent-2); }
.pline-node:disabled { opacity: .55; cursor: default; }
.pline-node.active {
  border-style: solid; border-color: var(--accent);
  background: var(--accent-soft); color: var(--accent-2);
}
.pline-arrow { align-self: center; color: var(--muted); font-weight: 700; font-size: .9rem; }

/* stage pill on the featured card */
.stage-pill {
  display: inline-block; margin-left: .4rem;
  font-size: .7rem; font-weight: 700; letter-spacing: .03em;
  color: #fff; background: var(--accent);
  border-radius: 999px; padding: .14rem .5rem;
  vertical-align: 1px;
}

/* quiet actions row (只複製 / ChatGPT) */
.quiet-row { display: flex; justify-content: center; align-items: center; gap: .35rem; }
.quiet-row .btn-quiet { align-self: center; }

/* 通關第 4 步 — 人工核對 checklist */
.check-card {
  margin-top: 1.5rem;
  background: var(--ink); color: #fff;
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.25rem;
  box-shadow: 0 14px 34px rgba(11, 31, 74, .2);
}
.check-card h4 { font-size: 1.05rem; font-weight: 900; color: #a6dcec; margin-bottom: .2rem; }
.check-card p { font-size: .86rem; font-weight: 500; color: rgba(255, 255, 255, .82); margin-bottom: .75rem; line-height: 1.55; }
.check-card ul { list-style: none; display: flex; flex-direction: column; gap: .55rem; }
.check-card li { display: flex; gap: .6rem; align-items: flex-start; font-size: .93rem; font-weight: 500; line-height: 1.5; }
.check-box {
  flex: 0 0 auto; width: 18px; height: 18px; margin-top: .2rem;
  border-radius: 5px; border: 1.5px solid rgba(255, 255, 255, .55);
}

/* ---------- W2 role mode: AI assistant picker + banner + backup wrap ---------- */
.role-picker { padding: 1rem 1.05rem; border-top: 1px solid var(--line-soft); }
.role-picker h3 { font-size: 1.12rem; font-weight: 900; color: var(--ink); }
.role-hint { font-size: .88rem; font-weight: 500; color: var(--muted); margin: .25rem 0 .8rem; line-height: 1.5; }
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.role-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: .18rem;
  padding: .8rem .85rem; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--card);
  cursor: pointer; text-align: left; min-height: 88px;
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .15s var(--ease);
}
.role-tile:hover { border-color: var(--accent); background: var(--accent-soft); }
.role-tile:active { transform: scale(.97); }
.role-icon { font-size: 1.35rem; line-height: 1; }
.role-t { font-size: 1rem; font-weight: 900; color: var(--ink); }
.role-s { font-size: .78rem; font-weight: 500; color: var(--muted); }
.role-custom-row { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .7rem; }
.role-custom-row input {
  flex: 1 1 180px; font-weight: 500; font-size: 1rem;
  padding: .7rem .85rem; border-radius: 11px; border: 1px solid var(--line);
  background: var(--card);
}

.role-banner {
  display: none; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .6rem 1.05rem; border-top: 1px solid var(--line-soft);
  background: var(--accent-soft); font-weight: 700; color: var(--accent-2); font-size: .94rem;
}
.role-switch {
  border: 1.5px solid var(--accent); background: var(--card); color: var(--accent-2);
  font-weight: 700; font-size: .88rem; padding: .4rem .85rem; border-radius: 999px;
  cursor: pointer; min-height: 38px;
}
.role-switch:hover { background: var(--accent); color: #fff; }

.backup-wrap { margin-top: 1.4rem; }
.backup-wrap[hidden] { display: none; }
.backup-wrap summary {
  list-style: none; cursor: pointer;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem;
  background: var(--card); border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm); padding: .85rem 1rem;
  font-weight: 700; color: var(--ink-2); font-size: .98rem;
}
.backup-wrap summary::-webkit-details-marker { display: none; }
.backup-wrap summary::after {
  content: "▾"; margin-left: auto; color: var(--muted); font-size: .9rem;
  transition: transform .2s var(--ease);
}
.backup-wrap[open] summary::after { transform: rotate(180deg); }
.backup-wrap summary small { display: block; width: 100%; font-weight: 500; font-size: .8rem; color: var(--muted); }
.backup-wrap[open] summary { border-style: solid; border-color: var(--accent); }

/* file upload: chip + actions row */
.file-chip-row { width: 100%; display: flex; }
.file-chip {
  display: inline-flex; align-items: center; gap: .45rem;
  max-width: 100%;
  background: var(--accent-soft); color: var(--accent-2);
  border: 1px solid rgba(8, 145, 178, .35);
  border-radius: 999px; padding: .38rem .8rem;
  font-size: .84rem; font-weight: 700;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.file-chip.busy { background: var(--paper-2); color: var(--muted); border-color: var(--line); }
.file-chip.error { background: #fdecea; color: #9f1d13; border-color: rgba(159, 29, 19, .3); }
.file-chip .mini-spinner { width: .85rem; height: .85rem; border-width: 2px; flex: 0 0 auto; }
.file-chip-x {
  border: 0; background: transparent; cursor: pointer;
  color: inherit; font-weight: 900; font-size: .85rem;
  padding: 0 0 0 .1rem; min-height: 24px;
}
.bot-input-actions { display: flex; flex-wrap: wrap; gap: .45rem; width: 100%; }
.bot-input-actions .bot-send { margin-left: auto; }
.bot-upload {
  font-weight: 700; padding: .55rem .9rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper-2); cursor: pointer;
  color: var(--ink); min-height: 42px;
  transition: border-color .2s, background .2s;
}
.bot-upload:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- responsive: keep the worksheet language on larger screens ---------- */
@media (min-width: 640px) {
  .site-map { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 760px) {
  :root { --max: 760px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
