:root {
  /* Exact warm pastel palette */
  --bg-study: #FBF6EE;
  --bg-study-edge: #F4EBDD;
  --bg-break: #F1F7F2;
  --bg-break-edge: #E5EFE7;
  --bg-free: #FDF3EC;
  --bg-free-edge: #F5E5D9;
  --bg-sleep: #E6E2F0;
  --bg-sleep-edge: #DAD4E7;

  --surface: #FFFDF9;
  --surface-soft: #F7F1E7;
  --border: #E4D7C5;
  --border-btn: #DFD2C0;
  --shadow-hard: #CBBAA3;

  --ink-primary: #3D312A;
  --ink-secondary: #7F6E63;

  --accent-peach: #F2A591;
  --accent-peach-hover: #E8927B;
  --accent-peach-shadow: #D4816B;
  --accent-sage: #A3C9A8;
  --accent-sage-deep: #7EA984;
  --accent-butter: #F6DA8B;
  --accent-sky: #A8C6DF;
  --accent-sky-shadow: #88A9C5;
  --accent-berry: #E5989B;

  --font-display: 'Fredoka', 'Nunito', ui-rounded, system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, SFMono-Regular, monospace;

  --radius-pill: 999px;
  --radius-card: 22px;
  --radius-btn: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  font-family: var(--font-body);
  color: var(--ink-primary);
  background-color: var(--bg-study);
  background-image: radial-gradient(circle at 50% 42%, var(--bg-study) 0%, var(--bg-study-edge) 100%);
  transition: background-color 650ms ease, background-image 650ms ease;
}

body[data-mode="break"] {
  background-color: var(--bg-break);
  background-image: radial-gradient(circle at 50% 42%, var(--bg-break) 0%, var(--bg-break-edge) 100%);
}

body[data-mode="free"] {
  background-color: var(--bg-free);
  background-image: radial-gradient(circle at 50% 42%, var(--bg-free) 0%, var(--bg-free-edge) 100%);
}

body[data-mode="sleep"],
body[data-mode="space"] {
  background-color: var(--bg-sleep);
  background-image: radial-gradient(circle at 50% 42%, var(--bg-sleep) 0%, var(--bg-sleep-edge) 100%);
}

/* Tactile fine paper noise */
.paper-grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.03;
  z-index: 60;
}

/* Full viewport 3D stage */
.stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  z-index: 1;
}

#scene-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: default;
}

#scene-canvas.cursor-grab {
  cursor: grab;
}

#scene-canvas.cursor-grabbing {
  cursor: grabbing;
}

/* Editorial speech bubble */
.speech-bubble {
  position: fixed;
  left: 50%;
  top: 24%;
  transform: translate(-50%, -100%);
  max-width: min(270px, 78vw);
  padding: 10px 15px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 3px 0 var(--border);
  color: var(--ink-primary);
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  pointer-events: none;
  z-index: 15;
  animation: bubble-in 200ms cubic-bezier(0.22, 1.35, 0.36, 1);
}

.speech-bubble::before,
.speech-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-style: solid;
}

.speech-bubble::before {
  bottom: -10px;
  border-width: 10px 8px 0 8px;
  border-color: var(--border) transparent transparent transparent;
}

.speech-bubble::after {
  bottom: -7.5px;
  border-width: 8px 6.5px 0 6.5px;
  border-color: var(--surface) transparent transparent transparent;
}

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: translate(-50%, -88%) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -100%) scale(1);
  }
}

.mode-indicator {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  padding: 6px 13px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--ink-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  pointer-events: none;
  z-index: 14;
}

/* Top HUD bar */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 16px 0;
  pointer-events: none;
  z-index: 20;
}

.top-bar > * {
  pointer-events: auto;
}

.brand-cluster {
  justify-self: start;
  display: flex;
  align-items: center;
}

.util-cluster {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Tactile toy/ceramic buttons */
.tactile-btn,
.pill-btn,
.dock-btn {
  appearance: none;
  font-family: var(--font-display);
  color: var(--ink-primary);
  background: var(--surface);
  border: 1.5px solid var(--border-btn);
  box-shadow: 0 3px 0 var(--border-btn);
  cursor: pointer;
  transition: transform 120ms cubic-bezier(0.22, 1.4, 0.36, 1),
              box-shadow 120ms ease,
              background-color 140ms ease,
              border-color 140ms ease;
}

.tactile-btn:active,
.pill-btn:active,
.dock-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--border-btn);
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 13px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
}

