@charset "UTF-8";
/*
 * Mini Cloud mobile presentation layer — <=700px, plus narrow <=430px.
 * Loaded AFTER component CSS. Do not change desktop styles or backend data.
 * CSS-only fallback retains the original scrollable navigation if JS fails.
 * New components must have a mobile treatment here (see docs/mobile-ui.md).
 */
.mobile-nav-trigger,
.mobile-nav-close,
.mobile-nav-backdrop,
.map-mobile-summary { display: none; }

@media (max-width: 700px) {
  /* Mobile viewport, safe areas, and resilient one-column layout. */
  html { -webkit-text-size-adjust: 100%; }
  body { min-width: 0; overflow-x: clip; }
  .app-shell,
  .workspace-body,
  .main-content,
  .page-heading,
  .panel,
  .modules-section,
  .notes-workspace,
  .storage-workspace,
  .map-page { min-width: 0; }
  .workspace-body { width: 100%; }
  .main-content {
    width: 100%;
    padding: 16px max(16px, env(safe-area-inset-right))
             calc(30px + env(safe-area-inset-bottom))
             max(16px, env(safe-area-inset-left));
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    min-height: 62px;
    gap: 9px;
    padding: 7px max(16px, env(safe-area-inset-right))
             7px max(16px, env(safe-area-inset-left));
    background: rgba(250, 251, 247, .97);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
  }
  .topbar .breadcrumb {
    flex: 1 1 auto;
    min-width: 0;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
  }
  .topbar-actions { min-width: 0; gap: 8px; flex: 0 0 auto; }
  .topbar-actions .private-badge,
  .topbar-actions .guest-only-nav-tag { display: none; }
  .topbar-actions .privacy-visibility-toggle {
    min-width: 44px;
    width: 44px;
    height: 44px;
    padding: 9px;
    display: inline-flex;
    justify-content: center;
  }
  .topbar-actions #privacy-visibility-label { display: none; }

  /* JavaScript-enhanced off-canvas navigation. */
  .mobile-shell-enabled.mobile-menu-open { overflow: hidden; }
  .mobile-shell-enabled .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    top: 0;
    width: min(86vw, 328px);
    max-width: calc(100vw - 42px);
    height: 100vh;
    height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 82;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: calc(22px + env(safe-area-inset-top)) 14px
             calc(20px + env(safe-area-inset-bottom));
    border: 0;
    border-right: 1px solid var(--line);
    background: #fcfdf9;
    box-shadow: 20px 0 48px rgba(20, 39, 24, .13);
    transform: translateX(-105%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .22s ease, visibility .22s ease;
  }
  .mobile-shell-enabled.mobile-menu-open .sidebar {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }
  .mobile-shell-enabled .sidebar .brand {
    margin: 0 48px 20px 6px;
    font-size: 20px;
  }
  .mobile-shell-enabled .sidebar .navigation-label {
    display: block;
    margin: 2px 12px 12px;
  }
  .mobile-shell-enabled .sidebar .main-navigation {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    overflow: visible;
    margin: 0;
    padding: 0;
  }
  .mobile-shell-enabled .sidebar .main-navigation > a,
  .mobile-shell-enabled .sidebar .main-navigation > a.nav-subitem {
    flex: 0 0 auto;
    width: 100%;
    min-height: 46px;
    padding: 12px 13px;
    margin: 0;
    border-radius: 10px;
    font-size: 13px;
    white-space: normal;
    line-height: 1.35;
  }
  .mobile-shell-enabled .sidebar .main-navigation > a.nav-subitem { padding-left: 37px; }
  .mobile-shell-enabled .sidebar .main-navigation .icon { width: 19px; height: 19px; }
  .mobile-shell-enabled .sidebar .main-navigation .account-navigation { margin-top: 10px; }
  .mobile-shell-enabled .sidebar .sidebar-bottom {
    position: static;
    margin-top: auto;
    padding-top: 20px;
  }
  .mobile-shell-enabled .sidebar .owner-name,
  .mobile-shell-enabled .sidebar .private-note { display: flex; }
  .mobile-shell-enabled .sidebar .private-note { padding: 12px; font-size: 11px; }
  .mobile-shell-enabled .sidebar .private-note small { font-size: 10px; }
  .mobile-shell-enabled .sidebar .owner-name { display: block; }
  .mobile-shell-enabled .sidebar .owner-row { padding-top: 14px; }
  .mobile-shell-enabled .sidebar .owner-row .avatar { height: 40px; width: 40px; }
  .mobile-shell-enabled .sidebar .owner-row .icon-button { height: 44px; width: 44px; }

  .mobile-shell-enabled .mobile-nav-trigger,
  .mobile-shell-enabled .mobile-nav-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #dbe4d5;
    border-radius: 12px;
    background: #fff;
    color: var(--green);
  }
  .mobile-shell-enabled .mobile-nav-trigger:hover,
  .mobile-shell-enabled .mobile-nav-close:hover { background: #edf3e3; }
  .mobile-shell-enabled .mobile-nav-bars {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 20px;
    height: 20px;
  }
  .mobile-shell-enabled .mobile-nav-bars > span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 4px;
    background: currentColor;
  }
  .mobile-shell-enabled .mobile-nav-close {
    position: absolute;
    top: calc(20px + env(safe-area-inset-top));
    right: 14px;
  }
  .mobile-shell-enabled .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(13, 27, 19, .53);
  }
  .mobile-shell-enabled .mobile-nav-backdrop:not([hidden]) { display: block; }
  .mobile-shell-enabled .mobile-nav-trigger[hidden],
  .mobile-shell-enabled .mobile-nav-close[hidden],
  .mobile-shell-enabled .mobile-nav-backdrop[hidden] { display: none; }

  /* Readable touch-targeted cards; never force side-scrolling the page. */
  .page-heading { display: flex; flex-wrap: wrap; gap: 12px; }
  .page-heading > div:first-child,
  .page-heading h1,
  .page-heading p { min-width: 0; overflow-wrap: anywhere; }
  .page-heading h1 { font-size: clamp(24px, 7vw, 31px); }
  .page-heading p { font-size: 12px; line-height: 1.7; }
  .health-grid,
  .modules-grid,
  .ai-management-grid,
  .iot-future-grid,
  .host-resource-grid,
  .host-telemetry--node .host-resource-grid { grid-template-columns: minmax(0, 1fr); }
  .metric-card,
  .module-card,
  .panel,
  .iot-future-card { min-width: 0; }
  .module-card { padding: 20px; }
  .module-card > p { font-size: 12px; line-height: 1.7; }
  .module-card h3 { font-size: 16px; }
  .module-link { font-size: 12px; }
  .module-top { flex-wrap: wrap; }
  .node-row { min-width: 0; flex-wrap: wrap; }
  .node-row .node-details { min-width: 0; }
  .host-node-extras { padding-left: 0; margin-top: 12px; }
  .host-monitor-panel,
  .traffic-panel { padding: 17px; }
  .host-telemetry--detail { display: flex; flex-direction: column; }
  .host-traffic,
  .traffic-widget,
  .host-resource, .telemetry-resource-card, .telemetry-widget-card { min-width: 0; }
  .cpu-panel .telemetry-resource-card,
  .traffic-panel .telemetry-widget-card,
  .host-telemetry--detail .telemetry-widget-card { padding: 12px; }
  .cpu-panel .telemetry-resource-card .cpu-reading strong { font-size: 20px; }
  .device-summary-list li,
  .storage-file-row { min-width: 0; overflow-wrap: anywhere; }
  .section-heading { flex-wrap: wrap; }
  .section-heading > div { min-width: 0; }
  .button,
  .icon-button,
  button[type="submit"],
  .note-action,
  .notes-section-tab,
  .catalog-delete,
  .pi-reboot-button,
  .pi-reboot-cancel,
  .pi-reboot-confirm,
  .map-simple-button,
  .map-zoom button,
  .guest-auth-button,
  .storage-file-actions a,
  .storage-file-actions button { min-height: 44px; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  textarea, select { max-width: 100%; min-height: 44px; font-size: 16px; }
  textarea { width: 100%; min-height: 100px; }
  .form-actions,
  .pi-heading-actions { flex-wrap: wrap; }
  .form-actions .button { min-width: 0; }
  .workspace-footer { gap: 8px; }

  /* Login and guest use the same established palette and backend flow. */
  .auth-shell { padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); }
  .auth-header { min-width: 0; }
  .auth-main { width: 100%; max-width: 440px; gap: 24px; margin: 28px auto 30px; }
  .auth-intro h1 { margin-top: 15px; font-size: clamp(30px, 9vw, 40px); letter-spacing: -1.5px; }
  .auth-intro > p { font-size: 12px; margin-top: 13px; }
  .auth-card { min-width: 0; padding: 24px 19px; }
  .auth-card h2 { font-size: 23px; }
  .form-field input { font-size: 16px; }
  .guest-auth-button { min-height: 48px; }
  .guest-boundary { min-width: 0; }
  .guest-showcase-grid { grid-template-columns: minmax(0, 1fr); }

  /* Notes and GitHub cards: action rows wrap rather than clip. */
  .notes-workspace,
  .notes-chat,
  .notes-timeline,
  .note-compose,
  .note-message,
  .note-bubble,
  .note-compose-form { min-width: 0; max-width: 100%; }
  .note-image { max-width: 100%; height: auto; }
  .note-actions, .note-image-tools, .notes-section-tabs,
  .catalog-toolbar, .catalog-card-footer, .catalog-card-top { flex-wrap: wrap; }
  .note-actions .note-action { display: inline-flex; align-items: center; padding: 8px 12px; }
  .notes-chat-header { flex-wrap: wrap; }
  .notes-chat-header-actions { flex: 1 1 100%; width: 100%; justify-content: space-between; }
  .notes-clear-all { min-width: 0; max-width: 100%; }
  .notes-clear-dialog { width: calc(100vw - 32px); padding: 20px; }
  .notes-clear-dialog-actions { flex-direction: column-reverse; align-items: stretch; }
  .notes-clear-dialog-actions form,
  .notes-clear-dialog-actions .button,
  .notes-clear-submit { width: 100%; min-height: 44px; }
  .note-compose-form textarea { width: 100%; font-size: 16px; }
  .catalog-grid { grid-template-columns: minmax(0, 1fr); }
  .catalog-card { min-width: 0; overflow-wrap: anywhere; }
  .catalog-toolbar input, .catalog-toolbar select { width: 100%; }
  .catalog-flow { max-width: 100%; overflow-x: auto; }
  .catalog-flow-step { flex-shrink: 0; }

  /* Storage: narrow screens get accessible controls, long names wrap. */
  .storage-transfer,
  .storage-section-header,
  .storage-file-row,
  .storage-dropzone { min-width: 0; }
  .storage-transfer-heading,
  .storage-progress-heading,
  .storage-file-actions { flex-wrap: wrap; }
  .storage-file-row,
  .storage-progress { overflow-wrap: anywhere; }
  .storage-file-actions { margin-left: 0; }
  .storage-dropzone { padding: 17px; }
  .storage-file-name { overflow-wrap: anywhere; }

  /* Monitoring: measured values still come only from existing APIs. */
  .pi-heading-actions { width: 100%; justify-content: flex-start; }
  .pi-reboot-button, .host-reboot-button { max-width: 100%; }
  .monitor-toolbar, .time-controls,
  .connection-strip, .readout-row,
  .pi-archive-heading, .pi-archive-timeline-head,
  .pi-ports-heading, .pi-port-log-head { flex-wrap: wrap; }
  .segmented { max-width: 100%; overflow-x: auto; }
  .chart-shell, .chart-panel, .chart-frame,
  .pi-archive, .pi-ports-board { min-width: 0; }
  .pi-ports-grid { grid-template-columns: minmax(0, 1fr); }
  /* Archive heading and statistics share a container-sized track system in archive.css. */
  .pi-reboot-dialog { max-width: calc(100vw - 24px); }

  /* System map: true narrow-screen node list + optional pan-and-zoom canvas. */
  .map-workspace { display: flex; flex-direction: column; min-width: 0; }
  .map-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .map-toolbar > label { width: 100%; min-width: 0; }
  .map-toolbar input, .map-toolbar select { width: 100%; min-width: 0; }
  .map-toolbar .map-zoom { width: fit-content; max-width: 100%; }
  .map-zoom button, .map-relations button { min-width: 44px; min-height: 44px; }
  .map-fullscreen-button { min-width: 44px; min-height: 44px; }
  .map-canvas-shell:fullscreen .map-canvas,
  .map-canvas-shell.map-canvas-shell--expanded .map-canvas { max-height: none; }
  .map-canvas-shell { width: 100%; max-width: 100%; min-width: 0; }
  .map-canvas { min-width: 0; width: 100%; max-width: 100%; max-height: 420px; overflow: hidden; touch-action: none; overscroll-behavior: contain; }
  .map-canvas-footer { flex-wrap: wrap; gap: 7px 11px; }
  .map-inspector { width: 100%; max-width: 100%; min-width: 0; }
  .map-inspector-head,
  .map-editor-section,
  .map-relations { min-width: 0; }
  .map-mobile-summary { display: block; padding: 17px; margin: 16px 0; }
  .map-mobile-summary h2 { font-size: 16px; margin-bottom: 5px; }
  .map-mobile-summary p { margin-bottom: 13px; color: var(--muted); font-size: 11px; }
  .map-mobile-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .map-mobile-item {
    width: 100%;
    min-height: 54px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fcfefb;
    color: var(--ink);
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .map-mobile-item strong { font-size: 12px; overflow-wrap: anywhere; }
  .map-mobile-item small { font-size: 10px; color: var(--muted); flex: 0 0 auto; }
  .map-mobile-item[aria-pressed="true"] { border-color: #76946a; background: #edf4e7; }
  .map-mobile-empty { font-size: 12px; color: var(--muted); }
  .map-mobile-canvas-hint { display: block; padding: 9px 2px; color: var(--muted); font-size: 11px; }

  .coordinate-map-panel { padding: 12px; }
  .coordinate-map-toolbar .button { min-height: 44px; }
  .coordinate-map-details { grid-template-columns: minmax(0, 1fr); }
  .coordinate-map-details > div { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
  .coordinate-map-details dd { margin: 0; }
  .coordinate-map-phones { padding: 12px; }
  .coordinate-map-source-control select { width: 100%; max-width: 100%; font-size: 16px; }
  .coordinate-map-requests li { display: grid; }
  .coordinate-map-request-actions .button { flex: 1 1 auto; }
  .coordinate-map-devices li { align-items: stretch; }
  .coordinate-map-devices .button { width: 100%; }

  /* Android: one screen, the same controls and owner permissions. */
  .android-heading { align-items: flex-start; flex-wrap: wrap; }
  .android-layout { display: flex; flex-direction: column; gap: 16px; }
  .android-display-panel, .android-controls { width: 100%; padding: 16px; }
  .android-controls { order: -1; }
  .android-controls > p { margin-top: 9px; }
  .android-view-actions { flex-direction: row; flex-wrap: wrap; margin-top: 17px; }
  .android-view-actions .button { flex: 1 1 140px; min-height: 48px; }
  .android-controls > .android-status { min-height: 0; padding-bottom: 12px; }
  .android-note { margin-top: 12px; }
  .android-stage { min-height: 300px; padding: 12px; }
  .android-navigation { gap: 6px; }
  .android-navigation button { min-height: 48px; gap: 5px; padding: 8px 4px; }
  .android-display-heading { flex-wrap: wrap; }

  /* Prevent accidental horizontal overflow from SVG/media. */
  /* Commands: same queue and permissions, one column and touch controls. */
  .commands-layout { grid-template-columns: minmax(0, 1fr); }
  .command-compose, .command-history, .command-inspector { min-width: 0; padding: 17px; }
  .command-form select, .command-form textarea { width: 100%; font-size: 16px; }
  .command-form button, .command-job, .command-cancel { min-width: 44px; min-height: 44px; }
  .command-inspector { grid-column: auto; }

  .main-content img, .main-content svg:not(.map-wires), .main-content video { max-width: 100%; }
  .main-content pre, .main-content code { overflow-wrap: anywhere; }
  .main-content pre { max-width: 100%; overflow-x: auto; }
}

@media (max-width: 430px) {
  .topbar .breadcrumb { font-size: 10px; }
  .main-content { padding-left: 14px; padding-right: 14px; }
  .page-heading h1 { font-size: 26px; }
  .auth-header .brand { font-size: 18px; }
  .auth-card { padding: 22px 16px; }
  .health-grid,
  .modules-grid { grid-template-columns: minmax(0, 1fr); }
  .metric-card, .module-card { padding: 17px; }
  .note-actions { gap: 6px; }
  .map-intro, .map-toolbar { min-width: 0; }
  .pi-reboot-dialog-actions { display: flex; flex-direction: column; }
  .pi-reboot-dialog-actions button { width: 100%; }
}

@media (max-width: 700px) and (prefers-reduced-motion: reduce) {
  .mobile-shell-enabled .sidebar { transition: none; }
}

/* AI Nodes branch only: narrow viewport, no duplicated status endpoint. */
@media(max-width:700px){
  .ai-nodes-panel{padding:15px}
  .ai-nodes-heading{flex-direction:column;align-items:stretch}
  .ai-nodes-grid{grid-template-columns:minmax(0,1fr)}
  .ai-nodes-item{min-width:0;padding:14px}
  .ai-nodes-item .ai-node-state{min-height:44px;display:inline-flex;align-items:center}
}

/* Notes → Problems: reuse catalogue cards while preserving a three-tab mobile row. */
@media(max-width:700px){
  .notes-section-tabs{max-width:100%;min-width:0}
  .notes-section-tab{min-width:0;min-height:44px;white-space:normal;text-align:center}
  .problems-grid{grid-template-columns:minmax(0,1fr)}
  .problem-ai-details summary,.problem-delete>summary,.problem-delete .catalog-danger-button{min-height:44px}
}
@media(max-width:430px){
  .notes-section-tab{font-size:11px;padding:9px 6px;gap:5px}
  .notes-section-tab .icon{flex-shrink:0;width:16px;height:16px}
  .problem-card{padding:14px}
}

/* One canonical AI Workspaces responsive layer; desktop layout stays unchanged. */
@media(max-width:700px){
  .ai-work-heading{align-items:flex-start;flex-wrap:wrap}
  .ai-work-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ai-work-columns{grid-template-columns:minmax(0,1fr)}
  .ai-work-form input,.ai-work-form textarea,.ai-work-form select{font-size:16px}
  .ai-work-primary,.ai-work-secondary{min-height:44px}
  .ai-work-folder-summary{min-height:55px;gap:7px;padding:12px}
  .ai-work-folder-count{white-space:normal}
  .ai-work-folder-body{padding:12px}
  .ai-work-task-head{flex-direction:column}
  .ai-work-task-meta{flex-direction:column;align-items:flex-start}
}
@media(max-width:430px){
  .ai-work-stats{gap:8px}
  .ai-work-stat{padding:11px}
  .ai-work-task{padding:12px}
}

/* AI Workspaces status filter remains touch-friendly on narrow screens. */
@media(max-width:700px){.ai-work-toolbar{align-items:stretch}.ai-work-toolbar select{width:100%;min-height:44px;font-size:16px}.ai-work-toolbar [data-ai-work-visible]{margin-left:0}}

@media(max-width:700px){.ai-work-mailbox .ai-work-tree-title{align-items:flex-start;flex-wrap:wrap}.ai-work-mailbox-item{align-items:flex-start}.ai-work-mailbox-task-id{flex-basis:100%;min-width:0}}

/* Independent Notes AI queue: narrow-screen form, history and four-tab navigation. */
@media(max-width:700px){
  .notes-ai-panel{padding:15px;min-width:0}
  .notes-ai-panel-title,.notes-ai-actions{align-items:stretch}
  .notes-ai-form textarea,.notes-ai-result-form textarea{font-size:16px}
  .notes-ai-actions button,.notes-ai-panel-title button{width:100%;min-height:44px}
  .notes-ai-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .notes-ai-stats>*{min-width:0;overflow-wrap:anywhere}
  .notes-ai-task-top>*{min-width:0;overflow-wrap:anywhere}
  .notes-section-tabs{max-width:100%;overflow-x:auto;scrollbar-width:thin}
  .notes-section-tab{flex:0 0 auto;min-width:105px;min-height:44px}
}
@media(max-width:430px){
  .notes-ai-panel{padding:12px}
  .notes-ai-history-item{padding:12px}
}

/* AI Workspaces scheduler: mobile-only controls, same backend and widgets. */
@media(max-width:700px){
  .ai-work-schedules{padding:14px;min-width:0}
  .ai-work-schedule-fields{grid-template-columns:minmax(0,1fr)}
  .ai-work-schedule-card{min-width:0}
  .ai-work-schedule-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .ai-work-schedule-actions button{min-height:44px;width:100%;white-space:normal}
  .ai-work-schedules :is(input,select,textarea){font-size:16px}
  .ai-work-schedule-delete button{min-height:44px}
}
@media(max-width:430px){
  .ai-work-schedule-head{flex-direction:column;align-items:flex-start}
  .ai-work-schedule-actions{grid-template-columns:minmax(0,1fr)}
}

/* Five installer platforms live in a horizontally scrollable page tab row. */
@media (max-width: 700px) {
  .installer-platform-tabs { width: 100%; max-width: 100%; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .installer-platform-tabs .notes-section-tab { flex: 0 0 auto; min-width: 128px; min-height: 44px; white-space: normal; text-align: center; }
  .installer-empty { padding: 20px; }
  .installer-empty h2 { font-size: 18px; }
  .installer-empty h3 { font-size: 15px; }
}

/* AI hub: allow all three primary tabs to scroll without truncating Android. */
@media(max-width:700px){
  .ai-management-primary-tabs{width:100%;max-width:100%;min-width:0;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:thin}
  .ai-management-primary-tabs .notes-section-tab{min-width:132px;min-height:44px;flex:1 0 auto;white-space:normal;overflow-wrap:anywhere;text-align:center}
  .integration-section-title{font-size:17px}
}

/* Central event journal: one responsive layer, 44px controls and no horizontal clipping. */
@media(max-width:700px){.event-stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.event-stats article{padding:12px}.event-stats strong{font-size:19px}.event-filters{grid-template-columns:minmax(0,1fr)}.event-filters input,.event-filters select{font-size:16px}.event-filter-actions button,.event-filter-actions a,.event-pagination a{min-height:44px}.event-row{padding:13px}.event-primary>*{min-width:0;overflow-wrap:anywhere}}@media(max-width:430px){.event-stats small{font-size:11px}.event-stats strong{font-size:17px}}

@media (max-width: 700px) {
  /* Notes AI provider boards use the same narrow-screen shell. */
  .notes-ai-board { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .notes-ai-compose-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .notes-ai-panel { padding: 18px; }
  .notes-ai-heading { align-items: flex-start; }
  .notes-ai-provider-tabs { width: 100%; }
  .notes-ai-provider-tab { flex: 1 1 0; min-width: 0; min-height: 44px; }
  .notes-ai-context { padding: 18px 0 0; border-left: 0; border-top: 1px solid #e4eadc; }
  .notes-ai-form textarea, .notes-ai-context-form textarea, .notes-ai-result-form textarea { font-size: 16px; }
  .notes-ai-trigger input { font-size: 16px; min-height: 44px; }
  .notes-ai-send-row { align-items: stretch; }
  .notes-ai-send-row > button { flex: 1 1 140px; align-self: flex-end; min-height: 44px; }
  .notes-ai-context-footer button { width: 100%; min-height: 44px; }
  .notes-ai-card { padding: 15px; }
  .notes-ai-card-actions button { min-height: 44px; }
  .notes-ai-card-actions .notes-ai-revise { max-width: 100%; min-height: 44px; }
  .notes-ai-revise-hint { overflow-wrap: anywhere; }
  .notes-ai-card .notes-ai-text { font-size: 13px; }
  .notes-ai-details summary, .notes-ai-task-meta summary { display: flex; align-items: center; min-height: 44px; }
  .notes-ai-column-heading h2 { font-size: 17px; }
  .notes-ai-connection-help { flex-basis: 100%; padding-left: 15px; }
  .notes-ai-last-seen, .notes-ai-overdue-summary { flex-basis: 100%; padding-left: 15px; }
}

/* Owner-only Node Agent snapshot: no fixed-width labels on narrow screens. */
@media (max-width:700px) { .device-agent-summary { min-width:0; max-width:100%; flex-direction:column; align-items:flex-start; gap:3px; padding:10px; overflow-wrap:anywhere; } }


/* The installer download remains a large touch target with no horizontal overflow. */
@media (max-width:700px){
  .installer-item{flex-direction:column;align-items:stretch;gap:12px;padding:14px;min-width:0}
  .installer-item-main{min-width:0}
  .installer-download-link{display:flex;width:100%;min-height:48px}
}


/* Unified Updates: one mobile layer for local probes and grouped receipts. */
@media(max-width:700px){
  .update-context-grid,.update-grid-local,.update-grid-components{grid-template-columns:minmax(0,1fr)}
  .update-context-card{padding:15px}
  .update-workspace .update-heading{align-items:flex-start;gap:7px}
  .update-workspace .update-refresh-state{max-width:100%;text-align:left}
  .update-jump-links a{min-height:44px}
  .update-card{padding:14px;min-width:0}
  .update-group-heading{display:block}
  .update-group-heading p{margin-top:5px}
  .update-facts>div{grid-template-columns:minmax(98px,.9fr) minmax(0,1.1fr)}
}
@media(max-width:430px){
  .update-workspace .page-heading h1{overflow-wrap:anywhere}
  .update-card-head{align-items:flex-start}
  .update-status{white-space:normal}
  .update-facts{padding:4px 10px}
  .update-facts>div{gap:7px}
}

/* Notes problems: two touch-friendly source tabs, shared v2 card layout. */
@media(max-width:700px){
 .problem-source-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
 .problem-source-tab{min-height:44px;padding:10px 9px;text-align:center;font-size:11px}
}
@media(max-width:430px){
 .problem-source-tabs{padding:4px}
 .problem-source-tab{font-size:10px;line-height:1.45}
}
