@font-face {
  font-family: Onest;
  src: url(fonts/onest-cyrillic.woff2) format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Onest;
  src: url(fonts/onest-cyrillic-ext.woff2) format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: Onest;
  src: url(fonts/onest-latin.woff2) format('woff2');
  font-weight: 100 900;
  font-display: swap;
  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: Onest;
  src: url(fonts/onest-latin-ext.woff2) format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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;
}

@font-face {
  font-family: 'Inter';
  src: url(fonts/inter-cyrillic.woff2) format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  src: url(fonts/inter-latin.woff2) format('woff2');
  font-weight: 100 900;
  font-display: swap;
  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: 'Manrope';
  src: url(fonts/manrope-cyrillic.woff2) format('woff2');
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  src: url(fonts/manrope-latin.woff2) format('woff2');
  font-weight: 200 800;
  font-display: swap;
  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: 'Geologica';
  src: url(fonts/geologica-cyrillic.woff2) format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Geologica';
  src: url(fonts/geologica-latin.woff2) format('woff2');
  font-weight: 100 900;
  font-display: swap;
  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: 'IBM Plex Sans';
  src: url(fonts/ibm-plex-sans-cyrillic.woff2) format('woff2');
  font-weight: 100 700;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url(fonts/ibm-plex-sans-latin.woff2) format('woff2');
  font-weight: 100 700;
  font-display: swap;
  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;
}

/* ---- tokens ------------------------------------------------------------- */

