*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface2: #21262d;
  --accent: #e84393;
  --accent2: #7c3aed;
  --chalk: #f0ece4;
  --rope: #c8772a;
  --rock: #6b7280;
  --text: #e2e8f0;
  --text-muted: #8b949e;
  --success: #3fb950;
  --warning: #d29922;
  --radius: 12px;
  --shadow: 0 4px 32px rgba(0,0,0,0.5);
  --border: rgba(255,255,255,0.07);
  --grid-color: rgba(255,255,255,0.06);
  --tick-color: #8b949e;
}

:root.light {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface2: #eef0f3;
  --accent: #d6006e;
  --accent2: #6d28d9;
  --chalk: #6b5b45;
  --rope: #a85c10;
  --rock: #6b7280;
  --text: #1a1d27;
  --text-muted: #52596b;
  --success: #16a34a;
  --warning: #b45309;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.10);
  --border: rgba(0,0,0,0.09);
  --grid-color: rgba(0,0,0,0.06);
  --tick-color: #52596b;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(124,58,237,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(232,67,147,0.04) 0%, transparent 50%);
}

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.4);
}

header h1 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: .02em;
  display: flex;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.logo-link:hover { opacity: .85; }

.header-icon {
  width: 22px;
  height: 22px;
  stroke: var(--accent);
  color: var(--accent);
  flex-shrink: 0;
}

.header-actions { display: flex; gap: .75rem; align-items: center; }

.dashboard-tabs {
  display: flex;
  align-items: stretch;
  height: 100%;
  gap: 0;
}

.dash-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 600;
  padding: 0 1.25rem;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.dash-tab:hover { color: var(--text); opacity: 1; }
.dash-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.dash-panel { width: 100%; }

.app-manual-frame {
  width: 100%;
  height: calc(100vh - 61px);
  border: none;
  display: block;
}

