/* ── Palette & tokens ─────────────────────────────────────────── */

:root {
  color-scheme: dark;

  /* deep blue-slate surfaces, faint indigo cast */
  --surface:        #0c1017;
  --surface-raised: #141a26;
  --surface-sunken: #0f1420;
  --surface-hover:  #1b2434;
  --border:         #232d40;
  --border-strong:  #34415c;

  /* cool light ink */
  --ink:       #e8ecf5;
  --ink-muted: #99a4bd;
  --ink-faint: #5f6b84;

  /* brand accent — electric cool blue (interactive, focus, primary) */
  --accent:      #4c8dff;
  --accent-soft: #17233c;

  /* semantic hues — used sparingly, each means one thing */
  --danger:      #ff6a5f;   /* overdue */
  --danger-soft: #2a1719;
  --warn:        #f4b545;   /* stale / going quiet */
  --warn-soft:   #271f13;
  --ok:          #45d69e;   /* done / positive */
  --ok-soft:     #10241d;
  --violet:      #ac8dff;   /* commitments — mine */
  --violet-soft: #1e1a30;
  --teal:        #38cfd6;   /* waiting on others */
  --teal-soft:   #0f2427;

  --font-ui:   "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-read: "Spectral", ui-serif, Georgia, serif;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 6px 20px -8px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(76,141,255,0.07), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(172,141,255,0.05), transparent 55%),
    var(--surface);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

::selection { background: rgba(76,141,255,0.28); }

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

/* ── Top bar ──────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(14, 19, 30, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 20px;
  overflow-x: auto;
}

.brand {
  font-weight: 700;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.brand::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px 1px rgba(76,141,255,0.7);
}

.mainnav, .peoplenav {
  display: flex;
  gap: 14px;
  flex-shrink: 0;
}

.mainnav a, .peoplenav a {
  color: var(--ink-muted);
  font-size: 13px;
  padding: 4px 0;
}

.mainnav a:hover, .peoplenav a:hover { color: var(--ink); }
.mainnav a.active, .peoplenav a.active { color: var(--ink); font-weight: 500; }

.peoplenav { margin-left: auto; }

/* ── Layout ───────────────────────────────────────────────────── */

.app {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.loading { color: var(--ink-faint); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* grid/flex children may not shrink below content width without this */
.grid-2 > * { min-width: 0; }

@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
}

.stack > * + * { margin-top: 20px; }

/* ── Dashboard header + stat strip ────────────────────────────── */

.dash-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.dash-greeting {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  background: linear-gradient(90deg, var(--ink), var(--accent) 180%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dash-date {
  font-size: 12px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.stat {
  --stat-hue: var(--accent);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 14px 13px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    linear-gradient(150deg, color-mix(in srgb, var(--stat-hue) 14%, transparent), transparent 60%),
    var(--surface-raised);
  box-shadow: var(--shadow);
  transition: transform 0.14s ease, border-color 0.14s ease;
}
.stat:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--stat-hue) 55%, var(--border)); }
.stat::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--stat-hue), transparent 80%);
}

.stat[data-accent="danger"] { --stat-hue: var(--danger); }
.stat[data-accent="blue"]   { --stat-hue: var(--accent); }
.stat[data-accent="violet"] { --stat-hue: var(--violet); }
.stat[data-accent="teal"]   { --stat-hue: var(--teal); }
.stat[data-accent="warn"]   { --stat-hue: var(--warn); }

.stat-value {
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--stat-hue);
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

@media (max-width: 720px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-value { font-size: 26px; }
}

/* ── Panels ───────────────────────────────────────────────────── */

.panel {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.018), transparent 120px),
    var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 16px;
  box-shadow: var(--shadow);
}

/* colored accent per card — a hairline top edge + tinted title dot */
.panel[data-accent] { --panel-hue: var(--accent); }
.panel[data-accent="danger"] { --panel-hue: var(--danger); }
.panel[data-accent="warn"]   { --panel-hue: var(--warn); }
.panel[data-accent="ok"]     { --panel-hue: var(--ok); }
.panel[data-accent="violet"] { --panel-hue: var(--violet); }
.panel[data-accent="teal"]   { --panel-hue: var(--teal); }
.panel[data-accent="blue"]   { --panel-hue: var(--accent); }

