/* Bergamot Client Portal — implements "Bergamot Client Hub v2" from Claude
   Design. Dense briefing board: the engagement on the left, the desk on the
   right, a row-per-workstream plan on calendar time. Paper is the daytime
   default; the dark (oxblood) theme keeps parity via the same tokens. */

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100vh; }

/* paper — the daytime default (palette from the v2 design) */
:root[data-theme="paper"] {
  --bg: #F4F1EA;
  --bg-2: #ECE7DC;
  --raise: #FBF9F4;
  --fg: #241118;
  --muted: #55404B;
  --dim: #79626C;
  --line: rgba(43, 26, 35, .20);
  --line-2: rgba(43, 26, 35, .10);
  --accent: #A85B2C;
  --accent-ink: #F4F1EA;
  --accent-dim: rgba(168, 91, 44, .12);
  --accent-2-dim: rgba(158, 120, 166, .12);
  --green: #5E7A55;
  --gold: #B0853F;
  --shadow: rgba(43, 26, 35, .04);
}
/* dark (oxblood) equivalents for the tokens the design added */
:root {
  --accent-ink: #120910;
  --green: #7E9A6E;
  --gold: #C59A45;
  --shadow: rgba(0, 0, 0, .2);
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(56rem 30rem at 16% -14%, var(--accent-dim), transparent 60%),
    radial-gradient(44rem 26rem at 90% -18%, var(--accent-2-dim), transparent 62%);
  opacity: .45;
}

#root { position: relative; z-index: 1; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.num, time { font-variant-numeric: tabular-nums; }
.quiet { color: var(--muted); margin: 0; }

/* ── chrome — thin ──────────────────────────────────────────────────── */

.chrome { border-bottom: 1px solid var(--line); background: var(--raise); }

.chrome-inner {
  padding: 10px clamp(16px, 2.2vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

/* the real lockup — mark in the family gold, wordmark in the theme's ink;
   both CSS masks so the one asset serves paper and dark */
.brand-lockup { display: flex; align-items: center; gap: 9px; }
.brand-lockup:hover { text-decoration: none; }

/* Jono's watercolor bergamot — a painted image, not a mask */
.brand-mark {
  width: 22px;
  height: 26px;
  background: url("/assets/bergamot-watercolor.png") center / contain no-repeat;
}

.brand-word {
  width: 100px;
  height: 33px;
  background: var(--fg);
  -webkit-mask: url("/assets/bergamot-wordmark.svg") center / contain no-repeat;
  mask: url("/assets/bergamot-wordmark.svg") center / contain no-repeat;
}

.brand-tag { padding-top: 4px; }

.brand-tag {
  font-size: 9px;
  letter-spacing: .4em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 500;
}

.identity { display: flex; align-items: center; gap: 14px; }
.who-name { font-size: 12px; color: var(--muted); font-weight: 500; }
.who-org { font-size: 11px; color: var(--dim); }

.chrome-link {
  background: none;
  border: none;
  color: var(--dim);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.chrome-link:hover { color: var(--muted); }

.theme-toggle { display: inline-flex; align-items: center; line-height: 0; }
.theme-toggle svg { display: block; }

.view { padding: 16px clamp(16px, 2.2vw, 40px) 70px; }

/* ── masthead — one compact band ────────────────────────────────────── */

.masthead {
  display: grid;
  grid-template-columns: minmax(230px, 3fr) minmax(0, 8fr);
  gap: clamp(20px, 2.6vw, 48px);
  align-items: start;
  padding: 4px 0 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 500;
  margin: 0 0 6px;
}
.eyebrow .tick { color: var(--green); }

.mast-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 27px;
  line-height: 1.1;
  letter-spacing: -.005em;
  margin: 0 0 4px;
}

.mast-sub {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 0 10px;
  max-width: 36ch;
}

.phase-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px 4px 9px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--raise);
}
.phase-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ── the plan — a plain gantt on calendar time ──────────────────────── */

.gantt { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; margin-top: 4px; }

.g-names { display: grid; }
.g-axis-spacer { height: 24px; }

