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

* {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--raised);
    color: var(--strong);
    font-size: clamp(15px, 14.0464px + 0.2545vw, 16px); /* 768px = 16px 375 = 15px */

    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    
    -webkit-tap-highlight-color: transparent;

    scroll-behavior: smooth;
}

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

:root {
    --base: #fafafa;
    --raised: #EBEBEB;

    --muted: #b6b6b6;
    --default: #606060;     
    --strong: #0e0e0e;

    --hover: #323232;
    --accent: #2281f7;
    --accent-subtle: #91b9ec70;

    --green: #00b341;
    --red: #e03535;
    --orange: #ee9701;
    --purple: #A855F7;

    --sidepadding: clamp(16px, 12.6848px + 0.884vw, 24px);
    --lockedvw: 1280px;
}

/* ====================BASIC CALLING==================== */

h1, h2, h3 { 
    font-weight: 600; 
    color: var(--strong); 
    letter-spacing: -.3px;
}

p {
    font-family: inherit;
    font-weight: 400;
}

a {
    font-family: inherit;
    font-weight: 450;
    text-decoration: none;
    color: inherit;
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--strong);
    outline-offset: 2px;
}

/* Skip navigation link — visible on keyboard focus only */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    padding: 8px 16px;
    background: var(--strong);
    color: var(--raised);
    font-weight: 600;
    z-index: 9999;
    text-decoration: none;
}
.skip-link:focus { top: 0; }

/* Visually hidden but accessible to screen readers */
.hidden { display: none !important; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

input { all: unset; }
button { all: unset; cursor: pointer; text-align: center; }

hr {
    border: none;
    border-top: 1px solid hsl(from var(--muted) h s l / 0.5);
}

.monospace { font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 470; }
.tab-8 { display: inline-block; margin-left: 10px; }
.tab-20 { display: inline-block; margin-left: 20px; }

svg { width: 18px; fill: var(--strong); margin: 0; padding: 0; box-sizing: border-box; height: fit-content; width: fit-content; }

/* ====================PLANS==================== */

.pricing-container {
    display: flex;
    justify-content: center;
    flex-direction: column;
    gap: 39px;
}

.pricing-plans-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;

    padding: 0 clamp(0px, -193.104px + 27.5862vw, 160px);
}

@media (min-width: 768px) { .pricing-plans-wrapper { grid-template-columns: 1fr 1fr; } }

.pricing-plan {
    display: flex;
    flex-direction: column;
    gap: 24px;

    width: 100%;
    padding: 28px 24px;

    border-radius: 10px;

    border: 1px solid hsl(from var(--muted) h s l / 0.5);
    background-color: var(--base);

    padding-bottom: 40px;
    min-width: 0; /* prevent grid/flex blowout */
}

