/* Shared design tokens define color, type, spacing, surfaces, and responsive layout.






*/
:root {
  /* The base theme sets the default page, card, border, shadow, and accent tokens.




*/
  --accent: #D3F84B;
  --accent-ink: #0C0C0C;
  --on-accent: #0C0C0C;
  --bg: #F1F1EF;
  --bg2: #E9E9E6;
  --card: #FFFFFF;
  --ink: #0C0C0C;
  --ink2: #4A4A47;
  --muted: #676762; /* >=4.5:1 on the light bg, bg2, and card surfaces. */
  --ink3: var(--muted);
  /* Selected descriptions use the on-accent foreground on the solid lime selection. */
  --selected-description-ink: var(--on-accent);
  /* Keep hairline separators soft; only actionable control frames use this stronger token. */
  --line: #E2E2DE;
  --line2: #D2D2CD;
  --line-control: #7F7F7A;
  --hair: rgba(12, 12, 12, .10);
  --danger: #A63A2B;
  --ok: #3E7C4F;
  --amber: #B98214;
  --amber-bg: color-mix(in srgb, var(--amber) 12%, var(--card));
  --accent-soft: var(--accent);
  --accent-wash: var(--card);
  --accent-line: var(--line2);
  /* Data bars retain the accent hue with darker steps that separate from their real tracks. */
  --data-tier-1: color-mix(in srgb, var(--accent) 44%, #000000);
  --data-tier-2: color-mix(in srgb, var(--accent) 48%, #000000);
  --data-tier-3: color-mix(in srgb, var(--accent) 52%, #000000);
  --data-tier-4: color-mix(in srgb, var(--accent) 56%, #000000);
  --landing-due-fill: color-mix(in srgb, var(--accent) 12%, var(--card));
  --landing-tab-selected-bg: var(--ink);
  --landing-tab-selected-fg: var(--bg);
  --danger-soft: color-mix(in srgb, var(--danger) 12%, var(--card));
  --ok-soft: color-mix(in srgb, var(--ok) 12%, var(--card));
  --radius: 14px;
  --fab-size: 54px;
  --fab-offset: calc(92px + var(--sab));
  --shadow-1: none;
  --shadow-2: 0 1px 0 var(--line2);
  /* Shared theme tokens are also passed to isolated canvas views.


*/
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --pad: 16px;
  --gap: 12px;
  /* The app column keeps content readable on wide screens while preserving the compact mobile layout.












*/
  --app-w: 760px;
  --sab: env(safe-area-inset-bottom, 0px);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}
[data-theme="dark"] {
  /* Keep native controls in the same palette as the page surface. `accent-color` alone does not
     make an unchecked checkbox's UA border readable against a dark card. */
  color-scheme: dark;
  --bg: #0A0A0A;
  --bg2: #121212;
  --card: #151515;
  --accent-ink: #F4F4F1;
  --ink: #F4F4F1;
  --ink2: #A8A8A3;
  --muted: #A8A8A3; /* >=4.5:1 on the dark bg, bg2, and card surfaces. */
  --ink3: var(--muted);
  --line: #232323;
  --line2: #2E2E2E;
  --line-control: #777772;
  --hair: rgba(244, 244, 241, .10);
  --danger: #DD7663;
  --ok: #6FAE82;
  --amber: #D9A94F;
  --amber-bg: color-mix(in srgb, var(--amber) 16%, var(--card));
  --accent-soft: var(--accent);
  --accent-wash: var(--card);
  --landing-due-fill: color-mix(in srgb, var(--accent) 20%, var(--card));
  --landing-tab-selected-bg: var(--accent);
  --landing-tab-selected-fg: var(--on-accent);
  --shadow-1: none;
  --shadow-2: 0 1px 0 var(--line2);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: color-mix(in srgb, var(--bg) 50%, var(--bg2));
  color: var(--ink); font-size: 15px; line-height: 1.5;
  font-synthesis-weight: none; text-rendering: optimizeLegibility;
}
.hidden { display: none !important; }
.muted { color: var(--ink3); }
.small { font-size: 13px; }
.tnum { font-variant-numeric: tabular-nums; }
a { color: var(--accent-ink); text-decoration: none; font-weight: 600; }
h1 { font-size: 26px; font-weight: 700; margin: 8px 0; letter-spacing: -.02em; line-height: 1.2; }
h2 { font-size: 20px; font-weight: 700; margin: 4px 0 12px; letter-spacing: -.02em; }

/* ---------- R29 public landing ---------- */
.landing {
  --landing-accent: var(--accent);   /* The landing page uses the same accent token as the app.*/
  --landing-paper: #F3F4F1;
  --landing-card: #FFFFFF;
  --landing-ink: #1A1C1E;
  --landing-ink2: #5A5F5B;
  --landing-ink3: var(--landing-ink2);
  --accent-ink: var(--landing-ink); /* Landing paper remains light in both theme modes. */
  /* Master 2026-10-15 contrast ruling: hero and wordmark stay ink on the lime brand surface.
     Restore Lime for both by changing this single token to var(--landing-accent). */
  --landing-brand-ink: var(--landing-ink);
  --landing-hair: rgba(26, 28, 30, .13);
  min-height: 100dvh; color: var(--landing-ink); background: var(--landing-paper);
  font-family: "Schibsted Grotesk", -apple-system, system-ui, sans-serif;
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  transition: background .6s;
}
.landing * { box-sizing: border-box; }
.landing a { color: inherit; font-weight: inherit; }
.landing button { font: inherit; }
.landing-wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding-inline: 28px; }
.landing-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--landing-paper) 86%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.landing-header.scrolled { border-bottom-color: var(--landing-hair); }
.landing-nav { display: flex; align-items: center; gap: 22px; padding-block: 18px; }
.landing-mark { color: var(--landing-brand-ink); font-family: "Bricolage Grotesque", system-ui, sans-serif; font-weight: 600; font-size: 21px; letter-spacing: -.01em; }
.landing-mark b { color: var(--landing-brand-ink); font-weight: 600; transition: color .6s; }
.landing-spacer { flex: 1; }
.landing-quiet { color: var(--landing-ink2) !important; font-size: 14.5px !important; font-weight: 500 !important; }
.landing-btn {
  display: inline-flex; align-items: center; justify-content: center; width: auto;
  border: 0; border-radius: 10px; padding: 11px 22px; background: var(--landing-ink);
  color: var(--landing-paper); font-weight: 600; font-size: 15px;
  transition: background .6s, transform .15s;
}
.landing-btn.accent { background: var(--landing-accent); color: var(--on-accent); }
.landing-btn.big { border-radius: 12px; padding: 14px 28px; font-size: 16.5px; }
.landing-btn:hover { transform: translateY(-1px); }
.landing-hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 48px;
  align-items: center; min-height: calc(92vh - 70px); padding: 64px 0 88px;
}
.landing-kicker { margin: 0 0 22px; color: var(--landing-ink2); font: 12px "Fragment Mono", ui-monospace, monospace; letter-spacing: .04em; }
.landing-kicker i { color: var(--accent-ink); font-style: normal; transition: color .6s; }
.landing h1, .landing h2, .landing h3 { font-family: "Bricolage Grotesque", system-ui, sans-serif; }
.landing h1 { max-width: 11ch; margin: 0; font-size: clamp(42px, 6.2vw, 80px); font-weight: 600; line-height: .99; letter-spacing: -.028em; }
.landing h1 span { display: block; color: var(--landing-brand-ink); transition: color .6s; }
.landing-sub { max-width: 44ch; margin: 26px 0 34px; color: var(--landing-ink2); font-size: 18.5px; }
.landing-cta-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.landing-cta-note { color: var(--landing-ink3); font: 12px "Fragment Mono", ui-monospace, monospace; }
/* Quieter than .landing-sub and louder than the mono note: it qualifies the offer rather than
   making it, and it has to stay readable as a full sentence at 390px. */
.landing-byo { max-width: 44ch; margin: 20px 0 0; color: var(--landing-ink2); font-size: 15px; }
.landing-stage { position: relative; justify-self: center; width: min(420px, 100%); }
.landing-ask {
  position: absolute; top: -14px; right: -8px; z-index: 3; max-width: 290px;
  padding: 12px 16px; border-radius: 16px 16px 4px 16px;
  background: var(--landing-ink); color: var(--landing-paper); box-shadow: 0 10px 30px rgba(26, 28, 30, .18);
  font-size: 14.5px; line-height: 1.45; opacity: 0; transform: translateY(8px) scale(.96);
}
.landing-caret { display: inline-block; width: 1px; height: 1em; margin-left: 1px; background: var(--landing-paper); vertical-align: -2px; animation: landingBlink 1s steps(1) infinite; }
@keyframes landingBlink { 50% { opacity: 0; } }
.landing-phone { position: relative; margin-top: 44px; padding: 12px; border: 1px solid var(--landing-hair); border-radius: 30px; background: var(--landing-card); box-shadow: 0 24px 60px rgba(26, 28, 30, .13); }
.landing-phone-screen { display: flex; flex-direction: column; height: 492px; overflow: hidden; border-radius: 20px; background: var(--landing-paper); }
.landing-phone-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 10px; font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: 16px; font-weight: 600; }
.landing-phone-head i { width: 8px; height: 8px; border-radius: 50%; background: var(--landing-accent); transition: background .6s; }
.landing-phone-tabs { flex: none; gap: 6px; margin: 0; padding: 0 14px 12px; }
.landing-phone-tabs button { pointer-events: none; padding: 6px 12px; border: 1px solid var(--landing-hair); border-radius: 999px; background: var(--landing-card); color: var(--landing-ink2); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.landing-phone-tabs button.on { border-color: var(--landing-ink); background: var(--landing-ink); color: var(--landing-paper); }
.landing-phone-tabs button.landing-new-view { border-color: var(--accent-ink); background: var(--landing-accent); color: var(--on-accent); }
.landing-phone-body { flex: 1; min-height: 0; overflow: hidden; padding: 2px 14px; pointer-events: none; }
.landing-phone-body .view-list { display: flex; flex-direction: column; gap: 8px; }
.landing-phone-body .task-row { min-height: 0; padding: 11px 13px; border: 1px solid var(--landing-hair); border-radius: 12px; background: var(--landing-card); box-shadow: none; }
.landing-phone-body .tick, .landing-phone-body .row-act { display: none; }
.landing-phone-body .task-title { color: var(--landing-ink); font-size: 13.5px; font-weight: 500; line-height: 1.35; }
.landing-phone-body .task-meta { margin-top: 7px; }
.landing-phone-body .pill { border: 1px solid var(--landing-hair); background: transparent; color: var(--landing-ink2); font-size: 10.5px; }
.landing-phone-bar { display: flex; align-items: center; gap: 8px; margin: 10px 14px 14px; padding: 9px 15px; border: 1px solid var(--landing-hair); border-radius: 999px; background: var(--landing-card); color: var(--landing-ink3); font-size: 12.5px; }
.landing-phone-bar i { width: 22px; height: 22px; margin-left: auto; border-radius: 50%; background: var(--landing-accent); transition: background .6s; }
/* the grown views + Home widgets are the SHIPPED renderers, shrunk to phone scale here.
   --accent is set locally so the demo's green never leaks into the signed-in app. */
.landing-phone-body { --accent: var(--landing-accent); }
.landing-phone-body .kb { gap: 8px; padding-bottom: 4px; }
.landing-phone-body .kb-col { width: calc(50% - 4px); min-width: calc(50% - 4px); padding: 8px; border-radius: 12px; }
.landing-phone-body .kb-col[data-col=""] { display: none; }
.landing-phone-body .kb-col h4 { font-size: 11px; }
.landing-phone-body .kb-card { margin-top: 6px; padding: 8px 9px; border-radius: 10px; font-size: 11.5px; box-shadow: none; }
.landing-phone-body .tbl-wrap { border-radius: 12px; box-shadow: none; }
.landing-phone-body .tbl th, .landing-phone-body .tbl td { padding: 7px 9px; font-size: 11px; }
.landing-phone-body .tbl th:nth-child(2), .landing-phone-body .tbl td:nth-child(2),
.landing-phone-body .tbl th:nth-child(3), .landing-phone-body .tbl td:nth-child(3),
.landing-phone-body .tbl th:nth-child(5), .landing-phone-body .tbl td:nth-child(5),
.landing-phone-body .tbl th:nth-child(6), .landing-phone-body .tbl td:nth-child(6),
.landing-phone-body .tbl th:nth-child(7), .landing-phone-body .tbl td:nth-child(7) { display: none; }
.landing-phone-body.landing-dash { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; align-content: center; overflow-y: hidden; }
.landing-phone-body.landing-dash .card { grid-column: span 2; margin: 0; padding: 18px 14px; border-radius: 12px; box-shadow: none; }
.landing-phone-body.landing-dash .card.stat { grid-column: span 1; }
.landing-phone-body.landing-dash .card h3 { font-size: 11.5px; margin-bottom: 6px; }
.landing-phone-body.landing-dash .card.stat h3 { font-size: 10px; line-height: 1.25; }
.landing-phone-body.landing-dash .stat .counter-num { font-size: 22px; }
.landing-phone-body.landing-dash .due-day { padding: 4px 6px; }
.landing-phone-body.landing-dash .ck-item, .landing-phone-body.landing-dash .chip { font-size: 11px; }
.landing-phone-body.landing-dash .ghost-add,
.landing-phone-body.landing-dash .grow-more { display: none; }
.landing-receipt {
  display: flex; align-items: center; gap: 10px; margin: 16px 0 0; padding: 10px 14px;
  border: 1px solid var(--landing-hair); border-radius: 12px; background: var(--landing-card);
  font: 11.5px "Fragment Mono", ui-monospace, monospace; color: var(--landing-ink2);
  opacity: 0; transform: translateY(8px);
}
.landing-receipt b { color: var(--accent-ink); font-weight: 400; transition: color .6s; }
.landing-receipt .landing-undo { margin-left: auto; color: var(--landing-ink3); }
.landing-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 14px; }
.landing-progress span {
  min-width: 0; padding: 9px 10px; border: 1px solid var(--landing-hair); border-radius: 11px;
  background: var(--landing-card); color: var(--landing-ink3);
  font: 11px/1.35 "Fragment Mono", ui-monospace, monospace;
}
.landing-progress b { display: block; margin-bottom: 4px; color: var(--landing-ink2); font-size: 13px; }
.landing-progress span.on { border-color: var(--accent-ink); color: var(--landing-ink); }
.landing-progress span.on b, .landing-progress span.done b { color: var(--accent-ink); }
.landing-replay { margin: 10px 0 0; color: var(--landing-ink3); font-size: 12px; line-height: 1.45; }
.landing-replay-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.landing-replay-row .landing-replay { flex: 1 1 180px; }
.landing :focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

