/* Narani 2026 Editorial Layer (`styles/editorial.css`) — Upgrade 26
 * Loaded last. Pretendard · 0.5px hairlines on warm paper · one soft shadow · 20/14 corners · 4pt spacing.
 * Type scale only: Display 28/700 · Title 20/650 · Body 15/450 (1.55) · Caption 12/500
 * (the focus clock is the single typographic exception: light 72–96px).
 */

html,
body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  line-height: var(--lh-body);
  color: var(--ink-1);
  background: var(--bg);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.ic {
  display: block;
  flex-shrink: 0;
}

/* ==================== MAIN ISLAND HUD (3 elements) ==================== */

.ed-balance {
  position: absolute;
  z-index: 20;
  top: calc(var(--space-4) + var(--safe-t));
  left: calc(var(--space-5) + env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: var(--space-1) var(--space-1);
  margin: calc(-1 * var(--space-1));
  border: 0;
  background: none;
  color: var(--ink-1);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ed-balance-label {
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  line-height: 1.4;
  color: var(--ink-3);
}

.ed-balance-value {
  font-size: var(--fs-title);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--ink-1);
}

.ed-menu-btn {
  position: absolute;
  z-index: 20;
  top: calc(var(--space-4) + var(--safe-t));
  right: calc(var(--space-5) + env(safe-area-inset-right, 0px));
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 0.5px solid var(--hairline-strong);
  background: rgba(251, 248, 243, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink-1);
  cursor: pointer;
}

.ed-balance[hidden],
.ed-menu-btn[hidden],
.ed-cta-wrap[hidden] {
  display: none;
}

/* Night and dusk skies are dark at the top: invert the HUD ink (no outlines, no shadows) */
.world-stage[data-tod='night'] .ed-balance-label {
  color: rgba(246, 239, 228, 0.7);
}
.world-stage[data-tod='dusk'] .ed-balance-label {
  color: #f6efe4; /* the dusk sky is mid-tone: full-strength ink keeps >= 4.5:1 (tools/capture_upgrade30.py) */
}
.world-stage[data-tod='night'] .ed-balance-value,
.world-stage[data-tod='dusk'] .ed-balance-value {
  color: #f6efe4;
}
.world-stage[data-tod='night'] .ed-menu-btn,
.world-stage[data-tod='dusk'] .ed-menu-btn {
  background: rgba(30, 26, 32, 0.5);
  border-color: rgba(246, 239, 228, 0.18);
  color: #f6efe4;
}

.ed-cta-wrap {
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: calc(var(--space-6) + var(--safe-b));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ed-cta {
  height: 56px;
  display: flex;
  align-items: center;
  border-radius: 28px;
  background: var(--solid);
  color: var(--ink-on-solid);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.ed-cta button {
  height: 100%;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  font-size: var(--fs-body);
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.ed-cta-start {
  padding: 0 var(--space-3) 0 var(--space-8);
  font-weight: 600;
}

.ed-cta-dot {
  opacity: 0.45;
  font-size: var(--fs-body);
}

.ed-cta-dur {
  padding: 0 var(--space-8) 0 var(--space-3);
  font-weight: 450;
  font-variant-numeric: tabular-nums;
  opacity: 0.86;
}

.ed-cta button:active {
  opacity: 0.7;
}

.ed-dur-popover {
  position: absolute;
  bottom: calc(100% + var(--space-3));
  display: flex;
  gap: var(--space-1);
  padding: 6px;
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  border: 0.5px solid var(--hairline);
  box-shadow: var(--shadow-soft);
  animation: edPop 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.ed-dur-popover[hidden] {
  display: none;
}

@keyframes edPop {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.ed-dur-chip {
  width: 64px;
  height: 56px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  padding-top: 16px;
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: var(--ink-1);
  cursor: pointer;
}

.ed-dur-chip strong {
  font-size: var(--fs-title);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.ed-dur-chip span {
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  color: inherit;
  opacity: 0.7;
}

.ed-dur-chip.is-active {
  background: var(--sage);
  color: var(--ink-on-solid);
}

.world-stage.is-photo-mode .ed-balance,
.world-stage.is-photo-mode .ed-menu-btn,
.world-stage.is-photo-mode .ed-cta-wrap {
  opacity: 0;
  pointer-events: none;
}

.photo-mode-bar {
  position: absolute;
  z-index: 25;
  right: calc(var(--space-4) + env(safe-area-inset-right, 0px));
  bottom: calc(var(--space-4) + var(--safe-b));
  display: flex;
  gap: var(--space-2);
}

.photo-mode-bar[hidden] {
  display: none;
}

.photo-mode-snap-btn,
.photo-mode-exit-btn {
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-pill);
  border: 0.5px solid var(--hairline-strong);
  background: rgba(251, 248, 243, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink-1);
  font-size: var(--fs-body);
  font-weight: 500;
}

.photo-mode-exit-btn {
  width: 40px;
  padding: 0;
  justify-content: center;
}

/* Edit mode surfaces */
.world-edit-banner {
  position: absolute;
  z-index: 20;
  top: calc(var(--space-4) + var(--safe-t));
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 6px var(--space-3);
  border-radius: var(--radius-pill);
  background: rgba(251, 248, 243, 0.86);
  border: 0.5px solid var(--hairline);
  color: var(--ink-2);
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.world-edit-banner.is-invalid {
  color: var(--danger);
}

.world-decor-tray {
  background: var(--surface-1);
  border-top: 0.5px solid var(--hairline);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-soft);
}

.decor-tray-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.decor-tray-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-md);
  background: var(--surface-3);
}

.decor-tab-pill {
  height: 32px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: 11px;
  background: none;
  color: var(--ink-2);
  font-size: var(--fs-body);
  font-weight: 500;
}

.decor-tab-pill[hidden] {
  display: none;
}

.decor-tab-pill.is-active {
  background: var(--surface-1);
  color: var(--ink-1);
  box-shadow: var(--shadow-sm);
}

.decor-tray-points {
  margin-left: auto;
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.decor-done-btn {
  height: 36px;
  padding: 0 var(--space-4);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--solid);
  color: var(--ink-on-solid);
  font-size: var(--fs-body);
  font-weight: 600;
}

.tray-item-card {
  border: 0.5px solid var(--hairline);
  background: var(--surface-1);
  border-radius: var(--radius-md);
  box-shadow: none;
}

.tray-item-card.is-selected {
  border-color: var(--sage);
  background: var(--surface-2);
}

.island-confirm-btn {
  display: grid;
  place-items: center;
  border: 0.5px solid var(--hairline-strong);
  background: var(--surface-1);
  color: var(--ink-1);
  box-shadow: var(--shadow-md);
}

.island-confirm-btn.is-ok {
  background: var(--solid);
  color: var(--ink-on-solid);
  border-color: transparent;
}

/* ==================== SHEETS ==================== */

.glass-sheet-backdrop {
  background: rgba(62, 45, 32, 0.22);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: none;
}

.glass-sheet-backdrop.is-entering {
  animation: sheetFadeIn 0.18s ease;
}

.glass-sheet-panel {
  background: var(--surface-1);
  border: 0;
  border-top: 0.5px solid var(--hairline);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  animation: none;
}

.glass-sheet-panel.is-entering {
  animation: sheetSlideUp 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.glass-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--hairline-strong);
}

.glass-sheet-head {
  padding: var(--space-2) var(--space-5) var(--space-3);
  border-bottom: 0;
}

.glass-sheet-head h2 {
  margin: 0;
  font-size: var(--fs-title);
  font-weight: var(--fw-title);
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.glass-sheet-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0.5px solid var(--hairline-strong);
  border-radius: 50%;
  background: none;
  color: var(--ink-2);
}

.glass-sheet-content {
  padding: var(--space-1) var(--space-5) calc(var(--space-6) + var(--safe-b));
}

@media (min-width: 860px) {
  .glass-sheet-panel {
    width: min(640px, 92vw);
    border: 0.5px solid var(--hairline);
    border-radius: var(--radius-lg);
  }
  .glass-sheet-content {
    padding: var(--space-1) var(--space-6) var(--space-6);
  }
}

/* ==================== SHARED EDITORIAL COMPONENTS ==================== */

.ed-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.ed-section {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.ed-section > * + * {
  margin-top: var(--space-3);
}

.ed-section-title,
.calendar-layout h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin: 0;
  font-size: var(--fs-body);
  font-weight: 650;
  line-height: 1.4;
  color: var(--ink-1);
}

.ed-caption,
.ed-meta {
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  line-height: 1.4;
  color: var(--ink-3);
}

.ed-meta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  white-space: nowrap;
}

.ed-figure {
  display: block;
  font-size: var(--fs-title);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.ed-display {
  display: block;
  font-size: var(--fs-display);
  font-weight: var(--fw-display);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.ed-lead {
  margin: 0;
  font-size: var(--fs-body);
  color: var(--ink-1);
}

.ed-note,
.empty-note {
  margin: 0;
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  line-height: 1.5;
  color: var(--ink-3);
}

.ed-note.is-accent {
  color: var(--accent);
}

.ed-mono {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.ed-btn {
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 var(--space-4);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--solid);
  color: var(--ink-on-solid);
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}

.ed-btn.is-quiet {
  background: transparent;
  color: var(--ink-1);
  border: 0.5px solid var(--hairline-strong);
}

.ed-btn:disabled,
.ed-btn.is-disabled {
  opacity: 0.4;
}

.ed-btn-lg {
  height: 52px;
  width: 100%;
  border-radius: 26px;
  font-size: var(--fs-body);
}

.ed-icon-btn {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 0.5px solid var(--hairline-strong);
  background: none;
  color: var(--ink-1);
  cursor: pointer;
}

.ed-btn-pair,
.ed-chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.ed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
}

.ed-section > .ed-row + .ed-row {
  margin-top: 0;
  border-top: 0.5px solid var(--hairline);
}

.ed-row.is-stacked {
  flex-direction: column;
  align-items: stretch;
}

.ed-row-text,
.ed-list-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.ed-row-text strong,
.ed-list-text strong {
  font-size: var(--fs-body);
  font-weight: 550;
  line-height: 1.4;
}

.ed-row-text span,
.ed-list-text span {
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  color: var(--ink-3);
  line-height: 1.4;
}

.ed-switch {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 13px;
  background: var(--surface-3);
  cursor: pointer;
  transition: background 0.2s ease;
}

.ed-switch span {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.ed-switch[aria-checked='true'] {
  background: var(--sage);
}

.ed-switch[aria-checked='true'] span {
  transform: translateX(18px);
}

.ed-segment {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-md);
  background: var(--surface-3);
}

.ed-segment button {
  flex: 1;
  height: 34px;
  border: 0;
  border-radius: 11px;
  background: none;
  color: var(--ink-2);
  font-size: var(--fs-body);
  font-weight: 500;
  cursor: pointer;
}

.ed-segment button.is-active {
  background: var(--surface-1);
  color: var(--ink-1);
  box-shadow: var(--shadow-sm);
}

.ed-inline-form {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.ed-inline-form input,
.visit-code-form input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  border: 0.5px solid var(--hairline-strong);
  background: var(--surface-1);
  color: var(--ink-1);
  font-size: var(--fs-body);
}

.ed-inline-form input[type='number'] {
  flex: 0 0 72px;
}

.ed-list {
  display: flex;
  flex-direction: column;
}

.ed-list-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
}

.ed-list-row + .ed-list-row {
  border-top: 0.5px solid var(--hairline);
}

.ed-progress {
  height: 2px;
  border-radius: 1px;
  background: var(--hairline-strong);
  overflow: hidden;
}

.ed-progress span {
  display: block;
  height: 100%;
  background: var(--ink-2);
}

.ed-callout {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
}

.ed-check-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-body);
  color: var(--ink-2);
}

