/* Core2Flow mobile guardrails — loaded by the workspace shell into every iframe.
   Presentation only: no process, data or workflow rules live in this file. */
@media (max-width: 700px), (pointer: coarse) and (max-width: 920px) {
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  html, body { max-width: 100%; overflow-x: hidden !important; }
  body { min-width: 0 !important; padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
  * { min-width: 0; }
  img, svg, canvas, video { max-width: 100%; height: auto; }
  button, input, select, textarea, [role="button"] { min-height: 42px; touch-action: manipulation; }
  input, select, textarea { font-size: 16px !important; }
  h1 { font-size: clamp(22px, 6vw, 30px) !important; line-height: 1.12 !important; }
  h2 { font-size: clamp(18px, 5vw, 24px) !important; line-height: 1.18 !important; }
  h3 { font-size: clamp(16px, 4.4vw, 20px) !important; }
  .shell, .page, main, .container { width: 100% !important; max-width: none !important; padding-left: 14px !important; padding-right: 14px !important; }
  .grid, .layout, .workspace, .content-grid, .cards, .kpis, .two, .three, .sections { grid-template-columns: minmax(0,1fr) !important; }
  .toolbar, .bar, .head, .top, .actions, .controls { flex-wrap: wrap !important; gap: 8px !important; }
  .toolbar > *, .head > *, .top > * { max-width: 100%; }
  .card, .panel, .section { border-radius: 14px !important; box-shadow: 0 7px 22px rgba(15,23,42,.055) !important; }
  dialog, .modal, .drawer { width: calc(100vw - 20px) !important; max-width: calc(100vw - 20px) !important; max-height: calc(100dvh - 28px) !important; margin: auto !important; border-radius: 18px !important; }
  table { display: block !important; width: 100% !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; scrollbar-width: none; font-size: 11px !important; }
  table::-webkit-scrollbar { display: none; }
  th, td { padding: 9px 7px !important; white-space: nowrap; }
  .embed-frame, iframe { max-width: 100% !important; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom,0px)) !important; left: 12px !important; right: 12px !important; width: auto !important; text-align: center; }

  /* Embedded workspaces use the same calm, compact tab rail as the shell. */
  .navbar, .tabs { min-width: 0 !important; }
  .tabs { display: flex !important; gap: 4px !important; overflow-x: auto !important; overflow-y: hidden !important; scrollbar-width: none !important; padding: 4px 2px !important; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto !important; min-height: 38px !important; padding: 8px 11px !important; border-radius: 11px !important; font-size: 12px !important; white-space: nowrap !important; }

  /* One calm navigation control replaces crowded horizontal tab rails. */
  .c2f-native-mobile-tabs { display:none !important; }
  .c2f-mobile-tab-nav { position:relative; min-width:0; flex:1 1 auto; }
  .c2f-mobile-tab-trigger { width:100%; min-height:40px !important; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:0 12px !important; border:1px solid #E5E7EB; border-radius:12px; background:#fff; color:#111827; box-shadow:0 2px 9px rgba(15,23,42,.045); font:750 13px Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; text-align:left; }
  .c2f-mobile-tab-trigger i { position:relative; width:18px; height:14px; flex:none; }
  .c2f-mobile-tab-trigger i:before,.c2f-mobile-tab-trigger i:after,.c2f-mobile-tab-trigger i { border-top:2px solid #667085; }
  .c2f-mobile-tab-trigger i:before,.c2f-mobile-tab-trigger i:after { content:""; position:absolute; left:0; width:18px; }
  .c2f-mobile-tab-trigger i:before { top:4px; }.c2f-mobile-tab-trigger i:after { top:10px; }
  .c2f-mobile-tab-backdrop { display:none; position:fixed; inset:0; z-index:998; width:100%; height:100%; border:0; background:rgba(15,23,42,.22); backdrop-filter:blur(2px); }
  .c2f-mobile-tab-sheet { display:none; position:fixed; left:10px; right:10px; bottom:calc(10px + env(safe-area-inset-bottom,0px)); z-index:999; max-height:min(70dvh,560px); overflow:auto; padding:8px; border:1px solid rgba(229,231,235,.95); border-radius:20px; background:rgba(255,255,255,.98); box-shadow:0 22px 70px rgba(15,23,42,.22); }
  .c2f-mobile-tab-nav.open .c2f-mobile-tab-backdrop,.c2f-mobile-tab-nav.open .c2f-mobile-tab-sheet { display:block; }
  .c2f-mobile-tab-sheet > strong { display:block; padding:10px 11px 8px; color:#667085; font-size:11px; letter-spacing:.06em; text-transform:uppercase; }
  .c2f-mobile-tab-sheet > button { width:100%; min-height:48px !important; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:0 12px !important; border:0; border-radius:13px; background:transparent; color:#344054; font:700 14px Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; text-align:left; }
  .c2f-mobile-tab-sheet > button + button { margin-top:2px; }
  .c2f-mobile-tab-sheet > button.active { color:#168A43; background:#EFFAF2; }
  .c2f-mobile-tab-sheet > button i { color:#98A2B3; font-size:22px; font-style:normal; }
  .navbar { gap:8px !important; padding:7px 9px !important; }
  .navbar .c2f-mobile-tab-nav { max-width:calc(100% - 48px); }
  .navbar-actions { margin-left:auto !important; gap:4px !important; }
  .navbar-actions .src-btn,.navbar-actions .webhook-status { display:none !important; }
  .navbar-actions .refresh-btn { width:40px; min-width:40px; height:40px; padding:0 !important; overflow:hidden; font-size:0 !important; border-radius:12px !important; }
  .navbar-actions .refresh-btn:before { content:"↻"; font-size:19px; }
}

@media (max-width: 430px) {
  body { font-size: 14px; }
  .shell, .page, main, .container { padding-left: 10px !important; padding-right: 10px !important; }
  .card, .panel, .section { padding: 12px !important; }
  .stamp, .quiet { font-size: 11px !important; }
}

@media (max-width: 700px), (pointer: coarse) and (max-width: 920px) {
  /* Calm, reference-like mobile density. */
  .today-focus { min-height:0 !important; padding:10px 12px !important; margin:0 0 7px !important; border-radius:14px !important; }
  .today-focus h2 { margin:0 !important; font-size:15px !important; line-height:1.15 !important; }
  .today-focus p { display:none !important; }
  .today-kicker { font-size:10px !important; letter-spacing:.05em !important; }
  .today-pulse { font-size:10px !important; }
  .today-dot { width:7px !important; height:7px !important; box-shadow:0 0 0 3px #EFFAF2 !important; }
  .kpis,.kpi-grid,.stat-grid,.metric-grid,.summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:8px !important; }
  .kpi,.stat-card,.metric-card,.summary-card { min-height:84px !important; padding:11px !important; border-radius:13px !important; }
  .logout-btn { width:40px !important; min-width:40px !important; height:40px !important; padding:0 !important; font-size:0 !important; overflow:hidden !important; justify-content:center !important; }
}
