/* Design tokens — change these to re-theme the whole site */
:root {
    --bg: #f6f6f4;
    --surface: #fff;
    --surface-alt: #fafaf8;
    --text: #1b1b1b;
    --text-muted: #666;
    --text-faint: #9a9a96;
    --border: #e4e4e0;
    --border-strong: #cfcfca;
    --accent: #0b3d91;
    --accent-soft: #e8eef8;
    --ok: #1f7a4d;
    --warn: #9a6a00;
    --radius: 4px;
    --font: "Inter", -apple-system, "Segoe UI", Arial, sans-serif;
    --content-width: 1080px;
}

* { box-sizing: border-box; }
body {
    font-family: var(--font); margin: 0; background: var(--bg); color: var(--text);
    font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-muted); margin: 0 0 10px; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header-inner { max-width: var(--content-width); margin: 0 auto; padding: 0 20px;
    display: flex; align-items: center; gap: 28px; height: 56px; }
.logo { font-weight: 700; font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo span { color: var(--accent); }
.site-nav { display: flex; gap: 20px; }
.site-nav a { color: var(--text-muted); font-size: 14px; }
.site-nav a:hover { color: var(--text); text-decoration: none; }

/* Diameter tabs */
nav.diameters { background: var(--surface); border-bottom: 1px solid var(--border); }
.diameters-inner { max-width: var(--content-width); margin: 0 auto; padding: 0 20px;
    display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.diameters-label { color: var(--text-faint); font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
    padding: 10px 12px 10px 0; white-space: nowrap; }
nav.diameters a { color: var(--text-muted); font-size: 14px; padding: 10px 12px; white-space: nowrap;
    border-bottom: 2px solid transparent; font-variant-numeric: tabular-nums; }
nav.diameters a:hover { color: var(--text); text-decoration: none; }
nav.diameters a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* Layout */
main { max-width: var(--content-width); margin: 0 auto; padding: 28px 20px 48px; }
.page-head { margin-bottom: 20px; }
.breadcrumbs { font-size: 13px; color: var(--text-faint); margin-bottom: 6px; }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs .sep { margin: 0 6px; }
.page-meta { color: var(--text-muted); margin-top: 4px; }
section.ranking { margin-top: 32px; }

.site-footer { border-top: 1px solid var(--border); color: var(--text-faint); font-size: 13px; }
.site-footer-inner { max-width: var(--content-width); margin: 0 auto; padding: 20px; }

/* Tables */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted);
    background: var(--surface-alt); border-bottom-color: var(--border-strong); white-space: nowrap; }