.ed-benefits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ed-benefits li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-body);
}

.ed-benefits .ic {
  color: var(--sage);
}

/* Menu */
.ed-menu-list {
  display: flex;
  flex-direction: column;
}

.ed-menu-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 56px;
  padding: 0 var(--space-1);
  border: 0;
  background: none;
  color: var(--ink-1);
  text-align: left;
  cursor: pointer;
}

.ed-menu-row + .ed-menu-row {
  border-top: 0.5px solid var(--hairline);
}

.ed-menu-icon {
  color: var(--ink-2);
}

.ed-menu-label {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--fs-body);
  font-weight: 500;
}

.ed-menu-label small {
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  color: var(--ink-3);
}

.ed-menu-chevron {
  color: var(--ink-3);
}

/* Bank */
.ed-bank-hero {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2) 0 0;
}

.ed-withdraw-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.ed-withdraw-btn {
  height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0.5px solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--ink-1);
  cursor: pointer;
}

.ed-withdraw-btn strong {
  font-size: var(--fs-title);
  font-weight: 650;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.ed-withdraw-btn span {
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  color: var(--ink-3);
}

.ed-withdraw-btn:disabled {
  opacity: 0.38;
  cursor: default;
}

.ed-withdraw-active {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--sage-soft);
}

.ed-countdown {
  font-size: var(--fs-title);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ed-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
}

.ed-ledger {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ed-ledger li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
}

.ed-ledger li + li {
  border-top: 0.5px solid var(--hairline);
}

.ed-ledger-tag {
  width: 44px;
  flex-shrink: 0;
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  color: var(--ink-3);
}

.ed-ledger-delta {
  font-size: var(--fs-body);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--sage);
  white-space: nowrap;
}

.ed-ledger-delta.is-minus {
  color: var(--ink-2);
}

.ed-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin: 0;
}

.ed-breakdown dt {
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  color: var(--ink-3);
}

.ed-breakdown dd {
  margin: 0;
  font-size: var(--fs-body);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Calendar (moved into 시간 은행 → 기록) */
.calendar-layout .panel-card,
.calendar-layout .cal-card {
  padding: var(--space-4);
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  box-shadow: none;
}

.calendar-grid-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cal-nav-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0.5px solid var(--hairline-strong);
  border-radius: 50%;
  background: none;
  color: var(--ink-2);
}

.cal-cell {
  border: 0.5px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  box-shadow: none;
}

.cal-cell.is-today {
  border-color: transparent;
}

.cal-cell.is-selected {
  background: transparent;
  color: var(--ink-1);
}

