/* A permanent banner row, independent of the timer's Focus-view layout. */
body[data-pomodoro-app] {
  --pomo-normal-room-height:clamp(850px,100svh,1300px);
  --pomo-normal-timer-anchor:calc(var(--pomo-normal-room-height) * .49);
  --pomo-focus-timer-anchor:calc(max(360px,100svh) * .48);
  --pomo-task-footprint:51px;
  --pomo-normal-dock-bottom:74px;
  --pomo-ad-top:calc(var(--pomo-normal-room-height) - var(--pomo-normal-dock-bottom) + 8px);
  --pomo-ad-height:90px;
  --pomo-ad-width:728px;
  --pomo-ad-center-x:50%;
  --pomo-ad-row-height:calc(var(--pomo-ad-height) + 14px);
  --pomo-ad-dock-space:40px;
}
@media(min-width:1600px) {
  body[data-pomodoro-app] {
    --pomo-normal-timer-anchor:calc(var(--pomo-normal-room-height) * .48);
    --pomo-normal-dock-bottom:86px;
  }
}
@media(min-width:761px) and (max-height:850px) {
  body[data-pomodoro-app] {
    --pomo-normal-room-height:max(700px,100svh);
    --pomo-normal-timer-anchor:calc(var(--pomo-normal-room-height) * .48);
    --pomo-task-footprint:45px;
    --pomo-normal-dock-bottom:57px;
  }
}
@media(min-width:761px) and (max-height:700px) {
  body[data-pomodoro-app] {
    --pomo-normal-room-height:max(580px,100svh);
    --pomo-normal-timer-anchor:calc(var(--pomo-normal-room-height) * .45);
    --pomo-normal-dock-bottom:42px;
  }
  body[data-pomodoro-app]:not(.is-zen) { --pomo-task-footprint:38px; }
}
@media(min-width:761px) and (min-height:701px) and (max-height:740px) {
  body[data-pomodoro-app] { --pomo-normal-timer-anchor:calc(var(--pomo-normal-room-height) * .46); }
}
/* On tablets the 728px unit also needs clearance from the right Focus button. */
@media(min-width:761px) and (max-width:1170px) {
  body[data-pomodoro-app] {
    --pomo-ad-top:max(calc(var(--pomo-normal-room-height) - var(--pomo-normal-dock-bottom) + 8px),calc(100svh - 22px));
  }
}
@media(max-width:767px) { body[data-pomodoro-app] { --pomo-ad-height:100px; } }
@media(max-width:760px) {
  body[data-pomodoro-app] {
    --pomo-normal-room-height:clamp(760px,100svh,1100px);
    --pomo-normal-timer-anchor:calc(var(--pomo-normal-room-height) * .47 + 21px);
    --pomo-task-footprint:48px;
    --pomo-ad-top:max(472px,calc(100svh - 190px));
    --pomo-ad-dock-space:100px;
    --pomo-ad-width:320px;
  }
  body[data-pomodoro-app] .timer-center > .room-eyebrow,
  body[data-pomodoro-app] .timer-center > #page-title { display:none; }
}
@media(max-width:760px) and (max-height:740px) {
  body[data-pomodoro-app] {
    --pomo-normal-room-height:max(600px,100svh);
    --pomo-normal-timer-anchor:calc(var(--pomo-normal-room-height) * .48 + 7.5px);
    --pomo-ad-top:max(472px,calc(100svh - 148px));
  }
  body[data-pomodoro-app]:not(.is-zen) { --pomo-task-footprint:40px; }
}
@media(max-height:500px) { body[data-pomodoro-app].is-zen { --pomo-task-footprint:40px; } }
@media(max-width:319px) { body[data-pomodoro-app] { --pomo-ad-height:50px; } }
body[data-pomodoro-app]:not(.is-zen) .focus-room,
body[data-pomodoro-app].is-zen .focus-room {
  height:max(var(--pomo-normal-room-height),100svh,calc(var(--pomo-ad-top) + var(--pomo-ad-row-height) + var(--pomo-ad-dock-space))) !important;
  min-height:0;
  max-height:none;
}
body[data-pomodoro-app]:not(.is-zen) .timer-center { top:var(--pomo-normal-timer-anchor); }
body[data-pomodoro-app].is-zen .timer-center { top:var(--pomo-focus-timer-anchor); }
/* Preserve the original progress position after removing its task shortcut. */
body[data-pomodoro-app] .timer-center::after {
  content:"";display:block;height:var(--pomo-task-footprint);pointer-events:none;
}
/* The native desktop docks keep their original viewport-based coordinates. */
.pomodoro-dock-anchor {
  position:absolute;inset:0 0 auto;height:var(--pomo-normal-room-height);pointer-events:none;
}
body[data-pomodoro-app].is-zen .pomodoro-dock-anchor { height:max(360px,100svh); }
.pomodoro-dock-anchor > .room-bottom { pointer-events:auto; }
body[data-pomodoro-app] .room-footnote {
  top:auto;
}
@media(max-width:760px) {
  body[data-pomodoro-app]:not(.is-zen) .room-bottom,
  body[data-pomodoro-app].is-zen .room-bottom {
    top:calc(var(--pomo-ad-top) + var(--pomo-ad-row-height) + 18px);bottom:auto;transform:none;
  }
  body[data-pomodoro-app] .room-footnote {
    top:calc(var(--pomo-ad-top) + var(--pomo-ad-row-height) + 72px);bottom:auto;
  }
}
.pomodoro-ad-slot {
  position:absolute;top:var(--pomo-ad-top);left:var(--pomo-ad-center-x);width:min(var(--pomo-ad-width),100%);
  height:calc(var(--pomo-ad-height) + 14px);min-height:0;
  margin:0 0 0 max(calc(var(--pomo-ad-width) / -2),-50%);padding:0;
  display:grid;grid-template-rows:14px var(--pomo-ad-height);
  justify-items:center;align-content:start;overflow:visible;z-index:1;
}
.pomodoro-ad-label {
  display:block;height:14px;line-height:14px;color:var(--room-soft);
  font:500 8px/14px Inter,Arial,sans-serif;letter-spacing:.08em;
  text-transform:uppercase;text-align:center;
  text-shadow:0 1px 2px rgba(9,20,19,.55);pointer-events:none;
}
.pomodoro-ad-content {
  width:100%;min-width:0;height:var(--pomo-ad-height);
  display:flex;justify-content:center;align-items:flex-start;overflow:visible;
}
.pomodoro-ad-content > ins,.pomodoro-smartbee-renderer { flex:0 0 auto; }
.pomodoro-ad-slot[data-state="unfilled"],.pomodoro-ad-slot[data-state="error"] {
  visibility:hidden;pointer-events:none;
}
@media print { .pomodoro-ad-slot { display:none!important; } }

