@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Manrope:wght@400;500;600&display=swap');

/* ═══════════════════════════════════════════════════════════
   GPA Calculator – Premium Design System
   ═══════════════════════════════════════════════════════════ */
:root {
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --primary-300: #a5b4fc;
    --primary-400: #818cf8;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --primary-800: #3730a3;
    --primary-900: #312e81;
    --accent-50: #ecfdf5;
    --accent-100: #d1fae5;
    --accent-400: #34d399;
    --accent-500: #10b981;
    --accent-600: #059669;
    --neutral-50: #f8fafc;
    --neutral-100: #f1f5f9;
    --neutral-200: #e2e8f0;
    --neutral-300: #cbd5e1;
    --neutral-400: #94a3b8;
    --neutral-500: #64748b;
    --neutral-600: #475569;
    --neutral-700: #334155;
    --neutral-800: #1e293b;
    --neutral-900: #0f172a;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    --max-w: 1120px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, .10);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, .12);
    --ease: cubic-bezier(.4, 0, .2, 1);
    --dur: .25s;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--neutral-800);
    background: #f3f4f6;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden
}

img {
    max-width: 100%;
    display: block
}

a {
    color: #111;
    text-decoration: none;
    transition: color var(--dur) var(--ease)
}

a:hover {
    color: #000
}

ul,
ol {
    list-style: none
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font: inherit
}

input,
select,
textarea {
    font: inherit
}

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

#main-content {
    flex: 1
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid var(--neutral-200);
    transition: border-color var(--dur) var(--ease)
}

.site-header.scrolled {
    border-color: #d1d5db
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--neutral-900);
    text-decoration: none
}

.logo-icon {
    font-size: 1.5rem
}

.logo-text {
    letter-spacing: -.02em
}

.logo-accent {
    color: #111
}

.main-nav ul {
    display: flex;
    gap: 4px
}

.main-nav a {
    display: block;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: .9rem;
    color: var(--neutral-600);
    transition: all var(--dur) var(--ease)
}

.main-nav a:hover {
    background: #f3f4f6;
    color: #111
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px
}

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--neutral-700);
    border-radius: 2px;
    transition: all var(--dur) var(--ease)
}

.mobile-menu-btn.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg)
}

.mobile-menu-btn.open span:nth-child(2) {
    opacity: 0
}

.mobile-menu-btn.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg)
}

.mobile-nav-drawer {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, .98);
    backdrop-filter: blur(20px);
    z-index: 99;
    padding: 24px 20px;
    overflow-y: auto;
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease)
}

.mobile-nav-drawer[hidden] {
    display: block;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px)
}

.mobile-nav-drawer:not([hidden]) {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0)
}

.mobile-nav-drawer ul {
    display: flex;
    flex-direction: column;
    gap: 2px
}

.mobile-nav-drawer a {
    display: block;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    color: var(--neutral-700);
    transition: all var(--dur) var(--ease)
}

.mobile-nav-drawer a:hover {
    background: #f3f4f6;
    color: #111
}

.nav-divider {
    height: 1px;
    background: var(--neutral-200);
    margin: 8px 0
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 12px 0 4px;
    font-size: .82rem
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 4px
}

.breadcrumbs li {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--neutral-500)
}

.breadcrumbs li:not(:last-child)::after {
    content: '›';
    color: var(--neutral-400)
}

.breadcrumbs a {
    color: var(--neutral-500)
}

.breadcrumbs a:hover {
    color: #111
}

.breadcrumbs li:last-child {
    color: var(--neutral-800);
    font-weight: 500
}

/* Hero */
.hero {
    position: relative;
    padding: 20px 0 0;
    text-align: center;
    overflow: hidden;
    background: #f5f5f5
}

.hero h1 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -.02em;
    color: #111;
    line-height: 1.15;
    margin-bottom: 8px;
    position: relative
}

.hero h1 span {
    color: #111
}

.hero-sub {
    font-size: clamp(0.95rem, 2vw, 1.05rem);
    color: #6b7280;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    font-weight: 400
}

.hero-cta {
    display: none
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: .95rem;
    transition: all var(--dur) var(--ease);
    position: relative;
    overflow: hidden
}

.btn-primary {
    background: #111;
    color: #fff;
    border-radius: 8px
}

.btn-primary:hover {
    background: #000;
    color: #fff
}

.btn-outline {
    border: 2px solid #d1d5db;
    color: #374151;
    background: #fff;
    border-radius: 8px
}

.btn-outline:hover {
    border-color: #9ca3af;
    color: #111;
    background: #f9fafb
}

.btn-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--neutral-600);
    transition: all var(--dur) var(--ease)
}

.btn-icon:hover {
    background: #f3f4f6;
    color: #374151
}

/* Quick Picks */
.quick-picks {
    padding: 32px 0 28px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb
}

.quick-picks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 24px
}

.quick-pick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    text-decoration: none;
    color: #111;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--dur) var(--ease);
    cursor: pointer
}