.panel[data-accent]::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, var(--panel-hue), transparent 70%);
  opacity: 0.75;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.panel-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-muted);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}
.panel[data-accent] .panel-title::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--panel-hue);
  box-shadow: 0 0 8px -1px var(--panel-hue);
}

.panel-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
  padding: 1px 7px;
}
.panel[data-accent]:not([data-empty]) .panel-count {
  color: var(--panel-hue);
  border-color: color-mix(in srgb, var(--panel-hue) 40%, var(--border));
  background: color-mix(in srgb, var(--panel-hue) 12%, var(--surface-sunken));
}

.empty {
  color: var(--ink-faint);
  font-style: italic;
  font-size: 13px;
  margin: 0;
}

.group-label {
  font-size: 11px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 10px 0 2px;
}
.group-label:first-child { margin-top: 0; }

/* ── Rows ─────────────────────────────────────────────────────── */

.row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  row-gap: 3px;
  gap: 10px;
  padding: 7px 8px;
  margin: 0 -8px;
  border-radius: 6px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s ease;
}
.row:last-child { border-bottom: none; }
.row:hover { background: var(--surface-hover); }

/* two-line rows: title line on top, context + actions underneath */
.row-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: 1 0 100%;
  min-width: 0;
}
.row-sub {
  padding-left: 24px;   /* aligns under the title, past the done toggle */
  gap: 8px;
  flex-wrap: wrap;
  row-gap: 3px;
}
.row-sub .meta { max-width: 13rem; }

.row-title {
  flex: 1;
  min-width: 38%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
}

a.row-title:hover { text-decoration: underline; }

.row-title.done {
  text-decoration: line-through;
  color: var(--ink-faint);
}

/* priority: weight and indent carry the signal; a small colored pip
   just helps the eye land on the top two */
.prio {
  flex-shrink: 0;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.prio::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}
.p1 { font-weight: 700; color: var(--danger); }
.p2 { font-weight: 600; color: var(--warn); }
.p3 { font-weight: 500; color: var(--ink-muted); }
.p4 { font-weight: 400; color: var(--ink-faint); margin-left: 8px; }
.p5 { font-weight: 400; color: var(--ink-faint); margin-left: 16px; }
.p4::before, .p5::before { opacity: 0.3; }

.tag {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
}
/* owner tags get a subtle hue: mine (violet), theirs (teal) */
.tag-mine   { color: var(--violet); border-color: color-mix(in srgb, var(--violet) 35%, var(--border)); background: var(--violet-soft); }
.tag-theirs { color: var(--teal);   border-color: color-mix(in srgb, var(--teal) 32%, var(--border));   background: var(--teal-soft); }

.meta {
  flex-shrink: 1;
  min-width: 2.2rem;
  font-size: 11px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* follow-up dates are the load-bearing signal — never truncate them */
.meta-date {
  flex-shrink: 0;
  min-width: 0;
  max-width: none;
}

@media (max-width: 560px) {
  .row { gap: 6px; }
  .row-title { min-width: 25%; }
  .meta { max-width: 4.5rem; min-width: 1.6rem; }
}

.meta a:hover, a.meta:hover { color: var(--ink); }

.faint { color: var(--ink-faint); }

/* decay signals: stale goes amber, overdue goes red */
.decay { color: var(--warn); }
.decay-strong { color: var(--danger); font-weight: 600; }

/* done toggle */
.done-toggle {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: transparent;
  cursor: pointer;
  padding: 0;
  position: relative;
  top: 2px;
}
.done-toggle:hover { border-color: var(--ok); }
.done-toggle.is-done {
  border-color: var(--ok);
  background: var(--ok);
  box-shadow: 0 0 8px -1px var(--ok);
}
.done-toggle.is-done::after {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--surface);
  margin: auto;
}

/* ── Forms & controls ─────────────────────────────────────────── */

input, select, button, textarea { font-family: var(--font-ui); font-size: 13px; color: var(--ink); }

