/* Luke's App: the "Soft Focus" skin from the Canvas artifact (light, warm gradient wall, white cards,
   one teal accent, pill buttons) at tight density, plus the frame around it: the top bar (a tab bar
   on a phone), the detail panel and the Feedback button.
   - Tokens live on :root. The artifact's names (--bg-ink, --card-line, ...) are kept so its rules port
     1:1; the short names (--ink, --line, --accent, ...) are what styles.css, auth and the CRM read.
   - Everything ported from the artifact is scoped under .la (the page, the drawer), because the CRM
     uses some of the same class names (.card, .seg, .lab, ...) with its own look. The CRM is never
     inside .la. crm.css loads after this file and wins inside the CRM. */

:root {
  --bg: #edf2f0; --bg-2: #e1e9e6; --bg-ink: #20302d; --bg-ink-2: #566864; --bg-line: #c4d2cd;
  --bg-accent: #0b7a6e; --bg-accent-ink: #ffffff; --bg-good: #17794a; --bg-bad: #c0392f; --bg-tone-ink: #ffffff; --bg-warn: #8c5a10; --bg-focus: #20302d;
  --card: #ffffff; --card-2: #f1f5f3; --card-ink: #20302d; --card-ink-2: #566864; --card-line: #e2eae7;
  --card-accent: #0b7a6e; --card-accent-ink: #ffffff; --card-good: #17794a; --card-bad: #c0392f; --card-tone-ink: #ffffff; --card-warn: #8c5a10; --card-focus: #20302d;
  --mark: #ffd8c4; --mark-ink: #5b2a14; --display-ink: #20302d;
  --wall: radial-gradient(60rem 40rem at 10% -10%, rgba(255, 198, 168, .6), transparent 62%), radial-gradient(52rem 40rem at 96% 6%, rgba(168, 214, 255, .55), transparent 62%);
  --hatch: linear-gradient(rgba(11, 122, 110, .08), rgba(11, 122, 110, .08));
  --shadow: 0 1px 2px rgba(20, 40, 35, .06), 0 14px 34px rgba(20, 40, 35, .09);
  --f-display: "Figtree", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --f-title: var(--f-display); --f-body: var(--f-display); --f-util: var(--f-display);
  --f-mono: ui-monospace, "SF Mono", "IBM Plex Mono", Consolas, monospace;
  --display-w: 800; --display-case: none; --display-track: -.03em; --display-lh: 1;
  --title-w: 600; --title-case: none; --title-size: 1.15rem; --title-track: -.01em;
  --label-w: 600; --label-case: none; --label-track: 0em; --label-style: normal; --label-size: .86rem;
  --body-size: 1rem;
  --radius: 22px; --radius-s: 999px; --bw: 1px;
  --tint-s: 78%; --tint-l: 92%; --tone-s: 55%; --tone-l: 25%; --dot-l: 46%;
  --d: 1; --scale: 1;
  /* the short names (styles.css, login, CRM base) */
  --bg-2: #e1e9e6; --ink: #20302d; --ink-2: #566864; --ink-3: #7f8f8b; --line: #dde6e2;
  --accent: #0b7a6e; --accent-ink: #ffffff; --good: #17794a; --warn: #8c5a10; --bad: #c0392f;
  --font: var(--f-body); --mono: var(--f-mono);
  color-scheme: light;
}
:root[data-density="tight"] { --d: .68; }
:root[data-density="roomy"] { --d: 1.4; }

/* One rem grows with the screen: 16px on a phone (iOS never zooms inputs), ~17px on a laptop, bigger on a TV. A−/A+ scale it. */
html { font-size: calc(clamp(16px, .3vw + 11px, 26px) * var(--scale)); }
body {
  background-color: var(--bg); background-image: var(--wall); background-repeat: no-repeat; background-attachment: fixed;
  color: var(--bg-ink); font: 400 var(--body-size)/1.45 var(--f-body);
}
html[data-canvas], html[data-canvas] body { overflow: hidden; }
.field { background: var(--card); }
.btn { border-radius: var(--radius-s); }

/* ================= the frame ================= */
/* --top-h: the bar along the top (laptop/TV) or the phone's slim header; --tab-h: the phone's tab bar
   (its home-indicator padding comes on top). Both are 0 where they are not shown. */
.shell { --top-h: 3.6rem; --tab-h: 0rem; display: flex; flex-direction: column; min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - var(--tab-h)); min-width: 0; }
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; position: relative; }
.crm-host { flex: 1 1 auto; min-width: 0; }
.ic { width: 1.15rem; height: 1.15rem; flex: none; }

/* ---- the top bar ---- */
.topnav {
  position: sticky; top: 0; z-index: 12; height: var(--top-h); flex: none; display: flex; align-items: center; gap: .9rem; min-width: 0;
  padding-inline: clamp(16px, 2.2vw, 3rem);
  background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--bg-line) 55%, transparent);
}
.mark-wrap { position: relative; flex: none; }
.mark { position: relative; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; padding: 0; border: 0; border-radius: 10px; background: none; cursor: pointer; }
.mark img { width: 1.85rem; height: 1.85rem; border-radius: 8px; display: block; }
.mark:hover img, .mark[aria-expanded="true"] img { box-shadow: 0 0 0 3px color-mix(in srgb, var(--bg-ink) 14%, transparent); }
.mark-dot { position: absolute; right: -.05rem; bottom: -.05rem; font-size: 0; gap: 0; }
.mark-dot .dot { width: .62rem; height: .62rem; border: 2px solid var(--bg); box-sizing: content-box; }
.mark-menu {
  position: absolute; top: calc(100% + .55rem); left: 0; z-index: 2; width: 15.5rem; display: flex; flex-direction: column; gap: .3rem; padding: .7rem;
  background: var(--card); color: var(--card-ink); border: 1px solid var(--card-line); border-radius: 16px; box-shadow: 0 18px 44px rgba(20, 40, 35, .18);
}
.mm-head { display: flex; flex-direction: column; gap: .1rem; padding: .1rem .35rem .45rem; border-bottom: 1px solid var(--card-line); margin-bottom: .2rem; }
.mm-status { font-size: .82rem; color: var(--card-ink-2); }
.mm-row { display: flex; align-items: center; gap: .3rem; padding-left: .35rem; }
.mm-lab { margin-right: auto; font-size: .9rem; color: var(--card-ink-2); }
.mm-btn { min-height: 2.3rem; padding: .3rem .7rem; border: 0; border-radius: 10px; background: none; color: var(--card-ink); font: inherit; font-size: .92rem; font-weight: 600; text-align: left; cursor: pointer; }
.mm-row .mm-btn { border: 1px solid var(--card-line); border-radius: 999px; min-width: 2.6rem; text-align: center; }
.mm-btn:hover { background: var(--card-2); }
.mm-btn[data-k="signout"] { color: var(--card-ink-2); }

