:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  color: #171712;
  background: #e9e8e2;
  --chrome: #f7f6f1;
  --line: #cfcec6;
  --muted: #74746d;
  --ink: #171712;
  --accent: #2457ff;
  --accent-soft: #e8edff;
  --danger: #c33a2d;
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; margin: 0; }
body { min-height: 100vh; overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app-shell { height: 100vh; display: grid; grid-template-rows: 58px minmax(0, 1fr); background: #e9e8e2; }
.topbar { display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; align-items: center; min-width: 0; padding: 0 16px; background: var(--chrome); border-bottom: 1px solid #bcbcb5; box-shadow: 0 1px 8px #2221; z-index: 20; }
.brand { height: 100%; display: flex; gap: 9px; align-items: center; color: var(--ink); text-decoration: none; font-size: 17px; font-weight: 760; letter-spacing: -.03em; }
.brand-mark { width: 29px; height: 29px; display: grid; place-items: center; color: white; background: var(--accent); border-radius: 7px 2px 7px 2px; font: 900 17px Georgia, serif; box-shadow: inset -3px -3px 0 #0a31bf; }
.brand small { align-self: flex-start; margin: 15px 0 0 -5px; color: #74746d; font: 700 8px/1 monospace; letter-spacing: .13em; }
.document-name { min-width: 0; justify-self: center; display: flex; align-items: center; gap: 8px; color: #4c4c47; }
.document-name > span:nth-child(2) { max-width: 36vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 620; }
.status-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #38a653; box-shadow: 0 0 0 3px #38a6531d; }
.saved-label { color: var(--muted); font-size: 11px; }
.top-actions { display: flex; align-items: center; gap: 7px; }
button { border: 0; background: none; cursor: pointer; }
button:disabled { opacity: .32; cursor: default; }
.icon-button, .quiet-button, .secondary-button, .danger-button { min-height: 34px; border: 1px solid var(--line); border-radius: 5px; background: #fff; box-shadow: 0 1px 1px #00000008; }
.icon-button { width: 35px; font-size: 20px; line-height: 1; }
.quiet-button { padding: 0 13px; font-weight: 620; }
.primary-button { min-height: 36px; display: inline-flex; align-items: center; gap: 15px; margin-left: 4px; padding: 0 14px; color: #fff; background: var(--accent); border-radius: 5px; font-weight: 700; box-shadow: inset 0 -2px 0 #1239ba, 0 1px 3px #153ac33c; }
.primary-button span { font-size: 15px; }

.workspace { min-height: 0; display: grid; grid-template-columns: 220px minmax(360px, 1fr) 270px; }
.palette, .inspector { min-height: 0; background: var(--chrome); overflow: auto; }
.palette { border-right: 1px solid var(--line); }
.inspector { border-left: 1px solid var(--line); }
.panel-heading { height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; border-bottom: 1px solid var(--line); text-transform: uppercase; }
.panel-heading span { font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.panel-heading small { color: #8a8981; font: 700 8px/1 monospace; letter-spacing: .12em; }
.palette-list { padding: 8px; }
.palette-item { width: 100%; display: grid; grid-template-columns: 38px minmax(0, 1fr) 20px; gap: 10px; align-items: center; padding: 8px; text-align: left; border: 1px solid transparent; border-radius: 5px; }
.palette-item:hover { background: #fff; border-color: #d8d7d0; box-shadow: 0 2px 6px #27261d0d; }
.palette-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #c8c7bf; background: #eeede8; border-radius: 3px; font: 800 12px/1 Georgia, serif; }
.palette-marquee { color: #d02669; }
.palette-gif { color: #fff; background: #202020; border-color: #202020; font: 800 9px monospace; }
.palette-counter { color: #2eea65; background: #151515; border-color: #151515; font: 800 8px monospace; }
.palette-table { color: var(--accent); font-size: 20px; }
.palette-item b { display: block; margin-bottom: 3px; font-size: 12px; }
.palette-item small { display: block; color: var(--muted); font-size: 10px; }
.palette-item i { color: #aaa9a2; font: normal 18px/1 sans-serif; }
.palette-tip { margin: 8px 15px; padding-top: 15px; border-top: 1px solid #d7d6cf; color: var(--muted); }
.palette-tip span { padding: 2px 5px; color: #3153c6; background: #e1e8ff; border-radius: 2px; font: 800 8px monospace; }
.palette-tip p { margin: 8px 0; font-size: 10px; line-height: 1.5; }

.stage { min-width: 0; min-height: 0; display: grid; grid-template-rows: 42px minmax(0, 1fr) 32px; background-color: #deddd7; background-image: radial-gradient(#b9b8b0 1px, transparent 1px); background-size: 16px 16px; }
.breadcrumb { display: flex; align-items: center; gap: 5px; padding: 0 18px; background: #f5f4efdd; border-bottom: 1px solid #cac9c1; backdrop-filter: blur(8px); overflow-x: auto; }
.breadcrumb button { flex: none; padding: 3px 4px; color: #66665f; border-radius: 3px; font-size: 11px; }
.breadcrumb button:last-child { color: var(--accent); font-weight: 750; }
.breadcrumb button:hover { background: #fff; }
.crumb-separator { color: #a4a39c; }
.canvas-wrap { min-height: 0; overflow: auto; padding: 42px max(26px, calc((100% - 790px) / 2)); }
.homepage-canvas { min-height: 620px; color: var(--page-text); background-color: var(--page-bg); background-image: var(--page-pattern, none); background-repeat: repeat; background-size: var(--page-pattern-size, auto); border: 1px solid #777; box-shadow: 0 18px 45px #2f2d2535, 0 0 0 5px #ffffff80; font-family: "Comic Sans MS", "Trebuchet MS", cursive; }
.browser-plaque { height: 31px; display: flex; gap: 5px; align-items: center; padding: 0 8px; color: #222; background: linear-gradient(#ddd, #bdbdbd); border-bottom: 2px ridge #eee; font: 9px/1 monospace; }
.browser-plaque > span { width: 8px; height: 8px; border-radius: 50%; background: #777; box-shadow: inset 1px 1px 1px #0004; }
.browser-plaque > span:first-child { background: #e34b3e; }
.browser-plaque > span:nth-child(2) { background: #e5bf38; }
.browser-plaque > span:nth-child(3) { background: #44a35e; }
.browser-plaque p { min-width: 0; flex: 1; margin: 0 5px; padding: 5px 8px; overflow: hidden; color: #666; background: #eee; border: 1px inset #ddd; text-overflow: ellipsis; white-space: nowrap; }
.browser-plaque b { color: #3046a0; font-size: 8px; letter-spacing: .06em; }
.page-content { min-height: 585px; padding: 22px; text-align: center; }
.block-list { min-height: 8px; }
.canvas-block { position: relative; margin: 0; border: 1px solid transparent; border-radius: 2px; transition: opacity 120ms ease, box-shadow 120ms ease; }
.canvas-block:hover { border-color: color-mix(in srgb, var(--page-accent), transparent 48%); }
.canvas-block.selected { border-color: var(--page-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--page-accent), transparent 74%); }
.canvas-block.dragging { opacity: .4; }
.block-controls { position: absolute; z-index: 8; top: -18px; right: -1px; display: none; height: 18px; color: #fff; background: var(--accent); border-radius: 3px 3px 0 0; font-family: ui-sans-serif, sans-serif; }
.canvas-block:hover > .block-controls, .canvas-block.selected > .block-controls { display: flex; }
.block-controls button { width: 24px; padding: 0; color: inherit; font-size: 11px; }
.block-controls button:hover { background: #ffffff2a; }
.block-controls .drag-handle { cursor: grab; touch-action: none; }
.drop-target { position: relative; z-index: 4; height: 4px; margin: 0; opacity: 0; transition: height 120ms ease, opacity 120ms ease, margin 120ms ease; }
.drop-target.available { height: 10px; margin: 2px 0; opacity: .45; background: repeating-linear-gradient(90deg, var(--accent), var(--accent) 5px, transparent 5px, transparent 8px) center/100% 1px no-repeat; }
.drop-target.active { height: 38px; margin: 5px 0; opacity: 1; border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent), transparent 88%); border-radius: 3px; }
.drop-target span { display: none; }
.drop-target.active span { display: block; position: absolute; inset: 0; place-content: center; color: var(--accent); font: 800 9px ui-monospace, monospace; text-transform: uppercase; }
.preview-heading { margin: 12px 0; color: var(--page-accent); text-shadow: 2px 2px 0 #000; letter-spacing: .04em; }
.preview-paragraph { margin: 12px 0; line-height: 1.55; }
.preview-marquee { overflow: hidden; margin: 12px 0; white-space: nowrap; font-weight: bold; }
.preview-marquee span { display: inline-block; min-width: 100%; animation: marquee var(--marquee-speed) linear infinite; }
.blink { animation: blink .8s steps(1, end) infinite; }
@keyframes marquee { from { transform: translateX(100%); } to { transform: translateX(-100%); } }
@keyframes blink { 50% { opacity: 0; } }
.preview-gif { display: inline-grid; grid-template-rows: 1fr auto; margin: 12px auto; overflow: hidden; color: white; background: #050505; border: 2px outset #ddd; }
.preview-gif > span { display: grid; place-items: center; font-size: 3em; filter: drop-shadow(0 0 7px var(--page-accent)); }
.preview-gif figcaption { padding: 2px 4px; color: #f7ff00; background: #000; font: bold 9px monospace; text-transform: uppercase; }
.preview-gif img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.preview-rule { margin: 14px 0; }
.rule-beveled { height: 4px; border: 0; border-top: 2px solid #fff; border-bottom: 2px solid #555; }
.rule-dotted { border: 0; border-top: 4px dotted var(--page-accent); }
.rule-rainbow { height: 7px; border: 0; background: linear-gradient(90deg,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00); }
.preview-counter { display: inline-block; margin: 12px auto; padding: 4px 6px; color: #39ff14; background: #050505; border: 3px inset #aaa; font: bold 22px "Courier New", monospace; letter-spacing: 3px; }
.preview-table { display: grid; margin: 12px 0; border-style: solid; border-color: var(--page-accent); }
.preview-cell { position: relative; min-width: 0; min-height: 58px; border: var(--cell-border-width, 1px) solid var(--page-accent); }
.cell-number { position: absolute; z-index: 7; top: 2px; left: 3px; padding: 2px 3px; color: color-mix(in srgb, var(--page-text), transparent 20%); background: color-mix(in srgb, var(--page-bg), transparent 20%); font: 700 7px ui-monospace, monospace; opacity: 0; }
.preview-cell:hover > .cell-number { opacity: .75; }
.canvas-foot { display: flex; align-items: center; justify-content: space-between; padding: 0 14px; color: #77766f; background: #f5f4efdd; border-top: 1px solid #cac9c1; font: 9px/1 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .06em; }

.inspector-body { padding: 15px; }
.selection-title { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid #d9d8d1; }
.selection-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); border: 1px solid #bac8ff; border-radius: 4px; font: 800 11px Georgia, serif; }
.selection-title small, .selection-title b { display: block; }
.selection-title small { margin-bottom: 4px; color: #88877f; font: 700 8px monospace; letter-spacing: .1em; }
.selection-title b { font-size: 14px; }
.field { display: block; margin: 0 0 14px; }
.field > span { display: block; margin-bottom: 6px; color: #575650; font-size: 10px; font-weight: 720; }
.field input:not([type="color"]):not([type="range"]), .field textarea, .field select { width: 100%; min-height: 35px; padding: 7px 8px; color: #222; background: #fff; border: 1px solid #c7c6be; border-radius: 4px; }
.field textarea { min-height: 68px; resize: vertical; line-height: 1.4; }
.field input[type="color"] { width: 100%; height: 35px; padding: 3px; background: #fff; border: 1px solid #c7c6be; border-radius: 4px; }
.field input[type="range"] { width: calc(100% - 32px); accent-color: var(--accent); vertical-align: middle; }
.field output { display: inline-block; min-width: 25px; color: #666; text-align: right; font: 10px monospace; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.field-grid:has(> :nth-child(3)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 16px; padding: 10px; background: #eeede8; border-radius: 4px; }
.toggle-row b, .toggle-row small { display: block; }
.toggle-row b { margin-bottom: 3px; font-size: 11px; }
.toggle-row small { color: var(--muted); font-size: 9px; }
.toggle-row input { width: 34px; height: 18px; accent-color: var(--accent); }
.inspector-body > hr { margin: 18px 0; border: 0; border-top: 1px solid #d7d6cf; }
.inspector-note { color: #77766f; font-size: 10px; line-height: 1.5; }
.secondary-button, .danger-button { min-height: 34px; padding: 0 11px; font-weight: 650; }
.danger-button { color: var(--danger); border-color: #e4bcb7; background: #fff7f6; }
.full { width: 100%; margin-top: 8px; }
.file-button { display: grid; place-items: center; cursor: pointer; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.inspector-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 22px; padding-top: 14px; border-top: 1px solid #d7d6cf; }

.drag-ghost { position: fixed; z-index: 100; padding: 9px 14px; color: #fff; background: #151515e8; border: 1px solid #fff6; border-radius: 4px; box-shadow: 0 8px 18px #0005; transform: rotate(1.5deg); pointer-events: none; font-size: 11px; font-weight: 720; }
.drag-ghost span { margin-right: 8px; color: #aebcff; }
.toast { position: fixed; z-index: 200; right: 18px; bottom: 18px; max-width: 330px; padding: 12px 16px; color: #fff; background: #282822; border-radius: 5px; box-shadow: 0 8px 24px #0005; font-size: 11px; }

.modal-backdrop { position: fixed; z-index: 150; inset: 0; display: grid; place-items: center; padding: 24px; background: #1616119c; backdrop-filter: blur(6px); }
.export-panel, .examples-panel { width: min(940px, 100%); max-height: min(780px, calc(100vh - 40px)); overflow: hidden; background: #f4f3ed; border: 1px solid #aaa99f; border-radius: 8px; box-shadow: 0 28px 80px #0007; }
.export-panel > header, .examples-panel > header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid #d0cfc7; }
.export-panel header small, .examples-panel header small { color: var(--accent); font: 800 8px monospace; letter-spacing: .14em; }
.export-panel h2, .examples-panel h2 { margin: 3px 0 0; font-size: 20px; letter-spacing: -.025em; }
.modal-close { width: 36px; height: 36px; border: 1px solid #d0cfc7; border-radius: 50%; background: #fff; font-size: 22px; }
.export-controls { display: flex; align-items: center; gap: 20px; padding: 14px 20px; }
.segmented { flex: none; display: flex; padding: 3px; background: #dfded7; border-radius: 6px; }
.segmented button { min-width: 130px; padding: 7px 16px; color: #686761; border-radius: 4px; font-weight: 750; }
.segmented button small { display: block; margin-top: 2px; font-size: 8px; font-weight: 500; }
.segmented button.active { color: #182e80; background: #fff; box-shadow: 0 1px 4px #0002; }
.export-controls > p { margin: 0; color: #6f6e67; font-size: 10px; }
.source-window { margin: 0 20px; overflow: hidden; color: #d9e2ee; background: #111821; border: 1px solid #080c10; border-radius: 6px; box-shadow: inset 0 0 35px #0006; }
.source-toolbar { height: 34px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; color: #8f9aa8; background: #1b2530; border-bottom: 1px solid #060b10; font: 9px monospace; }
.source-toolbar span { display: flex; gap: 5px; align-items: center; }
.source-toolbar i { width: 7px; height: 7px; border-radius: 50%; background: #d85447; }
.source-toolbar i:nth-child(2) { background: #dab542; }
.source-toolbar i:nth-child(3) { background: #4ba95f; margin-right: 6px; }
.source-window pre { height: min(430px, calc(100vh - 335px)); margin: 0; padding: 18px; overflow: auto; text-align: left; font: 10px/1.55 "SFMono-Regular", Consolas, monospace; white-space: pre; }
.source-window code { color: #b8c9d9; }
.export-panel > footer { display: flex; align-items: center; justify-content: space-between; padding: 17px 20px; }
.export-panel footer > div { display: flex; gap: 13px; align-items: center; color: #77766f; font: 9px monospace; text-transform: uppercase; }
.export-panel footer strong { color: #272722; font-size: 11px; }
.export-panel footer span + span::before { content: "•"; margin-right: 13px; color: #aaa; }
.download-button { min-height: 40px; min-width: 150px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; color: #fff; background: var(--accent); border-radius: 5px; font-weight: 750; box-shadow: inset 0 -2px 0 #1239ba; }
.download-button span { font-size: 18px; }
.examples-panel { width: min(690px, 100%); }
.example-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 20px; }
.example-grid button { padding: 0 0 16px; overflow: hidden; text-align: left; background: #fff; border: 1px solid #cecdc5; border-radius: 6px; }
.example-grid button:hover { border-color: var(--accent); box-shadow: 0 6px 18px #233b9320; transform: translateY(-2px); }
.example-art { height: 130px; display: grid; place-items: center; margin-bottom: 13px; background: #08003e; font-size: 56px; }
.art-2 { background: #d8ff2f; }
.art-3 { background: #e8e8e3; }
.example-grid b, .example-grid small { display: block; padding: 0 13px; }
.example-grid b { margin-bottom: 4px; }
.example-grid small { color: var(--muted); font-size: 10px; }

@media (max-width: 960px) {
  .workspace { grid-template-columns: 190px minmax(350px, 1fr); }
  .inspector { position: fixed; z-index: 30; top: 58px; right: 0; bottom: 0; width: 270px; box-shadow: -8px 0 25px #0002; }
  .canvas-wrap { padding-inline: 26px; padding-right: 296px; }
}

@media (max-width: 720px) {
  body { overflow: auto; }
  .app-shell { min-height: 100vh; height: auto; grid-template-rows: auto 1fr; }
  .topbar { min-height: 58px; grid-template-columns: 1fr auto; }
  .document-name { display: none; }
  .quiet-button, .saved-label { display: none; }
  .workspace { min-height: calc(100vh - 58px); grid-template-columns: 76px minmax(280px, 1fr); }
  .palette-item { grid-template-columns: 38px; justify-content: center; }
  .palette-item > span:nth-child(2), .palette-item i, .palette-tip, .panel-heading small { display: none; }
  .panel-heading { justify-content: center; padding: 0; }
  .canvas-wrap { padding: 22px 290px 22px 15px; }
  .page-content { padding: 12px; }
  .example-grid { grid-template-columns: 1fr; max-height: 65vh; overflow: auto; }
  .example-art { height: 85px; }
  .export-controls { align-items: stretch; flex-direction: column; }
  .segmented button { min-width: 0; flex: 1; }
  .export-panel footer > div { display: none; }
  .download-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .canvas-block, .drop-target, .example-grid button { transition: none !important; }
  .drag-ghost { transform: none; }
}

/* Late-1990s desktop editor chrome. The page canvas keeps the document's own style. */
:root {
  font-family: "MS Sans Serif", Tahoma, Geneva, sans-serif;
  font-size: 12px;
  color: #000;
  background: #008080;
  --chrome: #c0c0c0;
  --line: #808080;
  --muted: #444;
  --ink: #000;
  --accent: #000080;
  --accent-soft: #fff;
  --danger: #800000;
}

body, .app-shell { background: #008080; }
.topbar {
  padding: 4px 6px;
  background: #c0c0c0;
  border: 2px outset #fff;
  box-shadow: none;
}
.brand { gap: 6px; font-size: 14px; letter-spacing: 0; }
.brand-mark {
  width: 24px;
  height: 24px;
  color: #fff;
  background: #000080;
  border: 1px solid #000;
  border-radius: 0;
  box-shadow: none;
  font: bold 15px "Times New Roman", serif;
}
.status-dot { width: 8px; height: 8px; background: #008000; border: 1px solid #000; border-radius: 0; box-shadow: none; }
.saved-label { color: #444; }
.icon-button, .quiet-button, .secondary-button, .danger-button, .modal-close,
.palette-item, .download-button, .primary-button {
  border: 2px outset #fff;
  border-radius: 0;
  background: #c0c0c0;
  color: #000;
  box-shadow: none;
}
.icon-button:active, .quiet-button:active, .secondary-button:active, .danger-button:active,
.modal-close:active, .palette-item:active, .download-button:active, .primary-button:active {
  border-style: inset;
}
.primary-button { min-height: 32px; }
.workspace { border: 2px inset #fff; }
.palette, .inspector { background: #c0c0c0; border-color: #808080; }
.panel-heading {
  height: 30px;
  margin: 3px;
  padding: 0 6px;
  color: #fff;
  background: #000080;
  border: 0;
}
.panel-heading span { font-size: 11px; letter-spacing: 0; }
.panel-heading small { color: #fff; }
.palette-list { padding: 4px; }
.palette-item { margin-bottom: 3px; padding: 5px; }
.palette-item:hover { background: #c0c0c0; border-color: #fff #404040 #404040 #fff; box-shadow: none; }
.palette-icon, .selection-icon {
  background: #fff;
  border: 2px inset #fff;
  border-radius: 0;
}
.palette-tip { border-top: 1px solid #808080; color: #222; }
.palette-tip span { color: #000; background: #ffff00; border: 1px solid #000; border-radius: 0; }
.stage { background: #808080; background-image: none; }
.breadcrumb, .canvas-foot {
  background: #c0c0c0;
  border: 2px outset #fff;
  backdrop-filter: none;
}
.breadcrumb { padding: 0 8px; }
.breadcrumb button { color: #000; border-radius: 0; }
.breadcrumb button:last-child { color: #000080; }
.canvas-wrap { padding-top: 24px; padding-bottom: 24px; }
.homepage-canvas { border: 3px inset #fff; box-shadow: none; }
.browser-plaque {
  height: 28px;
  padding: 3px;
  color: #fff;
  background: #000080;
  border-bottom: 2px outset #fff;
}
.browser-plaque b { padding: 0 5px; color: #fff; font: bold 11px "MS Sans Serif", Tahoma, sans-serif; }
.browser-plaque p { color: #000; background: #fff; border: 2px inset #fff; }
.canvas-block { border-radius: 0; transition: none; }
.canvas-block.selected { border-color: #000080; box-shadow: 0 0 0 1px #fff; }
.block-controls { top: -20px; height: 20px; color: #fff; background: #000080; border-radius: 0; }
.drop-target { transition: none; }
.drop-target.active { border-color: #000080; background: #fff; border-radius: 0; }
.drop-target.active span { color: #000080; }
.inspector-body { padding: 10px; }
.selection-title { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #808080; }
.field input:not([type="color"]):not([type="range"]), .field textarea, .field select,
.field input[type="color"] {
  color: #000;
  background: #fff;
  border: 2px inset #fff;
  border-radius: 0;
}
.toggle-row { background: #c0c0c0; border: 1px solid #808080; border-radius: 0; }
.inspector-actions { border-top-color: #808080; }
.modal-backdrop { background: #0008; backdrop-filter: none; }
.export-panel, .examples-panel {
  background: #c0c0c0;
  border: 3px outset #fff;
  border-radius: 0;
  box-shadow: none;
}
.export-panel > header, .examples-panel > header {
  margin: 3px;
  padding: 5px 7px;
  color: #fff;
  background: #000080;
  border: 0;
}
.export-panel h2, .examples-panel h2 { margin: 0; font-size: 13px; letter-spacing: 0; }
.modal-close { width: 24px; height: 22px; color: #000; font-size: 16px; }
.export-controls { padding: 8px; }
.segmented { padding: 0; background: #c0c0c0; border-radius: 0; }
.segmented button { min-width: 120px; padding: 5px 10px; color: #000; border: 2px outset #fff; border-radius: 0; }
.segmented button.active { color: #000; background: #fff; border-style: inset; box-shadow: none; }
.source-window { margin: 0 8px; color: #000; background: #fff; border: 2px inset #fff; border-radius: 0; box-shadow: none; }
.source-toolbar { color: #fff; background: #000080; border: 0; }
.source-window code { color: #000; }
.export-panel > footer { justify-content: flex-end; padding: 8px; }
.download-button { min-height: 32px; }
.example-grid button { border: 2px outset #fff; border-radius: 0; }
.example-grid button:hover { border-color: #fff #404040 #404040 #fff; box-shadow: none; transform: none; }
.drag-ghost { color: #fff; background: #000080; border: 2px outset #fff; border-radius: 0; box-shadow: none; transform: none; }
.toast { color: #000; background: #ffffe1; border: 2px outset #fff; border-radius: 0; box-shadow: none; }

/* Use the browser's default font family throughout the editor chrome. */
:root { font-family: initial; }
.topbar *, .palette *, .inspector *, .breadcrumb *, .modal-backdrop *, .drag-ghost, .toast {
  font-family: initial;
}
.source-window pre, .source-window code { font-family: monospace; }
.stage { grid-template-rows: 42px minmax(0, 1fr); }

/* Creative suite additions. */
.document-name button { max-width: 34vw; overflow: hidden; padding: 3px 7px; color: #000080; text-overflow: ellipsis; white-space: nowrap; font-weight: bold; }
.document-name span { color: #555; font-size: 10px; }
.palette-group { margin-bottom: 9px; padding-bottom: 7px; border-bottom: 1px solid #808080; }
.palette-group:last-child { border-bottom: 0; }
.palette-group h3 { margin: 4px 6px; color: #333; font-size: 9px; font-weight: bold; letter-spacing: .08em; text-transform: uppercase; }
.file-palette-item { position: relative; cursor: pointer; }
.file-palette-item input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.palette-image, .palette-pixel, .palette-link, .palette-badge, .palette-icon.palette-list { color: #000080; font: bold 8px monospace; }

.stage-toolbar { min-width: 0; display: flex; align-items: stretch; background: #c0c0c0; border: 2px outset #fff; }
.stage-toolbar .breadcrumb { min-width: 0; flex: 1; border: 0; }
.preview-toolbar { flex: none; display: flex; align-items: center; gap: 2px; padding: 3px; }
.preview-toolbar button { width: 30px; border: 2px outset #fff; background: #c0c0c0; }
.preview-toolbar button:active, .preview-toolbar button.active { background: #fff; border-style: inset; }
.canvas-wrap { padding: 24px; }
.homepage-canvas { width: 790px; margin-inline: auto; transition: width 150ms ease; }
.preview-tablet .homepage-canvas { width: 600px; }
.preview-mobile .homepage-canvas { width: 375px; }
.preview-mobile .page-content { padding: 12px 8px; }

.preview-list { display: inline-block; margin: 12px auto; text-align: left; line-height: 1.6; }
.preview-link { display: inline-block; margin: 12px; color: #0000ee; text-decoration: underline; }
.classic-link-button { padding: 5px 10px; color: #000; background: #c0c0c0; border: 2px outset #fff; text-decoration: none; font: 13px Arial, sans-serif; }
.preview-badge { width: 176px; min-height: 62px; display: inline-grid; place-items: center; margin: 12px auto; padding: 4px; border: 3px outset #ddd; font: bold 12px/1.1 Arial, sans-serif; text-align: center; text-decoration: none; image-rendering: pixelated; }
.preview-upload, .preview-pixel { display: inline-block; max-width: 100%; margin: 12px auto; overflow: hidden; }
.preview-upload { border: 2px outset #ddd; }
.preview-upload img { display: block; width: 100%; height: auto; }
.preview-pixel img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.block-style { color: inherit; font: inherit; }
.block-style .preview-heading { color: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; font-style: inherit; text-decoration: inherit; text-shadow: inherit; }
.block-style .preview-marquee, .block-style .classic-link-button, .block-style .preview-badge { color: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; font-style: inherit; text-decoration: inherit; text-shadow: inherit; }
.preview-graphic-wrap { position: relative; display: inline-block; max-width: 100%; }
.preview-graphic-wrap.linked { cursor: pointer; outline: 1px dashed #0000ee; outline-offset: 2px; }
.graphic-link-chip { position: absolute; top: 2px; right: 2px; padding: 2px; background: #ffff00; border: 1px solid #000; font-size: 9px; }
.preview-audio, .preview-soundtrack { display: grid; gap: 5px; justify-items: center; margin: 10px; padding: 7px; color: #000; background: #c0c0c0; border: 2px outset #fff; font: 11px initial; }
.preview-audio audio, .preview-soundtrack audio { max-width: 100%; }
.preview-widget { display: inline-grid; gap: 4px; min-width: 240px; max-width: 100%; margin: 12px auto; padding: 9px 14px; color: #000; background: #c0c0c0; border: 3px outset #fff; text-align: center; }
.preview-widget small { font-size: .75em; }
.widget-construction { background: repeating-linear-gradient(135deg,#ffd400 0 12px,#111 12px 24px); }
.widget-construction > * { padding: 3px; background: #ffd400; }
.widget-new { color: #fff; background: #000080; }
.preview-graphic-menu { display: grid; grid-template-columns: repeat(var(--menu-cols),minmax(0,1fr)); gap: 8px; margin: 12px 0; }
.preview-graphic-menu a { display: grid; gap: 4px; justify-items: center; color: inherit; font-weight: bold; }
.preview-graphic-menu img { width: 88px; height: 44px; border: 2px outset #fff; image-rendering: pixelated; }
.inspector-subsection { margin-top: 18px; padding-top: 12px; border-top: 1px solid #808080; }
.inspector-subsection h3 { margin: 0 0 10px; font-size: 11px; }
.type-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.type-toggles label { padding: 5px; background: #ddd; border: 1px solid #808080; font-size: 10px; }
.type-toggles input { vertical-align: middle; }
.soundtrack-settings { margin-top: 10px; padding: 7px; border: 2px inset #fff; }
.soundtrack-settings > b { display: block; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; }
.palette-audio { color: #fff; background: #800080; font-size: 18px; }

.pages-panel, .pixel-panel { width: min(760px, 100%); max-height: min(820px, calc(100vh - 30px)); overflow: hidden; background: #c0c0c0; border: 3px outset #fff; }
.pages-panel > header, .pixel-panel > header { display: flex; align-items: center; justify-content: space-between; margin: 3px; padding: 5px 7px; color: #fff; background: #000080; }
.pages-panel h2, .pixel-panel h2 { margin: 0; font-size: 13px; }
.pages-actions { display: flex; gap: 6px; padding: 10px; border-bottom: 1px solid #808080; }
.page-list { max-height: min(620px, calc(100vh - 180px)); overflow: auto; padding: 8px; }
.page-card { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; margin-bottom: 6px; padding: 7px; border: 2px outset #fff; }
.page-card.active { background: #fff; border-style: inset; }
.page-card-art { width: 72px; height: 50px; display: grid; place-items: center; color: var(--page-text); background-color: var(--page-bg); background-image: var(--page-pattern, none); background-size: var(--page-pattern-size, auto); border: 2px inset #fff; }
.page-card-art span { padding: 2px 4px; color: #fff; background: #000080; font: 9px monospace; }
.page-card b, .page-card small { display: block; }
.page-card small { margin-top: 3px; color: #555; font-size: 10px; }

.pixel-panel { width: min(760px, 100%); overflow: auto; }
.pixel-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px; }
.pixel-tools label { display: flex; align-items: center; gap: 5px; }
.pixel-tools input[type="color"] { width: 36px; height: 30px; padding: 1px; border: 2px inset #fff; }
.pixel-swatch { width: 25px; height: 25px; border: 2px outset #fff; }
.pixel-tools .active { border-style: inset; background: #fff; }
.pixel-size { display: flex; justify-content: center; gap: 2px; margin-bottom: 8px; }
.pixel-size button { padding: 4px 12px; border: 2px outset #fff; }
.pixel-size button.active { background: #fff; border-style: inset; }
.pixel-grid { width: min(56vh, 500px); aspect-ratio: 1; display: grid; grid-template-columns: repeat(var(--pixel-cols), 1fr); margin: 0 auto; overflow: hidden; background-color: #fff; background-image: linear-gradient(45deg,#ddd 25%,transparent 25%),linear-gradient(-45deg,#ddd 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ddd 75%),linear-gradient(-45deg,transparent 75%,#ddd 75%); background-position: 0 0,0 5px,5px -5px,-5px 0; background-size: 10px 10px; border: 3px inset #fff; touch-action: none; }
.pixel-cell { min-width: 0; min-height: 0; padding: 0; border: 1px solid #0001; }
.pixel-cell:hover { box-shadow: inset 0 0 0 1px #fff, inset 0 0 0 2px #000; }
.pixel-panel footer { display: flex; align-items: center; justify-content: space-between; padding: 10px; }
.pixel-panel footer span { font: 10px monospace; }

@media (max-width: 960px) {
  .canvas-wrap { padding: 24px 296px 24px 24px; }
}

@media (max-width: 720px) {
  .stage-toolbar .breadcrumb { padding-inline: 5px; }
  .preview-toolbar button { width: 25px; }
  .canvas-wrap { padding: 16px 290px 16px 16px; }
  .page-card { grid-template-columns: 55px minmax(0, 1fr); }
  .page-card > button { width: 100%; }
  .pixel-grid { width: min(88vw, 440px); }
}
