/* Work Playbook — mobile/tablet first, big + high-contrast for reading at
   arm's length in the kitchen. Self-contained (no shared stylesheet). */
:root {
  --pb-bg: #12100c;
  --pb-card: #1c1a15;
  --pb-border: #322d20;
  --pb-gold: #c9a84c;
  --pb-gold-light: #e8c97a;
  --pb-text: #f3efe6;
  --pb-muted: #a89e86;
  --pb-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --pb-serif: 'Cormorant Garamond', Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
.pb-body {
  background: var(--pb-bg);
  color: var(--pb-text);
  font-family: var(--pb-sans);
  -webkit-text-size-adjust: 100%;
  padding-bottom: 3rem;
}

/* ── Password gate ───────────────────────────────────────────────────── */
/* When locked, hide the playbook and show the gate. */
.pb-locked .pb-topbar, .pb-locked .pb-main { display: none; }
.pb-gate { display: none; }
.pb-locked .pb-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}
.pb-gate-card {
  width: 100%;
  max-width: 340px;
  text-align: center;
  background: var(--pb-card);
  border: 1px solid var(--pb-border);
  border-radius: 14px;
  padding: 2rem 1.5rem;
}
.pb-gate-logo { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; }
.pb-gate-title {
  margin: 1rem 0 0.2rem;
  font-family: var(--pb-serif);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--pb-gold-light);
}
.pb-gate-sub { margin: 0 0 1.2rem; color: var(--pb-muted); font-size: 0.95rem; }
.pb-gate-input {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1.1rem;
  border: 1px solid var(--pb-border);
  border-radius: 10px;
  background: #100e0a;
  color: var(--pb-text);
  text-align: center;
  margin-bottom: 0.8rem;
}
.pb-gate-input:focus { outline: none; border-color: var(--pb-gold); }
.pb-gate-btn {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--pb-sans);
  color: #1a1a1a;
  background: var(--pb-gold);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  touch-action: manipulation;
}
.pb-gate-err { margin: 0.8rem 0 0; color: #e85c5c; font-size: 0.9rem; }

/* ── Top bar (sticky) ─────────────────────────────────────────────────── */
.pb-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(18, 16, 12, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--pb-border);
}
.pb-topbar-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.7rem 1rem;
  flex-wrap: wrap;
}
.pb-logo { width: 46px; height: 46px; border-radius: 8px; flex-shrink: 0; object-fit: cover; }
.pb-titles { flex: 1 1 auto; min-width: 0; }
.pb-heading {
  margin: 0;
  font-family: var(--pb-serif);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--pb-gold-light);
  line-height: 1.1;
}
.pb-sub { margin: 0.15rem 0 0; font-size: 0.85rem; color: var(--pb-muted); }

/* Language toggle */
.pb-lang {
  display: inline-flex;
  border: 1px solid var(--pb-border);
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}
.pb-lang-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--pb-muted);
  font-family: var(--pb-sans);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.pb-lang-btn.active {
  background: var(--pb-gold);
  color: #1a1a1a;
}

/* ── Cards ────────────────────────────────────────────────────────────── */
.pb-main { max-width: 760px; margin: 0 auto; padding: 1.1rem 1rem 0; }
.pb-card {
  background: var(--pb-card);
  border: 1px solid var(--pb-border);
  border-left: 5px solid var(--pb-gold);
  border-radius: 12px;
  padding: 1.1rem 1.1rem 0.6rem;
  margin-bottom: 1.4rem;
}
.pb-card-title {
  margin: 0;
  font-family: var(--pb-serif);
  font-size: 2rem;
  font-weight: 600;
  color: var(--pb-text);
  line-height: 1.1;
}
.pb-card-note {
  margin: 0.35rem 0 0.8rem;
  font-size: 1rem;
  color: var(--pb-gold-light);
  font-style: italic;
}
.pb-steps { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.pb-step {
  display: flex;
  gap: 0.9rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--pb-border);
}
.pb-step:first-child { border-top: none; }
.pb-step-num {
  flex-shrink: 0;
  min-width: 74px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--pb-gold);
  padding-top: 0.2rem;
}
.pb-step-body { flex: 1 1 auto; min-width: 0; }
.pb-step-text {
  font-size: 1.25rem;
  line-height: 1.45;
  color: var(--pb-text);
}
.pb-step-img {
  display: block;
  width: 100%;
  max-width: 320px;
  margin-top: 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--pb-border);
}
.pb-step-img-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 90px;
  color: var(--pb-muted);
  background: rgba(255, 255, 255, 0.03);
  border-style: dashed;
  font-size: 0.9rem;
  gap: 0.4rem;
}

