/* Phone layouts keep the scene, task and controls in separate usable areas. */
@media (max-width:900px), (max-width:1100px) and (max-height:600px) and (orientation:landscape) {
  .chamber-shell,.chamber-body,.chamber-stage,.chamber-right,.chamber-brand,.chamber-brand>div {
    min-width:0;
  }
  .chamber-top {
    display:flex;
    z-index:10;
    flex-wrap:wrap;
    flex:none;
    align-items:center;
    gap:6px;
    padding:8px;
  }
  .chamber-brand { width:100%;gap:0; }
  .chamber-mark { display:none; }
  .chamber-kicker { font-size:0;letter-spacing:normal;line-height:1; }
  .chamber-role-name {
    display:block;
    font-size:14px;
    line-height:1.3;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .chamber-top nav {
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto auto;
    gap:6px;
    width:100%;
    min-width:0;
  }
  .chamber-top nav .ch-btn,.chamber-more>summary {
    display:flex;
    align-items:center;
    justify-content:center;
    min-width:44px;
    min-height:44px;
    padding:8px 10px;
    font-size:14px!important;
    line-height:1.25;
    white-space:nowrap;
  }
  .chamber-top nav .ch-btn[hidden] { display:none!important; }
  .chamber-shell[data-role-choice=initial] .chamber-top nav { grid-template-columns:minmax(0,1fr) auto auto; }
  .chamber-more { min-width:0; }
  .chamber-more-menu {
    width:min(280px,calc(100vw - 24px));
    min-width:0;
    max-height:calc(100dvh - 110px);
    padding:10px;
    gap:8px;
    overscroll-behavior:contain;
  }
  .chamber-top nav .chamber-more-menu .ch-btn { justify-content:flex-start;white-space:normal; }
  .chamber-body {
    position:relative;
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:minmax(0,1.15fr) minmax(0,1fr);
    min-height:0;
    overflow:hidden;
  }
  .chamber-stage { min-height:0; }
  .chamber-live {
    left:12px;
    right:auto;
    top:12px;
    max-width:calc(100% - 24px);
    padding:7px 10px;
    font-size:12px;
  }
  .chamber-live span { min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
  .chamber-right {
    display:flex;
    min-height:0;
    padding:0;
    gap:0;
    overflow-x:hidden;
    overflow-y:auto;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    scroll-padding:56px 12px 12px;
    border-left:0;
    border-top:1px solid #ffffff26;
  }
  .chamber-task-toggle {
    position:sticky;
    top:0;
    z-index:4;
    display:flex;
    align-items:center;
    justify-content:space-between;
    flex:none;
    width:100%;
    min-height:48px;
    margin:0;
    padding:10px 14px;
    border:0;
    border-bottom:1px solid #ffffff24;
    border-radius:0;
    background:#183d38;
    color:#fff2d2;
    font-size:15px!important;
    font-weight:700;
    text-align:left;
    touch-action:manipulation;
  }
  .chamber-task-toggle::after { content:'⌄';font-size:20px;line-height:1; }
  .chamber-task-toggle[aria-expanded=false]::after { content:'⌃'; }
  #ch-panel { flex:none;gap:10px;padding:12px;min-width:0; }
  #ch-panel:empty { display:none; }
  .chamber-right h3 { margin:0;font-size:22px;line-height:1.2; }
  .chamber-right p { font-size:15px;line-height:1.5;overflow-wrap:break-word; }
  .chamber-right .ch-btn,.chamber-right .chamber-answer,.chamber-right .parl-bill,.chamber-right .cs-button {
    min-width:0;
    min-height:48px;
    padding:12px;
    font-size:15px!important;
    line-height:1.4;
    white-space:normal;
    overflow-wrap:break-word;
    touch-action:manipulation;
  }
  .chamber-right .chamber-task-toggle { padding:10px 14px; }
  .chamber-right .ch-btn+.ch-btn { margin-top:0; }
  .chamber-actions,.cs-listeners,.cs-nominees,.cs-ballot,.cs-evidence,.parl-bill-grid { gap:9px; }
  .chamber-right .parl-bill b { font-size:16px; }
  .chamber-right .parl-bill span,.chamber-right .cs-button small { font-size:13px;line-height:1.4; }
  .chamber-right summary {
    min-height:44px;
    padding:10px 0;
    font-size:14px;
    line-height:1.5;
    touch-action:manipulation;
  }
  .chamber-right .chamber-caption {
    flex:none;
    width:calc(100% - 24px);
    margin:0 12px 12px;
    padding:12px;
  }
  .chamber-caption p { font-size:15px;line-height:1.5; }
  .chamber-caption small { font-size:11px; }
  .chamber-shell input:not([type=checkbox]):not([type=range]),.chamber-shell textarea,.chamber-shell select {
    min-height:44px;
    max-width:100%;
    font-size:16px!important;
  }
  .chamber-shell[data-task-panel=collapsed] .chamber-body {
    grid-template-rows:minmax(0,1fr) 52px;
  }
  .chamber-shell[data-task-panel=collapsed] .chamber-right { overflow:hidden; }
  .chamber-shell[data-task-panel=collapsed] #ch-panel,
  .chamber-shell[data-task-panel=collapsed] .chamber-right .chamber-caption { display:none!important; }
  .chamber-shell[data-task-panel=collapsed] .chamber-task-toggle { min-height:52px; }
  .chamber-role-choices { grid-template-columns:minmax(0,1fr); }
  .chamber-role-choices-inline { gap:6px;margin:0; }
  .chamber-role-choices-inline .chamber-role-choice { min-height:56px;gap:2px;padding:8px 10px; }
  .chamber-role-choices-inline .chamber-role-choice strong { font-size:15px;line-height:1.2; }
  .chamber-role-choices-inline .chamber-role-choice span { font-size:13px;line-height:1.25; }
  .chamber-body:has(.chamber-role-choices-inline) {
    grid-template-rows:minmax(0,1fr) minmax(0,min(340px,70%));
  }
  .chamber-body:has(.chamber-role-choices-inline) #ch-panel { gap:8px;padding:10px 12px; }
  .chamber-body:has(.chamber-role-choices-inline) #ch-panel>p { margin:0; }
  .chamber-shell[data-task-panel=collapsed] .chamber-body:has(.chamber-role-choices-inline) {
    grid-template-rows:minmax(0,1fr) 52px;
  }
  .chamber-dialog { padding:10px; }
  .chamber-dialog-card { padding:16px;max-height:100%;overscroll-behavior:contain; }
  .chamber-dialog-head { gap:10px; }
  .chamber-dialog-head h3 { font-size:24px; }
  .chamber-dialog .ch-btn { min-height:44px;padding:10px 12px;font-size:15px!important; }
  .chamber-dialog p,.chamber-dialog li { font-size:15px; }
  .chamber-setting { grid-template-columns:minmax(0,1fr) minmax(120px,.8fr);gap:12px;min-height:56px; }
  .chamber-setting label { font-size:15px; }
  .chamber-setting input[type=checkbox] { width:28px;height:28px; }
  .chamber-artwork-grid { grid-template-columns:minmax(0,1fr); }
}

@media (max-width:900px) and (orientation:landscape), (max-width:1100px) and (max-height:600px) and (orientation:landscape) {
  .chamber-top { flex-wrap:nowrap;gap:10px;padding:6px 10px; }
  .chamber-brand { width:auto;flex:1 1 auto; }
  .chamber-top nav { width:auto;flex:none;grid-template-columns:auto auto auto auto; }
  .chamber-role-name { max-width:180px; }
  .chamber-body,.chamber-body:has(.chamber-role-choices-inline) {
    grid-template-columns:minmax(0,1fr) clamp(250px,34vw,300px);
    grid-template-rows:minmax(0,1fr);
  }
  .chamber-right { border-top:0;border-left:1px solid #ffffff26; }
  .chamber-shell[data-task-panel=collapsed] .chamber-body,
  .chamber-shell[data-task-panel=collapsed] .chamber-body:has(.chamber-role-choices-inline) {
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:minmax(0,1fr);
  }
  .chamber-shell[data-task-panel=collapsed] .chamber-right {
    position:absolute;
    top:12px;
    right:12px;
    z-index:5;
    width:auto;
    max-width:145px;
    border:1px solid #d3d6bc66;
    border-radius:8px;
    background:#183d38;
  }
  .chamber-shell[data-task-panel=collapsed] .chamber-task-toggle {
    min-height:44px;
    gap:10px;
    padding:8px 12px;
    border:0;
    white-space:nowrap;
  }
  .chamber-shell[data-task-panel=collapsed] .chamber-live { max-width:calc(100% - 174px); }
}

@media (max-width:360px) {
  .chamber-top nav .ch-btn,.chamber-more>summary { padding-inline:8px;font-size:13px!important; }
  .chamber-setting { grid-template-columns:minmax(0,1fr); }
  .chamber-setting input[type=checkbox] { justify-self:start; }
}
