/* MotionConvert — Matte Slate Design System */
/* Dark-first, CSS custom properties, Fira Sans + Fira Code */

/* === Font Import === */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&family=Fira+Sans:wght@400;500;600;700&display=swap');

/* === Design Tokens === */
:root {
    /* Fonts */
    --font-body: 'Fira Sans', -apple-system, sans-serif;
    --font-mono: 'Fira Code', monospace;

    /* Colors — Matte Slate Dark (primary) */
    --bg-primary: #09090b;
    --bg-card: #0e0e11;
    --bg-elevated: #131316;
    --bg-input: #0a0a0d;

    /* Aliases for inline-style compat */
    --bg-secondary: var(--bg-card);
    --bg-tertiary: var(--bg-elevated);
    --bg-output: var(--bg-input);

    /* Foreground */
    --fg: #ececef;
    --fg-secondary: #8b8b97;
    --fg-muted: #7a7a88;

    /* Aliases */
    --text-primary: var(--fg);
    --text-secondary: var(--fg-secondary);
    --text-muted: var(--fg-muted);

    /* Borders */
    --border: rgba(255,255,255,0.06);
    --border-hover: rgba(255,255,255,0.11);
    --border-focus: #3b82f6;

    /* Accent */
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-subtle: rgba(59,130,246,0.08);
    --accent-glow: rgba(59,130,246,0.15);

    /* Result values */
    --result-color: #93c5fd;
    --result-unit: rgba(59,130,246,0.45);

    /* Status */
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;

    /* Shadows */
    --card-shadow: 0 1px 3px rgba(0,0,0,0.3);
    --card-shadow-hover: 0 8px 24px rgba(0,0,0,0.3);

    /* Spacing (8px grid) */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Typography scale */
    --text-xs: 0.6875rem;
    --text-sm: 0.8125rem;
    --text-base: 0.9375rem;
    --text-lg: 1.125rem;
    --text-xl: 1.5rem;
    --text-2xl: 2rem;
    --text-result: 1.75rem;

    /* Layout */
    --topbar-height: 48px;
    --max-width: 1100px;
    --radius: 8px;
    --radius-sm: 6px;
    --sidebar-width: 280px;
    --rail-width: 28px;
}

/* === Light Mode === */
[data-theme="light"] {
    --bg-primary: #f5f5f7;
    --bg-card: #ffffff;
    --bg-elevated: #e8e8ec;
    --bg-input: #ffffff;
    --bg-output: #f0f0f4;

    --fg: #1a1a2e;
    --fg-secondary: #4a4a6a;
    --fg-muted: #6e6e88;

    --border: #d0d0d8;
    --border-hover: #b0b0bc;

    --accent-subtle: #dbeafe;
    --accent-glow: rgba(59,130,246,0.12);

    --result-color: #1d4ed8;
    --result-unit: rgba(59,130,246,0.6);

    --card-shadow: 0 1px 3px rgba(0,0,0,0.08);
    --card-shadow-hover: 0 4px 12px rgba(0,0,0,0.1);
}

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

/* === Base === */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--fg);
    background: var(--bg-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: var(--accent);
}
a:hover {
    color: var(--accent-hover);
}

input, select, button {
    font-family: inherit;
}

h1, h2, h3 {
    line-height: 1.3;
    font-weight: 600;
}
h1 { font-size: var(--text-xl); margin-bottom: var(--space-md); letter-spacing: -0.03em; }
h2 { font-size: var(--text-lg); margin-bottom: var(--space-md); }
h3 { font-size: var(--text-base); margin-bottom: var(--space-sm); }

/* === Topbar === */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--topbar-height);
    background: rgba(9,9,11,0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    /* Stronger separator + soft drop shadow so the bar stays visible
       when scrolling over dark content. */
    border-bottom: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 1px 0 0 rgba(255,255,255,0.04), 0 4px 16px rgba(0,0,0,0.4);
}
[data-theme="light"] .topbar {
    background: rgba(245,245,247,0.92);
    border-bottom-color: rgba(0,0,0,0.10);
    box-shadow: 0 1px 0 0 rgba(0,0,0,0.02), 0 4px 16px rgba(0,0,0,0.06);
}

