/* Koma — one stylesheet, light + dark.
   Theme: html[data-theme=light|dark] overrides the OS preference. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --sidebar: #eef1f4;
  --fg: #1c2430;
  --muted: #6a7383;
  --faint: #9aa2ae;
  --line: #e1e5eb;
  --line-strong: #cfd5dd;
  --accent: #0e7c86;
  --accent-ink: #ffffff;
  --accent-soft: rgba(14, 124, 134, 0.1);
  --now: #e8a33d;
  --green: #2f9e62;
  --yellow: #c9961a;
  --red: #d14b4b;
  --black-tier: #3a3f47;
  --hover: rgba(28, 36, 48, 0.045);
  --sel: rgba(14, 124, 134, 0.12);
  --shadow: 0 1px 2px rgba(28, 36, 48, 0.06), 0 4px 16px rgba(28, 36, 48, 0.06);
  --radius: 6px;
  --font: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1f26; --surface: #222731; --sidebar: #161a20; --fg: #e4e8ee; --muted: #8b95a5; --faint: #687183;
    --line: #2e3542; --line-strong: #3a4352; --accent: #2bb3bd; --accent-ink: #082c2f;
    --accent-soft: rgba(43, 179, 189, 0.14); --hover: rgba(255, 255, 255, 0.035); --sel: rgba(43, 179, 189, 0.16);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25); --black-tier: #0d0f12;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1b1f26; --surface: #222731; --sidebar: #161a20; --fg: #e4e8ee; --muted: #8b95a5; --faint: #687183;
  --line: #2e3542; --line-strong: #3a4352; --accent: #2bb3bd; --accent-ink: #082c2f;
  --accent-soft: rgba(43, 179, 189, 0.14); --hover: rgba(255, 255, 255, 0.035); --sel: rgba(43, 179, 189, 0.16);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25); --black-tier: #0d0f12;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--fg); font: 13px/1.45 var(--font);
  font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 3px; }
svg { width: 16px; height: 16px; flex-shrink: 0; }
h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 4px; }
h2 { font-size: 15px; font-weight: 600; margin: 24px 0 8px; }
h3 { font-size: 13px; font-weight: 600; margin: 18px 0 6px; }
p { margin: 6px 0; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; } .warn { color: var(--red); }
code, .mono { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 12px; }
code { background: var(--hover); padding: 1px 4px; border-radius: 3px; }
kbd { font: 11px "IBM Plex Mono", ui-monospace, monospace; border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: 4px; padding: 0 5px; background: var(--surface); color: var(--fg); }

/* ------------------------------------------------------------------ shell */
.navtoggle { display: none; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 208px; background: var(--sidebar); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; overflow-y: auto; z-index: 30; padding-bottom: 12px;
}
.logo { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; font-weight: 600; font-size: 14px;
  color: var(--fg); letter-spacing: 0.01em; }
.logo:hover { text-decoration: none; }
.logo .mark { width: 22px; height: 22px; }
.logo span { letter-spacing: -0.01em; }
.side { display: flex; flex-direction: column; padding: 4px 8px; }
.side a, .sidegroup a { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 5px; color: var(--fg); }
.side a:hover, .sidegroup a:hover { background: var(--hover); text-decoration: none; }
.side a.on, .sidegroup a.on { background: var(--sel); color: var(--fg); font-weight: 500; }
.side a svg { color: var(--muted); } .side a.on svg { color: var(--accent); }
.side .sect { padding: 10px 8px 3px; color: var(--faint); font-size: 11.5px; font-weight: 500; }
.side:first-of-type .sect { padding-top: 2px; }
.side .count { margin-left: auto; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.side .count:empty { display: none; }
.sidegroup { border-top: 1px solid var(--line); margin: 10px 0 0; padding: 8px 8px 0; }
.sidegroup summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 4px 8px; color: var(--muted);
  cursor: pointer; font-size: 12px; font-weight: 500; }
.sidegroup summary::-webkit-details-marker { display: none; }
.sidegroup summary .add { margin-left: auto; color: var(--muted); display: flex; }
.sidegroup a { padding-left: 34px; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.sidegroup a.more { color: var(--muted); }
.sidegroup .hint { display: block; padding: 2px 8px 6px 34px; color: var(--faint); font-size: 12px; }
.side.bottom { margin-top: auto; border-top: 1px solid var(--line); padding-top: 4px; padding-bottom: 10px; }
.side.bottom a { padding-top: 4px; padding-bottom: 4px; font-size: 12.5px; }
.shell { margin-left: 208px; min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 12px 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: 12.5px; overflow: hidden; white-space: nowrap; }
.crumbs a { color: var(--muted); display: flex; align-items: center; }
.crumbs a:last-child { color: var(--fg); }
.crumbs .sl { color: var(--faint); }
.tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 6px;
  color: var(--muted); background: none; border: 0; cursor: pointer; }
