/* Ohana Tracker. Material 3-inspired roles; no framework. */
:root {
  --primary: #2f5d8a; --on-primary: #fff;
  --primary-container: #d3e4ff; --on-primary-container: #001c38;
  --surface: #f8f9fc; --surface-low: #f1f3f8; --surface-high: #e6e8ee;
  --on-surface: #191c20; --muted: #5b6068; --outline: #c3c7cf;
  --inverse: #2e3135; --on-inverse: #eff0f6;
  --error: #ba1a1a; --ok: #2b7a3d; --warn: #8a5a00;
  --radius: 12px; --gap: 16px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #a3c9ff; --on-primary: #00315b;
    --primary-container: #12466f; --on-primary-container: #d3e4ff;
    --surface: #111418; --surface-low: #191c20; --surface-high: #272a2f;
    --on-surface: #e1e2e8; --muted: #a8acb4; --outline: #43474e;
    --inverse: #e1e2e8; --on-inverse: #2e3135;
    --error: #ffb4ab; --ok: #8fd69d; --warn: #f3bd5c;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--surface); color: var(--on-surface); font-size: 15px; line-height: 1.45; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 12px; font-weight: 600; }
h2 { font-size: 1.15rem; margin: 24px 0 8px; font-weight: 600; }
h3 { font-size: 1rem; margin: 20px 0 6px; }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .88em; }
pre { overflow-x: auto; background: var(--surface-high); padding: 10px; border-radius: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 10px 20px; background: var(--surface-low); border-bottom: 1px solid var(--outline); }
.brand { font-weight: 700; color: var(--on-surface); }
.top nav { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; }
.top nav a { padding: 6px 12px; border-radius: 999px; color: var(--on-surface); }
.top nav a[aria-current] { background: var(--primary-container); color: var(--on-primary-container); text-decoration: none; }
.search input { width: 200px; }
.account { position: relative; }
.account summary { cursor: pointer; list-style: none; padding: 6px 12px; border-radius: 999px; background: var(--surface-high); }
.account .menu { position: absolute; right: 0; top: 110%; background: var(--surface); border: 1px solid var(--outline);
  border-radius: var(--radius); padding: 8px; min-width: 160px; display: grid; gap: 4px; box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.account .menu a, .account .menu button { padding: 6px 10px; text-align: left; }

main { max-width: 1200px; margin: 0 auto; padding: 20px; }
main.narrow { max-width: 440px; padding-top: 12vh; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 24px; }

.card { border-radius: var(--radius); padding: 16px; margin: 0 0 var(--gap); }
.card.outlined { border: 1px solid var(--outline); background: var(--surface); }
.card.filled { background: var(--surface-high); }
.card.elevated { background: var(--surface-low); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.signin h1 { text-align: center; }

label { display: block; font-size: .85rem; font-weight: 600; margin: 10px 0 4px; color: var(--muted); }
label.check { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; color: var(--on-surface); margin: 4px 12px 4px 0; }
input, select, textarea { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--outline);
  border-radius: 8px; padding: 8px 10px; width: 100%; }
input[type=checkbox] { width: auto; }
textarea { resize: vertical; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .9rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px; }
fieldset { border: 1px solid var(--outline); border-radius: 8px; margin: 12px 0; padding: 6px 12px; }
legend { font-size: .85rem; font-weight: 600; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 12px; }

button, .button { font: inherit; font-weight: 600; border: 0; border-radius: 999px; padding: 8px 18px; cursor: pointer;
  background: var(--primary); color: var(--on-primary); display: inline-block; text-decoration: none; }
button.tonal, .button.tonal { background: var(--primary-container); color: var(--on-primary-container); }
button.text, .button.text { background: transparent; color: var(--primary); padding: 8px 10px; }
button.danger { color: var(--error); }
button.icon { background: transparent; color: var(--muted); padding: 2px 8px; position: relative; }
button.icon:hover { background: var(--surface-high); }
[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after { content: attr(data-tooltip); position: absolute; bottom: 120%; right: 0;
  white-space: nowrap; background: var(--inverse); color: var(--on-inverse); font-size: .75rem; font-weight: 400; padding: 4px 8px; border-radius: 4px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; align-items: center; }
.form-actions.split { justify-content: space-between; }
form.inline { display: inline; }
.actions-row { margin: 8px 0; }

.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 4px 10px; margin-bottom: 12px; }
.filters label { margin: 0 0 2px; }
.filters input, .filters select { width: auto; min-width: 110px; }
.filters .form-actions { margin: 0; }

.list { list-style: none; margin: 0 0 var(--gap); padding: 0; border: 1px solid var(--outline); border-radius: var(--radius); overflow: hidden; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 9px 14px; border-top: 1px solid var(--outline); background: var(--surface); }
.row:first-child { border-top: 0; }
.row.done .title { color: var(--muted); text-decoration: line-through; }
.row.child { padding-left: 34px; }
.row .title { flex: 1 1 280px; color: var(--on-surface); font-weight: 500; }
.row .meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ranked .row[draggable] { cursor: grab; }
.row.dragging { opacity: .5; }
.grip { color: var(--muted); cursor: grab; letter-spacing: -2px; }
.key { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .85rem; color: var(--muted); }
.meta { color: var(--muted); font-size: .85rem; }
.snippet { flex-basis: 100%; }
.empty { color: var(--muted); }
.count-line { color: var(--muted); margin: 0 0 6px; }
.flash { background: var(--primary-container); color: var(--on-primary-container); padding: 10px 14px; border-radius: 8px; }
.error { color: var(--error); }
.head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.chip { display: inline-block; font-size: .75rem; line-height: 1.6; padding: 0 8px; border-radius: 6px;
  border: 1px solid var(--outline); color: var(--muted); white-space: nowrap; }
a.chip:hover { text-decoration: none; background: var(--surface-high); }
.kind-bug { color: var(--error); border-color: currentColor; }
.kind-feature { color: var(--primary); border-color: currentColor; }
.kind-question { color: var(--warn); border-color: currentColor; }
.prio-p0 { background: var(--error); color: var(--surface); border-color: var(--error); }
.prio-p1 { color: var(--error); border-color: currentColor; }
.status-in_progress, .status-next { background: var(--primary-container); color: var(--on-primary-container); border-color: transparent; }
.status-blocked, .blocked { color: var(--warn); border-color: currentColor; }
.status-done, .outcome-pass { color: var(--ok); border-color: currentColor; }
.outcome-fail { color: var(--error); border-color: currentColor; }
.outcome-partial { color: var(--warn); border-color: currentColor; }
.claim { background: var(--surface-high); }

.board { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 12px; overflow-x: auto; }
.column h2 { margin-top: 0; font-size: 1rem; text-transform: capitalize; }
.column .count { color: var(--muted); font-weight: 400; }
.tile { display: grid; gap: 4px; color: var(--on-surface); padding: 10px 12px; margin-bottom: 8px; }
.tile:hover { text-decoration: none; outline: 1px solid var(--primary); }
.tile strong { font-weight: 500; }

.item-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
.item-head h1 { margin-bottom: 4px; }
.crumbs { margin: 0 0 4px; }
.body > :first-child { margin-top: 0; }
.body > :last-child { margin-bottom: 0; }
.body img { max-width: 100%; }
.body table { border-collapse: collapse; }
.body th, .body td { border: 1px solid var(--outline); padding: 4px 8px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.links { list-style: none; padding: 0; margin: 0 0 8px; font-size: .9rem; }
.links li { padding: 3px 0; }
.timeline { list-style: none; padding: 0; margin: 0 0 var(--gap); border-left: 2px solid var(--outline); }
.event { padding: 4px 0 10px 14px; }
.event .meta { margin: 0; }
.event .data { margin: 4px 0 0; font-size: .75rem; padding: 6px 8px; white-space: pre-wrap; word-break: break-word; }
.event .comment { background: var(--surface-low); border-radius: 8px; padding: 8px 12px; margin-top: 4px; }
.ev-comment .comment { background: var(--surface-high); }
.secret { cursor: copy; user-select: all; }
.secret.copied::after { content: "  copied"; color: var(--ok); }
.tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.tabs a { padding: 6px 14px; border-radius: 999px; }
.tabs a[aria-current] { background: var(--primary-container); color: var(--on-primary-container); }
details > summary { cursor: pointer; font-weight: 600; }

@media (max-width: 860px) {
  .item-layout { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(5, 240px); }
  .search input { width: 140px; }
  main { padding: 16px; }
}
