[hidden] { display: none !important; }
:root {
  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --surface-raised: #FFFFFF;
  --subtle: #F6F2EB;
  --sand: #F1ECE3;
  --text: #2B2724;
  --text-strong: rgb(43 39 36 / 88%);
  --text-muted: rgb(43 39 36 / 60%);
  --text-tertiary: rgb(43 39 36 / 40%);
  --border: rgb(90 64 36 / 11%);
  --border-strong: rgb(90 64 36 / 17%);
  --accent: #3E9B6E;
  --accent-hover: #348760;
  --accent-fg: #FFFFFF;
  --accent-subtle: #EBF6EF;
  --primary-action: var(--accent);
  --primary-action-fg: var(--accent-fg);
  --danger: #D9534F;
  --danger-subtle: #FCEBEA;
  --warning-fg: #9A6300;
  --warning-subtle: #FDF1D8;
  --progress-fg: #2F6DA8;
  --progress-subtle: #E7F0F9;
  --waiting-fg: #7A55A8;
  --waiting-subtle: #F2ECF9;
  --radius: 14px;
  --radius-pill: 999px;
  --font: Figtree, "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shadow-card: 0 1px 2px rgb(90 64 36 / 5%), 0 6px 20px rgb(90 64 36 / 5%);
  --shadow-floating: 0 10px 30px rgb(90 64 36 / 14%);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.45 var(--font);
    -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.page { max-width: 1080px; margin: 0 auto; padding: 20px 20px 40px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand h1 { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: -0.02em; }
.today { color: var(--text-muted); white-space: nowrap; }
.top-actions { display: flex; gap: 6px; }

.btn, .pill {
  height: 32px; padding: 0 12px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong); background: var(--surface-raised); font-weight: 600; font-size: 13px; white-space: nowrap;
}
.btn:hover, .pill:hover { background: var(--subtle); }
.btn.icon { width: 32px; padding: 0; }
select.pill {
  appearance: none; padding-right: 28px; max-width: 180px; field-sizing: content; text-overflow: ellipsis;
  background: var(--surface-raised) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23191919' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 11px center;
}
select.pill.active, .pill.toggle[aria-pressed="true"] { border-color: var(--accent); background-color: var(--accent-subtle); }

.help {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 12px; display: grid; gap: 6px; color: var(--text-muted);
}
kbd {
  font: 500 12px var(--mono); color: var(--text); background: var(--subtle);
  border: 1px solid var(--border); border-radius: 4px; padding: 0 4px;
}

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; position: relative; }
.search {
  height: 32px; width: 120px; padding: 0 12px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong); background: var(--surface);
}
.chips {
  display: flex; padding: 2px; gap: 2px; border-radius: var(--radius-pill);
  background: var(--sand); border: 1px solid var(--border);
}
.chips button {
  height: 28px; padding: 0 10px; border: 0; border-radius: var(--radius-pill);
  background: transparent; font-size: 13px; font-weight: 600; color: var(--text-muted); white-space: nowrap;
}
.chips button[aria-pressed="true"] { background: var(--surface-raised); color: var(--text); box-shadow: 0 0 0 1px var(--border-strong); }
.group-by { display: flex; align-items: center; gap: 6px; margin-left: auto; color: var(--text-muted); font-size: 13px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 6px 0 10px; min-height: 120px;
}