/* 꾸미기 */
.ed-points {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.ed-points > * + * {
  margin-top: 0;
}

.ed-house {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.ed-house img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.ed-seat-grid {
  display: flex;
  flex-direction: column;
}

.ed-seat {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.ed-seat + .ed-seat {
  border-top: 0.5px solid var(--hairline);
}

.ed-seat-thumb {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background-size: cover;
  background-position: center;
}

.ed-seat.is-selected .ed-seat-thumb {
  box-shadow: 0 0 0 1.5px var(--surface-2), 0 0 0 2.5px var(--sage);
}

.ed-seat-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ed-seat-body strong {
  font-size: var(--fs-body);
  font-weight: 550;
}

.ed-seat-body span {
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  color: var(--ink-3);
}

.ed-seat-actions {
  display: flex;
  gap: var(--space-2);
}

.ed-seat-actions .ed-btn {
  height: 34px;
  padding: 0 var(--space-3);
  font-size: var(--fs-caption);
}

.ed-gift-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: var(--space-3);
}

.ed-gift {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  opacity: 0.6;
}

.ed-gift.is-unlocked {
  opacity: 1;
}

.ed-gift img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.ed-gift strong {
  font-size: var(--fs-caption);
  font-weight: 600;
  line-height: 1.35;
}

.ed-gift > span {
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.ed-statue img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

/* 식구 */
.ed-pet-hero {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.ed-pet-hero .pet-stage-preview {
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: none;
}

.ed-pet-chip {
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 var(--space-3) 0 6px;
  border: 0.5px solid var(--hairline-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-1);
  color: var(--ink-1);
  font-size: var(--fs-body);
  font-weight: 500;
}

.ed-pet-chip.is-active {
  background: var(--sage);
  color: var(--ink-on-solid);
  border-color: transparent;
}

.ed-pet-chip.is-add {
  padding-left: var(--space-3);
  color: var(--ink-2);
}

.species-chip,
.coat-swatch-btn,
.collar-chip,
.personality-card {
  border: 0.5px solid var(--hairline);
  background: var(--surface-1);
  box-shadow: none;
}

.species-chip.is-selected,
.coat-swatch-btn.is-selected,
.collar-chip.is-selected,
.personality-card.is-selected {
  border-color: var(--sage);
  background: var(--surface-1);
  box-shadow: inset 0 0 0 0.5px var(--sage);
}

.collar-dot.is-none {
  border: 1px dashed var(--ink-3);
}

/* Legacy panels still used inside flagged views (penpal, neighbors) */
.panel-card {
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  box-shadow: none;
}

.btn-primary {
  border: 0;
  border-radius: var(--radius-md);
  background: var(--solid);
  color: var(--ink-on-solid);
  box-shadow: none;
}

.btn-secondary,
.btn-secondary-sm {
  border: 0.5px solid var(--hairline-strong);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink-1);
  box-shadow: none;
}

.btn-ghost-sm {
  border: 0;
  background: none;
  color: var(--ink-2);
}

.tier-badge {
  display: none;
}

/* ==================== FOCUS STAGE: FRAME MODE ==================== */

.ed-clock {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: calc(56px + var(--safe-b));
  transform: translate(calc(-50% + var(--oled-shift-x, 0px)), var(--oled-shift-y, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  color: #fffaf2;
  filter: drop-shadow(0 2px 14px rgba(24, 16, 10, 0.32));
  transition: bottom 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
  pointer-events: none;
}

.focus-stage:not(.is-frame-mode) .ed-clock {
  bottom: calc(148px + var(--safe-b));
}

.ed-clock-digits {
  pointer-events: auto;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: clamp(72px, 22vw, 96px);
  font-weight: 250;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ed-clock-digits.is-hidden {
  color: transparent;
  height: 24px;
  overflow: hidden;
}

.ed-progress-line {
  position: relative;
  width: min(240px, 62vw);
  height: 2px;
  border-radius: 1px;
  background: rgba(255, 250, 242, 0.32);
}

.ed-progress-fill {
  position: absolute;
  inset: 0;
  border-radius: 1px;
  background: currentColor;
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.25s linear;
}

.ed-progress-paw {
  position: absolute;
  top: -7px;
  left: 0;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  transform: rotate(90deg);
  transition: left 0.25s linear;
}

.ed-lights-dot {
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  opacity: 0.78;
}

.ed-lights-dot[hidden] {
  display: none;
}

.focus-stage.is-clock-on-light:not(.is-low-power) .ed-clock {
  color: var(--ink-1);
  filter: drop-shadow(0 1px 12px rgba(255, 250, 242, 0.6));
}

.focus-stage.is-clock-on-light:not(.is-low-power) .ed-progress-line {
  background: rgba(42, 34, 27, 0.16);
}

.focus-stage.is-low-power .ed-clock {
  color: rgba(255, 244, 226, 0.66);
}

.focus-chrome {
  display: block;
  padding: 0;
}

.focus-chrome:not(.is-hidden) {
  pointer-events: none;
}

.ed-focus-controls {
  position: absolute;
  left: 50%;
  bottom: calc(var(--space-6) + var(--safe-b));
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-1);
  padding: 6px;
  border-radius: var(--radius-lg);
  background: rgba(251, 248, 243, 0.8);
  border: 0.5px solid var(--hairline);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
  pointer-events: auto;
}

.focus-chrome.is-hidden .ed-focus-controls {
  pointer-events: none;
}

.ed-ctrl {
  width: 76px;
  height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: var(--ink-1);
  cursor: pointer;
}

.ed-ctrl span {
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  color: var(--ink-2);
}

.ed-ctrl:active {
  background: var(--surface-3);
}

.sound-drawer {
  left: 50%;
  bottom: calc(108px + var(--safe-b));
  transform: translateX(-50%);
  width: min(360px, calc(100vw - 32px));
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  border: 0.5px solid var(--hairline);
  box-shadow: var(--shadow-soft);
  color: var(--ink-1);
  pointer-events: auto;
}

.sound-chip {
  height: 36px;
  border: 0.5px solid var(--hairline-strong);
  border-radius: var(--radius-pill);
  background: none;
  color: var(--ink-1);
  font-size: var(--fs-body);
  font-weight: 500;
}

.sound-chip.is-active {
  background: var(--sage);
  color: var(--ink-on-solid);
  border-color: transparent;
}

.sound-vol-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  color: var(--ink-3);
}

.focus-invalid-banner {
  top: calc(var(--space-4) + var(--safe-t));
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 0.5px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  color: var(--ink-1);
  box-shadow: var(--shadow-soft);
}

.focus-quit-card {
  width: min(340px, 100%);
  padding: var(--space-6);
  border: 0.5px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  box-shadow: var(--shadow-lg);
  text-align: left;
}

.focus-quit-card h3 {
  margin: 0;
  font-size: var(--fs-title);
  font-weight: var(--fw-title);
}

.focus-quit-card p {
  margin: var(--space-2) 0 0;
  font-size: var(--fs-body);
  color: var(--ink-2);
}

.focus-quit-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

.focus-quit-actions .ed-btn {
  height: 48px;
  width: 100%;
}

@media (orientation: landscape) and (max-height: 540px) {
  .ed-clock,
  .focus-stage:not(.is-frame-mode) .ed-clock {
    left: auto;
    right: calc(var(--space-8) + env(safe-area-inset-right, 0px));
    bottom: calc(var(--space-6) + var(--safe-b));
    transform: translate(var(--oled-shift-x, 0px), var(--oled-shift-y, 0px));
    align-items: flex-end;
  }
  .ed-clock-digits {
    font-size: clamp(64px, 11vw, 88px);
  }
  .ed-focus-controls {
    left: calc(var(--space-6) + env(safe-area-inset-left, 0px));
    bottom: calc(var(--space-5) + var(--safe-b));
    transform: none;
  }
  .sound-drawer {
    left: calc(var(--space-6) + env(safe-area-inset-left, 0px));
    bottom: calc(96px + var(--safe-b));
    transform: none;
  }
}

/* ==================== COMPLETION RITUAL ==================== */

.focus-overlay-root .complete-backdrop {
  background: var(--bg);
  backdrop-filter: none;
}

.ed-complete {
  width: min(360px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-6) var(--space-5);
  border: 0.5px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.ed-complete-pet {
  width: 176px;
  height: 160px;
}

.ed-complete-pet.is-celebrating {
  animation: edCelebrate 1.6s cubic-bezier(0.33, 1, 0.68, 1) 0.2s 2 both;
  transform-origin: 50% 100%;
}

@keyframes edCelebrate {
  0%,
  100% {
    transform: translateY(0) scale(1, 1);
  }
  12% {
    transform: translateY(0) scale(1.04, 0.95);
  }
  30% {
    transform: translateY(-18px) scale(0.98, 1.03);
  }
  48% {
    transform: translateY(0) scale(1.03, 0.97);
  }
  62% {
    transform: translateY(-8px) scale(1, 1.01);
  }
  76% {
    transform: translateY(0) scale(1, 1);
  }
}

.ed-complete-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: var(--space-1) 0 var(--space-2);
}

.ed-complete-figure strong {
  font-size: var(--fs-display);
  font-weight: var(--fw-display);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink-1);
}

.ed-complete-figure span {
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--ink-2);
}

.ed-complete-notes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  color: var(--ink-3);
}

.ed-complete-actions {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.ed-complete-actions .ed-btn-lg {
  flex: 1;
}

/* ==================== ONBOARDING ==================== */

.onboarding-modal {
  border: 0.5px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  box-shadow: var(--shadow-lg);
}

.onboarding-steps {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}

.ob-step-bar {
  flex: 1;
  height: 2px;
  border-radius: 1px;
  background: var(--hairline-strong);
}

.ob-step-bar.is-active {
  background: var(--sage);
}

.onboarding-head h2 {
  margin: 0;
  font-size: var(--fs-title);
  font-weight: var(--fw-title);
  line-height: 1.35;
}

.onboarding-label {
  display: block;
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  color: var(--ink-3);
}

.onboarding-preview-card {
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  box-shadow: none;
}

.onboarding-preview-caption {
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--ink-2);
}

.ob-species-btn,
.ob-coat-swatch,
.onboarding-name-input {
  border: 0.5px solid var(--hairline-strong);
  box-shadow: none;
}

.ob-species-btn {
  background: var(--surface-1);
  border-radius: var(--radius-md);
}

.ob-species-btn.is-active,
.ob-coat-swatch.is-active {
  border-color: var(--sage);
  box-shadow: inset 0 0 0 0.5px var(--sage);
}

.onboarding-name-input {
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--surface-1);
  font-size: var(--fs-body);
}

.onboarding-rules-box {
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.ob-rule-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-1);
  color: var(--ink-2);
}

.ob-rule-row strong {
  font-size: var(--fs-body);
  font-weight: 600;
}

.ob-rule-row p {
  margin: 2px 0 0;
  font-size: var(--fs-body);
  color: var(--ink-2);
}

.onboarding-sub-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/* ==================== TOAST ==================== */

.nr-toast {
  bottom: calc(96px + var(--safe-b));
  max-width: min(320px, calc(100vw - 32px));
  padding: 10px var(--space-4);
  border-radius: var(--radius-md);
  background: var(--solid);
  color: var(--ink-on-solid);
  font-size: var(--fs-body);
  font-weight: 500;
  box-shadow: var(--shadow-soft);
}

