/* ClearThemeDemo — phone frame + row styling. Fully immersive: no status bar. */

.ctd-phone-outer {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Honest layout box: the wrapper occupies exactly the phone's visual size at
   the current scale, so flex/grid centering is true and there is no phantom
   space around a transform-shrunk frame. 413×872 = 393×852 screen + 10px
   bezel on each side (content-box below). */
.ctd-phone-scale {
  width: calc(413px * var(--ctd-scale, 1));
  height: calc(872px * var(--ctd-scale, 1));
  transform: scale(var(--ctd-scale, 1));
  transform-origin: top left;
}

.ctd-phone {
  /* content-box so the SCREEN is the true 393×852 logical frame (the page's
     global border-box reset would otherwise shrink it to 373×832, off the
     app-fidelity contract). */
  box-sizing: content-box;
  width: 393px;
  height: 852px;
  background: #000;
  border-radius: 55px;
  padding: 10px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.ctd-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 45px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* Per-theme museum font may be applied inline by ClearThemeDemo.mount
     ({font}); never synthesize a fake bold for faces without one — mirrors
     the app, which falls back to the regular file. */
  font-synthesis: none;
}

.ctd-screen * {
  box-sizing: border-box;
}

.ctd-island {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 126px;
  height: 37px;
  background: #000;
  border-radius: 19px;
  z-index: 40;
}

.ctd-home-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 5px;
  border-radius: 3px;
  background-color: currentColor;
  z-index: 40;
  opacity: 0.92;
  /* Surface-independent backdrop: the JS-computed currentColor is only
     meaningful for opaque themes (image-backed themes' rowHeatMap.end is
     transparent, so that luminance signal is moot) — this outline+shadow
     keeps the bar legible against ANY photo underneath it either way. */
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 0 4px rgba(0, 0, 0, 0.3);
}

.ctd-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 146px;
  display: flex;
  align-items: flex-end;
  padding: 0 16px 14px 15px;
  z-index: 2;
}

.ctd-title {
  font-weight: 700;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

/* A thin grab strip at the very top seam of row 1 — narrow enough to leave
   the row's own tap/click target usable, wide enough to catch a deliberate
   pull-down-from-top gesture. */
.ctd-pull-zone {
  position: absolute;
  left: 0;
  right: 0;
  top: 146px;
  height: 14px;
  z-index: 10;
  touch-action: none;
  overscroll-behavior: contain;
}

.ctd-rows-viewport {
  position: absolute;
  left: 0;
  right: 0;
  top: 146px;
  bottom: 0;
  overflow: hidden;
  overscroll-behavior: contain;
}

.ctd-rows {
  position: relative;
}

.ctd-row {
  position: absolute;
  left: 0;
  right: 0;
  height: 72px;
  display: flex;
  align-items: center;
  padding-left: 15px;
  padding-right: 16px;
  font-weight: 600;
  font-size: 25px;
  line-height: 1.2;
  transition: top 0.35s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease, color 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  user-select: none;
}

.ctd-screen.ctd-reduced-motion .ctd-row {
  transition: none;
}

.ctd-row-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ctd-strike {
  position: absolute;
  left: 15px;
  right: 16px;
  top: calc(50% + 2px);
  height: 2.5px;
  border-radius: 1.5px;
  background: currentColor;
}

.ctd-row-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 130px;
  pointer-events: none;
  z-index: 5;
}

.ctd-ghost-row {
  position: relative;
  left: 0;
  right: 0;
  border-radius: 8px;
  margin: 0 8px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  transition: none;
}

.ctd-row:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: -2px;
}