.iconbtn:hover { background: var(--hover); color: var(--fg); text-decoration: none; }
.iconbtn.accent { background: var(--accent); color: var(--accent-ink); }
.iconbtn.menu { display: none; }
.update { height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: var(--accent); color: var(--accent-ink);
  font: 500 12.5px var(--font); cursor: pointer; }
.update:hover { filter: brightness(1.05); }
.topsearch { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px; border-radius: 6px; background: var(--bg);
  border: 1px solid var(--line); color: var(--muted); width: 200px; }
.topsearch input, .topsearch input:not([type]) { border: 0; background: none; color: var(--fg); font: 12.5px var(--font); width: 100%;
  outline: none; padding: 0; box-shadow: none; }
.topsearch:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.topsearch { position: relative; width: 260px; }
.topsearch kbd.hint { font: 10.5px var(--font); color: var(--faint); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.topsearch:focus-within kbd.hint { display: none; }
.finder { position: absolute; top: 34px; right: 0; width: min(520px, 90vw); margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); z-index: 50;
  max-height: 60vh; overflow: auto; }
.finder li { display: grid; grid-template-columns: 10px 1fr; column-gap: 8px; align-items: center; padding: 6px 8px;
  border-radius: 6px; cursor: pointer; }
.finder li.on, .finder li:hover { background: var(--sel); }
.finder .ft { color: var(--fg); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finder .fp { grid-column: 2; color: var(--faint); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finder .st { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--faint); }
.finder .st.scheduled { background: var(--green); border-color: var(--green); }
.finder .st.partial, .finder .st.deferred { background: var(--yellow); border-color: var(--yellow); }
.finder .st.unscheduled, .finder .st.missed { background: var(--red); border-color: var(--red); }
.band { height: 3px; background: var(--accent); }
.content { width: 100%; max-width: 1080px; margin: 0 auto; padding: 22px 28px 80px; }
.content.narrow, .narrow { max-width: 760px; margin-left: auto; margin-right: auto; }
.content.wide { max-width: none; }
.scrim { display: none; }

/* ------------------------------------------------------------------ controls */
input, select, textarea, button { font: inherit; color: inherit; }
input[type=text], input:not([type]), input[type=password], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface);
  color: var(--fg); font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; line-height: 1.5; }
