/* =====================================================================
   APP SHELL — shared styles for authenticated views.
   Scoped under .app-layout so marketing/landing rules in theme.css
   are never accidentally overridden.
   ===================================================================== */

/* ----- Header ----- */
.app-header {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-header--minimal .container {
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.header-nav a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.header-nav a:hover {
  color: var(--text);
}

.header-nav a.is-active {
  color: var(--text);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.header-email {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ----- Buttons (app context) ----- */
.app-layout .btn-primary {
  background: var(--brand);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}

.app-layout .btn-primary:hover {
  background: var(--brand-dim);
}

.app-layout .btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.app-layout .btn-primary--sm {
  padding: 8px 16px;
  font-size: 0.8rem;
}

.app-layout .btn-secondary {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.8rem;
  border-radius: var(--radius-md);
  padding: 8px 16px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
}

.app-layout .btn-secondary:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.app-layout .btn-secondary--accent {
  border-color: var(--accent);
  color: var(--accent);
}

.app-layout .btn-secondary--accent:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: var(--accent-light);
  color: var(--accent-light);
}

.app-layout .btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.app-layout .btn-danger-solid {
  background: var(--danger);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.app-layout .btn-danger-solid:hover {
  background: color-mix(in srgb, var(--danger) 82%, black);
}

.app-layout .btn-danger-solid:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-back {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
}

.btn-back:hover {
  color: var(--text);
}

/* ----- Page layout ----- */
.page {
  padding: 48px 0 80px;
}

.page-title {
  margin-bottom: 8px;
}

.page-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.page-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.dashboard {
  padding: 48px 0 80px;
}

.dash-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.dash-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: var(--leading-tight);
  color: var(--text);
}

.dash-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.dash-sub {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 0.95rem;
}

/* ----- Cards ----- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  max-width: var(--content-width-form);
}

.card h2 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.card+.card {
  margin-top: 24px;
}

/* ----- Form controls ----- */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 32px;
  max-width: var(--content-width-form);
}

.form-section {
  margin-bottom: 36px;
}

.form-section:last-of-type {
  margin-bottom: 0;
}

.form-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.form-section-num {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.form-section-body {
  padding-left: 38px;
}

.form-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 36px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.field {
  margin-bottom: 28px;
}

.field:last-child {
  margin-bottom: 0;
}

.field-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: block;
}

.field-input,
.field-textarea,
.select-input,
.month-day-input {
  width: 100%;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.field-textarea {
  resize: vertical;
  min-height: 72px;
}

.select-input {
  width: auto;
  padding: 8px 12px;
  font-size: 0.9rem;
}

.month-day-input {
  width: 100px;
  padding: 10px 14px;
}

.field-input:focus,
.field-textarea:focus,
.select-input:focus,
.month-day-input:focus {
  border-color: rgba(var(--brand-rgb), 0.6);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.12);
}

.field-input::placeholder,
.field-textarea::placeholder {
  color: var(--text-muted);
}

.field-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.category-options,
.schedule-options,
.day-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.schedule-options {
  gap: 12px;
}

.category-chip,
.schedule-btn,
.day-chip {
  position: relative;
  padding: 8px 14px;
  background: var(--surface-raised);
  border: 2px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s, font-weight 0.15s;
  text-align: center;
}

.schedule-btn {
  flex: 1;
  border-radius: var(--radius-md);
  padding: 12px 10px;
  font-size: 0.9rem;
}

.day-chip {
  border-radius: var(--radius-md);
  padding: 11px 14px;
  min-width: 44px;
  font-size: 0.85rem;
  line-height: 1.2;
}

.category-chip:hover,
.schedule-btn:hover,
.day-chip:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.category-chip.active,
.schedule-btn.active,
.day-chip.active {
  border-color: var(--brand-light);
  color: var(--text);
  font-weight: 650;
  background: rgba(var(--brand-rgb), 0.18);
  box-shadow:
    0 0 0 3px rgba(var(--brand-rgb), 0.2),
    0 0 18px rgba(var(--brand-rgb), 0.18);
}

.schedule-btn.active::after,
.category-chip.active::after {
  content: '✓';
  display: inline-block;
  margin-left: 6px;
  color: var(--brand-light);
  font-weight: 700;
  font-size: 0.85em;
}

/* Visually hidden but still focusable/tabbable — display:none would drop
   these radio/checkbox inputs from the tab order entirely, making the
   category/schedule/day chips impossible to select by keyboard. Same
   clip-rect technique as .item-checkbox-input in checklist-presentations.css. */
.category-chip input,
.schedule-btn input,
.day-chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  /* Clicks hit the <label> chip, not the clipped input — avoids a second
     bubbled click when the browser activates the control via the label. */
  pointer-events: none;
}

.category-chip:has(input:focus-visible),
.schedule-btn:has(input:focus-visible),
.day-chip:has(input:focus-visible) {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.recurrence-sub {
  margin-top: 14px;
}

.items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

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

.item-grip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: grab;
  padding: 0;
  border-radius: var(--radius-md);
  transition: color 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.item-grip svg {
  display: block;
}

.item-grip:hover {
  color: var(--brand-light);
  border-color: rgba(var(--brand-rgb), 0.45);
  background: rgba(var(--brand-rgb), 0.1);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.12);
}

.item-grip:active {
  cursor: grabbing;
}

.item-grip:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.item-row-ghost {
  opacity: 0.4;
}

.item-input-wrap {
  flex: 1;
  position: relative;
}

.item-input {
  width: 100%;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 40px 10px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.item-input:focus {
  border-color: rgba(var(--brand-rgb), 0.6);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.12);
}

.item-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all 0.1s;
}

