* { box-sizing: border-box; }
:root {
  color-scheme: light;
  --ink: #202320;
  --muted: #737970;
  --line: #e4e5df;
  --paper: #fbfbf8;
  --accent: #287d7c;
  --accent-dark: #1f6565;
  --accent-soft: #e7f1ef;
  --stage: #e9e9e4;
  font-family: "DM Sans", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
html, body { min-width: 320px; min-height: 100%; margin: 0; background: var(--paper); color: var(--ink); }
body { min-height: 100vh; }
button, input, textarea { font: inherit; }
.app-shell { min-height: 100vh; }
.topbar { height: 76px; padding: 0 42px; display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 13px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); display: flex; gap: 3px; justify-content: center; align-items: center; padding: 7px; }
.brand-mark i { display: block; width: 3px; border-radius: 3px; background: #fff; }
.brand-mark i:nth-child(1) { height: 10px; }
.brand-mark i:nth-child(2) { height: 17px; }
.brand-mark i:nth-child(3) { height: 13px; }
.brand-copy { display: flex; flex-direction: column; gap: 2px; }
.brand-copy strong { font-size: 13px; letter-spacing: 1.7px; font-weight: 700; }
.brand-copy small { color: #8b9088; font-size: 9px; letter-spacing: 1.35px; font-weight: 600; }
.topbar-note { display: flex; align-items: center; gap: 8px; color: #69736d; font-size: 11px; letter-spacing: 1.15px; font-weight: 600; }
.topbar-note[data-state="offline"] { color: #8c5d23; }
.topbar-note[data-state="offline"] .live-dot { background: #c38a3d; }
.topbar-note[data-state="unavailable"] .live-dot { background: #a15b58; }
.live-dot, .resolution-dot, .stage-caption-dot { width: 7px; height: 7px; border-radius: 50%; background: #4b9b77; display: inline-block; }
.workspace { min-height: calc(100vh - 76px); display: grid; grid-template-columns: 390px minmax(0, 1fr); }
.editor-panel { padding: 39px 32px 24px 42px; border-right: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; }
.eyebrow { display: block; color: var(--accent); font-size: 10px; line-height: 1.2; letter-spacing: 1.7px; font-weight: 700; }
.panel-heading h1 { max-width: 300px; margin: 11px 0 7px; font-family: Montserrat, "DM Sans", sans-serif; font-size: 25px; line-height: 1.22; letter-spacing: -0.8px; font-weight: 600; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
#banner-form { margin-top: 30px; }
.field-label { display: block; margin-bottom: 8px; color: #313832; font-size: 12px; line-height: 1.25; font-weight: 600; }
textarea, input[type="text"] { width: 100%; border: 1px solid #dfe2dc; border-radius: 7px; outline: none; background: #fff; color: #212722; transition: border-color .15s ease, box-shadow .15s ease; }
textarea { min-height: 78px; padding: 11px 12px; line-height: 1.5; resize: vertical; font-size: 13px; }
input[type="text"] { height: 40px; padding: 0 12px; font-size: 13px; }
textarea:focus, input[type="text"]:focus { border-color: #4d9692; box-shadow: 0 0 0 3px rgba(40,125,124,.11); }
.field-meta { min-height: 20px; padding-top: 6px; display: flex; justify-content: space-between; gap: 8px; color: #90968f; font-size: 10px; }
.field-spacer { height: 17px; }
.field-spacer.small { height: 14px; }
.alignment-field { min-width: 0; margin: 23px 0 0; padding: 0; border: 0; }
.alignment-field legend { padding: 0; }
.alignment-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.alignment-button { min-height: 65px; padding: 8px 4px 7px; display: flex; flex-direction: column; gap: 7px; align-items: center; justify-content: center; border: 1px solid #e1e3dd; border-radius: 7px; background: #fff; color: #777e76; cursor: pointer; font-size: 10px; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.alignment-button:hover { border-color: #a7c5c2; }
.alignment-button.is-selected { border-color: #6ea9a4; color: var(--accent-dark); background: var(--accent-soft); }
.align-glyph { width: 26px; height: 21px; display: flex; flex-direction: column; justify-content: space-between; }
.align-glyph i { display: block; height: 2px; border-radius: 2px; background: currentColor; }
.align-glyph i:nth-child(1) { width: 19px; }
.align-glyph i:nth-child(2) { width: 25px; }
.align-glyph i:nth-child(3) { width: 15px; }
.align-left { align-items: flex-start; }
.align-center { align-items: center; }
.align-right { align-items: flex-end; }
.position-field { min-width: 0; margin: 16px 0 0; padding: 0; border: 0; }
.position-field legend { padding: 0; }
.position-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.position-button { min-height: 37px; padding: 6px 4px; border: 1px solid #e1e3dd; border-radius: 7px; background: #fff; color: #777e76; cursor: pointer; font-size: 10px; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.position-button:hover { border-color: #a7c5c2; }
.position-button.is-selected { border-color: #6ea9a4; color: var(--accent-dark); background: var(--accent-soft); }
.wash-control { margin-top: 25px; }
.wash-heading { display: flex; align-items: center; justify-content: space-between; }
.wash-heading .field-label { margin: 0; }
.wash-heading output { color: var(--accent-dark); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 18px; margin: 10px 0 3px; accent-color: var(--accent); cursor: pointer; }
.wash-control p { margin: 2px 0 0; color: #8b9189; font-size: 10px; line-height: 1.45; }
.editor-footnote { margin-top: auto; padding-top: 19px; display: flex; align-items: center; gap: 8px; border-top: 1px solid #eff0eb; color: #8a9088; font-size: 10px; }
.key-icon { width: 17px; height: 17px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #dfe4de; border-radius: 4px; color: var(--accent); font-size: 13px; }
.preview-area { min-width: 0; padding: 43px clamp(28px, 5vw, 76px) 38px; display: flex; flex-direction: column; background: #f5f5f1; }
.preview-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.preview-heading h2 { margin: 8px 0 0; font-family: Montserrat, "DM Sans", sans-serif; font-size: 21px; line-height: 1.2; letter-spacing: -.5px; font-weight: 600; }
.preview-tools { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.background-button, .restore-button { min-height: 34px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #d7ddd6; border-radius: 6px; background: #fff; color: #426662; cursor: pointer; font-size: 10px; font-weight: 600; transition: border-color .15s ease, background .15s ease; }
.background-button:hover, .restore-button:hover { border-color: #87b2ac; background: #f4f9f7; }
.background-button:focus-visible, .restore-button:focus-visible { outline: 3px solid rgba(40,125,124,.2); outline-offset: 2px; }
.background-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.restore-button[hidden] { display: none; }
.resolution-tag { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid #e0e3dd; border-radius: 20px; background: rgba(255,255,255,.65); color: #687169; font-size: 10px; letter-spacing: .3px; white-space: nowrap; }
.resolution-dot { width: 6px; height: 6px; background: #70a69a; }
.stage { flex: 1; min-height: 260px; margin-top: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; border: 1px solid #e0e2dc; border-radius: 10px; background: var(--stage); }
.stage-frame { width: min(100%, 920px); aspect-ratio: 16 / 9; border: 1px solid rgba(25,31,26,.14); background: #fff; box-shadow: 0 12px 30px rgba(36,42,35,.10); overflow: hidden; }
#banner-canvas { display: block; width: 100%; height: 100%; }
.stage-caption { margin-top: 14px; display: flex; align-items: center; gap: 7px; color: #7d857d; font-size: 10px; }
.offline-hint { margin: 9px 0 0; color: #858c84; font-size: 10px; line-height: 1.45; text-align: center; }
.stage-caption-dot { width: 6px; height: 6px; background: #6ea99b; }
.export-row { min-height: 74px; margin-top: 19px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.export-copy { display: flex; flex-direction: column; gap: 5px; }
.export-copy strong { color: #394039; font-size: 12px; font-weight: 600; }
.export-copy span { color: #858c84; font-size: 10px; }
.download-button { min-height: 43px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 7px; background: var(--accent); color: #fff; box-shadow: 0 3px 8px rgba(25,87,84,.16); cursor: pointer; font-size: 12px; font-weight: 600; transition: background .15s ease, transform .15s ease; }
.download-button:hover { background: var(--accent-dark); transform: translateY(-1px); }
.download-button:active { transform: translateY(0); }
.download-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.admin-pin-dialog { width: min(420px, calc(100vw - 32px)); padding: 0; border: 1px solid #e4e5df; border-radius: 12px; background: #fff; color: var(--ink); box-shadow: 0 24px 70px rgba(26,34,29,.24); }
.admin-pin-dialog::backdrop { background: rgba(24,31,27,.48); backdrop-filter: blur(3px); }
.admin-pin-dialog form { padding: 27px; }
.admin-pin-dialog h2 { margin: 9px 0 7px; font-family: Montserrat, "DM Sans", sans-serif; font-size: 21px; font-weight: 600; letter-spacing: -.4px; }
.admin-pin-dialog p { margin: 0 0 22px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.admin-pin-dialog input[type="password"] { width: 100%; height: 42px; padding: 0 12px; border: 1px solid #dfe2dc; border-radius: 7px; outline: none; background: #fff; color: #212722; font: inherit; letter-spacing: 2px; }
.admin-pin-dialog input[type="password"]:focus { border-color: #4d9692; box-shadow: 0 0 0 3px rgba(40,125,124,.11); }
.pin-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.pin-dialog-actions button { min-height: 38px; padding: 0 14px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 11px; font-weight: 600; }
.pin-cancel-button { border: 1px solid #dfe2dc; background: #fff; color: #566057; }
.pin-submit-button { border: 1px solid var(--accent); background: var(--accent); color: #fff; }
.pin-submit-button:hover { border-color: var(--accent-dark); background: var(--accent-dark); }
.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; }
@media (min-width: 1500px) { .stage-frame { width: min(100%, 1120px); } }
@media (max-width: 1000px) {
  .workspace { grid-template-columns: 330px minmax(0, 1fr); }
  .editor-panel { padding-left: 28px; padding-right: 24px; }
  .preview-area { padding-left: 28px; padding-right: 28px; }
  .stage { padding: 16px; }
}
@media (max-width: 760px) {
  .topbar { height: 65px; padding: 0 18px; }
  .brand-copy small { font-size: 8px; }
  .topbar-note { font-size: 9px; }
  .workspace { display: flex; flex-direction: column; }
  .editor-panel { padding: 27px 20px 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .panel-heading h1 { font-size: 23px; }
  #banner-form { margin-top: 22px; }
  .editor-footnote { margin-top: 24px; }
  .preview-area { padding: 28px 16px 24px; min-height: 380px; }
  .preview-heading h2 { font-size: 18px; }
  .resolution-tag { padding: 6px 8px; font-size: 9px; }
  .stage { min-height: 190px; padding: 12px; margin-top: 17px; }
  .export-row { align-items: flex-start; flex-direction: column; padding-top: 8px; }
  .download-button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* Local typography and safe-text-area controls. */
.text-style-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; }
.text-style-controls > label { display: flex; align-items: center; gap: 8px; color: #737970; font-size: 10px; }
.number-with-unit { display: flex; align-items: center; gap: 5px; }
input[type="number"] { width: 70px; height: 32px; border: 1px solid #dfe2dc; border-radius: 6px; padding: 0 6px 0 9px; background: #fff; color: var(--ink); font-size: 12px; }
input[type="number"]:focus { outline: 2px solid rgba(40,125,124,.22); outline-offset: 1px; }
input[type="color"] { width: 38px; height: 32px; padding: 3px; border: 1px solid #dfe2dc; border-radius: 6px; background: #fff; cursor: pointer; }
.text-area-controls { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.text-area-controls summary { color: #313832; font-size: 12px; font-weight: 600; cursor: pointer; }
.text-area-controls > p { color: #8b9189; font-size: 10px; line-height: 1.5; margin: 10px 0; }
.area-presets { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.area-presets button, .reset-visual-button { border: 1px solid #dfe2dc; border-radius: 6px; color: var(--accent-dark); background: #fff; cursor: pointer; padding: 7px 8px; font-size: 10px; }
.area-presets button:hover, .reset-visual-button:hover { background: var(--accent-soft); }
.area-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.area-inputs label { display: flex; flex-direction: column; gap: 5px; color: #737970; font-size: 10px; }
.area-inputs input { width: 100%; }
.checkbox-field { margin-top: 12px; display: flex; align-items: flex-start; gap: 7px; color: #737970; font-size: 10px; line-height: 1.5; cursor: pointer; }
.checkbox-field input { margin: 2px 0 0; flex-shrink: 0; accent-color: var(--accent); }
.reset-visual-button { margin-top: 13px; }
.stage-frame { position: relative; }
.text-box-guide { position: absolute; border: 1px dashed #287d7c; pointer-events: none; box-shadow: 0 0 0 1px rgba(255,255,255,.55); }
.text-box-guide[hidden] { display: none; }
.text-box-guide span { position: absolute; left: 0; top: 0; background: #287d7c; color: #fff; padding: 3px 5px; font-size: 9px; line-height: 1; }
.layout-status { margin: 12px 0 0; min-height: 18px; color: #6b756d; font-size: 11px; line-height: 1.45; }
.layout-status[data-state="overflow"] { color: #a04734; font-weight: 600; }
.download-button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
@media (min-width: 761px) { .preview-area { position: sticky; top: 0; align-self: start; height: calc(100vh - 16px); min-height: 560px; } }
@media (max-width: 760px) { .topbar { gap: 12px; } .topbar-note { max-width: 45%; line-height: 1.35; text-align: right; letter-spacing: .4px; } .stage-caption { flex-wrap: wrap; justify-content: center; } }
