/* "Activity details" in the Website tab (activity-sheets.js). Built from the
   editor's own tokens (styles.css) and the Banners panel's pieces
   (site-banners.css: .bn-bar, .bn-label, .bn-nudge, .bn-view, .bn-help). */
.ad-panel { display: grid; gap: 18px; }
/* The Banners bar sticks because it holds Publish; this one only explains. */
.ad-panel > .bn-bar { position: static; }

.ad-layout { display: grid; grid-template-columns: minmax(230px, 300px) minmax(0, 1fr); gap: 18px; align-items: start; }

/* the list of activities */
.ad-list { position: sticky; top: 12px; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 10px; max-height: calc(100vh - 40px); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--card); }
.ad-items { display: grid; gap: 4px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.ad-item-button { position: relative; display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 10px; align-items: center; width: 100%; min-height: 56px; border: 1px solid transparent; border-radius: 12px; padding: 6px 8px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.ad-item-button:hover { background: var(--teal-soft); }
.ad-item.is-selected .ad-item-button { border-color: var(--teal); background: var(--teal-soft); }
.ad-item-button:focus-visible { outline: 3px solid var(--coral-bright); outline-offset: 2px; }
.ad-item-thumb { width: 46px; height: 46px; border-radius: 9px; object-fit: cover; background: #e6e1d6; }
.ad-item-words { display: grid; min-width: 0; }
.ad-item-words strong { overflow: hidden; font-size: .88rem; text-overflow: ellipsis; white-space: nowrap; }
.ad-item-words small { overflow: hidden; color: #4d5d64; font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.ad-flag { grid-column: 2; justify-self: start; border-radius: 999px; padding: 1px 8px; background: var(--gold-soft); color: #5c4b18; font-size: .68rem; font-weight: 900; }
.ad-item.is-unsaved .ad-item-words strong::after { content: " •"; color: var(--coral); }

/* the editing side */
.ad-editor { display: grid; gap: 16px; min-width: 0; }
.ad-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.ad-head h2 { margin: 0; color: var(--ink); font-size: 1.45rem; }
.ad-sessions { margin: 2px 0 0; color: #4d5d64; font-size: .9rem; }
.ad-links { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 6px; }

.ad-group { display: grid; gap: 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 18px; background: var(--card); }
.ad-group > h3 { margin: 0; color: var(--teal-deep); font-size: 1.02rem; }
.ad-group .bn-label textarea { min-height: 0; }
.ad-label-row { display: flex; justify-content: space-between; gap: 10px; }
.ad-count { color: #6b7a80; font-size: .76rem; font-weight: 400; font-variant-numeric: tabular-nums; }
.ad-hint { color: #5a6a70; font-size: .78rem; font-weight: 400; }

/* the preview: the sheet's banner, cropped two ways, then its words */
.ad-preview { display: grid; gap: 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: #faf6ee; }
/* The shapes measured on the site: the sheet's picture is 938 x 300 on a
   computer and 390 x 250 on a phone. The crop works in proportions, so the
   same shape at any size shows the same crop. */
.ad-strips { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 10px; align-items: end; }
.ad-strip { position: relative; margin: 0; overflow: hidden; border-radius: 12px; background: #0d414c; }
.ad-strip.is-wide { aspect-ratio: 938 / 300; }
.ad-strip.is-phone { aspect-ratio: 390 / 250; }
.ad-strip img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ad-strip::after { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(2, 30, 36, .04) 18%, rgba(2, 30, 36, .88) 100%); content: ""; }
.ad-strip-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 10px; color: #cfe1e3; font-size: .78rem; text-align: center; }
.ad-strip-overlay { position: absolute; right: 0; bottom: 0; left: 0; z-index: 1; padding: 10px 12px; color: #fff; }
.ad-strip-overlay p { margin: 0 0 2px; color: #ffd29b; font-size: .62rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.ad-strip-overlay strong { display: block; font-size: 1.05rem; line-height: 1.05; }
.ad-strip.is-phone .ad-strip-overlay strong { font-size: .86rem; }
.ad-strip figcaption { position: absolute; top: 6px; left: 6px; z-index: 1; border-radius: 6px; padding: 2px 7px; background: rgba(255, 255, 255, .88); color: #20313a; font-size: .66rem; font-weight: 800; }
.ad-sheet { display: grid; gap: 6px; max-width: 70ch; color: var(--ink); font-size: .9rem; }
.ad-sheet p { margin: 0; }
.ad-sheet h3 { margin: 6px 0 0; font-size: .9rem; }
.ad-sheet-highlights { display: grid; gap: 3px; margin: 0; padding-left: 18px; }
.ad-sheet-credit { color: #5a6a70; font-size: .76rem; }

/* framing the picture: the strip as a computer shows it, draggable and
   zoomable, with a compass for moving it a step at a time */
.ad-framer { display: grid; gap: 10px; }
.ad-frame { position: relative; aspect-ratio: 938 / 300; overflow: hidden; border-radius: 14px; background: #0d414c; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.ad-frame.is-dragging { cursor: grabbing; }
.ad-frame:focus-visible { outline: 3px solid var(--coral-bright); outline-offset: 3px; }
.ad-frame img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.ad-frame::after { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(2, 30, 36, .04) 18%, rgba(2, 30, 36, .88) 100%); content: ""; pointer-events: none; }
.ad-frame-overlay { position: absolute; right: 0; bottom: 0; left: 0; z-index: 1; padding: clamp(12px, 3vw, 24px); color: #fff; pointer-events: none; }
.ad-frame-overlay p { margin: 0 0 4px; color: #ffd29b; font-size: .72rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.ad-frame-overlay strong { display: block; max-width: 18ch; font-size: clamp(1.2rem, 3vw, 2rem); line-height: 1.02; letter-spacing: -.02em; }

.ad-compass { position: absolute; top: 10px; right: 10px; z-index: 2; display: grid; grid-template: repeat(3, 26px) / repeat(3, 26px); place-items: center; width: 84px; height: 84px; border-radius: 50%; background: rgba(255, 255, 255, .9); box-shadow: 0 3px 12px rgba(0, 0, 0, .25); cursor: default; }
.ad-compass button { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 50%; padding: 0; background: transparent; cursor: pointer; touch-action: manipulation; }
.ad-compass button::before { display: block; width: 16px; height: 16px; background: var(--teal-deep); content: ""; -webkit-mask: var(--i-chevron) center / 16px 16px no-repeat; mask: var(--i-chevron) center / 16px 16px no-repeat; }
.ad-compass button:hover { background: var(--teal-soft); }
.ad-compass button:active { background: var(--teal); }
.ad-compass button:active::before { background: #fff; }
.ad-compass button:focus-visible { outline: 3px solid var(--coral-bright); outline-offset: 0; }
.ad-compass-n { grid-area: 1 / 2; }
.ad-compass-w { grid-area: 2 / 1; }
.ad-compass-w::before { transform: rotate(-90deg); }
.ad-compass-c { grid-area: 2 / 2; }
.ad-compass-c::before { -webkit-mask-image: var(--i-needle) !important; mask-image: var(--i-needle) !important; background: var(--coral) !important; }
.ad-compass-e { grid-area: 2 / 3; }
.ad-compass-e::before { transform: rotate(90deg); }
.ad-compass-s { grid-area: 3 / 2; }
.ad-compass-s::before { transform: rotate(180deg); }

.ad-zoom-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.ad-zoom-button { width: 40px; height: 40px; border: 1px solid #9fb3b6; border-radius: 12px; background: #fff; color: var(--teal-deep); font: inherit; font-size: 1.25rem; font-weight: 800; line-height: 1; cursor: pointer; }
.ad-zoom-button:hover:not(:disabled) { border-color: var(--teal); background: var(--teal-soft); }
.ad-zoom-button:disabled { opacity: .4; cursor: default; }
.ad-zoom-button:focus-visible { outline: 3px solid var(--coral-bright); outline-offset: 2px; }
.ad-zoom-readout { min-width: 48px; color: var(--ink); font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.ad-zoom-reset { border: 0; background: none; font: inherit; font-size: .88rem; cursor: pointer; }
.ad-zoom-bar .ad-hint { margin-left: auto; }

:root {
  --i-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 15l6-6 6 6'/%3E%3C/svg%3E");
  --i-needle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l4 10-4 10-4-10z' fill='black'/%3E%3C/svg%3E");
}

.ad-picker { display: grid; gap: 10px; border: 1px dashed #9fb3b6; border-radius: 16px; padding: 12px; }
.ad-picker input { min-height: 42px; border: 1px solid #9fb3b6; border-radius: 12px; padding: 8px 11px; font: inherit; }
.ad-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; max-height: 360px; overflow-y: auto; }
.ad-picker-item { display: grid; gap: 4px; border: 2px solid transparent; border-radius: 12px; padding: 4px; background: #fff; color: var(--ink); font: inherit; font-size: .72rem; text-align: left; cursor: pointer; }
.ad-picker-item img { width: 100%; aspect-ratio: 4 / 3; border-radius: 8px; object-fit: cover; background: #ece8e0; }
.ad-picker-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-picker-item:hover, .ad-picker-item.is-chosen { border-color: var(--teal); }
.ad-picker-item:focus-visible { outline: 3px solid var(--coral-bright); outline-offset: 2px; }

.ad-kinds { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; border: 0; padding: 0; }
.ad-kinds legend { margin-bottom: 6px; padding: 0; color: var(--teal-deep); font-size: .82rem; font-weight: 800; }
.ad-kind { display: flex; align-items: center; gap: 7px; min-height: 42px; border: 1px solid #b9c7c5; border-radius: 999px; padding: 0 14px 0 10px; background: #fff; font-size: .88rem; cursor: pointer; }
.ad-kind:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); font-weight: 700; }
.ad-kind input { flex: none; width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; accent-color: var(--teal); }
.ad-permission { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; border-radius: 14px; padding: 12px 14px; background: var(--gold-soft); color: #4a3c10; cursor: pointer; }
.ad-permission input { width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; padding: 0; accent-color: var(--teal); }
.ad-permission span { display: grid; gap: 2px; font-size: .9rem; }
.ad-permission small { font-size: .82rem; }

/* the timetable's facts, for reference */
.ad-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 18px; margin: 0; }
.ad-facts div { display: grid; gap: 1px; }
.ad-facts dt { color: #5a6a70; font-size: .76rem; font-weight: 800; }
.ad-facts dd { margin: 0; font-size: .9rem; }
.ad-facts dd.is-missing { color: #8a969a; font-style: italic; }

/* publishing */
.ad-actions { position: sticky; bottom: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; background: var(--card); box-shadow: 0 -4px 18px rgba(13, 65, 76, .08); }
.ad-status { margin: 0; color: #4d5d64; font-size: .9rem; }
.ad-status.is-waiting { color: #5c4b18; font-weight: 700; }
.ad-status.is-problem { color: #a33434; font-weight: 700; }
.ad-actions .button:disabled { opacity: .5; cursor: default; }

@media (max-width: 900px) {
  .ad-layout { grid-template-columns: 1fr; }
  .ad-list { position: static; max-height: 340px; }
  .ad-strips { grid-template-columns: 1fr; }
  .ad-actions { position: static; }
}

/* "Needs details": activities still showing the site's stand-in picture or
   wording, and a sheet that may belong to a renamed activity. */
.ad-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.ad-filter-button { min-height: 36px; border: 1px solid #b9c7c5; border-radius: 999px; padding: 0 12px; background: #fff; color: var(--ink); font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.ad-filter-button[aria-pressed="true"] { border-color: var(--teal); background: var(--teal); color: #fff; }
.ad-filter-button:focus-visible { outline: 3px solid var(--coral-bright); outline-offset: 2px; }
.ad-flag.is-needed { background: var(--coral-soft, #f8e7de); color: #8a3a1a; }
.ad-suggest { display: grid; gap: 10px; justify-items: start; border: 1px solid #e5bd72; border-left: 5px solid #8a6400; border-radius: 14px; padding: 12px 14px; background: #fdf6e4; color: #4a3c10; font-size: .9rem; }
.ad-suggest p { margin: 0; }

/* Looks: the picture in each colour treatment (shared/activity-sheets.mjs). */
.ad-looks { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.ad-looks-title { margin: 0; color: var(--teal-deep); font-size: .95rem; font-weight: 900; }
.ad-looks-title span { color: #4d5d64; font-size: .82rem; font-weight: 400; }
.ad-looks-row { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.ad-look { flex: none; display: grid; gap: 5px; justify-items: center; width: 98px; border: 0; border-radius: 12px; padding: 4px; background: none; color: var(--ink); font: inherit; font-size: .74rem; font-weight: 700; cursor: pointer; scroll-snap-align: start; }
.ad-look img { width: 88px; height: 88px; border: 3px solid transparent; border-radius: 12px; object-fit: cover; background: #ece8e0; }
.ad-look[aria-pressed="true"] img { border-color: var(--teal); }
.ad-look[aria-pressed="true"] span { color: var(--teal-deep); font-weight: 900; }
.ad-look:hover img { border-color: #9fb3b6; }
.ad-look:focus-visible { outline: 3px solid var(--coral-bright); outline-offset: 2px; }

/* Sheet colours taken from the picture (activity-sheets.js, tonesRow). */
.ad-tones { display: grid; gap: 8px; justify-items: start; }
.ad-tones-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ad-tone { display: flex; align-items: center; gap: 8px; min-height: 44px; border: 2px solid var(--line); border-radius: 999px; padding: 4px 14px 4px 6px; background: #fff; color: var(--ink); font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; }
.ad-tone[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-soft); }
.ad-tone:focus-visible { outline: 3px solid var(--coral-bright); outline-offset: 2px; }
.ad-tone-swatches { display: flex; }
.ad-tone-swatches i { width: 24px; height: 24px; margin-left: -6px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
.ad-tone-swatches i:first-child { margin-left: 0; }
.ad-tones-note { color: #5a6a70; font-size: .8rem; font-style: italic; }
.ad-tones-again { border: 0; background: none; font: inherit; font-size: .8rem; cursor: pointer; }

/* The preview wearing them, as the site will. */
.ad-sheet-button { justify-self: start; margin-top: 4px; border-radius: 999px; padding: 7px 14px; background: #125868; color: #fff; font-size: .8rem; font-weight: 800; }
.ad-preview.has-tone .ad-strip::after { background: linear-gradient(180deg, transparent 18%, color-mix(in srgb, var(--tone-deep) 92%, transparent) 100%); }
.ad-preview.has-tone .ad-strip { background: var(--tone-deep); }
.ad-preview.has-tone .ad-sheet { border-radius: 12px; padding: 12px 14px; background: linear-gradient(180deg, color-mix(in srgb, var(--tone-deep) 22%, var(--tone-soft)) 0, var(--tone-soft) 90px); }
.ad-preview.has-tone .ad-sheet h3 { color: var(--tone-accent); }
.ad-preview.has-tone .ad-sheet-highlights li::marker { color: var(--tone-accent); }
.ad-preview.has-tone .ad-sheet-button { background: var(--tone-accent); }