.item-delete:hover {
  color: var(--danger);
  background: rgba(var(--danger-rgb), 0.1);
}

.btn-add-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(var(--brand-rgb), 0.04);
  border: 1.5px dashed rgba(var(--brand-rgb), 0.35);
  border-radius: var(--radius-md);
  color: var(--brand-light);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 14px 16px;
  width: 100%;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn-add-item:hover {
  border-color: var(--brand-light);
  border-style: solid;
  background: rgba(var(--brand-rgb), 0.12);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(var(--brand-rgb), 0.18);
}

.btn-add-item:active {
  transform: translateY(0);
}

.btn-add-item:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .btn-add-item:hover {
    transform: none;
  }
}

.error-msg {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 8px;
  display: none;
}

.error-msg.show {
  display: block;
}

/* ----- Account settings flash / logo ----- */
.settings-flash {
  max-width: var(--content-width-form);
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.5;
}

.settings-flash--success {
  background: color-mix(in srgb, var(--success) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 35%, transparent);
  color: var(--text);
}

.settings-flash--error {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  color: var(--danger);
}

.settings-form .field {
  margin-bottom: 20px;
}

.settings-form .select-input {
  width: 100%;
}

.settings-logo-preview {
  margin-top: 12px;
  padding: 12px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: inline-block;
  max-width: 100%;
}

.settings-logo-preview img {
  display: block;
  max-height: 72px;
  max-width: 220px;
  object-fit: contain;
}

