:root {
  --ps-blue: #162D52;
  --ps-blue-hover: #0E2344;
  --ps-graphite: #1B1F24;
  --ps-muted: #66717E;
  --ps-border: #D8DEE6;
  --ps-surface: #F4F6F8;
  --ps-tint: #E8EDF3;
  --ps-white: #FFFFFF;
  --ps-success: #1F6B45;
  --ps-warning: #8A5A00;
  --ps-danger: #A63A32;
  --ps-font-sans: "Libre Franklin", Arial, sans-serif;
  --ps-font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shadow: 0 10px 30px rgba(14, 35, 68, .06);
}

* { box-sizing: border-box; }
html { color-scheme: light; background: var(--ps-white); }
body {
  margin: 0;
  color: var(--ps-graphite);
  background: var(--ps-white);
  font-family: var(--ps-font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button { touch-action: manipulation; }
button:disabled { cursor: wait; opacity: .68; }
[hidden] { display: none !important; }
.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;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  padding: 12px max(18px, calc((100vw - 900px) / 2));
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--ps-border);
  backdrop-filter: blur(12px);
}
.brand-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wordmark { width: 148px; height: auto; display: block; }
.product-name {
  padding-left: 10px;
  border-left: 1px solid var(--ps-border);
  color: var(--ps-muted);
  font-size: .92rem;
  font-weight: 600;
}
.tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: var(--ps-surface);
  border-radius: 10px;
}
.tab {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ps-muted);
  padding: 7px 11px;
  font-weight: 600;
  cursor: pointer;
}
.tab.is-active {
  background: var(--ps-white);
  color: var(--ps-blue);
  box-shadow: 0 1px 4px rgba(14,35,68,.08);
}

main {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 72px;
}
.view { display: grid; gap: 20px; }
.hero {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  align-items: start;
  padding: 8px 0 4px;
}
.proof-point { width: 42px; height: 42px; }
.eyebrow {
  margin: 0 0 5px;
  color: var(--ps-blue);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .055em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  max-width: 700px;
  color: var(--ps-blue);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.05;
  letter-spacing: -.03em;
}
h2 {
  margin: 0;
  color: var(--ps-blue);
  font-size: 1.35rem;
  line-height: 1.2;
}
h3 {
  margin: 0;
  color: var(--ps-blue);
  font-size: 1.05rem;
  line-height: 1.3;
}
.lede {
  margin: 9px 0 0;
  color: var(--ps-muted);
  font-size: 1rem;
}
.card-copy,
.capture-intro p,
.save-panel p,
.email-panel p,
.advanced-intro,
.details-content p,
.muted-copy {
  margin: 6px 0 0;
  color: var(--ps-muted);
}

.card,
.history-card,
.advanced-details {
  border: 1px solid var(--ps-border);
  border-radius: 16px;
  background: var(--ps-white);
}
.card { padding: 22px; box-shadow: var(--shadow); }
.notice {
  padding: 12px 14px;
  border: 1px solid #E7D7B8;
  border-left: 4px solid var(--ps-warning);
  border-radius: 10px;
  background: #FFFBF3;
  color: var(--ps-graphite);
}
.notice.error {
  border-color: #E8C7C3;
  border-left-color: var(--ps-danger);
  background: #FFF8F7;
}

.capture-card { display: grid; gap: 14px; }
.capture-intro { margin-bottom: 2px; }
.capture-options {
  margin-top: 4px;
  padding-top: 15px;
  border-top: 1px solid var(--ps-border);
}
.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  cursor: pointer;
}
.toggle-row input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--ps-blue);
}
.toggle-row span { display: grid; gap: 2px; }
.toggle-row strong { color: var(--ps-graphite); }
.toggle-row small { color: var(--ps-muted); }
.optional-note {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--ps-border);
}
.optional-note summary,
.earlier-check summary {
  cursor: pointer;
  color: var(--ps-blue);
  font-weight: 600;
}
.optional-note summary span,
.earlier-check summary span { color: var(--ps-muted); font-weight: 400; }

.field { display: grid; gap: 7px; margin-top: 14px; color: var(--ps-graphite); font-weight: 600; }
.field-plain { margin-top: 10px; }
.field input,
.field textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--ps-border);
  border-radius: 10px;
  background: var(--ps-white);
  padding: 11px 12px;
  color: var(--ps-graphite);
  outline: none;
}
.field textarea { min-height: 74px; resize: vertical; }
.field input:focus,
.field textarea:focus {
  border-color: var(--ps-blue);
  box-shadow: 0 0 0 3px var(--ps-tint);
}
.compact-field { max-width: 430px; }
.muted { color: var(--ps-muted); font-weight: 400; }

