:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: #142b2c;
  background: #eff6f3;
  --muted: #4f6462;
  --accent: #065b50;
  --accent-hover: #08483f;
  --border: #d8e5e0;
  --focus: #187f71;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
button, select { font: inherit; }
a { color: inherit; }
button, summary, select { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
h1[tabindex='-1']:focus { outline: none; }
h1, h2, p, ol { margin: 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.topbar { background: #fff; border-bottom: 1px solid var(--border); }
.topbar-inner {
  width: min(100% - 48px, 1120px);
  height: 76px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.wordmark { display: inline-flex; gap: 12px; align-items: center; text-decoration: none; font-weight: 800; }
.wordmark small { display: inline-block; margin-left: 6px; color: var(--muted); font-size: .75rem; font-weight: 600; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 10px;
}
.brand-mark i {
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 4px;
  position: relative;
}
.brand-mark i::after { content: ''; position: absolute; inset: 4px; background: #bcf7dc; border-radius: 1px; }
.tools { display: flex; align-items: center; gap: 8px; }
.language select, .menu summary {
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: #142b2c;
}
.language select { padding-inline: .65rem .35rem; font-weight: 700; font-size: .875rem; }
.menu { position: relative; }
.menu summary { width: 44px; display: grid; place-items: center; list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-icon { width: 17px; height: 12px; border-block: 2px solid currentColor; position: relative; }
.menu-icon::after { content: ''; position: absolute; top: 3px; inset-inline: 0; border-top: 2px solid currentColor; }
.menu-panel {
  position: absolute;
  z-index: 2;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  display: grid;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
  box-shadow: 0 10px 24px #0a332521;
}
.menu-panel > * { display: block; padding: .7rem; border: 0; border-radius: 6px; background: transparent; text-align: left; text-decoration: none; color: inherit; }
.menu-panel > *:hover { background: #eff6f3; }

.workspace { width: min(100% - 48px, 1120px); margin: clamp(26px, 6vw, 78px) auto 48px; }
body[data-view='scan'] { background: #403683; }
body[data-view='result'] { background: #fefefe; }
body:is([data-view='scan'], [data-view='result']) .workspace { width: 100%; margin: 0; }

.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 16px 36px #294a3610;
  overflow: hidden;
}
.split { display: grid; grid-template-columns: 1.02fr 1fr; align-items: stretch; }
.panel-copy { padding: clamp(25px, 5vw, 64px); align-self: center; }
h1 { font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 800; line-height: 1.05; letter-spacing: -.055em; text-wrap: balance; }
h2 { font-size: clamp(1.25rem, 2vw, 1.65rem); font-weight: 800; line-height: 1.2; letter-spacing: -.025em; }
.panel-copy > p, .message-panel > p { color: var(--muted); font-size: 1.05rem; line-height: 1.6; margin-top: 16px; max-width: 34rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  padding: .55rem .95rem;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
  line-height: 1.22;
}
.primary { background: var(--accent); color: #fff; }
.primary:hover { background: var(--accent-hover); }
.quiet:hover { background: #eaf5f0; }
.quiet { background: transparent; color: var(--accent); }
.button:disabled { cursor: wait; opacity: .6; }

.label-stage {
  display: grid;
  gap: 14px;
  align-content: center;
  justify-items: center;
  padding: clamp(24px, 4vw, 48px);
}
.label-stage { background: radial-gradient(ellipse at 65% 24%, #f6fff8, #d8eee4 85%); }
.sample-label {
  border: 1px solid #ceded7;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 30px #133a2a20;
  display: grid;
  justify-items: center;
  padding: 18px;
  width: min(100%, 260px);
}
.label-caption { font-size: .83rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
#sample-qr { display: block; width: min(100%, 208px); height: auto; image-rendering: pixelated; }
.label-code { font-family: ui-monospace, 'SF Mono', Consolas, monospace; font-size: .875rem; letter-spacing: .02em; }
.label-caption-note { color: #274940; font-size: .875rem; text-align: center; }
.message-panel { padding: clamp(24px, 5vw, 64px); }
.message-panel > .button { margin-top: 22px; }

dialog { width: min(100% - 32px, 460px); padding: 0; border: 1px solid var(--border); border-radius: 17px; color: #142b2c; box-shadow: 0 20px 55px #142b2c36; }
dialog::backdrop { background: #102a28a8; }
.dialog-body { padding: clamp(20px, 5vw, 34px); }
.dialog-body p { margin-top: 10px; line-height: 1.6; color: var(--muted); }
.dialog-body .button { margin-top: 22px; }

@media (max-width: 690px) {
  .topbar-inner, .workspace { width: calc(100% - 28px); }
  .topbar-inner { height: 64px; }
  .workspace { margin-top: 22px; }
  .panel { border-radius: 17px; }
  .split { grid-template-columns: 1fr; }
  .panel-copy { padding: 23px; }
}

@media (max-width: 350px) {
  .wordmark { gap: 6px; font-size: .9rem; }
  .wordmark small { margin-left: 2px; }
  .panel-copy { padding: 17px; }
}
