:root {
  --bg: #f2f2f7; --card: #fff; --text: #1c1c1e; --sub: #8e8e93; --line: #e5e5ea;
  --blue: #007aff; --red: #ff3b30; --orange: #ff9500; --green: #34c759;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #000; --card: #1c1c1e; --text: #f2f2f7; --sub: #8e8e93; --line: #38383a; --blue: #0a84ff; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Apple SD Gothic Neo", "Segoe UI", sans-serif; }
a { color: var(--blue); text-decoration: none; }
.wrap { max-width: 760px; margin: 0 auto; padding: 16px; }
header.top { display: flex; align-items: baseline; justify-content: space-between; padding: 24px 0 8px; }
header.top h1 { font-size: 32px; margin: 0; font-weight: 700; }
.muted { color: var(--sub); font-size: 13px; }
.card { background: var(--card); border-radius: 14px; overflow: hidden; }
.list .row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.list .row:last-child { border-bottom: 0; }
.icon { width: 64px; height: 64px; border-radius: 22.5%; background: var(--line) center/cover no-repeat;
  flex: none; border: 0.5px solid rgba(0,0,0,.08); }
.icon.lg { width: 118px; height: 118px; }
.grow { flex: 1; min-width: 0; }
.title { font-weight: 600; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subtitle { color: var(--sub); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn { display: inline-block; border: 0; border-radius: 999px; padding: 6px 18px; font-weight: 700; font-size: 15px;
  background: var(--bg); color: var(--blue); cursor: pointer; white-space: nowrap; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.danger { color: var(--red); }
.btn[disabled], .btn.disabled { opacity: .4; pointer-events: none; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px;
  background: var(--line); color: var(--sub); margin-left: 4px; vertical-align: middle; }
.badge.valid { background: rgba(52,199,89,.15); color: var(--green); }
.badge.warning { background: rgba(255,149,0,.15); color: var(--orange); }
.badge.expired { background: rgba(255,59,48,.15); color: var(--red); }
.hero { display: flex; gap: 18px; padding: 20px 0; }
.hero h2 { margin: 0 0 2px; font-size: 22px; }
.info { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0; padding: 4px 0; }
.info div { padding: 10px 12px; text-align: center; border-right: 1px solid var(--line); }
.info div:last-child { border-right: 0; }
.info b { display: block; font-size: 17px; }
.info span { font-size: 11px; color: var(--sub); text-transform: uppercase; }
h3 { font-size: 20px; margin: 24px 0 8px; }
.notes { padding: 14px 16px; white-space: pre-wrap; }
table.kv { width: 100%; border-collapse: collapse; font-size: 14px; }
table.kv td { padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.kv td:first-child { color: var(--sub); width: 38%; }
table.kv tr:last-child td { border-bottom: 0; }
.banner { padding: 12px 16px; border-radius: 12px; margin: 12px 0; font-size: 14px; }
.banner.warn { background: rgba(255,149,0,.15); }
.banner.err { background: rgba(255,59,48,.15); }
.qr { text-align: center; padding: 16px; }
.qr img { width: 180px; height: 180px; background: #fff; border-radius: 8px; }
.drop { display: block; border: 2px dashed var(--line); border-radius: 14px; padding: 36px; text-align: center; cursor: pointer;
  background: var(--card); transition: border-color .15s; }
.drop.over { border-color: var(--blue); }
progress { width: 100%; height: 6px; }
textarea { width: 100%; min-height: 70px; font: inherit; font-size: 14px; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px; background: var(--bg); color: var(--text); }
.empty { padding: 40px 16px; text-align: center; color: var(--sub); }
code { font-size: 12px; word-break: break-all; }
details summary { cursor: pointer; color: var(--blue); font-size: 13px; padding: 4px 0; }