.icon-pill-btn {
  width: 40px;
  padding: 0;
  justify-content: center;
}

.icon-pill-btn svg {
  width: 18px;
  height: 18px;
}

.icon-pill-btn.is-active {
  background: var(--accent-sky);
  border-color: var(--accent-sky-shadow);
  box-shadow: 0 3px 0 var(--accent-sky-shadow);
}

.icon-brand {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.brand-name {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-sep {
  width: 1.5px;
  height: 14px;
  background: var(--border);
}

.level-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-secondary);
}

/* Language switcher */
.lang-switch {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 3px;
  background: var(--surface);
  border: 1.5px solid var(--border-btn);
  border-radius: var(--radius-pill);
  box-shadow: 0 3px 0 var(--border-btn);
  gap: 2px;
}

.lang-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 500;
  height: 30px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.lang-btn.is-active {
  background: var(--surface-soft);
  color: var(--ink-primary);
}

/* Pomodoro Pill */
.pomo-pill {
  justify-self: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 4px 0 var(--border);
  padding: 10px 14px 12px;
  width: min(336px, calc(100vw - 32px));
  transition: width 180ms ease, padding 180ms ease;
}

.pomo-pill.is-collapsed {
  width: auto;
  padding: 6px 10px 6px 14px;
  border-radius: var(--radius-pill);
}

.pomo-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mode-switch {
  display: inline-flex;
  background: var(--surface-soft);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}

.mode-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.mode-tab.is-active {
  background: var(--surface);
  color: var(--ink-primary);
  box-shadow: 0 1px 0 var(--border);
}

.pomo-mini-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn-sm {
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--ink-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.icon-btn-sm:hover,
.icon-btn-sm.is-active {
  background: var(--surface-soft);
  color: var(--ink-primary);
}

.icon-btn-sm svg {
  width: 16px;
  height: 16px;
}

.pomo-timer-body {
  margin-top: 8px;
}

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

.timer-display {
  font-family: var(--font-mono);
  font-size: 2.05rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink-primary);
}

.pomo-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}

.tactile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-btn);
  font-size: 0.88rem;
  font-weight: 500;
}

.tactile-btn svg {
  width: 15px;
  height: 15px;
}

.primary-btn {
  background: var(--accent-peach);
  border-color: var(--accent-peach-shadow);
  box-shadow: 0 3px 0 var(--accent-peach-shadow);
  color: var(--ink-primary);
  text-decoration: none;
}

.primary-btn:hover {
  background: var(--accent-peach-hover);
}

.primary-btn:active {
  box-shadow: 0 1px 0 var(--accent-peach-shadow);
}

.icon-only-btn {
  width: 36px;
  padding: 0;
}

.icon-only-btn:hover {
  border-color: var(--accent-berry);
  background: #FCF4F4;
}

.pomo-progress-track {
  margin-top: 10px;
  height: 5px;
  width: 100%;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  overflow: hidden;
}

.pomo-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  background: var(--accent-sage);
  transition: width 260ms linear;
}

.pomo-free-note {
  margin-top: 9px;
  font-size: 0.82rem;
  color: var(--ink-secondary);
  line-height: 1.35;
}

/* Clock settings drawer inside Pomodoro pill */
.pomo-settings-panel {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1.5px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-secondary);
}

.preset-group {
  display: inline-flex;
  gap: 5px;
}

.preset-btn {
  appearance: none;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.preset-btn.is-selected {
  background: var(--accent-sage);
  border-color: var(--accent-sage-deep);
  color: var(--ink-primary);
}

.test-btn {
  background: var(--surface-soft);
  color: var(--ink-primary);
}

.test-btn:hover {
  background: var(--accent-butter);
  border-color: #D7BA6A;
}

/* Collapsed Pomodoro pill */
.pomo-collapsed {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compact-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-sage);
}

.compact-time {
  font-family: var(--font-mono);
  font-size: 0.96rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Bottom floating Action Dock */
.action-dock {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 4px 0 var(--border);
  z-index: 20;
  max-width: calc(100vw - 20px);
}

.dock-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 64px;
  height: 54px;
  padding: 6px 10px;
  border-radius: 16px;
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1;
}

