:root {
    color-scheme: light;
    --ink: #1d2b22;
    --muted: #77827a;
    --line: #e7ebe3;
    --surface: #ffffff;
    --canvas: #f4f7f1;
    --green: #2e8b57;
    --green-soft: #eaf5ed;
    --amber: #cf8614;
    --red: #d84f45;
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    background: var(--canvas);
    color: var(--ink);
    font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(ellipse at 15% 0%, #eaf2e7 0, transparent 38rem), var(--canvas); }
button, input { font: inherit; }
button { cursor: pointer; }
.shell { width: min(100% - 44px, 900px); margin: 0 auto; padding: 28px 0 26px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--green); color: white; font-size: 34px; line-height: 1; font-weight: 700; transform: rotate(-30deg); box-shadow: 0 5px 14px #2e8b5733; }
.brand strong { display: block; font: 800 19px/1.2 -apple-system, BlinkMacSystemFont, sans-serif; letter-spacing: -.4px; }
.brand small { color: var(--muted); font-size: 12px; }
.refresh-button { border: 1px solid #dce4da; background: #fff; color: var(--ink); border-radius: 12px; height: 42px; padding: 0 14px; display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; transition: .18s ease; box-shadow: 0 2px 5px #1c332208; }
.refresh-button:hover { border-color: #a8c7ae; background: #fbfdf9; }
.refresh-button:disabled { opacity: .65; cursor: wait; }
.refresh-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.refresh-button.is-loading svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.station-row { display: flex; align-items: center; gap: 14px; min-height: 88px; border: 1px solid var(--line); border-radius: 18px; background: #ffffffcc; padding: 16px 18px; box-shadow: 0 7px 20px #1c332208; }
.station-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--green-soft); color: var(--green); font-size: 26px; font-weight: 700; }
.station-info { min-width: 0; display: grid; gap: 2px; flex: 1; }
.station-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 16px/1.35 -apple-system, BlinkMacSystemFont, sans-serif; }
.station-info > span:last-child { color: var(--muted); font-size: 12px; }
.eyebrow { color: #89948a; font-size: 10px; font-weight: 700; letter-spacing: 1.1px; }
.text-button { border: 0; background: transparent; padding: 9px 0 9px 10px; color: var(--green); font-size: 12px; font-weight: 700; white-space: nowrap; }
.text-button:hover { color: #1e6b40; }
.search-panel { margin-top: 10px; border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: white; box-shadow: 0 8px 22px #1c33220c; }
.search-panel[hidden], .notice[hidden], .empty-state[hidden] { display: none; }
.search-panel label { display: block; margin-bottom: 9px; font-size: 12px; font-weight: 700; }
.search-controls { display: flex; gap: 8px; }
.search-controls input { min-width: 0; flex: 1; height: 42px; border: 1px solid #dfe5dc; border-radius: 10px; padding: 0 12px; color: var(--ink); outline: none; }
.search-controls input:focus { border-color: #70aa7f; box-shadow: 0 0 0 3px #2e8b5718; }
.search-controls button { border: 0; border-radius: 10px; padding: 0 16px; color: white; background: var(--green); font-size: 12px; font-weight: 700; }
.search-results { display: grid; gap: 5px; margin-top: 10px; }
.search-results:empty { display: none; }
.search-result { display: flex; justify-content: space-between; align-items: center; width: 100%; border: 0; border-radius: 9px; background: #f5f8f3; padding: 10px 11px; text-align: left; color: var(--ink); }
.search-result:hover { background: #eaf5ed; }
.search-result strong { font-size: 12px; }
.search-result span { color: var(--muted); font-size: 11px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 27px 2px 13px; }
.section-heading h1 { margin: 4px 0 0; font: 800 20px/1.2 -apple-system, BlinkMacSystemFont, sans-serif; letter-spacing: -.5px; }
.connection-state { display: inline-flex; align-items: center; gap: 7px; padding-bottom: 3px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.connection-state i { width: 7px; height: 7px; display: block; border-radius: 50%; background: #a8b1a9; }
.connection-state[data-state="ok"] i { background: #38a565; box-shadow: 0 0 0 3px #38a56520; }
.connection-state[data-state="error"] i { background: var(--red); }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bin-card { --tone: var(--green); min-height: 191px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); padding: 17px 18px 14px; box-shadow: 0 7px 20px #1c332208; animation: card-in .28s ease both; }
.bin-card[data-level="medium"] { --tone: var(--amber); }
.bin-card[data-level="high"] { --tone: var(--red); }
@keyframes card-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.commodity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.commodity-icon { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; background: #f0f4ed; font-size: 20px; }
.commodity h2 { margin: 0; overflow: hidden; text-overflow: ellipsis; font: 700 15px/1.3 -apple-system, BlinkMacSystemFont, sans-serif; white-space: nowrap; }
.percent { color: var(--tone); font: 800 22px/1 -apple-system, BlinkMacSystemFont, sans-serif; letter-spacing: -.7px; white-space: nowrap; }
.progress-track { width: 100%; height: 7px; margin: 15px 0 13px; overflow: hidden; border-radius: 99px; background: #edf0eb; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--tone); transition: width .55s cubic-bezier(.2,.8,.2,1); }
.pickup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pickup { min-width: 0; display: grid; gap: 4px; }
.pickup:last-child { text-align: right; }
.pickup-label { color: #89948a; font-size: 10px; font-weight: 600; }
.pickup strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 700; }
.pickup .muted-value { color: #a0a9a0; font-weight: 500; }
.measurement { margin-top: 11px; padding-top: 9px; border-top: 1px solid #f0f2ee; color: #909b91; font-size: 10px; }
.empty-state { margin: 18px 0; border: 1px dashed #cdd9ca; border-radius: 16px; padding: 34px 18px; text-align: center; color: var(--muted); background: #ffffffaa; }
.empty-icon { display: block; font-size: 28px; color: var(--green); }
.empty-state strong { display: block; margin-top: 8px; color: var(--ink); }
.empty-state p { margin: 5px 0 0; font-size: 12px; }
.footer { display: flex; justify-content: space-between; gap: 12px; margin: 16px 2px 0; color: var(--muted); font-size: 10px; }
.footer a { color: var(--green); text-decoration: none; font-weight: 700; white-space: nowrap; }
.footer a:hover { text-decoration: underline; }
.notice { margin: 13px 0 0; border: 1px solid #f0d6c7; border-radius: 11px; padding: 10px 12px; color: #87543f; background: #fff7f2; font-size: 12px; line-height: 1.45; }

@media (max-width: 560px) {
    .shell { width: min(100% - 26px, 480px); padding-top: 16px; }
    .topbar { margin-bottom: 17px; }
    .brand-mark { width: 39px; height: 39px; font-size: 30px; }
    .brand strong { font-size: 17px; }
    .refresh-button { width: 41px; padding: 0; justify-content: center; }
    .refresh-button span { display: none; }
    .station-row { gap: 10px; min-height: 77px; padding: 12px; }
    .station-icon { width: 38px; height: 38px; }
    .station-info strong { font-size: 14px; }
    .text-button { font-size: 11px; }
    .section-heading { align-items: start; flex-direction: column; gap: 7px; margin-top: 23px; }
    .section-heading h1 { font-size: 18px; }
    .cards { gap: 9px; }
    .bin-card { min-height: 174px; padding: 13px 12px 11px; border-radius: 15px; }
    .commodity { gap: 7px; }
    .commodity-icon { width: 31px; height: 31px; border-radius: 9px; font-size: 18px; }
    .commodity h2 { font-size: 13px; }
    .percent { font-size: 18px; }
    .progress-track { height: 6px; margin: 13px 0 11px; }
    .pickup-grid { gap: 5px; }
    .pickup-label { font-size: 9px; }
    .pickup strong { font-size: 10px; }
    .measurement { margin-top: 9px; padding-top: 7px; font-size: 9px; }
    .footer { flex-direction: column; gap: 7px; }
}

@media (max-width: 365px) {
    .cards { grid-template-columns: 1fr; }
    .bin-card { min-height: unset; }
    .measurement { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
