/* =============================================================
   sizepaper.net — Full CSS
   Homepage: 5 sizes + 1 View All = 6 per row
   Category: 6 per row
   Cards: Compact height, text unchanged
   ============================================================= */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
    background: #ffffff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: #111827;
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    max-width: 100%;
}

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

/* ---------- Variables ---------- */
:root {
    --text: #111827;
    --text-mid: #4b5563;
    --text-light: #6b7280;
    --bg: #ffffff;
    --card-bg: #ffffff;
    --border: #e5e7eb;
    --border-dark: #d1d5db;
    --blue: #2563eb;
    --red: #ef4444;
    --gutter: 20px;
    --radius: 6px;
    --radius-lg: 10px;
}

html[data-theme="dark"] {
    --text: #f3f4f6;
    --text-mid: #d1d5db;
    --text-light: #9ca3af;
    --bg: #0f172a;
    --card-bg: #1e293b;
    --border: #334155;
    --border-dark: #475569;
}

body {
    background: var(--bg);
    color: var(--text);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
    letter-spacing: -0.02em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.25rem; margin-bottom: 12px; }
h3 { font-size: 1.05rem; margin-bottom: 10px; }
h4 { font-size: 1rem; }
p { color: var(--text-mid); margin-bottom: 12px; }
p:last-child { margin-bottom: 0; }
a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: none; }
ul, ol { padding-left: 22px; color: var(--text-mid); }
li { margin-bottom: 6px; }
strong { color: var(--text); font-weight: 600; }

/* ---------- Layout ---------- */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--gutter);
    max-width: 1280px;
    position: relative;
    z-index: 1;
}

main {
    min-height: 60vh;
    padding-bottom: 40px;
    position: relative;
    z-index: 1;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--blue);
    color: #fff;
    padding: 10px 16px;
    z-index: 999;
}
.skip-link:focus { left: 0; color: #fff; }

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

/* =============================================================
   HEADER
   ============================================================= */
.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    overflow: visible !important;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px var(--gutter);
    max-width: 1280px;
    margin: 0 auto;
    min-height: 60px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
    flex-shrink: 0;
    letter-spacing: -0.02em;
}
.logo svg { color: var(--text); }

.header-search {
    position: relative;
    flex: 1;
    max-width: 300px;
    margin-left: auto;
    display: flex;
    align-items: center;
}
.header-search > svg {
    position: absolute;
    left: 14px;
    color: var(--text-light);
    pointer-events: none;
}
.header-search input {
    width: 100%;
    padding: 8px 14px 8px 36px;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    outline: none;
    transition: border-color 0.15s;
}
.header-search input:focus { border-color: var(--text); }

.search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
    max-height: 320px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
}
.search-results.is-open { display: block; }
.search-results a {
    display: block;
    padding: 10px 14px;
    color: var(--text);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover { background: var(--border); }
.search-results .sr-empty {
    padding: 10px 14px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.header-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    font-size: 0.82rem;
    font-family: inherit;
    font-weight: 500;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    text-decoration: none;
}
.header-btn:hover {
    background: var(--card-bg);
    text-decoration: none;
}
.header-icon { padding: 7px 9px; }

/* =============================================================
   UNIT DROPDOWN (navbar)
   ============================================================= */
.unit-dropdown { position: relative; }

.unit-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    padding: 6px;
    z-index: 9999;
    animation: unitFadeIn 0.15s ease;
}

@keyframes unitFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.unit-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    background: transparent;
    border: 0;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text);
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.1s, color 0.1s;
    position: relative;
}
.unit-option:hover { background: var(--border); }
.unit-option.is-active {
    background: var(--text);
    color: var(--bg);
    font-weight: 600;
}
.unit-option.is-active::before {
    content: "✓";
    position: absolute;
    right: 12px;
    font-size: 0.75rem;
}

/* =============================================================
   CATEGORY NAVIGATION
   ============================================================= */
.cat-nav {
    border-top: 1px solid var(--border);
    background: var(--bg);
    position: relative;
    z-index: 200;
    overflow: visible;
}

.cat-nav-inner {
    display: flex;
    gap: 6px;
    padding: 10px var(--gutter);
    max-width: 1280px;
    margin: 0 auto;
    overflow-x: auto;
    scrollbar-width: none;
    align-items: center;
    position: relative;
}
.cat-nav-inner::-webkit-scrollbar { display: none; }

.cat-tab {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    white-space: nowrap;
    transition: all 0.15s;
    flex-shrink: 0;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
}
.cat-tab:hover { background: var(--card-bg); text-decoration: none; }
.cat-tab.is-active { border-color: var(--text); font-weight: 600; }

/* =============================================================
   MORE DROPDOWN — Floating outside
   ============================================================= */
