:root {
  color-scheme: light;
  --ink: #222b2a;
  --muted: #5a6461;
  --wine: #851d37;
  --wine-dark: #64152a;
  --line: #deded7;
  --paper: #fcfbf8;
  --green: #286449;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: #f2f2ed;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
.wrap { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.masthead { background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { min-height: 74px; display: flex; align-items: center; gap: 12px; }
.brand strong, .brand span:not(.local) { display: block; }
.brand div > span { color: var(--muted); font-size: .82rem; }
.mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: var(--wine); color: white; font: bold 1.55rem Georgia, serif; }
.local { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; border: 1px solid #cadbd0; background: #edf4ee; color: #23533d; padding: 6px 12px; border-radius: 100px; font-size: .84rem; white-space: nowrap; }
.local .status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
main { padding: 35px 0 50px; }
.intro { max-width: 670px; }
.eyebrow { margin: 0 0 8px; color: var(--wine); text-transform: uppercase; font-size: .76rem; font-weight: 700; letter-spacing: .11em; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; }
h1 { font-size: clamp(2rem, 4.3vw, 3.4rem); line-height: 1.1; font-weight: 600; margin: 0 0 12px; }
.intro > p:last-child { margin: 0; color: var(--muted); line-height: 1.55; }
.steps { display: flex; flex-wrap: wrap; list-style: none; gap: 10px 24px; padding: 0 0 16px; margin: 24px 0 18px; border-bottom: 1px solid var(--line); }
.steps li { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.steps span { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid #cccfc5; border-radius: 50%; }
.steps [aria-current] { color: var(--wine-dark); }
.steps [aria-current] span { background: var(--wine); color: white; border-color: var(--wine); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(255px, .43fr); gap: 20px; align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 15px; padding: 25px; box-shadow: 0 1px 3px #20201908; }
.side { padding: 21px; margin-bottom: 13px; }
h2 { margin: 0 0 12px; font-size: 1.42rem; }
h3 { font-size: 1rem; margin: 0; }
.period { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .6fr); gap: 12px; margin: 19px 0 23px; }
.period label { display: grid; gap: 6px; font-size: .9rem; font-weight: 650; }
select, input[type="number"] { width: 100%; min-width: 0; color: inherit; font: inherit; border-radius: 7px; border: 1px solid #c6cbc3; padding: 9px 11px; background: white; }
.upload-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
#file-count, .subtle, .privacy { color: var(--muted); font-size: .9rem; line-height: 1.55; }
.subtle { margin: 0 0 14px; }
.drop { position: relative; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; min-height: 101px; padding: 16px; border: 1px dashed #aaafa4; border-radius: 11px; background: #f3f4ef; }
.drop svg { width: 21px; height: 21px; fill: none; stroke: var(--wine); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.drop span { color: var(--muted); }
.browse { color: var(--wine-dark); text-decoration: underline; font-weight: 700; cursor: pointer; }
.file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.drop:focus-within, .drop.dragging { outline: 2px solid var(--wine); outline-offset: 2px; }
.file-list, .sources { margin: 12px 0 17px; padding: 0; list-style: none; }
.file-list:empty { margin: 0 0 16px; }
.file-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.file-list li span, .downloads a, .sources span { overflow-wrap: anywhere; }
.file-list li small { color: var(--muted); display: block; }
.primary, .secondary { border: 1px solid transparent; border-radius: 8px; padding: 10px 15px; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; }
.primary { display: inline-block; background: var(--wine); color: white; }
.primary:hover { background: var(--wine-dark); }
.primary:disabled { opacity: .45; cursor: default; }
.secondary { background: transparent; border-color: var(--line); color: var(--ink); }
.secondary:hover { background: #f0f1eb; }
.remove { color: var(--wine-dark); background: transparent; border: 0; padding: 7px; cursor: pointer; }
.downloads a { color: var(--wine-dark); font-weight: 600; }
.requirements { margin: 0; }
.requirements div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.requirements div:last-child { border: 0; padding-bottom: 0; }
.requirements dt { font-weight: 650; }
.requirements dd { margin: 3px 0 0; font-size: .87rem; line-height: 1.45; color: var(--muted); }
.privacy { padding-inline: 7px; }
.sources { margin-bottom: 0; }
.sources li { margin: 8px 0; font-size: .88rem; }
.sources strong { display: block; color: var(--green); font-size: .8rem; }
.error { padding: 12px 15px; background: #fbe9eb; border: 1px solid #e7bec5; border-radius: 9px; color: #731832; margin: 0 0 13px; white-space: pre-line; overflow-wrap: anywhere; }
.working { display: flex; gap: 15px; align-items: center; margin-bottom: 12px; }
.working h2, .working p { margin: 0; }
.working p { color: var(--muted); margin-top: 4px; }
.spinner { flex: 0 0 25px; height: 25px; border: 3px solid #ecd5dc; border-top-color: var(--wine); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.table-scroll { overflow-x: auto; margin: 0 0 17px; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; font-size: .88rem; }
td input { min-width: 74px !important; }
td .existing { color: var(--muted); padding: 0 8px; }
:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }
@media (max-width: 760px) { .layout { grid-template-columns: 1fr; } .wrap { width: calc(100% - 28px); } main { padding-top: 25px; } }
@media (max-width: 420px) { .brand { gap: 8px; } .panel { padding: 17px; } .local { padding: 5px 7px; font-size: .74rem; } .steps { gap: 8px 12px; } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
