/* 0.18.42 · Owner-approved Category 2 corrective round I1–I9.
   Figma authority: 129:6, 131:2, 132:2, 133:2, 146:2, 147:2, 148:2, 149:2, 154:2. */

/* I1 · My Settings: one ordinary modal, aligned controls, desktop grows instead of creating a private scroll jail. */
.my-settings-modal { overflow:auto; }
.my-settings-card { width:min(1180px,calc(100vw - 32px)); max-height:none; overflow:visible; padding:22px 24px; }
.my-settings-form { overflow:visible; }
.my-settings-section { padding:13px 0; }
.my-settings-section h3 { margin-bottom:9px; font-size:13px; }
.my-settings-profile .home-pref-name { display:block; max-width:100%; }
.my-settings-form .home-pref-name>span { font-size:10px; }
.my-settings-form .home-pref-name input { min-height:52px; font-size:15px; font-weight:650; }
.my-settings-grid { gap:10px; align-items:end; }
.my-settings-form input[type="text"],.my-settings-form input:not([type]),.my-settings-form select { min-height:46px; }
.my-settings-form .home-pref-toggle { min-height:46px; height:46px; padding:0 12px; display:flex!important; align-items:center; gap:9px; }
.my-settings-form .home-pref-toggle>span { display:block; margin:0!important; line-height:1.25; }
.home-pref-timezone-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:end; }
.home-pref-timezone-row select { min-width:0; }
.timezone-device-button { min-height:46px; padding:0 14px; display:inline-flex; align-items:center; justify-content:center; gap:7px; white-space:nowrap; }
.timezone-device-button svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.8; }
.my-settings-actions { padding-top:12px; }
.my-settings-actions button { min-height:44px; }
.home-preferences-status { min-height:16px; margin-top:7px; }
.settings-version { margin-top:5px; }

