/* Gameplay-only elements: morning headline, Riley's tour, report cards, sales feedback. */
#ags-headline {
  position: fixed;
  left: 50%;
  top: calc(var(--view-top, 0px) + 150px);
  transform: translate(-50%, -8px);
  max-width: min(560px, calc(100vw - 32px));
  background: #fffdf6;
  color: var(--ink, #191c1e);
  border: 1px solid #efe3c4;
  border-radius: 14px;
  padding: 10px 16px;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 10px 30px rgba(20, 30, 50, 0.14);
  opacity: 0;
  pointer-events: none;
  z-index: 29;
  transition:
    opacity 0.35s,
    transform 0.35s;
}
#ags-headline.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
#ags-headline::before {
  content: 'THIS MORNING  ';
  font-size: 12px;
  letter-spacing: 0.12em;
  color: #b0884a;
  font-weight: 700;
}
#ags-guide {
  position: fixed;
  left: 16px;
  bottom: calc(170px + env(safe-area-inset-bottom, 0px));
  width: min(360px, calc(100vw - 32px));
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 14px 40px rgba(20, 30, 50, 0.2);
  z-index: 28;
  font-size: 13px;
  line-height: 1.5;
}
#ags-guide small {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted, #778294);
  font-weight: 700;
}
#ags-guide p {
  margin: 4px 0 10px;
}
#ags-guide .row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.ags-guide-who {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green, #0052cc);
  color: #fff;
  font-weight: 700;
}
.ags-pulse {
  position: relative;
  animation: ags-pulse 1.4s ease-in-out infinite;
}
@keyframes ags-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(0, 102, 237, 0.45);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(0, 102, 237, 0);
  }
}
@media (max-width: 760px) {
  #ags-guide {
    left: 16px;
    top: calc(var(--view-top, 0px) + 160px);
    bottom: auto;
    padding: 10px 12px;
    font-size: 12px;
  }
  #ags-guide p {
    margin: 2px 0 6px;
  }
  #ags-headline {
    top: calc(var(--view-top, 0px) + 120px);
  }
}
.year-strip {
  margin: 0 0 10px;
  border: 1px solid var(--line, #e1e6ef);
  border-radius: 12px;
  padding: 8px 12px;
  background: #fafbfd;
  font-size: 12px;
}
.year-strip summary {
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  list-style: none;
}
.year-strip summary::-webkit-details-marker {
  display: none;
}
.year-strip summary span {
  color: var(--muted, #778294);
}
.year-strip summary i {
  font-style: normal;
}
.year-panel .task small {
  display: block;
}
.negative,
.year-strip .negative {
  color: #c2410c;
}
.note.negative {
  background: #fff1e8;
  color: #9a3412;
}
.report-card {
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #0f2a4f, #1c4f8f);
  color: #fff;
  position: relative;
}
.report-card .eyebrow,
.report-card small {
  color: #bcd3f5;
}
/* Tiles: light text on translucent dark-blue tiles (white on ~#2a5a96 is about 7:1). */
.report-card .stat-grid {
  margin: 14px 0 8px;
  padding-right: 0;
}
.report-card .stat-grid > div {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.report-card .stat-grid small {
  color: #dbe8fb;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.report-card .stat-grid strong {
  color: #fff;
}
.report-card .negative,
.report-card .stat-grid strong.negative {
  color: #ffc9a8;
}
.report-card > .eyebrow {
  padding-right: 92px;
}
.report-grade {
  position: absolute;
  right: 14px;
  top: 8px;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border: 4px solid #ffe08a;
  border-radius: 50%;
  color: #ffe08a;
  font-size: 46px;
  font-weight: 800;
  line-height: 1;
  transform: rotate(-8deg);
  box-shadow:
    0 0 0 3px rgba(255, 224, 138, 0.25),
    inset 0 0 0 2px rgba(255, 224, 138, 0.35);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}
.report-card[data-grade^='C'] .report-grade,
.report-card[data-grade^='D'] .report-grade,
.report-card[data-grade^='F'] .report-grade {
  color: #ffc9a8;
  border-color: #ffc9a8;
}
.report-card .report-grade + .stat-grid {
  margin-top: 46px;
}
.report-foot {
  font-size: 13px;
  color: #e3ecff;
}
/* Friday: the report card already covers the day; don't repeat the day tiles under it. */
.modal .report-card ~ .stat-grid {
  display: none;
}
.ending-card {
  margin-top: 8px;
}
.chapter-stars {
  font-size: 26px;
  letter-spacing: 4px;
  color: #e3a008;
  margin: 4px 0 10px;
}
.cliffhanger {
  font-style: italic;
  border-left: 3px solid var(--coral, #0066ed);
  padding-left: 10px;
}
.forecast-line {
  font-size: 12px;
}
.price-slider {
  display: block;
  margin: 10px 0;
  font-size: 12px;
}
.price-slider input {
  width: 100%;
}
.persona-tag {
  font-size: 12px;
  background: #fff7e6;
  border-radius: 8px;
  padding: 6px 10px;
}
.sales-feedback {
  margin: 8px 0;
  font-size: 12px;
}
.sales-feedback summary {
  cursor: pointer;
  font-weight: 700;
}
.sales-feedback.good summary {
  color: #15803d;
}
.sales-feedback.fine summary {
  color: #475569;
}
.sales-feedback.warn summary {
  color: #b45309;
}
.sales-feedback.bad summary {
  color: #b91c1c;
}
.current-brief {
  border-radius: 12px;
  padding: 10px 12px;
  margin: 10px 0;
  background: #e8f5ec;
  border: 1px solid #bfe3cb;
}
.current-brief small {
  display: block;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: #2f6b45;
}
.current-brief.none {
  background: #fff5ec;
  border-color: #f3d3b5;
}
.current-brief.none small {
  color: #9a5a1f;
}
.retainer-card {
  border-left: 3px solid #15803d;
}
/* Round 2: Riley's tour card docked inside the sheet peek (phones / tablet portrait) or the desktop panel. */
#sheet-peek #ags-guide,
#sheet #ags-guide,
#panel #ags-guide {
  position: static;
  inset: auto;
  width: auto;
  max-width: none;
  margin: 0 0 8px;
  box-shadow: none;
  border: 1px solid #dfe6f1;
  background: #f6f9ff;
  z-index: auto;
}
#sheet-peek #ags-guide p {
  margin: 2px 0 6px;
}
#ags-guide .row button,
#ags-guide .row a {
  min-height: 44px;
}
.hint {
  font-size: 12px;
  color: var(--muted, #778294);
}

/* Round 2 handoff: gameplay classes (docs/R2_HANDOFF.md). */
#ags-guide[data-place] {
  position: static;
  inset: auto;
  width: auto;
}
#ags-guide[hidden] {
  display: none !important;
}
#ags-guide.ags-guide-compact p,
#ags-guide.ags-guide-compact .ags-guide-who {
  display: none;
}
.ags-guide-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e8f0ff;
  color: #0b4fd1;
  font-weight: 700;
  font-size: 13px;
}
p.sales-feedback.ags-sent {
  background: #f3f6fb;
  color: #3b4657;
  border-left: 3px solid #9fb3d1;
  font-style: italic;
}
.ags-odds {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f6f9ff;
  border: 1px solid #dfe6f1;
  font-size: 13px;
  color: #3b4657;
}
.ags-odds b {
  font-size: 16px;
  color: #0b1b33;
}
.ags-odds small {
  flex-basis: 100%;
  color: #15803d;
  font-size: 12px;
}
.ags-full-options {
  margin-top: 8px;
}
.card.ags-unstaffed {
  border-left: 4px solid #d97706;
  box-shadow: inset 0 0 0 1px #fde7c4;
}
.card.ags-invest {
  border-top: 3px solid #0b4fd1;
}
.card.ags-invest.owned {
  border-top-color: #15803d;
  opacity: 0.85;
}
.ags-owners-call .decision-option {
  min-height: 56px;
}
label.ags-setting {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 14px;
}
label.ags-setting input {
  width: 22px;
  height: 22px;
}