.group + .group { margin-top: 6px; }
.group-head {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px 4px 10px; min-height: 36px;
}
.group-head .caret {
  width: 22px; height: 22px; border: 0; background: none; border-radius: 6px; color: var(--text-tertiary);
  display: grid; place-items: center; flex: none;
}
.group-head .caret:hover { background: var(--subtle); color: var(--text); }
.group-head .caret svg { transition: transform .12s; }
.group.collapsed .caret svg { transform: rotate(-90deg); }
.group-title { font-weight: 700; font-size: 16px; letter-spacing: -0.015em; min-width: 0; overflow-wrap: anywhere; }
.group-title.muted { color: var(--text-muted); font-weight: 600; }
.group-title.danger { color: var(--text); }
.group-title.danger::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); margin-right: 7px; vertical-align: 2px; }
.count { font: 500 12px var(--mono); color: var(--text-tertiary); }
.group-tools { margin-left: auto; display: flex; gap: 2px; opacity: 0; transition: opacity .1s; }
.group-head:hover .group-tools, .group-head:focus-within .group-tools { opacity: 1; }
.tool {
  height: 26px; padding: 0 8px; border: 0; background: none; border-radius: 6px;
  color: var(--text-muted); font-size: 12px; font-weight: 600;
}
.tool:hover { background: var(--subtle); color: var(--text); }
.rename {
  font-weight: 700; font-size: 15px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 2px 8px; background: var(--surface-raised); min-width: 0; width: 280px; max-width: 100%;
}
.group.collapsed .rows, .group.collapsed .add { display: none; }
.group.drop-target > .group-head { box-shadow: inset 0 -2px 0 var(--accent); }

.row {
  --indent: 0;
  display: grid; grid-template-columns: 16px 20px minmax(0, 1fr) auto 26px;
  align-items: center; gap: 6px; padding: 3px 10px 3px calc(8px + var(--indent) * 24px);
  min-height: 38px; position: relative;
}
.row:hover { background: color-mix(in srgb, var(--subtle) 70%, transparent); }
.row.editing { background: var(--accent-subtle); }
.row.dragging { opacity: .4; }
.row.drop-before::before, .row.drop-after::after {
  content: ""; position: absolute; left: 10px; right: 10px; height: 2px; background: var(--accent); border-radius: 2px;
}
.row.drop-before::before { top: -1px; }
.row.drop-after::after { bottom: -1px; }

.handle {
  width: 16px; height: 22px; color: var(--text-tertiary); opacity: 0; cursor: grab;
  display: grid; place-items: center; border-radius: 4px;
}
.row:hover .handle { opacity: 1; }
.handle.off { visibility: hidden; }

.check {
  width: 18px; height: 18px; border-radius: 50%; padding: 0; border: 1.5px solid var(--text-tertiary);
  background: var(--surface-raised); display: grid; place-items: center; color: transparent;
}
.check:hover { border-color: var(--accent); }
.check[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }

.text, .edit, .add-input {
  font-size: 15px; line-height: 20px; padding: 4px 6px; margin: 0; border-radius: 6px; min-width: 0; overflow-wrap: anywhere;
}
.text { cursor: text; white-space: pre-wrap; }
.text a { color: inherit; text-decoration: underline; text-decoration-color: var(--text-tertiary); }
.text .empty { color: var(--text-tertiary); }
.row.done .text { color: var(--text-tertiary); text-decoration: line-through; text-decoration-color: var(--text-tertiary); }
.edit, .add-input { width: 100%; border: 0; background: transparent; outline: none; }
.edit::placeholder, .add-input::placeholder { color: var(--text-tertiary); }

