.track-switch,.advanced-context { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin:0 0 20px; }
.track-switch .active { border:2px solid var(--blue); background:#edf4fb; font-weight:700; }
.advanced-context { justify-content:space-between; color:var(--muted); font-size:12px; }
.advanced-card,.advanced-form { padding:24px; margin:20px 0; }
.advanced-photo { margin:0; padding:16px; background:#fff; border:1px solid var(--border); border-radius:6px; min-width:0; }
.advanced-photo img { display:block; width:100%; height:230px; object-fit:contain; }
.advanced-photo figcaption { margin-top:12px; font-weight:650; }
.advanced-photo small { display:block; color:var(--muted); font-weight:400; margin-top:5px; }
.advanced-photos,.advanced-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; margin-bottom:24px; }
.advanced-form label { display:flex; flex-direction:column; gap:6px; font-weight:600; margin-bottom:16px; }
.advanced-form input,.advanced-form select,.advanced-form textarea { width:100%; min-width:0; min-height:44px; padding:10px; border:1px solid var(--field); border-radius:5px; color:var(--text); background:white; font:inherit; font-weight:400; }
.advanced-form textarea { resize:vertical; }
.field-error { color:#b91c1c; font-weight:500; }
.actor-entry { border-top:1px solid var(--border); padding:16px 0; overflow-wrap:anywhere; }
.advanced-report { white-space:pre-wrap; overflow-wrap:anywhere; font:inherit; margin:0; }
.advanced-context span,.detail-field dd { overflow-wrap:anywhere; }
.advanced-card .button-row,.advanced-form .button-row { margin:20px 0 0; }
@media(max-width:1100px) { .with-investigation .advanced-form-grid { grid-template-columns:1fr; } }
@media(max-width:760px) { .advanced-photos,.advanced-form-grid { grid-template-columns:1fr; } .advanced-card,.advanced-form { padding:16px; } .advanced-photo img { height:200px; } }

@media(max-width:760px) { .with-investigation .advanced-context button { display:none; } }

/* Advanced tables keep their action controls independent of long record IDs. */
.advanced-records { container-type:inline-size; }
.advanced-records th:last-child,.advanced-records td:last-child { width:116px; padding-inline:8px; }
.advanced-records .table-action { min-width:74px; min-height:44px; padding:8px 10px; gap:6px; white-space:nowrap; overflow-wrap:normal; word-break:normal; }
.advanced-records .table-action span { white-space:nowrap; }
.technical .training-disclaimer { font-size:12px; line-height:1.6; border-left:2px solid var(--border); padding-left:12px; }

@media(min-width:1000px) and (max-width:1250px) {
  .workspace-layout.with-investigation:has(.advanced-context) { grid-template-columns:minmax(0,1fr) 320px; }
  .workspace-layout.with-investigation:has(.advanced-context) .mission-rail { width:320px; box-shadow:none; }
}

/* Respond to available workspace width, including an expanded sidebar + guide. */
@container (max-width:680px) {
  .advanced-records table,.advanced-records tbody { display:block; width:100%; }
  .advanced-records thead { display:none; }
  .advanced-records tbody tr { display:grid; position:relative; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 20px; padding:16px; border-bottom:1px solid var(--border); }
  .advanced-records td,.advanced-records td:first-child,.advanced-records td:last-child { display:block; width:auto; border:0; padding:0; text-align:left; }
  .advanced-records td:first-child { grid-column:1/-1; padding-right:0; }
  .advanced-records td:last-child { position:static; grid-column:auto; justify-self:start; align-self:end; }
  .advanced-records td::before { content:attr(data-label); display:block; color:var(--muted); font-size:10px; text-transform:uppercase; margin-bottom:4px; }
  .advanced-records td:last-child::before { display:none; }
  .advanced-records td[colspan] { grid-column:1/-1; }
  .advanced-records .advanced-toolbar { padding:16px; }
  .advanced-records .advanced-toolbar .search-field { flex:1 0 100%; }
}