@media (min-width: 620px) {
  .pb-heading { font-size: 2rem; }
  .pb-card-title { font-size: 2.3rem; }
  .pb-step-text { font-size: 1.35rem; }
}

/* ── Time clock card ─────────────────────────────────────────────────────
   Big, unmissable tap targets for the kitchen tablet. */
.pb-clock-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--pb-card);
  border: 1px solid var(--pb-border);
  border-left: 5px solid var(--pb-gold);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.4rem;
}
.pb-clock-card.is-in { border-left-color: #3ecf6a; }
.pb-clock-status { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.pb-clock-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: #3ecf6a; box-shadow: 0 0 10px rgba(62, 207, 106, 0.7);
  flex: 0 0 auto;
}
.pb-clock-dot-off { background: #6b6555; box-shadow: none; }
.pb-clock-dot-done {
  width: auto; height: auto; box-shadow: none; background: none;
  color: #3ecf6a; font-size: 1.6rem; font-weight: 700;
}
.pb-clock-lines { min-width: 0; }
.pb-clock-name { font-weight: 700; font-size: 1.15rem; color: var(--pb-text); }
.pb-clock-since { color: var(--pb-muted); font-size: 1rem; }
.pb-clock-elapsed { color: var(--pb-text); font-size: 1rem; margin-top: 0.1rem; }
.pb-clock-elapsed strong { color: var(--pb-gold-light); }
.pb-clock-btn {
  border: none;
  border-radius: 12px;
  padding: 0.9rem 1.6rem;
  font-family: var(--pb-sans);
  font-size: 1.25rem;
  font-weight: 700;
  color: #12100c;
  cursor: pointer;
  flex: 1 1 auto;
  min-height: 60px;
  transition: transform 0.08s ease, filter 0.15s ease;
}
.pb-clock-btn:active { transform: scale(0.97); }
.pb-clock-btn:disabled { opacity: 0.6; cursor: default; }
.pb-clock-btn-in { background: linear-gradient(180deg, #4ade80, #22c55e); }
.pb-clock-btn-out { background: linear-gradient(180deg, #fb7185, #ef4444); color: #fff; }
@media (min-width: 620px) {
  .pb-clock-btn { flex: 0 0 auto; }
  .pb-clock-name { font-size: 1.3rem; }
}

/* ── Dashboard (job categories) ──────────────────────────────────────── */
.pb-back {
  background: var(--pb-card); color: var(--pb-gold-light);
  border: 1px solid var(--pb-border); border-radius: 999px;
  padding: 0.55rem 1.1rem; font-size: 1rem; font-weight: 600; cursor: pointer;
  margin-right: 0.5rem; flex-shrink: 0;
}
.pb-back:active { transform: scale(0.97); }
.pb-tiles {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem; padding: 0.4rem 0;
}
.pb-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.7rem; min-height: 150px; padding: 1.5rem 1rem;
  background: var(--pb-card); border: 1px solid var(--pb-border); border-radius: 16px;
  color: var(--pb-text); cursor: pointer; transition: transform .1s, border-color .15s;
}
.pb-tile:active { transform: scale(0.97); }
.pb-tile:hover { border-color: var(--pb-gold); }
.pb-tile-icon { font-size: 3.2rem; line-height: 1; }
.pb-tile-name { font-size: 1.2rem; font-weight: 700; text-align: center; }

/* ── Platters to make ────────────────────────────────────────────────── */
.pb-loading, .pb-empty { color: var(--pb-muted); text-align: center; padding: 2rem 1rem; font-size: 1.05rem; }
.pb-platters { display: flex; flex-direction: column; gap: 0.9rem; }
.pb-platter {
  background: var(--pb-card); border: 1px solid var(--pb-border); border-radius: 14px;
  padding: 0.9rem; transition: opacity .2s;
}
.pb-platter-done { opacity: 0.5; }
.pb-platter-top { display: flex; align-items: center; gap: 0.9rem; }
.pb-platter-img {
  width: 86px; height: 86px; border-radius: 10px; object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--pb-border); cursor: zoom-in; background: #000;
}
.pb-platter-img-empty { display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.pb-platter-info { flex: 1; min-width: 0; }
.pb-platter-name { font-size: 1.35rem; font-weight: 700; font-family: var(--pb-serif); color: var(--pb-gold-light); }
.pb-platter-sub { color: var(--pb-muted); font-size: 0.95rem; margin-top: 0.15rem; }
.pb-platter-made { color: var(--pb-text); }
.pb-platter-badge {
  flex-shrink: 0; min-width: 78px; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(201,168,76,0.12); border: 1px solid rgba(201,168,76,0.35);
  border-radius: 10px; padding: 0.5rem 0.5rem; color: var(--pb-gold-light);
}
.pb-platter-badge-done { background: rgba(76,175,80,0.16); border-color: rgba(76,175,80,0.4); color: #9fe0a2; }
.pb-platter-left-num { font-size: 2rem; font-weight: 800; line-height: 1; }
.pb-platter-left-lbl { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }
.pb-platter-actions { display: flex; gap: 0.6rem; margin-top: 0.85rem; }
.pb-made-btn {
  flex: 1; background: var(--pb-gold); color: #1a1610; border: none; border-radius: 12px;
  padding: 0.95rem; font-size: 1.15rem; font-weight: 800; cursor: pointer;
}
.pb-made-btn:active { transform: scale(0.98); }
.pb-made-minus {
  width: 62px; background: var(--pb-card); color: var(--pb-muted);
  border: 1px solid var(--pb-border); border-radius: 12px; font-size: 1.9rem; line-height: 1; cursor: pointer;
}
.pb-made-minus:active { transform: scale(0.96); }

/* ── Platter photo enlarge modal ─────────────────────────────────────── */
.pb-photo-modal { position: fixed; inset: 0; z-index: 4000; display: flex; align-items: center; justify-content: center; }
.pb-photo-modal[hidden] { display: none; }
.pb-photo-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.85); }
.pb-photo-modal-card {
  position: relative; z-index: 1; max-width: min(92vw, 640px); max-height: 92vh;
  background: var(--pb-card); border: 1px solid var(--pb-border); border-radius: 14px;
  padding: 1rem; display: flex; flex-direction: column; align-items: center; gap: 0.8rem;
}
.pb-photo-modal-close {
  position: absolute; top: 0.5rem; right: 0.5rem; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--pb-border); background: rgba(0,0,0,0.5); color: #fff; font-size: 1.2rem; cursor: pointer;
}
.pb-photo-modal-title { font-family: var(--pb-serif); font-size: 1.5rem; color: var(--pb-gold-light); font-weight: 700; }
.pb-photo-modal-img { max-width: 100%; max-height: 68vh; border-radius: 10px; object-fit: contain; }
.pb-photo-modal-thumbs { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.pb-photo-modal-thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid transparent; opacity: 0.6; }
.pb-photo-modal-thumb.active, .pb-photo-modal-thumb:hover { border-color: var(--pb-gold); opacity: 1; }

/* ── Shared tool bits (stopwatch + amounts) ──────────────────────────── */
.pb-tool-hint { color: var(--pb-muted); font-size: 0.95rem; margin: 0 0 1rem; line-height: 1.4; }
.pb-input {
  width: 100%; padding: 0.85rem 0.9rem; font-size: 1.05rem;
  background: #14120d; color: var(--pb-text); border: 1px solid var(--pb-border);
  border-radius: 10px; font-family: var(--pb-sans);
}
.pb-input:focus { outline: none; border-color: var(--pb-gold); }
.pb-btn-gold { background: var(--pb-gold); color: #1a1610; border: none; border-radius: 12px; padding: 0.9rem 1.2rem; font-size: 1.1rem; font-weight: 800; cursor: pointer; }
.pb-btn-gold:active { transform: scale(0.98); }
.pb-btn-block { width: 100%; }
.pb-btn-ghost { background: var(--pb-card); color: var(--pb-muted); border: 1px solid var(--pb-border); border-radius: 12px; padding: 0.9rem 1.2rem; font-size: 1.05rem; cursor: pointer; }

/* Stopwatch */
.pb-sw { display: flex; flex-direction: column; align-items: center; gap: 1.3rem; padding: 1.5rem 0 0.5rem; }
.pb-sw-time { font-size: 4.2rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--pb-gold-light); letter-spacing: 1px; }
.pb-sw-btn { width: 100%; max-width: 320px; border: none; border-radius: 16px; padding: 1.3rem; font-size: 1.6rem; font-weight: 800; cursor: pointer; color: #fff; }
.pb-sw-btn:active { transform: scale(0.98); }
.pb-sw-start { background: linear-gradient(180deg, #34d399, #059669); }
.pb-sw-stop { background: linear-gradient(180deg, #fb7185, #e11d48); }
.pb-sw-note { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 0.7rem; }
.pb-sw-note-actions { display: flex; gap: 0.6rem; }
.pb-sw-note-actions .pb-btn-ghost { flex: 0 0 auto; }
.pb-sw-note-actions .pb-btn-gold { flex: 1; }

/* Amounts form */
.pb-form { display: flex; flex-direction: column; gap: 0.9rem; margin-bottom: 1.5rem; }
.pb-field { display: flex; flex-direction: column; gap: 0.35rem; }
.pb-field > span { font-size: 0.85rem; color: var(--pb-muted); font-weight: 600; }
.pb-field-row { display: flex; gap: 0.7rem; }
.pb-field-amt { flex: 1.2; }
.pb-field-unit { flex: 1; }
.pb-am-status { color: var(--pb-gold-light); font-size: 0.9rem; min-height: 1.1rem; }

/* Slicing timers */
/* Quick-start rows: tap a fish's minute chip to launch a timer */
.pb-timer-starters { display: flex; flex-direction: column; gap: 0.8rem; margin-bottom: 1.3rem; }
.pb-timer-starter {
  background: var(--pb-card); border: 1px solid var(--pb-border); border-radius: 16px;
  padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.6rem;
}
.pb-timer-starter-fish { display: flex; align-items: center; gap: 0.5rem; font-size: 1.25rem; font-weight: 800; color: var(--pb-text); }
.pb-timer-icon { font-size: 1.4rem; }
.pb-timer-name { font-weight: 800; color: var(--pb-text); }
.pb-timer-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 0.45rem; }
.pb-timer-chip {
  min-width: 52px; padding: 0.65rem 0.7rem; border-radius: 12px;
  border: 1px solid rgba(201,168,76,0.4); background: rgba(201,168,76,0.10);
  color: var(--pb-gold-light); font-size: 1.15rem; font-weight: 800; cursor: pointer;
}
.pb-timer-chip:active { transform: scale(0.96); background: rgba(201,168,76,0.22); }
.pb-timer-min-lbl { color: var(--pb-muted); font-size: 0.85rem; margin-left: 0.15rem; }

/* Running-timers list */
.pb-timer-active-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--pb-muted); margin-bottom: 0.6rem; }
.pb-timers { display: flex; flex-direction: column; gap: 0.7rem; }
.pb-timer {
  background: var(--pb-card); border: 1px solid var(--pb-border); border-radius: 16px;
  padding: 0.8rem 1rem; display: flex; align-items: center; gap: 0.8rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pb-timer-active-info { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; min-width: 0; }
.pb-timer-active-info .pb-timer-name { font-size: 1.25rem; }
.pb-timer-active-min { color: var(--pb-muted); font-size: 0.85rem; }
.pb-timer-time {
  font-size: 2.4rem; font-weight: 800; font-variant-numeric: tabular-nums;
  color: var(--pb-gold-light); letter-spacing: 1px; line-height: 1; flex-shrink: 0;
}
.pb-timer-btn {
  border: none; border-radius: 12px; padding: 0.75rem 1rem; font-size: 1rem;
  font-weight: 800; cursor: pointer; color: #fff; flex-shrink: 0;
}
.pb-timer-btn:active { transform: scale(0.98); }
.pb-timer-cancel { background: rgba(255,255,255,0.06); color: var(--pb-text); border: 1px solid var(--pb-border); }
.pb-timer-slice { background: linear-gradient(180deg, #fb7185, #e11d48); }
.pb-timer-empty { color: var(--pb-muted); padding: 0.8rem 0; font-size: 0.95rem; }
.pb-timer-running { border-color: rgba(52,211,153,0.5); }
.pb-timer-running .pb-timer-time { color: #6ee7b7; }
.pb-timer-ringing {
  border-color: #fb7185; box-shadow: 0 0 0 3px rgba(251,113,133,0.25);
  animation: pb-timer-flash 0.9s ease-in-out infinite;
}
.pb-timer-ringing .pb-timer-time { color: #fda4af; }
@keyframes pb-timer-flash {
  0%, 100% { box-shadow: 0 0 0 3px rgba(251,113,133,0.20); }
  50%      { box-shadow: 0 0 0 6px rgba(251,113,133,0.45); }
}
@media (prefers-reduced-motion: reduce) { .pb-timer-ringing { animation: none; } }

/* Cross-view "time to slice" banner (pinned top) */
.pb-timer-alarm {
  position: fixed; top: 0; left: 0; right: 0; z-index: 7000;
  background: linear-gradient(180deg, #e11d48, #9f1239);
  display: flex; flex-direction: column;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  animation: pb-alarm-pulse 1s ease-in-out infinite;
}
.pb-timer-alarm-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  padding: 0.85rem 1rem; max-width: 720px; margin: 0 auto; width: 100%;
}
.pb-timer-alarm-msg { color: #fff; font-weight: 800; font-size: 1.15rem; }
.pb-timer-alarm-btn {
  border: none; border-radius: 12px; padding: 0.7rem 1.1rem; font-size: 1.05rem;
  font-weight: 800; cursor: pointer; background: #fff; color: #9f1239; flex-shrink: 0;
}
.pb-timer-alarm-btn:active { transform: scale(0.97); }
@keyframes pb-alarm-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.82; } }
@media (prefers-reduced-motion: reduce) { .pb-timer-alarm { animation: none; } }

/* Shared log list (today's timings / recent measurements) */
.pb-log { border-top: 1px solid var(--pb-border); padding-top: 1rem; }
.pb-log-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--pb-muted); margin-bottom: 0.6rem; }
.pb-log-row { display: flex; gap: 0.8rem; align-items: baseline; padding: 0.5rem 0; border-bottom: 1px solid rgba(50,45,32,0.5); }
.pb-log-dur, .pb-log-amt { font-weight: 800; color: var(--pb-gold-light); font-variant-numeric: tabular-nums; flex-shrink: 0; min-width: 74px; }
.pb-log-what { color: var(--pb-text); font-size: 0.95rem; }
.pb-log-empty { color: var(--pb-muted); }
