:root {
  --bg: #f5f5f3;
  --panel: #ffffff;
  --soft: #f0f1f2;
  --line: #d9dde2;
  --text: #17191c;
  --muted: #6d737c;
  --accent: #1769e0;
  --accent-edge: #0f5fc6;
  --warn: #b7791f;
  --danger: #c53030;
  --shadow: 0 10px 30px rgba(20, 24, 32, 0.1);
  --hover: #f3f4f5;
  --hover-line: #e3e5e8;
  --icon: #eef2f7;
  --icon-ink: #1d4f91;
  --label: #4f545b;
  --label-soft: #7b8087;
  --canvas: #eceeed;
  --field: #fafafa;
  --wash: #eef3fa;
  --sheet: #f7fafc;
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  min-height: 100dvh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.topbar {
  height: 68px;
  min-height: 68px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  z-index: 5;
}
.word {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: -0.04em;
  margin-right: 8px;
  color: #17191c;
}
.mark {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 2px;
  background: #fff url("../favicon.svg?v=32") center / 36px 36px no-repeat;
  box-shadow: none;
}
.top-tools { display: flex; gap: 8px; align-items: center; }
.icon-btn, .ghost, .primary, .seg button, .frame-grid button, .nav-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: #222;
  border-radius: 12px;
  min-height: 40px;
}
.icon-btn { width: 40px; padding: 0; }
.primary {
  border: 1px solid var(--accent-edge);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  padding: 0 14px;
  box-shadow: none;
}
.ghost { padding: 0 14px; background: #fff; color: #222; font-weight: 800; }
#btn-delete { color: #9f1d1d; }
.export-top { margin-left: auto; }

.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr) 325px;
  border-top: 1px solid var(--line);
}
.rail-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 17px 14px;
  background: #fff;
  border-right: 1px solid var(--line);
  min-height: 0;
  overflow: auto;
}
.nav-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 52px;
  padding: 11px;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 650;
  color: #34383d;
  border-color: transparent;
  background: transparent;
}
.nav-btn strong {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--icon);
  color: var(--icon-ink);
  font-size: 15px;
  font-weight: 700;
}
.nav-btn.on, .nav-btn:hover {
  background: var(--hover);
  border-color: var(--hover-line);
  color: #111;
}
.nav-btn.on { box-shadow: inset 3px 0 0 var(--accent); }

.stage { min-width: 0; min-height: 0; position: relative; background: var(--canvas); }
#viewport { position: absolute; inset: 0; touch-action: none; }
#view { width: 100%; height: 100%; display: block; }
#overlay { position: absolute; inset: 0; pointer-events: none; }
#overlay .sel, #overlay .handle, #overlay .found, #overlay .warn, #overlay .compare-ui, #overlay .pill { pointer-events: auto; }

.flyer-loading {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(236, 238, 237, 0.94);
  pointer-events: auto;
}
.flyer-loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 168px;
  padding: 22px 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.flyer-loading p {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.flyer-spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #d5d9de;
  border-top-color: var(--accent);
  animation: flyer-spin 0.75s linear infinite;
}
@keyframes flyer-spin {
  to { transform: rotate(360deg); }
}

