/* ==========================================================================
 * Festival Studio - Schedule view and the shared activity form
 *
 * st-schedule-*  the Schedule screen (js/views/schedule.js): the day-grouped
 *                list, the one-day timeline and the Removed tab
 * st-actform-*   the add / edit activity dialog (js/ui/activity-form.js),
 *                which the stand drawer and the venue map open as well - this
 *                sheet is linked from index.html, so it is always loaded
 *
 * Built on the kit in /studio/studio.css: same tokens, the kit's table, menu
 * and input looks. Nothing here redefines a kit class outside these scopes.
 * ========================================================================== */

/* ---------- Schedule: frame ---------- */
.st-schedule-tabs { margin-bottom: 14px; }
.st-schedule-toolbar .st-select { flex: 0 1 250px; width: auto; min-width: 180px; }
.st-schedule-note { margin-bottom: 12px; max-width: 80ch; }

/* ---------- Schedule: list ---------- */
/* overflow: clip rounds the corners without becoming a scroll container, so
   the column header and the day headers can stick to the page as it scrolls. */
.st-schedule-list { background: var(--st-bg-card); border: 1px solid var(--st-border); border-radius: var(--st-r-14); overflow: clip; min-width: 0; }
.st-schedule-table { table-layout: fixed; }
.st-schedule-table thead th { z-index: 3; }
.st-schedule-table thead th:nth-child(1) { width: 104px; }
.st-schedule-table thead th:nth-child(3) { width: 150px; }
.st-schedule-table thead th:nth-child(4) { width: 104px; }
.st-schedule-table thead th:nth-child(5) { width: 96px; }
.st-schedule-table thead th:nth-child(6) { width: 96px; }
.st-schedule-table thead th:nth-child(7) { width: 54px; }
.st-schedule-table tbody + tbody .st-schedule-day th { border-top: 1px solid var(--st-border); }
/* Information-only festival (member passes off): nothing is checked in. */
.st-schedule-table.is-info-only .st-schedule-col-checkins { display: none; }
/* The removed list has four columns of its own. */
.st-schedule-table--removed thead th:nth-child(1) { width: auto; }
.st-schedule-table--removed thead th:nth-child(2) { width: 250px; }
.st-schedule-table--removed thead th:nth-child(3) { width: 110px; }
.st-schedule-table--removed thead th:nth-child(4) { width: 130px; }

.st-schedule-day th { top: 38px; z-index: 2; height: 42px; background: var(--st-bg-card); color: var(--st-text); font-size: 13.5px; letter-spacing: 0; }
.st-schedule-day__row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.st-schedule-day__date { font-weight: 600; }
.st-schedule-day__count { font-size: 12.5px; font-weight: 500; color: var(--st-text-muted); }

.st-schedule-row td { height: 54px; }
.st-schedule-row__time { font-weight: 600; white-space: nowrap; }
.st-schedule-row__flags { display: flex; flex-wrap: wrap; gap: 4px; }
.st-schedule-row__menu { padding-left: 0 !important; text-align: right; }
.st-schedule-row.is-done .st-schedule-row__time,
.st-schedule-row.is-done .st-schedule-act__title { color: var(--st-text-dim); }
.st-schedule-row.is-done .st-schedule-act__icon { opacity: 0.6; }
.st-schedule-row.is-new td { background: rgba(109, 92, 255, 0.12); }

.st-schedule-act { display: flex; align-items: center; gap: 12px; min-width: 0; }
.st-schedule-act__icon {
  width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: var(--st-r-8);
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--st-border); color: var(--st-lavender);
}
.st-schedule-act__text { min-width: 0; display: flex; flex-direction: column; gap: 1px; line-height: 1.35; }
.st-schedule-act__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-schedule-act__sub { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12.5px; color: var(--st-text-muted); }
.st-schedule-act__outside { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; color: var(--st-text-muted); }
.st-schedule-act__sub > .st-truncate + .st-schedule-act__outside::before { content: "·"; margin-right: 4px; }

/* Spots (A9): "8 / 20"; at the limit it reads as full. */
.st-schedule-spots { white-space: nowrap; font-variant-numeric: tabular-nums; }
.st-schedule-spots.is-full { color: #fcd34d; font-weight: 600; }

.st-schedule-pending { display: inline-block; width: 22px; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, 0.08); animation: st-pulse 1.3s ease-in-out infinite alternate; }

/* ---------- Schedule: sign-ups dialog ---------- */
.st-schedule-signups { min-height: 180px; }
.st-schedule-signups > * + * { margin-top: 10px; }
.st-schedule-signup { min-height: 48px; }

