/* tabviz presentation pages. Same tokens as the app: one light theme, one
   accent, hairlines. Text column narrow, charts wide. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --accent: #1d5c4f;
  --accent-wash: #e6efec;
  --ink: #0b0b0b;
  --ink2: #52514e;
  --muted: #898781;
  --line: #e1e0d9;
  --line2: #c3c2b7;
  --page: #f6f6f3;
  --surface: #ffffff;
  --r: 6px;
}

body {
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--page);
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); }

.site-hdr {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.site-hdr .brand { font-weight: 700; color: var(--accent); text-decoration: none; font-size: 17px; letter-spacing: -.01em; }
.site-hdr nav { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; }
.site-hdr nav a { color: var(--ink2); text-decoration: none; }
.site-hdr nav a[aria-current] { color: var(--ink); font-weight: 600; }
.site-hdr .grow { flex: 1; }
.cta {
  display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: var(--r);
  background: var(--accent); color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap;
}
.cta:hover { filter: brightness(1.12); }
.cta.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

main { padding: 0 20px 64px; }
.col { max-width: 680px; margin: 0 auto; }
.wide { max-width: 1120px; margin: 0 auto; }

.lead { padding: 56px 0 28px; }
.kicker { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
h1 { font-size: clamp(28px, 4.4vw, 40px); line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
.lead p { font-size: 18px; color: var(--ink2); margin-top: 16px; }
.lead .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; align-items: center; }
.lead .actions small { color: var(--muted); font-size: 13px; }

h2 { font-size: 22px; letter-spacing: -.01em; margin: 48px 0 10px; }
h3 { font-size: 16px; margin: 22px 0 4px; }
p + p { margin-top: 12px; }
.col p, .col li { color: #2b2a28; }
ul.plain { list-style: none; }
ul.plain li { padding: 7px 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }
code { font: 14px ui-monospace, SFMono-Regular, Menlo, monospace; background: #edece7; padding: 1px 5px; border-radius: 4px; }

figure { margin: 28px auto; }
.frame { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; overflow: hidden; }
.frame svg { width: 100%; height: auto; display: block; user-select: none; touch-action: pan-y; }
figcaption { font-size: 14px; color: var(--ink2); margin-top: 8px; max-width: 680px; }
figcaption b { color: var(--ink); }
.try { display: inline-block; font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-wash); border-radius: 10px; padding: 1px 8px; margin-right: 6px; }
.frame.narrow { max-width: 860px; margin: 0 auto; }

table.syntax { width: 100%; border-collapse: collapse; font-size: 15px; margin-top: 8px; }
table.syntax td, table.syntax th { text-align: left; padding: 7px 10px 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.syntax th { font-size: 13px; color: var(--muted); font-weight: 500; }

.note { border-left: 3px solid var(--line2); padding: 4px 0 4px 14px; color: var(--ink2); font-size: 15px; margin-top: 18px; }
.status { font-size: 13px; color: var(--muted); }

.personas { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; }
@media (max-width: 640px) { .personas { grid-template-columns: 1fr; } }
.personas a { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; text-decoration: none; color: var(--ink); }
.personas a:hover { border-color: var(--accent); }
.personas b { display: block; margin-bottom: 4px; }
.personas span { color: var(--ink2); font-size: 14px; }

footer { border-top: 1px solid var(--line); padding: 20px; font-size: 13px; color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
footer a { color: var(--muted); }

/* Pieces the live samples borrow from the app */
.stage-demo text[data-edit], svg.editing text[data-field] { cursor: text; }
svg.editing text[data-edit]:hover, svg.editing text[data-field]:hover { text-decoration: underline; text-decoration-color: var(--accent); }
svg [data-hit] { cursor: pointer; }
.drop-target > rect:nth-of-type(1), .drop-target > rect:nth-of-type(2) { stroke: var(--accent); stroke-width: 3; }
.ied { position: fixed; z-index: 100; display: flex; flex-direction: column; gap: 2px; }
.ied input { height: 32px; border: 2px solid var(--accent); border-radius: var(--r); padding: 0 8px; font: inherit; font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.15); background: #fff; }
.ied input:focus { outline: none; }
.ied-hint { font-size: 11px; color: var(--ink2); background: #fff; border-radius: 4px; padding: 1px 6px; align-self: flex-start; box-shadow: 0 2px 6px rgba(0,0,0,.1); }
.ied textarea { border: 2px solid var(--accent); border-radius: var(--r); padding: 6px 8px; font: inherit; font-size: 14px; line-height: 1.4; box-shadow: 0 4px 16px rgba(0,0,0,.15); background: #fff; resize: vertical; }
.ied textarea:focus { outline: none; }
.ied.busy textarea { opacity: .6; }
.ied-list { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line2); border-radius: var(--r); box-shadow: 0 6px 20px rgba(0,0,0,.14); padding: 3px; max-height: 240px; overflow-y: auto; }
.ied-list button { display: flex; justify-content: space-between; gap: 12px; border: 0; background: none; text-align: left; padding: 5px 8px; border-radius: 4px; cursor: pointer; font: inherit; font-size: 13px; color: var(--ink); }
.ied-list button.on, .ied-list button:hover { background: var(--accent-wash); color: var(--accent); }
.ied-list small { color: var(--muted); }
.snack {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(12px); opacity: 0; pointer-events: none;
  background: #1f1f1d; color: #fff; padding: 9px 14px; border-radius: 8px; display: flex; gap: 12px; align-items: center;
  max-width: min(92vw, 640px); z-index: 200; transition: opacity .15s, transform .15s; font-size: 14px;
}
.snack.show { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
.snack.err { background: #b3261e; }
.demo-err { color: var(--muted); font-style: italic; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(127,127,127,.35); border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; }

/* Data format page */
.docs .widget { border-top: 1px solid var(--line); margin-top: 40px; }
.docs .widget h2 { margin-top: 32px; }
.docs ol.steps { padding-left: 22px; }
.docs ol.steps li { padding: 5px 0; color: #2b2a28; }
.docs pre.tsv { font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; overflow-x: auto; tab-size: 18; white-space: pre; }
.docs table.syntax { font-size: 14px; }
.docs table.syntax td small { color: var(--muted); }
.docs table.syntax code { font-size: 12.5px; }
.docs .col { max-width: 820px; }
.docs table.syntax td:first-child, .docs table.syntax th { white-space: nowrap; }
.docs table.syntax code { white-space: nowrap; }
.docs .lead p, .docs .note { overflow-wrap: break-word; }
@media (max-width: 640px) { .docs table.syntax { display: block; overflow-x: auto; } }

/* Sheet ⇄ chart (site/sync.js): a spreadsheet grid beside the live chart */
.sync { display: grid; grid-template-columns: minmax(0, 5fr) auto minmax(0, 7fr); gap: 14px; align-items: start; margin: 26px auto; }
@media (max-width: 860px) { .sync { grid-template-columns: 1fr; } .sync-link { transform: rotate(90deg); justify-self: center; } }
.sync-cap { font-size: 13px; font-weight: 600; color: var(--ink2); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.sync-cap small { font-weight: 400; color: var(--muted); }
.sync-dot { width: 10px; height: 10px; border-radius: 2px; background: #1e8e3e; display: inline-block; }
.sync-link { align-self: center; display: flex; flex-direction: column; align-items: center; color: var(--accent); }
.sync-link span { font-size: 24px; line-height: 1; }
.sync-link small { font-size: 11px; color: var(--muted); }
.sync-grid-wrap { background: var(--surface); border: 1px solid var(--line2); border-radius: 6px; overflow: auto; max-height: 460px; }
.sync-grid { border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.sync-grid th, .sync-grid td { border: 1px solid #e3e3e3; padding: 3px 7px; height: 24px; max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.sync-grid thead th, .sync-grid td.rn { background: #f8f9fa; color: #6b6a66; font-weight: 500; text-align: center; font-size: 11px; position: sticky; }
.sync-grid thead th { top: 0; z-index: 1; }
.sync-grid td.rn { left: 0; min-width: 28px; }
.sync-grid td.hd { font-weight: 700; background: #f3f6f4; }
.sync-grid td[data-r]:not(.hd) { cursor: cell; }
.sync-grid td.editing { outline: 2px solid var(--accent); outline-offset: -2px; white-space: normal; max-width: 300px; background: #fff; cursor: text; }
.sync-grid td.more { color: var(--muted); font-style: italic; }
@keyframes cellflash { from { background: #fff3c4; } to { background: transparent; } }
.sync-grid td.flash { animation: cellflash 1.6s ease-out; }
.sync-chart .frame { padding: 10px; }

/* Live demo page */
.demo-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.demo-tabs button { border: 1px solid var(--line2); background: var(--surface); border-radius: 16px; padding: 5px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.demo-tabs button[aria-selected=true] { border-color: var(--accent); color: var(--accent); background: var(--accent-wash); font-weight: 600; }
.fr { margin-top: 40px; border-top: 1px solid var(--line); }
footer span:last-child { flex-basis: 100%; text-align: center; font-size: 12px; }

/* ?og on the demo page: a 1200 × 630 preview, the Sheet and the chart only */
body.og { background: #fff; }
body.og .site-hdr, body.og .lead, body.og .demo-tabs, body.og .demo-more, body.og footer, body.og .gtools-version { display: none !important; }
body.og main { padding: 28px 30px 0; }
body.og .wide { max-width: none; }
body.og .sync { margin: 0; }
body.og .sync-grid-wrap { max-height: 520px; }
body.og > div[title="Click to copy"] { display: none !important; }
body.og .sync { grid-template-columns: 300px auto minmax(0, 1fr); align-items: center; min-height: 574px; }
body.og .sync-grid th:nth-child(n+5), body.og .sync-grid td:nth-child(n+5) { display: none; }
body.og .sync-grid th, body.og .sync-grid td { max-width: 150px; }
.sync > * { min-width: 0; }
.sync-chart .frame { overflow: hidden; }
