/* ==========================================================================
   3rd of September — Pure Minimalist Tear-Off Calendar
   Ultra-Fluid 3D Animations & Pure Touch Interaction
   ========================================================================== */

:root {
  /* Fonts */
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-text: 'PT Serif', Georgia, serif;
  --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Geometry & Proportions */
  --cal-width: min(88vw, 380px);
  --holder-height: clamp(42px, 6.5vh, 58px);
  --sheet-height: clamp(400px, 62vh, 520px);

  /* Light Theme */
  --bg-color: #f2eee6;
  --bg-radial: radial-gradient(circle at 50% 35%, #faf8f5 0%, #ebe5d8 100%);
  --ambient-glow: rgba(220, 180, 120, 0.16);

  --cal-shadow:
    0 20px 40px -10px rgba(70, 55, 40, 0.22),
    0 40px 70px -15px rgba(70, 55, 40, 0.18),
    0 1px 3px rgba(0, 0, 0, 0.08);

  --paper-bg: #faf7f0;
  --paper-gradient: linear-gradient(180deg, #fdfbf7 0%, #f7f3e8 45%, #ede6d5 100%);
  --paper-edge: #dcd4c3;
  --paper-stack: #cfc6b3;

  --ink-primary: #181614;
  --ink-secondary: #3b3732;
  --ink-accent: #963524;

  --metal-1: #c6cbd2;
  --metal-2: #eef2f7;
  --metal-3: #9ea5af;
  --metal-4: #6d7580;
  --metal-rim: #525963;

  --hint-bg: rgba(255, 255, 255, 0.65);
  --hint-border: rgba(0, 0, 0, 0.08);
  --hint-color: rgba(60, 55, 50, 0.65);
}

/* Dark Theme (Auto by system) */
body.theme-dark {
  --bg-color: #0c0e14;
  --bg-radial: radial-gradient(circle at 50% 30%, #161a25 0%, #08090d 100%);
  --ambient-glow: rgba(120, 100, 220, 0.12);

  --cal-shadow:
    0 25px 60px -10px rgba(0, 0, 0, 0.85),
    0 50px 100px -20px rgba(0, 0, 0, 0.95),
    0 0 35px rgba(255, 200, 140, 0.06);

  --paper-bg: #ece6da;
  --paper-gradient: linear-gradient(180deg, #f1ebe0 0%, #e9e2d3 45%, #ddd4c2 100%);
  --paper-edge: #b5ac9b;
  --paper-stack: #20232b;

  --ink-primary: #141210;
  --ink-secondary: #2f2a24;
  --ink-accent: #872e20;

  --metal-1: #6a707a;
  --metal-2: #9ba4af;
  --metal-3: #4b525d;
  --metal-4: #2f343d;
  --metal-rim: #1f2329;

  --hint-bg: rgba(20, 23, 32, 0.65);
  --hint-border: rgba(255, 255, 255, 0.09);
  --hint-color: rgba(220, 225, 240, 0.65);
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  touch-action: manipulation;
}

body {
  font-family: var(--font-text);
  background: var(--bg-color);
  background-image: var(--bg-radial);
  color: var(--ink-primary);
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 0.4s ease;
}

/* Viewport Shell */
.app-viewport {
  position: relative;
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(8px, env(safe-area-inset-top, 8px)) 12px max(10px, env(safe-area-inset-bottom, 10px));
  overflow: hidden;
  z-index: 1;
}

/* Ambient Backing Glow */
.ambient-backdrop {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translateX(-50%);
  width: min(80vw, 450px);
  height: 350px;
  background: radial-gradient(circle, var(--ambient-glow) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}

/* ==========================================================================
   Calendar Stage
   ========================================================================== */
.calendar-stage {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
}

.calendar-wrapper {
  position: relative;
  width: var(--cal-width);
  max-width: calc(100vw - 24px);
  margin-left: auto;
  margin-right: auto;
  perspective: 1400px;
  transform-style: preserve-3d;
}

/* --------------------------------------------------------------------------
   Top Metal Clamp (Brushed steel with mounting brackets)
   -------------------------------------------------------------------------- */
.metal-holder {
  position: relative;
  width: 100%;
  height: var(--holder-height);
  border-radius: 6px 6px 0 0;
  background:
    repeating-linear-gradient(90deg,
      rgba(255, 255, 255, 0.06) 0px,
      rgba(255, 255, 255, 0.06) 1px,
      transparent 1px,
      transparent 3px),
    linear-gradient(180deg,
      var(--metal-2) 0%,
      var(--metal-1) 16%,
      var(--metal-2) 34%,
      var(--metal-3) 70%,
      var(--metal-4) 100%);
  border: 1px solid var(--metal-rim);
  border-bottom: none;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.7),
    inset 0 -2px 3px rgba(0, 0, 0, 0.4),
    0 4px 10px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 5vw, 26px);
  z-index: 50;
}

/* Screw heads */
.screw {
  width: clamp(10px, 2.5vw, 13px);
  height: clamp(10px, 2.5vw, 13px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #a6acb5, #3c424a);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.8),
    0 1px 2px rgba(0, 0, 0, 0.6);
  position: relative;
}

.screw::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60%;
  height: 2px;
  background: #17181c;
  transform: translate(-50%, -50%) rotate(42deg);
}

.screw-right::after {
  transform: translate(-50%, -50%) rotate(-38deg);
}

/* Center Loop Bracket */
.metal-loop-bracket {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  width: clamp(96px, 27vw, 130px);
  height: clamp(22px, 5vw, 30px);
}

.loop-plate {
  width: clamp(20px, 5vw, 26px);
  height: clamp(20px, 5vw, 26px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #424650 0%, #17191d 75%, #0d0e10 100%);
  border: 1px solid #111215;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.35),
    0 2px 5px rgba(0, 0, 0, 0.65);
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.loop-plate::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(6px, 1.6vw, 9px);
  height: clamp(6px, 1.6vw, 9px);
  border-radius: 50%;
  background: #000000;
  transform: translate(-50%, -50%);
}

.metal-bar-bracket {
  flex: 1;
  height: clamp(8px, 2vw, 12px);
  background: linear-gradient(180deg, #3d414a 0%, #1d1e22 35%, #0f1013 80%, #24262c 100%);
  margin: 0 -6px;
  z-index: 1;
  border-radius: 5px;
  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.75),
    inset 0 1px 1px rgba(255, 255, 255, 0.35);
  position: relative;
  overflow: hidden;
}

.bar-shine {
  position: absolute;
  top: 15%;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 5%, rgba(255, 255, 255, 0.45) 50%, transparent 95%);
}

.metal-rim-shadow {
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, transparent 100%);
  pointer-events: none;
  z-index: 31;
}

/* Perforation seam */
.tear-perforation-guide {
  position: absolute;
  top: var(--holder-height);
  left: 4px;
  right: 4px;
  height: 4px;
  background-image: repeating-linear-gradient(90deg,
      rgba(0, 0, 0, 0.4) 0px,
      rgba(0, 0, 0, 0.4) 4px,
      transparent 4px,
      transparent 8px);
  z-index: 28;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Calendar Sheet & Paper Physics
   -------------------------------------------------------------------------- */
.calendar-sheet-container {
  position: relative;
  width: 100%;
  height: var(--sheet-height);
  background: var(--paper-bg);
  box-shadow: var(--cal-shadow);
  perspective: 1200px;
  -webkit-perspective: 1200px;
  border-radius: 0 0 3px 3px;
  cursor: pointer;
  touch-action: none;
  outline: none;
  overflow: visible !important;
}

.calendar-sheet {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transform-origin: top center;
  border-radius: 0 0 2px 2px;
  will-change: transform, opacity;
  overflow: visible !important;
}

.sheet-under {
  z-index: 1;
  visibility: hidden;
}

.sheet-active {
  z-index: 20;
}

/* Two-Sided 3D Paper Architecture */
.sheet-face {
  position: absolute;
  inset: 0;
  border-radius: 0 0 2px 2px;
  overflow: hidden;
}

.sheet-face-front {
  background: var(--paper-gradient);
  background-color: var(--paper-bg);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  z-index: 2;
}

.sheet-face-back {
  background: #ede4d2;
  background-image: 
    repeating-linear-gradient(0deg, rgba(60, 50, 40, 0.04) 0px, rgba(60, 50, 40, 0.04) 1px, transparent 1px, transparent 18px),
    radial-gradient(ellipse at 50% 50%, rgba(210, 190, 150, 0.25), transparent 80%);
  transform: rotateX(180deg);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.08);
}

.back-vintage-stamp {
  border: 2px dashed rgba(140, 50, 40, 0.45);
  padding: 12px 24px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transform: rotate(-4deg);
  color: rgba(140, 50, 40, 0.65);
}

.stamp-date {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.stamp-tagline {
  font-family: var(--font-text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Top jagged torn paper edge */
.sheet-perforated-edge {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background-color: inherit;
  mask-image: radial-gradient(circle 3px at 4px 0px, transparent 3px, black 3.5px);
  mask-size: 8px 6px;
  mask-repeat: repeat-x;
  -webkit-mask-image: radial-gradient(circle 3px at 4px 0px, transparent 3px, black 3.5px);
  -webkit-mask-size: 8px 6px;
  -webkit-mask-repeat: repeat-x;
  pointer-events: none;
  z-index: 5;
}

.sheet-paper-texture {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(230, 210, 170, 0.14), transparent 70%),
    radial-gradient(ellipse at 85% 90%, rgba(200, 180, 140, 0.1), transparent 60%),
    radial-gradient(ellipse at 15% 95%, rgba(200, 180, 140, 0.1), transparent 60%);
  pointer-events: none;
  z-index: 1;
}

/* ==========================================================================
   Harmonious Balanced Layout (Tight Hero Group, Zero Jumping)
   ========================================================================== */
.sheet-content {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: 14px 18px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  color: var(--ink-primary);
  overflow: hidden;
}

/* 1. Header (Fixed 52px Height for 100% Stability) */
.sheet-header {
  height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  flex-shrink: 0;
}

.sheet-year {
  font-family: var(--font-serif);
  font-size: clamp(17px, 3.2vw, 21px);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink-secondary);
}

.sheet-subtitle {
  font-family: var(--font-text);
  font-size: clamp(11.5px, 2.2vw, 13px);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: 0.01em;
  max-width: 96%;
  color: var(--ink-primary);
}

/* Countdown Display (Non-September 3rd days) */
.sheet-countdown-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  max-width: 96%;
  margin-top: 1px;
}

.countdown-label {
  font-family: var(--font-text);
  font-size: clamp(10px, 2vw, 12px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-accent);
}

.countdown-value {
  font-family: var(--font-text);
  font-size: clamp(11px, 2.1vw, 13px);
  font-weight: 700;
  color: var(--ink-primary);
  line-height: 1.25;
  letter-spacing: 0.01em;
}

/* 2. Middle Hero Section: Tightly Grouped, Bold, No Giant Gaps */
.sheet-center-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

.sheet-month {
  font-family: var(--font-display);
  font-size: clamp(21px, 4vw, 26px);
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-primary);
  margin: 0 0 6px 0;
}

.sheet-day-number-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  /* padding-bottom pushes ЧЕТВЕРГ clear of the physical glyph descender
     Playfair Display '3' at line-height 0.88 bleeds ~20% below the box */
  padding-bottom: 22px;
}