.landing h2 { margin: 0; font-size: clamp(30px, 3.6vw, 46px); font-weight: 600; line-height: 1.05; letter-spacing: -.02em; }
.landing-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 52px; }
.landing-steps article { display: flex; flex-direction: column; gap: 16px; padding: 24px; border: 1px solid var(--landing-hair); border-radius: 16px; background: var(--landing-card); }
.landing-steps .n { color: var(--landing-ink3); font: 12px "Fragment Mono", ui-monospace, monospace; }
.landing-steps h3 { margin: 0; font-size: 20px; font-weight: 500; letter-spacing: -.01em; }
.landing-mockline, .landing-proposal, .landing-built { padding: 10px 13px; border: 1px solid var(--landing-hair); border-radius: 10px; background: var(--landing-paper); font-size: 13.5px; }
.landing-built { color: var(--accent-ink); font: 11px "Fragment Mono", ui-monospace, monospace; }
.landing-follow { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.landing-brief { max-width: 420px; padding: 22px; border: 1px solid var(--landing-hair); border-radius: 16px; background: var(--landing-card); }
.landing-brief b { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: 17px; font-weight: 500; }
.landing-brief > span { float: right; color: var(--landing-ink3); font: 11px "Fragment Mono", ui-monospace, monospace; }
.landing-brief p { margin: 10px 0 0; color: var(--landing-ink2); font-size: 14px; line-height: 1.55; }
.landing-routine { display: flex; align-items: center; gap: 10px; max-width: 420px; margin-top: 14px; padding: 11px 14px; border: 1px solid var(--landing-hair); border-radius: 12px; background: var(--landing-card); font-size: 13.5px; }
.landing-routine i { width: 7px; height: 7px; border-radius: 50%; background: #3E7C4F; }
.landing-routine b { margin-left: auto; color: var(--landing-ink3); font: 11px "Fragment Mono", ui-monospace, monospace; }
.landing-capability { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.landing-capability-card { max-width: 460px; padding: 24px; border: 1px solid var(--landing-hair); border-radius: 16px; background: var(--landing-card); }
.landing-capability-card p { margin: 0; color: var(--landing-ink2); font-size: 14px; line-height: 1.55; }
.landing-capability-card p + p { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--landing-hair); }
.landing-closer { padding: 120px 0 100px; text-align: center; }
.landing-closer h2 { max-width: 16ch; margin: 0 auto; font-size: clamp(36px, 5vw, 64px); }
.landing-closer .landing-btn { margin-top: 36px; }
.landing-footer { border-top: 1px solid var(--landing-hair); color: var(--landing-ink3); font-size: 13.5px; }
.landing-footer .landing-wrap { display: flex; align-items: center; gap: 22px; padding-block: 26px; }
[data-landing-reveal] { opacity: 0; transform: translateY(26px); }
.landing-static [data-landing-reveal] { opacity: 1; transform: none; }
/* Coming-soon styles use the runtime attribute and shared accent colors.

*/
.landing-soon, .landing-watch, .landing-soon-block { display: none; }
html[data-coming-soon] { --soon: var(--accent); --on-soon: var(--on-accent); }
html[data-coming-soon] .landing-soon { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--soon); color: var(--on-soon); font: 600 12px "Fragment Mono", ui-monospace, monospace; letter-spacing: .04em; }
html[data-coming-soon] .landing-soon.big { padding: 12px 20px; font-size: 14px; }
html[data-coming-soon] .landing-watch { display: inline; color: var(--landing-ink); font-weight: 600; text-decoration: underline 3px var(--accent-ink); text-underline-offset: 4px; }
html[data-coming-soon] .landing-soon-block { display: block; padding: 24px 0 96px; text-align: center; scroll-margin-top: 72px; }   /* #demo jump clears the sticky header */
.landing-soon-block h2 { max-width: 18ch; margin: 0 auto; font-size: clamp(32px, 4.4vw, 56px); }
.landing-soon-block p { max-width: 46ch; margin: 18px auto 32px; color: var(--landing-ink2); font-size: 17px; }
.landing-soon-block video { display: block; width: min(100%, 360px, calc(78vh * 780 / 1688)); height: auto; aspect-ratio: 780 / 1688; margin: 0 auto; border: 1px solid var(--landing-hair); border-radius: 24px; background: #000; }
.landing :is(a, button, input):focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 3px; }
.landing-waitlist {
  display: block; width: 100%; max-width: 680px; margin: 40px auto 0; padding: clamp(18px, 4vw, 28px);
  border: 1px solid var(--landing-hair); border-radius: 18px; background: var(--landing-card);
  color: var(--landing-ink); text-align: left; box-shadow: 0 12px 40px rgba(26, 28, 30, .07);
  scroll-margin-top: 88px; --waitlist-error: #9C2D24; --waitlist-success: #226B39;
}
.landing-waitlist-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.landing-waitlist-eyebrow { margin: 0 0 5px !important; color: var(--landing-ink3) !important; font: 11px "Fragment Mono", ui-monospace, monospace !important; letter-spacing: .06em; text-transform: uppercase; }
.landing-waitlist h3 { margin: 0; font-size: clamp(22px, 4vw, 30px); line-height: 1.15; overflow-wrap: anywhere; }
.landing-waitlist-label { display: block; margin-bottom: 8px; color: var(--landing-ink2); font-size: 14px; font-weight: 600; }
.landing-waitlist-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: stretch; }
.landing-waitlist input { min-width: 0; width: 100%; min-height: 48px; padding: 10px 13px; border: 1px solid var(--line-control); border-radius: 10px; background: var(--landing-paper); color: var(--landing-ink); font: inherit; }
.landing-waitlist input[aria-invalid="true"] { border-color: var(--waitlist-error); box-shadow: 0 0 0 2px color-mix(in srgb, var(--waitlist-error) 22%, transparent); }
.landing-waitlist input:focus-visible { border-color: var(--accent-ink); box-shadow: 0 0 0 3px var(--accent-ink); }
.landing-waitlist input[aria-invalid="true"]:focus-visible { border-color: var(--waitlist-error); outline: 3px solid var(--waitlist-error); outline-offset: 3px; }
.landing-waitlist .landing-waitlist-honeypot { position: absolute !important; inset-inline-start: -10000px !important; top: auto !important; width: 1px !important; min-width: 1px !important; height: 1px !important; min-height: 1px !important; padding: 0 !important; border: 0 !important; overflow: hidden !important; clip-path: inset(50%) !important; }
.landing-waitlist .landing-btn { min-height: 48px; padding-inline: 16px; white-space: normal; }
.landing-waitlist .landing-btn:disabled, .landing-waitlist-retry:disabled { cursor: wait; opacity: .65; }
.landing-soon-block .landing-waitlist-status,
.landing-soon-block .landing-waitlist-consent { max-width: none; margin: 14px 0 0; overflow-wrap: anywhere; text-align: left; }
.landing-soon-block .landing-waitlist-feedback {
  display: grid; grid-template-rows: minmax(65px, auto) minmax(44px, auto); gap: 10px;
  min-height: 119px; margin-top: 14px;
}
/* Keep the live region in the accessibility tree and reserve room before text arrives. */
.landing-soon-block .landing-waitlist-status { min-height: 65px; padding: 11px 13px; border-left: 3px solid transparent; border-radius: 0 8px 8px 0; background: var(--landing-paper); color: var(--landing-ink); font-size: 14px; line-height: 1.5; }
.landing-soon-block .landing-waitlist-feedback .landing-waitlist-status { margin: 0; }
.landing-soon-block .landing-waitlist-status:not([data-state]) { padding: 0; background: transparent; }
.landing-waitlist [hidden] { display: none !important; }
.landing-soon-block .landing-waitlist-status[data-state="success"] { border-left-color: #226B39; }
.landing-soon-block .landing-waitlist-status[data-state="rate"],
.landing-soon-block .landing-waitlist-status[data-state="offline"],
.landing-soon-block .landing-waitlist-status[data-state="failure"],
.landing-soon-block .landing-waitlist-status[data-state="error"] { border-left-color: var(--waitlist-error); }
.landing-waitlist-retry { min-height: 44px; margin-top: 0; padding: 9px 14px; border: 1px solid var(--line-control); border-radius: 9px; background: var(--landing-paper); color: var(--landing-ink); font: inherit; font-size: 14px; font-weight: 600; line-height: 1.3; cursor: pointer; }
.landing-soon-block .landing-waitlist-consent { color: var(--landing-ink3); font-size: 12.5px; line-height: 1.5; }
.landing-waitlist-consent a { text-decoration: underline; text-underline-offset: 2px; }
.landing-waitlist-copy { display: none !important; }

@media (max-width: 860px) {
  /* minmax(0,…) + min-width:0 stop the single track and its items growing to the kanban's intrinsic width */
  .landing-hero { grid-template-columns: minmax(0, 1fr); gap: 40px; min-height: 0; padding: 40px 0 64px; }
  .landing-hero > * { min-width: 0; }
  .landing-stage { justify-self: start; width: min(360px, 100%); }
  .landing-ask { right: 0; }
  .landing-steps, .landing-follow, .landing-capability { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 560px) {
  .landing-wrap { padding-inline: 20px; }
  .landing-nav { gap: 14px; }
  .landing-nav > a.landing-quiet { display: none; }
  .landing-btn { padding-inline: 16px; }
  .landing-waitlist-heading { flex-wrap: wrap; }
  .landing-waitlist-row { grid-template-columns: minmax(0, 1fr); }
  .landing-waitlist .landing-btn { width: 100%; }
}
@media (max-width: 420px) {
  .landing-nav { gap: 6px; }
  .landing-nav > a.landing-btn { padding-inline: 8px; font-size: 13px; white-space: nowrap; }
}
@media (max-width: 360px) {
  .landing-nav { flex-wrap: wrap; }
  .landing-nav .landing-spacer { display: none; }
  .landing-nav > a.landing-btn { margin-left: auto; max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .landing *, .landing *::before, .landing *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Each settings group uses a collapsed heading and a short summary of its contents.


*/
.set-grp { border-top: .5px solid var(--line2); }
.set-grp:first-child { border-top: 0; }
.set-grp > summary {
  list-style: none; cursor: pointer; padding: 15px 30px 15px 2px; position: relative;
  display: grid; gap: 3px;
}
.set-grp > summary::-webkit-details-marker { display: none; }
.set-grp > summary::after {
  content: "›"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%) rotate(0deg);
  color: var(--accent-ink); font-size: 26px; line-height: 1; transition: transform .16s ease;
}
.set-grp[open] > summary::after { transform: translateY(-50%) rotate(90deg); }
.set-grp-t {
  font-family: var(--font);
  font-size: 17px; font-weight: 600; letter-spacing: -.01em; color: var(--ink);
}
.set-grp-s { font-size: 12.5px; color: var(--ink3); line-height: 1.45; }
.set-grp-b { display: grid; gap: 12px; padding: 2px 0 18px; }
.set-grp-b > .card, .set-widgets > .card { margin: 0; }
.set-widgets { display: grid; gap: 12px; }
.cal-guide-choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.cal-guide-choices button[aria-pressed="true"] { border-color: var(--accent-ink); color: var(--accent-ink); }
.cal-guide-steps ol { margin: 8px 0 12px; padding-left: 22px; }
.cal-guide-steps li + li { margin-top: 7px; }
.cal-guide-linked { margin-top: 12px; }
/* A card that declared no group. Never expected on a shipped build (a test forbids it), loud
   on purpose when it happens: silence here is exactly how Billing spent a week in a drawer.
   BOTH classes in the selector deliberately — .set-sec also sets a colour, at equal specificity
   and LATER in this file, so `.set-ungrouped` alone lost and the warning rendered in plain ink.
   Caught by the browser run reading getComputedStyle, never by reading the rule. */
.set-sec.set-ungrouped { color: var(--danger); border-top: 0; }

/* inline SVG icons (stroke set from render.js) */
.i { width: 1.25em; height: 1.25em; vertical-align: -0.27em; flex: 0 0 auto; }

input, textarea, select {
  font: inherit; color: var(--ink); background: var(--card);
  border: .5px solid var(--line-control); border-radius: 13px; padding: 11px 13px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
/* SPACING-TEMPLATE v1 §2: keep selected text out of the custom chevron's 32px zone. */
select {
  -webkit-appearance: none; appearance: none;
  min-height: 44px; min-width: 0;
  padding: 0 32px 0 12px;
  text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1 3.5 6 8.5l5-5' fill='none' stroke='%235A564F' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 12px;
}
[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1 3.5 6 8.5l5-5' fill='none' stroke='%23B8B3A9' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
select:disabled { opacity: .55; }
.set-row > select, .set-row > input { flex: 1 1 0; min-width: 0; }
/* iOS zooms the whole page when a focused control renders under 16px, and the viewport has no
   escape hatch — Safari has ignored maximum-scale and user-scalable since iOS 10, so `16px on
   the control` IS the off switch. `font: inherit` above hands these the body's 15px, which is
   why every field zoomed. Coarse pointers only: desktop keeps its deliberate 15px density. */
/* `.mono` (12.5px, one class) outranks the bare element selector, so the invite-code and pairing
   fields still zoomed — listed here at matching specificity (ui-gate input_zoom, 10-15). */
@media (pointer: coarse) { input, textarea, select, .mono:is(input, textarea) { font-size: 16px; } }
/* Kono 2026-10-15 (iPhone): every non-chat page zoomed on double-tap, and a zoomed page drags
   sideways. `manipulation` turns off double-tap zoom only — pinch zoom stays (accessibility;
   no maximum-scale / user-scalable=no / touch-action:none anywhere). Chat keeps double-tap.
   On <html> because touch-action intersects down the ancestor chain: one rule covers tabs,
   sheets, auth and onboarding. */
html:not(:has(#app:not(.hidden) #tab-chat:not(.hidden))) { touch-action: manipulation; }
/* iOS WebKit gives a date field an intrinsic min width and centres its value, so in a 358px
   sheet 到期 rendered wider than the card (and empty, it collapses to a sliver). Reset it to a
   plain left-aligned field the same height as its neighbours. */
@media (pointer: coarse) {
  input[type=date] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; min-height: calc(1.5em + 23px); text-align: left; }
  input[type=date]::-webkit-date-and-time-value { text-align: left; margin: 0; }
}
/* A checkbox is not a text field. The rule above hands every input width:100% and a text field's
   padding, so a bare <label class="set-row"><span>..</span><input type=checkbox></label> gave the
   checkbox the whole row and flex squeezed the label to its min-content — for Chinese that is one
   character per line (Kono 10-15, workspace settings; personal settings only use .ws-tgl /
   .consent-row, which size their own box, so no personal-page check ever saw it). Sized once
   here so every caller is covered; .consent-row / .ws-tgl later in this file still win. */
input[type=checkbox] { flex: none; width: 18px; height: 18px; padding: 0; margin: 0; accent-color: var(--accent-ink); }
.set-row > span:has(+ input[type=checkbox]) { flex: 1 1 auto; min-width: 0; }
input::placeholder, textarea::placeholder { color: var(--ink3); }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent-ink);
  box-shadow: 0 0 0 3px var(--accent-ink);
}
/* The language picker has an inline hairline for its compact signed-out placement.
   Keep its visible control frame on the same contrast-safe token as every other field. */
select.lang-pick { border: 1px solid var(--line-control) !important; }
select.lang-pick:focus { border-color: var(--accent-ink) !important; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; padding: 0; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; padding: 13px 16px; border-radius: 13px; font-weight: 600; font-size: 15px;
  background: var(--card); border: .5px solid var(--line-control); text-align: center; color: var(--ink);
  transition: transform .12s ease, box-shadow .2s, filter .2s;
}
.btn:active { transform: scale(.97); }
.btn.primary {
  background: var(--accent); color: var(--on-accent); border: 0;
  box-shadow: none;
}
.btn.danger { color: var(--ink); border-color: var(--line-control); font-weight: 700; }
.btn:not(.primary):not(.danger):not(.btn-apple):not(.lv-msg .btn) { border: 1px solid #0A0A0A; }
[data-theme="dark"] .btn:not(.primary):not(.danger):not(.btn-apple):not(.lv-msg .btn) {
  border-color: #F4F4F1;
}
.btn.slim { width: auto; padding: 9px 16px; display: inline-flex; font-size: 14px; }
/* Responsive controls remain visible and usable at narrow and wide viewport sizes.




*/
#sVmStop[disabled] { opacity: .42; cursor: default; }
.link-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--ink2); font-size: 15px; font-weight: 600; padding: 8px; }
.link-btn[hidden] { display: none !important; }

/* banner + toast */
.banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  background: var(--amber-bg); color: var(--amber); font-size: 13px; font-weight: 600;
  padding: 12px 44px 12px 16px; text-align: center;
}
.banner .x { position: absolute; right: 6px; top: 6px; padding: 6px 8px; }
.banner .link-btn { color: inherit; font-size: 13px; text-decoration: underline; padding: 0 0 0 8px; }
/* A visible banner starts the landing page below itself instead of over its sticky header.
   --banner-h follows rendered banner resizes; the fallback covers one unwrapped line. */
body:has(#banner:not(.hidden)) .landing { padding-top: var(--banner-h, 44px); }
body:has(#banner:not(.hidden)) .landing-header { top: var(--banner-h, 44px); }
/* Responsive controls remain visible and usable at narrow and wide viewport sizes.






*/
body:has(#banner:not(.hidden)) #app { padding-top: var(--banner-h, 44px); }
body:has(#banner:not(.hidden)) #topbar { top: var(--banner-h, 44px); }
.toast {
  position: fixed; bottom: calc(160px + var(--sab)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 7px;
  background: var(--ink); color: var(--bg);
  padding: 11px 18px; border-radius: 22px; font-size: 13.5px; font-weight: 600;
  /* width: max-content — a fixed box at left:50% shrink-wraps into the HALF of the viewport to the
     right of that point, so a 15-character toast wrapped at 195px and split 「應用程式」 (UIUX F21). */
  z-index: 80; box-shadow: var(--shadow-2); width: max-content; max-width: 86vw;
  animation: toastUp .25s var(--ease-out);
}
@keyframes toastUp { from { transform: translate(-50%, 14px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
/* toast(msg, ic, {label, fn}) — the way back out of a tap that acted */
.toast .toast-act { color: var(--bg); font-size: 13.5px; font-weight: 700; text-decoration: underline; padding: 0 0 0 10px; white-space: nowrap; }

/* ---------- auth ---------- */
.screen { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 340px; text-align: center; }
.auth-back-row { display: flex; justify-content: flex-start; margin-bottom: 16px; }
.auth-back { margin: 0; }
.auth-logo { width: 84px; height: 84px; border-radius: 22px; box-shadow: var(--shadow-2); margin-bottom: 6px; }
.auth-card p.muted { margin: 4px 0 20px; font-size: 15px; }
.auth-card input { margin-top: 10px; text-align: left; }
.auth-field { margin: 0 0 11px; text-align: left; }
.auth-field > label { display: block; text-align: left; }
.auth-card .auth-field input, .auth-card .auth-field .pw-wrap { margin-top: 6px; }
.auth-card p.muted.auth-field-help { margin: 4px 0 0; font-size: 13px; line-height: 1.3; text-align: left; }
#authForgotPassword {
  min-height: 44px; display: inline-flex; align-items: center;
  padding-inline: 4px !important; margin-top: 0; margin-inline-start: -4px;
}
.auth-card .btn { margin-top: 16px; }
.auth-msg { color: var(--danger); font-size: 13px; min-height: 20px; margin: 10px 0 2px; }
/* Google and Apple sign-in */
.auth-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 0; color: var(--ink3); font-size: 13px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: .5px; background: var(--line2); }
.btn-oauth { gap: 10px; }
.btn-oauth .oauth-ic { display: inline-flex; width: 18px; height: 18px; flex: 0 0 auto; }
.btn-oauth .oauth-ic svg { width: 18px; height: 18px; display: block; }
.btn-apple { background: #000; color: #fff; border: 0; }
[data-theme="dark"] .btn-apple { background: #fff; color: #000; }

/* ---------- onboarding ---------- */
.ob-wrap { width: 100%; max-width: 400px; min-height: 82dvh; display: flex; flex-direction: column; }
.ob-top { display: flex; justify-content: space-between; align-items: center; }
.ob-dots { display: flex; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 4px; background: var(--line2); transition: width .3s var(--ease-out), background .2s; }
.dot.on { background: var(--accent-ink); width: 24px; }
[data-theme="dark"] #onboarding .ob-dots .dot { background: var(--line-control) !important; opacity: 1; }
[data-theme="dark"] #onboarding .ob-dots .dot.on { background: #F4F4F1 !important; }
#obStep { flex: 1; padding: 20px 0; }
#obStep.ob-in { animation: fadeUp .32s var(--ease-out) both; }
.persona-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.persona {
  position: relative; width: 100%; cursor: pointer;
  display: flex; flex-direction: column; align-items: flex-start; min-width: 0;
  background: var(--card); border: 1.5px solid var(--line-control); border-radius: var(--radius);
  padding: 14px; text-align: left; transition: border-color .15s, background .15s, transform .12s;
  box-shadow: var(--shadow-1);
}
.persona:active { transform: scale(.97); }
.persona .pe {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px; background: var(--card); color: var(--ink);
}
.persona .pe .i { width: 21px; height: 21px; }
.persona b { display: block; margin-top: 10px; font-size: 15px; letter-spacing: -.01em; }
.persona span:not(.pe):not(.choice-check) { font-size: 12.5px; color: var(--ink3); line-height: 1.4; display: block; margin-top: 2px; }
.persona .persona-copy { font-size: 12.5px; color: var(--ink3); line-height: 1.4; display: block; margin-top: 2px; text-wrap: balance; }
.persona b, .persona-copy, .ai-choice-copy b { max-width: 100%; overflow-wrap: anywhere; }
.persona.sel { --accent-ink: var(--on-accent); border-color: var(--accent-ink); background: var(--accent-soft); color: var(--on-accent); }
.persona.sel .pe { background: var(--card); color: var(--ink); }
.persona.sel span:not(.pe):not(.choice-check) { color: var(--on-accent); }
/* Sticky so the primary action is never below the fold. Step 1 is exactly one
   viewport tall on a 390x844 phone, so ANY content added to it (the morph demo
   adds ~193px) pushes Continue out of sight. Pinning the CTA fixes the class,
   not just the demo. Padding covers the home indicator on notched devices. */
.ob-next {
  position: sticky; bottom: 0; z-index: 3;
  margin-bottom: 0; padding-bottom: calc(12px + var(--sab, 0px));
  background: var(--bg);
}
.ai-choice { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0;
  margin-top: 12px; padding: 14px 16px; text-align: left; background: var(--card); border: 1.5px solid var(--line-control);
  border-radius: var(--radius); box-shadow: var(--shadow-1); }
.ai-choice.sel { --accent-ink: var(--on-accent); border-color: var(--accent-ink); background: var(--accent-soft); color: var(--on-accent); }
.ai-choice-copy { min-width: 0; flex: 1; }
.ai-choice-copy b { display: block; font-size: 15px; }
.ai-choice-copy span { display: block; font-size: 13px; color: var(--ink3); line-height: 1.4; overflow-wrap: anywhere; }
.ai-choice.sel .ai-choice-copy span { color: var(--on-accent); }
.ai-opt {
  display: block; width: 100%; text-align: left; background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--radius); padding: 15px 16px; margin-top: 12px; box-shadow: var(--shadow-1);
  transition: border-color .15s, background .15s;
}
.ai-opt.sel { border-color: var(--on-accent); background: var(--accent); color: var(--on-accent); }
.ai-opt b { display: block; font-size: 15px; }
.ai-opt span { font-size: 13px; color: var(--ink3); }
.ai-opt.sel span { color: var(--on-accent); }
/* Onboarding includes an optional preview of the fictional sample app; it can be skipped.
*/
.obc-input { width: 100%; max-width: 440px; margin: 0 auto; }
.obc-step-label { color: var(--ink3); font-size: 12px; font-weight: 650; letter-spacing: .02em; margin-bottom: 8px; }
.obc-input h1 { margin: 0 0 8px; }
.obc-input > .muted { margin: 0 0 16px; line-height: 1.45; }
.obc-input > #obcStep1Context, .obc-review > p.obc-sample-context { margin-top: var(--gap); }
#obStep #obcText {
  display: block; width: 100%; min-height: 150px; resize: vertical; box-sizing: border-box;
  padding: 12px 14px; border: 1.5px solid var(--line-control); border-radius: var(--radius);
  background: var(--card); color: var(--ink); font: inherit; line-height: 1.5;
}
#obStep #obcText.obc-sample-prefill { color: var(--ink3); }
.obc-privacy { color: var(--ink3); font-size: 12.5px; line-height: 1.45; margin: 9px 0 14px; }
.obc-consent { align-items: flex-start; line-height: 1.45; margin: 12px 0; }
.obc-consent input { margin-top: 3px; flex: none; }
/* Keep the input's consent and action together at every scroll position. The step still
   owns its full content height, so the last paragraph can scroll clear of the bar. */
#obStep:has(> .obc-input-actions) { display: flex; flex-direction: column; }
.obc-input-actions {
  position: sticky; bottom: 0; z-index: 3; flex: none;
  padding: 8px 0 calc(12px + var(--sab, 0px));
  background: color-mix(in srgb, var(--bg) 50%, var(--bg2));
  border-top: 1px solid var(--line);
}
.obc-input-actions .obc-consent { margin: 0 0 6px; }
.obc-consent-hint { margin: 0 0 6px; font-size: 12.5px; line-height: 1.4; color: var(--ink2); }
#onboarding .obc-input-actions .ob-next { position: static; padding: 13px 16px; }
#onboarding .obc-input-actions .ob-next:disabled {
  background: transparent; color: var(--ink3); border: 1px solid var(--line-control);
  opacity: 1; cursor: not-allowed; filter: none;
}
.obc-industry-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 14px; }
.obc-industry-chip { min-height: 38px; padding: 7px 12px; border: 1px solid var(--line-control);
  border-radius: 999px; background: var(--card); color: var(--ink); font-size: 13.5px; font-weight: 600; }
.obc-industry-chip[aria-pressed="true"] { border-color: var(--line-control); background: var(--accent); color: var(--on-accent); }
.obc-industry-chip:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.obc-try-hint { margin: 6px 0 0; color: var(--ink3); font-size: 12.5px; line-height: 1.45; }
.obc-sample { margin: 12px 0; }
.obc-sample label { display: block; margin: 8px 0 5px; color: var(--ink3); font-size: 12.5px; }
.obc-sample select { display: block; width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line-control);
  border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; }
.obc-error { margin-top: 16px; padding: 14px; border: 1px solid var(--line-control); border-radius: var(--radius); background: var(--card); }
.obc-error h2 { margin: 0 0 7px; font-size: 17px; }
.obc-error p { margin: 0 0 7px; color: var(--ink2); font-size: 13.5px; line-height: 1.45; }
.obc-error .obc-kept { color: var(--ink3); }
.obc-error-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.obc-wait { display: grid; min-height: 54dvh; place-items: center; text-align: center; }
.obc-wait h1 { margin: 0; font-size: 22px; }
.obc-minimal-review { padding-left: 22px; line-height: 1.6; }
.obc-review, .obc-completion { max-width: 560px; margin: 0 auto; }
.obc-review h1, .obc-completion h1 { margin: 0 0 8px; }
.obc-review > .muted { margin: 0 0 14px; line-height: 1.45; }
.obc-review-list, .obc-complete-list { list-style: none; margin: 0; padding: 0; }
.obc-result-list { list-style: none; margin: 12px 0 16px; padding: 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.obc-result-task { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 12px 0; line-height: 1.4; }
.obc-result-task + .obc-result-task { border-top: 1px solid var(--line); }
.obc-result-task-title { min-width: 0; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.obc-result-task .obc-date-label { flex: none; max-width: 40%; text-align: right; }
.obc-review-task { margin: 0 0 9px; padding: 13px 14px; border: 1px solid var(--line-control);
  border-radius: var(--radius); background: var(--card); }
.obc-review-select { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; line-height: 1.4; }
.obc-review-select input { flex: none; margin: 3px 0 0; }
[data-theme="dark"] #onboarding .obc-review-select input[type="checkbox"] {
  color-scheme: dark; accent-color: #F4F4F1 !important;
}
.obc-review-date { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  gap: 10px; margin: 10px 0 0 27px; }
.obc-date-label { color: var(--ink3); font-size: 13px; line-height: 1.4; word-break: keep-all; }
.obc-review-date input[type="date"] { width: 132px; max-width: 40vw; min-height: 36px; padding: 5px 7px;
  border: 1px solid var(--line-control); border-radius: 9px; background: var(--card); color: var(--ink); font: inherit; }
/* app.js toggles obcdateph-empty from the live input.value during render and input events.
   Hide only browser-generated date text while the current value is empty. */
.obc-review-date input[type="date"].obcdateph-empty::-webkit-datetime-edit,
.obc-review-date input[type="date"].obcdateph-empty::-webkit-date-and-time-value { color: transparent; }
[data-theme="dark"] .obc-review-date input[type="date"] { color: var(--ink); color-scheme: dark; }
[data-theme="dark"] #onboarding .obc-review-date input[type="date"]::-webkit-calendar-picker-indicator {
  filter: brightness(0) invert(1); opacity: 1;
}
.obc-reply-card { margin: 14px 0; padding: 14px; border: 1px solid var(--line-control);
  border-radius: var(--radius); background: var(--card); }
.obc-reply-card h2 { margin: 0 0 9px; font-size: 17px; }
.obc-reply-card textarea { display: block; width: 100%; box-sizing: border-box; resize: vertical; min-height: 92px;
  padding: 10px 12px; border: 1px solid var(--line-control); border-radius: 10px; background: var(--bg);
  color: var(--ink); font: inherit; line-height: 1.5; }
.obc-reply-card textarea:read-only { background: var(--bg2); }
.obc-reply-actions, .obc-later-actions, .obc-completion-actions { display: flex; flex-wrap: wrap;
  align-items: center; gap: 10px; margin-top: 10px; }
.obc-reply-note, .obc-safe { margin: 8px 0 0; color: var(--ink3); font-size: 12.5px; line-height: 1.45; }
.obc-review-actions { position: sticky; bottom: 0; z-index: 3; margin-top: 14px; padding: 10px 0;
  display: grid; gap: 9px; background: var(--bg); }
.obc-review-actions .btn { width: 100%; }
.obc-review-actions .btn:disabled { opacity: .48; cursor: not-allowed; }
.obc-complete-list { margin: 16px 0; padding: 12px 15px; border: 1px solid var(--line-control);
  border-radius: var(--radius); background: var(--card); }
.obc-complete-list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 9px 0; line-height: 1.4; }
.obc-complete-list li + li { border-top: 1px solid var(--line); }
.obc-complete-list li > span:first-child { min-width: 0; }
.obc-complete-reply textarea { min-height: 72px; }
.obc-later-card { margin: 16px 0; padding: 15px; border: 1.5px dashed var(--line-control);
  border-radius: var(--radius); background: var(--card); }
.obc-later-tag { margin-bottom: 6px; color: var(--ink3); font-size: 12px; font-weight: 650; }
.obc-later-card h2 { margin: 0 0 7px; font-size: 17px; }
.obc-later-card p { margin: 0; color: var(--ink2); font-size: 13.5px; line-height: 1.45; }
.obc-completion-actions { justify-content: center; }
@media (max-width: 480px) {
  .obc-review-date { grid-template-columns: 1fr; gap: 6px; }
  .obc-review-date input[type="date"] { width: 100%; max-width: 100%; }
  .obc-result-task { display: block; }
  .obc-result-task .obc-date-label { display: block; max-width: none; margin-top: 5px; text-align: left; }
}
@media (min-width: 900px) {
  #onboarding .ob-wrap {
    max-width: var(--app-w); min-height: 0; padding: clamp(24px, 3vw, 40px);
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--card); box-shadow: var(--shadow-1);
  }
  #onboarding #obStep { padding-block: 24px; }
  #onboarding .obc-input, #onboarding .obc-review, #onboarding .obc-completion { max-width: none; }
  #onboarding .obc-review-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
  #onboarding .obc-review-task { margin: 0; }
  #onboarding .obc-review-actions, #onboarding .ob-next { background: var(--card); }
  #onboarding .obc-input-actions { background: var(--card); }
}
@media (prefers-reduced-motion: reduce) { #obStep.ob-in { animation: none; } }
.ob-demo { display: flex; flex-direction: column; margin-top: 14px; }
.ob-demo-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ob-demo-top span { font-size: 12.5px; color: var(--ink3); }
.ob-demo-top .link-btn { font-size: 12.5px; padding: 4px 6px; flex: none; }
.ob-demo-off { text-align: center; margin-top: 10px; }
.ob-demo-off .link-btn { font-size: 13px; }
.ob-demo-bubble { opacity: 0; font-size: 13.5px; padding: 8px 12px; margin-bottom: 8px; max-width: 88%; min-height: 36px; }
.ob-demo-bubble.in { opacity: 1; animation: fadeUp .32s var(--ease-out); }
.ob-phone {
  /* Keep the sample app's selected controls on its own solid accent. */
  --accent-line: var(--line2);
  --accent-soft: var(--accent);
  width: 246px; height: 176px; margin: 0 auto; overflow: hidden;
  border: 1.5px solid var(--line); border-radius: 18px; background: var(--bg);
  box-shadow: var(--shadow-1);
}
.ob-phone-screen { width: 390px; height: 284px; transform: scale(.62); transform-origin: top left; padding: 10px 12px 0; pointer-events: none; }
[dir="rtl"] .ob-phone-screen { transform-origin: top right; }
.ob-mini-head { font-size: 14px; font-weight: 700; letter-spacing: -.01em; padding: 2px 2px 0; }
.ob-mini-tabs { padding: 8px 0 10px; }
.ob-mini-tabs button.ob-mini-new { --accent-ink: var(--on-accent); border-color: var(--accent-ink); color: var(--accent-ink); background: var(--accent); }
.ob-phone-screen .view-list { margin: 0; }
.morph .ob-mini-tabs { animation: morphPulse 1.1s ease-out; }
@media (prefers-reduced-motion: reduce) { .morph .ob-mini-tabs, .ob-demo-bubble.in { animation: none; } }

.consent-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 20px; font-size: 13px; color: var(--ink2); cursor: pointer; line-height: 1.45; }
.consent-row input { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px; accent-color: var(--accent-ink); }
.ntfy-link {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--card); border: 1px solid var(--ink); color: var(--accent-ink);
  font-weight: 600; border-radius: 14px; padding: 13px; margin-top: 12px;
}

/* ---------- app chrome ---------- */
#app { max-width: var(--app-w); margin: 0 auto; min-height: 100dvh; }
#topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 20px 10px; background: var(--bg);
  backdrop-filter: blur(24px) saturate(1.7); -webkit-backdrop-filter: blur(24px) saturate(1.7);
  border-bottom: .5px solid var(--hair);
}
#topbar .tt { flex: 1; min-width: 0; }
#chatBack {
  flex: none; display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; color: var(--ink2);
  background: var(--card); border: .5px solid var(--line-control); box-shadow: var(--shadow-1);
  transition: transform .12s var(--ease-out);
}
#chatBack:active { transform: scale(.94); }
#chatBack .i { width: 20px; height: 20px; }
#appTitle { font-size: 20px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
#topSub { font-size: 13px; color: var(--ink3); font-weight: 500; }
#main { padding: 4px 16px calc(150px + var(--sab)); }

