:root {
  --bg: #071018;
  --panel: #101c28;
  --panel-2: #142536;
  --text: #f2f7fb;
  --muted: #9fb4c8;
  --line: #244054;
  --accent: #79e6ff;
  --green: #68ff9e;
  --yellow: #ffe066;
  --red: #ff7373;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(121,230,255,.14), transparent 35%),
    var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.adaptiv-app {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.adaptiv-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
  padding: 24px;
  background: linear-gradient(135deg, #102131, #09131d);
  border: 1px solid var(--line);
  border-radius: 24px;
}

.eyebrow,
.card-label {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

h1 {
  font-size: clamp(34px, 6vw, 64px);
  margin: 0;
}

h2 {
  margin: 0;
}

.subtext,
.small-note {
  color: var(--muted);
  line-height: 1.5;
}

.status-pill {
  border: 1px solid var(--line);
  background: #0b1824;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--green);
  white-space: nowrap;
  font-weight: 700;
}

.mission-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.card {
  background: rgba(16, 28, 40, .92);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 12px 34px rgba(0,0,0,.22);
}

.primary-card {
  background: linear-gradient(135deg, #123248, #101c28);
}

.wide {
  margin-bottom: 16px;
}

.big-score {
  font-size: 72px;
  font-weight: 900;
  line-height: 1;
}

.band {
  font-size: 20px;
  text-transform: uppercase;
  font-weight: 800;
}

.band.green { color: var(--green); }
.band.yellow { color: var(--yellow); }
.band.red { color: var(--red); }

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.template-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.template-pill {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--text);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

button {
  border: 1px solid var(--line);
  background: #14324a;
  color: var(--text);
  padding: 12px 16px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 800;
}

button:hover {
  border-color: var(--accent);
}

button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

@media (max-width: 900px) {
  .adaptiv-hero {
    flex-direction: column;
  }

  .mission-grid {
    grid-template-columns: 1fr;
  }

  .status-pill {
    white-space: normal;
  }
}

/* ADAPTIV PHASE 1C — PROFILE UI */

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.profile-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.profile-grid input,
.profile-grid select {
  width: 100%;
  background: #0b1824;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.profile-output {
  margin-top: 16px;
  white-space: pre-wrap;
  background: #071018;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  color: var(--muted);
  max-height: 360px;
  overflow: auto;
}

/* ADAPTIV PHASE 1D — WORKOUT MISSION UI */

.workout-mission-card {
  background: #071018;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  color: var(--text);
}

.workout-title {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 8px;
}

.workout-meta {
  color: var(--muted);
  margin-bottom: 14px;
}

.workout-block {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

.workout-block h3 {
  margin: 0 0 8px;
  color: var(--accent);
}

.workout-block ul {
  margin: 0;
  padding-left: 20px;
}

.workout-badge {
  display: inline-block;
  margin: 4px 6px 4px 0;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
}

/* ===================================================== */
/* ADAPTIV PHASE 1E — RECOVERY ENGINE */
/* ===================================================== */

.recovery-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:14px;
  margin-bottom:18px;
}

.recovery-grid label{
  display:block;
  margin-bottom:8px;
  color:var(--muted);
  font-size:13px;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.recovery-grid input{
  width:100%;
  padding:12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#071018;
  color:var(--text);
}

.recovery-results-card{
  background:#071018;
  border:1px solid var(--line);
  border-radius:16px;
  padding:18px;
}

.recovery-score-big{
  font-size:58px;
  font-weight:900;
  margin:8px 0;
}

.recovery-band{
  font-size:20px;
  font-weight:800;
  text-transform:uppercase;
}

.recovery-green{
  color:#69ff9f;
}

.recovery-yellow{
  color:#ffe066;
}

.recovery-red{
  color:#ff6b6b;
}

.recovery-list{
  margin-top:16px;
}

.recovery-list li{
  margin-bottom:8px;
}

/* ===================================================== */
/* ADAPTIV PHASE 1F — MISSION TIMELINE SYSTEM */
/* ===================================================== */

.timeline-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:14px;
  margin-bottom:18px;
}

.timeline-grid label{
  display:flex;
  flex-direction:column;
  gap:8px;
  color:var(--muted);
  font-weight:700;
}

.timeline-grid input,
.timeline-grid select{
  width:100%;
  background:#071018;
  color:var(--text);
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px;
}

.timeline-output{
  background:#071018;
  border:1px solid var(--line);
  border-radius:16px;
  padding:18px;
  color:var(--text);
}

.timeline-phase{
  font-size:32px;
  font-weight:900;
  color:var(--accent);
  margin:8px 0;
  text-transform:uppercase;
}

.timeline-meta{
  color:var(--muted);
  margin-bottom:12px;
}

.timeline-checkpoint{
  border-top:1px solid var(--line);
  padding-top:12px;
  margin-top:12px;
}

.timeline-checkpoint strong{
  color:var(--accent);
}

/* ===================================================== */
/* ADAPTIV PHASE 2A — AI TRAINER SYSTEM */
/* ===================================================== */

.coach-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:14px;
  margin-bottom:18px;
}

.coach-grid label{
  display:flex;
  flex-direction:column;
  gap:8px;
  color:var(--muted);
  font-weight:700;
}

.coach-grid input,
.coach-grid select{
  width:100%;
  background:#071018;
  color:var(--text);
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px;
}

.coach-output{
  background:#071018;
  border:1px solid var(--line);
  border-radius:16px;
  padding:18px;
  color:var(--text);
}

.coach-name{
  font-size:26px;
  font-weight:900;
  color:var(--accent);
}

.coach-headline{
  font-size:24px;
  font-weight:900;
  margin-top:12px;
}

.coach-message{
  margin-top:12px;
  line-height:1.6;
  color:var(--text);
}

.coach-focus{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:14px;
}

.coach-pill{
  border:1px solid var(--line);
  background:var(--panel-2);
  border-radius:999px;
  padding:7px 11px;
}

/* ===================================================== */
/* ADAPTIV PHASE 2B — ADAPTIVE INTELLIGENCE */
/* ===================================================== */

.adaptive-grid{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:18px;
}

.adaptive-output{
  background:#071018;
  border:1px solid var(--line);
  border-radius:16px;
  padding:20px;
}

.adaptive-title{
  font-size:28px;
  font-weight:900;
  color:var(--accent);
}

.adaptive-sub{
  margin-top:10px;
  font-size:18px;
  font-weight:700;
}

.adaptive-pills{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:14px;
}

.adaptive-pill{
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--panel-2);
  padding:7px 11px;
}

.adaptive-list{
  margin-top:18px;
  padding-left:20px;
}

/* ===================================================== */
/* ADAPTIV PHASE 2C — GLOBAL ACCESSIBILITY + LOCALIZATION */
/* ===================================================== */

.access-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:14px;
  margin-bottom:18px;
}

.access-grid label{
  display:flex;
  flex-direction:column;
  gap:8px;
  color:var(--muted);
  font-weight:700;
}

.access-grid input,
.access-grid select{
  width:100%;
  background:#071018;
  color:var(--text);
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px;
}

.checkbox-row{
  justify-content:end;
}

.checkbox-row input{
  width:auto;
}

.access-output{
  background:#071018;
  border:1px solid var(--line);
  border-radius:16px;
  padding:20px;
}

.access-title{
  font-size:28px;
  font-weight:900;
  color:var(--accent);
}

.access-pills{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:14px;
}

.access-pill{
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--panel-2);
  padding:7px 11px;
}