.cat-more-menu {
    position: fixed;
    top: 0;
    left: 0;
    background-color: #ffffff;
    color: #111827;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.25),
        0 8px 20px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.03);
    padding: 8px;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 2147483647;
    min-width: 240px;
    width: 260px;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
}

.cat-more-menu.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.cat-more-menu[hidden] { display: none; }

.cat-more-menu a {
    display: block;
    padding: 10px 14px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #111827;
    background-color: transparent;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.1s, color 0.1s;
    cursor: pointer;
}
.cat-more-menu a:hover,
.cat-more-menu a:focus {
    background-color: #f3f4f6;
    color: #111827;
    outline: none;
    text-decoration: none;
}
.cat-more-menu a.is-active {
    background-color: #111827;
    color: #ffffff;
    font-weight: 600;
}
.cat-more-menu::-webkit-scrollbar { width: 6px; }
.cat-more-menu::-webkit-scrollbar-track { background: transparent; }
.cat-more-menu::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
.cat-more-menu::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

html[data-theme="dark"] .cat-more-menu {
    background-color: #1e293b;
    color: #f3f4f6;
    border-color: #334155;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 8px 20px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}
html[data-theme="dark"] .cat-more-menu a { color: #f3f4f6; }
html[data-theme="dark"] .cat-more-menu a:hover,
html[data-theme="dark"] .cat-more-menu a:focus {
    background-color: #334155;
    color: #f3f4f6;
}
html[data-theme="dark"] .cat-more-menu a.is-active {
    background-color: #f3f4f6;
    color: #111827;
}
html[data-theme="dark"] .cat-more-menu::-webkit-scrollbar-thumb {
    background: #475569;
}

/* =============================================================
   BREADCRUMB
   ============================================================= */
.breadcrumb {
    padding: 16px 0 4px;
    font-size: 0.82rem;
    color: var(--text-light);
}
.breadcrumb ol {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.breadcrumb li + li::before {
    content: "/";
    margin-right: 6px;
    color: var(--text-light);
}
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--text); }

.size-label-top {
    font-size: 0.8rem;
    color: var(--text-light);
    margin: 16px 0 8px;
}

/* =============================================================
   HOMEPAGE
   ============================================================= */
.intro-text {
    font-size: 1rem;
    color: var(--text-mid);
    padding: 20px 0 8px;
    max-width: 720px;
    line-height: 1.6;
}

.category-section {
    margin: 24px 0;
    position: relative;
    z-index: 1;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.92rem;
    font-weight: 500;
    margin-bottom: 10px;
}
.category-title a {
    color: var(--text-mid);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.category-title a:hover { color: var(--text); }
.category-title .arrow { color: var(--text-light); font-size: 0.85rem; }

/* =============================================================
   GRIDS — Homepage 5+1 | Category 6
   ============================================================= */

.home-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
    width: 100%;
}

.sizes-grid,
.sizes-grid-4 {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
    width: 100%;
}

/* =============================================================
   SIZE CARDS — Compact height, text unchanged
   ============================================================= */
.size-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    aspect-ratio: 1 / 0.7;
    padding: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.15s;
    overflow: hidden;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    min-height: 60px;
}

.size-card:hover {
    border-color: var(--text);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    text-decoration: none;
}

.size-name {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.size-dim {
    font-size: 0.68rem;
    color: var(--text-light);
    margin-top: 4px;
    line-height: 1.3;
}

.size-unit {
    color: var(--text-light);
}

/* View All card */
.size-card-viewall {
    justify-content: center;
    align-items: center;
    text-align: center;
    background: var(--card-bg);
}

.viewall-text {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.viewall-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1.5px solid var(--text-light);
    border-radius: 50%;
    font-size: 0.8rem;
    color: var(--text-light);
    line-height: 1;
    transition: all 0.15s;
}

.size-card-viewall:hover .viewall-arrow {
    border-color: var(--text);
    color: var(--text);
}

/* =============================================================
   SIZE HERO (detail page)
   ============================================================= */
.cat-h1 { font-size: 2rem; margin: 20px 0 24px; }

.size-hero { margin: 12px 0 24px; }

.size-hero-row {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-top: 16px;
    flex-wrap: wrap;
}

.size-visual {
    width: 100px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 16px;
    flex-shrink: 0;
}
.size-visual-box {
    width: 100%;
    height: 100%;
    background: var(--bg);
    border: 1.5px solid var(--text);
}

.size-hero-info { flex: 1; min-width: 200px; }

.size-hero-dim {
    font-size: 1.15rem;
    color: var(--text);
    font-weight: 500;
    margin-bottom: 12px;
}

.size-hero-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.8rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}
.btn-ghost:hover {
    background: var(--card-bg);
    text-decoration: none;
}

/* Change Unit dropdown */
.change-unit-wrap { position: relative; display: inline-block; }
.change-unit-wrap .btn-ghost { gap: 6px; }

