/* se-osce app styles — tokens only (spec se-osce-ui-prototype U7). The shell and the
   generic primitives (.card, .badge, .banner, .fui-list, .kpi-tile, .btn-icon) come
   from foundation-ui; only the app's own layout lives here. */

.osce-page { padding: 8px 4px 32px; } /* fills the shell: cap prose, never a page (ui_shell_pages.md) */

.osce-head { margin: 4px 0 18px; }
.osce-head h1 { font-size: var(--fs-xl); font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.osce-sub { color: var(--fg-muted); margin: 4px 0 0; font-size: var(--fs-md); }
.osce-back { display: inline-flex; align-items: center; gap: 4px; color: var(--fg-muted); font-size: var(--fs-sm); text-decoration: none; margin-bottom: 6px; }
.osce-back:hover { color: var(--accent); }
.osce-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.osce-title-row h1 { flex: 0 1 auto; }
.osce-actions, .osce-week { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }

.osce-section { margin-top: 14px; }
.osce-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.osce-grid .osce-section { margin-top: 0; }

.osce-muted { color: var(--fg-muted); }
.osce-mono { font-family: var(--font-mono); font-size: 0.92em; }
.osce-num { text-align: right; }
.osce-right { text-align: right; }
.osce-empty { color: var(--fg-muted); margin: 4px 0; }
.osce-label { color: var(--fg-muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; margin-right: 6px; }

.osce-tag {
  display: inline-block; margin: 1px 4px 1px 0; padding: 0 7px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  font-size: var(--fs-sm); color: var(--fg);
}

/* chips = navigation links carrying an explicit query (ui_templates_htmx.md state rule) */
.osce-chiprow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.osce-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px;
  border: 1px solid var(--border); border-radius: var(--r-pill);
  font-size: var(--fs-sm); color: var(--fg); text-decoration: none;
}
.osce-chip:hover { border-color: var(--accent); }
.osce-chip.is-active { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.14); color: var(--accent); }
.osce-versions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.osce-filters { margin-bottom: 10px; }

/* overview event list */
.osce-events { list-style: none; margin: 0; padding: 0; }
.osce-events li + li { border-top: 1px solid var(--border); }
.osce-event-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 2px; color: inherit; text-decoration: none; }
.osce-event-line:hover .osce-event-title { color: var(--accent); }
.osce-date { font-family: var(--font-mono); color: var(--fg-muted); min-width: 10ch; }
.osce-event-title { font-weight: 600; }

/* event detail */
.osce-bookings tr.osce-clash td { background: rgba(var(--danger-rgb), 0.08); }
.osce-bookings tr.osce-clash td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.osce-coverage { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 12px; font-size: var(--fs-sm); }
.osce-cov { display: inline-flex; align-items: center; gap: 6px; }

/* station detail */
.osce-profile + .osce-profile { margin-top: 10px; }
.osce-profile p { margin: 2px 0 0; color: var(--fg-muted); }
.osce-checklist { margin: 0; padding-left: 20px; }
.osce-checklist li { padding: 2px 0; }
.osce-timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--border); }
.osce-timeline li { position: relative; padding: 4px 0 10px 8px; }
.osce-timeline li::before {
  content: ""; position: absolute; left: -20px; top: 10px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent);
}
.osce-comment { margin: 4px 0 0; color: var(--fg-muted); font-style: italic; }

/* locations */
.osce-spots { list-style: none; margin: 0; padding: 0; }
.osce-spots li { padding: 3px 0; color: var(--fg); }
.osce-spots .ph { color: var(--fg-muted); }

/* calendar: day × hour grid */
.osce-cal, .osce-month { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-card); }
.osce-cal { --cal-cols: 5; --cal-min: 0px; overflow-x: auto; }
.osce-cal-row { display: grid; grid-template-columns: 64px repeat(var(--cal-cols), minmax(var(--cal-min), 1fr)); }
.osce-cols-1 { --cal-cols: 1; } .osce-cols-3 { --cal-cols: 3; } .osce-cols-5 { --cal-cols: 5; }
.osce-cols-7 { --cal-cols: 7; } .osce-cols-10 { --cal-cols: 10; --cal-min: 110px; } .osce-cols-14 { --cal-cols: 14; --cal-min: 110px; }
.osce-cal-row + .osce-cal-row { border-top: 1px solid var(--border); }
.osce-cal-headrow { background: var(--bg-alt); }
.osce-cal-dayhead { padding: 8px 10px; font-weight: 600; font-size: var(--fs-sm); }
.osce-cal-hour { padding: 8px; color: var(--fg-muted); font-size: var(--fs-sm); border-right: 1px solid var(--border); }
.osce-cal-cell { padding: 6px; min-height: 48px; display: flex; flex-direction: column; gap: 6px; }
.osce-cal-cell + .osce-cal-cell { border-left: 1px solid var(--border); }
.osce-cal-entry {
  display: flex; flex-direction: column; gap: 2px; padding: 6px 8px;
  border-left: 3px solid var(--accent); border-radius: var(--r-sm);
  background: rgba(var(--accent-rgb), 0.10); color: inherit; text-decoration: none; font-size: var(--fs-sm);
}
.osce-cal-entry:hover { background: rgba(var(--accent-rgb), 0.18); }
.osce-cal-entry .badge { align-self: flex-start; }

