/* Sett-Ops 1.9.39 groups C (layout at 320px and 844x390) and D (taps). Loaded LAST so it wins over styles/ops16/theme38/module css.
   RULE-31: every number below carries its WHY; REVISIT notes at the end of each block. Keyboard / screen-reader items are NOT here
   (Sheila Tab's PB-A11Y pack; kept out so the merge is clean). */

/* D: tap gaps. WHY 8px: Ariel's minimum gap between two tap targets (1.9.38 lanes: 6px Prompt Studio tabs, 3px Ideas status chips,
   7px KB tags, 6px Incidents filter tabs). KB tags get 10px because their ::after hit-extension (-2px each side) eats 4px of the gap.
   REVISIT if Ariel's minimum changes. */
.seg16[role=tablist]{gap:8px!important}
.pipe16{gap:8px!important}
.kb-tags{gap:10px!important}
.inc37tabs{gap:8px!important}

/* C: Ideas & Tasks status chips at 320 (Shabtai/Ariel: page 342px wide, "Shipped" cut). WHY 4 columns under 420px: 7 chips of 44px
   minimum + 8px gaps need 356px; 4 + 3 on two rows fit any phone from 300px. REVISIT if a stage is added. */
@media (max-width:420px){.pipe16{grid-template-columns:repeat(4,minmax(0,1fr))!important}.pipe16 button{min-width:0!important}}

/* C: Knowledge Base header at 320 (page 325-365px wide, "+ Add" clipped). WHY min-width:0: a flex child's default min width is its
   content, so the search field refused to shrink. REVISIT never. */
.kb-tools{min-width:0;max-width:100%}
.kb-search{min-width:0!important}
.kb-search input{width:100%}
.kb-tools .kb-btn{flex:none}
.kb-head{min-width:0}.kb-head>div{min-width:0}

