/* ═══════════════════════════════════════════════════════
   Ataraxia v1.3 — Layout styles
   touch: Focus Deck (≤900px tactile) | wide: base index.css
   ═══════════════════════════════════════════════════════ */

/* ── Touch layout tokens ─────────────────────────────── */
html[data-layout="touch"] {
  --ring-max: min(90vw, calc(100dvh - 17.5rem));
  --touch-glass: rgba(255, 255, 255, 0.38);
  --touch-glass-border: rgba(255, 255, 255, 0.18);
  --toolbar-offset: 8.75rem;
  --content-pad-top: max(9.5rem, calc(env(safe-area-inset-top, 0px) + var(--toolbar-offset)));
  --content-pad-bottom: max(7.5rem, calc(env(safe-area-inset-bottom, 0px) + 6.5rem));
  --scene-bar-offset: 4rem;
}

/* ── Scene bar ───────────────────────────────────────── */
.focus-scene-bar { display: none; }

html[data-layout="touch"] .focus-scene-bar {
  display: flex;
  position: fixed;
  left: 50%;
  bottom: max(0.55rem, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 120;
  width: var(--chrome-width);
  max-width: var(--chrome-width);
  box-sizing: border-box;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.3rem;
  border-radius: 20px;
  background: var(--chrome-surface-bg);
  border: 1px solid var(--chrome-surface-border);
  backdrop-filter: var(--chrome-surface-blur);
  -webkit-backdrop-filter: var(--chrome-surface-blur);
}

html[data-layout="touch"] .focus-scene-bar .scene-btn {
  flex: 1;
}

.scene-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: var(--scene-btn-pad, 0.45rem 1.1rem);
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}
.scene-btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
  opacity: 0.85;
  flex-shrink: 0;
}
.scene-btn.active {
  background: var(--accent);
  color: #1a1816;
  box-shadow: 0 3px 14px var(--accent-glow);
}
.scene-btn:not(.active):active { background: rgba(255, 255, 255, 0.1); }

/* ── Page scaffold (touch) ─────────────────────────── */
html[data-layout="touch"] .page-layout { justify-content: stretch; }

html[data-layout="touch"] .content:has(.is-minimized) {
  justify-content: flex-start;
}

html[data-layout="touch"] .content {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: var(--content-pad-top) 0.75rem var(--content-pad-bottom);
  gap: 0.35rem;
  align-items: stretch;
  justify-content: center;
}

html[data-layout="touch"][data-scene="timer"] .quote-card { display: none !important; }
html[data-layout="touch"][data-scene="quote"] .pomo-container { display: none !important; }

/* ── Timer scene ───────────────────────────────────── */
html[data-layout="touch"] .pomo-container {
  flex: 1 1 auto;
  width: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  animation: pomoEnter var(--ui-enter-dur) var(--ui-enter-ease) var(--ui-delay-pomo) both;
}
html[data-layout="touch"] .pomo-widget {
  width: min(100%, 380px);
  height: auto;
  max-width: none;
  max-height: min(68dvh, 480px);
  border-radius: 24px;
  padding: 0.95rem 1.05rem 0.85rem;
  gap: 0.45rem;
  justify-content: center;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
}
html[data-layout="touch"] .pomo-widget .pomo-ring-wrapper {
  flex: 0 0 auto;
  aspect-ratio: 1;
  width: min(var(--ring-max), 72vw, 300px);
  height: min(var(--ring-max), 72vw, 300px);
  max-width: 100%;
  margin: 0 auto;
  align-self: center;
  cursor: pointer;
}
html[data-layout="touch"] .pomo-widget .pomo-time-inside {
  font-size: var(--pomo-time-size, clamp(3rem, 16vw, 4.8rem));
}
html[data-layout="touch"] .pomo-widget .pomo-time-unit {
  font-size: var(--pomo-unit-size, clamp(1rem, 4.5vw, 1.4rem));
}
html[data-layout="touch"] .pomo-widget .pomo-label {
  font-size: var(--pomo-label-size, clamp(0.65rem, 2.8vw, 0.82rem));
}
html[data-layout="touch"] .pomo-widget .pomo-controls {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
  gap: 0.75rem;
  margin-top: 0.15rem;
  padding-bottom: 0.1rem;
}
html[data-layout="touch"] .pomo-widget .pomo-btn,
html[data-layout="touch"] .pomo-fullpage-overlay .pomo-btn,
html[data-layout="touch"] .pomo-corner-btn { touch-action: manipulation; }
html[data-layout="touch"] .pomo-widget .pomo-dot { width: 8px; height: 8px; }
html[data-layout="touch"] .pomo-widget .pomo-dots { gap: 6px; }
html[data-layout="touch"] .pomo-fullscreen-btn,
html[data-layout="touch"] .panel-minimize-btn {
  top: 0.5rem;
}

