:root {
  color-scheme: only light;

  --color-bg: #FFFDE7;
  --color-bg-alt: #E0F2F1;
  --color-surface: #FFFFFF;
  --color-surface-raised: #FFFFFF;
  --color-border: rgba(78, 52, 46, 0.22);
  --color-border-strong: #4E342E;

  --color-text: #4E342E;
  --color-text-muted: #795548;
  --color-text-dim: #A1887F;

  --color-accent: #FFAB91;
  --color-accent-hover: #FF8A65;
  --color-accent-dim: rgba(255, 171, 145, 0.28);
  --color-accent-text: #4E342E;

  --color-yellow: #FFF59D;
  --color-yellow-dim: rgba(255, 245, 157, 0.5);

  --color-danger: #D84438;
  --color-warning-bg: #FFF3E0;
  --color-warning-border: #FFB74D;
  --color-warning-text: #8D5A20;

  --radius: 24px;
  --radius-sm: 18px;
  --shadow: 4px 6px 0 rgba(78, 52, 46, 0.10), 6px 12px 24px rgba(78, 52, 46, 0.12);
  --shadow-sm: 3px 4px 0 rgba(78, 52, 46, 0.10), 3px 8px 16px rgba(78, 52, 46, 0.10);
  --shadow-ghost: 0 3px 0 rgba(78, 52, 46, 0.28);
  --shadow-ghost-active: 0 1px 0 rgba(78, 52, 46, 0.28);
  --shadow-pop: 4px 6px 0 rgba(255, 138, 101, 0.4);
  --overlay-tint: rgba(78, 52, 46, 0.45);
  --scrollbar-thumb: rgba(78, 52, 46, 0.28);
  --bg-glow-1: rgba(255, 245, 157, 0.55);
  --bg-glow-2: rgba(224, 242, 241, 0.7);
  --nav-bg: rgba(255, 253, 231, 0.94);

  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Jua only for short, large UI chrome (headings, buttons, labels) - it
     gets illegible fast in longer running text, so body copy stays on a
     plain, highly-readable Korean system stack. */
  --font-display: "Jua", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  --font-body: "Malgun Gothic", "Apple SD Gothic Neo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: only dark;

  --color-bg: #000000;
  --color-bg-alt: #0A0A0A;
  --color-surface: #121212;
  --color-surface-raised: #1A1A1A;
  --color-border: rgba(255, 255, 255, 0.18);
  --color-border-strong: #FFFFFF;

  --color-text: #FFFFFF;
  --color-text-muted: #CCCCCC;
  --color-text-dim: #888888;

  --color-accent: #FFAB91;
  --color-accent-hover: #FFC1AC;
  --color-accent-dim: rgba(255, 171, 145, 0.22);
  --color-accent-text: #000000;

  --color-yellow: #FFF59D;
  --color-yellow-dim: rgba(255, 245, 157, 0.18);

  --color-danger: #FF7A6B;
  --color-warning-bg: rgba(255, 183, 77, 0.14);
  --color-warning-border: #FFB74D;
  --color-warning-text: #FFCC80;

  --shadow: 4px 6px 0 rgba(255, 255, 255, 0.12), 6px 12px 24px rgba(0, 0, 0, 0.5);
  --shadow-sm: 3px 4px 0 rgba(255, 255, 255, 0.12), 3px 8px 16px rgba(0, 0, 0, 0.45);
  --shadow-ghost: 0 3px 0 rgba(255, 255, 255, 0.3);
  --shadow-ghost-active: 0 1px 0 rgba(255, 255, 255, 0.3);
  --overlay-tint: rgba(0, 0, 0, 0.75);
  --scrollbar-thumb: rgba(255, 255, 255, 0.25);
  --bg-glow-1: rgba(255, 171, 145, 0.08);
  --bg-glow-2: rgba(255, 255, 255, 0.04);
  --nav-bg: rgba(10, 10, 10, 0.94);
}

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

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  word-break: keep-all;
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 15% -10%, var(--bg-glow-1) 0%, transparent 45%),
    radial-gradient(circle at 100% 0%, var(--bg-glow-2) 0%, transparent 40%),
    var(--color-bg);
  background-attachment: fixed;
  color: var(--color-text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

@media (max-width: 480px) {
  body {
    /* fixed attachment is jank-prone on mobile Safari */
    background-attachment: scroll;
  }

  .app-container {
    padding: 16px 12px 48px;
  }
}

.detail-container {
  max-width: 640px;
}

.hidden {
  display: none !important;
}

h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  color: var(--color-text);
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }
}

