/* ExQ™ Shared Components */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--n1); color: var(--tx);
  font-family: var(--font-body); font-size: var(--text-base);
  line-height: 1.72; -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
img { max-width: 100%; }

/* ── Page shell ── */
.page-wrap { min-height: 100vh; display: flex; flex-direction: column; }

/* ── Top nav ── */
.top-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 2.75rem;
  min-height: 68px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--bd);
  position: sticky; top: 0; z-index: 50;
}
.nav-brand {
  display: flex; align-items: center; gap: var(--sp-3);
  font-family: var(--font-display); font-size: 1.2rem;
  font-weight: 700; color: var(--gold-l); letter-spacing: -.01em;
}
.nav-brand-sub {
  font-size: .72rem; color: var(--tx-d); font-family: var(--font-body);
  font-weight: 400; margin-top: .08rem; letter-spacing: .01em;
}
.nav-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }
.nav-actions { display: flex; align-items: center; gap: var(--sp-2); }
.nav-link {
  font-size: var(--text-sm); color: var(--tx-m);
  padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm);
  transition: color var(--dur), background var(--dur);
}
.nav-link:hover { color: var(--tx); background: var(--cd); }
.theme-toggle {
  width: 36px; height: 36px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--tx-d); background: var(--cd); border: 1px solid var(--bd);
  font-size: 1rem; transition: color var(--dur), background var(--dur);
}
.theme-toggle:hover { color: var(--gold-l); background: var(--gold-p); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: var(--text-sm); font-weight: 600;
  padding: .6rem var(--sp-5);
  border-radius: var(--r); transition: all var(--dur) var(--ease);
  white-space: nowrap; user-select: none; border: 1px solid transparent;
  letter-spacing: .01em;
}
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-primary {
  background: var(--gold); color: var(--n0); border-color: var(--gold-text);
  box-shadow: 0 2px 10px rgba(200,146,58,.3);
}
.btn-primary:hover:not(:disabled) {
  background: var(--gold-l); border-color: var(--gold-l);
  box-shadow: 0 4px 18px rgba(200,146,58,.42); transform: translateY(-1px);
}
.btn-secondary {
  background: var(--cd); color: var(--tx); border-color: var(--bd);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--cd-h); border-color: rgba(255,255,255,.14);
}
.btn-ghost {
  background: transparent; color: var(--tx-m); border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { color: var(--tx); background: var(--cd); }
.btn-danger {
  background: var(--ro-p); color: var(--ro); border-color: rgba(225,29,72,.2);
}
.btn-danger:hover:not(:disabled) { background: rgba(225,29,72,.2); }
.btn-lg {
  font-size: var(--text-base); font-weight: 700;
  padding: .85rem var(--sp-8); border-radius: var(--r-lg);
}
.btn-sm {
  font-size: var(--text-xs); padding: .45rem var(--sp-4); border-radius: var(--r-sm);
}
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: var(--r-sm); justify-content: center; }
.btn-icon.btn-lg { width: 46px; height: 46px; }

/* ── Cards ── */
.card {
  background: var(--cd); border: 1px solid var(--bd); border-radius: var(--r-lg);
  padding: var(--sp-6); transition: background var(--dur), border-color var(--dur), box-shadow var(--dur);
}
.card:hover { background: var(--cd-h); box-shadow: var(--sh); }
.card-sm { padding: var(--sp-4) var(--sp-5); border-radius: var(--r); }

/* ── Badge / Pill ── */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: var(--text-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; padding: .25rem .65rem; border-radius: var(--r-full);
}
.badge-gold   { background: var(--gold-p);  color: var(--gold-l); }
.badge-royal  { background: var(--royal-p); color: var(--royal-l); }
.badge-em     { background: var(--em-p);    color: var(--em); }
.badge-am     { background: var(--am-p);    color: var(--am); }
.badge-ro     { background: var(--ro-p);    color: var(--ro); }
.badge-vi     { background: var(--vi-p);    color: var(--vi); }
.badge-muted  { background: var(--cd);      color: var(--tx-d); }