.topbar-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    color: var(--fg);
    letter-spacing: -0.02em;
}
.logo:hover {
    color: var(--accent);
}

.main-nav {
    display: flex;
    gap: var(--space-lg);
}
.main-nav a {
    color: var(--fg-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: color 0.15s;
}
.main-nav a:hover {
    color: var(--fg);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.topbar-auth {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.topbar-link {
    color: var(--fg-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: color 0.15s;
}
.topbar-link:hover {
    color: var(--fg);
}

/* === Mobile Menu Button === */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-direction: column;
    gap: 4px;
    margin-left: var(--space-xs);
}
.hamburger-line {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--fg-secondary);
    border-radius: 1px;
    transition: all 0.2s;
}
.mobile-menu-btn:hover .hamburger-line {
    background: var(--fg);
}
.mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}
.mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* === Mobile Nav Dropdown === */
.mobile-nav {
    display: none;
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: var(--space-sm) 0;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
[data-theme="light"] .mobile-nav {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.mobile-nav.open {
    display: block;
}
.mobile-nav a {
    display: block;
    padding: var(--space-sm) 1.25rem;
    color: var(--fg-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: color 0.15s, background 0.15s;
}
.mobile-nav a:hover {
    color: var(--fg);
    background: var(--bg-elevated);
}
.mobile-nav-divider {
    height: 1px;
    background: var(--border);
    margin: var(--space-xs) 1.25rem;
}

/* === Theme Toggle === */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 5px 7px;
    color: var(--fg-secondary);
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    line-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.theme-toggle:hover {
    color: var(--fg);
    border-color: var(--border-hover);
    background: var(--bg-elevated);
}
.theme-icon {
    width: 16px;
    height: 16px;
    display: block;
}
/* Show the sun (theme-icon-light) when in DARK mode (it's the action: switch to light)
   and the moon (theme-icon-dark) when in LIGHT mode (action: switch to dark). */
[data-theme="dark"] .theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: block; }
[data-theme="light"] .theme-icon-light,
:not([data-theme="dark"]) .theme-icon-light { display: none; }
[data-theme="light"] .theme-icon-dark,
:not([data-theme="dark"]) .theme-icon-dark { display: block; }

/* === Breadcrumb === */
.breadcrumb {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-sm) 1.25rem;
    font-size: var(--text-sm);
    color: var(--fg-muted);
}
.breadcrumb a {
    color: var(--fg-muted);
}
.breadcrumb a:hover {
    color: var(--accent);
}

/* === Content Container === */
.content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-xl) 1.25rem;
}

/* When content wraps a rail-layout, remove duplicate constraints */
.content:has(> .rail-layout) {
    max-width: none;
    padding: 0;
}

/* === Cards === */
.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}
@media (min-width: 768px) {
    .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .card-grid { grid-template-columns: repeat(3, 1fr); }
}

/* 5-card grid: balanced 3+2 on wide screens (3 across top, 2 centered
   below with the same cell width as the top row). Falls back to the
   default card-grid breakpoints on tablet/mobile. */
@media (min-width: 1024px) {
    .card-grid--5 {
        grid-template-columns: repeat(6, 1fr);
    }
    .card-grid--5 > .card { grid-column: span 2; }
    .card-grid--5 > .card:nth-child(4) { grid-column: 2 / span 2; }
    .card-grid--5 > .card:nth-child(5) { grid-column: 4 / span 2; }
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-lg);
    transition: border-color 0.2s, transform 0.2s cubic-bezier(.16,1,.3,1), box-shadow 0.2s;
    color: var(--fg);
    display: block;
}
.card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
    color: var(--fg);
}
.card h3 {
    font-size: var(--text-base);
    font-weight: 600;
}
.card p {
    color: var(--fg-secondary);
    font-size: var(--text-sm);
    margin: 0;
}