textarea.mono { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 12.5px; }
label { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 3px; }
label.check { display: inline-flex; align-items: center; gap: 6px; color: var(--fg); margin: 4px 12px 4px 0; }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); cursor: pointer; font-weight: 500; font-size: 12.5px; }
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { background: transparent; color: var(--red); border-color: var(--line-strong); }
.btn.small { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.tiny { height: 20px; padding: 0 6px; font-size: 11px; border-color: var(--line); background: transparent; color: var(--muted); }
form.inline { display: inline; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stack > * + * { margin-top: 8px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin: 12px 0; }
.flash { border-left: 3px solid var(--green); background: var(--surface); padding: 8px 12px; border-radius: 4px; margin-bottom: 12px; }
.empty { color: var(--muted); padding: 24px 0; }

/* ------------------------------------------------------------------ chips and status */
.chip { display: inline-flex; align-items: center; gap: 4px; height: 18px; padding: 0 7px; border-radius: 9px; font-size: 11px;
  background: var(--hover); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.chip.dur { font-variant-numeric: tabular-nums; }
.chip.due { color: var(--red); border-color: transparent; background: transparent; padding: 0 2px; }
.chip.prio { color: #fff; border: 0; }
.chip.area::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--muted)); }
.chip.tag { background: transparent; }
.ico { width: 15px; height: 15px; color: var(--muted); }
.ico.hold { color: var(--muted); } .ico.star { color: var(--now); } .ico.seq, .ico.one, .ico.par { color: var(--faint); }
.st { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; border: 1.5px solid var(--faint); }
.st.scheduled { background: var(--green); border-color: var(--green); }
.st.limited { background: var(--yellow); border-color: var(--yellow); }
.st.none, .st.partial { background: var(--red); border-color: var(--red); }
.st.unscheduled, .st.missed { border-color: var(--red); background: repeating-linear-gradient(45deg, var(--red) 0 2px, transparent 2px 4px); }
.st.deferred { border-color: var(--yellow); background: repeating-linear-gradient(45deg, var(--yellow) 0 2px, transparent 2px 4px); }
.st.waiting, .st.out_of_range { border-color: var(--faint); background: transparent; }
.st.on_hold { display: none; }  /* the pause icon says it */
.pill { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 9px; font-size: 11px; background: var(--hover); color: var(--muted); }
.pill.s-scheduled { color: var(--green); } .pill.s-unscheduled, .pill.s-missed, .pill.s-partial { color: var(--red); }
.pill.s-deferred { color: var(--yellow); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; margin-right: 6px; }

/* ------------------------------------------------------------------ outline */
.otitle { display: flex; align-items: center; gap: 12px; margin: 6px 0 2px; }
.otitle .bigcheck { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); }
.otitle h1 { margin: 0; }
.ometa { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); margin: 4px 0 18px 34px; font-size: 12px; }
.tree { list-style: none; margin: 0; padding: 0; }
.tree .tree { padding-left: 22px; margin-left: 8px; border-left: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 8px; min-height: 28px; padding: 2px 6px; border-radius: 5px; position: relative; }
.row:hover { background: var(--hover); }
.row.sel { background: var(--sel); }
.row .tw { width: 14px; height: 14px; color: var(--faint); cursor: pointer; transition: transform .12s; flex-shrink: 0; border: 0; background: none; padding: 0; }
.row .tw.open { transform: rotate(90deg); }
.row .tw.leaf { visibility: hidden; }
.cb { width: 14px; height: 14px; border: 1.5px solid var(--line-strong); border-radius: 3px; background: transparent; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cb:hover { border-color: var(--accent); }
.cb.on { background: var(--accent); border-color: var(--accent); }
.cb.on::after { content: ""; width: 7px; height: 4px; border: 2px solid var(--accent-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.cb.parent { border-radius: 50%; }
.row .t { color: var(--fg); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .t:hover { text-decoration: none; color: var(--accent); }
.row.done .t { color: var(--faint); text-decoration: line-through; }
.row.heading .t { font-weight: 600; }
.row.link .linkico { color: var(--accent, #4a90d9); width: 14px; height: 14px; flex: none; margin-right: 2px; }
.row.link .t { font-style: italic; }
.row .meta { display: flex; align-items: center; gap: 6px; margin-left: 4px; min-width: 0; }
.row .acts { margin-left: auto; display: none; gap: 2px; }
.row:hover .acts, .row.sel .acts { display: flex; }
.row .acts .iconbtn { width: 22px; height: 22px; }
.row .acts svg { width: 13px; height: 13px; }
.addrow { display: flex; align-items: center; gap: 8px; padding: 4px 6px; margin-top: 4px; color: var(--faint); }
.addrow input { border: 0; border-bottom: 1px dashed var(--line-strong); border-radius: 0; background: transparent; padding: 4px 0; }
.addrow input:focus { box-shadow: none; border-bottom-color: var(--accent); }
.preview-slot { margin-left: 22px; font-size: 12px; color: var(--muted); min-height: 0; }
.preview-slot .warn { font-size: 12px; }

/* detail panel (inline, below a row) */
.detail { margin: 4px 0 10px 22px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.detail .dtitle { font-size: 14px; font-weight: 500; border: 0; padding: 2px 0; background: transparent; }
.detail .dtitle:focus { box-shadow: none; }
.detail textarea.notes { border: 0; padding: 4px 0; min-height: 44px; background: transparent; color: var(--fg); }
.detail textarea.notes:focus { box-shadow: none; }
.detail .grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 12px; margin-top: 8px; }
.detail .grid label { margin-top: 0; }
.detail .span2 { grid-column: span 2; } .detail .span4 { grid-column: 1 / -1; }
.detail .status { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 12px; color: var(--muted);
  border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; }
.detail .bar { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.detail .bar .sp { flex: 1; }
.mapchips { display: flex; flex-wrap: wrap; gap: 4px; }
.mapchips label { margin: 0; }
.mapchips input { display: none; }
.mapchips span { display: inline-flex; height: 22px; align-items: center; padding: 0 8px; border-radius: 11px; border: 1px solid var(--line-strong);
  font-size: 12px; color: var(--muted); cursor: pointer; }
.mapchips input:checked + span { background: var(--accent-soft); color: var(--fg); border-color: var(--accent); }

/* ------------------------------------------------------------------ today timeline */
.dayhead { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.dayhead h1 { margin: 0; }
.dayhead .nav { margin-left: auto; display: flex; gap: 4px; }
.where { color: var(--muted); font-size: 12px; }
.quick { display: flex; gap: 8px; margin-bottom: 18px; }
.quick input { height: 32px; }
.nowcard { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.nowcard a { display: block; padding: 10px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--fg); }
.nowcard a:hover { text-decoration: none; border-color: var(--line-strong); }
.nowcard .lbl { font-size: 11px; color: var(--muted); display: block; margin-bottom: 2px; }
.nowcard .now { border-left: 3px solid var(--now); }
/* the day: blocks on a time axis (72px per hour), the present as an amber line */
.day { position: relative; margin: 4px 0 24px 56px; }
.day .hr { position: absolute; left: -56px; right: 0; border-top: 1px solid var(--line); height: 0; }
.day .hr span { position: absolute; left: 0; top: -7px; width: 44px; text-align: right; color: var(--faint); font-size: 11px;
  background: var(--bg); padding-right: 6px; }
.blk { position: absolute; left: calc(var(--col) * 100% / var(--n)); width: calc(100% / var(--n) - 6px);
  display: flex; align-items: flex-start; gap: 8px; padding: 5px 8px 5px 10px; border-radius: 6px; overflow: hidden;
  background: color-mix(in srgb, var(--c, var(--accent)) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 22%, var(--line)); border-left: 3px solid var(--c, var(--accent)); }
.blk .what { flex: 1; min-width: 0; color: var(--fg); }
.blk .what:hover { text-decoration: none; }
.blk .what b { display: block; font-weight: 500; font-size: 13px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blk .what b .ico { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; }
.blk .sub { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 1px; color: var(--muted); font-size: 11.5px; }
.blk .sub .tm { font-variant-numeric: tabular-nums; }
.blk .sub .chip { height: 16px; font-size: 10.5px; }
.blk .tier { width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); }
.blk.t3 .tier { background: var(--red); }
.blk.short { padding-top: 3px; padding-bottom: 3px; align-items: center; }
.blk.short .what { display: flex; align-items: baseline; gap: 8px; }
.blk.short .sub { margin: 0; flex-wrap: nowrap; overflow: hidden; }
.blk.short .sub > :not(.tm) { display: none; }
.blk.bg { border-left-style: dashed; }
.blk.past:not(.current) { opacity: .62; }
.blk.done .what b { text-decoration: line-through; color: var(--muted); }
.blk.current { box-shadow: 0 0 0 2px var(--now); border-color: transparent; }
.blk.event { --c: var(--faint); color: var(--muted);
  background: repeating-linear-gradient(135deg, var(--surface) 0 6px, var(--bg) 6px 12px); border-left-color: var(--faint); }
.blk.event .what b { color: var(--muted); font-weight: 400; }
.blk .btns { display: flex; gap: 4px; opacity: 0; transition: opacity .12s; }
.blk:hover .btns, .blk:focus-within .btns, .blk.current .btns, .blk.sel .btns { opacity: 1; }
@media (hover: none) { .blk .btns { opacity: 1; } }
.nowbar { position: absolute; left: -10px; right: 0; height: 0; border-top: 2px solid var(--now); z-index: 3; pointer-events: none; }
.nowbar::before { content: ""; position: absolute; left: 0; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--now); }
.nowbar span { position: absolute; left: -48px; top: -9px; width: 34px; text-align: right; color: var(--now); font-size: 11px; font-weight: 600;
  background: var(--bg); }
.round { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: transparent; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.round:hover { border-color: var(--accent); color: var(--accent); }
.round svg { width: 11px; height: 11px; }
.round.ok:hover { background: var(--green); border-color: var(--green); color: #fff; }

/* day groups (next 7 days, results) */
.daygroup { margin-bottom: 18px; }
.daygroup h2 { margin: 0 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.daygroup h2 b { color: var(--fg); font-weight: 600; margin-right: 6px; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.lrow { display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 4px 6px; border-radius: 5px; }
.lrow:hover { background: var(--hover); }
.lrow.sel { background: var(--sel); }
.lrow .time { width: 86px; color: var(--muted); font-size: 12px; flex-shrink: 0; }
.lrow .t { color: var(--fg); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .where2 { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* board */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; align-items: start; }
.board .col { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.board .col h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; }
.board .col ol { list-style: none; padding: 0; margin: 0; }
.board .col li { display: flex; align-items: center; gap: 4px; padding: 5px 6px; border-radius: 5px; background: var(--bg); margin-bottom: 4px; border: 1px solid var(--line); }
.board .col li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board select { width: auto; padding: 0 2px; height: 20px; font-size: 11px; }

/* generic cards for settings / definitions */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 8px 0; }
details.card > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card[open] > summary { margin-bottom: 8px; }
.effects .row2, .effects .row3 { margin-top: 0; }
.effects select[multiple] { height: auto; }

/* time map painter */
.palette { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.pal { border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); height: 26px; padding: 0 10px; border-radius: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.pal::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--sw); }
.pal.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.pal.t1 { --sw: var(--green); } .pal.t2 { --sw: var(--yellow); } .pal.t3 { --sw: var(--red); } .pal.t4 { --sw: var(--black-tier); } .pal.t0 { --sw: var(--line); }
.tmgrid { display: grid; grid-template-columns: 34px repeat(var(--cols, 7), 1fr); gap: 1px; user-select: none; touch-action: none; margin: 8px 0;
  max-width: 760px; }
.tmgrid .hdr { font-size: 11px; text-align: center; color: var(--muted); padding-bottom: 2px; }
.tmgrid .hr { font-size: 10px; color: var(--faint); text-align: right; padding-right: 4px; line-height: 10px; }
.tmgrid .cell { height: 10px; background: var(--hover); border-radius: 1px; }
.tmgrid .cell.t1 { background: var(--green); } .tmgrid .cell.t2 { background: var(--yellow); }
.tmgrid .cell.t3 { background: var(--red); } .tmgrid .cell.t4 { background: var(--black-tier); }

/* calendar (FullCalendar) */
#cal { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.fc { --fc-border-color: var(--line); --fc-page-bg-color: var(--surface); --fc-neutral-bg-color: var(--bg);
  --fc-today-bg-color: var(--accent-soft); --fc-now-indicator-color: var(--now); --fc-button-bg-color: var(--surface);
  --fc-button-border-color: var(--line-strong); --fc-button-text-color: var(--fg); --fc-button-hover-bg-color: var(--hover);
  --fc-button-hover-border-color: var(--line-strong); --fc-button-active-bg-color: var(--sel); --fc-button-active-border-color: var(--accent);
  font-size: 12px; }
.fc .fc-toolbar-title { font-size: 15px; font-weight: 600; }
.fc .fc-button { height: 28px; padding: 0 10px; font-size: 12px; box-shadow: none !important; }
.fc .fc-event { border-radius: 4px; }
.fc .done { opacity: 0.5; text-decoration: line-through; }
.fc .fc-col-header-cell-cushion, .fc .fc-timegrid-slot-label-cushion { color: var(--muted); font-weight: 500; }

/* help overlay & command line */
.overlay { position: fixed; inset: 0; background: rgba(10, 14, 20, 0.45); display: none; align-items: flex-start; justify-content: center; z-index: 100; padding-top: 10vh; }
.overlay.show { display: flex; }
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); width: min(760px, 94vw); max-height: 76vh; overflow: auto; padding: 18px 22px; }
.sheet h2 { margin-top: 0; }
.keys { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 28px; }
.keys div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.keys h3 { grid-column: 1 / -1; margin: 12px 0 2px; color: var(--muted); font-weight: 600; font-size: 12px; }
.cmdline { position: fixed; left: 50%; transform: translateX(-50%); top: 14vh; width: min(560px, 92vw); z-index: 101; display: none;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--shadow); padding: 8px; }
.cmdline.show { display: block; }
.cmdline input { font-family: "IBM Plex Mono", ui-monospace, monospace; border: 0; box-shadow: none !important; font-size: 13px; }
.cmdline .hint { color: var(--muted); font-size: 11.5px; padding: 4px 8px 2px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 7px 14px;
  border-radius: 6px; font-size: 12.5px; z-index: 120; opacity: 0; transition: opacity .15s; pointer-events: none; }
.toast.show { opacity: 1; }
.pending { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--now); margin-left: 6px; }

/* running tracker */
.running { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--now); margin-bottom: 14px; }
.running a { color: var(--fg); }

/* ------------------------------------------------------------------ mobile */
.tabbar { display: none; }
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .18s ease; box-shadow: var(--shadow); }
  .navtoggle:checked ~ .sidebar { transform: none; }
  .navtoggle:checked ~ .scrim { display: block; position: fixed; inset: 0; background: rgba(10, 14, 20, 0.35); z-index: 25; }
  .shell { margin-left: 0; }
  .iconbtn.menu { display: inline-flex; }
  .topsearch, .tools .iconbtn:not(.accent):not(.theme) { display: none; }
  .update { padding: 0 10px; }
  .update span { font-size: 13px; }
  .content { padding: 16px 14px 90px; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom); z-index: 20; }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; color: var(--muted); font-size: 10.5px; }
  .tabbar a svg { width: 19px; height: 19px; }
  .tabbar a.on { color: var(--accent); }
  .tabbar a.add svg { background: var(--accent); color: var(--accent-ink); width: 34px; height: 34px; padding: 8px; border-radius: 50%; }
  .tabbar a:hover { text-decoration: none; }
  .detail .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nowcard { grid-template-columns: 1fr; }
  .row .meta .chip.tag, .row .meta .chip.area { display: none; }
  .keys { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.update { display: inline-flex; align-items: center; gap: 6px; }
.update svg { width: 14px; height: 14px; }
.update { font-weight: 600; margin-right: 6px; }
@media (max-width: 420px) { .update span { display: none; } .update { width: 30px; padding: 0; justify-content: center; } }
.row .t.proj { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; padding: 1px 8px 1px 4px; border-radius: 4px; }
.row .t.proj .ico { color: inherit; opacity: .8; }
.lrow.done .t { color: var(--faint); text-decoration: line-through; }
.list.panel { margin: 0; }
.list .empty { padding: 14px 6px; }
.detail .status.files { gap: 6px 14px; }
.detail .status.files a { display: inline-flex; align-items: center; gap: 4px; color: var(--fg); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.thumbs img { width: 120px; height: 90px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
/* hint mode (f) */
.hint-tag { position: absolute; z-index: 200; background: var(--now); color: #1c2430; font: 600 11px "IBM Plex Mono", ui-monospace, monospace;
  padding: 0 4px; border-radius: 3px; box-shadow: 0 1px 3px rgba(0,0,0,.3); pointer-events: none; text-transform: lowercase; }
.hint-tag.dim { opacity: .35; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 10px; }
.filters select, .filters input { height: 30px; }
.filters input { flex: 1 1 200px; }
.list.bin { padding: 4px 8px; }
.working { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.working .running { margin: 0; }
.running .sp { flex: 1; }
.running .tbtns { display: flex; gap: 4px; align-items: center; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 var(--green);
  animation: pulse 2s infinite; flex-shrink: 0; }
.running.paused .pulse { background: var(--faint); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(47, 158, 98, .5); } 70% { box-shadow: 0 0 0 6px rgba(47, 158, 98, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 158, 98, 0); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
/* statistics */
.stats .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; padding: 2px; background: var(--surface); }
.seg button { border: 0; background: none; color: var(--muted); font: 500 12px var(--font); padding: 5px 10px; border-radius: 5px; cursor: pointer; }
.seg button.on { background: var(--sel); color: var(--fg); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 14px 0 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.tile .k { color: var(--muted); font-size: 12px; }
.tile .v { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; color: var(--fg); }
.tile .v small { font-size: 13px; font-weight: 500; color: var(--muted); }
.tile .s { color: var(--faint); font-size: 12px; }
.tile.alert { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.stats section.panel { padding: 12px 16px 10px; margin-bottom: 14px; }
.stats h2 { margin: 2px 0 10px; font-size: 13.5px; }
.chart { width: 100%; height: 170px; display: block; overflow: visible; }
.chart .axis { stroke: var(--line-strong); stroke-width: 1; }
.chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .tick { fill: var(--faint); font: 10px var(--font); }
.chart .tick.mid { text-anchor: middle; }
.chart .mark { fill: var(--accent); }
.chart .hit { fill: transparent; }
.chart .bar:hover .hit { fill: var(--hover); }
.chart .bar:hover .mark { filter: brightness(1.12); }
.tableview { margin-top: 6px; font-size: 12px; color: var(--muted); }
.tableview table, table.est { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.tableview td, .tableview th, table.est td, table.est th { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--line); }
table.est td:nth-child(n+2), table.est th:nth-child(n+2) { text-align: right; font-variant-numeric: tabular-nums; }
table.est .over { color: var(--red); } table.est .under { color: var(--green); }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .cols2 { grid-template-columns: 1fr; } }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.hbars li { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: 12.5px; }
.hbars .hl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); }
.hbars .ht { height: 8px; background: transparent; }
.hbars .hf { display: block; height: 8px; background: var(--accent); border-radius: 0 4px 4px 0; }
.hbars .hv { color: var(--muted); font-variant-numeric: tabular-nums; }
.recent { list-style: none; margin: 0; padding: 0; }
.recent li { display: grid; grid-template-columns: 18px 1fr auto auto; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.recent li:last-child { border-bottom: 0; }
.ico.ok { color: var(--green); }
.day .fold { position: absolute; left: -56px; right: 0; height: 30px; display: flex; align-items: center; justify-content: center;
  color: var(--faint); font-size: 11.5px; border-top: 1px dashed var(--line-strong); border-bottom: 1px dashed var(--line-strong);
  background: repeating-linear-gradient(135deg, transparent 0 5px, var(--hover) 5px 10px); }
.dayhead h1 .date { font-size: 15px; font-weight: 400; color: var(--muted); margin-left: 10px; letter-spacing: 0; }
.chip.place { color: var(--muted); }
.chip.place .ico { width: 12px; height: 12px; }
/* task page */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 18px; margin: 14px 0 6px 30px; padding: 0; }
.facts div { min-width: 0; }
.facts dt { color: var(--faint); font-size: 11.5px; margin-bottom: 1px; }
.facts dd { margin: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px 12px; margin: 10px 0 0; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; color: var(--fg); }
.status-line.s-unscheduled, .status-line.s-missed { border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
.status-line.s-partial, .status-line.s-deferred { border-color: color-mix(in srgb, var(--yellow) 40%, var(--line)); }
.actions { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 14px 0 6px; align-items: center; }
.actions .group { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.joined { display: inline-flex; align-items: stretch; }
.actions .joined input, .actions .joined .btn { margin: 0; height: 28px; vertical-align: top; }
.joined input, .joined input:not([type]) { width: 92px; height: 28px; padding: 0 8px; box-sizing: border-box; border-radius: 6px 0 0 6px; border-right: 0; }
.joined .btn { border-radius: 0 6px 6px 0; height: 28px; }
ol.why { list-style: none; margin: 0; padding: 6px 14px; }
ol.why > li { display: grid; grid-template-columns: 22px 1fr; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.5; }
ol.why > li:last-child { border-bottom: 0; }
ol.why .n { width: 18px; height: 18px; border-radius: 50%; background: var(--sel); color: var(--accent); font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
ol.why b { font-weight: 600; }
ol.why ul { margin: 4px 0 0; padding-left: 16px; color: var(--muted); font-size: 12.5px; }

.blk .sub .tm { white-space: nowrap; }
@media (max-width: 520px) {
  .dayhead { flex-wrap: wrap; row-gap: 6px; }
  .dayhead h1 { font-size: 19px; }
  .dayhead h1 .date { display: block; margin: 2px 0 0; font-size: 13px; }
  .day { margin-left: 46px; }
  .day .hr, .day .fold { left: -46px; }
  .day .hr span { width: 38px; }
  .nowbar span { left: -44px; }
}
.update { white-space: nowrap; }
@media (max-width: 1180px) and (min-width: 861px) { .update span { display: none; } .update { width: 30px; padding: 0; justify-content: center; } }
.finder.suggest { width: min(460px, 92vw); z-index: 60; }
.finder.suggest li { grid-template-columns: 1fr auto; padding: 5px 9px; }
.finder.suggest .fp { grid-column: 2; grid-row: 1; text-align: right; max-width: 220px; }
/* schedule updates */
.update.busy svg { animation: spin .9s linear infinite; }
.update.busy { opacity: .9; cursor: progress; }
@keyframes spin { to { transform: rotate(360deg); } }
body.scheduling .band { background: linear-gradient(90deg, var(--accent) 0 30%, color-mix(in srgb, var(--accent) 25%, var(--surface)) 30% 60%, var(--accent) 60%);
  background-size: 200% 100%; animation: bandmove 1.1s linear infinite; }
@keyframes bandmove { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.schedpill { position: fixed; right: 18px; bottom: 18px; z-index: 70; display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 12px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow); font-size: 12.5px; }
.schedpill svg { color: var(--accent); }
@media (max-width: 860px) { .schedpill { bottom: 74px; } }
@media (prefers-reduced-motion: reduce) { .update.busy svg, body.scheduling .band { animation: none; } body.scheduling .band { opacity: .6; } }
/* calendar sources (palette validated: light and dark, CVD-safe) */
:root { --src0: #5B6EE1; --src1: #D97706; --src2: #9333EA; --src3: #DB2777; --src4: #0284C7; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --src0: #6F84E6; --src1: #C27A08; --src2: #9A5FE8; --src3: #E65A95; --src4: #1C9AD2; } }
:root[data-theme="dark"] { --src0: #6F84E6; --src1: #C27A08; --src2: #9A5FE8; --src3: #E65A95; --src4: #1C9AD2; }
.src-0 { --sc: var(--src0); } .src-1 { --sc: var(--src1); } .src-2 { --sc: var(--src2); } .src-3 { --sc: var(--src3); } .src-4 { --sc: var(--src4); }
.src-tasks { --sc: var(--accent); } .src-travel { --sc: var(--faint); }
.fc .fc-event[class*="src-"] { background: color-mix(in srgb, var(--sc) 16%, var(--surface)); border: 0; border-left: 3px solid var(--sc); }
.fc .fc-event[class*="src-"] .fc-event-main, .fc .fc-event[class*="src-"] .fc-event-title, .fc .fc-event[class*="src-"] .fc-event-time { color: var(--fg); }
.fc .fc-event.free { background: transparent; border-left-style: dashed; opacity: .8; }
.callegend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 0 0 10px; font-size: 12.5px; }
.callegend .src { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--fg); }
.callegend input { position: absolute; opacity: 0; pointer-events: none; }
.callegend .sw { width: 12px; height: 12px; border-radius: 3px; background: var(--sc); box-shadow: inset 0 0 0 1.5px var(--sc); }
.callegend input:not(:checked) + .sw { background: transparent; }
.callegend input:not(:checked) ~ * { color: var(--faint); }
.callegend .src:has(input:not(:checked)) { color: var(--faint); }
.callegend input:focus-visible + .sw { outline: 2px solid var(--accent); outline-offset: 2px; }
.fc .fc-event.src-tasks.tier2 { border-left-color: var(--yellow); } .fc .fc-event.src-tasks.tier3 { border-left-color: var(--red); }
.fc .fc-event.src-tasks.bg { border-left-style: dashed; }
.fc .fc-event.done .fc-event-title { text-decoration: line-through; color: var(--muted); }
.tpls { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 10px; }
.tpls a { display: grid; gap: 3px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--fg); }
.tpls a:hover { border-color: var(--line-strong); text-decoration: none; }
.tplform .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; align-items: end; }
@media (max-width: 640px) { .tplform .grid2 { grid-template-columns: 1fr; } }
.tplpreview { white-space: pre-wrap; line-height: 1.55; margin: 0; }
.tmgrid .hdr.hol { color: var(--accent); font-weight: 500; }
.tmgrid .cell.hol { margin-left: 4px; }
.tmgrid .hdr.hol { margin-left: 4px; }
.tmweek, .tmhol { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.tmweek select, .tmhol select { height: 30px; }
.tmnote { padding: 8px 12px; border-radius: 8px; background: var(--sel); font-size: 12.5px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fc .fc-bg-event.holiday { background: color-mix(in srgb, var(--now) 14%, transparent); opacity: 1; }
.fc .fc-event.holiday-label { background: transparent; border: 0; }
.fc .fc-event.holiday-label .fc-event-title { color: color-mix(in srgb, var(--now) 70%, var(--fg)); font-weight: 500; }
.tmweek select, .tmhol select { width: auto; min-width: 240px; }
.tmweek label, .tmhol label { margin: 0; }
.zonepick { position: relative; }
.zonepick > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; width: auto; padding: 0 6px; }
.zonepick > summary::-webkit-details-marker { display: none; }
.zonepick > summary span { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.zonemenu { position: absolute; right: 0; top: 36px; z-index: 80; width: 260px; display: grid; gap: 4px; padding: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.zonemenu button { text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 6px; cursor: pointer; color: var(--fg); font: 12.5px var(--font); }
.zonemenu button:hover, .zonemenu button.on { background: var(--sel); }
.zonemenu input { height: 30px; }
@media (max-width: 860px) { .zonepick { display: none; } }

/* Calendars page: one row per calendar, a segmented choice of use */
.caltable { width: 100%; border-collapse: collapse; }
.caltable th { text-align: left; font: 500 12px var(--font); color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.caltable td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.caltable tr:last-child td { border-bottom: 0; }
.caltable .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); width: 1%; white-space: nowrap; }
.caltable tr.new .t { font-weight: 600; }
.seg.radios label { font: 500 12px var(--font); color: var(--muted); padding: 5px 10px; border-radius: 5px; cursor: pointer; white-space: nowrap; }
.seg.radios input { position: absolute; opacity: 0; pointer-events: none; }
.seg.radios label:has(input:checked) { background: var(--sel); color: var(--fg); }
.seg.radios label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 640px) {
  .caltable thead { display: none; }
  .caltable tr { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .caltable td { border: 0; padding: 0 4px; }
  .caltable td:last-child { grid-column: 1 / -1; }
  .seg.radios { flex-wrap: wrap; }
}

/* Settings → Connections */
.conns { list-style: none; margin: 0; padding: 0; }
.conns li { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.conns li:last-child { border-bottom: 0; }
.conns .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--line); }
.conns li.on .dot { background: var(--green); }
.conns .act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .conns li { grid-template-columns: 10px 1fr; } .conns .act { grid-column: 2; justify-content: flex-start; } }
/* a date and an optional hour on that day */
.dt2 { display: flex; gap: 4px; }
.dt2 input[type=date] { flex: 1 1 auto; min-width: 0; }
.dt2 input[type=time] { flex: 0 0 110px; }
/* notes, comments and [[mentions]] */
.notes-body, .comment .ctext { white-space: pre-wrap; }
.comments { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.comment { padding: 8px 12px; }
.comment .chead { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment .cacts { margin-left: auto; display: flex; gap: 4px; }
a.mention { color: var(--accent); text-decoration: none; border-bottom: 1px dotted currentColor; }
a.mention::before { content: "↗ "; font-size: .85em; }
.mention.gone { color: var(--faint); text-decoration: line-through; }
.joined input[type=date] { width: 140px; }
.chip.local { background: var(--panel, #eef1f4); color: var(--muted, #5b6573); border: 1px dashed currentColor; }

/* recurring */
.recurring .freq { width: 132px; flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--accent); white-space: nowrap; }
.recurring .freq .ico { width: 13px; height: 13px; }
.recurring .time { width: 150px; white-space: nowrap; }
@media (max-width: 640px) { .recurring .where2 { display: none; } .recurring .freq { width: 96px; } .recurring .time { width: 76px; } }

/* assistant */
.chat { display: flex; flex-direction: column; min-height: calc(100vh - 120px); }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chat-log { list-style: none; margin: 8px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.chat-log .msg { max-width: 85%; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-log .msg p { margin: 0 0 6px; white-space: normal; } .chat-log .msg p:last-child { margin: 0; }
.chat-log .msg.me { align-self: flex-end; background: var(--accent-soft); border-color: transparent; }
.chat-log .msg.hint { color: var(--muted); max-width: 100%; white-space: normal; }
.chat-log .msg.err { border-color: var(--danger, #c0392b); color: var(--danger, #c0392b); }
.chat-log .msg.wait { color: var(--muted); }
.chat-log .acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; white-space: normal; }
.chat-log .act { font-size: 11px; padding: 1px 7px; border-radius: 9px; background: var(--hover); color: var(--muted); }
.chat-log .act.bad { color: var(--danger, #c0392b); }
.chat-log .via { display: block; margin-top: 6px; font-size: 11px; color: var(--faint); white-space: normal; }
.chat-input { display: flex; gap: 8px; align-items: flex-end; position: sticky; bottom: 0; padding: 8px 0; background: var(--bg); }
.chat-input textarea { flex: 1; resize: vertical; min-height: 44px; }

/* sign-in */
.signin .btn { width: 100%; justify-content: center; }
.signin .btn svg { width: 16px; height: 16px; }
.signin .or { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 12px; }
.signin .or::before, .signin .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
#signin h4 { margin: 16px 0 4px; font-size: 13px; }
.pwform { display: flex; flex-wrap: wrap; gap: 6px; max-width: 640px; }
.pwform input { flex: 1 1 160px; }