button,
a.btn-primary, a.btn-secondary, a.btn-success {
  padding: .45rem 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  transition: opacity .15s;
  text-decoration: none;
  display: inline-block;
}
button:hover, a.btn-primary:hover, a.btn-secondary:hover, a.btn-success:hover { opacity: .85; }
button:disabled { opacity: .4; cursor: default; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface2); color: var(--text); }
.btn-success { background: var(--success); color: #fff; }
a.btn-wide { min-width: 220px; text-align: center; }
.app-btns-col { display: flex; flex-direction: column; gap: .75rem; align-items: center; margin-top: 1.25rem; }
#auth-wall { display: none; }
.mt-1 { margin-top: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.btn-theme {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: .35rem .6rem;
  font-size: 1rem;
  line-height: 1;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
}
.btn-theme:hover { background: var(--border); opacity: 1; }

#auth-status {
  font-size: .8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: .4rem;
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.green { background: var(--success); }
.dot.red { background: #ef4444; }

.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
}
.filter-group { display: flex; flex-direction: column; gap: .5rem; }
.filter-group label.group-label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.filter-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  padding: .3rem .75rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: .8rem;
  cursor: pointer;
  transition: all .15s;
  font-weight: 500;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.location.active { background: var(--accent2); border-color: var(--accent2); }
.chip.success-chip.active { background: #22c55e; border-color: #22c55e; color: #fff; }
.chip.grade-chip.active { background: var(--warning); border-color: var(--warning); color: #000; }
.chip.period-chip.active { background: var(--accent2); border-color: var(--accent2); color: #fff; }
.chip.wall-style-chip.active { background: var(--ws-color); border-color: var(--ws-color); color: #fff; }

/* ── Grade range slider ───────────────────────────────────────────────────── */
.grade-range-group { min-width: 160px; flex: 1 1 160px; max-width: 260px; }
.grade-range-wrap {
  position: relative;
  height: 28px;
  display: flex;
  align-items: center;
}
.grade-range-wrap input[type=range] {
  position: absolute;
  width: 100%;
  height: 4px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  pointer-events: none;
  z-index: 2;
}
.grade-range-wrap input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent2);
  border: 2px solid var(--surface);
  cursor: pointer;
  pointer-events: all;
  transition: background .15s;
}
.grade-range-wrap input[type=range]::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent2);
  border: 2px solid var(--surface);
  cursor: pointer;
  pointer-events: all;
}
.grade-range-wrap input[type=range]::-webkit-slider-thumb:hover { background: var(--accent); }
.grade-range-wrap input[type=range]::-moz-range-thumb:hover    { background: var(--accent); }
.grade-range-track {
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  z-index: 1;
}
.grade-range-fill {
  position: absolute;
  height: 100%;
  background: var(--accent2);
  border-radius: 2px;
}

.filter-group.chart-filters { flex: 1 1 100%; border-top: 1px solid var(--border); padding-top: .75rem; margin-top: .25rem; }
.chart-filter-row { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.chart-filter-section { display: flex; flex-direction: column; gap: .4rem; }
.chart-filter-section label.group-label { font-size: .68rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
#btn-clear-chart-filters {
  padding: .25rem .7rem; font-size: .75rem; border-radius: 6px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; align-self: flex-end;
}
#btn-clear-chart-filters:hover { background: var(--border); color: var(--text); }

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
}
.login-card h3 { font-size: 1.1rem; margin-bottom: 1.5rem; text-align: center; }
.form-group { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.form-group label { font-size: .8rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.form-group input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .6rem .85rem;
  color: var(--text);
  font-size: .95rem;
  outline: none;
  transition: border-color .15s;
}
.form-group input:focus { border-color: var(--accent); }
.login-card button { width: 100%; margin-top: .5rem; padding: .7rem; font-size: .95rem; }
.login-note { font-size: .75rem; color: var(--text-muted); text-align: center; margin-top: 1rem; line-height: 1.5; }

.privacy-notice {
  font-size: .875rem;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent2);
  border-radius: 6px;
  padding: .65rem .9rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

#auth-wall {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 1.5rem;
  text-align: center;
}
#auth-wall h2 { font-size: 1.8rem; }
#auth-wall p { color: var(--text-muted); max-width: 420px; line-height: 1.6; }

#dashboard { display: none; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(124,58,237,0.04) 0%, transparent 60%);
  pointer-events: none;
}

.stat-icon {
  width: 28px;
  height: 28px;
  stroke: var(--accent2);
  opacity: 0.5;
  position: absolute;
  top: 1rem;
  right: 1rem;
}
.stat-card .label { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.stat-card .value { font-size: 2rem; font-weight: 700; margin-top: .25rem; }
.stat-card .value.accent { color: var(--accent); }
.stat-card .value.success { color: var(--success); }

.best-grades-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.best-grade-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .6rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  min-width: 90px;
}
.best-grade-chip .bg-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.best-grade-chip .bg-value {
  font-size: 1.4rem;
  font-weight: 700;
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  position: relative;
}

/* Touw-decoratie boven de charts-grid */
.charts-grid::before {
  content: '';
  display: block;
  grid-column: 1 / -1;
  height: 3px;
  background: repeating-linear-gradient(
    90deg,
    var(--rope) 0px, var(--rope) 8px,
    rgba(200,119,42,0.3) 8px, rgba(200,119,42,0.3) 12px
  );
  border-radius: 2px;
  margin-bottom: -.5rem;
  opacity: 0.4;
}
/* Tablet */
@media (max-width: 900px) {
  .charts-grid { grid-template-columns: 1fr; }
  .chart-wrapper { height: 240px; }
  .chart-wrapper.tall { height: 280px; }
}

/* Mobiel */
@media (max-width: 600px) {
  header {
    padding: .5rem 1rem;
    height: auto;
    min-height: 52px;
    flex-wrap: wrap;
    gap: .4rem;
  }
  header h1 { font-size: .95rem; }
  .header-icon { width: 18px; height: 18px; }
  .header-actions { gap: .3rem; }
  .header-actions button { padding: .3rem .55rem; font-size: .75rem; }
  .dashboard-tabs { width: 100%; order: 3; border-top: 1px solid var(--border); }
  .dash-tab { font-size: .78rem; padding: .4rem .75rem; flex: 1; text-align: center; }
  .app-manual-frame { height: calc(100vh - 100px); }

  main { padding: .75rem; }

  .login-card { padding: 1.25rem 1rem; }

  .filter-bar { padding: .6rem .75rem; gap: .75rem; }
  .chip { padding: .25rem .6rem; font-size: .75rem; }
  .filter-group label.group-label,
  .chart-filter-section label.group-label { font-size: .65rem; }

  .best-grades-bar { gap: .5rem; }
  .best-grade-chip { padding: .5rem .75rem; min-width: 72px; }
  .best-grade-chip .bg-label { font-size: .62rem; }
  .best-grade-chip .bg-value { font-size: 1.2rem; }

  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: 1rem; }
  .stat-card { padding: .75rem; }
  .stat-card .label { font-size: .65rem; }
  .stat-card .value { font-size: 1.3rem; }
  .stat-icon { width: 20px; height: 20px; top: .6rem; right: .6rem; }

  .chart-card { padding: .75rem; border-radius: 10px; }
  .chart-card h3,
  .chart-card-header h3 { font-size: .75rem; margin-bottom: .6rem; }
  .chart-card-header { gap: .5rem; }
  .chart-wrapper { height: 200px; }
  .chart-wrapper.tall { height: 320px; }
  .subtitle { font-size: .68rem; }

  .charts-grid { gap: .75rem; }
  .charts-grid::before { display: none; }
}