.g-name {
  height: 26px;
  display: flex;
  align-items: baseline;
  gap: 7px;
  line-height: 26px;
  border-top: 1px solid var(--line-2);
  padding-right: 12px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}
.g-name .n { font-size: 12.5px; font-weight: 500; color: var(--fg); flex: 0 0 auto; }
.g-name .d {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 12px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
}
.g-name.now .d { color: var(--accent); }

.g-tracks { position: relative; }
.g-grid { position: absolute; top: 24px; bottom: 0; width: 1px; background: var(--line-2); }

.g-axis { position: relative; height: 24px; }
.g-axis span {
  position: absolute;
  top: 3px;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
  padding-left: 5px;
}

.g-row { position: relative; height: 26px; border-top: 1px solid var(--line-2); }
.g-bar { position: absolute; top: 7px; height: 11px; border-radius: 3px; }
.g-bar.done { background: var(--accent); opacity: .7; }
.g-bar.run { background: linear-gradient(90deg, var(--accent-dim), transparent 85%); }
.g-bar.plan {
  background: repeating-linear-gradient(-45deg, var(--accent-dim) 0 1px, transparent 1px 5px);
  border: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent);
}
.g-bar.open {
  background: linear-gradient(90deg, var(--accent-dim), transparent);
  border-left: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}

.g-today { position: absolute; top: 0; bottom: 0; width: 1.5px; background: var(--accent); }
.g-today span {
  position: absolute;
  top: 1px;
  left: 5px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 11.5px;
  color: var(--accent);
  white-space: nowrap;
}

/* ── grid + panels ──────────────────────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(0, 2.1fr);
  gap: 14px;
  align-items: start;
}

.column { display: grid; gap: 14px; align-items: start; }

.panel {
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px 16px;
  box-shadow: 0 1px 2px var(--shadow);
}

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

.section-label {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 17.5px;
  color: var(--fg);
  margin: 0;
}

.head-count { font-size: 10.5px; color: var(--dim); letter-spacing: .04em; text-transform: uppercase; }

.explain {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13.5px;
  color: var(--dim);
  line-height: 1.45;
  margin: -6px 0 10px;
  max-width: 60ch;
}

.sub-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 8px;
}
.sub-label.rule-above { border-top: 1px solid var(--line-2); padding-top: 12px; margin-top: 14px; }

/* ── notable developments (shifts) ──────────────────────────────────── */

.shifts { list-style: none; margin: 0; padding: 0; }
.shift { padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.shift:first-child { padding-top: 0; }
.shift:last-child { border-bottom: none; padding-bottom: 0; }

.shift-line { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin: 0; }
.shift-what { color: var(--fg); font-size: 13.5px; font-weight: 500; line-height: 1.35; }
a.shift-what:hover { color: var(--accent); text-decoration: none; }

.shift-tag {
  font-size: 9px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
  padding-top: 3px;
}
.shift-tag.cb { color: var(--accent); }
.shift-tag.ai { color: var(--green); }

.shift-foryou {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
}

/* ── the morning brief ──────────────────────────────────────────────── */

.feature {
  display: block;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line-2);
  margin-bottom: 10px;
  color: var(--fg);
}
.feature:hover { text-decoration: none; }
.feature:hover .feature-title { color: var(--accent); }

.feat-meta {
  color: var(--dim);
  font-size: 10.5px;
  margin: 0 0 5px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.feat-meta b { color: var(--accent); font-weight: 600; }

.feature-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.18;
  margin: 0 0 5px;
  transition: color .25s;
}

