/* passself — Swiss / beige, matching the MaiTALK brochure system (disc #982).
   Paper (#f4eee1) ground, ink text, hard rules, offset shadows; Outfit for
   display/labels (heavy, tracked), Zen Kaku Gothic for body, JetBrains Mono for
   IDs/meta. Vermilion is the single hot accent; indigo the cool secondary. */

:root {
  --paper: #f4eee1;
  --paper-2: #ece3d0;
  --ink: #16120d;
  --ink-soft: #3a3127;
  --muted: #7a7060;
  --vermilion: #d8392a;
  --indigo: #27405a;
  --line: #16120d;
  --rule: 2px;
  --gothic: "Zen Kaku Gothic New", system-ui, sans-serif;
  --outfit: "Outfit", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
}
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--gothic);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 40px;
}

/* ── top bar ─────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: var(--rule) solid var(--ink);
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 5;
}
.wordmark {
  font-family: var(--outfit);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.03em;
}
.wordmark b {
  font-weight: 800;
}
.tool {
  font-family: var(--outfit);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--indigo);
}

/* ── layout ──────────────────────────────────────────────── */
.view {
  max-width: 620px;
  margin: 0 auto;
  padding: 28px 20px 0;
}
.hidden {
  display: none !important;
}
.lead {
  font-family: var(--outfit);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: clamp(28px, 7vw, 40px);
  line-height: 1.05;
  margin: 8px 0 12px;
}
.sub {
  color: var(--ink-soft);
  font-size: 15px;
  max-width: 46ch;
  margin: 0 0 24px;
}

/* ── camera ──────────────────────────────────────────────── */
.camwrap {
  position: relative;
  border: var(--rule) solid var(--ink);
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  max-width: 340px;
  margin: 0 auto 18px;
  background: var(--ink);
  box-shadow: 7px 7px 0 var(--ink);
}
.camwrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.reticle {
  position: absolute;
  inset: 18%;
  border: 3px solid var(--paper);
  border-radius: 12px;
  box-shadow: 0 0 0 100vmax rgba(22, 18, 13, 0.28);
}

/* ── buttons ─────────────────────────────────────────────── */
.btn {
  font-family: var(--outfit);
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: 15px;
  background: var(--paper);
  color: var(--ink);
  border: var(--rule) solid var(--ink);
  border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
  transition: transform 0.05s ease, box-shadow 0.05s ease;
}
.btn:active {
  transform: translate(2px, 2px);
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 5px 5px 0 var(--ink);
}
.btn-primary:active {
  box-shadow: 0 0 0 var(--ink);
}
.btn.big {
  display: block;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  padding: 15px 26px;
}
.btn-ghost {
  border-color: var(--muted);
  color: var(--ink-soft);
  font-weight: 700;
}

/* ── status line ─────────────────────────────────────────── */
.status {
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  min-height: 18px;
  margin: 12px 0;
}
.status.err {
  color: var(--vermilion);
}
.status.ok {
  color: var(--indigo);
}

/* ── manual sign-in ──────────────────────────────────────── */
.manual {
  margin: 20px auto 0;
  max-width: 340px;
}
.manual summary {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
}
.manual input {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 14px;
  border: var(--rule) solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
}
.manual .btn {
  width: 100%;
  margin-top: 10px;
}

/* ── pass card ───────────────────────────────────────────── */
.passcard {
  border: var(--rule) solid var(--ink);
  border-radius: 18px;
  padding: 18px 20px;
  background: var(--paper-2);
  box-shadow: 6px 6px 0 var(--ink);
  margin-bottom: 26px;
}
.passcard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.passlabel {
  font-family: var(--outfit);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 20px;
}
.chip {
  font-family: var(--outfit);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  white-space: nowrap;
}
.chip.status-active {
  background: var(--indigo);
  color: var(--paper);
  border-color: var(--indigo);
}
.chip.status-suspended,
.chip.status-revoked,
.chip.status-minted {
  background: var(--vermilion);
  color: var(--paper);
  border-color: var(--vermilion);
}
.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
  margin: 0;
}
.facts div {
  border-top: 1.5px solid rgba(22, 18, 13, 0.18);
  padding-top: 8px;
}
.facts dt {
  font-family: var(--outfit);
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.facts dd {
  margin: 2px 0 0;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}

/* ── field editors ───────────────────────────────────────── */
.field {
  position: relative;
  margin-bottom: 30px;
  padding-bottom: 4px;
  border-bottom: var(--rule) solid var(--ink);
}
.field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.field-head h2 {
  font-family: var(--outfit);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 18px;
  margin: 0;
}
.count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.count.over {
  color: var(--vermilion);
  font-weight: 700;
}
.field-help {
  color: var(--ink-soft);
  font-size: 13px;
  margin: 6px 0 12px;
}
textarea {
  width: 100%;
  font-family: var(--gothic);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  border: var(--rule) solid var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
  resize: vertical;
}
textarea:focus {
  outline: none;
  box-shadow: 4px 4px 0 var(--indigo);
}
.field-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 12px;
}
.save-msg {
  font-family: var(--mono);
  font-size: 12px;
  margin-right: auto;
}
.save-msg.ok {
  color: var(--indigo);
}
.save-msg.err {
  color: var(--vermilion);
}

/* locked (no entitlement) overlay */
.locked-veil {
  position: absolute;
  inset: 44px 0 8px;
  background: rgba(244, 238, 225, 0.86);
  backdrop-filter: blur(1.5px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 12px;
}
.locked-veil span {
  font-family: var(--outfit);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-soft);
  max-width: 28ch;
}

/* ── devices ─────────────────────────────────────────────── */
.devlist {
  list-style: none;
  margin: 0;
  padding: 0;
}
.dev {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--paper-2);
}
.dev:first-child {
  border-top: none;
}
.dev-main {
  flex: 1 1 auto;
  min-width: 0;
}
.dev-label {
  width: 100%;
  font-family: var(--gothic);
  font-weight: 500;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px dashed transparent;
  padding: 2px 0;
}
.dev-label::placeholder {
  color: var(--muted);
  font-style: italic;
}
.dev-label:hover {
  border-bottom-color: var(--paper-2);
}
.dev-label:focus {
  outline: none;
  border-bottom-color: var(--indigo);
}
.dev-label.err {
  border-bottom-color: var(--vermilion);
}
.dev-meta {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dev-disable {
  flex: 0 0 auto;
  padding: 8px 16px;
  font-size: 13px;
}
.dev-disable:hover:not(:disabled) {
  border-color: var(--vermilion);
  color: var(--vermilion);
}
.devlist-empty {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 0;
}

/* ── editor footer ───────────────────────────────────────── */
.editor-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 8px 0 0;
}
.privacy {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}

/* ── site footer (colophon) ──────────────────────────────── */
.sitefoot {
  max-width: 620px;
  margin: 40px auto 0;
  padding: 16px 20px 4px;
  border-top: var(--rule) solid var(--ink);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.colophon {
  font-family: var(--outfit);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.colophon .sep {
  color: var(--vermilion);
  margin: 0 1px;
}
.years {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--muted);
}