/* === Payment Failed Banner === */
.payment-failed-banner {
    background: rgba(239, 68, 68, 0.12);
    border-bottom: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    text-align: center;
    padding: 0.625rem 1rem;
    font-size: var(--text-sm);
}
.payment-failed-banner a {
    color: #fca5a5;
    text-decoration: underline;
    font-weight: 600;
}
[data-theme="light"] .payment-failed-banner {
    background: rgba(239, 68, 68, 0.08);
    color: #b91c1c;
}
[data-theme="light"] .payment-failed-banner a {
    color: #b91c1c;
}

/* === Hero === */
.hero {
    text-align: center;
    padding: var(--space-2xl) 0;
}
.hero h1 {
    font-size: clamp(1.75rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
}
.hero-subtitle {
    color: var(--fg-secondary);
    font-size: var(--text-lg);
    margin-bottom: var(--space-lg);
}
.hero-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--fg-secondary);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    font-family: var(--font-body);
}
.btn:hover {
    color: var(--fg);
    border-color: var(--border-hover);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 600;
}
.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

.btn-sm {
    padding: 3px 7px;
    font-size: 0.75rem;
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    border-radius: var(--radius-sm);
    font-weight: 600;
}
.btn-sm:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: var(--space-sm) var(--space-lg);
}

/* Focus rings for keyboard navigation */
.btn:focus-visible,
.btn-sm:focus-visible,
.btn-icon:focus-visible,
.pill-tab:focus-visible,
.stage-tab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* === Tool Category Sections === */
.tool-category {
    margin-bottom: var(--space-xl);
}
.tool-category h2 {
    font-size: var(--text-lg);
    color: var(--fg-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-md);
}

/* === Category Tabs === */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border);
}
.category-tab {
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--fg-secondary);
    transition: all 0.15s;
    white-space: nowrap;
}
.category-tab:hover {
    color: var(--fg);
    background: var(--bg-elevated);
}
.category-tab--active {
    color: var(--accent);
    background: var(--accent-subtle);
    font-weight: 600;
}

/* === Tool Toolbar === */
.tool-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding: var(--space-sm) 0;
    flex-wrap: wrap;
}
.tool-toolbar-left {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}
.tool-toolbar-right {
    display: flex;
    gap: var(--space-sm);
    margin-left: auto;
}
.tool-toolbar-msg {
    font-size: var(--text-sm);
    color: var(--success);
    transition: opacity 0.3s;
}

.load-dropdown {
    position: relative;
}
.load-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--card-shadow-hover);
    max-height: 200px;
    overflow-y: auto;
}
.load-dropdown-item {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
    cursor: pointer;
    color: var(--fg-secondary);
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}
.load-dropdown-item:last-child { border-bottom: none; }
.load-dropdown-item:hover {
    background: var(--bg-elevated);
    color: var(--fg);
}
.load-dropdown-empty {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
    color: var(--fg-muted);
}

/* === Tool Block === */
.tool-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: var(--space-lg);
    transition: border-color 0.2s;
}
.tool-block:hover {
    border-color: var(--border-hover);
}
.tool-block-header {
    margin-bottom: var(--space-lg);
}
.tool-block-header h2 {
    text-transform: none;
    letter-spacing: normal;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: var(--space-xs);
}
.tool-block-header p {
    color: var(--fg-secondary);
    font-size: var(--text-sm);
}

/* === Tool Page === */
.tool-page {
    max-width: 900px;
}
.tool-description {
    color: var(--fg-secondary);
    margin-bottom: var(--space-lg);
}

