@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --page-canvas: #fffaf0;
  --page-deep: #f5efe3;
  --page-ink: #0a0a0a;
  --page-muted: #6a6a6a;
  --font-sans: 'Inter', system-ui, sans-serif;
  --motion: 380ms;
  --motion-open: 280ms;
  --motion-close: 360ms;
  --motion-phone: 240ms;
}

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

html, body, #root {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

body {
  background:
    radial-gradient(ellipse 90% 70% at 50% 28%, #fffdf8 0%, transparent 58%),
    radial-gradient(ellipse 70% 50% at 50% 100%, var(--page-deep) 0%, transparent 55%),
    var(--page-canvas);
  color: var(--page-ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

@media (prefers-color-scheme: dark) {
  body {
    background:
      radial-gradient(ellipse 80% 60% at 50% 20%, #122222 0%, transparent 55%),
      #0a1a1a;
    color: #fffaf0;
  }
}

#root {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

.stage {
  width: min(100%, 28rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  gap: clamp(1rem, 2.5vh, 1.75rem);
}

.closed-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  transition: opacity 220ms ease, transform 220ms ease;
  transform-origin: 50% 80%;
}

.stage[data-phase="opening"] .closed-stack {
  position: absolute;
  inset: 0;
  margin: auto;
  height: fit-content;
  pointer-events: none;
  animation: stackLaunch 300ms ease-out forwards;
}

.stage[data-phase="open"] .closed-stack {
  position: absolute;
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
  visibility: hidden;
}

.stage[data-phase="closing"] .closed-stack {
  position: absolute;
  inset: 0;
  margin: auto;
  height: fit-content;
  opacity: 0;
  animation: stackCatch var(--motion-phone) ease forwards;
  animation-delay: 40ms;
  pointer-events: none;
}

@keyframes stackLaunch {
  0% { opacity: 1; visibility: visible; }
  70% { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: hidden; }
}

@keyframes stackCatch {
  0% { opacity: 0; visibility: hidden; }
  100% { opacity: 1; visibility: visible; }
}

.pitch {
  font-size: clamp(1rem, 0.95rem + 0.35vw, 1.125rem);
  color: var(--page-muted);
  max-width: 22rem;
  line-height: 1.55;
}

@media (prefers-color-scheme: dark) {
  .pitch { color: #a0a0a0; }
}

.hint {
  font-size: 0.8125rem;
  color: var(--page-muted);
  opacity: 0.9;
}

@media (prefers-color-scheme: dark) {
  .hint { color: #a0a0a0; }
}

.app-icon-btn {
  margin-top: 0.25rem;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem;
  border-radius: 18px;
  transition: transform 0.18s ease;
  color: inherit;
}

.app-icon-btn:hover { transform: scale(1.04); }
.app-icon-btn:active { transform: scale(0.96); }
.app-icon-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.app-icon-frame {
  width: 4.75rem;
  height: 4.75rem;
  border-radius: 22.5%;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 8px 20px rgba(0, 0, 0, 0.12);
  background: #fffaf0;
  transform-origin: 50% 50%;
}

.stage[data-phase="opening"] .app-icon-frame {
  animation: iconLaunch 280ms ease-out forwards;
}

.stage[data-phase="closing"] .app-icon-frame {
  animation: iconCatch var(--motion-close) ease-out forwards;
}

@keyframes iconLaunch {
  0% { transform: scale(1); }
  35% { transform: scale(0.86); }
  100% { transform: scale(1.12); opacity: 0; }
}

@keyframes iconCatch {
  0%, 48% { transform: scale(1); }
  68% { transform: scale(0.78); }
  82% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

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

.app-icon-btn:disabled:hover { transform: none; }

.app-icon { width: 100%; height: 100%; display: block; object-fit: cover; }
.app-icon-dark { display: none; }

@media (prefers-color-scheme: dark) {
  .app-icon-light { display: none; }
  .app-icon-dark { display: block; }
}

.app-icon-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* —— iPhone frame —— */
.phone {
  width: min(100%, 23rem, calc((min(72vh, 42rem)) * 9 / 19.5 + 22px));
  position: absolute;
  opacity: 0;
  transform: scale(0.86);
  transform-origin: 50% 50%;
  pointer-events: none;
  visibility: hidden;
}

.stage[data-phase="opening"] .phone {
  position: relative;
  visibility: visible;
  pointer-events: none;
  animation: phoneExpandIn var(--motion-phone) ease-out forwards;
}

.stage[data-phase="open"] .phone {
  position: relative;
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  visibility: visible;
}

.stage[data-phase="closing"] .phone {
  position: relative;
  visibility: visible;
  pointer-events: none;
  animation: phoneExpandOut var(--motion-phone) ease-in forwards;
}

@keyframes phoneExpandIn {
  from {
    opacity: 0;
    transform: scale(0.86);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes phoneExpandOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
    visibility: hidden;
  }
}

.phone-frame {
  position: relative;
  border-radius: 54px;
  padding: 11px;
  background: linear-gradient(145deg, #3a3a3c 0%, #1c1c1e 42%, #2c2c2e 70%, #0a0a0a 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 0 0 1px rgba(0, 0, 0, 0.55) inset,
    0 2px 0 rgba(255, 255, 255, 0.08) inset,
    0 28px 56px rgba(0, 0, 0, 0.32),
    0 8px 16px rgba(0, 0, 0, 0.18);
}

.phone-frame::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50px;
  pointer-events: none;
  box-shadow:
    0 0 0 1.5px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  z-index: 2;
}

.phone-glass {
  position: relative;
  border-radius: 44px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 9 / 19.5;
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

.phone-btn {
  position: absolute;
  background: linear-gradient(90deg, #4a4a4c, #2a2a2c 40%, #1a1a1c);
  border-radius: 2px;
  z-index: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.phone-btn-silent {
  left: -3px;
  top: 18%;
  width: 3px;
  height: 22px;
  border-radius: 2px 0 0 2px;
}

.phone-btn-vol-up {
  left: -3px;
  top: 26%;
  width: 3px;
  height: 42px;
  border-radius: 2px 0 0 2px;
}

.phone-btn-vol-down {
  left: -3px;
  top: 36%;
  width: 3px;
  height: 42px;
  border-radius: 2px 0 0 2px;
}

.phone-btn-power {
  right: -3px;
  top: 28%;
  width: 3px;
  height: 68px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(270deg, #4a4a4c, #2a2a2c 40%, #1a1a1c);
}

.dynamic-island {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 92px;
  height: 28px;
  background: #0a0a0a;
  border-radius: 999px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.island-camera {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #3a5a8a 0%, #1a2a4a 45%, #0a1020 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.status-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 25;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 50px;
  padding: 14px 22px 0;
  color: #0a0a0a;
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;
}

.status-time {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  padding-left: 4px;
  min-width: 54px;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-right: 2px;
}

.status-signal { width: 17px; height: 11px; }
.status-wifi { width: 15px; height: 11px; }
.status-battery { width: 25px; height: 11px; }

.home-indicator {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  width: 120px;
  height: 5px;
  border: none;
  border-radius: 999px;
  background: #0a0a0a;
  opacity: 0.28;
  cursor: pointer;
  z-index: 35;
  padding: 0;
}

.home-indicator:hover { opacity: 0.45; }
.home-indicator:focus-visible {
  outline: 2px solid #0a0a0a;
  outline-offset: 4px;
  opacity: 0.6;
}

.close-x {
  position: absolute;
  top: -0.35rem;
  right: -0.55rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: none;
  background: #faf5e8;
  color: #0a0a0a;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(10, 10, 10, 0.12);
  z-index: 5;
}

.close-x:focus-visible {
  outline: 2px solid #0a0a0a;
  outline-offset: 2px;
}

/* App chrome — always light Clay tokens like the product default */
.app-shell {
  --color-bg: #fffaf0;
  --color-surface: #faf5e8;
  --color-text: #0a0a0a;
  --color-text-secondary: #6a6a6a;
  --color-border: #e5e5e5;
  --color-primary: #0a0a0a;
  --color-primary-hover: #1f1f1f;
  --color-on-primary: #ffffff;
  --color-success: #22c55e;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --font-display: 'Inter', system-ui, sans-serif;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --shadow-sm: 0 1px 3px rgba(10, 10, 10, 0.04);
  --shadow-md: 0 4px 12px rgba(10, 10, 10, 0.06);
  --nav-height: 60px;

  background: var(--color-bg);
  color: var(--color-text);
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: left;
  position: relative;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: 1.5;
  padding-top: 50px;
  padding-bottom: 18px;
}

.app-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  outline: none;
}

.app-scroll {
  padding: var(--space-lg);
  animation: pageEnter 0.2s ease-out;
}

.app-scroll.has-fab {
  padding-bottom: calc(56px + var(--space-lg) + var(--space-md));
  position: relative;
}

@keyframes pageEnter {
  from { opacity: 0; }
  to { opacity: 1; }
}

.screen-title {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  font-size: var(--font-size-xl);
  font-weight: 500;
  margin-bottom: var(--space-lg);
}

.screen-title.tight { margin-bottom: 0; }

.app-nav {
  flex-shrink: 0;
  height: var(--nav-height);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.nav-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font: inherit;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.1;
  cursor: pointer;
  min-height: var(--nav-height);
}

.nav-link.active { color: var(--color-primary); }
.nav-link:active { opacity: 0.7; }
.nav-icon { width: 22px; height: 22px; }

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--nav-height) + 1rem);
  transform: translateX(-50%);
  background: #0a0a0a;
  color: #fff;
  font-size: 0.8125rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  white-space: nowrap;
  z-index: 40;
}

/* Avatar */
.avatar {
  flex-shrink: 0;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: color-mix(in srgb, var(--color-primary) 20%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar span {
  font-weight: 600;
  color: var(--color-primary);
  line-height: 1;
}

.avatar-sm { width: 32px; height: 32px; }
.avatar-sm span { font-size: 0.75rem; }
.avatar-md { width: 40px; height: 40px; }
.avatar-md span { font-size: 0.875rem; }
.avatar-lg { width: 64px; height: 64px; }
.avatar-lg span { font-size: 1.25rem; }

/* PersonCard */
.card-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.card {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  overflow: hidden;
  animation: cardEnter 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardEnter {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.name-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  width: 100%;
  padding: 0;
  min-width: 0;
}

.name-row:disabled { cursor: default; }

.meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.name {
  font-weight: 700;
  font-size: var(--font-size-base);
  color: var(--color-text);
}

.status {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-weight: 500;
}

.last-activity {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
}

.btn-contacted {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-success);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font: inherit;
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
}

.btn-contacted:active { transform: scale(0.98); }
.btn-contacted:disabled { opacity: 0.6; }

.btn-snooze {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
}

.btn-snooze:disabled { opacity: 0.6; }

.exit-contacted {
  pointer-events: none;
  animation: exitContacted 0.48s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes exitContacted {
  0% { opacity: 1; transform: translateX(0) scale(1) rotate(0); }
  18% { transform: translateX(-4%) scale(1.02) rotate(-0.5deg); }
  100% {
    opacity: 0;
    transform: translateX(108%) scale(0.88) rotate(4deg);
    height: 0 !important;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
    border: none;
    box-shadow: none;
    gap: 0;
  }
}

.exit-snoozed {
  pointer-events: none;
  animation: exitSnoozed 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes exitSnoozed {
  to {
    opacity: 0;
    transform: translateY(-28%) scale(0.94);
    filter: blur(2px);
    height: 0 !important;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
    gap: 0;
  }
}

.exit-stamp {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--color-success) 18%, transparent);
  color: var(--color-success);
  pointer-events: none;
  animation: stampIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes stampIn {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}

/* Celebration empty */
.celebration {
  padding: var(--space-xl) var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-md);
}

.cele-otter {
  width: 120px;
  height: 120px;
  object-fit: contain;
  animation: breathe 3.2s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.cele-title {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  font-size: var(--font-size-lg);
  font-weight: 500;
}

.cele-sub { color: var(--color-text-secondary); font-size: var(--font-size-sm); }

.fab {
  position: absolute;
  right: 16px;
  bottom: calc(var(--nav-height) + 26px);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--color-primary);
  color: var(--color-on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  z-index: 50;
}

/* People */
.people-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  gap: var(--space-sm);
}

.btn-add {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-primary);
  color: var(--color-on-primary);
  border: none;
  border-radius: var(--radius-md);
  font: inherit;
  font-weight: 600;
  font-size: var(--font-size-sm);
  white-space: nowrap;
  opacity: 0.45;
  cursor: not-allowed;
}

.search-wrap {
  position: relative;
  margin-bottom: var(--space-lg);
}

.search-icon {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-secondary);
  pointer-events: none;
}

.search {
  width: 100%;
  padding: var(--space-sm) var(--space-md) var(--space-sm) calc(var(--space-md) + 24px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  outline: none;
}

.search:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 12%, transparent);
}

.tier-section { margin-bottom: var(--space-lg); }

.tier-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.tier-name {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  font-weight: 500;
  font-size: var(--font-size-lg);
}

.tier-count {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.person-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface);
  border: none;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-xs);
  box-shadow: var(--shadow-sm);
  font: inherit;
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
}

.person-item:active { opacity: 0.7; }
.person-item-name { font-weight: 500; }

/* Upcoming */
.range-picker { margin-bottom: var(--space-lg); }
.range-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
}

.range-chips { display: flex; flex-wrap: wrap; gap: var(--space-xs); }

.chip {
  padding: var(--space-xs) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font: inherit;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  cursor: pointer;
}

.chip.active {
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.upcoming-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.upcoming-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.upcoming-left {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  min-width: 0;
  padding: 0;
}

.event-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-left: var(--space-xs);
}

.days-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.days-label.today {
  color: var(--color-success);
  font-weight: 700;
}

.empty-copy {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--color-text-secondary);
}

/* Detail */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-bottom: var(--space-md);
  color: var(--color-text-secondary);
  font: inherit;
  font-size: var(--font-size-sm);
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  min-height: 44px;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.detail-title {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  font-size: var(--font-size-xl);
  font-weight: 500;
}

.action-bar {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.detail-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-sm);
  gap: var(--space-md);
}

.meta-label {
  color: var(--color-text-secondary);
  font-weight: 600;
}

.detail-section { margin-top: var(--space-xl); }

.section-title {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  font-size: var(--font-size-lg);
  font-weight: 500;
  margin-bottom: var(--space-md);
}

.history-list { list-style: none; display: flex; flex-direction: column; gap: var(--space-xs); }

.history-item {
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  box-shadow: var(--shadow-sm);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion: 0ms;
    --motion-open: 0ms;
    --motion-close: 0ms;
    --motion-phone: 0ms;
  }
  .card, .app-scroll, .cele-otter, .exit-stamp,
  .phone, .app-icon-frame, .closed-stack { animation: none !important; }
  .exit-contacted, .exit-snoozed {
    animation: none;
    opacity: 0;
    height: 0 !important;
    padding: 0;
    margin: 0;
    overflow: hidden;
  }
}

@media (max-height: 560px) {
  .phone { width: min(100%, calc((min(68vh, 34rem)) * 9 / 19.5 + 22px)); }
  .app-icon-frame { width: 4rem; height: 4rem; }
  .cele-otter { width: 88px; height: 88px; }
}
