/* ============================================================
   MADKHAL — Tools Page style.css
   Light / Dark · RTL · Cairo + Tajawal
   ============================================================ */

/* ── DARK (default) ──────────────────────────────────────── */
:root {
  --bg:           #0b0d11;
  --surface:      #12151c;
  --surface-2:    #181c26;
  --surface-3:    #1e2230;
  --border:       rgba(255,255,255,0.07);
  --accent:       #2267e8;
  --accent-dim:   rgba(34, 126, 232, 0.12);
  --accent-glow:  rgba(34, 103, 232, 0.35);
  --text:         #e8eaf0;
  --muted:        #7a8099;
  --faint:        #424866;
  --danger:       #ef4444;
  --success:      #22c55e;
  --info:         #60a5fa;
  --header-bg:    rgba(11,13,17,0.88);
  --grid-line:    rgba(255,255,255,0.025);
  --nav-hover:    rgba(255,255,255,0.06);
  --mob-hover:    rgba(255,255,255,0.04);
  --shadow:       rgba(0,0,0,0.45);
  --font-h: 'Cairo',   sans-serif;
  --font-b: 'Tajawal', sans-serif;
  --r-sm:   8px;
  --r-md:   14px;
  --r-lg:   22px;
  --r-xl:   32px;
  --r-full: 999px;
  --ease:   cubic-bezier(0.4,0,0.2,1);
  --spring: cubic-bezier(0.34,1.56,0.64,1);
  --dur:    0.28s;
  --theme-dur: 0.4s;
}

/* ── LIGHT ───────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:          #f4f6fb;
  --surface:     #ffffff;
  --surface-2:   #eef0f7;
  --surface-3:   #e6e9f4;
  --border:      rgba(0,0,0,0.08);
  --accent:      #0a6ac4;
  --accent-dim:  rgba(10, 106, 196, 0.1);
  --accent-glow: rgba(10, 91, 196, 0.28);
  --text:        #0f1117;
  --muted:       #4a5068;
  --faint:       #9aa0bc;
  --danger:      #dc2626;
  --success:     #16a34a;
  --info:        #2563eb;
  --header-bg:   rgba(244,246,251,0.92);
  --grid-line:   rgba(0,0,0,0.04);
  --nav-hover:   rgba(0,0,0,0.05);
  --mob-hover:   rgba(0,0,0,0.03);
  --shadow:      rgba(0,0,0,0.10);
}

/* ── THEME TRANSITIONS ───────────────────────────────────── */
body, .header, .tool-card, .tool-tabs,
.course-row, .result-block, .abs-stat,
.abs-formula, .abs-disclaimer, .info-box,
.field-input, .field-select, .course-input,
.course-grade-select, .mobile-nav, .footer {
  transition:
    background var(--theme-dur) var(--ease),
    border-color var(--theme-dur) var(--ease),
    color var(--theme-dur) var(--ease);
}

/* ── RESET & BASE ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-b);
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  overflow-x: hidden;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }

/* ── HEADER ──────────────────────────────────────────────── */
.header {
  position: fixed; top: 0; right: 0; left: 0; z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--theme-dur) var(--ease),
              border-color var(--dur) var(--ease),
              backdrop-filter var(--dur) var(--ease);
}
.header.is-scrolled {
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-color: var(--border);
}
.header__inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
  height: 68px; display: flex;
  align-items: center; justify-content: space-between; gap: 1rem;
}
/* ── LOGO ────────────────────────────────────────────────── */
/* ضبط مقاس الشعار */
.header__logo img {
  height: 45px; 
  width: auto;
}

/* الوضع الفاتح (الافتراضي): إخفاء شعار الدارك وإظهار شعار اللايت */
.logo-dark {
  display: none;
}
.logo-light {
  display: block;
}

/* الوضع الليلي: إخفاء شعار اللايت وإظهار شعار الدارك */
/* ضفت لك أشهر الكلاسات اللي تستخدمها سكربتات التبديل عشان يضبط معك مباشرة */
body.dark .logo-light,
body.dark-mode .logo-light,
[data-theme="dark"] .logo-light {
  display: none !important;
}

body.dark .logo-dark,
body.dark-mode .logo-dark,
[data-theme="dark"] .logo-dark {
  display: block !important;
}

.header__nav { display: flex; align-items: center; gap: .25rem; }