body.adaptiv-large-text{
  font-size:118%;
}

body.adaptiv-high-contrast{
  --bg:#000000;
  --panel:#050505;
  --panel-2:#111111;
  --text:#ffffff;
  --muted:#e6e6e6;
  --line:#ffffff;
  --accent:#00ffff;
}

body.adaptiv-low-bandwidth *{
  box-shadow:none !important;
  transition:none !important;
}

/* ===================================================== */
/* ADAPTIV PHASE 2D — ADHERENCE + PROGRESSION CORE */
/* ===================================================== */

.progression-actions{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-bottom:18px;
}

.progression-output{
  background:#071018;
  border:1px solid var(--line);
  border-radius:16px;
  padding:20px;
}

.progression-title{
  font-size:28px;
  font-weight:900;
  color:var(--accent);
}

.progression-message{
  margin-top:10px;
  font-size:16px;
  line-height:1.6;
}

.progression-pills{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:14px;
}

.progression-pill{
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--panel-2);
  padding:7px 11px;
}

.progression-log{
  margin-top:18px;
  border-top:1px solid var(--line);
  padding-top:12px;
}

/* ===================================================== */
/* ADAPTIV PHASE 2E — SMART EXERCISE SUBSTITUTION */
/* ===================================================== */

.substitution-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:14px;
  margin-bottom:18px;
}

