/* ============================================================
   EduMatch — Design System & Global Styles
   Based on assistant.html theme and design language
   ============================================================ */

:root {
  --bg: #f8f9fb;
  --bg-soft: #f1f2f6;
  --bg-soft-2: #e5e7ef;
  --panel-bg: #ffffff;
  --text: #1c1c1e;
  --text-2: #5c5c62;
  --muted: #8e8e93;
  --line: #e9e9ee;
  --line-2: #dcdce2;

  --accent: #fc3f1d;
  --accent-hover: #e5330f;
  --accent-soft: rgba(252, 63, 29, 0.08);
  --accent-glow: rgba(252, 63, 29, 0.22);

  --good: #0f9d58;
  --good-soft: rgba(15, 157, 88, 0.12);
  --warn: #f4a300;
  --warn-soft: rgba(244, 163, 0, 0.12);
  --bad: #e5352b;
  --bad-soft: rgba(229, 53, 43, 0.12);

  --r-xl: 28px;
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 12px;
  --r-pill: 999px;

  --sh-sm: 0 1px 2px rgba(0,0,0,.03), 0 2px 8px rgba(0,0,0,.04);
  --sh-md: 0 4px 12px rgba(0,0,0,.05), 0 12px 32px rgba(0,0,0,.05);
  --sh-lg: 0 8px 24px rgba(0,0,0,.07), 0 24px 64px rgba(0,0,0,.07);

  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  --container-max: 1200px;
}

[data-theme="dark"] {
  --bg: #121214;
  --bg-soft: #1c1c1f;
  --bg-soft-2: #26262b;
  --panel-bg: #1c1c1f;
  --text: #f5f5f7;
  --text-2: #a1a1a8;
  --muted: #6e6e73;
  --line: #2c2c31;
  --line-2: #3a3a40;

  --accent: #ff5c3d;
  --accent-hover: #ff7a61;
  --accent-soft: rgba(255, 92, 61, 0.12);
  --accent-glow: rgba(255, 92, 61, 0.28);

  --good: #34c759;
  --good-soft: rgba(52, 199, 89, 0.16);
  --warn: #ff9f0a;
  --warn-soft: rgba(255, 159, 10, 0.16);
  --bad: #ff453a;
  --bad-soft: rgba(255, 69, 58, 0.16);

  --sh-sm: 0 1px 2px rgba(0,0,0,.2), 0 2px 8px rgba(0,0,0,.2);
  --sh-md: 0 4px 12px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.3);
  --sh-lg: 0 8px 24px rgba(0,0,0,.4), 0 24px 64px rgba(0,0,0,.4);
}

/* ============================================================
   RESET & BASE TYPOGRAPHY
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color .3s ease, color .3s ease;
}

::selection {
  background: var(--accent);
  color: #ffffff;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img, svg {
  vertical-align: middle;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* ============================================================
   HEADER & NAVBAR
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
  transition: background-color .3s ease, border-color .3s ease;
}

[data-theme="dark"] .header {
  background: rgba(18, 18, 20, 0.85);
}

.header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 13px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), #ff7a45);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 4px 12px var(--accent-glow);
  flex-shrink: 0;
  transition: transform .2s ease;
}

.logo:hover .logo-mark {
  transform: scale(1.05) rotate(-3deg);
}

.logo-mark svg {
  width: 20px;
  height: 20px;
}

.logo-text {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.logo-text span {
  color: var(--accent);
}

/* Nav links */
.main-nav ul {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.main-nav a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.main-nav a:hover {
  color: var(--text);
  background: var(--bg-soft);
}

.main-nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: background .3s ease, color .3s ease;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
  transition: background .2s, box-shadow .2s;
}

.dot.ok {
  background: var(--good);
  box-shadow: 0 0 0 3px var(--good-soft);
}

.version-pill {
  padding: 7px 13px;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}

.theme-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .2s, color .2s, transform .2s, border-color .2s;
  flex-shrink: 0;
}

.theme-btn:hover {
  background: var(--bg-soft-2);
  color: var(--text);
  transform: scale(1.05);
}

.theme-btn svg {
  width: 18px;
  height: 18px;
}

.theme-btn .icon-sun { display: none; }
.theme-btn .icon-moon { display: block; }
[data-theme="dark"] .theme-btn .icon-sun { display: block; }
[data-theme="dark"] .theme-btn .icon-moon { display: none; }

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  place-items: center;
}

.mobile-menu-btn svg {
  width: 20px;
  height: 20px;
}