/* === Value Field Component === */
.value-field {
    margin-bottom: 0.75rem;
}
.value-field:last-child {
    margin-bottom: 0;
}
.value-field label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--fg-secondary);
    margin-bottom: 4px;
}
.value-field-inner {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    overflow: hidden;
    transition: all 0.2s cubic-bezier(.16,1,.3,1);
}
.value-field-inner:hover {
    border-color: var(--border-hover);
}
.value-field-inner:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}
.value-field-input {
    flex: 1;
    padding: 0.625rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--fg);
    font-family: var(--font-mono);
    font-size: 1rem;
    outline: none;
    caret-color: var(--accent);
    min-width: 0;
    font-variant-numeric: tabular-nums;
}
.value-field-input::placeholder {
    color: var(--fg-muted);
}
.value-field-unit {
    padding: 0.625rem 0.5rem;
    border: none;
    border-left: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
    color: var(--fg-muted);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    outline: none;
    min-width: 3.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.value-field-unit:focus {
    background: var(--accent-subtle);
}
[data-theme="light"] .value-field-unit {
    background: rgba(0,0,0,0.03);
}

/* Output mode */
.value-field--output .value-field-inner {
    background: var(--bg-input);
}
.value-field--output .value-field-input {
    font-weight: 600;
    color: var(--result-color);
}
.value-field--output .value-field-unit {
    color: var(--result-unit);
}

/* === Section Headers (tool pages) === */
.sec-h {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.sec-title {
    font-size: var(--text-base);
    font-weight: 600;
    white-space: nowrap;
}
.sec-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}
.sec-extra {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* === Rail Flow Layout === */
.rail-layout {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: 1.5rem;
    padding: 0 1.25rem;
    align-items: start;
}

/* Page header spans both columns */
.rail-head {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0 0.25rem;
}
.rail-head-left {
    display: flex;
    align-items: baseline;
}
.rail-head-left h1 {
    margin-bottom: 0;
}
.rail-head-left p {
    color: var(--fg-secondary);
    font-size: var(--text-sm);
    margin-left: 0.75rem;
}
.rail-head-right {
    display: flex;
    gap: 0.5rem;
}

/* Left column: rail + stations */
.rail-col {
    position: relative;
    padding-left: var(--rail-width);
    min-width: 0;
}

/* Continuous rail line */
.rail-col::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent) 0%, rgba(59,130,246,0.25) 80%, transparent 100%);
    z-index: 1;
}
[data-theme="light"] .rail-col::before {
    background: linear-gradient(to bottom, var(--accent) 0%, rgba(59,130,246,0.12) 80%, transparent 100%);
}

/* Station sections */
.station {
    position: relative;
    margin-bottom: 1.25rem;
}

/* Station dot on the rail */
.station-dot {
    position: absolute;
    left: calc(-1 * var(--rail-width) + 4px);
    /* Align dot center with .sec-title center inside .stn-card */
    top: calc(2rem - 6px);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid rgba(59,130,246,0.35);
    z-index: 2;
}
.station-dot--active {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Station card */
.stn-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: border-color 0.2s;
}
.station:hover .stn-card {
    border-color: var(--border-hover);
}

/* Results station */
.station--results .stn-card {
    border-color: rgba(59,130,246,0.15);
    position: relative;
    overflow: hidden;
}
.station--results .stn-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 5%, var(--accent) 50%, transparent 95%);
}
.station--results .sec-title {
    color: var(--accent);
}
.station--results .sec-line {
    background: rgba(59,130,246,0.12);
}

/* Results grid */
.results-inline {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}
.result-inline-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--fg-secondary);
    margin-bottom: 6px;
}
.result-inline-value {
    font-family: var(--font-mono);
    font-size: var(--text-result);
    font-weight: 600;
    color: var(--result-color);
    letter-spacing: -0.01em;
}
.result-inline-unit {
    font-size: 0.875rem;
    color: var(--result-unit);
    margin-left: 4px;
}

/* === Sidebar (sticky right column) === */
.sidebar {
    position: sticky;
    top: 60px;
    align-self: start;
}

.sidebar-results {
    background: var(--bg-elevated);
    border: 1px solid rgba(59,130,246,0.12);
    border-radius: var(--radius);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}
