/* Phone reading layout for meeting and private individual log details.
   Keep the title, metadata, tabs and exports in the reading flow rather than
   reserving the top and bottom of a short viewport for large fixed panels.
   Review/edit screens and the private log's session/privacy mask are untouched. */
@media(max-width:740px) {
 :root .drawer.meeting-page {
  display:block;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior-y:contain;
  -webkit-overflow-scrolling:touch;
  scrollbar-gutter:auto;
  scroll-padding-block:12px max(16px,env(safe-area-inset-bottom));
 }
 :root .drawer.meeting-page>.meeting-page-header {
  position:relative;
  top:auto;
  padding:12px 16px 0;
 }
 :root .drawer.meeting-page>.meeting-scroll {
  flex:none;
  height:auto;
  min-height:0;
  max-height:none;
  overflow:visible;
  overscroll-behavior:auto;
  scrollbar-gutter:auto;
  padding:20px 16px 24px;
 }
 :root .drawer.meeting-page>.meeting-action-dock {
  position:relative;
  inset:auto;
  padding:12px 16px max(16px,env(safe-area-inset-bottom));
  box-shadow:none;
 }

 /* Every action keeps its label and touch area. Let the actual controls wrap
    naturally; do not reserve an empty row for absolutely positioned buttons. */
 :root .meeting-page .meeting-page-topline {
  display:flex;
  align-items:flex-start;
  flex-wrap:wrap;
  gap:8px;
  min-height:0;
 }
 :root .meeting-page .meeting-page-topline>.meeting-back-button {
  position:static;
  flex:0 0 auto;
  min-height:44px;
  padding:8px 0;
  gap:5px;
  font-size:12px!important;
 }
 :root .meeting-page .meeting-page-topline .meeting-header-tools,
 :root .meeting-page .meeting-page-topline .meeting-header-tools:has(.review-has-next) {
  position:static;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex:1 1 220px;
  flex-wrap:wrap;
  width:auto;
  min-height:0;
  padding:0;
  gap:6px;
 }
 :root .meeting-page .meeting-header-tools .meeting-close,
 :root .meeting-page .meeting-header-tools>.help-button {
  position:static;
  inset:auto;
 }
 :root .meeting-page .meeting-header-tools .kailog-help-entry {
  position:relative;
  inset:auto;
 }
 :root .meeting-page .meeting-header-tools .meeting-header-edit.review-has-next {
  /* A next-step badge extends above its button; keep it inside this flow. */
  margin-top:8px;
 }
 :root .meeting-page .meeting-title-area {
  padding:12px 0 14px;
 }
 :root .meeting-page .meeting-title-row {
  margin-bottom:10px;
 }
 :root .meeting-page .meeting-transcript-toolbar {
  position:relative;
  top:auto;
 }

 /* Both log types use one swipeable row, so four tabs do not consume two
    rows on phones. Labels stay intact and all tabs remain keyboard reachable. */
 :root :is(.meeting-page .meeting-tabs,.il-parity-workspace .il-detail-tabs) {
  position:relative;
  display:flex;
  flex-wrap:nowrap;
  grid-template-columns:none;
  align-items:stretch;
  width:100%;
  max-width:100%;
  box-sizing:border-box;
  overflow-x:auto;
  overflow-y:hidden;
  overscroll-behavior-x:contain;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
  scroll-padding-inline:4px;
  gap:4px;
  padding:4px;
  margin:0 0 12px;
 }
 :root :is(.meeting-page .meeting-tabs,.il-parity-workspace .il-detail-tabs)>[role=tab] {
  flex:0 0 auto;
  min-height:44px;
  padding:9px 12px;
  font-size:12px;
  line-height:1.6;
  white-space:nowrap;
  gap:6px;
 }
 :root :is(.meeting-page .meeting-tabs,.il-parity-workspace .il-detail-tabs)>[role=tab] :is(.meeting-icon,.il-icon) {
  display:none;
 }

 /* Private detail already follows the document's scroll. Match its spacing
    without changing the fixed two-person notice or any private data paths. */
 :root .il-parity-workspace .il-detail-pane .il-meeting-header {
  position:relative;
  top:auto;
  padding-bottom:2px;
  margin-bottom:20px;
 }
 :root .il-parity-workspace .il-detail-topline {
  align-items:flex-start;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:12px;
 }
 :root .il-parity-workspace .il-detail-topline>div {
  flex:1 1 220px;
  justify-content:flex-end;
  gap:6px;
 }
 :root .il-parity-workspace .il-detail-pane .il-detail-title {
  margin-bottom:10px;
 }
 :root .il-parity-workspace .il-detail-context {
  gap:5px 14px;
  margin-bottom:14px;
 }
 :root .il-parity-workspace .il-detail-context>span:nth-child(3) {
  flex-basis:auto;
 }
 :root .il-parity-workspace .il-private-tag-list {
  margin:10px 0 14px;
 }
 :root .il-parity-workspace .il-detail-tabs {
  margin-top:0;
 }
 :root .il-parity-workspace .il-detail-tabs>[role=tab] {
  scroll-margin-block:76px 16px;
 }
}
