/* ═══════════════════════════════════════════════════════════════
   JEE Counsellor — Predictor Styles v3 (Premium Redesign)
   Semantic Color System · Card Detail Modal · Enhanced Filters
   ═══════════════════════════════════════════════════════════════ */

/* ╔════════════════════════════════════════════╗
   ║   SEMANTIC COLOR SYSTEM                    ║
   ║                                            ║
   ║  🟢 Emerald  #22c55e  Safe ≥75%           ║
   ║  🔵 Blue     #3b82f6  Good 55–74%         ║
   ║  🟡 Amber    #f59e0b  Moderate 40–54%     ║
   ║  🟠 Orange   #f97316  Tough 20–39%        ║
   ║  🔴 Rose     #ef4444  Reach <20%          ║
   ║  🟣 Violet   #8b5cf6  Algorithm/Algo UI   ║
   ║  🩵 Sky      #0ea5e9  Trend/Fresh data    ║
   ╚════════════════════════════════════════════╝ */

:root {
  --c-em: #22c55e; --c-em-bg: rgba(34,197,94,0.08); --c-em-bd: rgba(34,197,94,0.22);
  --c-bl: #3b82f6; --c-bl-bg: rgba(59,130,246,0.08); --c-bl-bd: rgba(59,130,246,0.22);
  --c-am: #f59e0b; --c-am-bg: rgba(245,158,11,0.08); --c-am-bd: rgba(245,158,11,0.22);
  --c-or: #f97316; --c-or-bg: rgba(249,115,22,0.08); --c-or-bd: rgba(249,115,22,0.22);
  --c-ro: #ef4444; --c-ro-bg: rgba(239,68,68,0.08);  --c-ro-bd: rgba(239,68,68,0.22);
  --c-vi: #8b5cf6; --c-vi-bg: rgba(139,92,246,0.08); --c-vi-bd: rgba(139,92,246,0.22);
  --c-sk: #0ea5e9; --c-sk-bg: rgba(14,165,233,0.08); --c-sk-bd: rgba(14,165,233,0.22);
}

