:root {
  --ink: #081522;
  --muted: #617185;
  --line: #d9e2ea;
  --surface: #fff;
  --soft: #f3f7fa;
  --cyan: #19cdea;
  --violet: #7047ff;
  --green: #9fff00;
  --proof: #071321;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #edf3f7; color: var(--ink); font: 15px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 20; background: #fff; padding: 10px; }
.skip-link:focus { left: 10px; }
.brand-line { height: 4px; background: linear-gradient(90deg, #9fff00, #1dd9ef 46%, #7b50ff 75%, #ff00cb); }

.site-header { height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 26px; padding: 0 max(22px, calc((100vw - 1320px) / 2)); background: #fff; border-bottom: 1px solid var(--line); }
.brand img { display: block; width: min(250px, 30vw); height: auto; }
.site-header nav { display: flex; align-items: center; gap: 19px; }
.site-header a { color: var(--ink); font-weight: 800; text-decoration: none; }
.site-header .order-link { padding: 10px 15px; border-radius: 9px; background: var(--ink); color: #fff; box-shadow: 0 0 0 1px #111, 0 0 16px rgba(112, 71, 255, .24); }

main { width: min(1180px, calc(100% - 32px)); margin: auto; padding: 20px 0 40px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 275px; gap: 18px; align-items: end; margin-bottom: 16px; padding: 22px 25px; border-radius: 15px; background: linear-gradient(115deg, #06131f, #0c2034); color: #fff; box-shadow: 0 14px 34px rgba(8, 21, 34, .13); }
.eyebrow { margin: 0 0 6px; color: #35dcf5; font-size: .72rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.hero h1 { max-width: 760px; margin: 0; font-size: clamp(2.1rem, 3.8vw, 3.3rem); line-height: 1; letter-spacing: -.04em; }
.hero p:not(.eyebrow) { max-width: 820px; margin: 13px 0 0; color: #d5e2eb; font-size: .98rem; }
.hero-note { display: grid; gap: 2px; padding: 14px; border: 1px solid #39536a; border-radius: 11px; background: #0d2436; }
.hero-note strong { color: var(--green); }
.hero-note span { color: #c7d5df; font-size: .84rem; }
.hero-note a { margin-top: 5px; color: #fff; font-size: .78rem; font-weight: 850; }

.workspace { display: grid; grid-template-columns: minmax(310px, 365px) minmax(540px, 1fr); gap: 16px; align-items: start; }
.control-column { display: grid; gap: 14px; }
.panel, .proof-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: 0 10px 26px rgba(34, 52, 68, .07); }
.panel-heading, .proof-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 48px; padding: 11px 16px; border-bottom: 1px solid var(--line); background: #f8fafc; color: #53677b; font-size: .75rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.panel-heading a { color: #4125a4; text-transform: none; letter-spacing: 0; }
.panel-body { padding: 15px; }
label { display: block; margin-bottom: 6px; font-weight: 800; }
select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cbd7e2; border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-weight: 700; }
.size-details { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.size-details span { padding: 5px 8px; border-radius: 999px; background: #edf3f7; color: #41566a; font-size: .74rem; font-weight: 800; }
.size-recognition { margin-top: 10px; padding: 10px 11px; border: 1px solid #d7e1e9; border-radius: 8px; background: #f5f8fa; color: #53677b; font-size: .79rem; font-weight: 650; }
.size-recognition.success { border-color: #b9d8c2; background: #eff9f2; color: #285b38; }
.size-recognition.warning { border-color: #ead0a8; background: #fff8ec; color: #82500d; }

.drop-zone { width: 100%; min-height: 138px; display: grid; place-items: center; align-content: center; gap: 4px; padding: 18px; border: 2px dashed #98aabd; border-radius: 11px; background: #fbfcfd; color: var(--ink); font: inherit; cursor: pointer; }
.drop-zone:hover, .drop-zone.drag { border-color: var(--violet); background: #f8f5ff; }
.drop-zone strong { font-size: 1.05rem; }
.drop-zone span:last-child { color: var(--muted); font-size: .78rem; }
.upload-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 3px; border-radius: 50%; background: var(--ink); color: var(--green); font-size: 1.4rem; }
.file-card { width: 100%; max-width: 100%; min-width: 0; overflow: hidden; margin-top: 12px; padding: 12px 13px; border: 1px solid #d7e1e9; border-radius: 10px; background: #edf3f7; }
.file-card strong, .file-card span { display: block; min-width: 0; }
.file-card .file-card-label { margin: 0 0 5px; color: #53677b; font-size: .65rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.file-card .file-name { width: 100%; max-width: 100%; color: var(--ink); font-size: .87rem; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.file-card .file-meta { margin-top: 6px; color: var(--muted); font-size: .77rem; line-height: 1.35; }
.artwork-notice { margin: 9px 0 0; color: var(--muted); font-size: .77rem; }
.option-list { display: grid; gap: 10px; }
.check-row { display: flex; align-items: flex-start; gap: 9px; margin: 0; padding: 10px; border: 1px solid #dbe4eb; border-radius: 9px; cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--violet); }
.check-row:has(input:checked) { border-color: #5dcef0; background: linear-gradient(120deg, #f5fdff, #f8f5ff); box-shadow: 0 0 0 2px rgba(30, 210, 245, .12), 0 0 18px rgba(112, 71, 255, .10); }
.check-row span { display: grid; }
.check-row small { color: var(--muted); font-weight: 500; }
.next-actions { display: flex; gap: 8px; }
.button { display: inline-flex; min-height: 44px; flex: 1; align-items: center; justify-content: center; padding: 10px 12px; border: 1px solid #cbd7e2; border-radius: 9px; font-size: .9rem; font-weight: 900; text-align: center; text-decoration: none; }
.button.primary { border-color: var(--ink); background: var(--ink); color: #fff; }
.button.primary.disabled { border-color: #9da9b3; background: #9da9b3; cursor: not-allowed; }
.button.secondary { background: #fff; color: var(--ink); }

.proof-panel { position: sticky; top: 12px; }
.proof-heading { min-height: 58px; }
.proof-heading > div:first-child { display: grid; }
.proof-heading small { margin-top: 1px; color: #74869a; font-size: .7rem; letter-spacing: 0; text-transform: none; }
.proof-tabs { display: flex; gap: 6px; }
.proof-tabs button, .proof-tools button { min-height: 42px; padding: 8px 12px; border: 1px solid #34485b; border-radius: 8px; background: #132334; color: #dce7ef; font: inherit; font-weight: 800; cursor: pointer; }
.proof-tabs button { border-color: #cbd7e2; background: #fff; color: #42566a; }
.proof-tabs button.active { border-color: #8360ff; background: #eee9ff; color: #3d219e; }
.wrapped-pane, .flat-pane { background: var(--proof); }
#tubeCanvas { display: block; width: 100%; height: auto; aspect-ratio: 11 / 9.4; touch-action: none; }
.flat-pane { min-height: 420px; display: grid; place-items: center; padding: 20px; }
.flat-pane[hidden] { display: none; }
.flat-pane canvas { display: block; max-width: 100%; max-height: 650px; background: #fff; box-shadow: 0 16px 36px rgba(0, 0, 0, .32); }
.proof-tools { display: flex; justify-content: center; gap: 7px; flex-wrap: wrap; padding: 10px; background: #122131; }
.proof-tools button:disabled { opacity: .45; cursor: not-allowed; }
.proof-tools button[aria-pressed="true"] { border-color: var(--green); color: var(--green); }
.proof-tools .illumination-toggle { min-width: 142px; }
.proof-tools .illumination-toggle[aria-pressed="true"] { border-color: #63e9ff; color: #fff; background: #123148; box-shadow: inset 0 0 18px rgba(99, 233, 255, .2), 0 0 12px rgba(99, 233, 255, .22); }
.proof-tools .illumination-toggle[aria-pressed="false"] { border-color: #526173; color: #aeb9c5; background: #111b28; box-shadow: none; }
.proof-note { margin: 0; padding: 13px 16px; color: #718398; font-size: .78rem; }
.proof-note strong { color: #40566b; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.site-footer { background: #06131f; color: #d9e5ed; }
.footer-grid, .saw-band, .footer-legal { width: min(1320px, calc(100% - 32px)); margin: auto; }
.footer-grid { display: grid; grid-template-columns: 1.35fr repeat(5, 1fr); gap: 22px; padding: 38px 0 32px; }
.footer-grid > div { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.footer-grid h2 { margin: 0 0 7px; color: #fff; font-size: .83rem; letter-spacing: .08em; text-transform: uppercase; }
.footer-grid a { color: #d9e5ed; font-size: .86rem; text-decoration: none; }
.footer-grid a:hover { color: #fff; text-decoration: underline; }
.footer-brand img { width: min(230px, 100%); height: auto; }
.footer-brand p { max-width: 300px; margin: 7px 0 0; color: #9fb0bd; font-size: .84rem; }
.saw-band { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid #2b3b49; border-bottom: 1px solid #2b3b49; }
.saw-band a { color: #fff; font-weight: 700; }
.saw-band img { display: block; width: 145px; max-height: 34px; }
.footer-legal { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #9fb0bd; font-size: .78rem; }
.footer-legal a { color: #d9e5ed; }

@media (max-width: 1050px) {
  .workspace { grid-template-columns: 1fr; }
  .proof-panel { position: static; }
  .control-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .options-panel, .next-actions { grid-column: 1 / -1; }
  .hero { grid-template-columns: 1fr; }
  .hero-note { max-width: 600px; }
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  body { font-size: 15px; }
  .site-header { height: auto; min-height: 82px; padding: 14px 16px; }
  .site-header nav a:not(.order-link) { display: none; }
  .brand img { width: 220px; }
  main { padding-top: 16px; }
  .hero { padding: 22px 19px; }
  .hero h1 { font-size: 2.45rem; }
  .control-column { grid-template-columns: 1fr; }
  .options-panel, .next-actions { grid-column: auto; }
  .proof-heading { align-items: flex-start; flex-direction: column; }
  .proof-tabs { width: 100%; }
  .proof-tabs button { flex: 1; }
  .proof-tools button { min-height: 44px; flex: 1 1 auto; }
  .workspace { display: flex; flex-direction: column; }
  .control-column, .proof-column { width: 100%; }
  #tubeCanvas { aspect-ratio: 11 / 10; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; padding: 30px 0; }
  .saw-band, .footer-legal { padding: 16px 0; align-items: flex-start; flex-direction: column; }
}