/* Mobile Nav Drawer */
.mobile-nav-drawer {
  display: none;
  position: fixed;
  top: 65px;
  left: 0;
  right: 0;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--line);
  padding: 16px 24px 24px;
  box-shadow: var(--sh-lg);
  z-index: 999;
}

.mobile-nav-drawer.open {
  display: block;
}

.mobile-nav-drawer ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-nav-drawer a {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-weight: 600;
  color: var(--text-2);
}

.mobile-nav-drawer a.active,
.mobile-nav-drawer a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

/* ============================================================
   HERO SECTIONS
   ============================================================ */
.hero {
  position: relative;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg) 60%, var(--bg-soft) 100%);
  padding: 68px 0 88px;
  overflow: hidden;
  transition: background .3s ease;
}

.hero::before {
  content: "";
  position: absolute;
  top: -160px;
  right: -120px;
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, var(--accent-soft), transparent 68%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: -180px;
  left: -160px;
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, rgba(120, 140, 255, 0.10), transparent 70%);
  pointer-events: none;
  z-index: 1;
}

.hero-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  background: linear-gradient(180deg, transparent 0%, var(--bg) 70%, var(--bg) 100%);
  pointer-events: none;
  z-index: 2;
}

.hero-inner {
  position: relative;
  z-index: 3;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 11px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 22px;
}

.hero-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-title {
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--text);
  margin-bottom: 20px;
  max-width: 820px;
}

.hero-title .accent {
  color: var(--accent);
  background: linear-gradient(135deg, var(--accent), #ff7a45);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-2);
  max-width: 680px;
  margin-bottom: 28px;
}

.hero-sub strong {
  color: var(--text);
  font-weight: 700;
}

.hero-buttons {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.fact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--panel-bg);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  transition: var(--transition);
  box-shadow: var(--sh-sm);
}

.fact svg {
  width: 15px;
  height: 15px;
  color: var(--accent);
  flex-shrink: 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--r-pill);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  border: none;
  outline: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(252, 63, 29, 0.35);
  color: #ffffff;
}

.btn-secondary {
  background: var(--panel-bg);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: var(--sh-sm);
}

.btn-secondary:hover {
  background: var(--bg-soft);
  border-color: var(--line-2);
  transform: translateY(-2px);
  color: var(--text);
}

.btn-outline {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--line);
}

.btn-outline:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: var(--r-pill);
}

.btn svg {
  width: 16px;
  height: 16px;
  transition: transform .2s ease;
}

.btn:hover svg {
  transform: translateX(3px);
}

/* ============================================================
   PANELS & CARDS
   ============================================================ */
.panel {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--sh-md);
  transition: var(--transition);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.panel-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.panel-step {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 11px;
  border-radius: var(--r-pill);
}

/* Feature cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 64px;
}

.card {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-shadow: var(--sh-sm);
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: rgba(252, 63, 29, 0.35);
  transform: translateY(-6px);
  box-shadow: var(--sh-lg);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 22px;
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

.card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: var(--text);
}

.card p {
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 24px;
  flex: 1;
}

.card-link {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  transition: var(--transition);
}

.card-link svg {
  width: 16px;
  height: 16px;
  transition: transform .2s ease;
}

.card:hover .card-link svg {
  transform: translateX(4px);
}

/* ============================================================
   PROGRAM CARDS
   ============================================================ */
.program-card {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 22px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  box-shadow: var(--sh-sm);
  cursor: pointer;
  position: relative;
}

.program-card:hover {
  border-color: rgba(252, 63, 29, 0.4);
  transform: translateY(-4px);
  box-shadow: var(--sh-md);
}

.program-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.program-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1.2;
}

