@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/vendor/fonts/newsreader@5.3.0/newsreader-latin-opsz-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("/vendor/fonts/newsreader@5.3.0/newsreader-latin-opsz-italic.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 400;
  font-display: swap;
  src: url("/vendor/fonts/ibm-plex-sans@5.3.0/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 500;
  font-display: swap;
  src: url("/vendor/fonts/ibm-plex-sans@5.3.0/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
}

:root {
  --paper: #F4F1EF;
  --card: #FCFAF9;
  --ink: #1A1617;
  --ink-2: #403A3B;
  --muted: #77706F;
  --rule: #DDD7D4;
  --accent: #7A2668;
  --accent-soft: #EBD5E1;
  --serif: "Newsreader", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--paper); }
body { font-family: var(--sans); color: var(--ink); -webkit-font-smoothing: antialiased; font-size: 15px; line-height: 1.5; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.015em; margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.shell { max-width: 1080px; margin: 0 auto; padding: 0 40px; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }


.topbar { display: flex; align-items: baseline; gap: 12px 24px; flex-wrap: wrap; padding: 40px 0 28px; }
.topbar-meta { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: baseline; font-size: 13px; color: var(--muted); }
.topbar-meta .account { color: var(--ink); }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-self: center; }
.muted { color: var(--muted); }

.button {
  font: inherit; font-size: 13px; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--rule); background: transparent; color: var(--ink-2);
}
.button:hover { border-color: var(--ink); color: var(--ink); }
.button:disabled { opacity: 0.45; cursor: default; }
.cta {
  font-family: var(--serif); font-size: 21px; font-style: italic; color: var(--ink);
  background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px;
}
.cta:hover { color: var(--accent); }
.link-button { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; cursor: pointer; }
.link-button:hover { color: var(--ink); }
.link-button:disabled { color: var(--muted); text-decoration: none; cursor: default; }

.lede { font-family: var(--serif); font-size: 21px; font-weight: 300; line-height: 1.5; color: var(--ink-2); margin: 0; max-width: 600px; text-wrap: pretty; }
.loading { padding: 160px 0; text-align: center; font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--muted); }
.empty { color: var(--ink-2); font-family: var(--serif); font-size: 19px; margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Connect */
.connect { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 24px; padding: 48px 0; max-width: 760px; }
.connect h1 { font-size: clamp(42px, 5.4vw, 64px); font-weight: 300; line-height: 1.06; letter-spacing: -0.02em; text-wrap: balance; }
.connect h1 em { color: var(--accent); }
.connect > .button { align-self: flex-start; }
.connect-actions { display: flex; gap: 8px; }
.connect-form { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; margin-top: 12px; }
.connect-form label { font-size: 13px; color: var(--muted); }
.subdomain-field { display: flex; align-items: baseline; border-bottom: 1px solid var(--ink-2); max-width: 100%; }
.subdomain-field:focus-within { border-color: var(--accent); }
.subdomain-field .affix { color: var(--muted); font-family: var(--serif); font-size: 22px; font-weight: 300; }
.subdomain-field input { border: 0; background: transparent; font-family: var(--serif); font-size: 22px; padding: 6px 4px; width: 11ch; min-width: 0; outline: none; color: var(--ink); }
.subdomain-field input::placeholder { color: var(--rule); }
.form-error { color: var(--accent); font-size: 14px; margin: 0; min-height: 21px; }

/* The brief */
.status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); padding: 0 0 20px; }
.status[hidden] { display: none; }
.status-note { font-size: 13px; color: var(--muted); }
.spinner { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--rule); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

.dashboard { display: flex; flex-direction: column; gap: 72px; padding-bottom: 88px; }
.dashboard > div:empty { display: none; }
.masthead { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; padding-top: 24px; }
.masthead h1 { font-size: clamp(44px, 5.6vw, 68px); font-weight: 300; line-height: 1.06; letter-spacing: -0.022em; max-width: 900px; text-wrap: balance; }
.masthead h1:empty { display: none; }
.masthead h1 em { color: var(--accent); }
.standfirst { font-family: var(--serif); font-size: 21px; font-weight: 300; line-height: 1.55; color: var(--ink-2); margin: 0; max-width: 680px; text-wrap: pretty; }
.standfirst:empty { display: none; }
.masthead-actions { margin: 0; font-size: 14px; }
.masthead-actions:has([hidden]) { display: none; }