.feature-excerpt {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
  margin: 0 0 6px;
  max-width: 66ch;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.more { color: var(--accent); font-size: 12px; }
.feature:hover .more { text-decoration: underline; text-underline-offset: 3px; }

.archive-cols { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }

.archive-item {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 5px 2px;
  border-bottom: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 12.5px;
}
.archive-item:hover { color: var(--fg); text-decoration: none; }
.archive-item:hover .archive-date { color: var(--accent); }
.archive-date { flex: 0 0 62px; color: var(--dim); font-size: 10.5px; }
.archive-title { line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.browse-all { display: inline-block; margin-top: 8px; font-size: 12px; }

/* ── in your court ──────────────────────────────────────────────────── */

.court { list-style: none; margin: 0; padding: 0; }
.court-item { padding: 9px 0; border-top: 1px solid var(--line-2); display: flex; gap: 10px; }
.court-item:first-child { border-top: none; padding-top: 0; }

.check {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  border: 1.5px solid var(--dim);
  border-radius: 5px;
  position: relative;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.check:hover { border-color: var(--accent); }
.check:disabled { opacity: .5; cursor: default; }
.court-item.done .check { border-color: var(--green); background: var(--green); }
.court-item.done .check::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 4px;
  border-left: 1.5px solid var(--accent-ink);
  border-bottom: 1.5px solid var(--accent-ink);
  transform: translate(2.5px, 3px) rotate(-45deg);
}

.court-title { margin: 0; font-size: 12.5px; font-weight: 500; color: var(--fg); line-height: 1.35; }
.court-item.done .court-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--line);
}
.court-note { margin: 1px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.court-foot { display: flex; gap: 9px; align-items: center; margin-top: 3px; }
.due { font-family: var(--font-display); font-style: italic; font-size: 12px; color: var(--accent); }
.owner { font-size: 10.5px; color: var(--dim); letter-spacing: .03em; }

/* ── milestones ─────────────────────────────────────────────────────── */

.miles { list-style: none; margin: 0; padding: 0; position: relative; }
.miles::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 8px;
  width: 1px;
  background: var(--line);
}

.mile {
  position: relative;
  padding: 0 0 10px 22px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}
.mile:last-child { padding-bottom: 0; }

.mile-node {
  position: absolute;
  left: 0;
  top: 4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--raise);
}
.mile.done .mile-node { border-color: var(--accent); background: var(--accent-dim); }
.mile.done .mile-node::after {
  content: "";
  position: absolute;
  inset: 2.5px;
  border-radius: 50%;
  background: var(--accent);
}
.mile.now .mile-node { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim); }
.mile.ahead .mile-node { border-style: dashed; }

.mile-title { font-size: 12.5px; color: var(--fg); font-weight: 500; line-height: 1.35; margin: 0; }
.mile.ahead .mile-title { color: var(--muted); font-weight: 400; }
.mile-date {
  font-size: 10.5px;
  color: var(--dim);
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.mile.now .mile-date { color: var(--accent); }

/* ── activity + documents + reading rows ────────────────────────────── */

.feed { list-style: none; margin: 0; padding: 0; }
.feed-item { padding: 7px 0; border-top: 1px solid var(--line-2); display: flex; gap: 10px; }
.feed-item:first-child { border-top: none; padding-top: 0; }
.feed-mark { flex: 0 0 auto; margin-top: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--dim); }
.feed-mark.edition { background: var(--accent); }
.feed-mark.doc { background: var(--green); }
.feed-mark.people { background: var(--gold); }
.feed-text { margin: 0; font-size: 12px; color: var(--fg); line-height: 1.4; }
.feed-text b { font-weight: 600; }
.feed-meta { margin: 1px 0 0; font-size: 10.5px; color: var(--dim); letter-spacing: .02em; }

.reads { list-style: none; margin: 0; padding: 0; }
.read { padding: 8px 0; border-top: 1px solid var(--line-2); }
.read:first-child { border-top: none; padding-top: 0; }
.read-title { font-size: 12.5px; font-weight: 500; line-height: 1.35; color: var(--fg); }
.read-title:hover { color: var(--accent); text-decoration: none; }
.read-why { margin: 2px 0 2px; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.read-meta { margin: 0; font-size: 10.5px; color: var(--dim); letter-spacing: .03em; }

.doc-remove {
  background: none;
  border: none;
  color: var(--dim);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 8px;
}
.doc-remove:hover { color: var(--accent); }

.read.quiet { color: var(--muted); font-size: 12.5px; }

.rail-note {
  margin: 10px 0 0;
  font-size: 11.5px;
  color: var(--dim);
  line-height: 1.5;
  border-top: 1px solid var(--line-2);
  padding-top: 10px;
}
.rail-note a { font-weight: 500; }

/* ── the edition view (reading measure) ─────────────────────────────── */

.view:has(.article) { max-width: 800px; margin: 0 auto; padding-top: 40px; }

.view:has(.messages-page) { max-width: 760px; margin: 0 auto; }

.back { display: inline-block; font-size: 13px; margin-bottom: 32px; color: var(--muted); }
.back:hover { color: var(--accent); text-decoration: none; }

.meta { color: var(--dim); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 8px; }

.article-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(27px, 4.4vw, 36px);
  line-height: 1.15;
  margin: 0 0 24px;
  max-width: 18em;
}