.landing {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 32px;
  overflow: auto;
  pointer-events: auto;
  touch-action: auto;
  background: var(--canvas);
}
body.editor .landing { display: none; }
.landing-card {
  width: min(640px, 100%);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.eyebrow {
  color: var(--label-soft);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 900;
  margin: 0 0 10px;
}
.landing h1 {
  margin: 0;
  font-size: clamp(2.15rem, 5vw, 4.3rem);
  line-height: 0.94;
  letter-spacing: -0.07em;
  font-weight: 900;
  color: #12141a;
}
.local {
  color: var(--muted);
  margin: 16px 0 0;
  line-height: 1.48;
}
.drop {
  width: 100%;
  margin-top: 22px;
  padding: 28px 20px;
  text-align: center;
  border-radius: 18px;
  border: 1.5px dashed #3a4354;
  background: #fafafa;
  box-shadow: none;
}
.drop.hot { background: var(--wash); border-color: var(--accent); }
.drop p { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.canvas-drop {
  position: absolute;
  inset: 10px;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border: 2px dashed var(--accent);
  border-radius: 18px;
  background: rgba(238, 243, 250, 0.94);
  pointer-events: none;
}
.canvas-drop p {
  margin: 0;
  max-width: 280px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-align: center;
}
.row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.row .primary, .row .ghost { min-height: 48px; }
.demo-link {
  margin-top: 14px;
  background: none;
  border: 0;
  color: var(--accent);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 8px 0;
}

.pill, .found, .warn {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--text);
}
.pill {
  position: absolute;
  top: 12px;
  left: 12px;
  max-width: min(440px, calc(100% - 24px));
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
}
.pill.ok { color: var(--accent); }
.pill.bad { color: var(--danger); }
.pill.wait { color: var(--warn); }
.warn {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 58px;
  border-radius: 18px;
  padding: 12px;
}
.warn p { margin: 0 0 8px; }
.warn { border-color: var(--danger); color: var(--danger); background: #fff; }
.found {
  position: absolute;
  left: 50%;
  right: auto;
  top: auto;
  bottom: 16px;
  z-index: 4;
  width: max-content;
  max-width: min(420px, calc(100% - 24px));
  translate: -50% 0;
  border-radius: 999px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  touch-action: none;
  user-select: none;
  cursor: grab;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.found:not([hidden]) { animation: toast-in 0.28s ease; }
.found.dragging { transition: none; cursor: grabbing; animation: none; }
.found.out { opacity: 0; animation: none; }
@keyframes toast-in {
  from { opacity: 0; translate: -50% 14px; }
  to { opacity: 1; translate: -50% 0; }
}
.sel {
  position: absolute;
  border: 2px solid var(--accent);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
  background: transparent;
  cursor: grab;
  touch-action: none;
}
.handle {
  position: absolute;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  touch-action: none;
  transform: translate(-50%, -50%);
}
.handle::before { content: ""; position: absolute; inset: -14px; }
.handle.nw { left: 0; top: 0; }
.handle.ne { left: 100%; top: 0; }
.handle.sw { left: 0; top: 100%; }
.handle.se { left: 100%; top: 100%; }
.handle.rot { left: 50%; top: 0; transform: translate(-50%, -36px); cursor: alias; }
.handle.q { position: absolute; z-index: 3; }
#quad { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.layer-strip {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 14px;
}
.chip {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: #222;
  padding: 6px 10px;
  min-height: 36px;
  font-weight: 800;
  box-shadow: var(--shadow);
}
.chip.on { border-color: var(--accent); color: var(--accent); background: var(--wash); }
.chip .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--danger);
}
.chip .dot.ok { background: var(--accent); box-shadow: 0 0 14px rgba(169, 255, 104, 0.65); }
.compare-ui {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: var(--shadow);
}
.compare-ui input { flex: 1; accent-color: var(--accent); }

.inspector-col { display: block; min-width: 0; }
#inspector {
  margin: 0;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  padding: 17px 14px;
  overflow: auto;
  min-height: 0;
  background: #fff;
  box-shadow: none;
}
body:not(.editor) #inspector { opacity: 0.55; pointer-events: none; }
#inspector h2 { margin: 0 0 18px; font-size: 18px; letter-spacing: -0.03em; font-weight: 800; }
#inspector section { display: none; }
#inspector[data-panel="select"] [data-sec="select"],
#inspector[data-panel="link"] [data-sec="link"],
#inspector[data-panel="style"] [data-sec="style"],
#inspector[data-panel="background"] [data-sec="background"],
#inspector[data-panel="test"] [data-sec="test"],
#inspector[data-panel="export"] [data-sec="export"] { display: block; }
#inspector[data-panel="style"] [data-sec="background"] { display: block; margin-top: 16px; }
.help, .note, .reasons { color: var(--muted); line-height: 1.45; font-size: 13px; }
label {
  display: block;
  margin: 16px 0 7px;
  font-size: 12px;
  font-weight: 800;
  color: var(--label);
}
.rot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 16px 0 7px;
}
.rot-head label { margin: 0; min-width: 0; }
#btn-rot-reset {
  flex: 0 0 auto;
  min-height: 28px;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid #d9dde2;
  background: #fff;
  color: #222;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