html[data-layout="touch"] .pomo-settings {
  position: fixed;
  top: 50%;
  bottom: auto;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100vw - 1.25rem);
  max-width: 400px;
  z-index: 530;
  max-height: min(72dvh, 440px);
  padding: 1.1rem 1.15rem 1.2rem;
  animation: settingsInTouch 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes settingsInTouch {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 8px)); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}
html[data-layout="touch"] .pomo-settings .setting-row input[type="number"] {
  min-height: 40px;
  width: 68px;
  font-size: 1rem;
}
html[data-layout="touch"] .pomo-settings .phase-chip { min-height: 40px; }

/* ── Quote scene ─────────────────────────────────────── */
html[data-layout="touch"] .quote-card {
  flex: 1;
  width: 100%;
  max-height: none;
  margin: 0;
  padding: 1.2rem 1rem 1rem;
  border-radius: 20px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.1);
  animation: cardEnter var(--ui-enter-dur) var(--ui-enter-ease) var(--ui-delay-quote) both;
  display: flex;
  flex-direction: column;
}
html[data-layout="touch"] .quote-inner {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  max-height: none;
}
html[data-layout="touch"] .quote-body {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  justify-content: center;
}
html[data-layout="touch"] .quote-text {
  font-size: var(--quote-text-size, clamp(1.3rem, 5.5vw, 1.7rem));
  line-height: 1.5;
}
html[data-layout="touch"] .quote-author {
  font-size: clamp(0.68rem, 2.8vw, 0.82rem);
  margin-top: 0.5rem;
}
html[data-layout="touch"] .quote-action-row {
  flex-shrink: 0;
  gap: 0.5rem;
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: stretch;
}
html[data-layout="touch"] .quote-action-row .btn {
  flex: 1 1 calc(50% - 0.25rem);
  min-height: 44px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  padding: 0.5rem 0.65rem;
}

/* ── Credits (touch) — au-dessus de la barre scène ─── */
html[data-layout="touch"] .bottom-badges {
  bottom: calc(var(--credits-bottom) + var(--scene-bar-offset));
}

/* ── Tablet tactile density (601px+) ─────────────────── */
@media (min-width: 601px) and (hover: none) {
  html[data-layout="touch"] {
    --ring-max: min(70vw, calc(100dvh - 12rem));
    --scene-btn-pad: 0.55rem 1.4rem;
    --quote-text-size: clamp(1.35rem, 3.4vw, 1.8rem);
    --content-pad-top: max(3.75rem, calc(env(safe-area-inset-top, 0px) + 3.25rem));
    --content-pad-bottom: max(7rem, calc(env(safe-area-inset-bottom, 0px) + 6rem));
  }
  html[data-layout="touch"] .quote-card {
    padding: 1.5rem 1.5rem 1.25rem;
  }
  html[data-layout="touch"] .pomo-settings {
    max-width: 420px;
  }
}

/* Téléphone étroit (iPhone) : garder les deux actions côte à côte, en plus
   compact — empilées pleine largeur, elles dominaient la carte citation. */
