:root {
  /* Snowflake Sky Crisp palette (design-concepts/snowflake-sky-crisp.html),
     adopted app-wide per TECHUP-011. Existing variable names are kept so
     every component that already references them picks up the new look. */
  --gap: 12px;
  --bg: #f5f9fc;
  --paper: #fff;
  --ink: #102f45;
  --muted: #536d7d;
  --border: #dce8ef;
  --blue: #29b5e8;
  --accent: #087ba7;
  --wash: #e9f7fd;
  --good: #18705a;
  --good-bg: #e6f5ef;
  --warn: #946011;
  --warn-bg: #fff4d9;
  --danger: #b00020;
  --danger-bg: #fff3f3;
  --radius: 4px;
  --radius-lg: 6px;
}

* { box-sizing: border-box; }

/* Safe default for inline icon <svg>s (from the sprite in index.html) so a
   missing per-usage size rule can't blow up to the browser's intrinsic
   300x150 default. */
svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  padding-bottom: 64px; /* leave room for mobile bottom nav */
}

header {
  background: var(--paper);
  border-bottom: 1px solid var(--border);
}

.top-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -.4px;
  white-space: nowrap;
}
.brand img { width: auto; height: 26px; }
.brand small { display: block; font-size: 9px; letter-spacing: 1.5px; font-weight: 600; color: var(--muted); }

.hero { background: var(--blue); color: #07364b; }
.hero-inner { max-width: 1280px; margin: auto; padding: 8px 16px; }
.hero .eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px;
}

section { display: none; }
section.active { display: block; }

.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin-bottom: var(--gap);
}

.card h3 { margin: 0 0 4px; font-size: 15px; }
.card .meta { color: var(--muted); font-size: 13px; }
.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--wash);
  color: var(--accent);
  margin-left: 6px;
}
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.muted { background: var(--wash); color: var(--muted); }

table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); font-size: 14px; }

#error:not(:empty) {
  padding: 0.75rem 1rem;
  margin: 0;
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 500;
  text-align: center;
  overflow-wrap: anywhere;
}

/* --- Admin session management -------------------------------------------- */

/* Panel header: title with its action button. Stacks on narrow screens. */
.panel-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: var(--gap);
}
.panel-head h2 { margin: 0; font-size: 17px; }
#view-browse .panel-head h2 { font-size: 1.5em; }

button.primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
}
button.primary:hover { background: #066389; }

button.secondary {
  background: var(--paper);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
}
button.secondary:hover { background: var(--wash); }

a.button {
  display: inline-block;
  padding: 8px 14px;
  background: var(--paper);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-size: 14px;
  line-height: normal;
  text-decoration: none;
  cursor: pointer;
}
a.button:hover { background: var(--wash); }
a.button:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }

.schedule-actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin-top: 16px; }
.schedule-actions > button,
.schedule-actions > a.button {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  margin: 0;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.2;
}

.panel-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.card-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.card-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.card-actions button { font-size: 13px; padding: 6px 12px; }

/* Occurrences nested under their session card. */
.occurrences { border-top: 1px solid var(--border); padding-top: 8px; }
.occurrence {
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.occurrence:last-child { border-bottom: none; padding-bottom: 0; }
.occurrence button {
  margin-top: 6px;
  font-size: 12px;
  padding: 4px 10px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--accent);
  cursor: pointer;
}

/* --- Forms ---------------------------------------------------------------- */

.form {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 12px 0 4px;
}
.form label:first-of-type { margin-top: 0; }
.form .req { color: var(--danger); font-weight: 400; }

.form input,
.form select,
.form textarea {
  width: 100%;
  padding: 8px 10px;
  font-size: 15px; /* >=16px avoids iOS zoom-on-focus; 15px is the practical floor here */
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  color: inherit;
}
.form input[type="hidden"] { display: none; }
.form textarea { resize: vertical; }
.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}
.form .meta { font-size: 12px; margin: 4px 0 0; }

/* Paired datetime inputs: stacked on mobile, side by side on desktop. */
.form-row { display: grid; grid-template-columns: 1fr; gap: 12px; }

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.form-actions button { flex: 1; padding: 10px; font-size: 15px; }

/* Enrolment picker row (TECHUP-012): label + select + Add button, used inside
   modal tab content outside .form, so it mirrors .form's select styling. */