.quick-pick-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm)
}

.qp-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center
}

.qp-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center
}

/* Search Box */
.search-box-wrapper {
    text-align: center;
    padding: 0 16px;
    position: relative;
    max-width: 420px;
    margin: 0 auto;
    width: 100%
}

.search-label {
    display: block;
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 500
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 14px;
    width: 100%;
    transition: all var(--dur) var(--ease);
    position: relative
}

.search-box:focus-within {
    border-color: #d1d5db;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1)
}

.search-icon {
    font-size: 1rem;
    color: #9ca3af;
    flex-shrink: 0
}

.uni-search-input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 0.9rem;
    color: #111;
    padding: 0;
    font-family: inherit
}

.uni-search-input::placeholder {
    color: #d1d5db
}

.search-results {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
    z-index: 100
}

.board-selector h2 {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--neutral-900)
}

.board-selector .section-sub {
    text-align: center;
    color: var(--neutral-500);
    margin-bottom: 20px;
    font-size: 0.85rem
}

.board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px
}

.board-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 28px 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    color: var(--neutral-800);
    transition: all var(--dur) var(--ease);
    position: relative;
    overflow: hidden
}

.board-card:hover {
    border-color: #d1d5db;
    color: var(--neutral-900)
}

.board-icon {
    font-size: 2.2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #f3f4f6;
    color: #374151
}

.board-card h3 {
    font-size: 1rem;
    font-weight: 700
}

.board-card p {
    font-size: .82rem;
    color: var(--neutral-500);
    text-align: center
}

/* Popular Calculators */
.popular-calcs {
    padding: 32px 0 48px;
    background: #fff
}

.popular-calcs h2 {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px
}

.popular-calcs .section-sub {
    text-align: center;
    color: var(--neutral-500);
    margin-bottom: 20px;
    font-size: 0.85rem
}

.calc-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px
}

.calc-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    transition: all var(--dur) var(--ease);
    text-decoration: none;
    color: var(--neutral-800)
}

.calc-link:hover {
    border-color: #d1d5db;
    color: var(--neutral-900)
}

.calc-link-icon {
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f3f4f6;
    flex-shrink: 0;
    color: #374151
}

.calc-link h3 {
    font-size: .95rem;
    font-weight: 600
}

.calc-link p {
    font-size: .82rem;
    color: var(--neutral-500);
    margin-top: 2px
}

/* How it works */
.how-section {
    padding: 60px 0;
    background: #fff
}

.how-section h2 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 40px
}

.how-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
    text-align: center
}

.how-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px
}

.step-num {
    width: 48px;
    height: 48px;
    background: #111;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem
}

.how-step h3 {
    font-size: 1rem;
    font-weight: 600
}

.how-step p {
    font-size: .88rem;
    color: var(--neutral-500);
    max-width: 260px
}

/* Features */
.features-section {
    padding: 60px 0
}

.features-section h2 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 36px
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px
}

.feature-card {
    padding: 24px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    transition: all var(--dur) var(--ease)
}

.feature-card:hover {
    border-color: #d1d5db
}

.feature-icon {
    font-size: 1.6rem;
    margin-bottom: 12px
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px
}

.feature-card p {
    font-size: .85rem;
    color: var(--neutral-500);
    line-height: 1.6
}

/* Calculator hero & body */
.calc-hero {
    padding: 40px 0 24px;
    text-align: center;
    background: #f5f5f5
}

.calc-title {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--neutral-900);
    margin-bottom: 8px
}

.calc-intro {
    font-size: .95rem;
    color: var(--neutral-600);
    max-width: 600px;
    margin: 0 auto 20px;
    line-height: 1.7
}

.calc-hero-actions {
    display: inline-flex;
    gap: 10px;
    margin-bottom: 16px
}

.mode-toggle {
    display: inline-flex;
    background: var(--neutral-200);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 2px
}

.mode-btn {
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: .85rem;
    color: var(--neutral-600);
    transition: all var(--dur) var(--ease)
}

.mode-btn.active {
    background: #fff;
    color: #111;
    border: 1px solid #e5e7eb
}

.calc-body {
    padding: 24px 0 100px
}

/* Subject cards */
.subject-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px
}

.neb-grade-ui {
    background: linear-gradient(135deg, #fff7ed, #fef9c3);
    border: 1px solid #fcd34d;
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    margin: 0 0 16px;
    font-family: 'Manrope', sans-serif
}

.neb-grade-ui .neb-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px
}

.neb-grade-ui .input-field label {
    font-weight: 600;
    color: var(--neutral-700)
}

.neb-grade-ui input,
.neb-grade-ui select,
.subject-card .grade-select {
    width: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    color: var(--neutral-800);
    box-shadow: inset 0 1px 0 rgba(15, 23, 42, .03)
}

.subject-card .grade-select {
    background-image: linear-gradient(135deg, rgba(251, 191, 36, .12), rgba(253, 230, 138, .12));
    border-color: #f3f4f6
}