/* ── Hero ── */
.predict-hero {
  position: relative;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  padding: 3.5rem 5% 3rem;
  text-align: center;
  overflow: hidden;
}
.predict-hero-inner { position: relative; z-index: 2; max-width: 700px; margin: 0 auto; }
.predict-hero h1 { font-size: 2.4rem; font-weight: 900; color: #fff; margin: 0.5rem 0; letter-spacing: -0.03em; line-height: 1.15; }
.hero-grad { background: linear-gradient(135deg, #38bdf8, #818cf8, #c084fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.predict-hero p { color: #94a3b8; font-size: 1rem; max-width: 550px; margin: 0.6rem auto 0; line-height: 1.5; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(56, 189, 248, 0.12); border: 1px solid rgba(56, 189, 248, 0.25); color: #38bdf8; font-size: 0.78rem; font-weight: 700; padding: 0.35rem 0.9rem; border-radius: 100px; text-transform: uppercase; letter-spacing: 0.04em; }
.hero-glow { position: absolute; top: -50%; left: 50%; transform: translateX(-50%); width: 600px; height: 600px; background: radial-gradient(circle, rgba(56,189,248,0.12), transparent 60%); pointer-events: none; z-index: 1; }

.hero-data-stats { display: flex; gap: 2rem; justify-content: center; margin-top: 1.25rem; }
.hero-stat { text-align: center; }
.hero-stat-val { font-size: 1.3rem; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; }
.hero-stat-label { font-size: 0.7rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
@media(max-width:600px) {
  .predict-hero h1 { font-size: 1.6rem; }
  .predict-hero { padding: 2rem 5% 1.5rem; }
  .hero-data-stats { gap: 1rem; }
  .hero-stat-val { font-size: 1rem; }
}

/* ── Exam Gate Overlay ── */
.exam-gate {
  position: fixed; inset: 0;
  background: rgba(10, 14, 26, 0.82); backdrop-filter: blur(8px);
  z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem;
  animation: fadeIn .25s ease;
}
.exam-gate.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.exam-gate-card {
  background: var(--white); border-radius: 1.5rem; padding: 2.5rem 2rem; max-width: 520px; width: 100%;
  text-align: center; box-shadow: 0 24px 80px rgba(0,0,0,.3); animation: slideUp .35s cubic-bezier(.4,0,.2,1);
}
@keyframes slideUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.exam-gate-icon { font-size: 3rem; margin-bottom: .75rem; }
.exam-gate-title { font-size: 1.5rem; font-weight: 800; color: var(--gray-900); margin-bottom: .4rem; }
.exam-gate-sub { font-size: .9rem; color: var(--text-muted); margin-bottom: 1.75rem; max-width: 340px; margin-left: auto; margin-right: auto; }
.exam-gate-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 440px) { .exam-gate-choices { grid-template-columns: 1fr; } }
.exam-choice-btn {
  display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 1.5rem 1rem;
  border: 2px solid var(--border); border-radius: 1rem; background: var(--white); cursor: pointer;
  transition: all .18s; font-family: var(--font-sans);
}
.exam-choice-btn:hover { border-color: var(--blue-500); background: var(--blue-50); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(37,99,235,.12); }
.exam-choice-emoji { font-size: 2rem; }
.exam-choice-name { font-size: 1rem; font-weight: 800; color: var(--gray-900); }
.exam-choice-desc { font-size: .78rem; color: var(--text-muted); line-height: 1.5; }
.exam-gate-note { font-size: .75rem; color: var(--text-dim); }

/* ── Sidebar Exam Toggle ── */
.sidebar-exam-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: .35rem;
  margin-bottom: 1.25rem; background: var(--gray-100); padding: .25rem; border-radius: var(--r-lg);
}
.sidebar-exam-btn {
  padding: .5rem .4rem; font-size: .75rem; font-weight: 700; border: none;
  border-radius: calc(var(--r-lg) - 2px); background: transparent; color: var(--text-muted);
  cursor: pointer; transition: all .15s; font-family: var(--font-sans); white-space: nowrap;
}
.sidebar-exam-btn.active { background: var(--white); color: var(--blue-700); box-shadow: 0 1px 4px rgba(0,0,0,.12); }

/* ── Layout ── */
.predict-main { background: #f8fafc; min-height: 80vh; }
.predict-layout { display: grid; grid-template-columns: 300px 1fr; gap: 1.5rem; max-width: 1340px; margin: 0 auto; padding: 1.75rem 5%; }
@media(max-width:960px) { .predict-layout { grid-template-columns: 1fr; } }

/* ── Sidebar ── */
.sidebar-panel {
  position: sticky; top: calc(var(--nav-h, 64px) + 1rem); height: fit-content;
  background: #fff; border-radius: 16px; border: 1px solid #e2e8f0;
  box-shadow: 0 4px 24px rgba(0,0,0,0.04); padding: 1.5rem;
}
.panel-title { font-size: 1rem; font-weight: 800; color: #0f172a; margin-bottom: 1.25rem; padding-bottom: 0.65rem; border-bottom: 1px solid #f1f5f9; display: flex; align-items: center; gap: 8px; }
.panel-title i { color: #3b82f6; }
.sb-section-label {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 0.6rem; margin-top: 1.2rem;
  display: flex; align-items: center; gap: 0.4rem;
}
.sb-section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }
@media(max-width:960px) { .sidebar-panel { position: static; } }

/* Form elements */
.form-group { margin-bottom: 0.85rem; }
.form-label { font-size: 0.78rem; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.35rem; display: block; }
.filter-label { font-size: 0.78rem; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.5rem; display: block; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.input-wrap { position: relative; }
.input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 0.85rem; z-index: 1; }
.form-input {
  width: 100%; padding: 0.6rem 0.75rem 0.6rem 2.2rem;
  border: 1.5px solid #e2e8f0; border-radius: 10px; font-size: 0.9rem;
  font-family: 'Inter', var(--font-sans, sans-serif); outline: none;
  transition: all 0.2s; background: #f8fafc;
}
.form-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); background: #fff; }
.form-input.is-valid { border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.1); }
.form-select {
  width: 100%; padding: 0.55rem 0.75rem;
  border: 1.5px solid #e2e8f0; border-radius: 10px; font-size: 0.82rem;
  font-family: 'Inter', var(--font-sans, sans-serif); outline: none;
  background: #f8fafc; cursor: pointer; transition: all 0.2s;
}
.form-select:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }

/* Validation */
.valid-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #22c55e; opacity: 0; transition: all 0.2s; pointer-events: none; font-size: 1rem; }
.valid-icon.show { opacity: 1; transform: translateY(-50%) scale(1.15); }

/* Type checkboxes (hidden, kept for backward compat) */
.type-checks { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.type-checks label { display: flex; align-items: center; gap: 4px; font-size: 0.8rem; font-weight: 500; color: #334155; cursor: pointer; }
.type-checks input[type=checkbox] { accent-color: #3b82f6; width: 15px; height: 15px; }

.auto-predict-badge { background: linear-gradient(135deg, #dbeafe, #ede9fe); color: #3b82f6; padding: 0.6rem; border-radius: 10px; text-align: center; font-size: 0.82rem; font-weight: 700; margin-top: 1rem; border: 1px solid #bfdbfe; }
.auto-predict-badge i { margin-right: 4px; }
.sidebar-hint { text-align: center; font-size: 0.72rem; color: #94a3b8; margin-top: 0.35rem; }

/* ── Algorithm Explainer ── */
.algo-explainer {
  background: var(--c-vi-bg); border: 1px solid var(--c-vi-bd);
  border-radius: 12px; margin-top: 1rem; overflow: hidden;
}
.algo-explainer summary {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.73rem; font-weight: 600; color: var(--c-vi);
  cursor: pointer; list-style: none; user-select: none;
}
.algo-explainer summary::-webkit-details-marker { display: none; }
.algo-explainer summary .ae-arrow { margin-left: auto; transition: transform 0.2s; font-size: 0.65rem; opacity: 0.6; }
.algo-explainer[open] summary .ae-arrow { transform: rotate(180deg); }
.algo-explainer summary:hover { background: rgba(139,92,246,0.05); }
.ae-body { padding: 0.75rem; border-top: 1px solid var(--c-vi-bd); font-size: 0.76rem; color: var(--text-muted); line-height: 1.65; }
.ae-stage { display: flex; gap: 0.55rem; margin-bottom: 0.6rem; }
.ae-num {
  width: 20px; height: 20px; border-radius: 50%; background: var(--c-vi-bg);
  color: var(--c-vi); font-size: 0.68rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px;
  border: 1px solid var(--c-vi-bd);
}
.ae-stage-text strong { color: var(--gray-900); display: block; margin-bottom: 0.1rem; font-size: 0.74rem; }
.ae-example {
  background: #f8fafc; border: 1px solid var(--border);
  border-radius: 8px; padding: 0.6rem 0.75rem; margin-top: 0.6rem; font-size: 0.72rem;
}
.ae-example .ae-ex-title { color: var(--c-am); font-weight: 700; margin-bottom: 0.35rem; font-size: 0.71rem; text-transform: uppercase; letter-spacing: 0.05em; }
.ae-row { display: flex; justify-content: space-between; padding: 0.2rem 0; border-bottom: 1px solid var(--border); }
.ae-row:last-child { border-bottom: none; }
.ae-row .k { color: var(--text-muted); }
.ae-row .v { color: var(--c-vi); font-family: var(--font-mono); font-size: 0.71rem; font-weight: 600; }

/* ── Loading State ── */
.loading-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 5rem 1rem; gap: 1rem; }
.loading-spinner { width: 48px; height: 48px; border: 3px solid #e2e8f0; border-top-color: #3b82f6; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 1rem; font-weight: 700; color: #0f172a; }
.loading-sub { font-size: 0.82rem; color: #94a3b8; }

/* ── Empty State ── */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4rem 1.5rem; text-align: center; }
.empty-icon { font-size: 3.5rem; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.empty-state h3 { font-size: 1.4rem; font-weight: 800; color: #0f172a; margin: 0.8rem 0 0.3rem; }
.empty-state p { font-size: 0.95rem; color: #64748b; max-width: 420px; line-height: 1.5; }
.empty-stats { display: flex; gap: 2rem; margin-top: 1.5rem; }
.empty-stat { text-align: center; }
.empty-stat .num { display: block; font-size: 1.4rem; font-weight: 900; color: #3b82f6; }

/* ── Results Header ── */
.results-header-bar { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 1.25rem 1.5rem; margin-bottom: 1rem; box-shadow: 0 2px 12px rgba(0,0,0,0.03); }
.results-title { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.results-title h2 { font-size: 1.3rem; font-weight: 800; color: #0f172a; margin: 0; }
.results-count { background: #3b82f6; color: #fff; font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.65rem; border-radius: 100px; }
.results-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }
.rchip { font-size: 0.72rem; font-weight: 600; padding: 0.25rem 0.65rem; border-radius: 100px; cursor: pointer; transition: all 0.15s; border: 1px solid transparent; }
.rchip:hover { transform: scale(1.05); }
.rchip.active { box-shadow: 0 0 0 2px rgba(0,0,0,0.08); }
.rchip-safe  { background: #dcfce7; color: #166534; }
.rchip-safe.active  { border-color: #22c55e; }
.rchip-good  { background: #dbeafe; color: #1e40af; }
.rchip-good.active  { border-color: #3b82f6; }
.rchip-mod   { background: #fef3c3; color: #854d0e; }
.rchip-mod.active   { border-color: #f59e0b; }
.rchip-tough { background: #ffedd5; color: #9a3412; }
.rchip-tough.active { border-color: #f97316; }
.rchip-reach { background: #fee2e2; color: #991b1b; }
.rchip-reach.active { border-color: #ef4444; }

.results-meta { font-size: 0.82rem; color: #64748b; }
.results-meta strong { color: #0f172a; }

/* ── Results Controls (Filter Bar) ── */
.results-controls { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.search-box { position: relative; flex: 1; min-width: 200px; }
.search-box i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 0.85rem; }
.search-box input {
  width: 100%; padding: 0.55rem 0.75rem 0.55rem 2.4rem;
  border: 1.5px solid #e2e8f0; border-radius: 100px; font-size: 0.85rem; outline: none;
  transition: all 0.2s; background: #fff; font-family: 'Inter', var(--font-sans, sans-serif);
}
.search-box input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }

/* Filter type buttons */
.ftype-btns { display: flex; gap: 0.25rem; }
.ftbtn {
  padding: 0.35rem 0.65rem; background: #f8fafc; border: 1.5px solid #e2e8f0;
  border-radius: 8px; color: var(--text-muted); font-size: 0.75rem; font-weight: 700;
  cursor: pointer; transition: all 0.15s; white-space: nowrap; font-family: var(--font-sans);
}
.ftbtn:hover { border-color: #cbd5e1; color: var(--gray-900); }
.ftbtn.active { background: var(--c-vi-bg); border-color: var(--c-vi-bd); color: var(--c-vi); }

.filter-sep { width: 1px; height: 20px; background: #e2e8f0; flex-shrink: 0; }

.filter-sel {
  padding: 0.4rem 0.65rem; background: #fff; border: 1.5px solid #e2e8f0;
  border-radius: 8px; color: var(--text-muted); font-size: 0.76rem; outline: none;
  cursor: pointer; transition: all 0.15s; font-family: var(--font-sans);
}
.filter-sel:hover { border-color: #cbd5e1; }
.filter-sel option { background: #fff; }

.filter-count { margin-left: auto; font-size: 0.77rem; color: var(--text-muted); font-family: var(--font-mono); white-space: nowrap; }
.filter-count strong { color: var(--c-vi); }

.sort-select {
  padding: 0.4rem 0.9rem; border: 1.5px solid #e2e8f0; border-radius: 100px;
  font-size: 0.82rem; background: #fff; outline: none; cursor: pointer;
  font-family: 'Inter', var(--font-sans, sans-serif); transition: all 0.2s;
}
.sort-select:focus { border-color: #3b82f6; }
@media(max-width:600px) { .results-controls { flex-direction: column; } .search-box { width: 100%; min-width: 0; } .ftype-btns { width: 100%; overflow-x: auto; } }

/* ── Results Card Grid ── */
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem; }
@media(max-width:500px) { .results-grid { grid-template-columns: 1fr; } }

/* ── Result Card ── */
@keyframes cardIn {
  0% { opacity: 0; transform: translateY(20px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.result-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 16px;
  overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.03);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  animation: cardIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0; position: relative; cursor: pointer;
  border-left: 3px solid transparent;
}
.result-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
  border-color: #bfdbfe;
}

/* Tier-based left accent border */
.result-card.tier-safe  { border-left-color: #22c55e; }
.result-card.tier-good  { border-left-color: #3b82f6; }
.result-card.tier-mod   { border-left-color: #f59e0b; }
.result-card.tier-tough { border-left-color: #f97316; }
.result-card.tier-reach { border-left-color: #ef4444; }

.result-card.tier-safe:hover  { border-color: #22c55e; border-left-color: #22c55e; }
.result-card.tier-good:hover  { border-color: #3b82f6; border-left-color: #3b82f6; }
.result-card.tier-mod:hover   { border-color: #f59e0b; border-left-color: #f59e0b; }
.result-card.tier-tough:hover { border-color: #f97316; border-left-color: #f97316; }
.result-card.tier-reach:hover { border-color: #ef4444; border-left-color: #ef4444; }

.card-blurred { filter: blur(4px); pointer-events: none; user-select: none; }

.card-top { display: flex; align-items: flex-start; justify-content: space-between; padding: 1rem 1.25rem 0; }
.card-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.badge { font-size: 0.65rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.type-iit { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.type-nit { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.type-iiit { background: #ede9fe; color: #6d28d9; border: 1px solid #ddd6fe; }
.type-gfti { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.badge-nirf { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.badge-conf { font-size: 0.62rem; padding: 0.15rem 0.45rem; border-radius: 100px; }
.badge-conf-high { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.badge-conf-med  { background: #fef3c3; color: #854d0e; border: 1px solid #fde68a; }
.badge-conf-low  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* Stage badges */
.sbadge { font-size: 0.60rem; font-weight: 700; padding: 0.12rem 0.45rem; border-radius: 100px; letter-spacing: 0.03em; }
.sbadge-exact  { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.sbadge-buffer { background: #fef3c3; color: #854d0e; border: 1px solid #fde68a; }
.sbadge-proj   { background: #ede9fe; color: #6d28d9; border: 1px solid #ddd6fe; }

/* ── Circular Chance Meter ── */
.card-chance { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 58px; }
.chance-circle { width: 52px; height: 52px; position: relative; }
.chance-circle svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.circle-bg { fill: none; stroke: #f1f5f9; stroke-width: 3; }
.circle-fill { fill: none; stroke-width: 3; stroke-linecap: round; transition: stroke-dasharray 1.2s cubic-bezier(0.16, 1, 0.3, 1); }
.chance-safe .circle-fill     { stroke: #22c55e; }
.chance-good .circle-fill     { stroke: #3b82f6; }
.chance-moderate .circle-fill { stroke: #f59e0b; }
.chance-tough .circle-fill    { stroke: #f97316; }
.chance-reach .circle-fill    { stroke: #ef4444; }
.chance-num { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 0.78rem; font-weight: 800; color: #0f172a; }
.chance-text { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.chance-safe .chance-text     { color: #16a34a; }
.chance-good .chance-text     { color: #2563eb; }
.chance-moderate .chance-text { color: #d97706; }
.chance-tough .chance-text    { color: #ea580c; }
.chance-reach .chance-text    { color: #dc2626; }

/* ── Card Body ── */
.card-body { padding: 0.75rem 1.25rem; }
.card-college { font-size: 0.95rem; font-weight: 800; color: #0f172a; margin: 0 0 0.2rem; line-height: 1.25; }
.card-program { font-size: 0.78rem; color: #64748b; margin: 0 0 0.5rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Branch color chip */
.branch-chip {
  display: inline-flex; align-items: center; gap: 0.2rem;
  font-size: 0.68rem; font-weight: 700; padding: 0.15rem 0.5rem;
  border-radius: 6px; border: 1px solid; margin-bottom: 0.5rem;
}
.branch-cs   { background: #ede9fe; color: #7c3aed; border-color: #ddd6fe; }
.branch-ece  { background: #e0f2fe; color: #0284c7; border-color: #bae6fd; }
.branch-ee   { background: #fef3c3; color: #a16207; border-color: #fde68a; }
.branch-me   { background: #ffedd5; color: #c2410c; border-color: #fed7aa; }
.branch-civil{ background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.branch-chem { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.branch-other{ background: #f1f5f9; color: #475569; border-color: #e2e8f0; }

.card-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
.stat { background: #f8fafc; border-radius: 8px; padding: 0.45rem 0.6rem; display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: 0.62rem; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { font-size: 0.82rem; font-weight: 700; color: #0f172a; font-variant-numeric: tabular-nums; }

/* Trend badges */
.trend { font-size: 0.75rem; font-weight: 700; }
.trend-up { color: #0ea5e9; }
.trend-down { color: #ef4444; }
.trend-stable { color: #f59e0b; }
.trend-na { color: #cbd5e1; }

.card-extra { display: flex; gap: 0.75rem; margin-top: 0.5rem; font-size: 0.75rem; color: #64748b; }

/* ── Card Footer ── */
.card-footer { display: flex; align-items: center; justify-content: space-between; padding: 0.65rem 1.25rem; border-top: 1px solid #f1f5f9; margin-top: 0.5rem; }
.card-btn { font-size: 0.78rem; font-weight: 600; color: #3b82f6; text-decoration: none; transition: color 0.15s; }
.card-btn:hover { color: #1d4ed8; }
.card-actions { display: flex; gap: 0.4rem; }
.action-btn {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s; border: 1px solid #e2e8f0;
  background: #f8fafc; color: #94a3b8; font-size: 0.8rem;
}
.action-btn:hover { background: #eff6ff; color: #3b82f6; border-color: #bfdbfe; }
.action-btn.active-heart { background: #fef2f2; color: #ef4444; border-color: #fecaca; }
.action-btn.active-choice { background: #eff6ff; color: #3b82f6; border-color: #93c5fd; }

/* ── Round Trend Panel (Expandable) ── */
.round-trend-panel { padding: 1rem 1.25rem; border-top: 1px dashed #e2e8f0; background: #f8fafc; }
.round-trend-panel h4 { font-size: 0.82rem; font-weight: 700; color: #334155; margin: 0 0 0.75rem; }
.round-trend-panel h4 i { color: #3b82f6; margin-right: 4px; }
.trend-years { display: flex; gap: 1.5rem; }
.trend-year { flex: 1; }
.trend-year-label { font-size: 0.7rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.5rem; display: block; text-align: center; }
.trend-bars { display: flex; align-items: flex-end; gap: 4px; height: 70px; }
.trend-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; height: 100%; }
.trend-bar { width: 100%; max-width: 28px; border-radius: 4px 4px 0 0; min-height: 3px; transition: height 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
.bar-2025 { background: linear-gradient(to top, #3b82f6, #60a5fa); }
.bar-2024 { background: linear-gradient(to top, #94a3b8, #cbd5e1); }
.bar-empty { background: #f1f5f9; height: 3px !important; }
.trend-val { font-size: 0.6rem; color: #0f172a; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.trend-round { font-size: 0.6rem; color: #94a3b8; font-weight: 700; text-transform: uppercase; }
@media(max-width:500px) { .trend-years { flex-direction: column; gap: 1rem; } }

/* ══════════════════════════════════════════════
   CARD DETAIL MODAL
══════════════════════════════════════════════ */
.pred-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
  z-index: 9000; display: none; align-items: center; justify-content: center; padding: 1rem;
}
.pred-modal-overlay.open { display: flex; }

.pred-modal-box {
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 20px; width: 100%; max-width: 660px; max-height: 90vh;
  overflow-y: auto; position: relative;
  animation: modalSlideIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 25px 80px rgba(0,0,0,0.2);
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: scale(0.92) translateY(24px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.pm-header {
  padding: 1.3rem 1.5rem 1rem; border-bottom: 1px solid #f1f5f9;
  position: sticky; top: 0; background: #fff; z-index: 2;
  border-radius: 20px 20px 0 0;
}
.pm-close {
  position: absolute; top: 1rem; right: 1rem;
  background: #f8fafc; border: 1px solid #e2e8f0;
  color: var(--text-muted); width: 30px; height: 30px; border-radius: 50%;
  font-size: 0.85rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.pm-close:hover { background: #fee2e2; color: #ef4444; border-color: #fecaca; }

.pm-body { padding: 1.25rem 1.5rem; }

/* Prediction card in modal */
.pm-pred-card {
  background: linear-gradient(135deg, var(--c-vi-bg), rgba(139,92,246,0.02));
  border: 1px solid var(--c-vi-bd); border-radius: 14px;
  padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; position: relative; overflow: hidden;
}
.pm-pred-label {
  font-size: 0.67rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--c-vi);
  display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.6rem;
}
.pm-pred-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.pm-rank-big { font-size: 1.6rem; font-weight: 800; color: var(--c-vi); font-family: var(--font-mono); }
.pm-rank-vs { font-size: 0.82rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.4rem; }

/* Historical data section */
.pm-hist-label {
  font-size: 0.67rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--text-muted); margin-bottom: 0.7rem;
  display: flex; align-items: center; gap: 0.4rem;
}
.pm-hist-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.pm-year-block { margin-bottom: 1rem; }
.pm-year-title { display: flex; align-items: center; gap: 0.5rem; font-size: 0.73rem; font-weight: 700; color: var(--gray-900); margin-bottom: 0.45rem; }
.pm-year-pill {
  padding: 0.15rem 0.55rem; border-radius: 6px; font-size: 0.68rem; font-weight: 700;
  border: 1px solid;
}
.pm-year-latest { background: #e0f2fe; color: #0284c7; border-color: #bae6fd; }
.pm-year-prev   { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }

.pm-round-table { width: 100%; border-collapse: collapse; }
.pm-round-table th {
  font-size: 0.63rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-dim); padding: 0.3rem 0.5rem; text-align: left; border-bottom: 1px solid var(--border);
}
.pm-round-table td {
  font-size: 0.8rem; padding: 0.45rem 0.5rem; border-bottom: 1px solid #f8fafc; vertical-align: middle;
}
.pm-round-table tr:last-child td { border-bottom: none; }
.pm-round-table tr.final-row td { background: rgba(59,130,246,0.03); }
.pm-round-table tr:hover td { background: rgba(0,0,0,0.015); }

.pm-rnd-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 20px;
  background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe;
  border-radius: 5px; font-size: 0.68rem; font-weight: 700;
}
.pm-rnd-badge.final { background: #e0f2fe; color: #0284c7; border-color: #7dd3fc; }

.pm-rank-val { font-family: var(--font-mono); font-weight: 600; color: var(--gray-900); font-size: 0.8rem; }
.pm-rank-val.empty { color: var(--text-dim); }

/* YoY tags in modal */
.pm-yoy-tag {
  display: inline-flex; align-items: center; padding: 0.08rem 0.4rem;
  border-radius: 4px; font-size: 0.67rem; font-weight: 700; white-space: nowrap;
}
.pm-yoy-tag.opening    { background: #e0f2fe; color: #0284c7; }
.pm-yoy-tag.tightening { background: #fee2e2; color: #dc2626; }
.pm-yoy-tag.stable     { background: #fef3c3; color: #d97706; }
.pm-yoy-tag.final      { background: #e0f2fe; color: #0284c7; }

/* Modal actions */
.pm-actions {
  display: flex; gap: 0.65rem; padding: 0.85rem 1.5rem;
  border-top: 1px solid var(--border); background: #fff;
  position: sticky; bottom: 0; border-radius: 0 0 20px 20px;
}
.pm-btn {
  flex: 1; padding: 0.6rem 1rem; border-radius: 10px; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s; border: 1px solid var(--border); font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
}
.pm-btn-save { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.pm-btn-save:hover { background: #bbf7d0; }
.pm-btn-save.saved { background: #22c55e; color: #fff; border-color: #16a34a; }
.pm-btn-choice { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.pm-btn-choice:hover { background: #bfdbfe; }
.pm-btn-choice.added { background: #3b82f6; color: #fff; border-color: #2563eb; }
.pm-btn-close { background: #f8fafc; color: var(--text-muted); }
.pm-btn-close:hover { background: #f1f5f9; color: var(--gray-900); }

/* ── Premium Gate ── */
.premium-gate { margin-top: 1.5rem; text-align: center; }
.premium-gate-inner { background: linear-gradient(135deg, #0f172a, #1e293b); border-radius: 20px; padding: 2.5rem 2rem; color: #fff; }
.premium-gate-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.premium-gate-inner h3 { font-size: 1.3rem; font-weight: 800; margin: 0 0 0.3rem; }
.premium-gate-inner p { color: #94a3b8; font-size: 0.92rem; margin-bottom: 1rem; }
.btn-premium { display: inline-block; background: linear-gradient(135deg, #3b82f6, #8b5cf6); color: #fff; font-size: 0.92rem; font-weight: 700; padding: 0.7rem 2rem; border-radius: 100px; text-decoration: none; transition: all 0.2s; box-shadow: 0 4px 20px rgba(59,130,246,0.3); }
.btn-premium:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(59,130,246,0.4); }

/* ── Click hint on first card ── */
.click-hint {
  position: absolute; top: -8px; right: 12px; z-index: 3;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6); color: #fff;
  font-size: 0.68rem; font-weight: 700; padding: 0.25rem 0.7rem;
  border-radius: 100px; box-shadow: 0 4px 12px rgba(59,130,246,0.3);
  animation: clickHintFloat 2s ease-in-out infinite;
  display: flex; align-items: center; gap: 0.3rem;
}
@keyframes clickHintFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