.enrol-row { display: flex; gap: 8px; align-items: center; margin: 12px 0 16px; }
.enrol-row label { font-size: 13px; font-weight: 600; white-space: nowrap; }
.enrol-row select {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  color: inherit;
}
/* Presenter order input in the session modal (TECHUP-042). */
.staff-table .staff-order { width: 4.5em; padding: 6px 8px; font: inherit; border: 1px solid var(--border); border-radius: var(--radius); }

/* --- Nav: bottom tab bar on mobile, top nav on desktop --- */
nav#tabs {
  display: flex;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--paper);
  border-top: 1px solid var(--border);
  z-index: 10;
}
nav#tabs button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}
nav#tabs button svg { width: 18px; height: 18px; }
nav#tabs button.active { color: var(--accent); font-weight: 600; }

/* Account / avatar area in the top bar. */
.account { display: flex; align-items: center; gap: 10px; margin-left: auto; overflow-wrap: anywhere; }
.avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--wash);
  color: var(--accent);
  font-weight: 650;
  font-size: 12px;
}

[hidden] { display: none !important; }
.meta { color: var(--muted); font-size: 13px; }
.error { color: var(--danger); }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
#login-bar { overflow-wrap: anywhere; }

/* Screen-reader-only text (e.g. the splash's <h1>, whose logo is in the image). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- Splash / logged-out landing (TECHUP-022, ADR-0009) ------------------- */

/* Full-bleed: no header, no bottom-nav gutter; errors float over the image. */
body.splash-active { padding-bottom: 0; }
body.splash-active header.top { display: none; }
body.splash-active #error:not(:empty) { position: fixed; top: 0; left: 0; right: 0; z-index: 2; }

/* Phones: `contain` keeps the centred logo whole (cover crops it to ~26% of
   the width). #0f4355 is the image's average edge colour so the letterbox
   bands blend in. display overrides the global `section { display: none }`
   view-toggling rule; [hidden] still wins. */
.splash {
  display: block;
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  background: #0f4355 url("img/techup-splash-1280.jpg") center 40% / contain no-repeat;
}
.splash[hidden] { display: none; }

/* Login controls occupy the bottom third of the splash. */
.splash-actions {
  position: absolute;
  left: 0;
  right: 0;
  top: 66.67%;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
}
.splash-login {
  display: inline-block;
  min-width: 200px;
  padding: 14px 32px;
  background: var(--blue);
  color: #fff;
  border-radius: var(--radius-lg);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
}
.splash-login:hover, .splash-login:focus-visible { background: var(--accent); }
.splash-login:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* Dev picker on a light panel so the select/button stay readable over the photo. */
.splash-dev {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  background: rgba(255, 255, 255, .92);
  border-radius: var(--radius-lg);
  padding: 8px 12px;
  color: var(--ink);
}
.splash-dev .meta { color: var(--ink); }
.splash-dev select { max-width: 100%; }

@media (min-width: 640px) {
  .splash {
    background-image: url("img/techup-splash-2560.jpg");
    background-size: cover;
    background-position: center;
  }
}

.browse-group + .browse-group { margin-top: 28px; }
.browse-group > h3 { font-size: 16px; }
.day-separator {
  font-size: 16.9px;
  font-weight: 700;
  color: var(--muted);
  margin: 20px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.day-separator:first-child { margin-top: 4px; }
.card h4 { margin: 0; font-size: 15px; }
.card-head > h3, .card-head > h4 { min-width: 0; overflow-wrap: anywhere; }
.card, .detail-grid { overflow-wrap: anywhere; }
.assigned-session { border-left: 4px solid var(--accent); }
/* My Schedule groups for session managers/admins (TECHUP-041). */
.schedule-group-heading { font-size: 18px; margin: 24px 0 8px; }
.schedule-group-heading:first-child { margin-top: 4px; }
.session-description { white-space: pre-wrap; font-size: 14px; }
body:has(dialog[open]) { overflow: hidden; }
#session-modal {
  width: min(760px, calc(100% - 24px));
  max-height: calc(100dvh - 32px);
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: inherit;
  overflow-y: auto;
}
#session-modal::backdrop { background: rgb(0 0 0 / 45%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-head h2 { margin: 0; font-size: 19px; overflow-wrap: anywhere; min-width: 0; }
.icon-button { flex: 0 0 44px; height: 44px; font-size: 26px; background: none; border: 0; }
#session-modal-message:not(:empty) { margin: 12px 0; overflow-wrap: anywhere; }
#session-modal-content h3 { font-size: 16px; margin-top: 24px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.detail-grid dt { color: var(--muted); font-size: 12px; }
.detail-grid dd { margin: 4px 0 0; white-space: pre-wrap; font-size: 14px; }
.modal-form { padding: 16px 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; }
.modal-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.modal-form legend { font-weight: 600; padding: 0; margin-bottom: 12px; }
.modal-form label { margin-top: 12px; }
.form-row > div { min-width: 0; }
.form input, .form select, .form textarea { min-width: 0; max-width: 100%; font-size: 16px; }
.table-scroll { max-width: 100%; overflow-x: auto; }
.table-scroll table { min-width: 420px; }
.table-scroll td { overflow-wrap: anywhere; }

