:root {
    --bg: #f8f2e7;
    --panel: rgba(255, 251, 245, 0.9);
    --ink: #1e1a17;
    --muted: #6b6258;
    --accent: #b85c38;
    --accent-2: #2f6f5e;
    --warning: #b63d2f;
    --line: rgba(30, 26, 23, 0.12);
    --shadow: 0 18px 40px rgba(68, 38, 20, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.4;
    background:
        radial-gradient(circle at top left, rgba(184, 92, 56, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(47, 111, 94, 0.16), transparent 26%),
        linear-gradient(180deg, #fff8ef 0%, var(--bg) 100%);
}

button,
input {
    font: inherit;
}

.page-shell {
    max-width: 1380px;
    margin: 0 auto;
    padding: 14px;
}

.top-menu {
    position: sticky;
    top: 8px;
    z-index: 30;
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    gap: 10px;
    align-items: center;
    background: rgba(255, 251, 245, 0.95);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 10px;
    margin-bottom: 14px;
}

.menu-brand {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--accent);
    white-space: nowrap;
}

.menu-links {
    display: flex;
    gap: 8px;
}

.menu-links a {
    text-decoration: none;
    color: var(--ink);
    font-size: 0.82rem;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid transparent;
}

.menu-links a:hover {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.8);
}

.mission-menu {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.mission-chip {
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.74rem;
    background: rgba(47, 111, 94, 0.1);
    color: var(--accent-2);
    border: 1px solid rgba(47, 111, 94, 0.2);
}

.mission-chip.active {
    background: var(--accent-2);
    color: #fff;
    border-color: var(--accent-2);
}

.mission-chip.solved {
    border-color: rgba(47, 111, 94, 0.45);
}

.menu-actions {
    display: flex;
    gap: 8px;
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 248, 239, 0.92), rgba(255, 255, 255, 0.86));
    box-shadow: var(--shadow);
    margin-bottom: 14px;
}

.eyebrow {
    margin: 0 0 8px;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    color: var(--accent);
}

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

h1 {
    font-size: clamp(1.5rem, 2.6vw, 2.25rem);
    line-height: 1.05;
    margin-bottom: 8px;
}

.hero-copy {
    max-width: 65ch;
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

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

.layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 12px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 14px;
}

.mission-panel,
.history-panel {
    grid-column: 1 / 2;
}

.control-panel,
.cart-panel,
.catalog-panel {
    grid-column: 2 / 3;
}

.catalog-panel {
    order: 1;
}

.cart-panel {
    order: 2;
}

.history-panel {
    order: 3;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.stat-card,
.product-card,
.history-card,
.mission,
.note-box {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
}

.stat-card {
    padding: 11px;
}

.stat-card span {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.stat-card strong {
    font-size: 1.2rem;
}

.toolbar,
.coupon-row,
.checkout-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.toolbar {
    margin-bottom: 12px;
}

.note-box {
    padding: 12px;
    font-size: 0.88rem;
}

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

.product-card {
    padding: 12px;
}

.tag {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(47, 111, 94, 0.12);
    color: var(--accent-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
}

.price {
    font-size: 1.08rem;
    margin: 5px 0;
}

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

.cart-items {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.cart-line {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
}

.cart-line span {
    display: block;
    color: var(--muted);
    margin-top: 4px;
}

.cart-line input {
    width: 96px;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: white;
}

.coupon-row {
    margin: 10px 0;
}

.coupon-row input {
    flex: 1;
    min-width: 220px;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: white;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px solid var(--line);
}

.summary-row.total {
    font-size: 1rem;
    border-bottom: 0;
}

.checkout-actions {
    margin-top: 10px;
}

button,
.link-button {
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: white;
    padding: 8px 12px;
    font-size: 0.84rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform 140ms ease, opacity 140ms ease, background 140ms ease;
}

button:hover,
.link-button:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}

button.ghost,
.link-button.ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
}

.status-message {
    min-height: 24px;
    color: var(--warning);
    margin-top: 9px;
    font-size: 0.86rem;
}

.mission {
    padding: 0;
    margin-bottom: 8px;
    overflow: hidden;
}

.mission.solved {
    border-color: rgba(47, 111, 94, 0.38);
    background: rgba(47, 111, 94, 0.09);
}

.mission-head,
.history-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.mission-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    border: 0;
    padding: 10px 12px;
    cursor: pointer;
}

.mission-toggle:hover {
    background: rgba(255, 255, 255, 0.65);
    transform: none;
}

.mission-toggle h3 {
    margin: 0;
    font-size: 0.95rem;
}

.mission-body {
    padding: 0 12px 10px;
    border-top: 1px solid var(--line);
}

.mission.collapsed .mission-body {
    display: none;
}

.mission-head span,
.history-head span {
    color: var(--muted);
    font-size: 0.88rem;
}

details {
    margin-top: 10px;
}

summary {
    cursor: pointer;
    color: var(--accent-2);
}

.history-card {
    padding: 10px;
    margin-bottom: 8px;
}

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

@media (max-width: 980px) {
    .top-menu {
        grid-template-columns: 1fr;
    }

    .menu-actions {
        justify-content: flex-start;
    }

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

    .mission-panel,
    .history-panel,
    .control-panel,
    .cart-panel,
    .catalog-panel {
        grid-column: auto;
    }

    .hero {
        flex-direction: column;
    }
}
