/* 计时器独立页由外层页面滚动，导航随内容离开视口。房间计时器不受影响。 */
html:has(app-timer-sample > iframe[data-testid="timer-sample-frame"]) {
  scrollbar-gutter: stable;
}
body:has(app-timer-sample > iframe[data-testid="timer-sample-frame"]) .debater-global-nav {
  position: relative !important;
  top: auto !important;
  padding-block: 12px !important;
  transition-property: background-color, border-color, color !important;
}
body:has(app-timer-sample > iframe[data-testid="timer-sample-frame"]) .container:has(> app-breadcrumb) {
  padding-top: 16px !important;
}
html:has(app-timer-sample > iframe[data-timer-settings-open]) {
  overflow: hidden;
}

/* 去除随 iframe 高度增长的 100dvh 下限，避免高度反馈与第二根滚动条。 */
html[data-timer-embedded] {
  overflow: clip;
}
html[data-timer-embedded] .timer-tool:not(:fullscreen) {
  min-height: 0;
}
/* 设置打开时只滚动弹窗；位置与高度使用外层可见视口，而非整个长 iframe。 */
html[data-timer-embedded]:not(:has(:fullscreen)) .timer-dialog {
  position: fixed;
  top: var(--timer-host-dialog-top, 16px);
  max-height: min(820px, var(--timer-host-dialog-height, calc(100dvh - 32px)));
  margin-block: 0;
}
.timer-tool:fullscreen:has(.timer-dialog[open]) {
  overflow: hidden;
}
