:root {
    color-scheme: light;
    --bg: #f3f6fb;
    --panel: #ffffff;
    --ink: #152238;
    --muted: #64748b;
    --line: #d8e0ec;
    --brand: #155eef;
    --brand-dark: #0f3f9f;
    --ok: #12805c;
    --warn: #b76e00;
    --bad: #b42318;
    --shadow: 0 18px 45px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
html, body { width: 100%; min-width: 320px; overflow-x: hidden; }
body {
    margin: 0;
    font-family: Inter, Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(21, 94, 239, .08), transparent 34rem),
        var(--bg);
    color: var(--ink);
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.nav, .wrap, .footer, .carousel, .carousel-slide, .hero-main, .panel, .card, .split > section {
    min-width: 0;
    max-width: 100%;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}
.nav {
    width: min(1200px, calc(100% - 40px));
    min-height: 72px;
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand {
    min-width: max-content;
    display: inline-flex;
    align-items: center;
    color: var(--ink);
    font-size: 21px;
    font-weight: 800;
}
.site-logo { max-height: 46px; max-width: 210px; object-fit: contain; display: block; }
.nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}
.nav-links a {
    padding: 9px 10px;
    border-radius: 7px;
    color: #334155;
    font-weight: 700;
}
.nav-links a:hover {
    background: #eef4ff;
    text-decoration: none;
    color: var(--brand-dark);
}

.wrap {
    width: min(1200px, calc(100% - 40px));
    margin-inline: auto;
    padding: 32px 0 56px;
    display: block;
}
.wrap > h1:first-child { margin-top: 0; }

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
    gap: 24px;
    align-items: stretch;
    margin: 28px 0;
}
.hero-main, .panel, .card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
}
.hero-main, .panel { padding: 26px; }
.panel { overflow-x: auto; }
.card { padding: 22px; }
.hero h1 {
    max-width: 780px;
    margin: 0 0 14px;
    font-size: clamp(32px, 4vw, 54px);
    line-height: 1.02;
    letter-spacing: 0;
}
.hero p {
    max-width: 760px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.62;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card h3, .panel h2, .panel h3 { margin-top: 0; }
.card p, .panel p { line-height: 1.58; }
.price { font-size: 30px; font-weight: 900; margin: 12px 0; color: var(--ink); }
.muted { color: var(--muted); }
.content { line-height: 1.7; }

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    background: #e8f1ff;
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 800;
}
.badge.warn { background: #fff3d7; color: var(--warn); }
.badge.ok { background: #dcfce7; color: var(--ok); }
.badge.bad { background: #fee4e2; color: var(--bad); }

.btn, button {
    min-height: 40px;
    border: 0;
    border-radius: 8px;
    padding: 10px 16px;
    background: var(--brand);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; background: var(--brand-dark); }
.btn.secondary, button.secondary { background: #edf2f8; color: var(--ink); }
.btn.danger, button.danger { background: var(--bad); color: #fff; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 800; color: #334155; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    font: inherit;
    background: #fff;
    color: var(--ink);
}
input:focus, select:focus, textarea:focus {
    outline: 3px solid rgba(21, 94, 239, .15);
    border-color: var(--brand);
}
textarea { min-height: 116px; resize: vertical; }
input[type="color"] { min-height: 44px; padding: 4px; }
.check {
    display: inline-flex;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px;
    font-weight: 800;
}
.check input { width: auto; }

.notice {
    padding: 13px 15px;
    border: 1px solid #b6d4fe;
    background: #eef6ff;
    border-radius: 9px;
    margin-bottom: 18px;
    line-height: 1.5;
}
.error { border-color: #f1aeb5; background: #fff0f0; color: var(--bad); }

.carousel {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 28px;
    overflow: hidden;
}
.carousel-slide {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-height: 430px;
    aspect-ratio: 1600 / 520;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a, #1d4ed8);
    box-shadow: 0 24px 60px rgba(15, 23, 42, .18);
    display: flex;
    align-items: stretch;
}
.carousel-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}
.carousel-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(8, 17, 34, .86), rgba(8, 17, 34, .46), rgba(8, 17, 34, .12));
}
.carousel-content {
    position: relative;
    z-index: 2;
    width: min(760px, 100%);
    padding: clamp(28px, 5vw, 56px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
}
.carousel-content h2 {
    margin: 0 0 12px;
    font-size: clamp(30px, 4vw, 54px);
    line-height: 1.04;
}
.carousel-content p {
    margin: 0;
    max-width: 680px;
    color: rgba(255, 255, 255, .88);
    font-size: 17px;
    line-height: 1.62;
}
.carousel-actions { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; }
.carousel-actions .btn {
    background: #fff;
    color: var(--brand-dark);
}
.carousel-actions .btn:hover {
    background: #eaf1ff;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--panel);
}
th, td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}
th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.mini { font-size: 13px; }
.thumb { width: 110px; height: 62px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); }
.preview { max-width: 260px; max-height: 150px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

.split {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}
.side {
    position: sticky;
    top: 92px;
    display: grid;
    gap: 4px;
    max-height: calc(100vh - 112px);
    overflow: auto;
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 10px;
    padding: 10px;
    box-shadow: var(--shadow);
}
.side a {
    padding: 10px 12px;
    border-radius: 8px;
    color: #334155;
    font-weight: 800;
}
.side a:hover { background: #eef4ff; text-decoration: none; }
.side a.active { background: var(--brand); color: #fff; }
main.wrap > .split > section > h1:first-child { margin-top: 0; }

.footer {
    width: min(1200px, calc(100% - 40px));
    margin: 12px auto 0;
    padding: 24px 0 42px;
    color: var(--muted);
    font-size: 14px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.35fr repeat(3, minmax(0, 1fr));
    gap: 28px;
    border-top: 1px solid var(--line);
    padding-top: 28px;
}
.footer strong { color: var(--ink); display: block; margin: 12px 0 10px; }
.footer a { display: block; margin-top: 9px; color: var(--muted); }
.footer-brand { margin-bottom: 12px; }

@media (max-width: 1180px) {
    .nav, .wrap, .footer { width: min(100% - 32px, 980px); }
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .split { grid-template-columns: 230px minmax(0, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .nav {
        min-height: auto;
        padding: 14px 0;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    .brand { justify-content: center; }
    .nav-links { justify-content: center; }
    .hero, .grid, .grid.two, .split { grid-template-columns: 1fr; }
    .side {
        position: static;
        max-height: none;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
    .carousel-slide { min-height: 360px; aspect-ratio: 16 / 9; }
    .panel, .hero-main, .card { padding: 20px; }
    table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (max-width: 560px) {
    .nav, .wrap, .footer { width: calc(100% - 20px); }
    .nav-links { width: 100%; gap: 6px; }
    .nav-links a { padding: 7px 6px; font-size: 14px; }
    .hero h1 { font-size: 28px; }
    .hero p, .carousel-content p { font-size: 15px; }
    .carousel-slide { min-height: 320px; aspect-ratio: 4 / 3; }
    .carousel-content { padding: 22px; }
    .carousel-actions .btn, .actions .btn, .actions button { width: 100%; }
    .footer-grid { grid-template-columns: 1fr; }
}
