:root {
    --bg: #f3efe7;
    --surface: #fffaf2;
    --surface-strong: #fff;
    --text: #231b13;
    --muted: #6a5745;
    --line: #dcccb8;
    --accent: #b24f2a;
    --accent-strong: #8d3413;
    --accent-soft: #f3d8c8;
    --success: #1f7a52;
    --shadow: 0 18px 50px rgba(72, 43, 21, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(178, 79, 42, 0.12), transparent 28%),
        linear-gradient(180deg, #f8f3ea 0%, #efe6d9 100%);
}

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 32px auto 48px;
}

.hero {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
    padding: 28px;
    border: 1px solid rgba(106, 87, 69, 0.15);
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(255, 250, 242, 0.95), rgba(247, 235, 220, 0.95));
    box-shadow: var(--shadow);
}

.eyebrow {
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 12px;
    color: var(--accent);
}

h1,
h2 {
    margin: 0;
}

h1 {
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1;
}

.hero-copy,
.panel-head p,
.field span,
.option-grid label span,
.summary span,
.log-box,
td,
th,
button,
input,
textarea {
    font-family: "Trebuchet MS", Verdana, sans-serif;
}

.hero-copy {
    margin: 14px 0 0;
    max-width: 60ch;
    font-size: 16px;
    line-height: 1.6;
    color: var(--muted);
}

.hero-card {
    display: grid;
    gap: 14px;
    align-content: center;
}

.stat {
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(178, 79, 42, 0.16);
}

.stat-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.panel {
    margin-top: 24px;
    padding: 24px;
    border-radius: 24px;
    border: 1px solid rgba(106, 87, 69, 0.14);
    background: rgba(255, 250, 242, 0.94);
    box-shadow: var(--shadow);
}

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

.panel-head p {
    margin: 0;
    color: var(--muted);
}

.grid {
    display: grid;
    gap: 18px;
}

.notice {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(178, 79, 42, 0.22);
    background: rgba(243, 216, 200, 0.5);
    color: var(--text);
    line-height: 1.6;
    font-family: "Trebuchet MS", Verdana, sans-serif;
}

.notice code {
    font-family: Consolas, Monaco, monospace;
}

.field {
    display: grid;
    gap: 8px;
}

.field > span {
    font-weight: 700;
}

textarea,
input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 16px;
    background: var(--surface-strong);
    color: var(--text);
    font-size: 15px;
}

textarea {
    resize: vertical;
    min-height: 220px;
}

.options {
    padding: 18px;
    border-radius: 18px;
    background: rgba(243, 216, 200, 0.35);
    border: 1px solid rgba(178, 79, 42, 0.16);
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 8px;
}

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

button {
    border: 0;
    border-radius: 999px;
    padding: 13px 22px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

button:hover {
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

#start-btn,
#export-btn {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.ghost {
    color: var(--text);
    background: transparent;
    border: 1px solid var(--line);
}

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

.summary div {
    padding: 16px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.summary span {
    display: block;
    font-size: 13px;
    color: var(--muted);
}

.summary strong {
    display: block;
    margin-top: 6px;
    font-size: 28px;
}

.log-box {
    min-height: 200px;
    margin: 0;
    padding: 16px;
    overflow: auto;
    border-radius: 18px;
    background: #261b14;
    color: #f2e8db;
    line-height: 1.6;
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid #eadfcf;
    text-align: left;
    font-size: 14px;
}

thead th {
    position: sticky;
    top: 0;
    background: #fff6ec;
}

.empty-row td {
    text-align: center;
    color: var(--muted);
}

.is-valid {
    color: var(--success);
    font-weight: 700;
}

.is-invalid {
    color: var(--accent-strong);
    font-weight: 700;
}

@media (max-width: 900px) {
    .hero,
    .option-grid,
    .summary {
        grid-template-columns: 1fr;
    }

    .panel-head {
        align-items: start;
        flex-direction: column;
    }
}
