/* ==========================================================================
   "The Plan" — visual overview: calendar, show-day timeline, assignment board,
   serving-station diagrams, and orchestra meal plan grid.
   Relies on the CSS variables + topbar/sheet/toast from volunteer.css.
   ========================================================================== */

.plan-hero {
  background:
    radial-gradient(ellipse 70% 45% at 50% -5%, rgba(212,165,90,.28), transparent 62%),
    linear-gradient(180deg, var(--night-1) 0%, var(--night-2) 100%);
  color: #e8d6ad; border-bottom: 1px solid var(--gold-deep); padding: 32px 16px 28px; text-align: center; position: relative;
}
.plan-hero::after {
  content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(320px, 70%); height: 1px; background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
}
.plan-hero .kicker { font-family: var(--font-sc); text-transform: uppercase; letter-spacing: .28em; font-size: .8rem; color: var(--gold-bright); margin: 0 0 8px; }
.plan-hero h1 { margin: 0 0 16px; font-size: 1.9rem; color: #f5dfac; letter-spacing: .05em; }
.plan-stats { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.plan-stat { background: rgba(212,165,90,.1); border: 1px solid rgba(212,165,90,.28); border-radius: var(--r-md); padding: 12px 20px; min-width: 118px; }
.plan-stat b { display: block; font-family: var(--font-display); font-size: 1.5rem; color: #f5dfac; }
.plan-stat span { font-size: .84rem; color: #d0a970; }

.wrap { max-width: 960px; margin: 0 auto; padding: 24px 16px 120px; }

.block { margin-bottom: 48px; scroll-margin-top: 70px; }
.block-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 4px; flex-wrap: wrap; }
.block-head h2 { margin: 0; font-size: 1.75rem; color: var(--maroon); letter-spacing: .02em; display: inline-flex; align-items: center; gap: 9px; }
.block-head h2 .hicon { color: var(--gold); font-size: .82em; }
.block-head h2 .hicon svg { width: 1em; height: 1em; }
.block-head .badge { font-family: var(--font-sc); text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 600; color: var(--gold-deep); background: var(--paper-tint); border: 1px solid var(--gold-soft); padding: 4px 13px; border-radius: 999px; }
.block-sub { color: var(--muted); margin: 0 0 20px; font-style: italic; font-size: 1.05rem; }

/* ---------- Avatar chips (used everywhere) ---------- */
.people { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-size: .72rem; font-weight: 600; flex: 0 0 auto; cursor: default; position: relative;
}
.avatar.filled { color: #fff; }
.avatar.open {
  background: transparent; border: 2px dashed var(--gold-soft); color: var(--gold);
  font-weight: 700; cursor: pointer;
}
.avatar.open:hover { border-color: var(--gold); background: #fff8ea; }
.avatar.lead { box-shadow: 0 0 0 2px var(--gold); }
.avatar.backup.open { border-style: dotted; cursor: help; }
.avatar.backup.open:hover { background: transparent; border-color: var(--muted); }
.avatar.backup.filled { opacity: .82; }
.avatar .agi { font-size: .95rem; }
.avatar.backup .agi { color: var(--muted); }
.role-dot { position: absolute; bottom: -2px; right: -2px; font-size: .5rem; background: #fff; border-radius: 50%; padding: 1px; }

/* ---------- Calendar ---------- */
.calendar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 760px) { .calendar { grid-template-columns: repeat(2, 1fr); } }
.day {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px; box-shadow: var(--shadow-sm); position: relative; min-height: 130px; display: flex; flex-direction: column;
}
.day.show-day { border: 1.5px solid var(--gold); background: linear-gradient(180deg,#fdf6e0,#f8eccf); box-shadow: var(--shadow); }
.day .dow { font-family: var(--font-sc); font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; }
.day .dnum { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; color: var(--maroon); line-height: 1; margin: 3px 0 8px; }
.day .dnote { font-size: .95rem; color: var(--ink); font-weight: 600; margin-bottom: auto; }
.day .dtags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.dtag { font-size: .68rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.dtag.show { background: var(--gold); color: var(--maroon-dark); }
.dtag.meal { background: var(--after-bg); color: var(--after); }
.dtag.travel { background: var(--other-bg); color: var(--other); }
.dtag.rehearse { background: var(--break-bg); color: var(--break); }
.day .star { position: absolute; top: 10px; right: 12px; font-size: 1.1rem; }

/* ---------- Show-day timeline ---------- */
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; position: relative; }
@media (max-width: 680px) { .timeline { grid-template-columns: 1fr 1fr; gap: 12px; } }
.phase {
  background: var(--card); border: 1px solid var(--line); padding: 16px 14px; text-align: center; position: relative;
}
.phase:first-child { border-radius: var(--r-md) 0 0 var(--r-md); }
.phase:last-child { border-radius: 0 var(--r-md) var(--r-md) 0; }
@media (max-width: 680px) { .phase { border-radius: var(--r-md) !important; } }
.phase .ph-when { font-size: .74rem; text-transform: uppercase; letter-spacing: .6px; font-weight: 700; margin-bottom: 6px; }
.phase .ph-name { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; margin-bottom: 8px; color: var(--maroon); }
.phase .ph-count { font-family: var(--font-display); font-size: 2rem; font-weight: 600; color: var(--ink); }
.phase .ph-label { font-size: .84rem; color: var(--muted); font-style: italic; }
.phase .ph-watch { font-size: .72rem; font-weight: 700; margin-top: 8px; padding: 3px 9px; border-radius: 999px; display: inline-block; }
.ph-watch.yes { background: var(--watch-bg); color: var(--watch); }
.ph-watch.no { background: var(--onduty-bg); color: var(--onduty); }
.ph-watch.brk { background: var(--break-bg); color: var(--break); }
.phase.p-before { border-top: 4px solid var(--watch); }
.phase.p-during { border-top: 4px solid var(--onduty); }
.phase.p-break  { border-top: 4px solid var(--break); }
.phase.p-after  { border-top: 4px solid var(--after); }

/* ---------- Assignment board ---------- */
.board { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 720px) { .board { grid-template-columns: 1fr; } }
.zone { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.zone-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.zone-head .zi { font-size: 1.4rem; }
.zone-head h3 { margin: 0; font-size: 1.1rem; color: var(--maroon); flex: 1; }
.zone-head .zbar { width: 60px; height: 7px; background: var(--cream); border-radius: 999px; overflow: hidden; }
.zone-head .zbar > span { display: block; height: 100%; background: var(--gold); }
.zone-head .zpct { font-size: .74rem; color: var(--muted); font-weight: 700; }
.postline { padding: 9px 0; border-top: 1px dashed var(--line); }
.postline:first-of-type { border-top: none; }
.postline .pl-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.postline .pl-name { font-weight: 700; font-size: 1.02rem; color: var(--ink); }
.postline .pl-when { font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }

/* ---------- Serving stations ---------- */
.stations { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 720px) { .stations { grid-template-columns: 1fr; } }
.station {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow-sm);
}
.station.wide { grid-column: 1 / -1; }
.station-head { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.station-head .si { font-size: 1.3rem; }
.station-head h3 { margin: 0; font-size: 1.05rem; color: var(--maroon); }
.station-when { font-size: .74rem; color: var(--muted); margin-bottom: 14px; }
/* the physical table graphic */
.table-top {
  background: linear-gradient(180deg, var(--maroon), var(--maroon-dark)); color: #f0e2c0; border-radius: 10px;
  padding: 9px; text-align: center; font-family: var(--font-sc); font-size: .78rem; font-weight: 600; letter-spacing: .18em;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.25), 0 0 0 1px var(--gold-deep); margin-bottom: 14px; text-transform: uppercase;
}
.positions { display: flex; gap: 12px; flex-wrap: wrap; align-items: stretch; }
.position { flex: 1 1 120px; background: var(--paper-tint); border: 1px solid var(--line); border-radius: var(--r-md); padding: 11px; display: flex; flex-direction: column; }
.position .pos-label { font-weight: 700; font-size: .98rem; margin-bottom: 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 6px; color: var(--maroon); }
.position .people { margin-top: auto; }
.position .pos-cap { font-size: .74rem; color: var(--gold-deep); font-weight: 700; flex: 0 0 auto; }

/* ---------- Meal plan grid ---------- */
.mealwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-md); border: 1px solid var(--line); }
table.meals { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 620px; background: var(--card); }
table.meals th, table.meals td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
table.meals thead th { background: linear-gradient(180deg, var(--maroon), var(--maroon-dark)); color: #f0e2c0; font-family: var(--font-sc); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; position: sticky; top: 0; }
table.meals thead th:first-child { border-radius: var(--r-md) 0 0 0; }
table.meals thead th:last-child { border-radius: 0 var(--r-md) 0 0; }
table.meals td.daycell { background: var(--cream-2, #f3e9d8); }
.mdaylabel { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; color: var(--maroon); }
.mdaynote { font-size: .82rem; color: var(--muted); font-weight: 600; font-style: italic; }
.mcell { min-width: 130px; }
.mcell.grey { background: repeating-linear-gradient(45deg,#f6f0e6,#f6f0e6 8px,#efe6d6 8px,#efe6d6 16px); }
.mcell .grey-note { font-size: .82rem; color: var(--muted); font-style: italic; }
.meal-open {
  border: 1px dashed var(--gold); color: var(--maroon); background: var(--paper-tint); border-radius: var(--r-sm);
  padding: 9px 11px; font-size: .95rem; font-weight: 600; cursor: pointer; width: 100%; text-align: left; font-family: inherit;
}
.meal-open:hover { background: #fbeed0; border-color: var(--gold-deep); }
.meal-filled { display: flex; align-items: center; gap: 8px; }
.meal-filled .mf-av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-size: .68rem; font-weight: 600; color: #fff; background: var(--watch); flex: 0 0 auto; }
.meal-filled .mf-name { font-weight: 700; font-size: .98rem; }
.meal-filled .mf-x { margin-left: auto; background: none; border: none; color: var(--muted); cursor: pointer; font-size: .9rem; }
.meal-filled .mf-x:hover { color: var(--onduty); }

.legend-row { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 14px 0 0; font-size: .88rem; color: var(--muted); font-style: italic; }
.legend-row .lg { display: inline-flex; align-items: center; gap: 6px; }
.legend-row .sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--gold-deep); font-weight: 700; text-decoration: none; margin-bottom: 4px; }
