/* Etiketa: design tokens from the design hand-off (Etiketa-Tokeny). Always light. */
:root {
  --c-ink: #161616; --c-paper: #ffffff; --c-muted: oklch(0.44 0.01 165); --c-subtle: oklch(0.36 0.01 165);
  --c-line-soft: oklch(0.88 0.01 165); --c-line-faint: oklch(0.93 0.005 165); --c-line-mid: oklch(0.82 0.01 165);
  --c-emerald-25: oklch(0.985 0.01 165); --c-emerald-50: oklch(0.965 0.03 165); --c-emerald-700: oklch(0.42 0.12 165);
  --c-emerald-ok: oklch(0.38 0.1 165); --c-focus: oklch(0.62 0.12 165);
  --c-pink-50: oklch(0.955 0.03 10); --c-pink-100: oklch(0.93 0.045 10); --c-pink-ink: oklch(0.42 0.17 20);
  --c-crimson: oklch(0.5 0.19 20); --c-disabled-bg: oklch(0.94 0.005 165); --c-disabled-ink: oklch(0.45 0.01 165);
  --c-disabled-line: oklch(0.8 0.01 165); --c-ink-hover: #3a3a3a; --c-star: oklch(0.7 0.14 80);
  --font-sans: 'Schibsted Grotesk', system-ui, sans-serif; --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --fs-num: 64px; --fs-task: 19px;
  --r-tag: 3px; --r-btn: 6px; --r-card: 8px; --r-pill: 999px; --bw: 1.5px;
  --sh-menu: 0 10px 28px rgb(0 0 0 / .14); --sh-toast: 0 10px 30px rgb(0 0 0 / .25); --sh-drawer: -12px 0 40px rgb(0 0 0 / .12);
  --focus: 3px solid var(--c-focus);
  --h-btn: 36px; --h-input: 40px;
  color-scheme: light;
}
@media (max-width: 640px) { :root { --h-btn: 44px; --h-input: 48px; --fs-num: 44px; --fs-task: 18px; } }

* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; }
body { background: var(--c-paper); color: var(--c-ink); font: 15px/1.5 var(--font-sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
[hidden] { display: none !important; }
a { color: var(--c-ink); }
a:hover { color: var(--c-emerald-700); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: var(--focus); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 1px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }

/* ---------- buttons ---------- */
.btn { height: var(--h-btn); padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: var(--bw) solid var(--c-ink); border-radius: var(--r-btn); background: var(--c-paper); font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--c-emerald-50); color: var(--c-ink); }
.btn[aria-expanded="true"] { background: var(--c-emerald-50); box-shadow: inset 0 0 0 1px var(--c-ink); }
.btn.primary { background: var(--c-ink); color: #fff; font-weight: 700; padding: 0 14px; }
.btn.primary:hover { background: var(--c-ink-hover); }
.btn.primary:active { background: #000; transform: translateY(1px); }
.btn.primary.ok { background: var(--c-emerald-700); border-color: var(--c-emerald-700); }
.btn:disabled, .btn.primary:disabled { border-color: var(--c-disabled-line); background: var(--c-disabled-bg); color: var(--c-disabled-ink); cursor: not-allowed; transform: none; }
.btn.busy:disabled { cursor: wait; }
.btn.icon { width: var(--h-btn); padding: 0; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.xs { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 5px; flex: none; }
.btn.big { height: 48px; padding: 0 22px; font-size: 16px; }
.btn.danger-text { border-color: transparent; background: none; color: var(--c-pink-ink); padding: 0 10px; }
.btn.danger-text:hover { background: var(--c-pink-50); color: var(--c-pink-ink); }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

/* ---------- page + header ---------- */
.page { max-width: 1100px; margin: 0 auto; padding: 20px 40px 140px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 14px; border-bottom: 2px solid var(--c-ink); }
.top .ttl { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.top h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.top .meta { font-size: 13px; color: var(--c-muted); }
.top .acts { display: flex; gap: 8px; flex: none; }

/* ---------- alerts + status ---------- */
.alerts { display: grid; gap: 6px; margin-top: 12px; }
.alert { display: flex; align-items: center; gap: 12px; padding: 9px 10px 9px 14px; background: var(--c-pink-50); border: var(--bw) solid var(--c-crimson); border-radius: var(--r-btn); font-size: 14px; line-height: 1.4; }
.alert > .dot { background: var(--c-crimson); }
.alert > span:not(.dot) { flex: 1; }
.info-note { padding: 10px 12px; border-radius: var(--r-btn); background: var(--c-emerald-50); border: var(--bw) solid var(--c-emerald-700); font-size: 14px; line-height: 1.45; margin-top: 12px; }

/* ---------- summary band ---------- */
.band { margin-top: 16px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 32px; align-items: center; padding: 16px 22px; background: var(--c-emerald-50); border-radius: var(--r-card); }
.band .count { display: flex; align-items: center; gap: 12px; }
.band .num { font-size: var(--fs-num); line-height: .9; font-weight: 800; color: var(--c-emerald-700); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.band .word { font-size: 17px; font-weight: 800; line-height: 1.1; max-width: 110px; }
.band .ov { margin: 0; font-size: 15px; line-height: 1.5; text-wrap: pretty; max-width: 72ch; }
.band .ov.wait { color: var(--c-muted); }
.stats { grid-column: 1 / -1; display: grid; gap: 7px; padding-top: 10px; border-top: 1px solid oklch(0.85 0.04 165); }
.statbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 12px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; }
.s-todo { background: oklch(0.5 0.19 20); } .s-watch { background: oklch(0.66 0.13 65); } .s-snz { background: oklch(0.62 0.1 255); }
.s-info { background: oklch(0.62 0.1 165); } .s-rep { background: oklch(0.42 0.12 165); } .s-flt { background: oklch(0.82 0.02 165); }

/* ---------- account pills ---------- */
.accbar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.pill { height: 34px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; border: var(--bw) solid var(--c-ink); border-radius: var(--r-pill); background: var(--c-paper); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.pill:hover { background: var(--c-emerald-50); }
.pill b { font-weight: 800; color: var(--c-emerald-700); }
.pill[aria-pressed="true"] { background: var(--c-ink); color: #fff; }
.pill[aria-pressed="true"] b { color: #fff; }
.pill[aria-pressed="true"] .dot { box-shadow: 0 0 0 1.5px #fff; }
.tag-err { font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: var(--r-tag); background: var(--c-crimson); color: #fff; }

/* ---------- bulk selection bar ---------- */
.selbar { position: sticky; top: 8px; z-index: 6; margin-top: 14px; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; background: var(--c-ink); color: #fff; border-radius: var(--r-card); box-shadow: 0 6px 20px rgb(0 0 0 / .18); flex-wrap: wrap; }
.selbar > span { font-weight: 700; font-size: 14px; flex: 1; }
.selbar .btn { height: 34px; background: transparent; color: #fff; border-color: #fff; }
.selbar .btn:hover { background: #333; }
.selbar .btn.solid { background: #fff; color: var(--c-ink); border-color: #fff; font-weight: 700; }
.selbar .btn.plain { border-color: transparent; text-decoration: underline; font-weight: 400; }

/* ---------- clean + onboarding + first run ---------- */
.clean { margin-top: 28px; padding: 44px 24px; border: var(--bw) dashed var(--c-ink); border-radius: var(--r-card); text-align: center; display: grid; gap: 8px; justify-items: center; }
.clean p { margin: 0; }
.clean .t { font-size: 24px; font-weight: 800; }
.clean .d { font-size: 15px; color: var(--c-muted); max-width: 52ch; }
.onb { margin: 120px auto 0; max-width: 520px; display: grid; gap: 14px; justify-items: center; text-align: center; }
.onb p { margin: 0; }
.step { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--c-emerald-700); }
.onb .t { font-size: 32px; font-weight: 800; line-height: 1.15; }
.onb .d { font-size: 16px; line-height: 1.5; color: oklch(0.4 0.01 165); }
.onb .n { font-size: 13px; color: var(--c-muted); }
.firstrun { margin: 72px auto 0; max-width: 640px; display: grid; gap: 22px; }
.firstrun p { margin: 0; }
.firstrun .t { font-size: 28px; font-weight: 800; line-height: 1.2; }
.firstrun .d { font-size: 15px; line-height: 1.5; color: oklch(0.4 0.01 165); margin-top: 6px; }
.prog { display: grid; border-top: var(--bw) solid var(--c-ink); }
.prog > div { display: grid; grid-template-columns: 10px 160px minmax(0, 1fr) 150px; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--c-line-soft); }
.prog > div:last-child { border-bottom: 0; }
.prog .dot { width: 10px; height: 10px; }
.prog .name { font-size: 15px; font-weight: 700; }
.prog .bar { height: 8px; border-radius: 4px; background: oklch(0.93 0.01 165); overflow: hidden; }
.prog .bar i { display: block; height: 100%; background: var(--c-emerald-700); }
.prog .bar.run i { width: 35%; background: var(--c-ink); animation: run 1.6s ease-in-out infinite alternate; }
@keyframes run { from { margin-left: 0; } to { margin-left: 65%; } }
@media (prefers-reduced-motion: reduce) { .prog .bar.run i { animation: none; } }
.prog .r { font-size: 14px; text-align: right; color: var(--c-muted); }
.prog .r.ok { font-weight: 600; color: var(--c-emerald-ok); }

/* ---------- sections + cards ---------- */
.cat { margin-top: 26px; }
.cat-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: var(--bw) solid var(--c-ink); }
.cat-h h2 { margin: 0; font-size: 18px; font-weight: 800; }
.cat-h .n { font-size: 18px; font-weight: 800; color: var(--c-emerald-700); }
.cat-h .sub { font-size: 13px; color: var(--c-muted); }
.cards { display: grid; gap: 10px; margin-top: 10px; }
.card { border: var(--bw) solid var(--c-ink); border-radius: var(--r-card); background: var(--c-paper); scroll-margin-top: 70px; transition: background .6s, box-shadow .6s, border-color .6s; }
.card.flash, .irow.flash { border-color: var(--c-emerald-700); background: oklch(0.975 0.025 165); box-shadow: 0 0 0 4px oklch(0.88 0.06 165); }
.card-main { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 14px; padding: 14px; align-items: start; }
.chk { margin-top: 2px; width: 22px; height: 22px; border: var(--bw) solid var(--c-ink); border-radius: 4px; background: var(--c-paper); cursor: pointer; padding: 0; display: grid; place-items: center; }
.chk:hover { background: var(--c-emerald-50); }
.chk[aria-checked="true"] { background: var(--c-ink); }
.c-body { display: grid; gap: 5px; }
.c-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; }
.c-meta .from { font-weight: 700; overflow-wrap: anywhere; }
.c-meta .acc { display: flex; align-items: center; gap: 5px; color: var(--c-muted); }
.c-meta .mut { color: var(--c-muted); }
.tag-high { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: var(--c-crimson); color: #fff; padding: 2px 6px; border-radius: var(--r-tag); }
.tag-snz { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: var(--r-tag); border: var(--bw) solid var(--c-emerald-700); color: oklch(0.36 0.1 165); }
.tag-new { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: var(--r-tag); background: var(--c-emerald-700); color: #fff; }
.headline { margin: 0; font-size: var(--fs-task); font-weight: 700; line-height: 1.3; text-wrap: pretty; overflow-wrap: anywhere; }
.hl { padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; text-wrap: inherit; overflow-wrap: anywhere; }
.hl:hover, .hl[aria-expanded="true"] { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.summary { margin: 0; font-size: 14px; line-height: 1.45; color: var(--c-subtle); text-wrap: pretty; }
.pending { margin: 0; font-size: 13px; color: var(--c-muted); }
.c-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--c-muted); }
.c-foot:empty { display: none; }
.c-foot .subj { overflow-wrap: anywhere; }
.att { display: inline-flex; align-items: center; gap: 4px; max-width: 240px; padding: 1px 7px; border: 1px solid var(--c-line-mid); border-radius: 4px; color: var(--c-ink); background: none; font: inherit; cursor: pointer; }
.att:hover { border-color: var(--c-ink); }
.att[aria-busy] { cursor: progress; opacity: .6; }
.att svg { flex: none; }
.att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more-att { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--c-ink); cursor: pointer; }
.more-att:hover { text-decoration: underline; }
.c-side { display: grid; justify-items: end; gap: 10px; }
.c-acts { display: flex; gap: 6px; }
.due { font-size: 14px; padding: 4px 0; white-space: nowrap; }
.due.over { font-weight: 800; padding: 4px 10px; border-radius: 5px; background: var(--c-crimson); color: #fff; }
.due.soon { font-weight: 800; padding: 4px 10px; border-radius: 5px; background: var(--c-pink-100); color: var(--c-pink-ink); }
.due.plain { font-weight: 700; }
.due.none { font-size: 13px; color: oklch(0.5 0.01 165); }

/* ---------- ⋯ menu ---------- */
.menu-root { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 244px; background: var(--c-paper); border: var(--bw) solid var(--c-ink); border-radius: var(--r-card); box-shadow: var(--sh-menu); padding: 6px; display: grid; }
.mi { height: 38px; padding: 0 10px; display: flex; align-items: center; justify-content: space-between; text-align: left; border: 0; border-radius: 5px; background: none; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--c-ink); }
.mi:hover, .mi:focus-visible { background: var(--c-emerald-50); color: var(--c-ink); }
.mi:focus-visible { outline-offset: -3px; }
.mi.mv { height: 36px; font-weight: 400; }
.mi.danger { font-weight: 400; color: var(--c-pink-ink); }
.mi.danger:hover, .mi.danger:focus-visible { background: var(--c-pink-50); color: var(--c-pink-ink); }
.menu hr { border: 0; height: 1px; background: var(--c-line-soft); margin: 6px 4px; }
.menu .mh { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-muted); padding: 4px 10px; }

/* ---------- panels inside a card ---------- */
.panel { border-top: var(--bw) dashed var(--c-ink); padding: 14px 16px 16px 52px; display: grid; gap: 10px; }
.panel p { margin: 0; }
.panel-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.panel-h > div { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.panel-h strong { font-size: 14px; }
.x { width: 30px; height: 30px; border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; border-radius: 5px; flex: none; }
.x:hover { background: var(--c-emerald-50); }
.hint { font-size: 13px; color: var(--c-muted); }
.snz-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.snz-opt { min-width: 128px; display: grid; gap: 2px; text-align: left; padding: 8px 14px; border: var(--bw) solid var(--c-ink); border-radius: var(--r-btn); background: var(--c-paper); cursor: pointer; }
.snz-opt:hover { background: var(--c-emerald-50); }
.snz-opt b { font-size: 14px; }
.snz-opt span { font-size: 13px; color: var(--c-muted); }
.snz-own { min-width: 160px; display: grid; gap: 2px; padding: 6px 12px; border: var(--bw) dashed var(--c-ink); border-radius: var(--r-btn); cursor: pointer; }
.snz-own b { font-size: 14px; }
.snz-own input { border: 0; padding: 0; font-size: 13px; background: none; }
.prompt-ta { width: 100%; font: 13px/1.55 var(--font-mono); padding: 12px 14px; border: var(--bw) solid var(--c-ink); border-radius: var(--r-btn); resize: vertical; background: oklch(0.985 0.006 165); }
.panel-acts { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.msgs { display: grid; }
.msg { display: grid; gap: 4px; padding: 10px 0; border-top: 1px solid var(--c-line-soft); }
.msg-h { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.msg-h span { color: var(--c-muted); }
.msg p { font-size: 14px; line-height: 1.55; white-space: pre-wrap; max-width: 72ch; overflow-wrap: anywhere; }

/* ---------- reply + delete ---------- */
.reply { gap: 12px; }
.rp-grid { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px 12px; align-items: center; font-size: 14px; }
.rp-grid .lbl { color: var(--c-muted); }
.rp-grid input, .ai-row input { height: 36px; padding: 0 10px; border: var(--bw) solid var(--c-ink); border-radius: var(--r-btn); font-size: 14px; min-width: 0; width: 100%; background: var(--c-paper); }
.rp-from { display: flex; align-items: center; gap: 8px; min-height: 36px; min-width: 0; overflow-wrap: anywhere; }
.rp-to { display: flex; gap: 8px; min-width: 0; }
.seg { display: flex; border: var(--bw) solid var(--c-ink); border-radius: var(--r-btn); overflow: hidden; flex: none; }
.seg button { height: 33px; padding: 0 10px; border: 0; background: var(--c-paper); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.seg button[aria-checked="true"], .seg button[aria-selected="true"] { background: var(--c-ink); color: #fff; font-weight: 700; }
.seg button:focus-visible { outline-offset: -3px; }
.ai-box { display: grid; gap: 8px; padding: 10px 12px; border-radius: var(--r-btn); background: var(--c-emerald-50); }
.ai-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.ai-row strong { display: flex; align-items: center; gap: 6px; font-size: 14px; flex: none; }
.ai-row input { flex: 1 1 240px; width: auto; }
.btn.ai { height: 36px; border-color: var(--c-emerald-700); background: var(--c-emerald-700); color: #fff; font-weight: 700; flex: none; }
.btn.ai.alt { background: var(--c-paper); color: oklch(0.32 0.1 165); }
.btn.ai:disabled { border-color: oklch(0.75 0.03 165); background: oklch(0.94 0.01 165); color: oklch(0.38 0.05 165); }
.ai-note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; line-height: 1.4; }
.link { height: 28px; padding: 0; border: 0; background: none; font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ed-box { border: var(--bw) solid var(--c-ink); border-radius: var(--r-btn); overflow: hidden; background: var(--c-paper); }
.ed-tools { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-bottom: 1px solid var(--c-line-soft); background: oklch(0.985 0.006 165); }
.ed-tools button { min-width: 32px; height: 32px; padding: 0 9px; border: 0; border-radius: 5px; background: none; font-size: 13px; font-weight: 600; cursor: pointer; }
.ed-tools button:hover { background: var(--c-emerald-50); }
.ed-tools .b { font-weight: 800; } .ed-tools .i { font-style: italic; } .ed-tools .u { text-decoration: underline; }
.ai-fresh { display: flex; align-items: center; gap: 6px; padding: 8px 14px 0; font-size: 12px; font-weight: 700; color: oklch(0.36 0.1 165); }
.editor { min-height: 170px; padding: 12px 14px; font-size: 15px; line-height: 1.55; outline: none; overflow-wrap: anywhere; }
.editor:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--c-focus); }
.editor[aria-busy="true"] { opacity: .4; }
.editor p, .sig p { margin: 0 0 .6em; } .editor blockquote { margin: 0 0 .6em; padding-left: 12px; border-left: 3px solid var(--c-line-mid); }
.ed-sig { padding: 10px 14px 12px; border-top: 1px dashed var(--c-line-mid); display: grid; gap: 6px; }
.sig-h { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--c-muted); }
.sig-h .link { height: auto; font-size: 12px; }
.sig { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.ed-quote { margin: 0 14px 12px; padding: 10px 12px; border-radius: var(--r-btn); background: oklch(0.97 0.004 165); font-size: 13px; line-height: 1.5; color: var(--c-subtle); display: grid; gap: 4px; max-height: 220px; overflow: auto; }
.ed-quote .qh { font-weight: 600; } .ed-quote .qt { white-space: pre-wrap; overflow-wrap: anywhere; }
.rp-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 14px; }
.cb { min-height: 32px; display: flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; font-size: 14px; cursor: pointer; text-align: left; }
.cb .box { width: 18px; height: 18px; border-radius: 4px; border: var(--bw) solid var(--c-ink); display: grid; place-items: center; flex: none; }
.cb[aria-checked="true"] .box { background: var(--c-ink); }
.attach { position: relative; height: 32px; display: flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; }
.attach input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.attach:focus-within { outline: var(--focus); outline-offset: 2px; border-radius: 4px; }
.rp-file { display: inline-flex; align-items: center; gap: 2px; max-width: 260px; padding: 0 0 0 8px; border: 1px solid var(--c-line-mid); border-radius: 4px; font-size: 13px; }
.rp-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-file button { width: 28px; height: 28px; border: 0; background: none; font-size: 16px; cursor: pointer; flex: none; }
.rp-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rp-acts .btn { height: 40px; }
.mi:has(> svg) { justify-content: flex-start; gap: 8px; } .mi.danger { font-weight: 600; }
.mnote { padding: 8px 10px 4px; font-size: 12px; line-height: 1.4; color: var(--c-muted); }
.pending-send { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 16px 10px 52px; border-top: var(--bw) dashed var(--c-emerald-700); background: var(--c-emerald-50); font-size: 14px; font-weight: 600; }
.panel.del { border-top-color: var(--c-crimson); background: var(--c-pink-50); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; border-radius: 0 0 7px 7px; }
.del-t { display: grid; gap: 2px; flex: 1 1 280px; font-size: 14px; line-height: 1.4; }
.btn.danger { border-color: var(--c-crimson); background: var(--c-crimson); color: #fff; font-weight: 700; }
.btn.danger:hover { background: oklch(0.44 0.19 20); color: #fff; }
.wr { display: grid; gap: 12px; padding-top: 12px; border-top: 1px solid var(--c-line-soft); }
.wr-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wr-h > span { display: grid; gap: 2px; } .wr-h b { font-size: 15px; font-weight: 800; }
.tidy-l { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; line-height: 1.45; color: var(--c-muted); }
.sig-ed { display: grid; gap: 8px; }
.sig-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 600; }
.sig-ed textarea { width: 100%; padding: 8px 10px; border: var(--bw) solid var(--c-ink); border-radius: var(--r-btn); font: 13px/1.5 var(--font-mono); resize: vertical; }
.sig-prev { min-height: 60px; padding: 10px 12px; border: 1px dashed var(--c-line-mid); border-radius: var(--r-btn); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .rp-grid { grid-template-columns: 52px minmax(0, 1fr); }
  .rp-to { flex-wrap: wrap; }
  .rp-acts .btn { flex: 1; }
}

/* ---------- collapsed sections ---------- */
.coll { margin-top: 40px; border-top: 2px solid var(--c-ink); }
.coll > div { border-bottom: var(--bw) solid var(--c-line-soft); }
.coll-h { width: 100%; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 13px 4px; background: none; border: 0; cursor: pointer; text-align: left; }
.coll-h:hover { background: var(--c-emerald-25); }
.coll-h:focus-visible { outline-offset: -3px; }
.coll-h .car { width: 14px; font-size: 12px; font-weight: 800; }
.coll-h .t { font-size: 16px; font-weight: 800; }
.coll-h .n { font-size: 16px; font-weight: 800; color: var(--c-emerald-700); }
.coll-h .sub { font-size: 13px; color: var(--c-muted); }
.coll-h.empty .t, .coll-h.empty .n, .coll-h.empty .car { color: oklch(0.55 0.01 165); }
.coll-b { padding: 0 0 14px 28px; display: grid; gap: 6px; }
.coll-b > p { margin: 0; font-size: 14px; color: var(--c-muted); }
.row { display: flex; align-items: center; gap: 14px; padding: 6px 0; min-height: 40px; border-bottom: 1px solid var(--c-line-faint); }
.row .txt { flex: 1; font-size: 14px; overflow-wrap: anywhere; }
.row .txt strong { font-weight: 600; }
.row .txt span { color: var(--c-muted); }
.row .rt { font-size: 13px; color: var(--c-muted); flex: none; }
.row .btn { flex: none; }
.irow { border: var(--bw) solid var(--c-line-mid); border-radius: var(--r-btn); scroll-margin-top: 70px; transition: background .6s, box-shadow .6s, border-color .6s; }
.irow-main { display: flex; align-items: center; gap: 14px; padding: 10px 12px; }
.irow-main .txt { flex: 1; display: grid; gap: 2px; font-size: 14px; }
.irow-main .txt span:last-child { font-size: 13px; color: var(--c-muted); }
.irow-main .rt { font-size: 13px; color: var(--c-muted); flex: none; }
.irow-main .menu-root .btn { width: 32px; height: 32px; }
.irow .panel { padding-left: 34px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 18px; background: var(--c-ink); color: #fff; border-radius: var(--r-card); box-shadow: var(--sh-toast); font-size: 14px; width: max-content; max-width: calc(100vw - 32px); }
.toast span { flex: 1; }
.toast .btn { height: 32px; background: transparent; color: #fff; border-color: #fff; font-weight: 700; }
.toast .btn:hover { background: #333; }
.toast .x { color: #fff; width: 32px; height: 32px; }
.toast .x:hover { background: #333; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login form { width: min(360px, 100%); display: grid; gap: 16px; }
.login .head { display: grid; gap: 4px; padding-bottom: 14px; border-bottom: 2px solid var(--c-ink); }
.login .head b { font-size: 26px; font-weight: 800; }
.login .head span { font-size: 14px; color: var(--c-muted); }
.login label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.login input { height: 48px; padding: 0 14px; border: var(--bw) solid var(--c-ink); border-radius: var(--r-btn); font-size: 16px; }
.login input[aria-invalid="true"] { border: 2px solid var(--c-crimson); background: oklch(0.985 0.01 10); }
.login input:disabled { border-color: var(--c-disabled-line); background: oklch(0.96 0.004 165); }
.login .err { font-size: 14px; font-weight: 600; color: var(--c-pink-ink); }
.login .lock { margin: 0; padding: 10px 14px; border: var(--bw) solid var(--c-crimson); border-radius: var(--r-btn); background: var(--c-pink-50); font-size: 14px; line-height: 1.45; }
.login .goto { padding: 12px 14px; border-radius: var(--r-card); background: var(--c-emerald-50); font-size: 14px; }
.login .btn { height: 48px; font-size: 16px; width: 100%; }

/* ---------- settings drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: flex-end; }
.drawer .scrim { position: absolute; inset: 0; background: rgb(22 22 22 / .32); }
.drawer aside { position: relative; width: min(600px, 100vw); height: 100%; background: var(--c-paper); border-left: 2px solid var(--c-ink); box-shadow: var(--sh-drawer); display: flex; flex-direction: column; }
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px 14px; border-bottom: 2px solid var(--c-ink); flex: none; }
.drawer header h2 { margin: 0; font-size: 22px; font-weight: 800; }
.drawer header .btn { width: 40px; height: 40px; font-size: 22px; padding: 0; }
.drawer .body { flex: 1; overflow: auto; padding: 4px 24px 32px; }
.drawer footer { flex: none; display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px 24px; border-top: 2px solid var(--c-ink); }
.drawer footer .btn { height: 44px; padding: 0 18px; font-size: 15px; }
.drawer footer .res { margin-right: auto; }
.set { padding-top: 28px; display: grid; gap: 12px; }
.set:first-child { padding-top: 22px; }
.set h3 { margin: 0; font-size: 18px; font-weight: 800; }
.set .lead { display: grid; gap: 2px; }
.fld { display: grid; gap: 4px; }
.fld > span:first-child { font-size: 14px; font-weight: 600; }
.fld.sm > span:first-child { font-size: 13px; }
.fld input, .fld select { height: var(--h-input); padding: 0 10px; border: var(--bw) solid var(--c-ink); border-radius: var(--r-btn); font-size: 15px; background: var(--c-paper); width: 100%; }
.fld select { padding: 0 8px; }
.fld textarea { padding: 8px 10px; border: var(--bw) solid var(--c-ink); border-radius: var(--r-btn); font-size: 14px; line-height: 1.5; resize: vertical; width: 100%; }
.fld.days { grid-template-columns: minmax(0, 1fr) 96px; gap: 12px; align-items: center; }
.fld.days > span:first-child { display: grid; gap: 2px; }
.fld .hint { font-weight: 400; }
.fld-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.fld-row.srv { grid-template-columns: minmax(0, 2fr) minmax(0, .8fr) minmax(0, 1.2fr); }
.fld-row.fold { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.acct { border: var(--bw) solid var(--c-ink); border-radius: var(--r-card); }
.acct-h { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; background: none; text-align: left; cursor: pointer; border-radius: var(--r-card); }
.acct-h:hover { background: var(--c-emerald-25); }
.acct-h:focus-visible { outline-offset: -3px; }
.acct-h .dot { width: 10px; height: 10px; }
.acct-h .who { flex: 1; display: grid; gap: 1px; }
.acct-h .who b { font-size: 16px; }
.acct-h .who span { font-size: 13px; color: var(--c-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-h .ok { font-size: 13px; font-weight: 600; color: var(--c-emerald-ok); flex: none; }
.acct-h .st { font-size: 13px; color: var(--c-muted); flex: none; }
.acct-h .car { width: 14px; font-size: 12px; font-weight: 800; }
.acct-b { border-top: var(--bw) dashed var(--c-ink); padding: 14px; display: grid; gap: 12px; }
.acct-b p { margin: 0; }
.box-err { padding: 8px 12px; border-radius: var(--r-btn); background: var(--c-pink-50); border: var(--bw) solid var(--c-crimson); font-size: 14px; }
.box-em { padding: 8px 12px; border-radius: var(--r-btn); background: var(--c-emerald-50); font-size: 13px; line-height: 1.45; }
.res { font-size: 14px; font-weight: 600; }
.res.ok { color: var(--c-emerald-ok); }
.res.bad { color: var(--c-pink-ink); }
.res:empty { display: none; }
.btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.btns .grow { flex: 1; }
.btns .btn { height: 40px; }
.confirm { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 10px; border-radius: var(--r-btn); background: var(--c-pink-50); font-size: 13px; font-weight: 600; }
.confirm .yes { height: 32px; padding: 0 10px; border: 0; border-radius: 5px; background: var(--c-crimson); color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }
.confirm .no { height: 32px; padding: 0 8px; border: 0; background: none; font-size: 13px; cursor: pointer; text-decoration: underline; font-weight: 400; }
.add { height: 44px; border: var(--bw) dashed var(--c-ink); border-radius: var(--r-card); background: var(--c-paper); font-size: 15px; font-weight: 700; cursor: pointer; }
.add:hover { background: var(--c-emerald-50); }
a.add { display: flex; align-items: center; justify-content: center; text-decoration: none; color: var(--c-ink); }
.switch { height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 4px; border: 0; background: none; font-size: 14px; font-weight: 600; cursor: pointer; border-radius: var(--r-btn); flex: none; }
.switch .tr { width: 44px; height: 26px; border-radius: 13px; background: var(--c-paper); border: var(--bw) solid var(--c-ink); display: flex; padding: 2px; flex: none; }
.switch .tr i { width: 19px; height: 19px; border-radius: 50%; background: var(--c-ink); }
.switch[aria-checked="true"] .tr { background: var(--c-ink); justify-content: flex-end; padding: 3px; }
.switch[aria-checked="true"] .tr i { width: 18px; height: 18px; background: #fff; }
.types { display: grid; gap: 10px; }
.type { display: grid; gap: 8px; padding: 12px 14px; border: var(--bw) solid var(--c-ink); border-radius: var(--r-card); }
.type .th { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.type .th b { font-size: 15px; }
.type .th span, .type .signs { font-size: 13px; color: var(--c-muted); line-height: 1.45; }
.type .th span { flex: none; }
.type select { height: 36px; padding: 0 8px; border: var(--bw) solid var(--c-ink); border-radius: var(--r-btn); font-size: 14px; background: var(--c-paper); }
.type .btn { height: 36px; }
.saved { font-size: 13px; font-weight: 700; color: var(--c-emerald-ok); }
.saved.bad { color: var(--c-pink-ink); }
.empty-box { margin: 0; padding: 14px; border: var(--bw) dashed var(--c-disabled-line); border-radius: var(--r-card); font-size: 14px; color: var(--c-muted); }
.fixes { border-top: var(--bw) solid var(--c-line-soft); }
.fixes > button { width: 100%; display: flex; align-items: baseline; gap: 10px; padding: 12px 2px; border: 0; background: none; text-align: left; cursor: pointer; }
.fixes > button b { font-size: 15px; }
.fixes > button .n { font-size: 15px; font-weight: 800; color: var(--c-emerald-700); }
.fixes > button .car { width: 14px; font-size: 12px; font-weight: 800; }
.fix-list { display: grid; padding: 0 0 6px 24px; }
.fix { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--c-line-faint); font-size: 13px; }
.fix > span:first-child { color: var(--c-muted); }
.fix > span:nth-child(2) { display: grid; gap: 1px; }
.fix > span:nth-child(2) b { font-weight: 600; }
.fix > span:nth-child(2) span { color: var(--c-muted); }
.fix .btn { height: 30px; font-size: 13px; }
.slack-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.status { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.status .dot { background: var(--c-emerald-700); }

/* ---------- phone ---------- */
@media (max-width: 640px) {
  .page { padding: 12px 16px 120px; }
  .top { gap: 12px; padding-bottom: 10px; }
  .top h1 { font-size: 19px; }
  .top .meta, .top .lbl { display: none; }
  .top .acts .btn { width: var(--h-btn); padding: 0; }
  .band { grid-template-columns: minmax(0, 1fr); padding: 12px 14px; }
  .band .word { font-size: 15px; }
  .accbar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .pill { height: 40px; flex: none; }
  .selbar .btn { height: 40px; }
  .accbar { scrollbar-width: none; }
  .accbar::-webkit-scrollbar { display: none; }
  /* phone card: [priority, tags, deadline] / task / [from, account, time] / summary / foot / actions */
  .card-main { display: flex; flex-flow: row wrap; align-items: center; gap: 6px 10px; padding: 12px 14px; }
  .card-main > .chk { display: none; }
  .c-body, .c-side, .c-meta { display: contents; }
  .c-meta > * { order: 3; }
  .c-meta > .tag-high, .c-meta > .tag-snz, .c-meta > .tag-new { order: 0; }
  .c-side .due { order: 1; }
  .c-side .due.soon, .c-side .due.over { padding: 2px 8px; font-size: 13px; }
  .c-side .due.none { display: none; }
  .headline { order: 2; flex-basis: 100%; }
  .summary, .pending { order: 4; flex-basis: 100%; }
  .c-foot { order: 5; flex-basis: 100%; }
  .c-acts { order: 6; flex-basis: 100%; margin-top: 4px; }
  .c-acts > .btn { flex: 1; padding: 0 6px; }
  .c-acts > .btn.primary { flex: 1.2; }
  .c-acts > .menu-root .btn { width: 44px; }
  .panel, .irow .panel { padding: 12px 14px 14px; }
  .coll-b { padding-left: 0; }
  .row, .irow-main { flex-wrap: wrap; gap: 6px 12px; }
  .row .txt, .irow-main .txt { flex-basis: calc(100% - 30px); }
  .irow-main .menu-root .btn { width: 44px; height: 44px; }
  .btn.sm { height: 44px; }
  .toast { left: 16px; right: 16px; bottom: 16px; transform: none; width: auto; }
  .onb { margin-top: 56px; }
  .onb .t { font-size: 26px; }
  .firstrun { margin-top: 40px; }
  .prog > div { grid-template-columns: 10px minmax(0, 1fr) 110px; }
  .prog .bar { grid-column: 2 / -1; grid-row: 2; }
  .drawer .body { padding: 4px 16px 24px; }
  .drawer header, .drawer footer { padding-left: 16px; padding-right: 16px; }
  .fld-row.srv { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .fld-row.srv > :first-child { grid-column: 1 / -1; }
  .fix { grid-template-columns: minmax(0, 1fr) auto; }
  .fix > span:first-child { grid-column: 1 / -1; }
}