.links { display: flex; gap: .2rem; min-width: 0; }
.nav-link, .tab { display: inline-flex; align-items: center; gap: .45rem; border: 0; background: none; color: var(--bg-ink-2); font: inherit; font-weight: 650; cursor: pointer; white-space: nowrap; }
.nav-link { min-height: 2.35rem; padding: .35rem .9rem; border-radius: 999px; font-size: .95rem; }
.nav-link .ic { width: 1.05rem; height: 1.05rem; }
.nav-link:hover { color: var(--bg-ink); background: color-mix(in srgb, var(--bg-ink) 6%, transparent); }
.nav-link[aria-current="page"] { background: var(--bg-ink); color: #fff; }
.ptitle { display: none; }

.search { position: relative; margin-left: auto; display: flex; align-items: center; gap: .4rem; min-width: 0; }
.q-field { display: flex; align-items: center; gap: .45rem; width: 15rem; max-width: 100%; min-height: 2.35rem; padding: 0 .85rem; border: 1px solid var(--card-line); border-radius: 999px; background: color-mix(in srgb, var(--card) 85%, transparent); color: var(--bg-ink-2); transition: width .15s ease; cursor: text; }
.q-field:focus-within { width: 22rem; border-color: var(--bg-accent); background: var(--card); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bg-accent) 20%, transparent); }
.q-ic { width: 1rem; height: 1rem; }
.q { flex: 1 1 auto; min-width: 0; border: 0; background: none; padding: .35rem 0; color: var(--bg-ink); font: inherit; font-size: max(16px, .92rem); outline: none; }
.q::placeholder { color: var(--bg-ink-2); }
.q::-webkit-search-cancel-button { display: none; }
.q-open, .q-cancel { display: none; }
.q-pop {
  position: absolute; top: calc(100% + .55rem); right: 0; z-index: 2; width: min(30rem, calc(100vw - 2rem)); max-height: min(70vh, 40rem); overflow: auto; overscroll-behavior: contain;
  padding: .45rem; background: var(--card); color: var(--card-ink); border: 1px solid var(--card-line); border-radius: 16px; box-shadow: 0 18px 44px rgba(20, 40, 35, .18);
}
.res { display: flex; flex-direction: column; gap: 1px; }
.res-item { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; width: 100%; min-width: 0; text-align: left; cursor: pointer; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; padding: .45rem .6rem; }
.res-item:hover, .res-item:focus-visible { background: var(--card-2); outline: none; }
.res-k { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--card-ink-2); }
.res-k .adot { width: .6rem; height: .6rem; border-radius: 50%; display: inline-block; background: hsl(var(--h, 200) 62% var(--dot-l)); }
.res-t { font-weight: 600; overflow-wrap: anywhere; }
.res-item[data-done] .res-t { text-decoration: line-through; color: var(--card-ink-2); }
.res-s { font-size: .82rem; color: var(--card-ink-2); }
.res-lab { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--card-ink-2); padding: .35rem .6rem .3rem; }
.res-empty { margin: .2rem .6rem .5rem; color: var(--card-ink-2); font-size: .9rem; }

/* ---- the phone's tab bar ---- */
.tabs { display: none; }

/* ---- full-height screens sit under the top bar (or above the tab bar) ---- */
.shell[data-view="canvas"] .la.page { padding: 0; position: relative; height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - var(--top-h) - var(--tab-h)); }
#crm-host .crm { height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - var(--top-h) - var(--tab-h)); }
#crm-host .crm-top .brand { display: none; }

@media (max-width: 720px) {
  .shell { --top-h: 3.4rem; --tab-h: 3.7rem; }
  .shell[data-view="canvas"], .shell[data-view="crm"] { --top-h: 0rem; }
  .shell[data-view="canvas"] .topnav, .shell[data-view="crm"] .topnav { display: none; }
  .topnav { gap: .5rem; padding-inline: 12px 8px; }
  .links { display: none; }
  .ptitle { display: block; flex: 1 1 auto; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--display-w) 1.3rem/1.1 var(--f-display); letter-spacing: var(--display-track); color: var(--display-ink); }
  .search { margin-left: 0; position: static; }
  .q-field { display: none; }
  .q-open { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 0; border-radius: 999px; background: none; color: var(--bg-ink); cursor: pointer; }
  .q-open .ic { width: 1.35rem; height: 1.35rem; }
  .topnav[data-q="open"] .mark-wrap, .topnav[data-q="open"] .ptitle, .topnav[data-q="open"] .q-open { display: none; }
  .topnav[data-q="open"] .search { flex: 1 1 auto; }
  .topnav[data-q="open"] .q-field { display: flex; flex: 1 1 auto; width: auto; }
  .topnav[data-q="open"] .q-cancel { display: block; flex: none; min-height: 2.6rem; padding: 0 .5rem; border: 0; background: none; color: var(--bg-accent); font: inherit; font-weight: 650; cursor: pointer; }
  .q-pop { position: fixed; left: 8px; right: 8px; top: calc(env(safe-area-inset-top) + var(--top-h) + .3rem); width: auto; max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - var(--top-h) - var(--tab-h) - 1rem); }

  .tabs {
    position: fixed; z-index: 12; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr);
    height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding: .2rem max(.4rem, env(safe-area-inset-left)) env(safe-area-inset-bottom) max(.4rem, env(safe-area-inset-right));
    background: color-mix(in srgb, var(--card) 92%, transparent); border-top: 1px solid var(--card-line);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  .tab { flex-direction: column; justify-content: center; gap: .18rem; min-height: 0; padding: .2rem 0; font-size: .72rem; border-radius: 14px; }
  .tab .ic { width: 1.45rem; height: 1.45rem; }
  .tab[aria-current="page"] { color: var(--bg-accent); }
  .toast { bottom: calc(var(--tab-h, 3.7rem) + env(safe-area-inset-bottom) + .6rem); }

  /* the CRM keeps its own tabs (Call, Companies, ...) but at the top, so the app's tab bar is the only one at the bottom */
  #crm-host .crm-tabs.bottom { display: none; }
  #crm-host .crm-tabs.top { display: flex; flex: 1 1 auto; min-width: 0; gap: .1rem; overflow-x: auto; scrollbar-width: none; }
  #crm-host .crm-tabs.top button { min-height: 2.4rem; padding: .3rem .65rem; gap: .3rem; font-size: .85rem; }
  #crm-host .crm-tabs.top button .ic { display: none; }
  #crm-host .crm-top { flex-wrap: nowrap; }
  #crm-host .crm-top .status { margin-left: 0; }
  #crm-host .crm-top .status-text { display: none; }
}

