:root {
    --bg: #f3f4f6;
    --surface: #ffffff;
    --surface-alt: #f8f9fb;
    --text: #111827;
    --muted: #5b6472;
    --line: #d9dee7;
    --line-strong: #c6ceda;
    --accent: #1f4fd6;
    --accent-soft: #edf3ff;
    --success: #136b44;
    --danger: #b42318;
    --radius: 3px;
    --wrap: 1160px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Noto Sans", "Noto Sans Display", "Noto Serif", "Segoe UI", sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #f7f8fa 0%, #eef1f5 100%);
    line-height: 1.55;
}

a {
    color: inherit;
    text-decoration: none;
}

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

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2rem, 6vw, 3.7rem);
    line-height: 1.04;
    margin-bottom: 16px;
}

h2 {
    font-size: clamp(1.45rem, 4vw, 2.35rem);
    line-height: 1.1;
    margin-bottom: 10px;
}

h3 {
    font-size: 1.04rem;
    line-height: 1.25;
    margin-bottom: 8px;
}

.shell {
    width: min(calc(100% - 28px), var(--wrap));
    margin: 0 auto;
    padding: 18px 0 44px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.topbar-extended,
.brand-wrap {
    flex-wrap: wrap;
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 14px 18px;
}

.brand {
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-link {
    display: inline-flex;
    gap: 0;
}

.brand-primary {
    color: var(--text);
}

.brand-secondary {
    color: var(--accent);
}

.title-dot {
    color: var(--accent);
}

.hero-price-highlight {
    color: var(--accent);
}

.topnav {
    display: none;
    gap: 18px;
}

.lang-switch {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.lang-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.88);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.lang-link:hover,
.lang-link.is-active {
    color: var(--text);
    border-color: var(--line-strong);
    background: var(--surface);
}

.topnav a,
.ghost-link,
.text-link {
    color: var(--muted);
}

.topnav a:hover,
.ghost-link:hover,
.text-link:hover {
    color: var(--text);
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.hero {
    display: grid;
    gap: 12px;
}

.hero-main,
.hero-side,
.compact-card,
.pricing-card,
.category-card,
.addon-card,
.process-card,
.form-intro,
.form-card,
.access-denied,
.site-card,
.table-panel,
.admin-form-panel,
.admin-table-panel,
.admin-login-card {
    padding: 20px;
}

.hero-main {
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.75rem;
    font-weight: 700;
}

.lead,
.section-copy,
.side-note,
.compact-card p,
.pricing-text,
.category-card p,
.addon-card p,
.process-card p,
.site-domain,
.site-category,
.form-status,
.admin-subtitle {
    color: var(--muted);
}

.lead {
    font-size: 1.02rem;
    max-width: 64ch;
    margin-bottom: 20px;
}

.hero-actions,
.admin-form-actions,
.admin-row-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hero-actions {
    margin-bottom: 18px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 16px;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: var(--accent);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease;
}

.button:hover {
    background: #173eaa;
    border-color: #173eaa;
}

.button-muted {
    background: var(--surface);
    color: var(--accent);
}

.button-muted:hover {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--line-strong);
}

.link-button {
    border: 0;
    background: transparent;
    color: var(--danger);
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.metric-row {
    display: grid;
    gap: 10px;
    margin-top: 8px;
}

.metric-card {
    padding: 14px 15px;
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.metric-card strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 4px;
}

.metric-card span {
    color: var(--muted);
    font-size: 0.92rem;
}

.side-label {
    margin: 0 0 14px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.price-stack {
    display: grid;
    gap: 12px;
}

.price-line {
    display: grid;
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.price-line:first-child {
    padding-top: 0;
    border-top: 0;
}

.price-line strong {
    display: block;
    margin-bottom: 4px;
}

.price-line span {
    display: block;
    color: var(--muted);
    font-size: 0.92rem;
}

.price-tag {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 10px;
    background: var(--accent-soft);
    border: 1px solid #d7e4ff;
    border-radius: var(--radius);
}

.price-tag b {
    font-size: 1.05rem;
}

.price-tag small {
    color: var(--muted);
}

.section {
    margin-top: 16px;
}

.section-head {
    margin-bottom: 14px;
}

.section-head-split {
    display: grid;
    gap: 12px;
}

.grid {
    display: grid;
    gap: 12px;
}

.compact-grid,
.pricing-grid,
.category-grid,
.addon-grid,
.process-grid {
    align-items: stretch;
}

.compact-card p,
.pricing-card p,
.category-card p,
.addon-card p,
.process-card p {
    margin-bottom: 0;
}

.pricing-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pricing-range {
    margin-bottom: 0;
    font-weight: 700;
}

.pricing-value {
    font-size: clamp(2rem, 7vw, 3rem);
    line-height: 1;
    font-weight: 800;
}

.pricing-label {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.category-card {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 14px;
    align-items: start;
}

.count,
.process-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface-alt);
    font-weight: 800;
}

.addon-card strong {
    display: inline-block;
    margin-top: 10px;
    font-size: 1.1rem;
}

.process-card {
    display: grid;
    gap: 12px;
}

.split-section,
.admin-layout {
    display: grid;
    gap: 12px;
}

.lead-form {
    display: grid;
    gap: 12px;
}

.lead-form label {
    display: grid;
    gap: 6px;
}

.lead-form span {
    font-size: 0.93rem;
    font-weight: 700;
}

.lead-form input,
.lead-form select,
.lead-form textarea {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: #ffffff;
    color: var(--text);
    font: inherit;
    appearance: none;
}

.lead-form select[multiple] {
    min-height: 160px;
    padding: 8px 10px;
    appearance: auto;
}

.lead-form input:focus,
.lead-form select:focus,
.lead-form textarea:focus {
    outline: 0;
    border-color: #8cadff;
    box-shadow: 0 0 0 3px rgba(31, 79, 214, 0.08);
}

.form-status {
    min-height: 22px;
    margin-bottom: 0;
}

.form-status.is-success {
    color: var(--success);
}

.form-status.is-error,
.admin-error {
    color: var(--danger);
}

.puzzle-box {
    padding: 12px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface-alt);
}

.puzzle-title {
    margin: 0 0 6px;
    font-weight: 700;
}

.puzzle-order {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 0.92rem;
}

.puzzle-slider-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.puzzle-slider-rail {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 40px;
    overflow: hidden;
}

.puzzle-target-row {
    position: relative;
    height: 22px;
    margin: 0 0 4px;
    border-bottom: 1px dashed var(--line-strong);
}

.puzzle-target-label {
    position: absolute;
    top: -2px;
    transform: translateX(-50%);
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.puzzle-target-label b {
    margin-left: 4px;
    font-weight: 800;
}

.puzzle-target-marker {
    display: none;
}

.puzzle-target-guide {
    position: absolute;
    top: 6px;
    bottom: 6px;
    width: 8px;
    background: var(--accent);
    transform: translateX(-50%);
    opacity: 0.95;
    border-radius: 99px;
    box-shadow: 0 0 0 1px #ffffff, 0 0 0 3px rgba(31, 79, 214, 0.22);
    z-index: 3;
    pointer-events: none;
}

.puzzle-target-zone {
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 0;
    width: 0;
    border-radius: 999px;
    background: rgba(31, 79, 214, 0.25);
    border: 1px solid rgba(31, 79, 214, 0.45);
    z-index: 1;
    pointer-events: none;
}

.puzzle-target-pos-10 { left: 10%; }
.puzzle-target-pos-15 { left: 15%; }
.puzzle-target-pos-20 { left: 20%; }
.puzzle-target-pos-25 { left: 25%; }
.puzzle-target-pos-30 { left: 30%; }
.puzzle-target-pos-35 { left: 35%; }
.puzzle-target-pos-40 { left: 40%; }
.puzzle-target-pos-45 { left: 45%; }
.puzzle-target-pos-50 { left: 50%; }
.puzzle-target-pos-55 { left: 55%; }
.puzzle-target-pos-60 { left: 60%; }
.puzzle-target-pos-65 { left: 65%; }
.puzzle-target-pos-70 { left: 70%; }
.puzzle-target-pos-75 { left: 75%; }
.puzzle-target-pos-80 { left: 80%; }
.puzzle-target-pos-85 { left: 85%; }
.puzzle-target-pos-90 { left: 90%; }
/* Align target markers with actual range thumb path (18px thumb). */
.puzzle-slider-rail .puzzle-target-pos-10 { left: calc((10 * (100% - 18px) / 100) + 9px); }
.puzzle-slider-rail .puzzle-target-pos-15 { left: calc((15 * (100% - 18px) / 100) + 9px); }
.puzzle-slider-rail .puzzle-target-pos-20 { left: calc((20 * (100% - 18px) / 100) + 9px); }
.puzzle-slider-rail .puzzle-target-pos-25 { left: calc((25 * (100% - 18px) / 100) + 9px); }
.puzzle-slider-rail .puzzle-target-pos-30 { left: calc((30 * (100% - 18px) / 100) + 9px); }
.puzzle-slider-rail .puzzle-target-pos-35 { left: calc((35 * (100% - 18px) / 100) + 9px); }
.puzzle-slider-rail .puzzle-target-pos-40 { left: calc((40 * (100% - 18px) / 100) + 9px); }
.puzzle-slider-rail .puzzle-target-pos-45 { left: calc((45 * (100% - 18px) / 100) + 9px); }
.puzzle-slider-rail .puzzle-target-pos-50 { left: calc((50 * (100% - 18px) / 100) + 9px); }
.puzzle-slider-rail .puzzle-target-pos-55 { left: calc((55 * (100% - 18px) / 100) + 9px); }
.puzzle-slider-rail .puzzle-target-pos-60 { left: calc((60 * (100% - 18px) / 100) + 9px); }
.puzzle-slider-rail .puzzle-target-pos-65 { left: calc((65 * (100% - 18px) / 100) + 9px); }
.puzzle-slider-rail .puzzle-target-pos-70 { left: calc((70 * (100% - 18px) / 100) + 9px); }
.puzzle-slider-rail .puzzle-target-pos-75 { left: calc((75 * (100% - 18px) / 100) + 9px); }
.puzzle-slider-rail .puzzle-target-pos-80 { left: calc((80 * (100% - 18px) / 100) + 9px); }
.puzzle-slider-rail .puzzle-target-pos-85 { left: calc((85 * (100% - 18px) / 100) + 9px); }
.puzzle-slider-rail .puzzle-target-pos-90 { left: calc((90 * (100% - 18px) / 100) + 9px); }

.puzzle-slider {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 40px;
    accent-color: var(--accent);
}

.puzzle-slider::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: #f2f4f8;
}

.puzzle-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    background: var(--accent);
    margin-top: -6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.puzzle-slider::-moz-range-track {
    height: 8px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: #f2f4f8;
}

.puzzle-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    background: var(--accent);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.puzzle-value {
    min-width: 44px;
    font-weight: 700;
    color: var(--accent);
}

.puzzle-state {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.92rem;
}

.puzzle-state.is-success {
    color: var(--success);
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.view-switch {
    display: inline-flex;
    gap: 8px;
}

.admin-locale-switch {
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.switch-button {
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
}

.switch-button.is-active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.catalog-view {
    display: none;
}

.catalog-view.is-active {
    display: block;
}

.catalog-grid {
    align-items: start;
}

.site-card {
    overflow: hidden;
    padding: 0;
}

.site-shot,
.table-shot {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-bottom: 1px solid var(--line);
    background: #edf1f6;
}

.table-shot {
    width: 128px;
    min-width: 128px;
    border: 1px solid var(--line);
}

.placeholder-shot,
.placeholder-table-shot {
    display: grid;
    place-items: center;
    gap: 4px;
    text-align: center;
    background: linear-gradient(180deg, #f8faff 0%, #eef2f8 100%);
    color: var(--muted);
}

.placeholder-shot {
    padding: 26px 18px;
}

.placeholder-table-shot {
    width: 128px;
    min-width: 128px;
    min-height: 80px;
    border: 1px solid var(--line);
}

.site-body {
    padding: 16px 18px 18px;
}

.site-category {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.site-domain {
    font-size: 0.93rem;
}

.table-wrap {
    overflow-x: auto;
}

.admin-json-field {
    min-height: 460px;
    font-family: "SFMono-Regular", "Consolas", monospace;
}

.site-footer {
    margin-top: 22px;
    padding: 20px;
}

.footer-grid {
    display: grid;
    gap: 14px;
}

.site-footer h3 {
    margin-bottom: 10px;
}

.site-footer p:last-child {
    margin-bottom: 0;
}

.site-table {
    width: 100%;
    border-collapse: collapse;
}

.site-table th,
.site-table td {
    padding: 12px;
    border-top: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.site-table thead th {
    border-top: 0;
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.admin-body {
    min-height: 100vh;
}

.admin-login-shell {
    width: min(calc(100% - 28px), 460px);
    margin: 6vh auto 0;
}

.admin-login-card h1 {
    font-size: 2rem;
}

.admin-shell {
    padding-top: 24px;
}

.admin-topbar {
    align-items: end;
}

.admin-subtitle {
    margin-bottom: 0;
}

.admin-flash {
    padding: 14px 16px;
    margin-bottom: 12px;
    color: var(--success);
}

.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.admin-hidden {
    display: none;
}

.admin-table-panel,
.admin-form-panel {
    overflow: hidden;
}

.admin-row-actions form {
    margin: 0;
}

.admin-full {
    grid-column: 1 / -1;
}

@media (min-width: 760px) {
    .shell {
        width: min(calc(100% - 40px), var(--wrap));
        padding-top: 24px;
    }

    .topnav {
        display: flex;
    }

    .topbar-extended {
        align-items: center;
    }

    .hero {
        grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr);
    }

    .hero-actions,
    .admin-form-actions,
    .admin-row-actions {
        flex-direction: row;
        align-items: center;
    }

    .metric-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .price-line {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
    }

    .cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .split-section {
        grid-template-columns: 0.82fr 1.18fr;
    }

    .section-head-split {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
    }

    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-layout {
        grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr);
    }
}
