:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --header: #ffffff;
  --ink: #111113;
  --muted: #5c616b;
  --line: #e4e5e9;
  --blue: #111113;
  --blue-dark: #000000;
  --wash: #f4f5f7;
  --stage: #eceef1;
  --shadow: 0 18px 50px rgba(17, 17, 19, 0.06);
  --radius: 12px;
  color: var(--ink);
  background: var(--bg);
  color-scheme: light;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
html[data-theme="dark"] {
  --bg: #101012;
  --surface: #1c1c1f;
  --header: #141416;
  --ink: #f4f4f5;
  --muted: #a1a1aa;
  --line: #2c2c31;
  --blue: #f4f4f5;
  --blue-dark: #ffffff;
  --wash: #26262b;
  --stage: #0c0c0e;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; min-width: 320px; overflow-x: clip; }
button, input, select, a, summary { font: inherit; color: inherit; touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.72; }
img, svg { display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app { min-height: 100vh; background: var(--bg); }
.app.editing {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--stage);
}

.header {
  height: calc(52px + env(safe-area-inset-top));
  min-height: 0;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: env(safe-area-inset-top) 16px 0;
  background: var(--header);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  max-width: 100%;
}
.app.editing .header { border-bottom-color: rgba(18, 20, 26, 0.06); }

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 0;
  font-weight: 650;
  letter-spacing: -0.04em;
  font-size: 15px;
  flex: 0 0 auto;
}
.logo img { width: 22px; height: 22px; }

.header nav {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
}
.header nav a:hover { color: var(--ink); }
.header .btn { margin-left: auto; }
.header nav + .btn { margin-left: 0; }
.header nav { margin-right: auto; }

.btn {
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 600;
  background: transparent;
}
.btn.primary {
  background: var(--ink);
  color: var(--bg);
}
.btn.primary:hover:not(:disabled) { background: var(--blue-dark); }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.ghost {
  background: var(--wash);
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn.ghost:hover:not(:disabled) { border-color: var(--muted); background: var(--surface); }
.btn.text { color: var(--muted); }
.btn.text:hover { color: var(--ink); }
.btn.wide { width: 100%; }

.hero {
  padding: 54px 20px 28px;
  text-align: center;
}
.eyebrow {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 14px auto 0;
  max-width: min(18ch, 100%);
  font-size: clamp(40px, 5.4vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 650;
}
.hero h1 span { color: var(--blue); }
.lede {
  max-width: 560px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.drop {
  width: min(640px, calc(100% - 8px));
  margin: 34px auto 0;
  min-height: 280px;
  padding: 36px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--wash);
  color: var(--muted);
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.drop:hover, .drop.dragging {
  border-color: var(--ink);
  background: var(--surface);
}
.drop strong {
  color: var(--ink);
  font-size: 22px;
  letter-spacing: -0.03em;
}
.drop-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(17, 17, 19, 0.06);
  margin-bottom: 8px;
}
.drop-icon svg { width: 36px; height: 36px; }
.pills { display: flex; gap: 8px; margin-top: 10px; }
.pills em {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
}
.form-error {
  margin: 14px auto 0;
  color: #b42318;
  font-weight: 600;
  font-size: 14px;
}
.trust {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding: 0;
  margin: 26px auto 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.trust li { display: flex; align-items: center; gap: 8px; }
.trust li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
}

.wrap { width: min(1080px, calc(100% - 40px)); margin: 0 auto; }
.wrap.narrow { width: min(760px, calc(100% - 40px)); }
.band { background: var(--wash); padding: 72px 0; margin-top: 28px; content-visibility: auto; contain-intrinsic-size: auto 520px; }
.band h2, .steps h2, .faq h2 {
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.045em;
}
.section-lead { color: var(--muted); margin-top: 8px; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 28px;
}
.cards article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
}
.cards h3 { margin: 0 0 6px; letter-spacing: -0.03em; font-size: 17px; }
.cards p { color: var(--muted); line-height: 1.5; font-size: 14.5px; }
.icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #eef2ff;
  color: var(--blue);
}
.icon svg { width: 26px; height: 26px; }

.steps { padding: 72px 0; content-visibility: auto; contain-intrinsic-size: auto 420px; }
.steps ol {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.steps li {
  display: flex;
  gap: 14px;
  padding: 8px 8px 0 0;
}
.steps li > span {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--bg);
  font-weight: 800;
}
.steps h3 { letter-spacing: -0.03em; margin-bottom: 6px; }
.steps p { color: var(--muted); line-height: 1.5; font-size: 15px; }

.faq { padding: 10px 0 80px; content-visibility: auto; contain-intrinsic-size: auto 640px; }
.faq details {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  font-weight: 700;
  letter-spacing: -0.02em;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 500; font-size: 22px; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); line-height: 1.6; margin-top: 8px; max-width: 62ch; }

.footer { border-top: 1px solid var(--line); padding: 22px 0 28px; }
.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}
.footer strong { color: var(--ink); letter-spacing: -0.04em; }

.drop-shield {
  position: fixed;
  inset: 16px;
  z-index: 40;
  border: 1px solid var(--ink);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 24px;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.03em;
  text-align: center;
  pointer-events: none;
}