/* floating tab bar */
#tabbar {
  position: fixed; bottom: calc(10px + var(--sab)); left: 50%; transform: translateX(-50%);
  z-index: 40; width: calc(100% - 24px);
  display: flex; justify-content: space-around; align-items: center;
  padding: 8px 6px; border-radius: 32px;
  background: var(--card);
  backdrop-filter: blur(28px) saturate(1.8); -webkit-backdrop-filter: blur(28px) saturate(1.8);
  border: .5px solid var(--line); box-shadow: var(--shadow-2);
}
#tabbar button {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px;
  font-size: 12px; color: var(--ink3); padding: 2px 0; font-weight: 600; letter-spacing: .01em;
  transition: color .15s;
}
/* Non-chat tabs retain their label's intrinsic width; chat keeps its fixed basis. */
#tabbar button:not(.chat-tab) { min-width: auto; }
#tabbar button .ic {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 28px; border-radius: 14px; transition: background .2s;
}
#tabbar button .ic .i { width: 22px; height: 22px; }
#tabbar button .nav-more-ic { font-size: 22px; line-height: 22px; }
#tabbar button.on { --accent-ink: var(--on-accent); color: var(--accent-ink); }
#tabbar button.on .ic { background: var(--accent); }
[data-theme="dark"] #tabbar button.on .nav-lbl { color: var(--ink3); }
#tabbar .chat-tab { flex: 0 0 66px; padding-bottom: 3px; }
#tabbar .chat-tab .chat-bubble {
  display: flex; align-items: center; justify-content: center;
  width: 50px; height: 50px; border-radius: 25px; color: var(--on-accent);
  background: var(--accent); margin: -18px 0 0;
  box-shadow: none;
  transition: transform .12s;
}
#tabbar .chat-tab:active .chat-bubble { transform: scale(.94); }
#tabbar .chat-tab .chat-bubble .i { width: 23px; height: 23px; }
#tabbar .chat-tab { overflow: visible; }
#tabbar .chat-tab .nav-lbl { line-height: 12px; }
#tabbar .nav-lbl { max-width: 100%; white-space: nowrap; text-align: center; letter-spacing: -.06em; }
@media (min-width: 900px) {
  #tabbar { width: max-content; max-width: calc(100% - 24px); gap: 4px; }
  #tabbar button { flex: 1 1 auto; width: 76px; }
  #tabbar .chat-tab { flex: 0 0 66px; }
}
.nav-more-row { width: 100%; text-align: start; }
.nav-more-row span { min-width: 0; white-space: normal; overflow-wrap: anywhere; }

.due-strip, .kb, .seg, #tabbar { scrollbar-width: none; }
.due-strip::-webkit-scrollbar, .kb::-webkit-scrollbar, .seg::-webkit-scrollbar,
#tabbar::-webkit-scrollbar { display: none; }

/* cards */
.card {
  background: var(--card); border-radius: var(--radius);
  border: .5px solid var(--line); box-shadow: var(--shadow-1);
  padding: var(--pad); margin: var(--gap) 0;
  transition: box-shadow .3s, background .3s, transform .12s;
}
.card h3 {
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 12px; font-size: 12px; color: var(--ink3); font-weight: 600;
  letter-spacing: .05em;
}
.card h3 .i { width: 15px; height: 15px; }
.card h3 .n { color: var(--ink); }
/* a count/aside on a card heading sits at the far end, never crowding the title */
.card h3 .sp { margin-left: auto; font-weight: 600; color: var(--ink3); letter-spacing: 0; }
.card[data-open]:active, .task-row:active, .note-card:active { transform: scale(.98); }

/* Tab changes use a short fade without a per-card cascade.*/
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes tabFade { from { opacity: 0; } to { opacity: 1; } }
.tab-fade { animation: tabFade .16s ease-out; }

/* Solid skeleton fills (first load); motion uses opacity, never a color ramp. */
.skel { border-radius: var(--radius); border: .5px solid var(--line); background: var(--card); padding: 16px; margin: 14px 0; }
.skel i {
  display: block; height: 12px; border-radius: 6px; margin: 10px 0;
  background: color-mix(in srgb, var(--line) 80%, var(--card));
  animation: shimmer 1.3s ease-in-out infinite alternate;
}
.skel i:first-child { width: 34%; height: 10px; }
.skel i:last-child { width: 72%; }
@keyframes shimmer { from { opacity: .65; } to { opacity: 1; } }

/* empty states */
.empty { text-align: center; color: var(--ink2); padding: 40px 0; font-size: 15px; }
.empty-art {
  width: 76px; height: 76px; margin: 0 auto 4px; border-radius: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); color: var(--accent-ink); position: relative;
}
.empty-art .i { width: 34px; height: 34px; }
.empty-art::before, .empty-art::after {
  content: ""; position: absolute; border-radius: 50%; background: var(--line2);
}
.empty-art::before { width: 8px; height: 8px; top: 2px; right: -8px; }
.empty-art::after { width: 5px; height: 5px; bottom: 6px; left: -10px; }
.empty p { margin: 12px 0 16px; line-height: 1.5; }
/* Two-line empty state (F26b canvasLocalOnly): ink title, grey line under it. */
.empty .empty-title { display: block; color: var(--ink); font-weight: 600; text-wrap: balance; }
.empty .empty-sub { display: block; margin-top: 4px; color: var(--ink3); text-wrap: balance; }
.empty .btn { margin: 0 auto; }

/* morph flash — signature moment when the agent rewrites uiConfig */
@keyframes morphPulse {
  0% { outline: 3px solid var(--accent-line); outline-offset: 0; }
  100% { outline: 3px solid transparent; outline-offset: 12px; }
}
.morph .card, .morph .task-row, .morph .kb-col, .morph #viewTabs { animation: morphPulse 1.1s ease-out; }

/* ---------- home widgets ---------- */
#tab-home { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 8px; }
#tab-home > * { margin: 0; grid-column: 1 / -1; }
#tab-home > .stat { grid-column: auto; }

/* C31 Home: one bordered card with the four member-specific sections from the approved mock. */
#tab-home > .c31-home {
  margin: 8px 0 16px; padding: 0; border: 1px solid var(--ink); border-radius: var(--radius);
  background: var(--card); color: var(--ink); box-shadow: none;
}
.c31-home .c31-section { padding: 14px 16px; border-top: 1px solid var(--line); }
.c31-home .c31-section:first-child { border-top: 0; }
.c31-home .c31-section-title {
  display: flex; align-items: center; gap: 8px; margin: 0 0 8px;
  color: var(--ink2); font-size: 13px; font-weight: 600; letter-spacing: 0;
}
.c31-home .c31-count { margin-left: auto; padding: 2px 8px; font-size: 12.5px; }
.c31-need-row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 0; }
.c31-need-copy { flex: 1; min-width: 0; font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.c31-need-copy small { display: block; color: var(--ink2); font-size: 13px; font-weight: 400; }
.c31-home .c31-action {
  flex: none; min-height: 40px; max-width: 45%; padding: 0 14px; border: 1px solid var(--ink);
  background: var(--card); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600;
  white-space: normal; border-radius: 18px; /* pill, same radius as the sibling .chip row actions */
}
.c31-brief-time { margin-left: auto; color: var(--ink2); font-size: 14px; font-weight: 400; }
.c31-brief-text { font-size: 14px; line-height: 1.45; }
.c31-brief-text p { margin: 0; }
.c31-home .c31-link {
  display: block; min-height: 44px; margin-top: 4px; padding: 0; border: 0;
  background: none; color: var(--ink); font: inherit; font-weight: 600; text-align: left;
  text-decoration: underline; text-underline-offset: 4px;
}
.c31-full-brief { margin-top: 8px; font-size: 14px; }
.c31-home .c31-help, .c31-home .c31-empty { margin: 0; color: var(--ink2); font-size: 13px; }
.c31-home .c31-calendar { margin: 0; }
.c31-home .c31-cal-card {
  margin: 8px -16px 0; padding: 6px 8px 8px; border: .5px solid var(--line);
  border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-1);
}
.c31-cal-nav { display: flex; align-items: center; min-height: 44px; }
.c31-cal-nav b { flex: 1; text-align: center; font-size: 15px; font-weight: 600; }
.c31-cal-nav button {
  flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0;
  background: transparent; color: var(--ink); font: inherit; font-size: 20px;
}
.c31-home .c31-calgrid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.c31-home .c31-calgrid .calw { padding: 6px 0; color: var(--ink2); font-size: 11px; font-weight: 400; }
.c31-home .c31-calgrid .c31-day {
  display: block; width: 100%; min-width: 0; min-height: 32px; padding: 5px 0 3px;
  border: 2px solid transparent; border-radius: 11px; background: transparent; color: var(--ink);
  font: inherit; font-size: 14px; line-height: 1.2; opacity: 1;
}
.c31-home .c31-calgrid .c31-day.past { color: var(--ink3); }
.c31-home .c31-calgrid .c31-day.today { border-color: var(--ink); font-weight: 700; }
.c31-home .c31-calgrid .c31-day.selected {
  border-color: #0A0A0A; background: var(--accent); color: var(--on-accent); font-weight: 700;
}
/* TODO_KONO: dark selected-day border pending Kono (mock RECEIPT P2) */
[data-theme="dark"] .c31-home .c31-calgrid .c31-day.selected { border-color: var(--ink); }
.c31-home .c31-calgrid .c31-day i {
  display: block; width: 4px; height: 4px; margin: 2px auto 0; border-radius: 50%;
  background: var(--ink);
}
.c31-home .c31-calgrid .c31-day.selected i { background: var(--on-accent); }
.c31-day-heading { margin: 14px 0 8px; color: var(--ink2); font-size: 13px; font-weight: 600; }
.c31-task-row { padding: 2px 0 8px; }
.c31-task-title {
  display: block; min-height: 0; padding: 0; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 15px; text-align: left; overflow-wrap: anywhere;
}
.c31-task-row small { display: block; color: var(--ink2); font-size: 13px; }
.c31-home .c31-not-listed { margin-top: 8px; }
.c31-activity-row { display: flex; gap: 12px; padding: 8px 0; font-size: 14px; align-items: flex-start; }
.c31-activity-row time { flex: 0 0 44px; color: var(--ink2); font-size: 13px; white-space: nowrap; }
.c31-activity-row span { min-width: 0; overflow-wrap: anywhere; }

/* Attention card and needs-you state use the same visual treatment. */
.attn, .needs-you {
  border: .5px solid var(--line-control);
  background: var(--card);
  color: var(--ink);
}
.attn h3, .needs-you h3 { color: var(--accent-ink); }