/* --- Two-tab session modal (TECHUP-004) ------------------------------------ */

.modal-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin: 12px 0 0;
}
.modal-tabs button {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}
.modal-tabs button.active {
  color: var(--accent);
  font-weight: 600;
  border-bottom-color: var(--accent);
}
.modal-tabs button:hover:not(.active) { color: var(--ink); }

.info-section { margin: 12px 0; }
.info-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] { width: auto; margin: 0; }

/* Fields a presenter cannot edit in the session modal (TECHUP-045). Matches the
   [disabled] attribute, not :disabled, so the whole-fieldset disable while saving
   doesn't grey every field. --muted on --wash is 4.98:1 (WCAG AA). */
#session-modal .modal-form input[disabled]:not([type="checkbox"]),
#session-modal .modal-form select[disabled],
#session-modal .modal-form textarea[disabled] {
  background: var(--wash);
  color: var(--muted);
  -webkit-text-fill-color: var(--muted); /* Safari otherwise fades disabled text further */
  opacity: 1;
  border-style: dashed;
  cursor: not-allowed;
}
#session-modal .modal-form .checkbox-label:has(input[disabled]) { color: var(--muted); cursor: not-allowed; }
#session-modal .modal-form .checkbox-label input[disabled] { cursor: not-allowed; }

/* --- Attendee modal (TECHUP-006) ------------------------------------------- */

#admin-attendees-list tr[data-id] { cursor: pointer; }
#admin-attendees-list tr[data-id]:hover { background: var(--wash); }

#attendee-modal,
#new-session-modal,
#new-occurrence-modal,
#feedback-modal,
#manager-feedback-modal,
#commend-modal,
#survey-modal {
  width: min(600px, calc(100% - 24px));
  max-height: calc(100dvh - 32px);
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: inherit;
  overflow-y: auto;
}
#attendee-modal::backdrop,
#new-session-modal::backdrop,
#new-occurrence-modal::backdrop,
#feedback-modal::backdrop,
#manager-feedback-modal::backdrop,
#commend-modal::backdrop,
#survey-modal::backdrop { background: rgb(0 0 0 / 45%); }
#attendee-modal-message:not(:empty),
#new-session-modal-message:not(:empty),
#new-occurrence-modal-message:not(:empty),
#feedback-modal-message:not(:empty),
#manager-feedback-modal-message:not(:empty),
#commend-modal-message:not(:empty),
#survey-modal-message:not(:empty) { margin: 12px 0; overflow-wrap: anywhere; }

/* --- Session calendar (TECHUP-003) ----------------------------------------- */

.browse-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--gap);
}
.mode-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.mode-toggle button {
  border: 0;
  background: var(--paper);
  padding: 6px 12px;
  font-size: 13px;
  color: var(--muted);
}
.mode-toggle button.active { background: var(--accent); color: #fff; }
.day-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-left: 8px; }
.day-picker .day { display:flex; align-items:center; gap:12px; border:1px solid var(--border); border-radius:var(--radius-lg); background:var(--paper); padding:9px 17px; text-align:left; cursor: pointer; }
.day-picker .day b { font-size:23px; line-height:1; }
.day-picker .day span { font-size:11px; color:var(--muted); display:block; }
.day-picker .day strong { display:block; font-size:12px; color:var(--ink); }
.day-picker .day.active { background:var(--wash); border-color:var(--accent); }

/* Room-lane grid: rows come from the compressed segment builder, so every
   tile lands exactly on track lines. Horizontal scroll when lanes overflow. */