@media (max-width: 400px) {
  html[data-layout="touch"] .quote-action-row {
    gap: 0.4rem;
    margin-top: 0.5rem;
  }
  html[data-layout="touch"] .quote-action-row .btn {
    flex: 1 1 calc(50% - 0.2rem);
    min-height: 40px;
    font-size: 0.6rem;
    letter-spacing: 0.06em;
    padding: 0.4rem 0.55rem;
    white-space: nowrap;
  }
}

@media (max-width: 360px) {
  html[data-layout="touch"] {
    --ring-max: min(88vw, calc(100dvh - 16.5rem));
  }
  html[data-layout="touch"] .scene-btn span { display: none; }
  html[data-layout="touch"] .scene-btn { padding: 0.45rem 0.8rem; min-width: 44px; }
}

@media (prefers-color-scheme: dark) {
  html[data-theme="dark"][data-layout="touch"] {
    --touch-glass: rgba(30, 28, 26, 0.55);
    --touch-glass-border: rgba(255, 255, 255, 0.1);
  }
  html[data-layout="touch"] .scene-btn.active { color: #1a1816; }
}

@media (max-width: 430px) {
  html[data-layout="wide"] .pomo-settings {
    width: calc(100vw - 1.25rem);
    max-width: 400px;
    padding: 1.1rem 1.15rem 1.2rem;
  }
}

/* ── Wide layout : pomo en haut, citation en bas (ordi — plus présent, sans clipping) ── */

html[data-layout="wide"] .content:has(.is-minimized) {
  justify-content: flex-start;
}

/* Crédits : règle de secours placée après les layouts afin de rester une
   pastille centrée, y compris lorsqu'une règle responsive est ajoutée. */
.bottom-badges {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: var(--credits-bottom);
  width: var(--chrome-width);
  max-width: var(--chrome-width);
  box-sizing: border-box;
  margin-inline: auto;
  padding: var(--credits-pad-y) var(--credits-pad-x);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--credits-gap);
  text-align: center;
  color: var(--credits-text);
  font: 300 var(--credits-font-size)/1.35 var(--font-body);
  text-shadow: var(--credits-text-shadow);
  background: var(--chrome-surface-bg);
  border: 1px solid var(--chrome-surface-border);
  border-radius: 20px;
  backdrop-filter: var(--chrome-surface-blur);
  -webkit-backdrop-filter: var(--chrome-surface-blur);
  transform: none;
}

@media (orientation: portrait) {
  .bottom-badges .img-credit {
    flex-basis: 100%;
    max-width: 100%;
    white-space: normal;
  }
  .bottom-badges .img-credit + .credits-divider { display: none; }
}

html[data-layout="wide"] .content {
  justify-content: center;
  align-items: stretch;
  gap: clamp(0.65rem, 1.6dvh, 1rem);
  max-width: min(620px, calc(100vw - 2rem));
  padding-top: var(--content-pad-top);
  padding-bottom: max(3.5rem, calc(env(safe-area-inset-bottom, 0px) + 2.75rem));
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}

html[data-layout="wide"] .pomo-container {
  flex: 0 0 auto;
  min-height: 0;
  max-height: min(40dvh, 320px);
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: 0;
  overflow: visible;
  animation-delay: var(--ui-delay-pomo);
}