.sidebar-results::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent);
}
.sidebar-results-title {
    font-size: 0.5625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 0.75rem;
}
.sidebar-result-item {
    margin-bottom: 1rem;
}
.sidebar-result-item:last-child {
    margin-bottom: 0;
}
.sidebar-result-label {
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--fg-secondary);
    margin-bottom: 2px;
}
.sidebar-result-value {
    font-family: var(--font-mono);
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--result-color);
}
.sidebar-result-unit {
    font-size: var(--text-xs);
    color: var(--result-unit);
    margin-left: 2px;
}
.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 0.75rem 0;
}

.sidebar-links {
    margin-top: 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
}
.sidebar-links-title {
    font-size: 0.5625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-muted);
    margin-bottom: 0.5rem;
}
.sidebar-link {
    display: block;
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--fg-secondary);
    font-size: var(--text-sm);
    transition: color 0.15s;
}
.sidebar-link:last-child {
    border-bottom: none;
}
.sidebar-link:hover {
    color: var(--accent);
}
.sidebar-link span {
    font-size: var(--text-xs);
    color: var(--fg-muted);
    display: block;
}

/* === Below Fold ===
   Mobile-only related links: on desktop the .sidebar-links rail already
   shows Related Tools, so we hide this to avoid duplication. */
.below-fold {
    grid-column: 1 / -1;
    padding: 2rem 0 3rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 3;
    background: var(--bg-primary);
    display: none;
}
@media (max-width: 900px) {
    .below-fold { display: block; }
}
.below-fold-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.below-fold-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.related-grid--2col {
    grid-template-columns: repeat(2, 1fr);
}

.related-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    transition: all 0.2s cubic-bezier(.16,1,.3,1);
    display: block;
    color: var(--fg);
}
.related-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
    color: var(--fg);
}
.related-card h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 3px;
}
.related-card p {
    color: var(--fg-secondary);
    font-size: var(--text-sm);
    margin: 0;
}

.upgrade-prompt {
    text-align: center;
    padding: 1rem;
    background: var(--accent-subtle);
    border: 1px solid rgba(59,130,246,0.1);
    border-radius: var(--radius);
}
.upgrade-prompt p {
    color: var(--fg-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

/* === Output Tabs (underline style) === */
.output-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
}
.output-tab {
    padding: 0.5rem 0.875rem;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--fg-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-body);
    margin-bottom: -1px;
}
.output-tab:hover {
    color: var(--fg-secondary);
}
.output-tab--active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* === Stage Tabs (pill style) === */
.pill-tab {
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--fg-secondary);
    background: none;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-body);
}
.pill-tab:hover {
    color: var(--fg);
    border-color: var(--border-hover);
}
.pill-tab--active {
    color: var(--accent);
    background: var(--accent-subtle);
    border-color: rgba(59,130,246,0.2);
}

/* === Sub-cards (gear stages) === */
.sub-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}
[data-theme="light"] .sub-card {
    background: rgba(0,0,0,0.02);
}
.sub-card:last-of-type {
    margin-bottom: 0;
}
.sub-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.sub-card-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.stage-add {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--fg-muted);
    font-size: var(--text-sm);
    cursor: pointer;
    margin-top: 0.5rem;
    transition: all 0.15s;
}
.stage-add:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* === Form Elements === */
input[type="number"],
input[type="text"],
select {
    font-family: var(--font-body);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}
.form-group label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--fg-secondary);
    margin-bottom: var(--space-xs);
}
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--fg);
    font-family: var(--font-body);
    font-size: var(--text-base);
    transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}
.form-check label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-sm);
    color: var(--fg-secondary);
    cursor: pointer;
}
.form-control {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--fg);
    font-size: 1rem;
    box-sizing: border-box;
}
.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    font-size: 0.85rem;
    cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
}

/* === Converter Layout === */
.converter-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--space-md);
    align-items: end;
}
.converter-arrow {
    font-size: var(--text-xl);
    color: var(--fg-muted);
    padding-bottom: var(--space-sm);
    text-align: center;
}
.conversion-factor {
    margin-top: var(--space-md);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--fg-muted);
    text-align: center;
}