.sheet-day-number {
  font-family: var(--font-display);
  font-size: clamp(108px, 19.5vh, 140px);
  font-weight: 900;
  line-height: 1;
  color: var(--ink-primary);
  letter-spacing: -0.04em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  display: block;
}

.sheet-weekday {
  font-family: var(--font-display);
  font-size: clamp(15px, 3.2vw, 19px);
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-primary);
  margin: 0;
}

/* 3. Bottom Section: Fixed 122px Height */
.sheet-bottom-group {
  height: 122px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  flex-shrink: 0;
}

.sheet-astro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: var(--font-text);
  font-size: clamp(10.5px, 2.1vw, 12px);
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

.astro-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sun-symbol {
  color: var(--ink-accent);
  font-size: 1.1em;
}

.sheet-divider {
  width: 100%;
  height: 1px;
  background: var(--ink-light);
  opacity: 0.6;
  margin: 4px 0;
}

.sheet-footer {
  font-family: var(--font-text);
  font-size: clamp(10px, 2vw, 11.5px);
  line-height: 1.35;
  color: var(--ink-secondary);
  text-align: left;
}

.sheet-events-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sheet-events-list li {
  margin-bottom: 2px;
  color: var(--ink-secondary);
}

.sheet-events-list li strong {
  color: var(--ink-accent);
  font-weight: 700;
}

