    :root {
      --bg: rgba(255, 255, 255, 0.22);
      --ground: #d4c9bb;
      --surface: rgba(255, 255, 255, 0.34);
      --surface-solid: #ffffff;
      --text: #000000;
      --text-secondary: #000000;
      --accent: #a51c34;
      --complete: #1f7a38;
      --danger: #ff3b30;
      --border: #d1d1d6;
      --safe-top: env(safe-area-inset-top, 0px);
      --safe-bottom: env(safe-area-inset-bottom, 0px);
      --chrome: #F3F0F2;
    }

    @media (prefers-color-scheme: dark) {
      :root {
        --chrome: #545354;
      }
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    html, body {
      height: 100%;
      width: 100%;
      max-width: 100%;
      min-width: 0;
      background: var(--chrome);
      touch-action: manipulation;
    }

    body {
      font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
      background: var(--chrome);
      color: var(--text);
      -webkit-font-smoothing: antialiased;
      overflow: hidden;
    }

    .app {
      position: relative;
      display: flex;
      flex-direction: column;
      height: 100%;
      width: 100%;
      max-width: 430px;
      margin: 0 auto;
      background: var(--chrome);
      overflow: hidden;
      min-width: 0;
      border-radius: 24px 24px 0 0;
    }

    html.is-reloading,
    html.is-reloading body,
    .app.is-reloading {
      background: #ffffff;
    }

    .landscape-cover {
      position: fixed;
      inset: 0;
      z-index: 400;
      background: #000;
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
    }

    .landscape-cover img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center;
    }

    .landscape-caption {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0;
      min-height: 64px;
      padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
      background: rgba(0, 0, 0, 0.55);
      color: #fff;
      font-size: 16px;
      font-weight: 600;
      line-height: 1.35;
      text-align: center;
    }

    .landscape-caption[hidden] {
      display: none;
    }

    @media (orientation: landscape) and (hover: none) and (pointer: coarse) {
      .landscape-cover {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
      }
    }

    .companion-stage {
      position: absolute;
      inset: 0;
      z-index: 0;
      overflow: hidden;
      pointer-events: none;
      background: var(--chrome);
      border-radius: 24px 24px 0 0;
      opacity: 0;
    }

    .app.companion-ready .companion-stage {
      opacity: 1;
    }

    .app.companion-revealing .companion-stage {
      transition: opacity 0.4s ease;
    }

    .companion-still {
      position: absolute;
      inset: 0;
      z-index: 2;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center 8%;
      transition: opacity 0.4s ease;
    }

    .companion-still.is-swapped {
      opacity: 0;
    }

    .companion-clip {
      position: absolute;
      inset: 0;
      z-index: 1;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center 8%;
      opacity: 0;
      pointer-events: none;
    }

    .companion-clip.is-active {
      z-index: 2;
      opacity: 1;
    }

    #companion-celebrate.is-active {
      z-index: 3;
    }

    #companion-celebrate.is-active.is-fading {
      opacity: 0;
      transition: opacity 0.7s ease;
    }

    .companion-spacer {
      flex: 1 1 auto;
      min-height: 0;
    }

    .app:not([data-tab="entry"]) .companion-dev {
      display: none;
    }

    .icon-btn {
      position: absolute;
      top: calc(10px + var(--safe-top));
      z-index: 10;
      width: 44px;
      height: 44px;
      border: none;
      border-radius: 22px;
      background: rgba(255, 255, 255, 0.82);
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      color: #000;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      -webkit-tap-highlight-color: transparent;
    }

    .refresh-btn {
      right: 12px;
    }

    .icon-btn:disabled {
      pointer-events: none;
    }

    .peek-btn {
      top: calc(10px + var(--safe-top) + 52px);
      right: 12px;
    }

    .icon-btn svg {
      width: 22px;
      height: 22px;
      fill: currentColor;
    }

    .peek-icon-show {
      display: none;
    }

    .app.ui-hidden .peek-icon-hide {
      display: none;
    }

    .app.ui-hidden .peek-icon-show {
      display: block;
    }

    .app.ui-hidden .icon-btn {
      background: rgba(255, 255, 255, 0.72);
    }

    .app.ui-hidden .content,
    .app.ui-hidden .companion-dev {
      display: none;
    }

    .companion-dev {
      position: relative;
      z-index: 2;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 6px;
      padding: 8px 64px 8px 16px;
      background: rgba(255, 255, 255, 0.88);
      border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
    }

    .companion-dev[hidden] {
      display: none;
    }

    .companion-dev-label {
      font-size: 11px;
      font-weight: 600;
      color: var(--text-secondary);
      margin-right: 4px;
    }

    .companion-dev button {
      font-family: inherit;
      font-size: 11px;
      font-weight: 600;
      padding: 5px 8px;
      border: none;
      border-radius: 8px;
      background: var(--bg);
      color: var(--accent);
      cursor: pointer;
    }

    .content {
      position: relative;
      z-index: 1;
      flex: 1;
      min-width: 0;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      touch-action: pan-y;
      background: transparent;
      padding: calc(12px + var(--safe-top)) 16px calc(20px + var(--safe-bottom));
    }

    .app.is-reloading .content,
    .app.is-reloading .icon-btn,
    .app.is-reloading .companion-dev {
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.4s ease;
    }

    .tab-panel {
      display: none;
      position: relative;
      left: 0;
    }

    .tab-panel.active {
      display: block;
      animation: page-in 0.22s ease;
    }

    #tab-entry.tab-panel.active,
    #tab-card.tab-panel.active {
      display: flex;
      flex-direction: column;
      flex: 1;
      min-height: 0;
    }

    @keyframes page-in {
      from {
        left: var(--page-dx, 0px);
      }
      to {
        left: 0;
      }
    }

    .note-card {
      margin-top: auto;
      flex: 0 0 60%;
      min-height: 0;
      display: flex;
      flex-direction: column;
      gap: 10px;
      padding: 14px 14px 12px;
      background: var(--surface);
      border-radius: 12px;
      box-shadow: 0 8px 24px rgba(28, 20, 18, 0.12);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
    }

    .note-day-label {
      font-size: 13px;
      font-weight: 600;
      color: var(--text-secondary);
      flex-shrink: 0;
    }

    .note-card textarea {
      flex: 1;
      min-height: 0;
      width: 100%;
      border: none;
      border-radius: 10px;
      padding: 12px;
      background: rgba(255, 255, 255, 0.5);
      color: var(--text);
      font-family: inherit;
      font-size: 17px;
      line-height: 1.4;
      resize: none;
      overflow-y: auto;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
      -webkit-overflow-scrolling: touch;
    }

    .note-card textarea:focus {
      outline: 2px solid rgba(165, 28, 52, 0.35);
      outline-offset: -2px;
    }

    .note-card .btn {
      width: 100%;
      flex: none;
    }

    .date-nav {
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: var(--surface);
      border-radius: 12px;
      padding: 12px 8px;
      margin-bottom: 10px;
      flex-shrink: 0;
      box-shadow: 0 8px 24px rgba(28, 20, 18, 0.12);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
    }

    .date-nav-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 44px;
      height: 44px;
      border: none;
      background: none;
      color: var(--accent);
      cursor: pointer;
      border-radius: 8px;
      -webkit-tap-highlight-color: transparent;
    }

    .date-nav-btn:disabled {
      color: var(--border);
      cursor: default;
    }

    .date-nav-btn:not(:disabled):active {
      background: rgba(165, 28, 52, 0.1);
    }

    .date-nav-btn svg {
      width: 22px;
      height: 22px;
      fill: currentColor;
    }

    .date-display {
      text-align: center;
      flex: 1;
      padding: 4px;
      appearance: none;
      border: none;
      background: none;
      color: inherit;
      font-family: inherit;
      cursor: pointer;
      border-radius: 8px;
      -webkit-tap-highlight-color: transparent;
    }

    .date-display:active {
      background: rgba(165, 28, 52, 0.1);
    }

    .date-display .date-primary,
    .date-display .date-secondary {
      display: block;
    }

    .date-display .date-metrics {
      display: flex;
    }

    .date-display .date-primary {
      font-size: 17px;
      font-weight: 600;
      letter-spacing: -0.2px;
    }

    .date-display .date-secondary {
      font-size: 13px;
      color: var(--text-secondary);
      margin-top: 2px;
    }

    .date-metrics {
      position: relative;
      display: flex;
      align-items: baseline;
      justify-content: center;
      margin-top: 4px;
      padding: 0 28px;
    }

    .date-fun {
      font-size: 12px;
      font-weight: 600;
      color: var(--text-secondary);
      text-align: center;
      line-height: 1.25;
      min-width: 0;
    }

    .date-progress {
      position: absolute;
      right: 0;
      bottom: 0;
      font-size: 15px;
      font-weight: 700;
      color: var(--text-secondary);
      text-align: right;
      line-height: 1;
      text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
    }

    .date-progress.has-progress {
      color: #34c759;
    }

    .habit-dock {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
      margin-bottom: 0;
      flex-shrink: 0;
    }

    .habit-icon-btn {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 14px 8px 12px;
      border: none;
      border-radius: 16px;
      background: var(--surface);
      box-shadow: 0 8px 24px rgba(28, 20, 18, 0.12);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      color: var(--text);
      cursor: pointer;
      font-family: inherit;
      font-size: 13px;
      font-weight: 600;
      letter-spacing: -0.1px;
      -webkit-tap-highlight-color: transparent;
      touch-action: manipulation;
    }

    .habit-icon-glyph {
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .habit-icon-btn svg {
      width: 28px;
      height: 28px;
      fill: currentColor;
    }

    .habit-icon-btn:active {
      opacity: 0.75;
    }

    .habit-icon-btn.logged {
      background: rgba(255, 252, 247, 0.88);
      color: var(--text);
      box-shadow: 0 8px 24px rgba(28, 20, 18, 0.16);
    }

    .habit-icon-btn.complete {
      background: rgba(212, 244, 222, 0.72);
      color: var(--complete);
      box-shadow: 0 8px 24px rgba(52, 199, 89, 0.22);
    }

    .habit-icon-btn.starred .habit-icon-glyph svg {
      fill: #FFF200;
      filter:
        drop-shadow(0 0 2px #FFFFFF)
        drop-shadow(0 0 6px #FFEE00)
        drop-shadow(0 0 10px #FFC400);
    }

    .habit-modal[hidden] {
      display: none;
    }

    .habit-modal {
      position: fixed;
      inset: 0;
      z-index: 150;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px 16px;
      padding-top: calc(24px + var(--safe-top));
      padding-bottom: calc(24px + var(--safe-bottom));
      background: rgba(0, 0, 0, 0.5);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s ease;
    }

    .habit-modal.visible {
      opacity: 1;
      pointer-events: auto;
    }

    .habit-modal-sheet {
      width: 100%;
      max-width: 398px;
      max-height: 100%;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior: contain;
    }

    .habit-modal .section-card {
      display: none;
      margin-bottom: 12px;
    }

    .habit-modal .section-card.is-active {
      display: block;
    }

    .habit-modal-actions {
      display: flex;
      gap: 10px;
    }

    .habit-modal.quick-save .habit-modal-actions .btn-secondary {
      flex: 1;
    }

    .week-dash-sheet {
      max-width: 398px;
    }

    .week-dash-card {
      background: var(--surface);
      border-radius: 16px;
      padding: 14px 12px 16px;
      box-shadow: 0 8px 24px rgba(28, 20, 18, 0.12);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
    }

    .week-dash-nav {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 4px;
      margin-bottom: 12px;
    }

    .week-dash-heading {
      text-align: center;
      min-width: 0;
    }

    .week-dash-title {
      font-size: 17px;
      font-weight: 600;
      letter-spacing: -0.2px;
    }

    .week-dash-range {
      font-size: 13px;
      color: var(--text-secondary);
      margin-top: 2px;
    }

    .week-dash-stats {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 6px;
      margin-bottom: 14px;
    }

    .week-dash-stat {
      background: rgba(255, 255, 255, 0.5);
      border-radius: 10px;
      padding: 8px 4px 7px;
      text-align: center;
    }

    .week-dash-stat-value {
      display: block;
      font-size: 15px;
      font-weight: 700;
      letter-spacing: -0.2px;
      line-height: 1.2;
    }

    .week-dash-stat-label {
      display: block;
      font-size: 10px;
      font-weight: 600;
      color: var(--text-secondary);
      margin-top: 3px;
    }

    .week-dash-grid {
      display: grid;
      grid-template-columns: 44px repeat(7, minmax(0, 1fr)) 48px;
      gap: 9px 2px;
      align-items: center;
      margin-bottom: 10px;
    }

    .week-dash-habit,
    .week-dash-total {
      font-size: 11px;
      font-weight: 600;
      line-height: 1.2;
    }

    .week-dash-habit {
      text-align: left;
    }

    .week-dash-total {
      text-align: right;
      color: var(--text-secondary);
    }

    .week-dash-day {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 1px;
      border: none;
      background: none;
      color: inherit;
      font-family: inherit;
      padding: 4px 0;
      border-radius: 8px;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }

    .week-dash-day-name {
      font-size: 10px;
      font-weight: 600;
      color: var(--text-secondary);
    }

    .week-dash-day-num {
      font-size: 13px;
      font-weight: 700;
    }

    .week-dash-day.is-today .week-dash-day-name,
    .week-dash-day.is-today .week-dash-day-num {
      color: var(--accent);
    }

    .week-dash-day.is-selected {
      background: rgba(165, 28, 52, 0.1);
    }

    .week-dash-day:disabled {
      opacity: 0.35;
      cursor: default;
    }

    .week-dash-cell {
      width: 14px;
      height: 14px;
      margin: 1px auto;
      border-radius: 50%;
      border: 1.5px solid rgba(0, 0, 0, 0.18);
      background: transparent;
      padding: 0;
      appearance: none;
      display: block;
    }

    button.week-dash-cell {
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }

    .week-dash-cell.logged {
      background: #c4bbb0;
      border-color: #c4bbb0;
    }

    .week-dash-cell.complete {
      background: var(--complete);
      border-color: var(--complete);
    }

    .week-dash-cell.starred {
      width: 16px;
      height: 16px;
      margin: 0 auto;
      background: #FFF200;
      border-color: transparent;
      border-radius: 0;
      clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
      filter: drop-shadow(0 0 2px #FFFFFF) drop-shadow(0 0 4px #FFEE00);
    }

    .week-dash-cell.is-future {
      border-color: transparent;
      background: transparent;
      cursor: default;
    }

    .week-dash-count {
      font-size: 11px;
      font-weight: 700;
      text-align: center;
      line-height: 1;
    }

    .week-dash-count.hit {
      color: var(--complete);
      text-shadow:
        0 1px 1px rgba(0, 0, 0, 0.55),
        0 2px 4px rgba(0, 0, 0, 0.45);
    }

    .week-dash-count[data-week-day] {
      cursor: pointer;
    }

    .week-dash-card > .btn {
      width: 100%;
    }

    .section-card {
      background: var(--surface);
      border-radius: 12px;
      padding: 16px;
      margin-bottom: 12px;
      box-shadow: 0 8px 24px rgba(28, 20, 18, 0.12);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
    }

    .section-card.logged {
      background: rgba(255, 252, 247, 0.72);
      box-shadow: 0 8px 24px rgba(28, 20, 18, 0.14);
    }

    .section-card.complete {
      background: rgba(212, 244, 222, 0.38);
      box-shadow: 0 8px 24px rgba(52, 199, 89, 0.22);
    }

    .section-card h3 {
      font-size: 17px;
      font-weight: 600;
      margin-bottom: 12px;
    }

    .subsection-title {
      font-size: 15px;
      font-weight: 600;
      color: var(--text);
      margin-bottom: 12px;
    }

    .section-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 12px;
    }

    .section-header h3 {
      margin-bottom: 0;
    }

    .section-title {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
    }

    .complete-check {
      display: none;
      width: 22px;
      height: 22px;
      fill: #34c759;
      flex-shrink: 0;
    }

    .section-card.complete .complete-check {
      display: block;
      fill: #248a3d;
    }

    .card-reset {
      font-family: inherit;
      font-size: 13px;
      font-weight: 600;
      color: var(--accent);
      background: none;
      border: none;
      padding: 4px 8px;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
      flex-shrink: 0;
    }

    .card-reset:active {
      opacity: 0.6;
    }

    .week-dots {
      display: flex;
      gap: 8px;
      margin: 0 0 12px;
    }

    .week-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      border: 1.5px solid var(--border);
      background: transparent;
    }

    .week-dot.logged {
      background: #c4bbb0;
      border-color: #c4bbb0;
    }

    .week-dot.filled {
      background: var(--complete);
      border-color: var(--complete);
    }

    .week-dot.starred {
      background: #FFF200;
      border-color: transparent;
      border-radius: 0;
      clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    }

    .week-dot.rest {
      background: transparent;
      border-color: #d1d1d6;
    }

    .sleep-average {
      font-size: 13px;
      color: var(--text-secondary);
      margin: -4px 0 4px;
    }

    .sleep-goal-hint {
      font-size: 13px;
      color: var(--text-secondary);
      margin: 0 0 12px;
    }

    .field-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .field-row label {
      font-size: 15px;
      line-height: 1.3;
      color: var(--text-secondary);
      flex: 1;
      min-width: 0;
      padding-right: 8px;
    }

    .field-row + .field-row {
      margin-top: 12px;
    }

    .field-row input,
    .field-row select {
      font-family: inherit;
      font-size: 17px;
      color: var(--text);
      border: none;
      background: var(--bg);
      border-radius: 8px;
      -webkit-appearance: none;
      appearance: none;
    }

    .field-row input {
      max-width: 120px;
      padding: 10px 12px;
      text-align: right;
    }

    .field-row > select {
      min-width: 120px;
      max-width: 160px;
      padding: 10px 32px 10px 12px;
      text-align: right;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238e8e93' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 12px center;
    }

    .time-input {
      display: flex;
      align-items: center;
      gap: 4px;
      flex-shrink: 0;
    }

    .time-input select {
      width: 54px;
      min-width: 54px;
      max-width: 54px;
      flex: 0 0 54px;
      padding: 8px 2px;
      font-size: 16px;
      text-align: center;
      text-align-last: center;
      background-image: none;
    }

    .time-input .time-separator {
      font-size: 17px;
      font-weight: 600;
      color: var(--text-secondary);
    }

    .computed-value {
      font-size: 17px;
      font-weight: 600;
      color: var(--text);
      text-align: right;
      min-width: 80px;
    }

    .computed-value.empty {
      font-weight: 400;
      color: var(--text-secondary);
    }

    .btn {
      flex: 1;
      font-family: inherit;
      font-size: 17px;
      font-weight: 600;
      padding: 14px 16px;
      border: none;
      border-radius: 12px;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }

    .btn:active {
      opacity: 0.75;
    }

    .btn-primary {
      background: var(--accent);
      color: #fff;
    }

    .btn-secondary {
      background: var(--surface-solid);
      color: var(--text);
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }

    .btn-danger-outline {
      background: var(--surface-solid);
      color: var(--danger);
      border: 1px solid var(--danger);
      font-size: 15px;
      padding: 12px 16px;
      width: 100%;
    }

    .settings-card {
      background: var(--surface);
      border-radius: 12px;
      padding: 20px;
      box-shadow: 0 8px 24px rgba(28, 20, 18, 0.12);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
    }

    .settings-card h2 {
      font-size: 20px;
      font-weight: 600;
      margin-bottom: 8px;
    }

    .settings-card .settings-version {
      font-size: 13px;
      font-weight: 600;
      color: var(--text-secondary);
      margin: -4px 0 10px;
    }

    .settings-card p {
      font-size: 15px;
      line-height: 1.5;
      color: var(--text-secondary);
      margin-bottom: 12px;
    }

    .settings-group {
      margin-bottom: 24px;
      padding-bottom: 24px;
      border-bottom: 0.5px solid var(--border);
    }

    .settings-group:last-child {
      margin-bottom: 0;
      padding-bottom: 0;
      border-bottom: none;
    }

    .settings-group h3 {
      font-size: 17px;
      font-weight: 600;
      margin-bottom: 6px;
    }

    .settings-group .btn {
      width: 100%;
      flex: none;
    }

    .toast {
      position: fixed;
      bottom: calc(24px + var(--safe-bottom));
      left: 50%;
      transform: translateX(-50%) translateY(20px);
      background: rgba(28, 28, 30, 0.92);
      color: #fff;
      font-size: 15px;
      padding: 10px 20px;
      border-radius: 20px;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.25s ease, transform 0.25s ease;
      z-index: 100;
      white-space: nowrap;
    }

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

    .album-header {
      padding: 16px;
      margin-bottom: 12px;
      background: var(--surface);
      border-radius: 12px;
      box-shadow: 0 8px 24px rgba(28, 20, 18, 0.12);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
    }

    .album-header h2 {
      font-size: 22px;
      font-weight: 700;
    }

    .album-header p {
      font-size: 13px;
      color: var(--text-secondary);
      margin-top: 4px;
    }

    .album-empty {
      font-size: 15px;
      color: var(--text-secondary);
      text-align: center;
      padding: 32px 16px;
      background: var(--surface);
      border-radius: 12px;
      box-shadow: 0 8px 24px rgba(28, 20, 18, 0.12);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
    }

    .album-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      padding-bottom: 8px;
    }

    .album-card {
      position: relative;
      padding: 0;
      border: none;
      background: var(--surface);
      border-radius: 12px;
      overflow: hidden;
      box-shadow: 0 8px 24px rgba(28, 20, 18, 0.12);
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }

    .album-card img {
      display: block;
      width: 100%;
      aspect-ratio: 9 / 16;
      object-fit: cover;
      background: var(--surface-solid);
    }

    .album-card:active {
      opacity: 0.75;
    }

    .album-stamp {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      padding: 22px 8px 8px;
      background: linear-gradient(transparent, rgba(0, 0, 0, 0.66));
      color: #fff;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      text-align: center;
      pointer-events: none;
    }

    .celebration-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.65);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px;
      padding-top: calc(24px + var(--safe-top));
      padding-bottom: calc(24px + var(--safe-bottom));
      z-index: 200;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s ease;
    }

    .celebration-overlay.visible {
      opacity: 1;
      pointer-events: auto;
    }

    .celebration-card {
      background: var(--surface-solid);
      border-radius: 20px;
      padding: 16px;
      max-width: min(320px, calc((100dvh - 220px) * 9 / 16));
      width: 100%;
      text-align: center;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
      transform: scale(0.92);
      transition: transform 0.3s ease;
    }

    .celebration-overlay.visible .celebration-card {
      transform: scale(1);
    }

    .celebration-card img {
      width: 100%;
      aspect-ratio: 9 / 16;
      object-fit: cover;
      border-radius: 14px;
      display: block;
    }

    .celebration-title {
      font-size: 20px;
      font-weight: 700;
      margin: 14px 0 6px;
    }

    .celebration-message {
      font-size: 15px;
      color: var(--text-secondary);
      margin-bottom: 14px;
      line-height: 1.4;
    }

    .celebration-dismiss {
      width: 100%;
    }
 