/* === SEO Cards === */
.seo-cards {
    margin-top: var(--space-2xl);
}
.seo-cards h2 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-md);
}
.seo-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-sm);
}
.seo-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    transition: border-color 0.15s;
}
.seo-card:hover {
    border-color: var(--accent);
}
.seo-card h3 {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: 600;
    margin-bottom: 2px;
}
.seo-card p {
    font-size: 0.75rem;
    color: var(--fg-muted);
    margin: 0;
}

/* === Data Tables === */
.table-wrapper {
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}
.data-table th,
.data-table td {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.data-table th {
    font-weight: 600;
    color: var(--fg-secondary);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.data-table tbody tr:hover {
    background: var(--bg-elevated);
}
.mono {
    font-family: var(--font-mono);
}
.text-success {
    color: var(--success);
    font-weight: 600;
}

/* === Gear Finder Inputs === */
.gear-finder-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

/* === Auth Pages === */
.auth-page {
    display: flex;
    justify-content: center;
    padding: var(--space-2xl) var(--space-md);
}
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-2xl);
    width: 100%;
    max-width: 420px;
}
.auth-card h1 {
    text-align: center;
    margin-bottom: var(--space-xs);
}
.auth-subtitle {
    text-align: center;
    color: var(--fg-secondary);
    font-size: var(--text-sm);
    margin-bottom: var(--space-xl);
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}
.auth-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    border-radius: var(--radius-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--error);
    font-size: var(--text-sm);
}
.auth-error p { margin: 0; }
.auth-footer {
    text-align: center;
    margin-top: var(--space-lg);
    font-size: var(--text-sm);
    color: var(--fg-secondary);
}

/* === Account Pages === */
.account-page {
    max-width: 700px;
}
.account-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}
@media (min-width: 768px) {
    .account-grid { grid-template-columns: 1fr 1fr; }
}
.account-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-lg);
}
.account-card h3 {
    margin-bottom: var(--space-md);
}
.account-detail {
    font-size: var(--text-sm);
    color: var(--fg-secondary);
    margin-bottom: var(--space-xs);
}
.account-links {
    list-style: none;
    padding: 0;
}
.account-links li {
    margin-bottom: var(--space-sm);
}
.account-links a {
    font-size: var(--text-sm);
}

/* === Settings Form === */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}
.settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}
.settings-section h2 {
    font-size: var(--text-base);
    margin-bottom: 0;
}

/* === Pricing Page === */
.pricing-page {
    text-align: center;
}
.pricing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    margin: var(--space-xl) 0;
}
@media (min-width: 768px) {
    .pricing-grid { grid-template-columns: repeat(3, 1fr); }
}
.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: border-color 0.2s;
}
.pricing-card:hover {
    border-color: var(--border-hover);
}
.pricing-card.featured {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
    position: relative;
}
.pricing-badge {
    position: absolute;
    top: -12px;
    background: var(--accent);
    color: #fff;
    font-size: var(--text-sm);
    font-weight: 600;
    padding: 2px var(--space-md);
    border-radius: var(--radius-sm);
}
.pricing-tier-name {
    font-size: var(--text-lg);
    font-weight: 700;
    margin-bottom: var(--space-sm);
}
.pricing-price {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--accent);
    margin-bottom: var(--space-sm);
}
.pricing-price span {
    font-size: var(--text-sm);
    font-weight: 400;
    color: var(--fg-muted);
}
.pricing-features {
    list-style: none;
    padding: 0;
    margin: var(--space-lg) 0;
    text-align: left;
    width: 100%;
}
.pricing-features li {
    font-size: var(--text-sm);
    color: var(--fg-secondary);
    padding: var(--space-xs) 0;
    border-bottom: 1px solid var(--border);
}
.pricing-features li:last-child {
    border-bottom: none;
}
/* Push the action (form / button / span) to the bottom of the card so all
   three "Upgrade" / "Current plan" pills line up across the row regardless
   of how many features each tier has. */
.pricing-features {
    flex: 1 0 auto;
}
.pricing-card > form,
.pricing-card > a.btn,
.pricing-card > span.btn {
    margin-top: auto;
    width: 100%;
    text-align: center;
}
/* .btn is display:inline-flex, so width:100% alone leaves the label
   hugging the left edge — we need justify-content:center to actually
   center the text inside the button. */
