/* Shared mobile layout, loaded after the citizen, executive and admin themes. */
:root {
  --elahi-dock-height: 190px;
  --elahi-keyboard-inset: 0px;
  --elahi-viewport-height: 100dvh;
  --elahi-viewport-top: 0px;
}

/* Vehicle imagery belongs to the shared journey, not only the executive preview. */
.vehicle-option-top { position: relative; padding-top: 28px; }
.vehicle-drawing.vehicle-photo {
  display: grid;
  place-items: center;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  max-height: 280px;
  overflow: hidden;
  border-radius: 12px;
  background: #eef5f9;
}
.vehicle-photo > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.vehicle-photo .vehicle-image-fallback { width: 100%; min-height: 150px; place-items: center; }
.vehicle-photo .vehicle-image-fallback:not([hidden]) { display: grid; }
.vehicle-photo .vehicle-image-fallback svg { width: 80px; height: 60px; }
.vehicle-option-top > .vehicle-due-badge { position: absolute; top: 0; inset-inline-end: 0; }
.selected-vehicle-visual { margin-bottom: 20px; }
.selected-vehicle-visual .vehicle-photo { max-height: 240px; }

@media (max-width: 900px) {
  html { -webkit-text-size-adjust: 100%; scroll-padding-bottom: calc(var(--elahi-dock-height) + 24px); }
  body { min-width: 0; min-height: 100svh; }
  img, svg { max-width: 100%; }
  button, a, input, select, textarea { touch-action: manipulation; }
  input, select, textarea { font-size: 16px !important; }
  button, .primary, .secondary, .text-button, .quiet { min-height: 44px; }
  button { overflow-wrap: anywhere; }
  main, section, .chat-column, .welcome-intro, .card-body, .field,
  .person > div, .completion-entity > div { min-width: 0; }
  .field strong, .summary-row strong, .reference strong, .file-pill,
  .completion-reference, .assistant-copy { overflow-wrap: anywhere; }

  body:not([data-copy-view="admin"]) > header,
  .executive-experience > header {
    height: auto;
    min-height: 82px;
    width: 100%;
    padding: calc(12px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
    gap: 12px;
    flex-wrap: wrap;
  }
  .header-right { gap: 6px; flex: 0 0 auto; }
  .header-right .concept { display: none !important; }
  .brand, .executive-experience .brand { font-size: 23px; gap: 7px; letter-spacing: -1px; }
  .brand small, .executive-experience .brand small { font-size: 6px; letter-spacing: 1px; }
  .official-logo, .executive-experience .official-logo { width: 34px; height: 34px; }
  .showcase-reset, .executive-experience .showcase-reset { width: 44px; height: 44px; padding: 0; border-radius: 50%; justify-content: center; }
  .showcase-reset span, .executive-experience .showcase-reset span { display: none; }
  .icon-button, .executive-experience .icon-button { width: 44px; height: 44px; flex-shrink: 0; }
  .language-toggle { padding: 2px; gap: 0; }
  .language-toggle button, .executive-experience .language-toggle button { min-height: 44px; padding: 8px 10px; font-size: 12px; }
  .menu, html[dir="rtl"] .menu {
    top: calc(100% - 4px);
    inset-inline: 16px;
    width: auto;
    max-width: 390px;
    margin-inline-start: auto;
    max-height: calc(var(--elahi-viewport-height) - 110px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .menu button, #menu button[data-action], #menu button[data-concierge-action], .admin-menu-link { min-height: 48px; padding-block: 13px; font-size: 14px; }

  #welcome, .executive-experience #welcome { width: 100%; padding: 20px 20px calc(28px + env(safe-area-inset-bottom, 0px)); }
  .welcome-stage, .executive-experience .welcome-stage { display: flex; flex-direction: column; gap: 24px; align-items: stretch; }
  .welcome-intro, .executive-experience .welcome-intro { padding: 0; text-align: start; }
  .welcome-intro > .eyebrow, .executive-experience .welcome-intro > .eyebrow { font-size: 11px; line-height: 1.7; letter-spacing: 1px; }
  .welcome-intro h1, .executive-experience .welcome-intro h1 { font-size: clamp(36px, 7vw, 52px); line-height: 1.16; letter-spacing: -1.5px; margin: 16px 0 20px; }
  html[dir="rtl"] .welcome-intro h1, html[dir="rtl"] .executive-experience .welcome-intro h1 { font-size: clamp(32px, 6.6vw, 46px); line-height: 1.5; letter-spacing: 0; }
  .welcome-intro .intro, .executive-experience .welcome-intro .intro { font-size: 16px; line-height: 1.75; max-width: none; margin: 0 0 24px; }
  .hero-composer { max-width: none; }
  .ask-elahi-label, .executive-experience .ask-elahi-label { font-size: 15px; padding: 16px 16px 0; text-align: start; }
  .hero-composer form, .executive-experience .hero-composer form { padding: 12px; gap: 8px; }
  .hero-composer input, .executive-experience .hero-composer input { width: 0; min-height: 44px; font-size: 16px; }
  .send, .voice, .attach, .executive-experience .send { width: 44px; height: 44px; min-width: 44px; padding: 8px; flex: 0 0 44px; }
  .hero-caption { padding: 10px 14px; gap: 8px; flex-wrap: wrap; font-size: 12px; line-height: 1.6; }
  .personal-reminder { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 16px; text-align: start; }
  .personal-reminder small { font-size: 10px; }
  .personal-reminder b { font-size: 15px; }
  .personal-reminder p { font-size: 13px; line-height: 1.6; }
  .personal-reminder button, html[dir="rtl"] .personal-reminder button { grid-column: 2; justify-self: start; margin: 0; max-width: none; padding: 10px 14px; font-size: 13px; white-space: normal; }
  .immersive-city, .executive-experience .immersive-city { height: clamp(250px, 52vw, 380px); border-radius: 20px; }
  .scene-topline { inset-inline: 16px; top: 16px; }
  #motion-toggle { width: 44px; min-height: 44px; }
  .scene-glass, .executive-experience .scene-glass { inset-inline: 16px; bottom: 16px; padding: 18px; }
  .scene-glass h3, .executive-experience .scene-glass h3 { font-size: 30px; line-height: 1.2; }
  .scene-glass p { font-size: 13px; line-height: 1.7; }
  .scene-eyebrow, .scene-topline > span, .scene-bottom > span { font-size: 10px; }
  .scene-controls button { min-height: 44px; min-width: 44px; }
  .conversation-starters { justify-content: flex-start; gap: 8px 16px; }
  .conversation-starters button { font-size: 14px; line-height: 1.6; text-align: start; }
  .service-section-label { font-size: 11px; margin: 24px 0 12px; line-height: 1.6; }
  .service-launcher, .executive-experience .service-launcher { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; }
  .service-choice, .executive-experience .service-choice { width: 100%; min-width: 0; min-height: 90px; padding: 14px 12px; gap: 10px; text-align: start; }
  .service-choice > span:not(.service-icon):not(.service-arrow) { min-width: 0; }
  .service-choice b, .executive-experience .service-choice b { font-size: 14px; line-height: 1.5; white-space: normal; }
  .service-choice small, .executive-experience .service-choice small { font-size: 10px; line-height: 1.5; }
  .service-arrow { display: none; }
  .service-icon { width: 32px; height: 36px; }
  .welcome-bottom { font-size: 12px; line-height: 1.6; }

  #workspace, .executive-experience #workspace { width: 100%; max-width: 800px; margin: 12px auto 0; padding: 0 20px calc(var(--elahi-dock-height) + 28px); }
  .journey-heading, .executive-experience .journey-heading { align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; padding-bottom: 18px; }
  .journey-heading > div { flex: 1 1 200px; min-width: 0; }
  .journey-heading h2, .executive-experience .journey-heading h2, body[data-mode="conversation"] .journey-heading h2 { font-size: 27px; line-height: 1.3; margin-block: 8px 0; overflow-wrap: anywhere; }
  .journey-heading .eyebrow { font-size: 10px; }
  #journey-toggle { min-height: 44px; font-size: 13px; padding: 8px 0; }
  .step-pill, .executive-experience .step-pill { display: none; }
  .journey-plan { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 12px 10px; gap: 10px; margin-bottom: 24px; }
  .plan-item { min-width: 0; flex-direction: column; align-items: flex-start; font-size: 12px; gap: 7px; }
  .plan-item b { line-height: 1.5; }
  .plan-item > span { width: 24px; height: 24px; font-size: 11px; }
  .assistant-label { font-size: 11px; }
  .assistant-copy, body[data-mode="journey"] .assistant-copy, html[dir="rtl"] .assistant-copy, .executive-experience .assistant-copy { font-size: 16px; line-height: 1.8; }
  .bubble { max-width: 94%; font-size: 15px; line-height: 1.7; padding: 12px 16px; }
  .card-head, .executive-experience .card-head { padding: 18px 16px 14px; flex-wrap: wrap; gap: 10px; }
  .card-head > div { min-width: 0; }
  .card-head h3, .executive-experience .card-head h3 { font-size: 17px; line-height: 1.45; overflow-wrap: anywhere; }
  .card-head p, body[data-mode="journey"] .card-head p { font-size: 13px; line-height: 1.6; }
  .card-head .tag { margin-inline-start: 0; white-space: normal; font-size: 10px; }
  .card-body, .executive-experience .card-body { padding: 0 16px 20px; }
  .fields, .executive-experience .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
  .field label, .executive-experience .field label { font-size: 12px; line-height: 1.6; }
  .field strong, body[data-mode="journey"] .field strong, .executive-experience .field strong { font-size: 15px !important; line-height: 1.6; }
  .person { min-width: 0; padding: 14px; }
  .person h4 { font-size: 16px; }
  .person p { font-size: 12px; line-height: 1.6; }
  .actions { align-items: stretch; gap: 10px; }
  .actions > button { flex: 1 1 160px; margin: 0; }
  .primary, .secondary, .executive-experience .primary, .executive-experience .secondary { min-height: 48px; padding: 12px 16px; font-size: 15px; line-height: 1.5; white-space: normal; }
  .text-button { font-size: 14px; line-height: 1.5; }
  .source, .smallprint, .profile-picker-note, .service-copy { font-size: 12px; line-height: 1.7; }
  .check-row strong { font-size: 14px; }
  .check-row small { font-size: 12px; line-height: 1.6; }
  .check-row .tag { font-size: 10px; }
  .summary-row, body[data-mode="journey"] .summary-row, .executive-experience .summary-row { align-items: flex-start; font-size: 14px !important; gap: 16px; }
  .summary-row > span { flex: 1 1 50%; }
  .summary-row > strong { flex: 1 1 50%; text-align: end; }
  .profile-options, .vehicle-options { grid-template-columns: 1fr; gap: 16px; }
  .profile-options .profile-option { padding: 18px 16px; }
  .profile-copy strong { font-size: 16px; }
  .profile-copy small, .profile-copy .profile-relation { font-size: 13px; }
  .vehicle-option, .executive-experience .vehicle-option { padding: 20px; }
  .vehicle-option-top, .executive-experience .vehicle-option-top { display: block; min-height: 0; margin: 0 0 16px; padding-top: 30px; }
  .vehicle-drawing.vehicle-photo { max-height: 240px; }
  .vehicle-option > strong, .executive-experience .vehicle-option > strong { font-size: 22px; }
  .vehicle-year, .vehicle-expiry, .vehicle-expiry b, .executive-experience .vehicle-expiry, .executive-experience .vehicle-expiry b { font-size: 13px; }
  .vehicle-expiry { flex-wrap: wrap; }
  .vehicle-plate, .vehicle-select-label { font-size: 15px; }
  .vehicle-due-badge { font-size: 10px; white-space: normal; }
  .vehicle-counts { flex-wrap: wrap; font-size: 13px; gap: 8px 16px; }
  .vehicle-owner strong { font-size: 15px; }
  .vehicle-owner small { font-size: 12px; }
  .vehicle-count small { font-size: 9px; }
  .guided-option { flex: 1 1 120px; min-width: 0; min-height: 48px; font-size: 15px; padding: 12px; }
  .guided-option small { font-size: 12px; }
  .preference-label { font-size: 14px; }
  .balance-hero > span, .balance-hero p { font-size: 13px; }
  .readiness-summary { flex-wrap: wrap; }
  .readiness-summary b { font-size: 14px; }
  .readiness-summary small { font-size: 12px; }
  .outcome-summary, .how-grid { grid-template-columns: 1fr; }
  .outcome-label { font-size: 11px; }
  .outcome-summary p { font-size: 14px; }
  .completed-step > summary { padding: 14px; font-size: 14px; min-height: 56px; }
  .completed-step small { font-size: 11px; }
  .receipt { flex-wrap: wrap; }
  .receipt b { font-size: 14px; }
  .receipt small { font-size: 12px; }
  .receipt button { font-size: 14px; }
  .reference strong { font-size: clamp(19px, 5vw, 27px); }
  .timeline li { font-size: 14px; }
  .timeline small { font-size: 12px; }
  .completion-hero, .completion-content { padding: 24px 18px; }
  .completion-hero h3, html[dir="rtl"] .executive-experience .completion-hero h3 { font-size: 30px; overflow-wrap: anywhere; }
  .completion-facts { grid-template-columns: 1fr; gap: 22px; }
  .completion-actions { flex-direction: column; }
  .completion-entity { flex-wrap: wrap; }
  .completion-entity b { font-size: 17px; }
  .completion-entity small, .completion-next p, .completion-context { font-size: 13px; }

  #dock, body[data-mode="conversation"] #dock, .executive-experience #dock {
    inset-inline: max(12px, env(safe-area-inset-left, 0px)) max(12px, env(safe-area-inset-right, 0px));
    left: max(12px, env(safe-area-inset-left, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: var(--elahi-keyboard-inset);
    transform: none;
    width: auto;
    max-width: 776px;
    margin-inline: auto;
    padding: 12px 0 max(12px, env(safe-area-inset-bottom, 0px));
  }
  #chat-form { padding: 8px; gap: 4px; border-radius: 20px; }
  #chat-input, .executive-experience #chat-input { width: 0; min-height: 44px; font-size: 16px; }
  #quick-prompts, .executive-experience #quick-prompts { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-inline: contain; padding: 3px 2px 7px; margin: 0; gap: 8px; scrollbar-width: thin; }
  #quick-prompts button, .executive-experience #quick-prompts button { flex: 0 0 auto; max-width: 85%; min-height: 44px; padding: 10px 14px; font-size: 13px; white-space: normal; text-align: start; }
  .dock-note { flex-wrap: wrap; gap: 4px 10px; padding-inline: 4px; font-size: 10px; line-height: 1.5; }
  html[data-elahi-keyboard="open"] #dock { padding-bottom: 6px; }
  html[data-elahi-keyboard="open"] #quick-prompts, html[data-elahi-keyboard="open"] .dock-note { display: none; }
  #anchor { scroll-margin-bottom: calc(var(--elahi-dock-height) + 24px); }
  #typing { align-items: center; min-width: 0; }
  .agent-status-copy { min-width: 0; }
  .agent-status-copy #typing-label { font-size: 15px; }
  .agent-status-copy small { font-size: 13px; overflow-wrap: anywhere; }
  #journey-panel.mobile-open, html[dir="rtl"] #journey-panel.mobile-open {
    inset: calc(env(safe-area-inset-top, 0px) + 86px) 16px auto;
    width: auto;
    max-width: 390px;
    margin-inline-start: auto;
    max-height: calc(var(--elahi-viewport-height) - 120px);
    overscroll-behavior: contain;
  }
  dialog, dialog.wide, .executive-experience dialog {
    width: calc(100% - 24px);
    max-width: 620px;
    max-height: calc(var(--elahi-viewport-height) - 32px);
    padding: 28px 20px 24px;
    overflow: auto;
    overscroll-behavior: contain;
    border-radius: 20px;
    scroll-padding-block: 24px;
    inset-block-start: calc(var(--elahi-viewport-top) + 16px);
    inset-block-end: auto;
    margin-block: 0;
  }
  dialog h2, .executive-experience dialog h2 { font-size: 27px; line-height: 1.3; padding-inline-end: 24px; overflow-wrap: anywhere; }
  dialog p, .executive-experience dialog p { font-size: 14px; line-height: 1.8; }
  .close { width: 44px; height: 44px; top: 8px; inset-inline-end: 8px; }
  .modal-field { font-size: 14px; }
  .modal-field input { width: 100%; min-height: 48px; }
  .consent-label, .checkbox-label { font-size: 14px; line-height: 1.7; }
  .consent-label input, .checkbox-label input { width: 22px; height: 22px; flex: 0 0 22px; }
  .upload-zone { min-height: 88px; padding: 18px 12px; font-size: 15px; }
  .upload-zone small { font-size: 12px; }
  .upload-thumb { max-height: 32svh; width: 100%; object-fit: contain; }
  #toast { bottom: calc(var(--elahi-keyboard-inset) + var(--elahi-dock-height) + 12px); font-size: 14px; }
  .executive-review-nav { margin: 12px 16px; padding: 10px; flex-wrap: wrap; }
  .executive-review-label { flex-basis: 100%; font-size: 11px; }
  .executive-review-tabs { width: 100%; order: 3; }
  .executive-review-nav button, .executive-review-tabs button { min-height: 44px; font-size: 13px; }
  .executive-review-nav #executive-present { font-size: 13px; }
  #executive-exit { top: calc(8px + env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); min-height: 44px; }
  .executive-present > header { padding-top: calc(60px + env(safe-area-inset-top, 0px)); }
}

/* Keep the photo header and its text in separate rows on phones and tablets. */
@media (max-width: 900px) {
  .immersive-city, .executive-experience .immersive-city {
    display: grid;
    grid-template-rows: auto 1fr;
    height: auto;
    min-height: 320px;
    gap: 0;
  }
  .immersive-city .scene-topline {
    position: relative;
    inset: auto;
    grid-row: 1;
    align-self: start;
    min-width: 0;
    min-height: 44px;
    margin: 16px;
    gap: 12px;
  }
  .scene-topline > span { min-width: 0; font-size: 10px; letter-spacing: 1px; line-height: 1.5; }
  .scene-topline #motion-toggle { flex: 0 0 44px; }
  .immersive-city .scene-glass, .executive-experience .immersive-city .scene-glass {
    position: relative;
    inset: auto;
    grid-row: 2;
    align-self: end;
    min-width: 0;
    margin: 0 16px 16px;
    padding: 18px;
  }
  .scene-glass .scene-eyebrow { display: block; font-size: 10px; line-height: 1.6; letter-spacing: 1px; }
  .immersive-city .scene-glass h3, .executive-experience .immersive-city .scene-glass h3 {
    font-size: clamp(25px, 6.3vw, 30px);
    line-height: 1.25;
    letter-spacing: -.5px;
    margin: 12px 0;
  }
  .immersive-city .scene-glass h3 br, .immersive-city .scene-glass p br { display: initial; }
  .immersive-city .scene-glass p { font-size: 13px; line-height: 1.75; margin: 0; }
  .scene-glass .scene-bottom { min-width: 0; margin-top: 14px; padding-top: 6px; gap: 12px; }
  .scene-bottom > span { display: none; }
  .scene-controls { gap: 2px; flex-wrap: wrap; }
  .scene-controls button, .scene-controls button.active {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    flex: 0 0 44px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none;
    transform: none;
    transition: none;
  }
  .scene-controls button::before { content: none; }
  .scene-controls button::after { content: ''; display: block; width: 7px; height: 7px; border-radius: 999px; background: #ffffff85; transition: width .2s; }
  .scene-controls button.active::after { width: 22px; background: #b6e9ff; }
  .service-choice .service-arrow, .executive-experience .service-choice .service-arrow { display: none; }
  .service-choice, .executive-experience .service-choice { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 12px; }
  html[dir="rtl"] .immersive-city .scene-glass h3 { letter-spacing: 0; line-height: 1.5; }
}
@media (max-width: 600px) {
  .service-launcher, .executive-experience .service-launcher { grid-template-columns: 1fr; }
  .service-choice, .executive-experience .service-choice { min-height: 84px; padding: 16px; }
  .service-choice b, .executive-experience .service-choice b { font-size: 15px; }
}

@media (max-width: 600px) {
  .fields, .executive-experience .fields { grid-template-columns: 1fr; }
  .service-launcher > .service-choice:last-child { grid-column: 1 / -1; }
  .service-modal-grid { grid-template-columns: 1fr; }
  .actions { flex-direction: column; }
  .actions > button { flex: auto; width: 100%; }
  .header-right { gap: 4px; }
  .language-toggle button, .executive-experience .language-toggle button { padding-inline: 8px; }
  .header-right { margin-inline-start: auto; }
  .brand, .executive-experience .brand { font-size: 21px; }
  .scene-glass h3, .executive-experience .scene-glass h3 { font-size: 27px; }
  .scene-bottom > span { display: none; }
}

/* Keep navigation and wide diagnostic tables within the admin viewport. */
@media (max-width: 900px) {
  body[data-copy-view="admin"] .sidebar { position: relative; inset: auto; width: 100%; padding: calc(20px + env(safe-area-inset-top, 0px)) 16px 12px; }
  body[data-copy-view="admin"] .side-label, body[data-copy-view="admin"] .side-bottom { display: none; }
  body[data-copy-view="admin"] .studio-brand { font-size: 27px; }
  body[data-copy-view="admin"] .studio-brand small { font-size: 10px; }
  body[data-copy-view="admin"] #admin-nav { display: flex; flex-direction: row; gap: 6px; margin-top: 16px; overflow-x: auto; padding-bottom: 6px; overscroll-behavior-inline: contain; }
  body[data-copy-view="admin"] #admin-nav button { flex: 0 0 auto; min-height: 48px; white-space: nowrap; font-size: 14px; padding: 12px; }
  body[data-copy-view="admin"] .admin-shell { margin: 0; min-width: 0; }
  body[data-copy-view="admin"] .admin-header { height: auto; min-height: 72px; gap: 12px; flex-wrap: wrap; padding: 16px; }
  body[data-copy-view="admin"] .breadcrumb { font-size: 12px; overflow-wrap: anywhere; }
  body[data-copy-view="admin"] .header-controls { gap: 10px; flex-wrap: wrap; }
  body[data-copy-view="admin"] main { padding: 24px 16px; }
  body[data-copy-view="admin"] h1 { font-size: 30px; line-height: 1.3; }
  body[data-copy-view="admin"] .eyebrow { font-size: 11px; }
  body[data-copy-view="admin"] .page-heading { flex-wrap: wrap; align-items: flex-start; gap: 16px; }
  body[data-copy-view="admin"] .page-heading p { font-size: 15px; line-height: 1.7; }
  body[data-copy-view="admin"] .runtime-banner { flex-wrap: wrap; padding: 16px; }
  body[data-copy-view="admin"] .runtime-banner b { font-size: 14px; }
  body[data-copy-view="admin"] .runtime-banner div > span { font-size: 13px; line-height: 1.7; }
  body[data-copy-view="admin"] .stats, body[data-copy-view="admin"] .template-grid, body[data-copy-view="admin"] .system-map { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  body[data-copy-view="admin"] .connector-grid, body[data-copy-view="admin"] .two-column { grid-template-columns: 1fr; }
  body[data-copy-view="admin"] .stat, body[data-copy-view="admin"] .system-node, body[data-copy-view="admin"] .template { min-width: 0; padding: 16px; }
  body[data-copy-view="admin"] .stat small, body[data-copy-view="admin"] .stat span, body[data-copy-view="admin"] .template small { font-size: 12px; line-height: 1.6; }
  body[data-copy-view="admin"] .system-node b, body[data-copy-view="admin"] .template b { font-size: 15px; }
  body[data-copy-view="admin"] .system-node p { font-size: 13px; line-height: 1.7; }
  body[data-copy-view="admin"] .section-title { flex-wrap: wrap; gap: 12px; }
  body[data-copy-view="admin"] .section-title p { font-size: 14px; }
  body[data-copy-view="admin"] .tools, body[data-copy-view="admin"] .toolbar { flex-wrap: wrap; gap: 8px; }
  body[data-copy-view="admin"] .search { min-width: 0; width: 100%; flex-basis: 100%; min-height: 48px; }
  body[data-copy-view="admin"] .connector-endpoint { font-size: 13px; white-space: normal; overflow-wrap: anywhere; }
  body[data-copy-view="admin"] .table-scroll { max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; }
  body[data-copy-view="admin"] table { min-width: 620px; font-size: 14px; }
  body[data-copy-view="admin"] td small { font-size: 12px; }
  body[data-copy-view="admin"] .form-grid, body[data-copy-view="admin"] .review-grid { grid-template-columns: 1fr; }
  body[data-copy-view="admin"] .form-field.full { grid-column: auto; }
  body[data-copy-view="admin"] .form-field { min-width: 0; font-size: 14px; }
  body[data-copy-view="admin"] .form-field input, body[data-copy-view="admin"] .form-field select { min-height: 48px; }
  body[data-copy-view="admin"] .form-field small { font-size: 12px; line-height: 1.7; }
  body[data-copy-view="admin"] .form-actions { flex-wrap: wrap; gap: 12px; }
  body[data-copy-view="admin"] .form-actions > div { display: flex; flex-wrap: wrap; gap: 10px; }
  body[data-copy-view="admin"] .wizard-steps { flex-wrap: wrap; gap: 8px 14px; }
  body[data-copy-view="admin"] .wizard-steps span { font-size: 13px; }
  body[data-copy-view="admin"] .tool-schema { font-size: 13px; }
  body[data-copy-view="admin"] footer { flex-wrap: wrap; padding: 20px 16px max(20px, env(safe-area-inset-bottom, 0px)); font-size: 11px; }
  body[data-copy-view="admin"] footer span { max-width: none; font-size: 12px; text-align: start; }
  body[data-copy-view="admin"] #admin-toast { font-size: 14px; bottom: max(20px, env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 390px) {
  .brand small { display: none; }
  .brand, .executive-experience .brand { font-size: 19px; gap: 5px; }
  .official-logo, .executive-experience .official-logo { width: 30px; height: 30px; }
  .language-toggle button, .executive-experience .language-toggle button { font-size: 11px; padding-inline: 7px; }
  #welcome, .executive-experience #welcome, #workspace, .executive-experience #workspace { padding-inline: 16px; }
  .service-launcher, .executive-experience .service-launcher { grid-template-columns: 1fr; }
  .service-choice { min-height: 76px; }
  .hero-caption { flex-direction: column; }
  body[data-copy-view="admin"] .stats, body[data-copy-view="admin"] .template-grid, body[data-copy-view="admin"] .system-map { grid-template-columns: 1fr; }
}

@media (max-width: 900px) and (orientation: landscape) and (max-height: 520px) {
  .immersive-city, .executive-experience .immersive-city { height: auto; min-height: 250px; }
  dialog, .executive-experience dialog { max-height: calc(var(--elahi-viewport-height) - 16px); margin-block: 8px; }
  #quick-prompts { max-height: 60px; }
}

/* A crisp DubaiNow blue-and-white palette for small screens. */
@media (max-width: 900px) {
  body, body.executive-experience {
    --ink: #163f61;
    --navy: #103d68;
    --muted: #5a7489;
    --green: #087eb3;
    --line: #ccdfec;
    --paper: #f4f9fd;
    color: #244d6a;
    background: #f4f9fd;
  }
  .ambient {
    background: radial-gradient(ellipse at 8% 0, #d8edfc 0, transparent 50%),
      radial-gradient(ellipse at 100% 35%, #e0f4fa 0, transparent 50%),
      linear-gradient(160deg, #fbfdff, #f0f7fc);
  }
  .brand, .executive-experience .brand { color: #103e6b; }
  .brand small, .eyebrow, .welcome-intro > .eyebrow { color: #587b94; }
  .welcome-intro h1, .executive-experience .welcome-intro h1 { color: #113959; }
  .welcome-intro h1 em, .executive-experience .welcome-intro h1 em {
    color: #147cae;
    background: linear-gradient(105deg, #128bb8, #155f9b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  .welcome-intro .intro, .executive-experience .welcome-intro .intro { color: #526e83; }
  .hero-composer { background: #fff; border-color: #a8cede; box-shadow: 0 10px 30px #12538012; }
  .hero-composer:focus-within { border-color: #1595c4; box-shadow: 0 0 0 3px #1595c41a, 0 10px 30px #12538012; }
  .ask-elahi-label, .executive-experience .ask-elahi-label { color: #225b7b; }
  .hero-caption, .executive-experience .hero-caption { background: #edf7fd; color: #54768d; border-color: #dbeaf4; }
  input, #chat-input, .executive-experience #chat-input { color: #244e6b; }
  input::placeholder { color: #637e93; opacity: 1; }
  .send, .executive-experience .send { background: #105b8e; color: white; box-shadow: 0 4px 10px #0e5b8e24; }
  .voice, .attach { color: #477b9b; }
  .language-toggle { background: #e5f1fa; border-color: #c5deee; }
  .language-toggle button { color: #54738d; }
  .language-toggle button[aria-pressed="true"] { background: #fff; color: #155e8b; }
  .icon-button, .showcase-reset { background: #ffffffd9; border-color: #c5dce9; color: #245d7e; }
  .personal-reminder, .executive-experience .personal-reminder { background: #eaf5fd; border: 1px solid #cfe4f1; border-radius: 14px; padding: 16px; }
  .personal-reminder b { color: #285f80; }
  .personal-reminder small, .personal-reminder p { color: #57788e; }
  .reminder-symbol { color: #1689b7; background: #d8edf9; }
  .personal-reminder button { color: #1c648c; border: 1px solid #c7e0ef; }
  .city-slide, .city-window > img { filter: saturate(1.1) contrast(1.03); }
  .scene-glass { background: linear-gradient(135deg, #104b7a70, #0d3a5b45); border-color: #ffffff4d; }
  .scene-glass p { color: #e0edf6; }
  .service-choice, .executive-experience .service-choice { background: #fff; border-color: #c9deec; box-shadow: 0 5px 16px #225e8008; }
  .service-choice b, .executive-experience .service-choice b { color: #285873; }
  .service-choice small { color: #608098; }
  .service-icon, .card-icon { color: #1686b2; background: #e4f3fc; border-color: #d5eaf7; }
  .service-section-label, .conversation-starters button { color: #54778f; }
  .journey-heading h2, .executive-experience .journey-heading h2 { color: #174768; }
  .journey-plan { background: #f8fcff; border-color: #d0e2ee; }
  .plan-item { color: #5e7c92; }
  .plan-item.active { color: #156e9f; }
  .plan-item.active > span { color: #fff; background: #137fae; }
  .plan-item.done { color: #3b7c98; }
  .assistant-copy, body[data-mode="journey"] .assistant-copy, .executive-experience .assistant-copy { color: #35566f; }
  .assistant-label { color: #5a829b; }
  .assistant-label .mini-mark { background: #e0f2fc; color: #1788b9; }
  .bubble { background: #e1f0fc; border-color: #cce2f2; color: #285573; }
  .card, .executive-experience .card { background: #fff; border-color: #cbdfea; box-shadow: 0 6px 22px #174c6d09; }
  .card-head h3, .executive-experience .card-head h3 { color: #245572; }
  .card-head p, body[data-mode="journey"] .card-head p { color: #607f95; }
  .person { background: linear-gradient(110deg, #eaf5fd, #f7fbff); border-color: #d6e8f4; }
  .person h4 { color: #285d7e; }
  .person p, .field label { color: #5d7b91; }
  .field strong, body[data-mode="journey"] .field strong { color: #315f7b; }
  .primary, .executive-experience .primary { background: linear-gradient(105deg, #124b7b, #0d72a5); border-color: #1a6b96; color: #fff; box-shadow: 0 5px 12px #146d9920; }
  .secondary, .executive-experience .secondary { background: #f8fcff; border-color: #bcd7e7; color: #326b8e; }
  .text-button { color: #326f92; }
  .source, .smallprint, .profile-picker-note, .service-copy { color: #5e7e94; }
  .summary-row span { color: #5a7b91; }
  .summary-row strong { color: #2c5b79; }
  .summary-row.total strong { color: #124e76; }
  .profile-options .profile-option, .vehicle-option, .executive-experience .vehicle-option { background: linear-gradient(145deg, #fff, #edf7fe); border-color: #bcd8e9; }
  .profile-copy strong, .vehicle-option > strong { color: #285e7c; }
  .profile-copy .profile-relation, .profile-copy small, .vehicle-year, .vehicle-expiry { color: #5e8097; }
  .vehicle-photo { background: #e8f3fb; }
  .vehicle-select-label { color: #186f9d; }
  .balance-hero { background: linear-gradient(135deg, #e2f2fc, #f6fbff); border-color: #cce3f2; }
  .balance-hero > strong { color: #175d89; }
  .balance-hero > span, .balance-hero p { color: #567c97; }
  .guided-option.selected { background: #e3f4fe; border-color: #3c9bc5; color: #1a6f9c; }
  .soft-banner, .readiness-summary { background: #e9f6fc; color: #397490; border-color: #cde7f2; }
  #chat-form { background: #fff; border-color: #a9ccdf; box-shadow: 0 8px 26px #174f7514; }
  #quick-prompts button, .executive-experience #quick-prompts button { background: #f7fcff; border-color: #c5dfea; color: #426e8b; }
  .completed-step { background: #eef7fc; border-color: #d2e5f0; }
  .completed-step > summary { color: #4a7894; }
  .completed-step small { color: #65869b; }
  .success-card, .completion-hero { background: linear-gradient(145deg, #fff, #e3f5fc); }
  body[data-copy-view="admin"] { background: #f4f9fd; }
  body[data-copy-view="admin"] .sidebar { background: linear-gradient(130deg, #0d3559, #155a7f); }
  body[data-copy-view="admin"] .page-heading p, body[data-copy-view="admin"] .section-title p { color: #5a7b91; }
  body[data-copy-view="admin"] .stat, body[data-copy-view="admin"] .panel, body[data-copy-view="admin"] .connector-card { border-color: #ccdfeb; background: #fff; }
  body[data-copy-view="admin"] .stat span, body[data-copy-view="admin"] .connector-card .description, body[data-copy-view="admin"] .connector-meta { color: #5d7f95; }
  body[data-copy-view="admin"] .runtime-banner { background: #eaf5fc; border-color: #cbe3f1; }
}