.button {
  min-height: 46px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 10px 16px;
  font-weight: 650;
  cursor: pointer;
}
.button-large { min-height: 52px; width: 100%; font-size: 1rem; }
.button-full { width: 100%; }
.button-primary { background: var(--ps-blue); color: var(--ps-white); }
.button-primary:hover { background: var(--ps-blue-hover); }
.button-secondary { background: var(--ps-white); color: var(--ps-blue); border-color: var(--ps-border); }
.button-secondary:hover { border-color: var(--ps-blue); background: var(--ps-surface); }
.button-quiet { background: transparent; border-color: transparent; color: var(--ps-muted); }
.button-danger-quiet { background: transparent; color: var(--ps-danger); border-color: transparent; }
.button-camera-quiet { background: transparent; border-color: transparent; color: var(--ps-white); }
.text-button {
  border: 0;
  background: transparent;
  color: var(--ps-blue);
  font-weight: 650;
  padding: 5px 0;
  cursor: pointer;
}
.button:focus-visible,
.tab:focus-visible,
.text-button:focus-visible,
.shutter:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--ps-tint);
  outline-offset: 2px;
}

.camera-stage {
  overflow: hidden;
  border: 1px solid var(--ps-border);
  border-radius: 18px;
  background: #0C1118;
  box-shadow: var(--shadow);
}
.camera-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.camera-frame video { width: 100%; height: 100%; object-fit: contain; }
.camera-hud {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 6px 9px;
  border-radius: 7px;
  background: rgba(0,0,0,.58);
  color: var(--ps-white);
  font-size: .78rem;
}
.shutter-row {
  min-height: 88px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 9px 18px;
  background: #111821;
}
.shutter-row .button { justify-self: start; }
.shutter {
  width: 62px;
  height: 62px;
  padding: 5px;
  border: 2px solid var(--ps-white);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--ps-white); }

.result-card { display: grid; gap: 20px; }
.result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
#result-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.status-chip {
  flex: none;
  max-width: 44%;
  border-radius: 999px;
  padding: 6px 9px;
  background: #EDF7F1;
  color: var(--ps-success);
  font-size: .76rem;
  font-weight: 700;
  text-align: center;
}
.status-chip.warning { background: #FFF6E6; color: var(--ps-warning); }
.photo-preview {
  display: block;
  width: 100%;
  max-height: 620px;
  object-fit: contain;
  border-radius: 13px;
  background: var(--ps-surface);
  border: 1px solid var(--ps-border);
}
.essential-status {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: var(--ps-surface);
}
.essential-row { display: grid; grid-template-columns: 13px 1fr; gap: 10px; align-items: start; }
.essential-row strong,
.essential-row small { display: block; }
.essential-row strong { color: var(--ps-graphite); font-size: .95rem; }
.essential-row small { margin-top: 2px; color: var(--ps-muted); font-size: .84rem; }
.status-dot {
  width: 9px;
  height: 9px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--ps-success);
}
.status-dot-warning { background: var(--ps-warning); }
.status-dot-muted { background: #98A2AD; }
.status-dot-danger { background: var(--ps-danger); }

.save-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid #CBD6E4;
  border-radius: 14px;
  background: var(--ps-tint);
}
.step-label {
  margin: 0 0 4px !important;
  color: var(--ps-blue) !important;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.status-line { margin: 0; color: var(--ps-muted); font-size: .88rem; }
.status-line.success { color: var(--ps-success); }
.status-line.warning { color: var(--ps-warning); }
.status-line.error { color: var(--ps-danger); }
.secondary-actions { display: flex; flex-wrap: wrap; gap: 18px; }

.email-panel {
  padding-top: 16px;
  border-top: 1px solid var(--ps-border);
}
.email-panel > summary {
  cursor: pointer;
  color: var(--ps-blue);
  font-weight: 700;
}
.email-content { display: grid; gap: 10px; padding-top: 8px; }
.email-content p { margin: 0; color: var(--ps-muted); }
.email-panel .button { justify-self: start; }

.advanced-details {
  overflow: hidden;
  background: var(--ps-white);
  box-shadow: none;
}
.advanced-details > summary {
  cursor: pointer;
  padding: 14px 16px;
  color: var(--ps-blue);
  font-weight: 700;
  list-style-position: inside;
}
.advanced-details[open] > summary { border-bottom: 1px solid var(--ps-border); background: var(--ps-surface); }
.advanced-content { padding: 16px; }
.advanced-intro { margin-top: 0; margin-bottom: 14px; font-size: .9rem; }
.hash-block {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  padding: 14px;
  border: 1px solid var(--ps-border);
  border-radius: 12px;
  background: var(--ps-tint);
}
.hash-block > span {
  grid-column: 1 / -1;
  color: var(--ps-muted);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.hash-block code,
.verify-hash,
.advanced-value-mono { font-family: var(--ps-font-mono); overflow-wrap: anywhere; }
.hash-block code { min-width: 0; color: var(--ps-blue); font-size: .8rem; }
.metadata-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
  margin: 12px 0 0;
}
.meta-item { min-width: 0; padding: 11px; border-radius: 10px; background: var(--ps-surface); }
.meta-item dt { color: var(--ps-muted); font-size: .75rem; font-weight: 600; }
.meta-item dd { margin: 4px 0 0; overflow-wrap: anywhere; font-size: .92rem; }
.meta-copy { display: inline-flex; margin-top: 6px; }
.advanced-actions { display: grid; justify-items: start; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--ps-border); }
.file-check { display: grid; gap: 7px; color: var(--ps-muted); font-size: .88rem; font-weight: 600; }
.file-check input { max-width: 100%; }
.result-end-actions { display: flex; justify-content: flex-start; }