select,
input[type="date"], input[type="text"], input[type="email"],
input[type="password"], input[type="number"] {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
}
select:hover,
input[type="date"]:hover, input[type="text"]:hover, input[type="email"]:hover,
input[type="password"]:hover, input[type="number"]:hover { border-color: var(--border-strong); }
input::placeholder, textarea::placeholder { color: var(--ink-faint); }

.quick-add {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.quick-add-dot {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px dashed var(--border-strong);
}

.quick-add input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  padding: 2px 0;
  outline: none;
  font-size: 13.5px;
}
.quick-add input::placeholder { color: var(--ink-faint); }

.note-saved {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--ok);
  white-space: nowrap;
}
.note-saved:hover { text-decoration: underline; }

.btn {
  background: var(--surface-hover);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 12px;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.btn:hover { background: var(--surface-sunken); border-color: var(--accent); color: var(--ink); }

.filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pagehead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.pagehead h1 {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

/* ── Person header ────────────────────────────────────────────── */

.person-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.person-head h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
}

.person-role { color: var(--ink-muted); font-size: 13px; margin: 2px 0 0; }
.person-lastmet { font-size: 12px; margin: 4px 0 0; color: var(--ink-faint); }

.person-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--ink-muted);
  flex-wrap: wrap;
}

.person-controls label { display: flex; align-items: center; gap: 6px; }

/* ── Notes / prose ────────────────────────────────────────────── */

.prose {
  font-family: var(--font-read);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  margin: 2px 0 0;
  white-space: pre-wrap;
}

.meeting-entry { padding: 6px 0; border-bottom: 1px solid var(--border); }
.meeting-entry:last-child { border-bottom: none; }
.meeting-date { font-size: 12px; color: var(--ink-muted); }

/* ── Bulk edit bar ────────────────────────────────────────────── */

.bulkbar {
  position: sticky;
  top: 56px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--ink-muted);
}

.bulkbar label { display: flex; align-items: center; gap: 6px; }
.bulkbar .linkish { background: none; border: none; cursor: pointer; color: var(--ink-faint); padding: 0; }
.bulkbar .linkish:hover { color: var(--ink-muted); }

/* ── Meeting mode ─────────────────────────────────────────────── */

.meeting {
  min-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
}

.meeting-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 32px;
}

.meeting-top h1 { font-size: 16px; font-weight: 500; color: var(--ink-muted); margin: 0; }
.meeting-progress { font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

.meeting-top-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.meeting-list {
  flex: 1;
  overflow-y: auto;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.meeting-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  cursor: pointer;
}
.meeting-row:last-child { border-bottom: none; }
.meeting-row:hover { background: var(--surface-sunken); }
.meeting-row.selected {
  background: var(--surface-sunken);
  border-left-color: var(--ink);
}
.meeting-row.touched .meeting-row-title { color: var(--ink-faint); }

.meeting-row-mark {
  flex-shrink: 0;
  width: 14px;
  font-size: 13px;
  color: var(--ink-muted);
  text-align: center;
}

.meeting-row-main { flex: 1; min-width: 0; }

.meeting-row-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.3;
}
.meeting-row-title.done { text-decoration: line-through; }

.meeting-row-notes {
  margin: 3px 0 0;
  font-family: var(--font-read);
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-muted);
}

.meeting-new {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  margin-bottom: 8px;
}

.fu-inline { margin-top: 8px; }

.meeting .empty { padding: 14px; }

/* inline "talked" note input on rows */
.talk-note-inline {
  flex-shrink: 1;
  min-width: 0;
  width: 220px;
  padding: 2px 6px;
  font-size: 12px;
}

/* follow-up history */
.touch-row { cursor: pointer; }
.touch-row:hover { background: var(--surface-sunken); }
.touch-note-snippet { font-style: italic; }

/* 1:1 flag toggle */
.oo-btn { background: none; border: none; cursor: pointer; padding: 0; text-align: left; }
.oo-btn:hover { text-decoration: underline; }
.oo-on { color: var(--ink); font-weight: 500; }

/* the 1:1 meeting modal */
.meet-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.meet-row:last-child { border-bottom: none; }
.meet-row.touched .meeting-row-title { color: var(--ink-faint); }

