/* HB Supreme — Hummingbird Home Decor. Dark khaki (#BDB76B) on warm paper; Epilogue, as on hummingbirdhomedecor.com. */
@font-face { font-family: 'Epilogue'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/fonts/epilogue-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Epilogue'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/fonts/epilogue-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --khaki: #BDB76B; --khaki-600: #A9A257; --khaki-700: #8C8641; --khaki-800: #6B6633; --khaki-900: #45421F;
  --khaki-50: #F7F5E6; --khaki-100: #EFEBCB; --khaki-200: #E2DCA6;
  --bg: #F4F1E8; --surface: #FFFDF7; --surface-2: #EDE9DC; --surface-3: #E4DFCD; --sunken: #EAE6D8;
  --ink: #23221A; --ink-2: #4A4838; --muted: #6E6B55; --faint: #9A967E;
  --line: #DEDAC8; --line-2: #CFCAB4; --line-strong: #B9B39A;
  --accent: var(--khaki); --on-accent: #23221A; --accent-ink: #5E5A2B; --accent-soft: #F0ECCF;
  --danger: #A8432F; --danger-soft: #F6E3DC; --warn: #9A6A12; --warn-soft: #F7ECD2; --ok: #4F6B33; --ok-soft: #E4ECD6; --info: #4B6A73; --info-soft: #E0EAEA;
  --shadow-1: 0 1px 0 rgba(48, 44, 20, .04), 0 1px 2px rgba(48, 44, 20, .06);
  --shadow-2: 0 1px 0 rgba(48, 44, 20, .04), 0 4px 14px -4px rgba(48, 44, 20, .14);
  --shadow-3: 0 2px 0 rgba(48, 44, 20, .03), 0 18px 48px -12px rgba(48, 44, 20, .28);
  --scrim: rgba(28, 27, 20, .42);
  --r-xs: 6px; --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px;
  --ease: cubic-bezier(.2, .7, .2, 1); --ease-out: cubic-bezier(.16, 1, .3, 1); --spring: cubic-bezier(.34, 1.4, .64, 1);
  --t-fast: 120ms; --t: 200ms; --t-slow: 340ms;
  --sidebar: 248px; --topbar: 60px; --col: 296px;
  --font: 'Epilogue', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #17160F; --surface: #211F16; --surface-2: #2A281D; --surface-3: #343125; --sunken: #1B1A12;
  --ink: #EEEADA; --ink-2: #D2CDB6; --muted: #A8A38A; --faint: #7D7963;
  --line: #34322A; --line-2: #403D31; --line-strong: #57533F;
  --accent: var(--khaki); --on-accent: #1C1B12; --accent-ink: #D6D08C; --accent-soft: #343120;
  --danger: #E08A73; --danger-soft: #3A2219; --warn: #DDB25C; --warn-soft: #362A12; --ok: #A9C27F; --ok-soft: #26301A; --info: #8DB3BC; --info-soft: #1C2B2E;
  --shadow-1: 0 1px 0 rgba(0, 0, 0, .25);
  --shadow-2: 0 1px 0 rgba(0, 0, 0, .2), 0 6px 16px -6px rgba(0, 0, 0, .55);
  --shadow-3: 0 24px 60px -14px rgba(0, 0, 0, .7);
  --scrim: rgba(6, 6, 3, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font: 400 15px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'tnum' 0; letter-spacing: -.003em; transition: background-color var(--t-slow) var(--ease), color var(--t-slow) var(--ease); }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: var(--accent-ink); text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.018em; line-height: 1.2; text-wrap: balance; }
