:root {
  --bg: #0c0f0c;
  --card: #161b16;
  --line: #2a332a;
  --text: #f4f7f4;
  --muted: #8d9a8d;
  --accent: #3dd68c;
  --danger: #e25b5b;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 400px at 50% -10%, #1a2a20, transparent 60%),
    var(--bg);
}
button, input, select { font: inherit; color: inherit; }
.phone {
  width: min(440px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  padding: 20px 16px 96px;
}
.top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
h1 { margin: 0; font-size: 1.35rem; letter-spacing: -0.03em; }
.muted { color: var(--muted); font-size: 0.85rem; }
.row { display: flex; gap: 8px; align-items: center; }
.btn, .icon {
  border: 1px solid var(--line);
  background: #101510;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}
.btn.primary { background: var(--accent); color: #062214; border-color: transparent; font-weight: 650; }
.btn.danger { background: transparent; color: var(--danger); border-color: #5a2a2a; }
.btn.ghost { background: transparent; }
.search, .field input, .field select {
  width: 100%;
  border: 1px solid var(--line);
  background: #101510;
  border-radius: 12px;
  padding: 12px 14px;
}
.search { margin-bottom: 14px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 14px 12px;
  margin-bottom: 10px;
}
.card-head { display: flex; justify-content: space-between; gap: 8px; }
.issuer { font-size: 0.78rem; color: var(--accent); font-weight: 650; }
.name { margin: 2px 0 8px; font-size: 1rem; }
.code {
  font-family: var(--mono);
  font-size: 2rem;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}
.bar {
  height: 4px;
  border-radius: 99px;
  background: #243024;
  overflow: hidden;
  margin-top: 10px;
}
.bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  width: 0;
}
.bar.low > span { background: #e2b15b; }
.meta { display: flex; justify-content: space-between; margin-top: 8px; }
.actions { display: flex; gap: 6px; }
.icon { padding: 6px 8px; font-size: 0.8rem; }
.empty {
  text-align: center;
  padding: 48px 12px;
  color: var(--muted);
}
.fab {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: min(408px, calc(100% - 32px));
}
.login, .sheet {
  width: min(420px, calc(100% - 32px));
  margin: 12vh auto 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
}
.sheet {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  margin: 0;
  max-height: min(86vh, 720px);
  overflow: auto;
  z-index: 3;
}
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.field { margin-bottom: 12px; }
.field label { display: block; margin-bottom: 6px; font-size: 0.82rem; color: var(--muted); }
.error { color: #ffb4b4; min-height: 1.2em; font-size: 0.85rem; }
.qr { display: block; margin: 8px auto; border-radius: 12px; background: #fff; }
.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: #243024;
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: 999px;
  z-index: 5;
}
video.scan {
  width: 100%;
  border-radius: 12px;
  background: #000;
  max-height: 220px;
}
.secret {
  font-family: var(--mono);
  word-break: break-all;
  font-size: 0.85rem;
  background: #101510;
  border-radius: 10px;
  padding: 10px;
}