.marks-hidden {
    display: none
}

.subject-cards[data-input-mode="grade"] .remove-subject-btn,
.subject-cards[data-input-mode="grade"] .card-advanced {
    display: none
}

.subject-cards[data-input-mode="grade"] + .add-subject-btn {
    display: none
}

.subject-cards[data-input-mode="grade"] .input-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px
}

.subject-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: all var(--dur) var(--ease);
    animation: cardSlideIn var(--dur) var(--ease) both
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.subject-card:hover {
    border-color: #d1d5db
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--neutral-100)
}

.card-number {
    width: 28px;
    height: 28px;
    background: #f3f4f6;
    color: #374151;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
    flex-shrink: 0
}

.subject-name {
    flex: 1;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 2px 8px;
    padding-right: 28px;
    font-weight: 600;
    font-size: .95rem;
    color: var(--neutral-800);
    background: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'%3E%3C/path%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: all var(--dur) var(--ease);
    cursor: pointer;
    text-overflow: ellipsis;
}

.subject-name:hover {
    background-color: var(--neutral-100);
    border-color: var(--neutral-300);
}

.subject-name:focus {
    background-color: #fff;
    border-color: #9ca3af;
    outline: none;
    cursor: text;
    background-image: none;
}

.remove-subject-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.1rem;
    color: var(--neutral-400);
    transition: all var(--dur) var(--ease);
    display: flex;
    align-items: center;
    justify-content: center
}

.remove-subject-btn:hover {
    background: var(--error);
    color: #fff
}

.card-body {
    padding: 12px 16px 16px
}

.input-group {
    display: flex;
    gap: 12px
}

.input-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px
}

.input-field label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--neutral-500);
    text-transform: uppercase;
    letter-spacing: .04em
}

.input-field input[type="number"],
.input-field input[type="text"],
.input-field select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--neutral-200);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    color: var(--neutral-800);
    background: var(--neutral-50);
    transition: all var(--dur) var(--ease);
    -moz-appearance: textfield;
    appearance: textfield;
}

.input-field input::-webkit-outer-spin-button,
.input-field input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0
}

.input-field input:focus,
.input-field select:focus {
    outline: none;
    border-color: #9ca3af;
    background: #fff
}

.card-advanced {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--neutral-200)
}

.card-result {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--neutral-100)
}

.card-grade {
    font-size: .85rem;
    font-weight: 700;
    color: var(--neutral-500);
    padding: 4px 10px;
    background: var(--neutral-100);
    border-radius: var(--radius-sm);
    transition: all var(--dur) var(--ease)
}

.card-gpa {
    font-size: .85rem;
    font-weight: 700;
    color: #111
}

.add-subject-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    color: #6b7280;
    font-weight: 600;
    font-size: .9rem;
    transition: all var(--dur) var(--ease);
    margin-bottom: 16px
}

.add-subject-btn:hover {
    border-color: #9ca3af;
    color: #374151;
    background: #f9fafb
}

.add-icon {
    width: 24px;
    height: 24px;
    background: #f3f4f6;
    color: #374151;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700
}

/* Sticky result */
.sticky-result {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: #fff;
    border-top: 1px solid var(--neutral-200);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all .4s var(--ease)
}

.result-gpa {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px
}

.result-label {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--neutral-500)
}

.result-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #111;
    letter-spacing: -.02em;
    transition: color var(--dur) var(--ease)
}

.result-grade {
    display: flex;
    align-items: center
}

.grade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: .85rem;
    background: var(--neutral-200);
    color: var(--neutral-600);
    transition: all var(--dur) var(--ease)
}

.grade-aplus,
.grade-a {
    background: #f0f9ff;
    color: #1e40af
}

.grade-bplus,
.grade-b {
    background: #f3f4f6;
    color: #374151
}

.grade-cplus,
.grade-c {
    background: #fef3c7;
    color: #92400e
}

.grade-d {
    background: #fed7aa;
    color: #9a3412
}

.grade-ng,
.grade-f {
    background: #fecaca;
    color: var(--error)
}

.result-message {
    flex: 1;
    font-size: .85rem;
    color: var(--neutral-600);
    line-height: 1.4
}

.result-actions {
    display: flex;
    gap: 4px
}

/* Semester tabs */
.semester-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px
}

.semester-tab {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: .88rem;
    color: var(--neutral-500);
    background: var(--neutral-100);
    white-space: nowrap;
    transition: all var(--dur) var(--ease)
}

.semester-tab.active {
    background: #111;
    color: #fff
}

.add-semester-btn {
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    color: #374151;
    background: #f3f4f6;
    transition: all var(--dur) var(--ease)
}

.add-semester-btn:hover {
    background: #e5e7eb
}

.semester-panel {
    display: none
}

.semester-panel.active {
    display: block
}

.cgpa-result-bar {
    margin-top: 24px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb
}

.cgpa-semester-results {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px
}

