:root {
  --ink: #17202E;
  --muted: #5E6673;
  --faint: #8B929C;
  --line: #E2E4DE;
  --wash: #F1F2EE;
  --paper: #FFFFFF;
  --accent: #1E6A55;
  --accent-ink: #FFFFFF;
  --accent-wash: #E3EEE8;
  --wait: #8F6512;
  --wait-wash: #F6EDD9;
  --block: #A23B2A;
  --block-wash: #F6E2DD;
  --focus: #2D7FF9;
  --ui: "Schibsted Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --read: "Source Serif 4", Georgia, "Times New Roman", serif;
  --r-sm: 6px;
  --r-md: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #E8EAE6; --muted: #A4ABA6; --faint: #7D847F; --line: #2C3330; --wash: #141917; --paper: #1B211F;
    --accent: #5DBB9A; --accent-ink: #0E1512; --accent-wash: #1F3029; --wait: #E1B45C; --wait-wash: #33291A;
    --block: #EE8A78; --block-wash: #3A221D; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--wash); color: var(--ink); font: 400 15px/1.55 var(--ui);
  -webkit-font-smoothing: antialiased; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 .6em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: var(--wash); padding: 1px 5px; border-radius: 4px; }
.boot, .fatal { max-width: 520px; margin: 18vh auto; padding: 0 24px; color: var(--muted); }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; background: var(--wash); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; padding: 0 10px 20px; font-size: 15px; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; flex: none; }
.nav a { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--paper); }
.nav a[aria-current="page"] { background: var(--paper); box-shadow: inset 2px 0 0 var(--accent); }
.nav .count { background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 600; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px; }
.nav-new { margin-bottom: 10px; }
.side-foot { margin-top: auto; padding: 10px; font-size: 13px; color: var(--muted); }
.side-foot button { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
main.content { padding: 40px 48px 80px; min-width: 0; }
.page { max-width: 820px; margin: 0 auto; }
.page.wide { max-width: 980px; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding: 10px; border-right: 0; border-bottom: 1px solid var(--line); gap: 4px; align-items: center; }
  .brand { padding: 0 8px 0 4px; }
  .brand span { display: none; }
  .nav { display: contents; }
  .nav a { white-space: nowrap; }
  .nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }
  .nav-new { margin: 0; }
  .side-foot { display: none; }
  main.content { padding: 24px 16px 64px; }
}

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--paper); padding: 8px 14px; border-radius: var(--r-sm); cursor: pointer; font-weight: 500; text-decoration: none; color: var(--ink); line-height: 1.3; }
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--muted); padding-left: 8px; padding-right: 8px; }
.btn.quiet:hover { color: var(--ink); background: var(--wash); }
.btn.danger { color: var(--block); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: default; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
label.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
label.field > small, .hint { display: block; color: var(--muted); font-size: 13px; margin: -2px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--paper); border-radius: var(--r-sm); padding: 9px 11px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--muted); font-size: 14px; user-select: none; }
.switch input { width: 34px; height: 20px; appearance: none; background: var(--line); border-radius: 10px; position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(14px); }

