/* Landworx Growth mockup
   Shape rule: containers 16px, controls 10px, tick boxes 7px, pills full.
   Colour rule: brand green is the only action/progress colour. Each business
   also has an identity tone, used only on its icon tile and the page wash. */

:root {
  --bg: #F3F5F2;
  --surface: #FBFCFA;
  --surface-2: #ECF0EB;
  --surface-3: #FFFFFF;
  --line: #DEE4DE;
  --line-strong: #C3CDC5;
  --track: #E2E8E2;
  --check-border: #A2AEA5;
  --tab-active: #FFFFFF;
  --text: #0F1B15;
  --text-2: #4A5A51;
  --text-3: #5E6E65;
  --accent: #07A155;          /* Landworx brand green */
  --accent-ink: #05783F;      /* brand green, darkened for small text */
  --accent-strong: #06804A;   /* button fill with light text */
  --on-accent: #FFFFFF;
  --accent-soft: rgba(7, 161, 85, .11);
  --danger: #B93A26;
  --danger-soft: rgba(185, 58, 38, .09);
  --toast-bg: #14211A;
  --toast-text: #EEF4F0;
  --toast-action: #5FDB98;
  --scrim: rgba(10, 20, 15, .38);
  --shadow-xs: 0 1px 2px rgba(18, 44, 30, .06);
  --shadow-sm: 0 1px 2px rgba(18, 44, 30, .05), 0 6px 18px -10px rgba(18, 44, 30, .14);
  --shadow-md: 0 2px 4px rgba(18, 44, 30, .05), 0 18px 40px -18px rgba(18, 44, 30, .26);
  --shadow-lg: 0 12px 40px -8px rgba(18, 44, 30, .22), 0 2px 6px rgba(18, 44, 30, .06);

  --tone-maintenance: #07A155;
  --tone-material: #2B72B0;
  --tone-software: #7559C4;
  --tone-consulting: #A87510;
  --tone-teal: #0E8584;
  --tone-rose: #B8456A;
  --tone-slate: #4F6578;
  --tone-olive: #6F7F12;
  --needle: #E04A2B;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B110E;
    --surface: #121A16;
    --surface-2: #18221D;
    --surface-3: #1B2620;
    --line: #213029;
    --line-strong: #31453A;
    --track: #223129;
    --check-border: #4F675A;
    --tab-active: #26352D;
    --text: #E6EDE8;
    --text-2: #A7B5AC;
    --text-3: #83938A;
    --accent: #1FB866;
    --accent-ink: #46CF86;
    --accent-strong: #1FB866;
    --on-accent: #06140C;
    --accent-soft: rgba(31, 184, 102, .14);
    --danger: #F08068;
    --danger-soft: rgba(240, 128, 104, .12);
    --toast-bg: #E6EDE8;
    --toast-text: #0F1B15;
    --toast-action: #05783F;
    --scrim: rgba(0, 0, 0, .55);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-sm: inset 0 1px 0 rgba(255, 255, 255, .025), 0 8px 24px -14px rgba(0, 0, 0, .6);
    --shadow-md: inset 0 1px 0 rgba(255, 255, 255, .03), 0 22px 44px -20px rgba(0, 0, 0, .75);
    --shadow-lg: 0 18px 48px -10px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .04);
    --tone-maintenance: #34C27A;
    --tone-material: #5EA4E0;
    --tone-software: #A68FEC;
    --tone-consulting: #E2AC3F;
    --tone-teal: #3EC4C0;
    --tone-rose: #EE7FA0;
    --tone-slate: #9DB1C4;
    --tone-olive: #B5C84E;
    --needle: #FF6B47;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B110E;
  --surface: #121A16;
  --surface-2: #18221D;
  --surface-3: #1B2620;
  --line: #213029;
  --line-strong: #31453A;
  --track: #223129;
  --check-border: #4F675A;
  --tab-active: #26352D;
  --text: #E6EDE8;
  --text-2: #A7B5AC;
  --text-3: #83938A;
  --accent: #1FB866;
  --accent-ink: #46CF86;
  --accent-strong: #1FB866;
  --on-accent: #06140C;
  --accent-soft: rgba(31, 184, 102, .14);
  --danger: #F08068;
  --danger-soft: rgba(240, 128, 104, .12);
  --toast-bg: #E6EDE8;
  --toast-text: #0F1B15;
  --toast-action: #05783F;
  --scrim: rgba(0, 0, 0, .55);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-sm: inset 0 1px 0 rgba(255, 255, 255, .025), 0 8px 24px -14px rgba(0, 0, 0, .6);
  --shadow-md: inset 0 1px 0 rgba(255, 255, 255, .03), 0 22px 44px -20px rgba(0, 0, 0, .75);
  --shadow-lg: 0 18px 48px -10px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .04);
  --tone-maintenance: #34C27A;
  --tone-material: #5EA4E0;
  --tone-software: #A68FEC;
  --tone-consulting: #E2AC3F;
  --tone-teal: #3EC4C0;
  --tone-rose: #EE7FA0;
  --tone-slate: #9DB1C4;
  --tone-olive: #B5C84E;
  --needle: #FF6B47;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.ic { width: 1em; height: 1em; flex: none; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 40;
  background: var(--surface-3); padding: 8px 14px; border-radius: 10px; box-shadow: var(--shadow-md);
}
.skip-link:focus { top: 12px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklab, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in oklab, var(--line) 70%, transparent);
}
@media (prefers-reduced-transparency: reduce) {
  .topbar { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.topbar-inner {
  max-width: 1160px; margin: 0 auto; height: 60px;
  padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; padding: 6px 4px; }
.brand-mark { height: 20px; width: auto; display: block; }
.brand-sep { width: 1px; height: 18px; background: var(--line-strong); }
.brand-app { font-weight: 600; font-size: 15px; letter-spacing: -.01em; color: var(--text-2); white-space: nowrap; }

.theme-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px 0 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text-2); font-size: 13.5px; font-weight: 550;
  box-shadow: var(--shadow-xs);
  transition: border-color .2s, color .2s, transform .15s var(--ease);
}
.theme-toggle .ic { font-size: 17px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.account-btn[hidden] { display: none; }
.account-btn { padding-left: 5px; }
.account-btn .avatar {
  width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 12.5px; font-weight: 700;
}
.theme-toggle:hover { color: var(--text); border-color: var(--line-strong); }
.theme-toggle:active { transform: scale(.97); }

/* ---------- Page shells ---------- */
#app { display: block; outline: none; position: relative; }
.biz-main:focus, .home:focus { outline: none; }
.page-wash {
  position: absolute; inset: 0 0 auto 0; height: 420px; pointer-events: none; z-index: -1;
  background:
    radial-gradient(900px 340px at 12% -8%, color-mix(in oklab, var(--tone, var(--accent)) 11%, transparent), transparent 70%),
    radial-gradient(700px 300px at 92% -20%, color-mix(in oklab, var(--tone, var(--accent)) 6%, transparent), transparent 70%);
}
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* ---------- Home ---------- */
.home { padding-top: 56px; padding-bottom: 64px; }
.home-head { max-width: 720px; }
.home-head h1 {
  font-size: clamp(30px, 4.2vw, 44px); font-weight: 600; letter-spacing: -.032em; line-height: 1.08;
  outline: none;
}
.lede { margin-top: 12px; color: var(--text-2); font-size: 16.5px; max-width: 60ch; }
.lede strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.biz-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 36px;
}
.biz-card {
  position: relative; display: flex; flex-direction: column;
  padding: 24px; min-height: 252px;
  border-radius: 16px; border: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in oklab, var(--tone) 9%, transparent), transparent 55%),
    var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .2s;
}
.biz-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.biz-card:active { transform: translateY(-1px) scale(.995); }
.biz-card-add {
  align-items: center; justify-content: center; gap: 12px; text-align: center;
  background: transparent; box-shadow: none; border: 1.5px dashed var(--line-strong);
  color: var(--text-2); font-size: 15.5px; font-weight: 600; cursor: pointer;
}
.biz-card-add .plus {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-2); transition: background .2s, color .2s;
}
.biz-card-add .plus .ic { font-size: 18px; }
.biz-card-add:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); box-shadow: none; }
.biz-card-add:hover .plus { background: var(--surface); color: var(--accent-ink); }
.biz-card-form { gap: 8px; justify-content: flex-start; }
.biz-card-form:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--line); }
.biz-card-form .text-input { flex: none; width: 100%; margin-bottom: 6px; }
.biz-card-form .form-actions { margin-top: auto; padding-top: 6px; }
.biz-form-title { font-size: 17px; font-weight: 650; letter-spacing: -.015em; margin-bottom: 6px; }
.biz-card-top { display: flex; align-items: center; justify-content: space-between; }
.open-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 550;
  transition: background .2s, color .2s;
}
.open-pill .ic { font-size: 14px; transition: transform .3s var(--ease); }
.biz-card:hover .open-pill { background: var(--accent-soft); color: var(--accent-ink); }
.biz-card:hover .open-pill .ic { transform: translateX(3px); }
.biz-name { margin-top: 20px; font-size: 20px; font-weight: 600; letter-spacing: -.018em; line-height: 1.25; }
.biz-tag { margin-top: 6px; color: var(--text-2); font-size: 14.5px; line-height: 1.45; max-width: 52ch; }
.next { margin-top: 20px; display: grid; gap: 2px; min-width: 0; }
.next-label { font-size: 12.5px; color: var(--text-3); font-weight: 500; }
.next-title { font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.biz-progress { margin-top: auto; padding-top: 20px; display: grid; gap: 8px; }
.biz-progress .count-long { font-size: 13.5px; color: var(--text-2); }

.home-foot {
  margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  color: var(--text-3); font-size: 13.5px;
}

/* ---------- Tiles ---------- */
.tile {
  --size: 44px;
  width: var(--size); height: var(--size); flex: none;
  border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in oklab, var(--tone) 13%, var(--surface));
  color: var(--tone);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--tone) 22%, transparent);
}
.tile .ic { font-size: calc(var(--size) * .5); }
.tile-lg { --size: 52px; border-radius: 14px; }
.tile-sm { --size: 24px; border-radius: 7px; }