@media (max-width: 700px) {
  .main-header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-bottom: 20px;
  }

  .main-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .main-header-actions .btn {
    flex: 1 1 calc(50% - 4px);
  }
}

h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0 0 14px;
  color: var(--color-text);
}

.subtitle {
  color: var(--color-text-muted);
  margin: 0 0 24px;
  font-size: 1rem;
}

.card {
  position: relative;
  overflow: hidden;
  background: var(--color-surface);
  border: 2px solid var(--color-border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

@media (max-width: 480px) {
  .card {
    padding: 18px;
  }
}

.onboarding-card {
  max-width: 460px;
  margin: 48px auto 0;
  text-align: center;
}

.import-hint {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.92rem;
  margin: 18px 0 0;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-text);
  font-weight: 700;
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--color-accent-hover);
  text-decoration-thickness: 2px;
  touch-action: manipulation;
}

.form-row {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
}

.form-row label {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
}

input, select {
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 13px 14px;
  min-height: 48px;
  border: 2px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  width: 100%;
  touch-action: manipulation;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="number"] {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

input::placeholder {
  color: var(--color-text-dim);
  font-weight: 500;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--color-accent-hover);
  box-shadow: 0 0 0 4px var(--color-accent-dim);
}

select {
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 14px 20px;
  min-height: 48px;
  border-radius: var(--radius-sm);
  border: none;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.15s ease, box-shadow 0.2s ease, transform 0.25s var(--bounce), color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-accent-text);
  border: 2px solid var(--color-border-strong);
  box-shadow: 0 4px 0 var(--color-border-strong);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 0 var(--color-border-strong);
}

.btn-primary:active {
  transform: translateY(2px) scale(0.97);
  box-shadow: 0 1px 0 var(--color-border-strong);
}

.btn-ghost {
  background: var(--color-surface);
  color: var(--color-text);
  border: 2px solid var(--color-border-strong);
  box-shadow: var(--shadow-ghost);
}

.btn-ghost:hover {
  border-color: var(--color-border-strong);
  color: var(--color-text);
  background: var(--color-yellow-dim);
  transform: translateY(-2px) scale(1.03);
}

.btn-ghost:active {
  transform: translateY(2px) scale(0.97);
  box-shadow: var(--shadow-ghost-active);
}

.mode-toggle {
  display: flex;
  gap: 8px;
}

.mode-toggle-btn {
  flex: 1;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  padding: 13px 18px;
  min-height: 48px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.2s var(--bounce);
}

.mode-toggle-btn:hover {
  background: var(--color-yellow-dim);
  color: var(--color-text);
  transform: scale(1.03);
}

.theme-toggle {
  display: inline-flex;
}

.theme-toggle .mode-toggle-btn {
  flex: none;
  padding: 9px 14px;
  min-height: 44px;
  font-size: 0.88rem;
}

.mode-toggle-btn.active {
  background: var(--color-accent);
  border-color: var(--color-border-strong);
  color: var(--color-accent-text);
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 999px;
  border: 2px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.2s var(--bounce);
}

.chip:hover {
  background: var(--color-yellow-dim);
  color: var(--color-text);
  transform: scale(1.06);
}

.chip.active {
  background: var(--color-accent);
  border-color: var(--color-border-strong);
  color: var(--color-accent-text);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-small {
  padding: 9px 14px;
  min-height: 44px;
  font-size: 0.88rem;
}

.btn-block {
  width: 100%;
}

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

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

.main-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- bottom tab navigation (mobile only) ---------- */

/* Shown only inside the 700px media query below; the onboarding screen never
   shows it because .main-active is only set once the main screen is up. */
.bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  gap: 2px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 2px solid var(--color-border-strong);
  padding-bottom: env(safe-area-inset-bottom);
}

body:not(.main-active) .bottom-nav {
  display: none !important;
}

.bottom-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 56px;
  margin: 6px 3px;
  padding: 6px 4px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-text-muted);
  font-family: var(--font-display);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, transform 0.2s var(--bounce);
}

