
:root {
  --ink: #0B0D10;
  --nexus: #3B82F6;
  --spoke: #93C5FD;
  --color-bg: #F4F7FB;
  --color-surface: #FFFFFF;
  --color-surface-muted: #E8EEF5;
  --color-text-muted: #5C6570;
  --color-border: #D5DDE8;
  --color-glow: rgba(59, 130, 246, 0.28);
  --radius-md: 10px;
}
* { box-sizing: border-box; }
body {
  font: 16px/1.5 "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  margin: 0; color: var(--ink); background: #fff;
}
body.gate { max-width: 28rem; margin: 4rem auto; padding: 0 1.5rem; }
body.app { background: var(--color-bg); }
h1 { font-size: 1.4rem; margin: 0 0 0.6rem; }
h2 { font-size: 1.1rem; margin-top: 2rem; }
label { display: block; margin-top: 0.9rem; }
input, select { font: inherit; padding: 0.4rem 0.5rem; color: var(--ink); }
body.gate input { width: 100%; }
button {
  margin-top: 1.2rem; font: inherit; padding: 0.4rem 0.9rem; cursor: pointer;
  background: var(--nexus); color: #fff; border: 1px solid var(--nexus);
  border-radius: 6px;
}
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--nexus); outline-offset: 2px;
}
.error { color: #8a1f1f; }
.notice { color: #1f5c2f; }
.hint, .env { color: var(--color-text-muted); font-size: 0.9rem; }
code { background: #f2f2f2; padding: 0.1em 0.35em; border-radius: 3px; }
table { border-collapse: collapse; width: 100%; margin-top: 0.8rem; }
th, td {
  border-bottom: 1px solid var(--color-border); padding: 0.45rem 0.6rem;
  text-align: left; vertical-align: top; font-size: 0.95rem;
}
th {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--color-text-muted);
}
td form { display: inline; }
td button, td select, .otp button {
  margin-top: 0; font-size: 0.9rem; background: #fff; color: var(--ink);
  border-color: var(--color-border);
}
.otp button { margin-top: 0.6rem; }
.flag { font-size: 0.8rem; color: var(--color-text-muted); }
.off { color: #8a1f1f; }
.row-actions { white-space: nowrap; }
.new-user { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: flex-end; }
.new-user label { margin-top: 0; flex: 1 1 12rem; }
.new-user button { margin-top: 0; }
.new-user input, .new-user select { width: 100%; }
.otp {
  border: 2px solid #1f5c2f; background: #f3f8f4; padding: 0.8rem 1rem;
  margin-top: 1rem;
}
.otp input { font-family: ui-monospace, monospace; margin-top: 0.4rem; width: 100%; }
.shell { display: flex; min-height: 100vh; }
.rail {
  width: 232px; flex-shrink: 0; background: var(--ink); color: #E8EEF6;
  border-right: 1px solid #1c2430; padding: 14px 10px;
}
.logo {
  font-weight: 700; letter-spacing: 0.08em; font-size: 13px;
  color: var(--spoke); padding: 10px 12px 18px; margin: 0;
}
.logo span { color: var(--nexus); }
.group-label {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--spoke); padding: 12px 12px 6px; margin: 0;
}
.rail ul { list-style: none; margin: 0; padding: 0; }
.rail a {
  display: flex; align-items: center; gap: 10px; color: #E8EEF6;
  text-decoration: none; font-size: 13.5px; padding: 7px 10px;
  border-radius: 8px; border: 1px solid transparent;
}
.rail a::before {
  content: ""; width: 6px; height: 6px; border-radius: 99px;
  background: currentColor; flex-shrink: 0;
}
.rail a:hover { background: #161b22; }
.rail li.active a {
  color: var(--spoke); border-color: var(--nexus);
  box-shadow: 0 0 0 1px var(--nexus), 0 0 18px var(--color-glow);
}
.workspace { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 52px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; border-bottom: 1px solid var(--color-border);
  background: var(--color-surface); position: relative; z-index: 5;
}
.crumb { margin: 0; font-size: 13px; color: var(--color-text-muted); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.bell > summary, .avatar > summary {
  width: 34px; height: 34px; border-radius: 999px;
  border: 1px solid var(--color-border); display: grid; place-items: center;
  background: transparent; color: var(--ink);
}
.avatar > summary {
  border-color: var(--nexus); color: var(--nexus); font-weight: 700;
  font-size: 11px; box-shadow: 0 0 10px var(--color-glow);
}
.icon { width: 16px; height: 16px; display: block; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px;
  background: #fff; border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(11, 13, 16, 0.12);
  z-index: 6; padding: 6px;
}
.who { margin: 0; padding: 8px 10px; font-size: 13px; }
.who span, .empty-note { color: var(--color-text-muted); }
.empty-note { margin: 0; padding: 8px 10px; font-size: 13px; }
.menu-panel a {
  display: block; padding: 8px 10px; color: var(--ink); text-decoration: none;
  font-size: 13px; border-radius: 6px;
}
.menu-panel a:hover { background: var(--color-surface-muted); }
.menu-panel button {
  width: 100%; margin-top: 4px; background: #fff; color: var(--ink);
  border-color: var(--color-border);
}
.canvas-wrap {
  padding: 20px 22px 40px;
  background-image: radial-gradient(rgba(59, 130, 246, 0.16) 1px, transparent 1px);
  background-size: 18px 18px; flex: 1;
}
.panel {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 16px 18px 20px;
}
.canvas {
  min-height: 280px; border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  display: grid; place-items: center; text-align: center; padding: 28px;
  color: var(--color-text-muted);
}
.canvas strong { color: var(--ink); }
/* ThetaSignal Queue (SIG1). Tab strip, count chips, and the draft rows. */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; }
.tabs a {
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
  color: var(--ink); font-size: 13.5px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--color-border); background: var(--color-surface);
}
.tabs a:hover { background: var(--color-surface-muted); }
.tabs li.active a {
  border-color: var(--nexus); color: var(--nexus); font-weight: 600;
  box-shadow: 0 0 0 1px var(--nexus), 0 0 14px var(--color-glow);
}
.count {
  font-size: 11px; line-height: 1; padding: 3px 7px; border-radius: 999px;
  background: var(--color-surface-muted); color: var(--color-text-muted);
}
.tabs li.active .count { background: var(--nexus); color: #fff; }
.drafts { list-style: none; margin: 0; padding: 0; }
.draft {
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-surface); padding: 12px 14px; margin-bottom: 8px;
}
.draft p { margin: 0 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 11px; letter-spacing: 0.02em; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--color-border); color: var(--color-text-muted);
  background: var(--color-bg);
}
.chip-revision { border-color: #8a1f1f; color: #8a1f1f; background: #fbf2f2; }
/* ThetaSignal Accounts (P0-SIG2). One card per account: the 30-day figures, the
   top posts, and the Typefully social-set control. */
.sections { margin-bottom: 10px; }
.account {
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-surface); padding: 12px 14px; margin-bottom: 10px;
}
.account h3 { margin: 0 0 6px; font-size: 15px; display: flex;
  flex-wrap: wrap; gap: 8px; align-items: center; }
.figures { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 4px; font-size: 13.5px; }
.figures strong { font-variant-numeric: tabular-nums; }
.figures span { color: var(--color-text-muted); }
.figures strong { color: var(--ink); }
.as-of { margin: 0 0 8px; font-size: 12px; color: var(--color-text-muted); }
.top-posts { list-style: none; margin: 0 0 10px; padding: 0; }
.top-posts li {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline;
  padding: 4px 0; border-top: 1px dotted var(--color-border); font-size: 13px;
}
.top-posts a { color: var(--nexus); }
.map-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.map-row select { max-width: 22rem; }
.waiting {
  border: 1px dashed var(--color-border); border-radius: var(--radius-md);
  padding: 10px 12px; margin: 0 0 12px; color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.72);
}
/* ThetaSignal Analysis (P0-SIG3, LS-24). The control strip, the 7x24
   best-day/hour heatmap, the breakdown panels and the ranked list. */