input[type="text"], input[type="url"], input[type="email"], input[type="tel"], input[type="number"], select, textarea {
  width: 100%;
  min-height: 44px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
  color: #111;
  padding: 11px 12px;
}
textarea { min-height: 88px; resize: vertical; }
input[type="color"] {
  width: 31px;
  height: 31px;
  border: 0;
  background: none;
  padding: 0;
}
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pair > div {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
}
.pair label { margin: 0; color: var(--muted); font-size: 11px; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.seg, .frame-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button, .frame-grid button { padding: 8px 10px; min-height: 40px; font-weight: 800; }
.seg button.on, .frame-grid button.on {
  background: var(--wash);
  border-color: var(--accent);
  color: var(--accent);
}
.nav-btn.on { color: #111; }
.error { color: var(--danger); min-height: 1.2em; font-size: 13px; }
.payload { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; color: var(--muted); }
.meter {
  margin: 8px 0;
  padding: 13px;
  border-radius: 15px;
  border: 1px solid rgba(169, 255, 104, 0.2);
  background: var(--sheet);
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  font-weight: 800;
}
.meter.excellent, .meter.good { color: var(--accent); }
.meter.risky { color: var(--warn); }
.meter.unscannable { color: var(--danger); }
.stack { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.stack .primary, .stack .ghost { min-height: 48px; width: 100%; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--label); font-size: 12px; font-weight: 800; }
.check input { width: auto; }

.mobile-bar { display: none; }
.flyer-actions { display: none; }
.style-iso { display: none; }

.export-screen:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(23, 25, 28, 0.46);
}
.export-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  max-height: min(100%, calc(100dvh - 32px));
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px 18px 18px;
}
.export-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}
.export-card h2 {
  margin: 0 0 6px;
  padding-right: 36px;
  font-size: 1.7rem;
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.export-status {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.export-screen.failed .export-status { color: var(--danger); }
.export-progress {
  height: 6px;
  margin-top: 16px;
  border-radius: 999px;
  background: var(--soft);
  overflow: hidden;
  flex: none;
}
.export-progress span {
  display: block;
  height: 100%;
  width: 38%;
  border-radius: inherit;
  background: var(--accent);
  animation: export-slide 1.1s ease-in-out infinite;
}
@keyframes export-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
.ad-slot-export {
  display: flex;
  flex: none;
  width: 100%;
  height: 120px;
  min-height: 100px;
  max-height: 220px;
  margin-top: 16px;
  border-radius: 12px;
}
#export-download {
  position: relative;
  z-index: 1;
  flex: none;
  width: 100%;
  min-height: 48px;
  margin-top: 16px;
}
.replace-flyer:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  background: rgba(23, 25, 28, 0.46);
}
.replace-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px 18px 18px;
}
.replace-card h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  letter-spacing: -0.04em;
  line-height: 1.1;
}
.replace-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.replace-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.replace-actions .ghost,
.replace-actions .primary {
  flex: 1 1 140px;
  min-height: 48px;
}

[data-ad-spot] {
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f6f7f8;
  color: #8b919a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px dashed #d0d5dc;
}
[data-ad-spot].ad-slot-pending { pointer-events: none; user-select: none; }
[data-ad-spot] .adsbygoogle { display: block; width: 100%; height: 100%; }
.ad-slot-mobile { display: none; }
.ad-slot-rail,
.ad-slot-inspector { display: flex; }
.ad-slot-rail {
  flex: 0 0 160px;
  height: 160px;
  margin-top: auto;
  border-radius: 12px;
}
.ad-slot-inspector {
  flex: 0 0 160px;
  height: 160px;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
}

@media (min-width: 960px) {
  .inspector-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #fff;
    border-left: 1px solid var(--line);
  }
  .inspector-col #inspector {
    flex: 1 1 auto;
    border-left: 0;
  }
  .ad-slot-mobile { display: none; }
  .ad-slot-rail,
  .ad-slot-inspector { display: flex; }
}