.history-card { overflow: hidden; background: var(--ps-surface); }
.history-card > summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  list-style: none;
}
.history-card > summary::-webkit-details-marker { display: none; }
.history-card > summary strong { display: block; color: var(--ps-blue); font-size: 1.05rem; }
.history-card .eyebrow { margin-bottom: 2px; }
.summary-hint { color: var(--ps-muted); font-size: .85rem; }
.history-card[open] .summary-hint { visibility: hidden; }
.history-content { padding: 0 18px 18px; }
.history-toolbar { display: flex; justify-content: flex-end; margin-top: 8px; }
.capture-list { display: grid; gap: 9px; margin-top: 8px; }
.capture-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--ps-white);
  border: 1px solid var(--ps-border);
  border-radius: 10px;
}
.capture-row strong,
.capture-row small { display: block; }
.capture-row small { margin-top: 2px; color: var(--ps-muted); }
.capture-row .button-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.empty-state { margin: 8px 0 0; color: var(--ps-muted); }

.verify-card { max-width: 700px; display: grid; gap: 14px; }
.file-field { margin-top: 0; }
.earlier-check { padding: 11px 0; border-top: 1px solid var(--ps-border); border-bottom: 1px solid var(--ps-border); }
.details-content { padding-top: 8px; }
.verify-advanced-input { max-width: 700px; }
.verify-result { max-width: 700px; display: grid; gap: 14px; }
.verify-summary {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-radius: 12px;
}
.verify-summary.pass { background: #EDF7F1; }
.verify-summary.warn { background: #FFF8EA; }
.verify-summary.fail { background: #FFF3F2; }
.verify-summary-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ps-white);
  font-weight: 800;
}
.verify-summary.pass .verify-summary-icon { background: var(--ps-success); }
.verify-summary.warn .verify-summary-icon { background: var(--ps-warning); }
.verify-summary.fail .verify-summary-icon { background: var(--ps-danger); }
.verify-summary strong { display: block; color: var(--ps-blue); }
.verify-summary p { margin: 3px 0 0; color: var(--ps-muted); }
.verify-plain-note { margin: 0; color: var(--ps-muted); }
.verify-line { display: grid; grid-template-columns: 20px 1fr; gap: 9px; align-items: start; }
.verify-icon {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ps-white);
  background: var(--ps-success);
  font-size: .7rem;
  font-weight: 800;
}
.verify-icon.warn { background: var(--ps-warning); }
.verify-icon.fail { background: var(--ps-danger); }
.verify-line strong { display: block; color: var(--ps-blue); }
.verify-hash { font-size: .78rem; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 36px;
  border-top: 1px solid var(--ps-border);
  color: var(--ps-muted);
  font-size: .84rem;
}

@media (max-width: 680px) {
  .site-header {
    min-height: 58px;
    padding-top: 10px;
    padding-bottom: 10px;
    padding-left: max(13px, env(safe-area-inset-left));
    padding-right: max(13px, env(safe-area-inset-right));
    gap: 8px;
  }
  .wordmark { width: 122px; }
  .product-name { font-size: .86rem; padding-left: 8px; }
  .tab { min-height: 40px; padding: 7px 9px; }
  main { width: min(100% - 24px, 900px); padding-top: 22px; padding-bottom: 60px; }
  .hero { grid-template-columns: 36px 1fr; gap: 11px; }
  .proof-point { width: 34px; height: 34px; }
  h1 { font-size: clamp(1.8rem, 9vw, 2.45rem); }
  .card { padding: 17px; border-radius: 14px; }
  .result-heading { display: grid; gap: 10px; }
  .status-chip { max-width: 100%; justify-self: start; }
  .photo-preview { max-height: 68vh; }
  .metadata-grid { grid-template-columns: 1fr; }
  .hash-block { grid-template-columns: 1fr; }
  .hash-block .text-button { justify-self: start; }
  .secondary-actions { gap: 16px; }
  .capture-row { grid-template-columns: 1fr; }
  .capture-row .button-row { justify-content: flex-start; }
  footer {
    width: min(100% - 24px, 900px);
    flex-direction: column;
    gap: 3px;
    padding-bottom: max(36px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 430px) {
  .product-name { display: none; }
  .wordmark { width: 116px; }
  .tabs { flex: none; }
  .tab { padding-inline: 8px; font-size: .9rem; }
  .save-panel { padding: 15px; }
  .advanced-details > summary { padding: 13px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