.plan-name {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.plan-prices {
    display: flex;
    align-items: center;
    gap: 6px;
}

.plan-prices p {
    font-size: 48px;
    font-weight: 600;
    letter-spacing: -.7px;
}

.plan-prices .discounted {
    font-size: 38px;
    text-decoration: line-through;
    opacity: .36;
    font-weight: 500;
}

.plan-tag {
    background-color: var(--accent-subtle);

    color: var(--accent);
    font-weight: 500;
    font-size: 15px;

    width: fit-content;
    padding: 1px 4px;
    border-radius: 2px;
}

.plan-features {
    list-style: none;
    margin: 0;
    padding: 0;

    & ul {
        list-style: none;
        padding-left: 20px;

        font-weight: 450;

        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    & ul li::before {
        content: '✓';
        color: var(--green);
        display: inline-block;
        width: 1em;
        margin-left: -1em;
    }
}

.plan-features ul li:not(:nth-last-of-type(n+3))::before {
    content: 'X';
    color: var(--default);
}

.overage-enabled ul li:last-of-type:before {
    content: '✓';
    color: var(--green);
}

.bot-detection-enabled ul li:nth-last-of-type(2):before {
    content: '✓';
    color: var(--green);
}

.plan-cta {
    width: 100%;

    padding: 11px 0;
    border-radius: 6px;

    background-color: var(--strong);
    color: var(--base);

    font-weight: 500;
    text-align: center;
    transition: background-color .3s ease;

    &:hover { background-color: var(--hover); }
    &:active { scale: .99; }
}

.plan-cta a:hover { background-color: var(--hover); }

/* ====================MISC==================== */

.bar-graph {
    display: flex;
    margin-top: 16px;
    padding-top: 12px;
    gap: 6px;
}

.column-bar {
    width: 100%;
    margin-top: auto;

    position: relative;

    background-color: hsl(from var(--accent) h s l / 0.32);
    border: 1px solid hsl(from var(--accent) h s l / 0.96);
    border-radius: 5px 5px 1px 1px;

    font-size: 12px;
    color: var(--default);

    display: flex;
    flex-direction: column;

    transition: background-color .3s ease;

    & p {
        color: var(--muted);
        transition: color .3s ease;

        position: absolute; 
        left: 50%;
        top: -16px;
        transform: translate(-50%, -50%);

        pointer-events: none;
        -webkit-user-select: none;
        -ms-user-select: none; 
        user-select: none;
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none; 
    }

    &:hover {
        background-color: hsl(from var(--accent) h s l / 0.64);
        & p { color: var(--default); }
    }
}

.tag {
    font-weight: 480;
    font-size: 14px;

    width: fit-content;
    padding: 2px 6px;
    border-radius: 2px;

    &.accent { background-color: var(--accent-subtle); color: var(--accent); }
    &.positive { background-color: hsl(from var(--green) h s l / 0.24); color: var(--green); }
    &.neutral { background-color: hsl(from var(--muted) h s l / 0.24); color: var(--default); }
}

/* ====================BUTTONS==================== */

.side-by-side-buttons {
    display: flex;
    flex-direction: row;
    gap: 6px;
    font-size: 15px;

    & button, a {
        padding: 6px 12px;
        border-radius: 6px;

        background-color: var(--strong);
        color: var(--base);

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

        &:active { scale: .99; }
    }
}

.side-by-side-buttons {
    background-color: inherit; 
    color: var(--default); 

    transition: color .2s ease, border-color .2s ease;

    &:hover {
        color: var(--hover);
        border-color: var(--hover);
    }
}

.plain {
    border: none;
    background-color: inherit;

    color: var(--default);
}

.fill {
    padding: 7px 14px;
    border-radius: 8px;

    background-color: var(--strong);
    color: var(--base);

    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;

    transition: opacity .2s ease;

    &:hover { opacity: .8; }
    &:active { scale: .99; }

    & svg { width: 18px; }
}

.fill.accent { background-color: var(--accent); & svg { fill: var(--base); } }

.stroked {
    border-radius: 8px;
    padding: 7px 14px;
    
    font-weight: 500;
    font-size: 15px;

    background-color: transparent !important; 
    color: var(--default) !important; 
    border: 1px solid var(--muted);

    transition: color .2s ease, border-color .2s ease;

    & a:hover, button:hover {
        color: var(--hover);
        border-color: var(--hover);
    }

    &.red { color: var(--red) !important; border-color: var(--red) !important; }
}

.multi-button-switcher {
    background-color: hsl(from var(--muted) h s l / 0.3);
    border-radius: 6px;

    padding: 3px;
    box-sizing: border-box;

    position: relative;

    display: inline-flex;
}

.multi-button-switcher .slider {
    position: absolute;
    top: 4px;
    left: 3px;

    height: calc(100% - 8px);
    width: 0;

    background-color: var(--base);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .36);
    border-radius: 5px;

    z-index: 0;
    pointer-events: none;

    transition: transform 0.3s ease, width 0.3s ease, height 0.3s ease;
}

.multi-button-switcher button {
    padding: 7px 18px;
    border-radius: 5px;
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    flex: 1;
    font-size: 15px;
    color: var(--strong);
    font-weight: 500;
    transition: color 0.25s ease, font-weight 0.3s ease;
    white-space: nowrap;
    box-sizing: border-box;
    width: 100%;

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

.multi-button-switcher button.active {
    font-weight: 520;
}

.multi-button-switcher#column {
    flex-direction: column;
}

.multi-button-switcher#column .slider {
    top: 4px;
    left: 4px;
    width: calc(100% - 8px);
    height: 0; /* driven by JS */
}

.multi-button-switcher#column button {
    width: 100%;
    text-align: center;
}

/* ====================panel==================== */

.panel-mode {
    position: fixed;
    inset: 0;
    width: 100%;
    overflow: hidden;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.panel-mode::-webkit-scrollbar { display: none; }

.panel {
    position: fixed;
    inset: 0;

    padding: 12px var(--sidepadding);

    background-color: rgba(7, 7, 7, .7);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);

    display: none;
    visibility: hidden;

    place-items: center;

    overflow-y: auto;                  /* ← was: overflow: hidden */
    overscroll-behavior: contain;      /* ← moved out of media query */
    align-items: flex-start;           /* ← moved out of media query */
}

/* Allow scroll on mobile/touch devices */
@media (hover: none) and (pointer: coarse) {
    .panel {
        overflow-y: auto;
        overscroll-behavior: contain;
        align-items: flex-start;
    }
}

.panel.active { display: grid; visibility: visible; }

.panel-container {
    width: 100%;
    margin: auto;

    background-color: var(--base);
    border-radius: 10px;
    padding: 20px 24px;

    border: 1px solid hsl(from var(--muted) h s l / 0.5);
    background-color: var(--base);

    display: flex;
    flex-direction: column;
    gap: 18px;

    padding-bottom: 40px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    & h3 { font-size: 18px; }
    & button { margin: 0; padding: 2px 5px; }
    & button:active { scale: .98; }
    & svg { width: 19px; fill: var(--default); }
}