:root {
  --bg: #090b10;
  --bg-2: #141820;
  --bg-3: #1d2330;
  --line: rgba(246, 243, 236, 0.12);
  --text: #f6f3ec;
  --muted: #aaa496;
  --gold: #e6c98a;
  --gold-2: #f6e7c4;
  --danger: #ff8d86;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--text);
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(230, 201, 138, 0.16), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(88, 122, 255, 0.14), transparent 50%),
    var(--bg);
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(22px + env(safe-area-inset-bottom));
}
h1, h2, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
::selection { background: rgba(230, 201, 138, 0.35); }

.boot, .muted { color: var(--muted); }
.shell { width: min(480px, 100%); margin: 0 auto; }
.lock-wrap { min-height: calc(100dvh - 40px); display: grid; place-items: center; }
.lock-card, .modal-card { width: min(440px, 100%); display: grid; gap: 14px; }
.brand-logo {
  width: min(240px, 78%);
  height: auto;
  justify-self: center;
  border-radius: 50%;
}
.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}
.top-title { flex: 1; min-width: 0; }
.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;
}
.eyebrow {
  color: var(--gold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}
.lock-card h1, .subhead h1 { font-size: clamp(32px, 8vw, 44px); letter-spacing: -0.04em; }
.subhead { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.subhead h1 { flex: 1; }
.lock-side { margin-left: auto; }
.subhead h1 { font-size: 28px; }
.lede { color: var(--muted); line-height: 1.45; }

.stack-form, .settings { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span, .info span, .note-block span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
input, select, textarea {
  width: 100%;
  background: #0c0e14;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 16px;
}
textarea { min-height: 96px; resize: vertical; }
select option { background: #141820; }
.inline-field { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.form-error { min-height: 1.2em; color: var(--danger); }
.hint { color: var(--gold); font-size: 13px; }
.text-btn {
  justify-self: start;
  background: none;
  border: 0;
  color: var(--gold);
  padding: 0;
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  font-weight: 700;
  background: var(--bg-3);
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn.primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #241c0d; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid rgba(255, 141, 134, 0.45); }
.btn.small, .btn.tiny { padding: 8px 12px; font-size: 14px; }
.btn:disabled { opacity: 0.65; cursor: wait; }
.actions, .info-actions, .top-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.actions .btn { flex: 1; }

.topbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.topbar h1 { font-size: 34px; letter-spacing: -0.04em; }
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  margin-top: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}
.tab {
  border: 0;
  border-radius: 12px;
  padding: 10px 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}
.tab.active { background: var(--bg-3); color: var(--text); }
.search { margin-top: 14px; }
#collection { display: grid; gap: 14px; margin-top: 14px; }
.group {
  display: grid;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.03);
}
.group-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  text-align: left;
}
.group-head > span:first-child { display: grid; min-width: 0; }
.group-head strong { font-size: 17px; letter-spacing: -0.02em; }
.group-head small { color: var(--muted); font-size: 13px; }
.group-toggle { color: var(--gold); font-size: 13px; font-weight: 700; flex: none; }
.group h2 {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quiet-link { color: var(--gold); }
input[readonly] { opacity: 0.85; }
.share-box { display: grid; gap: 8px; padding-top: 8px; }
.share-box h2 {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.share-form { display: grid; gap: 8px; }
.share-list { display: grid; gap: 8px; }
.share-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.share-row small { color: var(--muted); }
.card-face {
  width: 100%;
  min-height: 176px;
  border: 0;
  border-radius: 22px;
  padding: 16px 16px 16px 20px;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  text-align: left;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}
.card-face.ink-dark { color: #1a1408; text-shadow: none; }
.card-face.selected { outline: 2px solid var(--gold); outline-offset: 3px; }
.bank-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  max-width: 46%;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: #14181f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-align: center;
  text-shadow: none;
  flex: none;
}
.card-face.ink-dark .bank-logo { background: rgba(20, 16, 8, 0.9); color: #f6f3ec; }
.network.visa { font-style: italic; letter-spacing: 0.14em; font-weight: 800; }
.card-face:active { transform: scale(0.985); }
.card-accent { position: absolute; inset: 0 auto 0 0; width: 7px; }
.card-glow {
  position: absolute;
  width: 190px;
  height: 190px;
  right: -60px;
  top: -80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.32), transparent 68%);
  pointer-events: none;
}
.card-top, .card-bottom, .card-brand { display: flex; justify-content: space-between; gap: 10px; position: relative; z-index: 1; }
.card-brand { align-items: center; min-width: 0; }
.card-brand div { min-width: 0; }
.card-brand strong, .card-brand em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-brand em { font-style: normal; opacity: 0.82; font-size: 12px; margin-top: 2px; }
.mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
}
.pan {
  position: relative;
  z-index: 1;
  font-family: Consolas, "Cascadia Mono", ui-monospace, monospace;
  letter-spacing: 0.12em;
  font-size: 15px;
}
.network { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; text-align: right; }
.holder { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; }
.chip { width: 34px; height: 26px; }

.bank-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}
.bank-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  background: #0c0e14;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  color: var(--text);
  font-size: 13px;
}
.bank-chip.active { border-color: var(--gold); }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }

.secret-row {
  width: 100%;
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
}
.secret-row.selected { border-color: var(--gold); }
.secret-row strong { display: block; }
.secret-row p { margin-top: 3px; color: var(--muted); font-size: 13px; }
.mark.quiet { background: var(--bg-3); border-color: var(--line); }

.info {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.info strong { display: block; margin-top: 4px; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.card-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.mono { font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; }
.note-block { padding-top: 14px; }
.note-block p { margin-top: 6px; white-space: pre-wrap; line-height: 1.45; }
.stamp { color: var(--muted); font-size: 12px; margin-top: 12px; }
.detail { display: grid; gap: 14px; }
.empty { text-align: center; padding: 36px 8px; display: grid; gap: 10px; justify-items: center; }
.empty p { color: var(--muted); line-height: 1.45; max-width: 36ch; }
.settings p { color: var(--muted); line-height: 1.5; }
.danger-zone { display: grid; gap: 8px; padding-top: 8px; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.62);
  display: grid;
  place-items: center;
  padding: 16px;
}
.modal-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(12px);
  opacity: 0;
  pointer-events: none;
  background: var(--gold-2);
  color: #241c0d;
  font-weight: 700;
  border-radius: 999px;
  padding: 12px 16px;
  z-index: 40;
  transition: 0.2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.shake { animation: shake 0.35s ease; }
@keyframes shake {
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

@media (min-width: 960px) {
  body { padding: 18px; }
  .only-mobile { display: none; }
  .desktop {
    width: min(1120px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 420px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
  }
  .pane {
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.03);
    min-height: calc(100dvh - 36px);
  }
}

.admin-desk { width: min(920px, 100%); margin: 0 auto; display: grid; gap: 16px; }
.admin-head { display: flex; align-items: center; gap: 12px; }
.admin-head h1 { font-size: clamp(28px, 5vw, 40px); letter-spacing: -0.04em; flex: 1; }
.admin-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.admin-tools .search { flex: 1; min-width: 180px; margin: 0; }
.admin-list { display: grid; gap: 12px; }
.admin-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-2);
}
.admin-meta { color: var(--muted); font-size: 13px; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) {
  .admin-grid { grid-template-columns: 1fr; }
}
.check-line { display: flex; align-items: center; gap: 8px; }
.check-line input { width: auto; }
.check-line span {
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  font-size: 15px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