.prose { max-width: 64ch; }
.prose p { margin: 0 0 1.2em; color: var(--fg); opacity: .93; font-size: 15px; line-height: 1.75; }
.prose h3, .prose h4, .prose h5 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 20px;
  margin: 1.7em 0 .55em;
}
.prose a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-dim); text-underline-offset: 3px; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.3em; color: var(--fg); opacity: .93; }
.prose li { margin-bottom: .4em; line-height: 1.65; }
.prose blockquote {
  margin: 0 0 1.2em;
  padding-left: 16px;
  border-left: 2px solid var(--accent-dim);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
}
.prose blockquote p { opacity: 1; }

.credit {
  margin-top: 40px;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
  color: var(--dim);
  font-size: 12px;
}

/* ── messages view ──────────────────────────────────────────────────── */

.ledger { margin-bottom: 18px; }

.entry { padding: 11px 0 10px; border-bottom: 1px solid var(--line-2); }
.entry.client { padding-left: 13px; border-left: 2px solid var(--accent-dim); }
.entry-meta { display: flex; gap: 10px; align-items: baseline; margin: 0 0 3px; }
.entry-author { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.entry-time { font-size: 11px; color: var(--dim); }
.entry-body { margin: 0; white-space: pre-wrap; font-size: 13.5px; color: var(--fg); opacity: .93; line-height: 1.55; }

.composer-field {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--fg);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.55;
  padding: 11px 13px;
  resize: vertical;
}
.composer-field:focus { outline: none; border-color: var(--accent); }

.composer-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 9px; }
.composer-note { flex: 1; color: var(--dim); font-size: 12px; margin: 0; }

/* ── the gate ───────────────────────────────────────────────────────── */

.gate { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.gate-card { width: 100%; max-width: 400px; }

.gate-mark {
  display: block;
  width: 44px;
  height: 50px;
  margin-bottom: 12px;
  background: url("/assets/bergamot-watercolor.png") left center / contain no-repeat;
}
.gate-word {
  display: block;
  width: 190px;
  height: 63px;
  background: var(--fg);
  -webkit-mask: url("/assets/bergamot-wordmark.svg") left center / contain no-repeat;
  mask: url("/assets/bergamot-wordmark.svg") left center / contain no-repeat;
  margin-bottom: 6px;
}
.gate-sub { font-family: var(--font-display); font-style: italic; font-size: 17px; color: var(--muted); margin: 0 0 38px; }
.gate-title { font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 1.2; margin: 0 0 16px; }

.field-label { display: block; font-size: 12.5px; color: var(--dim); margin-bottom: 8px; }

.field {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
  font: inherit;
  font-size: 15px;
  padding: 8px 2px;
  margin-bottom: 24px;
}
.field:focus { outline: none; border-color: var(--accent); }

.button {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  letter-spacing: .04em;
  padding: 9px 20px;
  border-radius: 3px;
  cursor: pointer;
  transition: background .25s ease, color .25s ease;
}
.button:hover:not(:disabled) { background: var(--accent); color: var(--accent-ink); }
.button:disabled { opacity: .55; cursor: default; }
.button.ghost { border-color: var(--line); color: var(--muted); }

.gate-note { color: var(--muted); font-size: 13px; margin: 16px 0 0; min-height: 1.4em; }

/* ── responsive ─────────────────────────────────────────────────────── */

@media (max-width: 760px) {
  .masthead { grid-template-columns: 1fr; gap: 12px; }
}

@media (max-width: 860px) {
  .grid, .archive-cols { grid-template-columns: 1fr; }
  .identity .who { display: none; }
}

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