:root {
  color-scheme: light;
  --bg: #f5f8fa;
  --surface: #fff;
  --soft: #ebf1f5;
  --ink: #182f3e;
  --muted: #5e7482;
  --line: #dbe5eb;
  --accent: #08696e;
  --tint: #e4f4f0;
  --warn: #9c4819;
  --shadow: 0 12px 40px #203d4a08;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c161e;
  --surface: #13232d;
  --soft: #1b2e39;
  --ink: #e9f4f8;
  --muted: #9bb4c2;
  --line: #2a414e;
  --accent: #6ad7cb;
  --tint: #193b3e;
  --warn: #f5b783;
  --shadow: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 14px;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button,
.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  min-height: 42px;
  padding: 9px 15px;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}
button:hover,
.file-button:hover {
  border-color: var(--accent);
}
button.primary {
  background: var(--accent);
  color: var(--surface);
  border-color: var(--accent);
  font-weight: 650;
}
html[data-theme="dark"] button.primary {
  color: #0c2425;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.file-button:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
header {
  max-width: 1380px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 40px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 750;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: -0.5px;
}
.brand span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  margin-left: 8px;
}
main {
  max-width: 1300px;
  margin: auto;
  padding: 0 40px;
}
.hero {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 50px;
  padding: 42px 0 48px;
  align-items: center;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 750;
  color: var(--muted);
}
h1 {
  font-size: clamp(38px, 5vw, 64px);
  letter-spacing: -2.6px;
  line-height: 1.07;
  margin: 18px 0;
}
h1 em {
  font-style: normal;
  color: var(--accent);
}
.lede {
  max-width: 570px;
  font-size: 17px;
  color: var(--muted);
  line-height: 1.7;
}
.hero-note {
  position: relative;
  padding: 28px 34px;
  background: linear-gradient(140deg, var(--tint), var(--surface));
  border: 1px solid var(--line);
  border-radius: 24px;
  transform: rotate(3deg);
  box-shadow: var(--shadow);
}
.hero-note strong {
  display: block;
  font-size: 23px;
  line-height: 1.3;
  letter-spacing: -0.7px;
}
.hero-note p {
  font-size: 13px;
  color: var(--muted);
}
.orbit {
  display: block;
  color: var(--accent);
  font-size: 36px;
  margin-bottom: 18px;
}
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.badge {
  border-radius: 99px;
  background: var(--tint);
  color: var(--accent);
  padding: 6px 11px;
  font-size: 11px;
  font-weight: 700;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 10px;
}
.toolbar > span {
  font-size: 12px;
  color: var(--muted);
}
.privacy {
  font-size: 12px;
  color: var(--muted);
  max-width: 850px;
  margin: 16px 0 24px;
}
.file-button {
  position: relative;
  overflow: hidden;
}
.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  cursor: pointer;
}
.center-tabs {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding: 8px 0 20px;
}
.center-tabs button {
  white-space: nowrap;
}
.center-tabs button[aria-pressed="true"] {
  background: var(--tint);
  border-color: var(--accent);
  color: var(--accent);
}
.workspace {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  min-height: 650px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.sidebar {
  padding: 26px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), var(--bg));
}
.sidebar nav {
  display: grid;
  gap: 8px;
  margin-top: 26px;
}
.sidebar nav button {
  justify-content: flex-start;
  background: transparent;
  border-color: transparent;
}
.sidebar nav button[aria-pressed="true"] {
  background: var(--tint);
  color: var(--accent);
  font-weight: 700;
}
.sidebar-note {
  padding: 24px 10px;
  margin-top: 55px;
  color: var(--muted);
  font-size: 12px;
}
.sidebar-note strong {
  font-size: 22px;
  color: var(--ink);
}
.panel {
  padding: 30px;
  min-width: 0;
}
h2 {
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.7px;
  margin: 0 0 12px;
}
h3 {
  font-size: 17px;
  line-height: 1.4;
  margin: 0 0 8px;
}
h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}
.muted {
  color: var(--muted);
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 24px;
}
.section-head p {
  margin: 5px 0 0;
}
.field {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin: 14px 0;
}
.field input,
.field textarea,
.field select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 9px;
  font-size: 14px;
  font-weight: 400;
}
.field textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.6;
}
.field textarea.tall {
  min-height: 300px;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}