.brief-card { background: var(--card); }
.brief-date {
  font-family: "New York", ui-serif, Georgia, "Times New Roman", serif;
  font-size: 19px; font-weight: 600; letter-spacing: -.01em; margin: -2px 0 8px;
}
.brief-card .brief-run-error {
  display: flex; width: 100%; align-items: flex-start; font-size: 14px;
  line-height: 1.35; text-wrap: pretty;
}
.brief-card .brief-run-error svg { flex: none; margin-top: .16em; }
.brief-card .brief-run-error span { min-width: 0; flex: 1; }
/* A widget body is MODEL-authored text, and it must never be able to set the width of the
   screen it sits on. A shared trip card arrived as one unbroken 5,838px line at 1280 and took
   the whole desktop layout with it: a grid/flex item's automatic minimum size is its content,
   so an unbreakable run of characters wins over any column. min-width:0 lets the card shrink;
   anywhere lets the run break. Content, not chrome — no layout of ours changes. */
.card { min-width: 0; }
.brief-md { font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.record-chart-wrap { min-width: 0; width: 100%; overflow: hidden; }
.records-chart-svg { display: block; width: 100%; max-width: 100%; overflow: hidden; }
.records-chart-empty, .records-chart-single-note { margin-top: 6px; line-height: 1.4; }
/* a widget the agent has queued for removal, still rendered because nothing is applied early */
.w-queued { opacity: .58; }
.w-queued-note { padding: 0 16px 12px; }
.brief-md h1, .brief-md h2, .brief-md h3 { font-size: 15.5px; margin: 12px 0 4px; }
.brief-md ul { margin: 4px 0; padding-left: 20px; }
.brief-md p { margin: 6px 0; }
.brief-md code { background: var(--bg); border-radius: 5px; padding: 1px 5px; font-size: 13px; }
/* Markdown tables use overflow-x:auto on the wrapper when needed; prose wraps within cells.



























*/
.md-tbl {
  overflow-x: auto; margin: 8px 0;
}
.md-table { border-collapse: collapse; min-width: 100%; font-size: 14px; }
.md-table th, .md-table td {
  padding: 7px 10px; border: .5px solid var(--line2); text-align: left; vertical-align: top;
  overflow-wrap: normal; word-break: normal;
  white-space: nowrap; /* times (09:00–14:00) and names stay on one line; .md-tbl scrolls */
}
/* The last column usually holds notes: let it wrap, but never narrower than a time range. */
.md-table td:last-child { white-space: normal; min-width: 8em; }
.md-table th { color: var(--ink3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; background: var(--bg); }
/* Phone: a 5-column shift table (員工/日期/上班/下班/狀態) must fit the chat bubble, not hide its
   last column behind an unmarked scroll. Tighter cells; times and names still never break. */
@media (max-width: 480px) {
  .md-table { font-size: 12px; }
  .md-table th, .md-table td { padding: 6px 5px; }
  .md-table th { font-size: 10.5px; letter-spacing: 0; }
  .md-table td:last-child { min-width: 3em; }
}
/* iOS installation steps */
.ios-step { display: flex; align-items: center; gap: 12px; padding: 14px; margin-top: 12px; background: var(--bg); border: .5px solid var(--line); border-radius: 14px; }
.ios-num { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.ios-step-t { flex: 1; font-size: 15px; }
.ios-glyph { flex: 0 0 26px; width: 26px; height: 26px; color: var(--accent-ink); }
.ios-point { display: flex; justify-content: center; margin: 2px 0; }
.ios-down { width: 22px; height: 22px; color: var(--accent-ink); animation: iosBob 1.1s ease-in-out infinite; }
@keyframes iosBob { 0%,100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }
/* Account cancellation choices */
.cx-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.cx-opt { justify-content: flex-start; text-align: left; }
.cx-opt.sel { --accent-ink: var(--on-accent); border-color: var(--accent-ink); background: var(--accent); color: var(--accent-ink); }

.due-strip { display: flex; flex-wrap: nowrap; gap: 4px; overflow-x: auto; padding: 2px 0 10px; }
.due-day {
  flex: 1 1 0; min-width: 0; text-align: center; white-space: nowrap;
  background: var(--card); border-radius: 13px; padding: 9px 0 7px;
  border: 2px solid transparent;
}
.due-day .dd-w { display: block; font-size: 12px; font-weight: 600; color: var(--ink3); text-transform: uppercase; letter-spacing: -.02em; }
.due-day .dd-n { display: block; font-size: 17px; font-weight: 700; margin-top: 1px; }
.due-day .dd-dots { display: block; height: 6px; line-height: 6px; }
.due-day .dd-dots b { display: inline-block; width: 4px; height: 4px; border-radius: 2px; background: var(--accent-ink); margin: 0 1px; }
.due-day.today { background: var(--accent); border-color: var(--on-accent); }
/* Approved brand detail: today's app cell is lime with a 2px #0A0A0A border and black text. */
#app .due-day.today { border: 2px solid #0A0A0A; }
.due-day.today .dd-w, .due-day.today .dd-n { color: var(--on-accent); }

.ck-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.ck-item[data-open] { justify-content: space-between; }
.needs-you .ny-text {
  flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
}

/* ===== the bound card: a card that READS its rows (render.js WIDGETS.records) =====
   Every number on it is computed from rows that exist; nothing here is model prose. */
.bound-row { justify-content: space-between; align-items: flex-start; gap: 12px; }
.bound-main { min-width: 0; flex: 1; }
.bound-t { font-weight: 600; display: block; }
.bound-row .task-meta { margin-top: 4px; }
.bound-row .task-meta:empty { display: none; }
.bound-n { font-weight: 600; flex: none; }
.bound-empty { padding: 4px 0 2px; }
/* the medication notice: said twice in a product's life and never again — one quiet line
   that is present every time she looks and costs nothing to skip */
.notice { margin: 14px calc(var(--pad) * -1) calc(var(--pad) * -1);
  padding: 11px var(--pad) 14px; border-top: .5px solid var(--hair);
  font-size: 11.5px; line-height: 1.45; color: var(--ink3); }

/* ===== the button that IS the thing (render.js actionChip) =====
   `done` is not a flag the button remembers — it is the card's own query over the store,
   so what is painted and what is stored cannot disagree. */
.bound-acts { margin-bottom: 12px; }
.bound-talk { margin-top: 14px; }
.row-acts { margin-top: 10px; }
/* provenance, as a pill among the pills — "who wrote this last", not decoration */
.src { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600;
  padding: 2.5px 8px; border-radius: 20px; letter-spacing: 0;
  background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink3); }
.row-acts .act { padding: 9px 14px; font-size: 13.5px; }
.act.at { background: var(--ok-soft); color: var(--ok); opacity: .75; }
.bound-acts.stacked { flex-direction: column; align-items: stretch; gap: 10px; }
.act { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 18px; padding: 11px 16px; font-size: 14.5px; font-weight: 600;
  background: var(--card); border: 1px solid var(--ink); color: var(--accent-ink);
  transition: transform .12s var(--ease-out), background .18s, color .18s; }
.act:active { transform: scale(.95); }
.act[disabled] { transform: none; }
.act .i { width: 15px; height: 15px; flex: none; }
.act.big { padding: 15px 20px; font-size: 16.5px; border-radius: 22px; }
.act.done { background: var(--ok-soft); color: var(--ok); }
.act.done .t { font-variant-numeric: tabular-nums; opacity: .85; margin-inline-start: 2px; }
/* failure mode 3: the field this button wrote to is gone. Disabled and SAID — never a
   silent fallback to a chat macro. */
.act.dead { background: var(--bg); color: var(--ink3); cursor: not-allowed; }
.dead-note { display: flex; align-items: flex-start; gap: 6px; margin-top: 9px;
  font-size: 12px; color: var(--danger); }
.dead-note .i { width: 14px; height: 14px; flex: none; margin-top: 2px; }
/* the ONE aggregate: summed here, from the rows printed above it */
.total-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 12px 0 2px; margin-top: 6px; border-top: .5px solid var(--hair); }
.total-row .lab { font-size: 12px; color: var(--ink3); font-weight: 600; letter-spacing: .05em; }
.total-row .num { font-size: 24px; font-weight: 700; letter-spacing: -.03em; }

/* Working for you status row */
.wf-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: .5px solid var(--hair); }
.wf-row:first-of-type { border-top: 0; }
.wf-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.wf-main b { font-size: 14.5px; font-weight: 600; }
.wf-next { font-size: 12.5px; color: var(--ink3); }
.wf-res { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--ink3); }
.wf-res svg { width: 13px; height: 13px; }
.wf-res.ok { color: var(--ok); }
.wf-res.bad { color: var(--danger); font-weight: 600; }   /* a failed run must LOOK failed */
.wf-pause { flex: none; padding: 6px 12px; font-size: 12.5px; }
.wf-sugg { margin-top: 10px; }

.stat { display: flex; flex-direction: column; justify-content: flex-end; min-height: 92px; }
.stat .counter-num { font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1; margin-top: 4px; }
.stat h3 { margin-bottom: 0; }

.qc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
#tab-tasks .empty + .grow-more { margin-inline: 0; }
.data-action-list { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 0; }
.data-action-item { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.data-action-copy { display: block; width: 100%; min-width: 0; line-height: 1.4; overflow-wrap: anywhere; }
.data-action-item > button, .data-action-list > button {
  width: max-content; max-width: 100%; flex: none; white-space: nowrap;
}
.data-action-item.recipe-install-row { flex-direction: row; flex-wrap: nowrap; align-items: flex-start; }
.recipe-install-row > .data-action-copy { width: auto; min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; }
.recipe-install-row > button { flex: none; margin-left: auto; white-space: nowrap; }
.data-action-list > .open-item-row, .data-action-list > .vm-size-choice, .data-action-list > .folder-choice {
  width: 100%; max-width: 100%; white-space: normal;
}
.open-item-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  width: 100%; max-width: 100%; min-width: 0; flex: none; padding: 11px 12px; text-align: left;
  white-space: normal; overflow-wrap: anywhere; color: var(--ink2); background: var(--card);
  border: 1px solid var(--line-control); border-radius: 12px; box-shadow: var(--shadow-1); }
.open-item-row > .i { width: 16px; height: 16px; color: var(--ink); }
.open-item-name { min-width: 0; line-height: 1.4; overflow-wrap: anywhere; }
.open-item-name.file-name { display: flex; overflow: hidden; white-space: nowrap; overflow-wrap: normal; }
.open-item-name-main { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.open-item-name-ext { flex: none; white-space: nowrap; }
.open-item-chevron { color: var(--ink3); font-size: 22px; line-height: 1; }
.empty-cta-action { margin: 0 auto; }
.rec-paste { display: flex; width: min(100%, 420px); gap: 8px; margin: 4px auto 0; }
.rec-paste input {
  flex: 1 1 0; width: 0; min-width: 0; height: 44px; padding: 0 12px; border-radius: 11px;
  border: 1px solid var(--line-control); background: var(--card); color: var(--ink);
  font: inherit; font-size: 14px;
}
.rec-paste input::placeholder { color: var(--ink3); }
.rec-paste .btn { flex: 0 0 auto; width: auto; min-width: 68px; min-height: 44px; }
.fx-action { align-self: flex-start; width: min(86%, 390px); }
.viewer-task-action, .backlink-action, .task-attachment-item { width: 100%; }
.vm-size-choice { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  min-width: 0; padding: 12px 14px; text-align: left; white-space: normal; color: var(--ink2);
  background: var(--card); border: 1.5px solid var(--line-control); border-radius: 12px; }
.vm-size-choice.selected { --accent-ink: var(--on-accent); border-color: var(--accent-ink); background: var(--accent); color: var(--on-accent); }
.vm-size-copy { display: flex; flex-direction: column; min-width: 0; gap: 3px; overflow-wrap: anywhere; }
.vm-size-copy b { font-size: 14px; color: var(--ink); }
.vm-size-copy > span { font-size: 12px; color: var(--ink3); }
.vm-size-choice.selected .vm-size-copy b, .vm-size-choice.selected .vm-size-copy > span { color: var(--on-accent); }
.vm-size-choice[aria-pressed="true"] .vm-size-copy b { font-weight: 700; }
.folder-choice { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  width: 100%; max-width: 100%; min-width: 0; flex: none; padding: 10px 12px; text-align: left; white-space: normal;
  color: var(--ink2); background: var(--card); border: 1px solid var(--line-control); border-radius: 12px; }
.folder-choice > .i { width: 16px; height: 16px; color: var(--ink); }
.folder-choice-name { min-width: 0; line-height: 1.4; overflow-wrap: anywhere; }
.folder-choice.selected { --accent-ink: var(--on-accent); border-color: var(--accent-ink); background: var(--accent); color: var(--on-accent); }
.folder-choice.selected > .i { color: var(--on-accent); }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--card); border: 1px solid var(--ink); color: var(--accent-ink); border-radius: 18px;
  padding: 8px 14px; font-size: 13.5px; font-weight: 600; white-space: nowrap; flex: none; transition: transform .12s;
}
.chip:active { transform: scale(.95); }

/* The add action appears as a separate, quiet tile after the current views.
*/
.ghost-add {
  display: flex; flex-direction: column; align-items: stretch; gap: 12px; width: 100%; text-align: start;
  background: var(--card); border: 1px dashed var(--line-control); border-radius: var(--radius);
  padding: 16px 18px; margin: 14px 0; color: var(--ink);
  transition: border-color .2s, background .2s, transform .12s;
}
.ghost-add:active { transform: scale(.99); }
.ghost-ic {
  display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px;
  border-radius: 50%; background: var(--card); border: 1px solid var(--ink); color: var(--accent-ink);
}
.ghost-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ghost-txt b { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.ghost-txt i { font-style: normal; font-size: 12.5px; line-height: 1.35; color: var(--ink3); }
@media (hover: hover) {
  .ghost-add:hover { border-color: var(--line-control); background: var(--accent-wash); }
}
/* The optional follow-up action sits directly below the related tile.
*/
.grow-more { margin: -8px 2px 14px; }

/* ---------- tasks ---------- */
.seg { display: flex; gap: 6px; overflow-x: auto; padding: 8px 2px 12px; }
/* View chips wrap when space is limited; other segmented controls retain horizontal scrolling.






*/
#viewTabs { flex-wrap: wrap; }
#viewTabs.single-view { padding: 8px 2px 12px; overflow: visible; }
#viewTabs.multi-view { overflow: visible; }
.view-title-row, .view-tabs-row { display: flex; align-items: center; gap: 8px; width: 100%; }
.view-tabs-row { min-width: 0; flex-wrap: wrap; }
.view-title-row { justify-content: space-between; }
.view-title {
  display: flex; align-items: center; gap: 9px; min-width: 0; margin: 0;
  color: var(--ink); font-size: 21px; line-height: 1.25; font-weight: 650;
}
.view-title svg { width: 20px; height: 20px; flex: 0 0 auto; color: var(--ink2); }
.page-menu { position: relative; flex: 0 0 auto; margin-left: auto; }
.page-menu > summary {
  display: grid; place-items: center; width: 38px; height: 38px; list-style: none;
  border-radius: 50%; color: var(--ink2); cursor: pointer; font-size: 25px; line-height: 1;
}
.page-menu > summary::-webkit-details-marker { display: none; }
.page-menu[open] > summary { background: var(--card); }
.page-menu-items {
  position: absolute; z-index: 20; top: calc(100% + 4px); right: 0; min-width: 230px;
  padding: 5px; background: var(--card); border: 1px solid var(--line-control);
  border-radius: 12px; box-shadow: var(--shadow-2, 0 8px 24px rgba(0,0,0,.14));
}
.page-menu-item {
  width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; text-align: start;
  background: transparent; color: var(--ink); font: inherit; cursor: pointer;
}
.page-menu-item:hover { background: var(--accent-wash); }
.seg button {
  white-space: nowrap; padding: 8px 15px; border-radius: 20px; font-size: 13px; font-weight: 600;
  background: var(--card); color: var(--ink2); border: .5px solid var(--line-control); box-shadow: var(--shadow-1);
  /* transform only: a background/colour transition replays on every theme flip (applyTheme at
     boot, OS dark-mode switch), and for 150ms the pills sat between the two palettes —
     grey on grey, the selected one olive on olive (UIUX tasks-now capture, 10-15). */
  transition: transform .12s;
}
.seg button:active { transform: scale(.95); }
.seg button.on { background: var(--accent); color: var(--on-accent); border-color: transparent; }

.task-row {
  display: flex; align-items: flex-start; gap: 12px; background: var(--card);
  border-bottom: .5px solid var(--hair);
  padding: 14px; margin: 0; transition: transform .12s, background .2s;
}
.task-row:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.task-row:last-child { border-radius: 0 0 var(--radius) var(--radius); border-bottom: 0; }
.task-row:only-child { border-radius: var(--radius); }
.view-list { border: .5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden; margin: 14px 0; }
.view-list .task-row { border-left: 0; border-right: 0; }
.tick {
  width: 24px; height: 24px; min-width: 24px; border-radius: 12px; border: 1.8px solid var(--line-control);
  margin-top: 1px; display: flex; align-items: center; justify-content: center; color: var(--on-accent);
  transition: all .18s;
}
.tick .i { width: 14px; height: 14px; }
.tick.done { background: var(--accent); border-color: var(--accent); }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 600; letter-spacing: -.01em; }
.task-title.done { text-decoration: line-through; color: var(--ink3); }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pill {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; padding: 3px 9px; border-radius: 20px;
  background: var(--bg); color: var(--ink2); font-weight: 600; font-variant-numeric: tabular-nums;
}
.pill .i { width: 12px; height: 12px; }
.pill.due { background: var(--accent); color: var(--on-accent); }
@scope (#tab-home, #tab-tasks) {
  .pill.due { background: var(--accent); color: var(--on-accent); }
  #tab-home .ck-item[data-goto="chat"] > .pill.due {
    background: var(--card); color: var(--ink);
  }
  .pill.overdue { background: var(--ink); color: var(--card); }
}
#tab-home .due-strip ~ .ck-item[data-open] > .pill.due {
  min-width: 72px; margin-left: auto; justify-content: center; text-align: center; white-space: nowrap;
}
.pill.overdue { background: var(--ink); color: var(--card); }
.pill.att { padding: 2.5px 7px; }