.meet-lognote {
  margin: 4px 0 0;
  font-family: var(--font-read);
  font-size: 13px;
  color: var(--ink);
  font-style: italic;
}

.meet-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.meet-btn {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 11.5px;
  color: var(--ink-muted);
  cursor: pointer;
}
.meet-btn:hover { border-color: var(--ink-muted); color: var(--ink); }
.meet-btn-active { color: var(--ink); font-weight: 500; border-color: var(--border-strong); }

.meet-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

.proj-notes {
  display: block;
  width: 100%;
  padding: 8px;
  font-family: var(--font-read);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
  resize: vertical;
  min-height: 76px;
}
.proj-notes::placeholder { color: var(--ink-faint); font-style: italic; }
.proj-notes:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.modal-wide { max-width: 660px; }
.modal-tall { max-height: 86vh; }

/* ── 1:1 log (searchable timeline) ────────────────────────────── */

.log-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.log-controls #log-q {
  flex: 1;
  min-width: 160px;
  padding: 6px 10px;
  border-radius: 999px;
}
.log-controls input[type="date"] { font-size: 11px; padding: 4px 6px; }
.log-dash { color: var(--ink-faint); }
.log-count {
  font-size: 11px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

.log-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
}

.log-card {
  position: relative;
  padding: 12px 14px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: 8px;
}

.log-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.log-card-date { font-weight: 600; font-size: 13px; letter-spacing: -0.01em; }

.log-card-notes { margin: 6px 0 0; font-size: 13.5px; }

.log-chips {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
}
.log-chip {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
}
.log-chip-title { color: var(--ink); flex-shrink: 0; }
.log-chip-note {
  font-family: var(--font-read);
  color: var(--ink-muted);
  font-style: italic;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.log-chip .tag { margin-left: auto; }

.meet-notes-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-top: 10px;
}

.meet-notes-label textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 8px;
  font-family: var(--font-read);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
  resize: vertical;
}

.meeting-keys {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 0 4px;
  font-size: 11px;
  color: var(--ink-faint);
}

kbd {
  background: var(--surface-sunken);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: var(--font-ui);
  font-size: 0.9em;
}

/* ── Follow-up affordances ────────────────────────────────────── */

.fu-btn, .talk-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-align: left;
}
.fu-btn:hover, .talk-btn:hover { text-decoration: underline; }
.talk-btn:disabled { opacity: 0.5; cursor: default; }

.fu-add {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--ink-faint);
}
.fu-add::before { content: "+ "; }
.fu-add:hover { color: var(--ink-muted); }

.fu-edit {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fu-edit input[type="date"] { padding: 1px 4px; font-size: 11px; }

/* inline follow-up preset menu */
.fu-menu {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.fu-menu button {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 11px;
  color: var(--ink-muted);
  cursor: pointer;
}
.fu-menu button:hover { border-color: var(--ink-muted); color: var(--ink); }
.fu-menu button.fu-danger:hover { border-color: var(--accent); color: var(--accent); }
.fu-menu input[type="date"] { padding: 1px 4px; font-size: 11px; max-width: 8rem; }
.fu-contact {
  padding: 1px 6px;
  font-size: 11px;
  max-width: 8rem;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--surface-sunken);
}
.fu-contact:focus-visible { outline-color: var(--accent); }

/* "with [contact]" chip on a follow-up row */
.with-chip {
  flex-shrink: 0;
  color: var(--teal);
  max-width: 8rem;
}

/* ── Today list ───────────────────────────────────────────────── */

.today-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 11px;
  color: var(--ink-faint);
}
.today-btn:hover { text-decoration: underline; }
.today-btn.on { color: var(--warn); font-weight: 600; }

.carry-hint {
  font-size: 12px;
  color: var(--ink-muted);
  margin: 0 0 8px;
}

/* ── Captain's log ────────────────────────────────────────────── */