.sheet-events-list li em {
  font-style: italic;
  color: var(--ink-primary);
}

/* Dynamic Interactive Shadows & Highlights */
.sheet-curl-shadow {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(0deg, rgba(0,0,0,0.25) 0%, transparent 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.sheet-peel-highlight {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 60%);
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}

/* Paper depth block */
.paper-block-sides {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.paper-side-bottom {
  position: absolute;
  bottom: -9px;
  left: 2px;
  right: 2px;
  height: 9px;
  background: repeating-linear-gradient(
    0deg,
    var(--paper-edge) 0px,
    var(--paper-edge) 1px,
    #ffffff 1px,
    #ffffff 2px
  );
  border-radius: 0 0 4px 4px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.paper-side-left {
  position: absolute;
  top: var(--holder-height);
  bottom: -6px;
  left: -4px;
  width: 4px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.25), transparent);
}

.paper-side-right {
  position: absolute;
  top: var(--holder-height);
  bottom: -6px;
  right: -4px;
  width: 4px;
  background: linear-gradient(270deg, rgba(0, 0, 0, 0.25), transparent);
}

/* ==========================================================================
   True 3D Page Flip Animation (Visible Backside, Slides Behind Holder)
   ========================================================================== */
.sheet-active.flipping-over {
  animation: flipOverHolder 0.62s cubic-bezier(0.4, 0, 0.6, 1) forwards;
  z-index: 25;
}

/*
  OUTWARD flip: bottom peels UP and OVER toward the viewer.
  transform-origin: top center
  rotateX(+180deg) = bottom swings FORWARD, over the top.
  The metal-holder at z-index:50 clips the sheet behind it
  once the sheet rotates past ~150°.
*/
@keyframes flipOverHolder {
  0% {
    transform: rotateX(0deg) translateY(0px);
    opacity: 1;
  }
  30% {
    /* Peeling up, bottom swings toward viewer */
    transform: rotateX(55deg) translateY(-6px);
    opacity: 1;
  }
  55% {
    /* Sheet crosses vertical — back face shows. Gone immediately. */
    transform: rotateX(100deg) translateY(-20px);
    opacity: 0;
  }
  100% {
    transform: rotateX(180deg) translateY(-48px);
    opacity: 0;
  }
}

.sheet-under.reveal-sheet {
  animation: revealUnder 0.62s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

@keyframes revealUnder {
  0% {
    transform: scale(0.97) translateY(4px);
    filter: brightness(0.82);
    opacity: 0.8;
  }
  100% {
    transform: scale(1) translateY(0);
    filter: brightness(1);
    opacity: 1;
  }
}

/* ==========================================================================
   Minimalist Touch Hint
   ========================================================================== */
.touch-hint {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--hint-color);
  letter-spacing: 0.04em;
  margin-top: clamp(12px, 2.5vh, 22px);
  padding: 20px 50px;
  background: var(--hint-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--hint-border);
  border-radius: 9999px;
  opacity: 0.85;
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}

.hint-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-accent);
  box-shadow: 0 0 6px var(--ink-accent);
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {

  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.9);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.touch-hint.fade-out {
  opacity: 0;
  transform: translateY(8px);
}

