/* =========================================================
   GLOBAL RESET
========================================================= */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: #f6f8fc;
    color: #172033;

    line-height: 1.6;

    -webkit-font-smoothing: antialiased;

    /* FIX: a single very long unbreakable token (e.g. a long
       placeholder-less number, long URL, etc.) could otherwise
       force horizontal scroll on narrow phones. */
    overflow-x: hidden;
}

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

button,
input {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

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


/* =========================================================
   VARIABLES
========================================================= */

:root {

    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;

    --text: #172033;
    --text-soft: #607086;
    --text-muted: #8793a5;

    --border: #e4e9f0;
    --border-dark: #d5dce7;

    --white: #ffffff;

    --page: #f6f8fc;

    --success: #16a34a;

    --danger: #dc2626;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;

    --shadow-sm:
        0 4px 16px rgba(20, 40, 70, 0.05);

    --shadow-md:
        0 12px 35px rgba(20, 40, 70, 0.08);

    --container: 1180px;
}


/* =========================================================
   CONTAINER
========================================================= */

.container {
    width: min(
        var(--container),
        calc(100% - 40px)
    );

    margin-left: auto;
    margin-right: auto;
}


/* =========================================================
   HEADER
========================================================= */

.site-header {
    position: sticky;
    top: 0;

    z-index: 1000;

    background: rgba(255, 255, 255, 0.96);

    border-bottom: 1px solid var(--border);

    backdrop-filter: blur(12px);
}

.header-inner {
    min-height: 72px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 25px;
}


/* LOGO */

.site-logo {
    display: inline-flex;
    align-items: center;

    gap: 10px;

    flex-shrink: 0;

    font-size: 18px;
    font-weight: 800;
}

.logo-mark {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border-radius: 10px;

    background: var(--primary);

    color: white;

    font-size: 17px;
    font-weight: 800;

    flex-shrink: 0;
}

.logo-text {
    white-space: nowrap;
}


/* NAV */

.main-navigation {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 9px 13px;

    border-radius: 8px;

    color: var(--text-soft);

    font-size: 14px;
    font-weight: 650;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
}


/* MOBILE MENU BUTTON */

.mobile-menu-button {
    display: none;

    width: 42px;
    height: 42px;

    padding: 9px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: white;

    cursor: pointer;

    flex-shrink: 0;
}

.mobile-menu-button span {
    display: block;

    height: 2px;

    margin: 5px 0;

    background: var(--text);

    border-radius: 5px;
}


/* MOBILE NAV */

.mobile-navigation {
    display: none;

    background: white;

    border-bottom: 1px solid var(--border);

    padding: 8px 20px;

    /* FIX: stick under the sticky header and sit above page
       content so it doesn't get pushed around / overlapped
       when opened. */
    position: sticky;
    top: 0;
    z-index: 999;
}

.mobile-navigation a {
    display: block;

    padding: 12px;

    border-radius: 8px;

    color: var(--text-soft);

    font-size: 14px;
    font-weight: 650;
}

.mobile-navigation a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.mobile-navigation.open {
    display: block;
}


/* =========================================================
   HERO
========================================================= */

.hero-section {
    padding: 65px 0 80px;

    background:
        linear-gradient(
            180deg,
            #edf5ff 0%,
            #f6f8fc 100%
        );
}

.hero-content {
    max-width: 760px;

    margin: 0 auto;

    text-align: center;
}

.hero-badge {
    display: inline-flex;

    align-items: center;

    padding: 6px 13px;

    margin-bottom: 17px;

    border-radius: 50px;

    background: #dbeafe;

    color: var(--primary);

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 0.7px;
}

.hero-content h1 {
    margin-bottom: 17px;

    font-size:
        clamp(40px, 5vw, 62px);

    line-height: 1.04;

    letter-spacing: -2.5px;
}

.hero-content p {
    max-width: 650px;

    margin: auto;

    color: var(--text-soft);

    font-size:
        clamp(16px, 2vw, 19px);
}


/* =========================================================
   WEBSITE MAIN LAYOUT
========================================================= */

.website-section {
    padding: 0 0 85px;
}


/*
    IMPORTANT:

    Main content = 1fr
    Sidebar = 320px

    This gives us a professional tools-site layout
    while keeping enough width for calculator content.
*/

.website-layout {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        320px;

    gap: 30px;

    align-items: start;

    margin-top: -35px;
}


/* =========================================================
   MAIN CONTENT
========================================================= */

.main-content {
    min-width: 0;
}


/* =========================================================
   CALCULATOR CARD
========================================================= */

.calculator-card {
    padding: 34px;

    background: var(--white);

    border: 1px solid var(--border);

    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-md);
}