.log-capture {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.log-capture textarea {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font-family: var(--font-read);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  resize: vertical;
}
.log-capture textarea::placeholder { color: var(--ink-faint); font-family: var(--font-ui); font-size: 13px; }
.log-capture textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.log-capture .btn-primary { flex-shrink: 0; padding: 9px 16px; }

.log-filterbar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.log-filterbar #log-search {
  flex: 1;
  min-width: 0;
  padding: 6px 12px;
  border-radius: 999px;
}
.log-filterbar .chip { cursor: pointer; }
.log-filterbar .chip:hover { border-color: var(--accent); color: var(--ink); }
.log-count { font-size: 11px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

.log-stream {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-day { margin-top: 8px; }
.log-day:first-child { margin-top: 0; }

.log-day-head {
  position: sticky;
  top: 48px;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 6px 2px;
  margin-bottom: 2px;
  background: linear-gradient(var(--surface), var(--surface) 70%, transparent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
}
.log-day-count { color: var(--ink-faint); font-weight: 500; }

.log-entry {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 10px;
  margin: 0 -10px;
  border-radius: 8px;
}
.log-entry:hover { background: var(--surface-raised); }
.log-entry:hover .log-del { opacity: 1; }

.log-time {
  flex-shrink: 0;
  width: 66px;
  font-size: 11px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

.log-body {
  flex: 1;
  min-width: 0;
  font-family: var(--font-read);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.log-tag {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0 4px;
  border-radius: 4px;
  font: inherit;
  font-weight: 600;
}
.log-tag:hover { background: color-mix(in srgb, var(--accent) 26%, transparent); }

.log-del {
  flex-shrink: 0;
  opacity: 0;
  background: none;
  border: none;
  color: var(--ink-faint);
  cursor: pointer;
  font-size: 13px;
  padding: 0 4px;
  transition: opacity 0.12s ease;
}
.log-del:hover { color: var(--accent); }

/* ── Meeting log ──────────────────────────────────────────────── */

.att-chips:empty { display: none; }
.att-chips { margin-bottom: 6px; }
.att-input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 6px 8px;
}
.att-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.att-sugg {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--ink-muted);
  cursor: pointer;
}
.att-sugg:hover { border-color: var(--teal); color: var(--ink); }

.mn-card { cursor: pointer; transition: border-color 0.12s ease; }
.mn-card:hover { border-color: var(--border-strong); }
.mn-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mn-card-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.mn-card-date { margin-left: 10px; font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.mn-att { margin-top: 8px; }
.mn-att .chip { font-size: 11px; }
.mn-notes { margin: 10px 0 0; font-size: 13.5px; color: var(--ink-muted); white-space: pre-wrap; }
.mn-delete:hover { color: var(--accent); }

.mn-resume .mn-resume-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.mn-resume-title { font-size: 15px; font-weight: 600; margin-top: 2px; }
.mn-resume-actions { display: flex; align-items: center; gap: 10px; }

.mn-title-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 4px 0 8px;
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.mn-title-input:focus-visible { outline: none; border-bottom-color: var(--accent); }
.mn-row2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 4px;
}
.mn-status { color: var(--ok); min-height: 1em; }

/* ── Items table ──────────────────────────────────────────────── */

.table-scroll { overflow-x: auto; }

.items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.items-table thead th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  padding: 4px 10px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.items-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
.items-table tbody tr:last-child td { border-bottom: none; }
.items-table tbody tr:hover td { background: var(--surface-hover); }

.items-table .col-title {
  white-space: normal;
  min-width: 220px;
  max-width: 360px;
  color: var(--ink);
}
.items-table .col-title.done { text-decoration: line-through; color: var(--ink-faint); }
.item-edit {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  white-space: normal;
}
.item-edit:hover { color: var(--accent); text-decoration: underline; }
.col-title.done .item-edit { text-decoration: line-through; }
.items-table .col-check, .items-table .col-done { width: 1%; padding-right: 0; }
.items-table .col-assignee a, .items-table .col-project a { color: var(--ink-muted); }
.items-table .col-assignee a:hover, .items-table .col-project a:hover { color: var(--ink); }
.items-table .col-project { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.items-table .done-toggle { top: 0; }

.status-pill {
  font-size: 10.5px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--ink-muted);
  text-transform: capitalize;
}
.status-pill.s-open    { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.status-pill.s-waiting { color: var(--warn);   border-color: color-mix(in srgb, var(--warn) 35%, var(--border)); }
.status-pill.s-done    { color: var(--ok);     border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); }
.status-pill.s-dropped { color: var(--ink-faint); }

/* action log */
.log-text { font-size: 12.5px; color: var(--ink-muted); }
.log-note { font-family: var(--font-read); color: var(--ink); }

/* action log modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(4, 6, 11, 0.66);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 16px 16px;
}

.modal {
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.7);
}

.modal-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 17px;
  line-height: 1;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 2px 4px;
}
.modal-close:hover { color: var(--ink); }

.modal-body { overflow-y: auto; }

.talk-note-input {
  min-width: 240px;
  padding: 5px 8px;
}

/* ── Auth & nav gating ────────────────────────────────────────── */

body:not(.authed) .mainnav,
body:not(.authed) .peoplenav,
body:not(.authed) .signout { display: none; }

.signout {
  margin-left: 12px;
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--ink-faint);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 0;
}
.signout:hover { color: var(--ink); }

.auth-wrap {
  min-height: calc(100vh - 160px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 340px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
}

.auth-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.auth-sub {
  color: var(--ink-muted);
  font-size: 13px;
  margin: 6px 0 20px;
}

.auth-card form { text-align: left; }

.auth-card label {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
  margin-bottom: 12px;
}

.auth-card input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 7px 8px;
}

.auth-toggle { margin-top: 16px; }

.otp-input {
  letter-spacing: 0.4em;
  font-size: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}
.auth-card .form-error { margin-top: 12px; text-align: center; }
.auth-sub strong { color: var(--ink); }

.linkish {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-faint);
  font-size: 12px;
  padding: 0;
}
.linkish:hover { color: var(--ink-muted); }

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

.btn-primary {
  background: linear-gradient(180deg, #5a97ff, var(--accent));
  color: #071018;
  font-weight: 600;
  border-color: transparent;
  box-shadow: 0 2px 12px -4px rgba(76,141,255,0.7);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #6ba2ff, #4585f5);
  border-color: transparent;
  color: #071018;
}

.btn-block { display: block; width: 100%; padding: 8px; margin-top: 4px; }

/* ── Entity forms (person / project) ──────────────────────────── */

.entity-form { padding: 4px 0; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}

@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
}

.form-grid label {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
}

.form-grid label.span-2 { grid-column: span 2; }
@media (max-width: 560px) {
  .form-grid label.span-2 { grid-column: span 1; }
}

.form-grid input, .form-grid select, .form-grid textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 6px 8px;
}
.form-grid textarea {
  font-family: var(--font-read);
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
}

