/* Unit Converter - Clean Design System */

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

:root {
    --primary: #e67e22;
    --primary-dark: #d35400;
    --primary-light: #fef5ed;
    --text: #2c3e50;
    --text-light: #34495e;
    --bg: #ffffff;
    --bg-alt: #f8f9fa;
    --border: #ddd;
    --border-input: #777;
    --success: #27ae60;
    --radius: 6px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
}

a { color: #16a085; text-decoration: none; }
a:hover { color: #138d75; text-decoration: underline; }

/* Typography - Compact for more content visibility */
h1 { font-size: 1.6rem; font-weight: 700; color: var(--text); margin-bottom: 0.5rem; line-height: 1.3; }
h2 { font-size: 1.35rem; font-weight: 700; color: var(--text); margin: 1.5rem 0 0.5rem; }
h3 { font-size: 1.15rem; font-weight: 700; color: var(--text); margin: 1rem 0 0.5rem; }
p { margin-bottom: 0.75rem; font-size: 1rem; line-height: 1.5; }

/* Layout */
.site-wrapper { min-height: 100vh; display: flex; flex-direction: column; }

/* Header */
.header { background: var(--primary); }
.header-inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 0.5rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo { font-size: 1.15rem; font-weight: 700; color: #fff; }
.logo:hover { color: #fff; text-decoration: none; }
.nav { display: flex; gap: 1.5rem; }
.nav a { font-size: 0.9rem; color: rgba(255,255,255,0.9); }
.nav a:hover { color: #fff; text-decoration: none; }

/* Main */
.main { flex: 1; max-width: 980px; width: 100%; margin: 0 auto; padding: 1.25rem; }

/* Layout Grid */
.layout { display: grid; grid-template-columns: 1fr 270px; gap: 2.5rem; }
.content { min-width: 0; }

/* Footer */
.footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 1.25rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
}
.footer-content p {
    margin: 0 0 0.75rem 0;
}
.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}
.footer-links a {
    color: var(--text-light);
    text-decoration: none;
}
.footer-links a:hover {
    color: var(--primary);
}

/* Breadcrumb */
.breadcrumb { font-size: 0.9rem; color: var(--text-light); margin-bottom: 0.5rem; }
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { margin: 0 0.4rem; }

/* Intro Text */
.intro { color: var(--text-light); margin-bottom: 1.25rem; font-size: 1.05rem; line-height: 1.5; }

/* =====================
   UNIFIED CALCULATOR BOX
   ===================== */
.calculator {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.25rem;
}
.calc-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.75rem;
    align-items: end;
}
.calc-field { }
.calc-field label {
    display: block;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.35rem;
}
.calc-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1.15rem;
    font-weight: 500;
    border: 1px solid var(--border-input);
    border-radius: var(--radius);
    background: var(--bg);
    transition: border-color 0.15s;
}
.calc-input:focus {
    outline: none;
    border-color: var(--primary);
}
.calc-select {
    width: 100%;
    padding: 0.4rem 0.5rem;
    font-size: 1rem;
    border: 1px solid var(--border-input);
    border-radius: var(--radius);
    background: var(--bg);
    margin-top: 0.35rem;
    cursor: pointer;
}
.calc-equals {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-light);
    padding: 0 0.4rem;
    padding-bottom: 0.5rem;
}
.calc-swap {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.15rem;
}
.calc-swap a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    font-size: 1.25rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    color: inherit;
}
.calc-swap a:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* Calculator Answer (inside calculator box) */
/* Default: Answer above inputs (border-bottom) */
.calc-answer {
    margin-bottom: 0.85rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
}
/* Answer below inputs - for homepage (border-top) */
.calc-answer--below {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
}
.calc-answer-main {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text);
}
.calc-answer-main .unit-name {
    font-weight: 400;
}
.calc-answer-main .answer-from,
.calc-answer-main .answer-to {
    display: inline;
}
.calc-answer-extra {
    margin-top: 0.35rem;
    font-size: 0.9rem;
    color: var(--text-light);
}
.calc-answer-extra span {
    margin-right: 1.25rem;
}
.calc-answer-link {
    margin-top: 0.5rem;
}
.calc-answer-link a {
    font-size: 0.95rem;
}