/* ---------- Progress ---------- */
.bar { position: relative; height: 4px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar > span {
  position: absolute; inset: 0; border-radius: inherit; background: var(--accent);
  transform-origin: left center; transform: scaleX(0);
  transition: transform .7s var(--ease);
}
.bar-lg { height: 6px; }
.count { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.count.is-complete { color: var(--accent-ink); font-weight: 600; }
.count-long { font-variant-numeric: tabular-nums; }
.count-long b { color: var(--text); font-weight: 600; }
.bump { animation: bump .5s var(--ease); }
@keyframes bump {
  0% { transform: translateY(0); }
  30% { transform: translateY(-3px); color: var(--accent-ink); }
  100% { transform: translateY(0); }
}
.count, .count-long { display: inline-block; }

/* ---------- Business page ---------- */
.biz-layout {
  display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 56px;
  padding-top: 36px; padding-bottom: 72px; align-items: start;
}
.sidebar {
  position: sticky; top: 84px; max-height: calc(100dvh - 104px); overflow: auto;
  padding: 2px 2px 16px; scrollbar-width: thin;
}
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px 0 10px; border-radius: 10px;
  color: var(--text-2); font-size: 14px; font-weight: 550;
  transition: background .2s, color .2s;
}
.back-link .ic { font-size: 16px; transition: transform .3s var(--ease); }
.back-link:hover { background: var(--surface-2); color: var(--text); }
.back-link:hover .ic { transform: translateX(-2px); }
.side-label { font-size: 12.5px; font-weight: 600; color: var(--text-3); padding: 0 10px; margin: 22px 0 6px; }
.side-list { display: grid; gap: 1px; }
.side-link {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  min-height: 36px; padding: 6px 10px; border-radius: 10px;
  color: var(--text-2); font-size: 14px; line-height: 1.3;
  transition: background .2s, color .2s;
}
.side-link span.name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-link:hover { background: var(--surface-2); color: var(--text); }
.side-link.is-current { background: var(--surface); color: var(--text); font-weight: 550; box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--line); }
.side-link.is-active { color: var(--text); background: var(--surface-2); }
.side-link .count { font-size: 12.5px; }
.side-add { color: var(--text-3); }
.side-add .ic { font-size: 15px; margin: 0 2px; }