.bottom-nav-btn:active {
  transform: scale(0.94);
}

.bottom-nav-btn[aria-current="page"] {
  color: var(--color-text);
  background: var(--color-accent-dim);
}

.bottom-nav-icon {
  position: relative;
  font-size: 1.15rem;
  line-height: 1;
}

.bottom-nav-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.bottom-nav-dot {
  display: none;
  position: absolute;
  top: -2px;
  right: -5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-danger);
}

.bottom-nav-btn.timer-active .bottom-nav-dot {
  display: block;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
}

.chat-section {
  margin-bottom: 20px;
}

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

.chat-section-header h2 {
  margin: 0;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  margin-bottom: 14px;
  padding-right: 2px;
}

@media (max-width: 480px) {
  .chat-messages {
    max-height: 320px;
  }

  .chat-bubble {
    max-width: 92%;
  }
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
}

.chat-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 20px;
  font-size: 0.96rem;
  line-height: 1.55;
}

.chat-row {
  display: flex;
  align-items: flex-end;
  align-self: flex-start;
  gap: 8px;
  max-width: 88%;
}

.chat-row .chat-bubble {
  max-width: none;
  min-width: 0;
}

.chat-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2px solid var(--color-border-strong);
  padding: 3px;
  object-fit: contain;
}

.chat-bubble-user {
  align-self: flex-end;
  background: var(--color-accent);
  color: var(--color-accent-text);
  border: 2px solid var(--color-border-strong);
  font-weight: 600;
  white-space: pre-wrap;
  border-bottom-right-radius: 6px;
}

.chat-bubble-assistant {
  align-self: flex-start;
  background: var(--color-surface);
  color: var(--color-text);
  border: 2px solid var(--color-border-strong);
  border-bottom-left-radius: 6px;
}

.chat-bubble-error {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
  border: 2px solid var(--color-warning-border);
  white-space: pre-wrap;
}

.chat-bubble-assistant > *:first-child {
  margin-top: 0;
}

.chat-bubble-assistant > *:last-child {
  margin-bottom: 0;
}

.chat-bubble-assistant p {
  margin: 0 0 8px;
}

.chat-bubble-assistant h1,
.chat-bubble-assistant h2,
.chat-bubble-assistant h3,
.chat-bubble-assistant h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 12px 0 6px;
}

.chat-bubble-assistant strong {
  color: var(--color-text);
  font-weight: 800;
}

.chat-bubble-assistant ul,
.chat-bubble-assistant ol {
  margin: 4px 0 10px;
  padding-left: 20px;
}

.chat-bubble-assistant li {
  margin-bottom: 4px;
}

.chat-bubble-assistant li::marker {
  color: var(--color-text-muted);
}

.chat-bubble-assistant code {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.85em;
}

.chat-bubble-assistant a {
  color: var(--color-text);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--color-accent-hover);
  text-decoration-thickness: 2px;
}

.chat-form {
  display: flex;
  gap: 8px;
}

.chat-form input {
  flex: 1;
}

.log-panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 800px) {
  .log-panel-grid {
    grid-template-columns: 1fr;
  }

  /* on mobile, logging a workout is the primary action -
     put the form above the (potentially long) history list */
  .form-column {
    order: -1;
  }
}

.history-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.history-column-header h2 {
  margin: 0;
}

.timer-card {
  margin-bottom: 20px;
  text-align: center;
}

.timer-display {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--color-text);
  text-align: center;
  margin: 4px 0 6px;
}

.segment-timer {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.segment-timer-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text-muted);
}

.segment-timer-display {
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}

@media (max-width: 480px) {
  .timer-display {
    font-size: 2.2rem;
  }

  .timer-controls {
    flex-wrap: wrap;
  }

  .timer-controls .btn {
    min-width: calc(50% - 4px);
  }
}

.timer-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.timer-controls .btn {
  flex: 1;
}

.timer-laps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  text-align: left;
}

.timer-laps:empty {
  display: none;
}

.timer-lap-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 12px;
  background: var(--color-bg-alt);
  border: 2px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
}

.timer-lap-item span:last-child {
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  font-weight: 700;
}

.log-form-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  text-align: center;
}

.log-form-placeholder .empty-message {
  padding: 0;
}

.sets-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.set-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.set-row span {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--color-text-muted);
  min-width: 48px;
}

