@font-face { font-family:"Pacifico"; src:url("https://cdn.jsdelivr.net/npm/@fontsource/pacifico@5.0.3/files/pacifico-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family:"Fredoka"; src:url("https://cdn.jsdelivr.net/npm/@fontsource/fredoka-one@4.5.5/files/fredoka-one-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family:"Lora"; font-weight:400; src:url("https://cdn.jsdelivr.net/npm/@fontsource/lora@5.0.15/files/lora-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family:"Lora"; font-weight:700; src:url("https://cdn.jsdelivr.net/npm/@fontsource/lora@5.0.15/files/lora-latin-700-normal.woff2") format("woff2"); }

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

body {
  font-family: "Fredoka", "Arial Rounded MT Bold", Arial, sans-serif;
  background: #f5f2eb;
  color: #1a1a2e;
  min-height: 100vh;
}

/* ── Loading screen ── */
#loadingScreen {
  position: fixed; inset: 0;
  background: #1a1a2e;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 9999;
}
.loading-scene {
  position: relative;
  width: 100%; height: 160px;
}
.loading-swan-track {
  position: absolute;
  top: 40%;
  animation: swimAcross 4s ease-in-out infinite;
}
.loading-swan {
  width: 80px; height: 80px;
  object-fit: contain;
  animation: swanBob 1.2s ease-in-out infinite;
  position: relative; z-index: 2;
}
@keyframes swimAcross {
  0%   { left: -100px; }
  50%  { left: 50%; }
  100% { left: calc(100% + 100px); }
}
@keyframes swanBob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-6px) rotate(2deg); }
}

/* Ripples behind the swan */
.swan-ripple {
  position: absolute;
  bottom: 8px; left: 40px;
  width: 12px; height: 12px;
  border: 2px solid rgba(0,188,200,0.5);
  border-radius: 50%;
  animation: rippleOut 1.5s ease-out infinite;
}
.ripple-2 { animation-delay: 0.4s; }
.ripple-3 { animation-delay: 0.8s; }
@keyframes rippleOut {
  0%   { width: 10px; height: 6px; opacity: 0.7; }
  100% { width: 60px; height: 20px; opacity: 0; }
}

/* Wave SVG at the bottom of the scene */
.loading-waves {
  position: absolute;
  bottom: 0; left: 0; width: 200%; height: 60px;
  animation: waveDrift 3s linear infinite;
}
.loading-waves svg { width: 100%; height: 100%; }
.wave { fill: rgba(0,188,200,0.2); }
.wave-1 { animation: waveFloat 2s ease-in-out infinite; }
.wave-2 { animation: waveFloat 2.5s ease-in-out infinite reverse; fill: rgba(0,160,180,0.12); }
@keyframes waveDrift {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes waveFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.loading-fact {
  text-align: center;
  max-width: 400px;
  margin: 0 auto 20px;
  padding: 0 20px;
}
.loading-fact-heading {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: "Fredoka", sans-serif;
  font-size: 10px; text-transform: uppercase;
  letter-spacing: 2px; color: #9999bb;
  margin-bottom: 8px;
}
.loading-fact-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: #9999bb; color: #1a1a2e;
  font-size: 10px; font-weight: 700;
  flex-shrink: 0;
}
.loading-fact-text {
  font-family: "Lora", serif;
  font-size: 15px; font-weight: 700;
  color: #ffffff; line-height: 1.5;
}
.loading-bottom {
  text-align: center;
  margin-top: 20px;
}
.loading-text {
  font-family: "Fredoka", sans-serif;
  font-size: 14px; color: #667799;
  margin-bottom: 24px;
}
.loading-bar {
  width: 200px; height: 3px;
  background: #2a2a44; border-radius: 2px;
  margin: 0 auto; overflow: hidden;
}
.loading-bar-fill {
  height: 100%; width: 0%;
  background: #f5c842; border-radius: 2px;
  animation: loadProgress 8s ease-out forwards;
}
@keyframes loadProgress { 0%{width:0%} 60%{width:70%} 90%{width:88%} 100%{width:95%} }