.meta { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.meta > span { display: inline-flex; align-items: center; }
.client {
  height: 22px; padding: 0 9px; border-radius: var(--radius-pill); background: hsl(var(--h, 30) 70% 93%);
  border: 0; font-size: 12px; font-weight: 600; color: hsl(var(--h, 30) 45% 30%);
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer;
}
.owner { gap: 5px; font-size: 12px; font-weight: 600; color: var(--text-muted); cursor: pointer; white-space: nowrap; }
.avatar {
  width: 20px; height: 20px; border-radius: 50%; background: hsl(var(--h, 30) 40% 48%); color: #fff;
  font-size: 10px; font-weight: 700; display: grid; place-items: center; text-transform: uppercase; flex: none;
}
.due { font-size: 12px; font-weight: 600; color: var(--text-muted); white-space: nowrap; min-width: 62px; justify-content: flex-end; cursor: pointer; }
.due.today, .due.overdue { height: 22px; padding: 0 9px; border-radius: var(--radius-pill); min-width: 0; }
.due.today { color: var(--warning-fg); background: var(--warning-subtle); }
.due.overdue { color: var(--danger); background: var(--danger-subtle); }
.status {
  height: 22px; padding: 0 9px 0 8px; gap: 5px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status[data-st="progress"] { color: var(--progress-fg); background: var(--progress-subtle); }
.status[data-st="blocked"] { color: var(--danger); background: var(--danger-subtle); }
.status[data-st="waiting"] { color: var(--waiting-fg); background: var(--waiting-subtle); }
.st-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; flex: none; box-sizing: border-box; }
.st-dot[data-st="progress"] { background: var(--progress-fg); }
.st-dot[data-st="blocked"] { background: var(--danger); }
.st-dot[data-st="waiting"] { background: var(--waiting-fg); }
.st-dot[data-st="todo"] { border: 1.5px solid var(--text-tertiary); }
.st-dot[data-st="done"] { background: var(--accent); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: hsl(var(--h, 30) 55% 62%); margin-right: 8px; vertical-align: 0; }
.row.done .meta { opacity: .55; }

.del {
  width: 26px; height: 26px; border: 0; background: none; border-radius: 6px; color: var(--text-tertiary);
  opacity: 0; display: grid; place-items: center;
}
.row:hover .del, .row.editing .del { opacity: 1; }
.del:hover { background: var(--subtle); color: var(--text); }

.add { display: grid; grid-template-columns: 16px 20px minmax(0, 1fr); gap: 6px; align-items: center; padding: 2px 10px 2px 8px; min-height: 34px; }
.add .plus { grid-column: 2; color: var(--text-tertiary); display: grid; place-items: center; }
.add-input { grid-column: 3; }
.add.lone { padding-top: 10px; padding-bottom: 10px; }

.empty-note { padding: 14px 18px; color: var(--text-muted); }
.new-section { margin: 10px 14px 0 12px; }

.suggest {
  position: fixed; z-index: 20; margin: 0; padding: 4px; list-style: none; min-width: 180px; max-width: 280px;
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-floating);
}
.suggest li { padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; display: flex; justify-content: space-between; gap: 12px; }
.suggest li .n { font: 500 12px var(--mono); color: var(--text-tertiary); }
.suggest li[aria-selected="true"] { background: var(--accent-subtle); }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 30;
  background: var(--text); color: var(--surface); border-radius: var(--radius-pill); padding: 8px 8px 8px 16px;
  display: flex; align-items: center; gap: 12px; font-size: 13px; box-shadow: var(--shadow-floating);
}
.toast button { border: 0; background: rgb(255 255 255 / 14%); color: var(--surface); border-radius: var(--radius-pill); height: 26px; padding: 0 12px; font-weight: 600; }
.toast.plain { padding-right: 16px; }


@media (max-width: 720px) {
  .page { padding: 12px 10px 32px; }
  .search { flex: 1; width: auto; min-width: 0; }
  .today { display: none; }
  .top-actions .btn:not(.icon) { padding: 0 10px; }
  #copy { display: none; }
  .row { grid-template-columns: 20px minmax(0, 1fr) 26px; padding-left: calc(10px + var(--indent) * 16px); row-gap: 0; }
  .handle { display: none; }
  .row > .check { grid-column: 1; grid-row: 1; }
  .row > .body { grid-column: 2; grid-row: 1; }
  .row > .del { grid-column: 3; grid-row: 1; opacity: .6; }
  .row > .meta { grid-column: 2; grid-row: 2; justify-content: flex-start; padding: 0 6px 4px; }
  .row > .meta:empty { display: none; }
  .add { grid-template-columns: 20px minmax(0, 1fr); padding-left: 10px; }
  .add .plus { grid-column: 1; }
  .add-input { grid-column: 2; }
  .group-tools { opacity: 1; }
  .due { min-width: 0; }
}