.dock-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.dock-btn:hover {
  background: var(--surface-soft);
}

.dock-btn.is-active {
  background: var(--accent-sky);
  border-color: var(--accent-sky-shadow);
  box-shadow: 0 3px 0 var(--accent-sky-shadow);
}

.dock-btn.is-active:active {
  box-shadow: 0 1px 0 var(--accent-sky-shadow);
}

.dock-btn.is-locked {
  color: var(--ink-secondary);
  background: var(--surface-soft);
}

.dock-divider {
  width: 1.5px;
  height: 30px;
  background: var(--border);
  margin: 0 2px;
  flex-shrink: 0;
}

.counter-badge {
  position: absolute;
  top: -6px;
  right: -5px;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--accent-butter);
  border: 1.5px solid #D7BA6A;
  color: var(--ink-primary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lock-mini {
  position: absolute;
  top: -5px;
  right: -4px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-secondary);
}

.lock-mini svg {
  width: 11px;
  height: 11px;
}

.notify-dot {
  position: absolute;
  top: 5px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-peach);
  border: 1.5px solid var(--surface);
}

/* Wardrobe Sliding Drawer (Desktop right panel / Mobile bottom sheet) */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(61, 49, 42, 0.22);
  z-index: 40;
  opacity: 0;
  transition: opacity 220ms ease;
}

.drawer-backdrop.is-open {
  opacity: 1;
}

.wardrobe-drawer {
  position: fixed;
  top: 14px;
  right: 14px;
  bottom: 14px;
  width: min(370px, calc(100vw - 28px));
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 26px;
  box-shadow: 0 6px 0 var(--border);
  z-index: 45;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(calc(100% + 28px));
  transition: transform 280ms cubic-bezier(0.22, 1.15, 0.36, 1);
}

.wardrobe-drawer.is-open {
  transform: translateX(0);
}

.drawer-handle {
  display: none;
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 18px 10px;
}

.drawer-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 600;
  line-height: 1.15;
}

.drawer-subtitle {
  margin: 3px 0 0;
  font-size: 0.8rem;
  color: var(--ink-secondary);
}

.progress-summary {
  margin: 0 18px 12px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  border-radius: 18px;
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.meta-strong {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
}

.meta-mono {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-secondary);
}

.xp-track {
  height: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.xp-bar {
  height: 100%;
  width: 0%;
  background: var(--accent-sage);
  border-radius: var(--radius-pill);
  transition: width 300ms ease;
}

.stats-strip {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--ink-secondary);
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 500;
}

.drawer-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 18px 10px;
  padding: 4px;
  background: var(--surface-soft);
  border-radius: 14px;
}

.drawer-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 7px 10px;
  border-radius: 11px;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.drawer-tab.is-active {
  background: var(--surface);
  color: var(--ink-primary);
  box-shadow: 0 1px 0 var(--border);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 18px 20px;
  overscroll-behavior: contain;
}

.wardrobe-list,
.vip-items {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.item-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.item-row.is-equipped {
  border-color: var(--accent-sage-deep);
  background: #F4F9F4;
}

.item-row.is-locked {
  background: var(--surface-soft);
  opacity: 0.88;
}

.item-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-primary);
  flex-shrink: 0;
}

.item-icon-box svg {
  width: 20px;
  height: 20px;
}

.item-info {
  flex: 1;
  min-width: 0;
}

.item-name {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.2;
}

.item-desc {
  margin-top: 2px;
  font-size: 0.74rem;
  color: var(--ink-secondary);
}

.item-action-btn {
  appearance: none;
  border: 1.5px solid var(--border-btn);
  background: var(--surface);
  color: var(--ink-primary);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px 11px;
  border-radius: 12px;
  box-shadow: 0 2px 0 var(--border-btn);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 100ms ease, box-shadow 100ms ease, background-color 120ms ease;
}

.item-action-btn:active {
  transform: translateY(1.5px);
  box-shadow: 0 0.5px 0 var(--border-btn);
}

.item-action-btn.is-on {
  background: var(--accent-sage);
  border-color: var(--accent-sage-deep);
  box-shadow: 0 2px 0 var(--accent-sage-deep);
}