.chapter-head { font-size: 28px; font-weight: 300; padding-top: 16px; margin-bottom: 24px; border-top: 1px solid var(--ink); }

.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metric { padding: 4px 20px 4px 0; display: flex; flex-direction: column; gap: 6px; }
.metric + .metric { padding-left: 20px; border-left: 1px solid var(--rule); }
.metric-label { font-size: 13px; color: var(--muted); }
.metric-value { font-family: var(--serif); font-size: 44px; font-weight: 300; line-height: 1.05; font-variant-numeric: lining-nums tabular-nums; }
.metric-change { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.bad { color: var(--accent); }

.setting { display: block; margin-top: 20px; font-size: 13px; color: var(--muted); }
.setting input { font: inherit; width: 3.5em; padding: 2px 4px; margin: 0 4px; border: 0; border-bottom: 1px solid var(--ink-2); background: transparent; color: var(--ink); text-align: center; }
.findings { list-style: none; margin: 0; padding: 0; counter-reset: finding; }
.finding { display: grid; grid-template-columns: 56px 1fr auto; column-gap: 8px; align-items: baseline; padding: 20px 0; border-bottom: 1px solid var(--rule); counter-increment: finding; }
.finding::before { content: counter(finding, decimal-leading-zero); grid-row: 1 / span 3; font-family: var(--serif); font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.finding-kind { grid-column: 2; font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--accent); }
.finding p { grid-column: 2; margin: 4px 0 0; font-family: var(--serif); font-size: 26px; font-weight: 300; line-height: 1.3; letter-spacing: -0.01em; max-width: 760px; text-wrap: pretty; }
.prescription { grid-column: 2; margin: 8px 0 0; font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--ink-2); max-width: 680px; }
.finding .link-button { grid-column: 3; grid-row: 1 / span 3; align-self: center; font-size: 13px; white-space: nowrap; }
.finding.quiet { grid-template-columns: 1fr; }
.finding.quiet::before { content: none; }
.finding.quiet p { grid-column: 1; color: var(--ink-2); }