/* ----- Appearance picker (Settings) ----- */
.appearance-section {
  max-width: var(--content-width-form);
  margin-bottom: 24px;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.theme-swatch {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 12px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-align: left;
}

.theme-swatch:hover {
  border-color: var(--border-highlight);
}

.theme-swatch.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.theme-swatch__preview {
  display: flex;
  height: 32px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.theme-swatch__preview span {
  flex: 1;
  min-width: 0;
}

.theme-swatch__name {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.theme-swatch.is-selected .theme-swatch__name {
  color: var(--text);
  font-weight: 600;
}

.theme-save-status {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 12px;
  min-height: 1.2em;
}

.accent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.accent-swatch {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-align: left;
}

.accent-swatch:hover {
  border-color: var(--border-highlight);
}

.accent-swatch.is-selected {
  border-color: var(--secondary);
  box-shadow: 0 0 0 1px var(--secondary);
}

.accent-swatch__chip {
  display: block;
  height: 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.accent-swatch__name {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.accent-swatch.is-selected .accent-swatch__name {
  color: var(--text);
  font-weight: 600;
}

.theme-save-status.is-success {
  color: var(--success);
}

.theme-save-status.is-error {
  color: var(--danger);
}

.font-picker-heading {
  margin-top: 28px;
}

.font-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.font-swatch {
  display: flex;
  align-items: center;
  padding: 16px 14px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-align: left;
}

.font-swatch:hover {
  border-color: var(--border-highlight);
}

.font-swatch.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.font-swatch__name {
  font-size: var(--text-md);
  color: var(--text-muted);
}

.font-swatch.is-selected .font-swatch__name {
  color: var(--text);
  font-weight: 600;
}

/* ----- Danger zone ----- */
.danger-zone {
  background: var(--surface);
  border: 1px solid rgba(var(--danger-rgb), 0.3);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: var(--content-width-form);
  margin-top: 24px;
}

.danger-zone-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--danger);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.danger-zone h2 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.danger-zone p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

/* ----- Delete confirmation modal ----- */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.delete-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 440px;
  width: 100%;
  text-align: left;
}

.delete-dialog h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
  color: var(--danger);
}

.delete-dialog .warning-lede {
  font-weight: 600;
  font-size: 0.92rem;
  margin: 0 0 14px;
  line-height: 1.5;
}

.delete-dialog .warning-list {
  margin: 0 0 20px;
  padding-left: 20px;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.8;
}

.delete-dialog .field {
  margin-bottom: 16px;
}

.delete-dialog label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
  display: block;
}

.delete-dialog input {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  box-sizing: border-box;
}

.delete-dialog input:focus {
  outline: none;
  border-color: var(--danger);
}

.delete-dialog .field-error {
  color: var(--danger);
  font-size: 0.82rem;
  margin-top: 6px;
  min-height: 1.2em;
}

.delete-dialog .actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Stat cards with icons (stats page) */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.stat-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card__value {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stat-card__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 8px;
}

.stat-table tbody tr:hover td {
  background: color-mix(in srgb, var(--accent) 4%, transparent);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  padding: 6px 10px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.header-nav__mobile-actions {
  display: none;
}

@media (max-width: 960px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
  }

  .header-nav {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding-top: 12px;
  }

  .header-nav.is-open {
    display: flex;
  }

  .header-left {
    flex-wrap: wrap;
    width: 100%;
  }

  /* Higher specificity than the page-local .header-actions { display: flex }
     in app.ejs so the desktop-only actions are always hidden at this breakpoint. */
  .app-header .header-actions--desktop {
    display: none;
  }

  .header-nav__mobile-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }

  .header-email {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .table-wrap {
    overflow-x: auto;
    margin: 16px 0;
  }

  .table-wrap .table {
    min-width: 520px;
  }
}

/* ── SHOW ME HOW BUTTON ───────────────────────────── */
.show-me-how-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 99px;
  border: 1px solid rgba(var(--accent-rgb), .45);
  background: rgba(var(--accent-rgb), .07);
  color: var(--secondary);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  white-space: nowrap;
}

.show-me-how-btn:hover {
  border-color: rgba(var(--accent-rgb), .7);
  background: rgba(var(--accent-rgb), .13);
}

@media (max-width: 960px) {
  .show-me-how-btn {
    display: none;
  }
}

/* ── PAGE TOUR CARD ───────────────────────────── */
#page-tour-card {
  position: absolute;
  z-index: 9999;
  width: 280px;
  background: var(--surface);
  border: 1px solid rgba(var(--accent-rgb), .5);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 0 30px rgba(var(--accent-rgb), .18), var(--shadow-card);
  animation: tour-card-in .2s cubic-bezier(.22, 1, .36, 1);
}

@keyframes tour-card-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-tour__label {
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: .1em;
  color: var(--secondary);
  margin-bottom: 5px;
}

.page-tour__title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
  line-height: 1.35;
}

.page-tour__body {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 14px;
}

.page-tour__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-tour__skip {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0;
}

.page-tour__skip:hover {
  color: var(--text);
}