:root {
  color-scheme: light;
  --bg: #f2f3f6;
  --surface: #ffffff;
  --raised: #ffffff;
  --sunken: #f5f6f8;
  --line: #e8eaef;
  --line-strong: #d5d9e1;
  --text: #15171c;
  --text-2: #565c6b;
  --text-3: #8a90a0;
  --danger: #e03e44;
  --amber: #c27a04;
  --wait: #0d8bd9;
  --ok: #2a9d5c;
  --scrim: rgba(18, 22, 33, .38);
  --shadow-sm: 0 1px 2px rgba(18, 22, 33, .06);
  --shadow: 0 16px 40px -12px rgba(18, 22, 33, .22), 0 2px 8px rgba(18, 22, 33, .06);
  --c-violet: #7a5af5;
  --c-amber: #d9920a;
  --c-teal: #0d9f98;
  --c-rose: #e2447a;
  --c-blue: #3478f6;
  --c-green: #2a9d5c;
  --c-orange: #ef6c1a;
  --c-gray: #8a90a0;
  /* accent: text and icons / solid fills / text on a solid fill */
  --accent: #5b4de0;
  --accent-solid: #6a5cf0;
  --on-accent: #ffffff;
  --side: 248px;
  --font: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 14px;
}
:root[data-theme='dark'] {
  /* "Twilight": deep indigo-violet surfaces, lavender text and accent. */
  color-scheme: dark;
  --bg: #0c0a14;
  --surface: #13101e;
  --raised: #1b172b;
  --sunken: #0f0d19;
  --line: #241f36;
  --line-strong: #372f50;
  --text: #ece9f7;
  --text-2: #aba4c6;
  --text-3: #8a83ab;
  --danger: #ff7b8a;
  --amber: #f5c15a;
  --wait: #7cc4ff;
  --ok: #5fd6a2;
  --scrim: rgba(6, 4, 14, .66);
  --shadow-sm: 0 1px 2px rgba(4, 2, 12, .5);
  --shadow: 0 18px 44px -12px rgba(4, 2, 12, .8), 0 0 0 1px rgba(200, 180, 255, .05);
  --c-violet: #b4aaff;
  --c-amber: #f5c15a;
  --c-teal: #4fd6c8;
  --c-rose: #ff86b0;
  --c-blue: #80b4ff;
  --c-green: #66d6a4;
  --c-orange: #ff9e6a;
  --c-gray: #9a93b8;
  --accent: #b4aaff;
  --accent-solid: #6b59ec;
  --on-accent: #ffffff;
}
:root[data-font='inter'] { --font: 'Inter', ui-sans-serif, system-ui, sans-serif; }
:root[data-font='geologica'] { --font: 'Geologica', ui-sans-serif, system-ui, sans-serif; }
:root[data-font='plex'] { --font: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif; }
:root[data-font='onest'] { --font: Onest, ui-sans-serif, system-ui, sans-serif; }
:root[data-font='system'] { --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif; }
:root[data-accent='ocean'] { --accent: #0b6f85; --accent-solid: #0c7c95; }
:root[data-accent='blue'] { --accent: #1f5fd6; --accent-solid: #2a6ff0; }
:root[data-accent='emerald'] { --accent: #0a7f58; --accent-solid: #0a8f63; }
:root[data-accent='orange'] { --accent: #cb4610; --accent-solid: #e4521b; }
:root[data-accent='graphite'] { --accent: #15171c; --accent-solid: #1b1e25; }
:root[data-theme='dark'][data-accent='ocean'] { --accent: #62d6e8; --accent-solid: #35c3d8; --on-accent: #04222b; }
:root[data-theme='dark'][data-accent='blue'] { --accent: #7db0ff; --accent-solid: #2a6ff0; --on-accent: #ffffff; }
:root[data-theme='dark'][data-accent='emerald'] { --accent: #4fd6a4; --accent-solid: #2fc08b; --on-accent: #04261a; }
:root[data-theme='dark'][data-accent='orange'] { --accent: #ff9166; --accent-solid: #f2622e; --on-accent: #ffffff; }
:root[data-theme='dark'][data-accent='graphite'] { --accent: #ece9f7; --accent-solid: #ece9f7; --on-accent: #13101e; }
:root {
  --accent-soft: color-mix(in srgb, var(--accent-solid) 13%, transparent);
  --hover: color-mix(in srgb, var(--text) 5%, transparent);
  --hover-strong: color-mix(in srgb, var(--text) 9%, transparent);
}

/* ---- base --------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 14px/1.5 var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
input, textarea { background: none; border: 0; outline: 0; padding: 0; min-width: 0; }
textarea { resize: none; display: block; width: 100%; overflow: hidden; }
::placeholder { color: var(--text-3); opacity: 1; }
::selection { background: color-mix(in srgb, var(--accent-solid) 28%, transparent); }
:focus-visible { outline: 2px solid var(--accent-solid); outline-offset: 1px; border-radius: 8px; }
input:focus-visible, textarea:focus-visible { outline: 0; }
svg { display: block; flex: none; }
kbd {
  font: 500 11px/1 var(--font);
  color: var(--text-3);
  background: var(--hover-strong);
  border-radius: 5px;
  padding: 4px 6px;
}
.muted { color: var(--text-3); }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--dot, var(--c-gray)); }

/* ---- shell: sidebar on the backdrop, content as floating cards ----------- */

.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); gap: 8px; height: 100dvh; padding: 8px 8px 8px 0; }
.shell.has-detail { grid-template-columns: var(--side) minmax(0, 1fr) 460px; }
.main, .detail {
  display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.main { container: main / inline-size; }
.scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.top + .scroll { border-top: 1px solid var(--line); }

/* ---- sidebar ----------------------------------------------------------- */

.side { display: flex; flex-direction: column; min-height: 0; padding: 8px 4px 4px 12px; gap: 2px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 14px; font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; box-shadow: var(--shadow-sm); flex: none; }
.side-new {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; margin-bottom: 6px;
  border-radius: 10px; background: var(--accent-solid); color: var(--on-accent); font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 2px rgba(18, 22, 33, .18);
}
.side-new:hover { filter: brightness(1.07); }
.side-new kbd { margin-left: auto; color: inherit; background: rgba(255, 255, 255, .2); }
:root[data-theme='dark'][data-accent='ocean'] .side-new kbd, :root[data-theme='dark'][data-accent='graphite'] .side-new kbd, :root[data-theme='dark'][data-accent='emerald'] .side-new kbd { background: rgba(0, 0, 0, .12); }
.side-search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 12px; margin-bottom: 10px; border-radius: 10px; background: var(--hover); color: var(--text-3); }
.side-search kbd { margin-left: auto; }
.side-search:hover { background: var(--hover-strong); color: var(--text-2); }
.side-scroll { flex: 1; min-height: 0; overflow: auto; margin: 0 -4px 0 -12px; padding: 0 4px 0 12px; }
.side-label { padding: 18px 10px 6px; font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: .01em; }
.nav { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border-radius: 9px; color: var(--text-2); font-weight: 500; }
.nav:hover { background: var(--hover); color: var(--text); }
.nav.active { background: var(--hover-strong); color: var(--text); font-weight: 600; }
.nav.active > svg { color: var(--accent); }
.nav .count { margin-left: auto; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; font-weight: 500; }
.nav .count.alert { color: var(--danger); background: color-mix(in srgb, var(--danger) 13%, transparent); padding: 1px 7px; border-radius: 99px; margin-right: -3px; }
.nav .dot { margin: 0 4px; }
.side-foot { display: flex; align-items: center; gap: 4px; padding-top: 6px; }

.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--hover); gap: 2px; }
.seg button { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 7px; color: var(--text-3); font-size: 13px; font-weight: 500; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--raised); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }

.icon-btn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--text-3); flex: none; }
.icon-btn:hover { background: var(--hover-strong); color: var(--text); }
.icon-btn.sm { width: 26px; height: 26px; border-radius: 7px; }
.icon-btn:disabled { opacity: .4; cursor: default; }

/* ---- top bar ----------------------------------------------------------- */

.top { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 0 16px 0 22px; flex: none; }
.top h1 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.02em; min-width: 0; }
.top h1 .dot { width: 10px; height: 10px; }
.top h1 .count { font-weight: 500; color: var(--text-3); font-size: 13px; letter-spacing: 0; background: var(--hover); padding: 1px 8px; border-radius: 99px; }
.top-search { display: flex; align-items: center; gap: 8px; width: 210px; height: 34px; padding: 0 10px; border-radius: 10px; background: var(--hover); color: var(--text-3); }
.top-search:focus-within { background: transparent; box-shadow: 0 0 0 2px var(--accent-solid); color: var(--text); }
.top-search input { flex: 1; }
.menu-btn { display: none; }

.filters { display: flex; align-items: center; gap: 6px; padding: 0 22px 12px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; flex: none; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; flex: none; max-width: 240px;
  border-radius: 8px; background: var(--hover); color: var(--text-2); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.chip:hover { background: var(--hover-strong); color: var(--text); }
.chip.on { background: var(--accent-soft); color: var(--accent); }
.chip.ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text-3); }
.chip.ghost:hover { background: var(--hover); color: var(--text); }
.chip.plain { background: transparent; color: var(--text-3); }
.chip .val { overflow: hidden; text-overflow: ellipsis; }

/* ---- list: a table with labelled columns, split into group sections ------ */

.list { padding: 0 12px 32px; --w-field: 150px; --w-area: 172px; --w-prio: 118px; --w-due: 92px; }
.thead, .row { display: flex; align-items: center; gap: 14px; padding: 0 12px; }
.thead { position: sticky; top: 0; z-index: 2; height: 36px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--text-3); }
.thead .c-title { flex: 1; min-width: 0; padding-left: 30px; }
.row-cells { display: contents; }
.cell { flex: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-field { width: var(--w-field); }
.c-area { width: var(--w-area); }
.c-prio { width: var(--w-prio); }
.c-due { width: var(--w-due); text-align: right; }
.row .c-field { font-size: 13px; color: var(--text-2); }

/* A group is a tinted band followed by its rows, set apart from the next group by whitespace. */
.group { --gc: var(--text-3); margin-top: 16px; }
.group.flat { margin-top: 0; }
.group-head {
  position: sticky; top: 36px; z-index: 1; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 6px 0 10px;
  border-radius: 10px; background: color-mix(in srgb, var(--gc) 10%, var(--surface)); font-weight: 650; font-size: 14.5px; letter-spacing: -.01em;
}
.group-head .count {
  font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums; letter-spacing: 0; padding: 1px 8px; border-radius: 99px;
  background: color-mix(in srgb, var(--gc) 16%, transparent); color: color-mix(in srgb, var(--gc) 65%, var(--text));
}
.group-toggle { display: flex; align-items: center; gap: 10px; min-width: 0; height: 100%; }
.group-toggle .chev { color: var(--text-3); transition: transform .16s ease; }
.group-toggle.closed .chev { transform: rotate(-90deg); }

.row {
  min-height: 46px; border-bottom: 1px solid var(--line); cursor: default;
  content-visibility: auto; contain-intrinsic-size: auto 46px;
}
.row:hover { background: var(--hover); }
.row.selected { background: var(--accent-soft); }
.row-title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; font-weight: 500; }
.row-title .ellipsis { min-width: 0; }
.row-tags { flex: none; font-size: 12px; font-weight: 400; color: var(--text-3); }
.row.is-done .row-title .ellipsis { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.status-btn { display: grid; place-items: center; width: 26px; height: 26px; margin: 0 -5px; border-radius: 8px; flex: none; }
.status-btn:hover { background: var(--hover-strong); }
.prio { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; vertical-align: middle; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; max-width: 170px; border-radius: 7px;
  background: color-mix(in srgb, var(--pc, var(--text-2)) 11%, transparent);
  color: color-mix(in srgb, var(--pc, var(--text-2)) 72%, var(--text));
  font-size: 12px; font-weight: 500; white-space: nowrap; vertical-align: middle;
}
.pill span { overflow: hidden; text-overflow: ellipsis; }
.pill .dot { width: 6px; height: 6px; }
.pill.tag { background: transparent; color: var(--text-3); padding: 0 2px; }
.due { font-size: 12px; font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row .due { font-size: 13px; }
.due.overdue { color: var(--danger); }
.due.today { color: var(--amber); }

.add-row { display: flex; align-items: center; gap: 14px; min-height: 42px; padding: 0 12px 0 13px; color: var(--text-3); width: 100%; font-size: 13px; font-weight: 500; }
.add-row:hover { color: var(--accent); background: var(--hover); }
div.add-row { box-shadow: inset 0 0 0 2px var(--accent-solid); border-radius: 10px; color: var(--accent); font-size: 14px; }
.add-row input { flex: 1; color: var(--text); }
.more-row { display: block; width: 100%; padding: 12px; color: var(--text-3); font-size: 13px; border-bottom: 1px solid var(--line); }
.more-row:hover { color: var(--text); background: var(--hover); }

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 88px 24px; color: var(--text-3); text-align: center; }
.empty b { color: var(--text); font-size: 16px; font-weight: 650; letter-spacing: -.01em; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 10px; background: var(--hover); font-weight: 600; white-space: nowrap; }
.btn:hover { background: var(--hover-strong); }
.btn.primary { background: var(--accent-solid); color: var(--on-accent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 2px rgba(18, 22, 33, .18); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.btn:disabled { opacity: .5; cursor: default; filter: none; }

/* ---- board ------------------------------------------------------------- */

.board { display: flex; gap: 10px; padding: 14px 16px 16px; height: 100%; overflow-x: auto; align-items: flex-start; }
.col { display: flex; flex-direction: column; flex: 1 0 264px; max-width: 360px; max-height: 100%; background: var(--sunken); border-radius: var(--radius); box-shadow: inset 0 0 0 1px transparent; }
.col.over { box-shadow: inset 0 0 0 2px var(--accent-solid); }
.col-head { display: flex; align-items: center; gap: 9px; height: 44px; padding: 0 8px 0 14px; font-weight: 600; font-size: 13px; flex: none; }
.col-head .count { color: var(--text-3); font-weight: 500; font-size: 12px; }
.col-body { display: flex; flex-direction: column; gap: 8px; padding: 0 8px 8px; overflow-y: auto; min-height: 52px; }
.card {
  display: flex; flex-direction: column; gap: 10px; padding: 12px 13px; border-radius: 12px;
  background: var(--raised); border: 1px solid var(--line); box-shadow: var(--shadow-sm); cursor: grab;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: 0 6px 16px -6px rgba(18, 22, 33, .18), var(--shadow-sm); }
.card.selected { border-color: var(--accent-solid); box-shadow: 0 0 0 1px var(--accent-solid); }
.card.dragging { opacity: .35; }
.card-title { font-weight: 550; line-height: 1.4; overflow-wrap: anywhere; }
.card.is-done .card-title { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.card-meta .due { min-width: 0; margin-left: auto; }
.drop-line { height: 3px; margin: -2px 4px; border-radius: 3px; background: var(--accent-solid); flex: none; }
.col-add { display: flex; align-items: center; gap: 8px; padding: 10px 12px; color: var(--accent); width: 100%; border-radius: 12px; background: var(--raised); box-shadow: inset 0 0 0 1px var(--line-strong); }
.col-add input { flex: 1; color: var(--text); }

/* ---- detail ------------------------------------------------------------ */

.detail-top { display: flex; align-items: center; gap: 4px; height: 56px; padding: 0 12px 0 24px; flex: none; color: var(--text-3); font-size: 13px; font-weight: 500; }
.detail-body { padding: 4px 24px 32px; }
.detail-title { font-size: 21px; font-weight: 650; line-height: 1.3; letter-spacing: -.02em; }
.desc { margin: 8px -10px 0; padding: 6px 10px; border-radius: 10px; min-height: 46px; cursor: text; }
.desc:hover { background: var(--hover); }
.desc.editing { background: var(--surface); box-shadow: 0 0 0 2px var(--accent-solid); padding: 0; cursor: auto; }
.desc.editing textarea { padding: 10px 12px 12px; line-height: 1.6; min-height: 96px; font-family: inherit; }
.desc-empty { color: var(--text-3); }
.md-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; padding: 5px 6px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); border-radius: 10px 10px 0 0; z-index: 1; }
.md-tools button { display: grid; place-items: center; min-width: 30px; height: 28px; padding: 0 6px; border-radius: 7px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.md-tools button:hover { background: var(--hover-strong); color: var(--text); }
.md-tools i { width: 1px; height: 16px; margin: 0 4px; background: var(--line-strong); }

.md { color: var(--text-2); line-height: 1.6; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md blockquote, .md pre { margin: 0 0 .7em; }
.md h2, .md h3, .md h4 { margin: 1.1em 0 .4em; color: var(--text); font-weight: 650; letter-spacing: -.01em; line-height: 1.3; }
.md h2 { font-size: 1.3em; }
.md h3 { font-size: 1.14em; }
.md h4 { font-size: 1em; }
.md strong { color: var(--text); font-weight: 650; }
.md a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
.md ul, .md ol { padding-left: 1.5em; }
.md li { margin: .15em 0; }
.md li > ul, .md li > ol { margin: .15em 0 0; }
.md li.task { list-style: none; margin-left: -1.5em; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 9px; }
.md li.task > span { flex: 1; min-width: 0; }
.md li.task > ul, .md li.task > ol { flex-basis: 100%; padding-left: 3em; }
.md li.task.done > span { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.md input[type='checkbox'] { width: 15px; height: 15px; margin: 0; accent-color: var(--accent-solid); cursor: pointer; position: relative; top: 2px; flex: none; }
.md code { font: .9em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--hover-strong); padding: 1px 5px; border-radius: 5px; color: var(--text); }
.md pre { padding: 12px 14px; border-radius: 10px; background: var(--sunken); overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { padding: 2px 0 2px 14px; border-left: 3px solid var(--line-strong); }
.md blockquote p { margin: 0; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1em 0; }
.props { display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: center; row-gap: 2px; margin: 16px -10px 0; padding: 10px; border-radius: 12px; background: var(--sunken); }
.props .label { color: var(--text-3); font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prop { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 34px; padding: 4px 9px; border-radius: 8px; width: 100%; min-width: 0; font-weight: 500; }
button.prop:hover, .prop.editable:hover { background: var(--hover-strong); }
.prop.editable:focus-within { background: var(--surface); box-shadow: 0 0 0 2px var(--accent-solid); }
.prop input { flex: 1; font-weight: 500; }
.prop .placeholder { color: var(--text-3); font-weight: 400; }
.prop a { color: var(--accent); }
.section-title { margin: 26px 0 12px; font-size: 13px; font-weight: 600; color: var(--text-3); }
.section-title .count { margin-left: 8px; font-size: 12px; color: var(--text-2); background: var(--hover); padding: 1px 8px; border-radius: 99px; }

.subtasks { margin-top: 18px; }
.subtasks .section-title { margin: 0 0 8px; }
.progress { height: 4px; border-radius: 4px; background: var(--hover-strong); overflow: hidden; margin-bottom: 6px; }
.progress i { display: block; height: 100%; border-radius: 4px; background: var(--ok); transition: width .25s ease; }
.subtask { display: flex; align-items: flex-start; gap: 10px; padding: 5px 4px 5px 8px; margin: 0 -8px; border-radius: 8px; }
.subtask:hover, .subtask:focus-within { background: var(--hover); }
.subtask input[type='checkbox'] { width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--accent-solid); flex: none; cursor: pointer; }
.subtask-title { flex: 1; line-height: 1.45; font-weight: 500; }
.subtask.done .subtask-title { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.subtask .icon-btn { width: 22px; height: 22px; opacity: 0; }
.subtask:hover .icon-btn, .subtask:focus-within .icon-btn { opacity: 1; }
.subtask.add { align-items: center; color: var(--text-3); cursor: text; padding-top: 7px; padding-bottom: 7px; }
.subtask.add input { flex: 1; color: var(--text); }
.subs-chip { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: 12px; font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; }
.subs-chip.all { color: var(--ok); }

.history { display: flex; flex-direction: column; gap: 12px; }
.event { display: flex; gap: 10px; font-size: 13px; color: var(--text-2); }
.event-mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--hover); color: var(--text-3); flex: none; }
.event-body { min-width: 0; flex: 1; padding-top: 1px; }
.event time { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.event b { font-weight: 600; color: var(--text); }
.bubble { margin-top: 6px; padding: 10px 12px; border-radius: 4px 12px 12px 12px; background: var(--sunken); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.bubble.md { white-space: normal; color: var(--text); }
.bubble.tg { background: color-mix(in srgb, var(--c-blue) 11%, transparent); }
.comment-box { display: flex; align-items: flex-end; gap: 8px; margin-top: 16px; padding: 7px 7px 7px 14px; border-radius: 12px; background: var(--sunken); box-shadow: inset 0 0 0 1px var(--line); }
.comment-box:focus-within { box-shadow: 0 0 0 2px var(--accent-solid); background: var(--surface); }
.comment-box textarea { padding: 5px 0; max-height: 160px; overflow-y: auto; }
.comment-box .icon-btn:not(:disabled) { background: var(--accent-solid); color: var(--on-accent); }

/* ---- popovers, pickers, modals ---------------------------------------- */

.pop-scrim { position: fixed; inset: 0; z-index: 40; }
.pop {
  position: fixed; visibility: hidden; min-width: 228px; max-width: min(330px, calc(100vw - 16px)); max-height: min(430px, calc(100dvh - 16px));
  display: flex; flex-direction: column; background: var(--raised); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden;
}
.pick-search { padding: 11px 14px; border-bottom: 1px solid var(--line); flex: none; }
.pick-search input { width: 100%; }
.pick-list { padding: 5px; overflow-y: auto; }
.pick-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 4px 9px; border-radius: 8px; color: var(--text); font-weight: 500; }
.pick-item.active { background: var(--hover-strong); }
.pick-item .check { margin-left: auto; color: var(--accent); }
.pick-item .hint { margin-left: auto; color: var(--text-3); font-size: 12px; font-weight: 400; }
.pick-empty { padding: 14px; color: var(--text-3); font-size: 13px; text-align: center; }
.pick-foot { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 13px; flex: none; }
.pick-foot input[type='date'] { flex: 1; height: 30px; padding: 0 8px; background: var(--hover); border-radius: 8px; color: var(--text); }
.swatches { display: grid; grid-template-columns: repeat(4, 34px); gap: 6px; padding: 10px; }
.swatch { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.swatch:hover, .swatch.on { background: var(--hover-strong); }
.swatch i { width: 16px; height: 16px; border-radius: 50%; background: var(--dot); }

.modal-scrim { position: fixed; inset: 0; z-index: 30; display: flex; justify-content: center; align-items: flex-start; padding: 13vh 16px 16px; background: var(--scrim); }
.modal { width: 100%; max-width: 620px; max-height: 100%; display: flex; flex-direction: column; background: var(--raised); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.qa-body { padding: 20px 22px 6px; }
.qa-title { font-size: 18px; font-weight: 650; letter-spacing: -.015em; }
.qa-desc { margin-top: 8px; color: var(--text-2); min-height: 46px; max-height: 30vh; overflow-y: auto; }
.qa-props { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 22px 16px; }
.qa-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 14px 12px 22px; border-top: 1px solid var(--line); background: var(--sunken); }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); color: var(--text-3); }
.palette-input input { flex: 1; font-size: 16px; color: var(--text); }
.palette-list { padding: 6px; overflow-y: auto; }
.palette-label { padding: 10px 10px 4px; font-size: 12px; color: var(--text-3); font-weight: 600; }

.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: calc(100vw - 24px); }
.toast { display: flex; align-items: center; gap: 14px; padding: 11px 16px; border-radius: 12px; background: #1b1e25; color: #f1f2f5; box-shadow: var(--shadow); font-size: 13px; font-weight: 500; }
:root[data-theme='dark'] .toast { background: #ece9f7; color: #13101e; }
.toast button { font-weight: 650; color: inherit; opacity: .75; }
.toast button:hover { opacity: 1; }

/* ---- settings, login --------------------------------------------------- */

.settings { max-width: 700px; padding: 0 22px 60px; }
.settings h2 { margin: 30px 0 4px; font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.settings h2:first-child { margin-top: 8px; }
.settings p { margin: 0 0 12px; color: var(--text-3); font-size: 13px; max-width: 62ch; }
.set-list { border-radius: 12px; background: var(--sunken); overflow: hidden; }
.set-row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row input.name { flex: 1; font-weight: 550; height: 32px; }
.set-row .type { color: var(--text-3); font-size: 12px; font-weight: 500; flex: none; }
.set-options { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 12px; border-bottom: 1px solid var(--line); margin-top: -4px; }
.set-options .pill { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); }
.set-options .pill button { color: var(--text-3); margin-right: -3px; }
.set-options .pill button:hover { color: var(--danger); }
.set-options input { height: 22px; width: 150px; font-size: 12px; padding: 0 8px; border-radius: 7px; background: var(--hover); }
.set-add { color: var(--text-3); }
.set-add input { flex: 1; height: 32px; color: var(--text); }
.set-inline { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.accents { display: flex; gap: 8px; }
.accent { width: 28px; height: 28px; border-radius: 50%; background: var(--sw); display: grid; place-items: center; color: #fff; box-shadow: inset 0 0 0 1px rgba(128, 128, 128, .25); }
.accent.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--sw); }
.fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 14px; }
.font-opt { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--sunken); box-shadow: inset 0 0 0 1px var(--line); text-align: left; }
.font-opt:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
.font-opt.on { box-shadow: inset 0 0 0 2px var(--accent-solid); }
.font-sample { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.font-name { font-size: 12px; color: var(--text-3); font-weight: 500; }
.note { padding: 14px 16px; border-radius: 12px; background: var(--sunken); font-size: 13px; color: var(--text-2); }
.note code { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--hover-strong); padding: 1px 5px; border-radius: 5px; color: var(--text); }
.status-line { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.status-line i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.status-line i.ok { background: var(--ok); }
.status-line i.bad { background: var(--danger); }

.login { display: grid; place-items: center; height: 100dvh; padding: 20px; }
.login form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; padding: 28px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.login h1 { margin: 0 0 8px; font-size: 20px; font-weight: 650; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.field { height: 42px; padding: 0 14px; border-radius: 10px; background: var(--hover); }
.field:focus { background: transparent; box-shadow: 0 0 0 2px var(--accent-solid); }
.login .btn { height: 42px; }
.error { color: var(--danger); font-size: 13px; }

.fab { display: none; }
.side-scrim { display: none; }

/* ---- task opened wide: reading column on the left, properties on the right -- */

.detail { container: detail / inline-size; }
@media (min-width: 761px) {
  .shell.wide.has-detail { grid-template-columns: var(--side) minmax(0, 1fr); }
  .shell.wide .main { display: none; }
  .shell.wide .detail { position: static; width: auto; box-shadow: var(--shadow-sm); }
  .detail.wide .detail-body { max-width: 780px; margin: 0 auto; padding: 12px 32px 56px; }
  .detail.wide .detail-title { font-size: 28px; }
  .detail.wide .md, .detail.wide .desc.editing textarea { font-size: 15.5px; line-height: 1.7; }
  @container detail (min-width: 980px) {
    .detail.wide .detail-body {
      display: grid; grid-template-columns: minmax(0, 1fr) 320px; column-gap: 48px; align-items: start; max-width: 1180px;
      grid-template-areas: 'title props' 'desc props' 'subs props' 'history props'; grid-template-rows: auto auto auto 1fr;
    }
    .detail.wide .detail-title { grid-area: title; }
    .detail.wide .desc { grid-area: desc; }
    .detail.wide .subtasks { grid-area: subs; }
    .detail.wide .props { grid-area: props; margin: 6px 0 0; position: sticky; top: 8px; }
    .detail.wide .detail-history { grid-area: history; }
  }
}

/* ---- the title wins when the list column gets narrow -------------------- */

@media (min-width: 761px) {
  @container main (max-width: 1120px) { .c-field { display: none; } }
  @container main (max-width: 900px) { .row-tags { display: none; } .list { --w-area: 150px; } }
  @container main (max-width: 780px) { .list { --w-prio: 18px; } .prio span, .thead .c-prio span { display: none; } }
  @container main (max-width: 640px) { .list { --w-area: 10px; } .c-area .pill { padding: 0; background: none; } .c-area .pill span, .thead .c-area span { display: none; } }
}

/* ---- narrow desktop: detail floats over the list ------------------------ */

@media (max-width: 1180px) {
  .shell.has-detail { grid-template-columns: var(--side) minmax(0, 1fr); }
  .detail { position: fixed; top: 8px; right: 8px; bottom: 8px; width: min(460px, calc(100% - 16px)); z-index: 20; box-shadow: var(--shadow); }
}

/* ---- phone ------------------------------------------------------------- */

@media (max-width: 760px) {
  .shell, .shell.has-detail { grid-template-columns: minmax(0, 1fr); padding: 0; gap: 0; }
  .main, .detail { border: 0; border-radius: 0; box-shadow: none; }
  .side {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 25; width: min(304px, 86vw); background: var(--bg);
    transform: translateX(-100%); transition: transform .22s cubic-bezier(.2, .8, .2, 1);
    padding: max(14px, env(safe-area-inset-top)) 12px 12px; border-radius: 0 18px 18px 0;
  }
  .side.open { transform: none; box-shadow: var(--shadow); }
  .side-scroll { margin: 0 -12px; padding: 0 12px; }
  .side-scrim { display: block; position: fixed; inset: 0; z-index: 24; background: var(--scrim); }
  .side-new kbd, .side-search kbd { display: none; }
  .nav { height: 40px; }
  .menu-btn { display: grid; margin-left: -8px; }
  .top { padding: env(safe-area-inset-top) 10px 0 14px; gap: 6px; min-height: 56px; }
  .top-search { width: 34px; padding: 0; justify-content: center; background: transparent; }
  .top-search input { display: none; }
  .top-search.open { position: absolute; left: 10px; right: 10px; width: auto; padding: 0 10px; height: 38px; background: var(--surface); box-shadow: 0 0 0 2px var(--accent-solid); z-index: 2; }
  .top-search.open input { display: block; }
  .seg .seg-label { display: none; }
  .filters { padding: 0 14px 10px; }
  .list { padding: 0 6px 28px; }
  .thead { display: none; }
  .group { margin-top: 10px; }
  .group-head { top: 0; }
  .row { flex-wrap: wrap; row-gap: 0; padding: 11px 10px; min-height: 50px; contain-intrinsic-size: auto 64px; }
  .row-title { flex: 1 1 calc(100% - 40px); display: block; }
  .row-title .ellipsis { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .row-tags { display: none; }
  .row-cells {
    display: flex; align-items: center; gap: 8px; flex: 1 1 100%; padding-left: 35px; margin-top: 6px; overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  }
  .row-cells .cell { width: auto; overflow: visible; }
  .row-cells .cell:empty { display: none; }
  .row .c-field { height: 22px; line-height: 22px; padding: 0 8px; border-radius: 7px; background: var(--hover); font-size: 12px; }
  .row .c-due { order: -2; font-size: 12px; }
  .row .c-area, .row .c-prio { order: -1; }
  .prio { font-size: 12px; }
  .add-row, .more-row { min-height: 46px; }
  .board { padding: 12px 12px 90px; scroll-snap-type: x mandatory; scroll-padding: 0 12px; }
  .col { flex: 0 0 84vw; scroll-snap-align: start; }
  .card { cursor: default; }
  .detail { position: fixed; inset: 0; width: 100%; }
  .wide-btn { display: none; }
  .subtask .icon-btn { opacity: 1; }
  .subtask { padding-top: 8px; padding-bottom: 8px; }
  .detail-top { padding: env(safe-area-inset-top) 8px 0 18px; height: calc(56px + env(safe-area-inset-top)); }
  .detail-body { padding: 4px 18px 40px; }
  .scroll { padding-bottom: 84px; }
  .detail .scroll { padding-bottom: env(safe-area-inset-bottom); }
  .fab {
    display: grid; place-items: center; position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 15;
    width: 56px; height: 56px; border-radius: 18px; background: var(--accent-solid); color: var(--on-accent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 10px 24px -6px color-mix(in srgb, var(--accent-solid) 55%, transparent), var(--shadow-sm);
  }
  .pop-scrim { background: var(--scrim); display: flex; align-items: flex-end; }
  .pop {
    position: static; visibility: visible; width: 100%; max-width: none; max-height: 70dvh;
    border-radius: 20px 20px 0 0; border-width: 1px 0 0; padding-bottom: env(safe-area-inset-bottom);
  }
  .pick-item { min-height: 46px; padding: 6px 12px; }
  /* Modals with a text field sit at the top, where the on-screen keyboard cannot cover them. */
  .modal-scrim { padding: 0; }
  .modal { max-width: none; border-radius: 0 0 20px 20px; border-width: 0 0 1px; max-height: 70dvh; padding-top: env(safe-area-inset-top); }
  .toasts { bottom: calc(88px + env(safe-area-inset-bottom)); }
  .settings { padding: 0 14px 60px; }
  input, textarea { font-size: 16px; } /* stops iOS zooming into focused fields */
}

/* ---- motion: short, opacity and transform only -------------------------- */

@keyframes fade-in { from { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.97); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(18px); } }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-14px); } }

.nav, .chip, .icon-btn, .seg button, .pick-item, .prop, .side-search, .add-row, .more-row, .status-btn { transition: background-color .12s ease, color .12s ease; }
.btn, .side-new, .fab { transition: background-color .12s ease, filter .12s ease, transform .1s ease; }
.btn:active, .side-new:active, .fab:active, .icon-btn:active, .chip:active { transform: scale(.96); }
.status-btn svg { transition: transform .12s ease; }
.status-btn:hover svg { transform: scale(1.14); }
.row-title .ellipsis, .card-title { transition: color .2s ease; }
.top-search, .field, .comment-box, .prop.editable { transition: box-shadow .12s ease, background-color .12s ease; }

/* Rows and cards ease in wherever they appear: on load, when created, when moved to another group. */
.row { transition: background-color .1s ease, opacity .22s ease, transform .22s ease; }
.card { transition: border-color .12s ease, box-shadow .16s ease, opacity .22s ease, transform .16s ease; }
@starting-style {
  .row, .card { opacity: 0; transform: translateY(-5px); }
}

.view-in { animation: rise-in .2s ease-out; }
.detail { animation: slide-in .22s cubic-bezier(.2, .8, .2, 1); }
.detail-content { animation: fade-in .16s ease-out; }
.pop { animation: pop-in .13s ease-out; transform-origin: top center; }
.modal-scrim { animation: fade-in .14s ease-out; }
.modal { animation: pop-in .18s cubic-bezier(.2, .8, .2, 1); }
.toast { animation: rise-in .2s cubic-bezier(.2, .8, .2, 1); }
.drop-line { animation: fade-in .1s ease-out; }
.event { animation: fade-in .2s ease-out; }

@media (max-width: 760px) {
  .side-scrim, .pop-scrim { animation: fade-in .18s ease-out; }
  .pop { animation: sheet-in .24s cubic-bezier(.2, .8, .2, 1); }
  .modal { animation: drop-in .22s cubic-bezier(.2, .8, .2, 1); }
  .detail { animation: rise-in .2s ease-out; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