/* Category Calculator Layout */
.calc-grid-category {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.75rem;
    align-items: end;
}
.calc-swap-cat {
    display: flex;
    align-items: center;
    margin-bottom: 0.35rem;
}
.calc-swap-cat button {
    padding: 0.5rem 0.75rem;
    font-size: 1.25rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
}
.calc-swap-cat button:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* Homepage Calculator Search */
.calc-search {
    display: flex;
    gap: 0.6rem;
    align-items: flex-end;
}
.calc-field-full {
    flex: 1;
}
.calc-search .calc-input {
    height: 2.75rem;
    box-sizing: border-box;
}
.calc-btn {
    height: 2.75rem;
    padding: 0.4rem 1.25rem;
    font-size: 1.05rem;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s;
    box-sizing: border-box;
}
.calc-btn:hover {
    background: var(--primary-dark);
}
.calc-btn .btn-icon {
    display: none;
}
.calc-btn .btn-text {
    display: inline;
}
.calc-error {
    margin-top: 0.75rem;
    padding: 0.6rem 0.85rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    border-radius: var(--radius);
    font-size: 0.9rem;
}

/* =====================
   ANSWER BOX (Value pages & Search)
   ===================== */
.answer-box {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.answer-box .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.85;
    margin-bottom: 0.35rem;
}
.answer-box .value {
    font-size: 1.5rem;
    font-weight: 600;
}
.answer-box .value strong {
    font-size: 1.65rem;
}
.answer-box .extra {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.2);
    font-size: 0.9rem;
    opacity: 0.9;
}
.answer-box .extra span {
    display: inline-block;
    margin-right: 1.25rem;
}

/* =====================
   STEP-BY-STEP SOLUTION
   ===================== */
.steps-section {
    background: var(--bg);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.steps-section h2 {
    margin: 0 0 1rem;
    padding: 0;
    border: none;
    font-size: 1.1rem;
}
.step {
    display: flex;
    gap: 0.9rem;
    margin-bottom: 1rem;
}
.step:last-child { margin-bottom: 0; }
.step-num {
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}
.step-content { flex: 1; padding-top: 3px; }
.step-content strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}
.step-content p {
    font-size: 0.95rem;
    color: var(--text-light);
    margin: 0;
}
.step.final {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}
.step.final .step-num { background: var(--success); }
.step.final .step-content p { font-weight: 600; color: var(--text); }

/* =====================
   FORMULA BOX
   ===================== */
.formula-box {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    margin-bottom: 1.5rem;
}
.formula-main {
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
}
.formula-note {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* =====================
   TWO-COLUMN LINK LIST (Clean, no boxes)
   ===================== */
.link-list {
    column-count: 2;
    column-gap: 2rem;
    margin: 0.75rem 0 1.5rem;
}
.link-list a {
    display: block;
    padding: 0.4rem 0;
    font-size: 0.95rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    break-inside: avoid;
}
.link-list a:hover {
    color: var(--primary);
    text-decoration: none;
}
.link-list a.highlight {
    color: var(--primary);
    font-weight: 500;
}

/* =====================
   LINK GRID (Internal Links for SEO)
   ===================== */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    margin: 0.75rem 0 1.5rem;
}
.link-grid .link-item {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: #16a085;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.15s;
}
.link-grid .link-item:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
}
.related-conversions {
    margin: 1rem 0 1.5rem;
}

/* =====================
   TWO-COLUMN DATA LIST (Examples, etc.)
   ===================== */
.data-list {
    column-count: 2;
    column-gap: 2rem;
    margin: 0.75rem 0 1.5rem;
}
.data-list-item {
    display: flex;
    justify-content: space-between;
    padding: 0.45rem 0;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
    break-inside: avoid;
}
.data-list-item .from { color: var(--text); }
.data-list-item .to { color: var(--primary); font-weight: 500; }

/* =====================
   TABLE
   ===================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    margin: 0.75rem 0 1.5rem;
}
.data-table th,
.data-table td {
    padding: 0.65rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.data-table th {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-light);
    background: var(--bg-alt);
}
.data-table tbody tr:hover { background: var(--bg-alt); }
.data-table a { color: var(--text); }
.data-table a:hover { color: var(--primary); }
.data-table .result { color: var(--primary); font-weight: 500; }

/* =====================
   CATEGORY LIST (Homepage)
   ===================== */
.category-section {
    margin: 1.5rem 0;
}
.category-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}
.category-list {
    column-count: 2;
    column-gap: 2rem;
}
.category-list a {
    display: block;
    padding: 0.45rem 0;
    font-size: 0.95rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    break-inside: avoid;
}
.category-list a:hover {
    color: var(--primary);
    text-decoration: none;
}