.pricing-card > form button,
.pricing-card > a.btn,
.pricing-card > span.btn {
    width: 100%;
    justify-content: center;
}
.early-bird {
    background: var(--accent-subtle);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: var(--space-lg);
    margin-top: var(--space-xl);
}
.early-bird h3 {
    color: var(--accent);
}

/* === Upgrade Page === */
.upgrade-page {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-md);
}
.upgrade-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-2xl);
}
.upgrade-card h2 {
    margin-bottom: var(--space-md);
}
.upgrade-card p {
    color: var(--fg-secondary);
    margin-bottom: var(--space-lg);
}

/* === Projects Page === */
.project-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}
.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.15s;
}
.project-card:hover {
    border-color: var(--border-hover);
}
.project-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--space-lg);
    min-height: 400px;
}
.project-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-md);
    overflow-y: auto;
}
.project-sidebar-item {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--fg-secondary);
    transition: background 0.15s;
}
.project-sidebar-item:hover,
.project-sidebar-item.active {
    background: var(--bg-elevated);
    color: var(--fg);
}
.project-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-lg);
}

/* === Modal === */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-xl);
    max-width: 440px;
    width: 90%;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}
.modal-header h3 { margin: 0; }
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--fg-secondary);
    padding: 0 4px;
}

/* === Footer === */
.site-footer {
    border-top: 1px solid var(--border);
    margin-top: var(--space-2xl);
    /* Vertical padding only — horizontal padding lives on .footer-inner /
       .footer-bottom so they line up with .content (border-box max-width) */
    padding: var(--space-2xl) 0 var(--space-xl);
    background: var(--bg-card);
}
.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
}
.footer-heading {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-muted);
    margin-bottom: var(--space-sm);
}
.footer-col a {
    display: block;
    padding: 3px 0;
    color: var(--fg-secondary);
    font-size: var(--text-sm);
    transition: color 0.15s;
}
.footer-col a:hover {
    color: var(--fg);
}
.footer-bottom {
    max-width: var(--max-width);
    margin: var(--space-xl) auto 0;
    padding: var(--space-md) 1.25rem 0;
    border-top: 1px solid var(--border);
    font-size: var(--text-xs);
    color: var(--fg-muted);
}

/* === Article/Prose Content === */
.article-content {
    max-width: 800px;
}
.article-content h2 {
    margin-top: var(--space-xl);
}
.article-content p {
    margin-bottom: var(--space-md);
    line-height: 1.7;
}
.article-content ul, .article-content ol {
    margin-bottom: var(--space-md);
    padding-left: var(--space-lg);
}
.article-content li {
    margin-bottom: var(--space-xs);
    line-height: 1.6;
}
.article-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--bg-elevated);
    padding: 2px 6px;
    border-radius: 3px;
}
.articles-grid {
    display: grid;
    gap: var(--space-md);
    margin-top: var(--space-md);
}
.article-card h2 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-xs);
}
.article-date {
    color: var(--fg-muted);
    font-size: var(--text-sm);
}
.prose {
    line-height: 1.7;
}
.prose p {
    margin-bottom: var(--space-md);
}
.prose h2, .prose h3 {
    margin-top: var(--space-xl);
}
.prose code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--bg-elevated);
    padding: 2px 6px;
    border-radius: 3px;
}
.prose pre {
    background: var(--bg-elevated);
    padding: var(--space-md);
    border-radius: var(--radius);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}
