:root {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  color: #182232;
  background: #f5f7fa;
  --surface: #fff;
  --surface-soft: #eef2f7;
  --text: #182232;
  --muted: #586779;
  --line: #dce2ea;
  --control-line: #8995a5;
  --accent: #195fce;
  --accent-soft: #eaf1ff;
  --button: #195fce;
  --button-hover: #124da9;
  --danger: #a92631;
  --focus: #195fce;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { touch-action: manipulation; }
button {
  min-height: 44px;
  border: 1px solid var(--button);
  border-radius: 8px;
  padding: .7rem 1rem;
  background: var(--button);
  color: #fff;
  font-weight: 650;
  line-height: 1.3;
  cursor: pointer;
  transition: background-color .15s, box-shadow .15s;
}
button:hover:not(:disabled) { background: var(--button-hover); }
button:disabled { cursor: not-allowed; opacity: .48; }
button.secondary, button.danger { background: transparent; border-color: var(--control-line); }
button.secondary { color: var(--accent); }
button.danger { color: var(--danger); }
button.secondary:hover:not(:disabled), button.danger:hover:not(:disabled) { background: var(--surface-soft); }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.skip-link { position: absolute; top: -100px; left: 1rem; z-index: 10; padding: 1rem; background: var(--surface); }
.skip-link:focus { top: 1rem; }

.site-header {
  max-width: 1280px;
  margin: auto;
  padding: 1.15rem 2rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.wordmark { color: var(--text); font-size: 1.25rem; font-weight: 800; letter-spacing: -.035em; text-decoration: none; }
.wordmark span { margin-left: .75rem; padding-left: .75rem; border-left: 1px solid var(--line); color: var(--muted); font-weight: 450; }
.environment { margin: 0; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
main { max-width: 1240px; min-height: 70vh; margin: 0 auto; padding: 2.25rem 2rem 3.5rem; }
.intro { max-width: 760px; margin-bottom: 1.5rem; }
.eyebrow { margin: 0; color: var(--accent); font-size: .72rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
h1 { margin: .5rem 0 .65rem; font-size: clamp(1.75rem, 3vw, 2.25rem); line-height: 1.15; letter-spacing: -.04em; }
h2 { margin: 0 0 .75rem; font-size: 1.2rem; line-height: 1.3; letter-spacing: -.02em; }
h3 { margin: 0 0 .65rem; font-size: .95rem; line-height: 1.4; }
p { line-height: 1.55; }
p, .help { color: var(--muted); }
.intro > p:last-child { margin: 0; font-size: .95rem; }
.help { margin: .4rem 0 0; font-size: .84rem; line-height: 1.5; }
.notice { margin: 1rem 0 1.5rem; padding: .8rem 1rem; border-left: 3px solid var(--accent); background: var(--accent-soft); font-size: .88rem; line-height: 1.55; }
.notice p:last-child { margin-bottom: 0; }
#prototype { margin-top: 0; }
#feedback:not(:empty) { margin: 1rem 0 1.5rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font-size: .92rem; line-height: 1.5; }
#feedback[data-kind="error"] { color: var(--danger); }
#reconciliation h2 { font-size: 1rem; }
#reconciliation p { margin: .6rem 0 1rem; }

.workspace-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 2rem; align-items: start; animation: reveal .2s ease-out; }
.sidebar { min-width: 0; padding-right: 1.25rem; border-right: 1px solid var(--line); }
.sidebar h2 { font-size: 1rem; }
.sidebar .contact { margin: .5rem 0; font-size: .8rem; overflow-wrap: anywhere; }
.account-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0; }
.account-actions button { padding: .5rem .65rem; font-size: .78rem; }
.submission-list { max-height: 440px; margin: 1rem 0; padding: 0; overflow-y: auto; list-style: none; scrollbar-gutter: stable; }
.submission-list li { min-width: 0; }
.submission-list button { display: block; width: 100%; margin: .25rem 0; padding: .75rem; border-color: transparent; background: transparent; color: var(--text); text-align: left; font-size: .88rem; font-weight: 650; overflow-wrap: anywhere; }
.submission-list button:hover:not(:disabled) { background: var(--surface-soft); }
.submission-list button[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); }
.submission-list small { display: block; margin-top: .3rem; color: var(--muted); font-size: .76rem; font-weight: 450; line-height: 1.45; }
.submission-date { display: block; margin-top: .3rem; color: var(--muted); font-size: .72rem; font-weight: 450; line-height: 1.45; }
.workspace-content, .entry-workspace { min-width: 0; }
.entry-workspace { max-width: 1040px; }
.entry-workspace > button { margin-top: 1rem; }
.section { min-width: 0; border-top: 1px solid var(--line); padding: 1.5rem 0; }
.section:first-child { border-top: 0; padding-top: 0; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; margin-bottom: .6rem; }
.section-heading h2 { margin: 0; overflow-wrap: anywhere; }
.status { color: var(--muted); font-size: .78rem; line-height: 1.5; }
.submission-status { margin: 1rem 0 1.5rem; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }
.submission-status > :first-child { margin-top: 0; }
.submission-status > :last-child { margin-bottom: 0; }
.submission-status p { font-size: .9rem; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 1.25rem; }
.field { display: flex; min-width: 0; flex-direction: column; gap: .45rem; margin-bottom: 1.2rem; }
.form-grid .field { margin-bottom: 0; }
.wide { grid-column: 1 / -1; }
label, legend { color: var(--text); font-size: .88rem; font-weight: 650; line-height: 1.45; }
input:not([type="checkbox"]):not([type="color"]), textarea, select { width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--control-line); border-radius: 7px; padding: .75rem .8rem; background: var(--surface); color: var(--text); }
input[type="color"] { width: 52px; min-width: 52px; min-height: 44px; padding: 3px; border: 1px solid var(--control-line); border-radius: 7px; background: var(--surface); }
input[type="file"] { max-width: 100%; font-size: .84rem; }
input[type="file"]::file-selector-button { min-height: 34px; margin-right: .65rem; border: 0; border-radius: 5px; padding: .4rem .6rem; background: var(--surface-soft); color: var(--text); cursor: pointer; font: inherit; }
textarea { min-height: 88px; resize: vertical; }
.color-field { display: flex; min-width: 0; gap: .6rem; }
.color-field input[type="text"] { max-width: 190px; }
.character-count { display: block; color: var(--muted); font-size: .75rem; }
.check { display: flex; align-items: flex-start; gap: .7rem; margin: 1rem 0; color: var(--text); font-size: .9rem; font-weight: 450; line-height: 1.5; }
.check input { min-width: 20px; min-height: 20px; margin: .15rem 0 0; accent-color: var(--button); }
fieldset { margin: 1.5rem 0 0; border: 0; padding: 0; }
legend { padding: 0; margin-bottom: .75rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 1.25rem; }
.auth { max-width: 600px; }
.auth form { margin-top: 1rem; }
.auth .section { border: 0; }
.auth .privacy-information > p { margin-top: 0; }
.auth .auth-back { margin-top: 1.5rem; }
.email-destination { margin: 0 0 .5rem; color: var(--text); overflow-wrap: anywhere; }
.empty { padding: 1rem 0; color: var(--muted); }
.selected-file { margin: .65rem 0; font-size: .8rem; overflow-wrap: anywhere; }

