/* Page-specific styles: dashboard, subjects, upload, bank, progress, settings */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2 > .field + .field { margin-top: 0; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mini-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; min-height: 180px; color: var(--text-3); }
.mini-empty svg { width: 28px; height: 28px; opacity: 0.7; }
.mini-empty p { max-width: 32ch; font-size: var(--fs-sm); }
.chart-box { position: relative; height: 220px; }
.chart-box.tall { height: 300px; }

/* ---------- dashboard ---------- */
.resume-strip { display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 16px; margin-bottom: 18px; border-color: color-mix(in srgb, var(--gold) 35%, transparent); }
.rs-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-text); flex: none; }
.rs-icon svg { width: 17px; height: 17px; }
.rs-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.dash-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: clamp(20px, 4vw, 56px);
  padding: clamp(24px, 4vw, 44px); overflow: hidden;
}
.dash-hero::before {
  content: ''; position: absolute; right: -80px; top: -120px; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 181, 68, 0.22), transparent 65%); pointer-events: none;
}
.dh-greet { color: var(--gold-text); font-weight: 600; font-size: var(--fs-sm); margin-bottom: 10px; }
.dh-title { font-size: clamp(2.3rem, 5vw, 3.6rem); line-height: 1.02; letter-spacing: -0.02em; max-width: 15ch; }
.dh-sub { color: var(--text-2); margin: 14px 0 24px; max-width: 52ch; font-size: 1.04rem; }
.dh-ring { position: relative; }
.hero-ring-label { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.hr-num { font-size: 3rem; }
.hr-of { font-size: var(--fs-xs); color: var(--text-3); margin-top: 6px; }

.stat-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 16px;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); backdrop-filter: blur(12px);
}
.stat { display: flex; align-items: center; gap: 13px; padding: 16px 18px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); flex: none; }
.stat-ic svg { width: 18px; height: 18px; }
.stat.is-hot .stat-ic { background: var(--gold-soft); color: var(--gold-text); }
.stat-val { font-family: var(--font-display); font-size: 1.6rem; line-height: 1.05; }
.stat-label { font-size: var(--fs-xs); color: var(--text-3); font-weight: 500; }

.dash-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; }
.dash-grid.even { grid-template-columns: 1fr 1fr; align-items: start; }
.dash-chart { display: flex; flex-direction: column; }
.dash-chart .chart-box { flex: 1; min-height: 220px; }
.dash-grid .section-head h2 { font-size: 1.3rem; }
.topic-list { display: flex; flex-direction: column; gap: 14px; }
.topic-row .tr-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.topic-row .tr-name { font-weight: 600; font-size: 0.93rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-row .tr-meta { margin-top: 5px; }

.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.subject-card {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 16px;
  border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface);
  color: var(--text); text-decoration: none; overflow: hidden; backdrop-filter: blur(12px);
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}
.subject-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--sc, var(--gold)); opacity: 0.9;
}
@media (hover: hover) { .subject-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--sc, var(--gold)) 40%, transparent); box-shadow: 0 18px 40px -22px color-mix(in srgb, var(--sc, var(--gold)) 70%, transparent); } }
.sc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.sc-icon { width: 44px; height: 44px; display: grid; place-items: center; font-size: 1.35rem; border-radius: 13px; background: color-mix(in srgb, var(--sc, var(--gold)) 16%, transparent); }
.sc-name { font-family: var(--font-display); font-size: 1.3rem; line-height: 1.15; }
.sc-meta { color: var(--text-3); font-size: var(--fs-sm); margin-bottom: 10px; }
.subject-card .bar { margin-top: auto; }
.subject-card.add {
  align-items: center; justify-content: center; min-height: 170px; gap: 10px;
  border-style: dashed; border-color: var(--line-strong); background: transparent; color: var(--text-2); font-weight: 600;
}
.subject-card.add::before { display: none; }
.subject-card.add:hover { color: var(--text); border-color: var(--gold); }
.add-ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-text); }