.substitution-grid label{
  display:flex;
  flex-direction:column;
  gap:8px;
  color:var(--muted);
  font-weight:700;
}

.substitution-grid select{
  width:100%;
  background:#071018;
  color:var(--text);
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px;
}

.substitution-output{
  background:#071018;
  border:1px solid var(--line);
  border-radius:16px;
  padding:20px;
}

.substitution-title{
  font-size:28px;
  font-weight:900;
  color:var(--accent);
}

.substitution-pills{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:14px;
}

.substitution-pill{
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--panel-2);
  padding:7px 11px;
}

.substitution-list{
  margin-top:18px;
}

.substitution-item{
  border-top:1px solid var(--line);
  padding-top:12px;
  margin-top:12px;
}

.substitution-item strong{
  color:var(--accent);
}

/* ===================================================== */
/* ADAPTIV PHASE 2F — TACTICAL READINESS */
/* ===================================================== */

.tactical-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:14px;
  margin-bottom:18px;
}

.tactical-grid label{
  display:flex;
  flex-direction:column;
  gap:8px;
  color:var(--muted);
  font-weight:700;
}

.tactical-grid input,
.tactical-grid select{
  width:100%;
  background:#071018;
  color:var(--text);
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px;
}

.tactical-output{
  background:#071018;
  border:1px solid var(--line);
  border-radius:16px;
  padding:20px;
}

.tactical-title{
  font-size:32px;
  font-weight:900;
  color:var(--accent);
}

.tactical-band{
  font-size:18px;
  font-weight:800;
  margin-top:8px;
}

.tactical-pills{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:14px;
}

.tactical-pill{
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--panel-2);
  padding:7px 11px;
}

.tactical-section{
  margin-top:18px;
  border-top:1px solid var(--line);
  padding-top:14px;
}

/* ==================================================
   ADAPTIV PHASE 2H — MOBILE UI CLEANUP
   Purpose: make Adaptiv usable on phones/tablets.
   ================================================== */