.cgpa-sem-chip {
    padding: 6px 12px;
    background: #f3f4f6;
    border-radius: 8px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--neutral-700);
    border: 1px solid #e5e7eb
}

.cgpa-final {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb
}

.cgpa-final .label {
    font-weight: 600;
    color: var(--neutral-700)
}

.cgpa-value {
    font-size: 2rem;
    font-weight: 800;
    color: #111
}

/* What-if */
.whatif-panel {
    margin-top: 32px;
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--neutral-200);
    overflow: hidden
}

.whatif-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 18px 20px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--neutral-800);
    transition: background var(--dur) var(--ease)
}

.whatif-toggle:hover {
    background: var(--neutral-50)
}

.whatif-toggle .chevron {
    transition: transform var(--dur) var(--ease)
}

.whatif-toggle.open .chevron {
    transform: rotate(180deg)
}

.whatif-body {
    padding: 0 20px 20px
}

.whatif-body[hidden] {
    display: none
}

.whatif-desc {
    font-size: .88rem;
    color: var(--neutral-500);
    margin-bottom: 16px
}

.whatif-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 16px
}

.whatif-inputs input[type="range"] {
    width: 100%;
    accent-color: #111;
    height: 6px
}

.range-value {
    display: inline-block;
    font-weight: 700;
    color: #111;
    margin-top: 4px
}

.whatif-result {
    padding: 16px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb
}

.whatif-result p {
    font-size: .9rem;
    color: var(--neutral-700)
}

.whatif-result .needed-gpa {
    font-size: 1.5rem;
    font-weight: 800;
    color: #111;
    margin-top: 4px
}

/* Trust box */
.trust-box {
    margin-top: 32px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb
}

.trust-box h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--neutral-800)
}

.trust-box ul {
    display: flex;
    flex-direction: column;
    gap: 6px
}

.trust-box li {
    font-size: .85rem;
    color: var(--neutral-600);
    padding-left: 16px;
    position: relative
}

.trust-box li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #111;
    font-weight: 700
}

.trust-box a {
    color: #111;
    font-weight: 500
}

.trust-meta {
    margin-top: 12px;
    font-size: .78rem;
    color: var(--neutral-400)
}

/* Scale table */
.scale-reference {
    margin-top: 32px
}

.scale-reference h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px
}

.scale-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--neutral-200)
}

.scale-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem
}

.scale-table th {
    text-align: left;
    padding: 10px 14px;
    background: var(--neutral-100);
    font-weight: 600;
    color: var(--neutral-700);
    border-bottom: 1px solid var(--neutral-200)
}

.scale-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--neutral-100);
    color: var(--neutral-700)
}

.scale-table tr:last-child td {
    border-bottom: none
}

.scale-table tr:hover td {
    background: var(--neutral-50)
}

/* Converter */
.converter-card {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 32px
}

.converter-inputs {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 20px
}

.converter-arrow {
    font-size: 1.5rem;
    color: #374151;
    font-weight: 700;
    padding-bottom: 10px
}

.converter-result {
    padding: 16px;
    background: #f9fafb;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 24px;
    border: 1px solid #e5e7eb
}

.converter-result p {
    font-size: .95rem;
    color: var(--neutral-700)
}

.converter-result .big {
    font-size: 2rem;
    font-weight: 800;
    color: #111
}

.converter-scale-info {
    margin-top: 20px
}

.converter-scale-info h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px
}

/* Table-style calculator panels */
.calc-panel {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 20px;
    margin-bottom: 18px
}

.panel-header h2 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--neutral-900)
}

.panel-header p {
    font-size: .85rem;
    color: var(--neutral-500)
}

.table-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px
}

.table-row {
    display: grid;
    grid-template-columns: 2.2fr .8fr 1fr .8fr 40px;
    gap: 10px;
    align-items: center
}

.cgpa-table .table-row {
    grid-template-columns: 1.6fr 1fr 1fr 40px
}

.points-output {
    background: #f9fafb;
    color: var(--neutral-600)
}

.table-row.table-head {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--neutral-500)
}

.table-row input[type="text"],
.table-row input[type="number"],
.table-row select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--neutral-200);
    border-radius: var(--radius-sm);
    background: var(--neutral-50);
    font-size: .95rem;
    color: var(--neutral-800)
}

.table-row input:focus,
.table-row select:focus {
    outline: none;
    border-color: #9ca3af;
    background: #fff
}

.table-remove {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--neutral-400);
    transition: all var(--dur) var(--ease)
}

.table-remove:hover {
    background: #fee2e2;
    color: var(--error)
}

.add-row-btn {
    width: 100%;
    padding: 14px;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    color: #6b7280;
    font-weight: 600;
    font-size: .9rem;
    transition: all var(--dur) var(--ease)
}

.add-row-btn:hover {
    border-color: #9ca3af;
    color: #374151;
    background: #f9fafb
}

.calc-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 6px 0 20px
}

.calc-actions .btn-primary {
    flex: 1
}

