:root {
    --ink: #2f2927;
    --muted: #756a66;
    --paper: #fffdf9;
    --line: #eadfd7;
    --accent: #6f5046;
    --accent-dark: #533a33;
    --soft: #f6eee8;
    --success: #2f775a;
    --danger: #a43f3f;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: #eee7e0; }
body {
    margin: 0;
    min-height: 100%;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 10% 5%, rgba(255,255,255,.95), transparent 30%),
        linear-gradient(145deg, #f3ede7 0%, #e8ddd4 100%);
}
button, input, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.page-shell { width: min(720px, 100%); margin: 0 auto; padding: 22px 14px 36px; }
.hero-card {
    position: relative;
    overflow: hidden;
    padding: 42px 24px 36px;
    text-align: center;
    color: #fff;
    background: linear-gradient(145deg, #6f5046, #4f3730);
    border-radius: 28px 28px 10px 10px;
    box-shadow: 0 18px 45px rgba(72, 47, 39, .22);
}
.hero-card::before, .hero-card::after {
    content: "";
    position: absolute;
    width: 180px; height: 180px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 50%;
}
.hero-card::before { top: -100px; left: -80px; }
.hero-card::after { right: -95px; bottom: -110px; }
.ornament { font-size: 22px; opacity: .85; margin-bottom: 10px; }
.eyebrow { margin: 0 0 14px; letter-spacing: .16em; font-size: 11px; font-weight: 700; opacity: .8; }
.hero-card h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(36px, 10vw, 58px); font-weight: 500; line-height: 1.05; }
.date { margin: 10px 0 22px; font-family: Georgia, serif; font-size: 17px; opacity: .8; }
.intro { max-width: 520px; margin: 0 auto; line-height: 1.65; color: rgba(255,255,255,.88); }
.upload-card {
    padding: 24px;
    background: var(--paper);
    border-radius: 10px 10px 28px 28px;
    box-shadow: 0 18px 45px rgba(72, 47, 39, .15);
}
.field-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 18px; }
label > span { display: block; margin-bottom: 7px; font-weight: 700; font-size: 14px; }
label small { font-weight: 500; color: var(--muted); }
input[type="text"], textarea {
    width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 13px;
    padding: 13px 14px; color: var(--ink); outline: none; resize: vertical;
}
input[type="text"]:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(111,80,70,.1); }
.picker {
    width: 100%; min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    border: 2px dashed #cdbbb0; border-radius: 18px; color: var(--accent-dark); background: var(--soft); cursor: pointer;
    padding: 22px; transition: transform .15s, border-color .15s, background .15s;
}
.picker:hover { transform: translateY(-1px); border-color: var(--accent); background: #f3e8e0; }
.picker-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: #fff; font-size: 30px; margin-bottom: 12px; box-shadow: 0 5px 18px rgba(65,39,31,.1); }
.picker strong { font-size: 17px; }
.picker small { margin-top: 7px; color: var(--muted); text-align: center; line-height: 1.45; }
.selection-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 13px 14px; background: var(--soft); border-radius: 13px; }
.selection-summary strong, .selection-summary span { display: block; }
.selection-summary span { color: var(--muted); font-size: 13px; margin-top: 2px; }
.text-button { border: 0; background: transparent; color: var(--accent); font-weight: 800; cursor: pointer; }
.file-list { display: grid; gap: 8px; margin: 12px 0; max-height: 265px; overflow: auto; }
.file-item { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fff; }
.file-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--soft); }
.file-meta { min-width: 0; }
.file-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; font-weight: 700; }
.file-size { font-size: 12px; color: var(--muted); margin-top: 2px; }
.file-state { font-size: 12px; font-weight: 800; color: var(--muted); }
.file-state.done { color: var(--success); }
.file-state.failed { color: var(--danger); }
.consent { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0; cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: 0 0 auto; }
.consent span { margin: 0; font-weight: 500; color: var(--muted); line-height: 1.45; }
.primary-button, .secondary-button {
    width: 100%; border: 0; border-radius: 14px; padding: 15px 18px; font-weight: 800; cursor: pointer;
}
.primary-button { color: #fff; background: var(--accent); box-shadow: 0 8px 20px rgba(111,80,70,.22); }
.primary-button:hover { background: var(--accent-dark); }
.primary-button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.secondary-button { color: var(--accent-dark); background: var(--soft); margin-top: 14px; }
.progress-panel, .success-panel, .error-panel { margin-top: 18px; padding: 18px; border-radius: 16px; }
.progress-panel { background: #f7f2ed; }
.progress-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.progress-head strong { display: block; margin-top: 3px; }
.status-label { font-size: 10px; letter-spacing: .12em; color: var(--muted); font-weight: 900; }
.progress-track { height: 12px; overflow: hidden; background: #dfd1c9; border-radius: 999px; margin: 14px 0 10px; }
.progress-track > div { width: 0; height: 100%; background: var(--accent); border-radius: inherit; transition: width .15s linear; }
#currentFileText { margin: 0; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.keep-open { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.success-panel { text-align: center; background: #eef8f2; color: #285c47; }
.success-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 10px; border-radius: 50%; background: var(--success); color: #fff; font-size: 28px; }
.success-panel h2 { margin: 0 0 8px; }
.success-panel p { margin: 0; line-height: 1.5; }
.error-panel { background: #fff0f0; color: #7d3030; }
.error-panel p { margin: 8px 0 0; line-height: 1.45; }
footer { text-align: center; color: #796b65; font-size: 12px; padding: 22px 14px 0; }
@media (min-width: 620px) {
    .page-shell { padding-top: 38px; }
    .upload-card { padding: 32px; }
    .field-grid { grid-template-columns: .8fr 1.2fr; }
}
