/* Task by Kylantis — one stylesheet, tokens from the design file. */

:root {
  --ink: #111111;
  --ink-2: #222222;
  --ink-3: #333333;
  --muted: #555555;
  --faint: #8A8A8A;
  --line: #DADADA;
  --line-2: #E2E2E2;
  --line-3: #EDEDED;
  --bg: #F4F4F4;
  --col-bg: #EAEAEA;
  --surface: #FFFFFF;
  --zebra: #FAFAFA;
  --yellow: #F7C331;
  --yellow-soft: #FCE9AE;
  --yellow-ink: #4A3800;
  --highlight: #FFFBEA;
  --rust: #C2502E;
  --rust-soft: #FBE1D8;
  --rust-ink: #8A2A12;
  --green: #1F3D27;
  --green-soft: #DCEBDF;
  --side-bg: #111111;
  --side-hover: #1E1E1E;
  --side-active: #2A2A2A;
  --side-line: #2E2E2E;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23111' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--ink); }
a:hover { color: var(--muted); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.icon { flex: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 3000; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 6px; }
.skip-link:focus { left: 8px; color: #fff; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.badge { font-size: 11px; background: var(--line-3); color: var(--ink-3); border-radius: 999px; padding: 2px 8px; }

/* ── App shell ──────────────────────────────────────────── */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px; flex: none;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--side-bg); color: #fff;
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 22px;
}
.sb-top { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 17px; font-weight: 800; }
.brand-sub { font-size: 11px; color: #BDBDBD; }
.brand-lg { gap: 12px; }
.brand-lg .brand-name { font-size: 20px; }
.brand-lg .brand-sub { font-size: 12px; }
.sb-toggle { display: none; background: none; border: 0; color: #fff; width: 40px; height: 40px; border-radius: 8px; align-items: center; justify-content: center; }
.sb-toggle:hover { background: var(--side-active); }
.sb-body { display: flex; flex-direction: column; gap: 22px; flex: 1; min-height: 0; }

.sb-nav, .sb-section { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.sb-link, .sb-project {
  display: flex; justify-content: space-between; align-items: center;
  color: #E6E6E6; text-decoration: none; padding: 10px; border-radius: 8px;
  overflow-wrap: anywhere;
}
.sb-link:hover, .sb-project:hover, .sb-list:hover, .sb-archived:hover { background: var(--side-hover); color: #fff; }
.sb-link.is-active, .sb-project.is-active { background: var(--side-active); color: #fff; font-weight: 600; }
.sb-count { font-size: 12px; background: var(--side-line); padding: 1px 8px; border-radius: 999px; font-weight: 500; }
.sb-heading {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 4px 6px 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: #A8A8A8;
}
.sb-add { color: #fff; display: inline-flex; padding: 4px; border-radius: 6px; }
.sb-add:hover { background: var(--side-active); color: #fff; }
.sb-list { color: #CFCFCF; text-decoration: none; padding: 7px 10px 7px 24px; font-size: 13px; border-radius: 8px; overflow-wrap: anywhere; }
.sb-list.is-active { color: #fff; font-weight: 600; }
.sb-list + .sb-project { margin-top: 4px; }
.sb-empty { color: #A8A8A8; font-size: 13px; padding: 0 10px; margin: 0; }
.sb-archived { display: flex; align-items: center; gap: 8px; color: #A8A8A8; text-decoration: none; font-size: 12px; padding: 10px; border-radius: 8px; margin-top: 6px; }
.sb-archived.is-active { color: #fff; }

.sb-foot { margin-top: auto; border-top: 1px solid var(--side-line); padding-top: 12px; }
.sb-menu { position: relative; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; list-style: none; }
.sb-user::-webkit-details-marker { display: none; }
.sb-user:hover, .sb-menu[open] .sb-user { background: var(--side-hover); }
.sb-user-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.sb-user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-sub { font-size: 11px; color: #BDBDBD; }
.sb-menu-pop {
  position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: #fff; color: var(--ink); border-radius: 10px; padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); display: flex; flex-direction: column;
}
.sb-menu-pop a, .sb-menu-pop button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px; border: 0; border-radius: 6px; background: none;
  color: var(--ink); text-decoration: none; text-align: left; font-size: 14px;
}
.sb-menu-pop a:hover, .sb-menu-pop button:hover { background: var(--bg); color: var(--ink); }
.sb-menu-lang { display: flex; gap: 4px; padding: 4px 6px; border-top: 1px solid var(--line-3); border-bottom: 1px solid var(--line-3); margin: 4px 0; }
.sb-menu-pop .sb-menu-lang a { width: auto; flex: 1; justify-content: center; padding: 6px; font-size: 13px; }
.sb-menu-pop .sb-menu-lang a.is-active { font-weight: 700; background: var(--bg); }

.avatar { border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; line-height: 1; letter-spacing: 0; }

.main { flex: 1; min-width: 0; padding: 24px 32px 40px; display: flex; flex-direction: column; gap: 20px; }
.main:focus { outline: none; }

/* ── Page header, tabs, filters ─────────────────────────── */

.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.crumbs { font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.page-title h1 {
  margin: 4px 0 0; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15;
  display: flex; align-items: center; gap: 6px; overflow-wrap: anywhere;
}
.title-gear { color: var(--faint); display: inline-flex; padding: 6px; border-radius: 8px; }
.title-gear:hover { color: var(--ink); background: var(--col-bg); }
.page-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.search {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; color: var(--muted);
}
.search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.search input { border: 0; outline: 0; font-size: 14px; width: 180px; background: transparent; color: var(--ink); }

.tabs-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; font-size: 14px; }
.tab { text-decoration: none; color: var(--muted); padding: 12px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); font-weight: 700; border-bottom-color: var(--ink); }
.tabs-extra { padding-bottom: 8px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }

.pill-select {
  display: inline-flex; align-items: center; gap: 4px; height: 36px;
  padding: 0 0 0 12px; font-size: 13px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
}
.pill-select:focus-within { border-color: var(--ink); }
.pill-select select {
  appearance: none; -webkit-appearance: none; border: 0; outline: 0; height: 34px; max-width: 170px;
  padding: 0 28px 0 0; font-size: 13px; font-weight: 600; cursor: pointer;
  background: transparent var(--chevron) no-repeat right 10px center;
}

.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--ink-3); }
.legend > span { display: flex; align-items: center; gap: 6px; }
.legend .diamond { margin: 0 2px 0 0; width: 9px; height: 9px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.seg { display: flex; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; height: 44px; }
.seg a { display: flex; align-items: center; padding: 0 14px; font-size: 13px; text-decoration: none; color: var(--ink); }
.seg a + a { border-left: 1px solid var(--line-3); }
.seg a:hover { background: var(--bg); color: var(--ink); }
.seg a.is-active { background: var(--ink); color: #fff; }
.seg-nav a { padding: 0 11px; }

.view-hint { font-size: 12px; color: var(--muted); margin: 0; }
.empty-search { color: var(--muted); font-size: 14px; margin: 0; }

/* ── Buttons ────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid transparent;
  font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.btn-yellow { background: var(--yellow); color: var(--ink); }
.btn-yellow:hover { background: #EDB61C; color: var(--ink); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #2E2E2E; color: #fff; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); font-weight: 500; }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-danger { background: var(--rust-ink); color: #fff; }
.btn-danger:hover { background: #6E200D; color: #fff; }
.btn-danger-text { color: var(--rust-ink); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; height: 52px; font-size: 16px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 6px; border: 0; background: none; color: var(--muted);
}
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.icon-btn:disabled { opacity: 0.3; cursor: default; background: none; }
.icon-btn-sm { width: 28px; height: 28px; }
.btn-mini { font-size: 12px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; white-space: nowrap; }
.btn-mini:hover { border-color: var(--ink); }
.link-danger {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; color: var(--rust-ink); font-size: 13px; padding: 6px 4px;
}
.link-danger:hover { text-decoration: underline; }

/* ── Tags, pills, avatars ───────────────────────────────── */

.tag { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.tag-grey   { background: var(--line-3); color: var(--ink-3); }
.tag-yellow { background: var(--yellow-soft); color: var(--yellow-ink); }
.tag-green  { background: var(--green-soft); color: var(--green); }
.tag-rust   { background: var(--rust-soft); color: var(--rust-ink); }
.tag-blue   { background: #DCE6F2; color: #1F3A5C; }
.tag-lilac  { background: #E8E0F0; color: #45306B; }
.tag-swatch { width: 14px; height: 14px; padding: 0; border-radius: 4px; flex: none; }

.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st-todo        { background: var(--line-3); color: var(--ink-3); }
.st-in_progress { background: var(--yellow-soft); color: var(--yellow-ink); }
.st-blocked     { background: var(--rust-soft); color: var(--rust-ink); }
.st-done        { background: var(--green-soft); color: var(--green); }

.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot-todo { background: var(--faint); }
.dot-in_progress { background: var(--yellow); }
.dot-blocked { background: var(--rust); }
.dot-done { background: var(--green); }

.bar-todo { background: #CFCFCF; color: var(--ink); }
.bar-in_progress { background: var(--yellow); color: var(--ink); }
.bar-blocked { background: var(--rust); color: #fff; }
.bar-done { background: var(--green); color: #fff; }

.diamond { display: inline-block; width: 9px; height: 9px; background: var(--ink); transform: rotate(45deg); margin: 0 9px 0 1px; vertical-align: 1px; flex: none; }
.diamond-lg { width: 14px; height: 14px; margin: 0; }

.who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.who-name { display: block; font-weight: 600; }
.who-sub { display: block; font-size: 12px; color: var(--muted); }

/* ── Board ──────────────────────────────────────────────── */

.board-scroll { overflow-x: auto; padding-bottom: 4px; }
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 16px; min-width: 1000px; align-items: start; }
.column { background: var(--col-bg); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 2px; font-size: 13px; font-weight: 700; }
.col-name { display: flex; align-items: center; gap: 8px; }
.col-count { color: var(--muted); font-weight: 500; }
.col-cards { display: flex; flex-direction: column; gap: 10px; min-height: 44px; border-radius: 10px; transition: background 0.12s; }
.col-cards.is-over { background: rgba(0, 0, 0, 0.045); }

.card {
  display: flex; flex-direction: column; gap: 10px; padding: 14px;
  background: #fff; color: var(--ink); text-decoration: none; border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.card:hover { color: var(--ink); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); }
.card:focus-visible { outline: 2px solid var(--ink); outline-offset: 0; }
.card.is-done { color: var(--muted); box-shadow: none; }
.card.is-done .card-title { text-decoration: line-through; }
.card.is-flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 3px var(--yellow); } to { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); } }
.card-title { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.card-sub { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.progress { display: block; height: 4px; background: var(--line-3); border-radius: 4px; }
.progress > span { display: block; height: 4px; background: var(--ink); border-radius: 4px; }
.card-note { font-size: 12px; color: var(--rust-ink); background: var(--rust-soft); padding: 6px 8px; border-radius: 6px; overflow-wrap: anywhere; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; }
.card-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); white-space: nowrap; }
.card-meta.is-hot { color: var(--rust-ink); font-weight: 600; }

.card-placeholder { border: 2px dashed #BDBDBD; border-radius: 10px; background: rgba(255, 255, 255, 0.45); }
.drag-ghost {
  position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; margin: 0;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22); opacity: 0.96; cursor: grabbing;
}
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }

.add-card {
  font-size: 13px; color: var(--ink-3); background: none; text-align: left;
  border: 1px dashed #BDBDBD; border-radius: 10px; padding: 12px;
}
.add-card:hover { border-color: var(--ink); color: var(--ink); background: rgba(255, 255, 255, 0.5); }
.add-card-form input {
  width: 100%; font-size: 14px; padding: 12px; border: 1px solid var(--ink); border-radius: 10px; background: #fff; outline: none;
}

/* ── List view ──────────────────────────────────────────── */

.table-card { background: #fff; border: 1px solid var(--line-2); border-radius: 12px; overflow-x: auto; }
.task-table { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 14px; text-align: left; }
.task-table:focus { outline: none; }
.task-table:focus-visible .row.is-active { box-shadow: inset 3px 0 0 var(--ink); }
.task-table thead th {
  padding: 12px; font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
.task-table th:first-child, .task-table td:first-child { padding-left: 20px; }
.task-table th:last-child, .task-table td:last-child { padding-right: 20px; }
.task-table td { padding: 12px; border-bottom: 1px solid var(--line-3); vertical-align: middle; }
.task-table .c-title { width: 40%; }
.task-table .c-title a { text-decoration: none; font-weight: 600; overflow-wrap: anywhere; }
.group-head th {
  padding: 12px 20px; background: var(--zebra); border-bottom: 1px solid var(--line-3);
  font-weight: 700; font-size: 14px; text-align: left;
}
.group-count { font-weight: 400; color: var(--muted); }
.row { cursor: default; }
.row:hover { background: #FCFCFC; }
.row.is-active { background: var(--highlight); box-shadow: inset 3px 0 0 var(--ink); }
.row td.is-cell { box-shadow: inset 0 0 0 2px var(--ink); border-radius: 4px; }
.row.is-done .c-title a { color: var(--muted); text-decoration: line-through; }
.row.is-done .c-due { color: var(--muted); }
.row.is-saving { opacity: 0.55; }
.c-due { white-space: nowrap; }
.c-due.is-hot { color: var(--rust-ink); font-weight: 600; }
.c-sub { color: var(--muted); white-space: nowrap; }
.cell-editor {
  width: 100%; min-width: 130px; height: 34px; font-size: 14px; padding: 0 8px;
  border: 1px solid var(--ink); border-radius: 6px; background: #fff; outline: none;
}
.quick-add td { padding: 10px 20px; border-bottom: 0; }
.quick-add-form { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.qa-plus { font-size: 18px; line-height: 1; }
.quick-add-form input[type="text"] { flex: 1; min-width: 0; border: 0; outline: 0; font-size: 14px; padding: 8px 0; background: transparent; color: var(--ink); }
.qa-list select { height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; font-size: 12px; background: #fff; max-width: 180px; }
.empty-row td { color: var(--muted); text-align: center; padding: 28px 20px; }
.kbd-hints { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 12px; color: var(--muted); }
kbd { font-family: inherit; font-size: 12px; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px; }

/* ── Gantt ──────────────────────────────────────────────── */

.gantt-card { background: #fff; border: 1px solid var(--line-2); border-radius: 12px; overflow-x: auto; }
.gantt { --label-w: 240px; position: relative; min-width: 980px; font-size: 13px; }
.g-row {
  display: grid; grid-template-columns: var(--label-w) minmax(0, 1fr); min-height: 48px;
  background: #fff; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-3);
}
.g-row:last-child { border-bottom: 0; }
.g-label {
  position: sticky; left: 0; z-index: 3; background: inherit;
  display: flex; align-items: center; min-width: 0;
  padding: 0 20px 0 36px; border-right: 1px solid var(--line-2);
}
.g-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-head { min-height: 0; font-weight: 600; border-bottom: 0; }
.g-head .g-label { padding: 14px 20px 0; color: var(--muted); }
.g-head-2 { font-size: 11px; color: var(--muted); font-weight: 400; border-bottom: 1px solid var(--line-2); }
.g-head-2 .g-label { padding: 0; }
.g-scale { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
.g-band { padding: 10px 12px 2px; border-left: 1px solid var(--line-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-band:first-child { border-left: 0; }
.g-tick { padding: 6px 12px; }
.g-tick.is-now { color: var(--ink); font-weight: 700; }
.g-list { background: var(--zebra); min-height: 44px; }
.g-list .g-label { padding-left: 20px; font-weight: 700; }
.g-list .g-label a { text-decoration: none; overflow-wrap: anywhere; }
.g-task:hover { background: #FCFCFC; color: var(--ink); }
.g-task:hover .g-title { text-decoration: underline; }
.g-task.is-done .g-title { color: var(--muted); text-decoration: line-through; }
.g-track {
  position: relative; min-height: 44px;
  background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(100% / var(--cols) - 1px), #F1F1F1 calc(100% / var(--cols) - 1px), #F1F1F1 calc(100% / var(--cols)));
}
.g-sum { position: absolute; top: 50%; height: 8px; margin-top: -4px; background: var(--ink); border-radius: 4px; min-width: 4px; }
.g-bar {
  position: absolute; top: 50%; height: 26px; margin-top: -13px; min-width: 6px;
  display: flex; align-items: center; padding: 0 8px; overflow: hidden; white-space: nowrap;
  border-radius: 6px; font-size: 11px; font-weight: 600;
}
.g-bar.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.g-bar.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.g-bar-label { overflow: hidden; text-overflow: ellipsis; }
.g-bar-out { position: absolute; top: 50%; transform: translateY(-50%); padding: 0 6px; font-size: 11px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.g-milestone { position: absolute; top: 50%; transform: translate(-7px, -50%); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.g-milestone.flip { flex-direction: row-reverse; transform: translate(calc(-100% + 7px), -50%); }
.g-ms-label { font-size: 11px; font-weight: 700; }
.g-none { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--faint); }
.g-off { position: absolute; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.g-off-before { left: 8px; }
.g-off-after { right: 8px; }
.g-today {
  position: absolute; top: 0; bottom: 0; z-index: 2; width: 2px; margin-left: -1px; pointer-events: none;
  left: calc(var(--label-w) + (100% - var(--label-w)) * var(--x)); background: var(--ink);
}
.g-today span {
  position: absolute; top: 4px; left: 0;
  font-size: 11px; font-weight: 700; background: var(--ink); color: #fff; padding: 2px 6px; border-radius: 0 4px 4px 0; white-space: nowrap;
}

/* ── Task detail ────────────────────────────────────────── */

.task-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.task-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.back-link { display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px 10px 0; color: var(--ink); font-weight: 600; text-decoration: none; }
.task-actions { display: flex; gap: 8px; }

.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 230px;
  display: flex; flex-direction: column; padding: 6px;
  background: #fff; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.menu-pop button { display: flex; align-items: center; gap: 10px; padding: 10px; border: 0; background: none; border-radius: 6px; text-align: left; font-size: 14px; }
.menu-pop button:hover { background: var(--bg); }
.menu-pop button.is-current { font-weight: 600; }
.menu-pop button .icon { margin-left: auto; }

.panel { background: #fff; border: 1px solid var(--line-2); border-radius: 12px; padding: 22px; }
.panel h2 { margin: 0 0 14px; font-size: 18px; font-weight: 700; }
.panel > p.muted { margin: -6px 0 16px; font-size: 13px; line-height: 1.55; }

.task-layout { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.task-main { flex: 999 1 520px; min-width: 0; padding: 28px 32px; display: flex; flex-direction: column; gap: 24px; }
.task-side { flex: 1 1 290px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.title-input {
  display: block; width: calc(100% + 12px); margin: -4px -6px; padding: 4px 6px;
  border: 0; border-radius: 8px; background: transparent; resize: none; overflow: hidden;
  font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2;
}
.title-input:hover { background: var(--zebra); }
.title-input:focus { outline: 2px solid var(--ink); background: #fff; }
.title-input.is-done { text-decoration: line-through; color: var(--muted); }

.canvas { position: relative; border: 1px solid var(--line-2); border-radius: 10px; }
.canvas.is-editing { border-color: var(--ink); }
.canvas-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line-3); }
.canvas-toolbar button { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: 0; background: none; border-radius: 6px; font-size: 14px; }
.canvas-toolbar button b { font-weight: 800; }
.canvas-toolbar button:hover { background: var(--bg); }
.canvas-status { margin-left: auto; font-size: 12px; color: var(--muted); padding-right: 10px; }
.canvas-label { font-size: 12px; color: var(--muted); padding-right: 8px; }
.canvas-view { padding: 18px 20px; min-height: 110px; font-size: 15px; line-height: 1.75; color: var(--ink-2); cursor: text; border-radius: 0 0 10px 10px; overflow-wrap: anywhere; }
.canvas-view:hover { background: #FCFCFC; }
.canvas-view .placeholder { color: var(--faint); margin: 0; }
.canvas-edit {
  display: block; width: 100%; min-height: 220px; padding: 18px 20px; border: 0; outline: 0; resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; line-height: 1.7;
  background: #fff; border-radius: 0 0 10px 10px;
}
.md p { margin: 0 0 10px; }
.md > :last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md h3, .md h4, .md h5 { margin: 14px 0 6px; line-height: 1.3; }
.md h3 { font-size: 18px; } .md h4 { font-size: 16px; } .md h5 { font-size: 15px; }
.md pre {
  margin: 12px 0; padding: 10px 12px; background: var(--bg); border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-x: auto;
}
.md code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em; background: var(--bg); border-radius: 4px; padding: 1px 5px; }
.md pre code { background: none; padding: 0; font-size: inherit; }
.md blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 3px solid var(--line); color: var(--muted); }
.md a { text-decoration: underline; }

.files { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 18px; }
.file-chip { display: inline-flex; align-items: center; max-width: 100%; border: 1px solid var(--line-2); border-radius: 8px; font-size: 13px; background: #fff; }
.file-chip a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 2px 8px 12px; text-decoration: none; min-width: 0; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.file-size { color: var(--muted); white-space: nowrap; }
.file-del { display: flex; padding: 8px 10px 8px 6px; border: 0; background: none; color: var(--faint); }
.file-del:hover { color: var(--rust-ink); }
.file-chip.is-uploading { opacity: 0.6; padding: 8px 12px; gap: 8px; }
.drop-hint {
  display: none; position: absolute; inset: 0; z-index: 5; align-items: center; justify-content: center;
  background: rgba(255, 251, 234, 0.94); border: 2px dashed var(--ink); border-radius: 10px; font-weight: 700;
}
.canvas.is-dropping .drop-hint { display: flex; }

.sub-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.sub-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.sub-head h2 .muted { font-weight: 400; font-size: 14px; }
.sub-lock { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.sub-list { display: flex; flex-direction: column; margin-top: 12px; border: 1px solid var(--line-2); border-radius: 10px; }
.sub-row { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--line-3); }
.sub-row input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); flex: none; }
.sub-title { flex: 1; font-size: 15px; overflow-wrap: anywhere; cursor: pointer; }
.sub-row.is-done .sub-title { color: var(--muted); text-decoration: line-through; }
.sub-row .icon-btn-sm { opacity: 0.45; }
.sub-row:hover .icon-btn-sm, .sub-row .icon-btn-sm:focus-visible { opacity: 1; }
.sub-add { display: flex; align-items: center; gap: 12px; padding: 6px 14px; color: var(--muted); }
.sub-plus { width: 18px; text-align: center; font-size: 18px; }
.sub-add input { flex: 1; min-width: 0; border: 0; outline: 0; font-size: 15px; padding: 8px 0; background: transparent; color: var(--ink); }

.side-fields { display: flex; flex-direction: column; gap: 18px; }
.side-fields .field > label, .side-fields .field-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.side-fields .field-row { grid-template-columns: 1fr; gap: 18px; }
.side-value { font-size: 14px; }
.owner-select { position: relative; display: flex; align-items: center; }
.owner-select #ownerAvatar { position: absolute; left: 10px; display: flex; pointer-events: none; }
.field .owner-select select { padding-left: 46px; min-height: 44px; }
.field select.status-select { font-weight: 600; border-color: transparent; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }
.hint-inline { display: block; font-size: 12px; color: var(--muted); }

.nudge-card { background: var(--green); color: #fff; border-radius: 12px; padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.nudge-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.nudge-title { font-size: 20px; font-weight: 800; line-height: 1.2; }
.nudge-text { margin: 0; font-size: 13px; line-height: 1.6; color: #E6EFE8; }
.nudge-bars { display: flex; gap: 6px; margin-top: 4px; }
.nudge-bars span { flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.3); }
.nudge-bars span.is-on { background: var(--yellow); }
.nudge-labels { display: flex; justify-content: space-between; font-size: 11px; color: #D5E3D8; }
.nudge-labels .is-on { color: #fff; font-weight: 700; }
.task-meta { font-size: 12px; color: var(--muted); padding: 0 4px; }

/* ── Forms ──────────────────────────────────────────────── */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; }
.field > label, .field-label, .field > legend { font-size: 14px; font-weight: 600; }
.field input[type="text"], .field input[type="email"], .field input[type="password"],
.field input[type="date"], .field input[type="search"], .field select, .field textarea {
  width: 100%; height: 44px; padding: 0 12px; font-size: 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
}
.field textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.field select { appearance: none; -webkit-appearance: none; background: #fff var(--chevron) no-repeat right 12px center; padding-right: 32px; }
.field select.st-todo { background-color: var(--line-3); }
.field select.st-in_progress { background-color: var(--yellow-soft); }
.field select.st-blocked { background-color: var(--rust-soft); }
.field select.st-done { background-color: var(--green-soft); }
.field input:focus, .field select:focus, .field textarea:focus,
.list-row-main input:focus, .list-add input:focus, .copy-row input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.field-head a { font-size: 13px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-check { justify-content: flex-end; padding-bottom: 12px; }
.hint { margin: 0; font-size: 12px; color: var(--muted); }
.opt { font-weight: 400; color: var(--faint); }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.form-error { margin: 0; font-size: 13px; color: var(--rust-ink); }
.form-narrow { max-width: 560px; display: flex; flex-direction: column; gap: 16px; }

.flash { padding: 12px 16px; border-radius: 10px; font-size: 14px; line-height: 1.5; }
.flash-ok { background: var(--green-soft); color: var(--green); }
.flash-error { background: var(--rust-soft); color: var(--rust-ink); }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 2000; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px);
  padding: 11px 16px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}
.toast.is-error { background: var(--rust-ink); }
.toast a { color: var(--yellow); font-weight: 700; }

.dialog {
  width: min(540px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0;
  border: 0; border-radius: 14px; color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.dialog::backdrop { background: rgba(17, 17, 17, 0.45); }
.dialog-form { display: flex; flex-direction: column; gap: 16px; padding: 24px; }
.dialog h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* ── Settings, people, archive ──────────────────────────── */

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; align-items: start; }
.settings-grid-wide { display: flex; flex-direction: column; align-items: stretch; }
.panel > form.invite-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); align-items: end; gap: 12px; }
.invite-form .form-actions { align-self: end; }
.invite-form .btn { width: 100%; }
.panel > form:not(.list-add):not(.invite-form) { display: flex; flex-direction: column; gap: 16px; }
.panel-danger { border-color: #F0C9BC; }
.panel-flush { padding: 0; }
.panel-pad { padding: 22px 22px 8px; }

.list-rows { display: flex; flex-direction: column; border: 1px solid var(--line-3); border-radius: 10px; margin-bottom: 12px; }
.list-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line-3); }
.list-row:last-child { border-bottom: 0; }
.list-row-main { display: flex; align-items: center; gap: 8px; flex: 1 1 340px; min-width: 0; }
.list-row-main input[type="text"], .list-add input[type="text"] { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; }
.list-row-main select, .list-add select, .list-delete-pop select { height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.list-row-tools { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.list-row-tools form { display: flex; }
.list-row-tools .small { margin-right: 6px; }
.list-delete { position: relative; }
.list-delete > summary { list-style: none; }
.list-delete > summary::-webkit-details-marker { display: none; }
.list-delete-pop {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 10; width: 250px;
  display: flex; flex-direction: column; gap: 10px; padding: 12px;
  background: #fff; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.list-delete-pop label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.list-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.list-add input[type="text"] { flex: 1 1 180px; }

.table-scroll { overflow-x: auto; }
.people-table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 14px; }
.people-table th { padding: 10px 12px; font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--line-2); }
.people-table th:first-child, .people-table td:first-child { padding-left: 22px; }
.people-table td { padding: 12px; border-bottom: 1px solid var(--line-3); vertical-align: middle; }
.people-table tr:last-child td { border-bottom: 0; }
.people-table tr.is-off { opacity: 0.6; }
.people-table .pill + .who-sub { margin-top: 4px; }
.row-actions form { display: flex; flex-wrap: nowrap; justify-content: flex-end; gap: 6px; }
.row-actions { width: 1%; white-space: nowrap; }
.people-table .who-sub { white-space: nowrap; }
.link-box p { margin: 0; line-height: 1.5; }
.copy-row { display: flex; gap: 8px; margin-top: 10px; }
.copy-row input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; font-size: 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--zebra); }

.swatches { border: 0; padding: 0; flex-direction: row; flex-wrap: wrap; gap: 6px; }
.swatches legend { width: 100%; margin-bottom: 6px; padding: 0; }
.swatch-pick { position: relative; display: inline-flex; padding: 3px; border: 2px solid transparent; border-radius: 50%; cursor: pointer; }
.swatch-pick input { position: absolute; opacity: 0; pointer-events: none; }
.swatch-pick:has(input:checked) { border-color: var(--ink); }
.swatch-pick:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.plain-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 0 0 12px; }
.plain-table th, .plain-table td { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line-3); vertical-align: top; }
.plain-table th { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.archive-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.archive-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; }
.archive-name { font-size: 16px; font-weight: 700; text-decoration: none; }
.empty-state { text-align: center; padding: 40px 24px; }
.empty-state h2 { margin: 0 0 6px; }
.empty-state p { margin: 0 auto; max-width: 440px; line-height: 1.6; }

/* ── My tasks ───────────────────────────────────────────── */

.my-summary { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--muted); }
.my-summary strong { color: var(--ink); }
.my-groups { display: flex; flex-direction: column; gap: 22px; }
.my-group h2 { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.my-overdue h2 { color: var(--rust-ink); }
.my-list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; }
.my-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line-3); }
.my-row:last-child { border-bottom: 0; }
.my-check { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); flex: none; }
.my-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.my-title { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.my-where { font-size: 12px; color: var(--muted); }
.my-due { font-size: 13px; color: var(--muted); white-space: nowrap; }
.my-due.is-hot { color: var(--rust-ink); font-weight: 600; }
.my-row.is-done .my-title { color: var(--muted); text-decoration: line-through; }

/* ── Sign in ────────────────────────────────────────────── */

.auth-body { background: #fff; }
.auth { display: flex; flex-wrap: wrap; min-height: 100vh; }
.auth-brand { flex: 1 1 420px; display: flex; flex-direction: column; gap: 40px; padding: 48px 56px; background: var(--ink); color: #fff; }
.auth-hero { margin-top: auto; }
.auth-hero h1 { margin: 0; font-size: clamp(36px, 4vw, 52px); line-height: 1.08; font-weight: 800; letter-spacing: -0.02em; }
.auth-hero p { margin: 20px 0 0; max-width: 380px; font-size: 16px; line-height: 1.6; font-weight: 300; color: #E2E2E2; }
.auth-legal { font-size: 12px; color: #A8A8A8; }
.auth-main { flex: 999 1 480px; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-box { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 20px; }
.auth-form { display: flex; flex-direction: column; gap: 20px; }
.auth-form h2 { margin: 0; font-size: 32px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.auth-lead { margin: 8px 0 0; font-size: 15px; color: var(--muted); line-height: 1.5; }
.auth-form .field { gap: 8px; }
.auth-form .field input { height: auto; padding: 14px 16px; font-size: 16px; border-color: #CFCFCF; }
.auth-note { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.lang-switch { display: flex; justify-content: center; gap: 4px; margin-top: 12px; }
.lang-switch a { padding: 6px 12px; border: 1px solid transparent; border-radius: 6px; font-size: 13px; text-decoration: none; }
.lang-switch a.is-active { font-weight: 700; background: var(--bg); border-color: var(--line); }

.plain-body { background: var(--bg); }
.plain-page { max-width: 520px; margin: 12vh auto; padding: 0 24px; }
.plain-brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 28px; font-size: 18px; font-weight: 800; text-decoration: none; }
.plain-page h1 { margin: 0 0 8px; font-size: 28px; font-weight: 800; letter-spacing: -0.01em; }
.plain-page p { color: var(--muted); line-height: 1.6; }

/* ── Small screens ──────────────────────────────────────── */

@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: sticky; top: 0; z-index: 50; padding: 10px 12px; gap: 0; overflow: visible; }
  .sb-toggle { display: inline-flex; }
  .sb-body { display: none; padding-top: 14px; max-height: calc(100vh - 64px); overflow-y: auto; }
  .sidebar.is-open .sb-body { display: flex; }
  .sb-menu-pop { bottom: auto; top: calc(100% + 6px); }
  .main { padding: 20px 16px 32px; gap: 16px; }
  .page-title h1, .title-input { font-size: 24px; }
  .task-main { padding: 20px; }
  .gantt { --label-w: 170px; }
  .g-label { padding-left: 16px; }
  .g-list .g-label { padding-left: 12px; }
  .auth-brand { padding: 32px 28px; gap: 28px; }
}

@media (max-width: 600px) {
  .page-tools { width: 100%; }
  .page-tools .search { flex: 1; }
  .search input { width: 100%; }
  .tabs-extra { width: 100%; }
  .field-row { grid-template-columns: 1fr; }
  .field-check { padding-bottom: 0; }
  .auth-brand { flex-basis: 100%; }
  .auth-hero h1 { font-size: 30px; }
  .auth-hero p { font-size: 15px; margin-top: 12px; }
  .auth-main { padding: 32px 16px 40px; }
  .task-actions { width: 100%; }
  .task-actions > * { flex: 1; }
  .task-actions .menu > summary { width: 100%; }
  .menu-pop { left: 0; right: auto; }
  .dialog-form { padding: 20px; }
  .my-row { flex-wrap: wrap; row-gap: 6px; }
  .my-row .my-due { margin-left: 32px; }
  .archive-item { flex-wrap: wrap; }
  .sub-row { flex-wrap: wrap; }
  .sub-row .sub-title { flex-basis: calc(100% - 70px); }
  .sub-row .btn-mini { margin-left: 30px; }
}

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