/* Realm Atlas - a vintage school atlas, not parchment: pale cream paper, pastel political fills, blue hairline
 * rivers, letterspaced small-caps serif labels, a ruled gazetteer column. The night atlas is the dark theme. */
:root, :root[data-theme="light"] {
  --paper: #f7f1e3; --paper-2: #efe6d2; --sheet: #fbf7ee; --ink: #33291f; --ink-2: #6a5d4c; --rule: #d8ccb4; --rule-2: #c6b796;
  --sea: #dbe8ec; --blue: #2d6aa3; --red: #a8433f; --amber: #b7791f; --green: #2f6b55; --sel: #1f5f8b; --chip: #e8dfca; --shadow: 0 1px 0 rgba(60, 45, 20, .08), 0 6px 18px rgba(60, 45, 20, .08);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; --sans: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif; --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --paper: #1c222c; --paper-2: #232b37; --sheet: #202833; --ink: #ece2cc; --ink-2: #b1a58f; --rule: #3a4452; --rule-2: #4a5566; --sea: #16202a; --blue: #7fb3e2; --red: #e07b72; --amber: #e3b25a; --green: #8fd0b5; --sel: #8cc7f0; --chip: #2c3644; --shadow: 0 6px 18px rgba(0, 0, 0, .35); color-scheme: dark; } }
:root[data-theme="dark"] { --paper: #1c222c; --paper-2: #232b37; --sheet: #202833; --ink: #ece2cc; --ink-2: #b1a58f; --rule: #3a4452; --rule-2: #4a5566; --sea: #16202a; --blue: #7fb3e2; --red: #e07b72; --amber: #e3b25a; --green: #8fd0b5; --sel: #8cc7f0; --chip: #2c3644; --shadow: 0 6px 18px rgba(0, 0, 0, .35); color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--serif); font-size: 15px; line-height: 1.5; }
a { color: var(--blue); }
.hidden { display: none !important; }
.mono { font-family: var(--mono); font-size: .86em; }
.muted { color: var(--ink-2); } .small { font-size: .86em; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }

/* Header: an atlas title strip with a double rule underneath. */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; border-bottom: 3px double var(--rule-2); background: var(--paper); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.backlink { font-family: var(--sans); font-size: 13px; text-decoration: none; color: var(--ink-2); }
.logo svg { display: block; } .lg-sheet { fill: #cfe0c3; stroke: var(--ink); stroke-width: 1.3; stroke-linejoin: round; } .lg-fold { stroke: var(--ink); stroke-width: .8; stroke-dasharray: 2 1.5; } .lg-river { fill: none; stroke: var(--blue); stroke-width: 1.4; }
.wordmark { font-size: 21px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-variant: small-caps; }
.tag { font-style: italic; color: var(--ink-2); font-size: 14px; }
.topactions { display: flex; align-items: center; gap: 8px; }
.credits { color: var(--ink-2); }
.topup { font-family: var(--sans); font-size: 13px; }
.tbtn { background: transparent; border: 1px solid var(--rule-2); border-radius: 3px; padding: 4px 10px; font-family: var(--sans); font-size: 13px; }
.tbtn:hover:not(:disabled) { background: var(--chip); }
.tbtn.icon { min-width: 32px; padding: 4px 6px; font-size: 15px; }

/* Template and lane strip. */
.laneBar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 22px; padding: 10px 18px; border-bottom: 1px solid var(--rule); background: var(--paper-2); }
.tgroup { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tlabel { font-variant: small-caps; letter-spacing: .12em; color: var(--ink-2); font-size: 13px; margin-right: 2px; }
.pill { border: 1px solid var(--rule-2); background: var(--sheet); border-radius: 999px; padding: 3px 12px; font-size: 14px; }
.pill:hover { border-color: var(--ink-2); }
.pill.quiet { background: transparent; font-style: italic; }
.lane { display: flex; flex-direction: column; align-items: flex-start; border: 1px solid var(--rule-2); background: var(--sheet); border-radius: 4px; padding: 3px 12px 4px; line-height: 1.2; text-align: left; }
.lane b { font-variant: small-caps; letter-spacing: .1em; font-size: 15px; } .lane small { color: var(--ink-2); font-size: 12px; font-style: italic; }
.lane.on { border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--ink); }

/* The atlas: map column + ruled gazetteer column. */
.atlas { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 0; align-items: start; min-height: calc(100vh - 140px); }
.mapcol { padding: 12px 16px 16px; min-width: 0; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 10px; font-family: var(--sans); font-size: 13px; }
.tool { border: 1px solid var(--rule-2); background: var(--sheet); border-radius: 3px; padding: 4px 10px; font-family: var(--sans); font-size: 13px; }
.tool.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.toolbar select { border: 1px solid var(--rule-2); background: var(--sheet); border-radius: 3px; padding: 3px 4px; font-family: var(--sans); font-size: 13px; }
.seg { gap: 0; }
.seg-b { border: 1px solid var(--rule-2); background: var(--sheet); padding: 4px 10px; font-family: var(--sans); font-size: 13px; margin-left: -1px; }
.seg-b:first-child { border-radius: 3px 0 0 3px; margin-left: 0; } .seg-b:last-child { border-radius: 0 3px 3px 0; }
.seg-b.on { background: var(--chip); font-weight: 600; box-shadow: inset 0 -2px 0 var(--ink); }
.tmenu { position: relative; }
.tmenu summary { list-style: none; cursor: pointer; border: 1px solid var(--rule-2); border-radius: 3px; padding: 4px 10px; background: var(--sheet); }
.tmenu summary::-webkit-details-marker { display: none; }
.tmenu summary::after { content: " ▾"; color: var(--ink-2); }
.tmenu .menu { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 210px; background: var(--sheet); border: 1px solid var(--rule-2); border-radius: 4px; box-shadow: var(--shadow); padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.tmenu.files .menu { left: auto; right: 0; }
.tmenu label { display: flex; gap: 6px; align-items: center; }
.mini { border: 1px solid var(--rule-2); background: var(--sheet); border-radius: 3px; padding: 3px 9px; font-family: var(--sans); font-size: 13px; text-align: left; }
.mini:hover:not(:disabled) { border-color: var(--ink-2); }
.mini.danger { color: var(--red); border-color: var(--red); }
.mini.quiet { background: transparent; }
.mapwrap { position: relative; background: var(--sea); border: 1px solid var(--rule-2); box-shadow: var(--shadow); border-radius: 2px; overflow: hidden; touch-action: none; }
.mapwrap.drop { outline: 3px dashed var(--blue); outline-offset: -6px; }
.map { display: block; width: 100%; height: auto; aspect-ratio: 10 / 7; user-select: none; -webkit-user-select: none; }
.map[data-tool="region"], .map[data-tool="river"], .map[data-tool="road"], .map[data-tool="place"] { cursor: crosshair; }
.map .vtx, .map .mid { cursor: grab; }
.map .place, .map .dispute, .map .ghost, .map .finding { cursor: pointer; }
.map .region:hover { filter: brightness(1.04) saturate(1.1); }
.hovercard { position: absolute; z-index: 5; max-width: 260px; pointer-events: none; background: var(--sheet); border: 1px solid var(--rule-2); box-shadow: var(--shadow); padding: 8px 10px; border-radius: 3px; font-size: 13px; line-height: 1.35; display: flex; flex-direction: column; gap: 3px; }
.hovercard strong { font-variant: small-caps; letter-spacing: .08em; font-size: 14px; }
.hc-facts { color: var(--ink-2); font-style: italic; } .hc-lore { color: var(--ink); }
.toolhint { margin: 8px 2px 0; font-size: 13px; font-style: italic; color: var(--ink-2); }
.statusline { margin: 2px 2px 0; color: var(--ink-2); min-height: 1.4em; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 12.5px; color: var(--ink-2); }
.lg-item { display: inline-flex; align-items: center; gap: 5px; } .lg-sw { width: 14px; height: 10px; border: 1px solid var(--rule-2); display: inline-block; }

/* Gazetteer column: ruled like a printed index. */
.side { background: var(--sheet); border-left: 3px double var(--rule-2); min-height: 100%; position: sticky; top: 0; max-height: 100vh; overflow: auto; }
.sheettoggle { display: none; }
.tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--rule-2); position: sticky; top: 0; background: var(--sheet); z-index: 3; }
.tab { flex: 1 1 auto; background: transparent; border: 0; border-bottom: 3px solid transparent; padding: 9px 6px 7px; font-variant: small-caps; letter-spacing: .08em; font-size: 14px; color: var(--ink-2); }
.tab.on { color: var(--ink); border-bottom-color: var(--ink); }
.count { display: inline-block; min-width: 1.6em; padding: 0 4px; border-radius: 8px; background: var(--chip); color: var(--ink); font-size: 11px; text-align: center; }
.count.bad { background: var(--red); color: var(--paper); }
.pane { padding: 12px 16px 24px; }
.worldbox { display: flex; flex-wrap: wrap; gap: 8px 10px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); margin-bottom: 10px; }
.fld { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--ink-2); flex: 1 1 140px; }
.fld.narrow { flex: 0 0 auto; flex-direction: row; align-items: center; gap: 6px; } .fld.narrow input { width: 70px; }
.fld.block { flex-basis: 100%; }
.fld input, .fld select, .fld textarea { background: var(--paper); border: 1px solid var(--rule-2); border-radius: 3px; padding: 4px 7px; font-size: 14px; color: var(--ink); width: 100%; }
.fld textarea { resize: vertical; font-size: 13.5px; }
.unit { font-size: 13px; }
.totals { flex-basis: 100%; margin: 2px 0 0; font-size: 12.5px; color: var(--ink-2); font-style: italic; }
.nosel { font-style: italic; color: var(--ink-2); font-size: 14px; padding: 6px 0 12px; }
.selbox { border: 1px solid var(--rule-2); background: var(--paper); border-radius: 3px; padding: 10px 12px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.selhead { display: flex; justify-content: space-between; align-items: center; }
.selhead h3 { margin: 0; font-size: 13px; font-family: var(--mono); color: var(--ink-2); font-weight: 400; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.selfacts, .selfind { margin: 0; padding-left: 18px; font-size: 13px; }
.selfacts li::marker { color: var(--ink-2); }
.gazlist, .placelist, .findlist, .historylist { list-style: none; margin: 0; padding: 0; }
.gz { padding: 9px 4px 10px; border-bottom: 1px solid var(--rule); cursor: pointer; }
.gz:hover, .gz.on { background: var(--paper); }
.gz.on { box-shadow: inset 3px 0 0 var(--sel); }
.gz-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.swatch { width: 12px; height: 12px; border: 1px solid var(--rule-2); border-radius: 2px; flex: 0 0 auto; }
.gz-name { font-variant: small-caps; letter-spacing: .1em; font-size: 16px; font-weight: 600; }
.gz-id { color: var(--ink-2); font-size: 11px; }
.gz-facts { margin: 2px 0 0 19px; font-size: 13px; font-style: italic; color: var(--ink-2); }
.gz-more { margin: 2px 0 0 19px; font-size: 12.5px; color: var(--ink-2); }
.gz-epithet { margin: 3px 0 0 19px; font-size: 13.5px; }
.chip { display: inline-block; font-family: var(--sans); font-size: 11px; padding: 0 7px; border-radius: 9px; background: var(--chip); color: var(--ink-2); }
.chip.warn, .chip.breaks { background: var(--amber); color: #fff; } .chip.ok, .chip.accepted { background: var(--green); color: #fff; } .chip.invalid, .chip.declined { background: var(--rule-2); color: var(--ink); }
.pl { display: grid; grid-template-columns: 70px 1fr; gap: 0 8px; padding: 7px 4px; border-bottom: 1px solid var(--rule); cursor: pointer; font-size: 14px; }
.pl.on, .pl:hover { background: var(--paper); }
.pl-kind { font-variant: small-caps; color: var(--ink-2); } .pl-name { font-weight: 600; } .pl-where { grid-column: 2; font-size: 12.5px; font-style: italic; color: var(--ink-2); }
.finding { display: flex; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--rule); font-size: 14px; cursor: pointer; }
.finding.error { color: var(--red); } .finding.warn { color: var(--amber); } .finding.info { color: var(--ink-2); }
.fn { flex: 0 0 auto; }
.flash { animation: flash 1.2s ease; } @keyframes flash { from { background: var(--chip); } to { background: transparent; } }
.rules { margin-top: 14px; font-size: 13px; color: var(--ink-2); } .rules summary { cursor: pointer; font-variant: small-caps; letter-spacing: .08em; }
.none { color: var(--ink-2); font-style: italic; }

/* Chronicle (the run lanes). */
.runform { display: flex; flex-direction: column; gap: 8px; }
.lanehead { margin: 0; font-size: 14px; } .lanechip { font-size: 12px; background: var(--ink); color: var(--paper); }
.lanenote { color: var(--ink-2); font-style: italic; }
.flabel { margin: 4px 0; font-variant: small-caps; letter-spacing: .08em; font-size: 13px; color: var(--ink-2); }
.focuslist { display: flex; flex-wrap: wrap; gap: 5px; }
.fchip { display: inline-flex; align-items: center; gap: 3px; border: 1px solid var(--rule-2); border-radius: 999px; padding: 2px 10px 2px 6px; font-size: 13.5px; background: var(--paper); cursor: pointer; }
.fchip.on { border-color: var(--ink); background: var(--chip); } .fchip.stale { border-style: dashed; border-color: var(--amber); }
.stalewrap { border-left: 3px solid var(--amber); padding: 4px 10px; background: var(--paper); font-size: 13px; }
.stalenote { margin: 0 0 6px; }
.meter { margin: 0; color: var(--ink-2); font-size: 12px; }
.clip, .runnote { margin: 0; font-size: 13px; color: var(--ink-2); font-style: italic; }
.rungate { margin: 0; font-size: 13.5px; padding: 6px 10px; background: var(--paper); border: 1px solid var(--rule-2); }
.gateaction { margin-left: 4px; }
.primary { background: var(--ink); color: var(--paper); border: 0; border-radius: 3px; padding: 9px 16px; font-variant: small-caps; letter-spacing: .1em; font-size: 16px; }
.primary:hover:not(:disabled) { background: var(--blue); }
.progress { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--rule-2); background: var(--paper); }
.progress h4 { margin: 0 0 4px; font-variant: small-caps; letter-spacing: .08em; }
.steps { list-style: none; margin: 6px 0 0; padding: 0; font-size: 14px; }
.step { color: var(--ink-2); } .step.active { color: var(--ink); font-weight: 600; } .step.done { color: var(--green); }
.result { margin-top: 14px; }
.result h3 { margin: 0; font-variant: small-caps; letter-spacing: .1em; font-size: 18px; }
.headline { margin: 4px 0 8px; font-style: italic; font-size: 15px; }
.partial { color: var(--amber); font-size: 13.5px; }
.reconsum { font-size: 13px; padding: 5px 9px; border-left: 3px solid var(--green); background: var(--paper); }
.reconsum.warn { border-color: var(--amber); } .reconsum.bad { border-color: var(--red); }
.lore-card { border-top: 1px solid var(--rule-2); padding: 10px 0 6px; }
.lore-card h4, .sellore h4, .tradeout h4 { margin: 0; font-variant: small-caps; letter-spacing: .1em; font-size: 16px; }
.epithet { margin: 2px 0 6px; font-style: italic; color: var(--ink-2); }
.lore-text { margin: 0 0 8px; text-align: justify; hyphens: auto; }
.sent.flagged { text-decoration: underline wavy var(--red); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.flag-inline { display: inline; font-family: var(--sans); font-size: 11.5px; padding: 0 5px; border-radius: 3px; background: transparent; }
.flag-inline.error { color: var(--red); border: 1px solid var(--red); } .flag-inline.warn { color: var(--amber); border: 1px solid var(--amber); }
.lore-facts { display: grid; grid-template-columns: 82px 1fr; gap: 3px 10px; margin: 0; font-size: 13.5px; }
.lore-facts dt { font-variant: small-caps; color: var(--ink-2); letter-spacing: .06em; }
.lore-facts dd { margin: 0; }
.flags { list-style: none; margin: 3px 0 0; padding: 0; }
.flag { font-family: var(--sans); font-size: 12px; } .flag.error { color: var(--red); } .flag.warn { color: var(--amber); }
.updated { font-size: 13px; background: var(--paper); padding: 4px 8px; border-left: 3px solid var(--blue); }
.currency { font-size: 14px; }
.props { list-style: none; margin: 6px 0 10px; padding: 0; counter-reset: none; }
.prop { border: 1px solid var(--rule-2); border-radius: 3px; padding: 8px 10px; margin-bottom: 7px; background: var(--paper); }
.prop.accepted { border-color: var(--green); } .prop.declined, .prop.invalid { opacity: .7; }
.prop-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.pn { display: inline-flex; justify-content: center; align-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--green); color: #fff; font-size: 11px; }
.prop.breaks .pn { background: var(--amber); } .prop.invalid .pn { background: var(--rule-2); }
.pd { font-weight: 600; flex: 1 1 60%; }
.why { margin: 4px 0; font-size: 13.5px; }
.prop-act { display: flex; gap: 6px; margin-top: 4px; }
.res, .press { padding-left: 18px; font-size: 13.5px; margin: 4px 0 10px; }
.flows { width: 100%; border-collapse: collapse; font-size: 13px; margin: 4px 0 10px; }
.flows th { text-align: left; font-variant: small-caps; color: var(--ink-2); border-bottom: 1px solid var(--rule-2); font-weight: 400; }
.flows td { border-bottom: 1px solid var(--rule); padding: 3px 4px 3px 0; vertical-align: top; }
.flows tr.flagged td { color: var(--red); }
.handoff { margin: 4px 0 10px; font-weight: 600; }
.resactions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.runmeta { color: var(--ink-2); margin-top: 6px; }
.raw pre { white-space: pre-wrap; font-size: 12px; background: var(--paper); padding: 8px; max-height: 300px; overflow: auto; }
.how { font-size: 13.5px; color: var(--ink-2); }
.hist-btn { width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--rule); padding: 8px 4px; display: flex; flex-direction: column; }
.hist-btn:hover { background: var(--paper); }
.hist-title { font-variant: small-caps; letter-spacing: .08em; font-weight: 600; } .hist-meta { font-size: 12.5px; color: var(--ink-2); }

.foot { border-top: 3px double var(--rule-2); padding: 12px 18px 24px; font-size: 13px; color: var(--ink-2); background: var(--paper); }
.foot p { margin: 4px 0; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: flex; flex-direction: column; gap: 6px; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 3px; font-family: var(--sans); font-size: 13px; box-shadow: var(--shadow); transition: opacity .5s; }
.toast.err { background: var(--red); } .toast a { color: inherit; font-weight: 600; } .toast.gone { opacity: 0; }
.printsheet { display: none; }

/* Narrow screens: the map goes full width and pans; the gazetteer becomes a bottom sheet. */
@media (max-width: 900px) {
  .atlas { display: block; padding-bottom: 64px; }
  .mapcol { padding: 10px 12px 12px; }
  .topbar, .laneBar { padding-left: 12px; padding-right: 12px; }
  .tag { display: none; }
  .side { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 30; max-height: 48px; min-height: 0; overflow: hidden; border-left: 0; border-top: 3px double var(--rule-2); box-shadow: 0 -6px 18px rgba(60, 45, 20, .15); transition: max-height .25s ease; }
  .side.open { max-height: 78vh; overflow: auto; }
  .sheettoggle { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 46px; border: 0; background: var(--sheet); font-variant: small-caps; letter-spacing: .1em; font-size: 15px; position: sticky; top: 0; z-index: 4; }
  .grip { width: 36px; height: 4px; border-radius: 2px; background: var(--rule-2); }
  .tabs { top: 46px; }
  .toasts { bottom: 60px; }
  .tmenu .menu { position: fixed; left: 12px; right: 12px; top: auto; min-width: 0; }
  .lane small { display: none; }
}

@media print {
  body { background: #fff; color: #000; }
  body > *:not(.printsheet) { display: none !important; }
  .printsheet { display: block !important; }
  .page { break-after: page; page-break-after: always; padding: 6mm 4mm; font-family: var(--serif); color: #222; }
  .page h1 { font-variant: small-caps; letter-spacing: .14em; text-align: center; font-size: 26pt; margin: 0 0 6mm; }
  .page h2 { font-variant: small-caps; letter-spacing: .12em; font-size: 20pt; margin: 0; border-bottom: 3px double #999; }
  .print-map svg { width: 100%; height: auto; } .mini-map svg { width: 100%; max-height: 95mm; height: auto; border: 1px solid #999; margin: 3mm 0; }
  .seed { font-style: italic; } .totals { text-align: center; color: #555; }
  .lore-facts { grid-template-columns: 30mm 1fr; }
  .flag-inline, .flags { font-size: 8pt; }
}

/* Docs pages (api.html, tokens.html). */
.sep { color: var(--rule-2); }
.doc { max-width: 940px; margin: 0 auto; padding: 24px 16px 40px; }
.doc h1 { font-variant: small-caps; letter-spacing: .1em; font-size: clamp(22px, 4vw, 32px); line-height: 1.15; margin: 0 0 14px; }
.doc h2 { font-variant: small-caps; letter-spacing: .08em; font-size: 19px; margin: 30px 0 8px; border-bottom: 3px double var(--rule-2); padding-bottom: 4px; }
.doc h3 { margin-top: 20px; font-size: 16px; }
.doc pre { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 3px; padding: 12px; overflow-x: auto; font: 12px/1.5 var(--mono); margin: 0 0 8px; max-width: 100%; }
.doc table { border-collapse: collapse; width: 100%; font-size: 13.5px; display: block; overflow-x: auto; }
.doc th, .doc td { border-bottom: 1px solid var(--rule); padding: 6px 8px; text-align: left; vertical-align: top; }
.doc code { font: 12px var(--mono); background: var(--chip); padding: 0 3px; border-radius: 3px; overflow-wrap: anywhere; }
.doc pre code { background: none; padding: 0; overflow-wrap: normal; }
.codegroup { margin: 8px 0 16px; }
.codegroup .tabs { display: flex; flex-wrap: wrap; gap: 2px; margin: 0 0 -1px; border: 0; position: static; background: none; }
.codegroup .tab { flex: none; background: var(--sheet); border: 1px solid var(--rule); border-bottom: 0; border-radius: 3px 3px 0 0; padding: 5px 10px; font: 12px/1.2 var(--mono); font-variant: normal; letter-spacing: 0; color: var(--ink-2); }
.codegroup .tab.active { color: var(--ink); border-color: var(--ink-2); background: var(--paper-2); }
.statebox { background: var(--sheet); border: 1px solid var(--rule-2); border-radius: 3px; padding: 14px; }
.statebox p { margin: 4px 0; }
.tokenrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; align-items: center; }
.tokenrow .primary { width: auto; }
.tokenbox { font: 12px var(--mono); background: var(--paper-2); border: 1px solid var(--rule); border-radius: 3px; padding: 8px 12px; word-break: break-all; flex: 1; }