.biz-main { min-width: 0; max-width: 760px; }
.biz-main > .back-link { display: none; margin: -6px 0 14px -10px; }
.biz-head { display: flex; gap: 18px; align-items: flex-start; }
.biz-head h1 { font-size: 30px; font-weight: 650; letter-spacing: -.028em; line-height: 1.12; outline: none; }
.biz-head .biz-tag { margin-top: 6px; font-size: 15px; }
.biz-head-text { flex: 1 1 auto; min-width: 0; }
.biz-edit-btn { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; }
.biz-edit-btn .ic { font-size: 15px; }
.biz-edit {
  display: grid; gap: 8px; padding: 20px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.biz-edit .text-input { flex: none; width: 100%; margin-bottom: 6px; }
.field-hint { font-weight: 450; color: var(--text-3); margin-left: 4px; }
.biz-edit-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.link-danger { color: var(--danger); }
.link-danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- Rev-counter dial ---------- */
.biz-top { display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.biz-top > .biz-head, .biz-top > .biz-edit { flex: 1 1 auto; min-width: 0; }
.gauge {
  flex: none; width: 228px; display: grid; justify-items: center; gap: 2px;
  padding: 14px 16px 14px; border-radius: 22px; border: 1px solid var(--line);
  background:
    radial-gradient(90% 70% at 50% 62%, color-mix(in oklab, var(--accent) 7%, transparent), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}
.gauge svg { width: 100%; height: auto; display: block; overflow: visible; }
.gauge .count-long { font-size: 13px; color: var(--text-2); }
.g-track { fill: none; stroke: var(--surface-2); stroke-width: 10; stroke-linecap: round; }
.g-fill {
  fill: none; stroke: url(#g-grad); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 0 100;
  filter: drop-shadow(0 0 5px color-mix(in oklab, var(--accent) 40%, transparent));
  transition: stroke-dasharray 1.2s var(--ease), opacity .3s;
}
.g-tick { stroke: var(--text-3); stroke-width: 1.1; opacity: .5; }
.g-tick.major { stroke: var(--text-2); stroke-width: 2; opacity: .9; }
.g-tick.hot { stroke: var(--accent); opacity: 1; }
.g-label {
  font-size: 8.5px; font-weight: 600; fill: var(--text-3); text-anchor: middle; dominant-baseline: central;
  font-variant-numeric: tabular-nums;
}
.g-needle {
  fill: var(--needle); transform-box: view-box; transform-origin: 100px 100px; transform: rotate(-120deg);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .25));
  transition: transform 1.25s cubic-bezier(.34, 1.4, .5, 1);
}
.g-hub { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; }
.g-hub-dot { fill: var(--needle); }
.g-value {
  font-size: 28px; font-weight: 700; letter-spacing: -.035em; fill: var(--text); text-anchor: middle;
  font-variant-numeric: tabular-nums;
}
.g-caption { font-size: 7.5px; font-weight: 650; letter-spacing: .2em; fill: var(--text-3); text-anchor: middle; }
.gauge.is-finished .g-caption { fill: var(--accent-ink); }
.gauge.no-anim .g-needle, .gauge.no-anim .g-fill { transition: none; }

.tabs {
  display: inline-flex; gap: 4px; padding: 4px; margin: 28px 0 22px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
}
.tab {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  min-height: 40px; padding: 0 14px; border-radius: 9px;
  color: var(--text-2); font-weight: 550; font-size: 14px;
  transition: background .2s, color .2s, box-shadow .2s;
}
.tab .ic { font-size: 16px; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--tab-active); color: var(--text); box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--line); }
.tab .count { font-size: 12.5px; }