/* ---------- home ---------- */
.ask-title { font-family: var(--read); font-weight: 400; font-size: clamp(30px, 4.2vw, 42px); letter-spacing: -0.02em; margin: 6vh 0 20px; }
.composer { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px; }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.composer textarea { border: 0; box-shadow: none !important; font-size: 17px; min-height: 110px; padding: 12px 12px 6px; background: transparent; }
.composer-bar { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 8px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--wash); border: 1px solid var(--line); border-radius: 999px; padding: 3px 6px 3px 10px; font-size: 13px; max-width: 260px; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--muted); width: 20px; height: 20px; border-radius: 50%; line-height: 1; }
.chip button:hover { background: var(--line); color: var(--ink); }
.notice { display: flex; gap: 12px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--wait); border-radius: var(--r-sm); padding: 10px 14px; margin-bottom: 18px; font-size: 14px; }
.notice .spacer { flex: 1; }
.section { margin-top: 40px; }
.section > h2 { margin-bottom: 10px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.section-head h2 { margin: 0; }
.section-head a { font-size: 14px; }
.starters { display: flex; flex-wrap: wrap; gap: 8px; }
.starters button { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; cursor: pointer; font-size: 14px; }
.starters button:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- lists ---------- */
.list { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.list > a, .list > .item { display: flex; gap: 14px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.list > :first-child { border-top: 0; }
.list > a:hover { background: var(--wash); }
.item-main { flex: 1; min-width: 0; }
.item-title { display: block; font-weight: 500; }
.item-sub { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-meta { color: var(--faint); font-size: 13px; white-space: nowrap; }
.tag { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.tag.on { color: var(--accent); border-color: var(--accent-wash); background: var(--accent-wash); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.group-label { font-size: 13px; font-weight: 600; color: var(--muted); margin: 26px 0 8px; }

/* status */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.s-COMPLETED { color: var(--accent); background: var(--accent-wash); }
.s-WAITING_APPROVAL { color: var(--wait); background: var(--wait-wash); }
.s-BLOCKED, .s-ESCALATED, .s-FAILED { color: var(--block); background: var(--block-wash); }
.s-RUNNING, .s-CONTINUED { color: var(--muted); background: var(--wash); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--faint); }
.dot.s-COMPLETED { background: var(--accent); } .dot.s-WAITING_APPROVAL { background: var(--wait); }
.dot.s-BLOCKED, .dot.s-ESCALATED, .dot.s-FAILED { background: var(--block); }

/* ---------- jobs ---------- */
.toolbar { display: flex; gap: 10px; margin: 18px 0 6px; flex-wrap: wrap; }
.toolbar input[type=search] { flex: 1; min-width: 200px; }
.toolbar select { width: auto; min-width: 200px; }
.lede { color: var(--muted); margin-top: 6px; }
.back { display: inline-block; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 14px; }
.back:hover { color: var(--ink); }
.facts { display: grid; grid-template-columns: 150px 1fr; gap: 10px 20px; margin: 22px 0; }
.facts dt { color: var(--muted); font-size: 14px; }
.facts dd { margin: 0; }
.facts ul { margin: 0; padding-left: 18px; }
@media (max-width: 600px) { .facts { grid-template-columns: 1fr; gap: 2px; } .facts dd { margin-bottom: 10px; } }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; }
details.more { border-top: 1px solid var(--line); }
details.more:last-of-type { border-bottom: 1px solid var(--line); }
details.more > summary { cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
details.more > summary::after { content: "+"; color: var(--muted); font-weight: 400; }
details.more[open] > summary::after { content: "−"; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > .body { padding: 0 0 18px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { position: relative; padding: 8px 0 8px 36px; border-top: 1px solid var(--line); font-size: 14px; }
.steps li:first-child { border-top: 0; }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--wash); display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--muted); }
.steps b { display: block; }
.steps small { color: var(--muted); }
.mini-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mini-table th, .mini-table td { text-align: left; padding: 8px 8px 8px 0; border-top: 1px solid var(--line); vertical-align: top; }
.mini-table th { font-weight: 600; color: var(--muted); font-size: 13px; border-top: 0; }

/* ---------- run ---------- */
.run-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.run-headline { font-family: var(--read); font-weight: 400; font-size: clamp(24px, 3.2vw, 32px); line-height: 1.25; letter-spacing: -0.015em; margin: 12px 0 10px; }
.run-summary { font-size: 16px; color: var(--ink); max-width: 68ch; }
.next-step { margin-top: 14px; padding: 12px 14px; background: var(--accent-wash); border-radius: var(--r-sm); font-size: 15px; }
.next-step b { font-weight: 600; }
.box { border-radius: var(--r-md); padding: 16px 18px; margin-top: 22px; border: 1px solid var(--line); background: var(--paper); }
.box.wait { border-color: color-mix(in srgb, var(--wait) 35%, var(--line)); }
.box.block { border-color: color-mix(in srgb, var(--block) 35%, var(--line)); }
.box > h2 { margin-bottom: 10px; }
.need { padding: 10px 0; border-top: 1px solid var(--line); }
.need:first-of-type { border-top: 0; }
.need b { display: block; }
.need small { display: block; color: var(--muted); }
.approval { padding: 12px 0; border-top: 1px solid var(--line); }
.approval:first-of-type { border-top: 0; }
.approval .row { margin-top: 8px; }
.risk { font-size: 12px; font-weight: 600; }
.risk-high { color: var(--block); } .risk-medium { color: var(--wait); } .risk-low { color: var(--accent); }
.doc-bar { display: flex; align-items: center; gap: 6px; margin: 32px 0 8px; flex-wrap: wrap; }
.doc-bar h2 { margin-right: auto; }
.doc { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: clamp(22px, 4vw, 44px) clamp(18px, 5vw, 56px); }
/* Deliverable: formatted like a chat assistant answer */
.prose { font-family: var(--ui); font-size: 16px; line-height: 1.72; color: var(--ink); max-width: 72ch; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0 !important; }
.prose h2 { font-size: 21px; font-weight: 650; margin: 1.9em 0 .55em; letter-spacing: -0.01em; }
.prose h3 { font-size: 17.5px; font-weight: 650; margin: 1.6em 0 .45em; }
.prose h4, .prose h5, .prose h6 { font-size: 16px; font-weight: 650; margin: 1.4em 0 .4em; }
.prose p { margin: 0 0 1em; }
.prose strong { font-weight: 650; }
.prose mark { background: var(--wait-wash); color: inherit; padding: 0 2px; border-radius: 3px; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.45em; }
.prose li { margin: .38em 0; padding-left: .2em; }
.prose li > ul, .prose li > ol { margin: .35em 0 .2em; }
.prose li::marker { color: var(--accent); font-weight: 600; }
.prose li.task { list-style: none; margin-left: -1.3em; }
.prose blockquote { margin: 1.2em 0; padding: 12px 16px; background: var(--accent-wash); border-left: 3px solid var(--accent); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--ink); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose blockquote.callout-warning, .prose blockquote.callout-caution, .prose blockquote.callout-important { background: var(--wait-wash); border-left-color: var(--wait); }
.prose pre { background: #1F2622; color: #E7ECE8; padding: 14px 16px; border-radius: var(--r-md); overflow-x: auto; font-size: 13px; line-height: 1.55; margin: 0 0 1.1em; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose code { background: var(--wash); border: 1px solid var(--line); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose img { max-width: 100%; border-radius: var(--r-sm); }
.prose a { word-break: break-word; }
.table-wrap { overflow-x: auto; margin: 0 0 1.2em; border: 1px solid var(--line); border-radius: var(--r-md); }
.prose table { border-collapse: collapse; font-size: 14.5px; line-height: 1.5; width: 100%; }
.prose th, .prose td { padding: 9px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { background: var(--wash); font-weight: 650; white-space: nowrap; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--wash) 45%, transparent); }
.prose.streaming > :last-child::after { content: ""; display: inline-block; width: 8px; height: 1.1em; margin-left: 2px; vertical-align: -0.15em; background: var(--accent); border-radius: 1px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.prose[contenteditable="true"] { outline: none; }
.editing .doc { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.edit-tools { display: flex; gap: 4px; flex-wrap: wrap; position: sticky; top: 0; z-index: 2; background: var(--paper); padding: 6px; border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 8px; }
.edit-tools button { border: 0; background: transparent; padding: 5px 9px; border-radius: 5px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.edit-tools button:hover { background: var(--wash); color: var(--ink); }
.inline-md strong { font-weight: 650; }
.revise { display: flex; gap: 8px; margin-top: 12px; }
.revise input { flex: 1; }
.edit-area { width: 100%; min-height: 60vh; font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: flex; gap: 10px; padding: 6px 0; font-size: 14px; }
.checks .r { font-weight: 600; width: 92px; flex: none; font-size: 12px; padding-top: 2px; }
.r-PASS { color: var(--accent); } .r-FAIL { color: var(--block); } .r-NOT_TESTED { color: var(--faint); }
.meta-grid { display: grid; grid-template-columns: 130px 1fr; gap: 6px 16px; font-size: 14px; }
.meta-grid dt { color: var(--muted); }
.meta-grid dd { margin: 0; overflow-wrap: anywhere; }

/* working */
.working { margin-top: 26px; }
.working .phase { display: flex; align-items: center; gap: 12px; padding: 7px 0; color: var(--faint); transition: color .3s; }
.working .phase.on { color: var(--ink); font-weight: 500; }
.working .phase.done { color: var(--muted); }
.working .mark { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; flex: none; position: relative; }
.working .phase.done .mark { background: var(--accent); border-color: var(--accent); }
.working .phase.on .mark { border-color: var(--accent); border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .working .phase.on .mark { animation: none; border-right-color: var(--accent); } }

/* auth */
.auth { max-width: 420px; margin: 10vh auto; padding: 0 20px; }
.auth h1 { font-family: var(--read); font-weight: 400; font-size: 34px; margin-bottom: 8px; }
.auth .panel { margin-top: 22px; }
.err { color: var(--block); font-size: 14px; margin: 8px 0; min-height: 1em; }

/* toast */
#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--r-sm); opacity: 0; pointer-events: none; transition: all .2s; font-size: 14px; max-width: 90vw; z-index: 50; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--block); color: #fff; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 20px 0; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 12px; cursor: pointer; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }
.copybox { display: flex; gap: 8px; }
.copybox input { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
label.field > span.switch { display: inline-flex; font-weight: 500; color: var(--ink); }
.nav a { gap: 8px; }

/* ---------- loading feedback ---------- */
#topbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity .2s; }
#topbar.on { opacity: 1; }
#topbar::before { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; background: var(--accent); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { to { left: 100%; } }
.spin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; vertical-align: -2px; flex: none; }
.btn .spin { width: 13px; height: 13px; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 40px 0; }
.loading .spin { width: 18px; height: 18px; color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .spin, #topbar::before { animation-duration: 2.4s; } .prose.streaming > :last-child::after { animation: none; } }
.phase-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; margin: 14px 0 4px; }
.phase-line .spin { color: var(--accent); }
.phase-done { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--faint); }
.phase-done span::before { content: "✓ "; color: var(--accent); }
.side-foot .ver { display: block; margin-top: 8px; color: var(--faint); font-size: 12px; }

/* ---------- integrations ---------- */
.mono { width: 36px; height: 36px; border-radius: 9px; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; letter-spacing: .02em; }
.mono.lg { width: 48px; height: 48px; font-size: 16px; border-radius: 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink); }
.card:hover { border-color: var(--faint); }
.card .top { display: flex; gap: 12px; align-items: center; }
.card .name { font-weight: 600; }
.card .cat { font-size: 12.5px; color: var(--muted); }
.card p { font-size: 14px; color: var(--muted); margin: 0; flex: 1; }
.card .go { font-size: 14px; font-weight: 600; color: var(--accent); }
.int-head { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.stepper { list-style: none; margin: 18px 0 0; padding: 0; counter-reset: st; }
.stepper > li { border: 1px solid var(--line); background: var(--paper); border-radius: var(--r-md); margin-bottom: 10px; }
.stepper > li > button.st-head { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; cursor: pointer; font-weight: 600; }
.stepper > li > button.st-head:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: var(--r-md); }
.st-num { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 12px; color: var(--muted); flex: none; }
.stepper li.done .st-num { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.stepper li.current .st-num { border-color: var(--accent); color: var(--accent); }
.stepper li.done .st-title { color: var(--muted); }
.st-body { padding: 0 16px 16px 54px; }
.st-body .prose { font-size: 15px; }
.st-body .prose pre { font-size: 12px; max-height: 320px; }
.st-actions { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.result { margin-top: 12px; padding: 10px 14px; border-radius: var(--r-sm); font-size: 14px; }
.result.ok { background: var(--accent-wash); color: var(--accent); }
.result.bad { background: var(--block-wash); color: var(--block); }
.preview-box { max-height: 360px; overflow: auto; background: var(--wash); border-radius: var(--r-sm); padding: 12px; font: 12px/1.5 ui-monospace, Menlo, monospace; white-space: pre-wrap; margin-top: 10px; }
.chat { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.bubble { max-width: 92%; padding: 12px 16px; border-radius: 14px; }
.bubble.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.bubble.ai { align-self: flex-start; background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.ai .prose { font-size: 15px; }
.chat-input { display: flex; gap: 8px; align-items: flex-end; }
.chat-input textarea { min-height: 52px; flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; margin-bottom: 16px; flex-wrap: wrap; }
.seg button { border: 0; background: var(--paper); padding: 8px 14px; cursor: pointer; font-weight: 500; color: var(--muted); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--accent-wash); color: var(--accent); }
.checks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; }
.checks-grid label { display: flex; gap: 8px; font-size: 14px; align-items: center; }
.versions .item { font-size: 14px; }
.copyline { display: flex; gap: 8px; align-items: center; background: var(--wash); border-radius: var(--r-sm); padding: 8px 10px; font-size: 13px; }
.copyline code { flex: 1; overflow-x: auto; white-space: nowrap; background: none; border: 0; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--faint); }
.status-dot.connected { background: var(--accent); } .status-dot.error { background: var(--block); }
.tag.bad { color: var(--block); border-color: var(--block-wash); background: var(--block-wash); }

/* ================= v1.2: icons, colour, calmer layout ================= */
.ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.btn .ic { width: 16px; height: 16px; margin: 0 -1px; }
.btn.small .ic { width: 14px; height: 14px; }
.tag { display: inline-flex; align-items: center; gap: 5px; }
.tag .ic { width: 13px; height: 13px; }
.switch .ic { width: 15px; height: 15px; margin-right: -3px; }

/* sidebar */
.side { background: linear-gradient(180deg, var(--paper) 0%, var(--wash) 100%); }
.nav-l { display: inline-flex; align-items: center; gap: 11px; }
.nav a .ic { width: 19px; height: 19px; color: var(--faint); transition: color .15s; }
.nav a:hover .ic { color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-wash); box-shadow: none; color: var(--accent); }
.nav a[aria-current="page"] .ic { color: var(--accent); }
.nav-new { background: var(--accent); color: var(--accent-ink) !important; }
.nav-new .ic { color: var(--accent-ink) !important; }
.nav-new:hover { background: var(--accent) !important; filter: brightness(1.08); }
.nav-new[aria-current="page"] { background: var(--accent) !important; color: var(--accent-ink) !important; }
.side-foot { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.side-foot .who { display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--ink); font-weight: 500; }
.side-foot .who span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-wash); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.side-foot #logout { text-decoration: none; width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; }
.side-foot #logout:hover { background: var(--wash); color: var(--ink); }
.side-foot .ver { grid-column: 1 / -1; margin: 0; }

/* page header */
.ph { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.ph h1 { font-size: 24px; }
.ph-ic { --ac: var(--accent); width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none;
  color: var(--ac); background: color-mix(in srgb, var(--ac) 13%, var(--paper)); }
.ph-ic .ic { width: 20px; height: 20px; }
.ph-ic.sm { width: 30px; height: 30px; border-radius: 8px; }
.ph-ic.sm .ic { width: 16px; height: 16px; }
.ph + .lede { margin-top: -6px; margin-bottom: 4px; }

/* area badges */
.abadge { --ac: var(--accent); width: 32px; height: 32px; border-radius: 8px; display: inline-grid; place-items: center; flex: none;
  color: var(--ac); background: color-mix(in srgb, var(--ac) 12%, var(--paper)); }
.abadge .ic { width: 17px; height: 17px; }
.abadge.sm { width: 24px; height: 24px; border-radius: 6px; }
.abadge.sm .ic { width: 14px; height: 14px; }
.abadge.xs { width: 18px; height: 18px; border-radius: 5px; background: none; }
.abadge.xs .ic { width: 13px; height: 13px; }
.group-label { display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: 14px; }
.group-label .cnt { color: var(--faint); font-weight: 500; font-size: 12.5px; }
.starters button { display: inline-flex; align-items: center; gap: 8px; padding: 5px 13px 5px 6px; }
.st-txt { font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--muted); }
.st-txt.s-COMPLETED { color: var(--accent); } .st-txt.s-WAITING_APPROVAL { color: var(--wait); }
.st-txt.s-BLOCKED, .st-txt.s-ESCALATED, .st-txt.s-FAILED { color: var(--block); }
@media (max-width: 600px) { .list .item-meta { display: none; } }

/* home */
.ask-title { margin-top: 4vh; }
.notice { gap: 10px; border-left-width: 1px; }
.notice > .ic { color: var(--wait); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.tile { --ac: var(--accent); display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); text-decoration: none; color: var(--ink); border-top: 3px solid var(--ac); }
.tile:hover { border-color: var(--ac); }
.tile .ic { grid-row: 1 / 3; width: 22px; height: 22px; color: var(--ac); }
.tile b { font-size: 22px; line-height: 1.1; }
.tile span { font-size: 12.5px; color: var(--muted); }
@media (max-width: 520px) { .tiles { grid-template-columns: 1fr 1fr 1fr; gap: 6px; } .tile { grid-template-columns: 1fr; padding: 10px; } .tile .ic { grid-row: auto; margin-bottom: 4px; } }

/* job page */
.meta-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.fact-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.fcard { display: flex; gap: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; }
.fcard > .ic { color: var(--accent); margin-top: 2px; }
.fcard b { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.fcard p { margin: 0; font-size: 14.5px; }
@media (max-width: 600px) { .fact-cards { grid-template-columns: 1fr; } }
.panel > textarea { border: 0; padding: 0; box-shadow: none !important; min-height: 60px; }

/* run page */
.run-head .abadge { margin-right: 2px; }
.next-step { display: flex; gap: 10px; align-items: flex-start; border-left: 3px solid var(--accent); }
.next-step > .ic { color: var(--accent); margin-top: 2px; }
.box-h { display: flex; align-items: center; gap: 8px; }
.box.wait .box-h .ic { color: var(--wait); }
.box.block .box-h .ic { color: var(--block); }
.box.wait { border-top: 3px solid var(--wait); }
.box.block { border-top: 3px solid var(--block); }
.doc { border-top: 3px solid var(--accent); }
.doc-bar h2 { display: flex; align-items: center; gap: 8px; }
.a.from, .hint.from { display: inline-block; margin-top: 6px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 16px; color: var(--muted); }
.empty-state > .ic { width: 34px; height: 34px; color: var(--accent); background: var(--accent-wash); border-radius: 50%; padding: 7px; box-sizing: content-box; }
.empty-state b { color: var(--ink); font-size: 16px; }

/* integrations */
.card { border-top: 3px solid transparent; }
.card:hover { border-top-color: var(--accent); }
.card .go { display: inline-flex; align-items: center; gap: 2px; }
.card .go .ic { width: 15px; height: 15px; }
.unlocks { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; color: var(--muted); }
.unlocks .ic { color: var(--wait); margin-top: 2px; }
.custom-cta { display: flex; gap: 14px; align-items: flex-start; }
.custom-cta .chat-input textarea { min-height: 42px; }
.back { display: inline-flex; align-items: center; gap: 6px; }
.back .ic { width: 15px; height: 15px; }

/* ================= AI helper ================= */
.ai-fab { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px 11px 14px; border-radius: 999px; border: 0; cursor: pointer; font-weight: 600; color: var(--accent-ink); background: var(--accent);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent), 0 1px 3px rgba(0,0,0,.15); }
.ai-fab .ic { width: 20px; height: 20px; }
.ai-fab:hover { filter: brightness(1.07); }
.ai-open .ai-fab { display: none; }
.ai-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100vw); z-index: 70; display: flex; flex-direction: column;
  background: var(--paper); border-left: 1px solid var(--line); box-shadow: -8px 0 30px rgba(20, 30, 40, .10); padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.ai-panel[hidden] { display: none; }
@media (min-width: 1240px) { body.ai-open .shell { margin-right: 400px; } body.ai-open .ai-panel { box-shadow: none; } }
.ai-head { display: flex; align-items: center; gap: 10px; padding: 14px 12px 14px 16px; border-bottom: 1px solid var(--line); }
.ai-ttl { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.ai-page { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); overflow: hidden; white-space: nowrap; }
.ai-page .ic { width: 13px; height: 13px; }
.ai-page span { overflow: hidden; text-overflow: ellipsis; }
.ai-icon { width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.ai-icon:hover { background: var(--wash); color: var(--ink); }
.ai-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--wash); }
.ai-msg { max-width: 92%; padding: 10px 14px; border-radius: 14px; font-size: 14.5px; }
.ai-msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.ai-msg.ai { align-self: flex-start; background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ai-msg .prose { font-size: 14.5px; line-height: 1.6; }
.ai-msg .prose h2, .ai-msg .prose h3 { font-size: 15px; margin: 1em 0 .3em; }
.ai-msg .prose ol, .ai-msg .prose ul { margin-bottom: .6em; }
.ai-msg .prose p:last-child { margin-bottom: 0; }
.ai-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 28px 10px 8px; color: var(--muted); font-size: 14px; }
.ai-empty > .ic { width: 30px; height: 30px; color: var(--accent); margin-bottom: 6px; }
.ai-empty b { color: var(--ink); font-size: 16px; }
.ai-sug { display: flex; flex-direction: column; gap: 6px; }
.ai-sug button { text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; cursor: pointer; font-size: 14px; color: var(--ink); }
.ai-sug button:hover { border-color: var(--accent); color: var(--accent); }
.ai-form { display: flex; gap: 8px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--line); background: var(--paper); }
.ai-form textarea { min-height: 42px; max-height: 140px; resize: none; border-radius: 12px; padding: 10px 12px; }
.ai-send { width: 42px; height: 42px; border-radius: 12px; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.ai-send[disabled] { opacity: .5; cursor: default; }
@media (max-width: 820px) { .ai-fab span { display: none; } .ai-fab { padding: 14px; } }
.count[hidden] { display: none; }
.st-txt { background: none !important; padding: 0; }
.area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 10px; }
.area-card { --ac: var(--accent); display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left;
  background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--ac); border-radius: var(--r-md); padding: 14px; cursor: pointer; color: var(--ink); font: inherit; }
