:root {
  --bg: #faf3f0; --panel: #ffffff; --panel-2: #f4e8e2; --ink: #3b2a22; --muted: #6a584f; --faint: #b3a29a;
  --line: #ecddd5; --accent: #45703f; --accent-ink: #ffffff; --accent-soft: #e3eedf;
  --danger: #b83a2e; --ok: #45703f; --warn: #8a6418;
  --now: #45703f; --now-soft: #e3eedf; --cta: #45703f;
  --side-bg: #a84a24; --side-ink: #faf3f0;
  --shadow: 0 1px 2px rgba(80,40,20,.06), 0 4px 16px rgba(80,40,20,.07);
  --radius: 14px;
  --sans: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Fredoka", "Nunito Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #1f1612; --panel: #2a1e19; --panel-2: #33251f; --ink: #faf3f0; --muted: #c3b0a6; --faint: #7c6a61;
  --line: #43322a; --accent: #8fc38b; --accent-ink: #1f1612; --accent-soft: #25392a;
  --danger: #ff8a7a; --ok: #8fc38b; --warn: #d9a441; --now: #8fc38b; --now-soft: #25392a;
  --side-bg: #a84a24; --side-ink: #faf3f0;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  color-scheme: dark;
}}
:root[data-theme="dark"] {
  --bg: #1f1612; --panel: #2a1e19; --panel-2: #33251f; --ink: #faf3f0; --muted: #c3b0a6; --faint: #7c6a61;
  --line: #43322a; --accent: #8fc38b; --accent-ink: #1f1612; --accent-soft: #25392a;
  --danger: #ff8a7a; --ok: #8fc38b; --warn: #d9a441; --now: #8fc38b; --now-soft: #25392a;
  --side-bg: #a84a24; --side-ink: #faf3f0;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3, h4, .brand { font-family: var(--display); font-weight: 500; letter-spacing: 0; }
.hidden { display: none !important; }

/* ---- layout ---- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 20px 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; padding: 4px 10px 18px; letter-spacing: -.01em; }
.brand .logo { width: 32px; height: 32px; display: block; object-fit: contain; flex: none; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 500; border: 0; background: none; cursor: pointer; text-align: left; width: 100%; }
.nav-item:hover { background: var(--panel-2); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item .ic { width: 20px; text-align: center; font-size: 16px; }
.nav-item .badge { margin-left: auto; font-size: 12px; background: var(--panel-2); color: var(--muted); border-radius: 999px; padding: 0 7px; }
.side .grow { flex: 1; }
.side .capture-btn { margin-top: 10px; }
main { min-width: 0; padding: 28px 32px 120px; max-width: 1400px; }
.bottom-nav { display: none; }
.fab { display: none; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  main { padding: calc(14px + env(safe-area-inset-top)) 16px calc(var(--nav-h) + 96px + env(safe-area-inset-bottom)); }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); }
  .bottom-nav a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 500; }
  .bottom-nav a .ic { font-size: 19px; line-height: 1; }
    .fab { display: grid; place-items: center; position: fixed; right: 18px; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); z-index: 41;
    width: 62px; height: 62px; border-radius: 50%; border: 0; background: #4a7547; color: #fff; font-size: 26px; box-shadow: 0 8px 24px rgba(60,110,60,.35); cursor: pointer; }
}

/* ---- headings ---- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; line-height: 1.1; margin: 0; letter-spacing: -.02em; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin: 26px 0 10px; display: flex; align-items: center; gap: 8px; }
.section-title .count { color: var(--muted); }

/* ---- buttons & inputs ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 8px 16px; border-radius: 999px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--panel-2); }
.btn.sm { padding: 5px 12px; font-size: 13px; border-radius: 999px; }
.btn:disabled { opacity: .5; cursor: default; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 500; }
.input, select.input, textarea.input { width: 100%; background: var(--panel-2); border: 1px solid transparent; border-radius: 10px; padding: 10px 12px; outline: none; }
.input:focus { border-color: var(--accent); background: var(--panel); }
textarea.input { resize: vertical; min-height: 80px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.page-head .row > * { flex: none; }
.seg { display: inline-flex; background: var(--panel-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; cursor: pointer; font-size: 13px; }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }

/* ---- chips ---- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; color: var(--muted); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.tag.draft { background: #d9a441; color: #1d1710; font-weight: 700; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; margin-right: 4px; }
.tag.due { color: var(--warn); }
.tag.over { color: var(--danger); font-weight: 600; }
.tag.time { color: var(--now); font-weight: 600; font-family: var(--mono); font-size: 11.5px; }

/* ---- task cards ---- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.task { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; cursor: pointer; position: relative; }
.task + .task { border-top: 1px solid var(--line); }
.list { overflow: hidden; }
.check { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--faint); background: none; cursor: pointer; margin-top: 1px; display: grid; place-items: center; padding: 0; color: transparent; font-size: 12px; transition: all .15s; }
.check:hover { border-color: var(--ok); color: var(--ok); }
.check.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.task .body { flex: 1; min-width: 0; }
.task .title { font-weight: 500; word-wrap: break-word; }
.task.is-done .title { text-decoration: line-through; color: var(--muted); }
.task .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 4px; }
.task .bar { position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; }
.prio-1 .title::before { content: "!"; color: var(--danger); font-weight: 700; margin-right: 6px; }
.ai-pending .title { color: var(--muted); }
.spinner { width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- now view ---- */
.hello { font-size: 14px; color: var(--muted); }
.clock { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.hero { position: relative; overflow: hidden; border-radius: 20px; padding: 22px; color: #fff; margin-bottom: 8px; }
.hero.fixed { background: linear-gradient(135deg, #cd5a2d, #b8473d); }
.hero.block { background: linear-gradient(135deg, var(--hero-c, #cd5a2d), color-mix(in srgb, var(--hero-c, #cd5a2d) 55%, #111)); }
.hero.free { background: linear-gradient(135deg, #62955f, #4d7a4a); }
.hero .kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; opacity: .85; font-weight: 600; }
.hero .big { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 4px; line-height: 1.15; }
.hero .when { opacity: .9; font-family: var(--mono); font-size: 13px; }
.hero .progress { height: 4px; background: rgba(255,255,255,.25); border-radius: 4px; margin-top: 14px; overflow: hidden; }
.hero .progress i { display: block; height: 100%; background: #fff; border-radius: 4px; }
.hero .actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.hero .actions .btn { background: rgba(255,255,255,.18); border-color: transparent; color: #fff; }
.hero .actions .btn:hover { background: rgba(255,255,255,.28); }
.focus-first { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.focus-first .title { font-size: 17px; font-weight: 600; }
.nudge { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-top: 12px; color: var(--muted); }
.nudge b { color: var(--ink); }
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 14px; padding: 10px 14px; align-items: center; cursor: pointer; }
.tl-item + .tl-item { border-top: 1px solid var(--line); }
.tl-item .t { font-family: var(--mono); font-size: 12.5px; color: var(--muted); width: 92px; flex: none; }
.empty { color: var(--muted); padding: 18px; text-align: center; }

/* ---- board ---- */
.board-tools { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; scroll-snap-type: x mandatory; }
.col { background: var(--panel-2); border-radius: 16px; padding: 10px; scroll-snap-align: start; min-height: 200px; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; font-weight: 600; font-size: 14px; }
.col-head .n { color: var(--muted); font-weight: 500; margin-left: 6px; }
.col-list { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.col .task { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.col .task + .task { border-top: 1px solid var(--line); }
.quick-add { width: 100%; background: transparent; border: 1px dashed var(--line); border-radius: 10px; padding: 9px 12px; margin-bottom: 8px; outline: none; }
.quick-add:focus { border-style: solid; border-color: var(--accent); background: var(--panel); }
.sortable-ghost { opacity: .35; }
.sortable-chosen { box-shadow: 0 10px 30px rgba(0,0,0,.2) !important; }
@media (max-width: 820px) { .board { grid-auto-columns: 84vw; margin: 0 -16px; padding: 0 16px 12px; } }

/* ---- week ---- */
.week-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.week { display: grid; grid-template-columns: 52px repeat(7, minmax(118px, 1fr)); min-width: 880px; position: relative; }
.wk-head { position: sticky; top: 0; z-index: 3; background: var(--panel); border-bottom: 1px solid var(--line); padding: 10px 8px; font-size: 13px; text-align: center; }
.wk-head b { display: block; font-size: 18px; }
.wk-head.today b { color: var(--accent); }
.wk-allday { border-bottom: 1px solid var(--line); padding: 4px; min-height: 30px; display: flex; flex-direction: column; gap: 3px; }
.wk-allday .pill { font-size: 11.5px; padding: 2px 6px; border-radius: 6px; background: var(--panel-2); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid var(--warn); }
.wk-hours { position: relative; }
.wk-hour { height: 48px; font-size: 11px; color: var(--muted); text-align: right; padding-right: 8px; transform: translateY(-7px); font-family: var(--mono); }
.wk-day { position: relative; border-left: 1px solid var(--line); background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% 48px; cursor: copy; }
.wk-block { position: absolute; left: 3px; right: 3px; border-radius: 8px; padding: 4px 7px; font-size: 12px; font-weight: 600; overflow: hidden; cursor: pointer;
  background: color-mix(in srgb, var(--c) 16%, transparent); color: color-mix(in srgb, var(--c) 80%, var(--ink)); border: 1px dashed color-mix(in srgb, var(--c) 55%, transparent); }
.wk-event { position: absolute; left: 10px; right: 4px; border-radius: 8px; padding: 4px 7px; font-size: 12px; overflow: hidden; cursor: pointer; z-index: 2;
  background: var(--c, var(--now)); color: #fff; font-weight: 500; box-shadow: var(--shadow); }
.wk-event.done { opacity: .45; text-decoration: line-through; }
.wk-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--now); z-index: 4; pointer-events: none; }
.wk-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--now); }

/* ---- projects ---- */
.area-block { margin-bottom: 26px; }
.area-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.area-head h2 { font-size: 18px; margin: 0; }
.area-head .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-size: 15px; }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.proj { padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.proj:hover { border-color: var(--faint); }
.proj .name { font-weight: 600; }
.proj .desc { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.proj .foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: auto; }
.proj.paused { opacity: .6; }

/* ---- sheets (modals) ---- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(10,10,15,.45); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s; }
.sheet { background: var(--panel); border-radius: 20px; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: rise .2s ease-out; }
.sheet h3 { margin: 0 0 16px; font-size: 19px; }
.sheet .foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.sheet .foot .left { margin-right: auto; }
@media (max-width: 820px) {
  .sheet-backdrop { align-items: center; justify-content: center; padding: 16px; }
  .sheet { border-radius: 20px; max-height: 88vh; max-width: 100%; padding: 20px; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: .6; } }

/* ---- capture ---- */
.capture { text-align: center; }
.mic { width: 96px; height: 96px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 38px; cursor: pointer; margin: 6px auto 14px; display: grid; place-items: center; transition: transform .15s; }
.mic.live { background: var(--now); animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--now) 60%, transparent); } 70% { box-shadow: 0 0 0 22px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.capture textarea { min-height: 120px; font-size: 16px; }
.capture .hint { color: var(--muted); font-size: 13px; margin-bottom: 12px; }

/* ---- login ---- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: 100%; max-width: 380px; padding: 28px; }
.login .brand { padding: 0 0 22px; font-size: 20px; }
.err { color: var(--danger); font-size: 14px; margin-bottom: 10px; }

/* ---- misc ---- */
#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 80; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%); }
@media (max-width: 820px) { #toast { bottom: calc(var(--nav-h) + 92px + env(safe-area-inset-bottom)); } }
.code { font-family: var(--mono); font-size: 12px; background: var(--panel-2); padding: 10px 12px; border-radius: 10px; overflow-x: auto; white-space: pre; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.settings-grid .card { padding: 20px; }
.settings-grid h3 { margin: 0 0 14px; font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---- whiteboard & presentation gallery ---- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.gcard { overflow: hidden; cursor: pointer; transition: transform .12s, border-color .12s; }
.gcard:hover { transform: translateY(-2px); border-color: var(--faint); }
.gcard .thumb { aspect-ratio: 16 / 10; background: #f6ece6; background-image: radial-gradient(#e8d6cc 1px, transparent 1px); background-size: 14px 14px;
  border-bottom: 1px solid var(--line); display: grid; place-items: center; padding: 10px; }
.gcard .thumb svg { width: 100%; height: 100%; }
.thumb-empty { color: #9aa3b0; font-size: 13px; }
.gmeta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 12px 14px; }
.gmeta .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 820px) { .gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; } .bottom-nav a { font-size: 10px; letter-spacing: -.1px; } .bottom-nav a .ic { font-size: 18px; } }

.tag.tg { color: var(--accent, #7c6cff); cursor: pointer; }
.tag.wb { color: var(--now); text-decoration: none; font-weight: 600; }
.tag.wb:hover { text-decoration: underline; }
.chip.tg { color: var(--accent, #7c6cff); }
.chip.tg.on { color: var(--bg); background: var(--accent, #7c6cff); border-color: var(--accent, #7c6cff); }
.chip .n { opacity: .65; font-size: 11px; margin-left: 2px; }
.chip.save { border-style: dashed; }
.chip .x { margin-left: 4px; opacity: .7; }
.views-row { margin-bottom: 8px; }
.tag.st { font-weight: 600; background: var(--accent-soft); color: var(--accent); }
.tag.st-doing { background: var(--now-soft); color: var(--now); }
.prog { height: 5px; border-radius: 3px; background: var(--line); margin: 8px 0 3px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--accent); }
.progtxt { font-size: 11px; color: var(--muted); }
.nextup { font-size: 12.5px; margin-top: 6px; color: var(--muted, inherit); }
.ptags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.proj-group { grid-column: 1 / -1; background: var(--panel-2); border-radius: 16px; padding: 10px; }
.proj-group > .card.group { margin-bottom: 10px; border-left: 4px solid var(--accent); }
.proj-grid.sub { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.sect { font-size: 15px; margin: 22px 0 8px; }
.jl { padding: 10px 12px; }
.jl-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.jl-row:last-of-type { border-bottom: 0; }
.jl-row.done .jl-name { color: var(--muted); }
.jl-main { flex: 1; min-width: 0; }
.jl-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jl-add { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.jl-add .input { flex: 1; min-width: 140px; }
.jobs { display: grid; gap: 10px; }
.card.job { padding: 12px 14px; cursor: pointer; }
.card.job.saved { border-left: 4px solid var(--accent); }
.job .jt { font-weight: 600; font-size: 15px; color: inherit; text-decoration: none; }
.job .jt:hover { text-decoration: underline; }
.job .jd { margin-top: 6px; font-size: 13px; color: var(--muted, inherit); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.job .jb { display: flex; gap: 8px; margin-top: 8px; }
.jobs { grid-template-columns: minmax(0, 1fr); }
.card.job { min-width: 0; overflow-wrap: anywhere; }
.jl-row { min-width: 0; }

.jf{display:grid;gap:8px;margin-bottom:10px}.jf-row{display:flex;flex-wrap:wrap;gap:6px}.jf-row .input{flex:1 1 130px;min-width:0}
.jtags{display:flex;flex-wrap:wrap;gap:4px;margin:3px 0}#f-rule{flex-wrap:wrap}#f-rule .input{flex:1 1 130px;min-width:0}
#toast.act { pointer-events: auto; display: flex; gap: 14px; align-items: center; }
#toast button { background: transparent; border: 0; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 0; }
@media (min-width: 821px) { #toast { left: auto; right: 24px; transform: translateY(20px); } #toast.show { transform: none; } }
.jtabs { margin-bottom: 12px; overflow-x: auto; flex-wrap: nowrap; } .jtabs .chip { white-space: nowrap; }
.tag.st.ok { background: rgba(60,170,100,.18); color: #237a48; } .card.job.applied { border-left: 3px solid #2f9e5e; }
.jb { display: flex; flex-wrap: wrap; gap: 6px; } .stack { display: grid; gap: 8px; } .stack textarea { width: 100%; font: inherit; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; } .sheet-head h3 { margin: 0; font-size: 16px; }

/* Knowledge base */
.kbtabs { margin-bottom: 4px; }
.kbtop { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; text-decoration: none; color: inherit; }
.kbtop:hover { border-color: var(--faint); }
.kbbanner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; margin-bottom: 16px; flex-wrap: wrap; }
.kbdoc { max-width: 820px; margin: 18px 0 80px; line-height: 1.6; }
.kbdoc h1 { font-size: 1.9rem; line-height: 1.2; margin: .3em 0; }
.kbdoc h2 { font-size: 1.4rem; margin-top: 1.8em; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.kbdoc h3 { font-size: 1.15rem; margin-top: 1.4em; }
.kbdoc blockquote { margin: 1em 0; padding: 4px 16px; border-left: 4px solid var(--faint); background: var(--panel-2); border-radius: 0 8px 8px 0; }
.kbdoc code { background: var(--panel-2); padding: 1px 5px; border-radius: 5px; font-size: .88em; }
.kbdoc pre { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow: auto; }
.kbdoc pre code { background: none; padding: 0; }
.kbdoc table { border-collapse: collapse; display: block; overflow: auto; margin: 1em 0; }
.kbdoc th, .kbdoc td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.kbdoc th { background: var(--panel-2); }
.kbdoc hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.kbdoc a { color: inherit; text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 2px; }
.kbmeta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0 14px; font-size: 13px; color: var(--muted); }
.kbrel { margin-top: 2em; border-top: 1px solid var(--line); padding-top: 4px; }
.kbrel a, .kbres { display: block; padding: 5px 0; text-decoration: none; }
.kbres { padding: 10px 0; border-bottom: 1px solid var(--line); }

/* ---- videos ---- */
.vlist { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.vcard { padding: 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vc-top { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.vc-title { font-weight: 600; overflow-wrap: anywhere; }
.vc-btns { display: flex; gap: 8px; margin-top: 8px; }
.vc-btns .btn { flex: 1; justify-content: center; }
.vtext { padding: 16px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.vhint { line-height: 1.5; }
.vprog { margin: 10px 0; }
.vbar { height: 8px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.vbar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.vp { position: fixed; inset: 0; z-index: 9999; background: #000; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.vp video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.vsub { position: absolute; pointer-events: none; color: #000; font-weight: 700; font-size: clamp(15px, 3.4vmin, 30px); line-height: 1.3; overflow-wrap: anywhere;
  text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff, 0 -1px 0 #fff, 0 1px 0 #fff, -1px 0 0 #fff, 1px 0 0 #fff; }
.vsub.off, .vsub.empty { display: none; }
.vsub.pos-bottom { left: 10%; right: 10%; bottom: 6%; text-align: center; }
.vsub.pos-top { left: 10%; right: 10%; top: 6%; text-align: center; }
.vsub.pos-left { left: 2%; width: 24%; top: 50%; transform: translateY(-50%); text-align: left; }
.vsub.pos-right { right: 2%; width: 24%; top: 50%; transform: translateY(-50%); text-align: right; }
.vflash { position: absolute; top: 12%; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.7); color: #fff; padding: 6px 14px; border-radius: 999px; font-size: 13px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.vflash.on { opacity: 1; }
.vctl { position: absolute; inset: 0; display: none; pointer-events: none; background: rgba(0,0,0,.25); }
.vp.paused .vctl { display: block; }
.vctl > * { pointer-events: auto; position: absolute; }
.vx { top: 10px; left: 10px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 18px; }
.vsubt { top: 10px; right: 10px; padding: 10px 14px; border-radius: 999px; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 14px; }
.vbig { top: 50%; left: 50%; transform: translate(-50%, -50%); width: 72px; height: 72px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); color: #000; font-size: 28px; padding-left: 5px; }
.vscrub { left: 6%; right: 6%; bottom: 22%; display: flex; align-items: center; gap: 10px; color: #fff; font-size: 13px; font-variant-numeric: tabular-nums; }
.vscrub input { flex: 1; min-width: 0; height: 32px; }
.vscrub span { flex: none; min-width: 38px; text-align: center; }
.morelist { display: grid; gap: 10px; }
.morelink { display: flex; align-items: center; gap: 12px; padding: 16px; text-decoration: none; color: inherit; font-weight: 600; }
.morelink .ic { font-size: 20px; width: 26px; text-align: center; }
html, body { overflow-x: hidden; }

/* ---- Jörniverse look: orange side bar, cream page, pill buttons ---- */
.side { background: var(--side-bg); border-right: 0; }
.side .brand { color: var(--side-ink); }
.side .nav-item { color: var(--side-ink); }
.side .nav-item:hover { background: rgba(0,0,0,.12); color: var(--side-ink); }
.side .nav-item.active { background: rgba(0,0,0,.22); color: var(--side-ink); font-weight: 700; }
.side .nav-item .badge { background: rgba(0,0,0,.25); color: var(--side-ink); }
.side .btn { background: #4a7547; border-color: #4a7547; color: #fff; }
.side .btn:hover { background: #3f663d; }
.side .btn.ghost { background: transparent; border-color: transparent; color: var(--side-ink); }
.bottom-nav a.active { color: var(--accent); }

/* ---- orange bottom bar ---- */
@media (max-width: 820px) {
  .bottom-nav { background: var(--side-bg); border-top: 0; backdrop-filter: none; }
  .bottom-nav a { color: #fff; margin: 6px 2px; border-radius: 14px; }
  .bottom-nav a.active { color: #fff; font-weight: 700; background: rgba(0,0,0,.24); }
}
.hero.fixed { background: linear-gradient(135deg, #b8862a, #9f741e); }
.hero.free { background: linear-gradient(135deg, #62955f, #4d7a4a); }

/* ---- capture chat ---- */
.chat-log{display:none;text-align:left;max-height:42vh;overflow-y:auto;margin:0 0 12px;padding:2px}
.capture.chatting .chat-log{display:flex;flex-direction:column;gap:8px}
.capture.chatting #mic{width:44px;height:44px}
.capture.chatting textarea{min-height:64px}
.msg{padding:9px 13px;border-radius:16px;font-size:15px;line-height:1.4;white-space:pre-wrap;max-width:88%;word-wrap:break-word}
.msg.user{align-self:flex-end;background:var(--accent-soft);color:var(--ink);border-bottom-right-radius:4px}
.msg.agent{align-self:flex-start;background:var(--panel-2);color:var(--ink);border-bottom-left-radius:4px}
.msg.thinking{display:flex;gap:5px;padding:12px 14px}
.msg.thinking span{width:7px;height:7px;border-radius:50%;background:var(--muted);animation:dot 1.2s infinite ease-in-out}
.msg.thinking span:nth-child(2){animation-delay:.15s}.msg.thinking span:nth-child(3){animation-delay:.3s}
@keyframes dot{0%,80%,100%{opacity:.25}40%{opacity:1}}

.dash-tabs { max-width: 320px; margin-bottom: 14px; }
.dash-tabs .badge { margin-left: 6px; font-size: 11px; background: var(--accent); color: #fff; border-radius: 999px; padding: 0 6px; }
.bottom-nav a { position: relative; }
.bottom-nav a .badge { position: absolute; top: 4px; left: calc(50% + 6px); font-size: 10px; line-height: 15px; min-width: 15px; text-align: center; background: var(--accent); color: #fff; border-radius: 999px; padding: 0 4px; }
.badge.hidden { display: none; }

/* ---- ported from the Lab: card view, tags, lists, tree ---- */
.ls-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; margin-right: 7px; }
.ls-bar { padding: 12px 14px; margin-bottom: 12px; }
.ls-order { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.ls-k { cursor: grab; color: var(--ink); }
.ls-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 0 0 4px; }
.ls-add { display: flex; gap: 8px; margin-bottom: 14px; }
.ls-add select.input { width: auto; flex: none; }
.ls-add .input[name=title] { flex: 1; min-width: 0; }
.ls-tree { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 1px solid var(--line); }
.ls-tree.ls-top { padding-left: 0; border-left: 0; }
.ls-row { display: flex; align-items: center; padding: 5px 4px; border-radius: 8px; cursor: pointer; }
.ls-row:hover { background: var(--panel-2); }
.ls-title { overflow-wrap: anywhere; }
.ls-badge { margin-left: 8px; font-size: 11px; color: var(--muted); background: var(--panel-2); border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.ls-records { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ls-rec { padding: 10px 12px; }
.ls-prop { display: flex; gap: 10px; align-items: baseline; margin-top: 6px; }
.ls-prop > .muted { width: 70px; flex: none; }
.ls-prop > span:last-child { display: flex; flex-wrap: wrap; gap: 4px; }
.ls-pill { display: inline-flex; align-items: center; background: var(--panel-2); border-radius: 999px; padding: 2px 9px; font-size: 13px; color: var(--ink); text-decoration: none; }
.ls-links { display: flex; flex-wrap: wrap; gap: 6px; }
.ls-sug { display: grid; gap: 2px; margin-top: 4px; }
.ls-s { text-align: left; border: 0; background: var(--panel-2); border-radius: 8px; padding: 8px 10px; cursor: pointer; color: var(--ink); display: flex; align-items: center; }
.ls-krow { gap: 8px; margin-bottom: 8px; }
.ls-krow .input { flex: 1; min-width: 0; }
.ls-krow input[type=color] { width: 34px; height: 34px; padding: 0; border: 0; background: none; flex: none; }

.mapslide { margin-top: 12px; padding: 22px 26px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 2px 14px rgba(0,0,0,.12); }
.mapslide h2 { font-size: 1.9rem; line-height: 1.2; margin: .15em 0 .35em; }
.mapslide p { margin: 0; max-width: 70ch; line-height: 1.55; }
.maph { margin: 22px 0 8px; font-size: 1.1rem; }
.mapgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 14px; align-items: start; }
.mapgrid.small { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin-top: 0; }
.mapcard { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.mapcard:focus-visible { outline: 2px solid var(--accent, #7c6cff); outline-offset: 2px; }
.mc-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.mc-in { flex: none; padding: 2px 9px; font-size: 12px; }
.mc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.mc-tags .chip { padding: 2px 9px; font-size: 12px; text-decoration: none; }
.mc-tags.big .chip { padding: 5px 12px; font-size: 14px; }
.mc-syn { color: var(--muted); line-height: 1.45; }
@media (hover: hover) {
  .mapcard .mc-syn { max-height: 0; overflow: hidden; opacity: 0; transition: max-height .2s ease, opacity .2s ease; }
  .mapcard:hover, .mapcard:focus-visible { transform: scale(1.04); box-shadow: 0 8px 26px rgba(0,0,0,.25); border-color: var(--faint); position: relative; z-index: 2; }
  .mapcard:hover .mc-syn, .mapcard:focus-visible .mc-syn { max-height: 14em; opacity: 1; }
}
@media (hover: none) { .mapcard .mc-syn { max-height: none; opacity: 1; } .mapcard:hover { transform: none; box-shadow: none; } }
.mapcard { min-width: 0; overflow-wrap: anywhere; }
.mapslide h2, .crumbs { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .mapgrid, .mapgrid.small { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mapcard { padding: 10px 11px; }
  .mapcard:hover, .mapcard:focus-visible { transform: none; box-shadow: none; border-color: var(--line); }
  .mapcard .mc-syn { max-height: none; opacity: 1; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; }
  .mc-head { flex-wrap: wrap; }
  .mapslide { padding: 14px 16px; border-radius: 14px; }
  .mapslide h2 { font-size: 1.35rem; }
  .mapslide p { font-size: 14px; }
  .mc-tags.big { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mc-tags.big .chip { min-width: 0; justify-content: space-between; overflow: hidden; }
}
.sheet-backdrop.modal-center { align-items: center; justify-content: center; padding: 16px; }
.sheet-backdrop.modal-center .sheet { border-radius: 20px; max-height: 80vh; max-width: min(560px, 100%); padding-bottom: 22px; overflow-wrap: anywhere; }
.sheet-backdrop.modal-center .sheet-head h3 { font-size: 19px; }
.tbcard { color: inherit; text-decoration: none; display: block; }
.tbcard .thumb { color: var(--accent); }
.tb-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.tb-bar .input { flex: 1 1 200px; min-width: 0; max-width: 340px; }
.tb-scroll { overflow-x: auto; overscroll-behavior-x: contain; padding: 14px 4px 24px; margin-top: 8px; -webkit-overflow-scrolling: touch; }
.tb, .tb-kids { list-style: none; margin: 0; padding: 0; }
.tb { width: max-content; min-width: 100%; }
.tb-kids { display: flex; flex-direction: column; margin-left: 22px; position: relative; }
.tb-kids::before { content: ""; position: absolute; left: -22px; top: 50%; width: 22px; border-top: 1.5px solid var(--line); }
.tb-n { display: flex; align-items: center; position: relative; padding: 4px 0 4px 26px; }
.tb > .tb-n { padding-left: 0; }
.tb-n::before { content: ""; position: absolute; left: 0; top: 50%; width: 26px; border-top: 1.5px solid var(--line); }
.tb-n::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 1.5px solid var(--line); }
.tb-n:first-child::after { top: 50%; } .tb-n:last-child::after { bottom: 50%; } .tb-n:only-child::after { display: none; }
.tb > .tb-n::before, .tb > .tb-n::after { display: none; }
.tb-chip { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; width: 250px; flex: none; padding: 5px 8px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--panel); font-size: 13px; }
.tb-chip.has { background: var(--accent-soft); border-color: var(--accent); }
.tb-chip.hit { box-shadow: 0 0 0 2px var(--accent); }
.tb-chip:hover { border-color: var(--accent); }
.tb-arrow { width: 20px; flex: none; text-align: center; color: var(--muted); border: 0; background: none; padding: 0; font-size: 14px; cursor: pointer; user-select: none; }
.tb-title { flex: 1 1 0; min-width: 0; text-align: left; border: 0; background: none; padding: 2px 0; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-title:hover { text-decoration: underline; }
.tb-count { flex: none; font-size: 11px; color: var(--muted); }
.tb-doc { flex: none; font-size: 11px; text-decoration: none; }
.tb-tags { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 4px; padding-left: 26px; }
.tb-tags .chip { padding: 1px 8px; font-size: 11px; cursor: pointer; }
@media (max-width: 640px) { .tb-chip { width: 220px; } .tb-bar .input { max-width: none; } }
.ls-inkb { margin-top: 14px; }
.tb-chip.root { border-width: 2px; font-size: 15px; } .tb-chip.root .tb-title { font-weight: 700; }

.vcmbtn { left: 50%; top: calc(50% - 100px); transform: translateX(-50%); padding: 10px 16px; border-radius: 999px; border: 0; background: rgba(255,255,255,.9); color: #000; font-size: 15px; font-weight: 600; }
.vcmbox { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(480px, 90%); padding: 14px; border-radius: 14px; background: var(--panel); color: var(--ink); z-index: 5; display: flex; flex-direction: column; gap: 8px; }
.vcmbox.hidden { display: none; }
.vcmbox textarea { width: 100%; font: inherit; padding: 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); }
.vcms { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.vcm { display: flex; gap: 8px; align-items: baseline; font-size: 14px; }
.vts { flex: none; border: 0; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 2px 10px; font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; }
.vcm-b { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.at { background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.atbar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.atbar.hidden { display: none; }
.atbar .chip { cursor: pointer; border: 0; }

.tn-top { display:flex; gap:8px; flex-wrap:wrap; align-items:center; padding:12px; margin-bottom:14px }
.tn-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(340px,1fr)); gap:14px; align-items:start }
.tn-card { padding:14px }
.tn-cols { display:grid; grid-template-columns:1fr 1fr; gap:12px }
.tn-lab { font-size:12px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; margin-bottom:4px }
.tn-row { display:flex; gap:8px; align-items:flex-start; padding:5px 0; font-size:14px; cursor:pointer }
.tn-row input { margin-top:3px }
.tn-add { display:flex; gap:6px; margin-top:6px } .tn-add .input { padding:6px 8px; font-size:13px; min-width:0 }
.tn-proj { margin-top:12px; padding-top:10px; border-top:1px dashed var(--faint) } .tn-ph { font-weight:600; margin-bottom:6px }
.tn-docs { display:flex; gap:6px; flex-wrap:wrap; margin-top:8px }
@media (max-width:520px) { .tn-cols { grid-template-columns:1fr } .tn-grid { grid-template-columns:1fr } }

.needed-pill { display:inline-block; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; padding:1px 6px; border-radius:99px; background:var(--panel-2); color:var(--muted); border:1px solid var(--faint); vertical-align:1px }
.note { padding:12px; margin-bottom:10px } .note-body { white-space:pre-wrap; word-break:break-word; cursor:text; min-height:1.4em }
.note-foot { justify-content:space-between; align-items:center; margin-top:8px }
.mic.sm { width:44px; height:44px }

.sheet-backdrop.chat-full { padding: 0; align-items: stretch; justify-content: stretch; background: var(--panel) }
.chat-full .sheet { max-width: none; max-height: none; height: 100dvh; border-radius: 0; box-shadow: none; display: flex; flex-direction: column; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); overflow: hidden }
.chat-full .capture { display: flex; flex-direction: column; flex: 1; min-height: 0 }
.chat-full .capture.chatting .chat-log { flex: 1; max-height: none; min-height: 0 }
.chat-full .chat-log { width: 100%; max-width: 760px; margin-left: auto; margin-right: auto }
.chat-full .capture > :not(.chat-log) { flex-shrink: 0; width: 100%; max-width: 760px; margin-left: auto; margin-right: auto }
.chat-log .earlier { align-self: center; margin-bottom: 4px }
.msg .capt{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin-bottom:3px}
.task .ctx{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin-bottom:2px}
.task:has(.ctx) .meta .tag:has(.dot){display:none}
.msg.sys{align-self:center;background:var(--panel-2);color:var(--muted);font-size:13px;text-align:center;border:1px dashed var(--faint)}
.dash-tabs{flex-wrap:wrap}
.nb { border:1px solid transparent; font-weight:600 }
.nb-pub { background:color-mix(in srgb,#3d9970 18%,transparent); color:#1f5f41; border-color:color-mix(in srgb,#3d9970 40%,transparent) }
.nb-task { background:color-mix(in srgb,#4a7bd0 18%,transparent); color:#3560b0; border-color:color-mix(in srgb,#4a7bd0 40%,transparent) }
.nb-pin { background:color-mix(in srgb,#d4a017 20%,transparent); color:#9a7410; border-color:color-mix(in srgb,#d4a017 45%,transparent) }
.nb-del { background:color-mix(in srgb,#d04a4a 14%,transparent); color:#b03a3a; border-color:color-mix(in srgb,#d04a4a 35%,transparent) }
@media (prefers-color-scheme:dark) { :root:not([data-theme="light"]) .nb-pub { color:#7fd3a8 } :root:not([data-theme="light"]) .nb-task { color:#9bbcf2 } :root:not([data-theme="light"]) .nb-pin { color:#e8c668 } :root:not([data-theme="light"]) .nb-del { color:#f09a9a } }
:root[data-theme="dark"] .nb-pub { color:#7fd3a8 } :root[data-theme="dark"] .nb-task { color:#9bbcf2 } :root[data-theme="dark"] .nb-pin { color:#e8c668 } :root[data-theme="dark"] .nb-del { color:#f09a9a }
.note-foot { flex-wrap:wrap; gap:8px }
.tn-tog { background:none; border:0; width:100%; text-align:left; display:flex; align-items:center; gap:8px; padding:6px 0; font:inherit; color:inherit; cursor:pointer }
.tn-head { font-size:1.05em } .tn-car { width:14px; color:var(--muted) }
.tn-cnt { margin-left:auto; font-size:12px; color:var(--muted); font-weight:500 }
.tn-body { margin-top:6px }
.wk-gcal { position:absolute; left:2px; right:2px; z-index:1; overflow:hidden; font-size:12px; padding:2px 5px; border-radius:6px; border-left:3px solid var(--c); background:color-mix(in srgb,var(--c) 22%,var(--panel,#fff)); cursor:pointer; opacity:.92; pointer-events:auto }
.pill.gcal { opacity:.85; cursor:pointer; background:color-mix(in srgb,var(--panel-2,#eee) 80%,transparent) }
.nb { flex:none; padding:8px 13px; min-height:36px; white-space:nowrap } .note-foot > span.row { flex-wrap:wrap; gap:8px }
.wk-closed { position:absolute; inset:0; z-index:0; pointer-events:none; background:repeating-linear-gradient(135deg,color-mix(in srgb,var(--muted,#888) 14%,transparent) 0 8px,transparent 8px 16px); display:flex; align-items:flex-start; justify-content:center; padding-top:10px }
.wk-closed span { font-size:12px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--muted,#777); background:var(--bg,#fff); padding:2px 8px; border-radius:999px; border:1px solid var(--faint,#ddd) }
.wk-closed.solo { background:repeating-linear-gradient(135deg,color-mix(in srgb,var(--muted,#888) 26%,transparent) 0 8px,transparent 8px 16px) } .wk-closed.solo span { font-size:13px }
.tn-pub { border:0; cursor:pointer; font:inherit; font-size:11px } .tn-pub.pubd { background:color-mix(in srgb,#3d9970 18%,transparent); color:#1f5f41 }

.pp{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.pp-th{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.pp-t{position:relative;display:inline-block}
.pp-t img{width:48px;height:48px;object-fit:cover;border-radius:8px;display:block}
.pp-t button{position:absolute;top:-6px;right:-6px;width:20px;height:20px;border-radius:50%;border:0;background:#000b;color:#fff;font-size:11px;line-height:20px;padding:0;cursor:pointer}
.cm-pics{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}
.cm-pics img{max-width:160px;max-height:160px;border-radius:8px;display:block;object-fit:cover}
.vpp{margin:6px 0}

.gsrc{font-size:10.5px;font-weight:400;opacity:.75}.gsrc.inl{display:inline;margin-left:4px}
.wk-allday .pill .gsrc{display:block}

#remind { position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(460px, calc(100vw - 24px)); z-index: 90; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.remind-item { pointer-events: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--ink); color: var(--bg); padding: 12px 14px; border-radius: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.25); transform: translateY(-140%); opacity: 0; transition: transform .3s ease, opacity .3s ease; }
.remind-item.in { transform: none; opacity: 1; }

.seg a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: 13px; }
.seg a.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.sheet:has(.prof-wide) { max-width: 760px; }

/* Discussions */
.dcols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; align-items: start; }
.dcol > h3 { margin: 0 0 10px; font-size: 15px; }
.dcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.dcard.resolved { opacity: .6; }
.dtext { white-space: pre-wrap; word-break: break-word; margin: 4px 0; }
.dreply { border-left: 3px solid var(--accent-soft); padding-left: 10px; margin: 8px 0; }
.dres { margin-top: 18px; } .dres summary { cursor: pointer; color: var(--muted); margin-bottom: 10px; }
.dwb-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.dwb { position: relative; overflow: hidden; height: calc(100vh - 340px); min-height: 380px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); touch-action: none; overscroll-behavior: contain; cursor: grab; }
.dwb.draw, .dwb.erase { touch-action: none; cursor: crosshair; }
.dwb.draw .dwb-card, .dwb.erase .dwb-card { pointer-events: none; opacity: .92; }
.dwb-world { position: absolute; left: 0; top: 0; width: 1px; height: 1px; transform-origin: 0 0; }
.dwb-svg { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; color: var(--muted); pointer-events: none; }
.dwb-svg .dlink-x { pointer-events: all; cursor: pointer; } .dwb-svg .dlink-x circle { fill: var(--panel); stroke: var(--muted); } .dwb-svg .dlink-x text { fill: var(--ink); font-size: 14px; }
.dwb-card { touch-action: none; position: absolute; width: 220px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; box-shadow: 0 2px 6px rgba(0,0,0,.12); cursor: move; user-select: none; }
.dwb-card.resolved { opacity: .55; } .dwb-card.linking { outline: 2px solid var(--accent); }
.dwb-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.dwb-text { white-space: pre-wrap; word-break: break-word; margin: 4px 0; font-size: 14px; }
.dmodal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.dmodal-in { background: var(--bg); border-radius: 14px; padding: 14px; width: min(520px, 100%); max-height: 90vh; overflow: auto; }

.dink { fill: none; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.dhit { fill: none; stroke: transparent; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.dwb.erase .dhit { pointer-events: stroke; }
.dpens { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.dpens .sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.dpens .sw.on { box-shadow: 0 0 0 2px var(--ink); }
.dedit { width: 100%; }
.dinfo-btn { border: 1px solid var(--line); background: var(--panel); color: var(--accent); border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 600; cursor: pointer; }
.dinfo-text { white-space: pre-wrap; word-break: break-word; margin: 10px 0 4px; line-height: 1.5; }
.dwb-card .dinfo-btn { padding: 1px 8px; font-size: 12px; }
@media (pointer: coarse) { .dpens .sw { width: 34px; height: 34px; } }

/* 0.2.2: help links, grouped More page, one activity feed, admin tabs */
.help-link{display:inline-block;margin:2px 0 0 10px;padding:1px 9px;border:1px solid var(--line);border-radius:99px;color:var(--muted);text-decoration:none;vertical-align:middle;font-weight:600}
.help-link:hover{color:var(--ink);border-color:var(--accent)}
.page-head h1 + .help-link{margin-left:0;margin-top:4px}
.more-h{margin:16px 0 8px;font-size:13px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
.more-h:first-of-type{margin-top:4px}
.act-it.unread{border-left:3px solid var(--accent)}
.act-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--accent);margin-right:6px;vertical-align:middle}
.admin-tabs{overflow-x:auto;flex-wrap:nowrap;max-width:100%;scrollbar-width:thin}
.admin-tabs .seg-b{white-space:nowrap}
.rmchip{text-decoration:none}
@media (max-width:700px){
  .col-list{min-height:56px}
  .task{touch-action:manipulation}
  .page-head{flex-wrap:wrap}
}
.opengroups{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:8px}
.og{display:flex;gap:10px;align-items:flex-start;justify-content:space-between;border:1px solid var(--line);border-radius:12px;padding:10px 12px;background:var(--panel)}
.og .btn{flex:none}

/* One audience picker (0.2.4) */
.aud { display: flex; flex-direction: column; gap: 8px; }
.aud-modes { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 3px; background: var(--panel); flex-wrap: nowrap; }
.aud-mode { flex: 1; display: flex; min-width: 0; }
.aud-mode input { position: absolute; opacity: 0; pointer-events: none; }
.aud-mode span { flex: 1; text-align: center; padding: 8px 6px; border-radius: 999px; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.aud-mode input:checked + span { background: var(--accent); color: var(--accent-ink); }
.aud-mode input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.aud-mode.off span { opacity: .45; cursor: not-allowed; }
.aud-groups { display: flex; flex-wrap: wrap; gap: 6px; }
.aud-groups[hidden] { display: none; }
.aud-chip { display: inline-flex; align-items: center; cursor: pointer; }
.aud-chip input { position: absolute; opacity: 0; pointer-events: none; }
.aud-chip span { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; background: var(--panel); min-height: 32px; display: inline-flex; align-items: center; }
.aud-chip input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.aud-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.aud-who { margin: 0; }
.aud-line { margin: 0 0 14px; }
.act-fpanel[hidden] { display: none; }

/* Read-only account notice */
.ro-banner { position: sticky; top: 0; z-index: 60; padding: 8px 14px; font-size: 13.5px; background: var(--panel-2); color: var(--text, inherit); border-bottom: 2px solid var(--warn); text-align: center; }

/* ---- accessibility: touch targets at least 24px, roomier checkboxes (Suite 0.1.12) ---- */
.help-link { display: inline-flex; align-items: center; min-height: 28px; padding: 0 4px; }
.rm-chip, .tag.rmchip { min-height: 24px; display: inline-flex; align-items: center; }
input[type="checkbox"], input[type="radio"] { min-width: 18px; min-height: 18px; }
label:has(> input[type="checkbox"]), label:has(> input[type="radio"]) { min-height: 28px; display: inline-flex; align-items: center; gap: 6px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 80%, var(--ink)); outline-offset: 2px; }
.week-wrap:focus-visible { outline-offset: -3px; }
[role="dialog"]:focus { outline: none; }
.ss-wrap{position:relative;display:inline-block;flex:1;min-width:180px}.ss-wrap .ss-in{width:100%}
.ss-list{position:absolute;z-index:60;left:0;right:0;top:100%;margin:2px 0 0;padding:4px 0;list-style:none;background:var(--panel);color:var(--ink);border:1px solid var(--line);border-radius:10px;max-height:260px;overflow:auto;box-shadow:0 8px 24px rgba(0,0,0,.18)}
.ss-list li{padding:9px 12px;min-height:24px;cursor:pointer}.ss-list li[aria-selected="true"],.ss-list li:hover{background:var(--soft,rgba(0,0,0,.06))}.ss-list .ss-none{color:var(--muted);cursor:default}

/* ---- Display and accessibility (Suite 0.1.14) ----
   High contrast: the same palette (Moss green, portal orange, cream, near-black) rearranged for the most contrast.
   Text near-black on cream, or cream on near-black; deep orange (#7a3518) and deep moss (#2c4a28) for accents.
   Moss green on orange never passes (1.0 to 2.0:1), so it is never used for text on orange.
   Chosen in Settings > Customise (data-contrast="high"), or the device's "more contrast" setting when no choice is made. */
:root[data-contrast="high"] {
  --bg: #fffaf5; --panel: #ffffff; --panel-2: #f6ece6; --ink: #140c08; --muted: #3b2a22; --faint: #4f3e35;
  --line: #3b2a22; --accent: #2c4a28; --accent-ink: #fffaf5; --accent-soft: #e3eedf;
  --danger: #8a1f16; --ok: #2c4a28; --warn: #5e4208; --now: #2c4a28; --now-soft: #e3eedf; --cta: #2c4a28;
  --side-bg: #7a3518; --side-ink: #fffaf5; --shadow: none; color-scheme: light;
}
:root[data-contrast="high"][data-theme="dark"] {
  --bg: #0f0906; --panel: #1a110d; --panel-2: #241812; --ink: #fffaf5; --muted: #e9ddd5; --faint: #c9b9af;
  --line: #e9ddd5; --accent: #b5e0b1; --accent-ink: #0f0906; --accent-soft: #1f3320;
  --danger: #ffb3a8; --ok: #b5e0b1; --warn: #f0c463; --now: #b5e0b1; --now-soft: #1f3320; --cta: #b5e0b1;
  --side-bg: #7a3518; --side-ink: #fffaf5; --shadow: none; color-scheme: dark;
}
@media (prefers-color-scheme: dark) { :root[data-contrast="high"]:not([data-theme="light"]) {
  --bg: #0f0906; --panel: #1a110d; --panel-2: #241812; --ink: #fffaf5; --muted: #e9ddd5; --faint: #c9b9af;
  --line: #e9ddd5; --accent: #b5e0b1; --accent-ink: #0f0906; --accent-soft: #1f3320;
  --danger: #ffb3a8; --ok: #b5e0b1; --warn: #f0c463; --now: #b5e0b1; --now-soft: #1f3320; --cta: #b5e0b1;
  --side-bg: #7a3518; --side-ink: #fffaf5; --shadow: none; color-scheme: dark;
}}
@media (prefers-contrast: more) {
  :root:not([data-contrast]) {
    --bg: #fffaf5; --panel: #ffffff; --panel-2: #f6ece6; --ink: #140c08; --muted: #3b2a22; --faint: #4f3e35;
    --line: #3b2a22; --accent: #2c4a28; --accent-ink: #fffaf5; --accent-soft: #e3eedf;
    --danger: #8a1f16; --ok: #2c4a28; --warn: #5e4208; --now: #2c4a28; --now-soft: #e3eedf; --cta: #2c4a28;
    --side-bg: #7a3518; --side-ink: #fffaf5; --shadow: none;
  }
  :root:not([data-contrast])[data-theme="dark"] {
    --bg: #0f0906; --panel: #1a110d; --panel-2: #241812; --ink: #fffaf5; --muted: #e9ddd5; --faint: #c9b9af;
    --line: #e9ddd5; --accent: #b5e0b1; --accent-ink: #0f0906; --accent-soft: #1f3320;
    --danger: #ffb3a8; --ok: #b5e0b1; --warn: #f0c463; --now: #b5e0b1; --now-soft: #1f3320; --cta: #b5e0b1;
    --side-bg: #7a3518; --side-ink: #fffaf5; --shadow: none;
  }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) { :root:not([data-contrast]):not([data-theme="light"]) {
  --bg: #0f0906; --panel: #1a110d; --panel-2: #241812; --ink: #fffaf5; --muted: #e9ddd5; --faint: #c9b9af;
  --line: #e9ddd5; --accent: #b5e0b1; --accent-ink: #0f0906; --accent-soft: #1f3320;
  --danger: #ffb3a8; --ok: #b5e0b1; --warn: #f0c463; --now: #b5e0b1; --now-soft: #1f3320; --cta: #b5e0b1;
  --side-bg: #7a3518; --side-ink: #fffaf5; --shadow: none;
}}
/* Stronger edges, underlined links and a thick focus ring whenever high contrast is on. */
:root.hc a, :root[data-links="underline"] a { text-decoration: underline; text-underline-offset: 2px; }
:root.hc .btn, :root.hc .input, :root.hc select, :root.hc textarea, :root.hc .seg, :root.hc .chip { border: 2px solid var(--line) !important; }
:root.hc .card, :root.hc .sheet { border: 2px solid var(--line); box-shadow: none; }
:root.hc :focus-visible { outline: 3px solid var(--ink) !important; outline-offset: 2px; }
:root.hc .sidebar :focus-visible, :root.hc .side :focus-visible { outline-color: var(--side-ink) !important; }
/* Status never by colour alone: a small text mark before coloured status words. */
:root.hc .nb-pub::before { content: "✓ "; } :root.hc .nb-del::before { content: "✕ "; } :root.hc .nb-pin::before { content: "★ "; }
/* Text size: the whole interface scales, so nothing is cut off at phone width. */
:root[data-text="large"] body { zoom: 1.15; }
:root[data-text="larger"] body { zoom: 1.3; }
/* Reduce motion: chosen here, or the device setting. */
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
/* The "Make it comfortable" step and the Display card. */
.dp-grid { display: grid; gap: 14px; }
.dp-row > b { display: block; margin: 0 0 6px; }
.dp-row .seg { flex-wrap: wrap; }
.dp-row .seg button { min-height: 44px; }

.ok-msg { background: var(--soft, #f6ece6); color: var(--ink, #140c08); border-left: 3px solid var(--accent, #a84a24); padding: 8px 10px; border-radius: 6px; margin: 0 0 10px; font-size: .9rem; }
/* Learniverse panel: group grants table and computers list (Suite 0.1.17). */
.ap-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.ap-table th, .ap-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.ap-table td input { width: 22px; height: 22px; }
.ap-devs { list-style: none; padding: 0; margin: 0; }
.ap-devs li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.dl-card .dl-rel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.dl-card .dl-rel:last-child { border-bottom: 0; }
.dl-sum { font-family: ui-monospace, monospace; font-size: .8rem; word-break: break-all; }