.badge-code {
  background: var(--bg-soft);
  color: var(--text-2);
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.badge-uni {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.badge-city {
  background: var(--bg-soft);
  color: var(--text-2);
}

.badge-direction {
  background: var(--bg-soft-2);
  color: var(--text-2);
}

.badge-match-high {
  background: var(--good-soft);
  color: var(--good);
  font-weight: 700;
}

.badge-match-mid {
  background: var(--warn-soft);
  color: var(--warn);
  font-weight: 700;
}

.badge-match-low {
  background: var(--bad-soft);
  color: var(--bad);
  font-weight: 700;
}

.program-title {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.35;
}

.program-profile {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.4;
}

.program-desc {
  color: var(--text-2);
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.program-ege-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.ege-tag {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--text-2);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ege-tag.required {
  border-color: rgba(252, 63, 29, 0.25);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.program-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}

.program-stats {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.stat-value {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
}

.stat-value.highlight {
  color: var(--accent);
}

.fav-btn {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.fav-btn:hover {
  color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.1);
}

.fav-btn.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.fav-btn svg {
  width: 17px;
  height: 17px;
}

/* ============================================================
   FORMS, INPUTS & PRESETS
   ============================================================ */
.field {
  margin-bottom: 20px;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.field-label .num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-soft);
  border: 1.5px solid transparent;
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: var(--transition);
}

input[type="text"]:hover,
input[type="number"]:hover,
select:hover,
textarea:hover {
  background-color: var(--bg-soft-2);
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  background-color: var(--panel-bg);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  font-weight: 400;
}

select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

select::-ms-expand {
  display: none;
}

[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23a1a1a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
}

select option {
  background: var(--panel-bg);
  color: var(--text);
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset {
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  border: 1.5px solid transparent;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.preset:hover,
.preset.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(252, 63, 29, 0.3);
  transform: translateY(-1px);
}

/* ============================================================
   MODAL WINDOW
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 2000;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  max-width: 820px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 36px 32px;
  position: relative;
  box-shadow: var(--sh-lg);
  transform: translateY(20px) scale(0.98);
  transition: transform .25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-content::-webkit-scrollbar {
  width: 7px;
}

.modal-content::-webkit-scrollbar-track {
  background: var(--bg-soft);
  border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 4px;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--bg-soft-2);
  color: var(--text);
  transform: scale(1.05);
}

.modal-header {
  margin-bottom: 20px;
  padding-right: 40px;
}

.modal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.modal-title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 6px;
}

.modal-profile {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
}

.modal-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  background: var(--bg-soft);
  padding: 16px 20px;
  border-radius: var(--r-md);
  margin-bottom: 24px;
}

.modal-stat {
  display: flex;
  flex-direction: column;
}

.modal-stat-label {
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.modal-stat-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.modal-section {
  margin-bottom: 22px;
}

.modal-section h3 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 10px;
}

.modal-desc {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-2);
}

.modal-ege-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ege-group-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ege-group-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  min-width: 140px;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  box-shadow: var(--sh-lg);
  border-radius: var(--r-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  pointer-events: auto;
  animation: toastIn .25s ease forwards;
  max-width: 360px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  margin-top: auto;
  transition: background-color .3s ease, border-color .3s ease;
}

.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 40px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-desc {
  font-size: 13px;
  color: var(--muted);
  max-width: 380px;
}

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
  font-size: 13.5px;
}

.footer-links a {
  color: var(--text-2);
  transition: color .15s;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 16px 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 12px;
}

/* ============================================================
   GLOBAL OVERFLOW FIX (mobile header)
   ============================================================ */
html {
  overflow-x: hidden;
  max-width: 100vw;
}
body {
  overflow-x: hidden;
  max-width: 100vw;
}
.header {
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
}
.header-inner {
  width: 100%;
  max-width: var(--container-max);
  box-sizing: border-box;
  min-width: 0;
}
.header-right {
  min-width: 0;
}
.logo {
  min-width: 0;
  overflow: hidden;
}
.logo-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .header-inner {
    padding: 12px 16px;
    gap: 12px;
  }
}

@media (max-width: 768px) {
  .main-nav {
    display: none;
  }
  .mobile-menu-btn {
    display: grid;
  }
  .version-pill {
    display: none;
  }
  .status-pill {
    padding: 6px 10px;
    font-size: 12px;
    max-width: 140px;
  }
  .status-pill #statusText {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .header-right {
    gap: 8px;
    flex-shrink: 1;
  }
  .logo-text {
    font-size: 17px;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    padding: 44px 0 64px;
  }
  .hero-inner {
    padding: 0 16px;
    max-width: 100%;
    box-sizing: border-box;
  }
  .hero-title {
    font-size: 30px;
    word-break: break-word;
  }
  .container {
    padding: 0 16px;
  }
  .modal-content {
    padding: 24px 18px;
  }
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .status-pill {
    display: none;
  }
  .header-inner {
    padding: 10px 12px;
    gap: 8px;
  }
  .logo {
    gap: 8px;
  }
  .logo-mark {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }
  .logo-mark svg {
    width: 18px;
    height: 18px;
  }
  .logo-text {
    font-size: 16px;
  }
  .theme-btn,
  .mobile-menu-btn {
    width: 36px;
    height: 36px;
  }
  .hero-title {
    font-size: 26px;
  }
  .hero-sub {
    font-size: 15px;
  }
  .container {
    padding: 0 12px;
  }
}