.hint { color: var(--ink-faint); font-weight: 400; }

.form-actions { margin-top: 14px; }

.form-error {
  color: var(--accent);
  font-size: 12px;
  margin: 10px 0 0;
}

/* ── Stakeholder chips ────────────────────────────────────────── */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.chips:empty { margin-top: 0; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--ink-muted);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2px 6px 2px 10px;
}

.chip button {
  background: none;
  border: none;
  color: var(--ink-faint);
  cursor: pointer;
  font-size: 13px;
  padding: 0 2px;
  line-height: 1;
}
.chip button:hover { color: var(--accent); }

/* ── Setup wizard ─────────────────────────────────────────────── */

.wizard {
  max-width: 560px;
  margin: 24px auto 0;
}

.wizard-step {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin: 0 0 6px;
}

.wizard-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

.wizard-sub {
  color: var(--ink-muted);
  font-size: 13px;
  margin: 6px 0 20px;
}

.wizard .entity-form {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.wizard-added { margin-top: 14px; }

.wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
}
.wizard-nav .btn-primary:only-child { margin-left: auto; }

/* ── 1:1 upcoming list ────────────────────────────────────────── */

.oneonone-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px;
  margin: 0 -4px;
  border-bottom: 1px solid var(--border);
  border-radius: 4px;
}
.oneonone-link:last-child { border-bottom: none; }
.oneonone-link:hover { background: var(--surface-sunken); }