.welcome { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(24px, 4vw, 56px); padding: clamp(26px, 5vw, 56px); overflow: hidden; }
.welcome::before {
  content: ''; position: absolute; left: -120px; bottom: -160px; width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 181, 68, 0.2), transparent 65%); pointer-events: none;
}
.welcome-title { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.04; letter-spacing: -0.02em; }
.steps { display: flex; flex-direction: column; gap: 6px; align-self: center; position: relative; }
.step { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: start; padding: 14px 6px; }
.step + .step { border-top: 1px solid var(--line); }
.step-n {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; font-size: 1.35rem;
  color: var(--gold-text); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); background: var(--gold-soft);
}
.step h3 { font-size: 1.02rem; font-weight: 700; margin-bottom: 2px; }

/* ---------- subject detail ---------- */
.subject-hero { padding: 22px clamp(20px, 3vw, 30px) 26px; overflow: hidden; }
.subject-hero::after {
  content: ''; position: absolute; right: -60px; top: -100px; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--sc) 30%, transparent), transparent 65%); pointer-events: none;
}
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); text-decoration: none; font-size: var(--fs-sm); font-weight: 600; margin-bottom: 14px; }
.back-link svg { width: 16px; height: 16px; }
.back-link:hover { color: var(--text); }
.sh-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; position: relative; z-index: 1; }
.sh-icon { width: 68px; height: 68px; border-radius: 20px; display: grid; place-items: center; font-size: 2rem; background: color-mix(in srgb, var(--sc) 18%, transparent); border: 1px solid color-mix(in srgb, var(--sc) 35%, transparent); flex: none; }
.sh-text { flex: 1; min-width: 200px; }
.sh-text h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.sh-actions { display: flex; gap: 8px; align-items: center; }
.dz-more { margin-top: 10px; font-size: var(--fs-sm); text-align: center; }
.dz-more a { color: var(--text-2); }