.cal-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--paper);
}
.cal-grid { display: grid; gap: 2px; width: 100%; }
.cal-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  padding: 8px 4px;
  overflow-wrap: anywhere;
}
.cal-corner { z-index: 4; border-right: 1px solid var(--border); }
.cal-axis {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--paper);
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  padding: 2px 6px 0 4px;
  border-right: 1px solid var(--border);
}
/* Collapsed idle range: thin hatched strip with its duration. */
.cal-gaprow {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  padding-left: 70px;
  font-size: 11px;
  color: var(--muted);
  background: repeating-linear-gradient(45deg, var(--wash) 0 6px, var(--paper) 6px 12px);
}
button.cal-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: var(--wash);
  padding: 4px 6px;
  font-size: 12px;
  line-height: 1.25;
  overflow: hidden;
  min-width: 0;
}
button.cal-tile:hover { border-color: var(--accent); }
.cal-tile .cal-title {
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.cal-tile .cal-time { color: var(--muted); font-size: 11px; }
.cal-tile .cal-sub {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-tile.cancelled { background: var(--border); }
.cal-tile.cancelled .cal-title { text-decoration: line-through; color: var(--muted); }
.cal-tile.draft { background: var(--paper); border-style: dashed; }
.cal-tile.mine { border-left: 4px solid var(--accent); }
.cal-tile.selected { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.cal-tile.plenary {
  border-left: 4px solid var(--blue);
  background: color-mix(in srgb, var(--blue) 8%, var(--wash));
  align-items: center;
  justify-content: center;
  text-align: center;
}
/* Meals and shared-space ("Other"/"Foyer") bookings: same full-row layout as
   plenary, distinct tint so they read differently (TECHUP-036). */
.cal-tile.meals,
.cal-tile.full-row {
  align-items: center;
  justify-content: center;
  text-align: center;
}
.cal-tile.meals {
  border-left: 4px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--wash));
}
.cal-tile.full-row {
  border-left: 4px solid var(--muted);
  background: color-mix(in srgb, var(--muted) 8%, var(--wash));
}
.cal-break {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: var(--surface-2, #f0f2f5);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 4px 12px;
  font-size: 0.85em;
  color: var(--text-muted, var(--muted));
  z-index: 1;
}
.cal-break-label { font-weight: 600; }
.cal-break-time { font-size: 0.9em; }
.schedule-break-divider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface-2, #f0f2f5);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  margin: 8px 0;
  font-size: 0.85em;
  color: var(--text-muted, var(--muted));
}
.schedule-break-label { font-weight: 600; }
.schedule-break-time { font-size: 0.9em; }

/* --- Session details sidebar (TECHUP-011) ---------------------------------- */

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin-top: var(--gap);
}

.card.selected { background: var(--wash); box-shadow: inset 3px 0 0 var(--blue); }
.card-select {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

/* Session row layout: time | title/meta | arrow (mirrors the mockup's .session). */
.session-row .card-select {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 16px;
  gap: 14px;
  align-items: start;
}
.session-row .time {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 650;
}
.session-row .time small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.session-row .kind { display: block; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 3px; }
.session-row-body h4 { margin: 0 0 4px; font-size: 15px; }
.session-row .session-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.session-row .session-meta svg { width: 13px; height: 13px; flex-shrink: 0; }
.session-row .card-select > svg { width: 16px; height: 16px; color: var(--muted); margin-top: 4px; }
.session-row.selected .card-select > svg { color: var(--blue); }

.session-detail {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 4px;
}
.session-detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}
.session-detail h3 { margin: 0 0 8px; font-size: 18px; }
.session-detail-capacity {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-top: 16px;
}
.session-detail progress { width: 100%; margin: 4px 0 16px; accent-color: var(--accent); }
.session-detail-action { display: block; width: 100%; margin-top: 8px; text-align: center; }

/* --- Commendations (TECHUP-020) ------------------------------------------ */

.commend-reasons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 0;
  border: none;
  padding: 0;
  margin: 0 0 12px;
}
.commend-reasons-grid legend {
  font-weight: 600;
  margin-bottom: 8px;
}
.commend-reasons-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 12px 4px 0;
}
.commend-reasons-grid label:nth-of-type(odd) {
  border-right: 1px solid var(--border);
  padding-right: 12px;
}
.commend-reasons-grid label:nth-of-type(even) {
  padding-left: 12px;
}
.commend-reason-text { flex: 1; }
.commend-tooltip {
  position: relative;
  cursor: help;
  font-size: 12px;
  opacity: 0.5;
  flex-shrink: 0;
}
.commend-tooltip:hover { opacity: 1; }
.commend-tooltip:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 100%;
  /* The info icon sits at the right edge of its column, so a centred bubble overflowed the modal's right edge
     (the dialog's overflow clips it). Grow leftward from the icon instead, capped to fit narrow screens. */
  right: 0;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: normal;
  width: max-content;
  max-width: min(240px, calc(100vw - 64px));
  z-index: 10;
  pointer-events: none;
  margin-bottom: 4px;
}