@media (prefers-reduced-motion: reduce) {
  .ed-complete-pet.is-celebrating,
  .glass-sheet-panel.is-entering,
  .glass-sheet-backdrop.is-entering,
  .ed-dur-popover {
    animation: none;
  }
}

/* 식구 sheet pickers */
.coat-row,
.collar-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.coat-swatch-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
}

.coat-swatch-btn .swatch-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: block;
}

.collar-chip {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
  color: var(--ink-1);
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  cursor: pointer;
}

.collar-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.personality-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.personality-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  color: var(--ink-1);
  text-align: left;
  cursor: pointer;
}

.personality-card strong {
  font-size: var(--fs-body);
  font-weight: 600;
}

.personality-card span {
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  line-height: 1.45;
  color: var(--ink-3);
}

/* ==================== UPGRADE 27: TWO-ACCOUNT BANK · ONBOARDING 2.0 · LOCK CAPTION ==================== */

.ed-accounts {
  margin: 2px 0 0;
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  line-height: 1.5;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.ed-accounts span {
  color: var(--ink-3);
}

.ed-block-demo {
  width: 100%;
  margin-top: var(--space-3);
}

.ed-badge {
  display: inline-flex;
  align-self: flex-start;
  margin: 0;
  padding: 4px var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
}

.ed-note.is-soft {
  color: var(--accent);
}

.ed-note[hidden] {
  display: none;
}

.ed-details {
  border-top: 0.5px solid var(--hairline);
  padding-top: var(--space-3);
}

.ed-details summary {
  cursor: pointer;
  font-size: var(--fs-body);
  font-weight: 550;
  color: var(--ink-1);
  list-style: none;
}

.ed-details summary::-webkit-details-marker {
  display: none;
}

.ed-details summary::after {
  content: '+';
  float: right;
  color: var(--ink-3);
}

.ed-details[open] summary::after {
  content: '−';
}

.ed-details ol {
  margin: var(--space-3) 0 0;
  padding-left: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  line-height: 1.55;
  color: var(--ink-2);
}

.ed-quiet-link {
  display: block;
  margin: var(--space-3) auto 0;
  padding: var(--space-2) var(--space-3);
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  text-decoration: underline;
  text-decoration-color: var(--hairline-strong);
  text-underline-offset: 3px;
  cursor: pointer;
}

.ed-lock-caption {
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  letter-spacing: 0.01em;
  opacity: 0.72;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Onboarding step 2 */
.ob-app-chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
  margin: var(--space-4) 0;
}

.ob-app-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-3) 0;
  border: 0.5px solid var(--hairline-strong);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  color: var(--ink-2);
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  cursor: pointer;
}

.ob-app-chip.is-active {
  border-color: var(--sage);
  box-shadow: inset 0 0 0 0.5px var(--sage);
  color: var(--ink-1);
}

.ob-app-icon {
  display: grid;
  place-items: center;
  height: 24px;
}

.ob-block-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  text-align: center;
}

.ob-block-phone {
  position: relative;
  width: 168px;
  height: 128px;
  border-radius: var(--radius-md);
  border: 0.5px solid var(--hairline-strong);
  background: var(--surface-1);
  overflow: hidden;
}

.ob-block-app {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
}

.ob-block-cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: var(--space-2);
  background: var(--surface-1);
  opacity: 0;
  transform: translateY(100%);
}

.ob-block-preview.is-playing .ob-block-cover {
  animation: obBlockCover 3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes obBlockCover {
  0%,
  30% {
    opacity: 0;
    transform: translateY(100%);
  }
  45%,
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.ob-block-pet {
  width: 56px;
  height: 56px;
}

.ob-block-cover strong {
  font-size: var(--fs-caption);
  font-weight: 650;
  color: var(--ink-1);
}

.ob-block-cover span {
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  color: var(--ink-3);
}

.ob-block-caption {
  margin: 0;
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  line-height: 1.55;
  color: var(--ink-2);
}

@media (prefers-reduced-motion: reduce) {
  .ob-block-preview.is-playing .ob-block-cover {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ==================== UPGRADE 28: WARM WATERCOLOR HEALING GUARD ==================== */
/* Serif (Gowun Batang) for titles, letters, the month and the wordmark; sans stays for numbers & controls. */

.glass-sheet-head h2,
.onboarding-head h2,
.focus-quit-card h3,
.guard-headline,
.calendar-layout .cal-header h3,
.ed-wordmark,
.ed-lead,
#complete-title {
  font-family: var(--font-serif);
  letter-spacing: -0.01em;
}

.glass-sheet-head h2,
.onboarding-head h2,
.guard-headline {
  font-weight: 700;
}

.focus-quit-card h3,
.calendar-layout .cal-header h3,
.ed-lead,
#complete-title {
  font-weight: 400;
}

#complete-title {
  font-size: var(--fs-body);
  color: var(--ink-2);
}

/* Cotton paper surfaces: grain + sunlight/peach + sage wash, no flat white board */
.glass-sheet-panel,
.onboarding-modal,
.ed-complete,
.focus-quit-card,
.blocker-phone-sheet,
.ed-dur-popover,
.world-decor-tray,
.sound-drawer {
  background: var(--paper);
  background-color: var(--surface-1);
}

.ed-section,
.calendar-layout .panel-card,
.calendar-layout .cal-card,
.onboarding-rules-box,
.onboarding-preview-card,
.ob-block-preview {
  background: var(--paper-grain), rgba(245, 237, 225, 0.86);
}

.focus-overlay-root .complete-backdrop {
  background: var(--paper-grain), var(--paper-wash), var(--bg);
}

/* Warm fills */
.ed-btn:not(.is-quiet),
.ed-cta,
.decor-done-btn,
.btn-primary {
  background: var(--solid);
  color: var(--ink-on-solid);
}

.ed-btn:not(.is-quiet):active,
.ed-cta button:active {
  background: var(--solid-hover);
}

.ed-btn.is-quiet {
  background: rgba(251, 246, 238, 0.55);
  border-color: var(--hairline-strong);
  color: var(--ink-1);
}

.ed-segment {
  background: var(--milk-tea);
}

.ed-segment button.is-active {
  background: var(--surface-1);
  color: var(--sage);
  box-shadow: inset 0 0 0 1px rgba(111, 134, 101, 0.45), var(--shadow-sm);
}

.ed-dur-chip.is-active,
.ed-pet-chip.is-active,
.sound-chip.is-active {
  background: var(--sage);
  color: var(--ink-on-solid);
}

.ed-progress span {
  background: var(--sage);
}

.ed-withdraw-btn {
  background: var(--paper-grain), var(--surface-1);
}

.ed-withdraw-active {
  background: var(--sage-soft);
}

/* Wordmark */
.ed-wordmark {
  margin: 0;
  font-size: var(--fs-title);
  color: var(--ink-1);
}

.ed-wordmark span {
  display: block;
  margin-top: 2px;
  font-family: var(--font-sans);
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

.ed-wordmark.is-quiet {
  margin-top: var(--space-6);
  text-align: center;
  font-size: var(--fs-body);
  color: var(--ink-2);
}

/* ---- Watercolor stamp calendar: no black squares, a diary painted day by day ---- */
.calendar-layout .cal-cell {
  position: relative;
  isolation: isolate;
  border: 0;
  background: transparent;
  color: var(--ink-1);
  box-shadow: none;
}

.calendar-layout .cal-cell.is-empty {
  background: transparent;
}

.cal-stamp {
  position: absolute;
  inset: 3px 4px 6px;
  z-index: -1;
  border-radius: 52% 48% 46% 54% / 55% 46% 54% 45%;
  transform: rotate(var(--stamp-rot, 0deg));
  opacity: 0;
  pointer-events: none;
}

.stamp-s1 .cal-stamp {
  border-radius: 46% 54% 58% 42% / 48% 56% 44% 52%;
}

.stamp-s2 .cal-stamp {
  border-radius: 58% 42% 50% 50% / 44% 58% 42% 56%;
}

.stamp-s3 .cal-stamp {
  border-radius: 50% 50% 42% 58% / 56% 42% 58% 44%;
}

.has-stamp .cal-stamp {
  opacity: var(--stamp-alpha, 0.5);
}

.stamp-focus .cal-stamp {
  background: radial-gradient(circle at 38% 36%, rgba(240, 178, 140, 0.95), rgba(214, 137, 100, 0.78) 52%, rgba(178, 105, 72, 0.32) 78%, rgba(178, 105, 72, 0) 92%);
}

.stamp-walk .cal-stamp {
  background: radial-gradient(circle at 40% 38%, rgba(184, 204, 168, 0.95), rgba(128, 152, 116, 0.6) 60%, rgba(111, 134, 101, 0) 92%);
}

.stamp-letter .cal-stamp {
  background: radial-gradient(circle at 40% 38%, rgba(190, 212, 224, 0.95), rgba(140, 172, 196, 0.55) 60%, rgba(140, 172, 196, 0) 92%);
}

.calendar-layout .cal-cell.is-today::after {
  content: '';
  position: absolute;
  inset: 1px 2px 4px;
  z-index: -1;
  border: 1px solid rgba(178, 105, 72, 0.7);
  border-radius: 48% 52% 55% 45% / 52% 47% 53% 48%;
  transform: rotate(-4deg);
}

.calendar-layout .cal-cell.is-selected::before {
  content: '';
  position: absolute;
  inset: 0 1px 3px;
  z-index: -2;
  border-radius: 55% 45% 50% 50% / 46% 55% 45% 54%;
  background: radial-gradient(circle at 50% 45%, rgba(239, 230, 215, 0.95), rgba(239, 230, 215, 0.6) 70%, rgba(239, 230, 215, 0));
  box-shadow: inset 0 0 0 1px rgba(111, 134, 101, 0.5);
}

.calendar-layout .cal-day-num {
  font-family: var(--font-sans);
  font-size: var(--fs-caption);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-1);
}

.calendar-layout .cal-min-tag {
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  font-variant-numeric: tabular-nums;
  color: #7c4630;
}

.dot-letter,
.sw-letter {
  background: #8cacc4;
}

.sw-focus {
  background: #d68964;
}

/* ---- Pastel watercolor app badges ---- */
.guard-app-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 46% 54% 50% 50% / 52% 46% 54% 48%;
  color: var(--app-color, var(--ink-2));
  background: radial-gradient(circle at 38% 34%, rgba(255, 255, 255, 0.7), var(--app-bg, var(--milk-tea)) 62%);
  box-shadow: inset 0 0 0 0.5px rgba(62, 49, 40, 0.12);
}

