/* Inherit Dean's palette, controls, typography and dark-mode tokens. Colours come only from
   styles.css tokens so light and dark themes both follow. */
.ac-selector { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.ac-selector [hidden] { display: none !important; }
.ac-selector > [data-content] { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ac-selector > [data-notice]:empty { display: none; }
[data-options-results] { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
[data-options-results] > .ac-hint { margin: -4px 0 0; }
[data-comparison]:empty { display: none; }
.ac-ic { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ac-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header: title and Pilot badge sit together, clear of the sheet's close button. */
.ac-selector-heading { display: flex; flex-direction: column; gap: 4px; padding-right: 44px; }
.ac-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ac-selector-heading h2 { margin: 0; }
.ac-sub { margin: 0; color: var(--ink-2); font-size: 14px; }

/* Stepper: numbered dots joined by a rail; done steps show a tick. */
.ac-stepper ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 0; align-items: center; }
.ac-stepper li { display: flex; align-items: center; flex: 1; min-width: 0; }
.ac-stepper li:not(:last-child)::after { content: ''; flex: 1; height: 2px; margin: 0 10px; border-radius: 2px; background: var(--line); }
.ac-stepper button { display: inline-flex; align-items: center; gap: 9px; padding: 4px 6px 4px 4px; border: none; background: none;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; border-radius: 999px; white-space: nowrap; }
.ac-stepper button:disabled { cursor: default; opacity: 0.55; }
.ac-stepper button:not(:disabled):hover .ac-step-n { box-shadow: inset 0 0 0 1.5px var(--navy); }
.ac-stepper button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.ac-step-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700;
  background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line); transition: background .2s var(--ease), color .2s var(--ease); }
.ac-stepper .is-current { color: var(--ink); }
.ac-stepper .is-current .ac-step-n { background: var(--navy); color: var(--surface); box-shadow: 0 0 0 4px var(--focus-ring); }
.ac-stepper .is-done { color: var(--ink); }
.ac-stepper .is-done .ac-step-n { background: color-mix(in srgb, var(--ok) 16%, transparent); color: color-mix(in srgb, var(--ok) 60%, var(--ink)); box-shadow: none; font-size: 0; }
.ac-stepper .is-done .ac-step-n::before { content: '✓'; font-size: 13px; }

/* Panels: one quiet surface style for every block in the flow. */
.ac-panel, .ac-context, .ac-row, .ac-room, .ac-callout { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.ac-panel { padding: 16px 18px; }
.ac-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ac-panel-head h3, .ac-results-head h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.ac-muted-sm { color: var(--ink-3); font-size: 12.5px; font-weight: 500; }
.ac-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }

/* Student identity + booked stay summary. */
.ac-context { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px 18px; padding: 14px 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--navy) 5%, var(--surface)), var(--surface)); }
.ac-context-meta { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ac-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ac-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 14px; font-weight: 700;
  color: var(--navy); background: color-mix(in srgb, var(--navy) 13%, transparent); }
.ac-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.ac-ref { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; color: var(--ink-2); background: var(--surface-2); vertical-align: 1px; }
.ac-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  color: var(--ink-2); background: var(--surface-2); max-width: 100%; }
.ac-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-chip .ac-ic { width: 13px; height: 13px; color: var(--ink-3); }
.ac-dates { display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.ac-dates .ac-ic { color: var(--ink-3); }
.ac-nights { padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--navy); background: color-mix(in srgb, var(--navy) 10%, transparent); }

/* Secondary buttons: lighter than the default pill so the primary action stands out. */
.ac-selector .btn.ac-ghost { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.ac-selector .btn.ac-ghost:hover { background: var(--surface-hover); }
.ac-selector .btn .ac-ic { width: 14px; height: 14px; }

/* Short one-line guidance in place of paragraphs. */
.ac-hint { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
.ac-hint .ac-ic { width: 14px; height: 14px; margin-top: 1px; color: var(--ink-3); }
.ac-callout { display: flex; align-items: center; gap: 12px; padding: 12px 14px; flex-wrap: wrap;
  background: color-mix(in srgb, var(--navy) 6%, var(--surface)); border-color: color-mix(in srgb, var(--navy) 18%, var(--line)); }
.ac-callout p { margin: 0; flex: 1; min-width: 200px; font-size: 13px; }
.ac-callout > .ac-ic { width: 18px; height: 18px; color: var(--navy); }

/* Existing placements: collapsible list with a count badge. */
.ac-existing summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font-weight: 700; font-size: 14px; }
.ac-existing summary::-webkit-details-marker { display: none; }
.ac-existing summary::before { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3);
  transform: rotate(-45deg); transition: transform .2s var(--ease); margin-right: 4px; }
.ac-existing[open] summary::before { transform: rotate(45deg); }
.ac-existing[open] summary { margin-bottom: 12px; }
.ac-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 11.5px;
  font-weight: 700; color: var(--ink-2); background: var(--surface-2); }