/* A streamed document must never paint its provisional room geometry. */
html[data-pomodoro-layout-pending] body[data-pomodoro-app] .focus-room,
html[data-pomodoro-layout-pending] body[data-pomodoro-app] .focus-room * {
  visibility:hidden !important;
}

/* One mobile viewport budget: preserve every control and the native banner size. */
@media(max-width:760px) {
  body[data-pomodoro-app] {
    --pomo-mobile-viewport-height:100svh;
    --pomo-mobile-safe-bottom:env(safe-area-inset-bottom,0px);
    --pomo-mobile-space:clamp(0px,calc((var(--pomo-mobile-viewport-height) - 740px) * .1153846),12px);
    --pomo-mobile-tight-space:clamp(0px,calc((700px - var(--pomo-mobile-viewport-height)) * .6),42px);
  }
  @supports(height:100dvh) { body[data-pomodoro-app] { --pomo-mobile-viewport-height:100dvh; } }
  body[data-pomodoro-app]:not(.is-zen) .focus-room,
  body[data-pomodoro-app].is-zen .focus-room {
    height:var(--pomo-mobile-room-height,var(--pomo-mobile-viewport-height)) !important;
    min-height:0;max-height:none;
  }
  body[data-pomodoro-app] .pomodoro-dock-anchor { height:var(--pomo-mobile-room-height,var(--pomo-mobile-viewport-height)); }
  body[data-pomodoro-app]:not(.is-zen) .timer-center,
  body[data-pomodoro-app].is-zen .timer-center {
    top:var(--pomo-mobile-center-anchor,calc(var(--pomo-mobile-viewport-height) * .47 + 21px));
  }
  body[data-pomodoro-app] .pomodoro-ad-slot {
    top:var(--pomo-mobile-ad-top,calc(var(--pomo-mobile-viewport-height) - var(--pomo-ad-row-height) - 100px));
    height:var(--pomo-ad-row-height);
  }
  body[data-pomodoro-app]:not(.is-zen) .room-bottom,
  body[data-pomodoro-app].is-zen .room-bottom {
    top:var(--pomo-mobile-dock-top,calc(var(--pomo-mobile-ad-top,calc(var(--pomo-mobile-viewport-height) - var(--pomo-ad-row-height) - 100px)) + var(--pomo-ad-row-height) + 18px));
    bottom:auto;transform:none;
  }
  body[data-pomodoro-app]:not(.is-zen) .room-footnote,
  body[data-pomodoro-app].is-zen .room-footnote {
    top:var(--pomo-mobile-footnote-top,calc(var(--pomo-mobile-viewport-height) - 26px));
    bottom:auto;height:auto;margin-block:0;line-height:14px;
  }
  /* Interpolate the existing short/tall spacing instead of jumping at 740px. */
  body[data-pomodoro-app]:not(.is-zen) .room-headline {
    margin:calc(12px + var(--pomo-mobile-space) * .4166667) 0 calc(7px + var(--pomo-mobile-space) * .25 - var(--pomo-mobile-tight-space) * .0952381);
  }
  body[data-pomodoro-app]:not(.is-zen) .room-subtitle {
    margin:calc(8px + var(--pomo-mobile-space) * .3333333 - var(--pomo-mobile-tight-space) * .1190476) auto calc(14px + var(--pomo-mobile-space) - var(--pomo-mobile-tight-space) * .1904762);
  }
  body[data-pomodoro-app]:not(.is-zen) .time {
    margin:calc(8px + var(--pomo-mobile-space) * .5833333 - var(--pomo-mobile-tight-space) * .1190476) 0 calc(6px + var(--pomo-mobile-space) * .25 - var(--pomo-mobile-tight-space) * .0714286);
    line-height:clamp(1.1em,calc(1.1em + var(--pomo-mobile-space) * .875),1.2em);
  }
  body[data-pomodoro-app]:not(.is-zen) .timer-actions { margin-top:calc(14px + var(--pomo-mobile-space) * .9166667 - var(--pomo-mobile-tight-space) * .1428571); }
  body[data-pomodoro-app]:not(.is-zen) .session-progress { margin-top:calc(12px + var(--pomo-mobile-space) - var(--pomo-mobile-tight-space) * .0952381); }
}

/* L10N R21: the mobile subtitle is intentionally removed; keep timer progress and banner row. */
@media(max-width:760px){body[data-pomodoro-app] .room-subtitle{display:none!important}}
