:root {
    color-scheme: light;
    --paper: #faf8f4;
    --white: #fff;
    --ink: #202723;
    --green: #15382c;
    --orange: #ffac71;
    --muted: #5b655e;
    --line: #dcded7;
    font-family: system-ui, sans-serif;
    background: var(--paper);
    color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, p { margin: 0 0 1rem; }
h1 { font-size: clamp(1.85rem, 5vw, 3rem); letter-spacing: -.055em; }
h2 { font-size: 1.2rem; }
a { color: var(--green); text-underline-offset: 3px; }
small { display: block; color: var(--muted); }
label { display: grid; gap: .4rem; font-size: .9rem; font-weight: 650; }
input, select, button { font: inherit; min-height: 44px; border-radius: 6px; }
input, select { border: 1px solid #aeb7ae; padding: .55rem .7rem; background: var(--white); color: var(--ink); width: 100%; }
button { border: 1px solid var(--green); background: var(--green); color: white; padding: .55rem 1rem; cursor: pointer; font-weight: 680; }
button:disabled { opacity: .5; cursor: default; }
button.quiet { background: transparent; color: var(--green); }
:focus-visible { outline: 3px solid #b74917; outline-offset: 3px; }
form { display: grid; gap: .85rem; justify-items: start; }
form > label, .fields { width: 100%; }
form > label { max-width: 25rem; }
.login { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100svh; }
.lettermark { background: var(--green); color: var(--paper); padding: clamp(2rem, 7vw, 7rem); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.lettermark > span, .lettermark small { letter-spacing: .17em; font-size: .8rem; font-weight: 750; color: var(--paper); }
.lettermark strong { font-family: Impact, 'Arial Narrow', sans-serif; font-size: clamp(5.5rem, 14vw, 13rem); line-height: .83; letter-spacing: -.018em; margin: .16em 0; }
.lettermark strong span, .brand span { color: var(--orange); }
.login-form { width: min(100%, 33rem); padding: clamp(2rem, 6vw, 5rem); margin: auto; }
.login-form form, .login-form button { width: 100%; }
.top { color: var(--paper); background: var(--green); display: flex; align-items: center; gap: 1rem; padding: .7rem max(1rem, calc((100% - 72rem)/2)); }
.brand { margin-right: auto; color: white; font-size: 1.5rem; font-weight: 850; letter-spacing: -.07em; text-decoration: none; white-space: nowrap; }
.top small { color: #d1dbd4; }
.top button.quiet { color: white; border-color: #a9bdb1; }
.desk { max-width: 75rem; margin: 0 auto; padding: 1.5rem; }
nav { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.5rem; }
nav a { padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; font-weight: 700; }
nav a[aria-current] { background: var(--green); border-color: var(--green); color: white; }
.panel, .metrics section { background: white; border: 1px solid var(--line); border-radius: 12px; padding: clamp(1rem, 3vw, 1.6rem); margin-bottom: 1rem; }
.panel p:last-child { margin-bottom: 0; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 1rem; }
.metrics strong { display: block; font-size: clamp(1.4rem, 3vw, 2rem); margin-top: .3rem; font-variant-numeric: tabular-nums; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: .8rem; }
.record, details { border-top: 1px solid var(--line); padding: .8rem 0; }
.record { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; overflow-wrap: anywhere; }
summary { cursor: pointer; font-weight: 700; padding: .45rem 0; }
details form { margin: .65rem 0; }
.muted { color: var(--muted); font-weight: 500; }
.notice { padding: .9rem 1rem; background: #e7f1e9; border-left: 4px solid var(--green); }
.notice.error { background: #fff0e9; border-color: #b74917; }
.inline { display: flex; align-items: center; width: auto; }
.inline input { width: 1.05rem; min-height: 1rem; }
.narrow { max-width: 36rem; }
.scale { display: grid; grid-template-columns: 1fr auto; gap: .8rem; padding: 1rem; background: #e9efea; border-radius: 8px; margin-bottom: 1rem; align-items: center; width: 100%; }
.scale output { display: block; font: 650 clamp(2rem, 7vw, 3.5rem)/1.15 ui-monospace, monospace; color: var(--green); }
.scale p { grid-column: 1/-1; font-size: .9rem; }
.scale > div:nth-child(2) { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; }
#cuts { width: 100%; }
.cut { display: grid; grid-template-columns: minmax(10rem, 2fr) minmax(6rem, 1fr) auto auto; gap: .65rem; align-items: end; margin-bottom: .75rem; }
.subtotal { align-self: center; font-weight: 700; }
.actions { display: flex; gap: .65rem; flex-wrap: wrap; align-items: center; }
.actions strong { font: 700 1.3rem ui-monospace, monospace; }
.jump { display: inline-flex; min-height: 44px; align-items: center; font-weight: 750; }
.cash-nav { display: flex; gap: 1.3rem; flex-wrap: wrap; }
.cash-queue summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 56px; }
.cash-queue summary::before { content: '+'; color: var(--green); font-size: 1.35rem; }
.cash-queue details[open] summary::before { content: '−'; }
.cash-queue summary > span { margin-right: auto; }
.cash-queue summary strong { font-variant-numeric: tabular-nums; font-size: 1.2rem; white-space: nowrap; }
.cash-actions button, .cash-queue select, .cash-queue input { min-height: 52px; }
.lot-cut { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) auto; }
.lot-picker form { display: flex; align-items: end; flex-wrap: wrap; }
.lot-picker label { flex: 1 1 12rem; }
.animal-diagram { display: block; width: 100%; max-width: 48rem; height: auto; margin: 1rem auto; }
.silhouette { fill: #e5e5df; }
.silhouette-edge { fill: none; stroke: var(--green); stroke-width: 2; pointer-events: none; }
.map-zone path { fill: var(--zone-fill, #e5e5df); stroke: #fff; stroke-width: 2; }
.map-zone text { font-size: 13px; font-weight: 750; text-anchor: middle; fill: var(--zone-ink, #172823); pointer-events: none; }
.map-zone .map-percent { font-size: 12px; }
.map-zone:hover path, .map-zone:focus-visible path { stroke: #ffab6d; stroke-width: 4; }
.shade-0 { --zone-fill: #ffe9d9; }
.shade-1 { --zone-fill: #fde0c8; }
.shade-2 { --zone-fill: #ffd0a8; }
.shade-3 { --zone-fill: #fcb887; }
.shade-4 { --zone-fill: #f5a273; }
.shade-5 { --zone-fill: #e78762; }
.shade-6 { --zone-fill: #a94d32; --zone-ink: white; }
.shade-7 { --zone-fill: #97402e; --zone-ink: white; }
.shade-8 { --zone-fill: #833629; --zone-ink: white; }
.shade-9 { --zone-fill: #742d23; --zone-ink: white; }
.shade-10 { --zone-fill: #60251d; --zone-ink: white; }
.map-legend { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem; margin-bottom: 1rem; font-size: .88rem; }
.map-ramp { flex: 0 1 8rem; height: 12px; border-radius: 8px; background: linear-gradient(90deg,#ffe9d9,#e78762,#60251d); }
.map-legend a { padding: .65rem .2rem; }
.zone-info { padding: .8rem 0; border-top: 1px solid var(--line); scroll-margin-top: 1rem; }
.zone-info:target { background: #fff7ef; outline: 2px solid #f5a273; padding: .8rem; }
.zone-info h3 { margin: 0 0 .4rem; }
@media (max-width: 700px) {
    .login, .scale { grid-template-columns: 1fr; }
    .lettermark { padding: 2rem; }
    .lettermark strong { font-size: clamp(4rem, 15vw, 6rem); }
    .lettermark br { display: none; }
    .lettermark br::after { content: ' '; }
    .desk { padding: .9rem; }
    .cut { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .top { flex-wrap: wrap; gap: .65rem; }
    .top > div { order: 3; width: 100%; }
    .desk form, .desk .fields, .scale > div { min-width: 0; }
    .cash-actions, .cash-actions button { width: 100%; }
    .cash-actions button { flex: 1 1 100%; }
    .map-zone text { font-size: 14px; }
}
@media print {
    .top, .desk > :not(.receipt), .print { display: none; }
    .receipt { border: 0; }
}