.nav-link {
  padding: .42rem .85rem; border-radius: var(--r-full);
  font-family: var(--font-h); font-size: .88rem; font-weight: 500;
  color: var(--muted); background: none; border: none; cursor: pointer;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--nav-hover); }

.nav-cta {
  padding: .42rem 1.1rem;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid rgba(34, 97, 232, 0.3); border-radius: var(--r-full);
  font-family: var(--font-h); font-size: .88rem; font-weight: 600;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.nav-cta:hover { background: var(--accent); color: #fff; box-shadow: 0 4px 18px var(--accent-glow); }

.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface-2); border: 1.5px solid var(--border);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              transform var(--dur) var(--spring), box-shadow var(--dur) var(--ease);
}
.theme-toggle:hover {
  transform: scale(1.1) rotate(15deg);
  border-color: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
}
.theme-toggle__icon { display: block; line-height: 1; }

.header__burger {
  display: none; flex-direction: column; gap: 5px;
  width: 32px; background: none; border: none; cursor: pointer; padding: 4px;
}
.header__burger span {
  display: block; height: 2px; background: var(--text); border-radius: 2px;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease),
              background var(--theme-dur) var(--ease);
}
.header__burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.header__burger.is-open span:nth-child(2) { opacity: 0; }
.header__burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none; flex-direction: column;
  background: var(--surface); border-top: 1px solid var(--border);
  overflow: hidden; max-height: 0;
  transition: max-height .4s var(--ease), background var(--theme-dur) var(--ease);
}
.mobile-nav.is-open { max-height: 380px; }
.mobile-nav__link {
  display: block; padding: .85rem 1.5rem;
  font-family: var(--font-h); font-size: .95rem; font-weight: 500;
  color: var(--muted); border-bottom: 1px solid var(--border);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.mobile-nav__link:hover { color: var(--text); background: var(--mob-hover); }
.mobile-nav__cta { color: var(--accent); font-weight: 700; }
.mobile-nav__theme {
  display: flex; align-items: center; gap: .7rem; padding: .85rem 1.5rem;
  font-family: var(--font-h); font-size: .9rem; color: var(--muted);
  cursor: pointer; background: none; border: none; width: 100%; text-align: right;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.mobile-nav__theme:hover { color: var(--accent); background: var(--mob-hover); }

/* ── PAGE HERO ───────────────────────────────────────────── */
.page-hero {
  position: relative;
  padding: calc(68px + 3rem) 0 2.5rem;
  text-align: center; overflow: hidden;
}
.page-hero__bg { position: absolute; inset: 0; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); }
.blob--1 {
  width: 500px; height: 500px; top: -140px; right: -80px;
  background: radial-gradient(circle, rgba(34, 120, 232, 0.13) 0%, transparent 70%);
}
.blob--2 {
  width: 360px; height: 360px; bottom: -60px; left: -60px;
  background: radial-gradient(circle, rgba(90,110,210,.10) 0%, transparent 70%);
}
[data-theme="light"] .blob--1 { background: radial-gradient(circle, rgba(10, 60, 196, 0.11) 0%, transparent 70%); }
[data-theme="light"] .blob--2 { background: radial-gradient(circle, rgba(70,90,200,.07)  0%, transparent 70%); }
.grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 0%, transparent 100%);
}
.page-hero__inner {
  position: relative; z-index: 1;
  max-width: 1200px; margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: .45rem; margin-bottom: 1rem;
  padding: .35rem .95rem;
  background: var(--accent-dim); border: 1px solid rgba(34, 113, 232, 0.25);
  border-radius: var(--r-full);
  font-family: var(--font-h); font-size: .78rem; font-weight: 600; color: var(--accent);
}
.badge-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50%       { box-shadow: 0 0 0 6px transparent; }
}
.page-hero__title {
  font-family: var(--font-h); font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 900; color: var(--text); margin-bottom: .6rem;
}
.page-hero__title span { color: var(--accent); text-shadow: 0 0 40px var(--accent-glow); }
.page-hero__sub {
  font-size: .97rem; color: var(--muted);
  max-width: 520px; margin: 0 auto; line-height: 1.7;
}