/* =====================
   FAQ
   ===================== */
.faq-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}
.faq-item:last-child { border-bottom: none; }
.faq-item h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.4rem;
    color: var(--text);
}
.faq-item p {
    font-size: 0.95rem;
    color: var(--text-light);
    margin: 0;
}

/* =====================
   EXAMPLE LIST
   ===================== */
.example-list {
    list-style: none;
    margin: 0.5rem 0 1rem;
    padding: 0;
}
.example-list li {
    padding: 0.5rem 0.75rem;
    background: var(--bg-alt);
    border-radius: var(--radius);
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
}

/* =====================
   SEARCH BOX
   ===================== */
.search-box {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.search-input {
    flex: 1;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    transition: border-color 0.15s;
}
.search-input:focus {
    outline: none;
    border-color: var(--primary);
}
.search-input::placeholder {
    color: var(--text-light);
}
.search-btn {
    padding: 0.85rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s;
}
.search-btn:hover { background: var(--primary-dark); }

/* =====================
   AI RESULT (Homepage Search)
   ===================== */
.ai-result {
    display: none;
    margin-bottom: 2rem;
}
.ai-result.show { display: block; }

/* =====================
   SIDEBAR
   ===================== */
.sidebar { font-size: 0.9rem; }
.sidebar-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.sidebar-group { margin-bottom: 0.35rem; }
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.75rem;
    background: var(--bg-alt);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    transition: background 0.15s;
}
.sidebar-header:hover { background: #eaeaea; }
.sidebar-header.active { color: var(--primary-dark); font-weight: 600; }
.sidebar-header .count {
    font-size: 0.75rem;
    color: var(--text);
    font-weight: 400;
}
.sidebar-header .icon { color: var(--text-light); }
.sidebar-content {
    display: none;
    padding: 0.4rem 0 0.4rem 0.75rem;
    column-count: 2;
    column-gap: 0.5rem;
}
.sidebar-content.open { display: block; }
.sidebar-content a {
    display: block;
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
    color: var(--text-light);
    border-radius: var(--radius);
    transition: all 0.1s;
    break-inside: avoid;
}
.sidebar-content a:hover {
    background: var(--bg-alt);
    color: var(--primary);
    text-decoration: none;
}
.sidebar-content a.current {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
}

/* =====================
   UNIT CARD
   ===================== */
.unit-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}
.unit-card .unit-symbol {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}
.unit-card .unit-name {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.unit-card .unit-system {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 800px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar {
        margin-top: 2rem;
        padding-top: 1.5rem;
        border-top: 1px solid var(--border);
    }
    .sidebar-content { column-count: 3; } /* More space when full width */
    .link-list, .data-list, .category-list { column-count: 1; }
}

@media (max-width: 550px) {
    html { font-size: 15px; }
    .header-inner { padding: 0.85rem 1rem; }
    .main { padding: 1rem; }
    .nav { display: none; }
    .sidebar-content { column-count: 2; } /* 2 columns for small screens */
    /* Answer: two lines on mobile, result highlighted */
    .calc-answer-main {
        font-size: 1rem;
    }
    .calc-answer-main .answer-from {
        display: block;
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }
    .calc-answer-main .answer-to {
        display: block;
        font-size: 1.4rem;
    }
    .calc-grid { 
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        gap: 0.5rem;
        align-items: stretch;
    }
    .calc-grid .calc-field:first-child {
        grid-column: 1;
        grid-row: 1;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    .calc-grid .calc-field:first-child label {
        order: 2;
        margin-bottom: 0;
        font-size: 0.9rem;
    }
    .calc-grid .calc-field:first-child .calc-input {
        order: 1;
        width: 60%;
        flex-shrink: 0;
    }
    .calc-grid .calc-swap {
        grid-column: 2;
        grid-row: 1 / 3;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 0;
    }
    .calc-grid .calc-swap a {
        padding: 0.6rem;
    }
    .calc-grid .calc-field:last-child {
        grid-column: 1;
        grid-row: 2;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    .calc-grid .calc-field:last-child label {
        order: 2;
        margin-bottom: 0;
        font-size: 0.9rem;
    }
    .calc-grid .calc-field:last-child .calc-input {
        order: 1;
        width: 60%;
        flex-shrink: 0;
    }
    /* Category calculator mobile */
    .calc-grid-category {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        gap: 0.75rem;
        align-items: stretch;
    }
    .calc-grid-category > .calc-field:first-child {
        grid-column: 1;
        grid-row: 1;
        display: flex;
        gap: 0.5rem;
        align-items: end;
        flex-wrap: wrap;
    }
    .calc-grid-category > .calc-field:first-child label {
        display: none; /* Hide "From" label on mobile */
    }
    .calc-grid-category > .calc-field:first-child .calc-input {
        width: 35%;
        flex-shrink: 0;
    }
    .calc-grid-category > .calc-field:first-child .calc-select {
        flex: 1;
        margin-top: 0;
    }
    .calc-grid-category .calc-swap-cat {
        grid-column: 2;
        grid-row: 1 / 3;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 0;
    }
    .calc-grid-category > .calc-field:last-child {
        grid-column: 1;
        grid-row: 2;
        display: flex;
        gap: 0.5rem;
        align-items: end;
        flex-wrap: wrap;
    }
    .calc-grid-category > .calc-field:last-child label {
        display: none; /* Hide "To" label on mobile */
    }
    .calc-grid-category > .calc-field:last-child .calc-input {
        width: 35%;
        flex-shrink: 0;
    }
    .calc-grid-category > .calc-field:last-child .calc-select {
        flex: 1;
        margin-top: 0;
    }
    /* Match input and select heights on mobile */
    .calc-grid-category .calc-input,
    .calc-grid-category .calc-select {
        padding: 0.65rem 0.75rem;
        font-size: 1rem;
        height: 2.75rem;
        box-sizing: border-box;
    }
    .calc-equals {
        text-align: center;
        padding: 0.25rem 0;
    }
    .calc-search {
        flex-direction: row;
        align-items: flex-end;
    }
    .calc-search .calc-field-full {
        flex: 1;
    }
    .calc-search .calc-input {
        height: 2.75rem;
    }
    .calc-search .calc-btn {
        width: auto;
        height: 2.75rem;
        padding: 0 0.75rem;
        font-size: 1.25rem;
    }
    .calc-search .calc-btn .btn-text {
        display: none;
    }
    .calc-search .calc-btn .btn-icon {
        display: inline;
    }
    .search-box { flex-direction: column; }
    .search-btn { width: 100%; }
    .answer-box .value { font-size: 1.3rem; }
    .answer-box .value strong { font-size: 1.4rem; }
}

/* =====================
   UTILITIES
   ===================== */
.text-center { text-align: center; }
.text-muted { color: var(--text-light); }
.mt-1 { margin-top: 0.75rem; }
.mt-2 { margin-top: 1.25rem; }
.mb-1 { margin-bottom: 0.75rem; }
.mb-2 { margin-bottom: 1.25rem; }

/* Error Box */
.error-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin: 1rem 0;
    font-size: 0.95rem;
}

/* Category Grid (Homepage) */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.category-card {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all 0.15s;
}
.category-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}
.category-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}
.category-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--primary);
}
.category-desc {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Category Sections (Homepage - grouped with titles) */
.category-section {
    margin-bottom: 1.5rem;
}
.category-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.category-list {
    column-count: 2;
    column-gap: 2rem;
}
.category-list a {
    display: block;
    padding: 0.4rem 0;
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
    break-inside: avoid;
}
.category-list a:hover {
    color: var(--primary);
    text-decoration: none;
}

@media (max-width: 550px) {
    .category-list {
        column-count: 1;
    }
}

/* ==========================================
    .conversion-links-grid {
        grid-template-columns: 1fr;
    }
    
    .conversion-group .conv-link {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
}

/* ==========================================
   REFERENCE TABLE - Clean Data Display
   ========================================== */

.reference-section {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.reference-section h2 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.reference-section > p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.reference-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.reference-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    background: var(--bg-alt);
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-light);
}

.reference-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.reference-table tr:hover {
    background: var(--bg-alt);
}

.reference-table tr.current,
.reference-table tr.active {
    background: var(--primary-light);
}

.reference-table tr.current td,
.reference-table tr.active td {
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.reference-table td a {
    color: #16a085;
    font-weight: 500;
}

.reference-table td a:hover {
    color: #138d75;
    text-decoration: underline;
}

.reference-table .formula {
    color: var(--text-light);
    font-family: monospace;
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    .reference-table {
        font-size: 0.8rem;
    }
    
    .reference-table th,
    .reference-table td {
        padding: 0.5rem;
    }
    
    .reference-table .formula {
        display: none;
    }
    
    .link-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }
    
    .link-grid .link-item {
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
    }
}