tbody tr:hover { background: var(--surface-alt); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.spec { font-variant-numeric: tabular-nums; color: var(--text-muted); white-space: nowrap; }
.rank { color: var(--text-faint); width: 44px; font-variant-numeric: tabular-nums; }
.thumb-cell { width: 56px; padding-right: 0; }
.thumb { width: 40px; height: 40px; object-fit: contain; background: var(--surface-alt);
    border: 1px solid var(--border); border-radius: var(--radius); display: block; }
.thumb-empty { width: 40px; height: 40px; background: var(--surface-alt); border-radius: var(--radius); }
a.entry-link { color: var(--text); font-weight: 500; }
a.entry-link:hover { color: var(--accent); }
.brand-name { color: var(--text-muted); font-weight: 400; }
.weight { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.weight small { color: var(--text-faint); font-weight: 400; }
.spec-inline { display: none; font-size: 13px; margin-top: 2px; }

/* Verified badges */
.badge { display: inline-block; font-size: 11px; font-weight: 500; padding: 1px 6px; border-radius: 3px;
    margin-left: 6px; vertical-align: 1px; }
.verified { color: var(--ok); background: #e9f4ee; }
.not-verified { color: var(--warn); background: #faf1dd; }

/* Entry detail */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.detail { display: grid; grid-template-columns: 320px 1fr; gap: 32px; align-items: start; }
.detail-photo { background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius);
    aspect-ratio: 1; display: flex; align-items: center; justify-content: center; color: var(--text-faint); }
.detail-photo img, .photo-large { max-width: 100%; max-height: 100%; object-fit: contain; }
.detail-weight { font-size: 32px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.detail-weight small { font-size: 16px; color: var(--text-muted); font-weight: 400; }
.spec-table { margin-top: 20px; }
.spec-table td { padding: 8px 0; }
.spec-table td:first-child { color: var(--text-muted); width: 45%; }
.spec-table td:last-child { font-variant-numeric: tabular-nums; }
.back-link { margin-top: 20px; font-size: 13px; }

/* Model head */
.model-head { display: flex; gap: 24px; align-items: center; }
.model-head .detail-photo { width: 120px; flex-shrink: 0; }

/* Brand list / model list */
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.brand-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text); }
.brand-card:hover { border-color: var(--accent); text-decoration: none; }
.brand-card img { max-width: 100%; max-height: 48px; object-fit: contain; }
.brand-card-name { font-size: 18px; font-weight: 600; letter-spacing: .04em; color: var(--text-faint); }
.brand-card-caption { font-size: 13px; color: var(--text-muted); text-align: center; }
.brand-logo { height: 32px; vertical-align: middle; margin-right: 10px; }

.model-list { list-style: none; padding: 0; margin: 0; columns: 3 220px; column-gap: 24px; }
.model-list li { padding: 7px 0; border-bottom: 1px solid var(--border); break-inside: avoid;
    display: flex; justify-content: space-between; gap: 12px; }
.model-list .count { color: var(--text-faint); font-variant-numeric: tabular-nums; }

/* Home */
.lead { color: var(--text-muted); font-size: 16px; max-width: 560px; margin: 8px 0 28px; }
.diameter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.diameter-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px; color: var(--text); }
.diameter-tile:hover { border-color: var(--accent); text-decoration: none; }
.diameter-tile strong { display: block; font-size: 28px; font-weight: 600; letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums; }
.diameter-tile span { color: var(--text-muted); font-size: 13px; }

/* Mobile */
@media (max-width: 720px) {
    .site-header-inner, .diameters-inner, main, .site-footer-inner { padding-left: 16px; padding-right: 16px; }
    main { padding-top: 20px; }
    h1 { font-size: 20px; }
    .detail { grid-template-columns: 1fr; gap: 20px; }
    .card { padding: 16px; }
    .hide-mobile { display: none; }
    .spec-inline { display: block; }
    td.num .badge { display: block; width: fit-content; margin: 3px 0 0 auto; }
    th, td { padding: 8px 10px; }
}

/* Buttons & messages */
.button { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: var(--radius);
    padding: 11px 20px; font: inherit; font-weight: 600; cursor: pointer; }
.button:hover { background: #082f70; text-decoration: none; }
.button-small { padding: 6px 12px; font-size: 13px; }
.header-cta { margin-left: auto; white-space: nowrap; }
.message { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid var(--border);
    background: var(--surface); }
.message-success { border-color: #b7dcc8; background: #e9f4ee; color: var(--ok); }
.message-warning { border-color: #ecd9a6; background: #faf1dd; color: var(--warn); }

/* Forms */
.form { max-width: 760px; }
.form fieldset { border: 0; padding: 0; margin: 0 0 24px; }
.form legend { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-muted); margin-bottom: 10px; }
.form .optional { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text-faint); }
.form-grid { display: grid; gap: 14px; }
.form-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; min-width: 0; }
.form-grid .field { margin-bottom: 0; }
.form-grid + .field { margin-top: 14px; }
.field label { font-size: 13px; color: var(--text-muted); }
.field .req { color: var(--warn); }
.field input[type=text], .field input[type=number], .field select, .field textarea {
    width: 100%; font: inherit; font-size: 16px; padding: 9px 10px; border: 1px solid var(--border-strong);
    border-radius: var(--radius); background: var(--surface); color: var(--text); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.field input::placeholder, .field textarea::placeholder { color: #c4c4bf; }
.field input[type=file] { font-size: 14px; padding: 10px; border: 1px dashed var(--border-strong);
    border-radius: var(--radius); background: var(--surface-alt); width: 100%; }
.field input[type=file]::file-selector-button { font: inherit; font-weight: 500; padding: 6px 12px; margin-right: 10px;
    border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.field-help, .form-hint { font-size: 12px; color: var(--text-faint); }
.form-hint { margin: 8px 0 0; }
.has-error input, .has-error select { border-color: #c0392b; }
.field-error, .form-error { font-size: 13px; color: #c0392b; }
.form-error { margin-bottom: 16px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 720px) {
    .form-grid.cols-5 { grid-template-columns: repeat(2, 1fr); }
    .form-grid.cols-2 { grid-template-columns: 1fr; }
    .site-nav { gap: 14px; }
    .site-header-inner { gap: 16px; }
}