.guard-app-icon svg {
  width: 18px;
  height: 18px;
}

.ob-app-chip.is-active {
  border-color: var(--sage);
  box-shadow: inset 0 0 0 1px rgba(111, 134, 101, 0.55);
  background: var(--sage-soft);
}

/* ---- Warm guard card (onboarding preview + real guard screen) ---- */
.guard-card {
  background: var(--paper-grain),
    radial-gradient(110% 70% at 18% 0%, rgba(250, 214, 170, 0.55), rgba(250, 214, 170, 0) 60%),
    radial-gradient(90% 60% at 90% 8%, rgba(176, 206, 224, 0.42), rgba(176, 206, 224, 0) 62%),
    var(--surface-1);
}

.guard-headline {
  margin: 0;
  font-size: var(--fs-title);
  line-height: 1.35;
  color: var(--ink-1);
}

.guard-body {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--ink-2);
}

.guard-sign {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--fs-caption);
  color: var(--ink-3);
  text-align: right;
}

.guard-letter {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
  padding: 0 var(--space-2);
  text-align: left;
}

.blocker-phone-sheet {
  gap: var(--space-3);
  border: 0.5px solid var(--hairline);
  border-radius: var(--radius-lg);
}

.blocker-os-bar {
  font-weight: var(--fw-caption);
}

.guard-wordmark {
  font-family: var(--font-serif);
  font-size: var(--fs-caption);
  color: var(--ink-2);
}

.guard-bar-label {
  color: var(--ink-3);
}

.blocker-app-pill.guard-app-badge {
  gap: var(--space-2);
  padding: 4px var(--space-3) 4px 4px;
  background: rgba(251, 246, 238, 0.7);
  border: 0.5px solid var(--hairline);
  color: var(--ink-2);
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
}

.blocker-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.blocker-actions .ed-btn {
  width: 100%;
}

.blocker-close-x {
  background: rgba(239, 230, 215, 0.8);
}

.mini-app-pill {
  border: 0.5px solid var(--hairline-strong);
  background: rgba(251, 246, 238, 0.7);
  color: var(--ink-2);
  font-weight: var(--fw-caption);
}

.mini-app-pill.is-active {
  border-color: rgba(111, 134, 101, 0.55);
  background: var(--sage-soft);
  color: var(--sage);
}

.blocker-family-strip {
  background: var(--sage-soft);
  border: 0.5px solid rgba(111, 134, 101, 0.35);
  color: var(--ink-2);
}

/* Onboarding preview grows into a small letter */
.ob-block-phone {
  width: 248px;
  height: 188px;
}

.ob-block-cover {
  gap: 4px;
  padding: var(--space-3);
}

.ob-block-cover .guard-headline {
  font-size: var(--fs-body);
}

.ob-block-cover .guard-body {
  font-size: var(--fs-caption);
  line-height: 1.55;
  text-align: center;
}

.ob-block-app {
  color: var(--app-color, var(--ink-2));
  background: var(--app-bg, var(--milk-tea));
}

.ob-step-bar.is-active {
  background: var(--sage);
}

.ed-lock-caption {
  font-family: var(--font-sans);
}

/* The 기록 / 적립 규칙 tabs sit right under the hero; sticky positioning slid them over the calendar's
   month header while scrolling, so they scroll with the content. */
.ed-tabs {
  position: static;
}

#bank-calendar-root {
  scroll-margin-top: var(--space-3);
}

/* ==================== UPGRADE 29: SOFTER TYPE · KR/EN · AA CONTRAST ==================== */
/* Display faces: Gowun Dodum (Korean, one rounded 400 face) / Fraunces Soft (English 400-600). */
.glass-sheet-head h2,
.onboarding-head h2,
.guard-headline {
  font-weight: 400;
}

html[lang='en'] .glass-sheet-head h2,
html[lang='en'] .onboarding-head h2,
html[lang='en'] .guard-headline {
  font-weight: 600;
  letter-spacing: -0.005em;
}

.ed-wordmark,
.guard-wordmark {
  font-family: var(--font-wordmark);
  font-weight: 500;
}

/* Selected chips, tabs and badges: >= 4.5:1 (tools/verify_upgrade29.mjs computes every pair) */
.ed-segment button.is-active {
  color: var(--sage-ink);
}

.ed-dur-chip.is-active,
.ed-pet-chip.is-active,
.sound-chip.is-active {
  background: var(--sage-deep);
  color: var(--ink-on-solid);
}

.mini-app-pill.is-active {
  color: var(--sage-ink);
}

.ed-badge,
.ed-note.is-accent,
.ed-note.is-soft {
  color: var(--terracotta-ink);
}

.calendar-layout .cal-min-tag {
  color: var(--ink-1);
}

/* Upgrade 29.1: the one-line "good habits time bank" promise (onboarding, Plus) */
.ed-habit-line {
  margin: 6px auto 0;
  max-width: 34ch;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  text-wrap: balance;
  word-break: keep-all;
}

.ed-stack > .ed-habit-line {
  margin: -6px 0 0;
  max-width: none;
}

/* Upgrade 30: "My museum of time" statue plaque — watercolor cotton paper, serif title, five-stage journey */
.plaque-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  background: rgba(62, 45, 32, 0.42);
  backdrop-filter: blur(10px);
}

.plaque-card {
  width: min(100%, 360px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 20px 18px;
  text-align: center;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: plaque-in 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes plaque-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.plaque-badge {
  margin: 0;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--gold-soft);
  color: var(--gold-ink);
  font-size: var(--fs-caption);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.plaque-art {
  width: 148px;
  height: 148px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 58%, rgba(255, 236, 190, 0.85), rgba(255, 236, 190, 0) 70%);
}

.plaque-art img {
  width: 148px;
  height: 148px;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(62, 49, 40, 0.18));
}

.plaque-kicker {
  margin: 2px 0 0;
  font-size: var(--fs-caption);
  color: var(--ink-2);
  letter-spacing: 0.04em;
}

.plaque-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--fs-title);
  font-weight: 600;
  line-height: 1.3;
  word-break: keep-all;
}

.plaque-stage {
  margin: 0;
  font-size: 13px;
  color: var(--terracotta-ink);
  word-break: keep-all;
}

.plaque-records {
  width: 100%;
  margin: 8px 0 0;
  display: grid;
  gap: 6px;
}

.plaque-record {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: rgba(251, 246, 238, 0.72);
  border: 1px solid var(--hairline);
}