.artwork-stage { min-width: 0; }
.artwork-stage.has-previews { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(0, 1.2fr); column-gap: 1.5rem; align-items: start; }
.artwork-stage.has-previews > * { grid-column: 1; }
.artwork-stage.has-previews > .layout-previews { grid-column: 2; grid-row: 1 / span 7; align-self: stretch; align-content: center; margin: 0; }
.artwork-stage.has-previews > .layout-previews + .help { grid-column: 2; }
.layout-previews { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; max-width: 560px; margin: 1.25rem 0; }
.layout-preview { min-width: 0; margin: 0; }
.layout-preview { display: grid; justify-items: center; align-content: start; gap: 1rem; padding: 1.25rem .75rem; border-radius: 10px; background: var(--surface-soft); text-align: center; }
.layout-icon { position: relative; display: grid; width: 128px; height: 128px; max-width: 100%; place-items: center; overflow: hidden; background: repeating-conic-gradient(#dce2ea 0 25%, #fff 0 50%) 50% / 16px 16px; }
.layout-icon[data-background-chosen="true"] { background-image: none; }
.layout-icon.is-ios { border-radius: 22.4%; }
.layout-icon.is-android { border-radius: 50%; }
.layout-icon img { width: 100%; height: 100%; object-fit: contain; opacity: 0; transform-origin: center; }
.layout-previews[data-state="ready"] .layout-icon img { opacity: 1; }
.preview-caption { grid-column: 1 / -1; margin: 0; font-size: .78rem; }
.layout-icon span { color: var(--text); font-size: .8rem; }
.layout-preview figcaption { color: var(--text); font-size: .82rem; font-weight: 650; }

.submission-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .85fr); gap: 1.25rem; align-items: start; margin: 1rem 0; }
.submission-summary dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; margin: 0; }
.submission-summary dl > div { min-width: 0; }
.submission-summary dt { margin-bottom: .35rem; color: var(--muted); font-size: .76rem; line-height: 1.4; }
.submission-summary dd { margin: 0; color: var(--text); font-size: .9rem; line-height: 1.5; overflow-wrap: anywhere; }
.background-swatch { display: inline-block; width: 22px; height: 22px; margin-right: .5rem; border: 1px solid var(--line); border-radius: 5px; vertical-align: middle; }
.app-label-preview { min-width: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.app-label-preview > :first-child { margin-top: 0; }
.app-label-preview > :last-child { margin-bottom: 0; }
.app-label-preview strong { display: block; color: var(--text); font-size: 1.15rem; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.app-label-preview .app-credit { display: block; margin-top: .35rem; color: var(--muted); font-size: .88rem; line-height: 1.5; overflow-wrap: anywhere; }
.app-label-preview .help { margin-top: .75rem; font-size: .78rem; }
.email-waiting { max-width: 900px; }
.email-waiting > h2 { margin-bottom: .6rem; }
.email-waiting .submission-summary { margin-top: 1.5rem; }
.artwork-received { margin: 1rem 0; }
.submission-confirmation { margin-top: 1.25rem; border-top: 1px solid var(--line); padding-top: .25rem; }
.submission-confirmation > h3 { margin: 1.25rem 0 .75rem; }
.submission-confirmation > .help { margin-top: -.3rem; }
.agreement { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 1rem; background: var(--surface); color: var(--text); font-size: .86rem; line-height: 1.6; white-space: pre-wrap; }
.submission-confirmation + .help { margin: 1rem 0; }
.withdrawal-actions { margin-top: 1rem; }
.withdrawal-actions > h3 { margin: 1rem 0 .5rem; }
.withdrawal-actions > .help { max-width: 600px; margin-bottom: .8rem; }
.original-source { color: var(--muted); font-size: .85rem; }
.original-source img { display: block; width: 128px; height: 128px; max-width: 100%; margin-top: .75rem; object-fit: contain; }
.original-source summary, .submission-details summary { padding: .5rem 0; cursor: pointer; }
.submission-details summary { color: var(--accent); }
.submission-details[open] summary { margin-bottom: 1rem; }

footer { display: flex; justify-content: space-between; gap: 1rem; max-width: 1240px; margin: auto; border-top: 1px solid var(--line); padding: 1.25rem 2rem; font-size: .76rem; }
footer p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 800px) {
  .site-header { padding: 1rem 1.25rem; }
  main { padding: 1.75rem 1.25rem 2.5rem; }
  .workspace-grid { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 1.25rem; }
  .sidebar .contact { margin: .4rem 0; }
  .account-actions { margin: .75rem 0; }
  .submission-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; max-height: 220px; overflow-y: auto; }
  .submission-list button { height: calc(100% - .5rem); }
  .artwork-stage.has-previews { display: block; }
  .artwork-stage.has-previews > .layout-previews { margin: 1rem 0; }
  .submission-summary { grid-template-columns: minmax(0, 1fr); }
  footer { padding: 1.25rem; }
  .environment { max-width: 100px; text-align: right; }
  .wordmark span { margin-left: .5rem; padding-left: .5rem; font-size: 1rem; }
}

@media (max-width: 520px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .wide { grid-column: auto; }
  .layout-preview { padding: 1rem .5rem; }
  .layout-icon { width: 108px; height: 108px; }
  .submission-summary dl { column-gap: .8rem; }
  .submission-list { scrollbar-gutter: auto; }
  .actions > button { max-width: 100%; }
  footer { display: block; }
}

@media (prefers-color-scheme: dark) {
  :root {
    color: #e3e9f2;
    background: #101720;
    --surface: #17212d;
    --surface-soft: #1d2a3b;
    --text: #e3e9f2;
    --muted: #a3b1c4;
    --line: #2c3a4d;
    --control-line: #60738c;
    --accent: #91baff;
    --accent-soft: #182d4a;
    --button: #2566c9;
    --button-hover: #3478e4;
    --danger: #ffadb5;
    --focus: #91baff;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.submission-history { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
.submission-history summary { cursor: pointer; margin-bottom: 12px; color: var(--muted); }