.area-card:hover { border-color: var(--ac); }
.area-card .abadge { grid-row: 1 / 3; }
.area-card b { font-weight: 600; font-size: 14.5px; }
.area-card span { font-size: 12.5px; color: var(--muted); }

/* ================= v1.3 ================= */
.s-REVIEW { color: #3D5F92; background: #E2EAF5; }
.s-TO_DO { color: var(--wait); background: var(--wait-wash); }
.st-txt.s-REVIEW { color: #3D5F92; } .st-txt.s-TO_DO { color: var(--wait); }
@media (prefers-color-scheme: dark) { .s-REVIEW { color: #9DB8E6; background: #1F2A3B; } .st-txt.s-REVIEW { color: #9DB8E6; } }
.box.review { border-top: 3px solid #4A6FA5; }
.box.review .box-h .ic { color: #4A6FA5; }

/* clickable missing inputs */
.needs { display: grid; gap: 8px; }
.need-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); text-decoration: none; color: var(--ink); background: var(--paper); transition: border-color .15s; }
.need-card:hover { border-color: var(--block); }
.need-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--block-wash); color: var(--block); flex: none; }
.need-tx { flex: 1; min-width: 0; }
.need-tx b { display: block; font-weight: 600; }
.need-tx small { display: block; color: var(--muted); font-size: 13px; }
.need-go { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; color: var(--accent); white-space: nowrap; }
.need-go .ic { width: 14px; height: 14px; }
@media (max-width: 600px) { .need-card { flex-wrap: wrap; } .need-go { margin-left: 46px; } }

/* dashboard */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kpi { --ac: var(--accent); display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--ac); border-radius: var(--r-md); text-decoration: none; color: var(--ink); }
.kpi:hover { border-color: var(--ac); }
.kpi .ic { grid-row: 1 / 3; width: 26px; height: 26px; color: var(--ac); }
.kpi b { font-size: 26px; line-height: 1.1; font-weight: 700; }
.kpi span { font-size: 13px; color: var(--muted); }
.mini-kpis { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 14px 0 18px; font-size: 14px; color: var(--muted); }
.mini-kpis > * { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); text-decoration: none; }
.mini-kpis b { color: var(--ink); }
.mini-kpis .ic { color: var(--faint); width: 16px; height: 16px; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dash-grid .panel h2 { font-size: 15px; margin-bottom: 12px; }
.dash-grid .span2 { grid-column: 1 / -1; }
@media (max-width: 760px) { .kpis { grid-template-columns: 1fr 1fr; } .dash-grid { grid-template-columns: 1fr; } }
.chart { width: 100%; height: auto; display: block; }
.chart text { font-size: 10px; fill: var(--faint); font-family: var(--ui); }
.stack { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--wash); }
.stack span { display: block; height: 100%; }
.hbars { display: grid; gap: 9px; }
.hbar { display: grid; grid-template-columns: auto 150px 1fr 30px; align-items: center; gap: 10px; font-size: 13.5px; }
.hb-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-t { height: 8px; background: var(--wash); border-radius: 999px; overflow: hidden; }
.hb-t i { display: block; height: 100%; border-radius: 999px; }
.hbar b { text-align: right; font-weight: 600; }
.list.flat { border: 0; border-radius: 0; }
.list.flat > a, .list.flat > .item { padding: 10px 0; }
.list.flat > a:hover { background: transparent; }