/* ---------- Schedule: timeline ---------- */
.st-schedule-tl { background: var(--st-bg-card); border: 1px solid var(--st-border); border-radius: var(--st-r-14); min-width: 0; }
.st-schedule-tl__head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; padding: 14px 18px; border-bottom: 1px solid var(--st-border); }
.st-schedule-tl__title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
.st-schedule-tl__title .st-badge { align-self: center; }
.st-schedule-tl__days .st-select { width: auto; min-width: 190px; }
.st-schedule-tl__scroll { overflow-x: auto; padding: 18px 16px 18px 0; }
.st-schedule-tl__scroll:focus-visible { outline-offset: -2px; }
.st-schedule-tl__canvas { position: relative; margin-left: 68px; }
.st-schedule-tl__hour { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--st-border); }
.st-schedule-tl__hour span {
  position: absolute; right: 100%; top: 0; transform: translateY(-50%); width: 68px; padding-right: 12px; text-align: right;
  font-size: 11.5px; font-weight: 500; color: var(--st-text-muted); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.st-schedule-tl__lanes { position: absolute; inset: 0; }
.st-schedule-tl__now { position: absolute; left: -6px; right: 0; height: 0; border-top: 2px solid var(--st-red); pointer-events: none; z-index: 2; }
.st-schedule-tl__now::before { content: ""; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--st-red); }
.st-schedule-tl__legend { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 12px 18px; border-top: 1px solid var(--st-border); font-size: 12.5px; color: var(--st-text-muted); }
.st-schedule-tl__legend > span { display: inline-flex; align-items: center; gap: 7px; }
.st-schedule-tl__dash { width: 14px; height: 10px; border-radius: 3px; border: 1px dashed rgba(255, 255, 255, 0.4); }

.st-schedule-block {
  --st-block: #8b93a7;
  --st-block-bg: rgba(255, 255, 255, 0.06);
  position: absolute; display: flex; flex-direction: column; gap: 1px; padding: 4px 8px 2px 9px; overflow: hidden; text-align: left;
  border-radius: var(--st-r-8); border: 1px solid var(--st-border-strong); border-left: 3px solid var(--st-block);
  /* The tint sits on the card colour, so hour lines never show through a block. */
  background: linear-gradient(var(--st-block-bg), var(--st-block-bg)), var(--st-bg-card);
  color: var(--st-text); font-size: 12.5px; line-height: 1.3; cursor: pointer;
  transition: border-color var(--st-ease);
}
.st-schedule-block:hover { border-color: rgba(255, 255, 255, 0.34); border-left-color: var(--st-block); z-index: 1; }
.st-schedule-block:focus-visible { outline-offset: 1px; z-index: 1; }
/* A flex row (live dot + title). The title text sits in its own .st-truncate
   span: text-overflow has no effect on text placed straight into a flex box. */
