/* Look carried over from the claude.ai prototype board. */
:root {
  --bg: #f2f4ee; --surface: #ffffff; --sunk: #e8ece2; --ink: #1b2318; --muted: #5a6754; --line: #d6ddcf;
  --accent: #2e6a28; --accent-ink: #ffffff; --soil: #8a5a2b;
  --bad: #b3261e; --bad-bg: #fbe9e7; --warn: #8f5a00; --warn-bg: #fdf1dc; --ok-bg: #e4f0e1; --info: #2f5f8a; --info-bg: #e3edf6;
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #11150f; --surface: #1a2018; --sunk: #151a13; --ink: #e4eadf; --muted: #9aa692; --line: #2b3427;
  --accent: #7dc46f; --accent-ink: #0e190c; --soil: #d49a5f;
  --bad: #ff8b80; --bad-bg: #3a1b18; --warn: #f0b860; --warn-bg: #33270f; --ok-bg: #1d2e1a; --info: #8fc0ec; --info-bg: #17283a; color-scheme: dark } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.4;
  padding-bottom: env(safe-area-inset-bottom, 0px); }
[hidden] { display: none !important; }
.wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
main.wrap { max-width: 1100px; margin: 0 auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

header { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.hin { max-width: 1100px; margin: 0 auto; }
.hrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding-block: 12px; }
h1 { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: .01em; margin: 0; line-height: 1; }
h1 small { font-family: var(--body); font-weight: 500; font-size: 13px; color: var(--muted); letter-spacing: 0; margin-left: 6px; }
.tabs { display: flex; gap: 2px; background: var(--sunk); padding: 3px; border-radius: 999px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; font-weight: 600; color: var(--muted); }
.tabs button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.tabs .n { font-variant-numeric: tabular-nums; font-weight: 500; margin-left: 3px; }
.spacer { flex: 1; }
.me { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.me b { color: var(--ink); }
select, input, textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; min-width: 0; }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 7px 12px; font-weight: 600; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { padding: 4px 9px; font-size: 13px; }

.attn { display: flex; flex-wrap: wrap; gap: 8px; padding-block: 0 12px; }
.chip { display: inline-flex; align-items: baseline; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--muted); }
.chip b { font-family: var(--display); font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
button.chip[aria-pressed="true"] { border-color: var(--ink); }
.chip.bad { background: var(--bad-bg); border-color: transparent; } .chip.bad b { color: var(--bad); }
.chip.warn { background: var(--warn-bg); border-color: transparent; } .chip.warn b { color: var(--warn); }
.inbox { align-self: center; font-size: 12px; color: var(--muted); margin-left: auto; }
.inbox.stale { color: var(--bad); font-weight: 600; margin-left: 0; flex-basis: 100%; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-block: 14px 6px; }
.toolbar.tight { padding-top: 0; }
.toolbar input[type=search] { flex: 1 1 200px; }
.toolbar label { font-size: 13px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.notice { margin-block: 8px; padding: 10px 14px; border-radius: var(--r); background: var(--warn-bg); color: var(--ink); font-size: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Task list */
.list { display: flex; flex-direction: column; gap: 6px; padding-bottom: 28px; }
.group-h { display: flex; align-items: baseline; gap: 8px; font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: 16px; color: var(--muted); margin: 14px 0 2px; }
.group-h.over { color: var(--bad); } .group-h.today { color: var(--warn); }
.task { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 4px 12px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.task.p-urgent { border-left-color: var(--bad); } .task.p-high { border-left-color: var(--warn); } .task.p-normal { border-left-color: var(--accent); } .task.p-low { border-left-color: var(--line); }
.task.done { opacity: .7; } .task.done .tt { text-decoration: line-through; }
.tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--muted); background: none; margin-top: 0; padding: 0; display: grid; place-items: center; color: var(--accent-ink); font-size: 14px; line-height: 1; }
.tick[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.tbody { min-width: 0; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.tt { font-weight: 600; overflow-wrap: anywhere; }
.td { font-size: 13px; color: var(--ink); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tmeta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); align-items: center; }
.tmeta a { color: inherit; }
.tag { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; border-radius: 4px; padding: 1px 6px; background: var(--sunk); color: var(--muted); }
.tag.urgent { background: var(--bad-bg); color: var(--bad); } .tag.high { background: var(--warn-bg); color: var(--warn); }
.tag.call { background: var(--info-bg); color: var(--info); } .tag.draft { background: var(--ok-bg); color: var(--accent); }
.tright { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.when { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.when.over { color: var(--bad); } .when.today { color: var(--warn); }
.who { font-size: 12px; font-weight: 600; background: var(--ok-bg); color: var(--ink); border-radius: 4px; padding: 1px 7px; white-space: nowrap; }
.who.none { background: var(--warn-bg); color: var(--warn); }
.links { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; font-weight: 600; }
.empty { color: var(--muted); font-size: 14px; padding: 10px 2px; }
.empty.lead { padding-top: 0; }

/* Activity */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.ptile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.ptile .nm { font-weight: 600; } .ptile .hrs { font-family: var(--display); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ptile .sub { font-size: 12px; color: var(--muted); }
.log { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 24px; }
.li { display: grid; grid-template-columns: 110px minmax(0,1fr) auto; gap: 2px 12px; padding: 9px 12px; border-top: 1px solid var(--line); font-size: 14px; }
.li:first-child { border-top: 0; }
.li.flat { padding-inline: 0; }
.li .t { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.li .x { min-width: 0; overflow-wrap: anywhere; } .li .x span { color: var(--muted); }
.li .m { font-variant-numeric: tabular-nums; font-weight: 600; }
.li.auto .x { color: var(--muted); }

/* Panels */
.overlay { position: fixed; inset: 0; background: rgba(10,14,9,.45); z-index: 20; display: flex; justify-content: flex-end; }
.panel { background: var(--bg); width: min(560px, 100%); height: 100%; overflow-y: auto; padding: calc(16px + env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) 18px; display: flex; flex-direction: column; gap: 14px; }
.panel h2 { font-family: var(--display); font-size: 24px; margin: 0; }
.panel p { margin: 0; color: var(--muted); }
.ph { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.grid .full { grid-column: 1 / -1; }
.f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.f > span { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.f textarea { min-height: 90px; resize: vertical; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.box h3 { margin: 0; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.addlog { display: grid; grid-template-columns: minmax(0,1fr) 82px auto; gap: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.confirm { font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stamp { font-size: 12px; color: var(--muted); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 999px; font-size: 14px; z-index: 30; max-width: calc(100% - 32px); }
.welcome { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); padding: 18px; margin-block: 10px; max-width: 65ch; }
.welcome h2 { font-family: var(--display); margin: 0 0 6px; font-size: 22px; }

/* People admin */
.urow { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.urow:first-child { border-top: 0; }
.urow .nm { font-weight: 600; } .urow .sub { font-size: 12px; color: var(--muted); }
.urow .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.urow.off .nm { color: var(--muted); text-decoration: line-through; }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 16px; background: var(--ok-bg); padding: 10px 12px; border-radius: 6px; user-select: all; overflow-wrap: anywhere; }
.adduser { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.adduser .full { grid-column: 1 / -1; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login form { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.login h1 { font-size: 32px; }
.login .err { color: var(--bad); font-size: 14px; min-height: 1.2em; }
.login .btn { padding: 10px 12px; }
.login input { padding: 10px; font-size: 16px; }

/* Guide page */
.guide { max-width: 70ch; padding-top: calc(20px + env(safe-area-inset-top, 0px)); padding-bottom: 40px; }
.guide h2 { font-family: var(--display); font-size: 22px; margin: 26px 0 6px; }
.guide li { margin-bottom: 6px; }

@media (max-width: 560px) {
  .grid, .adduser { grid-template-columns: 1fr; }
  .task { grid-template-columns: auto minmax(0,1fr); } .tright { grid-column: 2; flex-direction: row; align-items: center; }
  .li { grid-template-columns: 1fr auto; } .li .t { grid-column: 1 / -1; }
  input, select, textarea { font-size: 16px; } /* stops iPhone zooming in on focus */
  .hrow .me span.lbl { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