/* kanban */
.kb { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kb-col {
  min-width: 248px; width: 248px; background: color-mix(in srgb, var(--card) 45%, var(--bg));
  border: .5px solid var(--line); border-radius: var(--radius); padding: 10px;
  transition: border-color .15s, background .15s;
}
.kb-col h4 {
  display: flex; align-items: center; justify-content: space-between;
  margin: 2px 4px 8px; font-size: 12px; color: var(--ink2); text-transform: uppercase; letter-spacing: .06em;
}
.kb-col h4 .kb-n {
  font-size: 11px; font-weight: 700; min-width: 20px; text-align: center; padding: 1px 6px;
  border-radius: 9px; background: var(--card); border: .5px solid var(--line); color: var(--ink3);
  font-variant-numeric: tabular-nums;
}
.kb-col[data-col="doing"] h4 { color: var(--accent-ink); }
.kb-col[data-col="doing"] h4 .kb-n { --accent-ink: var(--on-accent); background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.kb-col[data-col="done"] h4 { color: var(--ok); }
.kb-col[data-col="done"] h4 .kb-n { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.kb-col[data-col="blocked"] h4 { color: var(--danger); }
.kb-col[data-col="blocked"] h4 .kb-n { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.kb-col.dragover { border-color: var(--accent-ink); background: var(--card); }
.kb-card {
  background: var(--card); border-radius: 12px; border: .5px solid var(--line); box-shadow: var(--shadow-1);
  padding: 11px 12px; margin: 8px 0; font-size: 14px; font-weight: 600; letter-spacing: -.01em;
  transition: transform .12s, opacity .12s;
}
.kb-card:active { transform: scale(.97); opacity: .8; }

/* table */
.tbl-wrap { container-type: inline-size; overflow-x: auto; background: var(--card); border: .5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
table.tbl { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 480px; }
.tbl th { text-align: left; color: var(--ink3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: .5px solid var(--hair); white-space: nowrap; }
.tbl td { font-variant-numeric: tabular-nums; }
.tbl tr:last-child td { border-bottom: 0; }

/* Task tables use a grid when space allows and labeled rows in narrow containers.










*/
@container (max-width: 520px) {
  table.tbl { min-width: 0; }   /* beats the wide-layout floor on specificity */
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .tbl tr { display: block; padding: 11px 14px; border-bottom: .5px solid var(--hair); }
  .tbl tr:last-child { border-bottom: 0; }
  .tbl td {
    display: flex; gap: 14px; align-items: baseline; justify-content: space-between;
    padding: 3px 0; border-bottom: 0; white-space: normal; overflow-wrap: break-word;
    text-align: right;
  }
  .tbl td::before {
    content: attr(data-label); flex: 0 0 auto; text-align: left;
    color: var(--ink3); font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .06em;
  }
  .tbl td:empty { display: none; }            /* an empty cell is noise, not a column */
  .tbl td:first-child {
    display: block; text-align: left; font-weight: 600; font-size: 15px; margin-bottom: 5px;
  }
  .tbl td:first-child::before { content: none; }   /* the title IS the row heading */
}
/* The landing mock is a 246px prop that already hides columns by hand — leave it alone. */
.landing-phone-body .tbl-wrap { container-type: normal; }

/* Canvas content uses its own document as the scroll surface. A wrapper must not put the inner scrollbar back on the outside of the frame instead of the inside.





*/
.canvas-frame { display: block; width: 100%; border: 0; background: transparent; }

#fab {
  position: fixed; right: max(16px, calc(50% - var(--app-w) / 2 + 16px)); bottom: var(--fab-offset); z-index: 30;
  width: var(--fab-size); height: var(--fab-size); border-radius: 50%; background: var(--accent); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px var(--hair);
  transition: transform .12s;
}
#appBuildFooter { margin-bottom: calc(var(--fab-size) + var(--fab-offset)); }
#fab:active { transform: scale(.92); }
#fab .i { width: 26px; height: 26px; }

/* ---------- chat ---------- */
#tab-chat { padding-bottom: 8px; }
#chatLog { display: flex; flex-direction: column; gap: 3px; padding-top: 6px; }
.date-sep { align-self: center; margin: 14px 0 6px; }
.date-sep span {
  font-size: 11px; font-weight: 600; color: var(--ink3); text-transform: uppercase; letter-spacing: .06em;
  background: var(--card); border: .5px solid var(--line); border-radius: 12px; padding: 3px 12px;
}
.msg {
  max-width: 82%; padding: var(--gap) 14px; border-radius: 18px; font-size: 15px;
  white-space: pre-wrap; word-break: break-word; line-height: 1.45;

}
/* F23: words in bubbles are kept whole; app.js cjkWordBreaks() marks the break points with <wbr>.
   overflow-wrap:anywhere is the escape hatch for a run with no marks. */
.msg, .kb-card { word-break: keep-all; overflow-wrap: anywhere; line-break: strict; }   /* strict: no 「，」 at a line start */
.msg .tok, .kb-card .tok, .msg .w, .kb-card .w { display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
/* UIUX F20: an assistant reply is md() HTML, so its <p> kept the UA 1em margins — 26px above and
   28px below the text against the user bubble's 11/13. The bubble's padding is the spacing. */
.msg > :first-child { margin-top: 0; }
.msg > :last-child { margin-bottom: 0; }
.msg.user {
  align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 5px;
  box-shadow: none;
}
.msg.user + .msg.user { border-top-right-radius: 8px; }
.msg.assistant { align-self: flex-start; background: var(--card); border: .5px solid var(--line); border-bottom-left-radius: 5px; }
.msg.repeat-failure-stop { color: var(--ink); }
.msg.repeat-failure-stop .stop-warning { color: currentColor; font-variant-emoji: text; }
/* multi-agent: each agent's replies carry its color as a subtle tint (--ab set inline) */
.msg.assistant.tinted { background: var(--card); border-color: var(--line-control); }
.msg.system { align-self: center; background: none; color: var(--ink3); font-size: 12.5px; }
.msg-meta { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ink3); padding: 2px 6px 8px; font-variant-numeric: tabular-nums; }
.msg-meta .i { width: 12px; height: 12px; }
.msg-meta.user { align-self: flex-end; }
.msg-meta.assistant { align-self: flex-start; }
/* send state: queued / working / failed must read differently at a glance (they all used to be a clock) */
.msg-meta .st { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.msg-meta .st.queued { color: var(--ink3); }
.msg-meta .st.working { color: var(--accent-ink); }
.msg-meta .st.working .i { animation: blink 1.4s infinite; }
.msg-meta .st.failed { color: var(--danger); }
/* failed turn: the worker writes no reply, so this card IS the reply */
.err-card {
  align-self: flex-end; width: min(86%, 340px); margin: 3px 0 10px;
  background: var(--danger-soft); border: .5px solid color-mix(in srgb, var(--danger) 30%, transparent);
  border-radius: var(--radius); border-bottom-right-radius: 6px; padding: 13px 14px;
}
.err-head {
  display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
  font-size: 11.5px; font-weight: 700; color: var(--danger);
  text-transform: uppercase; letter-spacing: .06em;
}
.err-head .i { width: 14px; height: 14px; flex: none; }
.err-head .nocaps { text-transform: none; }
.err-why { font-size: 14.5px; line-height: 1.4; margin-bottom: 8px; }
.err-raw {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; line-height: 1.4;
  color: var(--ink2); background: color-mix(in srgb, var(--ink) 5%, transparent);
  border-radius: 10px; padding: 7px 9px; margin-bottom: 10px;
  word-break: break-word; max-height: 88px; overflow: auto;
}
.err-card .btn.slim .i { width: 15px; height: 15px; }
.fx-row { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; max-width: 86%; padding: 3px 0 10px; }
.fx {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600;
  background: var(--card); color: var(--ink2); border: .5px solid var(--line);
  border-radius: 14px; padding: 6px 12px; box-shadow: var(--shadow-1); transition: transform .12s;
}
.fx:active { transform: scale(.95); }
.fx .i { width: 14px; height: 14px; color: var(--accent-ink); }
/* pending-action approval card (trust gates) */
.pa-card {
  align-self: flex-start; width: min(86%, 340px); margin: 3px 0 10px;
  background: var(--card);
  border: .5px solid var(--line-control); border-radius: var(--radius);
  border-bottom-left-radius: 6px; box-shadow: var(--shadow-1); padding: 13px 14px;

}
.pa-card.plan { width: 100%; max-width: none; }
.pa-card.plan .bp-summary,
.pa-card.plan .bp-why,
.pa-card.plan .bp-run-order,
.pa-card.plan .bp-item-copy,
.pa-card.plan .bp-item-status { font-weight: 400; }
.pa-card.plan .bp-details > summary { font-weight: 400; }
.bp-summary { margin: 0 0 10px; font-size: 14px; line-height: 1.5; }
.bp-details { margin-top: 8px; }
.bp-why { margin-bottom: 8px; }
.bp-run-order { margin: 0 0 8px; }
.bp-item-list { margin: 0; padding-left: 22px; }
.bp-item-row { padding: 5px 0; font-weight: 400; }
.bp-item-args { margin: 5px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; }
.bp-preview-actions { display: flex; justify-content: flex-start; margin: 10px 0; }
.bp-preview-trigger { background: var(--accent) !important; border: 0 !important; color: var(--on-accent) !important; }
.bp-preview-dialog {
  width: min(94vw, 1080px); max-width: none; max-height: 92dvh; padding: 16px;
  border: 2px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink);
  --bp-preview-backdrop: rgba(0, 0, 0, .72);
}
.bp-preview-dialog::backdrop { background: var(--bp-preview-backdrop); }
.bp-preview-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bp-preview-dialog-head h2 { margin: 0; color: var(--ink); font-size: 18px; }
.bp-preview-note { margin: 8px 0 12px; color: var(--ink); font-size: 13px; }
.bp-preview-close {
  width: 36px; height: 36px; border: 0; border-radius: 8px;
  background: var(--accent); color: var(--on-accent); font-size: 23px; line-height: 1; cursor: pointer;
}
.bp-preview-frame {
  display: block; width: 100%; height: min(68vh, 740px); border: 1px solid var(--line);
  border-radius: 8px; background: var(--card);
}
.pa-head {
  display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
  font-size: 11.5px; font-weight: 700; color: var(--accent-ink);
  text-transform: uppercase; letter-spacing: .06em;
}
.pa-head .i { width: 14px; height: 14px; }
.pa-sum { font-size: 15px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 12px; }
/* What it costs, on the card that asks to spend it. Set BELOW the summary and above the
   provenance line so the money is the second thing read, not a footnote. */
.pa-price { font-size: 13px; font-weight: 600; color: var(--ink2); margin: -6px 0 10px; }
.pa-actions { display: flex; gap: 8px; justify-content: flex-end; }
.pa-actions .btn { flex: 1; }
.pa-card.done { background: var(--card); border-style: dashed; border-color: var(--line2); box-shadow: none; }
.pa-card.done .pa-sum { color: var(--ink3); margin-bottom: 6px; }
.pa-out { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.pa-out .i { width: 14px; height: 14px; }
.pa-card.approved .pa-out { color: var(--ok); }
.pa-card.rejected .pa-out { color: var(--danger); }

.typing {
  display: flex; gap: 5px; align-self: flex-start; margin-top: 3px;
  background: var(--card); border: .5px solid var(--line); border-radius: 18px;
  border-bottom-left-radius: 5px; padding: 14px 16px;
}
.typing span { width: 7px; height: 7px; border-radius: 4px; background: var(--accent); animation: typing-pulse 1.4s ease-in-out infinite; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
.typing small { font-size: 11.5px; font-weight: 600; color: var(--ink3); margin-left: 5px; align-self: center; }
@keyframes typing-pulse {
  0%, 80%, 100% { opacity: .5; transform: translateY(0) scale(.88); }
  40% { opacity: 1; transform: translateY(-2px) scale(1); }
}
@keyframes blink { 0%, 70%, 100% { opacity: .25; } 35% { opacity: 1; } }
#chatBar {
  position: fixed; bottom: calc(84px + var(--sab)); left: 0; right: 0; z-index: 30;
  max-width: var(--app-w); margin: 0 auto; display: flex; gap: 8px; align-items: flex-end; padding: 8px 14px;
  background: var(--bg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
/* chat without custom tabs is full-page; once a user page exists the nav stays visible so the
   page just built is reachable without a URL or a hidden 0×0 button. */
#app.chatpage #chatBar { bottom: calc(10px + var(--sab)); }
#app.chatpage #main { padding-bottom: calc(96px + var(--sab)); }
#chatInput { resize: none; max-height: 120px; border-radius: 21px; padding: 10px 16px; scrollbar-width: none; }
/* UIUX F19 (P1, 10-15): at max height the draft scrolls inside the field and a line was cut in
   half against the frame (top in Chromium: the scrolled top padding shows a sliver; bottom in
   WebKit: it leaves the bottom padding out of the scroll range). The vertical inset is now a
   transparent BORDER - borders never scroll - so the scroll box holds whole lines only: max height
   is exactly 4 lines, and both scroll ends land on a line boundary. The visible frame moves to a
   box-shadow so the transparent border stays invisible; autosize() adds the frame to its height. */
#chatInput { padding: 0 16px; border: 0 solid transparent; border-block-width: 10px; line-height: 1.5;
  box-shadow: 0 0 0 .5px var(--line-control); max-height: calc(4lh + 20px); }
#chatInput:focus { border-color: transparent; box-shadow: 0 0 0 3px var(--accent-ink); }
/* UIUX F19 (10-15): a ~4px grey bar inside the right edge of the unfocused composer. overflow-y
   auto + a placeholder that wraps to a second line where the font is wider (Linux Noto CJK at
   390) = a classic scrollbar, clipped by the 21px radius to a sliver. The bar is hidden (the
   field still scrolls past 120px) and the placeholder stays on one line. */
#chatInput::-webkit-scrollbar { display: none; }
#chatInput::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* jump-to-bottom (chat) — glass pill, badge = new message while scrolled up */
#jumpBtn {
  position: fixed; right: max(16px, calc(50% - var(--app-w) / 2 + 16px)); bottom: calc(88px + var(--sab)); z-index: 29;
  width: 42px; height: 42px; border-radius: 21px; color: var(--accent-ink);
  background: var(--card);
  backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border: .5px solid var(--line-control); box-shadow: var(--shadow-2);
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s var(--ease-out);
}
#jumpBtn:active { transform: scale(.92); }
#jumpBtn .i { width: 20px; height: 20px; }
.jump-dot { position: absolute; top: -2px; right: -2px; width: 10px; height: 10px; border-radius: 5px; background: var(--accent-ink); border: 2px solid var(--bg); }
#micBtn { color: var(--ink2); padding: 9px 4px; }
#micBtn .i { width: 22px; height: 22px; }
#micBtn.rec { color: var(--danger); animation: blink 1s infinite; }
#sendBtn {
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--on-accent); width: 44px; height: 44px; min-width: 44px;
  border-radius: 22px; box-shadow: none;
  transition: transform .12s;
}
#sendBtn:active { transform: scale(.9); }
#sendBtn .i { width: 20px; height: 20px; }

/* ---------- library (notes | files) ---------- */
.lib-seg {
  display: flex; gap: 0; background: color-mix(in srgb, var(--line) 55%, var(--bg));
  border-radius: 12px; padding: 3px; margin: 8px 0 4px;
}
.lib-seg button {
  flex: 1; padding: 8px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--ink2);
  transition: background .15s, color .15s, box-shadow .15s;
}
.lib-seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-1); }
.search { margin: 10px 0 4px; border-radius: 21px; }
.note-search-row { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; }
.note-search-row .search { flex: 1 1 0; width: 0; min-width: 0; height: 46px; margin: 0; }
.note-search-row .note-new-button {
  display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center;
  width: auto; min-width: 0; height: 46px; padding: 0 12px; border: .5px solid var(--line-control);
  border-radius: 21px; background: var(--accent); color: var(--on-accent); font-size: 14px;
  white-space: nowrap;
}
.note-new-label { white-space: nowrap; }
#noteList [data-empty-cta="newNote"] { display: none; }
.note-card .nt { font-weight: 600; letter-spacing: -.01em; }
.note-card .nb { font-size: 13px; color: var(--ink3); margin-top: 3px; max-height: 40px; overflow: hidden; }
#noteEdCard { background: var(--card); min-height: 100dvh; padding: 16px 16px calc(24px + var(--sab)); max-width: var(--app-w); margin: 0 auto; }
#noteEdCard input { font-size: 19px; font-weight: 600; border: 1px solid var(--line-control); padding-left: 8px; background: none; box-shadow: none; }
/* 16px, not 15: this rule comes after the coarse-pointer floor and would otherwise re-arm the
   iOS focus zoom on the one surface people type the most into. */
#noteEdCard textarea { min-height: 46dvh; border: 1px solid var(--line-control); padding-left: 8px; background: none; font-size: 16px; box-shadow: none; }
#noteEdCard input:focus, #noteEdCard textarea:focus {
  border-color: var(--accent-ink); box-shadow: 0 0 0 3px var(--accent-ink);
}
.note-tools { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }

