/* ProgressBar.today editor — a calm, preview-first configuration studio. */

:root {
  --studio-bg: #f7f8f9;
  --studio-paper: #ffffff;
  --studio-ink: #202020;
  --studio-muted: #858585;
  --studio-faint: #a8a8a8;
  --studio-soft: #f3f3f3;
  --studio-soft-2: #ededed;
  --studio-border: #e7e7e7;
  --studio-coral: #ff8172;
  --studio-dark: #121820;
  --studio-radius: 18px;
  --studio-shadow: 0 9px 24px rgba(20, 24, 28, .08);
  --studio-serif: 'Cormorant Garamond', 'DM Serif Display', Georgia, serif;
}

* { box-sizing: border-box; }
html { height: auto; background: var(--studio-bg); }

body {
  min-height: 100vh;
  height: auto;
  margin: 0;
  display: block;
  overflow: hidden;
  background: var(--studio-bg);
  color: var(--studio-ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }
button, input, select { font: inherit; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--studio-dark) !important;
  outline-offset: 3px;
}

.skip-link { border: 0; border-radius: 999px; background: var(--studio-dark); color: #fff; box-shadow: var(--studio-shadow); }
.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; }

/* Floating navigation */

.site-header {
  position: fixed;
  z-index: 100;
  top: 24px;
  left: 50%;
  width: min(560px, calc(100vw - 32px));
  height: 58px;
  padding: 8px 8px 8px 20px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 20px;
  border: 1px solid rgba(226, 232, 240, .7);
  border-radius: 999px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 10px 25px rgba(0, 0, 0, .07);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.site-brand { display: flex; align-items: center; gap: 10px; width: max-content; color: inherit; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #d7d7d7; border-radius: 9px; background: #ececec; box-shadow: none; transform: none; }
.brand-mark i { display: none; }
.brand-mark::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--studio-coral); box-shadow: 0 0 0 4px #dcdcdc; }
.site-brand:hover .brand-mark { transform: none; }
.wordmark { font-size: 12px; font-weight: 600; line-height: 1; letter-spacing: .16em; }
.site-tagline { margin: 0; color: var(--studio-muted); font: 400 13px 'Inter', sans-serif; white-space: nowrap; }

.license-pill { justify-self: end; height: 40px; display: inline-flex; align-items: center; padding: 0 20px; border: 0; border-radius: 999px; background: var(--studio-dark); color: #fff; box-shadow: none; font-size: 10px; font-weight: 600; letter-spacing: .04em; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s; }
.license-pill .status-dot, .license-pill > span:last-child { display: none; }
.license-pill:hover { transform: translateY(-1px); background: #202832; box-shadow: 0 7px 18px rgba(0,0,0,.14); }
.license-pill:active { transform: translateY(0); }
.license-pill.is-paid { background: #dde2e5; color: var(--studio-dark); cursor: default; }

/* Primary split view */

.workspace {
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(390px, 46%) minmax(560px, 54%);
  grid-template-areas: 'preview controls';
  background: var(--studio-paper);
}

.stage {
  grid-area: preview;
  position: relative;
  min-width: 0;
  height: 100vh;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  overflow: hidden;
  background: var(--studio-bg);
  border: 0;
}

.preview-toolbar,
.preview-footer,
.preview-ticket,
.canvas-grid,
.canvas-index,
.orbit { display: none !important; }

.preview-canvas { grid-row: 1; position: relative; width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; background: transparent; }
.preview-canvas::before, .preview-canvas::after { display: none; }
.stage .phone-shell { position: relative; z-index: 2; width: min(370px, 32vw, calc((100vh - 168px) / 2.17)); max-width: 76%; transform: none; }
.stage .phone { box-shadow: 0 25px 58px rgba(0,0,0,.14), 0 0 0 14px #d0d0d0; transition: aspect-ratio .3s ease; }
.stage .screen { background: linear-gradient(160deg, #e9ca94 0 30%, #6f9e96 30% 69%, #345a53 69%); }
.stage .wallpaper { animation: studioPhotoIn .32s ease; }
@keyframes studioPhotoIn { from { opacity: .35; transform: scale(1.018); } }

.panel {
  grid-area: controls;
  width: 100%;
  height: 100vh;
  padding: 0 clamp(28px, 4vw, 54px) 166px;
  display: block;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--studio-paper);
  border: 0;
  scrollbar-width: thin;
  scrollbar-color: #d7d7d7 transparent;
}
.panel::-webkit-scrollbar { width: 6px; }
.panel::-webkit-scrollbar-track { background: transparent; border: 0; }
.panel::-webkit-scrollbar-thumb { background: #d7d7d7; border-radius: 99px; }

.panel-intro { position: relative; padding: 118px 0 32px; overflow: visible; border: 0; }
.panel-intro::after { display: none; }
.panel .panel-intro h1 { margin: 0; color: var(--studio-ink); font: 400 35px/1 var(--studio-serif); letter-spacing: -.03em; }
.panel-intro > .eyebrow { display: none; }
.panel-intro > p:not(.eyebrow) { max-width: 46ch; margin: 13px 0 14px; color: var(--studio-muted); font-size: 12px; line-height: 1.6; }
.local-save { display: inline-flex; align-items: center; gap: 7px; padding: 0; background: transparent; border: 0; color: #9c9c9c; font-size: 8px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.local-save span { color: var(--studio-coral); font-size: 9px; }

.editor-section { padding: 31px 0 35px; border: 0; border-top: 1px solid #efefef; }
.panel > section.editor-section + section.editor-section { padding-top: 31px; }
.section-heading { display: block; margin: 0 0 23px; }
.step-number { display: none; }
.section-heading h2 { margin: 0 0 5px; color: var(--studio-ink); font: 400 28px/1.1 var(--studio-serif); letter-spacing: -.025em; }
.section-heading p { margin: 0; color: #999; font-size: 10px; line-height: 1.45; }

/* Shared fields */

.field { margin: 0 0 22px; }
.field:last-child { margin-bottom: 0; }
.panel .field label,
.panel .field > label,
.label-row label,
.field-label { display: block; margin: 0 0 9px; color: #686868; font-size: 8px; font-weight: 600; line-height: 1.2; letter-spacing: .1em; text-transform: uppercase; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field-note { color: #a5a5a5; font-size: 7px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.control-help { margin: 8px 2px 0; color: #a1a1a1; font-size: 8px; line-height: 1.45; }

.field-row { display: grid; grid-template-columns: 1fr 24px 1fr; gap: 10px; align-items: end; margin-bottom: 22px; }
.field-row .field { min-width: 0; margin: 0; }
.date-arrow { display: grid; place-items: center; height: 56px; color: #aaa; font-size: 15px; }

.panel input[type="date"],
.panel input[type="text"],
.panel select,
.modal-card input[type="text"],
.modal-card input[type="email"] {
  width: 100%;
  min-height: 56px;
  padding: 0 17px;
  color: var(--studio-ink);
  background-color: #f7f7f7;
  border: 1px solid #ebebeb;
  border-radius: 17px;
  box-shadow: none;
  font: 400 12px 'Inter', sans-serif;
  color-scheme: light;
  transition: background .16s, border-color .16s, box-shadow .16s;
}
.panel input[type="date"]:hover,
.panel input[type="text"]:hover,
.panel select:hover { background-color: #f3f3f3; }
.panel input[type="date"]:focus,
.panel input[type="text"]:focus,
.panel select:focus { outline: none; background-color: #fff; border-color: #c9c9c9; box-shadow: 0 5px 16px rgba(0,0,0,.06); transform: none; }
.select-control { position: relative; }
.select-control::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 19px;
  width: 7px;
  height: 7px;
  border-right: 1.75px solid #777;
  border-bottom: 1.75px solid #777;
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
  transform-origin: center;
  transition: border-color .16s ease;
}
.select-control:focus-within::after { border-color: var(--studio-blue); }
.panel select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 48px; background-image: none; }

/* Background choices */

.stock-carousel { display: grid; grid-template-columns: 34px minmax(0, 1fr) 34px; gap: 9px; align-items: center; }
.stock-viewport {
  min-width: 0;
  margin: -5px 0;
  padding: 5px 3px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
  scroll-padding-inline: 3px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  touch-action: pan-x;
}
.stock-viewport::-webkit-scrollbar { display: none; }
.stock-viewport:focus-visible { outline: 2px solid var(--studio-blue) !important; outline-offset: 3px; border-radius: calc(var(--studio-radius) + 2px); }
.stock-grid { width: 100%; min-width: 100%; display: flex; gap: 10px; padding: 0; overflow: visible; }
.stock-grid:empty { min-height: 92px; border: 0; border-radius: var(--studio-radius); background: repeating-linear-gradient(135deg, #f8f8f8 0 10px, #f2f2f2 10px 20px); }
.stock-thumb { position: relative; width: auto; height: auto; aspect-ratio: 1080 / 2340; flex: 0 0 clamp(52px, calc((100% - 40px) / 5), 68px); padding: 0; overflow: hidden; scroll-snap-align: start; scroll-snap-stop: normal; background: var(--studio-soft); border: 1px solid transparent; border-radius: var(--studio-radius); box-shadow: none; cursor: pointer; transition: transform .17s ease, border-color .17s, box-shadow .17s; }
.stock-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; background: var(--studio-soft); filter: saturate(.82) contrast(.96); }
.stock-thumb::after { content: ''; position: absolute; inset: 0; border: 0; border-radius: inherit; pointer-events: none; }
.stock-thumb::before {
  content: '✓';
  position: absolute;
  z-index: 2;
  top: 7px;
  right: 7px;
  width: 18px;
  height: 18px;
  display: block !important;
  padding: 0;
  box-sizing: border-box;
  opacity: 0;
  color: var(--studio-ink);
  background: var(--studio-butter);
  border: 1px solid var(--studio-ink);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,.22);
  font: 800 10px/16px Arial, sans-serif;
  text-align: center;
  pointer-events: none;
  transform: scale(.65);
  transform-origin: center;
  transition: opacity .16s ease, transform .16s ease;
}
.stock-thumb:hover { transform: translateY(-2px); border-color: #dedede; box-shadow: var(--studio-shadow); }
.stock-thumb.active { transform: none; border-color: #737373; box-shadow: 0 4px 13px rgba(0,0,0,.08); }
.stock-thumb.active::after { border: 3px solid rgba(255,255,255,.8); }
.stock-thumb.active::before { opacity: 1; transform: scale(1); }
.stock-nav { position: relative; width: 34px; height: 34px; display: grid; place-items: center; padding: 0; background: #fff; border: 1px solid #dedede; border-radius: 50%; box-shadow: 0 4px 11px rgba(0,0,0,.06); cursor: pointer; transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease, opacity .16s ease; }
.stock-nav:hover:not(:disabled) { background: #f2f2f2; border-color: #bdbdbd; transform: translateY(-1px); }
.stock-nav:active:not(:disabled) { transform: translateY(1px); }
.stock-nav:disabled { opacity: .28; box-shadow: none; cursor: default; }
.stock-nav span { width: 7px; height: 7px; display: block; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; }
.stock-nav-prev span { margin-left: 3px; transform: rotate(135deg); }
.stock-nav-next span { margin-right: 3px; transform: rotate(-45deg); }
.stock-carousel-meta { display: flex; justify-content: space-between; gap: 12px; margin: 11px 43px 0; color: #9c9c9c; font-size: 7px; font-weight: 500; letter-spacing: .06em; line-height: 1.3; text-transform: uppercase; }
.stock-carousel-meta span:first-child { min-width: 0; overflow: hidden; color: #6d6d6d; text-overflow: ellipsis; white-space: nowrap; }
.stock-carousel-meta span:last-child { flex: 0 0 auto; }

.custom-photo-field { padding-top: 1px; }
.dropzone { position: relative; min-height: 88px; display: flex; align-items: stretch; justify-content: stretch; overflow: hidden; background: #f7f7f7; border: 1px solid #ebebeb; border-radius: var(--studio-radius); cursor: pointer; transition: background .18s, border-color .18s, box-shadow .18s, transform .18s; }
.dropzone:hover, .dropzone.drag, .dropzone:focus-visible { background: #f1f1f1; border-color: #cacaca; box-shadow: var(--studio-shadow); transform: translateY(-1px); }
.dropzone.has-photo { min-height: 118px; display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 15px; align-items: center; padding: 11px; background: #fff0ed; border-color: #ffc7bd; }
.dropzone.has-photo:hover, .dropzone.has-photo.drag, .dropzone.has-photo:focus-visible { background: #ffe7e2; border-color: #ff9e8e; }
.drop-hint { width: 100%; display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; padding: 15px 17px; color: var(--studio-ink); text-align: left; line-height: 1.3; }
.upload-symbol { width: 38px; height: 38px; display: grid; place-items: center; background: #e4e4e4; border: 0; border-radius: 50%; color: #4f4f4f; font-size: 19px; font-weight: 400; line-height: 1; }
.upload-copy { display: flex; flex-direction: column; gap: 3px; }
.upload-copy strong { font-size: 11px; font-weight: 500; }
.upload-copy small { color: #9a9a9a; font-size: 8px; }
.pro-stamp { align-self: start; padding: 4px 7px; background: #e8e8e8; color: #777; border-radius: 99px; font-size: 7px; font-weight: 600; letter-spacing: .08em; }
.thumb { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; object-fit: cover; }
.dropzone.has-photo .thumb { position: relative; inset: auto; width: 76px; height: 96px; display: block; object-fit: contain; object-position: center; background: #17191d; border-radius: 12px; box-shadow: 0 7px 18px rgba(0,0,0,.3); }
.photo-preview-meta { display: none; min-width: 0; color: #2b1e1b; }
.dropzone.has-photo .photo-preview-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.photo-preview-meta span { padding: 4px 7px; background: rgba(255,118,95,.16); border-radius: 999px; color: #9a3d2d; font-size: 7px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.photo-preview-meta strong { margin-top: 2px; font: 400 17px/1.1 var(--studio-serif); }
.photo-preview-meta small { max-width: 25ch; color: rgba(43,30,27,.7); font-size: 8px; line-height: 1.4; }

/* Appearance controls */

.design-carousel { display: grid; grid-template-columns: 34px minmax(0, 1fr) 34px; gap: 9px; align-items: center; }
.design-viewport { min-width: 0; margin: -5px 0; padding: 5px 3px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-behavior: smooth; scroll-padding-inline: 3px; scroll-snap-type: x mandatory; scrollbar-width: none; touch-action: pan-x; }
.design-viewport::-webkit-scrollbar { display: none; }
.design-viewport:focus-visible { outline: 2px solid var(--studio-blue) !important; outline-offset: 3px; border-radius: calc(var(--studio-radius) + 2px); }
.design-strip { width: 100%; min-width: 100%; display: flex; gap: 10px; padding: 0; overflow: visible; }
.design-option { --preview-ink: #fff; --auto-preview-accent: #ff765f; --preview-fg: var(--preview-text-color, var(--preview-ink)); --preview-bar: var(--preview-accent, var(--auto-preview-accent)); position: relative; min-width: 0; flex: 0 0 clamp(86px, calc((100% - 30px) / 4), 116px); padding: 7px 7px 12px; display: grid; grid-template-columns: 1fr; gap: 8px; align-items: center; justify-items: center; scroll-snap-align: start; background: var(--studio-soft); border: 1px solid transparent; border-radius: var(--studio-radius); box-shadow: none; cursor: pointer; transition: transform .17s ease, border-color .17s, box-shadow .17s, background .17s; }
.design-option:hover { transform: translateY(-2px); border-color: #dedede; box-shadow: var(--studio-shadow); }
.design-option.active { transform: none; background: #fafafa; border-color: #777; box-shadow: 0 5px 14px rgba(0,0,0,.08); }
.design-option img { position: relative; z-index: 0; grid-column: 1; width: 100%; height: 88px; aspect-ratio: auto; display: block; object-fit: cover; object-position: center; border: 0; border-radius: 12px; filter: saturate(.76) contrast(.96); transition: opacity .16s ease; }
.design-option span { width: 100%; overflow: hidden; color: #595959; font: 400 12px var(--studio-serif); text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.design-option small { display: none; }
.design-carousel-meta { margin-top: 11px; }

/* Live miniature treatments. The image beneath these overlays is synchronized
   with the selected stock background or uploaded photo. */
.design-option::before,
.design-option::after {
  content: '';
  position: absolute;
  z-index: 1;
  top: 19px;
  left: 16px;
  right: 16px;
  height: 54px;
  border-radius: 7px;
  pointer-events: none;
}
.design-option::after {
  color: var(--preview-fg);
  background:
    linear-gradient(var(--preview-fg), var(--preview-fg)) 50% 25% / 42% 2px no-repeat,
    linear-gradient(var(--preview-fg), var(--preview-fg)) 50% 43% / 62% 1px no-repeat,
    linear-gradient(var(--preview-bar), var(--preview-bar)) 50% 76% / 70% 4px no-repeat;
  opacity: .92;
}

/* Open layouts */
.design-option[data-design="minimal"]::before,
.design-option[data-design="focus"]::before,
.design-option[data-design="caption"]::before,
.design-option[data-design="stack"]::before,
.design-option[data-design="signal"]::before { background: linear-gradient(180deg, transparent, rgba(0,0,0,.28)); }
.design-option[data-design="minimal"]::after { background-position: 50% 28%, 50% 48%, 50% 76%; }
.design-option[data-design="focus"]::after {
  content: '132';
  display: grid;
  place-items: center;
  background: linear-gradient(var(--preview-bar), var(--preview-bar)) 50% 82% / 70% 3px no-repeat;
  font: 400 27px/1 var(--studio-serif);
}
.design-option[data-design="caption"]::after {
  content: '132 DAYS';
  display: flex;
  align-items: center;
  padding-left: 5px;
  background:
    linear-gradient(var(--preview-fg), var(--preview-fg)) 8% 24% / 48% 2px no-repeat,
    linear-gradient(var(--preview-bar), var(--preview-bar)) 8% 82% / 72% 3px no-repeat;
  font: 500 11px/1 'Inter', sans-serif;
  letter-spacing: .04em;
}
.design-option[data-design="stack"]::before { border-left: 3px solid var(--preview-fg); border-radius: 0; }
.design-option[data-design="stack"]::after { background-position: 28% 24%, 32% 44%, 42% 78%; }
.design-option[data-design="signal"]::after {
  content: '68%';
  display: grid;
  place-items: center;
  background: linear-gradient(var(--preview-bar), var(--preview-bar)) 50% 82% / 64% 3px no-repeat;
  font: 300 25px/1 'Inter', sans-serif;
  letter-spacing: -.08em;
}

/* Open outline plus card treatments */
.design-option[data-design="outline"]::before { background: rgba(0,0,0,.08); border: 1px solid rgba(255,255,255,.9); }
.design-option[data-design="glass"], .design-option[data-design="paper"] { --auto-preview-accent: #88a896; }
.design-option[data-design="dark"], .design-option[data-design="halo"], .design-option[data-design="breeze"] { --auto-preview-accent: #7ec4e4; }
.design-option[data-design="outline"] { --auto-preview-accent: #fff; }
.design-option[data-design="stack"], .design-option[data-design="ledger"] { --auto-preview-accent: #f0ba5d; }
.design-option[data-design="aurora"] { --auto-preview-accent: #8fd6ff; }
.design-option[data-design="editorial"] { --auto-preview-accent: #d3785c; }
.design-option[data-design="horizon"] { --auto-preview-accent: #ffc983; }
.design-option[data-design="chapter"] { --auto-preview-accent: #bc8a66; }
.design-option[data-design="glass"]::before { background: rgba(255,255,255,.30); border: 1px solid rgba(255,255,255,.58); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.design-option[data-design="dark"]::before { background: rgba(10,15,12,.64); border: 1px solid rgba(255,255,255,.28); }
.design-option[data-design="halo"]::before { background: rgba(8,12,28,.72); border: 1px solid rgba(175,218,255,.7); box-shadow: 0 0 10px rgba(96,178,255,.55); }
.design-option[data-design="aurora"]::before { background: linear-gradient(135deg, rgba(34,35,102,.85), rgba(118,51,126,.78), rgba(12,115,109,.78)); border: 1px solid rgba(220,230,255,.46); }
.design-option[data-design="paper"],
.design-option[data-design="editorial"],
.design-option[data-design="chapter"] { --preview-ink: #312a27; }
.design-option[data-design="paper"]::before { background: rgba(255,250,239,.94); }
.design-option[data-design="editorial"]::before { background: #f7eed8; border-radius: 2px; box-shadow: 4px 4px 0 rgba(16,20,26,.85); }
.design-option[data-design="ledger"]::before { background: #0f1d2b; border-left: 4px solid #f0ba5d; border-radius: 2px; }
.design-option[data-design="poster"]::before { background: #253db7; border: 1px solid #fff7df; border-radius: 2px; box-shadow: 4px 4px 0 #ff765f; }
.design-option[data-design="countdown"]::before { background: rgba(255,250,243,.88); border: 1px solid rgba(255,255,255,.65); }
.design-option[data-design="countdown"] { --preview-ink: #5c514e; }
.design-option[data-design="breeze"]::before { background: rgba(240,248,251,.88); border: 1px solid rgba(255,255,255,.72); }
.design-option[data-design="breeze"] { --preview-ink: #497387; }
.design-option[data-design="horizon"]::before { background: rgba(10,25,36,.78); border: 1px solid rgba(255,255,255,.22); }
.design-option[data-design="chapter"]::before { background: rgba(250,244,231,.96); border-left: 4px solid #bc8a66; border-radius: 2px 7px 7px 2px; }

.label-val { min-width: 38px; padding: 5px 8px; color: #6f6f6f; background: #ededed; border-radius: 999px; font-size: 8px; font-weight: 500; letter-spacing: .02em; text-align: center; }
input[type="range"] { width: 100%; height: 24px; margin: 0; accent-color: var(--studio-dark); cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 5px; background: #e7e7e7; border: 0; border-radius: 99px; }
input[type="range"]::-webkit-slider-thumb { width: 18px; height: 18px; margin-top: -6.5px; appearance: none; -webkit-appearance: none; background: #1f252c; border: 0; border-radius: 50%; box-shadow: 0 3px 8px rgba(0,0,0,.18); }
input[type="range"]::-moz-range-track { height: 5px; background: #e7e7e7; border: 0; border-radius: 99px; }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; background: #1f252c; border: 0; border-radius: 50%; box-shadow: 0 3px 8px rgba(0,0,0,.18); }

.swatches { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.color-controls-grid { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 22px; margin-bottom: 22px; }
.color-controls-grid > .field { min-width: 0; margin: 0; }
.color-controls-grid .label-row { justify-content: flex-start; gap: 8px; }
.swatch, .custom-swatch { position: relative; width: 33px; height: 33px; flex: 0 0 auto; display: grid; place-items: center; margin: 0; padding: 0; background: #eee; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #dedede; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.panel .field .custom-swatch { display: grid; place-items: center; margin: 0; }
.swatch:hover, .custom-swatch:hover { transform: scale(1.06); box-shadow: 0 0 0 1px #aaa; }
.swatch.active { transform: scale(.86); box-shadow: 0 0 0 2px #fff, 0 0 0 3px #343434; }
.swatch.active::after { display: none; }
.custom-swatch.active { transform: scale(.86); box-shadow: 0 0 0 2px #fff, 0 0 0 3px #343434; }
.auto-swatch {
  overflow: hidden;
  color: #fff;
  background: conic-gradient(from 45deg, #263cba, #ff765f, #f4c95d, #5b8f7b, #263cba);
}
.auto-swatch span {
  position: relative;
  z-index: 1;
  font: 700 11px/1 'Inter', sans-serif;
  text-shadow: 0 1px 3px rgba(0,0,0,.48);
}
.swatch-color { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; border: 0; cursor: pointer; }
.custom-swatch span { position: relative; width: 12px; height: 12px; display: block; color: transparent; font-size: 0; pointer-events: none; }
.custom-swatch span::before,
.custom-swatch span::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 1.5px;
  background: #777;
  border-radius: 99px;
  transform: translate(-50%, -50%);
}
.custom-swatch span::after { transform: translate(-50%, -50%) rotate(90deg); }

.error { margin: -8px 0 18px; padding: 10px 13px; color: #8a3e36; background: #fff0ee; border: 1px solid #ffd8d3; border-radius: 12px; font-size: 9px; font-weight: 500; line-height: 1.45; }
.error.success { color: #2f6b46; background: #eefaf1; border-color: #bfe8cd; }

/* Persistent result and actions */

.action-dock {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  width: 54%;
  padding: 13px clamp(28px, 4vw, 54px) 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  background: rgba(255,255,255,.95);
  border: 0;
  border-top: 1px solid #ededed;
  box-shadow: 0 -14px 32px rgba(0,0,0,.035);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0 0 1px; border: 0; }
.stat { min-width: 0; padding: 2px 10px 5px; background: transparent; border: 0; border-right: 1px solid #ededed; border-radius: 0; text-align: center; }
.stat:last-child { border-right: 0; }
.stat.standout { background: transparent; }
.stat-num { display: block; overflow: hidden; color: #4b4b4b; font: 400 17px/1 var(--studio-serif); text-overflow: ellipsis; }
.stat-label { display: block; margin-top: 3px; color: #aaa; font-size: 6px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }

.btn-primary, .btn-secondary { min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin: 0; padding: 0 20px; border-radius: 999px; font: 500 10px 'Inter', sans-serif; letter-spacing: .02em; text-decoration: none; text-transform: none; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, background .16s, border-color .16s; }
.btn-primary { grid-column: 2; grid-row: 1; background: var(--studio-dark); color: #fff; border: 1px solid var(--studio-dark); box-shadow: 0 6px 14px rgba(0,0,0,.12); }
.btn-primary:hover { background: #232b34; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(0,0,0,.15); }
.btn-primary:active { transform: translateY(0); box-shadow: 0 3px 8px rgba(0,0,0,.1); }
.btn-secondary { grid-column: 1; grid-row: 1; background: #fff; color: #303030; border: 1px solid #dadada; box-shadow: none; }
.btn-secondary:hover { background: #f7f7f7; border-color: #bcbcbc; transform: translateY(-1px); box-shadow: 0 5px 13px rgba(0,0,0,.06); }
.btn-primary:disabled, .btn-secondary:disabled { opacity: .5; cursor: wait; transform: none; box-shadow: none; }
.action-note { display: block; margin: 9px 0 0; color: var(--studio-muted); font-size: 10px; line-height: 1.4; text-align: center; }
.setup-wallpaper-btn { grid-column: 1 / -1; }

/* Dialogs */

.modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; background: rgba(17, 24, 32, .34); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.modal-card { position: relative; width: min(430px, 100%); max-height: min(760px, calc(100vh - 40px)); overflow-y: auto; padding: 38px; background: #fff; border: 1px solid #ededed; border-radius: 26px; box-shadow: 0 25px 70px rgba(0,0,0,.18); }
.modal-kicker { margin: 0 0 10px; color: #9a9a9a; font-size: 8px; font-weight: 600; letter-spacing: .11em; }
.modal-card h2 { max-width: 330px; margin: 0 0 13px; color: var(--studio-ink); font: 400 35px/.98 var(--studio-serif); letter-spacing: -.03em; }
.modal-sub { margin: 0 0 21px; color: var(--studio-muted); font-size: 11px; line-height: 1.65; }
.modal-sub strong { color: #4b4b4b; font-weight: 600; }
.modal-close { position: absolute; z-index: 3; top: 14px; right: 14px; width: 34px; height: 34px; display: grid; place-items: center; padding: 0; background: #f2f2f2; color: #777; border: 0; border-radius: 50%; font-size: 19px; line-height: 1; cursor: pointer; transition: background .15s, color .15s; }
.modal-close:hover { background: #e8e8e8; color: #222; transform: none; }
.modal-burst { position: absolute; top: 21px; right: 58px; display: grid; place-items: center; width: auto; height: auto; padding: 5px 8px; background: #efefef; border: 0; border-radius: 99px; box-shadow: none; color: #777; font-size: 7px; font-weight: 600; transform: none; }
.modal-buy { grid-column: auto; grid-row: auto; margin-bottom: 23px; }
.modal-divider { position: relative; margin: 25px 0 15px; border-top: 1px solid #ececec; text-align: center; }
.modal-divider span { position: relative; top: -8px; padding: 0 9px; background: #fff; color: #aaa; font-size: 8px; font-weight: 500; text-transform: uppercase; }
.modal-card input[type="text"], .modal-card input[type="email"] { margin-bottom: 10px; background: #f7f7f7; }
.modal-card .btn-secondary { grid-column: auto; grid-row: auto; margin-top: 0; }
.modal-card .error { margin: 12px 0 0; }

.purchase-options { display: grid; gap: 10px; }
.purchase-option { position: relative; width: 100%; padding: 17px 18px; display: grid; gap: 8px; background: #fffdf8; color: var(--studio-ink); border: 1px solid #d8cec2; border-radius: 17px; text-align: left; cursor: pointer; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.purchase-option:hover { transform: translateY(-2px); border-color: var(--studio-blue); box-shadow: 0 9px 20px rgba(48,72,200,.1); }
.purchase-option.is-featured { padding-top: 27px; border: 2px solid var(--studio-blue); background: #f1f3ff; }
.purchase-option:disabled { opacity: .6; cursor: wait; transform: none; }
.purchase-option-top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.purchase-option-top strong { font: 600 16px/1.2 var(--studio-sans); }
.purchase-option-top b { color: var(--studio-blue); font: 500 24px/1 var(--studio-serif); }
.purchase-option > span:last-child { max-width: 36ch; color: var(--studio-muted); font-size: 10px; line-height: 1.45; }
.purchase-badge { position: absolute; top: 7px; right: 11px; color: var(--studio-blue); font-size: 7px; font-weight: 800; letter-spacing: .1em; }
.wallpaper-manager { margin-top: 18px; padding: 16px; border: 1px solid var(--studio-line); border-radius: 16px; background: rgba(255,255,255,.46); }
.wallpaper-manager-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.wallpaper-manager-heading span { display: block; color: var(--studio-muted); font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.wallpaper-manager-heading h3 { margin: 3px 0 0; font-family: var(--studio-sans); font-size: 15px; }
.wallpaper-manager-heading .btn-secondary { min-height: 36px; padding: 0 13px; font-size: 10px; }
.wallpaper-slot-list { display: grid; gap: 8px; margin-top: 13px; }
.wallpaper-slot { min-height: 46px; padding: 8px 12px; border: 1px solid var(--studio-line); border-radius: 12px; background: var(--studio-paper); color: var(--studio-ink); display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; cursor: pointer; }
.wallpaper-slot strong { display: block; font-size: 11px; }
.wallpaper-slot span { color: var(--studio-muted); font-size: 9px; }
.wallpaper-slot.is-current { border-color: var(--studio-blue); box-shadow: inset 0 0 0 1px var(--studio-blue); }
.wallpaper-manager > p { margin: 10px 0 0; color: var(--studio-muted); font-size: 9px; line-height: 1.5; }
.restore-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.restore-row input[type="email"] { min-width: 0; margin: 0; }
.restore-row .btn-secondary { width: auto; min-height: 48px; padding-inline: 16px; white-space: nowrap; }
.restore-message { margin: 11px 0 0; color: var(--studio-muted); font-size: 9px; line-height: 1.45; }

.shortcut-card { width: min(490px, 100%); }
.shortcut-url-box { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin: 0 0 19px; }
.shortcut-card .modal-kicker { font-size: 11px; }
.shortcut-card .modal-sub { font-size: 15px; line-height: 1.55; }
.shortcut-url-box input[type="text"] { min-width: 0; margin: 0; font-size: 13px; text-overflow: ellipsis; }
.shortcut-copy { grid-column: auto; grid-row: auto; width: auto; min-height: 56px; padding-inline: 19px; border-radius: 999px; font-size: 14px; }
.shortcut-qr { display: block; width: 164px; height: 164px; margin: 0 auto 20px; padding: 8px; background: #fff; border: 1px solid #e7e7e7; border-radius: 18px; box-shadow: var(--studio-shadow); }
.shortcut-steps { margin: 0; padding: 0; list-style: none; counter-reset: shortcut; color: var(--studio-muted); font-size: 14px; line-height: 1.55; }
.shortcut-steps li { position: relative; min-height: 36px; padding: 10px 0 10px 42px; border-bottom: 1px solid #eee; counter-increment: shortcut; }
.shortcut-steps li::before { content: counter(shortcut); position: absolute; left: 0; top: 8px; width: 27px; height: 27px; display: grid; place-items: center; background: #eee; border: 0; border-radius: 50%; color: #666; font-size: 11px; font-weight: 600; }
.shortcut-steps strong { color: #444; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 1080px) {
  .workspace { grid-template-columns: 43% 57%; }
  .action-dock { width: 57%; }
  .stage .phone-shell { width: min(320px, 31vw, calc((100vh - 168px) / 2.17)); }
  .design-option img { height: 96px; }
}

@media (min-width: 1100px) {
  .color-controls-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 26px; }
}

@media (max-width: 880px) {
  body { overflow: auto; }
  .site-header { top: 14px; }
  .workspace { height: auto; display: flex; flex-direction: column; }
  .stage { order: 0; flex: none; width: 100%; height: 620px; border-bottom: 1px solid #ececec; }
  .stage .phone-shell { width: min(236px, 56vw); max-width: 64%; transform: none; }
  .panel { order: 1; width: 100%; height: auto; padding: 0 clamp(22px, 6vw, 48px) 150px; overflow: visible; }
  .panel-intro { padding-top: 54px; }
  .action-dock { width: 100%; padding-inline: clamp(22px, 6vw, 48px); }
}

@media (max-width: 600px) {
  .site-header { width: calc(100vw - 24px); height: 54px; padding: 7px 7px 7px 14px; gap: 10px; }
  .site-tagline { display: none; }
  .brand-mark { width: 28px; height: 28px; }
  .wordmark { display: inline-block; font-size: 11px; }
  .license-pill { height: 38px; padding-inline: 15px; font-size: 8px; }
  .stage { height: 555px; }
  .stage .phone-shell { width: min(204px, 58vw); transform: none; }
  .panel-intro { padding-top: 45px; }
  .panel .panel-intro h1 { font-size: 33px; }
  .editor-section { padding-block: 28px 31px; }
  .panel > section.editor-section + section.editor-section { padding-top: 28px; }
  .section-heading h2 { font-size: 26px; }
  .field-row { grid-template-columns: 1fr; gap: 12px; }
  .date-arrow { display: none; }
  .stock-carousel { grid-template-columns: 32px minmax(0, 1fr) 32px; gap: 8px; }
  .stock-nav { width: 32px; height: 32px; }
  .stock-carousel-meta { margin-inline: 40px; }
  .design-strip { grid-template-columns: repeat(2, 1fr); }
  .action-dock { padding-top: 12px; padding-bottom: 14px; }
  .stats { display: none; }
  .btn-primary, .btn-secondary { min-height: 50px; padding-inline: 13px; font-size: 9px; }
  .shortcut-copy { font-size: 13px; }
  .modal-card { padding: 34px 23px 26px; border-radius: 22px; }
  .modal-card h2 { font-size: 31px; }
  .modal-burst { display: none; }
}

/* ── ProgressBar.today identity ──
   The workflow stays preview-first, while the visual system is intentionally
   distinct: saturated studio colour, a flat masthead, asymmetric artwork,
   warmer surfaces, and bolder interaction states. */

:root {
  --studio-bg: #263db7;
  --studio-paper: #fbf6ed;
  --studio-ink: #20213d;
  --studio-muted: #777181;
  --studio-faint: #aaa2a1;
  --studio-soft: #f0e9de;
  --studio-soft-2: #e8dfd3;
  --studio-border: #ded5c8;
  --studio-coral: #ff765f;
  --studio-dark: #20213d;
  --studio-blue: #3048c8;
  --studio-sky: #9fd9df;
  --studio-butter: #f6d36d;
}

body { background: var(--studio-paper); color: var(--studio-ink); }

.site-header {
  top: 0;
  left: 0;
  width: 100%;
  height: 72px;
  padding: 0 28px;
  transform: none;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  border: 0;
  border-bottom: 1px solid rgba(32, 33, 61, .14);
  border-radius: 0;
  background: rgba(251, 246, 237, .94);
  box-shadow: none;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.site-brand { gap: 11px; }
.site-brand::after { content: 'DAILY PROGRESS'; padding-left: 12px; border-left: 1px solid #c9c0b5; color: #918b8a; font-size: 7px; font-weight: 700; letter-spacing: .13em; }
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: var(--studio-blue);
  color: #fff;
  box-shadow: 4px 4px 0 var(--studio-butter);
  transform: none;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}
.brand-mark::after { display: none; }
.site-brand:hover .brand-mark { transform: translateY(-1px); }
.wordmark {
  color: var(--studio-ink);
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.04em;
}
.site-tagline { color: #7e7882; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.license-pill { justify-self: end; height: 42px; padding: 0 19px; background: var(--studio-coral); color: var(--studio-ink); font-size: 9px; font-weight: 800; letter-spacing: .07em; }
.license-pill:hover { background: #ff886f; box-shadow: 0 8px 18px rgba(99, 48, 41, .18); }
.license-pill.is-paid { background: var(--studio-butter); color: var(--studio-ink); }

.workspace {
  height: calc(100vh - 72px);
  margin-top: 72px;
  grid-template-columns: minmax(390px, 44%) minmax(560px, 56%);
  background: var(--studio-paper);
}

.stage {
  height: calc(100vh - 72px);
  background-color: var(--studio-blue);
  background-image:
    linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 38px 38px;
  border-right: 1px solid rgba(32,33,61,.18);
}

.preview-canvas::before {
  content: '';
  display: block;
  position: absolute;
  z-index: 0;
  width: min(500px, 72%);
  height: min(640px, 74%);
  left: -10%;
  top: 14%;
  border-radius: 48% 52% 38% 62% / 56% 35% 65% 44%;
  background: #f7b6a2;
  transform: rotate(-8deg);
}

.preview-canvas::after {
  content: '';
  display: block;
  position: absolute;
  z-index: 1;
  width: 88px;
  height: 88px;
  right: 9%;
  bottom: 10%;
  border-radius: 22px;
  background: var(--studio-sky);
  transform: rotate(12deg);
  box-shadow: 14px 14px 0 var(--studio-butter);
}

.stage .phone-shell { transform: translate(8%, 0); }
.stage .phone-shell::before { content: 'LIVE / PREVIEW'; position: absolute; z-index: 8; left: -116px; top: 18%; padding: 7px 10px; border-radius: 999px; background: var(--studio-butter); color: var(--studio-ink); font-size: 7px; font-weight: 800; letter-spacing: .12em; transform: rotate(-90deg); }
.stage .phone-shell::after { content: 'PROGRESSBAR · TODAY'; position: absolute; z-index: 8; right: -116px; top: 23%; color: rgba(255,255,255,.72); font-size: 7px; font-weight: 700; letter-spacing: .15em; transform: rotate(90deg); }
.stage .phone { box-shadow: 0 28px 68px rgba(10, 18, 75, .34), 0 0 0 11px #eae1d4; }

/* iOS chrome is preview-only. It is intentionally absent from render.html so
   downloaded wallpapers remain clean for the real lock screen to overlay. */
.ios-lock-ui { position: absolute; inset: 0; z-index: 4; color: #fff; pointer-events: none; text-shadow: 0 1px 8px rgba(0,0,0,.24); }
.ios-lock-clock { position: absolute; top: 10.8%; left: 0; width: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; }
.ios-lock-date { font: 500 3.15cqw/1.2 'Inter', sans-serif; letter-spacing: -.05cqw; }
.ios-lock-time { display: block; margin-top: .6cqw; font: 600 19cqw/.92 'Inter', sans-serif; letter-spacing: -1.25cqw; font-variant-numeric: tabular-nums; }
.ios-quick-actions { position: absolute; left: 6.8%; right: 6.8%; bottom: 3.85%; display: flex; align-items: center; justify-content: space-between; }
.ios-quick-action { width: 13cqw; height: 13cqw; display: grid; place-items: center; background: rgba(15,17,18,.52); border: 1px solid rgba(255,255,255,.14); border-radius: 50%; box-shadow: 0 2px 9px rgba(0,0,0,.2); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.flashlight-glyph { position: relative; width: 4.7cqw; height: 6.25cqw; display: block; }
.flashlight-glyph::before { content: ''; position: absolute; top: 0; left: .5cqw; width: 3.7cqw; height: 2cqw; background: #fff; border-radius: .62cqw .62cqw .28cqw .28cqw; }
.flashlight-glyph::after { content: ''; position: absolute; left: 1.16cqw; bottom: 0; width: 2.4cqw; height: 4.7cqw; background: #fff; border-radius: .4cqw .4cqw .82cqw .82cqw; clip-path: polygon(14% 0, 86% 0, 100% 24%, 78% 100%, 22% 100%, 0 24%); }
.camera-glyph { position: relative; width: 5.9cqw; height: 4.5cqw; display: block; border: .68cqw solid #fff; border-radius: 1.08cqw; }
.camera-glyph::before { content: ''; position: absolute; left: 50%; top: 50%; width: 1.8cqw; height: 1.8cqw; border: .52cqw solid #fff; border-radius: 50%; transform: translate(-50%, -50%); }
.camera-glyph::after { content: ''; position: absolute; top: -1.48cqw; left: 1.32cqw; width: 1.9cqw; height: 1cqw; background: #fff; border-radius: .5cqw .5cqw 0 0; }
.phone.frame-home .ios-lock-clock { top: 8.5%; }
.phone.frame-home .ios-lock-time { font-size: 18cqw; }
.phone.frame-home .ios-quick-actions { bottom: 3.15%; }

.panel {
  height: calc(100vh - 72px);
  padding-inline: clamp(30px, 4.2vw, 58px);
  background: var(--studio-paper);
  scrollbar-color: #cfc4b8 transparent;
}
.panel::-webkit-scrollbar-thumb { background: #cfc4b8; }
.panel-intro { padding-top: 48px; padding-bottom: 30px; }
.panel .panel-intro h1 { color: var(--studio-ink); font-size: 38px; }
.panel-intro > p:not(.eyebrow) { color: var(--studio-muted); }
.local-save { color: #8c8690; }
.local-save span { color: var(--studio-coral); }

.editor-section { border-top-color: #ded5c8; }
.section-heading h2 { color: var(--studio-ink); }
.section-heading p { color: #948d90; }
.panel .field label,
.panel .field > label,
.label-row label,
.field-label { color: #6f6874; }
.field-note, .control-help { color: #a29a9a; }

.panel input[type="date"],
.panel input[type="text"],
.panel select,
.modal-card input[type="text"], .modal-card input[type="email"] { background-color: #fffdf8; border-color: #ded5c8; color: var(--studio-ink); }
.panel input[type="date"]:hover,
.panel input[type="text"]:hover,
.panel select:hover { background-color: #fff; }
.panel input[type="date"]:focus,
.panel input[type="text"]:focus,
.panel select:focus { border-color: var(--studio-blue); box-shadow: 0 0 0 3px rgba(48,72,200,.1); }

.stock-grid:empty { background: repeating-linear-gradient(135deg, #f2ebdf 0 11px, #ebe2d5 11px 22px); }
.stock-thumb { background: #eee5d9; }
.stock-thumb:hover { border-color: #bbb0a7; }
.stock-thumb.active { border-color: var(--studio-blue); box-shadow: 0 0 0 3px rgba(48,72,200,.1); }

.dropzone { background: #fff0e7; border-color: #f0c9bb; }
.dropzone:hover, .dropzone.drag, .dropzone:focus-visible { background: #ffe6db; border-color: var(--studio-coral); }
.upload-symbol { background: var(--studio-coral); color: var(--studio-ink); }
.pro-stamp { background: var(--studio-butter); color: var(--studio-ink); }

.design-option { background: #eee6da; }
.design-option:hover { border-color: #bcb2a9; }
.design-option.active { background: #eef0ff; border-color: var(--studio-blue); box-shadow: 0 0 0 3px rgba(48,72,200,.1); }
.design-option span { color: var(--studio-ink); }
.label-val { background: #e7e9ff; color: var(--studio-blue); }
input[type="range"] {
  --range-progress: 50%;
  width: 100%;
  height: 30px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border: 1px solid #cfc4b8;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--studio-blue) 0 var(--range-progress), #e8dfd3 var(--range-progress) 100%);
}
input[type="range"]::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  margin-top: -7px;
  appearance: none;
  -webkit-appearance: none;
  border: 3px solid var(--studio-paper);
  border-radius: 50%;
  background: var(--studio-coral);
  box-shadow: 0 0 0 2px var(--studio-blue), 0 5px 12px rgba(48,72,200,.22);
}
input[type="range"]::-moz-range-track {
  height: 8px;
  border: 1px solid #cfc4b8;
  border-radius: 999px;
  background: #e8dfd3;
}
input[type="range"]::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--studio-blue);
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 3px solid var(--studio-paper);
  border-radius: 50%;
  background: var(--studio-coral);
  box-shadow: 0 0 0 2px var(--studio-blue), 0 5px 12px rgba(48,72,200,.22);
}
input[type="range"]:focus-visible { outline-offset: 1px !important; }
.range-scale {
  display: flex;
  justify-content: space-between;
  margin-top: -2px;
  color: #9b9395;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.custom-swatch { background: #fffdf8; }

.action-dock {
  width: 56%;
  padding-inline: clamp(30px, 4.2vw, 58px);
  background: rgba(251,246,237,.96);
  border-top-color: #dcd2c5;
  box-shadow: 0 -16px 36px rgba(65,51,46,.07);
}
.stat { border-right-color: #ded5c8; }
.stat-num { color: var(--studio-ink); }
.stat-label { color: #9b9395; }
.btn-primary { background: var(--studio-blue); border-color: var(--studio-blue); box-shadow: 0 8px 18px rgba(48,72,200,.22); }
.btn-primary:hover { background: #243db5; }
.btn-secondary { background: #fffdf8; color: var(--studio-ink); border-color: #cfc4b8; }
.btn-secondary:hover { background: #fff; border-color: var(--studio-blue); }

.modal-card { background: var(--studio-paper); border-color: #ded5c8; }
.modal-close { background: #eee6da; color: var(--studio-ink); }
.modal-burst { background: var(--studio-butter); color: var(--studio-ink); }
.modal-divider span { background: var(--studio-paper); }
.modal-card input[type="text"], .modal-card input[type="email"] { background: #fffdf8; }

@media (max-width: 1080px) {
  .workspace { grid-template-columns: 42% 58%; }
  .action-dock { width: 58%; }
  .stage .phone-shell { transform: translate(5%, 0); }
  .stage .phone-shell::before, .stage .phone-shell::after { display: none; }
}

@media (max-width: 880px) {
  .site-header { height: 66px; padding-inline: 20px; }
  .workspace { margin-top: 66px; }
  .stage { height: 600px; background-size: 32px 32px; }
  .panel { height: auto; background: var(--studio-paper); }
  .panel-intro { padding-top: 44px; }
  .action-dock { width: 100%; }
  .stage .phone-shell { transform: none; }
}

@media (max-width: 600px) {
  .site-header { top: 0; width: 100%; height: 62px; padding-inline: 14px; border-radius: 0; }
  .site-brand::after { display: none; }
  .wordmark { font-size: 17px; letter-spacing: -.04em; }
  .workspace { margin-top: 62px; }
  .site-tagline { display: none; }
  .stage { height: 530px; }
  .preview-canvas::before { width: 86%; height: 78%; left: -22%; top: 14%; }
  .preview-canvas::after { width: 60px; height: 60px; right: 3%; bottom: 9%; border-radius: 17px; box-shadow: 9px 9px 0 var(--studio-butter); }
  .stage .phone-shell { transform: none; }
  .panel-intro { padding-top: 38px; }
}

/* Mobile-only preview workflow. Tablet and desktop keep the split layout. */
.mobile-preview-btn,
.mobile-preview-close { display: none; }

@media (max-width: 600px) {
  .stage { display: none; }

  .mobile-preview-btn {
    position: fixed;
    z-index: 140;
    right: 16px;
    bottom: calc(138px + env(safe-area-inset-bottom, 0px));
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 0 18px;
    color: #fff;
    background: var(--studio-blue);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 12px 28px rgba(32, 33, 61, .28);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .01em;
    cursor: pointer;
  }

  .mobile-preview-btn:active { transform: translateY(1px); }
  .mobile-preview-dot {
    width: 10px;
    height: 10px;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: inset 0 0 0 2px var(--studio-blue);
    background: var(--studio-butter);
  }

  body.mobile-preview-open { overflow: hidden; }
  body.mobile-preview-open .mobile-preview-btn { display: none; }
  body.mobile-preview-open .stage {
    position: fixed;
    z-index: 300;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    place-items: center;
    border: 0;
  }

  body.mobile-preview-open .preview-toolbar,
  body.mobile-preview-open .preview-footer { display: none !important; }
  body.mobile-preview-open .preview-canvas {
    grid-area: 1 / 1;
    width: 100%;
    height: 100%;
    padding: max(74px, env(safe-area-inset-top, 0px)) 18px max(28px, env(safe-area-inset-bottom, 0px));
  }
  body.mobile-preview-open .stage .phone-shell {
    width: min(260px, 68vw, calc((100dvh - 116px) / 2.17));
    max-width: none;
    transform: none;
  }

  .mobile-preview-close {
    position: fixed;
    z-index: 320;
    top: max(16px, env(safe-area-inset-top, 0px));
    right: 16px;
    min-height: 42px;
    display: none;
    align-items: center;
    gap: 7px;
    padding: 0 15px;
    color: var(--studio-ink);
    background: rgba(251, 246, 237, .94);
    border: 1px solid rgba(32, 33, 61, .18);
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(10, 18, 75, .18);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  body.mobile-preview-open .mobile-preview-close { display: inline-flex; }
  .mobile-preview-close span { font-size: 20px; font-weight: 400; line-height: 1; }
}

@media (max-width: 600px) {
  .editor-section[aria-labelledby="export-title"],
  .editor-section[aria-labelledby="export-title"] .field,
  .editor-section[aria-labelledby="export-title"] .select-control {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .panel #model {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 56px;
    min-height: 56px;
    padding: 0 48px 0 16px;
    overflow: hidden;
    font-size: 16px;
    line-height: 1.2;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .panel #model option,
  .panel #model optgroup {
    color: var(--studio-ink);
    background: var(--studio-paper);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 18px !important;
    font-weight: 500;
    line-height: 1.5;
  }

  .editor-section[aria-labelledby="export-title"] .select-control::after { right: 18px; }
}

@media (min-width: 881px) {
  .panel { padding-bottom: 118px; }
}

@media (max-width: 600px) {
  .panel-intro > p:not(.eyebrow) { font-size: 14px; line-height: 1.65; }
  .local-save { font-size: 10px; }
  .section-heading p { font-size: 12px; line-height: 1.55; }

  .panel .field label,
  .panel .field > label,
  .label-row label,
  .field-label { font-size: 11px; line-height: 1.3; }

  .field-note { font-size: 9px; }
  .control-help { font-size: 11px; line-height: 1.5; }

  .panel input[type="date"],
  .panel input[type="text"],
  .panel select { font-size: 16px; }

  .stock-carousel-meta { font-size: 9px; }
  .upload-copy strong { font-size: 13px; }
  .upload-copy small { font-size: 11px; }
  .pro-stamp { font-size: 9px; }
  .design-option span { font-size: 14px; }
  .label-val { font-size: 11px; }
  .range-scale { font-size: 9px; }

  .btn-primary,
  .btn-secondary {
    min-height: 56px;
    padding-inline: 16px;
    font-size: 13px;
    font-weight: 700;
  }

  .license-pill { font-size: 10px; }
  .mobile-preview-btn { font-size: 13px; }
  .modal-kicker { font-size: 10px; }
  .modal-sub { font-size: 13px; }
}

/* Desktop editor shell: scroll controls between the header and action dock. */
.panel-scroll { display: contents; }

@media (min-width: 881px) {
  .panel {
    height: calc(100vh - 72px);
    height: calc(100dvh - 72px);
    padding: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
  }

  .panel-scroll {
    min-width: 0;
    min-height: 0;
    display: block;
    padding: 0 clamp(30px, 4.2vw, 58px) 38px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-padding-block: 28px;
    scrollbar-width: thin;
    scrollbar-color: #cfc4b8 transparent;
  }

  .panel-scroll::-webkit-scrollbar { width: 6px; }
  .panel-scroll::-webkit-scrollbar-track { background: transparent; }
  .panel-scroll::-webkit-scrollbar-thumb { background: #cfc4b8; border-radius: 99px; }

  .action-dock {
    position: relative;
    z-index: 4;
    right: auto;
    bottom: auto;
    width: 100%;
    padding: 16px clamp(30px, 4.2vw, 58px) 20px;
    grid-row: 2;
    background: rgba(251, 246, 237, .98);
    box-shadow: 0 -12px 28px rgba(65, 51, 46, .06);
  }
}

@media (min-width: 601px) {
  .panel .panel-intro h1 { font-size: 42px; }
  .panel-intro > p:not(.eyebrow) { font-size: 14px; line-height: 1.65; }
  .local-save { font-size: 10px; }

  .section-heading h2 { font-size: 30px; }
  .section-heading p { font-size: 12px; line-height: 1.55; }

  .panel .field label,
  .panel .field > label,
  .label-row label,
  .field-label { font-size: 11px; line-height: 1.3; }

  .field-note { font-size: 9px; }
  .control-help { font-size: 11px; line-height: 1.5; }

  .panel input[type="date"],
  .panel input[type="text"],
  .panel select { font-size: 15px; }

  .panel select option,
  .panel select optgroup { font-size: 15px; }

  .stock-carousel-meta { font-size: 9px; }
  .upload-copy strong { font-size: 13px; }
  .upload-copy small { font-size: 10px; }
  .pro-stamp { font-size: 9px; }
  .design-option span { font-size: 14px; }
  .label-val { font-size: 11px; }
  .range-scale { font-size: 9px; }
  .error { font-size: 11px; }

  .action-dock > .btn-primary,
  .action-dock > .btn-secondary {
    min-height: 58px;
    font-size: 13px;
    font-weight: 700;
  }
}

@media (max-width: 600px) {
  .design-option { flex-basis: clamp(112px, calc((100% - 10px) / 2), 148px); }
}