/* Round 7 follow-up: staffing and pitch clues (docs/R7_HANDOFF.md). */
p.ags-nobody-free {
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff7e6;
  border: 1px solid #f5d79a;
  color: #7a4a06;
  font-size: 13px;
  line-height: 1.4;
}
.tag.ags-unstaffed-tag {
  background: #fde8e8;
  color: #b42318;
  border: 1px solid #f5b5b0;
  font-weight: 700;
}
b.ags-key {
  font-weight: 800;
  color: #0b1b33;
  background: linear-gradient(transparent 58%, #ffe58a 58%);
  padding: 0 2px;
  border-radius: 2px;
}

/* Round 7 final: inline small text inside cards reads as body text, not a label. */
.report-foot small,
.modal details small,
.modal .ags-pitch-score small,
.fx-card small {
  letter-spacing: 0;
  font-weight: 500;
  text-transform: none;
}

/* Round 7 final: Friday card in phone landscape. Three tile columns, grade clear of the tiles. */
@media (max-height: 500px) and (orientation: landscape) {
  .modal .report-card .stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .modal .report-card .stat-grid > div {
    padding: 6px 8px;
  }
  .modal .report-card .eyebrow {
    padding-right: 64px;
  }
  .modal .report-card .report-grade {
    width: 52px;
    height: 52px;
    font-size: 28px;
  }
  .modal .report-card .stat-grid {
    margin-top: 30px;
  }
}

/* ---------- Round 8: one consistent story ---------- */
p.sales-feedback.ags-sent.ags-hurt {
  background: #fff6ec;
  color: #6b3d12;
  border-left-color: #e0a052;
  font-style: normal;
}
.modal p.note.ags-red-day {
  border-left: 3px solid #d8453b;
  background: #fff1f0;
  color: #7a1e17;
}
.modal .stat-grid .ags-accrual small {
  white-space: normal;
}
.person-label.ags-idle-summary {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  font-weight: 700;
}

/* ---------- Round 8 final: phone-first fixes ---------- */
/* Tour and decision targets scroll clear of the phone tab bar, not just to their card's top. */
#panel [data-staff],
#panel [data-deliver],
#panel .decision-option {
  scroll-margin-bottom: calc(var(--nav-h, 0px) + 16px);
}
.modal .stat-grid .ags-accrual .ags-accrual-when {
  font-size: 0.72em;
  font-weight: 600;
  opacity: 0.75;
  white-space: nowrap;
}
.person-label.ags-idle-summary.ags-fold-in,
.person-label.ags-idle-summary.ags-fold-home {
  font-weight: 600;
}

/* Toasts never print over a celebration card (delivery, milestone): hidden, not only faded. */
body.fx-open #toast.visible,
body:has(.fx-milestone) #toast.visible {
  opacity: 0;
  visibility: hidden;
}
/* iPhone Friday card: the PAID stamp gets its own line under "Payroll paid", never on top of it. */
@media (max-width: 700px) {
  .report-card p.report-foot.ags-payroll-line {
    display: block;
  }
  .report-card .ags-payroll-line .ags-paid-stamp {
    display: block;
    width: max-content;
    margin: 8px 0 2px 2px;
  }
}
.ags-room-hint .ags-key,
.sales-quote .ags-key {
  white-space: normal;
}