.grid .wide {
  grid-column: 1/-1;
}
.card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  margin: 16px 0;
}
.card p {
  margin: 8px 0;
}
.card .actions {
  margin-top: 16px;
}
.card small {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.article-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
}
.empty {
  padding: 42px 20px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
}
.notice {
  padding: 16px 20px;
  border: 1px solid var(--accent);
  background: var(--tint);
  border-radius: 12px;
  margin: 16px 0;
  overflow-wrap: anywhere;
}
.notice p {
  margin: 0 0 12px;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin: 14px 0;
}
.check input {
  width: 18px;
  height: 18px;
}
.status {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
}
.details {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 24px;
}
.source-text {
  white-space: pre-wrap;
  max-height: 240px;
  overflow: auto;
  background: var(--bg);
  padding: 16px;
  font:
    12px/1.6 ui-monospace,
    monospace;
  border-radius: 8px;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.stat {
  background: var(--soft);
  padding: 18px;
  border-radius: 12px;
}
.stat strong {
  display: block;
  font-size: 28px;
}
.stat span {
  font-size: 11px;
  color: var(--muted);
}
dialog {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 20px;
  max-width: 720px;
  width: calc(100% - 32px);
  padding: 28px;
  max-height: 90vh;
}
dialog::backdrop {
  background: #07172199;
  backdrop-filter: blur(4px);
}
dialog .actions {
  margin-top: 24px;
  justify-content: flex-end;
}
#reader {
  max-width: 850px;
}
#reader-content {
  font-size: 16px;
}
#reader-content pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--soft);
  padding: 16px;
  border-radius: 10px;
}
#reader-content p {
  white-space: pre-wrap;
}
#reader-content h2 {
  font-size: 23px;
  margin-top: 30px;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 32px 0 50px;
  font-size: 11px;
  color: var(--muted);
}
.skip {
  position: absolute;
  top: -100px;
  left: 20px;
}
.skip:focus {
  top: 10px;
  padding: 12px;
  background: var(--surface);
  z-index: 20;
}
#print-content {
  display: none;
}
@media (max-width: 800px) {
  main {
    padding: 0 20px;
  }
  header {
    padding: 22px 20px;
  }
  .hero {
    grid-template-columns: 1fr 210px;
    gap: 25px;
  }
  .hero-note {
    padding: 22px;
  }
  .workspace {
    grid-template-columns: 150px minmax(0, 1fr);
  }
  .panel {
    padding: 22px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .brand span,
  .badge {
    display: none;
  }
  .hero {
    grid-template-columns: 1fr;
    padding: 20px 0 26px;
  }
  .hero-note {
    display: none;
  }
  .lede {
    font-size: 15px;
  }
  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .toolbar .actions {
    gap: 6px;
  }
  .toolbar button,
  .toolbar .file-button {
    font-size: 11px;
    padding: 8px 10px;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .sidebar {
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidebar .eyebrow,
  .sidebar-note {
    display: none;
  }
  .sidebar nav {
    display: flex;
    margin: 0;
    gap: 5px;
    flex-wrap: wrap;
  }
  .sidebar nav button {
    font-size: 11px;
    padding: 7px 9px;
  }
  .panel {
    padding: 20px 16px;
  }
  .section-head {
    flex-direction: column;
  }
  .article-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .stat-grid {
    gap: 7px;
  }
  .stat {
    padding: 10px;
  }
  .stat strong {
    font-size: 23px;
  }
  footer {
    flex-direction: column;
  }
  .card {
    padding: 16px;
  }
  .brand {
    font-size: 18px;
  }
  h1 {
    letter-spacing: -1.6px;
  }
}
@media print {
  body {
    background: #fff;
    color: #172b39;
  }
  body > * {
    display: none !important;
  }
  #print-content {
    display: block !important;
    background: #fff;
    color: #172b39;
    padding: 12px;
    font: 14px/1.65 system-ui;
  }
  #print-content h1 {
    font-size: 32px;
    letter-spacing: -1px;
  }
  #print-content h2 {
    font-size: 20px;
    break-after: avoid;
  }
  #print-content p {
    white-space: pre-wrap;
  }
  #print-content pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
  #print-content a {
    color: #172b39;
  }
}

.guide-link {
  font-size: 13px;
  margin: 18px 0 0;
}
.builder-guide {
  margin-top: 42px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 24px;
}
.guide-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}
.guide-heading h2 {
  font-size: 25px;
  line-height: 1.3;
  letter-spacing: -0.7px;
  margin: 8px 0 0;
}
.guide-heading a {
  flex-shrink: 0;
  font-size: 12px;
}
.guide-intro {
  max-width: 900px;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 24px;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.guide-grid article {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}
.guide-grid h3 {
  font-size: 16px;
  margin: 0 0 12px;
}
.guide-grid p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
  overflow-wrap: anywhere;
  margin: 0;
}
.guide-grid p + p {
  margin-top: 12px;
}
.guide-grid code {
  font-size: 0.95em;
  color: var(--ink);
}
.no-script {
  max-width: 1220px;
  margin: 0 auto 32px;
  padding: 18px 20px;
  color: var(--warn);
}
@media (max-width: 600px) {
  .guide-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .guide-heading h2 {
    font-size: 23px;
  }
  .guide-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .guide-grid article {
    padding: 20px;
  }
  .builder-guide {
    margin-top: 30px;
  }
}

/* Direct workspace entry; existing teal palette and native control semantics retained. */
.page-heading{padding:24px 0;border-bottom:1px solid var(--line);margin-bottom:24px}
.page-heading h1{font-size:clamp(30px,4vw,42px);letter-spacing:-1px;margin:0 0 16px}
.card,.panel,.stat,.guide-grid article{box-shadow:none;border-radius:10px}
.section-head,.grid,.field,.actions{min-width:0}
h1,h2,h3,button,.center-tabs{overflow-wrap:anywhere}
