body { display: flex; flex-direction: column; min-height: 100vh; margin: 0; font: 16px/1.4 "Public Sans", system-ui, sans-serif; background: #f2f2f2; color: #111; }
.masthead { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1em; padding: 0.8em 1.5em; background: #000; }
.masthead .label { color: #ffd50e; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; }
.masthead .logo { display: block; height: 4em; }
.masthead .account { display: flex; align-items: center; gap: 1em; justify-self: end; color: #aaa; font-size: 0.85em; }
.masthead form { margin: 0; }
@media (max-width: 50em) { .masthead .account span { display: none; } }
header .menu { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.6em; padding: 0 1.5em; background: #529062; }
header .menu a, header .menu summary { margin: 0; padding: 0.55em 0; color: #fff; font-size: 0.85em; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; text-decoration: none; border-bottom: 4px solid transparent; cursor: pointer; }
header .menu a:hover, header .menu summary:hover { border-bottom-color: #fff; }
.dropdown { position: relative; margin-left: auto; }
.dropdown summary { list-style: none; }
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown summary::after { content: " \25BE"; }
.dropdown > div { position: absolute; right: -1em; z-index: 20; display: flex; flex-direction: column; min-width: 18em; padding: 0.4em 1em; background: #529062; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25); }
header .dropdown > div a { font-weight: 600; letter-spacing: normal; text-transform: none; }
main { flex: 1; box-sizing: border-box; width: 100%; max-width: 1500px; margin: 0 auto; padding: 2em 1.5em 3em; }
footer { padding: 1.5em; background: #000; color: #aaa; font-size: 0.75em; letter-spacing: 0.5px; text-transform: uppercase; text-align: center; }
footer .revision { margin-left: 0.5em; color: #666; font-family: monospace; text-transform: none; }
h2 { margin: 0 0 0.8em; font-size: 1.6em; font-weight: 800; text-transform: uppercase; }
h3 { font-weight: 700; }
.card { background: #fff; border: 1px solid #e4e4e4; border-radius: 6px; padding: 1.25em 1.5em; margin-bottom: 1.5em; overflow-x: auto; }
.card h3 { margin-top: 0; }
.narrow { max-width: 32em; margin: 3em auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(18em, 1fr)); gap: 1em; }
.tile { color: inherit; text-decoration: none; margin: 0; border-top: 4px solid #529062; }
.tile:hover { border-top-color: #ffd50e; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08); }
.muted { color: #767676; font-size: 0.9em; }
table { border-collapse: collapse; width: 100%; font-size: 0.85em; }
th { position: sticky; top: 0; text-align: left; padding: 0.5em; font-size: 0.78em; text-transform: uppercase; color: #fff; background: #000; border-bottom: 4px solid; }
td { padding: 0.4em 0.5em; border-bottom: 1px solid #e4e4e4; vertical-align: top; white-space: nowrap; }
td form { margin: 0; }
.rev { border-color: #2e7d32; }
.calc { border-color: #1565c0; }
.hand { border-color: #ffd50e; }
.legend span { padding: 0 0.5em; margin-right: 1em; border-left-width: 1em; border-left-style: solid; }
.bad { color: #c62828; }
.warn { color: #b26a00; }
nav a { margin-right: 1em; }
input, select { padding: 0.4em 0.6em; font: inherit; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; background: #fff; max-width: 100%; }
input.short { width: 5em; }
label { display: inline-block; margin: 0 1em 0.8em 0; font-size: 0.9em; color: #555; }
label > input, label > select { display: block; margin-top: 0.2em; color: #000; }
button, a.button { display: inline-block; padding: 0.45em 1.3em; font: inherit; font-size: 0.9em; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; color: #fff; background: #000; border: 2px solid #ffd50e; border-radius: 999px; cursor: pointer; text-decoration: none; }
button:not(:disabled):hover, a.button:hover { color: #000; background: #ffd50e; }
button.secondary { color: #000; background: #fff; border-color: #000; }
button.link, button.link:not(:disabled):hover { padding: 0; color: #c62828; background: none; border: 0; font-weight: 400; letter-spacing: normal; text-transform: none; text-decoration: underline; }
td.delete { width: 1%; text-align: right; }
dialog { box-sizing: border-box; width: min(28em, calc(100vw - 2em)); padding: 1.5em; border: 0; border-top: 6px solid #529062; border-radius: 6px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3); }
dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
dialog label { display: block; margin-right: 0; }
dialog label > input { width: 100%; }
dialog .actions { display: flex; justify-content: flex-end; gap: 0.6em; margin-top: 1.2em; }
.result { padding: 0.6em 1em; border-radius: 4px; background: #fff8e1; border-left: 4px solid #ffd50e; }
code { font-size: 0.9em; }
.csv-button { margin-top: 0.8em; font-size: 0.85em; }
.summary { display: flex; flex-wrap: wrap; gap: 1em 2.5em; }
.summary div span { display: block; }
.card.warning { border-left: 4px solid #ffd50e; }
.valid { color: #2e7d32; }
.invalid { color: #c62828; }
.invalid-soft { color: #6b6bb8; }
.unmatched { color: #c62828; font-weight: 600; }
.badge { display: inline-block; margin-left: 0.4em; padding: 0.05em 0.5em; font-size: 0.72em; font-weight: 600; border-radius: 999px; background: #ffd50e; }
td.divider { border-left: 1px solid #e4e4e4; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5em 1.5em; }
.section-head label { margin: 0; }
.section-head label > input, .section-head label > select { display: inline-block; }
textarea { padding: 0.4em 0.6em; font: inherit; font-family: monospace; border: 1px solid #ccc; border-radius: 4px; }
label > textarea { display: block; margin-top: 0.2em; }
.grid { display: grid; grid-template-columns: 3fr 1fr; gap: 0.6em 1em; align-items: center; margin-bottom: 1em; }
.grid input, .grid select { width: 100%; }
.sheet-status { display: block; min-height: 1.4em; font-size: 0.9em; }
.sheet-status.ok { color: #2e7d32; }
.sheet-status.bad, .result.bad { color: #c62828; }
.result code { display: block; margin: 0.3em 0; word-break: break-all; }
.suggest { position: absolute; z-index: 10; max-height: 20em; overflow-y: auto; background: #fff; border: 1px solid #ccc; border-radius: 4px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12); }
.suggest div { padding: 0.35em 0.6em; cursor: pointer; }
.suggest div:hover, .suggest div.active { background: #fff6cc; }
.suggest small { display: block; color: #767676; }
button:disabled { opacity: 0.5; cursor: default; }
button.update-now { padding: 0.3em 0.8em; font-size: 0.85em; white-space: nowrap; }