/* month view: Monday-first week rows, one cell per date (U9) */
.osce-month-row { display: grid; grid-template-columns: repeat(var(--cal-cols, 7), minmax(0, 1fr)); }
.osce-month-row + .osce-month-row { border-top: 1px solid var(--border); }
.osce-month-cell { padding: 6px; min-height: 96px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.osce-month-cell + .osce-month-cell { border-left: 1px solid var(--border); }
.osce-month-pad { background: var(--bg-alt); }
.osce-month-day { color: var(--fg-muted); font-size: var(--fs-sm); }
.osce-month .osce-cal-entry { padding: 3px 6px; }
.osce-month .osce-cal-entry > span:nth-child(n+3):not(.badge) { display: none; }

/* placement colours: an entry takes its top-level location's ramp step (U11);
   the clash mark (danger) still wins below */
.osce-loc-1 { --loc: var(--viz-cat-1); } .osce-loc-2 { --loc: var(--viz-cat-2); }
.osce-loc-3 { --loc: var(--viz-cat-3); } .osce-loc-4 { --loc: var(--viz-cat-4); }
.osce-loc-5 { --loc: var(--viz-cat-5); } .osce-loc-6 { --loc: var(--viz-cat-6); }
.osce-loc-7 { --loc: var(--viz-cat-7); } .osce-loc-8 { --loc: var(--viz-cat-8); }
.osce-cal-entry[class*="osce-loc-"] { border-left-color: var(--loc); background: color-mix(in srgb, var(--loc) 16%, transparent); }
.osce-cal-entry[class*="osce-loc-"]:hover { background: color-mix(in srgb, var(--loc) 28%, transparent); }
.osce-cal-entry.osce-clash { border-left-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); background: rgba(var(--danger-rgb), 0.10); }
.osce-loc-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--loc); }

@media (max-width: 760px) {
  .osce-cal { --cal-min: 120px; }
  .osce-cal-row { grid-template-columns: 48px repeat(var(--cal-cols), minmax(var(--cal-min), 1fr)); }
  .osce-month { overflow-x: auto; }
  .osce-month-row { grid-template-columns: repeat(var(--cal-cols, 7), minmax(90px, 1fr)); }
}

/* placement calendar: one placement's intervals per day (U15, U16). The backend sets
   --top/--h in percent of the hour span; the column height gives the scale. */
.osce-pl-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; font-size: var(--fs-sm); }
.osce-pl { --pl-h: 640px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-card); overflow-x: auto; }
.osce-pl-row { display: grid; grid-template-columns: 64px repeat(var(--cal-cols, 5), minmax(var(--cal-min, 0px), 1fr)); }
.osce-pl-row + .osce-pl-row { border-top: 1px solid var(--border); }
.osce-pl-body { height: var(--pl-h); }
.osce-pl-hours { position: relative; border-right: 1px solid var(--border); }
.osce-pl-hours span { position: absolute; top: var(--top); right: 6px; transform: translateY(-50%); color: var(--fg-muted); font-size: var(--fs-xs); }
.osce-pl-day { position: relative; min-width: 0;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--pl-h) / 16 - 1px), var(--border) calc(var(--pl-h) / 16 - 1px), var(--border) calc(var(--pl-h) / 16)); }
.osce-pl-day + .osce-pl-day { border-left: 1px solid var(--border); }
.osce-pl-block {
  position: absolute; left: 4px; right: 4px; top: var(--top); height: var(--h);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; padding: 4px 6px;
  border-left: 3px solid var(--loc, var(--accent)); border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--loc, var(--accent)) 22%, transparent); font-size: var(--fs-sm); overflow: hidden;
}
.osce-pl-edit { border-left-style: dashed; }
.osce-pl[data-editable="1"] .osce-pl-block { cursor: grab; touch-action: none; }
.osce-pl-block.is-dragging { cursor: grabbing; box-shadow: var(--shadow-md); z-index: 2; }
.osce-pl-handle { position: absolute; left: 0; right: 0; height: 10px; cursor: ns-resize; }
.osce-pl-handle::after { content: ""; position: absolute; left: 40%; right: 40%; top: 4px; height: 2px; border-radius: 1px; background: var(--fg-muted); opacity: 0; }
.osce-pl-block:hover .osce-pl-handle::after { opacity: 0.8; }
.osce-pl-handle--top { top: 0; } .osce-pl-handle--bottom { bottom: 0; }
.osce-pl-del { opacity: 0; } .osce-pl-block:hover .osce-pl-del, .osce-pl-del:focus-visible { opacity: 1; }
.osce-pl-dayend { display: none; }

/* Filter bar: the view chips on one row, then the choosers as inset tom-select fields
   (ui_controls.md: >= 4 options = tom-select; a wrapping chip row = a compact multi-select). */
.osce-filterbar { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px 12px; }
.osce-filterbar .osce-viewrow { flex: 1 1 100%; margin-bottom: 0; }
.osce-filterbar .osce-filter { flex: 1 1 18rem; min-width: 14rem; max-width: 40rem; }
.osce-filterbar > .osce-chip { align-self: center; }
.osce-filterbar .osce-filter--search { flex: 1 1 14rem; max-width: 24rem; }
.osce-filterbar > .fui-chips, .osce-filterbar > .osce-count { align-self: center; }
.osce-filterbar > .osce-count { margin-left: auto; }
.osce-sample-note { font-size: var(--fs-xs); margin: 8px 0 0; }