.lecture-list { display: flex; flex-direction: column; gap: 10px; }
.lecture-row { display: flex; align-items: center; gap: 16px; padding: 14px 16px; }
.lecture-row.is-error { border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.lr-main { flex: 1; min-width: 0; }
.lr-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lr-title h3 { font-size: 1rem; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.lr-meta { margin-top: 2px; }
.lecture-row .bar { margin-top: 10px; max-width: 420px; }
.lr-actions { display: flex; align-items: center; gap: 4px; }
.file-tile {
  width: 44px; height: 52px; flex: none; display: grid; place-items: end center; padding-bottom: 8px;
  border-radius: 8px 14px 8px 8px; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.04em;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line-strong);
  position: relative;
}
.file-tile::before { content: ''; position: absolute; top: 9px; left: 9px; right: 13px; height: 2px; border-radius: 2px; background: currentColor; opacity: 0.35; box-shadow: 0 6px 0 currentColor, 0 12px 0 currentColor; }
.ft-pdf { color: #f4645c; }
.ft-docx { color: #6f9bff; }
.ft-pptx { color: #f08a4b; }
.ft-txt, .ft-md, .ft-paste { color: var(--text-2); }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; transform: scale(0.7); } }

/* ---------- dropzone ---------- */
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center;
  min-height: 300px; padding: 30px 22px; cursor: pointer;
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg);
  background:
    radial-gradient(400px 200px at 50% 0%, var(--gold-soft), transparent 70%),
    color-mix(in srgb, var(--surface-solid) 40%, transparent);
  transition: border-color 0.25s, background 0.25s, transform 0.25s var(--ease);
}
.dropzone:hover { border-color: color-mix(in srgb, var(--gold) 60%, transparent); }
.dropzone.over { border-color: var(--gold); border-style: solid; transform: scale(1.01); background: radial-gradient(500px 260px at 50% 30%, rgba(242, 181, 68, 0.22), transparent 70%), var(--surface); }
.dropzone.compact { min-height: 0; flex-direction: row; justify-content: flex-start; text-align: left; padding: 18px 22px; gap: 22px; }
.dz-art { position: relative; width: 156px; height: 96px; flex: none; }
.compact .dz-art { width: 112px; height: 64px; }
.dz-sheet {
  position: absolute; bottom: 0; width: 56px; height: 70px; border-radius: 6px 14px 6px 6px;
  display: grid; place-items: end center; padding-bottom: 8px; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.05em;
  background: var(--surface-solid); border: 1px solid var(--line-strong); box-shadow: var(--shadow-1);
  transition: transform 0.35s var(--ease-spring);
}
.compact .dz-sheet { width: 40px; height: 50px; font-size: 0.5rem; }
.dz-sheet.s1 { left: 0; transform: rotate(-12deg); color: #f4645c; }
.dz-sheet.s2 { left: 50px; z-index: 1; color: #6f9bff; bottom: 8px; }
.dz-sheet.s3 { right: 0; transform: rotate(12deg); color: #f08a4b; }
.compact .dz-sheet.s2 { left: 36px; }
.dz-up {
  position: absolute; z-index: 2; left: 50%; top: -14px; transform: translateX(-50%);
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--gold-hi), var(--gold) 60%, var(--ember)); color: var(--on-gold);
  box-shadow: 0 8px 20px -6px rgba(242, 160, 50, 0.8);
}
.dz-up svg { width: 20px; height: 20px; }
.compact .dz-up { width: 30px; height: 30px; top: -12px; }
.compact .dz-up svg { width: 16px; height: 16px; }
.dropzone:hover .s1, .dropzone.over .s1 { transform: rotate(-18deg) translate(-6px, -4px); }
.dropzone:hover .s3, .dropzone.over .s3 { transform: rotate(18deg) translate(6px, -4px); }
.dropzone:hover .s2, .dropzone.over .s2 { transform: translateY(-6px); }
.dz-text { display: flex; flex-direction: column; gap: 4px; max-width: 46ch; }
.dz-text strong { font-family: var(--font-display); font-weight: 400; font-size: 1.45rem; }
.compact .dz-text strong { font-size: 1.15rem; }
.dz-text span { color: var(--text-2); font-size: var(--fs-sm); }

/* ---------- upload ---------- */
.upload-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.upload-opts { position: sticky; top: 24px; }
.upload-opts .field + .field { margin-top: 22px; }
.src-pane { display: flex; flex-direction: column; gap: 14px; }
.paste-area { min-height: 300px; }
.file-queue { display: flex; flex-direction: column; gap: 8px; }
.fq-item { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); animation: modal-in 0.3s var(--ease) both; }
.fq-item .file-tile { width: 34px; height: 40px; font-size: 0.5rem; padding-bottom: 5px; }
.fq-item .file-tile::before { top: 7px; left: 7px; right: 10px; box-shadow: 0 5px 0 currentColor; }
.fq-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fq-main strong { font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-new { border-style: dashed; }
.chip-new svg { width: 15px; height: 15px; }
.inline-subject { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; padding: 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); animation: modal-in 0.25s var(--ease) both; }
.emoji-grid.compact { grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); }
.emoji-grid.compact button { height: 36px; font-size: 1.05rem; }
.submit-wrap { margin-top: 26px; display: flex; flex-direction: column; gap: 8px; }
.submit-btn { width: 100%; }
.submit-note { text-align: center; }