/* SECTION HEADING */

.section-heading {
    margin-bottom: 30px;
}

.section-label {
    display: inline-block;

    margin-bottom: 7px;

    color: var(--primary);

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 0.8px;
}

.section-heading h2 {
    margin-bottom: 5px;

    font-size: 27px;

    line-height: 1.25;
}

.section-heading p {
    color: var(--text-soft);

    font-size: 14px;
}


/* =========================================================
   SCALE SELECTOR (NEW)
========================================================= */

.scale-selector {
    margin-bottom: 22px;

    padding: 16px;

    border: 1px solid var(--border);

    border-radius: var(--radius-md);

    background: #f8fafc;
}

.scale-selector-label {
    display: block;

    margin-bottom: 10px;

    color: var(--text);

    font-size: 12px;
    font-weight: 800;

    letter-spacing: 0.4px;

    text-transform: uppercase;
}

.scale-options {
    display: flex;

    flex-wrap: wrap;

    gap: 8px;
}

.scale-option {
    position: relative;

    flex: 1 1 130px;
}

.scale-option input {
    position: absolute;

    opacity: 0;

    width: 100%;
    height: 100%;

    margin: 0;

    cursor: pointer;
}

.scale-option span {
    display: flex;

    align-items: center;
    justify-content: center;

    min-height: 42px;

    padding: 8px 10px;

    border: 1px solid var(--border-dark);

    border-radius: 9px;

    background: white;

    color: var(--text-soft);

    font-size: 13px;
    font-weight: 700;

    text-align: center;

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

.scale-option input:checked + span {
    border-color: var(--primary);

    background: var(--primary-light);

    color: var(--primary);

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.10);
}

.scale-option input:focus-visible + span {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}


/* =========================================================
   SEMESTER TABLE
========================================================= */

.semester-table-heading,
.semester-row {
    display: grid;

    grid-template-columns:
        minmax(130px, 1.25fr)
        minmax(100px, 1fr)
        minmax(120px, 1fr)
        44px;

    gap: 14px;

    align-items: center;
}

.semester-table-heading {
    padding: 0 12px 9px;

    color: var(--text-muted);

    font-size: 11px;
    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 0.5px;
}


/* ROW */

.semester-row {
    padding: 14px 12px;

    margin-bottom: 11px;

    border: 1px solid var(--border);

    border-radius: var(--radius-md);

    background: white;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.semester-row:hover {
    border-color: #cbd5e1;

    box-shadow:
        0 5px 18px rgba(20, 40, 70, 0.04);
}


/* SEMESTER TITLE */

.semester-title {
    font-size: 14px;
    font-weight: 750;
}


/* FORM FIELD */

.form-field {
    min-width: 0;
}

.form-field label {
    display: none;

    margin-bottom: 5px;

    color: var(--text-soft);

    font-size: 11px;
    font-weight: 700;
}

.form-field input {
    width: 100%;
    height: 46px;

    padding: 0 12px;

    border: 1px solid var(--border-dark);

    border-radius: 9px;

    outline: none;

    background: white;

    color: var(--text);

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

/* FIX: input has no explicit font-size, so on iOS Safari
   the default inherited size (14-16px depending on zoom)
   can sometimes dip under 16px and trigger an automatic
   zoom-in on focus, which breaks the layout on mobile. */
.form-field input {
    font-size: 16px;
}

.form-field input::placeholder {
    color: #a5afbd;
}

.form-field input:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.10);
}

.form-field input.input-error {
    border-color: var(--danger);

    box-shadow:
        0 0 0 3px rgba(220, 38, 38, 0.10);
}


/* REMOVE */

.remove-semester {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    border: none;

    border-radius: 9px;

    background: #fff1f2;

    color: var(--danger);

    cursor: pointer;

    font-size: 22px;

    line-height: 1;

    transition: 0.2s ease;
}

.remove-semester:hover {
    background: #ffe4e6;
}


/* =========================================================
   ADD SEMESTER
========================================================= */

.add-semester-button {
    width: 100%;
    min-height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    margin-top: 16px;

    border: 1px dashed #b8c4d4;

    border-radius: 10px;

    background: #fafbfd;

    color: var(--primary);

    cursor: pointer;

    font-size: 14px;
    font-weight: 750;

    transition: 0.2s ease;
}

.add-semester-button:hover {
    border-color: var(--primary);

    background: var(--primary-light);
}

.plus-icon {
    font-size: 21px;
    line-height: 1;
}


/* =========================================================
   CALCULATE BUTTON
========================================================= */

