:root {
  color-scheme: light;
  --ink: #1a1a1c;
  --muted: #626266;
  --line: #e5e7eb;
  --page: #f9fafb;
  --accent: #a85a08;
  --accent-strong: #92400e;
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .42; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
.shell { max-width: 1400px; margin-inline: auto; padding: 0 clamp(16px, 4vw, 52px) 56px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; margin: 32px 0 23px; }
.page-heading h1 { font-size: clamp(1.5rem, 3vw, 1.875rem); line-height: 1.2; letter-spacing: -.028em; }
.topbar-actions { display: flex; gap: 8px; }
.workspace { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 24px; align-items: start; }
.editor { display: grid; gap: 18px; }
.editor-section, .output { background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px #1118270a; }
.editor-section { padding: 20px; }
h2 { font-size: 1.1rem; letter-spacing: -.02em; }
.fields { display: grid; gap: 14px; margin-top: 16px; }
label { display: block; font-size: .875rem; font-weight: 650; }
.optional { color: var(--muted); font-weight: 400; margin-left: 3px; font-size: .8rem; }
input, textarea, select {
  color: var(--ink);
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 6px;
}
input, textarea { display: block; padding: 9px 10px; font-weight: 400; line-height: 1.45; width: 100%; }
label input, label textarea { margin-top: 5px; }
textarea { resize: vertical; min-height: 4rem; }
input::placeholder, textarea::placeholder { color: #747378; }
.button, .view-button, .icon-button {
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: .875rem;
  font-weight: 680;
  line-height: 1.2;
  min-height: 36px;
  background: transparent;
  color: var(--ink);
}
.button { padding: 8px 12px; white-space: nowrap; }
.primary { background: #fbbf24; color: #211a0b; }
.primary:hover:not(:disabled) { background: #f59e0b; }
.secondary { background: white; border-color: #d1d5db; }
.secondary:hover:not(:disabled), .quiet:hover, .icon-button:hover:not(:disabled) { background: #f3f4f6; }
.section-heading, .entry-bar, .output-bar, .export-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.entry-count { font-size: .8rem; margin-left: 4px; color: var(--muted); font-weight: 500; }
.hint { font-size: .83rem; line-height: 1.5; color: var(--muted); margin: 10px 0 15px; }
.entries { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.entry { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 12px; }
.entry > label { margin-top: 9px; }
.entry-number { font-size: .84rem; font-weight: 700; color: var(--accent-strong); }
.entry-actions { display: flex; gap: 3px; }
.icon-button { padding: 0; width: 33px; min-height: 33px; font-size: 1rem; }
.icon-button.remove { color: var(--accent-strong); font-size: 1.25rem; }
.output { position: sticky; top: 16px; min-width: 0; }
.output-bar { padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.views, .preview-controls { display: flex; gap: 5px; }
.view-button { padding: 7px 11px; color: var(--muted); }
.view-button[aria-pressed="true"] { background: #fffbeb; color: #92400e; }
.view-button:hover:not([aria-pressed="true"]) { background: var(--page); }
select { min-height: 36px; padding: 5px 7px; font-size: .85rem; }
.preview-panel { padding: clamp(10px, 2vw, 22px); background: #f3efe9; border-radius: 0 0 11px 11px; }
.preview-panel.dark { background: #222124; }
iframe { display: block; border: 0; border-radius: 8px; background: white; margin: auto; width: 100%; max-width: 728px; height: 680px; }
.dark iframe { background: #141416; }
iframe.mobile { max-width: 390px; }
.empty-preview { padding: 60px 12px; text-align: center; }
.dark .empty-preview { color: white; }
.html-panel { padding: 18px; }
.html-panel p { color: var(--muted); margin-bottom: 16px; }
.html-panel textarea { height: min(490px, 52vh); margin: 6px 0 12px; font: .83rem/1.55 ui-monospace, monospace; background: #f9f8f6; }
.export-footer { color: var(--muted); font-size: .875rem; }
.export-error { padding: 10px 16px; color: var(--accent-strong); border-top: 1px solid var(--line); }
.status:not(:empty) { position: fixed; z-index: 1; bottom: 20px; right: 20px; max-width: calc(100vw - 40px); padding: 10px 15px; border-radius: 8px; background: var(--ink); color: white; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 850px) {
  .workspace { grid-template-columns: minmax(250px, 34%) minmax(0, 1fr); gap: 14px; }
  .editor-section { padding: 14px; }
}
@media (max-width: 680px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .output { position: static; }
  .page-heading { margin-top: 26px; }
  .topbar-actions { gap: 4px; }
  .topbar-actions .button { padding-inline: 7px; }
}