/* Tabs on the left, Hide done on the right; the switch wraps under the tabs on phones. */
.view-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px;
  margin: 28px 0 22px;
}
.view-bar > .tabs { margin: 0; }
.view-bar > .switch { margin-left: auto; }
.view-bar.solo { margin: 16px 0 12px; }

.switch {
  display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 10px;
  color: var(--text-2); font-size: 13.5px; font-weight: 550; white-space: nowrap;
  transition: background .2s, color .2s;
}
.switch:hover { background: var(--surface-2); color: var(--text); }
.switch-track {
  position: relative; flex: none; width: 32px; height: 20px; border-radius: 999px;
  background: var(--track); box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: background .25s var(--ease), box-shadow .25s var(--ease);
}
.switch-thumb {
  position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%;
  background: #FFFFFF; box-shadow: 0 1px 2px rgba(10, 20, 15, .28);
  transition: transform .25s var(--ease);
}
.switch[aria-checked="true"] .switch-track { background: var(--accent); box-shadow: none; }
.switch[aria-checked="true"] .switch-thumb { transform: translateX(12px); }
.switch:active .switch-thumb { width: 16px; }
.switch[aria-checked="true"]:active .switch-thumb { transform: translateX(10px); }

/* ---------- Categories ---------- */
.cat {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 6px 8px 10px; box-shadow: var(--shadow-sm);
  scroll-margin-top: 84px;
}
.cat + .cat { margin-top: 16px; }
.cat-head { display: flex; align-items: center; gap: 12px; padding: 12px 4px 0 14px; }
.cat-icon {
  width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-2);
}
.cat-icon .ic { font-size: 17px; }
.cat-title { flex: 1 1 auto; min-width: 0; font-size: 17px; font-weight: 600; letter-spacing: -.012em; line-height: 1.3; }
.cat-desc { padding: 2px 16px 0 58px; color: var(--text-3); font-size: 13.5px; line-height: 1.45; }
.cat > .bar { margin: 12px 16px 6px 58px; }

.icon-btn {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px;
  color: var(--text-3); transition: background .2s, color .2s;
}
.icon-btn .ic { font-size: 18px; }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--surface-2); color: var(--text); }

.group + .group { margin-top: 4px; }
.sub-head {
  display: flex; align-items: center; gap: 10px;
  margin: 10px 4px 2px 58px; padding-top: 12px; border-top: 1px solid var(--line);
}
.sub-title { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 600; color: var(--text-2); letter-spacing: -.005em; }
.sub-head .icon-btn { width: 32px; height: 32px; }

.empty-note { padding: 6px 16px 2px 58px; color: var(--text-3); font-size: 14px; }