/* files */
.file-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0 4px; }
/* The two upload buttons stay on one row; a long folder count wraps in the space left over. */
.file-bar > span:first-child { min-width: 0; text-wrap: balance; /* no lone 「案」 on line 2 */ }
.file-bar > span:last-child { display: flex; gap: 8px; flex: none; }
.file-bar .btn.slim { padding-inline: 12px; white-space: nowrap; }
.file-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.file-tile {
  text-align: left; background: var(--card); border: 1px solid var(--line-control); border-radius: 14px;
  padding: 8px; box-shadow: var(--shadow-1); transition: transform .12s; min-width: 0;
}
.file-tile:active { transform: scale(.96); }
.ft-thumb {
  height: 84px; border-radius: 9px; overflow: hidden; background: var(--bg);
  display: flex; align-items: center; justify-content: center; color: var(--ink3);
}
.ft-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ft-thumb .i { width: 28px; height: 28px; }
.ft-name { font-size: 12px; font-weight: 600; margin-top: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-meta { display: flex; align-items: center; gap: 3px; font-size: 11px; color: var(--ink3); margin-top: 1px; }
.ft-meta .i { width: 11px; height: 11px; }

/* file viewer */
#viewerCard { background: var(--bg); min-height: 100dvh; width: 100%; padding: 12px 16px calc(24px + var(--sab)); max-width: var(--app-w); margin: 0 auto; display: flex; flex-direction: column; }
.viewer-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.viewer-top .v-name { flex: 1; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-body {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: var(--radius); background: var(--card); border: 1px solid var(--line);
  overflow: hidden; min-height: 42dvh; margin-bottom: 12px;
}
.viewer-body img { max-width: 100%; max-height: 62dvh; object-fit: contain; display: block; }
.v-pre {
  align-self: stretch; width: 100%; margin: 0; padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word; overflow-y: auto; max-height: 68dvh;
}
.v-html { align-self: stretch; width: 100%; height: 68dvh; border: 0; background: #fff; }
.v-pdf { align-self: stretch; width: 100%; height: 68dvh; border: 0; background: var(--card); }
.viewer-body .v-icon { color: var(--ink3); }
.viewer-body .v-icon .i { width: 56px; height: 56px; }
.viewer-body .v-meta { font-size: 13px; color: var(--ink3); margin-top: 10px; }
.viewer-actions { display: flex; gap: 8px; }
.viewer-actions .btn { font-size: 13.5px; padding: 11px 8px; }
#viewerCard #vChat[hidden], #viewerCard #vDl[hidden],
#viewerCard #vFolder[hidden], #viewerCard #vAtt[hidden] { display: none !important; }
.v-attached { margin-top: 12px; }

/* ---------- settings ---------- */
/* Section headings separate settings groups from the controls inside them.


*/
.set-sec {
  font-family: "New York", ui-serif, Georgia, "Times New Roman", serif;
  font-size: 17px; font-weight: 600; letter-spacing: -.01em; color: var(--ink);
  margin: 26px 2px 2px; padding-top: 16px; border-top: .5px solid var(--line2);
}
.set-sec:first-child { margin-top: 4px; padding-top: 0; border-top: 0; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; }
.usage-group + .usage-group { margin-top: 8px; }
.usage-group-heading { margin: 10px 0 2px; color: var(--ink3); font-size: 12px; font-weight: 600; line-height: 1.3; }
.usage-row > span { min-width: 0; flex: 1; font: inherit; white-space: normal; overflow-wrap: anywhere; }
.usage-row > strong { flex-shrink: 0; }
/* Settings icons use primary ink; destructive actions retain the danger token. */
#tab-settings .i { color: var(--ink); }
#tab-settings .tick .i { color: inherit; }
#tab-settings .btn.danger .i,
#tab-settings .sheet-item.danger .i,
#tab-settings [data-tx] .i,
#tab-settings [data-sx] .i,
#tab-settings [data-ix] .i { color: var(--danger); }
#tab-settings [data-ovdel] .i,
#tab-settings [data-tpldel] .i,
#tab-settings [data-mcpdel] .i { color: var(--danger); }
#tab-settings .set-row > input:not([type=checkbox]), #tab-settings .set-row > select {
  min-height: 44px; padding-top: 0; padding-bottom: 0;
}
/* A button that follows content in a settings card is spaced --gap (a few personal buttons carried
   an inline 14px; the workspace page, ICS, nav-tabs and quick-commands cards had nothing, so
   「複製邀請連結」「＋新增代理」「＋新增快速指令」 sat flush on the row above — Kono 10-15, UIUX F12).
   One rule for every card on both settings pages. */
#tab-settings .card > :not(.btn) + .btn { margin-top: var(--gap); }
/* F27 (Kono 10-15, UIUX SPACING.md): one rhythm for every settings card — title→description 4px,
   description→content --gap, content→button --gap (above), card→card --gap (.set-grp-b). */
#tab-settings .card > h3:has(+ .muted, + .howto) { margin-bottom: 4px; }
#tab-settings .card > h3 + .muted { margin-bottom: var(--gap); }
#tab-settings .card > h3 + .howto { margin-top: 0; margin-bottom: var(--gap); }
/* Navigation-tab reorder/remove (Kono 10-15: "↑ ↓ ✕ do nothing"). They were bare 19x23px glyphs
   with no disabled look, so the two that are legitimately impossible (first ↑, last ↓) looked
   exactly like the live ones and a fingertip mostly landed beside the rest. 44px targets, and an
   impossible move reads as impossible. */
#sTabs .set-row { gap: 2px; }
#sTabs .set-row input { flex: 1 1 auto; min-width: 0; margin-right: 6px; }
#sTabs button { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border-radius: 12px; }
#sTabs button:not(:disabled):active { background: var(--bg); }
#sTabs button:disabled { opacity: .28; cursor: default; }
/* storage meter (R7-STOR Settings Plan card) */
.storage-meter-wrap { margin: 0 0 12px; }
.meter { height: 4px; border-radius: 2px; background: var(--bg2); margin: 2px 0 8px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 2px; background: var(--data-tier-1); }
.use { margin: 12px 0 4px; }
.use-top { display: flex; align-items: baseline; gap: 8px; }
.use-top span { font-size: 13px; color: var(--ink2); }
.use-pct { margin-left: auto; font-size: 26px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.use-bar { height: 8px; border-radius: 4px; margin: 8px 0 6px; }
.use-bar i { border-radius: 4px; transition: width .35s ease; }
.use[data-state="low"] .use-pct { background: none; color: var(--ink); }
.use[data-state="crit"] .use-pct, .use[data-state="out"] .use-pct { color: var(--ink); }
.use-sub { line-height: 1.5; }
.use-warn { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; line-height: 1.45;
  background: var(--amber-bg); color: var(--ink2); }
.use[data-state="crit"] .use-warn, .use[data-state="out"] .use-warn { background: var(--danger-soft); }
.use-where { margin: 14px 0 2px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); }
.use-lane { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13.5px; }
.use-lane-n { flex: 0 0 38%; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.use-lane-b { flex: 1; height: 6px; border-radius: 3px; overflow: hidden;
  background: var(--bg2); }
.use-lane-b i { display: block; height: 100%; border-radius: 3px; background: var(--data-tier-1); }
.use-lane[data-lane="machine"] .use-lane-b i { background: var(--data-tier-2); }
.use-lane[data-lane="browser"] .use-lane-b i { background: var(--data-tier-3); }
.use-lane[data-lane="pages"] .use-lane-b i { background: var(--data-tier-4); }
.use-lane-a { flex: 0 0 54px; text-align: right; color: var(--ink3); }
.use-lane-p { flex: 0 0 40px; text-align: right; font-weight: 600; color: var(--ink2); }
.use-note { margin-top: 6px; line-height: 1.45; }
/* team / agents (workspace rows) */
.agent-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: .5px solid var(--hair); }
.agent-row:last-child { border-bottom: 0; }
/* Template gallery rows */
.gal-row { cursor: pointer; }
.gal-row .gal-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gal-row .gal-info b { font-size: 14px; }
/* UIUX F23 (10-15): template descriptions left one character on the last line (搞／定。) and split
   words (歷／史). pretty balances the last lines; the short one-line notes also keep CJK words
   whole (keep-all), with overflow-wrap as the escape hatch so a long locale string still wraps. */
.gal-row .gal-info .muted, #sheetCard > .muted, .howto, .task-title, .kb-card, .msg { text-wrap: pretty; }
.gal-row .gal-info .muted, #sheetCard > .muted, #sheetCard > .set-row > .small, .kb-card { word-break: keep-all; overflow-wrap: anywhere; }
/* F35: the checklist widget's reset note sits under its title (title→subtitle 4px, like settings). */
.card > h3 + .ck-sub { margin: -8px 0 8px; }
/* ponytail: keep-all only on short labels and narrow kanban cards (UIUX F23 reopen: 「…看／板」 left
   板 alone). Not on full-width task rows: keep-all on long free text leaves ragged one-phrase lines.
   WebKit has no word-aware CJK breaking (no word-break:auto-phrase); revisit when it ships. */
.gal-row .btn.slim { flex: none; }
#galQ { width: 100%; margin: 12px 0 4px; }
.agent-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px var(--ink); }
.agent-name { flex: 1; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
/* Responsive tables keep values readable and preserve access to their full contents.



*/
.agent-name > span { flex: none; overflow-wrap: normal; }
.agent-row .link-btn { padding: 4px 6px; }
.agent-row .link-btn .i { width: 15px; height: 15px; }
.pres { width: 8px; height: 8px; border-radius: 4px; background: var(--line2); flex: none; }
.pres.on { background: var(--ok); }
.agent-swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; transition: transform .12s; }
.agent-swatch.sel { border-color: var(--ink); }
.agent-swatch:active { transform: scale(.9); }

/* task multi-select (long-press → checkboxes + action bar) */
.task-row.selmode { cursor: pointer; }
.task-row.selon { background: var(--accent); color: var(--on-accent); border-radius: 12px; }
.task-row.selon .task-title, .task-row.selon .task-title.done { color: var(--on-accent); }
.selbar {
  position: fixed; left: 0; right: 0; bottom: calc(84px + var(--sab)); z-index: 30;
  max-width: var(--app-w); margin: 0 auto; display: flex; gap: 8px; padding: 10px 14px;
  background: var(--bg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.selbar .btn.primary { flex: 1; }

/* Activity feed widget rows */
.feedrow { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: .5px solid var(--hair); font-size: 13px; align-items: flex-start; }
.feedrow:last-child { border-bottom: 0; }
.feedrow time { font-size: 11px; color: var(--ink3); white-space: nowrap; padding-top: 2px; }
.set-row label { font-size: 13.5px; color: var(--ink2); font-weight: 600; min-width: 86px; }
.set-row > label { flex: 0 0 5em; min-width: 0; }
@media (max-width: 480px) {
  #tab-settings .card[data-g="reachyou"] .set-row:has(#sBrief),
  #tab-settings .card[data-g="reachyou"] .set-row:has(#sNtfyUrl),
  #tab-settings .card[data-g="reachyou"] .set-row:has(#sReflect) {
    align-items: stretch; flex-direction: column; gap: 6px;
  }
  #tab-settings .card[data-g="reachyou"] .set-row:has(#sBrief) > label,
  #tab-settings .card[data-g="reachyou"] .set-row:has(#sNtfyUrl) > label,
  #tab-settings .card[data-g="reachyou"] .set-row:has(#sReflect) > label { flex: none; width: 100%; }
  #tab-settings .card[data-g="reachyou"] .set-row:has(#sBrief) > input,
  #tab-settings .card[data-g="reachyou"] .set-row:has(#sNtfyUrl) > input,
  #tab-settings .card[data-g="reachyou"] .set-row:has(#sReflect) > select { flex: none; width: 100%; }
}
.mem-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mem-card-head h3 { margin-bottom: 0; }
.mem-item { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: .5px solid var(--hair); font-size: 14px; }
.mem-item:last-child { border-bottom: 0; }
.mem-copy { flex: 1; min-width: 0; }
.mem-text { display: flex; align-items: flex-start; gap: 5px; line-height: 1.4; }
.mem-item .i { color: var(--accent-ink); margin-right: 2px; }
.mem-meta { display: flex; gap: 8px; margin: 4px 0 0 27px; color: var(--ink3); font-size: 11px; }
.mem-state.on { color: var(--accent-ink); font-weight: 600; }
.mem-actions { display: flex; gap: 8px; flex: none; width: max-content; max-width: 100%; margin-left: 27px; }
.mem-item [data-mem-pin] { color: var(--accent-ink); font-size: 13px; font-weight: 600; }
.mem-item [data-mem-del] { color: var(--danger); font-size: 13px; font-weight: 600; }
.mono { font-family: var(--mono); font-size: 12.5px; }
textarea.mono { min-height: 220px; }
.hist-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: .5px solid var(--hair); font-size: 13px; }
.hist-item:last-child { border-bottom: 0; }
/* The action is two CJK characters in most languages and one unbreakable English word in en, so
   the flex row happily broke 還原 down the middle of the word. English never showed it. */
.hist-item button { white-space: nowrap; }

/* Activity timeline */
#activityCard { background: var(--bg); min-height: 100dvh; width: 100%; padding: 0 16px calc(24px + var(--sab)); max-width: var(--app-w); margin: 0 auto; }
.act-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: calc(10px + var(--sat)) 0 10px; background: var(--bg); border-bottom: .5px solid var(--hair); }
.act-head button { padding: 6px; color: var(--ink2); }
.act-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.act-card h3 { color: var(--ink); font-size: 12.5px; }
.act-row { padding: 6px 0; border-bottom: .5px solid var(--hair); }
.act-row:last-child { border-bottom: 0; }
.act-row .fx-row { max-width: 100%; padding: 2px 0 4px; }
.act-meta { font-size: 11px; color: var(--ink3); }
#activity .hist-item, #activity .feedrow, #activity .pa-card { margin: 0; }
.howto { background: var(--bg); border-radius: 12px; padding: 10px 12px; font-size: 12.5px; color: var(--ink2); margin-top: 10px; line-height: 1.5; }
.howto ol { margin: 4px 0 0; padding-left: 18px; }
.self-host-connect ol.self-host-connect-steps > li + li { margin-top: 8px; }
.self-host-connect-step-label { display: block; }
.self-host-connect-options { display: grid; gap: 8px; margin: 6px 0 2px; }
.self-host-connect-option { min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.self-host-connect-option h5 { margin: 0 0 5px; color: var(--ink); font-size: 12.5px; font-weight: 600; line-height: 1.4; }
.self-host-code-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 6px; }
.self-host-code-note > .self-host-code { flex: 1 1 220px; margin-top: 0; }
.self-host-code-note > span { white-space: nowrap; }
.self-host-code { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px;
  min-width: 0; margin-top: 6px; padding: 5px 6px; border: 1px solid var(--line2); border-radius: 8px; background: var(--card); }
.self-host-code pre { min-width: 0; margin: 0; color: var(--ink); font: 12px/1.45 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.self-host-connect code { font-family: var(--mono); font-size: .95em; }
.self-host-copy { min-width: 58px; min-height: 44px; padding: 6px 9px; border: 1px solid var(--line-control);
  border-radius: 7px; background: var(--bg); color: var(--ink2); font-size: 12px; font-weight: 600; }
.self-host-copy:active { background: var(--bg2); }
.self-host-connect-docs { min-height: 44px; padding: 10px 8px; text-decoration: underline; text-underline-offset: 2px; }
/* The stylesheet preserves shared design tokens and responsive layout behavior.*/
.pair-flow { border-top: .5px solid var(--hair); margin-top: 4px; padding-top: 10px; }
.pair-code {
  font: 600 24px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em;
  text-align: center; color: var(--accent-ink); padding: 10px 0 4px; user-select: all; -webkit-user-select: all;
}

/* ---------- overlays ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 70; background: rgba(43, 42, 40, .35);
  background-color: rgba(43, 42, 40, .68);
  display: flex; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  overscroll-behavior: contain;   /* a drag on the backdrop never scrolls the page (Kono 10-15) */
}
/* Responsive tables keep values readable and preserve access to their full contents.






*/
.overlay.full { background: var(--bg); align-items: stretch; overflow-y: auto; backdrop-filter: none; -webkit-backdrop-filter: none; }
/* Responsive controls remain visible and usable at narrow and wide viewport sizes.





*/
/* Kono 10-15 (iPhone): with the keyboard up, the add-workspace sheet slid with the page. Two
   causes. (a) Nothing locked the document while a sheet was open, so a drag on the backdrop
   scrolled the page under the fixed layer (and iOS scrolls it on focus). (b) iOS shrinks only
   the visual viewport, never the layout viewport a fixed sheet is anchored to, so bottom:0 sits
   behind the keyboard; app.js publishes the covered height as --kb (Safari has no
   interactive-widget). */
html:has(.overlay:not(.hidden)) { overflow: hidden; }
#modal, #sheet { z-index: 75; bottom: var(--kb, 0px); }
#modal > .sheet-card, #sheet > .sheet-card { max-height: min(88dvh, calc(100% - 12px)); overscroll-behavior: contain; }
.sheet-card {
  background: var(--card); opacity: 1; width: 100%; max-width: var(--app-w); border-radius: 26px 26px 0 0;
  /* overflow-x: hidden is load-bearing: overflow-y:auto alone computes overflow-x to auto, which
     made the edit/new-task sheet a sideways scroller on iPhone (Kono 10-15, the whole form slid
     right) the moment any child — the iOS date field — was wider than the card. */
  padding: 20px 18px calc(20px + var(--sab)); max-height: 88dvh; overflow-y: auto; overflow-x: hidden;
  animation: rise .38s var(--ease-drawer);
}
#sheetCard:has(#repCancel) { max-height: calc(100dvh - var(--kb, 0px) - 24px); }
#sheetCard:has(#repCancel) .sheet-actions {
  position: sticky; bottom: 24px; z-index: 1; margin-inline: -18px; padding: 12px 18px;
  background: var(--card);
}
#sheetCard:has(#repCancel) .sheet-actions > #repCancel,
#sheetCard:has(#repSend) .sheet-actions > #repSend { min-width: 112px; justify-content: center; }
[data-theme="dark"] #sheetCard:has(.usage-group, #usageEmpty) { border-top: 1px solid var(--line2); }
.sheet-card.slim { padding-bottom: calc(12px + var(--sab)); }
@keyframes rise { from { transform: translateY(48px); opacity: 1; } to { transform: none; opacity: 1; } }
.sheet-card .frow { margin-top: 14px; }
.sheet-card label.fl { display: block; font-size: 11.5px; color: var(--ink3); font-weight: 600; margin-bottom: 5px; text-transform: uppercase; letter-spacing: .06em; }
.tagbox { display: flex; flex-wrap: wrap; gap: 7px; }
.tagbox .chip.off { background: var(--bg); color: var(--ink3); }
.att-row { display: flex; flex-wrap: wrap; gap: 7px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 20px; }
.sheet-item {
  display: flex; align-items: center; gap: 9px; width: 100%; min-width: 0; text-align: left;
  padding: 14px 6px; font-size: 15.5px; font-weight: 500; border-bottom: .5px solid var(--hair);
  white-space: normal; overflow-wrap: anywhere;
}
.sheet-item .i { color: var(--ink3); }
.sheet-item:last-child { border-bottom: 0; }
.sheet-item.danger, .sheet-item.danger .i { color: var(--danger); }

/* The stylesheet preserves shared design tokens and responsive layout behavior.*/
/* compact glass pill (left side, opposite the jump button) — no pulse, no full-width takeover */
#liveBar {
  position: fixed; left: max(14px, calc(50% - 226px)); bottom: calc(88px + var(--sab)); z-index: 29;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 15px; border-radius: 21px; font-weight: 600; font-size: 13px;
  color: var(--accent-ink); background: var(--card);
  backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border: .5px solid var(--accent-ink); box-shadow: var(--shadow-1);
}
#liveBar .i { width: 17px; height: 17px; }
#liveCard { background: var(--bg); min-height: 100dvh; width: 100%; max-width: var(--app-w); margin: 0 auto; display: flex; flex-direction: column; }
#liveHead {
  display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
  border-bottom: 1px solid var(--line2); background: var(--card);
}
#liveHead .i { width: 20px; height: 20px; }
#liveUrl {
  flex: 1; min-width: 0; font-size: 16px; /* 16px: iOS won't zoom-jump the viewport on focus */
  color: var(--ink); background: var(--bg); border: 1px solid var(--line-control); box-shadow: none;
  border-radius: 9px; padding: 7px 10px; width: auto;
}
#liveUrl:focus { border-color: var(--accent-ink); box-shadow: 0 0 0 2px var(--accent-ink); }
#liveTgl { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink2); }
#liveTgl input { accent-color: var(--accent-ink); width: 18px; height: 18px; }
#liveTgl:has(input:checked) { color: var(--accent-ink); }
#liveWrap { position: relative; flex: 1; overflow: hidden; background: #101014; display: flex; align-items: flex-start; justify-content: center; }
#liveCanvas { width: 100%; height: auto; display: block; }
/* connection / session-ended states — never a silent black canvas */
#liveState {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: #101014; color: #EDEAE4;
}
.lv-msg { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 24px; font-size: 13.5px; }
.lv-msg .i { width: 28px; height: 28px; opacity: .7; }
.lv-msg b { font-size: 15px; }
.lv-msg span:not(.lv-spin) { color: rgba(237, 234, 228, .65); max-width: 260px; line-height: 1.5; }
.lv-msg .btn { margin-top: 8px; width: auto; background: rgba(255, 255, 255, .1); border-color: #7F7F84; color: #fff; }
.lv-spin {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .25); border-top-color: #fff;
  animation: lvspin .8s linear infinite;
}
@keyframes lvspin { to { transform: rotate(360deg); } }
/* Responsive controls remain visible and usable at narrow and wide viewport sizes.



*/
.pair-busy { position: relative; opacity: 1; cursor: progress; }
.pair-busy::after {
  content: ""; display: inline-block; width: 13px; height: 13px; margin-left: 7px;
  vertical-align: -2px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor;
  animation: lvspin .8s linear infinite;
}
#liveFoot {
  display: flex; gap: 8px; align-items: center; padding: 10px 12px calc(12px + var(--sab));
  border-top: 1px solid var(--line2); background: var(--card);
}
#liveFoot input { flex: 1; border-radius: 12px; padding: 9px 12px; font-size: 16px; }
#liveFoot .btn { white-space: nowrap; }
#liveFoot .btn .i { width: 18px; height: 18px; }
/* system messages (e.g. "user finished the manual step") — quiet, centered */
.msg.system { align-self: center; background: none; border: 0; color: var(--ink3); font-size: 12.5px; box-shadow: none; padding: 2px 8px; }
.msg-meta.system { display: none; }

/* ---------- notification center (bell + sheet) ---------- */
#bellBtn {
  position: relative; flex: none; display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; color: var(--ink);
  background: var(--card); border: .5px solid var(--ink); box-shadow: var(--shadow-1);
}
#bellBtn:active { transform: scale(.94); }
#bellBtn .i { width: 20px; height: 20px; }
#bellBadge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 9px; background: var(--accent); color: var(--on-accent);
  font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center;
  border: 2px solid var(--bg); box-sizing: border-box;
}
.ntf-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
/* F33/E3: mark-all-read failure, said in the panel under its header (never over the rows) */
.ntf-status { display: flex; align-items: center; gap: 6px; margin: 2px 0 8px; padding: 8px 10px;
  border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 13px;
  font-weight: 600; line-height: 1.35; text-wrap: balance; }
.ntf-status svg { flex: none; width: 16px; height: 16px; }
.ntf-head h2 { margin: 0; }
.ntf-row {
  display: flex; gap: 12px; width: 100%; text-align: left; align-items: flex-start;
  padding: 13px 4px; border-bottom: .5px solid var(--hair);
}
.ntf-row:last-child { border-bottom: 0; }
.ntf-row:active { background: var(--bg); }
.ntf-ic {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); color: var(--accent-ink);
}
.ntf-ic .i { width: 17px; height: 17px; }
.ntf-row.ntf-model-needed .ntf-ic { background: var(--bg2); color: var(--ink2); }
.ntf-main { flex: 1; min-width: 0; }
.ntf-main b { display: block; font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.ntf-row:not(.unread) .ntf-main b { font-weight: 500; color: var(--ink2); }
.ntf-body {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 13px; color: var(--ink3); line-height: 1.4; margin-top: 1px;
}
.ntf-row.ntf-model-needed .ntf-body {
  display: block; -webkit-line-clamp: unset; -webkit-box-orient: initial;
  overflow: visible; overflow-wrap: anywhere;
}
.ntf-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; padding-top: 2px; }
.ntf-time { font-size: 11.5px; color: var(--ink3); }
.ntf-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-ink); }
.self-host-connect { margin-top: 14px; }
.self-host-connect h4 { margin: 0 0 8px; color: var(--ink); font-size: 14px; font-weight: 600; }
.self-host-connect-status {
  padding: 7px 9px; border-radius: 8px; background: var(--bg2); color: var(--ink2); font-weight: 600;
}
.self-host-connect ol { margin-top: 8px; }
.self-host-connect li + li { margin-top: 4px; }
.self-host-connect-docs { padding: 7px 0 0; }