/* jobs: design-your-own */
.build-cta { display: flex; gap: 14px; align-items: flex-start; padding: 16px; margin-bottom: 18px; background: var(--paper); border: 1px solid var(--line); border-left: 3px solid #6D5BD0; border-radius: var(--r-md); }
.build-in { flex: 1; min-width: 0; }
.build-in b { display: block; margin-bottom: 8px; }
.build-in .chat-input textarea { min-height: 42px; }

/* simple WordPress setup */
.easy-steps { list-style: none; margin: 12px 0 14px; padding: 0; display: grid; gap: 10px; }
.easy-steps li { display: flex; gap: 14px; align-items: flex-start; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; }
.easy-steps p { margin: 4px 0 10px; color: var(--muted); }
.easy-steps li > div > p:last-child { margin-bottom: 0; }
.es-n { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; flex: none; }
.wp-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
@media (max-width: 860px) { .wp-opts { grid-template-columns: 1fr; } }
.wp-opt { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.wp-opt:first-child { border-top: 3px solid var(--accent); }
.wp-opt-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wp-opt-h b { font-size: 16px; }
.wp-opt > p { margin: 0; color: var(--muted); }
.mini-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; }
.wp-opt details.more { border-bottom: 0; }

/* ================= v1.6: task layout like a chat app (sidebar | details | output) ================= */
.page.full { max-width: none; }
main.content.task-mode { padding: 0; }
.task { display: grid; grid-template-columns: minmax(360px, 1fr) minmax(420px, 1.25fr); height: 100vh; }
.task-mid { overflow-y: auto; padding: 26px 28px 90px; min-width: 0; }
.task-out { overflow-y: auto; background: var(--paper); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.task-out-head { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 12px 18px; background: var(--paper); border-bottom: 1px solid var(--line); }
.task-out-head > b { display: inline-flex; align-items: center; gap: 8px; }
.task-out #docWrap { flex: 1; }
.task-out .doc { border: 0; border-radius: 0; padding: 30px clamp(18px, 3vw, 44px) 40px; }
.task-out .revise { position: sticky; bottom: 0; margin: 0; padding: 12px 16px; background: var(--paper); border-top: 1px solid var(--line); }
.task-out .empty-state { flex: 1; justify-content: center; }
.task-out .edit-tools { margin: 10px 16px 0; }
.task-mid .run-headline { font-size: clamp(22px, 2.4vw, 28px); }
.task-mid .flow.short { height: 300px; }
@media (min-width: 1240px) { body.ai-open .task { grid-template-columns: minmax(320px, 1fr) minmax(380px, 1.1fr); } }
@media (max-width: 1100px) {
  .task { grid-template-columns: 1fr; height: auto; }
  .task-mid { overflow: visible; padding: 22px 16px 24px; }
  .task-out { overflow: visible; border-left: 0; border-top: 1px solid var(--line); }
}
.linkish { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 6px 0; margin-top: 12px; color: var(--accent); font-weight: 600; cursor: pointer; }
.linkish .ic { width: 16px; height: 16px; }
.box.fb { border-top: 3px solid #6D5BD0; }
.box.fb .box-h .ic { color: #6D5BD0; }
.fb-opts { display: grid; gap: 8px; margin: 10px 0 8px; }
.fb-opts label { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; cursor: pointer; }
.fb-opts label:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }
.fb-opts small { display: block; color: var(--muted); font-size: 13px; }
.fb-opts input { margin-top: 4px; }

/* calendar */
.cal-label { min-width: 150px; text-align: center; }
.cal-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 14px; align-items: start; }
@media (max-width: 1000px) { .cal-wrap { grid-template-columns: 1fr; } }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--line); gap: 1px; }
.cal-wd { background: var(--wash); padding: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); text-align: center; }
.cal-day { all: unset; box-sizing: border-box; background: var(--paper); min-height: 104px; padding: 6px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; }
.cal-day:hover { background: color-mix(in srgb, var(--accent-wash) 40%, var(--paper)); }
.cal-day:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.cal-day.out { background: var(--wash); }
.cal-day.out .cal-n { color: var(--faint); }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-n { font-size: 13px; font-weight: 600; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cal-n { background: var(--accent); color: var(--accent-ink); }
.cal-chip { --ac: var(--accent); display: flex; align-items: center; gap: 4px; font-size: 11.5px; line-height: 1.3; padding: 2px 6px; border-radius: 5px; border-left: 3px solid var(--ac); background: color-mix(in srgb, var(--ac) 10%, var(--paper)); overflow: hidden; white-space: nowrap; cursor: pointer; }
.cal-chip span { overflow: hidden; text-overflow: ellipsis; }
.cal-chip .ic { width: 11px; height: 11px; flex: none; }
.cal-chip.sch { background: transparent; border: 1px dashed var(--ac); border-left-width: 3px; border-left-style: solid; }
.cal-chip.r-COMPLETED::after, .cal-chip.r-REVIEW::after, .cal-chip.r-WAITING_APPROVAL::after, .cal-chip.r-TO_DO::after, .cal-chip.r-BLOCKED::after, .cal-chip.r-FAILED::after { content: ""; width: 6px; height: 6px; border-radius: 50%; margin-left: auto; flex: none; background: var(--accent); }
.cal-chip.r-REVIEW::after, .cal-chip.r-WAITING_APPROVAL::after, .cal-chip.r-TO_DO::after { background: var(--wait); }
.cal-chip.r-BLOCKED::after, .cal-chip.r-FAILED::after { background: var(--block); }
.cal-more { font-size: 11.5px; color: var(--muted); padding-left: 4px; }
.cal-side { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; position: sticky; top: 16px; }
.cal-side h2 { font-size: 16px; margin-bottom: 10px; }
.cal-add { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.cal-add h3 { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
@media (max-width: 640px) { .cal-day { min-height: 64px; } .cal-chip span { display: none; } .cal-chip { padding: 3px; } }
body:has(main.task-mode) .ai-fab { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }

/* paused jobs */
.s-PAUSED, .s-FAILED { color: #5B4BB5; background: #ECE8FA; }
.st-txt.s-PAUSED, .st-txt.s-FAILED { color: #5B4BB5; }
.dot.s-PAUSED, .dot.s-FAILED { background: #6D5BD0; }
@media (prefers-color-scheme: dark) { .s-PAUSED, .s-FAILED { color: #B9AEF2; background: #2A2540; } .st-txt.s-PAUSED, .st-txt.s-FAILED { color: #B9AEF2; } }
.box.paused { border-top: 3px solid #6D5BD0; }
.box.paused .box-h .ic { color: #6D5BD0; }
.partial-note { display: flex; gap: 8px; align-items: center; margin: 14px 18px 0; padding: 10px 12px; border-radius: var(--r-sm); background: #ECE8FA; color: #3E3380; font-size: 14px; }
.partial-note .ic { width: 16px; height: 16px; }

/* setup wizard */
.wiz-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 20px; padding: 18px; background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--r-md); }
.wiz-hero-t { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; }
.wiz-hero-t span { color: var(--muted); font-size: 14px; }
.wiz { margin-top: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px 22px; box-shadow: 0 6px 24px rgba(20,30,40,.06); }
.wiz-top { display: flex; align-items: center; gap: 10px; }
.wiz-bar { height: 5px; background: var(--wash); border-radius: 999px; margin: 14px 0 18px; overflow: hidden; }
.wiz-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; }
.wiz-h { font-size: 20px; margin-bottom: 8px; }
.wiz-text { font-size: 15.5px; color: var(--ink); max-width: 62ch; }
.wiz-go { margin: 6px 0 12px; padding: 11px 18px; font-size: 15px; }
.wiz-copy { margin: 4px 0 12px; }
.wiz-copy code { font-size: 13.5px; }
.wiz-copies { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.wiz-copies .tag { cursor: pointer; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; padding: 4px 10px; background: var(--wash); }
.wiz-copies .tag:hover { border-color: var(--accent); color: var(--accent); }
.wiz-input { margin: 6px 0 4px; font-size: 15px; padding: 11px 12px; }
.wiz-script pre { max-height: 220px; overflow: auto; background: #1F2622; color: #E7ECE8; padding: 12px 14px; border-radius: var(--r-sm); font-size: 12px; margin: 6px 0 10px; white-space: pre; }
.wiz-wait { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 8px 0; }
.wiz-wait .result { flex: 1; }
.wiz-foot { display: flex; align-items: center; gap: 8px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px; margin: 8px 0; border: 2px dashed var(--line); border-radius: var(--r-md); cursor: pointer; color: var(--muted); text-align: center; }
.dropzone .ic { width: 26px; height: 26px; color: var(--accent); }
.dropzone b { color: var(--ink); }
.dropzone.over, .dropzone:hover { border-color: var(--accent); background: var(--accent-wash); }

/* tasks done one at a time */
.task-list { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); }
.task-list li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); }
.task-list li:first-child { border-top: 0; }
.task-list li[data-jump] { cursor: pointer; }
.task-list li[data-jump]:hover { background: var(--wash); }
.tl-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; border: 2px solid var(--line); color: var(--muted); flex: none; }
.tl-n .ic { width: 13px; height: 13px; stroke-width: 3; }
.tl-n .spin { width: 12px; height: 12px; color: var(--wait); }
.tl-done .tl-n { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tl-running .tl-n, .tl-next .tl-n { border-color: var(--wait); color: var(--wait); }
.tl-t { flex: 1; min-width: 0; }
.tl-s { font-size: 12.5px; color: var(--muted); }
.tl-done .tl-s { color: var(--accent); font-weight: 600; }
.tl-running .tl-s { color: var(--wait); font-weight: 600; }
.kpi span small { color: var(--faint); font-size: 12px; }
.hb-head { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.hb-head b { font-weight: 600; text-align: right; }
.hbar b + b { color: var(--muted); }

.partial-note.warn { background: var(--wait-wash); color: var(--ink); align-items: flex-start; }
.partial-note.warn .ic { color: var(--wait); margin-top: 2px; }
.wf-ai { background: color-mix(in srgb, #6D5BD0 6%, var(--paper)); border: 1px solid color-mix(in srgb, #6D5BD0 25%, var(--line)); border-radius: var(--r-md); padding: 14px; }
.wf-ai .field > span { display: inline-flex; align-items: center; gap: 6px; }
.wf-changed { margin-top: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--accent-wash); }
.wf-changed > b { display: flex; align-items: center; gap: 6px; color: var(--accent); }
.wf-changed .prose { font-size: 14px; margin-top: 4px; }
.problem { align-items: flex-start; }
.problem .item-sub { white-space: normal; }
.ok-txt { color: var(--accent); font-weight: 600; } .bad-txt { color: var(--block); font-weight: 600; }
.pd summary { cursor: pointer; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.pd code { display: block; margin-top: 4px; white-space: normal; font-size: 12px; }

/* ================= v2.0 ================= */
/* task page: equal, resizable columns; the output can be hidden */
.task { grid-template-columns: minmax(0,1fr) 8px minmax(0,1fr); }
.task-split { cursor: col-resize; background: var(--line); width: 1px; justify-self: center; position: relative; }
.task-split::after { content: ""; position: absolute; inset: 0 -4px; }
.task-split:hover, .task-split:focus-visible, .task.resizing .task-split { background: var(--accent); width: 3px; outline: none; }
.task.resizing { cursor: col-resize; user-select: none; }
.task-out { border-left: 0; }
.out-rail { display: none; }
.task.out-closed { grid-template-columns: minmax(0,1fr) 0 48px !important; }
.task.out-closed .task-out, .task.out-closed .task-split { display: none; }
.task.out-closed .out-rail { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 0; border: 0; border-left: 1px solid var(--line); background: var(--paper); cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; }
.task.out-closed .out-rail span { writing-mode: vertical-rl; }
.task.out-closed .out-rail:hover { color: var(--accent); }
.out-hide { margin-left: 4px; }
@media (max-width: 1100px) {
  .task, .task.out-closed { grid-template-columns: 1fr !important; }
  .task-split { display: none; }
  .task.out-closed .out-rail { flex-direction: row; justify-content: center; border-left: 0; border-top: 1px solid var(--line); }
  .task.out-closed .out-rail span { writing-mode: horizontal-tb; }
}
/* New task: one chat box and three suggestions */
.home-chat { max-width: 760px; margin: 8vh auto 0; }
.home-chat .ask-title { text-align: center; margin-bottom: 18px; }
.composer.big textarea { min-height: 120px; font-size: 16.5px; }
.sugg3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
@media (max-width: 760px) { .sugg3 { grid-template-columns: 1fr; } }
.sugg { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; color: var(--ink); font: inherit; }
.sugg:hover { border-color: var(--accent); }
.sugg b { font-size: 14.5px; }
.sugg > span:last-child { font-size: 13px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* Jobs */
.jsearch { margin: 14px 0 12px; max-width: 360px; }
.tabs .cnt { font-size: 12px; color: var(--muted); margin-left: 2px; }
/* step list */
.tl-skipped { opacity: .55; }
.tl-skipped .tl-n { border-style: dashed; }

/* review a workflow before it runs */
.plan-ask { margin: 14px 0 4px; padding: 10px 14px; border-left: 3px solid var(--line); background: var(--paper); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.plan-ask p { margin: 2px 0 0; }
.plan-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plan-steps li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); }
.ps-n { width: 24px; height: 24px; border-radius: 50%; background: var(--wash); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; color: var(--muted); }
.ps-b { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ps-b small { color: var(--muted); font-size: 13px; }
.ps-k { --ac: var(--accent); display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ac); }
.ps-k .ic { width: 13px; height: 13px; }
.ps-t { display: inline-flex; align-items: center; gap: 5px; }
.ps-t .ic { width: 12px; height: 12px; }
.req-list { display: grid; gap: 8px; }
.req { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); flex-wrap: wrap; }
.req.is-missing { border-color: color-mix(in srgb, var(--wait) 45%, var(--line)); background: color-mix(in srgb, var(--wait-wash) 45%, var(--paper)); }
.req-t { flex: 1; min-width: 200px; display: flex; flex-direction: column; }
.req-t small { color: var(--muted); font-size: 13px; }
.req-a { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.req-s { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 13.5px; }
.req-s .ic { width: 14px; height: 14px; }
.req-s.ok { color: var(--accent); } .req-s.skip { color: var(--muted); } .req-s.info { color: var(--muted); }
.linkish.sm { margin: 0; font-size: 13px; padding: 2px 4px; }
.plan-foot { position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px; margin: 22px -28px -90px; padding: 14px 28px; background: color-mix(in srgb, var(--bg) 92%, transparent); border-top: 1px solid var(--line); backdrop-filter: blur(6px); flex-wrap: wrap; }
.plan-foot .hint { max-width: 320px; text-align: right; }
.plan-canvas { padding: 14px 16px 20px; }
.plan-canvas .flow { height: calc(100vh - 260px); min-height: 380px; }
@media (max-width: 1100px) { .plan-foot { margin: 18px -16px -24px; padding: 12px 16px; } .plan-canvas .flow { height: 420px; } }

/* reject with notes */
.rj { margin-top: 10px; padding: 12px; border-radius: var(--r-sm); background: color-mix(in srgb, #6D5BD0 6%, var(--paper)); border: 1px solid color-mix(in srgb, #6D5BD0 25%, var(--line)); }
.rj .field > span { display: inline-flex; align-items: center; gap: 6px; }
.rj-opts { display: grid; gap: 6px; }
.rj-opts label { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; cursor: pointer; background: var(--paper); }
.rj-opts label:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }
.rj-opts small { display: block; color: var(--muted); font-size: 12.5px; }
.rj-opts input { margin-top: 3px; }
.sent-back { display: flex; gap: 6px; align-items: flex-start; }
.sent-back .ic { width: 15px; height: 15px; margin-top: 2px; color: #6D5BD0; flex: none; }

.form-h { margin: 22px 0 2px; font-size: 15px; }
.mem-list [contenteditable] { outline: none; border-radius: 4px; padding: 1px 3px; margin: -1px -3px; }
.mem-list [contenteditable]:focus { background: var(--accent-wash); }
#memBox .panel > .switch { display: flex; margin: 6px 0; }

.notice.warn-profile { margin-top: 12px; background: var(--wait-wash); border-color: color-mix(in srgb, var(--wait) 40%, var(--line)); align-items: flex-start; }
.notice.warn-profile .ic { color: var(--wait); }

.plan-analysis { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper); padding: 0 14px; }
.plan-analysis summary { padding: 12px 0; }
.an-grid { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; margin: 0 0 10px; font-size: 14px; }
.an-grid dt { color: var(--muted); font-weight: 600; }
.an-grid dd { margin: 0; }
@media (max-width: 640px) { .an-grid { grid-template-columns: 1fr; } .an-grid dd { margin-bottom: 6px; } }