.plaque-record dt {
  font-size: 13px;
  color: var(--ink-2);
}

.plaque-record dd {
  margin: 0;
  font-size: var(--fs-body);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  word-break: keep-all;
}

.plaque-record.is-hero {
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 12px;
  background: var(--gold-soft);
}

.plaque-record.is-hero dd {
  font-family: var(--font-serif);
  font-size: var(--fs-display);
  font-weight: 600;
  color: var(--ink);
  text-align: center;
}

.plaque-journey {
  width: 100%;
  margin-top: 8px;
}

.plaque-journey-title {
  margin: 0 0 8px;
  font-size: var(--fs-caption);
  color: var(--ink-2);
  text-align: left;
}

.plaque-track {
  position: relative;
  height: 4px;
  margin: 0 10% -9px;
  border-radius: var(--radius-pill);
  background: var(--hairline-strong);
}

.plaque-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sage), var(--gold));
}

.plaque-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}

.plaque-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-caption);
  color: var(--ink-2);
}

.plaque-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.plaque-step.is-reached .plaque-dot {
  background: var(--sage);
  border-color: var(--sage);
}

.plaque-step.is-current .plaque-dot {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(156, 116, 36, 0.18);
}

.plaque-step.is-current {
  color: var(--ink);
  font-weight: 600;
}

.plaque-journey-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--ink-2);
}

.plaque-journey-note.is-mythic {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plaque-journey-note.is-mythic strong {
  font-family: var(--font-serif);
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--gold-ink);
}

.plaque-close {
  margin-top: 12px;
  min-width: 140px;
}

@media (prefers-reduced-motion: reduce) {
  .plaque-card { animation: none; }
}

/* 사업자 정보 (Plus 안내 하단, 운영: 주식회사 와이즈) */
.ed-biz dl { margin: 0; display: grid; gap: 4px; }
.ed-biz dl > div { display: grid; grid-template-columns: 7.5em 1fr; gap: 8px; }
.ed-biz dt { color: var(--ink-3); } /* full-strength token: >= 4.5:1 on the sheet (opacity dropped it to ~2.9:1) */
.ed-biz dd { color: var(--ink-2); }
.ed-biz dd { margin: 0; word-break: keep-all; overflow-wrap: anywhere; }

/* Upgrade 30.1: quiet Privacy · Terms footer (Settings, Plus) */
.ed-legal-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 4px 0 2px;
  font-size: var(--fs-caption);
  color: var(--ink-2);
}

.ed-legal-links a {
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: var(--hairline-strong);
  text-underline-offset: 3px;
}

.ed-legal-links a:hover,
.ed-legal-links a:focus-visible {
  color: var(--ink-1);
  text-decoration-color: currentColor;
}

/* ==================== Upgrade 31: focus stage — timer never on the companions ====================
   Portrait & desktop: the timer is a dark watercolor pill in the top safe area (within the top 25dvh);
   the cushion / companion stage below stays clear at every height (375×560 address-bar worst case too).
   Short landscape (phones on their side): HUD column on the left 42 %, the room on the right 58 %.
   The mini toolbar (sound · hide time · landscape/full · pause/end) lives in the bottom safe band. */
.focus-stage .ed-clock,
.focus-stage:not(.is-frame-mode) .ed-clock {
  top: calc(env(safe-area-inset-top, 0px) + clamp(8px, 2dvh, 20px));
  bottom: auto;
  left: 50%;
  max-height: 25dvh;
  max-width: calc(100vw - 32px);
  transform: translate(calc(-50% + var(--oled-shift-x, 0px)), var(--oled-shift-y, 0px));
  gap: 6px;
  padding: 10px 20px;
  border-radius: 22px;
  color: #fff9f0;
  background: rgba(26, 21, 18, 0.52);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(26, 21, 18, 0.16);
  filter: none;
}

/* On very light art the pill deepens a little so #FFF9F0 keeps AA (≥ 4.5:1) */
.focus-stage.is-clock-on-light:not(.is-low-power) .ed-clock {
  color: #fff9f0;
  background: rgba(26, 21, 18, 0.64);
  filter: none;
}

.focus-stage.is-clock-on-light:not(.is-low-power) .ed-progress-line {
  background: rgba(255, 249, 240, 0.32);
}

.focus-stage .ed-clock-digits {
  font-size: clamp(2.375rem, 10.5vw, 3.5rem);
  font-weight: 300;
  font-variant-numeric: tabular-nums;
}

.focus-stage .ed-progress-line {
  width: min(200px, 48vw);
}

.focus-stage .ed-lock-caption {
  max-width: min(78vw, 360px);
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.9;
}