.calculate-button {
    width: 100%;
    min-height: 52px;

    margin-top: 12px;

    border: none;

    border-radius: 10px;

    background: var(--primary);

    color: white;

    cursor: pointer;

    font-size: 15px;
    font-weight: 750;

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.calculate-button:hover {
    background: var(--primary-dark);

    transform: translateY(-1px);

    box-shadow:
        0 7px 18px rgba(37, 99, 235, 0.20);
}

.calculate-button:active {
    transform: translateY(0);
}


/* =========================================================
   RESULT
========================================================= */

.result-box {
    margin-top: 25px;

    padding: 28px;

    text-align: center;

    border: 1px solid #bfdbfe;

    border-radius: 14px;

    background:
        linear-gradient(
            135deg,
            #eff6ff,
            #f8fbff
        );
}

.result-title {
    color: var(--text-soft);

    font-size: 13px;
    font-weight: 700;
}

.cgpa-result {
    margin: 3px 0;

    color: var(--primary);

    font-size: 52px;
    font-weight: 850;

    line-height: 1.2;

    letter-spacing: -1px;

    /* FIX: allow the big number to shrink instead of
       overflowing its box on very narrow phones. */
    word-break: break-word;
}

.cgpa-scale-tag {
    display: inline-block;

    margin-top: 2px;

    color: var(--text-muted);

    font-size: 12px;
    font-weight: 700;
}

.result-message {
    color: var(--text-soft);

    font-size: 13px;
}


/* =========================================================
   CONTENT CARD
========================================================= */

.content-card {
    margin-top: 28px;

    padding: 38px;

    background: white;

    border: 1px solid var(--border);

    border-radius: var(--radius-lg);
}

.content-card h2 {
    margin-top: 48px;
    margin-bottom: 14px;

    font-size: 27px;

    line-height: 1.25;

    letter-spacing: -0.4px;
}

.content-card h2:first-of-type {
    margin-top: 0;
}

.content-card p {
    margin-bottom: 15px;

    color: var(--text-soft);

    font-size: 15px;
}


/* =========================================================
   FORMULA
========================================================= */

.formula-card {
    margin: 25px 0;

    padding: 25px;

    border: 1px solid var(--border);

    border-radius: 12px;

    background: #f8fafc;

    text-align: center;
}

.formula-title {
    margin-bottom: 8px;

    color: var(--text);

    font-size: 13px;
    font-weight: 750;
}

.formula {
    color: var(--primary);

    font-size: 18px;
    font-weight: 800;

    /* FIX: the formula line is long and used a fixed
       font-size, which could overflow narrow phones. */
    word-break: break-word;
}


/* =========================================================
   STEPS
========================================================= */

.steps-grid {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 15px;

    margin-top: 24px;
}

.step-card {
    padding: 23px;

    border: 1px solid var(--border);

    border-radius: 13px;

    background: white;
}

.step-number {
    margin-bottom: 12px;

    color: var(--primary);

    font-size: 12px;
    font-weight: 850;
}

.step-card h3 {
    margin-bottom: 7px;

    font-size: 17px;
}

.step-card p {
    margin: 0;

    font-size: 13px;
}


/* =========================================================
   FAQ
========================================================= */

.faq-list {
    margin-top: 20px;

    border-top: 1px solid var(--border);
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-question {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 19px 3px;

    border: none;

    background: transparent;

    color: var(--text);

    text-align: left;

    cursor: pointer;

    font-size: 15px;
    font-weight: 700;
}

.faq-icon {
    flex-shrink: 0;

    color: var(--primary);

    font-size: 21px;

    transition: transform 0.2s ease;
}

.faq-answer {
    display: none;

    padding: 0 3px 19px;
}

.faq-answer p {
    margin: 0;

    font-size: 14px;
}

.faq-item.open .faq-answer {
    display: block;
}

.faq-item.open .faq-icon {
    transform: rotate(45deg);
}


/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
    min-width: 0;

    position: sticky;

    top: 92px;

    display: flex;

    flex-direction: column;

    gap: 24px;

    /* FIX: on shorter viewports (laptops with small screen
       height, landscape tablets) a tall sticky sidebar could
       get clipped against the viewport with no way to scroll
       within itself. Cap its height and let it scroll. */
    max-height: calc(100vh - 112px);

    overflow-y: auto;
}


/* =========================================================
   ADVERTISEMENT
========================================================= */

.ad-container {
    width: 100%;
}

.ad-label {
    margin-bottom: 7px;

    color: #9aa5b5;

    font-size: 9px;
    font-weight: 700;

    text-align: center;

    text-transform: uppercase;

    letter-spacing: 0.8px;
}

.ad-box {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border);

    border-radius: 10px;

    background: #f9fafc;

    color: #b0b9c5;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.7px;
}