/* Toast */
.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(70px);
  background: rgba(18, 20, 26, 0.95);
  color: #ffffff;
  padding: 8px 18px;
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 100;
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==========================================================================
   Flip Counter Widget
   ========================================================================== */
.flip-counter {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 7px 18px;
  background: var(--hint-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--hint-border);
  border-radius: 9999px;
  opacity: 0.75;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.flip-counter:hover {
  opacity: 1;
}

.flip-counter-item {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.flip-counter-value {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--hint-color);
  letter-spacing: 0.01em;
  min-width: 24px;
  text-align: right;
  transition: color 0.3s ease;
}

.flip-counter-value.updated {
  color: var(--ink-accent);
}

.flip-counter-label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  color: var(--hint-color);
  opacity: 0.7;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.flip-counter-divider {
  width: 1px;
  height: 20px;
  background: var(--hint-border);
  opacity: 0.8;
}

/* Mobile Viewport Optimization (< 480px width or < 760px height) */
@media (max-width: 480px),
(max-height: 760px) {
  :root {
    --cal-width: min(86vw, 340px);
    --holder-height: clamp(38px, 5.5vh, 44px);
    --sheet-height: calc(var(--cal-width) * 1.34);
  }

  .app-viewport {
    padding: max(8px, env(safe-area-inset-top, 8px)) 12px max(12px, env(safe-area-inset-bottom, 12px));
  }

  .sheet-content {
    padding: 12px 16px 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
  }

  .sheet-header {
    height: 48px;
  }

  .sheet-center-hero {
    flex: 1;
    margin: 0;
    padding: 0;
  }

  .sheet-bottom-group {
    height: 114px;
    gap: 2px;
  }

  .sheet-year {
    font-size: 16px;
  }

  .sheet-subtitle {
    font-size: 11px;
    line-height: 1.25;
  }

  .sheet-month {
    font-size: 19px;
    margin: 0 0 4px 0;
  }

  .sheet-day-number-wrap {
    padding-bottom: 16px;
  }

  .sheet-day-number {
    font-size: clamp(90px, 16.5vh, 112px);
  }

  .sheet-weekday {
    font-size: 14px;
    margin: 2px 0 0 0;
  }

  .sheet-astro {
    font-size: 9.5px;
    gap: 2px;
  }

  .sheet-divider {
    margin: 3px 0;
  }

  .sheet-footer {
    font-size: 9.5px;
    line-height: 1.3;
  }

  .sheet-events-list li {
    margin-bottom: 2px;
  }

  .touch-hint {
    margin-top: 10px;
    padding: 6px 16px;
    font-size: 11px;
  }
}

/* Extra Compact Screens (e.g. iPhone SE, 375x667) */
@media (max-height: 680px) {
  :root {
    --cal-width: min(86vw, 320px);
    --holder-height: 38px;
    --sheet-height: clamp(340px, 57vh, 410px);
  }

  .sheet-content {
    padding: 8px 14px;
  }

  .sheet-day-number {
    font-size: clamp(88px, 16vh, 108px);
    /* No translateY on compact screens */
  }

  .sheet-footer {
    font-size: 10px;
    line-height: 1.3;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

  .sheet-active.tearing-down,
  .sheet-under.reveal-sheet {
    animation: none !important;
    transition: opacity 0.25s ease !important;
  }
}