/*
 * RF Shotlist styles. VARIANT C "Tally". Designed by Fable 5.1.
 *
 * Concept: the broadcast tally light. RecFocus red is the live signal: the
 * count sits in a red pill, the focused row carries a red tally bar and a
 * heavy white ring, the detail screen's shot number is a red slate. Purple
 * is reserved for the action you take (Done, Back). Heavy weights, big
 * rounded geometry, and everything else stays black and silent.
 *
 * Complete replacement for app/styles.css. Every class and selector the app
 * uses is kept. Display is additive: pure black renders as transparent.
 */
:root {
  /* RecFocus brand palette (only these, plus tints / opacity) */
  --rf-white: #FFFFFF;
  --rf-black: #000000;
  --rf-gray: #2D2D2D;
  --rf-red: #E8222C;
  --rf-purple: #653DF4;

  /* Semantic colors */
  --color-bg: var(--rf-black);
  --color-text: var(--rf-white);
  --color-text-dim: rgba(255, 255, 255, 0.68);
  --color-accent: var(--rf-purple);
  --color-signal: var(--rf-red);
  --color-danger: var(--rf-red);
  --color-focus-ring: var(--rf-white);
  --color-row-focus-bg: rgba(232, 34, 44, 0.20);
  --color-divider: rgba(255, 255, 255, 0.22);

  /* Category tags: each category its own color AND treatment */
  --tag-a-bg: var(--rf-purple);
  --tag-a-fg: var(--rf-white);
  --tag-a-border: var(--rf-purple);
  --tag-b-bg: var(--rf-red);
  --tag-b-fg: var(--rf-white);
  --tag-b-border: var(--rf-red);
  --tag-drone-bg: var(--rf-white);
  --tag-drone-fg: var(--rf-black);
  --tag-drone-border: var(--rf-white);
  --tag-audio-bg: var(--rf-black);
  --tag-audio-fg: #B9A6FB;          /* purple tint, double outline treatment */
  --tag-audio-border: #B9A6FB;
  --tag-other-bg: var(--rf-gray);
  --tag-other-fg: rgba(255, 255, 255, 0.85);
  --tag-other-border: rgba(255, 255, 255, 0.5);

  /* Type */
  --font: -apple-system, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Roboto, Arial, sans-serif;
  --fs-header: 26px;
  --fs-body: 30px;
  --fs-meta: 24px;
  --fs-num: 30px;
  --fs-detail-title: 42px;
  --fs-message: 48px;
  --fs-tag: 19px;
  --fw-normal: 600;
  --fw-focus: 800;

  /* Layout (viewport is a fixed 600x600 square) */
  --viewport: 600px;
  --safe: 32px;
  --header-h: 52px;
  --header-gap: 10px;
  --row-h: 88px;            /* platform minimum target height */
  --row-gap: 4px;
  --picker-row-h: 108px;
  --row-pad-x: 20px;
  --num-w: 64px;
  --radius: 20px;
  --focus-ring-w: 4px;
  --accent-bar-w: 10px;
  --button-h: 88px;
  --button-gap: 14px;
  --icon: 30px;

  /* States */
  --done-opacity: 0.4;
  --dur: 150ms;
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur: 0ms; }
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: var(--viewport);
  height: var(--viewport);
  overflow: hidden;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  font-weight: var(--fw-normal);
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
}

.app {
  position: absolute;
  top: var(--safe);
  left: var(--safe);
  width: calc(var(--viewport) - 2 * var(--safe));
  height: calc(var(--viewport) - 2 * var(--safe));
  overflow: hidden;
}

.screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.icon {
  width: var(--icon);
  height: var(--icon);
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Header: heavy title, the count is a red tally pill */
.header {
  flex: none;
  height: var(--header-h);
  margin-bottom: var(--header-gap);
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: var(--fs-header);
  line-height: 1.2;
  border-bottom: 1px solid var(--color-divider);
}
.header__title {
  margin: 0;
  font-size: inherit;
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header__count {
  flex: none;
  padding: 4px 18px 5px;
  margin-bottom: 6px;
  color: var(--color-text);
  background: var(--color-signal);
  border-radius: 999px;
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Scrolling list (scrolled by JS, never by the page) */
.list {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
  position: relative;
}

.row {
  height: var(--row-h);
  margin-bottom: var(--row-gap);
  padding: 0 var(--row-pad-x);
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: var(--fs-body);
  line-height: 1.15;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: background-color var(--dur) ease, box-shadow var(--dur) ease;
}
.focusable:focus { outline: none; }  /* ring is drawn by .is-focused, kept in sync with DOM focus */
.row.is-focused,
.row:focus-visible {
  font-weight: var(--fw-focus);
  background: var(--color-row-focus-bg);
  box-shadow: inset 0 0 0 var(--focus-ring-w) var(--color-focus-ring);
}
/* Tally bar: a solid red cap on the left edge of the ring */
.row.is-focused::before,
.row:focus-visible::before {
  content: "";
  position: absolute;
  left: var(--focus-ring-w);
  top: var(--focus-ring-w);
  bottom: var(--focus-ring-w);
  width: var(--accent-bar-w);
  border-radius: calc(var(--radius) - var(--focus-ring-w)) 0 0 calc(var(--radius) - var(--focus-ring-w));
  background: var(--color-signal);
  transform-origin: left center;
  animation: rf-tally-in var(--dur) ease-out;
}
@keyframes rf-tally-in {
  from { transform: scaleY(0.2); opacity: 0; }
  to   { transform: scaleY(1); opacity: 1; }
}
/* Done: dim the CONTENT, not the row, so a focused done row keeps a full
   brightness focus ring. */
.row.is-done > * { opacity: var(--done-opacity); }

.row__num {
  flex: none;
  width: var(--num-w);
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-num);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
}
.row__check { color: var(--color-text); }
.row__title {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Done rows get a wider number column so the check mark fits beside it */
.row.is-done .row__num { width: calc(var(--num-w) + var(--icon)); }

.list__empty {
  margin: 0;
  font-size: var(--fs-body);
  color: var(--color-text-dim);
}

/* Picker rows: two lines */
.row--shoot {
  height: var(--picker-row-h);
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 4px;
}
.row--shoot .row__title { flex: none; font-size: 34px; font-weight: 800; letter-spacing: -0.01em; }
.row__meta {
  font-size: var(--fs-meta);
  font-weight: var(--fw-normal);
  color: var(--color-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row__meta--error { color: var(--color-danger); }

/* Tag chips: chunky, uppercase, rounded slate labels */
.tag {
  flex: none;
  max-width: 150px;
  padding: 5px 11px;
  border: 3px solid transparent;
  border-radius: 10px;
  font-size: var(--fs-tag);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tag--a     { background: var(--tag-a-bg);     color: var(--tag-a-fg);     border-color: var(--tag-a-border); }
.tag--b     { background: var(--tag-b-bg);     color: var(--tag-b-fg);     border-color: var(--tag-b-border); }
.tag--drone { background: var(--tag-drone-bg); color: var(--tag-drone-fg); border-color: var(--tag-drone-border); }
.tag--audio { background: var(--tag-audio-bg); color: var(--tag-audio-fg); border-color: var(--tag-audio-border); border-style: double; border-width: 4px; padding: 4px 12px; }
.tag--other { background: var(--tag-other-bg); color: var(--tag-other-fg); border-color: var(--tag-other-border); border-style: dashed; }

/* Detail card: red slate number, heavy title */
.detail {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
}
.detail__top {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: var(--fs-header);
}
.detail__num {
  padding: 4px 16px 5px;
  font-size: 24px;
  font-weight: 800;
  color: var(--color-text);
  background: var(--color-signal);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.detail__status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-weight: 800;
}
.detail__title {
  margin: 0;
  font-size: var(--fs-detail-title);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.015em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow-wrap: anywhere;
}
.detail__note {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Buttons: pills. Focus fills purple (action), danger fills red. */
.buttons {
  flex: none;
  margin-top: auto;
  display: flex;
  gap: var(--button-gap);
}
.buttons--stack { flex-direction: column; }
.button {
  flex: 1 1 0;
  min-width: 0;
  min-height: var(--button-h);
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font: inherit;
  font-size: var(--fs-body);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.005em;
  text-align: center;
  color: var(--color-text);
  background: var(--color-bg);
  border: 3px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color var(--dur) ease, border-color var(--dur) ease, box-shadow var(--dur) ease;
}
.button.is-focused,
.button:focus-visible {
  font-weight: var(--fw-focus);
  background: rgba(101, 61, 244, 0.72);
  border-color: var(--color-focus-ring);
  box-shadow: inset 0 0 0 1px var(--color-focus-ring);
}
.button--danger { color: rgba(255, 255, 255, 0.85); }
.button--danger.is-focused { color: var(--color-text); background: rgba(232, 34, 44, 0.78); }
.button.is-armed { border-style: dashed; }

/* Complete + message screens */
.complete, .message {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.complete__icon { width: 80px; height: 80px; color: var(--color-signal); stroke-width: 2.5; }
.message__icon { width: 80px; height: 80px; color: var(--color-danger); stroke-width: 2.5; }
.complete__title, .message__title {
  margin: 0;
  font-size: var(--fs-message);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.complete__sub, .message__body {
  margin: 0;
  font-size: 26px;
  color: var(--color-text-dim);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.complete .buttons, .message .buttons { width: 100%; }
.screen--loading { justify-content: center; }
.screen--loading .message__title { font-size: var(--fs-header); font-weight: 800; color: var(--color-text-dim); }