:root {
  --adaptiv-mobile-gap: 14px;
  --adaptiv-mobile-radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

.adaptiv-app,
.adaptiv-shell,
main,
#adaptivRoot {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.adaptiv-card,
.card,
.panel,
section {
  max-width: 100%;
}

button,
input,
select,
textarea {
  max-width: 100%;
}

button {
  touch-action: manipulation;
}

pre,
code,
textarea,
.profile-json,
.json-panel,
.output,
.result-box {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Tablet cleanup */
@media (max-width: 900px) {
  body {
    padding: 14px;
  }

  .hero,
  .adaptiv-hero {
    padding: 26px 22px;
    border-radius: 22px;
  }

  .hero h1,
  .adaptiv-hero h1,
  h1 {
    font-size: clamp(2.2rem, 9vw, 4rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
  }

  .status-grid,
  .metric-grid,
  .dashboard-grid,
  .top-grid,
  .profile-grid,
  .form-grid,
  .quick-actions,
  .mission-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: var(--adaptiv-mobile-gap) !important;
  }

  .wide,
  .span-2,
  .profile-json,
  .mission-card,
  .timeline-card {
    grid-column: 1 / -1 !important;
  }
}

/* Phone cleanup */
@media (max-width: 640px) {
  body {
    padding: 10px;
  }

  .adaptiv-app,
  .adaptiv-shell,
  main,
  #adaptivRoot {
    padding: 0 !important;
  }

  .hero,
  .adaptiv-hero {
    padding: 22px 16px !important;
    border-radius: var(--adaptiv-mobile-radius) !important;
    margin-bottom: 12px !important;
  }

  .hero h1,
  .adaptiv-hero h1,
  h1 {
    font-size: clamp(2.15rem, 14vw, 3.4rem) !important;
    line-height: 0.95 !important;
    letter-spacing: -0.055em !important;
    margin-bottom: 12px !important;
  }

  .hero p,
  .adaptiv-hero p,
  p {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .status-grid,
  .metric-grid,
  .dashboard-grid,
  .top-grid,
  .profile-grid,
  .form-grid,
  .quick-actions,
  .mission-grid,
  .timeline-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .adaptiv-card,
  .card,
  .panel,
  section {
    padding: 16px !important;
    border-radius: var(--adaptiv-mobile-radius) !important;
    margin-bottom: 12px !important;
  }

  .metric-card,
  .stat-card {
    min-height: auto !important;
  }

  .metric-value,
  .recovery-score,
  .score,
  .big-number {
    font-size: clamp(2.8rem, 18vw, 4.8rem) !important;
    line-height: 0.95 !important;
  }

  .quick-actions,
  .button-row,
  .actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  button,
  .btn {
    width: 100% !important;
    min-height: 44px;
    padding: 12px 14px !important;
    border-radius: 14px !important;
    font-size: 0.95rem !important;
  }

  input,
  select,
  textarea {
    width: 100% !important;
    min-height: 44px;
    font-size: 16px !important;
    border-radius: 12px !important;
  }

  label {
    display: block;
    margin-bottom: 6px;
  }

  .mission-tags,
  .chips,
  .tag-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .mission-tags span,
  .chips span,
  .chip,
  .pill {
    max-width: 100%;
    white-space: normal !important;
    word-break: break-word;
  }

  .profile-json,
  .json-panel,
  pre,
  textarea {
    max-height: 260px !important;
    font-size: 0.75rem !important;
  }

  .section-title,
  h2 {
    font-size: 1.3rem !important;
    line-height: 1.15 !important;
  }

  h3 {
    font-size: 1.05rem !important;
  }

  .mobile-hide {
    display: none !important;
  }

  .mobile-compact {
    padding: 12px !important;
  }
}

/* Ultra-small phones */
@media (max-width: 390px) {
  body {
    padding: 8px;
  }

  .hero h1,
  .adaptiv-hero h1,
  h1 {
    font-size: 2.25rem !important;
  }

  .adaptiv-card,
  .card,
  .panel,
  section {
    padding: 14px !important;
  }
}

/* Phase 2H marker */
body::after {
  content: "adaptiv_phase_2h_mobile_cleanup_loaded";
  display: none;
}

/* ==================================================
   PHASE 3B-A — ADAPTIV V3 AUTONOMOUS MISSION PANEL
   ================================================== */
.adaptiv-v3-panel {
  margin: 24px auto;
  max-width: 1180px;
  padding: 0 16px 32px;
}

.adaptiv-v3-card {
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 20px;
  padding: 20px;
  background: rgba(8, 12, 24, 0.78);
  box-shadow: 0 18px 60px rgba(0,0,0,0.28);
}

.adaptiv-v3-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.adaptiv-v3-header h2 {
  margin: 0 0 6px;
}

.adaptiv-v3-header p {
  margin: 0;
  opacity: 0.78;
}

.adaptiv-v3-pill {
  white-space: nowrap;
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.18);
  opacity: 0.9;
}

.adaptiv-v3-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}

.adaptiv-v3-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
}

.adaptiv-v3-grid input,
.adaptiv-v3-grid select {
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.16);
  padding: 10px;
  background: rgba(255,255,255,0.06);
  color: inherit;
}

.adaptiv-v3-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.adaptiv-v3-actions button {
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.16);
  padding: 10px 12px;
  cursor: pointer;
}

.adaptiv-v3-output {
  min-height: 180px;
  max-height: 420px;
  overflow: auto;
  border-radius: 14px;
  padding: 14px;
  background: rgba(0,0,0,0.32);
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .adaptiv-v3-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

@media (max-width: 560px) {
  .adaptiv-v3-grid {
    grid-template-columns: 1fr;
  }

  .adaptiv-v3-header {
    flex-direction: column;
  }
}


/* ==================================================
   PHASE 3F-B — NUTRITION DASHBOARD FRONTEND PANEL
   ================================================== */

.nutrition-dashboard-panel {
  margin-top: 24px;
  padding: 20px;
  border-radius: 18px;
}

.nutrition-dashboard-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.nutrition-dashboard-header h2 {
  margin: 0 0 6px 0;
}

.nutrition-dashboard-header p {
  margin: 0;
  opacity: 0.8;
}

.nutrition-score-badge {
  min-width: 86px;
  min-height: 86px;
  border-radius: 999px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border: 1px solid rgba(255,255,255,0.18);
}

.nutrition-score-badge span {
  font-size: 28px;
  font-weight: 800;
}

.nutrition-score-badge small {
  opacity: 0.75;
}

.nutrition-priority-grid,
.nutrition-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.nutrition-priority-card,
.nutrition-module-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
}