/* Result cards */
.result-card-wrap {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    margin: 12px 0 24px
}

.result-header {
    background: #1e66c2;
    color: #fff;
    padding: 16px 20px
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px
}

.result-download {
    padding: 8px 12px;
    border-radius: 8px;
    background: #fff;
    color: #1e66c2;
    font-weight: 700;
    font-size: .78rem;
    border: 1px solid rgba(255, 255, 255, .5)
}

.result-download:hover {
    background: #e0ecff
}

.result-header h3 {
    font-size: 1rem;
    font-weight: 700
}

.result-header p {
    font-size: .78rem;
    opacity: .9
}

.result-grid-lg {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    padding: 16px
}

.result-box {
    border-radius: 12px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 6px
}

.result-box.accent {
    background: #eef4ff;
    border-color: #dbe7ff
}

.result-box.green {
    background: #ecfdf5;
    border-color: #bbf7d0
}

.result-box.soft {
    background: #f5f3ff;
    border-color: #e9d5ff
}

.result-number {
    font-size: 2rem;
    font-weight: 800;
    color: #1e40af
}

.result-box.green .result-number {
    color: #059669
}

.result-box.soft .result-number {
    color: #7c3aed
}

.result-sub {
    font-size: .78rem;
    color: var(--neutral-600)
}

.result-tag {
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e5f7ed;
    color: #059669;
    font-size: .72rem;
    font-weight: 700
}

.result-formula {
    font-size: .72rem;
    color: var(--neutral-500)
}

.result-grid-sm {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    padding: 0 16px 16px
}

.result-stat {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px
}

.stat-label {
    font-size: .72rem;
    color: var(--neutral-500);
    text-transform: uppercase;
    letter-spacing: .06em
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--neutral-800)
}

.stat-pill {
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff7ed;
    color: #c2410c;
    font-size: .72rem;
    font-weight: 700
}

.result-scale {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    padding: 0 16px 16px
}

.scale-chip {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
    text-align: center;
    font-size: .72rem;
    font-weight: 700;
    color: var(--neutral-600)
}

.result-bars {
    padding: 0 16px 16px;
    display: grid;
    gap: 10px
}

.bar-row {
    display: grid;
    grid-template-columns: 110px 1fr 40px;
    gap: 10px;
    align-items: center
}

.bar-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--neutral-700)
}

.bar-track {
    height: 12px;
    background: #f3f4f6;
    border-radius: 999px;
    overflow: hidden
}

.bar-fill {
    height: 100%;
    background: #f97316;
    border-radius: 999px
}

.bar-value {
    font-size: .8rem;
    font-weight: 700;
    color: var(--neutral-700)
}

/* Percentage conversion table */
.percent-hero {
    padding: 16px;
    margin: 16px;
    border-radius: 12px;
    background: #eff6ff;
    text-align: center
}

.percent-big {
    font-size: 2.2rem;
    font-weight: 800;
    color: #1d4ed8
}

.percent-note {
    font-size: .85rem;
    color: var(--neutral-600)
}

.result-table {
    padding: 0 16px 16px
}

.result-row {
    display: grid;
    grid-template-columns: 1.5fr .6fr .5fr .7fr;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #e5e7eb
}

.result-row:last-child {
    border-bottom: none
}

.result-head {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--neutral-500)
}

.result-row .system strong {
    display: block;
    font-size: .85rem
}

.result-row .system span {
    font-size: .72rem;
    color: var(--neutral-500)
}

.result-row .gpa {
    font-weight: 800;
    color: #2563eb
}

.result-row .grade {
    font-weight: 700;
    color: var(--neutral-700)
}

.result-row .class {
    font-size: .72rem;
    font-weight: 700;
    color: #1d4ed8;
    background: #dbeafe;
    padding: 4px 8px;
    border-radius: 999px;
    justify-self: start
}

.formula-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
    padding: 0 16px 16px
}

.formula-chip {
    padding: 10px 12px;
    border-radius: 10px;
    background: #f1f5f9;
    font-size: .78rem;
    color: var(--neutral-600)
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 12px
}

.result-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 6px
}

.result-card .result-label,
.result-single .result-label {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--neutral-500)
}

.result-card .result-value,
.result-single .result-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #111
}

.result-single {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0
}

.quick-select {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px
}

.chip-btn {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--neutral-200);
    background: #fff;
    font-weight: 600;
    font-size: .85rem;
    color: var(--neutral-700);
    transition: all var(--dur) var(--ease)
}

.chip-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db
}

.percent-input-wrap {
    position: relative
}

.percent-input-wrap .percent-suffix {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 700;
    color: var(--neutral-500)
}

.percent-input-wrap input {
    padding-right: 36px
}

.percent-inputs {
    margin-top: 12px
}

/* Calculator info sections */
.calc-section {
    margin-top: 28px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb
}

.calc-section h2 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--neutral-900)
}