.prose pre code {
    background: none;
    padding: 0;
}
.prose ul, .prose ol {
    margin: 0 0 var(--space-md) var(--space-lg);
}
.prose li {
    margin-bottom: var(--space-xs);
}
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-md) 0;
    font-size: var(--text-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.prose th,
.prose td {
    padding: 0.625rem 0.875rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.prose th {
    background: var(--bg-elevated);
    font-weight: 600;
    color: var(--fg);
}
.prose tr:last-child td {
    border-bottom: none;
}
.prose tr:hover td {
    background: var(--bg-elevated);
}

/* === Utility === */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.text-center { text-align: center; }
.mt-lg { margin-top: var(--space-lg); }
.mb-lg { margin-bottom: var(--space-lg); }

/* Field pair grid */
.field-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* Icon buttons */
.btn-icon {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 2px 8px;
    font-size: var(--text-sm);
    color: var(--fg-secondary);
    transition: all 0.15s;
    line-height: 1.5;
}
.btn-icon:hover {
    color: var(--fg);
    border-color: var(--border-hover);
    background: var(--bg-card);
}
.btn-icon--danger:hover {
    color: var(--error);
    border-color: var(--error);
}

/* === Responsive === */
@media (max-width: 900px) {
    :root {
        --rail-width: 24px;
    }

    /* Rail layout collapses to single column */
    .rail-layout {
        grid-template-columns: 1fr;
        padding: 0 0.75rem;
        gap: 0;
    }
    .rail-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem 0 0.25rem;
    }
    .rail-head-left p {
        margin-left: 0;
    }

    /* Sidebar becomes fixed bottom bar */
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        z-index: 200;
        padding: 0;
        background: rgba(14,14,17,0.95);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid rgba(59,130,246,0.15);
        box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
    }
    [data-theme="light"] .sidebar {
        background: rgba(245,245,247,0.95);
        border-top-color: rgba(59,130,246,0.2);
        box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    }
    .sidebar-results {
        display: flex;
        gap: 1rem;
        flex-wrap: wrap;
        padding: 0.625rem 0.75rem;
        background: none;
        border: none;
        border-radius: 0;
    }
    .sidebar-results::before { display: none; }
    .sidebar-results-title,
    .sidebar-divider { display: none; }
    .sidebar-result-item {
        min-width: 80px;
        margin-bottom: 0;
    }
    .sidebar-result-value { font-size: var(--text-base); }
    .sidebar-result-label { font-size: 0.5625rem; }
    .sidebar-links { display: none; }

    /* Tighter stations */
    .station { margin-bottom: 0.75rem; }
    .stn-card { padding: 1rem; }
    .rail-col::before { left: 7px; }
    .station-dot {
        left: calc(-1 * var(--rail-width) + 2px);
        top: calc(1.75rem - 4px);
        width: 8px;
        height: 8px;
    }

    /* Compact fields */
    .field-pair { grid-template-columns: 1fr; }
    .value-field-input { padding: 0.5rem 0.625rem; font-size: var(--text-base); }
    .value-field-unit { padding: 0.5rem 0.375rem; min-width: 3.25rem; font-size: 0.75rem; }
    .value-field label { font-size: 0.75rem; margin-bottom: 3px; }

    .results-inline { grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem; }
    .result-inline-value { font-size: var(--text-lg); }
    .result-inline-label { font-size: 0.625rem; }
    .result-inline-unit { font-size: var(--text-xs); }
    .sec-h { margin-bottom: 0.75rem; }
    .sec-title { font-size: 0.875rem; }

    .below-fold .related-grid { grid-template-columns: 1fr; }
    .below-fold { padding-bottom: 5rem; }

    .main-nav { display: none; }
    .topbar-auth { display: none; }
    .mobile-menu-btn { display: flex; }
    .content { padding: var(--space-md); }
    .footer-inner { grid-template-columns: 1fr 1fr; gap: var(--space-md); }
    .footer-inner .footer-col:last-child { grid-column: 1 / -1; }

    /* Converter */
    .converter-grid { grid-template-columns: 1fr; }
    .converter-arrow {
        text-align: center;
        transform: rotate(90deg);
        padding: 0;
    }

    /* Gear finder */
    .gear-finder-inputs { grid-template-columns: 1fr; }

    /* Projects */
    .project-layout { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .results-inline { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
    .rail-head-right { gap: 0.25rem; }
    .rail-head-right .btn { padding: 4px 8px; font-size: 0.75rem; }
}
