:root {
  color-scheme: light;
  --ink: #2f282b;
  --blue: #654150;
  --blue-dark: #4d303c;
  --ice: #eee8e9;
  --line: rgba(47,40,43,.16);
  --muted: #74686d;
  --paper: #f9f8f5;
  --white: #fffdfc;
  --success: #87606f;
  --brand-font: "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
.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; }
html { background: var(--paper); font-family: "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif; color: var(--ink); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 85% 0%, #e4e0db 0, transparent 32rem), var(--paper); }
button, input { font: inherit; }
button { cursor: pointer; }
.topbar { height: 92px; padding: 0 5vw; display: flex; align-items: center; justify-content: space-between; background: rgba(249,248,245,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; color: inherit; text-decoration: none; }
.official-logo { display: block; width: min(285px, 40vw); height: 40px; overflow: hidden; position: relative; }
.official-logo img { position: absolute; width: 100%; height: auto; left: 50%; top: 49%; transform: translate(-50%, -50%); }
.language { border: 1px solid var(--line); color: var(--ink); background: white; border-radius: 999px; padding: 10px 15px; font-size: .82rem; font-weight: 750; }
main { width: min(1080px, calc(100% - 32px)); margin: clamp(32px, 7vh, 72px) auto 24px; display: grid; grid-template-columns: minmax(0, .88fr) minmax(360px, 1.12fr); gap: 24px; align-items: start; }
.scan-experience { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, .88fr) minmax(360px, 1.12fr); overflow: hidden; background: var(--white); border: 1px solid rgba(9,27,49,.08); border-radius: 28px; box-shadow: 0 18px 50px rgba(25,54,92,.09); }
.scan-panel, .visual-panel { background: var(--white); }
.scan-panel { padding: clamp(28px, 5vw, 48px); }
h1 { margin: 0 0 28px; font-family: var(--brand-font); font-size: clamp(2.1rem, 5vw, 3.65rem); line-height: .98; letter-spacing: -.055em; max-width: 590px; }
.scan-button { width: 100%; min-height: 84px; border: 0; background: var(--blue); color: white; border-radius: 18px; display: flex; align-items: center; justify-content: center; gap: 18px; box-shadow: 0 12px 28px rgba(107,64,84,.24); transition: transform .18s, background .18s; }
.scan-button:hover { background: var(--blue-dark); transform: translateY(-2px); }
.scan-button span:last-child { display: grid; text-align: left; gap: 3px; }
.scan-button strong { font-family: var(--brand-font); letter-spacing: .025em; font-size: 1rem; }
.scan-button small { opacity: .7; font-size: .72rem; letter-spacing: .08em; }
.scan-icon { width: 31px; height: 31px; border: 3px solid white; border-radius: 5px; position: relative; }
.scan-icon:after { content: ""; position: absolute; left: -7px; right: -7px; top: 12px; height: 3px; background: white; box-shadow: 0 0 0 3px rgba(107,64,84,.8); }
.divider { margin: 25px 0 18px; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .68rem; letter-spacing: .12em; font-weight: 750; }
.divider:before, .divider:after { content: ""; height: 1px; flex: 1; background: var(--line); }
.lookup-form > label { display: block; font-size: .76rem; font-weight: 750; margin-bottom: 8px; color: var(--muted); }
.input-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.input-row input { width: 100%; min-width: 0; border: 1px solid var(--line); background: #fafbfd; border-radius: 13px; padding: 15px 16px; font-size: 1rem; color: var(--ink); outline: none; }
.input-row input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(107,64,84,.12); }
.input-row button { border: 0; border-radius: 13px; padding: 0 18px; color: white; background: var(--ink); font-size: .75rem; letter-spacing: .06em; font-weight: 800; }
.visual-panel { margin: 24px 24px 24px 0; overflow: hidden; position: relative; min-height: 382px; border-radius: 20px; }
.visual-panel img { width: 100%; height: 100%; min-height: 382px; display: block; object-fit: cover; object-position: 48% 48%; transform: scale(1.1); }
.barcode-callout { position: absolute; left: 18px; bottom: 18px; z-index: 1; display: grid; gap: 2px; padding: 11px 15px; border-radius: 12px; background: rgba(255,255,255,.94); color: var(--ink); box-shadow: 0 8px 24px rgba(52,38,45,.2); backdrop-filter: blur(8px); }
.barcode-callout span { color: var(--blue); font-size: .62rem; font-weight: 850; letter-spacing: .12em; }
.barcode-callout strong { font-size: 1.05rem; letter-spacing: .03em; }
.result-panel { grid-column: 1 / -1; background: var(--white); border: 1px solid rgba(9,27,49,.08); box-shadow: 0 18px 50px rgba(25,54,92,.09); border-radius: 28px; padding: clamp(25px, 4vw, 40px); }
.result-heading { display: flex; gap: 20px; justify-content: space-between; align-items: start; }
.result-kicker { font-size: .68rem; color: var(--success); font-weight: 850; letter-spacing: .1em; }
.result-heading h2 { margin: 9px 0 4px; font-family: var(--brand-font); font-size: clamp(1.75rem, 3vw, 2.6rem); line-height: 1.05; letter-spacing: -.04em; }
.result-heading p { margin: 0; color: var(--muted); font-size: 1.05rem; }
.barcode-badge { text-align: left; padding: 10px 13px 10px 10px; background: var(--ice); color: var(--blue-dark); border-radius: 11px; display: flex; align-items: center; gap: 9px; flex: none; }
.qr-symbol { width: 30px; height: 30px; display: grid; place-items: center; flex: none; }
.qr-symbol svg { width: 100%; height: 100%; fill: currentColor; }
.barcode-copy { display: grid; }
.barcode-copy > span { font-size: .55rem; letter-spacing: .1em; font-weight: 800; }
.barcode-copy strong { margin-top: 3px; font-size: .9rem; }
.location-card { margin: 30px 0 18px; padding: 20px; border-radius: 17px; background: var(--ink); color: white; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.location-card div { display: grid; gap: 7px; }
.location-card span, .detail-grid dt { font-size: .62rem; letter-spacing: .08em; font-weight: 750; color: #d4c1c9; }
.location-card strong { font-size: 1.05rem; }
.detail-grid { margin: 0; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 17px; overflow: hidden; }
.detail-grid div { padding: 18px; min-width: 0; }
.detail-grid div:nth-child(odd) { border-right: 1px solid var(--line); }
.detail-grid div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
.detail-grid dt { color: var(--muted); margin-bottom: 8px; }
.detail-grid dd { margin: 0; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.inch-value { display: block; margin-top: 5px; color: var(--muted); font-size: .76rem; font-weight: 650; line-height: 1.3; }
.drawing-button { margin-top: 18px; width: 100%; min-height: 62px; border: 0; border-radius: 15px; background: var(--blue); color: white; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 18px; text-align: center; text-decoration: none; box-shadow: 0 10px 24px rgba(107,64,84,.2); transition: background .18s, transform .18s, box-shadow .18s; }
.drawing-button:hover { background: var(--blue-dark); transform: translateY(-1px); box-shadow: 0 12px 28px rgba(107,64,84,.26); }
.drawing-button > span:first-child { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 9px; background: rgba(255,255,255,.16); color: white; font-weight: 900; }
.drawing-button > span:last-child { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.drawing-button strong { display: block; color: white; font-size: .86rem; line-height: 1.25; letter-spacing: .055em; }
.new-scan { margin-top: 12px; width: 100%; padding: 15px; border: 0; border-radius: 13px; color: white; background: var(--blue); font-family: var(--brand-font); font-weight: 800; letter-spacing: .02em; }
footer { width: min(1080px, calc(100% - 32px)); margin: 20px auto 32px; color: var(--muted); display: flex; justify-content: flex-start; font-size: .75rem; }
footer > span:first-child { color: var(--ink); font-size: .95rem; }
.footer-logo { width: 220px; height: 28px; }
dialog { width: min(560px, calc(100% - 24px)); border: 0; padding: 0; border-radius: 24px; color: var(--ink); box-shadow: 0 30px 90px rgba(0,0,0,.35); overflow: hidden; }
dialog::backdrop { background: rgba(47,40,43,.78); backdrop-filter: blur(7px); }
.scanner-head { padding: 22px; display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.scanner-head > div { display: grid; gap: 4px; }
.scanner-head strong { font-size: 1.15rem; }
.scanner-head small { color: var(--muted); line-height: 1.35; }
.scanner-head button { border: 0; background: var(--paper); width: 36px; height: 36px; border-radius: 50%; font-size: 1.5rem; line-height: 1; }
#reader { min-height: 330px; background: var(--ink); }
#reader video { object-fit: cover; }
.scanner-status { margin: 0; padding: 15px 20px 20px; color: var(--muted); font-size: .8rem; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); padding: 13px 18px; border-radius: 12px; background: var(--ink); color: white; box-shadow: 0 12px 35px rgba(0,0,0,.22); z-index: 10; font-size: .88rem; text-align: center; }
@media (max-width: 780px) {
  .topbar { height: 68px; padding: 0 18px; }
  .official-logo { width: 245px; height: 34px; }
  main { width: min(100% - 20px, 600px); margin: 18px auto; display: flex; flex-direction: column; }
  .scan-experience { width: 100%; display: flex; flex-direction: column; border-radius: 22px; }
  .scan-panel, .result-panel, .visual-panel { width: 100%; }
  .result-panel { border-radius: 22px; }
  .scan-panel { padding: 27px 21px; }
  h1 { font-size: 2.55rem; }
  .visual-panel { width: auto; min-height: 0; margin: 0 18px 20px; border-radius: 18px; }
  .visual-panel img { height: 280px; min-height: 0; transform: scale(1.13); }
  .barcode-callout { left: 14px; bottom: 14px; }
  .result-heading { display: flex; }
  .location-card { grid-template-columns: 1fr 1fr; }
  footer { width: calc(100% - 32px); }
  .footer-logo { width: 190px; height: 24px; }
}
@media (max-width: 390px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid div:nth-child(odd) { border-right: 0; }
  .detail-grid div:not(:last-child) { border-bottom: 1px solid var(--line); }
  .location-card { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