.section-lead {
    font-size: .9rem;
    color: var(--neutral-600);
    margin-bottom: 12px
}

.section-note {
    font-size: .78rem;
    color: var(--neutral-500);
    margin-top: 10px
}

.howto-steps {
    counter-reset: step;
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
    padding-left: 0
}

.howto-steps li {
    counter-increment: step;
    padding-left: 28px;
    position: relative;
    font-size: .9rem;
    color: var(--neutral-700)
}

.howto-steps li::before {
    content: counter(step) '.';
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 700;
    color: #111
}

.support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px
}

.support-card {
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--neutral-200);
    background: var(--neutral-50)
}

.support-card h3 {
    font-size: .9rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--neutral-800)
}

.support-card ul {
    display: flex;
    flex-direction: column;
    gap: 6px
}

.support-card li {
    font-size: .82rem;
    color: var(--neutral-600)
}

.support-formula {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px dashed var(--neutral-200);
    background: #fff;
    font-size: .82rem;
    font-weight: 600;
    color: var(--neutral-800);
    font-family: 'Courier New', monospace
}

.support-card[data-variant="blue"] {
    background: #eff6ff;
    border-color: #bfdbfe
}

.support-card[data-variant="green"] {
    background: #ecfdf5;
    border-color: #bbf7d0
}

.support-card[data-variant="purple"] {
    background: #f5f3ff;
    border-color: #ddd6fe
}

.support-card[data-variant="yellow"] {
    background: #fef9c3;
    border-color: #fde68a
}

.formula-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #f9fafb
}

.formula-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--neutral-500)
}

.formula-text {
    font-size: .92rem;
    font-weight: 700;
    color: #111;
    font-family: 'Courier New', monospace
}

.info-points {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 12px
}

.info-point {
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #f9fafb
}

.info-point .info-label {
    display: block;
    font-size: .85rem;
    font-weight: 700;
    color: var(--neutral-800);
    margin-bottom: 6px
}

.info-point p {
    font-size: .82rem;
    color: var(--neutral-600)
}

.quick-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--neutral-200)
}

.quick-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem
}

.quick-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--neutral-100);
    font-weight: 700;
    color: var(--neutral-700)
}

.quick-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--neutral-100);
    color: var(--neutral-700)
}

.quick-table tr:last-child td {
    border-bottom: none
}

.why-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px
}

.why-list li {
    font-size: .9rem;
    color: var(--neutral-700);
    padding-left: 18px;
    position: relative
}

.why-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--neutral-400)
}

.callout-note {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #fed7aa;
    background: #fff7ed;
    color: #9a3412;
    font-size: .85rem;
    font-weight: 600
}

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

.related-cta {
    font-size: .85rem;
    font-weight: 600;
    color: var(--neutral-600)
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px
}

.tool-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--neutral-200);
    background: #fff;
    text-decoration: none;
    color: var(--neutral-800);
    transition: all var(--dur) var(--ease)
}

.tool-card:hover {
    border-color: #d1d5db;
    background: #f9fafb
}

.tool-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--neutral-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem
}

.tool-card h3 {
    font-size: .9rem;
    font-weight: 700;
    margin-bottom: 4px
}

.tool-card p {
    font-size: .8rem;
    color: var(--neutral-600)
}

/* FAQ */
.faq-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--neutral-200)
}

.faq-section h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--neutral-900)
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px
}

.faq-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all var(--dur) var(--ease)
}

.faq-item[open] {
    border-color: #d1d5db
}

.faq-item summary {
    padding: 16px 20px;
    font-weight: 600;
    font-size: .95rem;
    color: var(--neutral-800);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background var(--dur) var(--ease)
}

.faq-item summary:hover {
    background: var(--neutral-50)
}

.faq-item summary::-webkit-details-marker {
    display: none
}

.faq-item summary::after {
    content: '+';
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--neutral-400);
    transition: transform var(--dur) var(--ease)
}

.faq-item[open] summary::after {
    transform: rotate(45deg)
}

.faq-answer {
    padding: 0 20px 16px;
    font-size: .9rem;
    color: var(--neutral-600);
    line-height: 1.7
}

/* Footer */
.site-footer {
    background: #fff;
    color: #6b7280;
    padding: 60px 0 0;
    margin-top: auto
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px
}

.footer-brand p {
    margin-top: 12px;
    font-size: .88rem;
    line-height: 1.6;
    color: #6b7280
}

.footer-contact {
    margin-top: 10px;
    font-size: .85rem;
    color: #6b7280
}

.footer-contact a {
    color: #111;
    font-weight: 600
}

.footer-brand .logo {
    color: #111
}

.footer-brand .logo-accent {
    color: #111
}

.footer-links h4 {
    color: #111;
    font-size: .9rem;
    font-weight: 700;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: .04em
}

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

.footer-links a {
    font-size: .85rem;
    color: #6b7280;
    transition: color var(--dur) var(--ease)
}

.footer-links a:hover {
    color: #111
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-top: 1px solid #e5e7eb;
    font-size: .82rem
}