.commend-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }

/* TECHUP-034 checkbox alignment. The reasons grid sits inside .form, whose
   generic rules leaked in: `.form label` (block, 12px top margin, weight 600)
   with `.form label:first-of-type { margin-top: 0 }` staggered the first row,
   and `.form input` (width:100%, padding, border) stretched every checkbox.
   These overrides out-rank both (including the :first-of-type rule). */
.commend-reasons-grid { grid-auto-rows: minmax(36px, auto); align-items: center; }
.form .commend-reasons-grid label,
.form .commend-reasons-grid label:first-of-type {
  display: flex;
  align-items: center;
  margin: 0;
  min-height: 36px;
  font-size: 14px;
  font-weight: 400;
}
.form .commend-reasons-grid input[type="checkbox"] {
  flex: none;
  width: 16px;
  height: 16px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  accent-color: var(--accent);
}
.form .commend-reasons-grid input[type="checkbox"]:focus { outline-offset: 2px; }

#commend-message:not(:empty) { margin-top: 12px; color: var(--good); font-weight: 600; }

/* --- Personnel directory (TECHUP-034) -------------------------------------- */

/* Mobile-first: search + session filter stack, rows are cards; the
   min-width:640px block turns rows into aligned columns. */
.directory-toolbar { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 8px; }
.directory-toolbar input,
.directory-toolbar select {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  color: inherit;
}
.directory-toolbar input:focus,
.directory-toolbar select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}
.directory-count { margin: 0 0 8px; font-size: 13px; }
.directory-head { display: none; }
.directory-list { list-style: none; margin: 0; padding: 0; }
.directory-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 0;
  width: 100%;
  margin: 0 0 var(--gap);
  padding: 12px 16px;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-wrap: anywhere;
}
.directory-row:hover { background: var(--wash); }
.directory-name { flex: 1 0 100%; font-weight: 600; font-size: 15px; }
.directory-email { flex: 1 0 100%; color: var(--muted); font-size: 13px; }
.directory-cell { color: var(--muted); font-size: 13px; }
.directory-cell:empty { display: none; }
.directory-cell:not(:empty) ~ .directory-cell:not(:empty)::before { content: "\00b7"; margin: 0 6px; }

/* The room-lane grid is not usable on phones: force list mode there. */
@media (max-width: 639px) {
  #browse-toolbar { display: none; }
  .commend-reasons-grid { grid-template-columns: 1fr; }
  .commend-reasons-grid label:nth-of-type(odd) { border-right: none; }
  .commend-reasons-grid label:nth-of-type(even) { padding-left: 0; }
}

@media (min-width: 640px) {
  #session-modal, #attendee-modal, #new-session-modal, #new-occurrence-modal, #feedback-modal, #manager-feedback-modal, #commend-modal, #survey-modal { padding: 24px; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body { padding-bottom: 0; }
  nav#tabs {
    position: static;
    border-top: none;
    border-bottom: 1px solid var(--border);
    justify-content: flex-start;
    gap: 20px;
    padding: 0 16px;
  }
  nav#tabs button {
    flex: none;
    flex-direction: row;
    gap: 8px;
    padding: 12px 0;
    font-size: 14px;
  }
  nav#tabs button.active { border-bottom-color: var(--blue); }

  /* Headers and card actions sit inline once there is room. */
  .panel-head,
  .card-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .card-actions { flex-shrink: 0; }

  /* Start/end datetimes pair up. */
  .form-row { grid-template-columns: 1fr 1fr; }

  /* Personnel directory (TECHUP-034): aligned columns instead of stacked cards. */
  .directory-toolbar { grid-template-columns: minmax(0, 1fr) minmax(0, 320px); }
  .directory-head,
  .directory-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1.3fr);
    gap: 12px;
    align-items: center;
  }
  .directory-head {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
  }
  .directory-list li + li .directory-row { border-top: 1px solid var(--border); }
  .directory-row { padding: 8px 12px; border: 0; border-radius: 0; margin: 0; }
  .directory-list { border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); overflow: hidden; }
  .directory-email,
  .directory-cell { color: var(--ink); font-size: 14px; }
  .directory-cell:not(:empty) ~ .directory-cell:not(:empty)::before { content: none; }
  .directory-cell:empty { display: block; } /* keep the column slot */

  /* Buttons size to their content rather than stretching across the form. */
  .form-actions button { flex: none; min-width: 120px; }

  /* Session details sidebar sits next to the list/calendar once there's room. */
  .workbench { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
  .session-detail {
    border-left: 1px solid var(--border);
    border-top: 0;
    padding: 0 0 0 20px;
    margin-top: 0;
    position: sticky;
    top: 12px;
  }
}