p { margin: 0; }
::selection { background: var(--khaki-200); color: #23221A; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--khaki-700); outline-offset: 2px; border-radius: var(--r-xs); }
[data-theme="dark"] :focus-visible { outline-color: var(--khaki); }
.icon { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.icon.sm { width: 15px; height: 15px; } .icon.lg { width: 22px; height: 22px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--line-strong); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- buttons ---------- */
.btn { --b: var(--surface); --c: var(--ink); --bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: var(--r-sm); border: 1px solid var(--bd); background: var(--b); color: var(--c); font-weight: 550; font-size: 14px;
  white-space: nowrap; user-select: none; position: relative; isolation: isolate;
  transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease); }
.btn:hover { --b: var(--surface-2); --bd: var(--line-strong); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.primary { --b: var(--accent); --c: var(--on-accent); --bd: transparent; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .1), var(--shadow-1); }
.btn.primary:hover { --b: var(--khaki-600); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .12), var(--shadow-2); transform: translateY(-1px); }
.btn.primary:active { transform: translateY(0) scale(.985); }
.btn.dark { --b: var(--ink); --c: var(--bg); --bd: transparent; }
.btn.dark:hover { --b: var(--ink-2); }
.btn.ghost { --b: transparent; --bd: transparent; }
.btn.ghost:hover { --b: var(--surface-2); --bd: transparent; }
.btn.danger { --c: var(--danger); }
.btn.danger:hover { --b: var(--danger-soft); --bd: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.sm { min-height: 32px; padding: 0 11px; font-size: 13px; gap: 6px; border-radius: 7px; }
.btn.icon-only { width: 40px; padding: 0; }
.btn.sm.icon-only { width: 32px; }
.btn.block { width: 100%; }
.btn .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { color: var(--accent-ink); background: none; border: 0; padding: 0; font-weight: 550;
  background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size var(--t) var(--ease); }
.link:hover { background-size: 100% 1px; }

/* ---------- inputs ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 6px; letter-spacing: .005em; }
.input, .select, .textarea { width: 100%; min-height: 42px; padding: 9px 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--surface); transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), background-color var(--t) var(--ease); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--khaki-700); box-shadow: 0 0 0 3px color-mix(in srgb, var(--khaki) 32%, transparent); }
.input[readonly], .textarea[readonly], .select:disabled, .input:disabled, .textarea:disabled { background: var(--sunken); color: var(--ink-2); border-style: dashed; cursor: default; }
.textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238C8641' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
.input.has-icon { padding-left: 38px; }
.input-wrap { position: relative; }
.input-wrap > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.err { color: var(--danger); font-size: 12.5px; font-weight: 500; }
.field.invalid .input, .field.invalid .textarea, .field.invalid .select { border-color: var(--danger); }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; min-height: 32px; }
.check input { appearance: none; width: 19px; height: 19px; margin: 0; border-radius: 6px; border: 1.5px solid var(--line-strong); background: var(--surface);
  display: grid; place-items: center; flex: none; cursor: pointer; transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t-fast) var(--spring); }
.check input::after { content: ''; width: 10px; height: 6px; border: 2px solid var(--on-accent); border-top: 0; border-right: 0; transform: rotate(-45deg) scale(0) translate(1px, -1px); transition: transform var(--t) var(--spring); }
.check input:checked { background: var(--accent); border-color: var(--khaki-700); }
.check input:checked::after { transform: rotate(-45deg) scale(1) translate(1px, -1px); }
.check input:active { transform: scale(.9); }
.check input:disabled { cursor: default; opacity: .6; }
.switch { appearance: none; width: 38px; height: 22px; border-radius: 22px; background: var(--line-2); position: relative; cursor: pointer; flex: none; margin: 0;
  transition: background-color var(--t) var(--ease); }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  transition: transform var(--t) var(--spring); }
.switch:checked { background: var(--khaki-700); }
.switch:checked::after { transform: translateX(16px); }
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: 10px; border: 1px solid var(--line); gap: 2px; position: relative; }
.seg button { border: 0; background: none; padding: 0 12px; min-height: 32px; border-radius: 7px; font-size: 13px; font-weight: 550; color: var(--muted);
  transition: color var(--t) var(--ease), background-color var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.seg.access button[aria-pressed="true"][data-v="edit"] { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.seg.access button[aria-pressed="true"][data-v="view"] { background: var(--info-soft); color: var(--info); box-shadow: none; }

/* ---------- info tip ---------- */
.tip-i { position: relative; display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent;
  color: var(--muted); font: italic 600 10.5px/1 Georgia, serif; padding: 0; cursor: help; flex: none; transition: all var(--t) var(--ease); }
.tip-i:hover, .tip-i:focus-visible { background: var(--accent); color: var(--on-accent); border-color: var(--khaki-700); }
.tip-i::before { content: ''; position: absolute; inset: -12px; }
#tip { position: fixed; z-index: 400; max-width: 260px; padding: 8px 11px; border-radius: 8px; background: #2A281D; color: #F3F0E2; font-size: 12.5px; line-height: 1.45;
  box-shadow: var(--shadow-3); pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
#tip.on { opacity: 1; transform: none; }

/* ---------- chips, avatars ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  white-space: nowrap; background: var(--surface-2); color: var(--ink-2); border: 1px solid transparent; max-width: 100%; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.chip.label { color: #fff; background: var(--c); }
[data-theme="dark"] .chip.label { color: #17160F; }
.chip.urgent { background: var(--danger-soft); color: var(--danger); }
.chip.hold { background: var(--warn-soft); color: var(--warn); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.accent { background: var(--accent-soft); color: var(--accent-ink); }
.chip.outline { background: transparent; border-color: var(--line-2); color: var(--muted); }
.av { --s: 26px; width: var(--s); height: var(--s); border-radius: 50%; display: inline-grid; place-items: center; font-size: calc(var(--s) * .4); font-weight: 650;
  color: #23221A; background: var(--c, var(--khaki-200)); flex: none; letter-spacing: 0; box-shadow: 0 0 0 2px var(--surface); text-transform: uppercase; }
.avs { display: inline-flex; }
.avs .av + .av { margin-left: -7px; }
.av.lg { --s: 40px; }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; grid-template-columns: 1fr; background: var(--bg); }
.login-art { display: none; position: relative; overflow: hidden; background: #2A281D; }
.login-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .9; animation: kenburns 24s var(--ease) infinite alternate; }
.login-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(23, 22, 15, .05) 40%, rgba(23, 22, 15, .78)); }
.login-art .quote { position: absolute; left: 48px; right: 48px; bottom: 44px; z-index: 1; color: #F3F0E2; }
.login-art .quote h2 { font-size: 30px; font-weight: 500; letter-spacing: -.025em; max-width: 18ch; }
.login-art .quote p { margin-top: 10px; color: #CFCAB0; font-size: 14px; }
@keyframes kenburns { from { transform: scale(1.02); } to { transform: scale(1.1) translate(-1.5%, -1%); } }
.login-pane { display: flex; flex-direction: column; justify-content: center; padding: max(32px, env(safe-area-inset-top)) 24px 32px; }
.login-box { width: 100%; max-width: 380px; margin: 0 auto; animation: rise .6s var(--ease-out) both; }
.login-box .brand { height: 54px; width: auto; margin-bottom: 36px; }
.login-box h1 { font-size: 26px; letter-spacing: -.03em; }
.login-box .sub { color: var(--muted); margin: 6px 0 28px; }
.login-box form { display: grid; gap: 16px; }
.login-foot { margin-top: 28px; font-size: 12.5px; color: var(--faint); }
.pw-wrap { position: relative; }
.pw-wrap .btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.pw-wrap .input { padding-right: 46px; }
@media (min-width: 960px) { .login { grid-template-columns: 1.08fr 1fr; } .login-art { display: block; } }

/* ---------- shell ---------- */
.shell { min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
.side { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; min-height: 100dvh; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
.top { position: sticky; top: 0; z-index: 40; height: calc(var(--topbar) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0; display: flex; align-items: center; gap: 10px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color var(--t) var(--ease); }
.top.scrolled { border-bottom-color: var(--line); }
.top h1 { font-size: 18px; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; min-width: 0; }
.top h1 .mark { width: 28px; height: 28px; }
.top .spacer { flex: 1; }
.top .search { display: none; }
.content { flex: 1; min-width: 0; padding: 16px; }
.bottom-nav { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(var(--n, 4), 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-top: 1px solid var(--line); }
.bottom-nav a { display: grid; justify-items: center; gap: 3px; padding: 6px 0 4px; border-radius: 10px; color: var(--muted); font-size: 11px; font-weight: 600; min-height: 48px;
  transition: color var(--t) var(--ease), background-color var(--t) var(--ease); position: relative; }
.bottom-nav a .icon { transition: transform var(--t) var(--spring); }
.bottom-nav a[aria-current="page"] { color: var(--ink); }
.bottom-nav a[aria-current="page"] .icon { transform: translateY(-1px) scale(1.08); color: var(--khaki-800); }
[data-theme="dark"] .bottom-nav a[aria-current="page"] .icon { color: var(--khaki); }
.bottom-nav a[aria-current="page"]::before { content: ''; position: absolute; top: 0; width: 22px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.bottom-nav a:active { background: var(--surface-2); }

@media (min-width: 900px) {
  .shell { grid-template-columns: var(--sidebar) 1fr; }
  .side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; padding: 18px 14px 14px; border-right: 1px solid var(--line); background: var(--surface); gap: 4px; }
  .side .brand { display: flex; align-items: center; padding: 4px 8px 18px; }
  .side .brand img { height: 38px; width: auto; }
  .nav-sec { font-size: 11px; font-weight: 650; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; padding: 16px 10px 6px; }
  .nav a { display: flex; align-items: center; gap: 11px; padding: 0 10px; min-height: 38px; border-radius: 9px; color: var(--ink-2); font-weight: 520; font-size: 14px; position: relative;
    transition: background-color var(--t) var(--ease), color var(--t) var(--ease); }
  .nav a .icon { color: var(--muted); transition: color var(--t) var(--ease), transform var(--t) var(--spring); }
  .nav a:hover { background: var(--surface-2); color: var(--ink); }
  .nav a:hover .icon { transform: translateX(1px); color: var(--ink-2); }
  .nav a[aria-current="page"] { background: var(--accent-soft); color: var(--ink); font-weight: 620; }
  .nav a[aria-current="page"] .icon { color: var(--khaki-800); }
  [data-theme="dark"] .nav a[aria-current="page"] .icon { color: var(--khaki); }
  .nav a[aria-current="page"]::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
  .nav a .count { margin-left: auto; font-size: 11.5px; color: var(--muted); font-weight: 600; }
  .side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); }
  .side .me .who { min-width: 0; flex: 1; line-height: 1.25; }
  .side .me .who b { display: block; font-size: 13.5px; font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side .me .who span { font-size: 12px; color: var(--muted); }
  .main { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .top { padding: 0 24px; }
  .top h1 .mark { display: none; }
  .top .search { display: block; width: min(320px, 32vw); }
  .content { padding: 20px 24px 28px; }
}

/* ---------- page helpers ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h2 { font-size: 22px; letter-spacing: -.025em; }
.page-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-h h3 { font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.panel-b { padding: 16px; }
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 36px 16px; color: var(--muted); font-size: 13.5px; }
.empty .icon { width: 28px; height: 28px; color: var(--faint); }
.empty b { color: var(--ink-2); font-weight: 600; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.row { display: flex; align-items: center; gap: 8px; } .grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid2 .full { grid-column: 1 / -1; } }
.skel { background: linear-gradient(90deg, var(--surface-2) 0, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: var(--r-sm); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.enter { animation: rise .42s var(--ease-out) both; }
.enter-stagger > * { animation: rise .42s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 32ms); }

/* ---------- board ---------- */
.board-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.board-bar .filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.board { display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding: 2px 16px 18px; margin: 0 -16px;
  scroll-padding-inline: 16px; align-items: flex-start; min-height: calc(100dvh - 220px); }
.col { flex: 0 0 min(86vw, var(--col)); scroll-snap-align: start; display: flex; flex-direction: column; max-height: calc(100dvh - 200px); border-radius: var(--r-lg);
  background: var(--sunken); border: 1px solid var(--line); transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease), box-shadow var(--t) var(--ease); }
[data-theme="dark"] .col { background: #1D1C14; }
.col.drop-ok { border-color: var(--khaki-600); box-shadow: 0 0 0 3px color-mix(in srgb, var(--khaki) 22%, transparent); background: color-mix(in srgb, var(--accent-soft) 70%, var(--sunken)); }
.col.drop-no { opacity: .55; }
.col-h { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px 14px; position: sticky; top: 0; }
.col-h .bar { width: 8px; height: 8px; border-radius: 3px; background: var(--c); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
.col-h h3 { font-size: 13.5px; font-weight: 640; letter-spacing: -.005em; }
.col-h .n { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 0 7px; line-height: 19px; }
.col-h .lock { color: var(--faint); }
.col-h .spacer { flex: 1; }
.col-list { flex: 1; overflow-y: auto; padding: 2px 8px 8px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; overscroll-behavior: contain; }
.col-add { margin: 0 8px 8px; justify-content: flex-start; color: var(--muted); }
.col-add:hover { color: var(--ink); }
@media (min-width: 900px) { .board { margin: 0 -24px; padding: 2px 24px 18px; scroll-padding-inline: 24px; scroll-snap-type: none; } .col { flex-basis: var(--col); } }

.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 11px 12px 10px; cursor: pointer; text-align: left; width: 100%;
  box-shadow: var(--shadow-1); display: grid; gap: 8px; color: inherit;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease), opacity var(--t) var(--ease); touch-action: manipulation; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--line-2); }
.card:active { transform: translateY(0) scale(.995); }
.card.dragging { opacity: .35; transform: none; box-shadow: none; }
.card.ghost-lift { position: fixed; z-index: 300; pointer-events: none; width: var(--w); transform: rotate(1.5deg) scale(1.02); box-shadow: var(--shadow-3); border-color: var(--khaki-600); transition: none; }
.card .cover { margin: -11px -12px 0; height: 118px; border-radius: var(--r) var(--r) 0 0; overflow: hidden; background: var(--surface-2); }
.card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease-out); }
.card:hover .cover img { transform: scale(1.03); }
.card .labels { display: flex; flex-wrap: wrap; gap: 4px; }
.card .labels .chip { height: 6px; width: 34px; padding: 0; border-radius: 4px; font-size: 0; }
.card .t { display: flex; align-items: flex-start; gap: 8px; }
.card .t b { font-size: 14px; font-weight: 620; line-height: 1.3; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.card .code { font-size: 11px; color: var(--faint); font-weight: 600; letter-spacing: .02em; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12px; color: var(--muted); }
.card .meta > span { display: inline-flex; align-items: center; gap: 4px; }
.card .meta .icon { width: 14px; height: 14px; }
.card .meta .done { color: var(--ok); }
.card .foot { display: flex; align-items: center; gap: 8px; }
.card .foot .spacer { flex: 1; }
.card .progress { height: 3px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.card .progress i { display: block; height: 100%; background: var(--khaki-600); border-radius: 3px; transition: width var(--t-slow) var(--ease); }
.card.hold { background: repeating-linear-gradient(-45deg, var(--surface), var(--surface) 10px, color-mix(in srgb, var(--warn-soft) 55%, var(--surface)) 10px, color-mix(in srgb, var(--warn-soft) 55%, var(--surface)) 20px); }
.card .move-btn { position: absolute; top: 6px; right: 6px; opacity: 0; transition: opacity var(--t) var(--ease); }
.card:hover .move-btn, .card:focus-within .move-btn { opacity: 1; }
@media (hover: none) { .card .move-btn { opacity: 1; } }
.drop-marker { height: 3px; border-radius: 3px; background: var(--khaki-700); margin: -5px 2px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--khaki) 25%, transparent); }

/* ---------- sheet (job detail) & modal ---------- */
.scrim { position: fixed; inset: 0; z-index: 200; background: var(--scrim); animation: fade var(--t) var(--ease) both; }
.scrim.out { animation: fade var(--t-fast) var(--ease) reverse both; }
.sheet { position: fixed; z-index: 210; inset: 0; background: var(--bg); display: flex; flex-direction: column; animation: sheet-up var(--t-slow) var(--ease-out) both; }
.sheet.out { animation: sheet-up 180ms var(--ease) reverse both; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheet-in { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 900px) {
  .sheet { inset: 10px 10px 10px auto; width: min(980px, calc(100vw - 280px)); border-radius: var(--r-xl); border: 1px solid var(--line); box-shadow: var(--shadow-3); animation-name: sheet-in; overflow: hidden; }
}
.sheet-h { display: flex; align-items: flex-start; gap: 12px; padding: calc(14px + env(safe-area-inset-top)) 16px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.sheet-h .title { flex: 1; min-width: 0; }
.sheet-h .title .code { font-size: 12px; font-weight: 650; color: var(--muted); letter-spacing: .03em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sheet-h .title h2 { font-size: 20px; letter-spacing: -.025em; margin-top: 4px; overflow-wrap: anywhere; }
.sheet-h .title .name-input { font-size: 20px; font-weight: 600; letter-spacing: -.025em; border: 1px solid transparent; background: transparent; padding: 2px 6px; margin: 2px -7px 0; border-radius: 8px; width: calc(100% + 14px);
  transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease); }
.sheet-h .title .name-input:hover { background: var(--surface-2); }
.sheet-h .title .name-input:focus { outline: none; border-color: var(--khaki-700); background: var(--surface); }
.sheet-tabs { display: flex; gap: 2px; overflow-x: auto; padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.sheet-tabs::-webkit-scrollbar { display: none; }
.sheet-tabs button { border: 0; background: none; padding: 12px 10px; font-size: 13.5px; font-weight: 580; color: var(--muted); white-space: nowrap; position: relative; display: inline-flex; gap: 7px; align-items: center;
  transition: color var(--t) var(--ease); }
.sheet-tabs button:hover { color: var(--ink); }
.sheet-tabs button[aria-selected="true"] { color: var(--ink); }
.sheet-tabs button::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--khaki-700); transform: scaleX(0); transition: transform var(--t) var(--ease-out); }
.sheet-tabs button[aria-selected="true"]::after { transform: scaleX(1); }
[data-theme="dark"] .sheet-tabs button::after { background: var(--khaki); }
.sheet-tabs .badge { font-size: 11px; background: var(--surface-2); border-radius: 10px; padding: 0 6px; line-height: 18px; color: var(--muted); }
.sheet-b { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
.sheet-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .sheet-grid { grid-template-columns: minmax(0, 1fr) 280px; } }
.sheet-side { display: grid; gap: 12px; align-content: start; }
.kv { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.kv dt { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.kv dd { margin: 0; font-size: 14px; font-weight: 540; }
.sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: grid; gap: 14px; }
.sec + .sec { margin-top: 14px; }
.sec-h { display: flex; align-items: center; gap: 10px; }
.sec-h h3 { font-size: 15px; display: flex; gap: 8px; align-items: center; }
.sec-h .icon { color: var(--khaki-800); }
[data-theme="dark"] .sec-h .icon { color: var(--khaki); }
.sec-h .spacer { flex: 1; }
.saved-tick { font-size: 12px; color: var(--ok); display: inline-flex; gap: 4px; align-items: center; opacity: 0; transition: opacity var(--t) var(--ease); }
.saved-tick.on { opacity: 1; }
.stage-steps { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.stage-steps::-webkit-scrollbar { display: none; }
.stage-steps button { flex: 1 0 auto; min-width: 74px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 8px; padding: 7px 10px; font-size: 12px; font-weight: 600;
  display: grid; gap: 5px; text-align: left; transition: all var(--t) var(--ease); }
.stage-steps button i { height: 3px; border-radius: 3px; background: var(--line-2); transition: background-color var(--t) var(--ease); }
.stage-steps button.past { color: var(--ink-2); }
.stage-steps button.past i { background: var(--c); opacity: .55; }
.stage-steps button.now { color: var(--ink); border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--surface)); }
.stage-steps button.now i { background: var(--c); }
.stage-steps button:not(:disabled):hover { border-color: var(--line-strong); color: var(--ink); transform: translateY(-1px); }
.stage-steps button:disabled { cursor: default; }

.checklist { display: grid; gap: 2px; }
.checklist-h { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.checklist-h b { font-size: 14px; font-weight: 620; flex: 1; }
.checklist-h .pct { font-size: 12px; color: var(--muted); font-weight: 600; min-width: 34px; text-align: right; }
.meter { height: 5px; background: var(--surface-2); border-radius: 5px; overflow: hidden; margin-bottom: 6px; }
.meter i { display: block; height: 100%; background: var(--khaki-600); border-radius: 5px; transition: width var(--t-slow) var(--ease-out); }
.meter.full i { background: var(--ok); }
.ci { display: flex; align-items: flex-start; gap: 10px; padding: 5px 6px; border-radius: 8px; transition: background-color var(--t) var(--ease); }
.ci:hover { background: var(--surface-2); }
.ci .check { min-height: 22px; align-items: flex-start; flex: 1; }
.ci .check input { margin-top: 1px; }
.ci .txt { font-size: 14px; line-height: 1.4; transition: color var(--t) var(--ease); }
.ci.done .txt { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.ci .by { font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.ci .x { opacity: 0; transition: opacity var(--t) var(--ease); }
.ci:hover .x, .ci:focus-within .x { opacity: 1; }
@media (hover: none) { .ci .x { opacity: 1; } }

.comment-box { display: grid; gap: 8px; }
.comment { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.comment:first-child { border-top: 0; }
.comment .body { flex: 1; min-width: 0; }
.comment .who { font-size: 13px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.comment .who b { font-weight: 620; }
.comment .who span { color: var(--faint); font-size: 12px; }
.comment p { margin-top: 3px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment .acts { display: flex; gap: 10px; margin-top: 4px; font-size: 12px; }
.comment .acts button { background: none; border: 0; padding: 0; color: var(--muted); font-weight: 550; }
.comment .acts button:hover { color: var(--ink); text-decoration: underline; }

.files { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.file { position: relative; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); display: grid; transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.file:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.file .thumb { aspect-ratio: 4 / 3; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; color: var(--faint); }
.file .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease-out); }
.file:hover .thumb img { transform: scale(1.03); }
.file .fm { padding: 8px 10px; display: grid; gap: 2px; }
.file .fm b { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file .fm span { font-size: 11.5px; color: var(--muted); }
.file .kind { position: absolute; top: 8px; left: 8px; }
.file .acts { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity var(--t) var(--ease); }
.file:hover .acts, .file:focus-within .acts { opacity: 1; }
@media (hover: none) { .file .acts { opacity: 1; } }
.file .acts .btn { background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(6px); }
.drop { border: 1.5px dashed var(--line-strong); border-radius: var(--r); padding: 18px; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; color: var(--muted); font-size: 13.5px;
  transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease); }
.drop.over { border-color: var(--khaki-700); background: var(--accent-soft); color: var(--ink); }

.timeline { display: grid; gap: 0; }
.tl { display: grid; grid-template-columns: 28px 1fr; gap: 10px; position: relative; padding-bottom: 14px; }
.tl::before { content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; width: 1px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.tl .dot .icon { width: 14px; height: 14px; }
.tl .txt { font-size: 13.5px; padding-top: 4px; }
.tl .txt b { font-weight: 620; }
.tl .txt time { display: block; font-size: 12px; color: var(--faint); margin-top: 2px; }
.tl .diff { margin-top: 4px; font-size: 12.5px; color: var(--muted); display: grid; gap: 2px; }
.tl .diff s { color: var(--faint); }

/* ---------- popover menu ---------- */
.pop { position: fixed; z-index: 320; min-width: 220px; max-width: min(320px, calc(100vw - 24px)); max-height: min(420px, 70vh); overflow-y: auto; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-3); padding: 6px; animation: pop-in var(--t) var(--ease-out) both; transform-origin: var(--ox, top left); }
@keyframes pop-in { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }
.pop .pop-h { font-size: 11.5px; font-weight: 650; color: var(--faint); text-transform: uppercase; letter-spacing: .07em; padding: 8px 10px 6px; }
.pop .mi { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border: 0; background: none; border-radius: 8px; text-align: left; font-size: 14px;
  transition: background-color var(--t-fast) var(--ease); }
.pop .mi:hover, .pop .mi:focus-visible { background: var(--surface-2); outline: none; }
.pop .mi .icon { color: var(--muted); }
.pop .mi .tick { margin-left: auto; color: var(--khaki-800); opacity: 0; }
.pop .mi[aria-checked="true"] .tick { opacity: 1; }
.pop .mi.danger { color: var(--danger); } .pop .mi.danger .icon { color: var(--danger); }
.pop .mi:disabled { opacity: .45; cursor: default; }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
@media (max-width: 640px) {
  .pop.as-sheet { left: 8px !important; right: 8px; top: auto !important; bottom: calc(8px + env(safe-area-inset-bottom)); max-width: none; max-height: 70vh; border-radius: var(--r-lg); animation-name: sheet-up; }
}

.modal { position: fixed; z-index: 260; left: 50%; top: 50%; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); overflow: auto; transform: translate(-50%, -50%);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-3); animation: modal-in var(--t-slow) var(--ease-out) both; }
@keyframes modal-in { from { opacity: 0; transform: translate(-50%, -46%) scale(.98); } to { opacity: 1; transform: translate(-50%, -50%); } }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 18px 20px 4px; }
.modal-h h2 { font-size: 18px; flex: 1; }
.modal-b { padding: 14px 20px; display: grid; gap: 14px; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 6px 20px 18px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .modal { top: auto; bottom: 0; left: 0; right: 0; width: 100%; transform: none; border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom); animation-name: sheet-up; }
  .modal-f .btn { flex: 1; }
}

/* ---------- toasts ---------- */
#toasts { position: fixed; z-index: 500; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100vw - 24px)); pointer-events: none; }
@media (min-width: 900px) { #toasts { left: auto; right: 20px; bottom: 20px; transform: none; } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 11px 12px 11px 14px; border-radius: 12px; background: #2A281D; color: #F3F0E2; box-shadow: var(--shadow-3);
  font-size: 13.5px; animation: toast-in var(--t-slow) var(--spring) both; }
.toast.out { animation: toast-out 200ms var(--ease) both; }
.toast .icon { color: var(--khaki); }
.toast.err .icon { color: #F0A08A; }
.toast .grow { line-height: 1.4; }
.toast button { background: none; border: 0; color: var(--khaki); font-weight: 650; padding: 4px 6px; border-radius: 6px; }
.toast button:hover { background: rgba(255, 255, 255, .08); }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- dashboard ---------- */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
@media (min-width: 1100px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); display: grid; gap: 6px; position: relative; overflow: hidden;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.stat .k { font-size: 12.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: clamp(20px, 3.4vw, 28px); font-weight: 620; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .s { font-size: 12px; color: var(--muted); }
.stat.feature { background: linear-gradient(135deg, #3A3824, #23221A); color: #F3F0E2; border-color: transparent; }
.stat.feature .k, .stat.feature .s { color: #CFCAB0; }
.stat.feature::after { content: ''; position: absolute; right: -30px; bottom: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(189, 183, 107, .4), transparent 70%); }
.dash { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .dash { grid-template-columns: 1.4fr 1fr; } }
.funnel { display: grid; gap: 8px; }
.funnel a { display: grid; grid-template-columns: 110px 1fr 32px; gap: 10px; align-items: center; font-size: 13px; color: var(--ink-2); padding: 4px 6px; border-radius: 8px; transition: background-color var(--t) var(--ease); }
.funnel a:hover { background: var(--surface-2); }
.funnel .track { height: 10px; border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.funnel .track i { display: block; height: 100%; border-radius: 10px; background: var(--c); transform-origin: left; animation: grow .8s var(--ease-out) both; animation-delay: calc(var(--i) * 50ms); }
@keyframes grow { from { transform: scaleX(0); } }
.funnel b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 620; }
.list { display: grid; }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line); color: inherit; transition: background-color var(--t) var(--ease); min-height: 56px; }
.li:first-child { border-top: 0; }
a.li:hover, button.li:hover { background: var(--surface-2); }
button.li { width: 100%; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; }
.li .date { width: 46px; flex: none; text-align: center; border-radius: 10px; background: var(--surface-2); padding: 5px 0; line-height: 1.1; }
.li .date b { display: block; font-size: 17px; font-weight: 650; }
.li .date span { font-size: 10.5px; text-transform: uppercase; color: var(--muted); font-weight: 650; letter-spacing: .06em; }
.li .main-t { flex: 1; min-width: 0; }
.li .main-t b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .main-t span { font-size: 12.5px; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- calendar ---------- */
.cal-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-bar h2 { font-size: 20px; letter-spacing: -.025em; min-width: 0; margin-right: auto; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--line); gap: 1px; }
.month .dow { background: var(--surface-2); font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; padding: 8px 10px; }
.day { background: var(--surface); min-height: 112px; padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; transition: background-color var(--t) var(--ease); }
.day.other { background: var(--sunken); }
.day.other .dn { color: var(--faint); }
.day .dn { font-size: 12.5px; font-weight: 620; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; border: 0; background: none; padding: 0; }
.day .dn:hover { background: var(--surface-2); }
.day.today .dn { background: var(--accent); color: var(--on-accent); }
.ev { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 560; padding: 3px 6px; border-radius: 6px; border: 0; text-align: left; width: 100%; min-width: 0;
  background: color-mix(in srgb, var(--c) 18%, var(--surface)); color: var(--ink); border-left: 3px solid var(--c); transition: transform var(--t-fast) var(--ease), background-color var(--t) var(--ease); }
.ev:hover { background: color-mix(in srgb, var(--c) 30%, var(--surface)); transform: translateX(1px); }
.ev span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev time { font-variant-numeric: tabular-nums; color: var(--muted); flex: none; font-weight: 600; }
.ev.measure { --c: var(--info); border-left-style: dashed; }
.more { font-size: 11.5px; color: var(--muted); background: none; border: 0; padding: 2px 6px; text-align: left; font-weight: 600; }
.more:hover { color: var(--ink); }
@media (max-width: 720px) {
  .day { min-height: 64px; padding: 4px; align-items: center; }
  .day .ev { display: none; }
  .day .dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
  .day .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
  .month .dow { padding: 6px 2px; text-align: center; font-size: 10.5px; }
  .day .more { display: none; }
}
@media (min-width: 721px) { .day .dots { display: none; } }
.agenda { margin-top: 14px; }
.week { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .week { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.wday { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); min-height: 140px; display: flex; flex-direction: column; min-width: 0; }
.wday-h { display: flex; align-items: baseline; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.wday-h b { font-size: 20px; font-weight: 620; letter-spacing: -.02em; }
.wday-h span { font-size: 12px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.wday.today .wday-h b { color: var(--khaki-800); }
[data-theme="dark"] .wday.today .wday-h b { color: var(--khaki); }
.wday.today { border-color: var(--khaki-600); box-shadow: 0 0 0 3px color-mix(in srgb, var(--khaki) 18%, transparent); }
.wday-b { padding: 8px; display: grid; gap: 6px; align-content: start; }
.evc { display: grid; gap: 4px; padding: 9px 10px; border-radius: 10px; background: color-mix(in srgb, var(--c) 14%, var(--surface)); border: 0; border-left: 3px solid var(--c); text-align: left; width: 100%;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.evc:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.evc.measure { --c: var(--info); }
.evc .k { font-size: 11.5px; font-weight: 650; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.evc b { font-size: 13.5px; font-weight: 620; overflow-wrap: anywhere; }
.evc .m { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.day-view { display: grid; gap: 10px; }
.day-view .evc { padding: 14px; grid-template-columns: 1fr auto; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th { position: sticky; top: 0; z-index: 1; text-align: left; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2);
  padding: 10px 14px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.tbl th button { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; display: inline-flex; gap: 4px; align-items: center; }
.tbl th button:hover { color: var(--ink); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; transition: background-color var(--t-fast) var(--ease); }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; }
.cards-m { display: none; }
@media (max-width: 720px) {
  .table-wrap.respond { display: none; }
  .cards-m { display: grid; gap: 8px; }
}

/* ---------- settings ---------- */
.settings { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .settings { grid-template-columns: 220px minmax(0, 1fr); align-items: start; } }
.set-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.set-nav::-webkit-scrollbar { display: none; }
.set-nav a { flex: none; display: flex; align-items: center; gap: 10px; padding: 0 12px; min-height: 38px; border-radius: 9px; color: var(--ink-2); font-weight: 540; font-size: 14px; white-space: nowrap;
  border: 1px solid var(--line); background: var(--surface); transition: all var(--t) var(--ease); }
.set-nav a:hover { color: var(--ink); border-color: var(--line-strong); }
.set-nav a[aria-current="page"] { background: var(--accent-soft); border-color: var(--khaki-600); color: var(--ink); font-weight: 620; }
@media (min-width: 1000px) { .set-nav { flex-direction: column; position: sticky; top: calc(var(--topbar) + 16px); } .set-nav a { border-color: transparent; background: none; } }
.matrix { width: 100%; border-collapse: separate; border-spacing: 0; }
.matrix th, .matrix td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13.5px; }
.matrix th { font-size: 11.5px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.matrix tr:last-child td { border-bottom: 0; }
.stage-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: var(--c); margin-right: 8px; vertical-align: 1px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches button { width: 26px; height: 26px; border-radius: 8px; border: 2px solid transparent; background: var(--c); padding: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1);
  transition: transform var(--t-fast) var(--spring), border-color var(--t) var(--ease); }
.swatches button:hover { transform: scale(1.1); }
.swatches button[aria-pressed="true"] { border-color: var(--ink); transform: scale(1.06); }
.drag-row { cursor: grab; }
.drag-row .grip { color: var(--faint); }

/* ---------- misc ---------- */
.kbd { font: 600 11px/1 var(--font); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 3px 5px; color: var(--muted); background: var(--surface); }
.bell { position: relative; }
.bell .pip { position: absolute; top: 7px; right: 7px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); animation: pop-in var(--t) var(--spring) both; }
.money { font-variant-numeric: tabular-nums; font-weight: 600; }
.pay-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); flex-wrap: wrap; }
.pay-row .grow b { display: block; font-size: 14px; }
.pay-row .grow span { font-size: 12.5px; color: var(--muted); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 26px; font-size: 12px; font-weight: 650; }
.status-pill.paid { background: var(--ok-soft); color: var(--ok); }
.status-pill.due { background: var(--warn-soft); color: var(--warn); }
.status-pill.late { background: var(--danger-soft); color: var(--danger); }
.status-pill.none { background: var(--surface-2); color: var(--muted); }
.wa-share { color: #1F7A4D; }
[data-theme="dark"] .wa-share { color: #6BCB97; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .login-art img { animation: none; }
}
@media print { .side, .top, .bottom-nav { display: none !important; } }
