:root {
    --bg: #f6f7f4;
    --surface: #ffffff;
    --ink: #1e2528;
    --muted: #657075;
    --line: #d9dfdc;
    --accent: #176b5b;
    --accent-dark: #0f4e43;
    --warn: #9c3f2f;
    --good: #1f7a46;
    --shadow: 0 10px 28px rgba(22, 34, 38, .08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--ink);
}

a {
    color: var(--accent-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px clamp(16px, 4vw, 48px);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    font-weight: 700;
    color: var(--ink);
}

nav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.wrap {
    width: min(1180px, calc(100% - 32px));
    margin: 30px auto 70px;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin-bottom: 22px;
}

h1, h2 {
    margin: 0 0 10px;
}

h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
}

h2 {
    font-size: 1.3rem;
}

p {
    line-height: 1.55;
}

.muted {
    color: var(--muted);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.item-card, .panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.item-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.item-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.item-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    background: #e8ece9;
}

.item-image.large {
    border-radius: 8px;
    min-height: 320px;
}

.placeholder {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-weight: 700;
}

.stats, .big-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0;
}

dt {
    color: var(--muted);
    font-size: .82rem;
}

dd {
    margin: 3px 0 0;
    font-weight: 700;
}

.big-stats {
    margin: 20px 0;
}

.big-stats dd {
    font-size: 1.4rem;
}

.button, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.button:hover {
    background: var(--accent-dark);
    text-decoration: none;
}

.button.secondary {
    background: #e7efec;
    color: var(--accent-dark);
}

.disabled-action {
    width: 100%;
    background: #9b6b64;
    color: #fff;
    cursor: not-allowed;
    opacity: .82;
}

.disabled-action.winning {
    background: #24824f;
}

.small {
    min-height: 34px;
    padding: 0 12px;
}

.link-button {
    min-height: 0;
    padding: 0;
    background: transparent;
    color: var(--accent-dark);
}

.inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.panel {
    padding: 22px;
    margin-bottom: 22px;
}

.auth {
    width: min(460px, 100%);
    margin: 60px auto;
}

.stack {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-weight: 700;
    font-size: .9rem;
}

input, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 11px 12px;
    font: inherit;
    color: var(--ink);
    background: #fff;
}

textarea {
    resize: vertical;
}

.detail {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
    gap: 24px;
    align-items: start;
}

.bid-form {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.wide {
    grid-column: 1 / -1;
}

.check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.check input {
    width: auto;
}

.compact {
    color: var(--ink);
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

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

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

th, td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: .85rem;
}

.notice, .alert {
    padding: 13px 15px;
    border-radius: 6px;
    margin-bottom: 18px;
}

.notice {
    background: #e7f3ed;
    color: #145235;
}

.alert {
    background: #f8e8e4;
    color: var(--warn);
}

.bid-status {
    border-radius: 6px;
    color: #fff;
    font-weight: 800;
    margin: 18px 0;
    padding: 14px 16px;
    text-align: center;
}

.bid-status.winning {
    background: #24824f;
}

.bid-status.outbid {
    background: #9f5a54;
}

.error-box {
    white-space: pre-wrap;
    background: #2a1e1e;
    color: #fff;
    padding: 14px;
    border-radius: 6px;
    overflow-x: auto;
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 0 10px;
    background: #eceeed;
    color: var(--muted);
    font-size: .84rem;
    font-weight: 700;
}

.pill.good {
    background: #e3f2e8;
    color: var(--good);
}

.countdown.closed {
    color: var(--warn);
}

.empty {
    background: var(--surface);
    border: 1px dashed var(--line);
    border-radius: 8px;
    padding: 32px;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 760px) {
    .topbar, .page-head {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .item-image.large {
        min-height: 220px;
    }

    h1 {
        font-size: 2rem;
    }
}