/* Style presets override shared tokens so components and canvas views use the same active theme.





*/
[data-preset="glass"] {
  --card: #FFFFFF;
  --line: rgba(255, 255, 255, .65);
  --line2: rgba(43, 42, 40, .12);
  --shadow-1: 0 8px 32px rgba(43, 42, 40, .10), inset 0 1px 0 rgba(255, 255, 255, .65);
  --shadow-2: 0 12px 40px rgba(43, 42, 40, .16), inset 0 1px 0 rgba(255, 255, 255, .65);
}
[data-preset="glass"] body { background: color-mix(in srgb, var(--accent-wash) 20%, var(--bg)); }
[data-preset="glass"] .card, [data-preset="glass"] #topbar, [data-preset="glass"] #tabbar,
[data-preset="glass"] #chatBar, [data-preset="glass"] .sheet-card {
  backdrop-filter: blur(24px) saturate(1.7);
  -webkit-backdrop-filter: blur(24px) saturate(1.7);
}
[data-theme="dark"][data-preset="glass"] {
  --card: #1D1C21;
  --line: rgba(255, 255, 255, .10);
  --line2: rgba(255, 255, 255, .14);
  --shadow-1: 0 2px 14px rgba(0, 0, 0, .40), inset 0 1px 0 rgba(255, 255, 255, .06);
  --shadow-2: 0 8px 32px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .06);
}
/* This preset changes structure and spacing while leaving the accent color user-configurable.









*/
[data-preset="beyond"] {
  --radius: 14px;
  --bg: #F1F1EF;
  --bg2: #E9E9E6;
  --card: #FFFFFF;
  --ink: #0C0C0C;
  --ink2: #4A4A47;
  --ink3: var(--muted);
  --line: #E2E2DE;
  --line2: #D2D2CD;
  --hair: rgba(12, 12, 12, .10);
  /* Flat by construction. The board rules surfaces with hairlines instead of lifting them,
     so a shadow here would read as a different design language, not a softer one. */
  --shadow-1: none;
  --shadow-2: 0 1px 0 var(--line2);
  --pad: 16px;
  --gap: 12px;
}
[data-theme="dark"][data-preset="beyond"] {
  --bg: #0A0A0A;
  --bg2: #121212;
  --card: #151515;
  --ink: #F4F4F1;
  --ink2: #A8A8A3;
  --ink3: var(--muted);
  --line: #232323;
  --line2: #2E2E2E;
  --hair: rgba(244, 244, 241, .10);
  --shadow-1: none;
  --shadow-2: 0 1px 0 var(--line2);
}
/* Display type: the board sets headings tight and heavy against generous body text. Tracking
   is the only thing that needs saying — weight and size already come from the components. */
[data-preset="beyond"] h1, [data-preset="beyond"] h2 { letter-spacing: -.02em; }
[data-preset="beyond"] .act-head h2, [data-preset="beyond"] #appTitle { letter-spacing: -.03em; }
/* Chips and the active tab read as filled rounded squares rather than soft pills. */
[data-preset="beyond"] .qc-chips button, [data-preset="beyond"] .pill { border-radius: 8px; }

[data-preset="material"] {
  --radius: 24px;
  --font: Roboto, "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --pad: 16px;
  --gap: 12px;
  --line: transparent;
  --shadow-1: none;
  --shadow-2: 0 1px 3px rgba(25, 24, 29, .10);
}
[data-theme="dark"][data-preset="material"] {
  --card: color-mix(in srgb, var(--accent) 9%, #17161B);
  --bg: #121114;
  --bg2: #0E0D10;
  --line: transparent;
  --shadow-1: none;
  --shadow-2: 0 1px 3px rgba(0, 0, 0, .45);
}


/* The stylesheet preserves shared design tokens and responsive layout behavior.*/
/* entrance animation only for genuinely NEW content (renderChat tags .in) */
.msg.in, .pa-card.in { animation: fadeUp .25s var(--ease-out) backwards; }

/* toast exit (app.js toggles .hide before .hidden) */
.toast { transition: opacity .2s var(--ease-out), transform .25s var(--ease-out); }
.toast.hide { opacity: 0; transform: translate(-50%, 8px); }

/* pointer affordances, gated so touch never sticks */
@media (hover: hover) and (pointer: fine) {
  .btn:hover { filter: brightness(.97); }
  .btn.primary:hover { filter: brightness(1.06); }
  .chip:hover, .fx:hover, .seg button:hover, .sheet-item:hover, .q-opt:hover:not(:disabled) { filter: brightness(.96); }
  .task-row:hover { background: var(--card); }
  .note-card:hover, .kb-card:hover { box-shadow: var(--shadow-2); }
  .persona:hover, .ai-opt:hover { border-color: var(--line-control); }
}

/* keyboard focus ring, matching the input ring */
:where(button, a, [tabindex]):focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ink);
  border-radius: 10px;
}

/* pressed feedback on the controls that lacked it */
#bellBtn { transition: transform .12s var(--ease-out); }
.ai-opt, .link-btn { transition: transform .12s var(--ease-out), border-color .2s; }
.ai-opt:active, .link-btn:active { transform: scale(.97); }
.sheet-item:active { background: var(--bg); }
#tabbar button .ic { transition: background .2s, transform .12s var(--ease-out); }
#tabbar button:active .ic { transform: scale(.9); }

/* Onboarding question choices stack vertically and distinguish the selected answer.*/
/* question option buttons — stacked, tap to answer; answered: chosen highlighted, rest fade */
.q-opts { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; width: 100%; max-width: 100%; align-self: flex-start; }
.q-opt {
  display: flex; align-items: center; justify-content: flex-start; width: 100%; max-width: 100%; min-width: 0;
  text-align: left; font-size: 14px; font-weight: 500; white-space: normal; overflow-wrap: anywhere;
  padding: 11px 14px; border-radius: 14px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line-control); box-shadow: var(--shadow-1); line-height: 1.4;
  transition: transform .12s, border-color .15s, color .15s;
}
.q-opt:active { transform: scale(.97); }
.q-opt:disabled { cursor: default; }
.q-opts.answered .q-opt { opacity: .4; box-shadow: none; }
.q-opts.answered .q-opt.chosen { opacity: 1; border: 1.5px solid var(--accent-ink); color: var(--accent-ink); }
.q-option-item.chosen .data-action-copy { color: var(--accent-ink); font-weight: 700; }
.q-option-item { width: 100%; }
.q-hint { font-size: 11px; color: var(--ink3); padding: 2px 2px 0; }

/* first-conversation starter prompts (onboarding v2) — tap one to send it */
.starters { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; width: 100%; max-width: 100%; align-self: flex-start; }
.empty + .starters { align-self: center; margin-top: 0; }
.starter-hint { font-size: 11px; color: var(--ink3); padding: 2px 2px 4px; }
.starter {
  display: flex; align-items: center; justify-content: flex-start; width: 100%; max-width: 100%; min-width: 0;
  text-align: left; font-size: 14px; font-weight: 500; line-height: 1.4; white-space: normal; overflow-wrap: anywhere;
  padding: 11px 14px; border-radius: 14px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line-control);
  box-shadow: var(--shadow-1);
  transition: transform .12s, border-color .15s;
}
.starter:active { transform: scale(.97); }

/* timeline (history / event log) — hairline spine, terracotta dots */
.tl { position: relative; margin-left: 8px; border-left: 1.5px solid var(--hair); padding-left: 18px; display: flex; flex-direction: column; gap: 16px; }
.ev { position: relative; }
.ev::before { content: ""; position: absolute; left: -24px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-ink); }
.ev.sys::before { background: var(--line2); }
.ev .who { font-size: 11.5px; font-weight: 700; }
.ev .who time, .ev time { font-weight: 400; color: var(--ink3); margin-left: 6px; font-size: 11px; }
.ev p { font-size: 13.5px; line-height: 1.55; color: var(--ink2); margin: 3px 0 0; white-space: pre-wrap; word-break: break-word; }

/* mention chip — accent inline; inverted inside filled bubbles */
.mention { color: var(--accent-ink); font-weight: 700; }
.msg.user .mention { color: #fff; text-decoration: underline; }
/* #ref chips — inline task references in chat/feed text */
.ref-chip {
  display: inline-flex; align-items: center; max-width: 200px; overflow: hidden; text-overflow: ellipsis;
  font-size: 12.5px; font-weight: 600; background: var(--card); color: var(--accent-ink);
  border-radius: 10px; padding: 1px 8px; margin: 0 1px; vertical-align: baseline; white-space: nowrap;
}
.msg.user .ref-chip { background: transparent; color: #0A0A0A; border: 1px solid #0A0A0A; }

/* quoted-message block above a reply bubble */
.reply-quote {
  max-width: 82%; font-size: 11.5px; color: var(--ink3);
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  border-left: 2.5px solid var(--accent-ink); border-radius: 8px;
  padding: 5px 10px; margin-bottom: 3px;
}
.msg.user + .reply-quote, .reply-quote.user { align-self: flex-end; }

/* calendar strip (month grid card) */
.cal-card .cal-nav { display: flex; align-items: center; gap: 2px; }
.calgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.calw { font-size: 11px; color: var(--ink3); padding: 4px 0; font-weight: 600; }
.cal { padding: 8px 0 5px; font-size: 13.5px; border-radius: 11px; position: relative; color: var(--ink2); }
.cal.due { --accent-ink: var(--on-accent); font-weight: 700; color: var(--accent-ink); background: var(--accent); }
.cal.today { border: 1.5px solid var(--ink); font-weight: 700; color: var(--ink); }
.cal.selected { background: var(--ink); color: var(--bg); }
.cal i { display: block; width: 4px; height: 4px; border-radius: 50%; background: var(--accent-ink); margin: 2px auto 0; }
.cal.due i { background: var(--on-accent); }
.cal.selected i { background: var(--bg); }
.calnav { background: none; border: none; font-size: 16px; font-weight: 700; color: var(--accent-ink); padding: 0 10px; }

/* reduced motion: keep opacity cues, drop movement */
@media (prefers-reduced-motion: reduce) {
  .tab-fade, .msg.in, .pa-card.in, #obStep.ob-in, .sheet-card, .toast {
    animation-duration: .01ms !important; animation-delay: 0s !important;
  }
  .morph .card, .morph .task-row, .morph .kb-col, .morph #viewTabs { animation: none; }
  .typing span { animation: none; opacity: .72; transform: none; }
  .pair-busy::after { animation: blink 1.2s infinite; }   /* keep the cue, drop the rotation */
  * { transition-duration: .05s !important; }
}


/* reply bar rides inside the fixed chat bar as a full-width first row */
#chatBar { flex-wrap: wrap; }
#chatBar > #replyBar.reply-bar { max-width: none; }
/* @/slash suggestion menu — full-row card floating above the input */
#suggest {
  flex: 1 1 100%; display: flex; flex-direction: column; margin: 0 0 8px;
  background: var(--card); border: .5px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-2); overflow: hidden; max-height: 42dvh; overflow-y: auto;
}
#suggest.hidden { display: none; }
#suggest button { display: flex; align-items: baseline; gap: 8px; text-align: left; padding: 11px 14px; font-size: 14px; border-bottom: .5px solid var(--hair); }
#suggest button:last-child { border-bottom: 0; }
#suggest button.on { background: var(--accent); color: var(--on-accent); }
#suggest button.on b, #suggest button.on .sug-hint { color: var(--on-accent); }
#suggest b { color: var(--accent-ink); white-space: nowrap; }
#suggest .sug-hint { color: var(--ink3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.reply-bar { flex: 1 1 100%; display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.att-bar .att-thumb { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; flex: none; border: .5px solid var(--line); }
#attBtn { color: var(--ink2); padding: 9px 2px; }
#attBtn .i { width: 22px; height: 22px; }
/* chat images + attached-file chips */
.chatimg {
  align-self: flex-start; max-width: 68%; max-height: 320px; border-radius: 14px;
  border: .5px solid var(--line); box-shadow: var(--shadow-1); margin: 2px 0; object-fit: contain;
}
.chatimg.user { align-self: flex-end; }
.fx-row.user { align-self: flex-end; }
.reply-bar .rq-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar .i { width: 15px; height: 15px; flex: none; }

#chatInput { flex: 1 1 0; min-width: 0; }
#micBtn, #sendBtn { flex: none; }
#chatBar > .chat-enter-hint {
  flex: 0 0 100%; order: 2; margin-top: -5px; padding: 0 5px 1px;
  color: var(--ink3); font-size: 11px; line-height: 1.3; text-align: right;
  pointer-events: none;
}
/* #9c: a keyboard-shortcut hint means nothing on a phone's on-screen keyboard. */
@media (pointer: coarse) { #chatBar > .chat-enter-hint { display: none; } }
.account-identities { display: grid; gap: 4px; margin: 0 0 12px; }
/* Balance, on its own right-aligned row above the input, and ONLY while it is running out
   (app.js creditChip: 25%, or empty). It sat IN the input row first; at 390px that took the
   textarea from 238px to 165px and cut 「Ask Kono'S anything…」 through the middle of its second
   line. Same full-width-row shape as #suggest and .reply-bar, so the composer keeps its width.
   Deliberately the same pill as #liveBar rather than a new shape — the app already says "here
   is a live fact about this turn" that way, and a second vocabulary for the same sentence is
   how a screen starts to look assembled. Danger only at zero: "getting low" and "stopped" are
   different events and reading them off one colour is what a meter is for. */
.credit-row { flex: 1 1 100%; display: flex; justify-content: flex-end; margin: 0 0 8px; }
.credit-chip {
  flex: none; display: inline-flex; align-items: center;
  height: 32px; padding: 0 12px; border-radius: 16px;
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--accent-ink); background: var(--card);
  border: .5px solid var(--accent-ink); box-shadow: var(--shadow-1);
  transition: transform .12s var(--ease-out);
}
.credit-chip.out { color: var(--danger); border-color: var(--accent-ink); }
.credit-chip:active { transform: scale(.92); }

.ok-text { color: var(--ok); font-weight: 600; }

/* onboarding v3: the product stays visible while the first real feature is proposed */
#obStep textarea { width: 100%; resize: vertical; min-height: 92px; }
.ob3-context-label { display: block; margin: 10px 0 6px; color: var(--ink); font-size: 14px; font-weight: 600; }
.ob3-required { margin-left: 7px; color: var(--danger); font-size: 11px; font-weight: 700; }
.ob3-context-help, .ob3-context-error { margin: 5px 0 8px; font-size: 12px; line-height: 1.45; }
.ob3-context-help { color: var(--ink2); }
.ob3-context-error { color: var(--danger); font-weight: 600; }
#obContext.ob3-context-invalid { border-color: var(--danger); box-shadow: 0 0 0 2px var(--danger-soft); }
.ob3-quiet { display: flex; flex-wrap: wrap; gap: 14px; margin: 10px 0 4px; }
.ob3-quiet .link-btn { padding: 4px 0; color: var(--ink2); font-size: 13px; }
.ob3-persona-switch {
  margin-top: 8px; padding: 9px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.ob3-persona-lead { margin: 0 0 8px; color: var(--ink2); font-size: 13px; line-height: 1.4; }
.ob3-persona-options { display: flex; flex-wrap: wrap; gap: 6px; }
.ob3-persona-option {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-control); border-radius: 999px;
  background: var(--card); color: var(--ink); font: inherit; font-size: 13px; line-height: 1.25;
  cursor: pointer;
}
.ob3-persona-option[aria-pressed="true"] {
  border: 2px solid #0A0A0A; background: #fff; color: #0A0A0A; font-weight: 700;
}
.ob3-persona-option:disabled { opacity: .55; cursor: wait; }
.ob3-persona-check { font-weight: 700; }
.ob3-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.ob3-proposals { display: grid; align-content: start; gap: 9px; min-height: 144px; margin-top: 12px; }
.ob3-proposal {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: max-content; max-width: 100%; padding: 8px 14px; text-align: center;
  --accent-soft: var(--card); background: var(--accent-soft); border: 1px solid var(--line-control); color: var(--accent-ink); border-radius: 18px; white-space: nowrap;
  box-shadow: var(--shadow-1); transition: border-color .18s, transform .18s, box-shadow .18s;
}
.ob3-proposal span { flex: none; color: var(--accent-ink); font-size: 12px; font-weight: 700; }
.ob3-proposal-copy { font-weight: 500; }
.ob3-proposal:hover { border-color: var(--on-accent); transform: translateY(-1px); box-shadow: var(--shadow-2); }
.ob3-proposal:disabled { opacity: .55; cursor: wait; transform: none; }
.ob3-spinner {
  display: inline-block; width: 13px; height: 13px; flex: none;
  border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%;
  animation: ob3-spin .8s linear infinite;
}
@keyframes ob3-spin { to { transform: rotate(360deg); } }
.ob3-wait-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; }
.ob3-wait-actions .link-btn { padding: 4px 0; color: var(--accent-ink); text-align: left; }
.ob3-build-failure { margin-top: 12px; color: var(--danger); font-weight: 600; }
.ob3-proposal-skel { display: grid; gap: 9px; }
.ob3-proposal-skel i {
  display: block; height: 55px; border-radius: 14px;
  background: var(--bg2);
  animation: ob3-shimmer 1.3s ease-in-out infinite alternate;
}
@keyframes ob3-shimmer { from { opacity: .65; } to { opacity: 1; } }
.aha-highlight { animation: aha-arrive 1.8s ease both; }
@keyframes aha-arrive {
  0%, 35% { color: var(--on-accent); background: var(--accent); box-shadow: 0 0 0 7px var(--line2); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .ob3-proposal, .ob3-proposal-skel i, .ob3-spinner, .aha-highlight { animation: none; transition: none; }
  .aha-highlight { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
}

/* password field with visibility toggle */
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 44px; }
.pw-wrap #authEye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; padding: 8px; color: var(--ink3); cursor: pointer;
}
.pw-wrap #authEye .i { width: 19px; height: 19px; }

