:root {
    --bg: #f6f5f2;
    --surface: #ffffff;
    --text: #1f2421;
    --muted: #6b7168;
    --border: #e3e0d8;
    --accent: #3a6b4f;
    --warning-bg: #fff4dd;
    --warning-border: #e8c468;
    --warning-text: #6b4e00;
    --danger-bg: #fde8e6;
    --danger-border: #e8a29b;
    --danger-text: #7a2018;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14161a;
        --surface: #1e2126;
        --text: #ecebe8;
        --muted: #9aa09a;
        --border: #2c3038;
        --accent: #6fbf8f;
        --warning-bg: #3a2f0f;
        --warning-border: #7a5f1c;
        --warning-text: #f2cf6e;
        --danger-bg: #3a1512;
        --danger-border: #7a3229;
        --danger-text: #f2a89e;
    }
}

* {
    box-sizing: border-box;
}

a {
    color: var(--accent);
}

body {
    margin: 0;
    padding: 24px 16px 48px;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 1.05rem;
    line-height: 1.55;
    letter-spacing: 0.01em;
}

main {
    max-width: 640px;
    margin: 0 auto;
}

h1 {
    font-size: 1.6rem;
    margin: 0 0 16px;
}

h2 {
    font-size: 1.05rem;
    margin: 0 0 10px;
    color: var(--muted);
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.alert-warning {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning-text);
}

.alert-danger {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--danger-text);
}

.cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 16px 0 24px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card .label {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 600;
}

.card .value {
    font-size: 1.6rem;
    font-weight: 600;
}

.card .value-text {
    font-size: 1.25rem;
}

.card .sub {
    font-size: 0.8rem;
    color: var(--muted);
}

section {
    margin-bottom: 24px;
}

.defrosting-list,
.events {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.defrosting-list li,
.events li {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.defrosting-list li:last-child,
.events li:last-child {
    border-bottom: none;
}

.events li {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.event-time {
    font-size: 0.75rem;
    color: var(--muted);
}

.shop-hours {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.shop-hours li {
    display: flex;
    justify-content: space-between;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}

.shop-hours li:last-child {
    border-bottom: none;
}

.shop-hours li.today {
    background: var(--warning-bg);
    font-weight: 600;
}

.shop-hours .shop-time.closed {
    color: var(--danger-text);
    font-weight: 600;
}

.shop-status {
    color: var(--muted);
    font-size: 0.92rem;
    margin: 0 0 4px;
}

.button-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    align-items: stretch;
}

.button-row form {
    display: flex;
    flex-direction: column;
}

button {
    width: 100%;
    flex: 1;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--accent);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

button:disabled {
    background: var(--muted);
    cursor: not-allowed;
    opacity: 0.6;
}

.buy-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
}

.buy-form label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--muted);
}

.buy-form input[type="number"] {
    width: 64px;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
}

.buy-form button {
    min-height: 0;
}