@media (max-width: 959px) {
  html {
    height: 100%;
    overflow: hidden;
  }
  body {
    height: 100%;
    min-height: 0;
    padding-top: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .topbar {
    height: 60px;
    min-height: 60px;
    padding: 0 12px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 8;
  }
  .workspace {
    display: flex;
    flex-direction: column;
    flex: none;
    min-height: auto;
    overflow: visible;
    border-top: 0;
    padding-top: 60px;
  }
  .rail-left { display: none; }
  .inspector-col { display: block; overflow: visible; border: 0; background: transparent; }
  .ad-slot-rail,
  .ad-slot-inspector { display: none; }
  .ad-slot-mobile {
    display: flex;
    flex: none;
    width: 100%;
    height: 100px;
    min-height: 100px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }
  .stage {
    flex: none;
    height: calc(100dvh - 284px);
    min-height: 240px;
  }
  .top-tools .ghost { display: none; }
  .flyer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: center;
    box-sizing: border-box;
    height: 56px;
    padding: 0 12px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 60px;
    z-index: 7;
  }
  .flyer-actions .ghost {
    min-height: 40px;
    width: 100%;
  }
  .mobile-bar {
    position: sticky;
    top: 116px;
    bottom: auto;
    left: auto;
    right: auto;
    z-index: 7;
    margin: 0;
    gap: 4px;
    padding: 7px;
    border-radius: 0;
    border: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: #fff;
    box-shadow: none;
  }
  #inspector {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    max-height: none;
    overflow: visible;
    z-index: 1;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    transform: none;
    display: none;
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }
  body.editor #inspector.open { display: block; }
  body:not(.editor) #inspector { display: none; }
  #inspector[data-panel="style"] { padding-top: 0; }
  #inspector[data-panel="style"] #panel-title { display: none; }
  #inspector[data-panel="style"] .style-iso {
    display: block;
    position: sticky;
    top: 184px;
    z-index: 6;
    margin: 0 -14px 14px;
    padding: 10px 14px 12px;
    background: #fff;
    border-bottom: 1px solid var(--line);
  }
  #style-preview {
    width: 100%;
    height: 176px;
    display: block;
    border-radius: 14px;
    background: var(--canvas);
  }
  .mobile-bar { display: grid; grid-template-columns: repeat(5, 1fr); }
  .mobile-bar .nav-btn {
    min-height: 52px;
    padding: 8px 3px;
    border: 0;
    border-radius: 10px;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    color: #444;
    background: transparent;
    font-size: 10px;
    font-weight: 700;
    box-shadow: none;
  }
  .mobile-bar .nav-btn strong {
    width: auto;
    height: auto;
    background: transparent;
    color: inherit;
    font-size: 16px;
  }
  .mobile-bar .nav-btn.on {
    color: var(--accent);
    background: var(--wash);
    border-color: transparent;
    box-shadow: none;
  }
  .landing { display: none; }
  .drop { padding: 16px; }
  .row .primary, .row .ghost, .demo-link { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .found { animation: none; }
  .export-progress span { animation: none; width: 100%; }
  .flyer-spinner { animation: none; border-top-color: var(--accent); }
}


a.word { text-decoration: none; color: inherit; }
a.ghost { text-decoration: none; display: inline-flex; align-items: center; }
.doc-back { margin-left: auto; }

.rail-legal {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 14px;
}
.rail-legal p {
  margin: 0 11px 4px;
  color: var(--label-soft);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.rail-legal a {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 11px;
  border-radius: 10px;
  color: #34383d;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
}
.rail-legal a:hover { background: var(--hover); color: #111; }

.legal-mobile { display: none; }

body.doc {
  display: block;
  height: auto;
  min-height: 100dvh;
  overflow: auto;
  background: var(--bg);
}
.doc-wrap {
  width: min(760px, calc(100% - 32px));
  margin: 24px auto 72px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 32px 36px;
}
.doc-wrap h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
  font-weight: 900;
}
.doc-meta { color: var(--muted); margin: 12px 0 0; }
.doc-wrap h2 {
  margin: 28px 0 8px;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}
.doc-wrap p, .doc-wrap li { line-height: 1.55; font-size: 16px; }
.doc-wrap ul { margin: 8px 0 0; padding-left: 1.2em; }
.doc-wrap li { margin: 4px 0; }
.doc-wrap a { color: var(--accent); }
.doc-wrap code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
}
.doc-more {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.doc-more a {
  color: #34383d;
  font-weight: 750;
  text-decoration: none;
}
.doc-more a[aria-current="page"] { color: var(--accent); }

@media (max-width: 959px) {
  html.doc { height: auto; overflow: auto; }
  body.doc {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    display: block;
  }
  body.doc .topbar { position: static; height: auto; min-height: 60px; }
  .doc-wrap { padding: 22px 18px 28px; margin-top: 16px; }
  .legal-mobile {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex: none;
    padding: 12px 12px 14px;
    background: #fff;
    border-bottom: 1px solid var(--line);
  }
  .legal-mobile a {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
  }
}