.page-tour__next {
  padding: 6px 16px;
  border-radius: 8px;
  border: none;
  background: var(--secondary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.page-tour__next:hover {
  opacity: .88;
}

/* ── TOUR SPOTLIGHT ───────────────────────────── */
#page-tour-spotlight {
  position: absolute;
  z-index: 9998;
  pointer-events: none;
  border: 2px solid var(--secondary);
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(var(--accent-rgb), .3);
  transition: top .2s ease, left .2s ease, width .2s ease, height .2s ease;
}

/* Completion celebration */
.celebration-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3000;
  overflow: hidden;
}

.celebration-burst {
  position: absolute;
  width: 80px;
  height: 80px;
  transform: translate(-50%, -50%);
  animation: celebration-burst 800ms ease-out forwards;
}

@keyframes celebration-burst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.5);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.5);
  }
}

.celebration-burst__ring {
  width: 100%;
  height: 100%;
  border: 3px solid var(--success);
  border-radius: 50%;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confetti-fall 900ms ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }

  100% {
    opacity: 0;
    transform: translateY(120px) rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {

  .celebration-burst,
  .confetti-piece {
    animation: none !important;
    display: none;
  }
}

/* Upgrade pricing */
.upgrade-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.upgrade-header {
  text-align: center;
  margin-bottom: 40px;
}

.upgrade-badge {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.upgrade-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.upgrade-grid {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 820px;
  width: 100%;
}

.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  flex: 1;
  min-width: 280px;
  display: flex;
  flex-direction: column;
}

.pricing-card--pro {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent), var(--shadow-md);
}

.pricing-card__badge {
  background: var(--accent);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-bottom: 12px;
  align-self: flex-start;
}

.pricing-card__price {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin: 8px 0;
}

.pricing-card__price span {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 400;
}

.pricing-card__features {
  list-style: none;
  margin: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: var(--text-sm);
  flex: 1;
}

.pricing-card__features li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.pricing-card__features li::before {
  content: '✓';
  color: var(--brand);
  font-weight: 700;
}

.actions-zone {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  max-width: var(--content-width-form);
  margin-top: 24px;
}

.actions-zone-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.actions-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.app-layout .btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.app-layout .btn-ghost:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.presentation-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.presentation-chip {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
  min-width: 76px;
  background: var(--surface-raised);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}

.presentation-chip.active {
  border-color: var(--brand-light);
  color: var(--text);
  font-weight: 650;
  background: rgba(var(--brand-rgb), 0.16);
  box-shadow:
    0 0 0 3px rgba(var(--brand-rgb), 0.2),
    0 0 18px rgba(var(--brand-rgb), 0.16);
}

.presentation-chip.active::after {
  content: '✓';
  position: absolute;
  top: 5px;
  right: 7px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--brand-light);
  line-height: 1;
}

/* Visually hidden but still focusable/tabbable — see the same fix on
   .category-chip/.schedule-btn/.day-chip input above. */
.presentation-chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
}

.presentation-chip:has(input:focus-visible) {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.presentation-help {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0 0 12px;
  line-height: 1.45;
  max-width: 42rem;
}

.presentation-hint {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid rgba(var(--brand-rgb), 0.45);
  background: rgba(0, 0, 0, 0.22);
  font-family: var(--font-body);
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted);
  min-height: 1.2em;
}

/* ----- Responsive ----- */
@media (max-width: 960px) {
  .app-header .container {
    flex-wrap: wrap;
    row-gap: 12px;
  }

  .header-left {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .header-email {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Comfortable tap targets — desktop sizing is untouched; this only
     widens the hit area where fingers, not a precise cursor, are doing
     the tapping. ~44px is the common touch-target guideline (WCAG 2.5.5 /
     Apple HIG). Several of these controls sit well under that on desktop
     sizing alone (.item-grip/.item-delete in particular, ~26-30px). */
  .app-layout .btn-primary,
  .app-layout .btn-secondary,
  .btn-add-item,
  .card-action-link,
  .filter-chip {
    min-height: 44px;
  }

  .item-grip,
  .item-delete {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .category-chip,
  .schedule-btn,
  .day-chip {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {

  .app-layout *,
  .app-layout *::before,
  .app-layout *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}