/* ── TOOL TAB SWITCHER ───────────────────────────────────── */
.tool-tabs-wrap {
  max-width: 1200px; margin: 0 auto 2.5rem;
  padding: 0 clamp(1rem, 4vw, 2rem);
  display: flex; justify-content: center;
}
.tool-tabs {
  display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-full); padding: .4rem;
}
.tool-tab {
  display: flex; align-items: center; gap: .5rem;
  padding: .6rem 1.4rem; border-radius: var(--r-full);
  font-family: var(--font-h); font-size: .9rem; font-weight: 600;
  color: var(--muted); background: none; border: none; cursor: pointer;
  white-space: nowrap;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.tool-tab:hover { color: var(--text); background: var(--surface-2); }
.tool-tab.active {
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 18px var(--accent-glow);
}
.tool-tab__icon { font-size: 1.05rem; }

/* ── TOOL PANELS ─────────────────────────────────────────── */
.tools-container {
  max-width: 900px; margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem) 5rem;
  flex: 1;
}
.tool-panel { display: none; animation: panel-in .4s var(--ease); }
.tool-panel.active { display: block; }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── CARD ────────────────────────────────────────────────── */
.tool-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); overflow: hidden; position: relative;
}
.tool-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.tool-card__head {
  padding: 2rem 2rem 1.4rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem;
}
.tool-card__emoji { font-size: 2.4rem; line-height: 1; }
.tool-card__title { font-family: var(--font-h); font-size: 1.35rem; font-weight: 800; color: var(--text); }
.tool-card__sub   { font-size: .85rem; color: var(--muted); margin-top: .25rem; line-height: 1.5; }
.tool-card__body  { padding: 2rem; }

/* ── SECTION LABEL ───────────────────────────────────────── */
.sec-label {
  display: inline-block;
  font-family: var(--font-h); font-size: .75rem; font-weight: 700;
  color: var(--accent); text-transform: uppercase; letter-spacing: .1em;
  padding: .22rem .8rem; margin-bottom: .85rem;
  background: var(--accent-dim); border-radius: var(--r-full);
  border: 1px solid rgba(34, 113, 232, 0.2);
}

/* ── MODE CHIPS ──────────────────────────────────────────── */
.mode-chips { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.mode-chip {
  padding: .45rem 1rem; border-radius: var(--r-full);
  font-family: var(--font-h); font-size: .82rem; font-weight: 600;
  color: var(--muted); background: var(--surface-2); border: 1.5px solid var(--border);
  cursor: pointer; transition: all var(--dur) var(--ease);
}
.mode-chip:hover  { border-color: var(--accent); color: var(--accent); }
.mode-chip.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* ── FIELDS ──────────────────────────────────────────────── */
.field-group { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.2rem; }
.field-label {
  display: flex; align-items: center; gap: .4rem;
  font-family: var(--font-h); font-size: .88rem; font-weight: 600;
  color: var(--text); cursor: pointer;
}
.field-label__icon { font-size: 1rem; }
.field-input-wrap  { position: relative; display: flex; align-items: center; }
.field-input {
  width: 100%; padding: .82rem 1rem .82rem 3rem;
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--font-h); font-size: 1rem; font-weight: 500; color: var(--text);
  outline: none; direction: ltr; text-align: center;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              background var(--theme-dur) var(--ease), color var(--theme-dur) var(--ease);
}
.field-input::placeholder { color: var(--faint); font-weight: 400; }
.field-input:focus     { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.field-input.is-error  { border-color: var(--danger);  box-shadow: 0 0 0 3px rgba(239,68,68,.12); }
.field-suffix {
  position: absolute; left: 1rem;
  font-family: var(--font-h); font-size: .88rem; font-weight: 600;
  color: var(--muted); pointer-events: none;
}
.field-hint { font-size: .76rem; color: var(--faint); }

.field-select {
  width: 100%; padding: .82rem 1rem;
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--font-h); font-size: .95rem; font-weight: 600; color: var(--text);
  outline: none; cursor: pointer; direction: rtl; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%237a8099' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left .9rem center;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              background var(--theme-dur) var(--ease), color var(--theme-dur) var(--ease);
}
.field-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .82rem 1.8rem; border-radius: var(--r-full);
  font-family: var(--font-h); font-size: .95rem; font-weight: 700;
  cursor: pointer; border: none;
  transition: transform var(--dur) var(--spring), box-shadow var(--dur) var(--ease),
              background var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 8px 28px var(--accent-glow); }