/* ── Error screen ── */
#errorScreen {
  position: fixed; inset: 0;
  background: #1a1a2e;
  display: flex; align-items: center; justify-content: center;
}
.error-inner { text-align: center; padding: 40px; }
.error-title { font-family:"Lora",serif; font-size:24px; color:#e05050; margin-bottom:12px; }
.error-msg { font-family:"Fredoka",sans-serif; font-size:14px; color:#667799; margin-bottom:24px; max-width:400px; }
.error-inner button {
  background: #f5c842; border: none; border-radius: 6px;
  padding: 10px 24px; font-family:"Fredoka",sans-serif;
  font-size: 14px; cursor: pointer; color: #1a1a2e;
}

/* ── Header ── */
.header {
  background: #1a1a2e;
  border-bottom: none;
  position: sticky; top: 0; z-index: 100;
  padding: 8px 28px;
}

/* ── Top nav ── */
.top-nav { display:flex; align-items:center; gap:8px; width:100%; }
.top-nav-home { background:none; border:none; color:#f5f2eb; font-size:24px; cursor:pointer; padding:4px 10px 4px 0; opacity:0.7; transition:opacity .15s; }
.top-nav-home:hover { opacity:1; }
.top-nav-pill { display:none; }
.top-nav-pill:hover { border-color:rgba(255,255,255,0.4); color:#f5f2eb; }
.top-nav-pill.active { background:#f5f2eb; color:#1a1a2e; border-color:#f5f2eb; }

/* Burger menu (homepage only) */
.top-nav-burger { display:block; background:none; border:none; color:#f5f2eb; font-size:24px; cursor:pointer; padding:4px 8px; opacity:0.7; transition:opacity .15s; }
.top-nav-burger:hover { opacity:1; }
.burger-menu { position:absolute; top:100%; left:28px; background:#1a1a2e; border:2px solid #2a2a44; border-radius:8px; padding:8px; flex-direction:column; gap:4px; box-shadow:0 8px 24px rgba(0,0,0,0.3); z-index:200; }
.burger-item { background:none; border:none; color:#f5f2eb; font-family:"Fredoka",sans-serif; font-size:14px; padding:10px 20px; cursor:pointer; text-align:left; border-radius:6px; transition:background .15s; white-space:nowrap; }
.burger-item:hover { background:#2a2a44; }

/* ── Sub nav bar ── */
.sub-nav-bar { background:#fff; border-bottom:2px solid #e8e4d8; padding:8px 28px; position:sticky; top:48px; z-index:99; }
.header-status {
  font-family: "Fredoka", sans-serif;
  font-size: 12px; color: #666677;
  font-weight: 700; white-space: nowrap;
  margin-left: auto;
}

/* ── Pill nav ── */
.pill-nav {
  display: flex; align-items: center;
  gap: 8px; overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.pill-nav::-webkit-scrollbar { display: none; }
.pill-divider { width: 1px; height: 20px; background: #e0dcd0; flex-shrink: 0; margin: 0 4px; }
.pill {
  background: #f5f2eb; border: 2px solid #e8e4d8;
  border-radius: 50px;
  padding: 8px 18px;
  font-family: "Fredoka", sans-serif;
  font-size: 13px; font-weight: 700;
  color: #666677; cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
  transition: all .2s ease;
}
.pill:hover { background: #eae6dd; border-color: #d0ccc0; color: #1a1a2e; }
.roster-top-pill { background:transparent; border-color:rgba(255,255,255,0.5); color:rgba(255,255,255,0.8); padding:6px 14px; font-size:12px; }
.roster-top-pill:hover { background:rgba(255,255,255,0.15); border-color:#fff; color:#fff; }
.roster-top-pill.active { background:#fff; border-color:#fff; color:#1a1a2e; }
.pill.active {
  background: #1a1a2e; border-color: #1a1a2e;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(26,26,46,0.25);
}

/* ── Date filter bar ── */
.date-filter-bar {
  background: #ffffff;
  border-bottom: 2px solid #e8e4d8;
  padding: 10px 28px;
  z-index: 97;
}
.date-filter-inner {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
}
.date-filter-label {
  font-family: "Fredoka", sans-serif;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: #888899;
}
.date-select {
  font-family: "Fredoka", sans-serif;
  font-size: 13px; color: #1a1a2e;
  background: #f5f2eb;
  border: 2px solid #1a1a2e;
  border-radius: 6px; padding: 6px 12px;
  cursor: pointer; outline: none;
  width: 130px; text-align: center;
}
.date-select:focus { border-color: #f5c842; }
.date-filter-inner input.flatpickr-input {
  font-family: "Fredoka", sans-serif;
  font-size: 13px; color: #1a1a2e;
  background: #f5f2eb;
  border: 2px solid #1a1a2e;
  border-radius: 6px; padding: 6px 12px;
  cursor: pointer; outline: none;
  width: 130px; text-align: center;
}
.date-filter-inner input.flatpickr-input:focus { border-color: #f5c842; }

/* ── Flatpickr MIP theme overrides ── */
.flatpickr-calendar {
  font-family: "Fredoka", sans-serif !important;
  background: #fff !important;
  border: 2px solid #1a1a2e !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 32px rgba(26,26,46,0.18) !important;
  overflow: hidden;
}
.flatpickr-months {
  background: #1a1a2e; padding: 4px 0;
}
.flatpickr-months .flatpickr-month {
  background: #1a1a2e !important; color: #f5c842 !important;
  height: 36px !important;
}
.flatpickr-current-month {
  font-family: "Fredoka", sans-serif !important;
  font-size: 14px !important; font-weight: 600 !important;
  color: #f5c842 !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months {
  background: #1a1a2e !important; color: #f5c842 !important;
  font-family: "Fredoka", sans-serif !important;
  font-weight: 600 !important;
}
.flatpickr-current-month input.cur-year {
  color: #f5c842 !important; font-weight: 600 !important;
}
.flatpickr-current-month .fp-year-select,
.flatpickr-current-month .numInputWrapper .fp-year-select {
  background: #1a1a2e; color: #f5c842;
  border: 1px solid rgba(245,200,66,0.3); border-radius: 4px;
  font-family: "Fredoka", sans-serif;
  font-size: 14px; font-weight: 600;
  padding: 2px 4px; cursor: pointer;
  appearance: auto; -webkit-appearance: auto;
}
.flatpickr-current-month .fp-year-select:focus {
  outline: none; border-color: #f5c842;
}
.flatpickr-current-month .fp-year-select option {
  background: #1a1a2e; color: #f5c842;
}
/* Hide the default year arrows since we use a dropdown */
.flatpickr-current-month .numInputWrapper { pointer-events: auto; }
.flatpickr-current-month .numInputWrapper span.arrowUp,
.flatpickr-current-month .numInputWrapper span.arrowDown { display: none !important; }
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  fill: #f5c842 !important; color: #f5c842 !important;
}
.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
  fill: #fff !important; color: #fff !important;
}
.flatpickr-weekdays { background: #f5f2eb !important; }
span.flatpickr-weekday {
  font-family: "Fredoka", sans-serif !important;
  color: #888899 !important; font-size: 11px !important;
  font-weight: 600 !important; background: #f5f2eb !important;
}
.flatpickr-day {
  font-family: "Fredoka", sans-serif !important;
  color: #1a1a2e !important; border-radius: 8px !important;
  font-size: 13px !important;
}
.flatpickr-day:hover {
  background: #f5f2eb !important; border-color: #e8e4d8 !important;
}
.flatpickr-day.today {
  border-color: #f5c842 !important;
}
.flatpickr-day.today:hover {
  background: #f5c842 !important; color: #1a1a2e !important;
}
.flatpickr-day.selected, .flatpickr-day.selected:hover {
  background: #1a1a2e !important; color: #f5c842 !important;
  border-color: #1a1a2e !important;
}
.flatpickr-day.flatpickr-disabled, .flatpickr-day.flatpickr-disabled:hover {
  color: #ccc !important;
}
.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay {
  color: #ccc !important;
}
.date-filter-to {
  font-family: "Fredoka", sans-serif;
  font-size: 12px; color: #888899;
}
.apply-btn {
  background: #1a1a2e; color: #f5c842;
  border: 2px solid #1a1a2e; border-radius: 6px;
  padding: 5px 16px; font-family: "Fredoka", sans-serif;
  font-size: 13px; font-weight: 700;
  cursor: pointer; transition: background .15s;
}
.apply-btn:hover { background: #2a2a44; }
.reset-btn {
  background: transparent; color: #888899;
  border: 2px solid #ccccdd; border-radius: 6px;
  padding: 5px 12px; font-family: "Fredoka", sans-serif;
  font-size: 13px; cursor: pointer; transition: all .15s;
}
.reset-btn:hover { border-color: #1a1a2e; color: #1a1a2e; }
.date-filter-note {
  font-family: "Fredoka", sans-serif;
  font-size: 11px; color: #aaaacc;
  font-style: italic;
}

/* ── Page ── */
.page { padding: 14px 28px; }
.section { display: none; }
.section.active { display: block; }


/* ── Hand-drawn border filter (inner panels only) ── */
.wonky { filter: url(#wonky); }

/* ── Cards ── */
.card {
  background: #ffffff;
  border: 2.5px solid #1a1a2e;
  border-radius: 8px;
  padding: 18px 20px;
  box-shadow: 5px 5px 0 #1a1a2e;
}
.card-title {
  font-family: "Fredoka", sans-serif;
  font-size: 12px; letter-spacing: .5px;
  color: #888899; margin-bottom: 14px;
}

/* ── Layouts ── */
.row-mau { display:grid; grid-template-columns:1fr; gap:16px; margin-bottom:16px; }
.row-2 { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:16px; }
.row-1 { margin-bottom: 16px; }

/* ── Snap bar ── */
.snap-bar {
  background: #1a1a2e;
  border: 2.5px solid #1a1a2e;
  border-radius: 8px;
  box-shadow: 5px 5px 0 #0d0d1a;
  padding: 0; margin-bottom: 16px; overflow: hidden;
}
.snap-row {
  display: grid;
  grid-template-columns: 180px repeat(var(--snap-cols, 3), 1fr);
  align-items: start; padding: 12px 20px; gap: 0;
}
.snap-row.annual { background:#0f0f22; border-top:1.5px solid #2a2a44; }
.snap-month-block { padding-right:16px; border-right:1px solid #2a2a44; }
.snap-month-label { font-family:"Fredoka",sans-serif; font-size:8px; text-transform:uppercase; letter-spacing:1.5px; color:#9999bb; margin-bottom:2px; }
.snap-month-name { font-family:"Lora",serif; font-size:17px; font-weight:700; color:#ffffff; line-height:1.3; }
.snap-metric { padding:0 16px; border-right:1px solid #2a2a44; min-width:0; }
.snap-metric:last-child { border-right:none; }
.snap-metric-label { font-family:"Fredoka",sans-serif; font-size:8px; text-transform:uppercase; letter-spacing:1px; color:#9999bb; margin-bottom:2px; white-space:nowrap; }
.snap-metric-value { font-family:"Lora",serif; font-size:18px; font-weight:700; color:#ffffff; line-height:1; margin-bottom:4px; white-space:nowrap; }
.snap-metric-row { display:flex; align-items:center; gap:6px; flex-wrap:nowrap; }
.snap-prior { font-family:"Fredoka",sans-serif; font-size:10px; color:#9999bb; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* ── Badges ── */
.badge { display:inline-block; padding:2px 7px; border-radius:4px; font-family:"Fredoka",sans-serif; font-size:11px; font-weight:700; transform:skewX(-5deg); white-space:nowrap; flex-shrink:0; }
.badge-up   { background:#1b4332; color:#52d68a; border:1.5px solid #2d6a4f; }
.badge-down { background:#4a1c1c; color:#f08080; border:1.5px solid #8b3030; }
.badge-na   { background:#2a2a44; color:#667799; border:1.5px solid #333355; }

/* ── KPI strip ── */
.kpi-strip { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-bottom:22px; }
.kpi-strip.three-col { grid-template-columns:1fr 1fr 1fr; }
.kpi-card { background:#fff; border:2.5px solid #1a1a2e; border-radius:8px; padding:14px 16px 10px; box-shadow:5px 5px 0 #1a1a2e; overflow:hidden; }
.kpi-card:nth-child(2) { transform:rotate(0.3deg); }
.kpi-card-title { font-family:"Fredoka",sans-serif; font-size:12px; color:#888899; margin-bottom:12px; padding-bottom:8px; border-bottom:2px solid #f0ece0; }
.kpi-row { display:grid; grid-template-columns:22px 1fr auto; grid-template-rows:auto 4px; align-items:center; column-gap:10px; padding:7px 0 4px; border-bottom:1.5px solid #f0ece0; }
.kpi-row:last-child { border-bottom:none; }
.kpi-pos { font-family:"Pacifico",cursive; font-size:12px; color:#ccccdd; text-align:center; }
.kpi-label { font-family:"Fredoka",sans-serif; font-size:14px; color:#2a2a3a; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.kpi-metric { font-family:"Pacifico",cursive; font-size:13px; color:#1a1a2e; white-space:nowrap; }
.kpi-bar-track { grid-column:2/4; height:4px; background:#f0ece0; border-radius:2px; overflow:hidden; }
.kpi-bar-fill { height:100%; border-radius:2px; transition:width .7s cubic-bezier(.4,0,.2,1); }

/* ── Info button + modal ── */
.info-btn { display:inline-flex; align-items:center; justify-content:center; width:16px; height:16px; border-radius:50%; background:#1a1a2e; color:#f5f2eb; font-size:10px; font-family:"Fredoka",sans-serif; font-weight:700; cursor:pointer; border:none; margin-left:6px; vertical-align:middle; flex-shrink:0; opacity:0.6; transition:opacity .15s; }
.info-btn:hover { opacity:1; }
.info-modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.45); z-index:1000; align-items:center; justify-content:center; }
.info-modal-overlay.visible { display:flex; }
.info-modal { background:#fff; border:2.5px solid #1a1a2e; border-radius:8px; box-shadow:6px 6px 0 #1a1a2e; padding:24px 28px; max-width:520px; width:90%; font-family:"Fredoka",sans-serif; color:#1a1a2e; position:relative; }
.info-modal h3 { font-family:"Lora",serif; font-size:18px; font-weight:700; margin-bottom:12px; }
.info-modal p { font-size:14px; line-height:1.7; margin-bottom:10px; color:#333; }
.info-modal p:last-of-type { margin-bottom:0; }
.info-modal-close { position:absolute; top:12px; right:14px; background:none; border:none; font-size:20px; cursor:pointer; color:#888; line-height:1; }
.info-modal-close:hover { color:#1a1a2e; }

/* ── Section divider ── */
.section-divider { font-family:"Pacifico",cursive; font-size:22px; color:#1a1a2e; padding:22px 0 10px; border-top:2.5px solid #1a1a2e; margin-top:8px; }

/* ── Filtered range banner ── */
.filter-active-banner {
  background: #f5c842;
  border: 2px solid #1a1a2e;
  border-radius: 6px;
  padding: 8px 16px;
  margin-bottom: 14px;
  font-family: "Fredoka", sans-serif;
  font-size: 13px; color: #1a1a2e;
  display: none;
}
.filter-active-banner.visible { display: block; }

/* ── Recipes page ── */
.recipe-search-bar { display:flex; gap:10px; margin-bottom:18px; flex-wrap:wrap; }
.recipe-input { font-family:"Fredoka",sans-serif; font-size:14px; padding:8px 12px; border:2px solid #e0dcd0; border-radius:6px; background:#fff; color:#1a1a2e; outline:none; }
.recipe-input:focus { border-color:#1a1a2e; }
.recipe-select { font-family:"Fredoka",sans-serif; font-size:14px; padding:8px 12px; border:2px solid #e0dcd0; border-radius:6px; background:#fff; color:#1a1a2e; outline:none; cursor:pointer; }
.recipe-select:focus { border-color:#1a1a2e; }
.recipe-label { font-family:"Fredoka",sans-serif; font-size:12px; color:#888899; display:block; margin-bottom:4px; }
.recipe-btn { font-family:"Fredoka",sans-serif; font-size:13px; padding:8px 16px; border:2px solid #1a1a2e; border-radius:6px; background:#fff; color:#1a1a2e; cursor:pointer; font-weight:600; transition:background .15s; }
.recipe-btn:hover { background:#f0ece0; }
.recipe-btn-primary { background:#47c299; color:#fff; border-color:#47c299; }
.recipe-btn-primary:hover { background:#3aad85; }
.recipe-btn-danger { background:#e05050; color:#fff; border-color:#e05050; }
.recipe-btn-danger:hover { background:#c03030; }
.recipe-info { display:inline-flex; align-items:center; justify-content:center; width:15px; height:15px; border-radius:50%; background:#c9c1b0; color:#fff; font-family:"Fredoka",sans-serif; font-size:10px; font-weight:700; font-style:italic; cursor:help; margin-left:6px; position:relative; vertical-align:middle; user-select:none; }
.recipe-info:hover, .recipe-info:focus { background:#1a1a2e; outline:none; }
.recipe-info::before { content:"i"; }
.recipe-info .recipe-info-tip { display:none; position:absolute; left:50%; bottom:calc(100% + 8px); transform:translateX(-50%); background:#1a1a2e; color:#fff; padding:9px 11px; border-radius:6px; font-size:11px; font-weight:400; font-style:normal; width:240px; max-width:80vw; text-align:left; z-index:100; box-shadow:0 4px 14px rgba(0,0,0,0.18); line-height:1.45; pointer-events:none; white-space:normal; }
.recipe-info .recipe-info-tip::after { content:""; position:absolute; top:100%; left:50%; transform:translateX(-50%); border:6px solid transparent; border-top-color:#1a1a2e; }
.recipe-info:hover .recipe-info-tip, .recipe-info:focus .recipe-info-tip { display:block; }
.rx-search { position:relative; }
.rx-search-input { width:100%; }
.rx-search-dropdown { position:absolute; top:calc(100% + 2px); left:0; right:0; max-height:320px; overflow-y:auto; background:#fff; border:2px solid #1a1a2e; border-radius:6px; z-index:50; box-shadow:0 6px 20px rgba(0,0,0,0.12); }
.rx-search-option { padding:8px 12px; cursor:pointer; font-family:"Fredoka",sans-serif; font-size:13px; color:#1a1a2e; line-height:1.3; }
.rx-search-option:hover, .rx-search-option.rx-focus { background:#f0ece0; }
.rx-search-option .rx-meta { color:#888; font-size:11px; margin-left:6px; }
.rx-search-group { padding:6px 12px; font-family:"Fredoka",sans-serif; font-size:10px; color:#888899; background:#faf6ee; text-transform:uppercase; letter-spacing:0.5px; font-weight:700; position:sticky; top:0; }
.rx-search-empty { padding:12px; color:#888; font-style:italic; font-size:13px; font-family:"Fredoka",sans-serif; }
.recipe-btn-icon, .recipe-btn-icon:hover, .recipe-btn-icon:focus, .recipe-btn-icon:focus-visible, .recipe-btn-icon:active { background:transparent; border:0; outline:0; box-shadow:none; -webkit-appearance:none; -moz-appearance:none; appearance:none; font-size:18px; color:#cc4444; cursor:pointer; padding:4px 8px; line-height:1; }
.recipe-btn-icon:hover { color:#e05050; }
.recipe-rm-delete { font-size:20px; color:#cc4444; cursor:pointer; display:inline-block; text-align:center; }
.recipe-rm-delete:hover { color:#e05050; }
.drag-handle { font-size:16px; color:#ccc; cursor:grab; text-align:center; user-select:none; width:24px; }
.drag-handle:hover { color:#888; }
.rm-history-btn { cursor:pointer; font-size:18px; opacity:0.8; transition:opacity .15s; }
.rm-history-btn:hover { opacity:1; transform:scale(1.2); }
.ing-search-wrap { position:relative; }
.ing-search-results { position:absolute; top:100%; left:0; right:0; background:#fff; border:2px solid #1a1a2e; border-radius:6px; max-height:250px; overflow-y:auto; z-index:50; box-shadow:4px 4px 0 rgba(0,0,0,0.15); }
.ing-search-group { font-family:Fredoka,sans-serif; font-size:11px; color:#666; padding:5px 10px; text-transform:uppercase; letter-spacing:0.5px; background:#f0ece0; border-top:1px solid #e8e4d8; }
.ing-search-item { font-family:Fredoka,sans-serif; font-size:13px; padding:6px 10px; cursor:pointer; display:flex; justify-content:space-between; }
.ing-search-item:hover { background:#f0ece0; }
.ing-search-item .ing-item-detail { color:#888; font-size:12px; }

.recipe-stats-bar { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:12px; background:#1a1a2e; border-radius:8px; padding:16px 20px; margin-bottom:18px; }
.recipe-stat { text-align:center; }
.recipe-stat-label { font-family:"Fredoka",sans-serif; font-size:11px; color:#889; text-transform:uppercase; letter-spacing:0.5px; margin-bottom:4px; }
.recipe-stat-value { font-family:"Lora",serif; font-size:18px; font-weight:700; color:#f5f2eb; }
.recipe-stat-sub { font-family:"Fredoka",sans-serif; font-size:12px; color:#f5c842; margin-top:2px; }

.recipe-pill { font-family:"Fredoka",sans-serif; font-size:13px; padding:6px 14px; border:1.5px solid rgba(255,255,255,0.25); border-radius:20px; background:transparent; color:rgba(255,255,255,0.6); cursor:pointer; transition:all .15s; }
.recipe-pill:hover { border-color:rgba(255,255,255,0.5); color:#f5f2eb; }
.recipe-pill-active { background:#f5f2eb; color:#1a1a2e; border-color:#f5f2eb; }
.recipe-pill-active:hover { color:#7b1fa2; }
.recipe-pill-count { font-size:11px; opacity:0.5; margin-left:2px; }
.recipe-pill-active .recipe-pill-count { opacity:0.7; }
/* Variant for filter pills that sit on the cream page background
   (PO list, Production Orders list, Order Tracker) — the default
   white-tinted style is invisible without the dark navy bar behind it. */
.recipe-pill-light { color:#666; border-color:#cfcabd; }
.recipe-pill-light:hover { color:#1a1a2e; border-color:#1a1a2e; }
.recipe-pill-light.recipe-pill-active { background:#1a1a2e; color:#fff; border-color:#1a1a2e; }
.recipe-pill-light.recipe-pill-active:hover { color:#fff; }
.recipe-card:hover { box-shadow:6px 6px 0 #1a1a2e; transform:translateY(-1px); transition:all .15s; }

/* Doh Doh brand-coloured hover effect — blue→pink gradient overlay
   on hover, with a subtle lift and matching glow. Only applied when
   the card carries the recipe-card-doh-doh class (vendor = Doh Doh). */
.recipe-card.recipe-card-doh-doh { position:relative; overflow:hidden; transition:all .25s ease; }
.recipe-card.recipe-card-doh-doh::before {
  content:""; position:absolute; inset:0;
  /* Blue holds longer at the start so it reads bolder; pink takes the
     trailing third so the brand pop still lands on the bottom-right. */
  background:linear-gradient(135deg, #0f47e1 0%, #0f47e1 35%, #de1895 100%);
  opacity:0; transition:opacity .3s ease; pointer-events:none; z-index:0;
}
.recipe-card.recipe-card-doh-doh:hover::before { opacity:0.20; }
.recipe-card.recipe-card-doh-doh:hover {
  box-shadow: 6px 6px 0 #de1895, -3px -3px 22px rgba(15, 71, 225, 0.45);
  border-color: transparent;
  transform: translateY(-2px);
}
.recipe-card.recipe-card-doh-doh > * { position:relative; z-index:1; }
.recipe-row-hover:hover { background:#f0ece0 !important; transition:background .1s; }
.recipe-name-link:hover { text-decoration:underline; color:#7b1fa2; }
.row-edit-saved { animation: rowEditSavedFlash 1.2s ease-out; }
@keyframes rowEditSavedFlash {
  0% { background:#d4f5dd !important; border-color:#2a8636 !important; }
  100% { background:#fff; border-color:#d0cdc0; }
}
.pencil-scribble { position:fixed; bottom:20px; right:24px; width:200px; opacity:0.5; pointer-events:none; z-index:0; }

.recipe-drag-ghost { opacity:0.3; }
.recipe-drag-chosen { box-shadow:8px 8px 0 #1a1a2e; transform:rotate(1deg); }
.recipe-drag-active { cursor:grabbing; }
.recipe-ingredients-mini { margin-bottom:8px; }
.recipe-ing-row { display:grid; grid-template-columns:1fr auto auto; gap:8px; padding:5px 0; border-bottom:1px solid #f0ece0; font-family:"Fredoka",sans-serif; font-size:13px; color:#444; }
.recipe-ing-row:last-child { border-bottom:none; }
.recipe-total-row { display:flex; justify-content:space-between; padding:10px 0 0; border-top:2px solid #1a1a2e; font-family:"Lora",serif; font-size:16px; font-weight:700; color:#1a1a2e; margin-top:4px; }

.recipe-editor-ing { display:grid; grid-template-columns:minmax(180px,1.3fr) 90px minmax(24px,auto) minmax(0,1fr) 70px 30px; align-items:center; gap:8px; padding:6px 0; border-bottom:1px solid #f0ece0; }
.recipe-editor-ing:last-child { border-bottom:none; }
.recipe-editor-ing .recipe-select { width:100%; min-width:0; font-size:13px; padding:6px 8px; }
.recipe-editor-ing .recipe-input { font-size:13px; padding:6px 8px; }
.recipe-editor-ing .ing-search-wrap { min-width:0; }
.recipe-editor-ing .ing-search { width:100%; }
.recipe-editor-ing .ing-qty { width:100%; }
.recipe-editor-ing .ing-toggles-cell { display:flex; align-items:center; gap:6px; min-width:0; }
.recipe-editor-ing .ing-conversion-cell { font-family:"Fredoka",sans-serif; font-size:11px; color:#999; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.recipe-ing-unit { font-family:"Fredoka",sans-serif; font-size:12px; color:#888; }
.recipe-ing-cost { font-family:"Fredoka",sans-serif; font-size:13px; color:#1a1a2e; font-weight:600; text-align:right; }
@media (max-width:720px) {
  .recipe-editor-ing { display:flex; flex-wrap:wrap; }
  .recipe-editor-ing .recipe-select { flex:1; min-width:180px; }
  .recipe-editor-ing .ing-search-wrap { flex:1; min-width:180px; }
  .recipe-editor-ing .ing-qty { width:80px; }
}

.recipe-materials-table { width:100%; border-collapse:collapse; font-family:"Fredoka",sans-serif; font-size:14px; }
.recipe-materials-table th { text-align:left; padding:8px 6px; border-bottom:2px solid #1a1a2e; color:#888899; font-size:12px; font-weight:400; white-space:nowrap; }
.recipe-materials-table td { padding:6px; border-bottom:1px solid #f0ece0; }
.recipe-materials-table td:last-child { width:40px; text-align:center; }
.recipe-materials-table .recipe-input { width:100%; padding:6px 8px; font-size:13px; }
.recipe-materials-table .recipe-select { width:100%; padding:6px 8px; font-size:13px; }

/* ── Cashflow badges ── */
.badge-fixed { background:#1a3a5c; color:#7db8f0; border:1.5px solid #2a5a8c; }
.badge-variable { background:#5c3d1a; color:#f0c87d; border:1.5px solid #8c6a2a; }
.badge-approx { background:#4a3a1a; color:#e0c87d; border:1.5px solid #6a5a2a; }
.badge-agreed { background:#1a4a3a; color:#7de0c8; border:1.5px solid #2a6a5a; }
.badge-loan { background:#3d1a5c; color:#c87df0; border:1.5px solid #5a2a8c; }
.badge-cogs { background:#1a3a3a; color:#7dc8d8; border:1.5px solid #2a5a5a; }
.badge-opex { background:#3a3a1a; color:#d8c87d; border:1.5px solid #5a5a2a; }

/* ── Homepage pills ── */
/* Legacy grid (kept harmless in case anything still references it) */
.home-pills { display:none; }
.home-pill { display:none; }

/* ── Radial wheel menu ── */
.home-wheel {
  position:relative;
  width:340px;
  height:340px;
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  /* Radius for option placement. Density classes override below. */
  --radius:115px;
  /* Stop text selection / iOS long-press callout while interacting. */
  user-select:none;
  -webkit-user-select:none;
  -webkit-touch-callout:none;
  touch-action:none;
}
.home-wheel,
.home-wheel * { -webkit-tap-highlight-color:transparent; }
.home-wheel.wheel-sparse  { --radius:100px; }   /* up to 4 items */
.home-wheel.wheel-medium  { --radius:118px; }   /* 5-6 items */
.home-wheel.wheel-dense   { --radius:130px; }   /* 7+ items */
.home-wheel-center {
  position:relative;
  z-index:2;
  width:110px; height:110px;
  border-radius:50%;
  background:transparent;
  color:#1a1a2e;
  /* Match the app-wide border + offset-shadow look (st-bigbtn, st-list-card, etc.) */
  border:2px solid #1a1a2e;
  box-shadow:3px 3px 0 #1a1a2e;
  cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  font-family:"Lora",serif; font-size:30px; font-weight:700;
  transition:transform .25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .15s, background .15s, color .15s;
  /* Headspace-style gentle breath. GPU-composited transform —
     no measurable perf cost. The more-specific :active / .is-open
     rules below override the animation during interaction (they
     also explicitly null `animation` so the transform isn't
     fighting two sources at once). */
  /* Two separate animations on different properties, with
     deliberately coprime durations (6s vs 11s) so they drift out of
     phase forever — the combined scale+morph never repeats and the
     two motions never pivot at the same moment, so the eye reads it
     as continuously varying rather than staged. Every keyframe
     segment is ease-in-out, so each individual motion stays a
     smooth wave. */
  animation: home-wheel-breathe-scale 6s ease-in-out infinite,
             home-wheel-breathe-shape 11s ease-in-out infinite;
  will-change: transform;
}
.home-wheel-center:hover { background:rgba(26,26,46,0.08); }
.home-wheel-center:active { transform:translate(2px, 2px); box-shadow:1px 1px 0 #1a1a2e; animation:none; }
.home-wheel.is-open .home-wheel-center { transform:scale(0.85); box-shadow:2px 2px 0 #1a1a2e; animation:none; }
/* The scale animation IS the breath, shaped like a real one rather
   than a symmetric sine: quicker inhale (peak at 40%), slower
   exhale, then a near-flat rest (78%→100%) before the next cycle —
   that bottom pause is what makes it read as breathing instead of
   pulsing. The blob also lifts ~2px and its offset shadow grows as
   it inflates, so it rises off the page paper-cutout style (the
   border-radius morph repaints every frame anyway, so animating the
   shadow adds no new paint cost). The shape animation wanders
   through three soft blob poses instead of returning to a perfect
   circle, at a coprime duration so the poses land on a different
   phase of the breath every cycle. */
@keyframes home-wheel-breathe-scale {
  0%   { transform: scale(1) translateY(0);       box-shadow: 3px 3px 0 #1a1a2e; }
  40%  { transform: scale(1.09) translateY(-2px); box-shadow: 5px 5px 0 #1a1a2e; }
  78%  { transform: scale(1.008) translateY(0);   box-shadow: 3.2px 3.2px 0 #1a1a2e; }
  100% { transform: scale(1) translateY(0);       box-shadow: 3px 3px 0 #1a1a2e; }
}
@keyframes home-wheel-breathe-shape {
  0%, 100% { border-radius: 51% 49% 48% 52% / 49% 51% 52% 48%; }
  33%      { border-radius: 61% 39% 55% 45% / 44% 59% 41% 56%; }
  66%      { border-radius: 42% 58% 47% 53% / 57% 43% 58% 42%; }
}
@media (prefers-reduced-motion: reduce) {
  .home-wheel-center { animation: none; }
}
.home-wheel-options {
  position:absolute; inset:0;
  z-index:1;
  pointer-events:none;        /* re-enabled per option when open */
}
.home-wheel.is-open .home-wheel-options { pointer-events:auto; }
.home-wheel-option {
  position:absolute;
  left:50%; top:50%;
  width:78px; height:78px;
  border-radius:50%;
  background:#fff;
  border:2.5px solid #1a1a2e;
  box-shadow:3px 3px 0 #1a1a2e;
  cursor:pointer;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:2px;
  font-family:"Fredoka",sans-serif;
  /* Collapsed state: stacked at the centre, invisible. */
  transform:translate(-50%, -50%) scale(0);
  opacity:0;
  transition:
    transform .35s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity .2s ease,
    background .15s,
    box-shadow .15s;
  transition-delay:0ms;
  padding:0;
}
.home-wheel.is-open .home-wheel-option {
  transform:translate(
    calc(-50% + (var(--cx) * var(--radius))),
    calc(-50% + (var(--cy) * var(--radius)))
  ) scale(1);
  opacity:1;
  transition-delay:var(--delay, 0ms);
}
.home-wheel-option:hover { background:#214084; color:#fff; }
.home-wheel-option:active {
  transform:translate(
    calc(-50% + (var(--cx) * var(--radius)) + 2px),
    calc(-50% + (var(--cy) * var(--radius)) + 2px)
  ) scale(1);
  box-shadow:1px 1px 0 #1a1a2e;
}
/* Armed = pointer is currently angled toward this option during a hold.
   Release here selects. Visual pop so the user knows what'll fire. */
.home-wheel.is-open .home-wheel-option.is-armed {
  background:#214084;
  color:#fff;
  z-index:3;
  transform:translate(
    calc(-50% + (var(--cx) * var(--radius) * 1.08)),
    calc(-50% + (var(--cy) * var(--radius) * 1.08))
  ) scale(1.18);
  box-shadow:5px 5px 0 #1a1a2e;
  transition-delay:0ms;
}

/* Shared formula used by both the open + armed states of a sub-item.
   distance = base + row * row-gap, both in pixels. */

/* ── Sub-menu layer (nested options around an armed top-level option) ── */
.home-wheel-sub {
  position:absolute; inset:0;
  /* Sub-items fan in an arc at this radius from the wheel centre. */
  --sub-radius:calc(var(--radius) + 100px);
  /* Container itself never catches clicks — only the actual sub-item
     buttons do. This way the empty space inside the sub layer (which
     covers the whole wheel via inset:0) doesn't block clicks from
     reaching the parent option buttons underneath. */
  pointer-events:none;
  z-index:4;
}
.home-wheel-sub.is-open .home-wheel-subopt { pointer-events:auto; }
.home-wheel-subopt {
  position:absolute;
  left:50%; top:50%;
  /* Smaller pills so 4-item fans fit without overlapping each other
     or the neighbouring main buttons. Longer labels wrap to 2 lines. */
  min-width:80px; max-width:100px; padding:7px 10px;
  border-radius:18px;
  background:#fff; color:#1a1a2e;
  border:2px solid #1a1a2e;
  box-shadow:3px 3px 0 #1a1a2e;
  cursor:pointer;
  font-family:"Fredoka",sans-serif; font-size:11px; font-weight:700;
  line-height:1.15;
  text-align:center;
  transform:translate(-50%, -50%) scale(0);
  opacity:0;
  transition:
    transform .25s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity .15s ease,
    background .12s,
    color .12s,
    box-shadow .12s;
  transition-delay:0ms;
}
.home-wheel-sub.is-open .home-wheel-subopt {
  transform:translate(
    calc(-50% + (var(--cx) * var(--sub-radius))),
    calc(-50% + (var(--cy) * var(--sub-radius)))
  ) scale(1);
  opacity:1;
  transition-delay:var(--delay, 0ms);
}
.home-wheel-sub.is-open .home-wheel-subopt.is-armed,
.home-wheel-sub.is-open .home-wheel-subopt:hover {
  background:#214084; color:#fff;
  transform:translate(
    calc(-50% + (var(--cx) * var(--sub-radius) * 1.06)),
    calc(-50% + (var(--cy) * var(--sub-radius) * 1.06))
  ) scale(1.12);
  box-shadow:4px 4px 0 #1a1a2e;
  transition-delay:0ms;
  z-index:5;
}
.home-wheel-emoji { font-size:22px; line-height:1; }
.home-wheel-label { font-size:11px; font-weight:700; color:inherit; line-height:1; }
/* Roster pre-release lock — greyed, non-tappable "coming soon" wheel option */
.home-wheel-soon { font-size:8px; font-weight:600; font-style:italic; color:#999; line-height:1; margin-top:1px; }
.home-wheel-option.wheel-locked { filter:grayscale(1); pointer-events:none; cursor:not-allowed; }
.home-wheel.is-open .home-wheel-option.wheel-locked { opacity:0.45; }
.home-welcome-hint {
  font-family:"Fredoka",sans-serif; font-size:13px; color:#888;
  margin:6px 0 0; text-align:center;
}
#homepage {
  position:fixed; top:60px; left:0; right:0; bottom:0;
  display:flex; flex-direction:column; align-items:center;
  justify-content:center;
  background:#f5f2eb; z-index:50;
}
.home-welcome {
  /* Absolute so moving it vertically doesn't shift the wheel's centre. */
  position:absolute;
  top:14vh; left:0; right:0;
  text-align:center;
  margin-bottom:0;
}
.home-welcome h1 { font-family:"Lora",serif; font-size:48px; font-weight:700; color:#1a1a2e; margin-bottom:0; }
.home-fact { max-width:600px; text-align:center; padding:20px; position:absolute; bottom:24px; left:50%; transform:translateX(-50%); }
.home-fact-heading { font-family:"Fredoka",sans-serif; font-size:13px; color:#aaa; margin-bottom:6px; display:flex; align-items:center; justify-content:center; gap:6px; }
.home-fact-icon { display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; border-radius:50%; background:#1a1a2e; color:#f5f2eb; font-size:10px; font-family:"Fredoka",sans-serif; font-weight:700; }
.home-fact-text { font-family:"Fredoka",sans-serif; font-size:14px; color:#666; line-height:1.6; transition:opacity .3s; }

/* ── Mobile responsive ── */
@media (max-width: 768px) {
  /* Header + top nav */
  .header { padding: 6px 12px; }
  .top-nav { gap: 6px; }
  .top-nav-home { font-size: 20px; padding: 2px 6px 2px 0; }
  .sub-nav-bar { padding: 6px 12px; top: 40px; }
  .header-status { font-size: 9px; }
  .pill { padding: 6px 14px; font-size: 12px; }
  .pill-nav { gap: 6px; }

  /* Homepage */
  #homepage { min-height:calc(100vh - 50px); padding:0 16px; }
  .home-welcome { top:7vh; }
  /* Phone browsers (Safari, Chrome) put their address bar over the
     bottom of the viewport — bump the headlines panel up off it,
     and respect iOS safe-area on devices with a home indicator. */
  .home-fact { bottom:calc(56px + env(safe-area-inset-bottom, 0px)); }
  .home-welcome h1 { font-size:28px; }
  /* Wheel: shrink slightly on small phones. */
  .home-wheel { width:300px; height:300px; }
  .home-wheel.wheel-sparse { --radius:88px; }
  .home-wheel.wheel-medium { --radius:104px; }
  .home-wheel.wheel-dense  { --radius:115px; }
  .home-wheel-center { width:96px; height:96px; font-size:26px; }
  .home-wheel-option { width:70px; height:70px; }
  .home-wheel-emoji { font-size:20px; }
  .home-wheel-label { font-size:10px; }
  /* Sub-items: tighter offset + smaller pill so they don't run off
     the side of a phone viewport. */
  .home-wheel-sub { --sub-radius:calc(var(--radius) + 82px); }
  .home-wheel-subopt { min-width:72px; max-width:90px; padding:6px 9px; font-size:10px; }
  .home-fact { padding:20px 10px; }
  .home-fact-text { font-size:13px; }

  /* Date filter bar */
  .date-filter-bar { padding: 8px 12px; top: auto; position: relative; }
  .date-filter-inner { gap: 8px; }
  .date-select { font-size: 12px; padding: 4px 6px; }
  .apply-btn { padding: 4px 12px; font-size: 12px; }
  .reset-btn { padding: 4px 10px; font-size: 12px; }

  /* Page */
  .page { padding: 14px 10px; }

  /* Cards — ensure charts don't overflow */
  .card { padding: 14px 10px; box-shadow: 3px 3px 0 #1a1a2e; overflow: hidden; min-width: 0; }

  /* Row children need min-width:0 for grid to shrink properly */
  .row-2 > *, .row-mau > *, .row-1 { min-width: 0; }

  /* Grids → single column */
  .row-2 { grid-template-columns: 1fr; }
  .kpi-strip { grid-template-columns: 1fr; }
  .kpi-strip.three-col { grid-template-columns: 1fr; }

  /* Snap bar — clean mobile card layout */
  .snap-bar { overflow: hidden; border-radius: 10px; box-shadow: 3px 3px 0 #0d0d1a; }
  .snap-row {
    display: flex; flex-direction: column;
    gap: 0; padding: 0;
  }
  .snap-month-block {
    border-right: none; padding: 14px 16px 10px;
    border-bottom: 1px solid #2a2a44;
    text-align: center;
  }
  .snap-month-label { font-size: 9px; letter-spacing: 2px; margin-bottom: 4px; }
  .snap-month-name { font-size: 18px; }
  .snap-metric {
    padding: 12px 16px; border-right: none;
    border-bottom: 1px solid #2a2a44;
    display: grid; grid-template-columns: 1fr auto;
    grid-template-rows: auto auto; column-gap: 12px;
    align-items: center;
  }
  .snap-metric:last-child { border-bottom: none; }
  .snap-metric-label {
    grid-column: 1; grid-row: 1;
    font-size: 9px; margin-bottom: 0;
  }
  .snap-metric-value {
    grid-column: 1; grid-row: 2;
    font-size: 20px; margin-bottom: 0;
  }
  .snap-metric-row {
    grid-column: 2; grid-row: 1 / 3;
    flex-direction: column; align-items: flex-end; gap: 2px;
  }
  .snap-prior { font-size: 9px; text-align: right; }
  .snap-row.annual { border-top: 2px solid #f5c842; }

  /* KPI cards — mobile layout */
  .kpi-card { box-shadow: 3px 3px 0 #1a1a2e; padding: 12px 14px 8px; }
  .kpi-card-title { font-size: 11px; text-align: center; }
  .kpi-row {
    grid-template-columns: 20px 1fr auto;
    column-gap: 8px; padding: 6px 0 3px;
  }
  .kpi-pos { font-size: 11px; }
  .kpi-label { font-size: 12px; min-width: 0; }
  .kpi-metric { font-size: 12px; text-align: right; }
  .kpi-bar-track { grid-column: 1 / -1; }

  /* Charts */
  canvas { max-width: 100%; }

  /* Inline grids — prevent overflow */
  [style*="grid-template-columns"] { overflow-x: auto; }

  /* Info modal */
  .info-modal { padding: 18px 16px; width: 95%; }

  /* Section divider */
  .section-divider { font-size: 18px; padding: 16px 0 8px; }
}

@media (max-width: 480px) {
  .header-status { font-size: 9px; }
  .pill { padding: 5px 12px; font-size: 11px; }
  .snap-metric-value { font-size: 18px; }
  .badge { font-size: 10px; }
}

/* ── Login screen ───────────────────────────────────────────── */
#loginScreen {
  position: fixed; inset: 0;
  background: #f5f2eb;
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.login-inner {
  background: #fff;
  border: 2px solid #1a1a2e;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%; max-width: 380px;
  box-shadow: 4px 4px 0 #1a1a2e;
  text-align: center;
}
.login-logo {
  font-family: "Fredoka", sans-serif;
  font-size: 42px; font-weight: 700;
  color: #1a1a2e; letter-spacing: 2px;
  margin-bottom: 2px;
}
.login-subtitle {
  font-family: "Fredoka", sans-serif;
  font-size: 14px; color: #aaa;
  text-transform: uppercase; letter-spacing: 2px;
  margin-bottom: 28px;
}
.login-form { text-align: left; }
.login-field { margin-bottom: 16px; }
.login-label {
  display: block;
  font-family: "Fredoka", sans-serif;
  font-size: 12px; text-transform: uppercase;
  letter-spacing: 1px; color: #888;
  margin-bottom: 5px;
}
.login-input {
  width: 100%; box-sizing: border-box;
  padding: 10px 12px;
  border: 2px solid #e0dbd0; border-radius: 8px;
  font-family: "Fredoka", sans-serif; font-size: 15px;
  background: #faf8f3; color: #1a1a2e;
  outline: none; transition: border-color .2s;
}
.login-input:focus { border-color: #1a1a2e; }
.login-error {
  font-family: "Fredoka", sans-serif;
  font-size: 13px; color: #c0392b;
  min-height: 18px; margin-bottom: 10px;
}
.login-btn {
  width: 100%; padding: 12px;
  background: #1a1a2e; color: #f5f2eb;
  border: none; border-radius: 8px;
  font-family: "Fredoka", sans-serif;
  font-size: 16px; font-weight: 600;
  cursor: pointer; transition: opacity .2s;
}
.login-btn:hover { opacity: .85; }
.login-btn:disabled { opacity: .5; cursor: default; }

/* Burger menu additions */
.burger-divider { height: 1px; background: #e0dbd0; margin: 4px 0; }
.burger-signout {
  color: #c0392b !important;
  font-weight: 600;
}

/* Admin panel */
.admin-user-card {
  border: 1.5px solid #e0dbd0; border-radius: 10px;
  padding: 14px 16px; margin-bottom: 12px;
  background: #faf8f3;
}
.admin-user-email {
  font-family: "Lora", serif; font-weight: 700;
  font-size: 15px; color: #1a1a2e; margin-bottom: 4px;
}
.admin-user-name {
  font-family: "Fredoka", sans-serif;
  font-size: 13px; color: #888; margin-bottom: 10px;
}
.admin-perm-row {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.admin-perm-label {
  display: flex; align-items: center; gap: 6px;
  font-family: "Fredoka", sans-serif; font-size: 14px;
  color: #1a1a2e; cursor: pointer; user-select: none;
}
.admin-perm-label input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }

/* ── Serve Size calculator ── */
.serve-label { font-family:"Fredoka",sans-serif; font-size:13px; color:#888899; display:block; margin-bottom:6px; }
.serve-input { font-family:"Fredoka",sans-serif; font-size:16px; padding:10px 14px; border:2px solid #e0dcd0; border-radius:8px; background:#fff; color:#1a1a2e; outline:none; width:100%; box-sizing:border-box; }
.serve-input:focus { border-color:#1a1a2e; }
.serve-slider-section { background:#f5f2eb; border-radius:10px; padding:16px 18px; }
.serve-slider { -webkit-appearance:none; appearance:none; width:100%; height:8px; border-radius:4px; outline:none; cursor:pointer; background:linear-gradient(to right, #1a1a2e var(--fill-pct, 0%), #ddd8cc var(--fill-pct, 0%)); }
.serve-slider::-webkit-slider-thumb { -webkit-appearance:none; appearance:none; width:26px; height:26px; border-radius:50%; background:#1a1a2e; cursor:pointer; box-shadow:0 2px 8px rgba(0,0,0,0.3); }
.serve-slider::-moz-range-thumb { width:26px; height:26px; border:none; border-radius:50%; background:#1a1a2e; cursor:pointer; }
#ss-liquid-rect { transition: y 0.5s cubic-bezier(.4,0,.2,1); }
.serve-stat { background:#fff; border:2px solid #e0dcd0; border-radius:10px; padding:16px 18px; }
.serve-stat-label { font-family:"Fredoka",sans-serif; font-size:12px; color:#888899; margin-bottom:4px; }
.serve-stat-value { font-family:Lora,serif; font-size:28px; font-weight:700; color:#1a1a2e; }
.serve-stat-sub { font-family:"Fredoka",sans-serif; font-size:13px; color:#888; margin-top:4px; }
@media(max-width:600px) { #ss-glass-svg { width:100px; height:210px; } .serve-stat-value { font-size:22px; } }

/* ── Inventory table ── */
.inv-table {
  width:100%; border-collapse:collapse;
  font-family:"Fredoka",sans-serif; font-size:14px;
}
.inv-table thead th {
  text-align:left; font-size:11px; text-transform:uppercase;
  letter-spacing:1px; color:#888; padding:8px 12px;
  border-bottom:2px solid #e8e4d8; white-space:nowrap;
}
.inv-table tbody tr { border-bottom:1px solid #f0ece0; }
.inv-table tbody tr:hover { background:#faf8f3; }
.inv-table td { padding:10px 12px; }
.inv-product { font-weight:700; color:#1a1a2e; }
.inv-variant { color:#667799; font-size:13px; }
.inv-sku { color:#888; font-size:12px; font-family:monospace; }
.inv-price { color:#1a1a2e; white-space:nowrap; }
.inv-stock { font-size:16px; }
.inv-stock-label { font-size:11px; }
.inv-qty { color:#555; text-align:right; font-variant-numeric:tabular-nums; }
th.inv-qty { color:#888; }

@media (max-width:768px) {
  .inv-table { font-size:12px; }
  .inv-table td, .inv-table th { padding:6px 8px; }
  .inv-stock { font-size:14px; }
  .inv-hide-mobile { display:none; }
}

/* ── Order tables: shared partial badge, expanded-row shading, mobile cards ──
   Used by Order Tracker, Purchase Orders and Production Orders. A table opts
   in with class "mip-rtable" (on the <table>) + "mip-rtable-wrap" (on the
   wrapping .card). Each <td> carries a data-label for the phone card view. */

/* Strong, unmistakable PARTIAL pill — solid orange so a half-done order
   can't be mistaken for pending/accepted at a glance. */
.mip-badge-partial {
  display:inline-block; font-family:"Fredoka",sans-serif;
  font-size:11px; font-weight:700; letter-spacing:.4px; text-transform:uppercase;
  color:#fff; background:#e65100; padding:2px 9px; border-radius:4px; white-space:nowrap;
}

/* Expanded-row shading (desktop): the clicked row and its detail row share one
   tint + a left accent bar so they clearly read as a single block. */
.inv-table tbody tr.mip-row-open > td,
.inv-table tbody tr.mip-row-open:hover > td,
.inv-table tbody tr.mip-detail-row > td { background:#eaeff7; }
.inv-table tbody tr.mip-row-open > td:first-child,
.inv-table tbody tr.mip-detail-row > td:first-child { box-shadow:inset 3px 0 0 var(--mip-accent,#214084); }

@media (max-width:768px) {
  /* Strip the heavy outer card chrome so each order-card stands alone. */
  .mip-rtable-wrap { background:transparent; border:none; box-shadow:none; padding:0; overflow:visible; }

  /* Table → stack of cards. Each row becomes a flex column so a title cell
     can be hoisted to the top and the action button sunk to the bottom. */
  table.mip-rtable, table.mip-rtable tbody { display:block; width:100%; }
  table.mip-rtable thead { display:none; }
  table.mip-rtable tbody tr {
    display:flex; flex-direction:column;
    border:2px solid #1a1a2e; border-radius:10px; background:#fff;
    margin:0 0 12px; padding:11px 14px; box-shadow:3px 3px 0 #1a1a2e;
  }
  table.mip-rtable tbody tr:hover { background:#fff; }
  table.mip-rtable td {
    display:flex; align-items:center; justify-content:space-between; gap:14px;
    padding:8px 0; border-bottom:1px solid #f4f1e8; text-align:right; white-space:normal;
  }
  table.mip-rtable td:last-child { border-bottom:none; }
  table.mip-rtable td::before {
    content:attr(data-label); flex:0 0 auto; text-align:left;
    font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.5px; color:#999;
  }
  /* Title cell — the card heading (e.g. vendor). Floats to the top. */
  table.mip-rtable td.mip-cell-title {
    order:-1; justify-content:flex-start; text-align:left;
    font-size:16px; font-weight:700; color:#1a1a2e;
    padding:0 0 9px; margin-bottom:5px; border-bottom:1px solid #ece8dc;
  }
  table.mip-rtable td.mip-cell-title::before { content:none; }
  /* Full-width cell — the inline detail/expansion block. */
  table.mip-rtable td.mip-cell-full { order:90; display:block; text-align:left; padding:6px 0 0; border-bottom:none; }
  table.mip-rtable td.mip-cell-full::before { content:none; }
  /* Action cell — full-width tap target at the bottom of the card. */
  table.mip-rtable td.mip-cell-action { order:95; padding:11px 0 2px; border-bottom:none; }
  table.mip-rtable td.mip-cell-action::before { content:none; }
  table.mip-rtable td.mip-cell-action button { width:100%; padding:12px; font-size:14px; }
  /* Checkbox/select cell — a desktop-only power action; hide on phone. */
  table.mip-rtable td.mip-cell-cb { display:none; }

  /* Expanded-row shading on phone — tint the whole card + left accent. */
  table.mip-rtable tbody tr.mip-row-open,
  table.mip-rtable tbody tr.mip-detail-row {
    background:#eaeff7; border-color:#1a1a2e; border-left:4px solid var(--mip-accent,#214084);
  }
  /* Detail card hugs the row card above it so they read as one block. */
  table.mip-rtable tbody tr.mip-detail-row { margin-top:-8px; border-top:none; border-radius:0 0 10px 10px; }
  table.mip-rtable tbody tr.mip-row-open { border-radius:10px 10px 0 0; }
}

/* ── Roster (Deputy-style swim lanes) ── */
.roster-header { margin-bottom: 12px; }
.roster-nav { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.roster-week-label { font-family:"Lora",serif; font-size:18px; font-weight:700; color:#1a1a2e; }

/* Layout: staff sidebar + calendar */
.roster-layout { display:flex; gap:0; border:2px solid #e8e4d8; border-radius:10px; overflow:hidden; background:#fff; }

/* Staff sidebar */
.roster-staff-sidebar {
  width:160px; flex-shrink:0; background:#faf8f3;
  border-right:2px solid #e8e4d8; overflow-y:auto;
}
.roster-sidebar-header {
  font-family:"Fredoka",sans-serif; font-size:12px; font-weight:700;
  text-transform:uppercase; letter-spacing:1px; color:#888;
  padding:10px 12px; border-bottom:1px solid #e8e4d8; height:38px;
  display:flex; align-items:center;
}
.roster-staff-row {
  display:flex; align-items:center; gap:8px; padding:8px 12px;
  border-bottom:1px solid #f0ece0; font-family:"Fredoka",sans-serif; font-size:13px; color:#1a1a2e;
}
.roster-staff-avatar {
  width:28px; height:28px; border-radius:50%; background:#1a1a2e; color:#f5f2eb;
  font-size:10px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.roster-staff-name { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* Calendar area */
.roster-calendar { flex:1; min-width:0; overflow-x:auto; }

/* Day headers */
.roster-day-headers {
  display:grid; grid-template-columns:repeat(7,1fr);
  border-bottom:1px solid #e8e4d8;
}
.roster-dh {
  text-align:center; font-family:"Fredoka",sans-serif; font-size:12px; color:#888;
  padding:8px 4px; border-right:1px solid #e8e4d8;
}
.roster-dh:last-child { border-right:none; }
.roster-dh-today { background:#eef3ff; color:#5c8df6; font-weight:700; }
.roster-dh-num { font-family:"Lora",serif; font-size:16px; font-weight:700; color:#1a1a2e; }
.roster-dh-today .roster-dh-num { color:#5c8df6; }

/* Swim lane per area */
.roster-lane { border-bottom:2px solid #e8e4d8; }
.roster-lane:last-child { border-bottom:none; }
.roster-lane-header {
  font-family:"Fredoka",sans-serif; font-size:13px; font-weight:700;
  color:#1a1a2e; padding:8px 12px; background:#faf8f3;
  border-bottom:1px solid #e8e4d8; display:flex; align-items:center; gap:8px;
}
.roster-lane-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.roster-lane-grid { display:grid; grid-template-columns:repeat(7,1fr); }
.roster-lane-cell {
  min-height:70px; padding:4px; border-right:1px solid #f0ece0;
  display:flex; flex-direction:column; gap:4px; position:relative; overflow:hidden;
}
.roster-lane-cell:last-child { border-right:none; }
.roster-lane-cell-today { background:#f8faff; }

/* Quick-add button in cell */
.roster-cell-add {
  background:none; border:1px dashed #ddd; border-radius:4px;
  color:#ccc; font-size:16px; cursor:pointer; padding:2px; margin-top:auto;
  transition:all .15s;
}
.roster-cell-add:hover { border-color:#5c8df6; color:#5c8df6; background:#eef3ff; }

/* Drag-and-drop highlights */
.roster-staff-row { cursor:grab; transition:opacity .15s; }
.roster-staff-row:active { cursor:grabbing; }
.roster-drop-highlight { outline:2px dashed #5c8df6; outline-offset:-2px; background:#eef3ff !important; }
.roster-shift-card.roster-drop-highlight { outline-color:#34a853; background:#e8f4ea !important; }

/* Copy modal day toggles */
.copy-day-toggle {
  background:#f5f2eb; border:2px solid #e8e4d8; border-radius:8px;
  padding:8px 14px; font-family:"Fredoka",sans-serif; font-size:13px;
  color:#1a1a2e; cursor:pointer; transition:all .15s; font-weight:700;
}
.copy-day-toggle:hover:not(:disabled) { border-color:#5c8df6; background:#eef3ff; }
.copy-day-toggle.copy-day-selected { background:#1a1a2e; border-color:#1a1a2e; color:#fff; }

/* Shift card */
.roster-shift-card {
  background:#f5f2eb; border-radius:6px; padding:6px 8px;
  border-left:3px solid #5c8df6; position:relative;
  font-family:"Fredoka",sans-serif; font-size:11px;
  cursor:grab;
}
.roster-shift-draft {
  border-left-color: #e67e22;
  border-left-style: dashed;
}
.roster-shift-card:active { cursor:grabbing; }
.roster-shift-time { font-weight:700; color:#1a1a2e; margin-bottom:2px; font-size:11px; }
.roster-shift-label { color:#667799; font-size:10px; font-style:italic; margin-bottom:3px; }

/* Staff badges inside shift */
.roster-staff-badge {
  display:flex; align-items:center; justify-content:space-between; gap:3px;
  padding:2px 5px; background:#fff; border-radius:3px;
  font-size:10px; color:#1a1a2e; margin-bottom:2px;
}
.roster-remove-assign {
  background:none; border:none; color:#ccc; font-size:12px; cursor:pointer;
  padding:0 2px; line-height:1;
}
.roster-remove-assign:hover { color:#e05050; }

/* Shift action buttons */
.roster-shift-btns {
  display:flex; gap:2px; margin-top:3px; opacity:0; transition:opacity .15s;
}
.roster-shift-card:hover .roster-shift-btns { opacity:1; }
.roster-btn-sm {
  background:#e8e4d8; border:none; border-radius:3px; cursor:pointer;
  font-size:12px; padding:1px 5px; color:#666; transition:all .1s;
}
.roster-btn-sm:hover { background:#1a1a2e; color:#fff; }
.roster-btn-del:hover { background:#e05050; color:#fff; }

/* Shift form */
.roster-form-field { margin-bottom:14px; }
.roster-form-field label {
  display:block; font-family:"Fredoka",sans-serif; font-size:12px;
  text-transform:uppercase; letter-spacing:1px; color:#888; margin-bottom:5px;
}
.roster-form-field input, .roster-form-field select, .roster-form-field textarea {
  width:100%; box-sizing:border-box; padding:8px 12px;
  border:2px solid #e0dbd0; border-radius:8px;
  font-family:"Fredoka",sans-serif; font-size:14px;
  background:#faf8f3; color:#1a1a2e; outline:none;
}
.roster-form-field input:focus, .roster-form-field select:focus, .roster-form-field textarea:focus { border-color:#1a1a2e; }
.roster-form-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }

/* Staff checklist for bulk assign */
.roster-staff-checklist {
  max-height:200px; overflow-y:auto; border:2px solid #e0dbd0; border-radius:8px;
  padding:8px; background:#faf8f3;
}
.roster-check-row {
  display:flex; align-items:center; gap:8px; padding:6px 8px; border-radius:4px;
  font-family:"Fredoka",sans-serif; font-size:14px; color:#1a1a2e; cursor:pointer;
}
.roster-check-row:hover { background:#eae6dd; }
.roster-check-existing { color:#888; }
.roster-check-row input[type="checkbox"] { width:16px; height:16px; cursor:pointer; }

/* Dark mode roster */

/* Mobile roster */
@media (max-width: 768px) {
  .roster-layout { flex-direction:column; }
  .roster-staff-sidebar { width:100%; border-right:none; border-bottom:2px solid #e8e4d8; display:flex; overflow-x:auto; }
  .roster-sidebar-header { display:none; }
  .roster-staff-row { flex-shrink:0; border-bottom:none; border-right:1px solid #f0ece0; padding:6px 10px; }
  .roster-lane-cell { min-height:50px; padding:3px; }
  .roster-shift-card { font-size:9px; padding:4px 5px; }
  .roster-shift-time { font-size:9px; }
  .roster-staff-badge { font-size:8px; padding:1px 3px; }
  .roster-nav { gap:6px; }
  .roster-week-label { font-size:14px; }
  .roster-lane-header { font-size:12px; padding:6px 10px; }
}

/* ── Planner: drag-swap staff between lanes (native HTML5 DnD) ──
   Only the `.wp-staff-pill` chip is draggable; the rows
   themselves never move. That keeps every production row
   perfectly static and only the small name-chip flies under
   the cursor. The swap happens as a state update on drop. */
.wp-staff-pill {
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.wp-staff-pill:hover {
  background: #fff3cd !important;
  border-color: #f0dcc0 !important;
}
.wp-staff-pill:active {
  cursor: grabbing !important;
}
/* Source pill dims slightly while it's being dragged so the
   user can see which staff is "in flight". */
.wp-staff-pill--dragging {
  opacity: 0.35;
}
/* The row under the cursor gets a subtle highlight to signal
   "drop here to swap". No layout shift, no height change. */
.wp-staff-row.wp-staff-drop-target {
  outline: 2px dashed #e8c77a;
  outline-offset: -2px;
  background: rgba(255, 245, 214, 0.35) !important;
  border-radius: 6px;
}

/* ── Dark mode ── */

/* ── Stocktake (phone-first) ──────────────────────────────── */
.st-wrap { max-width: 640px; margin: 0 auto; padding: 12px 14px 64px; }
.st-loading { padding: 48px 16px; text-align: center; font-family:"Fredoka",sans-serif; color:#888; }
.st-head { display:flex; align-items:center; gap:12px; margin: 6px 0 16px; }
.st-title { font-family:"Lora",serif; font-size:24px; font-weight:700; color:#1a1a2e; margin:0; }
.st-back {
  font-family:"Fredoka",sans-serif; font-size:15px; color:#1a1a2e;
  background:#fff; border:2px solid #1a1a2e; border-radius:8px;
  padding:8px 14px; cursor:pointer; min-height:44px; box-shadow:2px 2px 0 #1a1a2e;
}
.st-bigbtn {
  display:block; width:100%; font-family:"Fredoka",sans-serif; font-size:17px;
  color:#fff; background:#214084; border:2px solid #1a1a2e; border-radius:10px;
  padding:16px; cursor:pointer; min-height:56px; margin:8px 0; box-shadow:3px 3px 0 #1a1a2e;
}
.st-bigbtn:active { transform:translate(2px,2px); box-shadow:1px 1px 0 #1a1a2e; }
.st-search-btn { background:#fff; color:#1a1a2e; }
.st-danger { background:#e7b4b4; color:#1a1a2e; }
.st-delete { background:#a83232; color:#fff; }
.st-input {
  width:100%; box-sizing:border-box; font-family:"Fredoka",sans-serif; font-size:17px;
  color:#1a1a2e; background:#fff; border:2px solid #1a1a2e; border-radius:10px;
  padding:14px; min-height:52px; margin:6px 0;
}
.st-empty { padding:28px 16px; text-align:center; font-family:"Fredoka",sans-serif; color:#888; }
/* ── Stocktake home: "pick a list to start" cards ── */
.st-pick-label { font-family:"Fredoka",sans-serif; font-size:15px; font-weight:600; color:#1a1a2e; margin:4px 0 2px; }
.st-start-grid { display:grid; grid-template-columns:1fr; gap:12px; margin:10px 0 18px; }
.st-start-card {
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  background:#fff; border:2px solid #1a1a2e; border-radius:14px; padding:18px;
  cursor:pointer; box-shadow:3px 3px 0 #1a1a2e; position:relative; min-height:74px;
}
.st-start-card:active { transform:translate(2px,2px); box-shadow:1px 1px 0 #1a1a2e; }
.st-start-main { display:flex; flex-direction:column; gap:3px; min-width:0; }
.st-start-card .st-list-name { font-size:20px; }
.st-start-card .st-edit-link { position:static; top:auto; right:auto; margin-top:8px; align-self:flex-start; }
.st-start-go {
  flex:0 0 auto; font-family:"Fredoka",sans-serif; font-weight:700; font-size:16px;
  color:#fff; background:#214084; border:2px solid #1a1a2e; border-radius:9px;
  padding:10px 16px; white-space:nowrap;
}
.st-start-go--recal { background:#2a9d8f; }
/* Category headings on the stocktake home (Daily / Recalibration) */
.st-cat-head {
  font-family:"Lora",serif; font-size:18px; font-weight:700; color:#1a1a2e;
  margin:18px 0 8px; padding-bottom:5px; border-bottom:2px solid #1a1a2e;
}
.st-cat-head--recal { border-bottom-color:#2a9d8f; }
/* Collection sub-headings inside the count screen (e.g. Full Boxes / Mix n Match) */
.st-coll-head {
  font-family:"Fredoka",sans-serif; font-size:14px; font-weight:600; color:#214084;
  margin:18px 0 6px; padding-bottom:3px; border-bottom:1px solid #c9d4ea;
}
/* Daily / Recalibration category badges on the Manage-lists cards —
   same skewed look as the Cost-Management expense badges (.badge). */
.badge-daily { background:#1a3a5c; color:#7db8f0; border:1.5px solid #2a5a8c; }
.badge-recal { background:#143f3a; color:#7ad9c8; border:1.5px solid #246b60; }
/* Builder category picker */
.st-cat-pick { display:flex; align-items:center; gap:10px; margin-top:12px; }
.st-cat-pick label { font-family:"Fredoka",sans-serif; font-size:14px; font-weight:600; color:#1a1a2e; }
.st-cat-pick .st-input { max-width:200px; }
.st-search-secondary { font-size:15px; min-height:48px; padding:12px; box-shadow:2px 2px 0 #1a1a2e; }
/* On wider screens the cards shouldn't stretch full-width — wrap them
   into a row at a comfortable size; phones stay single full-width column. */
@media (min-width:600px){
  .st-start-grid { grid-template-columns:repeat(auto-fill, 300px); justify-content:start; }
}
.st-list-grid { display:flex; flex-direction:column; gap:10px; margin:10px 0; }
.st-list-card {
  background:#fff; border:2px solid #1a1a2e; border-radius:12px; padding:16px;
  cursor:pointer; box-shadow:3px 3px 0 #1a1a2e; position:relative;
}
.st-list-card:active { transform:translate(2px,2px); box-shadow:1px 1px 0 #1a1a2e; }
.st-list-name { font-family:"Lora",serif; font-size:19px; font-weight:700; color:#1a1a2e; }
.st-list-meta { font-family:"Fredoka",sans-serif; font-size:13px; color:#888; margin-top:2px; }
.st-edit-link {
  position:absolute; top:12px; right:12px; font-family:"Fredoka",sans-serif;
  font-size:13px; color:#1a1a2e; background:#f5f2eb; border:1px solid #1a1a2e;
  border-radius:6px; padding:6px 10px; cursor:pointer; min-height:36px;
}
.st-builder-bar { display:flex; flex-direction:column; gap:8px; margin-top:18px; }
.st-section-label {
  font-family:"Fredoka",sans-serif; font-size:13px; font-weight:600; color:#1a1a2e;
  margin:20px 0 8px; border-bottom:1px solid #d8d3c5; padding-bottom:4px;
}
.st-row {
  background:#fff; border:2px solid #1a1a2e; border-radius:12px;
  padding:14px; margin:10px 0; box-shadow:3px 3px 0 #1a1a2e; position:relative;
}
.st-row-top { display:flex; justify-content:space-between; align-items:baseline; gap:10px; }
.st-row-name { font-family:"Lora",serif; font-size:18px; font-weight:700; color:#1a1a2e; }
.st-row-unit { font-family:"Fredoka",sans-serif; font-size:13px; color:#667; white-space:nowrap; }
.st-row-shopify {
  font-size:10px; background:#1a1a2e; color:#fff; border-radius:4px;
  padding:1px 5px; margin-left:5px; vertical-align:middle;
}
.st-row-cur { font-family:"Fredoka",sans-serif; font-size:13px; color:#888; margin:4px 0 10px; }
.st-row-committed { font-family:"Fredoka",sans-serif; font-size:15px; font-weight:600; color:#c0392b; margin:4px 0 10px; }
.st-row-committed-unit { font-weight:400; font-size:13px; color:#c0392b; opacity:0.8; }
.st-row-input { display:flex; align-items:stretch; gap:10px; }
.st-step {
  flex:0 0 auto; width:58px; font-size:28px; font-family:"Fredoka",sans-serif;
  color:#fff; background:#214084; border:2px solid #1a1a2e; border-radius:10px;
  cursor:pointer; min-height:60px; line-height:1; padding:0;
}
.st-step:active { transform:translateY(2px); }
.st-num {
  flex:1 1 auto; min-width:0; text-align:center; font-family:"Fredoka",sans-serif;
  font-size:26px; font-weight:700; color:#1a1a2e; background:#f5f2eb;
  border:2px solid #1a1a2e; border-radius:10px; padding:8px 90px 8px 8px; min-height:60px;
  width:100%; box-sizing:border-box;
  -moz-appearance:textfield;
}
.st-num::-webkit-outer-spin-button,
.st-num::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.st-num-wrap { position:relative; flex:1 1 auto; min-width:0; display:flex; align-items:stretch; }
.st-num-unit {
  position:absolute; right:12px; top:50%; transform:translateY(-50%);
  font-family:"Fredoka",sans-serif; font-size:18px; font-weight:700;
  color:#888; pointer-events:none;
  max-width:80px; text-align:right; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
/* Manager note shown under the count box on the stocktake screen */
.st-row-note { font-family:"Fredoka",sans-serif; font-size:13px; color:#5a6472; line-height:1.4; margin-top:9px; }
.st-row-status { font-family:"Fredoka",sans-serif; font-size:13px; min-height:18px; margin-top:8px; }
.st-row-status.st-saving { color:#888; }
.st-row-status.st-ok { color:#2a8636; }
.st-row-status.st-err { color:#c0392b; }
.st-retry {
  font-family:"Fredoka",sans-serif; font-size:13px; color:#c0392b; background:#fff;
  border:1px solid #c0392b; border-radius:6px; padding:4px 10px; cursor:pointer; margin-left:4px;
}
.st-add-row, .st-item-row {
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  background:#fff; border:1px solid #d8d3c5; border-radius:10px; padding:12px; margin:8px 0;
}
.st-add-name { font-family:"Fredoka",sans-serif; font-size:15px; font-weight:600; color:#1a1a2e; }
.st-add-tag { font-family:"Fredoka",sans-serif; font-size:12px; color:#888; margin-top:2px; }
/* Builder per-item note input */
.st-note-input {
  display:block; width:100%; margin-top:7px; box-sizing:border-box;
  font-family:"Fredoka",sans-serif; font-size:13px; color:#1a1a2e;
  background:#faf8f2; border:1px solid #d8d3c5; border-radius:8px; padding:7px 9px;
}
.st-note-input:focus { outline:none; border-color:#214084; }
.st-addbtn {
  font-family:"Fredoka",sans-serif; font-size:15px; color:#1a1a2e; background:#9999bb;
  border:2px solid #1a1a2e; border-radius:8px; padding:10px 18px; cursor:pointer; min-height:44px;
}
.st-item-ctrls { display:flex; gap:6px; flex:0 0 auto; }
.st-iconbtn {
  font-family:"Fredoka",sans-serif; font-size:16px; color:#1a1a2e; background:#f5f2eb;
  border:1px solid #1a1a2e; border-radius:8px; width:42px; min-height:42px; cursor:pointer; padding:0;
}
.st-iconbtn:disabled { opacity:0.35; cursor:default; }
.st-iconbtn.st-danger { background:#e7b4b4; }
.st-items-sortable { display:block; }
.st-drag-handle {
  flex:0 0 auto; cursor:grab; color:#999; font-size:18px; line-height:1;
  padding:0 10px 0 2px; user-select:none; letter-spacing:-2px;
}
.st-drag-handle:active { cursor:grabbing; color:#1a1a2e; }
.st-drag-ghost { opacity:0.35; }
.st-drag-chosen { background:#fff8e1 !important; }
label.st-add-row { cursor:pointer; }
.st-add-bulkbar {
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin:10px 0; position:sticky; top:0; background:#f5f2eb; padding:6px 0; z-index:1;
}
.st-pickall {
  font-family:"Fredoka",sans-serif; font-size:15px; color:#1a1a2e;
  display:flex; align-items:center; gap:8px; cursor:pointer;
}
.st-pickall input { width:22px; height:22px; accent-color:#1a1a2e; }
.st-pick { width:24px; height:24px; flex:0 0 auto; accent-color:#1a1a2e; }
.st-recent { margin-top:4px; }
.st-act-row {
  background:#fff; border:1px solid #d8d3c5; border-radius:10px;
  padding:10px 12px; margin:8px 0;
}
.st-act-main { display:flex; justify-content:space-between; align-items:baseline; gap:10px; }
.st-act-item { font-family:"Fredoka",sans-serif; font-size:15px; font-weight:600; color:#1a1a2e; }
.st-act-delta { font-family:"Fredoka",sans-serif; font-size:15px; font-weight:700; white-space:nowrap; }
.st-act-sub { font-family:"Fredoka",sans-serif; font-size:12px; color:#888; margin-top:3px; }

/* ── Checklists ── */
.ck-tabs { display:flex; gap:6px; margin:8px 0 14px; }
.ck-tab {
  flex:1; font-family:"Fredoka",sans-serif; font-size:15px; color:#1a1a2e; background:#fff;
  border:2px solid #1a1a2e; border-radius:8px; padding:10px; cursor:pointer; min-height:44px;
}
.ck-tab.active { background:#214084; color:#fff; }
.ck-tpl-desc { font-family:"Fredoka",sans-serif; font-size:13px; color:#444; margin-top:4px; }
.ck-start-btn { margin-top:10px; }
.ck-cancel-link { background:#e7b4b4 !important; }
.ck-progress { background:#eee; border-radius:4px; height:6px; overflow:hidden; margin-top:8px; }
.ck-progress-fill { background:#2a8636; height:100%; transition:width 0.2s; }
.ck-badge {
  display:inline-block; font-family:"Fredoka",sans-serif; font-size:11px; font-weight:600;
  background:#888; color:#fff; border-radius:4px; padding:1px 6px; margin-left:6px; vertical-align:middle;
}
.ck-badge-cancel { background:#a83232; }
.ck-badge-ok { background:#2a8636; }
.ck-menu-picker { display:flex; flex-direction:column; gap:4px; margin:14px 0 10px; }
.ck-menu-preview {
  background:#fff; border:2px solid #1a1a2e; border-radius:12px; padding:16px;
  box-shadow:3px 3px 0 #1a1a2e; margin:10px 0;
}
.ck-menu-preview .ck-start-btn { margin-top:12px; }
.ck-date-bar {
  display:flex; gap:10px; align-items:center; flex-wrap:wrap;
  background:#fff; border:1px solid #d8d3c5; border-radius:10px;
  padding:10px 12px; margin:10px 0 14px; font-family:"Fredoka",sans-serif; font-size:13px; color:#1a1a2e;
}
.ck-date-bar label { display:flex; align-items:center; gap:6px; }
.ck-date-bar input[type=date] {
  font-family:"Fredoka",sans-serif; font-size:14px; color:#1a1a2e;
  background:#f5f2eb; border:1px solid #1a1a2e; border-radius:6px; padding:6px 8px; min-height:36px;
}
.ck-date-reset {
  font-family:"Fredoka",sans-serif; font-size:16px; color:#1a1a2e; background:#f5f2eb;
  border:1px solid #1a1a2e; border-radius:6px; padding:4px 10px; cursor:pointer; min-height:36px; margin-left:auto;
}
.ck-tpl-meta { display:flex; flex-direction:column; gap:6px; margin-bottom:14px; }
.ck-settings-panel {
  display:flex; flex-direction:column; gap:6px;
  background:#fff; border:1px solid #d8d3c5; border-radius:10px;
  padding:14px; margin:8px 0 18px;
}
.ck-settings-title {
  font-family:"Fredoka",sans-serif; font-size:13px; font-weight:700;
  color:#1a1a2e; text-transform:uppercase; letter-spacing:0.4px;
  border-bottom:1px solid #e8e4d8; padding-bottom:6px; margin-bottom:4px;
}
.ck-settings-divider {
  height:1px; background:#e8e4d8; margin:14px -14px 4px;
}

/* Completed-card add-ons */
.ck-completed-card { padding-bottom:46px; } /* room for the delete link */
.ck-skip-flag {
  position:absolute; top:12px; right:12px;
  width:24px; height:24px; border-radius:50%;
  background:#c0392b; color:#fff; font-weight:700;
  display:flex; align-items:center; justify-content:center;
  font-size:14px; line-height:1; font-family:"Fredoka",sans-serif;
  pointer-events:none; box-shadow:1px 1px 0 #1a1a2e;
}
.ck-delete-link {
  position:absolute; bottom:10px; right:12px; top:auto;
  background:#fff; border:1px solid #c0392b; color:#c0392b;
  font-family:"Fredoka",sans-serif; font-size:12px; font-weight:600;
  padding:4px 10px; border-radius:6px; cursor:pointer; min-height:28px;
}
.ck-delete-link:hover { background:#c0392b; color:#fff; }
.ck-field-label { font-family:"Fredoka",sans-serif; font-size:13px; color:#888; margin-top:8px; }
.ck-textarea { min-height:60px; resize:vertical; padding:10px 14px; }
.ck-save-status { font-family:"Fredoka",sans-serif; font-size:12px; color:#888; min-height:16px; }
.ck-items-sortable { display:block; }
.ck-tpl-item {
  display:flex; align-items:flex-start; gap:8px; background:#fff;
  border:1px solid #d8d3c5; border-radius:10px; padding:10px; margin:8px 0;
}
.ck-tpl-item-main { flex:1; min-width:0; display:flex; flex-direction:column; gap:6px; }
.ck-label-input { margin:0; padding:8px 10px; font-size:15px; min-height:42px; }
.ck-tpl-item-controls { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.ck-type-select {
  font-family:"Fredoka",sans-serif; font-size:14px; color:#1a1a2e; background:#fff;
  border:1px solid #1a1a2e; border-radius:8px; padding:6px 8px; min-height:36px;
}
.ck-req-photo { font-family:"Fredoka",sans-serif; font-size:13px; color:#1a1a2e; display:flex; align-items:center; gap:6px; cursor:pointer; }
.ck-req-photo input { width:18px; height:18px; accent-color:#1a1a2e; }
.ck-req-photo-disabled { font-family:"Fredoka",sans-serif; font-size:13px; color:#888; font-style:italic; }

.ck-run-meta { font-family:"Fredoka",sans-serif; font-size:12px; color:#666; margin-bottom:14px; }
.ck-item {
  background:#fff; border:2px solid #1a1a2e; border-radius:12px;
  padding:14px; margin:10px 0; box-shadow:3px 3px 0 #1a1a2e;
}
.ck-item-done { background:#e8f4e8; }
.ck-item-top { display:flex; gap:12px; align-items:flex-start; }
.ck-tickbox {
  flex:0 0 auto; width:44px; height:44px; border:2px solid #1a1a2e; border-radius:10px;
  background:#fff; cursor:pointer; font-size:24px; line-height:1; color:#fff;
  display:flex; align-items:center; justify-content:center; padding:0;
}
.ck-tickbox-on { background:#2a8636; border-color:#1f6629; }
.ck-item-body { flex:1; min-width:0; }
.ck-item-label { font-family:"Lora",serif; font-size:17px; font-weight:700; color:#1a1a2e; line-height:1.3; }
.ck-text-input { margin-top:8px; font-size:16px; padding:10px 12px; min-height:46px; }
.ck-text-readonly { font-family:"Fredoka",sans-serif; font-size:15px; color:#1a1a2e; background:#f5f2eb; border:1px solid #d8d3c5; border-radius:6px; padding:8px 10px; margin-top:8px; }
.ck-item-attr { font-family:"Fredoka",sans-serif; font-size:12px; color:#888; margin-top:6px; }

.ck-photos { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; align-items:flex-start; }
.ck-photo-thumb { position:relative; width:70px; height:70px; border-radius:8px; overflow:hidden; border:1px solid #d8d3c5; }
.ck-photo-thumb img { width:100%; height:100%; object-fit:cover; cursor:pointer; display:block; }
.ck-photo-del {
  position:absolute; top:2px; right:2px; width:22px; height:22px; border-radius:50%;
  background:rgba(0,0,0,0.6); color:#fff; border:none; font-size:13px; line-height:1; cursor:pointer; padding:0;
}
.ck-photo-add {
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  width:70px; height:70px; border:2px dashed #1a1a2e; background:#f5f2eb; border-radius:8px;
  font-family:"Fredoka",sans-serif; font-size:11px; color:#1a1a2e; cursor:pointer; padding:0;
}
.ck-photo-add span { font-size:10px; }

.ck-actions-bar { margin-top:24px; }
.ck-submit-btn { background:#47c299; }

.ck-modal-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,0.55); z-index:9999;
  display:flex; align-items:center; justify-content:center; padding:16px;
}
.ck-modal {
  background:#fff; border:2px solid #1a1a2e; border-radius:12px; padding:20px;
  max-width:420px; width:100%; box-shadow:4px 4px 0 #1a1a2e; max-height:80vh; overflow:auto;
}
.ck-modal h3 { font-family:"Lora",serif; font-size:20px; margin:0 0 8px; color:#1a1a2e; }
.ck-modal p { font-family:"Fredoka",sans-serif; font-size:14px; color:#444; margin:0 0 12px; }
.ck-missing-list { list-style:none; padding:0; margin:0 0 14px; }
.ck-missing-list li {
  display:flex; justify-content:space-between; align-items:center; gap:10px;
  padding:8px 10px; border-bottom:1px solid #eee; font-family:"Fredoka",sans-serif; font-size:14px;
}
.ck-missing-list li { flex-direction:column; align-items:stretch; gap:6px; }
.ck-missing-head { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.ck-missing-label { color:#1a1a2e; font-weight:600; }
.ck-missing-reason { color:#c0392b; font-size:12px; white-space:nowrap; }
.ck-skip-input { margin:0; min-height:40px; font-size:14px; padding:8px 10px; }
.ck-submit-btn[disabled] { opacity:0.5; cursor:not-allowed; }
.ck-skip-note {
  font-family:"Fredoka",sans-serif; font-size:13px; color:#a35a00;
  background:#fff4e0; border:1px solid #f0d18a; border-radius:6px;
  padding:6px 10px; margin-top:8px;
}
.ck-skip-attr { font-size:11px; color:#7a5b00; margin-top:3px; }

/* Wheel customise — used inline in the Admin panel */
.wcm-collapsible {
  background:#fff; border:2px solid #1a1a2e; border-radius:12px;
  padding:0; box-shadow:3px 3px 0 #1a1a2e; overflow:hidden;
}
.wcm-collapsible-summary {
  list-style:none; cursor:pointer; padding:14px 16px;
  display:flex; align-items:center; justify-content:space-between; gap:10px;
}
.wcm-collapsible-summary::-webkit-details-marker { display:none; }
.wcm-chevron {
  font-family:"Fredoka",sans-serif; font-size:18px; color:#1a1a2e;
  transition:transform .2s;
}
.wcm-collapsible[open] .wcm-chevron { transform:rotate(180deg); }
.wcm-collapsible-body { padding:0 16px 16px; }
.wcm-roleblock {
  margin-bottom:18px; padding:14px; background:#fafaf6;
  border:1px solid #d8d3c5; border-radius:10px;
}
.wcm-roleblock-title {
  font-family:"Fredoka",sans-serif; font-size:14px; font-weight:700;
  color:#214084; text-transform:uppercase; letter-spacing:0.4px;
  margin-bottom:10px;
}
.wcm-actions {
  display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-top:14px;
}
.wcm-actions .st-bigbtn { display:inline-block; width:auto; margin:0; }
.wcm-status { font-family:"Fredoka",sans-serif; font-size:13px; color:#888; }
.wcm-status.ok { color:#2a8636; }
.wcm-status.err { color:#c0392b; }

.wcm-group { margin:14px 0; padding-top:10px; border-top:1px solid #e8e4d8; }
.wcm-group:first-of-type { border-top:none; padding-top:0; }
.wcm-group-title {
  font-family:"Fredoka",sans-serif; font-weight:700; font-size:14px;
  color:#1a1a2e; margin-bottom:8px; display:flex; justify-content:space-between; align-items:baseline;
}
.wcm-count { font-weight:400; font-size:12px; color:#888; }
.wcm-options { display:flex; flex-wrap:wrap; gap:6px; }
.wcm-option {
  display:inline-flex; align-items:center; gap:6px;
  padding:6px 10px; border:1px solid #d8d3c5; border-radius:14px;
  font-family:"Fredoka",sans-serif; font-size:13px; color:#1a1a2e;
  background:#fff; cursor:pointer; user-select:none;
}
.wcm-option.is-on { background:#214084; color:#fff; border-color:#214084; }
.wcm-option input { width:16px; height:16px; accent-color:#214084; }
.wcm-option input:disabled + * { opacity:0.6; }

/* Inline pills next to run-item labels */
.ck-pill {
  display:inline-block; font-family:"Fredoka",sans-serif; font-size:11px;
  font-weight:600; border-radius:10px; padding:1px 8px; margin-left:6px;
  vertical-align:middle; white-space:nowrap;
}
.ck-pill-oneoff { background:#fff4e0; color:#a35a00; border:1px solid #f0d18a; }
.ck-pill-random { background:#e8f0ff; color:#1a3a99; border:1px solid #b3c6e8; }

/* Random-photo row inside the template editor */
.ck-random-row {
  background:#fff; border:1px solid #d8d3c5; border-radius:10px;
  padding:10px 12px; margin:8px 0 14px; display:flex; flex-direction:column; gap:6px;
}
.ck-random-row .ck-field-label { margin:0; }
.ck-random-count-input { max-width:120px; margin:0; padding:8px 10px; font-size:15px; min-height:40px; }
.ck-field-hint { font-family:"Fredoka",sans-serif; font-size:12px; color:#888; }

/* Scheduled one-off items section */
.ck-pending-list { display:flex; flex-direction:column; gap:8px; margin:8px 0; }
.ck-pending-empty { padding:14px 12px; }
.ck-pending-row {
  display:flex; align-items:flex-start; gap:8px; background:#fff;
  border:1px solid #d8d3c5; border-radius:10px; padding:10px;
}
.ck-pending-main { flex:1; min-width:0; display:flex; flex-direction:column; gap:6px; }
.ck-pending-controls { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.ck-pending-date { display:flex; align-items:center; gap:6px; font-family:"Fredoka",sans-serif; font-size:13px; color:#1a1a2e; }
.ck-pending-date-lbl { color:#888; }
.ck-pending-date input[type=date] {
  font-family:"Fredoka",sans-serif; font-size:14px; color:#1a1a2e;
  background:#f5f2eb; border:1px solid #1a1a2e; border-radius:6px;
  padding:6px 8px; min-height:36px;
}
.ck-pending-label-readonly { font-family:"Fredoka",sans-serif; font-size:15px; font-weight:600; color:#1a1a2e; padding:8px 4px 0; }
.ck-pending-readonly-meta { font-family:"Fredoka",sans-serif; font-size:12px; color:#888; }
.ck-pending-pill {
  display:inline-block; font-family:"Fredoka",sans-serif; font-size:11px;
  font-weight:600; border-radius:10px; padding:2px 8px; white-space:nowrap;
}
.ck-pill-scheduled { background:#e3efe3; color:#1a5a25; border:1px solid #bcd6bc; }
.ck-pill-missed   { background:#ffe0e0; color:#a32626; border:1px solid #f0a6a6; }
.ck-pill-consumed { background:#eee; color:#666; border:1px solid #ccc; }

/* Sections (template builder rows + run-view headings) */
.ck-tpl-section {
  background:#f5f2eb; border:1px solid #c8c4b8; padding:8px 10px;
}
.ck-section-input {
  margin:0; padding:8px 12px; font-family:"Lora",serif; font-size:18px;
  font-weight:700; color:#1a1a2e; min-height:44px; background:#fff;
  border:1px solid #c8c4b8; flex:1;
}
.ck-run-section {
  font-family:"Lora",serif; font-size:20px; font-weight:700; color:#1a1a2e;
  margin:22px 0 8px; padding-bottom:6px; border-bottom:2px solid #1a1a2e;
}

/* Per-item description (builder textarea + run-view sub-line) */
.ck-item-desc-input {
  margin:6px 0 0; padding:6px 10px; font-family:"Fredoka",sans-serif;
  font-size:13px; min-height:34px; color:#555; background:#fafaf6;
  border:1px solid #d8d3c5; resize:vertical;
}
.ck-item-desc {
  font-family:"Fredoka",sans-serif; font-size:13px; color:#666;
  line-height:1.4; margin-top:4px; white-space:pre-wrap;
}

/* Two-button add row in the template editor */
.ck-add-row { display:flex; flex-direction:column; gap:8px; margin-top:14px; }

.ck-photo-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,0.85); z-index:10000;
  display:flex; align-items:center; justify-content:center; padding:12px;
}
.ck-photo-overlay img { max-width:100%; max-height:100%; object-fit:contain; border-radius:6px; }
.ck-photo-close {
  position:absolute; top:14px; right:14px; width:40px; height:40px; border-radius:50%;
  background:rgba(255,255,255,0.9); color:#1a1a2e; border:none; font-size:18px; cursor:pointer;
}

/* Dark mode home page */

/* Dark mode login */

/* Dark mode admin/serve/misc */

/* ═══════════════════════════════════════════════════════════
   Training & Progression
   ═══════════════════════════════════════════════════════════ */
.tr-wrap { font-family:Fredoka, sans-serif; padding:10px 4px 60px; }
.tr-header { padding:0 8px 12px; }
.tr-tabbar {
  display:flex; flex-wrap:wrap; gap:6px;
  border-bottom:1px solid #e8e3d4; padding-bottom:0;
}
.tr-tab {
  background:transparent; border:none; padding:8px 14px;
  font-family:Fredoka, sans-serif; font-size:13px; color:#666;
  border-bottom:2px solid transparent; cursor:pointer; white-space:nowrap;
}
.tr-tab.active { color:#1a1a2e; border-bottom-color:#47c299; font-weight:600; }
.tr-tab:hover { color:#1a1a2e; }
.tr-body { padding:14px 8px; }
.tr-empty {
  font-family:Fredoka, sans-serif; color:#888; font-size:13px;
  padding:30px 18px; text-align:center; background:#faf8f1;
  border:1px dashed #d4cfc1; border-radius:8px;
}
.tr-group-title {
  font-family:Fredoka, sans-serif; font-size:11px; font-weight:700;
  letter-spacing:.6px; text-transform:uppercase; color:#888;
  margin:18px 0 8px;
}
.tr-actions-row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:10px; }
.tr-card-grid {
  display:grid; gap:12px;
  grid-template-columns:repeat(auto-fill, minmax(260px, 1fr));
}
.tr-card {
  background:#fff; border:1px solid #e8e3d4; border-radius:8px; padding:12px 14px;
  font-family:Fredoka, sans-serif; font-size:13px;
}
.tr-card-title { font-family:Lora, serif; font-size:15px; font-weight:600; margin-bottom:4px; }
.tr-card-meta { font-size:12px; color:#666; margin-top:4px; display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.tr-card-actions { display:flex; gap:6px; margin-top:10px; flex-wrap:wrap; }
.tr-progress {
  background:#f0ece0; height:8px; border-radius:4px; overflow:hidden;
  margin-top:6px;
}
.tr-progress-bar { background:#47c299; height:100%; transition:width .25s ease; }

/* Form rows */
.tr-form-row { margin-bottom:14px; }
.tr-form-row label {
  display:block; font-size:11px; font-weight:600;
  letter-spacing:.4px; text-transform:uppercase; color:#666;
  margin-bottom:4px;
}
.tr-input {
  font-family:Fredoka, sans-serif; font-size:14px;
  padding:8px 10px; border:1px solid #d4cfc1; border-radius:6px;
  background:#fff; width:100%; max-width:480px; box-sizing:border-box;
}
.tr-input-small { font-size:12px; padding:6px 8px; }

/* Criterion rows in module builder */
.tr-crit-row {
  display:flex; gap:8px; align-items:flex-start; background:#faf8f1;
  border:1px solid #e8e3d4; border-radius:6px; padding:8px; margin-bottom:6px;
}
.tr-crit-handle {
  cursor:grab; font-size:14px; color:#888; padding-top:8px;
  user-select:none; line-height:1;
}
.tr-pw-row {
  display:flex; gap:8px; align-items:center; background:#faf8f1;
  border:1px solid #e8e3d4; border-radius:6px; padding:8px; margin-bottom:6px;
}

/* Expandable pathway card with nested levels + modules */
.tr-pw-section {
  background:#fff; border:1px solid #e8e3d4; border-radius:8px;
  overflow:hidden;
}
.tr-pw-summary {
  display:flex; align-items:center; gap:10px;
  padding:10px 14px; cursor:pointer;
  list-style:none; background:#faf8f1;
  font-family:Fredoka, sans-serif;
}
.tr-pw-summary::-webkit-details-marker { display:none; }
.tr-pw-summary::before {
  content:"▸"; color:#888; transition:transform .15s ease;
  flex:0 0 12px; text-align:center;
}
.tr-pw-section[open] > .tr-pw-summary::before { transform:rotate(90deg); }

.tr-pw-body {
  padding:14px;
  border-top:1px solid #e8e3d4;
}
.tr-pw-subhead {
  font-family:Fredoka, sans-serif; font-size:11px; font-weight:700;
  letter-spacing:.6px; text-transform:uppercase; color:#888;
  margin-bottom:6px;
}
.tr-pw-bead-grid {
  display:flex; flex-wrap:wrap; gap:8px;
  margin-bottom:6px;
}
.tr-pw-bead-grid-indented { margin-left:46px; }
.tr-pw-bead {
  background:#faf8f1; border:1px solid #e8e3d4; border-radius:8px;
  padding:4px 10px 4px 4px; display:inline-flex; align-items:center; gap:6px;
  font-family:Fredoka, sans-serif; font-size:12px; cursor:pointer;
}
.tr-pw-bead:hover { background:#f0ece0; }
.tr-pw-level {
  margin-top:10px; padding:8px; background:#faf8f1;
  border:1px solid #e8e3d4; border-radius:6px;
}
.tr-pw-level-header {
  display:flex; align-items:center; gap:10px;
  background:none; border:none; padding:0; cursor:pointer;
  font-family:Fredoka, sans-serif; color:#1a1a2e;
}
.tr-pw-level-header:hover { color:#000; }
.tr-pw-level-sublabel {
  font-family:Fredoka, sans-serif; font-size:10px; font-weight:700;
  letter-spacing:.5px; text-transform:uppercase; color:#666;
  margin:8px 0 4px 46px;
}
.tr-badge-pathway-list { display:flex; flex-direction:column; gap:6px; margin-bottom:10px; }
.tr-badge-subgroup-label {
  font-family:Fredoka, sans-serif; font-size:10px; font-weight:700;
  letter-spacing:1px; text-transform:uppercase; color:#888;
  margin:4px 0 6px;
}
.tr-badge-row {
  display:flex; gap:8px; align-items:center; background:#fff;
  border:1px solid #e8e3d4; border-radius:6px; padding:8px 10px;
}
.tr-badge-row[draggable] { cursor:default; }

/* Linked-chip ("Required modules" / "Prerequisite badges") */
.tr-chip-link {
  display:inline-flex; align-items:center; gap:6px;
  background:#1a1a2e; color:#fff; border-radius:16px; padding:4px 10px;
  font-size:12px; font-family:Fredoka, sans-serif;
  margin:4px 6px 0 0;
}
.tr-chip-link button {
  background:none; border:none; color:#fff; cursor:pointer; font-size:14px;
  line-height:1; padding:0 2px;
}

/* Badge chips on My Training cards */
.tr-badge-chip {
  display:inline-flex; align-items:center; gap:4px; font-size:11px;
  background:#f0ece0; padding:2px 8px 2px 2px; border-radius:14px;
  font-family:Fredoka, sans-serif;
}

/* Badge grid (My Badges, staff panel) */
.tr-badge-grid {
  display:grid; gap:12px;
  grid-template-columns:repeat(auto-fill, minmax(150px, 1fr));
}
.tr-badge-tile {
  background:#fff; border:1px solid #e8e3d4; border-radius:8px;
  padding:14px 10px; text-align:center;
  display:flex; flex-direction:column; align-items:center; gap:6px;
  font-family:Fredoka, sans-serif;
}
.tr-badge-tile-name { font-family:Lora, serif; font-weight:600; font-size:14px; }
.tr-badge-tile-meta { font-size:11px; color:#888; }
.tr-badge-tile-note { font-size:12px; color:#444; font-style:italic; margin-top:2px; }

/* Review-state chips */
.tr-chip {
  display:inline-block; font-size:10px; font-weight:700; letter-spacing:.4px;
  text-transform:uppercase; padding:2px 7px; border-radius:4px;
  font-family:Fredoka, sans-serif;
}
.tr-chip-red    { background:#fde7e7; color:#a31e1e; }
.tr-chip-amber  { background:#fff3cd; color:#a06200; }
.tr-chip-green  { background:#e8f5e9; color:#1a6b3a; }

/* Completed-row action pills — same skewed-pill look as the
   cost management Fixed/Approx/Loan badges. Keep colours per
   action: refresher = navy, revoke + delete = red. */
.tr-pill-btn {
  display:inline-block;
  padding:4px 10px;
  border-radius:4px;
  font-family:"Fredoka",sans-serif;
  font-size:11px;
  font-weight:700;
  transform:skewX(-5deg);
  white-space:nowrap;
  flex-shrink:0;
  cursor:pointer;
  border:1.5px solid;
  letter-spacing:0.3px;
  line-height:1.3;
  transition:filter 0.12s;
}
.tr-pill-btn:hover  { filter:brightness(1.15); }
.tr-pill-btn:active { filter:brightness(0.9); }
.tr-pill-btn-refresher { background:#1a3a5c; color:#7db8f0; border-color:#2a5a8c; }
.tr-pill-btn-revoke    { background:#5c1a1a; color:#f07d7d; border-color:#8c2a2a; }
.tr-pill-btn-delete    { background:#3a0f0f; color:#c87d7d; border-color:#6a2020; }

/* Career path row */
.tr-tree-row {
  margin-bottom:18px; padding:14px 10px; background:#faf8f1;
  border:1px solid #e8e3d4; border-radius:8px;
}
.tr-tree-name {
  font-family:Lora, serif; font-weight:600; font-size:14px;
  margin-bottom:10px; color:#1a1a2e;
}
/* Section wrapper holds multiple labelled groups. Desktop: side by
   side with a thin vertical divider between them. Mobile: stack
   vertically with a horizontal rule between sections so each level
   gets its own row that scrolls independently. */
.tr-tree-chain-wrap {
  display:flex; align-items:flex-start; gap:14px;
  overflow-x:auto; padding:6px 4px 2px;
}
.tr-tree-section {
  display:flex; flex-direction:column; align-items:center;
  min-width:max-content; flex-shrink:0;
}
.tr-tree-section-label {
  font-family:Fredoka, sans-serif; font-size:10px; font-weight:700;
  letter-spacing:1.2px; text-transform:uppercase; color:#888;
  margin-bottom:6px; text-align:center;
}
.tr-tree-section-divider {
  flex:0 0 2px;
  background:#b8b0a0;
  align-self:stretch;
  margin:8px 0;
  border-radius:1px;
  min-height:50px;
}

@media (max-width:600px) {
  /* Stack sections vertically — each section becomes a row that
     scrolls horizontally on its own if needed. Avoids beads
     overlapping when the row gets cramped. */
  .tr-tree-chain-wrap {
    flex-direction:column;
    align-items:stretch;
    gap:6px;
    overflow-x:visible;
  }
  .tr-tree-section {
    min-width:0; width:100%; flex-shrink:1;
  }
  .tr-tree-section .tr-tree-chain {
    overflow-x:auto;
    padding-bottom:4px;
  }
  .tr-tree-section-divider {
    flex:0 0 1px;
    width:100%;
    min-height:1px;
    height:1px;
    margin:4px 0;
    align-self:stretch;
  }
}
.tr-tree-chain {
  display:flex; align-items:flex-start; gap:14px;
  padding:4px 0;
}
.tr-tree-bead-area {
  /* Fixed at the largest bead (level = 100) so smaller beads centre
     within the same vertical band. Keeps the connection line aligned
     on every node regardless of badge type. */
  height:110px; display:flex; align-items:center; justify-content:center;
}
.tr-tree-node {
  display:flex; flex-direction:column; align-items:center; gap:6px;
  cursor:default; min-width:80px;
}
.tr-tree-label {
  font-family:Fredoka, sans-serif; font-size:11px; color:#1a1a2e;
  text-align:center; max-width:90px;
}
.tr-tree-conn {
  flex:0 0 32px; height:2px; background:#d4cfc1; border-radius:1px;
  /* Half the bead-area height (110/2 = 55) puts the line on the
     visual centre of every bead, regardless of size. */
  margin-top:55px;
}
@media (max-width:600px) {
  .tr-tree-chain { gap:14px; }
  .tr-tree-conn { flex:0 0 22px; }
}

/* Level milestone "LEVEL" pill overlay. Ring colour itself is set
   inline by _trEmblemHtml() based on badge_type — see that function
   for the gold / blue / rainbow / green palette. */
.tr-tree-node-level .tr-tree-level-wrap { position:relative; display:inline-block; }
.tr-tree-level-pill {
  position:absolute; left:50%; bottom:-8px; transform:translateX(-50%);
  background:#1a1a2e; color:#fff;
  font-family:Fredoka, sans-serif; font-size:9px; font-weight:700;
  letter-spacing:1px; padding:3px 9px; border-radius:10px;
  box-shadow:0 1px 4px rgba(0,0,0,0.25);
  border:2px solid #fff;
}
.tr-tree-level-pill-earned { background:#b48a1f; color:#fff; }
/* Cross-pathway level used as a prereq — smaller bead, blue PREREQ
   pill so it reads consistently with the prereq_module ring colour. */
.tr-tree-prereq-pill {
  background:#1565c0;
  font-size:8px;
  padding:2px 7px;
}
.tr-tree-prereq-pill.tr-tree-level-pill-earned { background:#1565c0; }

/* My Training — collapsible level sections */
.tr-my-section {
  background:#faf8f1; border:1px solid #e8e3d4; border-radius:8px;
  padding:10px 14px; margin-bottom:10px;
}
.tr-my-section > summary {
  display:flex; align-items:center; gap:8px;
  cursor:pointer; list-style:none; padding:4px 0;
  font-family:Fredoka, sans-serif;
}
.tr-my-section > summary::-webkit-details-marker { display:none; }
.tr-my-section > summary::before {
  content:"▸"; color:#888; transition:transform .15s ease;
  flex:0 0 12px; text-align:center;
}
.tr-my-section[open] > summary::before { transform:rotate(90deg); }

/* Module level-filter pills */
.tr-mod-filter {
  display:flex; flex-wrap:wrap; gap:6px;
  margin:8px 0 14px;
}
.tr-mod-filter-pill {
  background:#fff; border:1px solid #d4cfc1; border-radius:14px;
  padding:5px 10px; font-family:Fredoka, sans-serif; font-size:12px;
  color:#666; cursor:pointer; display:inline-flex; align-items:center; gap:4px;
}
.tr-mod-filter-pill:hover { color:#1a1a2e; }
.tr-mod-filter-pill.active {
  background:#1a1a2e; color:#fff; border-color:#1a1a2e;
}
.tr-mod-filter-count {
  background:#f0ece0; color:#666;
  font-size:10px; font-weight:700; padding:1px 6px; border-radius:8px;
  font-family:Fredoka, sans-serif;
}
.tr-mod-filter-pill.active .tr-mod-filter-count { background:#47c299; color:#fff; }

/* Modules list inside the badge editor (drag-reorderable) */
.tr-mod-list { display:flex; flex-direction:column; gap:6px; margin-bottom:6px; }
.tr-mod-row {
  display:flex; align-items:center; gap:10px;
  background:#fff; border:1px solid #e8e3d4; border-radius:6px;
  padding:6px 10px;
}
.tr-mod-row .tr-crit-handle { padding:0; }
.tr-mod-row .recipe-btn { padding:2px 8px; font-size:14px; }

/* Team-table */
.tr-team-table {
  width:100%; border-collapse:collapse; font-family:Fredoka, sans-serif; font-size:13px;
  background:#fff; border:1px solid #e8e3d4; border-radius:8px; overflow:hidden;
}
.tr-team-table th {
  background:#faf8f1; text-align:left; padding:8px 10px; font-size:11px;
  font-weight:700; letter-spacing:.4px; text-transform:uppercase; color:#666;
  border-bottom:1px solid #e8e3d4;
}
.tr-team-table td {
  padding:10px; border-bottom:1px solid #f0ece0;
}
.tr-team-table tbody tr { cursor:pointer; }
.tr-team-table tbody tr:hover { background:#faf8f1; }

/* Instance criterion view (inside modal) */
.tr-crit-view {
  display:flex; align-items:flex-start; gap:10px;
  padding:10px; border:1px solid #e8e3d4; border-radius:6px;
  margin-bottom:6px; background:#fff;
  font-family:Fredoka, sans-serif; font-size:13px;
}
.tr-crit-view.tr-crit-done { background:#f4faf5; border-color:#bfe6cd; }
.tr-crit-view input[type=checkbox] { margin-top:4px; transform:scale(1.2); cursor:pointer; }
.tr-crit-view input[type=checkbox]:disabled { cursor:not-allowed; opacity:.4; }

/* Home wheel review pill */
.home-wheel-review-pill {
  position:absolute; top:-6px; right:-6px;
  min-width:18px; height:18px; padding:0 5px;
  background:#c0392b; color:#fff;
  font-size:10px; font-weight:700;
  border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 1px 3px rgba(0,0,0,0.3);
  border:2px solid #fff;
  font-family:Fredoka, sans-serif;
  z-index:2;
}

/* Labelled two-state switch for admin toggles (Cut over tab). Shows both
   options side by side with the active one filled, so it's obvious which
   state is live — no guessing which way a tick means. */
.mip-switch { display:inline-flex; align-items:center; cursor:pointer; }
.mip-switch input { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.mip-switch-track {
  display:inline-flex; border:1px solid #d8d2c4; border-radius:999px;
  overflow:hidden; background:#f0ece1;
  font-family:Fredoka, sans-serif; font-size:13px; font-weight:600;
  user-select:none; white-space:nowrap;
}
.mip-switch-opt { padding:7px 16px; color:#9a9384; transition:background .15s ease, color .15s ease; }
.mip-switch input:not(:checked) ~ .mip-switch-track .mip-switch-off { background:#1a1a2e; color:#fff; }
.mip-switch input:checked ~ .mip-switch-track .mip-switch-on { background:#1a1a2e; color:#fff; }
.mip-switch input:focus-visible ~ .mip-switch-track { outline:2px solid #47c299; outline-offset:2px; }