.nutrition-priority-card strong,
.nutrition-module-card strong {
  display: block;
  margin-bottom: 6px;
}

.nutrition-priority-card span,
.nutrition-module-card span {
  opacity: 0.85;
}

.nutrition-dashboard-section {
  margin: 16px 0;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.035);
}

.nutrition-dashboard-section h3 {
  margin-top: 0;
}

.nutrition-dashboard-section li {
  margin-bottom: 6px;
}

.nutrition-dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.nutrition-dashboard-actions button {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}

.nutrition-safety-note {
  margin-top: 14px;
  font-size: 0.85rem;
  opacity: 0.72;
}

/* ADAPTIV DASHBOARD SHELL */
.adaptiv-os-shell {
  margin: 24px auto;
  padding: 20px;
  max-width: 1180px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  background: rgba(10, 14, 22, 0.78);
}

.adaptiv-os-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.adaptiv-os-kicker {
  font-size: 12px;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.adaptiv-os-status {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,0.16);
}

.adaptiv-os-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
}

.adaptiv-os-nav button {
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.06);
  color: inherit;
}

.adaptiv-os-nav button.adaptiv-nav-active {
  background: rgba(255,255,255,0.18);
}

.adaptiv-os-section {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
}

.adaptiv-dashboard-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.adaptiv-dashboard-phase,
.adaptiv-card-priority,
.adaptiv-explainability-topline {
  font-size: 11px;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.adaptiv-dashboard-card-grid,
.adaptiv-explainability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.adaptiv-universal-card,
.adaptiv-explainability-card,
.adaptiv-empty-card {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
}

.adaptiv-card-topline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.adaptiv-card-field {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.adaptiv-dashboard-summary,
.adaptiv-transport-shell pre {
  overflow-x: auto;
  padding: 12px;
  border-radius: 12px;
  background: rgba(0,0,0,0.25);
}

/* ADAPTIV DASHBOARD UX REFINEMENT LAYER */
.adaptiv-os-shell {
  box-shadow: 0 18px 60px rgba(0,0,0,0.32);
}

.adaptiv-os-header h1,
.adaptiv-dashboard-header h2 {
  margin: 4px 0;
  line-height: 1.08;
}

.adaptiv-os-header p,
.adaptiv-dashboard-header p {
  margin: 4px 0 0;
  opacity: 0.78;
  line-height: 1.35;
}

.adaptiv-os-nav {
  position: sticky;
  top: 0;
  z-index: 8;
  padding: 8px 0;
  backdrop-filter: blur(10px);
}

.adaptiv-os-nav button {
  min-height: 38px;
  transition: transform 0.12s ease, background 0.12s ease;
}

.adaptiv-os-nav button:active {
  transform: scale(0.98);
}

.adaptiv-os-section {
  margin-top: 10px;
}

.adaptiv-dashboard-shell,
.adaptiv-explainability-shell,
.adaptiv-transport-shell {
  margin-top: 16px;
}

.adaptiv-dashboard-header {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.adaptiv-dashboard-integrity,
.adaptiv-os-status {
  white-space: nowrap;
  font-weight: 700;
}

.adaptiv-dashboard-card-grid,
.adaptiv-explainability-grid {
  margin-top: 12px;
}

.adaptiv-universal-card,
.adaptiv-explainability-card,
.adaptiv-empty-card {
  min-width: 0;
}

.adaptiv-universal-card h3,
.adaptiv-explainability-card h3 {
  margin: 6px 0 10px;
  line-height: 1.12;
}

.adaptiv-card-field {
  align-items: flex-start;
  font-size: 13px;
}

.adaptiv-card-field strong {
  flex: 0 0 42%;
  opacity: 0.8;
}

.adaptiv-card-field span {
  flex: 1;
  text-align: right;
  overflow-wrap: anywhere;
}

.adaptiv-dashboard-summary {
  max-height: 220px;
  font-size: 12px;
}

.adaptiv-explainability-links {
  padding-left: 18px;
  opacity: 0.82;
  overflow-wrap: anywhere;
}

.adaptiv-transport-shell pre {
  max-height: 260px;
  font-size: 12px;
}

@media (max-width: 760px) {
  .adaptiv-os-shell {
    margin: 14px 8px;
    padding: 14px;
    border-radius: 16px;
  }

  .adaptiv-os-header,
  .adaptiv-dashboard-header {
    flex-direction: column;
  }

  .adaptiv-os-header h1 {
    font-size: 24px;
  }

  .adaptiv-os-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .adaptiv-os-nav button {
    width: 100%;
  }

  .adaptiv-os-section {
    padding: 10px;
  }

  .adaptiv-dashboard-card-grid,
  .adaptiv-explainability-grid {
    grid-template-columns: 1fr;
  }

  .adaptiv-card-field {
    display: block;
  }

  .adaptiv-card-field span {
    display: block;
    margin-top: 3px;
    text-align: left;
  }

  .adaptiv-dashboard-summary,
  .adaptiv-transport-shell pre {
    max-height: 180px;
  }
}

@media (min-width: 1100px) {
  .adaptiv-dashboard-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ADAPTIVE DASHBOARD COMPRESSION + PRIORITY ENGINE */
.adaptiv-universal-card[data-priority="critical"] {
  border: 2px solid rgba(255,80,80,0.35);
  box-shadow: 0 0 18px rgba(255,80,80,0.10);
}

.adaptiv-universal-card[data-priority="high"] {
  border: 1px solid rgba(255,180,80,0.22);
}

.adaptiv-card-more {
  margin-top: 10px;
  font-size: 11px;
  opacity: 0.72;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.adaptiv-dashboard-card-grid {
  align-items: start;
}

@media (max-width: 760px) {
  .adaptiv-universal-card {
    padding: 12px;
  }

  .adaptiv-card-field {
    font-size: 12px;
  }

  .adaptiv-card-more {
    font-size: 10px;
  }
}

/* ADAPTIV DASHBOARD EXPAND / COLLAPSE INTERACTION LAYER */
.adaptiv-card-more {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.08);
  color: inherit;
}

.adaptiv-hidden-fields {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255,255,255,0.14);
}

/* ADAPTIVE FOCUS MODE + SECTION COLLAPSE SYSTEM */
.adaptiv-runtime-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.adaptiv-runtime-controls button {
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.08);
  color: inherit;
}

.adaptiv-collapsed-section {
  display: none !important;
}

.adaptiv-compact-mode .adaptiv-universal-card,
.adaptiv-compact-mode .adaptiv-explainability-card {
  padding: 8px;
}

.adaptiv-compact-mode .adaptiv-card-field {
  font-size: 11px;
}

.adaptiv-focus-mode .adaptiv-universal-card[data-priority="low"] {
  opacity: 0.55;
}

.adaptiv-focus-mode .adaptiv-universal-card[data-priority="moderate"] {
  opacity: 0.72;
}

.adaptiv-focus-mode .adaptiv-universal-card[data-priority="critical"] {
  transform: scale(1.01);
}

.adaptiv-focus-mode .adaptiv-universal-card[data-priority="high"] {
  transform: scale(1.005);
}

@media (max-width: 760px) {
  .adaptiv-runtime-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .adaptiv-runtime-controls button {
    width: 100%;
  }
}

/* ADAPTIVE CONTEXTUAL RUNTIME ENGINE */
.adaptiv-runtime-balanced .adaptiv-os-shell {
  border-color: rgba(255,255,255,0.10);
}

.adaptiv-runtime-elevated .adaptiv-os-shell {
  border-color: rgba(255,180,80,0.35);
  box-shadow: 0 0 30px rgba(255,180,80,0.12);
}

.adaptiv-runtime-critical .adaptiv-os-shell {
  border-color: rgba(255,80,80,0.42);
  box-shadow: 0 0 42px rgba(255,80,80,0.16);
}

.adaptiv-critical-runtime .adaptiv-universal-card[data-priority="critical"] {
  transform: scale(1.02);
}

.adaptiv-runtime-critical .adaptiv-dashboard-header {
  border-bottom-color: rgba(255,80,80,0.28);
}

.adaptiv-runtime-elevated .adaptiv-dashboard-header {
  border-bottom-color: rgba(255,180,80,0.22);
}

/* AUTOMATIC RUNTIME ADAPTATION ENGINE */
.adaptiv-runtime-auto-critical .adaptiv-os-shell {
  animation: adaptivCriticalPulse 2.4s infinite;
}

@keyframes adaptivCriticalPulse {
  0% {
    box-shadow: 0 0 0 rgba(255,80,80,0.0);
  }

  50% {
    box-shadow: 0 0 32px rgba(255,80,80,0.14);
  }

  100% {
    box-shadow: 0 0 0 rgba(255,80,80,0.0);
  }
}