.btn--ghost   { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn--ghost:hover   { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn--danger  { background: rgba(239,68,68,.1); color: var(--danger); border: 1px solid rgba(68, 148, 239, 0.25); }
.btn--danger:hover  { background: var(--danger); color: #fff; }
.btn--full    { width: 100%; justify-content: center; }
.btn--sm      { padding: .5rem 1.1rem; font-size: .82rem; }

/* ── DIVIDER ─────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }

/* ── GPA COURSES LIST ────────────────────────────────────── */
.courses-list { display: flex; flex-direction: column; gap: .7rem; margin-bottom: 1.2rem; }
.course-row {
  display: grid; grid-template-columns: 1fr 90px 130px 36px;
  gap: .6rem; align-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: .7rem 1rem;
  transition: border-color var(--dur) var(--ease),
              background var(--theme-dur) var(--ease);
}
.course-row:hover { border-color: rgba(34, 113, 232, 0.25); }
.course-input {
  background: transparent; border: none; outline: none;
  font-family: var(--font-h); font-size: .9rem; font-weight: 500; color: var(--text);
  direction: rtl; width: 100%;
  transition: color var(--theme-dur) var(--ease);
}
.course-input::placeholder { color: var(--faint); }
.course-input--num { direction: ltr; text-align: center; }
.course-grade-select {
  background: transparent; border: none; outline: none; cursor: pointer;
  font-family: var(--font-h); font-size: .9rem; font-weight: 700; color: var(--accent);
  direction: rtl; appearance: none; text-align: center; width: 100%;
  transition: color var(--theme-dur) var(--ease);
}
.course-grade-select option { background: var(--surface); color: var(--text); }
.course-del {
  background: none; border: none; cursor: pointer;
  color: var(--faint); font-size: 1.1rem; padding: .2rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.course-del:hover { color: var(--danger); background: rgba(239,68,68,.1); }
.courses-header {
  display: grid; grid-template-columns: 1fr 90px 130px 36px;
  gap: .6rem; padding: 0 1rem .4rem;
}
.courses-header span {
  font-family: var(--font-h); font-size: .72rem; font-weight: 700;
  color: var(--faint); text-transform: uppercase; letter-spacing: .08em;
  text-align: center;
}
.courses-header span:first-child { text-align: right; }

/* ── SCALE TOGGLE ────────────────────────────────────────── */
.scale-toggle {
  display: inline-flex; gap: .35rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-full); padding: .3rem; margin-top: .5rem;
  transition: background var(--theme-dur) var(--ease), border-color var(--theme-dur) var(--ease);
}
.scale-btn {
  padding: .42rem 1.2rem; border-radius: var(--r-full);
  font-family: var(--font-h); font-size: .88rem; font-weight: 700;
  color: var(--muted); background: none; border: none; cursor: pointer;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.scale-btn:hover  { color: var(--text); }
.scale-btn.active {
  background: var(--accent); color: #fff;
  box-shadow: 0 3px 14px var(--accent-glow);
}

/* ── CARRY-OVER SECTION ──────────────────────────────────── */
.carry-over {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); margin-bottom: 1.2rem; overflow: hidden;
}
.carry-over__toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1.1rem; background: none; border: none; cursor: pointer;
  font-family: var(--font-h); font-size: .88rem; font-weight: 600; color: var(--muted);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.carry-over__toggle:hover { color: var(--text); background: var(--surface-3); }
.carry-over__arrow { font-size: .7rem; transition: transform var(--dur) var(--ease); }
.carry-over.is-open .carry-over__arrow { transform: rotate(180deg); }
.carry-over__body {
  max-height: 0; overflow: hidden;
  transition: max-height .35s var(--ease);
}
.carry-over.is-open .carry-over__body { max-height: 200px; }
.carry-over__inner {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: .8rem; padding: .8rem 1.1rem 1.1rem;
}
.carry-over__inner--3col {
  grid-template-columns: 1fr 1fr 1fr;
}

/* ── RESULT BLOCK ────────────────────────────────────────── */
.result-block {
  display: none; margin-top: 1.5rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  animation: panel-in .4s var(--ease);
}
.result-block.show { display: block; }

/* Ring + stats row */
.result-top {
  padding: 1.6rem 2rem; display: flex; gap: 2rem; flex-wrap: wrap;
  align-items: center; border-bottom: 1px solid var(--border);
}
.ring-wrap { position: relative; width: 110px; height: 110px; flex-shrink: 0; }
.ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--surface-3); stroke-width: 8; }
.ring-fill  {
  fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round;
  stroke-dasharray: 283; stroke-dashoffset: 283;
  transition: stroke-dashoffset 1.1s var(--ease);
  filter: drop-shadow(0 0 8px var(--accent-glow));
}
.ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ring-val  { font-family: var(--font-h); font-size: 1.55rem; font-weight: 900; color: var(--text); line-height: 1; }
.ring-unit { font-family: var(--font-h); font-size: .72rem; font-weight: 700; color: var(--muted); }

.result-stats { display: flex; flex-wrap: wrap; gap: 1.2rem; flex: 1; }
.result-stat__label { font-size: .75rem; color: var(--muted); font-family: var(--font-h); margin-bottom: .25rem; }
.result-stat__value { font-family: var(--font-h); font-size: 1.4rem; font-weight: 800; color: var(--text); }

.result-bottom {
  padding: 1rem 1.5rem;
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
}
.res-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .9rem; border-radius: var(--r-full);
  font-family: var(--font-h); font-size: .82rem; font-weight: 700;
}
.res-badge--a { background: rgba(34,197,94,.12);  color: var(--success); border: 1px solid rgba(34,197,94,.25); }
.res-badge--b { background: rgba(96,165,250,.12);  color: var(--info);    border: 1px solid rgba(96,165,250,.25); }
.res-badge--c { background: var(--accent-dim);     color: var(--accent);  border: 1px solid rgba(34, 103, 232, 0.25); }
.res-badge--d { background: rgba(239,68,68,.12);   color: var(--danger);  border: 1px solid rgba(239,68,68,.25); }
.result-note  { font-size: .82rem; color: var(--muted); line-height: 1.5; }