.btn.primary { background: var(--primary-action); border-color: var(--primary-action); color: var(--primary-action-fg); }
.btn.primary:hover { background: var(--accent-hover); }
.tokens { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tokens li { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 4px 0; border-top: 1px solid var(--border); }
.tokens .when { color: var(--text-muted); font-size: 12px; margin-left: auto; }

/* ---------- pickers & quick-add icons ---------- */
.meta > .ghosts { display: none; gap: 2px; }
.row:hover .meta > .ghosts, .row.editing .meta > .ghosts, .row.picking .meta > .ghosts,
.add:hover .meta > .ghosts, .add:focus-within .meta > .ghosts, .add.has-draft .meta > .ghosts { display: inline-flex; }
.ghost {
  width: 24px; height: 24px; padding: 0; border: 1px dashed var(--border-strong); border-radius: 50%;
  background: transparent; color: var(--text-tertiary); display: grid; place-items: center;
}
.ghost:hover { border-style: solid; border-color: var(--accent); color: var(--accent); background: var(--accent-subtle); }
.meta [data-pick] { cursor: pointer; }
.meta .owner:hover, .meta .due:not(.today):not(.overdue):hover { color: var(--text); }
.meta .client:hover, .meta .status:hover, .meta .due.today:hover, .meta .due.overdue:hover { filter: brightness(.96); }

.add { grid-template-columns: 16px 20px minmax(0, 1fr) auto; }
.add-meta { grid-column: 4; padding-right: 32px; }

.picker {
  position: absolute; z-index: 25; width: 260px; padding: 6px;
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-floating);
  display: grid; gap: 4px;
}
.pk-head { display: flex; align-items: center; gap: 6px; padding: 4px 6px 2px; font-size: 12px; font-weight: 700; color: var(--text-muted); }
.pk-sub { margin-left: auto; font-weight: 500; color: var(--text-tertiary); }
.pk-search {
  height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); outline: none;
}
.pk-search:focus { border-color: var(--accent); }
.pk-list { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow-y: auto; }
.pk-list li {
  display: flex; align-items: center; gap: 8px; padding: 0 8px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.pk-list li[aria-selected="true"] { background: var(--subtle); }
.pk-list li:hover { background: var(--subtle); }
.pk-list li.on { font-weight: 600; }
.pk-list .swatch, .pk-list .st-dot { margin-right: 0; flex: none; }
.picker:focus { outline: none; }
.pk-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-check { color: var(--accent); display: grid; }
.pk-plus, .pk-ic { width: 20px; height: 20px; display: grid; place-items: center; color: var(--text-muted); flex: none; }
.pk-list .n, .pk-quick .n { font-size: 12px; color: var(--text-tertiary); }
.pk-list .pk-empty { color: var(--text-tertiary); cursor: default; }
.pk-list .pk-empty:hover { background: none; }
.pk-quick { display: grid; }
.pk-quick button {
  display: flex; justify-content: space-between; align-items: center; height: 34px; padding: 0 8px;
  border: 0; border-radius: 8px; background: none; font-size: 14px; text-align: left;
}
.pk-quick button:hover, .pk-quick button:focus-visible { background: var(--subtle); outline: none; }
.pk-quick button[aria-current="true"] { background: var(--accent-subtle); font-weight: 600; }
.pk-date { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 2px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }
.pk-date input { height: 30px; padding: 0 6px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); }
.pk-foot { display: flex; gap: 4px; padding-top: 4px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pk-foot button { height: 28px; padding: 0 8px; border: 0; border-radius: 8px; background: none; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.pk-foot button:hover { background: var(--subtle); color: var(--text); }
.pk-foot [data-pk="remove"] { color: var(--danger); }

.suggest .cmd { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.suggest .ic { width: 22px; height: 22px; border-radius: 6px; background: var(--subtle); display: grid; place-items: center; color: var(--text-muted); }
.suggest li { align-items: center; }

@media (max-width: 720px) {
  .row:hover .meta > .ghosts, .row.picking .meta > .ghosts { display: none; }
  .row.editing .meta > .ghosts { display: inline-flex; }
  .row:not(.editing) > .meta:not(:has(> :not(.ghosts))) { display: none; }
  .add { grid-template-columns: 20px minmax(0, 1fr); }
  .add-meta { grid-column: 2; padding: 0 6px 6px; justify-content: flex-start; display: none; }
  .add:focus-within .add-meta, .add.has-draft .add-meta { display: flex; }
  .picker { width: min(300px, calc(100vw - 16px)); }
}

/* ---------- filters ---------- */
.filters-btn { display: inline-flex; align-items: center; gap: 6px; }
.filters-btn.active { border-color: var(--accent); background-color: var(--accent-subtle); }
.fcount {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--radius-pill); background: var(--accent); color: var(--accent-fg);
  font-size: 11px; font-weight: 700; display: inline-grid; place-items: center;
}
.active-filters { display: contents; }
.fchip {
  height: 28px; padding: 0 6px 0 11px; gap: 6px; display: inline-flex; align-items: center; border-radius: var(--radius-pill);
  border: 0; background: var(--sand); font-size: 13px; font-weight: 600; color: var(--text-strong); white-space: nowrap;
}
.fchip svg { color: var(--text-tertiary); width: 16px; height: 16px; padding: 3px; border-radius: 50%; }
.fchip:hover svg { background: rgb(90 64 36 / 10%); color: var(--text); }
.filters-pop {
  position: absolute; z-index: 22; top: calc(100% + 6px); left: 0; width: min(440px, 100%);
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-floating);
  padding: 8px 12px 10px; display: grid; gap: 2px;
}
.f-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 40px; }
.f-label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.filters-pop select.pill { width: 100%; max-width: none; field-sizing: fixed; }
.filters-pop .chips { justify-self: start; flex-wrap: wrap; border-radius: 16px; }
.f-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 8px; }