.legend-row { margin: 0 0 20px; font-size: 13px; color: var(--muted); }
.legend { display: inline-block; width: 10px; height: 10px; margin: 0 6px 0 14px; vertical-align: -1px; }
.legend:first-child { margin-left: 0; }
.legend.this { background: var(--accent); }
.legend.last { background: var(--accent-soft); }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.bars li { display: grid; grid-template-columns: minmax(140px, 280px) 1fr 48px; align-items: center; gap: 18px; }
.bar-label { font-family: var(--serif); font-size: 17px; text-align: right; background: none; border: 0; padding: 4px 0; color: var(--ink); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-label:hover { color: var(--accent); }
.bar-track { position: relative; height: 20px; }
.bar { position: absolute; left: 0; }
.bar.last { top: 0; bottom: 0; background: var(--accent-soft); }
.bar.this { top: 6px; bottom: 6px; background: var(--accent); }
.bar.this.other { background: var(--muted); }
.bar-value { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--ink-2); }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--rule); white-space: nowrap; }
th:first-child, td:first-child { padding-left: 0; }
thead th { font-weight: 400; font-size: 13px; color: var(--muted); border-bottom-color: var(--ink); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.sort { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.sort:hover { color: var(--ink); }
tbody th { font-weight: 400; white-space: normal; min-width: 220px; }
.row-link { font-family: var(--serif); font-size: 17px; text-align: left; background: none; border: 0; padding: 0; color: var(--ink); cursor: pointer; }
.row-link:hover { color: var(--accent); }
tr.selected .row-link { color: var(--accent); }

.sheet {
  position: fixed; inset: 0 0 0 auto; margin: 0; width: min(560px, 100vw); height: 100dvh; max-height: none; max-width: none;
  padding: 0; border: 0; border-left: 1px solid var(--rule); background: var(--paper); color: var(--ink);
  box-shadow: -24px 0 48px rgba(26, 22, 23, 0.08);
  transform: translateX(100%);
  /* allow-discrete keeps the dialog in the top layer until the slide-out finishes. */
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), overlay 0.28s allow-discrete, display 0.28s allow-discrete;
}
.sheet[open] { transform: translateX(0); }
@starting-style { .sheet[open] { transform: translateX(100%); } }
.sheet::backdrop {
  background: rgba(26, 22, 23, 0);
  transition: background 0.28s ease, overlay 0.28s allow-discrete, display 0.28s allow-discrete;
}
.sheet[open]::backdrop { background: rgba(26, 22, 23, 0.18); }
@starting-style { .sheet[open]::backdrop { background: rgba(26, 22, 23, 0); } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet::backdrop { transition: none; } }
.sheet-body { height: 100%; overflow-y: auto; padding: 40px 36px; }
.sheet-close { position: absolute; top: 14px; right: 16px; width: 32px; height: 32px; font-size: 22px; line-height: 1; color: var(--muted); background: none; border: 0; border-radius: 50%; cursor: pointer; }
.sheet-close:hover { color: var(--ink); background: var(--card); }
.detail-card { display: flex; flex-direction: column; gap: 12px; }
.detail-card h2 { font-size: 30px; font-weight: 300; padding-right: 32px; }
.detail-stats { font-family: var(--sans) !important; font-size: 13px !important; color: var(--muted) !important; }
.detail-card p { margin: 0; max-width: 720px; font-family: var(--serif); font-size: 18px; color: var(--ink-2); }
.detail-card h4 { font-family: var(--serif); font-size: 17px; font-weight: 400; color: var(--ink); margin: 0 0 10px; }
.detail-grid { display: flex; flex-direction: column; gap: 28px; margin-top: 12px; }
.examples { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.examples a { font-variant-numeric: tabular-nums; color: var(--muted); margin-right: 6px; }
.daily { display: flex; align-items: flex-end; gap: 3px; height: 96px; }
.day { flex: 1; background: var(--accent-soft); }
.day.this { background: var(--accent); }
.playbook { margin-top: 12px; }
.playbook .playbook-note { margin: 0; font-family: var(--serif); font-style: italic; color: var(--muted); }
.playbook-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.playbook-row { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.playbook-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.playbook .playbook-title { margin: 0; font-family: var(--serif); font-size: 18px; color: var(--ink); }
.playbook .playbook-description { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.playbook-head .link-button { font-size: 13px; white-space: nowrap; }
.draft:empty { display: none; }
.draft-text { margin-top: 14px; padding: 2px 0 2px 16px; border-left: 2px solid var(--accent); font-family: var(--serif); font-size: 17px; line-height: 1.6; color: var(--ink); white-space: pre-wrap; outline: none; }
.draft-text:focus { border-left-color: var(--ink); }
.playbook .draft-foot { display: flex; gap: 12px; align-items: baseline; margin: 10px 0 0 18px; font-size: 13px; }
.playbook code { font-size: 12px; padding: 1px 4px; background: var(--accent-soft); color: var(--ink); border-radius: 3px; }
.action-status p { margin: 10px 0 0; font-size: 13px; }
.action-status .draft-foot { margin-left: 0; }
.action-confirm { color: var(--ink-2); }
.action-buttons { display: flex; gap: 16px; align-items: baseline; }
.action-controls { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.action-controls select { font: inherit; padding: 2px 4px; border: 0; border-bottom: 1px solid var(--ink-2); background: transparent; color: var(--ink); max-width: 240px; }
.action-controls input { accent-color: var(--accent); }
.note-action { margin: 10px 0 0 18px; font-size: 13px; }
.daily-axis { display: flex; justify-content: space-between; font-size: 12px; margin-top: 6px; }

@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 24px; }
  .metric, .metric + .metric { padding: 0 16px 0 0; border-left: 0; }
  .bars li { grid-template-columns: minmax(100px, 160px) 1fr 40px; gap: 10px; }
}

@media (max-width: 640px) {
  .shell { padding: 0 16px; }
  .topbar-actions { margin-left: 0; }
  .subdomain-field .affix:first-child { display: none; }
  .finding { grid-template-columns: 32px 1fr; }
  .sheet-body { padding: 32px 20px; }
  .finding .link-button { grid-column: 2; grid-row: auto; margin-top: 8px; justify-self: start; }
  .finding p { font-size: 22px; }
}