.footer-version {
    color: #9ca3af
}

/* 404 */
.error-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center
}

.error-content {
    max-width: 400px
}

.error-code {
    font-size: 6rem;
    font-weight: 800;
    color: #111;
    line-height: 1;
    margin-bottom: 16px
}

.error-message {
    font-size: 1.1rem;
    color: var(--neutral-600);
    margin-bottom: 24px
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.animate-in {
    animation: fadeUp .5s var(--ease) both
}

/* Responsive */
@media(max-width:768px) {
    .main-nav {
        display: none
    }

    .mobile-menu-btn {
        display: flex
    }

    .hero {
        padding: 56px 0 40px
    }

    .hero h1 {
        font-size: 1.8rem
    }

    .board-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px
    }

    .board-card {
        padding: 20px 14px
    }

    .calc-list {
        grid-template-columns: 1fr
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px
    }

    .converter-inputs {
        flex-direction: column;
        align-items: stretch
    }

    .converter-arrow {
        text-align: center;
        transform: rotate(90deg)
    }

    .table-row {
        grid-template-columns: 1fr;
        gap: 8px
    }

    .cgpa-table .table-row {
        grid-template-columns: 1fr
    }

    .table-row.table-head {
        display: none
    }

    .calc-actions {
        flex-direction: column
    }

    .calc-actions .btn {
        width: 100%
    }

    .result-row {
        grid-template-columns: 1fr;
        gap: 6px
    }

    .result-head {
        display: none
    }

    .bar-row {
        grid-template-columns: 1fr
    }

    .related-header {
        flex-direction: column;
        align-items: flex-start
    }

    .sticky-result {
        padding: 10px 16px;
        gap: 10px
    }

    .result-value {
        font-size: 1.5rem
    }

    .result-message {
        display: none
    }

    .whatif-inputs {
        grid-template-columns: 1fr 1fr
    }
}

@media(max-width:480px) {
    .board-grid {
        grid-template-columns: 1fr
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px
    }

    .input-group {
        flex-direction: column
    }

    .how-steps {
        grid-template-columns: 1fr
    }

    .hero-cta {
        flex-direction: column;
        width: 100%
    }

    .hero-cta .btn {
        width: 100%
    }

    .whatif-inputs {
        grid-template-columns: 1fr
    }

    .cgpa-semester-results {
        flex-direction: column
    }
}

@media print {

    .site-header,
    .site-footer,
    .sticky-result,
    .whatif-panel,
    .add-subject-btn,
    .result-actions,
    .mobile-nav-drawer,
    .mode-toggle,
    .mobile-menu-btn,
    .history-panel,
    .share-card-modal,
    .toast,
    .progress-indicator {
        display: none !important
    }

    body {
        background: #fff
    }

    .subject-card {
        break-inside: avoid;
        border: 1px solid #ccc
    }
}

/* ═══════════════════════════════════════════════════════════
   V2 — Dark Mode
   ═══════════════════════════════════════════════════════════ */


/* ═══════════════════════════════════════════════════════════
   V2 — TU Sub-Program Cards
   ═══════════════════════════════════════════════════════════ */
.tu-programs {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    padding: 16px 0 0
}

.tu-program-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    background: #fff;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--neutral-200);
    text-decoration: none;
    color: var(--neutral-800);
    font-weight: 600;
    font-size: .85rem;
    transition: all var(--dur) var(--ease)
}

.tu-program-card:hover {
    border-color: #d1d5db;
    color: #111
}

.tu-program-card .prog-icon {
    font-size: 1.15rem
}

/* ═══════════════════════════════════════════════════════════
   V2 — GPA Explainer Section
   ═══════════════════════════════════════════════════════════ */
.explainer-section {
    padding: 64px 0;
    background: #fff
}

.explainer-section h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 32px;
    text-align: center;
    color: var(--neutral-900)
}

.explainer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start
}

.explainer-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e5e7eb
}

.explainer-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--neutral-900)
}

.formula-box {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: #111;
    border: 1px dashed #d1d5db;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
    letter-spacing: .02em
}

.explainer-steps {
    display: flex;
    flex-direction: column;
    gap: 14px
}

.explainer-step {
    display: flex;
    gap: 12px;
    align-items: flex-start
}

.explainer-step .step-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .72rem;
    flex-shrink: 0
}

.explainer-step p {
    font-size: .85rem;
    color: var(--neutral-600);
    line-height: 1.55
}

.explainer-step strong {
    color: var(--neutral-800)
}

/* Grade comparison table */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
    margin-top: 12px
}

.comparison-table th {
    text-align: left;
    padding: 10px 12px;
    background: #f3f4f6;
    font-weight: 600;
    color: #111;
    border-bottom: 2px solid #e5e7eb;
    font-size: .75rem;
    letter-spacing: .04em;
    text-transform: uppercase
}

.comparison-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--neutral-200);
    color: var(--neutral-600)
}

