:root {
  color-scheme: light;
  --ink: #172338;
  --muted: #6d788a;
  --line: #e1e6ee;
  --paper: #ffffff;
  --canvas: #f5f7fb;
  --blue: #2756c7;
  --blue-dark: #1d429f;
  --blue-soft: #e9efff;
  --gold: #f2b94b;
  --bronze: #b96b36;
  --green: #21835a;
  --red: #b84646;
  --shadow: 0 16px 42px rgba(26, 44, 79, .08);
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--canvas);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--canvas); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(39, 86, 199, .28); outline-offset: 2px; }
.app-shell { max-width: 1020px; min-height: 100vh; margin: 0 auto; padding: 0 18px 48px; }
.topbar { display:flex; align-items:center; justify-content:space-between; min-height:74px; border-bottom:1px solid var(--line); gap:16px; }
.brand { display:flex; align-items:center; gap:11px; border:0; padding:0; background:transparent; color:var(--ink); text-align:left; }
.brand-mark { display:grid; place-items:center; width:40px; height:40px; border-radius:14px; background:var(--blue); box-shadow:0 6px 15px rgba(39,86,199,.2); }
.brand-mark svg { width:25px; height:25px; }
.brand-title { font:800 17px/1.12 Manrope, sans-serif; letter-spacing:-.4px; }
.brand-subtitle { display:block; color:var(--muted); font:500 11px/1.25 "DM Sans",sans-serif; margin-top:3px; letter-spacing:.15px; }
.topbar-actions { display:flex; gap:8px; align-items:center; }
.main-content { padding-top:28px; }
.loading { min-height:70vh; display:grid; align-content:center; justify-items:center; color:var(--muted); gap:12px; }
.spinner { width:27px; height:27px; border:3px solid #dce4f2; border-top-color:var(--blue); border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.eyebrow { color:var(--blue); font-size:12px; font-weight:700; letter-spacing:1px; text-transform:uppercase; margin:0 0 9px; }
h1,h2,h3,p { margin-top:0; }
h1,h2,h3 { font-family:Manrope,"DM Sans",sans-serif; letter-spacing:-.6px; }
h1 { font-size:clamp(27px,5vw,39px); line-height:1.12; margin-bottom:10px; }
h2 { font-size:23px; line-height:1.2; margin-bottom:8px; }
h3 { font-size:17px; line-height:1.25; margin-bottom:6px; }
.lede { color:var(--muted); line-height:1.55; max-width:560px; margin-bottom:0; }
.center-screen { min-height:calc(100vh - 80px); display:grid; place-items:center; padding:30px 0; }
.auth-card,.form-card { width:min(100%,440px); background:var(--paper); border:1px solid var(--line); border-radius:22px; box-shadow:var(--shadow); padding:28px; }
.hero-emblem { width:54px; height:54px; border-radius:18px; display:grid; place-items:center; background:var(--blue-soft); margin-bottom:22px; }
.hero-emblem svg { width:32px; height:32px; }
.form-row { display:grid; gap:7px; margin-top:20px; }
label { font-size:13px; font-weight:700; color:#36445a; }
input, select { width:100%; min-height:48px; padding:0 14px; border:1px solid #d6deea; border-radius:12px; background:#fff; color:var(--ink); }
input::placeholder { color:#9aa4b3; }
.field-note { margin:7px 0 0; color:var(--muted); font-size:12px; line-height:1.45; }
.btn { min-height:44px; border:1px solid transparent; border-radius:12px; padding:0 15px; display:inline-flex; align-items:center; justify-content:center; gap:8px; font-weight:700; font-size:14px; transition:background .15s, transform .15s, border-color .15s; }
.btn:active { transform:translateY(1px); }
.btn-primary { color:white; background:var(--blue); }
.btn-primary:hover { background:var(--blue-dark); }
.btn-secondary { background:#fff; color:var(--ink); border-color:var(--line); }
.btn-secondary:hover { border-color:#b8c6df; background:#f9fbff; }
.btn-quiet { background:transparent; color:var(--muted); padding:0 10px; }
.btn-quiet:hover { color:var(--ink); background:#eef2f8; }
.btn-danger { color:var(--red); background:#fff; border-color:#f1d4d4; }
.btn-block { width:100%; margin-top:22px; }
.header-row { display:flex; justify-content:space-between; align-items:flex-end; gap:20px; margin-bottom:23px; }
.header-row .btn { flex:0 0 auto; }
.profile-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:13px; margin-top:24px; }
.profile-card { min-height:94px; border:1px solid var(--line); background:var(--paper); border-radius:17px; padding:16px; display:flex; align-items:center; justify-content:space-between; text-align:left; gap:12px; box-shadow:0 5px 18px rgba(26,44,79,.035); }
.profile-card:hover { border-color:#aebfe3; box-shadow:0 8px 24px rgba(26,44,79,.08); }
.profile-name { font:700 16px Manrope,sans-serif; display:block; }
.profile-meta { color:var(--muted); font-size:12px; margin-top:5px; display:block; }
.profile-progress { text-align:right; color:var(--blue); font:800 18px Manrope,sans-serif; white-space:nowrap; }
.profile-progress small { color:var(--muted); font:500 11px "DM Sans",sans-serif; display:block; margin-top:2px; }
.add-profile-card { display:grid; place-items:center; color:var(--blue); border:1px dashed #b8c8e5; background:rgba(255,255,255,.45); border-radius:17px; min-height:94px; font-weight:700; }
.add-symbol { font-size:23px; line-height:1; margin-bottom:4px; }
.notice { display:flex; gap:10px; align-items:flex-start; border:1px solid #dce5f5; background:#f0f4fc; padding:13px 15px; border-radius:13px; color:#4b5d7a; font-size:13px; line-height:1.45; margin-top:22px; }
.notice-icon { width:18px; height:18px; flex:none; display:grid; place-items:center; border:1.5px solid #7b90b9; color:#6179a5; border-radius:50%; font-weight:800; font-size:11px; }
.profile-head { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; margin-bottom:21px; }
.profile-head .lede { margin-top:4px; }
.profile-tools { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.summary-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:22px 0; }
.summary-card { background:var(--paper); border:1px solid var(--line); border-radius:16px; padding:15px 17px; }
.summary-label { font-size:12px; font-weight:600; color:var(--muted); }
.summary-value { font:800 25px/1.1 Manrope,sans-serif; margin:6px 0 0; letter-spacing:-.8px; }
.summary-foot { font-size:11px; color:var(--muted); margin-top:4px; }
.progress-track { height:7px; background:#edf0f5; border-radius:9px; overflow:hidden; margin-top:11px; }
.progress-fill { height:100%; background:linear-gradient(90deg,#356be4,#67a4ff); border-radius:9px; transition:width .3s; }
.missing-panel { background:var(--paper); border:1px solid var(--line); border-radius:17px; padding:17px; margin:0 0 18px; box-shadow:0 5px 18px rgba(26,44,79,.035); }
.missing-panel-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:11px; }
.missing-panel-heading .eyebrow { margin-bottom:5px; }
.missing-panel-heading h2 { font-size:19px; margin:0; }
.missing-total { flex:none; padding:7px 10px; border-radius:999px; background:#fff4dd; color:#805d13; font-size:12px; font-weight:700; }
.missing-denomination-list { list-style:none; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 24px; margin:0; padding:0; }
.missing-denomination-list li { display:grid; grid-template-columns:105px minmax(0,1fr); gap:8px; padding:9px 0; border-top:1px solid #edf0f5; font-size:13px; line-height:1.5; }
.missing-denomination-list strong { color:#36445a; }
.missing-denomination-list li span { color:var(--muted); overflow-wrap:anywhere; }
.missing-complete { margin:0; padding:12px 0 2px; color:var(--green); font-size:14px; font-weight:700; }
.year-panel { background:var(--paper); border:1px solid var(--line); border-radius:20px; overflow:hidden; box-shadow:0 7px 24px rgba(26,44,79,.035); }
.year-toolbar { display:flex; align-items:center; justify-content:space-between; padding:15px 17px; border-bottom:1px solid var(--line); gap:12px; }
.year-switch { display:flex; align-items:center; gap:12px; }
.year-switch h2 { font:800 24px Manrope,sans-serif; margin:0; min-width:55px; text-align:center; font-variant-numeric:tabular-nums; }
.icon-btn { display:grid; place-items:center; width:38px; height:38px; border:1px solid var(--line); border-radius:11px; background:white; color:var(--ink); font-size:18px; }
.icon-btn:hover:not(:disabled) { background:#f2f5fa; }
.icon-btn:disabled { opacity:.35; cursor:not-allowed; }
.year-actions { display:flex; gap:7px; }
.year-actions .btn { min-height:38px; padding:0 11px; font-size:12px; }
.coin-grid { padding:18px; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.coin-tile { min-height:111px; border:1px solid var(--line); border-radius:15px; background:#fff; color:var(--ink); padding:12px 8px 11px; display:grid; justify-items:center; align-content:center; gap:7px; }
.coin-tile:hover { border-color:#b9c7df; background:#fafcff; }
.coin-tile.owned { border-color:#9bb4f0; background:#f2f6ff; }
.coin-face { width:43px; height:43px; border-radius:50%; display:grid; place-items:center; background:linear-gradient(145deg,#e5e9ef,#c5cbd4); color:#626e7b; font:800 10px Manrope,sans-serif; box-shadow:inset 0 0 0 3px rgba(255,255,255,.52),0 2px 3px rgba(36,50,71,.12); }
.coin-face.gold { background:linear-gradient(145deg,#ffdf80,#dc9c2c); color:#77500d; }
.coin-face.copper { background:linear-gradient(145deg,#efaa79,#a9512f); color:#6d2e17; }
.coin-face.dual { background:linear-gradient(145deg,#e6eaf0 0 48%,#f2bd4b 49% 100%); color:#4c5766; }
.coin-label { font:700 14px Manrope,sans-serif; }
.coin-state { color:var(--muted); font-size:11px; }
.coin-tile.owned .coin-state { color:var(--blue); font-weight:700; }
.missing-box { display:flex; justify-content:space-between; align-items:center; gap:15px; padding:13px 18px; border-top:1px solid var(--line); background:#fbfcfe; }
.missing-title { font-size:13px; font-weight:700; }
.missing-list { color:var(--muted); font-size:12px; margin-top:4px; }
.status-pill { flex:none; padding:6px 9px; border-radius:999px; background:#fff4dd; color:#956a15; font-weight:700; font-size:11px; }
.status-pill.complete { color:#1c7651; background:#e4f6ed; }
.year-jump { display:flex; align-items:center; gap:8px; margin-top:15px; }
.year-jump label { color:var(--muted); font-size:12px; }
.year-jump select { width:auto; min-height:39px; padding:0 34px 0 11px; border-radius:10px; font-size:13px; }
.pin-lock { background:#fff8e9; border:1px solid #f0dfb9; border-radius:12px; padding:11px 13px; color:#7f642f; font-size:12px; line-height:1.45; margin-bottom:15px; }
.hidden { display:none !important; }
.form-actions { display:flex; gap:10px; margin-top:22px; }
.form-actions .btn { flex:1; }
.form-error { color:#b13f43; font-size:13px; line-height:1.4; margin:12px 0 0; }
.modal-backdrop { position:fixed; inset:0; z-index:8; display:grid; place-items:center; padding:18px; background:rgba(20,31,50,.43); backdrop-filter:blur(3px); }
.pin-dialog { position:relative; width:min(100%,420px); max-height:calc(100dvh - 36px); overflow:auto; padding:25px; background:#fff; border:1px solid rgba(255,255,255,.7); border-radius:21px; box-shadow:0 24px 70px rgba(14,26,48,.24); }
.modal-close { position:absolute; top:14px; right:14px; width:35px; height:35px; border:0; border-radius:10px; background:#f1f4f8; color:#59677d; font-size:23px; line-height:1; }
.modal-close:hover { background:#e8edf5; }
.back-link { border:0; background:transparent; padding:0; color:var(--blue); font-weight:700; font-size:13px; margin-bottom:18px; }
.empty-state { padding:26px 18px; text-align:center; border:1px dashed #cbd5e4; border-radius:16px; color:var(--muted); margin-top:22px; }
.empty-state .btn { margin-top:10px; }
.toast { position:fixed; left:50%; bottom:calc(18px + env(safe-area-inset-bottom)); transform:translate(-50%,14px); background:#1e2c45; color:#fff; padding:12px 16px; border-radius:13px; max-width:calc(100vw - 32px); box-shadow:0 10px 28px rgba(20,33,56,.2); font-size:13px; opacity:0; pointer-events:none; transition:opacity .2s,transform .2s; z-index:10; }
.toast.show { opacity:1; transform:translate(-50%,0); }
footer { color:#8b95a5; text-align:center; font-size:11px; margin-top:28px; }
@media (max-width:640px) {
  .app-shell { padding:0 13px 30px; }
  .topbar { min-height:66px; }
  .brand-mark { width:37px; height:37px; }
  .brand-title { font-size:16px; }
  .main-content { padding-top:22px; }
  .auth-card,.form-card { padding:23px 19px; border-radius:19px; }
  .header-row { align-items:flex-start; flex-direction:column; gap:13px; }
  .header-row .btn { width:100%; }
  .profile-grid { grid-template-columns:1fr; gap:10px; margin-top:20px; }
  .profile-card,.add-profile-card { min-height:80px; }
  .profile-head { flex-direction:column; }
  .profile-tools { width:100%; justify-content:flex-start; }
  .summary-grid { gap:9px; margin:18px 0; }
  .summary-card { padding:13px 12px; }
  .summary-value { font-size:22px; }
  .missing-panel { padding:14px 13px; }
  .missing-panel-heading { align-items:flex-start; flex-direction:column; }
  .missing-denomination-list { grid-template-columns:1fr; }
  .missing-denomination-list li { grid-template-columns:105px minmax(0,1fr); gap:6px; }
  .year-toolbar { align-items:flex-start; flex-direction:column; }
  .year-actions { width:100%; }
  .year-actions .btn { flex:1; }
  .coin-grid { padding:13px; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; }
  .coin-tile { min-height:96px; padding:9px 4px; gap:5px; }
  .coin-face { width:37px; height:37px; font-size:9px; }
  .coin-label { font-size:13px; }
  .coin-state { font-size:10px; }
  .missing-box { align-items:flex-start; padding:12px 13px; }
  .year-jump { justify-content:space-between; }
  .year-jump select { flex:1; max-width:180px; }
}
@media (max-width:370px) {
  .coin-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation-duration:.01ms !important; transition-duration:.01ms !important; scroll-behavior:auto !important; } }
