:root {
    --radio-accent: #0076d3;
    --radio-accent-dark: #00579c;
    --text: #2b2b2b;
    --muted: #6b7280;
    --line: #e5e7eb;
    --soft: #f6f8fb;
    --danger: #b42318;
    --success: #067647;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text);
    background: #fff;
}

.site-header {
    background: var(--radio-accent);
    color: #fff;
}

.header-inner {
    width: min(1120px, calc(100% - 32px));
    min-height: 94px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
}

.logo {
    width: 142px;
    height: auto;
    display: block;
}

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

h1 {
    margin-bottom: 0;
    font-size: clamp(1.35rem, 2.4vw, 2.2rem);
    font-weight: 800;
}

h2 {
    margin-bottom: 12px;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    line-height: 1.08;
}

.overline {
    margin-bottom: 6px;
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    color: inherit;
    opacity: .78;
    letter-spacing: 0;
}

.admin-link {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,.42);
    border-radius: 6px;
    padding: 10px 12px;
    white-space: nowrap;
}

.page {
    width: min(1120px, calc(100% - 32px));
    margin: 32px auto 56px;
}

.access-panel {
    min-height: 420px;
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 48px;
    align-items: center;
    border-top: 6px solid var(--radio-accent);
    padding-top: 42px;
}

.access-form, .bid-form {
    display: grid;
    gap: 14px;
}

label {
    display: block;
    font-weight: 800;
    font-size: .92rem;
}

input {
    width: 100%;
    min-height: 46px;
    border: 1px solid #cfd6df;
    border-radius: 6px;
    padding: 10px 12px;
    font: inherit;
}

input:focus {
    outline: 3px solid rgba(0, 118, 211, .18);
    border-color: var(--radio-accent);
}

button {
    min-height: 46px;
    border: 0;
    border-radius: 6px;
    padding: 11px 16px;
    font: inherit;
    font-weight: 800;
    color: #fff;
    background: var(--radio-accent);
    cursor: pointer;
}

button:hover {
    background: var(--radio-accent-dark);
}

button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.secondary {
    color: var(--radio-accent);
    background: #eef6fd;
}

.danger {
    min-height: 36px;
    padding: 8px 10px;
    background: var(--danger);
}

.muted, .small-note {
    color: var(--muted);
}

.auction-layout {
    display: grid;
    grid-template-columns: minmax(280px, 430px) 1fr;
    gap: 34px;
    align-items: start;
}

.gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.gallery img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 6px;
    background: var(--soft);
}

.gallery img:first-child {
    grid-column: 1 / -1;
    aspect-ratio: 4 / 3;
}

.auction-main {
    border-top: 6px solid var(--radio-accent);
    padding-top: 24px;
}

.description {
    max-width: 58ch;
    color: #454b55;
    line-height: 1.55;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 12px;
    margin: 26px 0;
}

.stat {
    min-height: 106px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: var(--soft);
}

.stat span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: .86rem;
    font-weight: 800;
}

.stat strong {
    display: block;
    font-size: clamp(1.25rem, 2vw, 2rem);
    line-height: 1.05;
}

.stat.strong {
    color: #fff;
    background: var(--radio-accent);
    border-color: var(--radio-accent);
}

.stat.strong span {
    color: rgba(255,255,255,.76);
}

.ended-banner, .success, .form-error, .form-message {
    border-radius: 6px;
    padding: 12px 14px;
}

.ended-banner {
    margin: 0 0 18px;
    color: #fff;
    background: var(--text);
}

.bid-form {
    grid-template-columns: 1fr 1fr 1fr auto;
    align-items: end;
    margin-top: 8px;
}

.form-message {
    grid-column: 1 / -1;
    min-height: 44px;
    margin: 0;
    padding: 10px 0;
}

.form-message.error, .form-error {
    color: var(--danger);
    background: #fff3f1;
}

.form-message.success, .success {
    color: var(--success);
    background: #ecfdf3;
}

.small-note {
    margin-top: 14px;
    font-size: .9rem;
}

.admin-shell {
    border-top: 6px solid var(--radio-accent);
    padding-top: 24px;
}

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

th {
    font-size: .84rem;
    text-transform: uppercase;
    color: var(--muted);
}

tr:last-child td {
    border-bottom: 0;
}

.inline-form {
    margin: 0;
}

@media (max-width: 860px) {
    .header-inner {
        min-height: 82px;
        grid-template-columns: 1fr auto;
    }

    .logo {
        width: 116px;
    }

    .header-inner > div {
        grid-column: 1 / -1;
    }

    .admin-link {
        grid-row: 1;
        grid-column: 2;
        align-self: start;
    }

    .access-panel, .auction-layout {
        grid-template-columns: 1fr;
    }

    .stats-grid, .bid-form {
        grid-template-columns: 1fr;
    }

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

    .gallery img, .gallery img:first-child {
        grid-column: auto;
        aspect-ratio: 1 / 1;
    }
}

@media (max-width: 520px) {
    .page, .header-inner {
        width: min(100% - 20px, 1120px);
    }

    .header-inner {
        gap: 12px;
    }

    .admin-link {
        padding: 9px 10px;
        font-size: .86rem;
    }

    .gallery {
        grid-template-columns: 1fr;
    }

    .gallery img, .gallery img:first-child {
        aspect-ratio: 4 / 3;
    }

    .admin-toolbar {
        display: grid;
        grid-template-columns: 1fr;
    }

    .admin-toolbar h2 {
        font-size: 1.45rem;
        line-height: 1.16;
    }

    .table-wrap {
        overflow: visible;
        border: 0;
    }

    table, thead, tbody, tr, td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    thead {
        display: none;
    }

    tr {
        border: 1px solid var(--line);
        border-radius: 8px;
        margin-bottom: 12px;
        overflow: hidden;
    }

    td {
        display: grid;
        grid-template-columns: 120px 1fr;
        gap: 12px;
        align-items: center;
        border-bottom: 1px solid var(--line);
    }

    td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: .78rem;
        font-weight: 800;
        text-transform: uppercase;
    }

    td:last-child {
        border-bottom: 0;
    }

    .danger {
        width: 100%;
    }
}