.result-actions { padding: 0 1.5rem 1.2rem; display: flex; gap: .5rem; flex-wrap: wrap; }

/* ── ABSENCE RESULT ──────────────────────────────────────── */
.abs-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1rem; padding: 1.5rem;
}
.abs-stat {
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 1rem 1.2rem; text-align: center;
}
.abs-stat--accent { border-color: rgba(34, 103, 232, 0.3); background: var(--accent-dim); }
.abs-stat--danger { border-color: rgba(239,68,68,.3);  background: rgba(239,68,68,.07); }
.abs-stat--warn   { border-color: rgba(251, 211, 36, 0.3);  background: rgba(36, 129, 251, 0.07); }
.abs-stat__label  { font-family: var(--font-h); font-size: .78rem; font-weight: 600; color: var(--muted); margin-bottom: .4rem; }
.abs-stat__value  { font-family: var(--font-h); font-size: 2.2rem; font-weight: 900; color: var(--text); line-height: 1; }
.abs-stat--accent .abs-stat__value { color: var(--accent); }
.abs-stat--danger .abs-stat__value { color: var(--danger); }
.abs-stat--warn   .abs-stat__value { color: #f59e0b; }

.abs-progress-wrap { padding: 0 1.5rem .75rem; }
.abs-progress-label {
  display: flex; justify-content: space-between;
  font-family: var(--font-h); font-size: .78rem; color: var(--muted); margin-bottom: .4rem;
}
.abs-progress { height: 8px; background: var(--surface-3); border-radius: var(--r-full); overflow: hidden; }
.abs-progress__fill {
  height: 100%; border-radius: var(--r-full);
  background: var(--accent);
  transition: width 1s var(--ease), background .4s var(--ease);
}
.abs-progress__fill.is-danger { background: var(--danger); }
.abs-progress__fill.is-warn   { background: #f59e0b; }

.abs-formula {
  margin: 0 1.5rem .8rem; padding: .85rem 1.2rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); font-family: var(--font-h); font-size: .82rem;
  color: var(--muted); line-height: 1.6; text-align: center;
}
.abs-formula strong { color: var(--accent); }
.abs-disclaimer {
  margin: 0 1.5rem 1.5rem; padding: .75rem 1rem;
  background: rgba(34, 103, 232, 0.06); border: 1px solid rgba(34, 120, 232, 0.15);
  border-radius: var(--r-md); font-size: .78rem; color: var(--muted); line-height: 1.6;
}

/* ── SCORE CONVERTER ─────────────────────────────────────── */
.conv-visual {
  display: flex; flex-direction: column; align-items: center;
  gap: .4rem; padding: 1.6rem 1.5rem .8rem;
}
.conv-fraction {
  display: flex; align-items: baseline; gap: .4rem;
  font-family: var(--font-h); font-size: 1.6rem; font-weight: 900; color: var(--text);
}
.conv-arrow-big { font-size: 1.3rem; color: var(--accent); }
.conv-result-big {
  font-family: var(--font-h); font-size: 3.8rem; font-weight: 900;
  color: var(--accent); text-shadow: 0 0 30px var(--accent-glow); line-height: 1;
  transition: color var(--theme-dur) var(--ease);
}
.conv-result-label { font-family: var(--font-h); font-size: .85rem; color: var(--muted); margin-top: .15rem; }
.conv-formula-box {
  margin: 0 1.5rem .8rem; padding: .85rem 1.2rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); font-family: var(--font-h); font-size: .82rem;
  color: var(--muted); line-height: 1.6; text-align: center;
}
.conv-formula-box strong { color: var(--accent); }