.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
}
.stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: 28px;
  min-width: 0;
  min-height: 0;
}
.frame {
  position: relative;
  width: fit-content;
  max-width: 100%;
  line-height: 0;
  touch-action: none;
  user-select: none;
}
.frame canvas {
  display: block;
  max-width: min(920px, 100%);
  max-height: calc(100vh - 148px);
  width: auto;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(18, 20, 26, 0.16);
  background-color: #f7f8fb;
  background-image:
    linear-gradient(45deg, #e4e7ee 25%, transparent 25%),
    linear-gradient(-45deg, #e4e7ee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e4e7ee 75%),
    linear-gradient(-45deg, transparent 75%, #e4e7ee 75%);
  background-size: 28px 28px;
  background-position: 0 0, 0 14px, 14px -14px, -14px 0;
  cursor: ew-resize;
}
.frame.is-brush canvas { cursor: none; }

.tag {
  position: absolute;
  top: 14px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(18, 20, 26, 0.72);
  color: white;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  pointer-events: none;
}
.tag.before { left: 14px; }
.tag.after { right: 14px; }
.split-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28px;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  pointer-events: none;
}
.split-handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: white;
  box-shadow: 0 0 0 1px rgba(18, 20, 26, 0.25);
}
.split-handle span {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 4px 16px rgba(18, 20, 26, 0.25);
}
.split-handle span::before,
.split-handle span::after {
  content: "";
  position: absolute;
  top: 10px;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}
.split-handle span::before { left: 7px; border-right: 5px solid #12141a; }
.split-handle span::after { right: 7px; border-left: 5px solid #12141a; }

.brush-ring {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 1px rgba(18, 20, 26, 0.55);
  pointer-events: none;
  opacity: 0;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(18, 20, 26, 0.42);
  color: white;
  text-align: center;
  backdrop-filter: blur(3px);
}
.overlay p { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; margin-top: 12px; }
.overlay small { display: block; margin-top: 10px; max-width: 320px; line-height: 1.45; color: rgba(255,255,255,0.86); }
.spinner {
  width: 38px;
  height: 38px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.28);
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}
.bar {
  width: min(280px, 70vw);
  height: 6px;
  margin: 14px auto 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}
.bar span {
  display: block;
  height: 100%;
  background: white;
  border-radius: inherit;
}
.bar span.indeterminate { width: 40%; animation: indeterminate 1.1s ease-in-out infinite; }

.stage-error {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 32px));
  background: var(--surface);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
  text-align: center;
}
.stage-error p { color: #b42318; font-weight: 600; margin-bottom: 12px; }

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
  color: var(--ink);
  border-left: 1px solid var(--line);
  overflow: auto;
  padding: 16px 16px 20px;
}
.panel .download-block {
  margin-top: 14px;
  padding-top: 0;
  border-top: 0;
}
.panel .btn.ghost,
.panel .stepper,
.panel .segment button,
.panel .size-presets button {
  color: var(--ink);
  background: var(--wash);
}
.panel .btn.primary,
.panel .size-presets button.active {
  background: var(--ink);
  color: var(--bg);
}
.panel .segment button.active {
  background: var(--surface);
  color: var(--ink);
}
.panel .btn.text {
  background: transparent;
  color: var(--muted);
}
.panel .download-block {
  position: static;
  padding-bottom: 4px;
  background: transparent;
}
.panel .download-block .btn {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}
.panel input[type="file"] {
  display: none;
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.panel-head h1 {
  font-size: 16px;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.panel-head p { color: var(--muted); font-size: 13px; margin-top: 0; flex: 0 0 auto; }
.panel section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.panel h2 {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line);
  padding: 0;
}
.swatch.active { box-shadow: 0 0 0 2px var(--blue); }
.swatch.checker {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #d9dde7 25%, transparent 25%),
    linear-gradient(-45deg, #d9dde7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d9dde7 75%),
    linear-gradient(-45deg, transparent 75%, #d9dde7 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0;
}
.color-pick input {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 2px solid var(--surface);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line);
  background: none;
  overflow: hidden;
}
.color-pick.disabled { opacity: 0.48; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.row-actions .btn { padding: 8px 12px; font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.45; margin-top: 10px; }
.hint.ok { color: #087443; font-weight: 700; }
.segment {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  background: var(--wash);
  border-radius: 14px;
}
.segment button {
  border: 0;
  background: transparent;
  border-radius: 10px;
  min-height: 40px;
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}
.segment button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(18, 20, 26, 0.08); }
.slider-label {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 700;
}
input[type="range"] { width: 100%; height: 28px; margin: 0; accent-color: var(--ink); }
.brush-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.stepper {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--wash);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}
.size-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.size-presets button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--wash);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.size-presets button.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.download-block .btn + .btn { margin-top: 8px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes indeterminate {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.tabbar { display: none; }

@media (max-width: 1180px) {
  .header {
    height: calc(48px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 12px 0;
    gap: 8px;
  }
  .header nav { display: none; }
  .logo { flex: 1 1 auto; min-width: 0; gap: 8px; font-size: 15px; }
  .logo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .header-tools { flex: 0 0 auto; min-width: 0; margin-left: 0; gap: 6px; }
  body:not(.is-editing) .header-tools > .btn { display: none; }
  .theme-switch { height: 32px; }
  .theme-switch span { height: 26px; line-height: 26px; padding: 0 8px; }
  .lang {
    position: relative;
    width: 92px;
    height: 32px;
    flex: 0 0 92px;
    overflow: hidden;
  }
  .lang select {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 32px;
    font-size: 16px;
  }
  body.is-editing .header .btn.small {
    display: inline-flex;
    align-items: center;
    height: 32px;
    max-width: 28vw;
    padding: 0 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body {
    padding-bottom: calc(58px + env(safe-area-inset-bottom));
  }
  body.is-editing { padding-bottom: 0; }
  .tabbar {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    background: var(--header);
    border-top: 1px solid var(--line);
    padding: 4px 2px calc(4px + env(safe-area-inset-bottom));
    min-height: calc(54px + env(safe-area-inset-bottom));
  }
  .tabbar a {
    min-width: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    padding: 8px 3px 4px;
    text-align: center;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.03em;
    overflow: hidden;
    overflow-wrap: anywhere;
  }
  .tabbar a[aria-current="page"] {
    color: var(--ink);
    box-shadow: inset 0 2px 0 var(--ink);
  }
  body.is-editing .tabbar { display: none; }
}

@media (max-width: 420px) {
  body.is-editing .logo span { display: none; }
  .tabbar a { font-size: 10px; padding: 6px 2px; }
}

@media (max-width: 900px) {
  .hero { padding: 28px 16px 16px; }
  .hero h1 { font-size: clamp(32px, 9vw, 44px); }
  .drop { min-height: 200px; margin-top: 20px; padding: 24px 16px; }
  .band, .steps { padding: 40px 0; }
  .cards, .steps ol { grid-template-columns: 1fr; }
  .footer-row { flex-direction: column; }
  body.is-editing {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
  }
  body.is-editing #editor-host {
    flex: 1;
    min-height: 0;
    display: flex;
  }
  #editor-host .workspace {
    height: auto;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .workspace { display: flex; flex-direction: column; }
  .stage { flex: 0 0 auto; min-height: 0; padding: 8px 8px 0; }
  .frame canvas { max-height: 34dvh; border-radius: 12px; }
  .panel {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 8px;
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.16);
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
  }
  .panel .download-block { margin-top: 10px; border-top: 0; padding-top: 0; }
  .panel h2 { margin-bottom: 8px; }
  .row-actions .btn { flex: 1 1 0; min-height: 44px; }
  .panel .download-block .btn { min-height: 48px; }
  .swatch, .color-pick input { width: 40px; height: 40px; }
  .split-handle span { width: 36px; height: 36px; }
  .segment button, .size-presets button, .stepper { min-height: 44px; }
}

.header nav { margin-right: 0; }
.header .btn { margin-left: 0; }
.header-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.theme-switch {
  height: 28px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--wash);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 1px;
}
.theme-switch span {
  height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 22px;
}
html[data-theme="light"] .theme-switch [data-mode="light"] {
  background: #111113;
  color: #ffffff;
}
html[data-theme="dark"] .theme-switch [data-mode="dark"] {
  background: #f4f4f5;
  color: #111113;
}
.lang select {
  height: 32px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 500;
  max-width: 132px;
}
.header nav a[aria-current="page"] { color: var(--ink); }

.prose { width: min(720px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 80px; }
.prose h1 {
  font-size: clamp(36px, 5vw, 52px);
  letter-spacing: -0.045em;
  line-height: 1.05;
  font-weight: 650;
  max-width: 18ch;
}
.prose .lede { margin: 16px 0 0; max-width: 62ch; text-align: left; }
.prose h2 { margin-top: 36px; font-size: 22px; letter-spacing: -0.03em; }
.prose p, .prose li { color: var(--muted); line-height: 1.65; }
.prose p { margin-top: 12px; max-width: 68ch; }
.prose ol { margin: 18px 0 0; padding-left: 20px; }
.prose li { margin-top: 12px; }
.prose li strong { color: var(--ink); }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.crumbs a { border-bottom: 1px solid var(--line); }
.related { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 28px; padding: 0; list-style: none; }
.related a { font-weight: 600; border-bottom: 1px solid var(--line); }

body.is-editing {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--stage);
}
body.is-editing .header { flex: 0 0 auto; }
body.is-editing .header nav { display: none; }
body.is-editing #editor-host {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#editor-host .workspace { flex: 1; width: 100%; height: auto; min-height: 0; }

html[data-theme="dark"] .drop-shield {
  background: rgba(16, 16, 18, 0.94);
  color: #f4f4f5;
}
html[data-theme="light"] .drop-shield {
  background: rgba(255, 255, 255, 0.94);
  color: #111113;
}

@media (max-width: 1180px) {
  .header-tools { margin-left: auto; gap: 6px; }
  .lang select { max-width: 100%; height: 32px; font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .drop { transition: none; }
  .spinner, .bar span.indeterminate { animation: none; }
}