/* Hide done: done rows drop out of view but still count. A row just ticked stays until it folds away. */
.hide-done .task.is-done:not(.is-leaving-done) { display: none; }
.hidden-note { display: none; padding: 8px 16px 2px 58px; color: var(--text-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.hide-done .hidden-note { display: block; animation: fade-in .3s var(--ease); }

/* ---------- Task rows ---------- */
.task {
  position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: start;
  gap: 4px; padding: 2px 4px 2px 7px; border-radius: 10px;
  transition: background .2s;
}
.task:hover { background: color-mix(in oklab, var(--surface-2) 60%, transparent); }
.task.just-done { animation: rowflash .9s var(--ease); }
.task.is-new { animation: rowin .5s var(--ease) backwards; animation-delay: calc(var(--n, 0) * 35ms); }
@keyframes rowflash { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
@keyframes rowin { 0% { background: var(--accent-soft); opacity: 0; transform: translateY(-4px); } 40% { opacity: 1; transform: none; } 100% { background: transparent; } }

.check { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; }
.check .box {
  position: relative; width: 22px; height: 22px; border-radius: 7px;
  border: 1.5px solid var(--check-border); background: var(--surface-3);
  display: grid; place-items: center; color: var(--on-accent);
  transition: background .25s var(--ease), border-color .25s var(--ease);
}
.check .box::after {
  content: ""; position: absolute; inset: -1.5px; border-radius: 8px; pointer-events: none;
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 45%, transparent); opacity: 0;
}
.check .tick { font-size: 14px; clip-path: inset(0 100% 0 0); transition: clip-path .28s var(--ease) .06s; }
.check:hover .box { border-color: var(--accent); }
.check:active .box { transform: scale(.9); }
.check[aria-checked="true"] .box { background: var(--accent); border-color: var(--accent); }
.check[aria-checked="true"] .tick { clip-path: inset(0 0 0 0); }
.task.just-done .check .box { animation: pop .45s var(--ease-pop); }
.task.just-done .check .box::after { animation: ring .6s var(--ease); }
@keyframes pop { 0% { transform: scale(.78); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes ring { 0% { opacity: 1; box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 45%, transparent); } 100% { opacity: 0; box-shadow: 0 0 0 10px color-mix(in oklab, var(--accent) 0%, transparent); } }

.task-body { min-width: 0; padding: 10px 0 10px 2px; }
.task-title {
  display: block; width: 100%; text-align: left;
  font-size: 15px; line-height: 1.45; color: var(--text); overflow-wrap: anywhere;
  border-radius: 6px; cursor: text;
  text-decoration: line-through; text-decoration-color: transparent; text-decoration-thickness: 1.5px;
  transition: color .3s var(--ease), text-decoration-color .3s var(--ease);
}
.task-title.static { cursor: default; }
.task-notes {
  margin-top: 2px; font-size: 13px; line-height: 1.45; color: var(--text-3);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.task.is-done .task-title { color: var(--text-3); text-decoration-color: color-mix(in oklab, var(--text-3) 55%, transparent); }
.task.is-done .task-notes { opacity: .7; }
.task .row-menu { margin-top: 4px; }
.task .ref { padding: 12px 10px 0 4px; font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* Drag to reorder (desktop only). The grip sits in the gutter left of the tick box. */
.task-list { position: relative; }
.grip {
  position: absolute; left: 0; top: 2px; width: 18px; height: 44px;
  display: none; place-items: center; border-radius: 6px;
  color: var(--text-3); cursor: grab; touch-action: none; opacity: 0;
  transition: opacity .15s var(--ease), color .15s;
}
.grip .ic { font-size: 16px; }
@media (hover: hover) and (pointer: fine) {
  .grip { display: grid; }
  .task:hover > .grip, .task-ghost > .grip { opacity: 1; }
  .grip:hover { color: var(--text); }
  .task.is-done > .grip, .is-dragging .task:not(.task-ghost) > .grip { opacity: 0; pointer-events: none; }
}
/* Nothing to reorder against: one open task or none. Kept apart so browsers without :has() keep the rules above. */
@media (hover: hover) and (pointer: fine) {
  .task-list:not(:has(> .task:not(.is-done) ~ .task:not(.is-done))) .grip { display: none; }
}
.task-ghost {
  position: fixed; z-index: 45; margin: 0; pointer-events: none;
  background: var(--surface-3); box-shadow: var(--shadow-lg), 0 0 0 1px var(--line);
  transform: scale(1.012);
}
.task.is-drag-source { visibility: hidden; }
.task.is-lifted { z-index: 2; background: var(--surface-3); box-shadow: var(--shadow-lg), 0 0 0 1px var(--line); }
.task.is-settling { z-index: 2; transition: background .3s var(--ease), box-shadow .3s var(--ease); }
.task-list.is-sorting > .task { transition: transform .22s var(--ease), background .2s; }
.is-dragging, .is-dragging * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
/* Where the row will land: the other rows slide aside and this slot opens. */
.drop-slot {
  position: absolute; left: 2px; right: 2px; border-radius: 10px; pointer-events: none;
  background: var(--accent-soft); border: 1.5px dashed color-mix(in oklab, var(--accent) 55%, transparent);
  transition: top .22s var(--ease);
}

.rename-input {
  width: 100%; font-size: 15px; line-height: 1.45; padding: 3px 8px; margin: -4px 0 -4px -8px;
  border-radius: 8px; border: 1.5px solid var(--accent); background: var(--surface-3); color: var(--text);
  outline: none; box-shadow: 0 0 0 4px var(--accent-soft);
}
.cat-head .rename-input { font-size: 17px; font-weight: 600; margin: 0; flex: 1 1 auto; min-width: 0; }
.sub-head .rename-input { font-size: 14px; font-weight: 600; margin: 0; flex: 1 1 auto; min-width: 0; }

/* ---------- Add controls ---------- */
.add-row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 4px;
  width: 100%; min-height: 44px; padding: 0 4px 0 7px; border-radius: 10px; text-align: left;
  color: var(--text-3); font-size: 14.5px; font-weight: 500;
  transition: background .2s, color .2s;
}
.add-row .plus {
  justify-self: center; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  border: 1.5px dashed var(--check-border); color: var(--text-3);
  transition: border-color .2s, color .2s, background .2s;
}
.add-row .plus .ic { font-size: 13px; }
.add-row span:last-child { padding-left: 2px; }
.add-row:hover { background: var(--accent-soft); color: var(--accent-ink); }
.add-row:hover .plus { border-color: var(--accent); border-style: solid; color: var(--accent-ink); }

.add-form { padding: 8px 8px 10px 58px; display: grid; gap: 8px; }
.add-mode {
  justify-self: start; display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 2px;
  border-radius: 10px; background: var(--surface-2);
}
.add-mode button {
  height: 30px; padding: 0 12px; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--text-3);
  transition: background .2s, color .2s, box-shadow .2s;
}
.add-mode button:hover { color: var(--text); }
.add-mode button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.add-field { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.text-input {
  flex: 1 1 220px; min-width: 0; height: 42px; padding: 0 12px;
  border-radius: 10px; border: 1.5px solid var(--line-strong); background: var(--surface-3); color: var(--text);
  font-size: 15px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.text-input::placeholder { color: var(--text-3); opacity: .85; }
.text-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.form-actions { display: flex; gap: 6px; }

/* List mode: a box that grows with what is pasted or dictated. */
.list-input {
  display: block; width: 100%; height: auto; min-height: 108px; max-height: 50vh;
  padding: 9px 12px; line-height: 1.5; resize: none; overflow-y: auto;
}
@supports (field-sizing: content) { .list-input { field-sizing: content; } }
.list-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.list-hint { flex: 1 1 240px; min-width: 0; color: var(--text-3); font-size: 13px; line-height: 1.45; }
.list-hint.is-warn { color: var(--text); font-weight: 550; }
.list-foot .btn-primary { min-width: 128px; font-variant-numeric: tabular-nums; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn-primary:disabled:hover { background: var(--accent-strong); }

.link-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px; border-radius: 10px;
  color: var(--text-3); font-size: 13.5px; font-weight: 550;
  transition: background .2s, color .2s;
}
.link-btn .ic { font-size: 15px; }
.link-btn:hover { background: var(--surface-2); color: var(--text); }

.add-cat {
  margin-top: 16px; width: 100%; min-height: 60px; border-radius: 16px;
  border: 1.5px dashed var(--line-strong); color: var(--text-2);
  display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 550; font-size: 15px;
  transition: border-color .2s, color .2s, background .2s;
}
.add-cat .ic { font-size: 18px; }
.add-cat:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.add-cat-form { margin-top: 16px; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); display: grid; gap: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 16px; border-radius: 10px; font-size: 14.5px; font-weight: 600; white-space: nowrap;
  transition: background .2s, color .2s, transform .15s var(--ease), box-shadow .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent-strong); color: var(--on-accent); box-shadow: var(--shadow-xs); }
.btn-primary:hover { background: color-mix(in oklab, var(--accent-strong) 88%, var(--text)); }
.btn-ghost { color: var(--text-2); border: 1px solid var(--line); background: var(--surface); }
.btn-ghost:hover { color: var(--text); border-color: var(--line-strong); }
.btn-danger { background: var(--danger); color: #FFF8F6; }
:root[data-theme="dark"] .btn-danger { color: #1A0703; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-danger { color: #1A0703; } }
.btn-quiet { height: 36px; padding: 0 12px; font-size: 13.5px; font-weight: 550; color: var(--text-2); border: 1px solid var(--line); background: transparent; }
.btn-quiet:hover { color: var(--text); border-color: var(--line-strong); }

/* ---------- Checklist ---------- */
.checklist-intro { color: var(--text-2); font-size: 14.5px; margin: -4px 0 18px; max-width: 62ch; }

/* ---------- Menu ---------- */
.menu-layer { position: fixed; inset: 0; z-index: 50; }
.menu-scrim { position: absolute; inset: 0; }
.menu {
  position: fixed; min-width: 216px; padding: 6px;
  background: var(--surface-3); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
  transform-origin: top right; animation: menu-in .16s var(--ease);
}
@keyframes menu-in { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }
.menu-title { padding: 8px 12px 6px; font-size: 12.5px; color: var(--text-3); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 0 12px;
  border-radius: 9px; font-size: 14.5px; font-weight: 500; text-align: left; color: var(--text);
}
.menu-item .ic { font-size: 18px; color: var(--text-3); }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); outline: none; }
.menu-item.danger, .menu-item.danger .ic { color: var(--danger); }
.menu-item.danger:hover, .menu-item.danger:focus-visible { background: var(--danger-soft); }
.menu-cancel { display: none; }
.menu-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item:disabled { opacity: .42; cursor: default; }
.menu-item:disabled:hover { background: none; }

/* Move to picker: same popover and sheet, with sections, indents and collapsible businesses. */
.menu.picker {
  width: 340px; max-height: min(560px, calc(100dvh - 16px)); overflow-y: auto;
  overscroll-behavior: contain; scrollbar-width: thin;
}
.picker .menu-title {
  position: sticky; top: -6px; z-index: 1; max-width: none; margin: -6px -6px 2px; padding: 14px 18px 10px;
  background: var(--surface-3); border-bottom: 1px solid var(--line);
}
.menu-section { padding: 12px 12px 4px; font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.menu-section + .menu-section, .menu-item + .menu-section { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 14px; }
.menu-item.depth-1 { padding-left: 42px; }
.menu-item.depth-2 { padding-left: 72px; }
.menu-item.is-sub { min-height: 38px; font-size: 14px; color: var(--text-2); }
.menu-item.is-current:disabled { opacity: 1; color: var(--text-3); }
.menu-note { display: inline-flex; align-items: center; gap: 5px; flex: none; font-size: 12.5px; font-weight: 600; color: var(--accent-ink); }
.menu-item .menu-note .ic { font-size: 13px; color: var(--accent-ink); }
.menu-item .caret { font-size: 14px; transition: transform .2s var(--ease); }
.menu-item[aria-expanded="true"] .caret { transform: rotate(180deg); }
.tile-xs { --size: 24px; border-radius: 7px; }
.menu-item .tile .ic { font-size: 13px; color: var(--tone); }

/* Celebration */
.confetti { position: fixed; left: 0; top: 0; z-index: 55; pointer-events: none; }

/* ---------- Dialog ---------- */
.dialog {
  width: min(420px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-lg);
}
.dialog[open] { animation: dialog-in .22s var(--ease); }
.dialog::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.dialog-inner { padding: 24px; }
.dialog-title { font-size: 18px; font-weight: 650; letter-spacing: -.015em; }
.dialog-body { margin-top: 8px; color: var(--text-2); font-size: 14.5px; }
.dialog-actions { margin-top: 22px; display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- Toast ---------- */
.toast-region { position: fixed; left: 0; right: 0; bottom: 20px; z-index: 60; display: grid; justify-items: center; pointer-events: none; padding: 0 16px; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 14px;
  max-width: 460px; min-height: 48px; padding: 6px 6px 6px 16px; border-radius: 14px;
  background: var(--toast-bg); color: var(--toast-text); box-shadow: var(--shadow-lg); font-size: 14.5px;
  animation: toast-in .3s var(--ease);
}
.toast.is-leaving { animation: toast-out .2s var(--ease) forwards; }
.toast-msg { flex: 1 1 auto; }
.toast-undo { height: 36px; padding: 0 12px; border-radius: 9px; font-weight: 650; color: var(--toast-action); }
.toast-undo:hover { background: color-mix(in oklab, var(--toast-action) 14%, transparent); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Entrance motion ---------- */
.animate-in .reveal { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .biz-layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 20px; }
  .sidebar { display: none; }
  .biz-main { max-width: none; }
  .biz-main > .back-link { display: inline-flex; }
}
@media (max-width: 719px) {
  .biz-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 28px; }
  .biz-card { min-height: 0; padding: 20px; }
}
@media (max-width: 639px) {
  body { font-size: 15px; }
  .topbar-inner { padding: 0 16px; height: 56px; }
  .wrap { padding: 0 16px; }
  .brand-mark { height: 16px; }
  .brand { gap: 10px; }
  .brand-app { font-size: 14px; }
  .theme-toggle { width: 40px; padding: 0; justify-content: center; }
  .theme-toggle span:not(.avatar) { display: none; }
  .account-btn { width: 40px; padding: 0; justify-content: center; }
  .home { padding-top: 32px; padding-bottom: 40px; }
  .lede { font-size: 15.5px; }
  .biz-name { font-size: 18.5px; margin-top: 16px; }
  .next { margin-top: 16px; }
  .biz-head { gap: 14px; }
  .biz-head h1 { font-size: 24px; }
  .biz-top { flex-direction: column; align-items: stretch; gap: 18px; }
  .gauge { width: 100%; }
  .gauge svg { max-width: 250px; }
  .biz-edit { padding: 16px; }
  .biz-edit-actions .form-actions { width: 100%; }
  .biz-card-add { min-height: 120px; flex-direction: row; }
  .biz-head .biz-tag { font-size: 14.5px; }
  .tile-lg { --size: 44px; border-radius: 12px; }
  .tabs { display: flex; width: 100%; margin: 22px 0 18px; }
  .tab { padding: 0 12px; justify-content: center; }
  .tab:first-child { flex: 0 0 auto; }
  .tab:last-child { flex: 1 1 auto; min-width: 0; }
  .tab .ic { display: none; }
  .cat { padding: 4px 4px 8px; border-radius: 16px; }
  .cat-head { padding: 12px 2px 0 12px; gap: 10px; }
  .cat-icon { width: 30px; height: 30px; }
  .cat-desc { padding: 2px 12px 0 52px; }
  .cat > .bar { margin: 12px 12px 6px 52px; }
  .sub-head { margin-left: 52px; }
  .empty-note { padding-left: 52px; }
  .task { padding: 2px 0 2px 4px; gap: 2px; }
  .task .icon-btn.row-menu { width: 40px; height: 40px; margin-top: 2px; }
  .add-row { padding: 0 0 0 4px; gap: 2px; }
  .add-form { padding: 8px 8px 10px 12px; }
  .text-input { flex-basis: 100%; }
  .form-actions { width: 100%; }
  .form-actions .btn { flex: 1 1 0; }

  /* Menus become a bottom sheet on phones */
  .menu-scrim { background: var(--scrim); animation: fade-in .2s var(--ease); }
  .menu {
    left: 8px !important; right: 8px; top: auto !important; bottom: calc(8px + env(safe-area-inset-bottom));
    min-width: 0; padding: 8px; border-radius: 18px; transform-origin: bottom center;
    animation: sheet-in .28s var(--ease);
  }
  .menu-title { max-width: none; padding: 8px 14px 8px; }
  .menu-item { min-height: 52px; font-size: 16px; padding: 0 14px; }
  .menu-cancel { display: flex; justify-content: center; margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; font-weight: 600; }
  .menu.picker { width: auto; max-height: calc(100dvh - 64px - env(safe-area-inset-bottom)); }
  .picker .menu-title { top: -8px; margin: -8px -8px 2px; padding: 16px 22px 10px; }
  .picker .menu-cancel { position: sticky; bottom: -8px; background: var(--surface-3); }
  .picker .menu-cancel::before {
    content: ""; position: absolute; left: 0; right: 0; bottom: calc(100% + 1px); height: 30px; pointer-events: none;
    background: linear-gradient(to bottom, color-mix(in oklab, var(--surface-3) 0%, transparent), var(--surface-3) 70%);
  }
  .menu-section { padding: 12px 14px 4px; }
  .menu-item.depth-1 { padding-left: 46px; }
  .menu-item.depth-2 { padding-left: 78px; }
  .menu-item.is-sub { min-height: 46px; font-size: 15px; }
  .view-bar { margin: 22px 0 18px; }
  .view-bar { gap: 4px 16px; }
  .view-bar.solo { margin: 14px 0 10px; }
  .hidden-note { padding-left: 52px; }
  .toast-region { bottom: calc(12px + env(safe-area-inset-bottom)); }
  .toast { width: 100%; }
}
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important; animation-delay: 0ms !important;
    transition-duration: 1ms !important; transition-delay: 0ms !important;
  }
}

::selection { background: color-mix(in oklab, var(--accent) 26%, transparent); }

/* Small phones: room for the account and theme buttons. */
@media (max-width: 420px) {
  .brand-tail { display: none; }
}