/* --- Feedback (TECHUP-009) -------------------------------------------------- */

.feedback-intro { font-size: 1.2em; }
.tz-banner { margin-bottom: 8px; }

.feedback-question { margin-bottom: 16px; }
.feedback-question label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.feedback-form-card form { margin-top: 8px; }
.feedback-form-card textarea {
  width: 100%;
  padding: 8px 10px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  resize: vertical;
}

.score-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.score-option {
  display: inline-block;
  min-width: 36px;
  text-align: center;
  padding: 6px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  margin: 0;
}
.score-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.score-option:has(input:checked) {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Labelled radio lists: welcome survey and attendee feedback (TECHUP-044). */
fieldset.feedback-question, .survey-question { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
fieldset.feedback-question legend, .survey-question legend { font-size: 13px; font-weight: 600; padding: 0; margin-bottom: 6px; }
.feedback-question textarea { width: 100%; font-family: inherit; font-size: 16px; resize: vertical; }
.choice-list { display: flex; flex-wrap: wrap; gap: 6px; }
.choice-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  margin: 0;
}
.choice-option:has(input:checked) { border-color: var(--accent); background: var(--wash); }
.choice-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Out-rank the generic .form label/input rules (see the TECHUP-034 note above). */
.form .choice-list .choice-option,
.form .choice-list .choice-option:first-of-type { display: inline-flex; margin: 0; font-size: 14px; font-weight: 400; }
.choice-option input[type="radio"] {
  flex: none; width: 16px; height: 16px; min-width: 0; margin: 0; padding: 0;
  border: 0; border-radius: 0; accent-color: var(--accent);
}
.form .choice-option input[type="radio"]:focus { outline: none; }
.survey-other { margin-top: 8px; }
.survey-other input { width: 100%; }
#survey-modal-intro { margin: 4px 0 12px; }
/* Welcome survey only: questions 20% larger than the shared 13px legend, and clear space between question
   blocks. ID-scoped so it beats `.modal-form fieldset { margin: 0 }`, which was cancelling the 16px gap. */
#survey-modal .survey-question { margin: 0 0 28px; }
#survey-modal .survey-question legend { font-size: 15.6px; margin-bottom: 10px; }
@media (max-width: 639px) {
  .choice-list { flex-direction: column; }
}

.feedback-submitted { border-left: 4px solid var(--good); }
.feedback-scores { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; font-size: 13px; color: var(--muted); }

.feedback-locked { opacity: 0.65; }

.feedback-card-compact { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.feedback-card-compact .feedback-card-info { flex: 1; min-width: 0; }
.feedback-card-compact h4 { margin: 0; }
.feedback-card-compact .meta { margin: 2px 0 0; }
.feedback-card-compact button { flex-shrink: 0; }
.feedback-card-compact .feedback-locked-note { flex-shrink: 0; max-width: 45%; margin: 0; font-size: 13px; text-align: right; }

/* --- Notifications (TECHUP-018) ------------------------------------------- */

.notif-bell {
  position: relative;
  background: none;
  border: none;
  padding: 4px;
  color: var(--ink);
  display: grid;
  place-items: center;
}
.notif-bell svg { width: 22px; height: 22px; }

.notif-count {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
}

.notif-panel {
  position: absolute;
  right: 16px;
  top: 100%;
  width: calc(100% - 32px);
  max-width: 360px;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  padding: 8px;
  z-index: 100;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
}
.notif-item:last-child { border-bottom: none; }
.notif-item strong { font-size: 14px; }

.notif-dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--muted);
  padding: 0 4px;
  line-height: 1;
}
.notif-dismiss:hover { color: var(--danger); }

header.top { position: relative; }