.gen-wrap { max-width: 760px; margin: 0 auto; }
.gen-head { text-align: center; margin-bottom: 24px; }
.gen-head h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: 6px; }
.gen-list { display: flex; flex-direction: column; gap: 12px; }
.gen-card { display: flex; align-items: center; gap: 20px; padding: 18px 22px; }
.gen-card .ring .fill { transition: stroke-dashoffset 1.2s var(--ease); }
.gen-card:not(.is-done):not(.is-error) .ring svg { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { filter: drop-shadow(0 0 10px rgba(242, 181, 68, 0.55)); } }
.gc-pct { font-weight: 700; font-size: 0.88rem; }
.gc-main { flex: 1; min-width: 0; }
.gc-main h3 { font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.gc-phase { color: var(--text-2); font-size: var(--fs-sm); margin: 2px 0 10px; }
.gen-card.is-done .gc-phase { color: var(--ok); font-weight: 600; }
.gen-card.is-error { border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.gen-card.is-error .gc-phase { color: var(--bad); }
.gc-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.gc-steps li { font-size: 0.72rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; color: var(--text-3); background: var(--surface-2); }
.gc-steps li.done { color: var(--ok); background: var(--ok-soft); }
.gc-steps li.now { color: var(--gold-text); background: var(--gold-soft); }
.gen-cta { margin-top: 22px; text-align: center; }
.gen-done { padding: 22px; border-radius: var(--r-xl); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); background: linear-gradient(180deg, var(--ok-soft), transparent); animation: modal-in 0.4s var(--ease-spring) both; }
.gd-text { margin-bottom: 14px; font-size: 1.05rem; }
.gen-done .btn-row { justify-content: center; }

/* ---------- bank ---------- */
.filters { display: grid; grid-template-columns: minmax(200px, 2fr) repeat(3, minmax(130px, 1fr)); gap: 10px; padding: 10px; border-radius: var(--r-lg); }
.bank-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 16px 2px 12px; min-height: 30px; }
.reveal-all { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.q-list, .review-list { display: flex; flex-direction: column; gap: 12px; }
.more-box { display: flex; justify-content: center; margin-top: 18px; }
.q-card, .rv-card { padding: 18px 20px 14px; }
.q-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.q-num {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px;
  font-size: 0.8rem; font-weight: 700; color: var(--text-2); background: var(--surface-2);
}
.q-tags { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
/* block (not flex) so the ellipsis works; never wider than the tag row on a phone */
.faint-badge { display: inline-block; line-height: 24px; max-width: min(220px, 100%); overflow: hidden; text-overflow: ellipsis; }
.q-tools { display: flex; gap: 2px; }
.q-text { font-size: 1.06rem; font-weight: 600; line-height: 1.5; margin-bottom: 12px; overflow-wrap: anywhere; }
.q-text.urdu { font-weight: 400; font-size: 1.15rem; }
.q-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.q-opt {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid transparent; font-size: 0.93rem; min-width: 0;
}
.q-opt .opt-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.opt-letter {
  width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 7px;
  font-size: 0.74rem; font-weight: 800; color: var(--text-3); border: 1px solid var(--line-strong);
}
.q-opt.is-correct { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.q-opt.is-correct .opt-letter { background: var(--ok); color: #04150d; border-color: transparent; }
.q-opt.is-wrong { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.q-opt.is-wrong .opt-letter { background: var(--bad); color: #1d0503; border-color: transparent; }
.opt-mark { display: inline-flex; align-items: center; gap: 3px; color: var(--ok); flex: none; }
.opt-mark svg { width: 17px; height: 17px; }
.opt-mark.bad { color: var(--bad); }
.opt-mark .times { font-size: 0.78rem; font-weight: 800; }
.q-explain { display: flex; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--steel-soft); color: var(--text); font-size: 0.92rem; }
.q-explain svg { width: 18px; height: 18px; color: var(--steel); flex: none; margin-top: 2px; }
.q-foot { display: flex; justify-content: flex-end; margin-top: 8px; }
.rv-card.has-mistake { border-left: 3px solid var(--bad); }

/* option editor */
.opt-edit { display: flex; flex-direction: column; gap: 8px; }
.opt-edit-row { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 10px; border-radius: 14px; border: 1px solid transparent; transition: background 0.2s, border-color 0.2s; }
.opt-edit-row input[type='radio'] { width: 18px; height: 18px; accent-color: var(--ok); flex: none; cursor: pointer; }
.opt-edit-row.is-correct { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.opt-edit-row.is-correct .opt-letter { background: var(--ok); color: #04150d; border-color: transparent; }
.subj-preview { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 18px; border-radius: 16px; background: var(--surface-2); }
.sp-icon { width: 46px; height: 46px; display: grid; place-items: center; font-size: 1.4rem; border-radius: 14px; border: 1px solid; }
.sp-name { font-family: var(--font-display); font-size: 1.3rem; }

/* ---------- progress ---------- */
.weak-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.weak-q { display: flex; gap: 14px; padding: 14px 16px; align-items: flex-start; }
.wq-rate { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 14px; flex: none; background: var(--bad-soft); color: var(--bad); line-height: 1.1; }
.wq-rate .num { font-family: var(--font-display); font-size: 1.4rem; }
.wq-main { min-width: 0; }
.wq-text { font-weight: 600; font-size: 0.94rem; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.td-date { white-space: nowrap; }
.td-subj { max-width: 280px; }
.td-go { width: 30px; color: var(--text-3); }
.td-go svg { width: 16px; height: 16px; }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.settings-side { display: flex; flex-direction: column; gap: 16px; }
.settings-card .sc-head { display: flex; gap: 14px; margin-bottom: 18px; }
.settings-card .sc-head h2 { font-family: var(--font-display); font-size: 1.45rem; margin-bottom: 2px; }
.settings-card .sc-ic { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 13px; background: var(--gold-soft); color: var(--gold-text); }
.settings-card .sc-ic svg { width: 20px; height: 20px; }
.key-status { margin-bottom: 16px; }
.key-status .badge { height: auto; padding: 5px 11px; white-space: normal; }
.key-wrap .input { padding-right: 46px; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.9rem; }
.test-result { display: flex; align-items: center; gap: 8px; min-height: 28px; margin-top: 12px; }
.test-result svg { width: 17px; height: 17px; flex: none; }
.test-result.ok { color: var(--ok); }
.test-result.bad { color: var(--bad); }
.howto { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.howto summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; color: var(--text-2); list-style: none; }
.howto summary::-webkit-details-marker { display: none; }
.howto summary svg { width: 17px; height: 17px; }
.howto[open] summary { color: var(--text); }
.howto-steps { list-style: decimal; padding-left: 22px; margin-top: 12px; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); font-size: 0.93rem; }
.howto-steps li::marker { color: var(--gold-text); font-weight: 700; }
.model-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.model-card {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'top top' 'name cost' 'blurb blurb';
  gap: 2px 12px; padding: 14px 16px; text-align: left; border-radius: 16px;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.25s;
}
.model-card:hover { border-color: var(--text-3); }
.model-card.on { border-color: var(--gold); background: linear-gradient(120deg, var(--gold-soft), transparent 70%), var(--surface-2); box-shadow: var(--glow-gold); }
.mc-top { grid-area: top; display: flex; justify-content: space-between; align-items: center; }
.mc-speed { font-size: var(--fs-xs); font-weight: 700; color: var(--gold-text); }
.mc-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); }
.model-card.on .mc-radio { border: 5px solid var(--gold); background: #fff; }
.mc-name { grid-area: name; font-family: var(--font-display); font-size: 1.3rem; }
.mc-blurb { grid-area: blurb; }
.mc-cost { grid-area: cost; align-self: center; text-align: right; white-space: nowrap; }
.mc-pkr { font-weight: 800; }

/* ---------- responsive ---------- */
.key-wrap .input { padding-left: 14px; }

@media (max-width: 1100px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .f-search { grid-column: 1 / -1; }
  .filters > select:last-child { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  .upload-grid, .settings-grid, .welcome { grid-template-columns: 1fr; }
  .upload-opts { position: static; }
}
@media (max-width: 760px) {
  .dash-hero { grid-template-columns: 1fr; }
  .dh-ring { justify-self: center; order: -1; }
  .dash-hero .ring { width: 140px !important; height: 140px !important; }
  .dash-hero .ring svg { width: 140px; height: 140px; }
  .hr-num { font-size: 2.4rem; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .dash-grid, .dash-grid.even { grid-template-columns: 1fr; }
  .q-opts { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .weak-list { grid-template-columns: 1fr; }
  .dropzone.compact { flex-direction: column; text-align: center; }
  .lecture-row { flex-wrap: wrap; gap: 12px; }
  .lr-main { flex-basis: calc(100% - 60px); }
  .lr-actions { margin-left: 56px; }
}
@media (max-width: 480px) {
  .stat { padding: 12px; gap: 10px; }
  .stat-ic { display: none; }
  .stat-val { font-size: 1.35rem; }
  .dh-title { font-size: 2.1rem; }
  .btn-row > .btn-lg { flex: 1 1 auto; }
  .gen-card { flex-direction: column; text-align: center; }
  .gc-steps { justify-content: center; }
  .sh-actions { width: 100%; }
  .sh-actions > .btn { flex: 1; }
  .table td, .table th { padding: 11px 10px; }
}