/* ---- Feedback: on every screen, bottom-right (above the tab bar on a phone) ---- */
.fb-host { position: fixed; z-index: 14; right: calc(1rem + env(safe-area-inset-right)); bottom: calc(1rem + env(safe-area-inset-bottom) + var(--tab-h, 0rem)); display: flex; flex-direction: column; align-items: flex-end; gap: .6rem; pointer-events: none; }
.fb-host > * { pointer-events: auto; }
.la .fb-btn {
  position: relative; display: inline-flex; align-items: center; gap: .45rem; min-height: 2.3rem; padding: 0 .95rem; border: 1px solid var(--bg-line); border-radius: 999px;
  background: color-mix(in srgb, var(--card) 88%, transparent); color: var(--bg-ink-2); font: 600 .85rem/1 var(--f-util); cursor: pointer;
  box-shadow: 0 4px 14px rgba(20, 40, 35, .08); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.la .fb-btn:hover, .la .fb-btn[aria-expanded="true"] { color: var(--bg-ink); border-color: var(--bg-ink-2); }
.fb-n { min-width: 1.3rem; height: 1.3rem; padding: 0 .35rem; border-radius: 999px; display: inline-grid; place-items: center; background: var(--bg-accent); color: var(--bg-accent-ink); font: 700 .74rem/1 var(--f-util); font-variant-numeric: tabular-nums; }
.la .fb-panel { width: min(24rem, calc(100vw - 2rem)); max-height: min(72vh, 38rem); overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: .75rem; border-radius: 18px; padding: .9rem 1rem 1rem; box-shadow: 0 18px 50px rgba(20, 40, 35, .22); }
.la .fb-panel .ghead { align-items: flex-start; }
.la .fb-title { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.la .fb-title strong { font-size: 1.05rem; }
.la .fb-title .lab { overflow-wrap: anywhere; }
.la .fb-panel .btn.quiet { min-height: 2rem; min-width: 2rem; padding: .2rem .5rem; font-size: 1.15rem; }
.la .fb-form { display: flex; flex-direction: column; gap: .45rem; align-items: flex-end; margin: 0; }
.la .fb-form .edit { width: 100%; min-height: 4.2rem; }
.la .fb-list { display: flex; flex-direction: column; gap: .5rem; }
.la .fb-empty { font-size: .9rem; }
.la .fb-note { background: var(--surface-2); border-radius: 12px; padding: .6rem .75rem; display: flex; flex-direction: column; gap: .45rem; }
.la .fb-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.la .fb-reply { border-left: 3px solid var(--accent); padding-left: .65rem; display: flex; flex-direction: column; gap: .2rem; }
.la .fb-reply p { white-space: pre-wrap; overflow-wrap: anywhere; }
.la .fb-reply .by { font: 600 .72rem/1 var(--f-util); color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.la .fb-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.la .fb-foot .btn { min-height: 2rem; padding: .3rem .8rem; }
html.drawer-open .fb-host { display: none; }
.la .fb-btn .ic { width: 1rem; height: 1rem; }
@media (max-width: 720px) {
  .la .fb-btn { min-height: 2.6rem; min-width: 2.6rem; padding: 0 .7rem; justify-content: center; gap: .3rem; background: color-mix(in srgb, var(--card) 94%, transparent); }
  .la .fb-btn .fb-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .la .fb-btn .ic { width: 1.15rem; height: 1.15rem; }
  .fb-host { right: calc(.75rem + env(safe-area-inset-right)); bottom: calc(.75rem + env(safe-area-inset-bottom) + var(--tab-h, 0rem)); }
}

/* ================= the ported views (.la) ================= */
.la {
  --surface: var(--bg); --surface-2: var(--bg-2); --ink: var(--bg-ink); --ink-2: var(--bg-ink-2); --line: var(--bg-line);
  --accent: var(--bg-accent); --accent-ink: var(--bg-accent-ink); --good: var(--bg-good); --bad: var(--bg-bad); --tone-ink: var(--bg-tone-ink); --warn: var(--bg-warn); --focus: var(--bg-focus);
  color: var(--ink);
}
.la.page {
  flex: 1 1 auto; min-width: 0;
  padding-inline: clamp(16px, 2.2vw, 3rem); padding-block: .4rem calc(5rem + var(--tab-h, 0rem));
  display: flex; flex-direction: column; gap: calc(1.25rem * var(--d));
}
.la .card {
  --surface: var(--card); --surface-2: var(--card-2); --ink: var(--card-ink); --ink-2: var(--card-ink-2); --line: var(--card-line);
  --accent: var(--card-accent); --accent-ink: var(--card-accent-ink); --good: var(--card-good); --bad: var(--card-bad); --tone-ink: var(--card-tone-ink); --warn: var(--card-warn); --focus: var(--card-focus);
  background: var(--surface); color: var(--ink); border: var(--bw) solid var(--line); box-shadow: var(--shadow);
  padding: calc(.95rem * var(--d)) calc(1.05rem * var(--d));
}
.la :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.la .lab {
  font: var(--label-style) var(--label-w) var(--label-size)/1.2 var(--f-util);
  letter-spacing: var(--label-track); text-transform: var(--label-case); color: var(--ink-2); margin: 0;
}
.la .muted { color: var(--ink-2); }
.la .when { font: 500 .78rem/1 var(--f-mono); color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.la h3 { margin: 0; }
.la p { margin: 0; }

/* controls */
.la button { font: inherit; color: inherit; }
.la .btn, .la .seg button {
  font: var(--label-style) var(--label-w) var(--label-size)/1 var(--f-util); letter-spacing: var(--label-track); text-transform: var(--label-case);
  padding: .5rem .75rem; min-height: 2.3rem; min-width: 2.3rem; border: var(--bw) solid var(--line); background: transparent; color: var(--ink);
  border-radius: var(--radius-s); cursor: pointer; white-space: nowrap;
}
.la .btn:hover, .la .seg button:hover { border-color: var(--ink); }
.la .btn.solid { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.la .btn.quiet { border-color: transparent; color: var(--ink-2); }
.la .btn.quiet:hover { color: var(--ink); border-color: var(--line); }
.la .btn.danger { border-color: var(--bad); color: var(--bad); }
.la .btn.danger:hover { background: var(--bad); color: var(--tone-ink); }
.la .seg { display: flex; flex-wrap: wrap; gap: .3rem; padding: 0; border: 0; border-radius: 0; background: none; }
.la .seg button { display: inline-flex; align-items: center; gap: .4rem; }
.la .seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.la .seg button[data-tone="quiet"][aria-pressed="true"] { background: var(--surface-2); color: var(--ink); border-color: var(--ink); }
.la .seg button[data-tone="good"][aria-pressed="true"] { background: var(--good); color: var(--tone-ink); border-color: var(--good); }
.la .seg button[data-tone="bad"][aria-pressed="true"] { background: var(--bad); color: var(--tone-ink); border-color: var(--bad); }
.la .seg button.subchip { font-size: calc(var(--label-size) * .92); border-style: dashed; }
.la .edit {
  font: inherit; color: var(--ink); background: transparent; border: 0; border-bottom: var(--bw) dashed var(--line); border-radius: 0;
  padding: .35rem 0; width: 100%; min-width: 0; resize: none; overflow: hidden; field-sizing: content; display: block;
}
.la .edit::placeholder { color: var(--ink-2); opacity: 1; }
.la .edit:focus-visible { outline: none; border-bottom: var(--bw) solid var(--accent); background: var(--surface-2); }
.la .edit.box { border: var(--bw) solid var(--line); background: var(--surface-2); border-radius: min(var(--radius-s), .7rem); padding: .45rem .65rem; }
.la .edit.box:focus-visible { border: var(--bw) solid var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.la select.edit.box { width: auto; max-width: 100%; cursor: pointer; min-height: 2.3rem; }
.la .edit.title { font: var(--title-w) 1.7rem/1.12 var(--f-title); letter-spacing: var(--title-track); text-transform: var(--title-case); }
@media (pointer: coarse) { .la input.edit, .la textarea.edit, .la select.edit { font-size: max(16px, 1em); } }
.la .chip {
  font: var(--label-style) var(--label-w) calc(var(--label-size) * .9)/1 var(--f-util); letter-spacing: var(--label-track); text-transform: var(--label-case);
  padding: .25rem .5rem; border-radius: var(--radius-s); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap;
}
.la .chip.mark { background: var(--mark); color: var(--mark-ink); border-color: var(--mark); }
.la .chip.good { background: var(--good); color: var(--tone-ink); border-color: var(--good); }
.la .chip.wait { border-style: dashed; color: var(--accent); }
.la .chip.ref { cursor: pointer; background: transparent; color: var(--accent); border-color: currentColor; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; }
.la .chip.ref::before { content: '↗ '; }
.la .adot { width: .7rem; height: .7rem; border-radius: 50%; flex: none; display: inline-block; background: hsl(var(--h, 200) 62% var(--dot-l)); }
.la .adot.plain { background: var(--ink-2); }
.la .zone-empty { margin: 0; border: var(--bw) dashed var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; color: var(--ink-2); }
.la .fieldrow { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.la .inline { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.la .inline > .fieldrow { flex: 1 1 10rem; }
.la .plus {
  width: 1.9rem; height: 1.9rem; border-radius: 50%; border: var(--bw) solid currentColor; background: transparent; color: inherit; cursor: pointer;
  font: 500 1.25rem/1 var(--f-mono); display: grid; place-items: center; padding: 0; flex: none; opacity: .75;
}
.la .plus:hover { opacity: 1; }
@keyframes landed { from { box-shadow: 0 0 0 .5rem var(--mark); } to { box-shadow: 0 0 0 0 transparent; } }
.la .landed { animation: landed 1.8s ease-out; }
@media (prefers-reduced-motion: reduce) { .la .landed { animation: none; } }

/* comment + ask on every item */
.la .fb { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: flex-start; padding-top: .15rem; min-width: 0; }
.la .fb > .edit { flex: 1 1 13rem; width: auto; order: 1; }
.la .ask { order: 3; flex: 1 1 13rem; min-width: 0; display: flex; gap: .3rem; align-items: flex-start; margin: 0; }
.la .ask .edit { flex: 1 1 auto; width: auto; }
.la .ask .btn { flex: none; }
.la .thread { order: 2; flex: 1 1 100%; min-width: 0; display: flex; flex-direction: column; gap: .4rem; }
.la .qa { background: var(--surface-2); border-radius: min(var(--radius-s), .7rem); padding: .55rem .7rem; display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; }
.la .qa .q { font-weight: 600; }
.la .qa .a { white-space: pre-wrap; max-width: 70ch; }
.la .qa .a.wait { color: var(--ink-2); font-style: italic; }
.la .qa .a.wait::before { content: ''; display: inline-block; width: .55rem; height: .55rem; margin-right: .45rem; border-radius: 50%; background: var(--accent); vertical-align: .05em; animation: pulse 1.8s ease-in-out infinite; }
.la .qa .by { font: 600 .72rem/1 var(--f-util); color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.la .fbcard { display: flex; flex-direction: column; gap: .5rem; }

/* bars and add boxes */
.la .bar { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; align-items: center; min-width: 0; }
.la .add { display: flex; flex-wrap: wrap; gap: .4rem; flex: 1 1 28rem; min-width: 0; align-items: stretch; margin: 0; }
.la .add .edit { flex: 1 1 14rem; width: auto; font-size: 1.15rem; }
.la .add select.edit { flex: 0 1 15rem; font-size: 1rem; }
.la.page > .add, .la .pcol > .add, .la .drawer .add { flex: none; }

/* action lists */
.la .groups { display: grid; gap: calc(1.2rem * var(--d)) calc(1.4rem * var(--d)); align-items: start; grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr)); }
.la .group { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.la .ghead { display: flex; align-items: center; justify-content: space-between; gap: .6rem; min-width: 0; }
.la .path {
  font: var(--label-style) var(--label-w) var(--label-size)/1.2 var(--f-util); letter-spacing: var(--label-track); text-transform: var(--label-case);
  background: none; border: 0; color: var(--ink-2); padding: .3rem 0; text-align: left; display: inline-flex; gap: .45rem; align-items: center; min-width: 0; overflow-wrap: anywhere;
}
.la button.path { cursor: pointer; }
.la button.path:hover { color: var(--ink); text-decoration: underline; }
.la .rows { display: flex; flex-direction: column; min-width: 0; }
.la .rows.card { padding: 0; border-radius: var(--radius); overflow: hidden; }
.la .arow { display: flex; align-items: center; gap: .65rem; padding: calc(.5rem * var(--d)) calc(.85rem * var(--d)); border-bottom: 1px solid var(--line); min-width: 0; }
.la .arow:last-child { border-bottom: 0; }
.la .arow.wrap { flex-wrap: wrap; }
.la .ctext { flex: 1 1 14rem; min-width: 0; margin: 0; font-size: 1.08rem; line-height: 1.3; overflow-wrap: anywhere; text-align: left; background: none; border: 0; padding: .25rem 0; cursor: pointer; color: inherit; }
.la .ctext:hover { text-decoration: underline; }
.la .check {
  flex: none; width: 1.75rem; height: 1.75rem; border-radius: 50%; border: var(--bw) solid var(--ink-2); background: transparent; color: transparent;
  cursor: pointer; font-size: 1rem; line-height: 1; display: grid; place-items: center; padding: 0;
}
.la .check:hover { border-color: var(--good); color: var(--good); }
.la .check[aria-pressed="true"] { background: var(--good); border-color: var(--good); color: var(--tone-ink); }
.la .atitle { flex: 1 1 auto; min-width: 0; text-align: left; background: none; border: 0; color: inherit; font: inherit; font-size: 1.08rem; line-height: 1.3; cursor: pointer; padding: .25rem 0; overflow-wrap: anywhere; }
.la .atitle:hover { text-decoration: underline; }
.la [data-status="done"] .atitle { text-decoration: line-through; color: var(--ink-2); }
.la .star { flex: none; background: none; border: 0; cursor: pointer; font-size: 1.3rem; line-height: 1; color: var(--ink-2); opacity: .38; padding: .25rem; min-width: 2.1rem; min-height: 2.1rem; border-radius: var(--radius-s); }
.la .star:hover { opacity: .8; }
.la .star[aria-pressed="true"] { color: var(--accent); opacity: 1; }
@media (pointer: coarse) { .la .check { width: 2.2rem; height: 2.2rem; } .la .star { min-width: 2.6rem; min-height: 2.6rem; } }

/* Home: capture, the Inbox strip, filter chips, actions by area and project */
.la .home { width: 100%; max-width: 52rem; margin: 0 auto; display: flex; flex-direction: column; gap: calc(1.15rem * var(--d) + .3rem); padding-top: .9rem; }
.la .home-head { display: flex; align-items: baseline; justify-content: space-between; gap: .4rem 1.2rem; flex-wrap: wrap; min-width: 0; }
.la .home-date { font: var(--display-w) clamp(1.7rem, 2vw, 2.3rem)/1.1 var(--f-display); letter-spacing: var(--display-track); color: var(--display-ink); }
.la .ticker { margin: 0; min-width: 0; color: var(--ink-2); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.la .ticker:empty { display: none; }
.la .add.capture { flex: none; }
.la .add.capture .edit { min-height: 2.9rem; padding-inline: 1rem; background: var(--card); border-color: var(--card-line); border-radius: 999px; }
.la .add.capture .btn { min-height: 2.9rem; padding-inline: 1.1rem; }
.la .hlab { font: 700 .76rem/1.2 var(--f-util); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
.la .inbox-strip { display: flex; flex-direction: column; gap: .35rem; }
.la .inbox-strip .rows.card { border-style: dashed; border-color: var(--bg-line); box-shadow: none; background: color-mix(in srgb, var(--card) 72%, transparent); }
.la .arow.cap { flex-wrap: wrap; row-gap: .3rem; }
.la .cmain { flex: 1 1 16rem; min-width: 0; display: flex; align-items: center; gap: .6rem; }
.la .cmain .ctext { flex: 1 1 auto; }
.la .cmeta { display: inline-flex; align-items: center; gap: .45rem; flex: none; }
.la .cact { display: flex; align-items: center; gap: .25rem; flex: none; margin-left: auto; }
.la .cact .file-pick { max-width: 13rem; min-height: 2.2rem; padding-block: .3rem; font-size: .92rem; }
.la .cact .btn.quiet { font-size: 1.2rem; min-width: 2.2rem; min-height: 2.2rem; padding: 0; }
.la .chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.la .chips button {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 2.2rem; padding: .35rem .85rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--bg-line); background: transparent; color: var(--ink-2); font: 600 .88rem/1 var(--f-util); white-space: nowrap;
}
.la .chips button:hover { color: var(--ink); border-color: var(--ink-2); }
.la .chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.la .chips .n { font: 500 .78rem/1 var(--f-mono); opacity: .7; font-variant-numeric: tabular-nums; }
.la .hgroups { display: flex; flex-direction: column; gap: calc(1.3rem * var(--d) + .4rem); }
.la .harea { display: flex; flex-direction: column; gap: .55rem; min-width: 0; }
.la .ahead-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: .5rem; padding: .15rem 0; border: 0; background: none; color: var(--ink-2); font: 700 .78rem/1.2 var(--f-util); letter-spacing: .07em; text-transform: uppercase; text-align: left; }
.la button.ahead-btn { cursor: pointer; }
.la button.ahead-btn:hover { color: var(--ink); }
.la .ahead-btn .adot { width: .62rem; height: .62rem; }
.la .hproj { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.la .phead-btn { align-self: stretch; display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; padding: .1rem .2rem .1rem 0; border: 0; background: none; color: var(--ink); font: 600 1rem/1.25 var(--f-title); text-align: left; min-width: 0; }
.la button.phead-btn { cursor: pointer; }
.la button.phead-btn:hover .pt { text-decoration: underline; }
.la .phead-btn.plain { color: var(--ink-2); }
.la .phead-btn .pt { min-width: 0; overflow-wrap: anywhere; }
.la .phead-btn .n { flex: none; font: 500 .78rem/1 var(--f-mono); color: var(--ink-2); }
.la .crumbs .btn.back { min-height: 2.1rem; padding: .35rem .8rem; }
@media (max-width: 720px) {
  .la .home { padding-top: .2rem; }
  .la .home-date { display: none; }
  .la .add.capture .edit { flex-basis: 0; }
  .la .cact { margin-left: 0; width: 100%; }
  .la .cact .file-pick { flex: 1 1 auto; max-width: none; }
  .la .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .la .chips button { flex: none; padding-inline: .75rem; }
}

/* the projects map */
.la .areas { display: grid; gap: calc(1.4rem * var(--d)); align-items: start; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.la .areas.one { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
@media (max-width: 900px) { .la .areas.one { grid-template-columns: minmax(0, 1fr); } }
.la .area { display: flex; flex-direction: column; gap: calc(.7rem * var(--d)); min-width: 0; }
.la .band {
  border-radius: var(--radius); padding: calc(.8rem * var(--d)) calc(1rem * var(--d)); display: flex; flex-direction: column; gap: .15rem; min-width: 0;
  background: hsl(var(--h, 200) var(--tint-s) var(--tint-l)); color: hsl(var(--h, 200) var(--tone-s) var(--tone-l));
  --ink: hsl(var(--h, 200) var(--tone-s) var(--tone-l)); --ink-2: hsl(var(--h, 200) var(--tone-s) var(--tone-l)); --line: transparent; --surface-2: transparent;
}
.la .band.plain { background: transparent; color: var(--bg-ink); border: var(--bw) dashed var(--bg-line); --ink: var(--bg-ink); --ink-2: var(--bg-ink-2); }
.la .band .edit { border-bottom-color: transparent; padding: .1rem 0; }
.la .band .edit:hover { border-bottom-color: currentColor; }
.la .band .name { font: var(--display-w) 1.75rem/1.05 var(--f-display); letter-spacing: var(--display-track); text-transform: var(--display-case); }
.la .band .lab { color: inherit; opacity: .85; }
.la .band .nrow { display: flex; align-items: center; justify-content: space-between; gap: .6rem; min-width: 0; }
.la .band .nrow > .edit, .la .band .nrow > .name { flex: 1 1 auto; min-width: 0; }
.la .band .more { color: inherit; border-color: currentColor; opacity: .55; }
.la .band .more:hover { opacity: 1; }
.la .band .linkish { background: none; border: 0; padding: .1rem 0; text-align: left; cursor: pointer; color: inherit; }
.la .band .linkish:hover { text-decoration: underline; }
.la .band.sub { padding: calc(.5rem * var(--d)) calc(.8rem * var(--d)); gap: .05rem; }
.la .band.sub .name { font-size: 1.2rem; }
.la .subarea { display: flex; flex-direction: column; gap: calc(.6rem * var(--d)); min-width: 0; padding-left: calc(.7rem * var(--d)); border-left: 2px solid hsl(var(--h, 200) 55% var(--dot-l)); margin-top: calc(.3rem * var(--d)); }
.la .pcard { text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: .45rem; border-radius: var(--radius); font: inherit; min-width: 0; width: 100%; }
.la .pcard:hover { border-color: var(--ink); }
.la .pcard[data-state="parked"], .la .pcard[data-state="done"], .la .pcard[data-state="dead"] { opacity: .6; }
.la .pcard[data-state="dead"] h3, .la .pcard[data-state="done"] h3 { text-decoration: line-through; }
.la .pcard h3 { margin: 0; font: var(--title-w) var(--title-size)/1.15 var(--f-title); letter-spacing: var(--title-track); text-transform: var(--title-case); overflow-wrap: anywhere; }
.la .pcard p { margin: 0; overflow-wrap: anywhere; }
.la .nx { display: flex; gap: .5rem; align-items: baseline; }
.la .nx .lab { flex: none; }
.la .pfoot { display: flex; align-items: center; gap: .6rem; margin-top: auto; padding-top: .2rem; }
.la .prog { flex: 1 1 auto; height: .4rem; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.la .prog i { display: block; height: 100%; border-radius: 99px; background: hsl(var(--h, 200) 62% var(--dot-l)); }
.la .newslot { border: var(--bw) dashed var(--line); border-radius: var(--radius); padding: calc(.5rem * var(--d)) calc(.8rem * var(--d)); margin: 0; display: flex; }
.la .newslot .edit { border-bottom: 0; }
.la .more {
  height: 1.9rem; min-width: 1.9rem; padding: 0 .45rem; border: var(--bw) solid currentColor; border-radius: 99px; background: transparent; color: inherit; cursor: pointer;
  font: 500 .8rem/1 var(--f-mono); opacity: .75; flex: none; white-space: nowrap;
}
.la .more:hover { opacity: 1; }

/* the project page */
.la .crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .6rem; color: var(--ink-2); }
.la .ppage { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: calc(1.6rem * var(--d)); align-items: start; }
.la .phead { display: flex; flex-direction: column; gap: calc(.8rem * var(--d)); border-radius: var(--radius); min-width: 0; }
.la .pcol { display: flex; flex-direction: column; gap: calc(.9rem * var(--d)); min-width: 0; }

/* the detail panel */
.la .drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(31rem, 100%); z-index: 15; overflow: auto; border-radius: 0; border-width: 0 0 0 var(--bw);
  padding: calc(1rem + env(safe-area-inset-top, 0px)) 1.2rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: calc(.9rem * var(--d)); box-shadow: -14px 0 44px rgba(0, 0, 0, .16);
}
.la .drawer > * { flex-shrink: 0; }
.la .drawer .ghead { align-items: center; }
.la .dhead { position: sticky; top: calc(-1rem - env(safe-area-inset-top, 0px)); z-index: 1; background: var(--surface); padding-block: .5rem; margin-block: -.5rem 0; flex-wrap: wrap; }
.la .dhead .inline { flex-wrap: nowrap; }
@media (pointer: coarse) { .la .drawer .btn, .la .drawer .seg button { min-height: 2.75rem; } }

@media (max-width: 1000px) { .la .ppage { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  .la .add .edit { flex-basis: 100%; }
  .la .add select.edit { flex: 1 1 auto; }
}

/* ================= Canvas ================= */
.la .canvas {
  position: absolute; inset: 0; z-index: 1; gap: 0; overflow: hidden;
  --grid-major: color-mix(in srgb, var(--bg-ink) 15%, transparent); --grid-minor: color-mix(in srgb, var(--bg-ink) 7%, transparent);
  color: var(--ink); background: var(--bg) var(--wall) no-repeat; font: 400 var(--body-size)/1.45 var(--f-body);
}
.la .vp {
  position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab;
  background-image: linear-gradient(var(--grid-major) 1px, transparent 1px), linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-minor) 1px, transparent 1px), linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
}
.la .vp.far { --grid-minor: transparent; }
.la .vp.panning { cursor: grabbing; }
.la .world { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; }
.la .wires { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.la .wires path { fill: none; stroke: var(--line); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.la .wires circle { fill: var(--bg); stroke: var(--line); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.la .wires .hued { stroke: hsl(var(--h, 200) 55% var(--dot-l)); }
.la .wires .w-soft { stroke-dasharray: 5 5; }
.la .wires .w-link { stroke: #e0895f; stroke-width: 2; stroke-dasharray: 9 6; }
.la .wires circle.w-link { fill: #e0895f; stroke-dasharray: none; }
.la .wires .w-hit { stroke: transparent; stroke-width: 20; stroke-dasharray: none; pointer-events: stroke; cursor: pointer; }
.la .node { position: absolute; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; display: flex; flex-direction: column; gap: .3rem; min-width: 0; border-radius: var(--radius); }
.la .node[data-fixed] { cursor: inherit; }
.la .node.sel { outline: 3px solid #e0895f; outline-offset: 4px; }
.la .node.lift { outline: 2px dashed var(--ink); outline-offset: 4px; }
.la .node h3 { margin: 0; font: var(--title-w) var(--title-size)/1.15 var(--f-title); letter-spacing: var(--title-track); text-transform: var(--title-case); overflow-wrap: break-word; }
.la .node p { margin: 0; overflow-wrap: anywhere; }
.la .nrow { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; min-width: 0; }
.la .nrow > :first-child { min-width: 0; flex: 1 1 auto; }
.la .node .name { font: var(--display-w) 1.5rem/1.05 var(--f-display); letter-spacing: min(var(--display-track), .05em); text-transform: var(--display-case); overflow-wrap: break-word; }
.la .node.band { --ink: hsl(var(--h, 200) var(--tone-s) var(--tone-l)); }
.la .n-root { width: 18rem; padding: 1rem 1.1rem; border: 2px solid var(--ink); background: var(--card); box-shadow: var(--shadow); }
.la .n-root .name { font-size: 2.5rem; line-height: 1; color: var(--display-ink); }
.la .n-root.slim { padding: .3rem .7rem; border-width: var(--bw); justify-content: center; min-height: 3rem; }
.la .n-root.slim .name { font-size: 1.3rem; }
.la .n-root.slim .nrow { align-items: center; }
.la .n-area { width: 17rem; }
.la .n-area.sub { width: 15rem; padding: .55rem .8rem; }
.la .n-area.sub .name { font-size: 1.15rem; }
.la .n-project { width: 16.5rem; }
.la .n-project.card { padding: .7rem .8rem; }
.la .n-project[data-state="parked"], .la .n-project[data-state="done"], .la .n-project[data-state="dead"] { opacity: .6; }
.la .n-action { width: 20rem; flex-direction: row; align-items: center; gap: .55rem; }
.la .n-action.card { padding: .45rem .6rem; border-radius: min(var(--radius), 16px); }
.la .nmain { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .25rem; }
.la .nchips { display: flex; flex-wrap: wrap; gap: .3rem; }
.la .n-action .ntitle { font-size: 1.02rem; line-height: 1.3; overflow-wrap: anywhere; }
.la .n-action[data-status="done"] .ntitle { text-decoration: line-through; color: var(--ink-2); }
.la .n-inbox, .la .n-unfiled, .la .n-capture { width: 14rem; padding: .6rem .75rem; border: var(--bw) dashed var(--line); background: color-mix(in srgb, var(--card) 70%, transparent); }
.la .n-inbox .name, .la .n-unfiled .name { font-size: 1.35rem; }
.la .n-note { width: 14rem; padding: .6rem .75rem; background: var(--mark); color: var(--mark-ink); font: 500 .9rem/1.4 var(--f-mono); border-radius: 14px; }
.la .n-note p { white-space: pre-wrap; }
.la .nbtns { display: flex; gap: .3rem; align-items: center; flex: none; }
.la .fold {
  height: 1.9rem; min-width: 1.9rem; padding: 0 .45rem; border: var(--bw) solid currentColor; border-radius: 99px; background: transparent; color: inherit; cursor: pointer;
  font: 500 .8rem/1 var(--f-mono); opacity: .75; flex: none; white-space: nowrap;
}
.la .fold:hover { opacity: 1; }
.la .inl {
  display: block; width: 100%; min-width: 0; flex: 1 1 auto; border: 0; margin: 0; padding: 0; background: transparent; resize: none; overflow: hidden;
  outline: 2px solid #e0895f; outline-offset: 4px; border-radius: 1px; user-select: text; -webkit-user-select: text; cursor: text;
}
.la .canvas:not([data-mode="wide"]) .node { cursor: pointer; }
.la .cnt { flex: none; font: 600 .95rem/1 var(--f-mono); opacity: .85; white-space: nowrap; padding: .45rem .15rem 0; }
.la .canvas:not([data-mode="wide"]) .more { width: 2.75rem; min-width: 2.75rem; height: 2.75rem; margin: -.35rem -.3rem -.35rem .15rem; opacity: 1; }
.la .canvas:not([data-mode="wide"]) .check { width: 2.2rem; height: 2.2rem; }
@media (hover: hover) {
  .la .canvas[data-mode="wide"] .node [data-edit] { cursor: text; }
  .la .canvas[data-mode="wide"] .node .nbtns {
    position: absolute; right: -1px; bottom: calc(100% - 1px); z-index: 2; display: none; padding: .25rem;
    background: var(--card); color: var(--bg-ink); border: var(--bw) solid var(--bg-line); border-radius: 999px;
  }
  .la .canvas[data-mode="wide"] .node:hover, .la .canvas[data-mode="wide"] .node:focus-within { z-index: 2; }
  .la .canvas[data-mode="wide"] .node:hover .nbtns, .la .canvas[data-mode="wide"] .node:focus-within .nbtns { display: flex; }
}
@media (pointer: coarse) {
  .la .canvas .plus, .la .canvas .fold, .la .canvas .more { min-width: 2.5rem; width: auto; height: 2.5rem; }
  .la .canvas .check { width: 2.2rem; height: 2.2rem; }
  .la .canvas .star { min-width: 2.5rem; min-height: 2.5rem; }
}
.la .cv-tools-btn {
  position: absolute; z-index: 3; top: calc(.8rem + env(safe-area-inset-top, 0px)); right: calc(.8rem + env(safe-area-inset-right, 0px));
  height: 3rem; display: inline-flex; align-items: center; gap: .4rem; padding: 0 1rem 0 .8rem;
  border: 1px solid var(--bg-line); border-radius: 999px; background: var(--card); color: var(--bg-ink); cursor: pointer; font-weight: 650;
}
.la .cv-tools-btn .ic-dots { font-size: 1.3rem; line-height: 1; }
.la .cv-tools-btn:hover, .la .cv-tools-btn[aria-expanded="true"] { border-color: var(--bg-ink); }
@media (max-width: 720px) { .la .cv-tools-btn { width: 3rem; padding: 0; justify-content: center; } .la .cv-tools-btn .tl { display: none; } }
.la .canvas .menu {
  position: absolute; z-index: 4; top: calc(4.3rem + env(safe-area-inset-top, 0px)); right: calc(.8rem + env(safe-area-inset-right, 0px));
  width: min(22rem, calc(100% - 1.6rem)); max-height: calc(100% - 5.3rem - env(safe-area-inset-top, 0px)); overflow: auto;
  display: flex; flex-direction: column; gap: .9rem; border-radius: min(var(--radius), 18px); padding: 1rem;
}
.la .mgroup { display: flex; flex-direction: column; gap: .4rem; }
.la .mgroup p { margin: 0; font-size: .88rem; }
.la .hintpill {
  position: absolute; z-index: 3; top: .8rem; left: calc(.8rem + env(safe-area-inset-left, 0px));
  max-width: calc(100% - 10rem); min-height: 3rem; display: flex; align-items: center; gap: .7rem; padding: .3rem .4rem .3rem .9rem;
  background: var(--mark); color: var(--mark-ink); border-radius: 999px; font: var(--label-w) var(--label-size)/1.2 var(--f-util);
}
.la .hintpill .btn { color: inherit; border-color: currentColor; }
.la .titleblock {
  position: absolute; z-index: 2; left: calc(.8rem + env(safe-area-inset-left, 0px)); bottom: .8rem; pointer-events: none;
  display: grid; grid-template-columns: auto auto; border: var(--bw) solid var(--line); background: var(--card); color: var(--ink-2); border-radius: 12px; overflow: hidden;
  font: 500 .68rem/1.2 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; font-variant-numeric: tabular-nums;
}
.la .titleblock > div { padding: .3rem .6rem; border-top: 1px solid var(--line); }
.la .titleblock > .tb-v { border-left: 1px solid var(--line); color: var(--ink); }
.la .titleblock .tb-name { grid-column: 1 / -1; border-top: 0; border-left: 0; color: var(--display-ink); font: var(--display-w) 1.15rem/1 var(--f-display); letter-spacing: var(--display-track); text-transform: none; }
@media (max-width: 600px) { .la .titleblock .tb-x, .la .titleblock .tb-name { display: none; } .la .titleblock > div { border-top: 0; } }

/* ================= Calendar ================= */
.la .cal-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem; min-width: 0; }
.la .cal-nav { display: flex; gap: .3rem; }
.la .cal-title { margin: 0; flex: 1 1 auto; min-width: 0; font: var(--display-w) 1.65rem/1.05 var(--f-display); letter-spacing: var(--display-track); text-transform: var(--display-case); color: var(--display-ink); }
.la .cal-wrap { position: relative; display: flex; flex-direction: column; gap: calc(1rem * var(--d)); min-width: 0; --line-soft: color-mix(in srgb, var(--card-line) 62%, transparent); }
.la .cal-month, .la .cal-week, .la .cal-quick { --line-soft: color-mix(in srgb, var(--line) 62%, transparent); --hover: color-mix(in srgb, var(--surface-2) 75%, var(--surface)); }
.la .cal-month.card { padding: 0; overflow: hidden; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-radius: min(var(--radius), 14px); }
.la .cal-dow { padding: .6rem .65rem .5rem; font: 500 .8rem/1 var(--f-body); color: var(--ink-2); border-bottom: 1px solid var(--line); border-right: 1px solid var(--line-soft); }
.la .cal-day { min-height: calc(7.4rem * var(--d) + 1.5rem); min-width: 0; padding: .3rem .35rem .45rem; display: flex; flex-direction: column; gap: .2rem; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); cursor: cell; transition: background-color .12s; }
.la .cal-dow:nth-child(7n), .la .cal-day:nth-child(7n) { border-right: 0; }
.la .cal-day:nth-last-child(-n + 7) { border-bottom: 0; }
.la .cal-day:hover { background: var(--hover); }
.la .cal-day.out { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.la .cal-day.out .dn { color: var(--ink-2); opacity: .7; }
.la .cal-day .dn { align-self: flex-start; min-width: 1.75rem; height: 1.75rem; display: grid; place-items: center; padding: 0 .3rem; border-radius: 99px; font: 600 .85rem/1 var(--f-body); font-variant-numeric: tabular-nums; }
.la .cal-day.today .dn { background: var(--accent); color: var(--accent-ink); }
.la .cal-day.picked { box-shadow: inset 0 0 0 2px var(--accent); }
.la .cal-day.over, .la .cw-ad.over, .la .cw-slot.over, .la .cal-aday.over { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.la .cal-item {
  display: flex; align-items: center; gap: .35rem; width: 100%; min-width: 0; padding: .22rem .45rem; border: 0; border-radius: min(var(--radius-s), 6px);
  background: hsl(var(--h, 200) var(--tint-s) var(--tint-l)); color: hsl(var(--h, 200) var(--tone-s) var(--tone-l)); font: 500 .82rem/1.25 var(--f-body); text-align: left; cursor: pointer;
}
.la .cal-item.plain { background: var(--surface-2); color: var(--ink); }
.la .cal-item:hover { filter: brightness(.97); box-shadow: inset 0 0 0 1px currentColor; }
.la .cal-item.dragging { opacity: .45; }
.la .cal-item .t { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.la .cal-item .tm { flex: none; font: 500 .74rem/1 var(--f-mono); opacity: .8; }
.la .cal-item .ck { flex: none; width: .78rem; height: .78rem; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; font-size: .55rem; line-height: 1; }
.la .cal-item[data-done] .t { text-decoration: line-through; opacity: .6; }
.la .cal-item.wide { flex: 1 1 12rem; width: auto; font-size: 1rem; padding: .3rem .2rem; background: none; color: var(--ink); gap: .55rem; }
.la .cal-item.wide:hover { box-shadow: none; filter: none; text-decoration: underline; }
.la .cal-item.wide .tm { display: none; }
.la .cal-item.wide .ck { color: hsl(var(--h, 200) 55% var(--dot-l)); }
.la .cal-item.wide.plain .ck { color: var(--ink-2); }
.la .cal-item.wide.event::before { content: ''; flex: none; width: .7rem; height: .7rem; border-radius: 3px; background: hsl(var(--h, 200) 62% var(--dot-l)); }
.la .cal-item.wide.event.plain::before { background: var(--ink-2); }
.la .cal-more { align-self: flex-start; border: 0; background: none; color: var(--ink-2); font: 500 .78rem/1 var(--f-body); padding: .2rem .45rem; cursor: pointer; border-radius: var(--radius-s); }
.la .cal-more:hover { color: var(--ink); background: var(--surface-2); }
.la .cal-month.small .cal-day { min-height: 3.6rem; padding: .25rem .1rem; align-items: center; cursor: pointer; }
.la .cal-month.small .cal-dow { text-align: center; padding: .5rem 0; }
.la .cal-month.small .cal-day .dn { align-self: center; }
.la .cal-dots { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; }
.la .cal-dots .adot { width: .42rem; height: .42rem; }
.la .cal-quick.card { position: absolute; z-index: 5; width: min(23rem, 100%); display: flex; flex-direction: column; gap: .6rem; border-radius: min(var(--radius), 14px); box-shadow: 0 18px 44px rgba(0, 0, 0, .18); }
.la .cal-quick .edit.box { width: 100%; }
.la .cal-quick .inline { gap: .4rem .5rem; }
.la .cal-quick input[type="time"].edit.box, .la .cal-quick input[type="date"].edit.box { width: auto; }
.la .cal-quick.inline-q { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.la .cal-quick.inline-q > .edit.box { flex: 1 1 18rem; width: auto; min-height: 2.6rem; }
.la .cal-quick.inline-q > .inline { flex: 0 1 auto; }
.la .cal-quick .ghead .btn { min-height: 2rem; padding: .2rem .55rem; font-size: 1.1rem; }
.la .cal-week.card { padding: 0; overflow: hidden; border-radius: min(var(--radius), 14px); --sh: calc(3rem * var(--d) + .7rem); }
.la .cw-row { display: grid; grid-template-columns: 3.8rem repeat(7, minmax(0, 1fr)); }
.la .cw-head { border-bottom: 1px solid var(--line); }
.la .cw-dh { display: flex; align-items: baseline; gap: .45rem; padding: .55rem .6rem; border-left: 1px solid var(--line-soft); }
.la .cw-dh .dn { font: 600 1.05rem/1 var(--f-body); font-variant-numeric: tabular-nums; }
.la .cw-dh.today .dn { color: var(--accent-ink); background: var(--accent); border-radius: 99px; padding: .2rem .45rem; }
.la .cw-g { padding: .4rem .5rem; font-size: .75rem; color: var(--ink-2); text-align: right; }
.la .cw-all { border-bottom: 1px solid var(--line); }
.la .cw-ad { display: flex; flex-direction: column; gap: .2rem; padding: .3rem; min-height: 2.6rem; min-width: 0; border-left: 1px solid var(--line-soft); cursor: cell; }
.la .cw-ad:hover, .la .cw-slot:hover { background: var(--hover); }
.la .cw-hours { padding: 0; }
.la .cw-hl { height: var(--sh); padding: .15rem .5rem 0 0; font: 500 .72rem/1 var(--f-mono); color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.la .cw-col { position: relative; border-left: 1px solid var(--line-soft); min-width: 0; }
.la .cw-col.today, .la .cw-ad.today { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.la .cw-slot { height: var(--sh); border-bottom: 1px solid var(--line-soft); cursor: cell; }
.la .cal-item.block { position: absolute; z-index: 1; flex-wrap: wrap; align-items: baseline; align-content: flex-start; gap: 0 .4rem; overflow: hidden; padding: .3rem .5rem; box-shadow: inset 3px 0 0 hsl(var(--h, 200) 60% var(--dot-l)); }
.la .cal-item.block.plain { box-shadow: inset 3px 0 0 var(--ink-2); }
.la .cal-item.block .t { flex: 1 1 6rem; white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.la .cal-agenda { display: flex; flex-direction: column; gap: calc(1rem * var(--d)); }
.la .cal-aday { display: flex; flex-direction: column; gap: .35rem; min-width: 0; border-radius: var(--radius); }
.la .cal-aday .path .chip { margin-left: .5rem; }
.la .cal-aday.late .path { color: var(--bad); }
.la .cal-arow { gap: .7rem; }
.la .cal-when { min-width: 4.2rem; font-size: .8rem; }
.la .cal-arow .path { flex: 0 1 auto; font-size: calc(var(--label-size) * .88); padding: 0; }
@media (max-width: 720px) {
  .la .cal-title { flex-basis: 100%; order: -1; font-size: 1.4rem; }
  .la .cal-arow { flex-wrap: wrap; row-gap: .25rem; }
  .la .cal-arow .path { flex-basis: 100%; padding-left: 4.9rem; }
}

/* the toast rides above the bars and the detail panel */
.toast { z-index: 40; border-radius: 999px; padding: .65rem .8rem .65rem 1.2rem; box-shadow: 0 10px 30px rgba(20, 40, 35, .3); }
.toast button { border-radius: 999px; }
.la .cal-item.wide .t { white-space: normal; }