.item-lock-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.71rem;
  color: var(--ink-secondary);
  flex-shrink: 0;
}

.item-lock-pill svg {
  width: 12px;
  height: 12px;
}

/* VIP Card */
.vip-card {
  margin-top: 12px;
  padding: 14px;
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  border-radius: 18px;
}

.vip-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.vip-card-title {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
}

.vip-price-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--accent-butter);
  border: 1px solid #D7BA6A;
}

.vip-card-desc {
  margin: 6px 0 12px;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--ink-secondary);
}

.vip-cta {
  width: 100%;
  height: 40px;
}

.vip-code-form {
  margin-top: 10px;
  display: flex;
  gap: 7px;
}

.vip-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 11px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}

.vip-input:focus {
  border-color: var(--accent-peach);
}

.vip-apply-btn {
  padding: 0 12px;
  height: 36px;
  font-size: 0.8rem;
}

.vip-feedback {
  margin: 7px 0 0;
  min-height: 16px;
  font-size: 0.75rem;
  color: var(--ink-secondary);
}

.vip-feedback.is-error {
  color: #B45B60;
}

.vip-feedback.is-ok {
  color: #4D7C55;
}

.vip-active-banner {
  margin-top: 12px;
  padding: 11px 13px;
  background: #F1F7F2;
  border: 1.5px solid var(--accent-sage-deep);
  border-radius: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 500;
}

.vip-active-banner svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.kofi-link {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 14px;
  color: var(--ink-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1.5px dashed var(--border);
  transition: background-color 140ms ease, color 140ms ease;
}

.kofi-link:hover {
  background: var(--surface-soft);
  color: var(--ink-primary);
}

.kofi-link svg {
  width: 16px;
  height: 16px;
}

/* Subtle Toast */
.toast {
  position: fixed;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  padding: 9px 16px;
  background: var(--surface);
  border: 1.5px solid var(--accent-sage-deep);
  border-radius: var(--radius-pill);
  box-shadow: 0 3px 0 var(--border);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 500;
  z-index: 55;
  animation: toast-in 200ms cubic-bezier(0.22, 1.3, 0.36, 1);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

[hidden] {
  display: none !important;
}

/* Responsive mobile layout */
@media (max-width: 740px) {
  .top-bar {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    row-gap: 8px;
    padding: max(10px, env(safe-area-inset-top)) 10px 0;
  }

  .brand-cluster {
    grid-column: 1;
    grid-row: 1;
  }

  .util-cluster {
    grid-column: 2;
    grid-row: 1;
    gap: 5px;
  }

  .pomo-pill {
    grid-column: 1 / -1;
    grid-row: 2;
    width: min(336px, calc(100vw - 20px));
    padding: 8px 12px 10px;
  }

  .brand-name {
    display: none;
  }

  .brand-sep {
    display: none;
  }

  .pill-btn {
    height: 36px;
    padding: 0 10px;
  }

  .icon-pill-btn {
    width: 36px;
    padding: 0;
  }

  .lang-switch {
    height: 36px;
  }

  .lang-btn {
    height: 26px;
    padding: 0 6px;
    font-size: 0.7rem;
  }

  .timer-display {
    font-size: 1.78rem;
  }

  .action-dock {
    bottom: max(10px, env(safe-area-inset-bottom));
    gap: 5px;
    padding: 6px 7px;
    border-radius: 20px;
  }

  .dock-btn {
    min-width: 48px;
    height: 48px;
    padding: 5px 6px;
    border-radius: 13px;
    font-size: 0.65rem;
  }

  .dock-btn svg {
    width: 18px;
    height: 18px;
  }

  .dock-divider {
    height: 24px;
    margin: 0 1px;
  }

  /* Bottom sheet on mobile */
  .wardrobe-drawer {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 78dvh;
    border-radius: 26px 26px 0 0;
    border-bottom: none;
    box-shadow: 0 -4px 0 var(--border);
    transform: translateY(104%);
  }

  .wardrobe-drawer.is-open {
    transform: translateY(0);
  }

  .drawer-handle {
    display: block;
    width: 40px;
    height: 4px;
    border-radius: var(--radius-pill);
    background: var(--border);
    margin: 10px auto 0;
  }
}
