/* Pantry Watch: one plain table. System font, aligned numbers, green only where something is on sale. */
:root {
  color-scheme: light dark;
  --bg: #fff; --fg: #111; --muted: #666; --rule: #ddd; --head: #f5f5f5;
  --sale: #0a7a2f; --sale-bg: #eaf6ed; --warn: #a15c00; --err: #b3261e; --link: #0b57d0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212; --fg: #eaeaea; --muted: #9a9a9a; --rule: #303030; --head: #1b1b1b;
    --sale: #5fd083; --sale-bg: #12301c; --warn: #e0a040; --err: #f2867e; --link: #8ab4f8;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.35 system-ui, "Segoe UI", Arial, sans-serif; }
main { max-width: 1040px; margin: 0 auto; padding: 20px 16px 40px; }

header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; }
h1 { font-size: 22px; font-weight: 650; margin: 0; }
h1 .n { color: var(--sale); }
.sub { color: var(--muted); font-size: 13px; }
.right { margin-left: auto; }
.status { margin: 8px 0 0; min-height: 18px; font-size: 13px; color: var(--muted); }
.status.err { color: var(--err); }

button, select { font: inherit; font-size: 13px; color: var(--fg); }
button { padding: 5px 10px; border: 1px solid var(--rule); background: var(--head); border-radius: 4px; cursor: pointer; }
button:disabled { opacity: 0.5; cursor: default; }
select { padding: 2px 4px; border: 1px solid var(--rule); background: var(--bg); border-radius: 4px; max-width: 100%; }
.link, button.link { color: var(--link); font-size: 13px; cursor: pointer; background: none; border: 0; padding: 0; text-decoration: underline; }
.file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file:focus-within { outline: 2px solid var(--link); outline-offset: 2px; }

table { width: 100%; border-collapse: collapse; margin-top: 6px; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--head); padding: 6px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th.num, td.num { text-align: right; white-space: nowrap; }
td.price { font-weight: 650; font-size: 17px; }
td.price small { font-weight: 400; font-size: 12px; color: var(--muted); }
td.empty { color: var(--muted); padding: 18px 10px; }

.name { font-weight: 600; }
button.name { font-size: 15px; background: none; border: 0; padding: 0; text-align: left; }
.prod { color: var(--muted); font-size: 13px; }
.on { color: var(--sale); font-weight: 650; white-space: nowrap; }
.off { color: var(--muted); }
.warn { color: var(--warn); font-size: 13px; }
.save { color: var(--sale); font-weight: 650; }
.save .prod { font-weight: 400; }

tr.sale > td { background: var(--sale-bg); }
tr.sale > td:first-child { box-shadow: inset 3px 0 0 var(--sale); }

tr.member > td, tr.facts > td { padding-top: 5px; padding-bottom: 5px; font-size: 13px; color: var(--muted); }
tr.member > td.item, tr.facts > td.item { padding-left: 26px; }
tr.member > td.price { font-size: 14px; font-weight: 500; color: var(--fg); }
tr.member.best .desc { color: var(--fg); font-weight: 600; }
.manage { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-top: 3px; }

svg.spark { width: 90px; height: 20px; display: block; margin-left: auto; }
svg.spark path { fill: none; stroke: var(--muted); stroke-width: 1.5; }
svg.spark rect { fill: var(--sale); }
input[type=checkbox] { margin: 0; accent-color: var(--sale); }

.tools { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 16px; font-size: 13px; }
.tools input[type=search] { font: inherit; padding: 6px 9px; border: 1px solid var(--rule); border-radius: 4px; background: var(--bg); color: var(--fg); width: min(320px, 100%); }
#results-box { margin-top: 18px; }
.label { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 600; }

@media (max-width: 700px) {
  /* phone: Item, Price, Save. The green row carries the status. */
  .hide-s, .c-status, .c-unit { display: none; }
  td, th { padding-left: 6px; padding-right: 6px; }
  tr.sale > td.item { box-shadow: inset 3px 0 0 var(--sale); padding-left: 10px; }
  tr.member > td.item, tr.facts > td.item { padding-left: 18px; }
}

/* Demo page only: the made-up-data notice. */
.demo { margin: 0 0 14px; padding: 8px 10px; border: 1px solid var(--rule); border-left: 3px solid var(--warn); background: var(--head); font-size: 13px; }
.demo a { color: var(--link); }