.chart-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: border-color .2s;
}
.chart-card:hover { border-color: rgba(255,255,255,0.22); }
.chart-card.wide { grid-column: 1 / -1; }
.chart-card h3 {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 1rem;
}
.chart-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1rem;
}
.chart-card-header h3 { margin-bottom: .25rem; }
.chart-card-header .subtitle { font-size: .75rem; color: var(--text-muted); }
.chart-wrapper { position: relative; height: 280px; }
.chart-wrapper.tall { height: 340px; }
.chart-wrapper canvas { cursor: pointer; }

.divider { border-color: rgba(255,255,255,0.08); margin: 1.2rem 0; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1rem; font-weight: 600; margin: 0; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: .25rem .5rem;
}
.modal-close:hover { color: var(--text); }
.modal-body {
  overflow-y: auto;
  padding: 1rem 1.5rem 1.5rem;
}
.route-row {
  display: grid;
  grid-template-columns: 1.5fr 2fr 2fr 2fr 2fr;
  gap: .5rem;
  align-items: center;
  padding: .5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: .85rem;
}
.route-row:last-child { border-bottom: none; }
.route-row-header {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.session-location-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 0 .75rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: .5rem;
}
.session-location-label {
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}
.session-location-row .route-select {
  width: auto;
  min-width: 120px;
}
.route-row input[type="number"],
.route-row input[type="text"],
.route-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .3rem .5rem;
  color: var(--text);
  font-size: .85rem;
  width: 100%;
}
.route-row input[type="number"]:focus,
.route-row input[type="text"]:focus,
.route-select:focus { border-color: var(--accent); outline: none; }
.route-select { cursor: pointer; appearance: none; -webkit-appearance: none; }
.save-indicator { color: var(--success); font-size: .75rem; opacity: 0; transition: opacity .3s; }
.save-indicator.visible { opacity: 1; }

.route-delete-btn {
  background: none;
  border: none;
  padding: .1rem .3rem;
  font-size: .9rem;
  cursor: pointer;
  opacity: 0.3;
  transition: opacity .15s;
  flex-shrink: 0;
}
.route-delete-btn:hover { opacity: 1; }
.route-row:hover .route-delete-btn { opacity: 0.6; }

@media (max-width: 600px) {
  .modal { max-height: 90vh; }
  .modal-body { padding: .75rem 1rem 1rem; }
  .route-row { grid-template-columns: 1fr 1fr 1fr 1fr 1fr; font-size: .7rem; gap: .3rem; }
  .route-row input[type="number"],
  .route-row input[type="text"],
  .route-select { font-size: .7rem; padding: .2rem .3rem; }
  .session-location-row { gap: .5rem; }
  .session-location-label { font-size: .68rem; }
}
.hidden { display: none !important; }