/* ---------- goals ---------- */
.goals {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card);
  padding: 4px 0 8px; margin-bottom: 14px;
}
.goals.collapsed { padding-bottom: 4px; }
.goals-head { display: flex; align-items: center; gap: 6px; padding: 8px 14px 4px 10px; min-height: 36px; }
.goals-head .caret {
  width: 22px; height: 22px; border: 0; background: none; border-radius: 6px; color: var(--text-tertiary); display: grid; place-items: center; flex: none;
}
.goals-head .caret:hover { background: var(--subtle); color: var(--text); }
.goals-head .caret svg { transition: transform .12s; }
.goals.collapsed .caret svg { transform: rotate(-90deg); }
.goals-title { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.015em; cursor: pointer; }
.goals-summary { font-size: 13px; color: var(--text-muted); margin-left: 6px; }
.gs-behind { color: var(--warning-fg); font-weight: 600; }
.gs-due { color: var(--text-strong); font-weight: 600; }
.goals-add { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.goals-list { display: grid; gap: 8px; padding: 6px 14px 4px; }
.goals-empty { color: var(--text-muted); padding: 4px 2px 6px 22px; }
.goals-empty b { color: var(--text); font-weight: 600; }

.goal {
  --tone: var(--accent); --tone-subtle: var(--accent-subtle);
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden;
}
.goal[data-tone="ahead"] { --tone: var(--progress-fg); --tone-subtle: var(--progress-subtle); }
.goal[data-tone="behind"] { --tone: #D99A1E; --tone-subtle: var(--warning-subtle); }
.goal[data-tone="missed"] { --tone: var(--danger); --tone-subtle: var(--danger-subtle); }
.goal[data-tone="upcoming"] { --tone: var(--text-tertiary); --tone-subtle: var(--subtle); }
.g-main { padding: 10px 12px 10px; cursor: pointer; display: grid; gap: 8px; }
.g-main:hover { background: color-mix(in srgb, var(--subtle) 60%, transparent); }
.g-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.g-name {
  border: 0; background: none; padding: 0; font-size: 15px; font-weight: 700; text-align: left; letter-spacing: -0.01em;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.g-pill {
  height: 22px; padding: 0 9px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; white-space: nowrap;
  display: inline-flex; align-items: center; background: var(--tone-subtle); color: var(--tone);
}
.g-pill[data-tone="behind"] { color: var(--warning-fg); }
.g-pill[data-tone="upcoming"] { color: var(--text-muted); }
.g-pill[data-tone="hit"] { background: var(--accent); color: var(--accent-fg); }
.g-due {
  height: 22px; padding: 0 9px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; white-space: nowrap;
  display: inline-flex; align-items: center; border: 1px dashed var(--border-strong); color: var(--text-strong);
}
.g-num { margin-left: auto; font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.g-num b { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.g-checkin { height: 30px; flex: none; }
.g-checkin:disabled { opacity: .5; cursor: default; }
.g-bar { position: relative; height: 10px; border-radius: var(--radius-pill); background: var(--sand); }
.g-fill { height: 100%; border-radius: inherit; background: var(--tone); min-width: 4px; transition: width .3s; }
.g-pace {
  position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--text);
  opacity: .55;
}
.g-pace::after { content: ""; position: absolute; inset: -4px -6px; }
.g-sub { font-size: 12.5px; color: var(--text-muted); }

.g-form {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 10px 12px 12px;
  background: var(--subtle); border-top: 1px solid var(--border);
}
.goal-form { border: 1px solid var(--border); border-radius: 12px; }
.g-field { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.g-field.grow { flex: 1 1 200px; }
.g-field input {
  height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface);
  font-size: 14px; font-weight: 500; color: var(--text); min-width: 0; width: 100%;
}
.g-field input[type="number"] { width: 110px; }
.g-field input[type="date"] { width: 150px; }
.g-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.g-lengths { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.g-lengths span { margin-right: 4px; }
.g-buttons { display: flex; gap: 6px; margin-left: auto; }

.g-detail { border-top: 1px solid var(--border); padding: 10px 12px 8px; display: grid; gap: 10px; }
.g-chart { display: block; max-width: 100%; overflow: visible; }
.gc-target { stroke: var(--border-strong); stroke-dasharray: 3 4; }
.gc-pace { stroke: var(--text-tertiary); stroke-dasharray: 5 5; stroke-width: 1.5; }
.gc-today { stroke: var(--border-strong); }
.gc-actual { fill: none; stroke: var(--tone); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.gc-dots circle { fill: var(--surface); stroke: var(--tone); stroke-width: 2; }
.gc-label { font-size: 11px; font-weight: 600; fill: var(--text-tertiary); }
.g-hist { list-style: none; margin: 0; padding: 0; display: grid; }
.g-hist li {
  display: grid; grid-template-columns: 64px auto auto minmax(0, 1fr) 26px; align-items: center; gap: 10px;
  min-height: 34px; border-top: 1px solid var(--border); font-size: 13px;
}
.g-hist li:first-child { border-top: 0; }
.g-hist li:hover .del { opacity: 1; }
.g-hdate { color: var(--text-muted); }
.g-hval { font-weight: 700; }
.g-delta { font-size: 12px; font-weight: 600; color: var(--accent); }
.g-delta.neg { color: var(--danger); }
.g-hnote { color: var(--text-strong); min-width: 0; overflow-wrap: anywhere; }
.g-none { color: var(--text-muted); font-size: 13px; }
.g-actions { display: flex; gap: 2px; }
.tool.danger { color: var(--danger); }

@media (max-width: 720px) {
  .goals-list { padding: 6px 10px 4px; }
  .goals-summary { display: none; }
  .g-top { flex-wrap: wrap; row-gap: 4px; }
  .g-name { flex: 1 1 100%; white-space: normal; }
  .g-num { margin-left: 0; }
  .g-checkin { margin-left: auto; }
  .g-hist li { grid-template-columns: 52px auto auto minmax(0, 1fr) 26px; gap: 6px; }
  .g-hist .del { opacity: .6; }
  .g-buttons { margin-left: 0; }
  .filters-pop { width: 100%; }
}

.user { display: flex; align-items: center; min-width: 28px; }
.user:empty { display: none; }
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gate-card { max-width: 380px; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card); text-align: center; display: grid; gap: 12px; justify-items: center; }
.gate-card h1 { margin: 0; font-size: 18px; font-weight: 600; }
.gate-card p { margin: 0; color: var(--text-muted); line-height: 1.5; }