.st-schedule-block__title { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; font-weight: 600; white-space: nowrap; overflow: hidden; }
.st-schedule-block__meta { flex: 0 0 auto; font-size: 11.5px; color: var(--st-text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-schedule-block__live { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; background: var(--st-green); }
.st-schedule-block.is-compact { flex-direction: row; align-items: center; gap: 8px; padding-top: 0; padding-bottom: 0; }
.st-schedule-block.is-compact .st-schedule-block__title { flex: 0 1 auto; min-width: 0; }
.st-schedule-block.is-compact .st-schedule-block__meta { flex: 0 0 auto; }
.st-schedule-block.is-assumed { border-bottom-style: dashed; border-right-style: dashed; border-top-style: dashed; }
/* Finished: a quieter surface and quieter text, not a faded block. Fading the
   whole block took its 11.5px time line to about 3.5:1; these stay above
   4.5:1 on any stand color. The background is set here directly because the
   category tint arrives as an inline --st-block-bg, which a class cannot
   override; the left bar keeps the stand's color. */
.st-schedule-block.is-done { background: linear-gradient(rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.03)), var(--st-bg-card); }
.st-schedule-block.is-done .st-schedule-block__title { color: var(--st-text-dim); }
.st-schedule-block.is-done .st-schedule-block__meta { color: var(--st-text-muted); }
.st-schedule-block.is-new { border-color: var(--st-focus); border-left-color: var(--st-block); }

/* ---------- Activity form ---------- */
.st-actform__body > * + * { margin-top: 16px; }
.st-actform .st-textarea { min-height: 68px; }
.st-actform__section { padding-top: 16px; border-top: 1px solid var(--st-border); }
.st-actform__heading { margin-bottom: 12px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--st-text-muted); }
.st-actform__marker { display: grid; grid-template-columns: 168px minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.st-actform__warn { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; line-height: 1.45; color: #fcd34d; }
.st-actform__warn .st-icon { margin-top: 2px; }
.st-actform__info { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 8px 12px; border-radius: 10px; background: rgba(109, 92, 255, 0.12); font-size: 12.5px; line-height: 1.45; color: var(--st-text-dim); }
.st-actform__info[hidden] { display: none; }
.st-actform__info .st-icon { margin-top: 2px; color: #b8adff; }
/* Sign-ups: Spots next to the Full switch. */
.st-actform__signups { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px 24px; align-items: start; }
.st-actform__signups > .st-toggle { margin-top: 26px; }
/* The note about the chat and the reminder sits in the footer, left of the buttons. */
.st-actform .st-dialog__footer-end:has(> .st-actform__note) { flex: 1 1 auto; min-width: 0; }
.st-actform__note { display: flex; align-items: flex-start; gap: 8px; flex: 1 1 0; min-width: 0; margin-right: 8px; font-size: 12.5px; line-height: 1.45; color: var(--st-text-muted); }
.st-actform__note .st-icon { margin-top: 2px; color: var(--st-text-muted); }

/* Searchable select: a button that looks like the kit's select. */
.st-actform-combo { display: flex; align-items: center; gap: 9px; text-align: left; }
.st-actform-combo__lead { display: inline-grid; place-items: center; flex: 0 0 auto; color: var(--st-lavender); }
.st-actform-combo__lead.is-dim { color: var(--st-text-muted); }
.st-actform-combo__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-actform-combo.is-empty .st-actform-combo__label { color: var(--st-text-muted); }
.st-actform-type { display: flex; flex-direction: column; gap: 8px; }

/* Popover: the kit's menu surface with a search box on top and a list that scrolls. */
.st-actform-pop { display: flex; flex-direction: column; padding: 0; overflow: hidden; max-width: calc(100vw - 16px); max-height: 420px; }
.st-actform-pop--tiles { max-height: 360px; }
.st-actform-pop__search { flex: 0 0 auto; padding: 8px; border-bottom: 1px solid var(--st-border); }
.st-actform-pop__list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px; overscroll-behavior: contain; }
.st-actform-pop__list .st-menu__item.is-active { background: rgba(255, 255, 255, 0.08); }
.st-actform-pop__list .st-menu__item .st-icon { color: var(--st-lavender); }
.st-actform-pop__list .st-menu__item .st-dot { margin: 0 4px; }
.st-actform-pop__list .st-loading { padding: 20px 12px; }
.st-actform-pop__note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 12px 10px; font-size: 13px; color: var(--st-text-muted); }
.st-actform-tiles { display: grid; grid-template-columns: repeat(auto-fill, 34px); gap: 2px; padding: 2px 6px 6px; }
.st-actform-tile { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--st-r-8); border: 1px solid transparent; color: var(--st-text); }
.st-actform-tile:hover { background: rgba(255, 255, 255, 0.08); }
.st-actform-tile.is-active { background: rgba(109, 92, 255, 0.2); border-color: rgba(124, 92, 255, 0.7); }
.st-actform-tile:focus-visible { outline-offset: -2px; }
.st-actform-tile__emoji { font-size: 19px; line-height: 1; }

/* Where: a picture of the spot next to what it is. */
.st-actform-where { display: flex; flex-direction: column; gap: 10px; }
.st-actform-place { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: stretch; padding: 10px; border: 1px solid var(--st-border); border-radius: var(--st-r-12); background: rgba(255, 255, 255, 0.02); }
.st-actform-place__thumb { position: relative; height: 116px; border-radius: var(--st-r-8); overflow: hidden; background: var(--st-bg-elev); border: 1px solid var(--st-border); }
.st-actform-place__thumb img { width: 100%; height: 100%; object-fit: cover; }
.st-actform-place__pin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); color: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7)); }
.st-actform-place__pin .st-icon { fill: var(--st-violet); }
.st-actform-place__blank { position: absolute; inset: 0; display: grid; place-items: center; color: var(--st-text-muted); }
.st-actform-place__body { display: flex; flex-direction: column; justify-content: center; gap: 8px; min-width: 0; }
.st-actform-place__title { font-size: 13.5px; font-weight: 600; }
.st-actform-place__text { font-size: 12.5px; line-height: 1.5; color: var(--st-text-muted); }
.st-actform-place__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }

/* What the marker will look like in the app: violet disc, white pill. */
.st-actform-preview { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 104px; padding: 12px 8px; border-radius: var(--st-r-10); background: #dfe5dc; }
.st-actform-preview__dot { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: #8b5cf6; border: 2px solid #fff; color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28); }
.st-actform-preview__pill { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 3px 8px; border-radius: 10px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18); font-size: 11px; line-height: 1.3; white-space: nowrap; }
.st-actform-preview__name { font-weight: 600; color: rgba(0, 0, 0, 0.87); overflow: hidden; text-overflow: ellipsis; }
.st-actform-preview__sep { color: rgba(0, 0, 0, 0.38); }
.st-actform-preview__time { font-weight: 700; color: rgba(0, 0, 0, 0.54); font-variant-numeric: tabular-nums; }

/* ---------- Narrow ---------- */
@media (max-width: 1100px) {
  /* The duration column closes to nothing instead of display: none. The table
     has a fixed layout and day headers that span every column: a column that
     disappears would leave the span one too wide and open an empty column. */
  .st-schedule-table thead th.st-schedule-col-duration { width: 0; }
  .st-schedule-table .st-schedule-col-duration { padding: 0; overflow: hidden; visibility: hidden; }
  .st-schedule-table thead th:nth-child(3) { width: 120px; }
  .st-schedule-table thead th:nth-child(5),
  .st-schedule-table thead th:nth-child(6) { width: 84px; }
}
@media (max-width: 720px) {
  .st-actform__marker, .st-actform-place, .st-actform__signups { grid-template-columns: minmax(0, 1fr); }
  .st-actform__signups > .st-toggle { margin-top: 0; }
  .st-schedule-table thead th:nth-child(1) { width: 84px; }
  .st-schedule-table thead th:nth-child(3) { width: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  .st-schedule-pending { animation: none; }
}

/* The event's clock and the date check (views/schedule.js renderNotice). */
.st-schedule-notice { display: grid; gap: 8px; margin: 0 0 12px; }
.st-schedule-notice[hidden] { display: none; }
.st-schedule-datecheck {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.08); color: var(--st-text); font-size: 13.5px;
}
.st-schedule-datecheck > .st-icon { color: #fcd34d; flex: 0 0 auto; }
.st-schedule-datecheck__msg { flex: 1 1 260px; min-width: 0; }
.st-schedule-zone { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; color: var(--st-text-muted); }

/* Share the schedule (E2, ui/agenda-share.js): switch, link, QR code, in the
   dialog the header's "Share" opens. Off: QR covered, Copy / Download disabled. */
.st-schedule-share__explainer { margin: 0 0 16px; font-size: 14px; color: var(--st-text-muted); }
.st-schedule-share__switch { display: grid; gap: 4px; margin-bottom: 16px; }
.st-schedule-share__status { margin: 0 0 0 46px; font-size: 13px; color: var(--st-text-muted); }
.st-schedule-share__status[data-kind="success"] { color: var(--st-green); }
.st-schedule-share__status[data-kind="warning"] { color: var(--st-amber); }
.st-schedule-share__body { display: flex; align-items: center; gap: 20px; }
.st-schedule-share__qr {
  position: relative; flex: 0 0 auto; width: 132px; height: 132px; display: grid; place-items: center; padding: 6px;
  border-radius: var(--st-r-10); background: #fff; overflow: hidden;
}
.st-schedule-share__qr-image { display: grid; place-items: center; }
.st-schedule-share__qr canvas { width: 120px; height: 120px; image-rendering: pixelated; }
.st-schedule-share__qr .st-link { padding: 6px; font-size: 12px; color: #4b3df5; text-align: center; }
.st-schedule-share:not(.is-live) .st-schedule-share__qr-image { opacity: 0.55; }
.st-schedule-share__qr-cover {
  position: absolute; inset: 0; display: none; place-items: center; padding: 12px; text-align: center;
  font-size: 13px; font-weight: 600; line-height: 1.3; color: #1f2937; background: rgba(255, 255, 255, 0.72);
}
.st-schedule-share.is-off .st-schedule-share__qr-image { opacity: 0.18; filter: blur(2px); pointer-events: none; user-select: none; }
.st-schedule-share.is-off .st-schedule-share__qr-cover { display: grid; }
.st-schedule-share__hint { margin: 0; color: var(--st-amber); }
.st-schedule-share__hint[hidden] { display: none; }
.st-schedule-share__links { min-width: 0; }
.st-schedule-share__url { font-size: 15px; font-weight: 600; word-break: break-all; }
@media (max-width: 720px) {
  .st-schedule-share__body { flex-direction: column; align-items: flex-start; }
  .st-schedule-share__status { margin-left: 0; }
}