.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .75rem 1.25rem;
  font-size: .85rem;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s, transform .3s;
  z-index: 999;
  max-width: 340px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: #ef4444; color: #ef4444; }
.toast.ok { border-color: var(--success); color: var(--success); }

/* ── Manual (handleiding) ──────────────────────────────────────────────────── */
.manual-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}
.manual-section h2 {
  margin-top: 2rem;
  margin-bottom: .4rem;
  font-size: 1.1rem;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: .3rem;
}
.manual-section h3 {
  margin-top: 1.2rem;
  margin-bottom: .3rem;
  font-size: .95rem;
  color: var(--text);
}
.manual-section p, .manual-section li {
  line-height: 1.6;
  font-size: .9rem;
  color: var(--text);
}
.manual-section a:not([class*="btn"]) { color: var(--accent); }
.manual-section ul { padding-left: 1.4rem; }
.screenshot-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 2px dashed var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: .85rem;
  margin: 1rem 0;
  min-height: 180px;
}
.screenshots-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.screenshots-row .screenshot-placeholder {
  flex: 1;
  min-width: 120px;
  min-height: 150px;
}
.key-table {
  width: 100%;
  border-collapse: collapse;
  margin: .8rem 0;
  font-size: .875rem;
}
.key-table th, .key-table td {
  text-align: left;
  padding: .4rem .6rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.key-table th { color: var(--text-muted); font-weight: 600; }
.key {
  display: inline-block;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: .78rem;
  font-family: monospace;
  color: var(--text);
}

img.screenshot {
  max-height: 280px;
  width: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
  margin: .5rem auto;
}
.screenshots-row img.screenshot {
  flex: 0 0 auto;
  margin: 0;
}

/* ── Feedback FAB + modal ──────────────────────────────────────────────────── */
.feedback-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent2);
  color: #fff;
  font-size: 1.3rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s, opacity .15s;
}
.feedback-fab:hover { transform: scale(1.1); opacity: 1; }

.feedback-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 950;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0 1.5rem 5rem;
}
.feedback-modal.hidden { display: none; }

.feedback-modal-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
  position: relative;
}
.feedback-modal-inner h3 { font-size: 1rem; font-weight: 700; margin-bottom: .4rem; }
.feedback-modal-inner p  { font-size: .82rem; color: var(--text-muted); margin-bottom: 1rem; }
.feedback-modal-inner textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: .55rem .75rem;
  font-size: .9rem;
  font-family: inherit;
  resize: vertical;
  min-height: 90px;
}
.feedback-modal-inner textarea:focus { outline: none; border-color: var(--accent2); }
.feedback-modal-inner .btn-primary { width: 100%; margin-top: .75rem; padding: .65rem; }

.feedback-modal-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: .2rem .4rem;
  border-radius: 4px;
}
.feedback-modal-close:hover { color: var(--text); opacity: 1; }

/* ── Language switcher ───────────────────────────────────────────────────── */
.lang-switcher {
  position: relative;
  display: flex;
  align-items: center;
}

.lang-btn {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .35rem .7rem;
  font-size: .85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .35rem;
  transition: background .15s;
  font-weight: 600;
}
.lang-btn:hover { background: var(--border); opacity: 1; }

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  min-width: 110px;
  z-index: 200;
  overflow: hidden;
}
.lang-dropdown.open { display: block; }

.lang-option {
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  padding: .55rem 1rem;
  text-align: left;
  font-size: .85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .5rem;
  transition: background .12s;
  border-radius: 0;
}
.lang-option:hover { background: var(--surface2); opacity: 1; }
.lang-option.active { color: var(--accent); font-weight: 700; }

.grade-system-select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .35rem .6rem;
  font-size: .82rem;
  cursor: pointer;
  height: 2rem;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .5rem center;
  padding-right: 1.6rem;
}
.grade-system-select:focus { outline: 2px solid var(--accent); }