.change-unit-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
    min-width: 140px;
    padding: 6px;
    z-index: 9999;
    animation: unitFadeIn 0.15s ease;
}
.change-unit-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    background: transparent;
    border: 0;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text);
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.1s, color 0.1s;
    position: relative;
}
.change-unit-menu button:hover { background: var(--border); }
.change-unit-menu button.is-active {
    background: var(--text);
    color: var(--bg);
    font-weight: 600;
}
.change-unit-menu button.is-active::before {
    content: "✓";
    position: absolute;
    right: 12px;
    font-size: 0.75rem;
}

/* =============================================================
   INFO / CONTENT SECTIONS
   ============================================================= */
.content-section { margin: 40px 0; }

.info-block {
    margin: 32px 0;
    padding: 20px 0;
    border-top: 1px solid var(--border);
}
.info-block h2 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    margin-bottom: 12px;
    font-weight: 600;
}
.info-block p {
    font-size: 0.9rem;
    line-height: 1.7;
    max-width: 900px;
    color: var(--text-mid);
}

/* =============================================================
   TABLES
   ============================================================= */
.table-block {
    margin: 32px 0;
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg);
}

.table-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    padding: 14px 16px 0;
    margin: 0;
}

.sizes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.sizes-table th,
.sizes-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.sizes-table th {
    font-weight: 500;
    font-size: 0.82rem;
    color: var(--text-light);
}
.sizes-table tr:last-child td { border-bottom: 0; }
.sizes-table a { color: var(--text); font-weight: 500; }
.sizes-table a:hover { color: var(--blue); }
.sizes-table-units td:first-child { color: var(--text-light); }

/* =============================================================
   RELATED CATEGORIES
   ============================================================= */
.related-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.related-cat {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text);
    text-decoration: none;
    transition: all 0.15s;
}
.related-cat:hover {
    border-color: var(--text);
    background: var(--bg);
    text-decoration: none;
}

/* =============================================================
   FAQ
   ============================================================= */
.faq-section { margin: 40px 0; }

.faq-item {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}
.faq-item:first-of-type { border-top: 1px solid var(--border); }

.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text);
    list-style: none;
    padding: 4px 24px 4px 0;
    position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    border-right: 1.5px solid var(--text-light);
    border-bottom: 1.5px solid var(--text-light);
    transition: transform 0.2s;
}
.faq-item[open] summary::after {
    transform: translateY(-50%) rotate(-135deg);
}
.faq-item p {
    margin-top: 10px;
    font-size: 0.88rem;
    color: var(--text-mid);
    line-height: 1.65;
}

/* =============================================================
   SVG NESTING DIAGRAM
   ============================================================= */
.svg-nest {
    display: flex;
    justify-content: center;
    margin: 24px 0;
    padding: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 500px;
}
.svg-nest svg {
    width: 100%;
    max-width: 420px;
    height: auto;
    display: block;
}
.svg-nest rect { stroke: var(--text); fill: none; }
.svg-nest text {
    fill: var(--text);
    font-size: 11px;
    font-family: inherit;
    font-weight: 500;
}

/* =============================================================
   COMPARE TOOL
   ============================================================= */
.compare-unit-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 8px 0 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.compare-unit-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-mid);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.compare-unit-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.unit-pill {
    padding: 6px 14px;
    font-size: 0.82rem;
    font-family: inherit;
    font-weight: 500;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.unit-pill:hover {
    border-color: var(--text);
    background: var(--card-bg);
}
.unit-pill.is-active {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
    font-weight: 600;
}

.compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin: 24px 0 32px;
    align-items: start;
}

.compare-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.compare-label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-mid);
    margin-top: 10px;
}

.compare-select {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
}
.compare-select:focus { border-color: var(--text); }

.compare-visual {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.compare-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid var(--text);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.compare-box-a {
    background: rgba(37, 99, 235, 0.12);
    border-color: #2563eb;
}
.compare-box-b {
    background: rgba(239, 68, 68, 0.12);
    border-color: #ef4444;
}
.compare-box-label {
    position: absolute;
    top: 4px;
    left: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text);
    background: var(--bg);
    padding: 1px 6px;
    border-radius: 3px;
    white-space: nowrap;
    z-index: 2;
}

.compare-summary {
    margin: 32px 0;
    padding: 24px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.compare-summary-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
}
.compare-summary-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-mid);
    margin: 0;
}

/* =============================================================
   LEGAL PAGES
   ============================================================= */