.controls {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--color-border);
  border-radius: var(--radius-md); background: var(--color-surface);
}
.controls label { margin-top: 0; font-size: 12px; color: var(--color-text-muted); }
.controls select, .controls input[type="number"] { display: block; margin-top: 2px; }
.controls button { margin-top: 0; }
.controls .toggle { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.controls .toggle input { margin: 0; }
.subpanel {
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-surface); padding: 12px 14px; margin: 0 0 12px;
}
.subpanel h2 { margin: 0 0 4px; font-size: 1rem; }
.subpanel > p.hint { margin: 0 0 8px; }
.best {
  margin: 0 0 10px; padding: 8px 10px; border-radius: var(--radius-md);
  border: 1px solid var(--nexus); background: rgba(59, 130, 246, 0.08);
  font-size: 13.5px;
}
.heat-scroll { overflow-x: auto; }
table.heatmap { width: auto; min-width: 100%; table-layout: fixed; }
table.heatmap th, table.heatmap td {
  border: 1px solid var(--color-border); padding: 0; text-align: center;
  font-size: 11px; font-variant-numeric: tabular-nums;
}
table.heatmap th { text-transform: none; letter-spacing: 0; padding: 2px 3px; }
table.heatmap th[scope="row"] { width: 3.2rem; text-align: left; padding-left: 6px; }
table.heatmap td { width: 1.55rem; height: 1.55rem; color: var(--ink); }
td.cell.blank { background: var(--color-bg); color: transparent; }
td.cell.thin { background: var(--color-surface-muted); color: var(--color-text-muted); }
td.cell.heat-1 { background: rgba(59, 130, 246, 0.12); }
td.cell.heat-2 { background: rgba(59, 130, 246, 0.26); }
td.cell.heat-3 { background: rgba(59, 130, 246, 0.42); }
td.cell.heat-4 { background: rgba(59, 130, 246, 0.60); color: #fff; }
td.cell.heat-5 { background: rgba(59, 130, 246, 0.78); color: #fff; }
.thin-note { color: var(--color-text-muted); font-size: 12px; }
.ranked { list-style: none; margin: 0; padding: 0; counter-reset: ranked; }
.ranked li {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline;
  padding: 6px 0; border-top: 1px dotted var(--color-border); font-size: 13px;
}
.ranked li:first-child { border-top: 0; }
.ranked .place {
  font-variant-numeric: tabular-nums; color: var(--color-text-muted);
  min-width: 1.6rem;
}
.ranked a { color: var(--nexus); }
.ranked .figure { font-variant-numeric: tabular-nums; font-weight: 600; }
.chip-maturing { border-color: #8a5a1f; color: #8a5a1f; background: #fcf6ee; }
.detail-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.detail-grid > section { flex: 1 1 18rem; min-width: 0; }
/* Brand Positioning (SIG6, LS-36). The walkthrough's two columns: the interview
   on the left, the live draft on the right. One column under 768px, where the
   .shell rule below already stacks the rail. */
.positioning { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.positioning > section { min-width: 0; }
.positioning textarea {
  width: 100%; box-sizing: border-box; min-height: 5.5rem; resize: vertical;
  font: inherit; padding: 6px 8px; border: 1px solid var(--color-border);
  border-radius: var(--radius-md); background: var(--color-surface);
}
.positioning .transcript { list-style: none; margin: 0 0 10px; padding: 0; }
.positioning .transcript li {
  padding: 4px 0; border-top: 1px dotted var(--color-border); font-size: 13px;
}
.positioning .transcript li:first-child { border-top: 0; }
.positioning .who { font-weight: 600; margin-right: 6px; }
.version-line {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline;
  margin: 0 0 10px; font-size: 13.5px; color: var(--color-text-muted);
}
.version-line .figure { color: var(--ink); font-weight: 600; }
.history { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.history li {
  padding: 5px 0; border-top: 1px dotted var(--color-border);
}
.history li:first-child { border-top: 0; }
.history a { color: var(--nexus); }
@media (max-width: 768px) {
  .positioning { grid-template-columns: 1fr; }
}
.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
/* Integrations (P0-NX1). Status pills and provider cards. */
.pill {
  display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px;
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em;
  border: 1px solid var(--color-border); color: var(--color-text-muted);
}
.pill.connected { color: #1f5c2f; border-color: #1f5c2f; }
.pill.expired, .pill.error { color: #8a5a1f; border-color: #8a5a1f; }
.pill.revoked { color: #8a1f1f; border-color: #8a1f1f; }
.provider { border-bottom: 1px solid var(--color-border); padding: 0.9rem 0; }
.provider:last-of-type { border-bottom: 0; }
.provider h3 { margin: 0 0 0.2rem; font-size: 1rem; }
.provider .kind { font-size: 0.8rem; color: var(--color-text-muted); }
.provider-actions { margin-top: 0.6rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.provider-actions form { display: inline; }
.provider-actions button { margin-top: 0; font-size: 0.9rem; }
.activity { font-size: 0.9rem; }
@media (max-width: 768px) {
  .shell { flex-direction: column; }
  .rail { width: auto; }
}
