:root {
    --bg: #f4f0e8;
    --panel: #fffdf8;
    --panel-strong: #f7ead1;
    --text: #221c15;
    --muted: #6d6257;
    --line: #d7c8b2;
    --accent: #9d2f19;
    --accent-dark: #612011;
    --success: #2c6e49;
    --error: #a12d22;
    --shadow: 0 20px 40px rgba(34, 28, 21, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(157, 47, 25, 0.12), transparent 30%),
        linear-gradient(180deg, #f8f3ea 0%, #f1ebdf 100%);
    color: var(--text);
    font-family: Georgia, "Times New Roman", serif;
}

.layout {
    max-width: 1240px;
    margin: 0 auto;
    padding: 32px 20px 48px;
}

.hero {
    padding: 28px;
    border: 1px solid var(--line);
    background: linear-gradient(135deg, rgba(255, 253, 248, 0.98), rgba(247, 234, 209, 0.96));
    box-shadow: var(--shadow);
    border-radius: 22px;
}

.eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--accent);
    font-size: 0.78rem;
}

.hero h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 1;
}

.lead {
    max-width: 760px;
    color: var(--muted);
    font-size: 1.1rem;
}

.grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 22px;
}

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

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

.stack {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

label,
h2,
h3 {
    margin-top: 0;
}

input[type="file"] {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px dashed var(--line);
    background: var(--panel-strong);
}

input[type="text"],
select {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
}

input[type="checkbox"] {
    margin-right: 8px;
}

button {
    width: fit-content;
    padding: 12px 18px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--accent), var(--accent-dark));
    color: #fff;
    cursor: pointer;
    font-weight: 700;
}

.alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 14px;
}

.alert-success {
    background: rgba(44, 110, 73, 0.12);
    color: var(--success);
}

.alert-error {
    background: rgba(161, 45, 34, 0.1);
    color: var(--error);
}

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

.stats div {
    display: flex;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

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

.stats dd {
    margin: 0;
    font-weight: 700;
}

.compact div {
    gap: 12px;
}

.file-groups {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.file-list {
    margin: 0;
    padding-left: 18px;
}

.file-list li {
    margin-bottom: 10px;
}

.file-list span {
    display: block;
    color: var(--muted);
    font-size: 0.92rem;
}

.visit-form {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.visit-actions {
    display: flex;
    align-items: end;
}

.check-row {
    display: flex;
    align-items: center;
}

.visit-result {
    margin-top: 20px;
}

.report {
    max-height: 420px;
    overflow: auto;
    padding: 16px;
    border-radius: 16px;
    background: #1e1915;
    color: #f5eee6;
    white-space: pre-wrap;
    line-height: 1.45;
}

.downloads {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.downloads a {
    color: var(--accent-dark);
    font-weight: 700;
}

.footer {
    padding-top: 18px;
    color: var(--muted);
    text-align: center;
}

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