.legal-page {
    max-width: 820px;
    margin: 0 auto;
    padding: 8px 0 48px;
}
.legal-content h2 { font-size: 1.5rem; margin: 28px 0 12px; }
.legal-content h3 {
    font-size: 1.05rem;
    margin: 22px 0 8px;
    color: var(--text);
    font-weight: 600;
}
.legal-content p {
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--text-mid);
    margin-bottom: 12px;
}
.legal-content ul { padding-left: 22px; margin: 10px 0 16px; }
.legal-content li {
    font-size: 0.93rem;
    line-height: 1.7;
    color: var(--text-mid);
    margin-bottom: 6px;
}
.legal-content a {
    color: var(--blue);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.legal-content strong { color: var(--text); font-weight: 600; }
.legal-content em {
    color: var(--text-light);
    font-style: normal;
    font-size: 0.85rem;
}

/* =============================================================
   AD SLOTS
   ============================================================= */
.ad-slot {
    margin: 32px auto;
    width: 100%;
    max-width: 100%;
    text-align: center;
    min-height: 100px;
    overflow: hidden;
}
.ad-slot[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.68rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: 6px;
}
.ad-slot ins.adsbygoogle {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100px !important;
}

/* =============================================================
   FOOTER
   ============================================================= */
.site-footer {
    margin-top: 60px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-light);
    background: var(--bg);
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 0 var(--gutter);
    max-width: 1280px;
    margin: 0 auto;
}
.footer-left {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}
.footer-left a { color: var(--text-light); }
.footer-left a:hover { color: var(--text); }
.footer-right {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.footer-right a {
    color: var(--text-light);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
}
.footer-right a.is-active {
    color: var(--text);
    font-weight: 700;
}
.footer-right a:hover { color: var(--text); }

/* =============================================================
   BUTTONS
   ============================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    background: var(--text);
    color: var(--bg);
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    transition: opacity 0.15s;
}
.btn:hover {
    opacity: 0.9;
    text-decoration: none;
    color: var(--bg);
}

/* =============================================================
   ERROR PAGE
   ============================================================= */
.error-page {
    text-align: center;
    padding: 60px 20px;
}
.error-page h1 {
    font-size: 4rem;
    color: var(--text);
    margin: 0 0 12px;
    line-height: 1;
}
.error-page p {
    font-size: 1.05rem;
    color: var(--text-mid);
    margin-bottom: 24px;
}

/* =============================================================
   RESPONSIVE — Compact height, text unchanged
   ============================================================= */

/* 1024-1280px: 5 columns */
@media (max-width: 1280px) {
    .home-grid,
    .sizes-grid,
    .sizes-grid-4 {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 7px;
    }
    .size-card {
        min-height: 58px;
        padding: 7px;
    }
}

/* 860-1024px: 4 columns */
@media (max-width: 1024px) {
    .home-grid,
    .sizes-grid,
    .sizes-grid-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 7px;
    }
    .size-card {
        min-height: 58px;
        padding: 7px;
    }
}

/* 640-860px: 3 columns */
@media (max-width: 860px) {
    .home-grid,
    .sizes-grid,
    .sizes-grid-4 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }
    .size-card {
        min-height: 55px;
        padding: 7px;
    }
}

/* 480-640px: 2 columns */
@media (max-width: 640px) {
    :root { --gutter: 14px; }

    .header-inner {
        flex-wrap: wrap;
        padding: 10px var(--gutter);
    }
    .logo { font-size: 0.95rem; }
    .header-search {
        flex: 1;
        max-width: none;
        order: 3;
        width: 100%;
        margin-top: 4px;
        margin-left: 0;
    }
    .header-actions {
        order: 2;
        gap: 4px;
        margin-left: auto;
    }
    .header-btn span { display: none; }
    .header-btn { padding: 7px 9px; }

    .home-grid,
    .sizes-grid,
    .sizes-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .size-card {
        padding: 7px;
        min-height: 55px;
    }

    .cat-h1 { font-size: 1.5rem; }

    .footer-inner { flex-direction: column; align-items: flex-start; }

    .sizes-table th,
    .sizes-table td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .size-visual { width: 90px; height: 120px; }
    .size-hero-dim { font-size: 1rem; }

    .compare-grid { grid-template-columns: 1fr; gap: 20px; }
    .compare-unit-row { gap: 8px; }
    .compare-unit-label {
        width: 100%;
        margin-bottom: 4px;
    }
    .unit-pill {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    .compare-summary { padding: 18px; }
    .compare-summary-text { font-size: 0.88rem; }

    .legal-content h2 { font-size: 1.25rem; }
    .legal-content h3 { font-size: 1rem; }
}

/* < 480px: Small mobile */
@media (max-width: 480px) {
    .home-grid,
    .sizes-grid,
    .sizes-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px;
    }
    .size-card {
        padding: 6px;
        min-height: 50px;
    }
}

/* =============================================================
   PRINT
   ============================================================= */
@media print {
    .site-header,
    .site-footer,
    .ad-slot,
    .cat-nav,
    .header-search,
    .compare-unit-row,
    .size-hero-actions {
        display: none !important;
    }
    body {
        background: #fff;
        color: #000;
    }
    .container { padding: 0; }
}