/* Kitchen Watch: additions on top of style.css + dashboard.css */
:root { --l-bad: #E5484D; --l-warn: #F5A524; --l-info: #3B82F6; --heat0: #F3F4F6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --heat0: #161D27; } }
:root[data-theme="dark"] { --heat0: #161D27; }

.cam-card { padding: 14px; }
.cam-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.live-badge { font-size: 11px; font-weight: 800; color: #fff; background: #DC2626; border-radius: 5px; padding: 1px 7px; letter-spacing: .06em; }
.note-card { margin: 16px 0; font-size: 14px; color: var(--ink-2); }
.note-card p { margin: 0 0 8px; } .note-card p:last-child { margin: 0; }
.stackcol { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pad-x { padding: 0 20px 12px; }

/* video */
.vbox { position: relative; background: #0B0F14; border-radius: 10px; overflow: hidden; aspect-ratio: 640 / 426; }
.vbox video { width: 100%; height: 100%; object-fit: contain; }
.clock { position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,.66); color: #fff; font: 700 15px/1 "Figtree", sans-serif; font-variant-numeric: tabular-nums; padding: 7px 10px; border-radius: 8px; pointer-events: none; }
.clock:empty { display: none; }
.vmsg { position: absolute; inset: 0; display: grid; place-items: center; color: #E5E7EB; font-size: 15px; text-align: center; padding: 20px; background: rgba(11,15,20,.8); }
.ctl { display: flex; gap: 12px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.ctl .icon-btn { width: 44px; height: 44px; }
#l-play .i-play { display: none; } #l-play.paused .i-play { display: block; } #l-play.paused .i-pause { display: none; }
.jump { display: inline-flex; gap: 8px; align-items: center; }
.jump select { min-height: 38px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; padding: 0 10px; font: 600 14px inherit; font-family: inherit; }

/* live */
.live2 { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.now-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.now-h h3 { margin: 0; }
.now-img { margin: 10px 0; border-radius: 10px; overflow: hidden; cursor: zoom-in; aspect-ratio: 640/426; background: var(--bg); }
.now-img img { width: 100%; height: 100%; object-fit: cover; }
.now-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.now-stats div { background: var(--bg); border-radius: 10px; padding: 8px 12px; }
.now-stats b { display: block; font-size: 26px; font-weight: 300; line-height: 1.1; font-variant-numeric: tabular-nums; }
.now-stats span { font-size: 12px; color: var(--muted); font-weight: 600; }
.flags { display: flex; gap: 6px; flex-wrap: wrap; }
.feed { max-height: 420px; overflow: auto; margin-top: 8px; }
.feed .fi { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.feed .fi:first-child { border-top: 0; }
.feed .fi .t { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.feed .fi.new { animation: flash 2.4s ease-out; }
.feed .empty { padding: 16px 0; border: 0; }

/* lane dot */
.ld { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }

/* heatmap */
.heat { padding: 0 20px 18px; overflow-x: auto; }
.heat table { border-collapse: separate; border-spacing: 3px; width: 100%; min-width: 520px; font-size: 13px; }
.heat th { font-weight: 600; color: var(--muted); font-size: 12px; text-align: center; padding: 0 0 4px; font-variant-numeric: tabular-nums; }
.heat th.l { text-align: left; }
.heat td.l { white-space: nowrap; color: var(--ink-2); padding-right: 8px; }
.heat td.c { height: 30px; border-radius: 6px; background: var(--heat0); cursor: pointer; text-align: center; font-weight: 700; font-size: 12px; color: transparent; min-width: 34px; }
.heat td.c:hover { outline: 2px solid var(--ink); color: var(--ink); }
.heat td.c.on { outline: 2px solid var(--accent); color: var(--ink); }
.heat td.c.nv { background: repeating-linear-gradient(45deg, var(--heat0), var(--heat0) 4px, transparent 4px, transparent 8px); cursor: default; }
.heat td.c.nv:hover { outline: 0; }
.heat td.n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; padding-left: 8px; white-space: nowrap; }
.heat-key { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 0 20px 16px; }
.heat-key i { width: 22px; height: 10px; border-radius: 3px; display: block; }

/* moments list */
.mrow { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 20px; border-top: 1px solid var(--line); cursor: pointer; }
.mrow:hover { background: var(--bg); }
.mrow .th { width: 112px; aspect-ratio: 640/426; border-radius: 8px; overflow: hidden; background: var(--bg); position: relative; }
.mrow .th img { width: 100%; height: 100%; object-fit: cover; }
.mrow .th .vid { position: absolute; right: 4px; bottom: 4px; background: rgba(0,0,0,.65); color: #fff; font-size: 10px; font-weight: 700; border-radius: 4px; padding: 1px 5px; }
.mrow .nm { font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mrow .meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mrow .nt { font-size: 12px; color: var(--warn); margin-top: 2px; }
.mrow.done { opacity: .62; }
.mrow .stt { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* needs */
.need { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.need:first-of-type { border-top: 0; margin-top: 8px; }
.need small { display: block; color: var(--muted); font-size: 12px; }
.need .go { color: var(--accent); font-weight: 600; font-size: 13px; }
.allc { margin-top: 10px; padding: 12px; border-radius: 10px; background: var(--ok-soft); color: var(--ok); font-size: 14px; font-weight: 600; }

/* where bars */
.wbar { display: grid; grid-template-columns: 112px 1fr 30px; gap: 10px; align-items: center; padding: 6px 0; font-size: 14px; }
.wbar i { height: 8px; background: var(--bg); border-radius: 4px; position: relative; display: block; }
.wbar i b { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 4px; }
.wbar span:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
#where { margin-top: 8px; }

/* staff sparkline */
.spark { display: flex; align-items: flex-end; gap: 1px; height: 54px; margin-top: 12px; }
.spark i { flex: 1; background: var(--accent); opacity: .55; border-radius: 1px 1px 0 0; min-height: 1px; }

/* recording lanes */
.lanes { margin-top: 14px; display: grid; grid-template-columns: 170px minmax(0, 1fr) 36px; gap: 4px 10px; align-items: center; }
.lanes .lab { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 8px; align-items: center; }
.lanes .cnt { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.lane { position: relative; height: 20px; background: var(--bg); border-radius: 6px; cursor: pointer; overflow: hidden; }
.lane i { position: absolute; top: 3px; bottom: 3px; background: var(--c); border-radius: 3px; min-width: 4px; }
.lane i.sel { outline: 2px solid var(--ink); outline-offset: 1px; }
.lane u { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, transparent, transparent 3px, var(--line-2) 3px, var(--line-2) 4px); opacity: .7; }
.lane .cur, .axis .cur { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); pointer-events: none; }
.axis { position: relative; height: 18px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.hint { margin: 10px 0 0; }

/* drawer */
.drawer { width: min(640px, 100vw); }
.d-nav { display: flex; gap: 8px; }
.d-media { border-radius: 10px; overflow: hidden; background: #000; aspect-ratio: 640/426; }
.d-media video, .d-media img { width: 100%; height: 100%; object-fit: contain; }
.d-cap { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.d-title b { display: block; font-size: 18px; } .d-title small { color: var(--muted); font-size: 13px; }
.strip2 { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.strip2 button { flex: none; width: 96px; border: 2px solid transparent; border-radius: 8px; padding: 0; background: none; cursor: pointer; overflow: hidden; }
.strip2 button.on { border-color: var(--accent); }
.strip2 img { width: 100%; aspect-ratio: 640/426; object-fit: cover; }
.strip2 span { display: block; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; padding: 2px 0; }
.dnote { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 13px; }
.keys { font-size: 12px; color: var(--muted); margin-top: 14px; }
.keys kbd { border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; font: 600 11px inherit; font-family: inherit; }

/* rules table */
.rtab { width: 100%; border-collapse: collapse; font-size: 14px; }
.rtab th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.rtab td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.rtab td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rtab th.n { text-align: right; }
.rtab small { display: block; color: var(--muted); font-size: 13px; }

@media (max-width: 1100px) { .live2 { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .mrow { grid-template-columns: 92px minmax(0, 1fr); padding: 10px 16px; }
  .mrow .th { width: 92px; }
  .mrow .stt { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; }
  .lanes { grid-template-columns: 1fr 30px; }
  .lanes .lab { grid-column: 1 / -1; margin-top: 6px; }
  .lanes .axis-pad { display: none; }
  .heat { padding: 0 12px 14px; }
  .rtab .hide-m { display: none; }
  .card-h .seg { width: 100%; } .card-h .seg button { flex: 1; }
  .pad-x { padding: 0 16px 12px; }
}

/* fixes */
.vmsg[hidden] { display: none; }
.cols, .live2 { grid-template-columns: minmax(0, 1fr) 340px; }
.card, .rail, .stackcol { min-width: 0; }
.kpi .v small.in { display: inline; }
.sofar { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 14px; }
.sofar div { background: var(--bg); border-radius: 10px; padding: 8px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.sofar b { font-size: 20px; font-weight: 400; font-variant-numeric: tabular-nums; color: var(--ink); }
.sofar div.z b { color: var(--muted); }
@media (max-width: 1100px) { .cols, .live2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .bar-r .btn { padding: 0 10px; }
  .tabs button span { white-space: nowrap; }
  .sofar { grid-template-columns: 1fr 1fr; }
}
.toast button { color: #5EEAD4; }