/* I2 · My Rooms: actions shrink first, labels disappear only when space truly runs out. */
.my-room-row { grid-template-columns:minmax(180px,1fr) auto!important; gap:12px; align-items:center; }
.my-room-actions { width:auto!important; display:flex!important; flex-wrap:nowrap!important; justify-content:flex-end; gap:7px; }
.my-room-actions .my-room-action { flex:0 0 auto!important; width:auto!important; min-width:0; min-height:38px; padding:0 11px; display:inline-flex; align-items:center; justify-content:center; gap:6px; }
.my-room-action svg { width:15px; height:15px; flex:0 0 15px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.my-room-action span { white-space:nowrap; }
@media (max-width:1099px) and (min-width:760px) {
  .my-room-actions .my-room-action { padding-inline:8px; gap:4px; font-size:8px; }
  .my-room-action svg { width:14px; height:14px; flex-basis:14px; }
}
@media (max-width:759px) {
  .my-rooms-head>div:first-child { flex:1 1 220px!important; }
  .my-rooms-head-controls { width:auto!important; margin-left:auto!important; justify-content:flex-end!important; }
  .my-room-row { grid-template-columns:minmax(0,1fr) auto!important; min-height:62px; padding:10px 11px; }
  .my-room-copy .room-slug { display:none; }
  .my-room-actions { display:flex!important; width:auto!important; gap:5px; }
  .my-room-actions .my-room-action { width:40px!important; height:38px; min-width:40px!important; flex:0 0 40px!important; padding:0!important; border-radius:10px; }
  .my-room-action span { display:none; }
  .my-room-action svg { width:16px; height:16px; flex-basis:16px; }
}
@media (max-width:519px) {
  .my-rooms { padding:14px 12px; }
  .my-rooms-head { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px 10px; }
  .my-rooms-head>div:first-child { min-width:0; }
  .my-rooms-head>div:first-child p { font-size:9px; }
  .my-rooms-head-controls { grid-column:2; grid-row:1 / span 2; align-self:start; }
  .section-collapse-label { display:none; }
  .section-collapse-control { width:34px; min-width:34px; padding:0; }
  .my-room-row { gap:6px; }
  .my-room-copy b { font-size:11px; }
  .my-room-copy small { max-width:118px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
  .my-room-actions { gap:4px; }
  .my-room-actions .my-room-action { width:36px!important; min-width:36px!important; flex-basis:36px!important; height:36px; }
}

/* I3 · Board: active color must be unmissable; check is geometrically centered INSIDE the swatch. */
.board-color { position:relative; box-sizing:border-box; }
.board-color.active { border-color:#7ca6ff!important; box-shadow:0 0 0 2px #7ca6ff,0 0 0 4px rgba(124,166,255,.22)!important; }
.board-color.active::after { content:"✓"; position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:18px; height:18px; display:grid; place-items:center; border-radius:50%; color:#fff; background:rgba(8,17,29,.74); font:900 11px/1 "Segoe UI",sans-serif; text-shadow:0 1px 2px rgba(0,0,0,.7); pointer-events:none; }
.board-color-custom { --board-custom-color:transparent; font-size:18px; font-weight:800; }
.board-color-custom[data-board-color] { background:var(--board-custom-color)!important; color:#fff; }
.board-color-custom[data-board-color]::before { content:""; position:absolute; inset:6px; border-radius:50%; background:var(--board-custom-color); }
.board-color-custom:not([data-board-color])::before { display:none; }

/* I4 · Durable history controls. */
.chat-history-controls { display:flex; align-items:center; justify-content:center; gap:8px; min-height:24px; padding:3px 8px; color:rgb(var(--rooms-rgb-718198,113,129,152)); font-size:9px; }
.chat-history-controls .compact { min-height:28px; padding:0 10px; font-size:9px; }
#chatHistoryStatus.is-error { color:#ff9aa4; }
.attachment-expired .attachment-download:disabled { opacity:.45; cursor:not-allowed; }

/* I5 · Phone room header becomes one storey. */
.room-info-button,.room-info-popover { display:none; }
@media (max-width:760px) {
  .room-head { position:relative; min-height:52px; height:52px; padding:6px 8px!important; align-items:center!important; flex-wrap:nowrap; gap:6px; }
  .room-title-group { flex:1 1 auto!important; min-width:0; display:block; }
  .room-title-group h2 { margin:0; min-width:0; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:15px; line-height:1.2; }
  .breakout-context { display:none!important; }
  .room-summary { display:none!important; }
  .room-head-actions { flex:0 0 auto!important; max-width:none!important; display:flex; align-items:center; gap:6px; flex-wrap:nowrap!important; }
  .room-head-actions>#copyRoomBtn,.room-head-actions>#breakoutsBtn,.room-head-actions>#lockRoomBtn,
  .room-head-actions>#transcriptionBtn:not(.hidden),.room-head-actions>#transcriptionRunBtn:not(.hidden),
  .room-head-actions>#transcriptionBtn,.room-head-actions>#transcriptionRunBtn { display:none!important; }
  .room-head-actions>#admissionNotice:not(.hidden) { width:36px; min-width:36px; height:36px; padding:0; }
  .room-head-actions>#admissionNotice span { display:none!important; }
  .room-info-button { width:42px; height:36px; min-width:42px; display:inline-flex; align-items:center; justify-content:center; gap:4px; padding:0 6px; border:1px solid rgba(100,230,172,.25); border-radius:12px; color:rgb(var(--rooms-rgb-dce8f7,220,232,247)); background:rgb(var(--rooms-rgb-111d2c,17,29,44)); }
  .room-info-button svg { width:14px; height:14px; fill:none; stroke:#64e6ac; stroke-width:1.8; }
  .room-info-button b { font-size:11px; }
  .connection-indicator { width:28px; height:36px; min-width:28px; min-height:36px; padding:0; border:0; background:transparent; }
  .connection-indicator i { width:8px; height:8px; }
  .connection-indicator .connection-label { display:none; }
  .room-info-popover { position:absolute; z-index:88; top:62px; right:8px; width:min(358px,calc(100vw - 16px)); padding:14px; border:1px solid rgb(var(--rooms-rgb-394b64,57,75,100)); border-radius:18px; background:rgb(var(--rooms-rgb-0d1623,13,22,35)); box-shadow:0 20px 60px rgba(0,0,0,.58); }
  .room-info-popover:not(.hidden) { display:block; }
  .room-info-popover-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
  .room-info-popover dl { margin:0 0 12px; display:grid; gap:8px; }
  .room-info-popover dl>div { display:flex; justify-content:space-between; gap:12px; }
  .room-info-popover dt { color:rgb(var(--rooms-rgb-94a4ba,148,164,186)); font-size:10px; font-weight:700; }
  .room-info-popover dd { margin:0; font-size:11px; font-weight:800; }
  #roomInfoCopyBtn { min-height:34px; display:inline-flex; align-items:center; gap:6px; }
}
@media (max-width:340px) {
  .room-head { min-height:48px; height:48px; }
  .room-title-group h2 { font-size:14px; }
  .room-info-button { width:38px; min-width:38px; height:34px; }
  .connection-indicator { height:34px; }
}

/* I6 · No permanent technical tax between video and panel on phones. */
.room-main { position:relative; }
.room-media-warning { position:absolute; z-index:18; left:12px; right:12px; bottom:12px; min-height:42px; padding:8px 42px 8px 38px; border:1px solid #8b6c2a; border-radius:12px; color:rgb(var(--rooms-rgb-f5f8ff,245,248,255)); background:rgba(42,32,18,.96); box-shadow:0 12px 35px rgba(0,0,0,.42); font-size:10px; line-height:1.35; }
.room-media-warning::before { content:"!"; position:absolute; left:13px; top:50%; transform:translateY(-50%); color:#f1cb76; font-size:15px; font-weight:900; }
@media (max-width:760px) {
  .room-message { position:absolute; z-index:14; left:50%; bottom:10px; transform:translateX(-50%); width:max-content; max-width:calc(100% - 24px); min-height:0; margin:0; padding:5px 9px; opacity:.86; pointer-events:none; font-size:9px; }
  .mobile-panel-resizer { display:none!important; height:0!important; min-height:0!important; overflow:hidden; }
  .room-shell { grid-template-rows:minmax(250px,1fr) minmax(190px,var(--mobile-panel-height,320px))!important; }
  .room-main { grid-row:1!important; }
  .participant-panel,.participant-panel.detached { grid-row:2!important; }
  .room.panel-closed .room-shell,.room.panel-detached .room-shell { grid-template-rows:minmax(250px,1fr) auto!important; }
}

/* I7 · Same participantPanel becomes fullscreen. */
.panel-fullscreen-button { display:none; }
@media (max-width:760px) {
  .panel-fullscreen-button { display:grid; }
  .room.panel-fullscreen { overflow:hidden; }
  .room.panel-fullscreen .participant-panel.panel-fullscreen { position:fixed!important; z-index:190!important; left:var(--buddy-vv-left,0px)!important; top:var(--buddy-vv-top,0px)!important; right:auto!important; bottom:auto!important; width:100vw!important; height:var(--buddy-vv-height,var(--app-viewport-height,100dvh))!important; max-width:none!important; max-height:none!important; min-height:0!important; border:0; border-radius:0; transform:none!important; resize:none!important; box-shadow:none; background:rgb(var(--rooms-rgb-050a12,5,10,18)); grid-template-rows:auto minmax(0,1fr)!important; }
  .room.panel-fullscreen .participant-panel .panel-topbar { padding:max(8px,env(safe-area-inset-top)) 9px 8px; min-height:54px; }
  .room.panel-fullscreen .hybridTabBtn,#participantPanel.panel-fullscreen #hybridTabBtn { display:none!important; }
  #participantPanel.panel-fullscreen .panel-tabs { flex:1 1 auto; display:grid; grid-template-columns:1fr 1fr; gap:6px; }
  #participantPanel.panel-fullscreen .panel-actions #panelDetachBtn,#participantPanel.panel-fullscreen .panel-actions #panelCloseBtn { display:none!important; }
  #participantPanel.panel-fullscreen #panelFullscreenBtn svg use { pointer-events:none; }
  #participantPanel.panel-fullscreen .participants-pane,#participantPanel.panel-fullscreen .chat-pane { min-height:0; overflow:auto; }
  #participantPanel.panel-fullscreen .chat-pane { padding-bottom:max(8px,env(safe-area-inset-bottom)); }
  .room.panel-fullscreen .toolbar-wrap { display:none!important; }
}

/* I8 · Keyboard-active geometry follows visualViewport, not mythical 100vh. */
@media (max-width:760px) {
  .room.keyboard-active .toolbar-wrap { display:none!important; }
  .room.keyboard-active:not(.panel-fullscreen) .room-shell { height:calc(var(--buddy-vv-height) - 54px)!important; min-height:0!important; grid-template-rows:108px minmax(0,1fr)!important; }
  .room.keyboard-active:not(.panel-fullscreen) .room-main,.room.keyboard-active:not(.panel-fullscreen) .video-grid { min-height:0!important; height:108px!important; }
  .room.keyboard-active:not(.panel-fullscreen) .video-grid .participant-tile:not(.is-focused) { display:none; }
  .room.keyboard-active:not(.panel-fullscreen) .participant-panel { height:100%!important; min-height:0!important; }
  .room.keyboard-active .chat-pane { min-height:0; overflow:hidden; }
  .room.keyboard-active .chat-messages { min-height:0; overflow:auto; }
  .room.keyboard-active .chat-form { position:sticky; bottom:0; z-index:10; padding-bottom:max(4px,env(safe-area-inset-bottom)); background:inherit; }
  .room.panel-fullscreen.keyboard-active .participant-panel.panel-fullscreen { height:var(--buddy-vv-height)!important; }
}

/* I9 · Exactly two phone tiles may render side-by-side without changing server layout preference. */
@media (max-width:760px) {
  .video-grid[data-pair-view="side"]:not(.focus-mode):not(.sidebar-mode) { display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr))!important; grid-template-rows:minmax(0,1fr)!important; gap:6px; align-items:stretch; }
  .video-grid[data-pair-view="side"]:not(.focus-mode)>.participant-tile { grid-column:auto!important; grid-row:1!important; width:auto!important; height:100%!important; min-width:0; min-height:0; }
  .video-grid[data-pair-view="side"] .participant-tile video { object-fit:cover; }
}

@media (max-width:560px) {
  .my-settings-card { width:100%; max-height:calc(var(--buddy-vv-height,var(--app-viewport-height,100dvh)) - 16px); overflow:auto; padding:16px; }
  .my-settings-grid,.my-settings-grid.devices,.my-settings-grid.interface { grid-template-columns:1fr; }
  .home-pref-timezone-row { grid-template-columns:1fr; }
  .timezone-device-button { width:100%; }
  .my-settings-form .home-pref-toggle { min-height:48px; height:auto; }
  .my-settings-actions { position:sticky; bottom:-16px; z-index:4; margin:10px -16px -16px; padding:10px 16px max(10px,env(safe-area-inset-bottom)); background:rgba(var(--rooms-rgb-0d1623,13,22,35),0.985); }
  html[data-theme="light"] .my-settings-actions { background:rgba(var(--rooms-rgb-f8fbff,248,251,255),0.985); }
}