/* Citation seule réduite : le timer occupe bien l’espace disponible */
html[data-layout="wide"] .content:has(.quote-card.is-minimized):not(:has(.pomo-container.is-minimized)) .pomo-container {
  flex: 1 1 auto;
  max-height: min(62dvh, 440px);
  min-height: 0;
  align-self: stretch;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Les deux réduits (wide) : pomo haut, citation bas */
html[data-layout="wide"] .content:has(.pomo-container.is-minimized):has(.quote-card.is-minimized) {
  justify-content: flex-start;
  gap: 0.4rem;
}

html[data-layout="wide"] .content:has(.pomo-container.is-minimized):has(.quote-card.is-minimized) .quote-card {
  margin-top: auto !important;
}

html[data-layout="wide"] .pomo-settings {
  position: fixed;
  top: 50%;
  bottom: auto;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(320px, calc(100vw - 1.25rem));
  max-height: min(70dvh, 440px);
  overflow-y: auto;
  z-index: 530;
  animation: settingsInWide 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes settingsInWide {
  from { opacity: 0; transform: translate(-50%, calc(-50% - 6px)); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}

html[data-layout="wide"] .pomo-widget {
  width: 100%;
  max-width: min(320px, 100%);
  height: auto;
  max-height: 100%;
  padding: 0.95rem 1.15rem 0.85rem;
  gap: 0.42rem;
  justify-content: center;
  border-radius: 24px;
}

html[data-layout="wide"] .content:has(.quote-card.is-minimized):not(:has(.pomo-container.is-minimized)) .pomo-widget {
  max-width: min(400px, 100%);
  max-height: min(60dvh, 420px);
  width: 100%;
}

html[data-layout="wide"] .pomo-widget .pomo-ring-wrapper {
  flex: 0 0 auto;
  width: clamp(152px, 24dvh, 208px);
  height: clamp(152px, 24dvh, 208px);
  max-width: 100%;
  margin: 0 auto;
}

html[data-layout="wide"] .content:has(.quote-card.is-minimized):not(:has(.pomo-container.is-minimized)) .pomo-widget .pomo-ring-wrapper {
  width: clamp(180px, 30dvh, 250px);
  height: clamp(180px, 30dvh, 250px);
}

html[data-layout="wide"] .pomo-widget .pomo-time-inside {
  font-size: clamp(2.15rem, 5.5dvh, 2.9rem);
}

html[data-layout="wide"] .pomo-widget .pomo-time-unit {
  font-size: clamp(0.9rem, 2.3dvh, 1.1rem);
}

html[data-layout="wide"] .pomo-widget .pomo-label {
  font-size: 0.64rem;
}

html[data-layout="wide"] .pomo-widget .pomo-controls {
  gap: 0.55rem;
  margin-top: 0.15rem;
}

html[data-layout="wide"] .quote-card {
  flex: 1 1 auto;
  min-height: min(22dvh, 168px);
  max-height: min(36dvh, 290px);
  padding: clamp(1.1rem, 2.8dvh, 1.65rem) clamp(1.15rem, 3vw, 2rem);
  animation-delay: var(--ui-delay-quote);
}

html[data-layout="wide"] .quote-inner {
  gap: clamp(0.55rem, 1.5dvh, 0.9rem);
}

html[data-layout="wide"] .quote-body {
  gap: clamp(0.45rem, 1.2dvh, 0.7rem);
}

html[data-layout="wide"] .quote-mark {
  font-size: clamp(1.25rem, 3.5dvh, 1.75rem);
}

html[data-layout="wide"] .quote-text {
  font-size: clamp(0.98rem, 2.2dvh, 1.28rem);
  line-height: 1.48;
}

html[data-layout="wide"] .quote-author {
  font-size: clamp(0.62rem, 1.6dvh, 0.78rem);
}

html[data-layout="wide"] .quote-action-row {
  padding-top: clamp(0.15rem, 0.5dvh, 0.35rem);
}

html[data-layout="wide"] .quote-action-row .btn {
  padding: 0.5rem 1.15rem;
  font-size: 0.7rem;
  min-height: 40px;
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.07);
}

html[data-layout="wide"] .quote-action-row .btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
}



/* Tablette paysage / petit viewport en wide — reprend un cran, sans trop tasser le timer */
@media (max-height: 720px) and (min-width: 601px) {
  html[data-layout="wide"] .content {
    padding-top: clamp(2.75rem, 5dvh, 3.25rem);
    gap: 0.5rem;
  }
  html[data-layout="wide"] .pomo-container {
    max-height: min(34dvh, 250px);
  }
  html[data-layout="wide"] .pomo-widget {
    max-width: min(280px, 100%);
    padding: 0.8rem 1rem 0.72rem;
  }
  html[data-layout="wide"] .pomo-widget .pomo-ring-wrapper {
    width: clamp(128px, 20dvh, 168px);
    height: clamp(128px, 20dvh, 168px);
  }
  html[data-layout="wide"] .pomo-widget .pomo-time-inside {
    font-size: clamp(1.95rem, 5dvh, 2.5rem);
  }
  html[data-layout="wide"] .quote-card {
    min-height: min(20dvh, 150px);
    max-height: min(34dvh, 250px);
  }
  html[data-layout="wide"] .quote-text {
    font-size: clamp(0.98rem, 2.4dvh, 1.28rem);
  }
}

/* ── Téléphone (≤720px) : largeur chrome, pomo + quote 50/50 ─── */
@media (max-width: 720px) {
  .top-right-actions .lang-btn span {
    display: none;
  }

  .top-right-actions .lang-btn {
    padding: 0.42rem;
    gap: 0;
  }

  html[data-layout="touch"] .focus-scene-bar,
  html[data-layout="wide"] .focus-scene-bar {
    display: none !important;
  }

  html[data-layout="touch"] .bottom-badges,
  html[data-layout="wide"] .bottom-badges {
    bottom: var(--credits-bottom);
  }

  html[data-layout="touch"][data-scene="timer"] .quote-card,
  html[data-layout="touch"][data-scene="quote"] .pomo-container {
    display: flex !important;
  }

  html[data-layout="touch"] .content:has(.is-minimized),
  html[data-layout="wide"] .content:has(.is-minimized) {
    justify-content: flex-start !important;
    align-items: center;
    flex: 1 1 0;
    min-height: 0;
  }

  html[data-layout="touch"] .content,
  html[data-layout="wide"] .content {
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
    padding-top: var(--content-pad-top);
    padding-bottom: var(--content-pad-bottom);
    gap: 0.35rem;
    align-items: center;
    justify-content: stretch;
    overflow: hidden;
  }

  html[data-layout="touch"] .pomo-container.is-minimized,
  html[data-layout="wide"] .pomo-container.is-minimized,
  html[data-layout="touch"] .quote-card.is-minimized,
  html[data-layout="wide"] .quote-card.is-minimized {
    width: var(--pill-max-width) !important;
    max-width: var(--pill-max-width) !important;
    align-self: center;
  }

  html[data-layout="touch"] .quote-card.is-minimized,
  html[data-layout="wide"] .quote-card.is-minimized {
    padding: 0 !important;
    margin-bottom: 0;
  }

  html[data-layout="touch"] .pomo-container.is-minimized .panel-restore-chip,
  html[data-layout="wide"] .pomo-container.is-minimized .panel-restore-chip,
  html[data-layout="touch"] .quote-card.is-minimized .panel-restore-chip,
  html[data-layout="wide"] .quote-card.is-minimized .panel-restore-chip {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Citation réduite : --content-pad-bottom (JS) = crédits + même gap 10px que menu↔pomo */

  html[data-layout="touch"] .pomo-container,
  html[data-layout="wide"] .pomo-container {
    flex: 1 1 0;
    min-height: 0;
    width: var(--chrome-width);
    max-width: var(--chrome-width);
    max-height: none;
    margin: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
  }

  /* Mode tablette/ordi : anneau compact si overflow (js → data-pomo-scale="wide") */
  html[data-pomo-scale="wide"] .pomo-container {
    align-items: center;
  }

  html[data-pomo-scale="wide"] .pomo-widget {
    width: 100%;
    max-width: min(272px, 100%);
    height: auto;
    max-height: 100%;
    min-height: 0;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: inherit;
    padding: 0.8rem 1rem 0.72rem;
    gap: 0.35rem;
    justify-content: center;
    border-radius: 22px;
    box-sizing: border-box;
  }

  html[data-pomo-scale="wide"] .pomo-widget .pomo-ring-wrapper {
    flex: 0 0 auto;
    width: clamp(128px, 20dvh, 172px);
    height: clamp(128px, 20dvh, 172px);
    max-width: 100%;
    margin: 0 auto;
    overflow: visible;
  }

  html[data-pomo-scale="wide"] .pomo-widget .pomo-center {
    inset: 0;
    gap: 0.1rem;
    overflow: visible;
    padding: 0;
  }

  html[data-pomo-scale="wide"] .pomo-widget .pomo-controls {
    gap: 0.45rem;
    margin-top: 0.1rem;
    padding-bottom: 0;
  }

  /* Échelle dynamique --pw-base (js/pomo.js syncWidgetScale), mêmes ratios que plein écran */
  html:not([data-pomo-scale="wide"]) .pomo-widget {
    --pw-base: 12px;
    font-size: var(--pw-base);
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: none;
    min-height: 0;
    flex: 1;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto auto;
    align-items: center;
    justify-items: center;
    gap: 0.55em;
    padding: 0.75em 0.85em 1.15em;
    border-radius: 20px;
    box-sizing: border-box;
    overflow: hidden;
  }

  html:not([data-pomo-scale="wide"]) .pomo-widget .pomo-ring-wrapper {
    grid-row: 1;
    place-self: center;
    flex: unset;
    min-height: 0;
    min-width: 0;
    width: min(28em, 100%);
    height: min(28em, 100%);
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 1;
    margin: 0;
    overflow: hidden;
  }

  html:not([data-pomo-scale="wide"]) .pomo-widget .pomo-ring-bg,
  html:not([data-pomo-scale="wide"]) .pomo-widget .pomo-ring-progress {
    stroke-width: 0.55em;
  }

  html:not([data-pomo-scale="wide"]) .pomo-widget .pomo-center {
    inset: 13%;
    gap: 0.04em;
    overflow: hidden;
    padding: 0 0.08em;
    box-sizing: border-box;
  }

  html:not([data-pomo-scale="wide"]) .pomo-widget .pomo-label {
    font-size: 1.65em;
    letter-spacing: 0.11em;
    max-width: 100%;
  }

  html:not([data-pomo-scale="wide"]) .pomo-widget .pomo-time-inside {
    font-size: 6.75em;
    line-height: 1;
    max-width: 100%;
  }

  html:not([data-pomo-scale="wide"]) .pomo-widget .pomo-time-unit {
    font-size: 0.34em;
  }

  html:not([data-pomo-scale="wide"]) .pomo-widget .pomo-dots {
    gap: 0.38em;
    margin-top: 0.12em;
    flex-shrink: 0;
  }

  html:not([data-pomo-scale="wide"]) .pomo-widget .pomo-dot {
    width: 0.95em;
    height: 0.95em;
  }

  html:not([data-pomo-scale="wide"]) .pomo-widget .pomo-controls {
    grid-row: 3;
    flex-shrink: 0;
    gap: 1.1em;
    margin-top: 0.2em;
    padding-bottom: 0.35em;
  }

  html:not([data-pomo-scale="wide"]) .pomo-widget .pomo-btn--primary,
  html:not([data-pomo-scale="wide"]) .pomo-widget .pomo-btn--secondary {
    width: 4.2em;
    height: 4.2em;
    min-width: 4.2em;
    min-height: 4.2em;
  }

  html:not([data-pomo-scale="wide"]) .pomo-widget .pomo-btn--primary svg,
  html:not([data-pomo-scale="wide"]) .pomo-widget .pomo-btn--secondary svg {
    width: 1.75em;
    height: 1.75em;
  }

  html:not([data-pomo-scale="wide"]) .pomo-widget .pomo-phase-ready-label {
    grid-row: 2;
    font-size: 1.5em;
    width: 28em;
    max-width: 100%;
  }

  /* Citation seule réduite : le timer remplit l’espace utile (anneau plus grand) */
  html:not([data-pomo-scale="wide"]) .content:has(.quote-card.is-minimized):not(:has(.pomo-container.is-minimized)) .pomo-container {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    align-items: center;
    justify-content: center;
  }

  html:not([data-pomo-scale="wide"]) .content:has(.quote-card.is-minimized):not(:has(.pomo-container.is-minimized)) .pomo-widget {
    flex: 1 1 auto;
    width: min(100%, var(--chrome-width, 100%));
    height: auto;
    max-height: min(78%, 34rem);
    min-height: min(52%, 18rem);
    grid-template-rows: minmax(0, 1fr) auto auto;
    align-content: center;
    justify-items: center;
    gap: 0.45em;
    padding: 0.85em 0.9em 1em;
  }

  html:not([data-pomo-scale="wide"]) .content:has(.quote-card.is-minimized):not(:has(.pomo-container.is-minimized)) .pomo-widget .pomo-ring-wrapper {
    width: min(28em, 78%, 52dvh);
    height: auto;
    max-width: 100%;
    max-height: min(52dvh, 20rem);
    aspect-ratio: 1;
  }

  html:not([data-pomo-scale="wide"]) .content:has(.quote-card.is-minimized):not(:has(.pomo-container.is-minimized)) .pomo-widget .pomo-controls {
    grid-row: auto;
    margin-top: 0;
    padding-bottom: 0.1em;
  }

  /* Les deux réduits (téléphone) : pomo haut, citation bas */
  html[data-layout="touch"] .content:has(.pomo-container.is-minimized):has(.quote-card.is-minimized),
  html[data-layout="wide"] .content:has(.pomo-container.is-minimized):has(.quote-card.is-minimized) {
    justify-content: flex-start !important;
    gap: 0.35rem;
  }

  html[data-layout="touch"] .content:has(.pomo-container.is-minimized):has(.quote-card.is-minimized) .quote-card,
  html[data-layout="wide"] .content:has(.pomo-container.is-minimized):has(.quote-card.is-minimized) .quote-card {
    margin-top: auto !important;
  }

  /* Pomo seul réduit (téléphone) : citation remplit sous le chip jusqu’aux crédits */
  html[data-layout="touch"] .content:has(.pomo-container.is-minimized):not(:has(.quote-card.is-minimized)) .quote-card,
  html[data-layout="wide"] .content:has(.pomo-container.is-minimized):not(:has(.quote-card.is-minimized)) .quote-card {
    flex: 1 1 auto !important;
    width: var(--chrome-width) !important;
    max-width: var(--chrome-width) !important;
    max-height: none !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    align-self: center;
  }

  html[data-layout="touch"] .quote-card,
  html[data-layout="wide"] .quote-card {
    flex: 1 1 0;
    min-height: 0;
    width: var(--chrome-width);
    max-width: var(--chrome-width);
    max-height: none;
    margin: 0;
    border-radius: 20px;
    padding: 1rem 1rem 0.9rem;
  }

}

/* ── Révélation au démarrage ──────────────────────────────────────────────
 *
 * `data-layout` est posé avant le premier rendu par js/layout-boot.js : les
 * proportions sont donc justes d'emblée. Restent les décalages mesurés sur le
 * DOM (--toolbar-offset, --content-pad-*), qu'aucun script ne peut connaître
 * avant peinture : le contenu les attend derrière un fondu de 180 ms, levé par
 * updateChromeInsets() à la première frame mesurée.
 *
 * Le fond n'est PAS masqué : la photo s'installe tout de suite, seule l'UI
 * arrive en fondu. Et seul le JS masque — un JS en panne ne peut donc pas
 * laisser une page vide (filet de 1,5 s dans layout-boot.js).
 */
.page-layout,
.top-right-actions {
  transition: opacity 180ms ease;
}
html[data-booting] .page-layout,
html[data-booting] .top-right-actions {
  opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
  .page-layout,
  .top-right-actions { transition: none; }
  html[data-booting] .page-layout,
  html[data-booting] .top-right-actions { opacity: 1; }
}
