@font-face {
  font-family: "Jost";
  src: url("assets/Jost-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #171b31;
  --muted: #747a91;
  --soft: #a0a5b5;
  --line: rgba(40, 53, 92, 0.11);
  --blue: #5572ee;
  --violet: #8962df;
  --mint: #168c78;
  --paper: #ffffff;
  --card: rgba(255, 255, 255, 0.86);
  font-family: "Jost", "Avenir Next", Avenir, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.page-shell {
  position: relative;
  width: min(1160px, calc(100% - 72px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 30px 0 22px;
}

.topbar {
  display: flex;
  height: 48px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(39, 53, 89, 0.12);
  padding-bottom: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand img { width: 43px; height: 24px; object-fit: contain; }
.brand-name { font-size: 16px; font-weight: 650; letter-spacing: 0.19em; }
.product-lockup { display: flex; align-items: center; gap: 10px; }
.product-name { color: #515a7a; font-size: 11px; font-weight: 650; letter-spacing: 0.18em; }

.intro { max-width: 650px; margin: 47px 0 24px; }
.micro-label { color: #75809e; font-size: 10px; font-weight: 650; letter-spacing: 0.18em; }
h1 { margin: 0 0 8px; font-size: clamp(36px, 4.7vw, 52px); font-weight: 470; letter-spacing: -0.05em; line-height: 1.04; }

.control-bar {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 16px;
  border: 1px solid rgba(44, 60, 106, 0.11);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 7px 30px rgba(38, 53, 99, 0.035), inset 0 1px rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.control-bar-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.control-status { display: flex; min-width: 0; align-items: center; gap: 11px; }
.control-status > div { display: grid; gap: 2px; }
.status-dot { position: relative; width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: #b8bdcb; box-shadow: 0 0 0 4px rgba(155, 163, 187, 0.12); }
.status-dot[data-state="current"] { background: #1a9c84; box-shadow: 0 0 0 4px rgba(26, 156, 132, 0.12); }
.status-dot[data-state="acquiring"] { background: var(--blue); box-shadow: 0 0 0 4px rgba(85, 114, 238, 0.12); animation: breathe 1.2s ease-in-out infinite; }
.status-dot[data-state="error"] { background: #d46c63; box-shadow: 0 0 0 4px rgba(212, 108, 99, 0.11); }
.status-text { color: #303853; font-size: 13px; font-weight: 520; }
.mode-switch { display: inline-flex; gap: 3px; padding: 4px; border: 1px solid rgba(53, 66, 107, 0.09); border-radius: 12px; background: rgba(242, 244, 250, 0.8); }
.mode-button { display: inline-flex; min-height: 34px; align-items: center; justify-content: center; gap: 7px; padding: 0 11px; border: 0; border-radius: 8px; color: #858ba0; background: transparent; cursor: pointer; font-size: 12px; font-weight: 520; transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease; }
.mode-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.35; }
.mode-button.is-selected { color: #35416e; background: white; box-shadow: 0 1px 4px rgba(35, 48, 87, 0.12); }
.primary-button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 10px; padding: 0 17px; border: 0; border-radius: 11px; color: white; background: linear-gradient(110deg, #536fe6, #745edb 76%, #805fd5); box-shadow: 0 7px 16px rgba(93, 101, 214, 0.21), inset 0 1px rgba(255, 255, 255, 0.23); cursor: pointer; font-size: 13px; font-weight: 570; transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease; }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(93, 101, 214, 0.26), inset 0 1px rgba(255, 255, 255, 0.23); filter: saturate(1.06); }
.primary-button:active { transform: translateY(0); }
.primary-button:focus-visible, .mode-button:focus-visible, .copy-button:focus-visible, input:focus-visible { outline: 3px solid rgba(94, 119, 238, 0.32); outline-offset: 3px; }
.primary-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.55; }
.button-spinner { display: none; width: 15px; height: 15px; border: 2px solid rgba(255, 255, 255, 0.38); border-top-color: white; border-radius: 50%; animation: spin 700ms linear infinite; }
.is-loading .button-spinner { display: inline-block; }
.primary-button:disabled { cursor: wait; opacity: 0.86; }
.feedback { margin: -7px 0 14px; color: #a54d49; font-size: 12px; line-height: 1.45; }
.feedback.is-success { color: #397e71; }
.control-bar .feedback { margin: 0; }
.marker-hold-note { margin: 0; color: #80879d; font-size: 12px; line-height: 1.45; }

.workspace { display: flex; max-width: 580px; margin-inline: auto; flex-direction: column; gap: 18px; }
.details-column { display: flex; min-width: 0; flex-direction: column; gap: 16px; }
.glass-card { border: 1px solid rgba(49, 64, 108, 0.1); border-radius: 21px; background: var(--card); box-shadow: 0 17px 48px rgba(35, 49, 93, 0.065), inset 0 1px 0 rgba(255, 255, 255, 0.96); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.qr-card { position: relative; display: flex; min-height: 442px; flex-direction: column; overflow: hidden; padding: 24px 26px 18px; }
.card-topline { position: relative; z-index: 1; display: flex; min-height: 41px; align-items: flex-start; justify-content: space-between; }
h2 { margin: 4px 0 0; font-size: 17px; font-weight: 530; letter-spacing: -0.02em; }
.source-badge { padding: 5px 9px; border: 1px solid rgba(85, 114, 238, 0.16); border-radius: 999px; color: #586aaf; background: rgba(237, 241, 255, 0.8); font-size: 10px; font-weight: 580; }
.qr-stage { position: relative; z-index: 1; display: grid; min-height: 320px; flex: 1; place-items: center; padding: 17px 0 12px; }
.qr-placeholder { display: grid; min-height: 270px; align-content: center; justify-items: center; gap: 18px; color: #9298ad; font-size: 12px; }
.placeholder-mark { display: grid; width: 92px; height: 92px; place-items: center; border: 1px dashed rgba(99, 113, 164, 0.29); border-radius: 18px; background: rgba(249, 250, 255, 0.55); }
.placeholder-mark svg { width: 43px; height: 43px; fill: none; stroke: #9da9ca; stroke-linecap: round; stroke-linejoin: round; stroke-width: 3; }
.placeholder-mark circle { fill: #8999d7; stroke: none; }
.qr-canvas { display: block; width: min(100%, 500px); height: auto; image-rendering: auto; background: white; }
.qr-caption { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding-top: 11px; border-top: 1px solid rgba(42, 57, 99, 0.08); color: #8790a8; font-size: 10px; letter-spacing: 0.025em; }
.qr-caption-dot { width: 5px; height: 5px; border-radius: 50%; background: linear-gradient(145deg, var(--blue), var(--violet)); }

.data-card { padding: 24px 25px 20px; }
.data-heading { align-items: center; margin-bottom: 17px; }
.crosshair-icon { width: 22px; height: 22px; margin-right: 1px; fill: none; stroke: #8894bc; stroke-linecap: round; stroke-width: 1.3; }
.position-empty { display: flex; min-height: 298px; align-items: center; gap: 14px; padding: 20px 5px; color: #9298ad; }
.empty-index { color: #b9bfd0; font-size: 11px; font-weight: 570; letter-spacing: 0.08em; }
.position-empty p { max-width: 210px; margin: 0; font-size: 13px; line-height: 1.55; }
.coordinate-row { display: grid; grid-template-columns: minmax(72px, 1fr) auto 13px; align-items: baseline; gap: 5px; padding: 12px 0 11px; border-bottom: 1px solid rgba(43, 59, 102, 0.08); }
.coordinate-row:first-child { padding-top: 5px; }
.data-label { display: block; color: #8a90a5; font-size: 11px; font-weight: 470; }
.coordinate-value { color: #222b4a; font-size: clamp(18px, 2vw, 22px); font-weight: 520; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.unit { color: #838aa3; font-size: 12px; }
.data-divider { height: 1px; margin: 15px 0 13px; background: linear-gradient(90deg, rgba(85, 114, 238, 0.3), rgba(130, 102, 213, 0.1), transparent); }
.measurement-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 10px; }
.measurement-cell { min-width: 0; }
.measurement-value { display: block; margin-top: 3px; color: #37415f; font-size: 13px; font-weight: 570; font-variant-numeric: tabular-nums; }
.source-value { color: #596cba; }
.data-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 15px; padding-top: 11px; border-top: 1px solid rgba(43, 59, 102, 0.08); color: #9a9fb0; font-size: 10px; }
.data-foot time { color: #686f87; font-variant-numeric: tabular-nums; text-align: right; }
.copy-button { display: flex; width: 100%; min-height: 40px; align-items: center; justify-content: center; gap: 8px; border: 1px solid rgba(80, 98, 162, 0.17); border-radius: 10px; color: #56648f; background: rgba(249, 250, 255, 0.82); cursor: pointer; font-size: 12px; font-weight: 540; transition: background 140ms ease, border-color 140ms ease; }
.copy-button:hover:not(:disabled) { border-color: rgba(87, 112, 224, 0.36); background: #f4f6ff; }
.copy-button:disabled { color: #a8adbd; cursor: default; }
.copy-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.45; }
.accuracy-note { margin: 9px 0 0; color: #9a9fb0; font-size: 10px; line-height: 1.4; text-align: center; }

.manual-form { padding-top: 0; }
.form-intro { margin: 0 0 16px; color: #7e859c; font-size: 12px; line-height: 1.5; }
.field-label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 13px 0 6px; color: #5b6480; font-size: 11px; font-weight: 540; }
.field-label span { color: #a1a6b5; font-size: 10px; font-weight: 420; }
.input-wrap { display: flex; height: 42px; align-items: center; gap: 9px; padding: 0 11px; border: 1px solid rgba(54, 68, 111, 0.13); border-radius: 9px; background: rgba(249, 250, 253, 0.9); }
.input-wrap:focus-within { border-color: rgba(87, 112, 224, 0.45); box-shadow: 0 0 0 3px rgba(87, 112, 224, 0.08); }
.input-wrap input { width: 100%; min-width: 0; border: 0; outline: 0; color: #2a3454; background: transparent; font-size: 13px; font-variant-numeric: tabular-nums; }
.input-wrap input::placeholder { color: #b7bdcc; }
.input-wrap > span { color: #9298ab; font-size: 11px; }

.privacy-line { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 19px 0 18px; color: #8b91a5; }
.privacy-line svg { width: 15px; height: 15px; flex: 0 0 15px; fill: none; stroke: #8791b2; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.35; }
.privacy-line p { margin: 0; font-size: 11px; line-height: 1.5; text-align: center; }
.privacy-line strong { color: #66708d; font-weight: 570; }
.footer { display: flex; justify-content: space-between; padding-top: 12px; border-top: 1px solid rgba(39, 53, 89, 0.1); color: #a0a5b5; font-size: 9px; font-weight: 550; letter-spacing: 0.14em; }
.footer-separator { padding: 0 5px; color: #c3c7d3; }

@keyframes breathe { 50% { opacity: 0.5; transform: scale(0.84); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 1280px) {
  .intro { margin-top: 49px; }
  .workspace { gap: 20px; }
  .qr-card { min-height: 455px; }
  .qr-stage { min-height: 330px; }
}

@media (max-width: 760px) {
  .page-shell { width: min(calc(100% - 24px), 580px); padding-top: 21px; }
  .intro { margin: 34px 0 21px; }
  h1 { font-size: clamp(37px, 9.2vw, 45px); }
  .control-bar { gap: 12px; padding: 13px; border-radius: 15px; }
  .workspace { gap: 13px; }
  .details-column { gap: 13px; }
  .qr-card { min-height: 390px; padding: 18px 12px 15px; }
  .qr-stage { min-height: 284px; }
  .qr-placeholder { min-height: 240px; }
  .qr-canvas { width: min(100%, 500px); }
  .data-card { padding: 21px 20px 18px; }
  .position-empty { min-height: 120px; }
  .coordinate-value { font-size: clamp(20px, 5.7vw, 24px); }
  .privacy-line { align-items: flex-start; margin: 16px 4px; }
  .privacy-line p { text-align: left; }
}

@media (max-width: 380px) {
  .page-shell { width: calc(100% - 24px); }
  .brand-name { font-size: 14px; }
  .product-name { font-size: 10px; }
  .control-bar-top { align-items: flex-start; flex-direction: column; }
  .control-bar { gap: 10px; }
  .mode-button { gap: 5px; padding: 0 8px; }
  .qr-card { padding-inline: 12px; }
  .data-card { padding-inline: 16px; }
  .coordinate-row { grid-template-columns: minmax(58px, 0.8fr) auto 11px; gap: 3px; }
  .coordinate-value { font-size: 19px; }
  .data-label { font-size: 10px; }
}

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

/* AVP-035: one marker workflow for device and manual sources. */
.intro { max-width: none; text-align: center; }
.details-column { gap: 16px; }
.marker-source { display: flex; justify-content: center; margin: 0 0 14px; }
.marker-action { width: min(100%, 500px); margin: 0 auto 14px; }
.marker-action .primary-button { width: 100%; }
.qr-stage .manual-form { width: min(100%, 500px); margin: 0 auto; }
.qr-stage .form-intro { margin-top: 0; }
.control-bar-top { display: block; }
.position-empty { min-height: 90px; }
@media (max-width: 760px) {
  .marker-action, .qr-stage .manual-form { width: min(100%, 500px); }
}

/* AVP-035: high-resolution indigo line rendering, with no centre occlusion. */
.qr-output { position: relative; width: min(100%, 500px); }
.qr-output .qr-canvas { width: 100%; }
@media (max-width: 760px) {
  .qr-output { width: min(100%, 500px); }
}

.qr-card .card-topline { min-height: 22px; align-items: center; }
