/* The online date stamp editor. Built from the site's tokens: camera black, graphite, shutter yellow. */
.ed-band { padding: clamp(20px, 3vw, 40px) var(--gutter) clamp(40px, 6vw, 72px); }
.ed-intro { max-width: 860px; margin-bottom: clamp(20px, 3vw, 32px); }
.ed-intro .eyebrow { color: var(--shutter); margin-bottom: 12px; }
.ed-intro h1 { font: 800 clamp(30px, 4.2vw, 56px)/1.02 var(--display); font-variation-settings: "wdth" 104; letter-spacing: -.025em; text-wrap: balance; }
.ed-intro .lead { margin-top: 14px; max-width: 680px; }

.ed { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: clamp(16px, 2vw, 28px); align-items: start; max-width: 1360px; }
.ed.is-over .ed-stage { outline: 3px dashed var(--shutter); outline-offset: 4px; }

.ed-stage { position: sticky; top: 76px; min-height: calc(66vh + 110px); display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: var(--radius); background: var(--graphite); padding: 12px; }
/* Reserves the sample photo's box (768x1376) before the script sizes the canvas, so nothing moves on load.
   Same rule as buildPreview(): fit the stage width and 66% of the window height, never upscale. */
.ed-canvas { display: block; max-width: 100%; border-radius: 10px; width: min(100%, calc(max(320px, 66vh) * 768 / 1376), 768px); aspect-ratio: 768 / 1376; }
.ed-drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 0 4px; text-align: center; }
.ed-drop[hidden] { display: none; }
.ed-drop p { font-size: 13px; color: #C7C7CC; }
.ed-file-btn { cursor: pointer; }
.ed-file-btn:focus-within { outline: 3px solid var(--text); outline-offset: 3px; }
.ed-status { margin-top: 10px; font-size: 15px; text-align: center; color: #C7C7CC; }
.ed-status:empty { display: none; }
.ed-status[data-kind="error"] { color: #FF6961; }
.ed-status[data-kind="success"] { color: var(--proof); }
.ed-noscript { padding: 16px; text-align: center; }

.ed-panel { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ed-panel fieldset { margin: 0; min-width: 0; padding: 14px 16px 16px; border: 0; border-radius: 16px; background: var(--graphite); }
.ed-panel fieldset[hidden] { display: none; }
.ed-panel legend { float: left; width: 100%; margin-bottom: 10px; padding: 0; font: 400 12px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.ed-panel legend + * { clear: both; }
.ed-tag { font-style: normal; margin-left: 6px; padding: 2px 6px; border-radius: 5px; background: var(--shutter); color: var(--ink); letter-spacing: .04em; }

.ed-stamps { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ed-stamp { position: relative; display: block; padding: 9px 10px; border-radius: 11px; background: var(--card); cursor: pointer; }
.ed-stamp input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ed-stamp:has(input:checked) { box-shadow: inset 0 0 0 2px var(--shutter); }
.ed-stamp:has(input:focus-visible) { outline: 3px solid var(--shutter); outline-offset: 2px; }
.ed-stamp-name { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; font: 600 14.5px/1.25 var(--body); }
.ed-stamp-name em { font: 400 10.5px/1 var(--mono); font-style: normal; color: var(--shutter); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.ed-stamp-name em.is-free { color: var(--proof); }
.ed-stamp small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.3; color: #AEAEB2; }

.ed-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ed-grid { display: grid; grid-template-columns: repeat(3, 36px); gap: 4px; }
.ed-grid label { position: relative; height: 30px; border-radius: 7px; background: var(--card); cursor: pointer; }
.ed-grid input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.ed-grid span { position: absolute; inset: 11px 14px; border-radius: 2px; background: #636366; pointer-events: none; }
.ed-grid label:has(input:checked) { background: var(--shutter); }
.ed-grid label:has(input:checked) span { background: var(--ink); }
.ed-grid label:has(input:focus-visible) { outline: 3px solid var(--text); outline-offset: 1px; }
.ed-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--card); }
.ed-seg label { position: relative; cursor: pointer; }
.ed-seg input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.ed-seg span { display: block; min-width: 42px; padding: 9px 0; border-radius: 999px; text-align: center; font: 600 14px/1 var(--body); }
.ed-seg label:has(input:checked) span { background: var(--shutter); color: var(--ink); }
.ed-seg label:has(input:focus-visible) span { outline: 3px solid var(--text); outline-offset: 1px; }

.ed-field { display: block; margin-top: 10px; }
.ed-field:first-of-type { margin-top: 0; }
.ed-field[hidden] { display: none; }
.ed-field span { display: block; margin-bottom: 4px; font-size: 13px; color: #C7C7CC; }
/* 16px stops iOS zooming the page when a field gets focus. */
.ed-field input { width: 100%; min-height: 42px; padding: 8px 12px; border: 0; border-radius: 10px; background: var(--card); color: var(--text); font: 400 16px/1.2 var(--body); color-scheme: dark; }
.ed-field input:disabled { color: #AEAEB2; opacity: 1; }
.ed-field input::placeholder { color: #8E8E93; }
.ed-hint { margin-top: 6px; font-size: 13px; line-height: 1.4; color: #AEAEB2; }
.ed-hint:empty { display: none; }
.ed-switch { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 14.5px; cursor: pointer; }
.ed-switch[hidden] { display: none; }
.ed-switch input { width: 18px; height: 18px; margin: 0; accent-color: var(--shutter); }

.ed-inks { display: flex; gap: 8px; flex-wrap: wrap; }
.ed-ink { width: 32px; height: 32px; padding: 0; border: 2px solid transparent; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); cursor: pointer; }
.ed-ink-original { background: conic-gradient(#FF8A2A, #FFD60A, #fff, #FF8A2A); }
.ed-ink[aria-pressed="true"] { border-color: var(--ink); outline: 2px solid var(--shutter); outline-offset: 0; }

.ed-locks { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-locks button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--card); color: var(--text); font: 500 13.5px/1 var(--body); cursor: pointer; }
.ed-locks button::after { content: " ›"; color: var(--shutter); }
.ed-locks button:hover { background: #3A3A3C; }

.ed-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0; }
.ed-save { flex: 1 1 180px; }
.ed-save.is-iphone { background: var(--text); }
.ed-actions .btn-ghost[hidden] { display: none; }
.ed-actions .ed-hint { flex-basis: 100%; }

.ed-dialog { width: min(720px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: var(--radius); background: var(--graphite); color: var(--text); }
.ed-dialog::backdrop { background: rgba(0,0,0,.66); }
.ed-close { position: absolute; top: 10px; right: 10px; z-index: 1; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--card); color: var(--text); font-size: 24px; line-height: 1; cursor: pointer; }
.ed-dialog-body { display: grid; grid-template-columns: 200px 1fr; gap: 24px; padding: 26px; }
.ed-dialog h2 { font: 700 clamp(23px, 3vw, 29px)/1.1 var(--display); padding-right: 30px; }
.ed-dialog .eyebrow { margin-bottom: 8px; color: var(--shutter); padding-right: 40px; }
.ed-qr-wrap p { margin-top: 8px; text-align: center; font-size: 13px; color: #C7C7CC; }
.ed-qr svg { display: block; width: 100%; height: auto; border-radius: 12px; }
.ed-benefits { margin: 14px 0; display: grid; gap: 8px; font-size: 15px; line-height: 1.4; color: #D1D1D6; }
.ed-benefits b { color: var(--text); font-weight: 600; }
.ed-dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ed-dialog.is-phone .ed-dialog-body { grid-template-columns: 1fr; }
.ed-dialog.is-phone .ed-qr-wrap { display: none; }

@media (max-width: 900px) {
  .ed { grid-template-columns: minmax(0, 1fr); }
  .ed-stage { position: relative; top: 0; min-height: min(calc(66vh + 110px), 170vw); }
  .ed-dialog-body { grid-template-columns: 1fr; }
  .ed-qr-wrap { max-width: 180px; }
}