.set-row input {
  flex: 1;
}

.set-remove-btn {
  background: transparent;
  border: none;
  color: var(--color-danger);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  transition: transform 0.2s var(--bounce);
}

.set-remove-btn:hover {
  transform: scale(1.2);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-day-compact {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 48px;
  background: var(--color-surface);
  border: 2px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  touch-action: manipulation;
  transition: box-shadow 0.15s ease, transform 0.2s var(--bounce);
}

.history-day-compact:hover {
  box-shadow: var(--shadow-pop);
  transform: translateY(-2px);
}

.history-day-compact:active {
  transform: translateY(0) scale(0.98);
}

.history-day-compact[aria-expanded="true"] {
  background: var(--color-accent-dim);
  box-shadow: var(--shadow-pop);
}

.history-day-chevron {
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 6px solid var(--color-text-muted);
  transition: transform 0.15s ease;
}

.history-day-compact[aria-expanded="true"] .history-day-chevron {
  transform: rotate(90deg);
  border-left-color: var(--color-accent-hover);
}

.history-day-detail {
  margin: 8px 0 4px 3px;
  padding: 14px 0 0 13px;
  border-left: 2px solid var(--color-border);
}

.history-day-compact .history-day-date {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  white-space: nowrap;
  color: var(--color-text);
}

.history-day-compact .history-day-title {
  flex: 1;
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-day-compact .history-day-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
  background: var(--color-accent-dim);
  padding: 3px 10px;
  border-radius: 999px;
}

.detail-card {
  margin-bottom: 12px;
  border-left: 3px solid var(--color-border-strong);
  padding-left: 10px;
}

.detail-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.detail-card-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.detail-card-weight {
  font-weight: 700;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}

.detail-card-meta {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.detail-sets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-set-chip {
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--color-bg-alt);
  border: 2px solid var(--color-border-strong);
  color: var(--color-text);
}

.detail-set-chip-fail {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
  color: var(--color-warning-text);
}

.detail-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid var(--color-border);
}

.detail-card-actions .btn {
  flex: 1;
}

.history-item-fail {
  color: var(--color-danger);
  font-weight: 700;
}

.empty-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  text-align: center;
  padding: 20px 0;
}

.empty-message p {
  margin: 0;
}

.mascot-illustration {
  width: 96px;
  height: auto;
  display: block;
  margin: 0 auto 12px;
}

.mascot-illustration-small {
  width: 64px;
  margin-bottom: 0;
}

.mascot-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 8px);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 32px);
  background: var(--color-surface);
  border: 2px solid var(--color-border-strong);
  border-radius: 999px;
  box-shadow: var(--shadow);
  padding: 8px 20px 8px 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s var(--bounce);
}

.mascot-toast.mascot-toast-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mascot-toast-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.mascot-toast-text {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-text);
}

@media (max-width: 700px) {
  .mascot-toast {
    bottom: calc(80px + env(safe-area-inset-bottom));
  }
}

/* ---------- mobile tab switching ----------
   Kept last in the file on purpose: these rules override base display values
   (.bottom-nav, .main-header-actions) that are declared further up, and only
   source order separates same-specificity rules. Above 700px nothing here
   applies, so the desktop layout is untouched. */

@media (max-width: 700px) {
  .bottom-nav {
    display: flex;
  }

  .app-container {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  body[data-active-tab] [data-tab] {
    display: none;
  }

  body[data-active-tab="chat"] [data-tab="chat"],
  body[data-active-tab="log"] [data-tab="log"],
  body[data-active-tab="timer"] [data-tab="timer"] {
    display: block;
  }

  body[data-active-tab="settings"] [data-tab="settings"] {
    display: flex;
  }

  /* the timer stands alone in its own tab - no gap to a following card */
  .timer-card {
    margin-bottom: 0;
  }
}

/* ---------- privacy policy page ---------- */

.privacy-card {
  max-width: 640px;
  margin: 48px auto;
}

.privacy-card h1 {
  font-size: 1.5rem;
}

.privacy-card h2 {
  font-size: 1.05rem;
  margin-top: 28px;
}

.privacy-card p,
.privacy-card li {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.privacy-card ul {
  padding-left: 20px;
  margin: 8px 0;
}

.privacy-card .back-link {
  display: inline-block;
  margin-top: 28px;
}