.chip {
  font-size: var(--text-xs); background: var(--cd);
  border: 1px solid var(--bd); border-radius: var(--r-full);
  padding: .25rem .7rem; color: var(--tx-m);
}
.chip-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

/* ── Progress bar ── */
.prog-track {
  height: 5px; background: var(--cd); border-radius: var(--r-full); overflow: hidden;
}
.prog-fill {
  height: 100%; background: var(--gold);
  border-radius: var(--r-full); transition: width .4s var(--ease);
}
.prog-fill.royal { background: var(--royal); }
.prog-fill.em    { background: var(--em); }

/* ── Labels ── */
.lbl {
  font-size: var(--text-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: var(--tx-d);
}
.lbl-gold  { color: var(--gold-text); }
.lbl-royal { color: var(--royal-l); }

/* ── Divider ── */
.divider   { height: 1px; background: var(--bd); }
.divider-v { width: 1px; background: var(--bd); align-self: stretch; }

/* ── Toast / Alert ── */
.toast {
  position: fixed; bottom: var(--sp-6); right: var(--sp-6);
  background: var(--n2); border: 1px solid var(--bd);
  border-radius: var(--r-lg); padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--sh-lg); z-index: 200;
  display: flex; align-items: center; gap: var(--sp-3);
  font-size: var(--text-sm); max-width: 340px;
  animation: toast-in .22s var(--ease);
}
@keyframes toast-in { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:translateY(0); } }
.toast.success { border-color: var(--em); }
.toast.warning { border-color: var(--am); }

/* ── Modal ── */
.modal-bg {
  position: fixed; inset: 0; background: var(--overlay);
  z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: var(--sp-4); animation: fade-in .18s;
}
@keyframes fade-in { from { opacity:0; } to { opacity:1; } }
.modal {
  background: var(--n2); border: 1px solid var(--bd);
  border-radius: var(--r-xl); padding: var(--sp-8);
  max-width: 500px; width: 100%; box-shadow: var(--sh-lg);
}

/* ── Selection card ── */
.sel-card {
  background: var(--cd); border: 2px solid var(--bd); border-radius: var(--r-lg);
  padding: var(--sp-5); cursor: pointer;
  transition: border-color var(--dur), background var(--dur), transform var(--dur), box-shadow var(--dur);
  text-align: center; user-select: none;
}
.sel-card:hover { background: var(--cd-h); border-color: rgba(255,255,255,.14); transform: translateY(-2px); box-shadow: var(--sh); }
.sel-card.selected { border-color: var(--gold-text); background: var(--gold-p); box-shadow: var(--sh-gold); }
.sel-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sel-icon { font-size: 2rem; margin-bottom: var(--sp-3); display: block; }
.sel-name { font-weight: 700; font-size: var(--text-md); margin-bottom: .2rem; }
.sel-desc { font-size: var(--text-sm); color: var(--tx-m); }

/* ── Grids ── */
.g2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: var(--sp-5); }
.g3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: var(--sp-5); }
.g4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: var(--sp-4); }
.g5 { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr)); gap: var(--sp-3); }

/* ── Scroll container ── */
.scroll-x { overflow-x: auto; }

/* ── Keyboard hint ── */
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--n3); border: 1px solid var(--bd); border-radius: var(--r-xs);
  font-family: var(--font-mono); font-size: .7rem; font-weight: 600;
  padding: .12rem .4rem; color: var(--tx-m); min-width: 22px;
}

/* ── Footer ── */
.page-foot {
  margin-top: auto; padding: var(--sp-6) 2.75rem;
  background: var(--n0); border-top: 1px solid var(--bd);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--sp-4);
  font-size: var(--text-sm); color: var(--tx-d);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .top-nav { padding: 1rem 1.25rem; min-height: 60px; }
  .page-foot { flex-direction: column; align-items: flex-start; padding: var(--sp-5) 1.25rem; }
  .btn-lg { font-size: var(--text-sm); padding: .75rem var(--sp-6); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