.ad-300 {
    min-height: 250px;
}


/*
    When AdSense code is inserted later,
    remove/replace the placeholder span.
*/


/* =========================================================
   SIDEBAR CARD
========================================================= */

.sidebar-card {
    padding: 20px;

    border: 1px solid var(--border);

    border-radius: 14px;

    background: white;

    box-shadow: var(--shadow-sm);
}

.sidebar-heading {
    margin-bottom: 15px;
}

.sidebar-heading > span {
    display: block;

    margin-bottom: 3px;

    color: var(--primary);

    font-size: 9px;
    font-weight: 850;

    letter-spacing: 0.8px;
}

.sidebar-heading h2 {
    font-size: 20px;

    line-height: 1.25;
}


/* =========================================================
   TOOLS LIST
========================================================= */

.tools-list {
    display: flex;

    flex-direction: column;

    gap: 4px;
}

.tool-item {
    display: grid;

    grid-template-columns:
        38px
        minmax(0, 1fr)
        18px;

    align-items: center;

    gap: 10px;

    padding: 10px 7px;

    border-radius: 9px;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.tool-item:hover {
    background: #f5f8fc;

    transform: translateX(2px);
}


/* TOOL ICON */

.tool-icon {
    width: 36px;
    height: 36px;

    display: grid;
    place-items: center;

    border-radius: 9px;

    background: var(--primary-light);

    color: var(--primary);

    font-size: 10px;
    font-weight: 850;
}


/* TOOL INFO */

.tool-info {
    min-width: 0;

    display: flex;

    flex-direction: column;
}

.tool-info strong {
    overflow: hidden;

    color: var(--text);

    font-size: 13px;

    white-space: nowrap;

    text-overflow: ellipsis;
}

.tool-info small {
    overflow: hidden;

    color: var(--text-muted);

    font-size: 10px;

    white-space: nowrap;

    text-overflow: ellipsis;
}

.tool-arrow {
    color: #a0aaba;

    font-size: 15px;
}


/* =========================================================
   POPULAR TOOLS
========================================================= */

.popular-list {
    list-style: none;
}

.popular-list li {
    border-bottom: 1px solid #edf0f4;
}

.popular-list li:last-child {
    border-bottom: none;
}

.popular-list a {
    display: flex;

    align-items: center;

    padding: 10px 2px;

    color: var(--text-soft);

    font-size: 13px;

    transition: 0.2s ease;
}

.popular-list a::before {
    content: "→";

    margin-right: 8px;

    color: var(--primary);
}

.popular-list a:hover {
    color: var(--primary);
}


/* =========================================================
   FOOTER
========================================================= */

.site-footer {
    padding: 55px 0 25px;

    background: #111827;

    color: white;
}

.footer-grid {
    display: grid;

    grid-template-columns:
        2fr
        1fr
        1fr;

    gap: 50px;

    padding-bottom: 38px;
}

.footer-logo {
    color: white;

    margin-bottom: 15px;
}

.footer-brand p {
    max-width: 340px;

    color: #9ca7b8;

    font-size: 13px;
}

.footer-column {
    display: flex;

    flex-direction: column;

    gap: 8px;
}

.footer-column h3 {
    margin-bottom: 6px;

    font-size: 14px;
}

.footer-column a {
    color: #9ca7b8;

    font-size: 13px;

    transition: 0.2s ease;
}

.footer-column a:hover {
    color: white;
}

.footer-bottom {
    padding-top: 22px;

    border-top: 1px solid #293244;

    color: #8792a4;

    font-size: 12px;
}


/* =========================================================
   LARGE LAPTOP
========================================================= */

@media (max-width: 1100px) {

    .website-layout {
        grid-template-columns:
            minmax(0, 1fr)
            290px;

        gap: 24px;
    }

    .container {
        width: min(
            100% - 32px,
            var(--container)
        );
    }

}


/* =========================================================
   TABLET / SMALL LAPTOP
========================================================= */

@media (max-width: 900px) {

    .website-layout {
        grid-template-columns:
            minmax(0, 1fr)
            270px;

        gap: 20px;
    }

    .calculator-card {
        padding: 25px;
    }

    .content-card {
        padding: 28px;
    }

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

    .semester-table-heading,
    .semester-row {
        grid-template-columns:
            minmax(100px, 1fr)
            minmax(85px, 1fr)
            minmax(100px, 1fr)
            42px;
    }

    /* FIX: at this width the 320px/270px sidebar column plus a
       320px-ish tools card starts fighting the main column for
       space and the "2fr" footer brand column gets cramped.
       Give the footer a bit more breathing room here too. */
    .footer-grid {
        gap: 34px;
    }

}


/* =========================================================
   TABLET PORTRAIT
========================================================= */

@media (max-width: 760px) {

    .header-inner {
        min-height: 64px;
    }

    .main-navigation {
        display: none;
    }

    .mobile-menu-button {
        display: block;
    }

    .hero-section {
        padding: 50px 0 65px;
    }

    .website-layout {
        grid-template-columns: 1fr;

        margin-top: -25px;
    }

    /*
        Sidebar becomes normal content below main content.
        No sticky behavior on smaller screens.
    */

    .sidebar {
        position: static;

        display: grid;

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        align-items: start;

        /* FIX: sticky-only max-height/overflow rules from the
           desktop sidebar must not carry over once it becomes
           a static, non-scrolling block on tablet/mobile. */
        max-height: none;
        overflow: visible;
    }

    /*
        Tools card gets full width.
    */

    .sidebar-card:first-of-type {
        grid-column: 1 / -1;
    }

    /*
        Ads remain normal responsive blocks.
    */

    .ad-container {
        width: 100%;
    }

    .ad-300 {
        min-height: 250px;
    }

    /* FIX: on tablet the 3-column footer becomes very tight
       (2fr/1fr/1fr across a ~700px container). Switch to two
       columns with the brand block spanning full width. */
    .footer-grid {
        grid-template-columns: 1fr 1fr;

        gap: 30px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .footer-brand p {
        max-width: 100%;
    }

    /* FIX: 3-across scale options got tight around 480-760px
       once combined with the calculator card's smaller
       padding; let them wrap into two rows more gracefully. */
    .scale-option {
        flex: 1 1 140px;
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 560px) {

    .container {
        width: calc(100% - 24px);
    }

    .hero-section {
        padding: 42px 0 55px;
    }

    .hero-content h1 {
        font-size: 38px;

        letter-spacing: -1.7px;
    }

    .hero-content p {
        font-size: 15px;
    }


    .website-section {
        padding-bottom: 55px;
    }


    .website-layout {
        gap: 18px;
    }


    .calculator-card {
        padding: 18px;

        border-radius: 14px;
    }


    .section-heading h2 {
        font-size: 23px;
    }


    /*
        On phones, each semester becomes a
        compact card instead of a table row.
    */

    .semester-table-heading {
        display: none;
    }

    .semester-row {
        grid-template-columns:
            1fr 1fr;

        gap: 10px;

        padding: 15px;
    }

    .semester-title {
        grid-column: 1 / -1;

        padding-bottom: 1px;
    }

    .form-field {
        display: flex;

        flex-direction: column;
    }

    .form-field label {
        display: block;
    }

    .remove-semester {
        grid-column: 1 / -1;

        width: 100%;

        height: 38px;

        font-size: 18px;
    }


    .calculate-button {
        min-height: 50px;
    }


    .result-box {
        padding: 24px 15px;
    }

    .cgpa-result {
        font-size: 46px;
    }


    .content-card {
        padding: 23px 18px;

        border-radius: 14px;
    }

    .content-card h2 {
        margin-top: 40px;

        font-size: 23px;
    }


    /*
        Sidebar becomes a single column.
    */

    .sidebar {
        display: flex;

        flex-direction: column;

        gap: 18px;
    }

    .sidebar-card:first-of-type {
        grid-column: auto;
    }


    /*
        On mobile, tools appear before ads.
        This keeps related navigation useful.
    */

    .ad-300 {
        min-height: 250px;
    }


    .footer-grid {
        grid-template-columns: 1fr;

        gap: 28px;
    }

    .footer-brand {
        grid-column: auto;
    }

    /* FIX: scale selector should stack to one-per-row on
       small phones instead of squeezing 2-3 across. */
    .scale-options {
        flex-direction: column;
    }

    .scale-option {
        flex: 1 1 auto;
    }

}


/* =========================================================
   VERY SMALL PHONES
========================================================= */

@media (max-width: 380px) {

    .hero-content h1 {
        font-size: 34px;
    }

    .calculator-card {
        padding: 14px;
    }

    .semester-row {
        padding: 12px;
    }

    .content-card {
        padding: 20px 15px;
    }

    .tool-item {
        padding-left: 3px;
        padding-right: 3px;
    }

    /* FIX: 52px result number plus default padding could
       feel cramped on 320-360px phones; shrink slightly
       further so it never wraps awkwardly. */
    .cgpa-result {
        font-size: 40px;
    }

}
