/* Builder-only polish. Never affects the printed itinerary. */
@media screen {
  .assistant-request-mode { width:100%; min-height:38px; border:1px solid #ccd8e5; border-radius:10px; background:#f5f9ff; color:#244366; padding:8px 10px; margin-bottom:8px; font:inherit; }
  .assistant-source { display:block; margin:8px 0; font-size:11px; color:#316147; overflow-wrap:anywhere; }
  .workspace-source-actions { margin:0 0 8px; border:1px solid #dbe3ec; border-radius:10px; background:#fff; }
  .workspace-source-actions > summary { cursor:pointer; padding:9px 12px; font-size:12px; color:#35516d; }
  .workspace-source-actions .itinerary-start-actions { margin:0; padding:8px; }
  #knowledge-health { margin-bottom:24px; }
  #knowledge-coverage { max-height:420px; overflow:auto; margin-top:16px; }
  #knowledge-health > details > summary { cursor:pointer; padding:12px 0; }
  .mobile-header-actions { display:contents; }
  .mobile-header-actions > summary { display:none; }
}
@media screen and (max-width:700px) {
  .app-shell > .app-header { min-height:60px; padding:10px 12px; flex-wrap:nowrap; gap:8px; }
  .app-header .brand strong { font-size:14px; }
  .app-header .brand em, .app-header > .project-state { display:none; }
  .app-header .header-actions { flex:0 0 auto; display:flex; flex-wrap:nowrap; width:auto; gap:6px; margin-left:auto; }
  .app-header #save-project { display:inline-flex !important; font-size:12px; min-height:38px; padding:8px; }
  .mobile-header-actions { display:block; position:relative; }
  .mobile-header-actions > summary { display:block; cursor:pointer; list-style:none; padding:10px; border:1px solid #d8e0e8; border-radius:9px; background:#fff; font-size:12px; }
  .mobile-header-actions:not([open]) > :not(summary) { display:none; }
  .mobile-header-actions[open] { position:absolute; right:12px; top:10px; z-index:120; width:min(260px,calc(100vw - 24px)); background:#fff; box-shadow:0 8px 32px #243b5330; border:1px solid #d8e0e8; border-radius:12px; padding:6px; }
  .mobile-header-actions[open] > :not(summary) { display:flex; width:100%; margin:5px 0; justify-content:flex-start; }
  .workspace-client-summary { padding:8px 12px; min-height:48px; }
  .workspace-client-summary #workspace-save-state { font-size:10px; }
}

/* This file loads last on both app surfaces. Keep touch sizing here so more
   specific component rules cannot shrink controls below a comfortable target. */
@media screen and (pointer:coarse) {
  body :is(button, [role="button"], [role="separator"], summary, a.button, input:not([type="checkbox"]):not([type="radio"]), select) {
    min-height:44px !important;
  }
  body :is(input[type="checkbox"], input[type="radio"]) {
    width:24px;
    height:24px;
  }
}

/* On phones with a short visual viewport (landscape or an open keyboard),
   keep all section choices on one row and reserve most of Details for fields. */
@media screen and (max-width:1100px) and (max-height:700px) {
  .has-assistant-workspace #builder-panel .workspace-client-summary {
    min-height:44px;
    padding:5px 12px;
    gap:8px;
  }
  .has-assistant-workspace #builder-panel #workspace-trip-summary { display:none; }
  .has-assistant-workspace #builder-panel .builder-navigation { gap:6px; padding:7px 10px; }
  .has-assistant-workspace #builder-panel .workspace-nav-groups { gap:3px; padding:2px; }
  .has-assistant-workspace #builder-panel .workspace-nav-groups button { padding:4px 3px; font-size:10px; }
  .has-assistant-workspace #builder-panel[data-workspace-group="trip"] .builder-tabs {
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:3px;
  }
  .has-assistant-workspace #builder-panel[data-workspace-group="design"] .builder-tabs {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:3px;
  }
  .has-assistant-workspace #builder-panel .builder-tab {
    min-width:0;
    padding:4px 3px;
    overflow:hidden;
    font-size:10px;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
}

@media screen and (max-width:1100px) and (max-height:480px) {
  /* The client name remains in Trip details; reclaim this duplicate summary
     row when phone landscape height is exceptionally tight. */
  .has-assistant-workspace #builder-panel .workspace-client-summary { display:none; }
}