/* Upgrade 31.1: keyboard way back to the tools — invisible until it has keyboard focus */
.focus-kbd-reveal {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: 12px;
  z-index: 30;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgba(26, 21, 18, 0.72);
  color: #fff9f0;
  font-size: 15px;
  clip-path: inset(50%);
  opacity: 0;
}
.focus-kbd-reveal:focus-visible { clip-path: none; opacity: 1; outline: 1px solid #fff9f0; outline-offset: 2px; }

/* Frame mode with the time hidden: no pill, only a 2 px footprint progress line at the very bottom */
.focus-stage.is-time-hidden .ed-clock {
  opacity: 0;
  visibility: hidden;
}

.focus-footbar {
  position: absolute;
  z-index: 8;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(255, 249, 240, 0.22);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.focus-stage.is-time-hidden .focus-footbar {
  opacity: 1;
}

.focus-footbar-fill {
  position: absolute;
  inset: 0;
  background: #fff9f0;
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.25s linear;
}

.focus-stage .ed-focus-controls {
  bottom: calc(var(--safe-b) + 12px);
  gap: 2px;
  padding: 6px;
}

.focus-stage .ed-ctrl {
  width: 74px;
  min-width: 44px;
  height: 56px;
  min-height: 44px;
}

.focus-stage .ed-ctrl span {
  white-space: nowrap;
}

.focus-hint,
.focus-tip {
  position: absolute;
  z-index: 12;
  left: 50%;
  bottom: calc(var(--safe-b) + 88px);
  transform: translateX(-50%);
  width: max-content;
  max-width: min(92vw, 420px);
  margin: 0;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  background: rgba(26, 21, 18, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff9f0;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  pointer-events: none;
}

.focus-tip {
  border-radius: var(--radius-md);
}

.focus-hint[hidden],
.focus-tip[hidden] {
  display: none;
}

@media (orientation: landscape) and (max-height: 540px) {
  .focus-stage {
    background: linear-gradient(180deg, #2b221c 0%, #3a2c22 100%);
  }
  .focus-stage .focus-canvas {
    left: 42%;
    width: 58%;
  }
  .focus-stage .ed-clock,
  .focus-stage:not(.is-frame-mode) .ed-clock {
    top: 50%;
    bottom: auto;
    left: 21%;
    right: auto;
    max-width: calc(42vw - 24px);
    max-height: none;
    transform: translate(calc(-50% + var(--oled-shift-x, 0px)), calc(-50% + var(--oled-shift-y, 0px)));
    align-items: center;
  }
  .focus-stage .ed-clock-digits {
    font-size: clamp(2.375rem, 7vw, 3.5rem);
  }
  .focus-stage .ed-lock-caption {
    max-width: calc(42vw - 64px);
  }
  .focus-stage .ed-focus-controls {
    left: 21%;
    transform: translateX(-50%);
    bottom: calc(var(--safe-b) + 8px);
  }
  .focus-stage .ed-ctrl {
    width: 64px;
    height: 52px;
  }
  .focus-hint,
  .focus-tip {
    left: 21%;
    bottom: auto;
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    max-width: calc(42vw - 24px);
  }
  .focus-stage .sound-drawer {
    left: 21%;
    transform: translateX(-50%);
    width: min(330px, calc(42vw - 16px));
  }
}

/* ==================== Upgrade 31: 10-second interactive watercolor intro ==================== */
/* Live island behind; blurred top/bottom bands (Skip, story bar, tap hint); centre band for motion and copy. */
.intro2 {
  --intro-ink: #2f241c;
  --intro-cotton: 251, 246, 238;
  --band-t: 21%;
  --band-b: 23%;
  position: fixed;
  inset: 0;
  z-index: 160;
  overflow: hidden;
  color: var(--intro-ink);
  font-family: var(--font-sans);
  cursor: pointer;
}
.intro2 .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.intro2-veil,
.intro2-feed,
.intro2-wash,
.intro2-bloom,
.intro2-band { position: absolute; left: 0; right: 0; pointer-events: none; }
.intro2-veil { inset: 0; background: radial-gradient(90% 60% at 50% 50%, rgba(var(--intro-cotton), 0.34), rgba(var(--intro-cotton), 0.12)); transition: opacity 1.2s ease; }
.intro2-band { z-index: 2; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: opacity 1.2s ease, height 1.2s ease; }
.intro2-band.is-top { top: 0; height: var(--band-t); background: linear-gradient(rgba(247, 236, 220, 0.86), rgba(247, 236, 220, 0.4)); mask-image: linear-gradient(#000 70%, transparent); }
.intro2-band.is-bottom {
  bottom: 0;
  height: var(--band-b);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 22px);
  background: linear-gradient(to top, rgba(247, 236, 220, 0.9), rgba(247, 236, 220, 0.42));
  mask-image: linear-gradient(to top, #000 70%, transparent);
}
.intro2-hint { margin: 0; font-size: 15px; font-weight: 600; color: #4a3b2f; animation: intro-breathe 2.4s ease-in-out infinite; }
@keyframes intro-breathe { 50% { opacity: 0.55; } }
.intro2[data-scene='3'] .intro2-veil,
.intro2[data-scene='3'] .intro2-band.is-top,
.intro2[data-scene='3'] .intro2-hint,
.intro2.is-reduced .intro2-hint { opacity: 0; }
.intro2[data-scene='3'] .intro2-band.is-bottom { height: 38%; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

.intro2-feed {
  top: var(--band-t);
  bottom: var(--band-b);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 9vw;
  mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
  transition: opacity 0.5s ease;
}
.intro2-feed i { flex: 0 0 15vh; border-radius: 18px; background: linear-gradient(160deg, rgba(74, 84, 96, 0.92), rgba(52, 60, 70, 0.9)); filter: blur(0.6px); animation: intro-feed 0.7s linear infinite; }
@keyframes intro-feed { to { transform: translateY(calc(-15vh - 12px)); } }
.intro2-wash { top: var(--band-t); bottom: var(--band-b); }
.intro2-wash b {
  position: absolute;
  width: 30vmax;
  height: 30vmax;
  border-radius: 46% 54% 52% 48%;
  background: radial-gradient(circle, rgba(var(--intro-cotton), 0.96) 52%, rgba(var(--intro-cotton), 0.5) 60%, rgba(var(--intro-cotton), 0) 70%);
  box-shadow: 0 0 0 10px rgba(143, 179, 201, 0.18);
  transform: translate(-50%, -50%) scale(0);
  animation: intro-drop 0.9s cubic-bezier(0.3, 0.6, 0.3, 1) 1.1s forwards;
}
.intro2-wash b:nth-child(1) { left: 34%; top: 34%; }
.intro2-wash b:nth-child(2) { left: 70%; top: 52%; animation-delay: 1.2s; }
.intro2-wash b:nth-child(3) { left: 42%; top: 80%; animation-delay: 1.3s; }
.intro2-wash b:nth-child(4) { left: 62%; top: 16%; animation-delay: 1.38s; }
@keyframes intro-drop { to { transform: translate(-50%, -50%) scale(3); } }
.intro2:not([data-scene='1']) .intro2-feed,
.intro2:not([data-scene='1']) .intro2-wash { opacity: 0; }

.intro2-bar { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 20px); left: 16px; right: 112px; z-index: 3; display: flex; gap: 6px; }
.intro2-bar span { flex: 1; height: 4px; border-radius: 2px; overflow: hidden; background: rgba(47, 36, 28, 0.2); }
.intro2-bar i { display: block; width: 0; height: 100%; background: #5f7f5a; }
.intro2[data-scene='1'] .intro2-bar span:nth-child(1) i { animation: intro-fill 2s linear forwards; }
.intro2[data-scene='2'] .intro2-bar span:nth-child(1) i,
.intro2[data-scene='3'] .intro2-bar i { width: 100%; }
.intro2[data-scene='2'] .intro2-bar span:nth-child(2) i { animation: intro-fill 4.5s linear forwards; }
@keyframes intro-fill { to { width: 100%; } }
.intro2-skip {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 6px);
  right: 10px;
  z-index: 4;
  min-width: 88px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgba(var(--intro-cotton), 0.95);
  box-shadow: 0 2px 10px rgba(62, 45, 32, 0.12);
  color: var(--intro-ink);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.intro2-scene {
  position: absolute;
  top: var(--band-t);
  bottom: var(--band-b);
  left: 0;
  right: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}
.intro2[data-scene='1'] [data-for='1'],
.intro2[data-scene='2'] [data-for='2'],
.intro2[data-scene='3'] [data-for='3'] { opacity: 1; visibility: visible; transition: opacity 0.45s ease; }
.intro2-copy {
  margin: 0;
  max-width: 22em;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 20px;
  border-radius: 20px;
  background: rgba(var(--intro-cotton), 0.92);
  font-size: 20px;
  line-height: 1.45;
  word-break: keep-all;
}
.intro2-copy span:first-child { font-family: var(--font-serif); font-size: 26px; font-weight: 600; }
.intro2-copy small { font-size: 16px; color: #4a3b2f; }
.intro2-copy.is-on-slate { padding: 20px 24px; box-shadow: 0 10px 30px rgba(47, 36, 28, 0.16); animation: intro-rise 0.6s ease 0.2s both; }
.intro2-copy.is-on-slate span:first-child { font-size: 28px; }
@keyframes intro-rise { from { opacity: 0; transform: translateY(10px); } }

.intro2-panel {
  width: 84%;
  max-width: 460px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 14px;
  border-radius: 28px;
  background: rgba(var(--intro-cotton), 0.84);
  box-shadow: 0 14px 40px rgba(47, 36, 28, 0.16);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.intro2-panel .intro2-copy { padding: 0; background: none; }
.intro2-tap { padding: 0; border: 0; background: none; color: var(--intro-ink); cursor: pointer; }
.intro2-duo { position: relative; display: flex; align-items: flex-end; gap: 8px; }
.intro2-cat { width: clamp(112px, min(23dvh, 42vw), 196px); height: clamp(112px, min(23dvh, 42vw), 196px); object-fit: contain; transform-origin: 70% 100%; animation: intro-nudge 1.4s ease-in-out infinite; }
@keyframes intro-nudge { 50% { transform: rotate(4deg) translateX(5px); } }
.intro2-jarwrap { position: relative; display: block; }
.intro2-jar { display: block; width: clamp(84px, min(17dvh, 32vw), 144px); height: clamp(105px, min(21dvh, 40vw), 180px); color: #6b5a4b; }
.intro2-jar-fill { fill: #8fb3c9; transition: transform 1.2s cubic-bezier(0.3, 0.7, 0.3, 1); }
.intro2.is-dropped .intro2-jar-fill { transform: translateY(-66px); }
.intro2-ring { position: absolute; inset: 10% -14% -6%; border-radius: 50%; box-shadow: 0 0 0 3px rgba(95, 127, 90, 0.5); animation: intro-ring 1.6s ease-out infinite; }
@keyframes intro-ring { from { transform: scale(0.82); opacity: 0.9; } to { transform: scale(1.18); opacity: 0; } }
.intro2.is-dropped .intro2-ring { display: none; }
.intro2-plus {
  position: absolute;
  right: 0;
  top: -10px;
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 600;
  color: #3d5a3a;
  opacity: 0;
}
.intro2.is-dropped .intro2-plus { animation: intro-plus 1.4s ease forwards; }
@keyframes intro-plus { 20% { opacity: 1; } to { opacity: 1; transform: translateY(-30px); } }
.intro2-bloom {
  left: 50%;
  top: 46%;
  z-index: 0;
  width: 110vmax;
  height: 110vmax;
  border-radius: 50%;
  background:
    radial-gradient(circle at 44% 46%, rgba(143, 179, 201, 0.55), rgba(143, 179, 201, 0) 34%),
    radial-gradient(circle at 58% 42%, rgba(244, 190, 150, 0.5), rgba(244, 190, 150, 0) 30%),
    radial-gradient(circle at 50% 58%, rgba(168, 196, 150, 0.5), rgba(168, 196, 150, 0) 34%);
  transform: translate(-50%, -50%) scale(0);
}
.intro2.is-dropped .intro2-bloom { transition: transform 1.4s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 1s ease; transform: translate(-50%, -50%) scale(1); }
.intro2[data-scene='3'] .intro2-bloom { opacity: 0; }
.intro2-swap { display: grid; }
.intro2-swap > * { grid-area: 1 / 1; align-self: center; justify-self: center; transition: opacity 0.5s ease 0.3s; }
.intro2-prompt { padding: 10px 18px; border-radius: 22px 22px 22px 6px; background: #fff; box-shadow: 0 6px 18px rgba(62, 45, 32, 0.14); font-size: 20px; font-weight: 600; }
.intro2.is-dropped .intro2-prompt,
.intro2:not(.is-dropped) .intro2-swap .intro2-copy,
.intro2:not(.is-dropped) .intro2-saved { opacity: 0; }
.intro2-saved { margin: 0; min-height: 22px; font-size: 16px; font-weight: 600; color: #3d5a3a; transition: opacity 0.5s ease 0.5s; }

[data-for='3'] { top: 0; bottom: 0; z-index: 3; justify-content: space-between; padding: calc(env(safe-area-inset-top, 0px) + 56px) 20px calc(env(safe-area-inset-bottom, 0px) + 24px); }
.intro2-here { align-self: flex-start; margin: 0; padding: 8px 14px; border-radius: var(--radius-pill); background: rgba(var(--intro-cotton), 0.92); font-size: 16px; font-weight: 600; }
.intro2-lights { position: absolute; top: 24%; right: 10%; margin: 0; display: flex; align-items: center; gap: 6px; }
.intro2-lights i { width: 8px; height: 8px; border-radius: 50%; background: #ffd98a; box-shadow: 0 0 10px 3px rgba(255, 210, 120, 0.7); animation: intro-breathe 2.4s ease-in-out infinite; }
.intro2-lights i:nth-child(2) { animation-delay: 0.8s; }
.intro2-lights i:nth-child(3) { animation-delay: 1.6s; }
.intro2-lights span { margin-left: 4px; padding: 4px 10px; border-radius: var(--radius-pill); background: rgba(var(--intro-cotton), 0.9); font-size: 14px; }
.intro2-foot { width: min(100%, 420px); display: flex; flex-direction: column; gap: 12px; }
.intro2-start { width: 100%; min-height: 56px; font-size: 18px; }
.intro2-step { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); z-index: 3; min-width: 160px; min-height: 48px; transform: translateX(-50%); }
.intro2-step[hidden] { display: none; }
@media (max-height: 640px) {
  .intro2 { --band-t: 15%; --band-b: 16%; }
  .intro2-copy span:first-child { font-size: 26px; }
  .intro2-panel { gap: 6px; padding: 12px; }
}
@media (orientation: landscape) and (max-height: 500px) { .intro2-panel { flex-flow: row wrap; justify-content: center; } }
.intro2.is-reduced *,
.intro2.is-reduced *::before { animation: none !important; transition: none !important; }
.intro2.is-reduced .intro2-feed,
.intro2.is-reduced .intro2-wash { display: none; }
.intro2.is-reduced[data-scene='1'] .intro2-bar span:nth-child(1) i,
.intro2.is-reduced[data-scene='2'] .intro2-bar span:nth-child(-n + 2) i { width: 100%; }
.intro2.is-reduced.is-dropped .intro2-plus { opacity: 1; }

/* ==================== Upgrade 31: 2-step setup · coach marks ==================== */
.ob2-progress {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--ink-2);
}
.ob2 .ob-species-btn { min-height: 64px; }
.ob2-coats .ob-coat-swatch { width: 44px; height: 44px; }
.ob2-name-note { margin: 0; }
.ob2-rhythms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.ob2-rhythm {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 96px;
  padding: 12px;
  border: 0.5px solid var(--hairline-strong);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.ob2-rhythm.is-active {
  border-color: var(--sage);
  box-shadow: inset 0 0 0 1.5px var(--sage);
  background: var(--sage-soft, var(--surface-2));
}
.ob2-rhythm-name { font-size: 15px; font-weight: 600; }
.ob2-rhythm-swap {
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  word-break: keep-all;
}
.ob2-rhythm-base { font-size: 13px; color: var(--ink-2); }
.ob2-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--sage-ink);
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
  vertical-align: 1px;
}
.ob2-custom-toggle { align-self: center; }
.ob2-custom { display: flex; flex-direction: column; gap: 6px; }
.ob2-day {
  margin-top: 4px;
  padding: 14px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}
.ob2-day-title { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.ob2-day-line { margin: 0; font-size: 17px; font-weight: 600; word-break: keep-all; }
.ob2-day-safe { margin: 4px 0 10px; font-size: 14px; color: var(--ink-2); word-break: keep-all; }
.ob2-day-change {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  box-shadow: inset 0 0 0 0.5px var(--ink);
  border-radius: 10px;
  background: var(--surface-1);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.ob2-hours {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 6px;
  max-height: 220px;
  margin-top: 10px;
  overflow-y: auto;
}
.ob2-hours[hidden] { display: none; }
.ob2-hours button {
  position: relative;
  min-height: 44px;
  border: 0.5px solid var(--hairline-strong);
  border-radius: 10px;
  background: var(--surface-1);
  color: var(--ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.ob2-hours button.is-active { border-color: var(--sage); box-shadow: inset 0 0 0 1.5px var(--sage); font-weight: 600; }
.ob2-hours .ob2-badge { display: block; margin: 2px auto 0; width: max-content; }
.ed-q {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.cm { position: fixed; inset: 0; z-index: 158; }
.cm-spot { position: fixed; border-radius: 18px; box-shadow: 0 0 0 3px rgba(255, 249, 240, 0.9), 0 0 0 200vmax rgba(30, 22, 16, 0.55); transition: left 0.35s ease, top 0.35s ease, width 0.35s ease, height 0.35s ease; pointer-events: none; }
.cm-spot.is-round { border-radius: 50%; }
.cm-bubble {
  position: fixed;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 16px 16px 14px;
  border-radius: 20px;
  background: radial-gradient(120% 80% at 100% 0%, #fdf1de 0%, rgba(253, 241, 222, 0) 55%), var(--paper, #fbf6ee);
  color: var(--ink);
  box-shadow: 0 12px 32px rgba(30, 22, 16, 0.28);
}
.cm-bubble::before { content: ''; position: absolute; left: calc(var(--tail-x, 50%) - 9px); width: 18px; height: 18px; background: var(--surface-1); transform: rotate(45deg); }
.cm-bubble[data-side='below']::before { top: -8px; }
.cm-bubble[data-side='above']::before { bottom: -8px; }
.cm-skip {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--ink-2);
  font-size: 14px;
  cursor: pointer;
}
.cm-count { margin: 0 0 6px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cm-text { margin: 0 56px 6px 0; font-size: 17px; line-height: 1.5; word-break: keep-all; }
.cm-text.is-strong { font-weight: 600; }
.cm-safe { margin: 0 0 8px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); font-size: 14px; font-weight: 600; }
.cm[data-cm-step='house'] .cm-text { font-size: 16px; }
.cm-picker .app-picker { gap: 6px; }
.cm-picker .app-preset-grid { display: flex; gap: 6px; margin: 0; overflow-x: auto; scrollbar-width: none; }
.cm-picker .ob-app-chip { flex: 0 0 60px; padding: 8px 0; }
.cm-picker:not(.is-adding) .app-add-form { display: none; }
.cm-picker .app-picker-note { margin: 0; font-size: 12px; line-height: 1.45; }
.cm-add-toggle {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--sage-ink);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.cm-add-toggle[hidden] { display: none; }
.cm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cm-primary { flex: 1 1 auto; min-height: 52px; font-size: 17px; }

/* ==================== Upgrade 32: free house switching · home themes ==================== */
.ed-house-free { margin: 8px 0 0; }
.ed-house-switch { margin-top: 10px; }
/* 33.2: house chips (here + 10-second preview) on one line, one height at 360 px; columns follow the names */
.ed-house-switch, .tp-levels { display: grid; grid-template-columns: repeat(4, auto); }
.ed-house-switch button, .tp-levels button { height: 36px; padding: 0 4px; font-size: 12px; white-space: nowrap; }
.ed-house-switch.is-compact { margin: 8px 0 4px; }
.ed-theme-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.ed-theme {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0.5px solid var(--hairline-strong);
  border-radius: var(--radius-md);
  background: var(--surface-1);
}
.ed-theme.is-selected { border-color: var(--sage); box-shadow: inset 0 0 0 1px var(--sage); }
.ed-theme-swatch {
  flex: 0 0 40px;
  height: 40px;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 249, 240, 0.65), transparent 60%), var(--theme-accent);
}
.ed-theme .ed-seat-body { flex: 1 1 150px; min-width: 0; }
.ed-theme .ed-seat-body strong { word-break: keep-all; }
.ed-theme .ed-seat-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-left: auto; }