.batch-section { padding: 0 1.5rem 1.2rem; }
.batch-section__label {
  font-family: var(--font-h); font-size: .82rem; font-weight: 600;
  color: var(--muted); margin-bottom: .6rem;
}
.batch-list { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .7rem; }
.batch-row {
  display: grid; grid-template-columns: 1fr auto 36px;
  gap: .6rem; align-items: center;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: .5rem .85rem;
}
.batch-row input {
  background: transparent; border: none; outline: none;
  font-family: var(--font-h); font-size: .9rem; font-weight: 500; color: var(--text);
  direction: ltr; text-align: center; width: 100%;
  transition: color var(--theme-dur) var(--ease);
}
.batch-row input::placeholder { color: var(--faint); }
.batch-result-tag {
  font-family: var(--font-h); font-size: .88rem; font-weight: 700;
  color: var(--accent); white-space: nowrap;
}

/* ── INFO BOX ────────────────────────────────────────────── */
.info-box {
  padding: .85rem 1.2rem;
  background: rgba(96,165,250,.08); border: 1px solid rgba(96,165,250,.2);
  border-radius: var(--r-md);
  font-family: var(--font-h); font-size: .82rem; color: var(--info); line-height: 1.6;
}

/* ── ERROR MSG ───────────────────────────────────────────── */
.tool-error {
  display: none; margin-top: 1rem; padding: .7rem 1rem;
  background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.2);
  border-radius: var(--r-sm);
  font-family: var(--font-h); font-size: .84rem; color: var(--danger);
}
.tool-error.show { display: block; }

/* ── FOOTER ──────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border); background: var(--surface); padding: 1.4rem 0;
  transition: background var(--theme-dur) var(--ease), border-color var(--theme-dur) var(--ease);
}
.footer__inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .75rem;
}
.footer__brand { display: flex; align-items: center; gap: .5rem; }
.footer__copy  { font-size: .8rem; color: var(--faint); font-family: var(--font-h); }
.footer__link  {
  font-family: var(--font-h); font-size: .8rem; color: var(--muted);
  border-bottom: 1px solid var(--faint); padding-bottom: 1px;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.footer__link:hover { color: var(--accent); border-color: var(--accent); }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 680px) {
  .header__nav       { display: none; }
  .header__burger    { display: flex; }
  .mobile-nav        { display: flex; }
  .tool-tabs         { gap: .3rem; padding: .3rem; }
  .tool-tab          { padding: .5rem .9rem; font-size: .8rem; }
  .tool-card__body   { padding: 1.2rem; }
  .course-row        { grid-template-columns: 1fr 72px 100px 32px; gap: .4rem; }
  .courses-header    { display: none; }
  .carry-over__inner { grid-template-columns: 1fr; }
  .carry-over__inner--3col { grid-template-columns: 1fr; }
  .result-top        { flex-direction: column; align-items: flex-start; gap: 1.2rem; }
  .abs-grid          { grid-template-columns: 1fr; }
  .footer__inner     { flex-direction: column; align-items: center; text-align: center; }
}
@media (max-width: 440px) {
  .tool-tab__icon    { display: none; }
  .conv-result-big   { font-size: 2.8rem; }
  .tool-tabs-wrap    { padding: 0 .75rem; }
}
