/* TV board. Sized in rem off the viewport so a 1080p or 4K TV shows the same layout. */
:root {
  --bg: #0a1324; --surface: #111e36; --surface-2: #172846; --line: #22365a;
  --ink: #f1f5fb; --ink-2: #c3cfe2; --muted: #8b9bb8;
  --gold: #e3bd52; --po: #6aa9ff; --tb: #3ed6a0; --other: #8b9bb8;
  --warn: #f6c453; --bad: #ff8a80; --info: #8cc4ff; --good: #5ee0a0;
  font-size: min(calc(100vw / 120), calc(100vh / 67.5));
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(120rem 60rem at 80% -20%, #16294d 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--ink); font: 400 1rem/1.35 Inter, system-ui, "Segoe UI", sans-serif;
  display: flex; flex-direction: column; overflow: hidden;
}

/* top bar */
.bar { position: relative; display: flex; align-items: center; gap: 2rem; padding: 1.1rem 2.2rem; border-bottom: 1px solid var(--line); background: rgba(10, 19, 36, .6); }
.brand { display: flex; align-items: center; gap: .9rem; }
.brand .crown { width: 2.6rem; color: var(--gold); display: block; }
.brand b { display: block; font-size: 1.45rem; font-weight: 800; letter-spacing: .01em; }
.brand small { display: block; color: var(--gold); font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.tabs { display: flex; gap: .4rem; margin-left: auto; }
.tabs button { font: inherit; font-size: .95rem; font-weight: 600; color: var(--muted); background: none; border: 1px solid transparent; border-radius: 999px; padding: .4rem 1rem; cursor: pointer; }
.tabs button.on { color: var(--ink); background: var(--surface-2); border-color: var(--line); }
.clock { text-align: right; min-width: 14rem; }
.clock b { display: block; font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.clock span { color: var(--ink-2); font-size: .95rem; }
.progress { position: absolute; left: 0; bottom: -1px; height: 3px; width: 0; background: var(--gold); opacity: .8; }
@keyframes fill { from { width: 0; } to { width: 100%; } }

/* panel */
main { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 1.4rem 2.2rem 1.8rem; gap: 1.2rem; }
main.enter { animation: enter .5s ease; }
@keyframes enter { from { opacity: 0; transform: translateY(.6rem); } }
.phead { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; }
.phead h1 { font-size: 2.4rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.1; }
.phead p { color: var(--ink-2); font-size: 1.1rem; margin-top: .2rem; }
.stats { display: flex; gap: .8rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: .8rem; padding: .55rem 1.1rem; min-width: 7.5rem; }
.stat b { display: block; font-size: 1.9rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

.locked { margin: auto; text-align: center; }
.locked h1 { font-size: 2.4rem; font-weight: 800; }
.locked p { color: var(--ink-2); font-size: 1.2rem; margin-top: .5rem; }

/* week */
.week { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .9rem; }
.day { display: flex; flex-direction: column; gap: .6rem; min-height: 0; overflow: hidden; background: rgba(17, 30, 54, .55); border: 1px solid var(--line); border-radius: 1rem; padding: .7rem; }
.day.today { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset, 0 0 2.5rem -1rem var(--gold); }
.day.past { opacity: .5; }
.dhead { display: flex; align-items: baseline; gap: .5rem; padding: .1rem .3rem .3rem; }
.dhead b { font-size: 1.25rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.dhead span { font-size: 1.25rem; color: var(--ink-2); font-weight: 600; }
.dhead em { margin-left: auto; font-style: normal; font-size: .8rem; font-weight: 700; color: #1b1405; background: var(--gold); border-radius: 999px; padding: .1rem .6rem; text-transform: uppercase; letter-spacing: .06em; }
.empty { color: var(--muted); font-size: 1rem; padding: .5rem .3rem; }
.job { background: var(--surface-2); border-radius: .75rem; padding: .65rem .75rem .7rem; border-left: .35rem solid var(--other); }
.job.po { border-left-color: var(--po); }
.job.tb { border-left-color: var(--tb); }
.jtop { display: flex; align-items: center; gap: .5rem; }
.jtop h3 { font-size: 1.2rem; font-weight: 800; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { flex: none; font-size: .78rem; font-weight: 800; border-radius: .35rem; padding: .1rem .4rem; color: #06101f; background: var(--other); }
.job.po .badge { background: var(--po); }
.job.tb .badge { background: var(--tb); }
.where { font-size: 1rem; font-weight: 600; color: var(--ink); margin-top: .25rem; }
.where span { display: block; font-weight: 400; font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job dl { margin-top: .4rem; display: grid; gap: .15rem; }
.job dl div { display: grid; grid-template-columns: 3.6rem 1fr; gap: .4rem; font-size: .88rem; }
.job dt { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: .72rem; letter-spacing: .05em; padding-top: .12rem; }
.job dd { color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.details, .supplies { margin-top: .4rem; font-size: .82rem; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.details { color: var(--gold); }
.supplies { border-top: 1px dashed var(--line); padding-top: .35rem; }
.dnotes { margin-top: auto; display: grid; gap: .35rem; padding-top: .3rem; }
.dnotes p { display: flex; gap: .45rem; font-size: .88rem; color: var(--ink-2); background: rgba(227, 189, 82, .08); border-radius: .5rem; padding: .35rem .5rem; }
.dnotes b { color: var(--ink); margin-right: .25rem; }
.ic { font-style: normal; }

/* storage */
.sites { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: .9rem; }
.site { background: rgba(17, 30, 54, .55); border: 1px solid var(--line); border-radius: 1rem; padding: .9rem; min-height: 0; overflow: hidden; }
.site h2, .pending h2 { display: flex; align-items: center; justify-content: space-between; font-size: 1.35rem; font-weight: 800; margin-bottom: .6rem; }
.site h2 span { font-size: 1rem; color: #1b1405; background: var(--gold); border-radius: 999px; padding: .05rem .65rem; }
.site ul { list-style: none; display: grid; gap: .4rem; }
.site li { display: flex; align-items: center; justify-content: space-between; gap: .6rem; background: var(--surface-2); border-radius: .6rem; padding: .5rem .7rem; }
.site li b { font-size: 1.05rem; font-weight: 700; }
.site li small { display: block; color: var(--muted); font-size: .82rem; }
.age { flex: none; font-size: .9rem; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.site li.warn .age { color: var(--warn); }
.site li.bad .age { color: var(--bad); }
.site li.gone { opacity: .45; }

/* rugs */
.rugs { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 1rem; }
.rugs table { width: 100%; border-collapse: separate; border-spacing: 0 .35rem; font-size: 1rem; }
.rugs th { text-align: left; color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 0 .8rem; }
.rugs td { background: var(--surface-2); padding: .55rem .8rem; color: var(--ink-2); }
.rugs td:first-child { border-radius: .6rem 0 0 .6rem; }
.rugs td:last-child { border-radius: 0 .6rem .6rem 0; }
.rugs td b { color: var(--ink); font-size: 1.1rem; }
.rugs td small { display: block; color: var(--muted); font-size: .8rem; margin-top: .15rem; }
.rugs .num { text-align: right; font-variant-numeric: tabular-nums; }
.rugs td.num { color: var(--ink); font-weight: 700; font-size: 1.1rem; }
.rugs .note { font-size: .88rem; max-width: 28rem; }
.pill { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; font-size: .9rem; border-radius: 999px; padding: .2rem .75rem .2rem .3rem; background: rgba(139, 155, 184, .15); color: var(--ink-2); white-space: nowrap; }
.pill i { font-style: normal; display: grid; place-items: center; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--muted); color: var(--bg); font-size: .8rem; font-weight: 800; }
.pill.warn { background: rgba(246, 196, 83, .14); color: var(--warn); } .pill.warn i { background: var(--warn); }
.pill.bad { background: rgba(255, 138, 128, .14); color: var(--bad); } .pill.bad i { background: var(--bad); }
.pill.info { background: rgba(140, 196, 255, .14); color: var(--info); } .pill.info i { background: var(--info); }
.pending { background: rgba(17, 30, 54, .55); border: 1px solid var(--line); border-radius: 1rem; padding: .9rem 1rem; }
.pending h2 span { font-size: .95rem; font-weight: 600; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { background: var(--surface-2); border-radius: .5rem; padding: .3rem .65rem; font-size: .95rem; font-weight: 600; }
.chip b { color: var(--gold); margin-left: .2rem; }
.chip small { color: var(--muted); font-weight: 500; margin-left: .3rem; }

/* cleaning */
.clean { display: grid; grid-template-columns: repeat(auto-fill, minmax(26rem, 1fr)); gap: .9rem; align-content: start; flex: 1; min-height: 0; overflow: hidden; }
.ccard { background: var(--surface-2); border: 1px solid var(--line); border-radius: 1rem; padding: .9rem 1rem 1rem; display: grid; gap: .55rem; align-content: start; }
.ctop { display: flex; align-items: center; gap: .6rem; }
.ctop h3 { font-size: 1.35rem; font-weight: 800; }
.prio { display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: .45rem; background: var(--gold); color: #1b1405; font-weight: 800; }
.loc { margin-left: auto; color: var(--muted); font-size: .9rem; font-weight: 600; }
.meter .mlabel { display: flex; justify-content: space-between; font-size: .88rem; color: var(--ink-2); margin-bottom: .25rem; }
.meter .mlabel b { color: var(--ink); font-variant-numeric: tabular-nums; }
.track { height: .55rem; background: rgba(139, 155, 184, .18); border-radius: 999px; overflow: hidden; }
.track div { height: 100%; background: var(--po); border-radius: 999px; }
.meter.full .track div { background: var(--good); }
.meta { display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .85rem; color: var(--muted); }
.meta .late { color: var(--warn); }
.ccard .note { font-size: .9rem; color: var(--ink-2); }

/* phones / small windows: stack and scroll, no rotation */
@media (max-width: 900px) {
  :root { font-size: 15px; }
  body { overflow: auto; height: auto; }
  .bar { flex-wrap: wrap; gap: .8rem; padding: .8rem 1rem; }
  .tabs { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  .clock { min-width: 0; margin-left: auto; }
  .clock b { font-size: 1.3rem; }
  main { padding: 1rem; }
  .phead { flex-direction: column; align-items: flex-start; gap: .8rem; }
  .stats { flex-wrap: wrap; }
  .week, .sites { grid-template-columns: 1fr; }
  .day.past { display: none; }
  .rugs { overflow-x: auto; }
  .rugs table { min-width: 52rem; }
  .clean { grid-template-columns: 1fr; }
  .progress { display: none; }
}