/* C: New idea sheet flush to the right edge at 320 (Shabtai). WHY 16px: the same side margin every other sheet has. REVISIT never. */
@media (max-width:420px){#sheet.sheet{box-sizing:border-box;left:0;right:0;width:100%!important;max-width:100vw;padding-left:16px!important;padding-right:16px!important}
  #sheet.sheet input,#sheet.sheet select,#sheet.sheet textarea,#sheet.sheet .btn{max-width:100%;box-sizing:border-box}}

/* C: Apps helper chip overlap at 320 (Shabtai: "Helper" printed on top of the helper name; cut in landscape). WHY wrap: the chip's
   label and value are two lines on a narrow card instead of one squeezed line. REVISIT never. */
#v-projects .pchip,#v-projects [class*="chip"]{white-space:normal;height:auto;min-height:0;overflow-wrap:anywhere}
#v-projects a[href^="mailto:"],#v-projects .mail16,#v-projects [data-mail]{min-height:44px;display:inline-flex;align-items:center}

/* C: Usage names cut to "De..." at 320 (Shabtai). WHY the name gets its own full line: two AIs whose names start alike must be told
   apart; the plan pill moves under it. Contrast: the "Updated ..." line was 4.47:1 (Shabtai), now #b9bdd6 on the card = 7.9:1.
   REVISIT never. */
@media (max-width:420px){.us15h{flex-wrap:wrap}.us15h b{flex:1 1 100%;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;min-width:0}}
.us15foot,.us15.mini .us15foot:not(:has(em)){color:#b9bdd6!important}

/* C: Settings Shabbat card at 320 (Shabtai: title "Sh...", one word per line beside "Starts in 40h"). WHY the pill drops under the
   title: the title and text get the whole card width. REVISIT never. */
/* (the real card: button.shcard > span.shic + span.pbody + span.pill; WHY 150px: the title's widest word plus room; under it the pill
   wraps to its own line, left-aligned under the text.) */
@media (max-width:420px){.shcard{flex-wrap:wrap!important;row-gap:6px}.shcard .pbody{flex:1 1 150px!important;min-width:150px!important}.shcard b{white-space:normal!important;overflow:visible!important;text-overflow:clip!important}.shcard .pill{flex:0 0 auto;margin-left:calc(var(--shic39,0px))}}

/* C: header at 320 and at simulated 200% zoom (Ariel: DEMO badge over Refresh by ~10px; Shabtai: DEMO pill a dot / "DEM").
   WHY: the brand block may shrink (min-width:0) and the logo hides under 380px (it is the same icon as the app's), so the version +
   Refresh row keeps its room; the DEMO chip sizes to its word (min 44px) instead of a fixed 44px circle. REVISIT if the header gains a
   button. */
header.top .brand{min-width:0;flex:1 1 auto;overflow:hidden}
header.top .verrow{display:flex;align-items:center;gap:6px;flex-wrap:nowrap;min-width:0}
header.top>button,header.top .iconbtn,header.top .chip{flex:none}
.top .chip.demo,#syncChip.demo{width:auto!important;min-width:44px;padding:0 8px!important;gap:4px}
.top .chip.demo span,#syncChip.demo span{display:inline!important;font-size:10.5px;letter-spacing:.02em;white-space:nowrap}
.top .chip.demo .dot{display:none}
@media (max-width:380px){header.top .logo{display:none}header.top .brand small{display:none}}
@media (max-width:300px){header.top .ver{display:none}}

/* D: the floating bolt (⚡). Shabtai measured a 17x17 hit area: the tap landed on the icon span inside the button. WHY
   pointer-events:none on the children: the whole 56px button is the target, never a 17px child. The small scrolled state was 40x40;
   now 48x48 (WHY: 44 minimum + 4 so the ring is not the edge). REVISIT never. */
.fab13>*{pointer-events:none}
.fab13.scroll13{width:48px!important;height:48px!important}
/* D: reserve its space (Ariel/Shabtai: the bolt covered the Apps and Incidents cards and "Send a command"). On a phone the bolt now
   sits INSIDE the bottom bar's own space, at its right end, and the bar's 5 tabs make room for it, so it can never cover a card.
   WHY 64px: 56px bolt + 8px gap. WHY phones only (<=480px wide or <=500px tall): on wide screens the nav is a side rail and the bolt
   covers nothing (Ariel 844: PASSED). REVISIT if the nav gains a 6th tab. */
@media (max-width:480px),(max-height:500px){
  body:has(.fab13:not(.hide)) nav.tabs{padding-right:64px!important}
  .fab13:not(.hide){bottom:calc(6px + var(--safe-b,0px))!important;right:6px!important;width:52px!important;height:52px!important;padding:0!important;gap:0!important}
  .fab13 b,.fab13 .faborb15{display:none!important}
}

/* C: landscape 844x390 (Shabtai: only ~70px of a page visible under header + focus bar + demo bar + nav; DEMO pill cut to "DEM").
   WHY compact: under 500px tall the stacked bars shrink (nav 46px, strips one line) and the Power build banner stops being sticky,
   so a page shows at least ~200px of its own content. REVISIT if a bar is added. */
@media (max-height:500px){
  nav.tabs{padding-top:2px!important;padding-bottom:calc(2px + var(--safe-b,0px))!important}
  nav.tabs button{min-height:44px!important;flex-direction:row!important;gap:6px!important;font-size:12px}
  #ap38banner,.ap-bannerwrap{position:static!important}
  #testSiteBadgeStatic{line-height:1.4!important;font-size:10.5px!important}
  .demopill19{padding:2px 12px!important}
  .focus19bar,.focusbar19,#focusBanner19{padding-top:2px!important;padding-bottom:2px!important}
  header.top{padding-top:4px!important;padding-bottom:4px!important}
  main{padding-bottom:60px!important}
}

/* C: Home's Orbit captions at 320 (Shabtai: "Passed vc...", badges over names). WHY: names wrap to 2 lines and the ⚠ badge moves to
   the avatar's corner so it never sits on text. REVISIT never. */
@media (max-width:360px){.o13 .t13name,.o13 b,.wd38step b{white-space:normal!important;overflow-wrap:anywhere;line-height:1.15}.o13 .t13job,.o13 small{white-space:normal!important;-webkit-line-clamp:2;display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden}.o13 .warn13,.o13 .badge13{top:-4px!important;right:-4px!important}}

/* C: the toast at 320 (Shabtai: "Demo mode: nothing is sent" stayed on screen over content). WHY: it sits above the bar on the left,
   never wider than the screen minus the bolt, and taps go through it (it is words, not a control). REVISIT never. */
.toast{pointer-events:none;max-width:calc(100vw - 96px);box-sizing:border-box;white-space:normal;text-align:center}
@media (max-width:480px){.toast{bottom:calc(70px + var(--safe-b,0px))!important;font-size:13px;padding:9px 14px}}

/* D: the Team "3 of 8 active" chip truncated at 320 (Ariel). WHY nowrap + flex:none: a count must never be cut. REVISIT never. */
.section-title .pill{flex:none;white-space:nowrap;max-width:none!important;overflow:visible!important}

/* D: Ideas & Tasks search box was 30px wide (Ariel). WHY 140px minimum: room for "Search tasks" at 16px. REVISIT never. */
#v-tasks input[type=search]{min-width:140px;flex:1 1 140px}

/* D: the bubble's star button (Starred testable, 1.9.39). WHY a 44x44 hit area around a small glyph: the meta line stays small and the
   tap target still meets 44px; the ::after extends it. REVISIT never. */
.c39star{min-height:0!important;min-width:0!important;height:auto!important;vertical-align:baseline;position:relative;border:0;background:none;color:inherit;font:inherit;font-size:13px;line-height:1;padding:0 4px;margin-right:4px;opacity:.8;cursor:pointer}
/* WHY min-height 0: the app's 44px button minimum made every bubble's time line 44px tall (+24px per message, and a long-press at
   the bubble's middle landed on the time line); the 44x44 tap area is the ::after below instead. REVISIT never. */
.c39star::after{content:"";position:absolute;left:50%;top:50%;width:44px;height:44px;transform:translate(-50%,-50%)}
.c39star.on{opacity:1}.c39star.c30star{font-size:13px;margin-right:4px} /* WHY: .c30star's 10px size is for the old mark; the button keeps its own */
/* D: the confidence chip under each Team row is a label, not a button (Ariel: 26px tall with a pointer cursor, 2.4:1 text).
   WHY cursor default + #c9c3e6: it does nothing on its own, and "Not stated" must read at 4.5:1 or more. REVISIT if it becomes tappable. */
.conf37chip{cursor:default!important}
.conf37[data-level=none] .conf37chip{color:#c9c3e6!important}

/* C: header at a simulated 200% zoom (a 390px phone = 195 CSS px; Ariel). WHY two rows below 300px: the brand + version/Refresh line
   gets its own row, so it can neither shrink to 0 nor slide under the DEMO chip; the chip and the three round buttons sit on the
   second row. 300px: just under the 320 phones, which keep one row. REVISIT if the header gains a button. */
@media (max-width:300px){header.top{flex-wrap:wrap!important;row-gap:4px;height:auto!important}header.top .brand{flex:1 1 100%!important;min-width:0}header.top .brand .verrow{flex-wrap:wrap}}

/* C: DEV / TEST copies only: the red strip is position:fixed over the top 17-24px, and the brand line sat under it (screenshots at
   320 and 844x390: "Sett-Ops" cut by the strip). WHY 24px: the strip's tallest one-line height (320px, 10.5px text). Main has no
   strip, so nothing moves there. REVISIT if the strip's text grows. */
body:has(#testSiteBadgeStatic) header.top{margin-top:24px}