.ac-alloc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ac-alloc { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.ac-alloc:first-child { border-top: none; padding-top: 0; }
.ac-alloc-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.ac-alloc-main strong { font-size: 14px; overflow-wrap: anywhere; }
.ac-alloc-sub { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Filters: labelled fields on a grid that wraps cleanly. */
.ac-filters { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)) minmax(170px, 1.6fr) auto; gap: 12px; align-items: end; }
.ac-filters-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 12px; }
.ac-filters label, .ac-inline { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); min-width: 0; }
.ac-filters .btn { height: 44px; }

/* Step 1 search bar. */
.ac-search { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ac-search-field { position: relative; flex: 1; min-width: 240px; display: block; }
.ac-search-field .ac-ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-3); pointer-events: none; }
.ac-search-field input { padding-left: 38px; width: 100%; }
.ac-inline { flex-direction: row; align-items: center; gap: 8px; }
.ac-inline select { width: auto; }

/* Queue rows. */
.ac-list { display: flex; flex-direction: column; gap: 8px; }
.ac-row { display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr) auto; align-items: center; gap: 12px 18px; padding: 12px 14px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.ac-row:hover { border-color: color-mix(in srgb, var(--navy) 28%, var(--line)); box-shadow: var(--shadow-sm); }
.ac-row-main { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.ac-row-side { display: flex; align-items: center; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.ac-row-side .ac-selector-actions { margin: 0; }
.ac-flags { display: flex; gap: 6px; flex-wrap: wrap; }
.ac-count { color: var(--ink-3); font-size: 12.5px; font-weight: 600; }
.ac-loading { padding: 22px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* Room results. */
.ac-results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.ac-toggle, .ac-compare { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.ac-toggle input, .ac-compare input { width: auto; }
.ac-selector-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.ac-room { display: flex; flex-direction: column; gap: 10px; padding: 16px; transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease); }
.ac-room:hover { border-color: color-mix(in srgb, var(--navy) 28%, var(--line)); box-shadow: var(--shadow); }
.ac-room.is-muted { background: var(--surface-3); }
.ac-room-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ac-room-top .ac-eyebrow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-room-top .pill { flex: none; }
.ac-room:has([data-compare]:checked) { border-color: color-mix(in srgb, var(--navy) 45%, var(--line)); box-shadow: 0 0 0 3px var(--focus-ring); }
.ac-room h3 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.015em; }
.ac-room-name { margin: -4px 0 0; color: var(--ink-2); font-size: 13.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ac-restrict { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.ac-restrict span { color: var(--ink-3); font-weight: 600; margin-right: 4px; }
.ac-doc { margin: 0; font-size: 12px; color: var(--ink-3); }
.ac-doc.warn { color: color-mix(in srgb, var(--warn) 70%, var(--ink)); }
.ac-room-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ac-room-foot .ac-selector-actions { margin: 0; }

/* Confirm step. */
.ac-confirm-room { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.ac-confirm-name { font-size: 17px; letter-spacing: -0.015em; }
.ac-confirm .ac-chips { margin-bottom: 10px; }
.ac-confirm .ac-restrict { margin-bottom: 14px; }
.ac-ack { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r-sm); cursor: pointer; font-size: 13.5px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.ac-ack input { width: auto; margin-top: 2px; }
.ac-ack:has(input:checked) { background: color-mix(in srgb, var(--ok) 10%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 40%, transparent); }
.ac-foot { justify-content: flex-end; margin-bottom: 0; }

.ac-empty-soft { padding: 36px 24px; }
.ac-empty-soft .ac-muted-sm { display: block; }

/* Shared pieces kept for the Add Accommodation draft form. */
.ac-selector-pager { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ac-selector-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-block: 12px; }
.ac-selector-filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin-block: 16px; }
.ac-selector-filters label { display: flex; flex-direction: column; gap: 6px; min-width: 130px; }
.ac-selector-filters .ac-selector-check, .ac-selector-check { display: flex; flex-direction: row; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--ink-2); }
.ac-selector-check input { width: auto; }
.ac-selector-notice { padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); margin: 0; font-size: 13px; }
.ac-selector-notice:empty { display: none; }
.ac-selector-notice.error { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 7%, var(--surface)); }
.ac-selector-table { overflow-x: auto; }
.ac-selector-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ac-selector-table th, .ac-selector-table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.ac-selector-table thead th { font-size: 12px; color: var(--ink-2); }
.ac-selector-table tbody th { color: var(--ink-3); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .ac-room, .ac-row, .ac-step-n, .ac-existing summary::before { transition: none; }
}
@media (max-width: 1000px) {
  .ac-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ac-filters .ac-grow, .ac-filters > .btn { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .ac-context { grid-template-columns: 1fr; }
  .ac-context > .btn { justify-self: start; }
  .ac-row { grid-template-columns: 1fr; }
  .ac-row-side { justify-content: space-between; }
}
@media (max-width: 600px) {
  .ac-stepper .ac-step-t { display: none; }
  .ac-stepper .is-current .ac-step-t { display: inline; }
  .ac-selector-filters > label, .ac-selector-filters > button, .ac-search > * { width: 100%; min-width: 0 !important; }
  .ac-selector .formgrid { grid-template-columns: 1fr; }
}
