:root {
  --bg: oklch(1 0 0);
  --surface: oklch(0.968 0.006 253);
  --surface-strong: oklch(0.925 0.012 253);
  --ink: oklch(0.205 0.045 254);
  --muted: oklch(0.47 0.025 253);
  --line: oklch(0.86 0.016 253);
  --navy: oklch(0.235 0.073 252);
  --navy-hover: oklch(0.19 0.066 252);
  --primary: oklch(0.57 0.165 75);
  --primary-hover: oklch(0.52 0.17 70);
  --success: oklch(0.46 0.11 173);
  --success-bg: oklch(0.95 0.035 173);
  --error: oklch(0.47 0.17 29);
  --error-bg: oklch(0.955 0.035 29);
  --focus: oklch(0.64 0.15 240);
  --radius: 10px;
  --shadow-small: 0 4px 8px oklch(0.2 0.03 253 / 0.10);
  --z-sticky: 20;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); line-height: 1.5; }
body:not(.login-page) { display: flex; flex-direction: column; }
a { color: inherit; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 10px 14px; background: var(--bg); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.app-header { min-height: 72px; padding: 10px max(24px, calc((100vw - 1120px)/2)); display: flex; align-items: center; gap: 36px; background: var(--navy); color: var(--bg); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: max-content; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: var(--bg); font-weight: 900; }
.brand strong, .brand small { display: block; line-height: 1.1; }
.brand strong { letter-spacing: -0.02em; }
.brand small { margin-top: 3px; color: oklch(0.82 0.018 252); font-size: .7rem; }
.app-header nav { display: flex; gap: 4px; flex: 1; }
.app-header nav a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 13px; border-radius: 8px; color: oklch(0.88 0.015 252); text-decoration: none; font-size: .9rem; font-weight: 650; }
.app-header nav a:hover, .app-header nav a[aria-current="page"] { background: oklch(0.32 0.072 252); color: var(--bg); }
.account { display: flex; align-items: center; gap: 12px; font-size: .86rem; }
.account form { margin: 0; }
.workspace { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 58px 0 88px; flex: 1; }
.site-footer { padding: 22px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: .78rem; }
.page-heading { max-width: 720px; margin-bottom: 38px; }
.page-heading h1 { margin: 3px 0 8px; font-size: 2.35rem; line-height: 1.08; letter-spacing: -0.035em; text-wrap: balance; }
.page-heading p { max-width: 68ch; margin: 0; color: var(--muted); font-size: 1.03rem; text-wrap: pretty; }
.section-label, .mission-label { margin: 0 0 4px !important; color: var(--primary-hover) !important; font-size: .75rem !important; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.split-heading { max-width: none; display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; }
.button { min-height: 44px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 9px 15px; border: 0; border-radius: 9px; text-decoration: none; font-weight: 750; cursor: pointer; transition: background-color 180ms ease, color 180ms ease, transform 180ms ease; }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.button-primary { background: var(--primary); color: var(--bg); }
.button-primary:hover:not(:disabled) { background: var(--primary-hover); }
.button-secondary { border: 1px solid var(--navy); background: var(--bg); color: var(--navy); }
.button-secondary:hover { background: var(--navy); color: var(--bg); }
.button-quiet { background: transparent; color: inherit; }
.button-quiet:hover { background: oklch(1 0 0 / .1); }
.button-wide { width: 100%; }
.button-small { min-height: 36px; padding: 6px 10px; font-size: .82rem; }
.notice { margin: 0 0 26px; padding: 13px 15px; border-radius: var(--radius); font-weight: 650; }
.notice-success { background: var(--success-bg); color: oklch(0.34 0.09 173); }
.notice-error { background: var(--error-bg); color: var(--error); }
.window-state { min-width: 235px; display: flex; align-items: center; gap: 11px; padding: 14px 16px; background: var(--surface); border-radius: var(--radius); }
.window-state > span { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--muted); }
.window-state.state-open > span { background: var(--success); }
.window-state strong, .window-state small { display: block; }
.window-state small { color: var(--muted); }
.workflow { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.workflow > li { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 18px; padding: 32px 0; border-bottom: 1px solid var(--line); }
.step-number { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: var(--bg); font-weight: 850; }
.step-body h2 { margin: 2px 0 5px; font-size: 1.24rem; letter-spacing: -.02em; }
.step-body > p { max-width: 70ch; margin: 0 0 17px; color: var(--muted); }
.command { max-width: 570px; min-height: 44px; margin: 0 0 17px; display: flex; align-items: center; justify-content: space-between; gap: 16px; overflow: hidden; border-radius: 8px; background: var(--navy); color: oklch(0.92 0.01 252); }
.command code { padding: 10px 13px; overflow-x: auto; font-size: .84rem; }
.copy-button { align-self: stretch; padding: 0 14px; border: 0; border-left: 1px solid oklch(1 0 0 / .18); background: transparent; color: inherit; cursor: pointer; font-weight: 700; }
.copy-button:hover { background: oklch(1 0 0 / .1); }
.upload-form { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
label { display: grid; gap: 6px; color: var(--ink); font-size: .86rem; font-weight: 720; }
input, select { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid oklch(0.7 0.02 253); border-radius: 8px; background: var(--bg); color: var(--ink); }
input:hover, select:hover { border-color: var(--muted); }
input:disabled { background: var(--surface); }
.file-picker { min-width: min(100%, 360px); }
.file-picker input { padding: 7px; }
input[type="file"]::file-selector-button { margin-right: 10px; padding: 5px 10px; border: 0; border-radius: 5px; background: var(--surface-strong); color: var(--ink); font-weight: 700; }
.requirements { max-width: 720px; margin-top: 18px; color: var(--muted); font-size: .88rem; }
.requirements summary { color: var(--ink); cursor: pointer; font-weight: 700; }
.requirements li + li { margin-top: 6px; }
.submission-status { margin-top: 36px; padding: 26px 28px; display: flex; align-items: center; justify-content: space-between; gap: 25px; background: var(--surface); border-radius: 12px; }
.submission-status h2 { margin: 0 0 3px; }
.submission-status p { margin: 0; color: var(--muted); }
.trust-note { display: flex; gap: 10px; max-width: 290px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.trust-note > span { color: var(--success); font-size: 1.3rem; }
.trust-note p { font-size: .82rem; }
.submission-list { border-top: 1px solid var(--line); }
.list-header, .submission-row { display: grid; grid-template-columns: minmax(180px, 1.3fr) .7fr 1fr auto; gap: 22px; align-items: center; }
.list-header { min-height: 42px; color: var(--muted); font-size: .73rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.submission-row { min-height: 78px; border-top: 1px solid var(--line); }
.submission-row p { margin: 0; color: var(--muted); font-size: .88rem; }
.team-identity { display: flex; align-items: center; gap: 12px; }
.team-monogram { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-strong); color: var(--navy); font-weight: 850; text-transform: uppercase; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; font-size: .76rem; font-weight: 800; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-ready { background: var(--success-bg); color: oklch(0.35 0.09 173); }
.status-waiting { background: var(--surface-strong); color: var(--muted); }
.muted { color: var(--muted); font-size: .86rem; }
.empty-state { padding: 56px 20px; text-align: center; background: var(--surface); }
.empty-state h2 { margin: 0; }
.empty-state p { color: var(--muted); }
.login-page { min-height: 100vh; background: var(--navy); }
.login-page .site-footer { border-color: oklch(1 0 0 / .14); color: oklch(0.78 0.018 252); }
.login-shell { min-height: calc(100vh - 67px); display: grid; grid-template-columns: minmax(320px, 1fr) minmax(420px, 1fr); }
.login-intro { min-height: 640px; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(34px, 6vw, 82px); color: var(--bg); background: var(--navy); }
.login-intro h1 { max-width: 650px; margin: 10px 0 14px; font-size: clamp(3rem, 6vw, 5.5rem); line-height: .96; letter-spacing: -.04em; text-wrap: balance; }
.login-intro > div > p:last-child { max-width: 52ch; color: oklch(0.83 0.018 252); font-size: 1.08rem; }
.brand-light { color: var(--bg); }
.prototype-note { max-width: 55ch; color: oklch(0.7 0.02 252); font-size: .75rem; }
.login-form-wrap { display: grid; place-items: center; padding: 40px; background: var(--bg); }
.login-form { width: min(100%, 430px); display: grid; gap: 19px; }
.login-form h2 { margin: 2px 0 5px; font-size: 1.7rem; letter-spacing: -.03em; }
.login-form > div > p:last-child { margin: 0; color: var(--muted); }
.preview-workspace { flex: 1; background: var(--surface); }
.preview-toolbar { min-height: 112px; padding: 20px max(24px, calc((100vw - 1120px)/2)); display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--bg); border-bottom: 1px solid var(--line); }
.preview-toolbar h1 { margin: 5px 0 0; font-size: 1.45rem; letter-spacing: -.025em; }
.preview-toolbar p { margin: 2px 0 0; color: var(--muted); font-size: .82rem; }
.back-link { color: var(--muted); font-size: .82rem; font-weight: 700; text-decoration: none; }
.back-link:hover { color: var(--ink); }
.viewport-switch { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.viewport-button { min-height: 38px; padding: 6px 13px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 750; }
.viewport-button.is-active { background: var(--bg); color: var(--ink); box-shadow: var(--shadow-small); }
.boundary-banner { padding: 9px max(24px, calc((100vw - 1120px)/2)); display: flex; justify-content: space-between; gap: 20px; background: oklch(0.91 0.05 76); color: oklch(0.3 0.06 66); font-size: .78rem; }
.preview-stage { min-height: 760px; padding: 28px; display: flex; justify-content: center; overflow: auto; }
.preview-stage iframe { width: min(1440px, 100%); min-height: 700px; border: 0; background: var(--bg); box-shadow: 0 4px 8px oklch(0.2 0.03 253 / .14); transition: width 220ms ease; }
.preview-stage.is-mobile iframe { width: 390px; }
.admin-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.admin-panel { padding: 24px; border: 1px solid var(--line); border-radius: 12px; }
.panel-heading { min-height: 38px; display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.panel-heading h2 { margin: 0; font-size: 1.18rem; }
.stack-form { margin-top: 20px; display: grid; gap: 15px; }
.stack-form .button { justify-self: start; }
.check-row { grid-template-columns: auto 1fr; align-items: start; }
.check-row input { width: 20px; min-height: 20px; margin-top: 2px; accent-color: var(--navy); }
.check-row strong, .check-row small { display: block; }
.check-row small, .field-hint { color: var(--muted); font-size: .75rem; font-weight: 500; }
.accounts { margin-top: 42px; border-top: 1px solid var(--line); }
.accounts-heading { padding: 28px 0 15px; }
.accounts-heading h2, .accounts-heading p { margin: 0; }
.accounts-heading p { color: var(--muted); font-size: .85rem; }
.account-row { min-height: 70px; display: grid; grid-template-columns: minmax(180px, 1.3fr) .5fr .65fr 1fr auto; gap: 18px; align-items: center; border-top: 1px solid var(--line); }
.account-row strong, .account-row small { display: block; }
.account-row small { color: var(--muted); }
.role-label { color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: capitalize; }
.account-actions { position: relative; }
.account-actions summary { cursor: pointer; color: var(--navy); font-weight: 750; }
.account-action-menu { position: absolute; right: 0; top: 30px; z-index: var(--z-sticky); width: 285px; padding: 15px; display: grid; gap: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); box-shadow: var(--shadow-small); }
.account-action-menu form { display: grid; gap: 9px; }
@media (max-width: 820px) {
  .app-header { flex-wrap: wrap; gap: 8px 18px; padding: 12px 20px; }
  .app-header nav { order: 3; flex: 0 0 100%; width: 100%; overflow-x: auto; }
  .app-header nav a { white-space: nowrap; }
  .account { margin-left: auto; }
  .account > span { display: none; }
  .workspace { width: min(100% - 28px, 1120px); padding-top: 38px; }
  .split-heading { align-items: flex-start; flex-direction: column; }
  .login-shell { grid-template-columns: 1fr; }
  .login-intro { min-height: 400px; padding: 34px 26px; }
  .login-intro h1 { font-size: 3.25rem; }
  .login-form-wrap { padding: 52px 24px; }
  .admin-layout { grid-template-columns: 1fr; }
  .list-header { display: none; }
  .submission-row { grid-template-columns: 1fr auto; gap: 9px 18px; padding: 18px 0; }
  .submission-row > :nth-child(3) { grid-column: 1; }
  .submission-row > :nth-child(4) { grid-column: 2; grid-row: 2; }
  .account-row { grid-template-columns: 1fr auto auto; gap: 8px 12px; padding: 16px 0; }
  .account-row > .muted { grid-column: 1 / 3; }
  .account-actions { grid-column: 3; grid-row: 2; }
}
@media (max-width: 540px) {
  .page-heading h1 { font-size: 2rem; }
  .workflow > li { grid-template-columns: 42px minmax(0, 1fr); gap: 9px; }
  .step-number { width: 34px; height: 34px; }
  .submission-status, .preview-toolbar, .boundary-banner { align-items: stretch; flex-direction: column; }
  .submission-status .button { width: 100%; }
  .preview-toolbar { padding: 18px 16px; }
  .preview-stage { padding: 12px; }
  .preview-stage.is-mobile iframe { width: 100%; }
  .boundary-banner { padding: 10px 16px; gap: 3px; }
  .account-action-menu { position: fixed; inset: auto 12px 12px; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