/* the brain: wiki-links + backlinks */
.wikilink { color: var(--accent-ink); text-decoration: none; border-bottom: 1px dashed var(--accent-ink); font-weight: 600; }
.backlinks { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.backlinks .fl { width: 100%; }

/* ---------- shared workspaces ---------- */
/* header title doubles as the workspace switcher */
#topbar .tt { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tt-row { display: flex; align-items: center; gap: 5px; min-width: 0; }
.tt-row #appTitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-caret { display: inline-flex; color: var(--ink3); flex: none; }
.ws-caret .i { width: 14px; height: 14px; }
/* switcher sheet: current mark + member count */
.ws-cur { margin-left: 6px; color: var(--accent-ink); display: inline-flex; }
.ws-unread { width: 7px; height: 7px; border-radius: 4px; background: var(--accent-ink); flex: none; align-self: center; margin-left: 6px; }
.sheet-item .ws-count { margin-left: auto; }
/* The stylesheet preserves shared design tokens and responsive layout behavior.*/
#suggest button.off { opacity: .45; }
#suggest button.off b { color: var(--ink3); }
/* teammates' messages: left-aligned peer bubbles in the member's color */
.msg.user.peer {
  align-self: flex-start; color: var(--ink);
  border-bottom-right-radius: 18px; border-bottom-left-radius: 5px;
  background: color-mix(in srgb, var(--ab, var(--card)) 10%, var(--card));
  border: .5px solid color-mix(in srgb, var(--ab, var(--accent-ink)) 55%, var(--line-control));
  box-shadow: none;
}
.msg-meta.user.peer { align-self: flex-start; }
.msg.user.peer .mention { color: var(--accent-ink); text-decoration: underline; }
.msg.user.peer .ref-chip { background: transparent; color: #0A0A0A; border: 1px solid #0A0A0A; }
[data-theme="dark"] .msg.user.peer .ref-chip { color: #F4F4F1; border-color: #F4F4F1; }
/* Theme presets use shared tokens while preserving the user-configured accent. */
.msg.user.peer.agentmsg { border: 1px dashed color-mix(in srgb, var(--ab, var(--accent-ink)) 55%, var(--line-control)); }
.msg.user.peer.brand-lime { background: #F2F2F2; border: .5px solid var(--line-control); }
[data-theme="dark"] .msg.user.peer.brand-lime { background: #1E1E1E; }
.msg.user.peer.agentmsg.brand-lime { border: 1px dashed var(--line-control); }
.a2a-tag { align-self: flex-start; font-size: 11px; color: var(--ink3); padding: 2px 6px 0; }
/* my-agent availability toggle in the ws Agents card */
.ws-tgl { display: inline-flex; align-items: center; flex: none; }
.ws-tgl input { width: 18px; height: 18px; accent-color: var(--accent-ink); margin: 0; }

/* ===== RTL (ar / ur / fa / he) =====
   document.documentElement.dir="rtl" already flips text, alignment and flex start/end/justify;
   these override only the PHYSICAL left/right accents that don't auto-flip. */
[dir=rtl] .tl { margin-left: 0; margin-right: 8px; border-left: 0; border-right: 1.5px solid var(--hair); padding-left: 0; padding-right: 18px; }
[dir=rtl] .reply-quote { border-left: 0; border-right: 2.5px solid var(--accent-ink); }
[dir=rtl] .brief-md ul, [dir=rtl] .howto ol { padding-left: 0; padding-right: 20px; }
[dir=rtl] .msg.user { border-bottom-right-radius: 18px; border-bottom-left-radius: 5px; }
[dir=rtl] .msg.user + .msg.user { border-top-right-radius: 18px; border-top-left-radius: 8px; }
[dir=rtl] .msg.assistant { border-bottom-left-radius: 18px; border-bottom-right-radius: 5px; }

/* #12: short action labels stay intact through the scoped action-row selectors below. */
.persona { position: relative; width: 100%; cursor: pointer; display: flex; flex-direction: column;
  align-items: flex-start; min-width: 0; }
.persona-choice { appearance: none; }
.persona .pe { color: var(--ink); }
.persona .choice-check { position: absolute; top: 14px; right: 14px; }
.persona .persona-copy { font-size: 12.5px; color: var(--ink3); line-height: 1.4; display: block;
  margin-top: 2px; text-wrap: balance; }
.persona b, .persona-copy, .ai-choice-copy b { max-width: 100%; overflow-wrap: anywhere; }
.choice-check { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border-radius: 50%; color: var(--on-accent); background: var(--accent); }
.choice-check .i { width: 15px; height: 15px; }
.ai-choice { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0;
  margin-top: 12px; padding: 14px 16px; text-align: left; background: var(--card); border: 1.5px solid var(--line-control);
  border-radius: var(--radius); box-shadow: var(--shadow-1); }
.ai-choice.sel { --accent-ink: var(--on-accent); border-color: var(--accent-ink); background: var(--accent-soft); color: var(--on-accent); }
.ai-choice-copy { min-width: 0; flex: 1; }
.ai-choice-copy b { display: block; font-size: 15px; }
.ai-choice-copy span { display: block; font-size: 13px; color: var(--ink3); line-height: 1.4; overflow-wrap: anywhere; }
.persona.sel span.persona-copy { color: var(--selected-description-ink); }
.ai-choice.sel .ai-choice-copy span { color: var(--selected-description-ink); }
.ai-opt { display: flex; color: var(--ink); }
.ai-opt:active { transform: scale(.99); }
.empty .btn { margin: 0; }
.wf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.wf-main { flex: 1 1 100%; }
.wf-actions { width: max-content; max-width: 100%; }
.data-action-list { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 0; }
.data-action-item { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.data-action-copy { display: block; width: 100%; min-width: 0; line-height: 1.4; overflow-wrap: anywhere; }
.data-action-item > button, .data-action-list > button {
  width: max-content; max-width: 100%; flex: none; white-space: nowrap;
}
.data-action-list > .open-item-row, .data-action-list > .vm-size-choice, .data-action-list > .folder-choice {
  width: 100%; max-width: 100%; white-space: normal;
}
.open-item-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  width: 100%; max-width: 100%; min-width: 0; flex: none; padding: 11px 12px; text-align: left;
  white-space: normal; overflow-wrap: anywhere; color: var(--ink2); background: var(--card);
  border: 1px solid var(--line-control); border-radius: 12px; box-shadow: var(--shadow-1); }
.open-item-row > .i { width: 16px; height: 16px; color: var(--ink); }
.open-item-name { min-width: 0; line-height: 1.4; overflow-wrap: anywhere; }
.open-item-name.file-name { display: flex; overflow: hidden; white-space: nowrap; overflow-wrap: normal; }
.open-item-name-main { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.open-item-name-ext { flex: none; white-space: nowrap; }
.open-item-chevron { color: var(--ink3); font-size: 22px; line-height: 1; }
.empty-cta-action { margin: 0 auto; }
.rec-add-row { display: flex; justify-content: flex-start; margin: 8px 0 12px; }
.rec-add-button { min-height: 44px; max-width: 100%; white-space: normal; }
.rec-status-row { display: flex; min-width: 0; margin-top: 6px; }
.rec-status-select { max-width: min(100%, 220px); min-height: 36px; padding: 6px 28px 6px 9px;
  color: var(--ink); background-color: var(--card); border: 1px solid var(--line-control);
  border-radius: 10px; font: inherit; font-size: 13px; }
.kb-card .rec-status-row { margin-top: 8px; }
.fx-action { align-self: flex-start; width: min(86%, 390px); }
.viewer-task-action, .backlink-action, .task-attachment-item { width: 100%; }
.vm-size-choice { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  min-width: 0; padding: 12px 14px; text-align: left; white-space: normal; color: var(--ink2);
  background: var(--card); border: 1.5px solid var(--line-control); border-radius: 12px; }
.vm-size-choice.selected { --accent-ink: var(--on-accent); border-color: var(--accent-ink); background: var(--accent); color: var(--on-accent); }
.vm-size-copy { display: flex; flex-direction: column; min-width: 0; gap: 3px; overflow-wrap: anywhere; }
.vm-size-copy b { font-size: 14px; color: var(--ink); }
.vm-size-copy > span { font-size: 12px; color: var(--ink3); }
.vm-size-choice[aria-pressed="true"] .vm-size-copy b { font-weight: 700; }
.folder-choice { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  width: 100%; max-width: 100%; min-width: 0; flex: none; padding: 10px 12px; text-align: left; white-space: normal;
  color: var(--ink2); background: var(--card); border: 1px solid var(--line-control); border-radius: 12px; }
.folder-choice > .i { width: 16px; height: 16px; color: var(--ink); }
.folder-choice-name { min-width: 0; line-height: 1.4; overflow-wrap: anywhere; }
.folder-choice.selected { --accent-ink: var(--on-accent); border-color: var(--accent-ink); background: var(--accent); color: var(--on-accent); }
.chip, .fx { flex: none; }
.ghost-add { display: flex; flex-direction: column; align-items: stretch; gap: 12px; width: 100%; text-align: start; }
.ghost-add-copy { display: flex; align-items: flex-start; gap: 12px; }
.ghost-add-action { align-self: flex-start; }
.bound-acts .record-action-item > .act.big { width: 100%; }
.pa-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.pa-actions .btn { width: max-content; max-width: 100%; flex: 0 0 auto; white-space: nowrap; }
.note-tools { margin-bottom: 6px; }
.viewer-top { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin-bottom: 8px; }
.viewer-file-data { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; }
.viewer-file-data .v-name { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-head-actions { align-self: flex-start; }
.pair-provider-row { padding: 8px 0; border-bottom: .5px solid var(--hair); }
.pair-provider-row:last-child { border-bottom: 0; }
.pair-provider-info { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.pair-provider-name { overflow-wrap: anywhere; }
.pair-provider-actions, .primary-picker-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pair-provider-actions > .btn, .primary-picker-actions > .btn {
  width: max-content; max-width: 100%; flex: 0 0 auto; white-space: nowrap;
}
.primary-picker-controls { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 0; }
.primary-picker-controls label { flex: 0 0 auto; min-width: 86px; font-size: 13.5px; color: var(--ink2); font-weight: 600; }
.primary-picker-controls select { flex: 1 1 auto; min-width: 0; width: auto; }
.selbar { flex-wrap: wrap; }
.selbar .btn.primary { flex: 0 0 auto; }
.card h3.choice-section-subtitle { margin: 16px 0 8px; color: var(--ink); font-size: 14px; font-weight: 600; letter-spacing: 0; }
.mem-item { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.mem-actions { width: max-content; max-width: 100%; margin-left: 27px; }
.tagbox { display: flex; flex-flow: row wrap; align-items: flex-start; gap: 7px; min-width: 0; }
.tagbox .chip.off { background: var(--bg); color: var(--ink2); }
.tagbox .task-tag-toggle { width: auto; max-width: 100%; min-width: 0; }
.task-tag-toggle:not(.off) { color: var(--ink); }
.task-tag-name { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-tag-remove { flex: none; font-size: 17px; line-height: 1; }
.tagbox #tmNewTag { flex: none; }
.att-row { display: flex; flex-direction: column; gap: 7px; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.sheet-actions > .btn { width: max-content; max-width: 100%; flex: 0 0 auto; white-space: nowrap; }
.mcp-revoke-actions { flex-direction: column; align-items: flex-start; }
.notif-actions { display: grid; gap: 10px; margin-top: 20px; }
.notif-action-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.notif-actions > .btn, .notif-action-pair .btn { min-width: 0; white-space: nowrap; padding-inline: 8px; }
.w12-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.w12-actions > button, .w12-actions > .btn, .w12-actions > .chip, .w12-actions > .link-btn {
  width: max-content; max-width: 100%; min-width: 0; flex: 0 0 auto; white-space: nowrap;
}
.w12-actions.w12-one-col { flex-direction: column; align-items: flex-start; }
.notif-actions > .btn, .notif-action-pair .btn { min-width: 0; white-space: nowrap; padding-inline: 8px; }
.perm-choice { margin-top: 10px; }
.perm-choice > .howto { margin-top: 0; }
.perm-choice-action { display: flex; justify-content: flex-end; margin-top: 8px; }
.perm-choice-action .perm-grant-action { width: auto; max-width: 100%; flex: 0 0 auto; justify-content: center; white-space: nowrap; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--accent-ink); border-radius: 10px;
}
.q-opts { display: flex; flex-direction: column; gap: 6px; margin-top: 6px;
  width: 100%; max-width: 100%; align-self: flex-start; }
.q-opt { display: flex; align-items: center; justify-content: flex-start; width: 100%; max-width: 100%; min-width: 0;
  text-align: left; font-size: 14px; font-weight: 500; white-space: normal; overflow-wrap: anywhere;
  padding: 11px 14px; border-radius: 14px; color: var(--ink); background: var(--card); border: 1px solid var(--line-control);
  box-shadow: var(--shadow-1); line-height: 1.4; }
.q-option-item.chosen .data-action-copy { color: var(--accent-ink); font-weight: 700; }
.q-option-item { width: 100%; }
.starters { display: flex; flex-direction: column; gap: 6px; margin-top: 10px;
  width: 100%; max-width: 100%; align-self: flex-start; }
.starter { display: flex; align-items: center; justify-content: flex-start; width: 100%; max-width: 100%; min-width: 0;
  text-align: left; font-size: 14px; font-weight: 500; line-height: 1.4; white-space: normal; overflow-wrap: anywhere;
  padding: 11px 14px; border-radius: 14px; color: var(--ink); background: var(--card); border: 1px solid var(--line-control); }
.cal-card .cal-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.ob3-proposal-item { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; min-width: 0; }
.ob3-proposal { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: max-content;
  max-width: 100%; padding: 8px 14px; text-align: center; color: var(--accent-ink); --accent-soft: var(--card); background: var(--accent-soft);
  border: 1px solid var(--line-control); border-radius: 18px; white-space: nowrap; }
.ob3-proposal-item .ob3-proposal {
  background: var(--card); border: 1px solid var(--ink);
}
.ob3-proposal-copy { font-weight: 500; }
.backlinks { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.folder-row { margin-top: 8px; }
@media (max-width: 560px) {
  .sheet-actions { display: grid; grid-template-columns: repeat(2, max-content); }
  .pa-actions, .pair-provider-actions { display: grid; grid-template-columns: repeat(2, max-content); }
  .mcp-revoke-actions { grid-template-columns: max-content; }
  .w12-actions { display: grid; grid-template-columns: repeat(2, max-content); justify-content: start; }
  .w12-actions.w12-one-col { grid-template-columns: max-content; }
  .selbar.w12-actions { justify-content: center; }
}

html[data-leaving] body > :not(#accountLeaveStatus),
html[data-leaving] body > :not(#accountLeaveStatus) * {
  display: none !important;
}
#accountLeaveStatus {
  box-sizing: border-box;
  width: min(620px, calc(100% - 32px));
  margin: 12vh auto 24px;
  padding: 22px 24px;
  color: var(--ink, #292522);
  background: var(--card, #fffaf4);
  border: 1px solid var(--line-control, #cfc2b6);
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(35, 25, 18, .16);
  font: 15px/1.55 system-ui, sans-serif;
}
#accountLeaveStatus[hidden] { display: none !important; }
#accountLeaveStatus .account-leave-message { margin: 0; font-weight: 650; }
#accountLeaveStatus .account-leave-help,
#accountLeaveStatus .account-leave-session { margin: 10px 0 0; color: var(--ink2, #5c534b); }
#accountLeaveStatus .account-leave-retry { margin-top: 16px; min-height: 42px; }
#accountLeaveStatus .account-leave-retry:disabled { cursor: wait; opacity: .62; }

/* Prompt actions must be readable in full before sending. Other chips stay compact. */
.chip[data-prompt-chip] {
  white-space: normal;
  max-width: 100%;
  text-align: left;
  overflow-wrap: anywhere;
  border-radius: 999px;
}
.chip[data-prompt-chip][data-prompt-wrapped] { border-radius: 16px; }

.pa-actions .btn:disabled { opacity: .48; cursor: not-allowed; }

/* C4: the Tasks add menu keeps the task and list choices together above the FAB. */
.lc-task-menu {
  position: fixed; z-index: 31; right: max(16px, calc(50% - var(--app-w) / 2 + 16px));
  bottom: calc(160px + var(--sab)); width: min(250px, calc(100vw - 40px));
  background: var(--card); color: var(--ink); border: 1px solid var(--line-control);
}
.lc-task-menu button {
  display: block; width: 100%; min-height: 68px; padding: 11px 16px; text-align: left;
  color: var(--ink); background: var(--card); border: 0; border-bottom: 1px solid var(--line);
}
.lc-task-menu button:last-child { border-bottom: 0; }
.lc-task-menu b { display: block; font-weight: 600; }
.lc-task-menu small { display: block; color: var(--ink2); font-size: 12.5px; line-height: 1.4; }

/* Full-screen list creator follows the approved C4 screen proportions and existing app tokens. */
#modal.overlay.full > .sheet-card.list-creator-screen {
  display: flex; flex-direction: column; width: 100%; max-width: var(--app-w); min-height: 100dvh;
  max-height: none; padding: 0; overflow-x: hidden; overflow-y: auto; border-radius: 0;
  background: var(--bg); color: var(--ink); box-shadow: none; animation: none;
}
.list-creator-screen .lc-bar {
  display: flex; align-items: center; gap: 8px; flex: 0 0 auto;
  padding: max(44px, calc(env(safe-area-inset-top) + 24px)) 16px 12px;
  border-bottom: 1px solid var(--line);
}
.list-creator-screen .lc-bar h2 {
  flex: 1; min-width: 0; margin: 0; text-align: center; font-size: 17px;
  font-weight: 600; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lc-bar-button {
  flex: 0 0 56px; min-width: 56px; min-height: 44px; padding: 0; color: var(--ink);
  background: transparent; border: 0; font: inherit; font-size: 15px;
}
.lc-align-left { text-align: left; }
.lc-align-right { text-align: right; font-weight: 600; }
.lc-body { flex: 1 0 auto; min-height: 0; padding: 16px 20px; }
.lc-label {
  display: block; margin: 18px 0 6px; color: var(--ink2); font-size: 13px; font-weight: 600;
}
.lc-body > .lc-label:first-child { margin-top: 0; }
.lc-input {
  display: block; width: 100%; min-height: 48px; padding: 12px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line-control); border-radius: 0; font: inherit;
}
.lc-input::placeholder { color: var(--ink3); opacity: 1; }
.lc-input.invalid { border: 2px solid var(--danger); }
.lc-error { margin: 6px 0 0; color: var(--danger); font-size: 13px; }
.lc-fields-label { margin-top: 18px; }
.lc-field-row {
  display: flex; align-items: center; gap: 10px; min-height: 52px;
  border-bottom: 1px solid var(--line);
}
.lc-field-name { flex: 1; min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.lc-field-type { flex: 0 0 auto; color: var(--ink2); font-size: 13px; }
.lc-remove, .lc-option-remove {
  min-width: 44px; min-height: 44px; padding: 0; color: var(--ink2); background: transparent;
  border: 0; font: inherit; font-size: 18px;
}
.lc-link {
  min-height: 44px; padding: 0; color: var(--ink); background: transparent; border: 0;
  font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 4px;
}
.lc-help { margin: 6px 0 0; color: var(--ink2); font-size: 13px; }
.lc-type-segmented {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line-control);
}
.lc-type-button {
  min-width: 0; min-height: 44px; padding: 8px 2px; color: var(--ink); background: transparent;
  border: 0; border-left: 1px solid var(--line-control); font: inherit; font-size: 14px;
}
.lc-type-button:first-child { border-left: 0; }
.lc-type-button.selected, .lc-chip.selected {
  --accent-ink: var(--on-accent); color: var(--on-accent); background: var(--accent); font-weight: 600;
}
.lc-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lc-chip {
  display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 7px 14px;
  color: var(--ink); background: var(--bg); border: 1px solid var(--line-control);
  font: inherit; font-size: 14px;
}
.lc-chip.selected { border-color: var(--accent-ink); }
.lc-option-chip { padding-right: 2px; }
.lc-option-remove { min-width: 26px; width: 26px; min-height: 26px; font-size: 16px; }
.lc-option-add { border-style: dashed; }
.lc-option-draft-row { display: flex; align-items: center; gap: 10px; width: 100%; margin: 8px 0; }
.lc-option-draft-row .lc-input { flex: 1; min-width: 0; }
.lc-created-status {
  flex: 0 0 auto; margin: 12px 20px 0; padding: 10px 14px;
  color: var(--ink); background: transparent; border: 1px solid var(--line-control);
  font-size: 14px; font-weight: 600;
}
.lc-list-body { display: flex; flex-direction: column; }
.lc-empty-state { padding: 48px 12px; text-align: center; }
.lc-empty-state h3 { margin: 0 0 6px; font-size: 18px; }
.lc-empty-state p { margin: 0 0 18px; color: var(--ink2); font-size: 14px; }
.lc-empty-state .btn { width: 100%; min-height: 50px; font-size: 16px; }
.lc-table-scroll { position: relative; min-width: 0; overflow-x: auto; margin: 0 -6px; }
.lc-table-scroll.has-scroll-cue .lc-table { min-width: 520px; }
.lc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.lc-table th {
  padding: 8px 6px; color: var(--ink2); border-bottom: 1px solid var(--ink);
  text-align: left; font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.lc-table td { padding: 12px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lc-select-pill {
  display: inline-block; padding: 2px 8px; color: var(--on-accent); background: var(--accent);
  font-size: 12.5px; font-weight: 600;
}
.lc-scroll-cue {
  position: sticky; float: right; right: 0; top: 0; display: flex; align-items: center; justify-content: center;
  width: 26px; height: 100%; min-height: 52px; margin-left: -26px; color: var(--ink2);
  background: linear-gradient(90deg, transparent, var(--bg)); font-size: 27px; pointer-events: none;
}
.lc-foot { margin: auto -20px -16px; padding: 12px 20px calc(34px + var(--sab)); border-top: 1px solid var(--line); }
.lc-foot .btn { width: 100%; min-height: 50px; }
.lc-record-body { overflow-y: auto; }
.lc-record-field { margin: 0 0 18px; }
.lc-record-field .lc-label { margin-top: 0; }
.lc-record-field input[type="file"] { max-width: 100%; }
.lc-date-picker { margin: 8px 0 0; padding: 10px; border: 1px solid var(--ink); border-radius: 0; box-shadow: none; }
.lc-date-picker h3 { margin: 0 0 8px; color: var(--ink); font-size: 15px; letter-spacing: 0; }
.lc-date-picker .cal-nav { flex-wrap: nowrap; gap: 2px; }
.lc-date-picker .calnav { min-width: 44px; min-height: 44px; padding: 0; color: var(--ink); }
.lc-date-picker .calgrid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.lc-date-picker .calw { padding: 4px 0; color: var(--ink2); }
.lc-date-picker button.cal {
  width: 100%; min-width: 0; min-height: 40px; padding: 6px 0; color: var(--ink2);
  background: transparent; border: 2px solid transparent; border-radius: 0; font: inherit; font-size: 14px;
}
.lc-date-picker button.cal.today { border-color: var(--ink); color: var(--ink); font-weight: 700; }
.lc-date-picker button.cal.selected { color: var(--on-accent); background: var(--accent); font-weight: 700; }
/* TODO_KONO: dark selected-day border + dark error colour pending Kono (mock RECEIPT P2) */
[data-theme="dark"] .lc-date-picker button.cal.selected { border-color: var(--ink); }
[data-theme="dark"] .lc-error { color: var(--danger); }
.lc-settings-item { justify-content: space-between; }