.comparison-table tr:last-child td {
    border-bottom: none
}

.comparison-table tr:hover td {
    background: var(--neutral-100)
}

/* ═══════════════════════════════════════════════════════════
   V2 — Progress Indicator
   ═══════════════════════════════════════════════════════════ */
.progress-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 0 16px;
    font-size: .82rem;
    font-weight: 500;
    color: var(--neutral-400)
}

.progress-bar-wrap {
    flex: 1;
    max-width: 200px;
    height: 4px;
    background: var(--neutral-100);
    border-radius: 999px;
    overflow: hidden
}

.progress-bar-fill {
    height: 100%;
    background: #111;
    border-radius: 999px;
    transition: width .35s var(--ease)
}

/* ═══════════════════════════════════════════════════════════
   V2 — History Panel
   ═══════════════════════════════════════════════════════════ */
.history-panel {
    margin-top: 40px;
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--neutral-200);
    overflow: hidden
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--neutral-200)
}

.history-header h3 {
    font-size: .92rem;
    font-weight: 700;
    color: var(--neutral-800)
}

.history-clear-btn {
    font-size: .78rem;
    font-weight: 600;
    color: var(--error);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--dur) var(--ease)
}

.history-clear-btn:hover {
    background: #fef2f2
}

.history-list {
    max-height: 300px;
    overflow-y: auto
}

.history-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--neutral-200);
    transition: background var(--dur) var(--ease);
    text-decoration: none;
    color: var(--neutral-800)
}

.history-item:last-child {
    border-bottom: none
}

.history-item:hover {
    background: var(--neutral-100)
}

.history-gpa {
    font-size: 1.1rem;
    font-weight: 800;
    color: #111;
    min-width: 50px
}

.history-info {
    flex: 1
}

.history-info .hist-program {
    font-size: .85rem;
    font-weight: 600
}

.history-info .hist-date {
    font-size: .72rem;
    color: var(--neutral-400)
}

.history-empty {
    padding: 32px;
    text-align: center;
    color: var(--neutral-400);
    font-size: .85rem
}

/* ═══════════════════════════════════════════════════════════
   V2 — Share Card Modal
   ═══════════════════════════════════════════════════════════ */
.share-card-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur) var(--ease)
}

.share-card-modal.visible {
    opacity: 1;
    pointer-events: all
}

.share-card-inner {
    background: #fff;
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 420px;
    width: 100%;
    transform: scale(.95);
    transition: transform var(--dur) var(--ease)
}

.share-card-modal.visible .share-card-inner {
    transform: scale(1)
}

.share-card-preview {
    display: flex;
    justify-content: center;
    margin-bottom: 24px
}

.share-card-preview canvas {
    border-radius: var(--radius-md);
    max-width: 100%;
    border: 1px solid #e5e7eb
}

.share-card-actions {
    display: flex;
    gap: 8px;
    justify-content: center
}

.share-card-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--neutral-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--neutral-500);
    transition: all var(--dur) var(--ease)
}

.share-card-close:hover {
    background: var(--neutral-200);
    color: var(--neutral-800)
}

/* ═══════════════════════════════════════════════════════════
   V2 — Toast Notification
   ═══════════════════════════════════════════════════════════ */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: #fff;
    color: #111;
    padding: 12px 24px;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    opacity: 0;
    pointer-events: none;
    transition: all .35s var(--ease);
    z-index: 150;
    white-space: nowrap
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: all
}

/* ═══════════════════════════════════════════════════════════
   V2 — Enhanced Responsive
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .explainer-grid {
        grid-template-columns: 1fr
    }

    .tu-programs {
        grid-template-columns: repeat(2, 1fr)
    }
}

@media (max-width: 480px) {
    .tu-programs {
        grid-template-columns: 1fr
    }

    .features-grid {
        grid-template-columns: 1fr
    }

    .comparison-table {
        font-size: .75rem
    }

    .comparison-table th,
    .comparison-table td {
        padding: 6px 8px
    }
}

@media (max-width: 320px) {
    html {
        font-size: 14px
    }
}

/* ═══════════════════════════════════════════════════════════
   V2 — Blog / Grading Guides
   ═══════════════════════════════════════════════════════════ */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.blog-card {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--neutral-200);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all var(--dur) var(--ease);
    text-decoration: none;
    color: var(--neutral-800);
    height: 100%;
}

.blog-card:hover {
    border-color: #d1d5db
}

.blog-card-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.blog-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--neutral-900);
    transition: color var(--dur) var(--ease);
}

.blog-card:hover h3 {
    color: #111
}

.blog-card p {
    font-size: 0.95rem;
    color: var(--neutral-600);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 16px;
}

.blog-meta {
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--neutral-500);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.blog-meta::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #111;
    border-radius: 50%;
}

@media (max-width: 640px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
}

/* Hide ad placeholders until AdSense approval (remove this rule after approval) */
.ad-slot,
.ad-label {
    display: none !important;
}