/* ════════════════════════════════════════════════════════
   Reminder COC — Design System
   Dark-first, Mobile-first, Glassmorphism
   ════════════════════════════════════════════════════════ */

/* ── Google Fonts ───────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

/* ── CSS Variables (Dark Theme Default) ─────────────────── */
:root {
  /* Colors */
  --c-bg:          #0f0f1a;
  --c-surface:     #1a1a2e;
  --c-surface-2:   #1e2040;
  --c-surface-3:   #252855;
  --c-border:      rgba(255,255,255,0.08);
  --c-border-2:    rgba(255,255,255,0.15);

  --c-text:        #e8eaf0;
  --c-text-2:      #9499b0;
  --c-text-3:      #5e6280;

  --c-gold:        #f5a623;
  --c-gold-light:  #ffc649;
  --c-gold-dim:    rgba(245,166,35,0.15);
  --c-gold-glow:   rgba(245,166,35,0.3);

  --c-green:       #4ade80;
  --c-green-dim:   rgba(74,222,128,0.12);
  --c-green-glow:  rgba(74,222,128,0.3);

  --c-red:         #f87171;
  --c-red-dim:     rgba(248,113,113,0.12);
  --c-red-glow:    rgba(248,113,113,0.3);

  --c-blue:        #60a5fa;
  --c-blue-dim:    rgba(96,165,250,0.12);

  --c-accent:      #7c3aed;
  --c-accent-2:    #6d28d9;
  --c-accent-dim:  rgba(124,58,237,0.2);

  --c-primary:     #4f46e5;
  --c-primary-2:   #4338ca;
  --c-primary-dim: rgba(79,70,229,0.2);

  /* Typography */
  --font-body:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;

  /* Radius */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  24px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow-gold: 0 0 20px var(--c-gold-glow);
  --shadow-glow-green: 0 0 20px var(--c-green-glow);

  /* Transitions */
  --t-fast:   150ms ease;
  --t-normal: 250ms ease;
  --t-slow:   400ms ease;

  /* Layout */
  --nav-height: 64px;
  --max-width:  430px;
}

/* ── Light Theme Override ────────────────────────────────── */
[data-theme="light"] {
  --c-bg:        #f0f2f8;
  --c-surface:   #ffffff;
  --c-surface-2: #f8f9fd;
  --c-surface-3: #eef0fa;
  --c-border:    rgba(0,0,0,0.08);
  --c-border-2:  rgba(0,0,0,0.15);
  --c-text:      #1a1a2e;
  --c-text-2:    #4a4f6e;
  --c-text-3:    #8a8fac;
  --c-gold-dim:  rgba(245,166,35,0.1);
  --c-green-dim: rgba(22,163,74,0.1);
  --c-red-dim:   rgba(220,38,38,0.1);
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.12);
}

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--c-bg);
  color: var(--c-text);
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--t-slow), color var(--t-slow);
}

body.modal-open {
  overflow: hidden;
}

/* ── App Shell ───────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
}

#page-content {
  flex: 1;
  padding: var(--space-4);
  padding-bottom: calc(var(--nav-height) + var(--space-4));
  overflow-y: auto;
}

/* ── Bottom Navigation ───────────────────────────────────── */
#bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  height: var(--nav-height);
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
  align-items: stretch;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--c-text-3);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  transition: color var(--t-fast), background var(--t-fast);
  padding: var(--space-2) var(--space-1);
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.nav-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 40px;
  height: 3px;
  background: var(--c-gold);
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  transition: transform var(--t-normal);
}

.nav-item--active {
  color: var(--c-gold);
}

.nav-item--active::before {
  transform: translateX(-50%) scaleX(1);
}

.nav-item__icon {
  font-size: 22px;
  line-height: 1;
  transition: transform var(--t-fast);
}

.nav-item:active .nav-item__icon {
  transform: scale(0.85);
}

/* ── Page Header ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  padding-top: var(--space-2);
}

.page-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--c-gold-light), var(--c-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Section Labels ──────────────────────────────────────── */
.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin: var(--space-5) 0 var(--space-3);
  padding-left: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.section-label--attention {
  color: var(--c-gold);
}

.section-label--active {
  color: var(--c-text-2);
}

.section-label--attention::after,
.section-label--active::after {
  content: '';
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: 0.25;
}

/* ── Upgrade Cards ───────────────────────────────────────── */
.upgrade-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.upgrade-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--space-4);
  position: relative;
  overflow: hidden;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  /* No animation by default — prevents flicker on re-render */
}

.upgrade-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}

.upgrade-card--active::before { background: var(--c-blue); }
.upgrade-card--completed::before { background: var(--c-green); }

.upgrade-card--completed {
  border-color: rgba(74,222,128,0.2);
  background: linear-gradient(135deg, var(--c-surface) 0%, rgba(74,222,128,0.04) 100%);
  box-shadow: 0 0 0 1px rgba(74,222,128,0.1), var(--shadow-md);
}

.upgrade-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.upgrade-card__account-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.upgrade-card__account-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-2);
}

.upgrade-card__th {
  font-size: 11px;
  font-weight: 600;
  color: var(--c-gold);
  background: var(--c-gold-dim);
  padding: 2px 8px;
  border-radius: var(--r-full);
}

.upgrade-card__status {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.upgrade-card__status--done {
  color: var(--c-green);
  display: flex;
  align-items: center;
  gap: 4px;
}

.upgrade-card__upgrade-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: var(--space-3);
  line-height: 1.3;
}

/* Countdown */
.upgrade-card__countdown {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -1px;
  color: var(--c-gold);
  text-shadow: var(--shadow-glow-gold);
  margin-bottom: var(--space-1);
  line-height: 1;
}

.upgrade-card__finish-time {
  font-size: 12px;
  color: var(--c-text-3);
  margin-bottom: var(--space-3);
}

.upgrade-card__next {
  font-size: 13px;
  color: var(--c-text-2);
  margin-bottom: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--c-surface-2);
  border-radius: var(--r-sm);
  border: 1px solid var(--c-border);
}

.upgrade-card__next-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--c-text-3);
  display: block;
  margin-bottom: 2px;
}

.upgrade-card__actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* ── Account Cards ───────────────────────────────────────── */
.accounts-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.account-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--space-4);
  animation: slideUp 0.3s ease both;
}

.account-card__main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-3);
}

.account-card__name {
  font-size: 16px;
  font-weight: 700;
  color: var(--c-text);
}

.account-card__th {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-gold);
  background: var(--c-gold-dim);
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--r-full);
  margin-top: var(--space-1);
}

.account-card__note {
  font-size: 12px;
  color: var(--c-text-3);
  margin-top: var(--space-1);
}

.account-card__stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  align-items: flex-end;
}

.account-card__actions {
  display: flex;
  gap: var(--space-2);
}

/* ── History ─────────────────────────────────────────────── */
.history-filters {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

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

.history-date-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--c-text-3);
  padding: var(--space-4) 0 var(--space-2);
}

.history-item {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-2);
  animation: slideUp 0.2s ease both;
}

.history-item--cancelled {
  opacity: 0.6;
}

.history-item__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-1);
}

.history-item__account {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-2);
}

.history-item__status {
  font-size: 11px;
  font-weight: 700;
  color: var(--c-green);
}

.history-item--cancelled .history-item__status {
  color: var(--c-text-3);
}

.history-item__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: var(--space-1);
}

.history-item__meta {
  font-size: 11px;
  color: var(--c-text-3);
  font-family: var(--font-mono);
}

.history-item__speed,
.history-item__next {
  font-size: 11px;
  color: var(--c-text-3);
  margin-top: var(--space-1);
}

.history-item__actions {
  margin-top: var(--space-2);
}

/* ── Settings ────────────────────────────────────────────── */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.settings-section {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.settings-section__title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--c-text-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface-2);
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid var(--c-border);
  gap: var(--space-3);
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-item--action {
  flex-wrap: wrap;
}

.settings-item__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.settings-item__label {
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text);
}

.settings-item__desc {
  font-size: 12px;
  color: var(--c-text-3);
}

.settings-hint {
  font-size: 12px;
  color: var(--c-text-3);
  padding: 0 var(--space-4) var(--space-3);
  line-height: 1.5;
}

.settings-hint--warning {
  color: var(--c-red);
}

/* ── Toggle Switch ───────────────────────────────────────── */
.toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle__slider {
  position: absolute;
  inset: 0;
  background: var(--c-surface-3);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: background var(--t-normal);
}

.toggle__slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 4px;
  top: 4px;
  background: white;
  border-radius: var(--r-full);
  transition: transform var(--t-normal);
  box-shadow: var(--shadow-sm);
}

.toggle input:checked + .toggle__slider {
  background: var(--c-primary);
}

.toggle input:checked + .toggle__slider::before {
  transform: translateX(20px);
}

.toggle input:disabled + .toggle__slider {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  min-height: 40px;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--t-fast);
  border-radius: inherit;
}

.btn:active::after {
  background: rgba(255,255,255,0.1);
}

.btn--primary {
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  color: white;
  box-shadow: 0 2px 8px var(--c-primary-dim);
}

.btn--primary:hover {
  box-shadow: 0 4px 16px var(--c-primary-dim);
  transform: translateY(-1px);
}

.btn--accent {
  background: linear-gradient(135deg, var(--c-gold), #e8920a);
  color: #1a1a0e;
  font-weight: 700;
}

.btn--accent:hover {
  box-shadow: var(--shadow-glow-gold);
  transform: translateY(-1px);
}

.btn--ghost {
  background: var(--c-surface-2);
  color: var(--c-text-2);
  border-color: var(--c-border);
}

.btn--ghost:hover {
  background: var(--c-surface-3);
  color: var(--c-text);
}

.btn--danger {
  background: linear-gradient(135deg, var(--c-red), #dc2626);
  color: white;
}

.btn--danger:hover {
  box-shadow: var(--shadow-glow-green);
}

.btn--danger-ghost {
  color: var(--c-red) !important;
  border-color: rgba(248,113,113,0.2) !important;
}

.btn--danger-ghost:hover {
  background: var(--c-red-dim) !important;
}

.btn--sm { font-size: 12px; padding: 6px 12px; min-height: 32px; }
.btn--xs { font-size: 11px; padding: 4px 10px; min-height: 28px; }
.btn--full { width: 100%; }

.btn--icon-label .btn__icon {
  font-size: 18px;
  line-height: 1;
}

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-full);
  letter-spacing: 0.3px;
}

.badge--active {
  background: var(--c-blue-dim);
  color: var(--c-blue);
}

.badge--done {
  background: var(--c-green-dim);
  color: var(--c-green);
}

/* ── Form Elements ───────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-2);
  letter-spacing: 0.3px;
}

.required {
  color: var(--c-red);
}

.form-input,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border-2);
  border-radius: var(--r-md);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
  min-height: 48px;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239499b0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
  cursor: pointer;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-dim);
  background: var(--c-surface);
}

.form-input--sm,
.form-select--sm {
  padding: var(--space-2) var(--space-3);
  font-size: 14px;
  min-height: 40px;
}

.form-select--sm {
  padding-right: 32px;
}

.form-error {
  font-size: 12px;
  color: var(--c-red);
  font-weight: 500;
}

.form-hint {
  font-size: 12px;
  color: var(--c-gold);
  margin-top: var(--space-2);
}

.form-fieldset {
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}

.form-legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-2);
  padding: 0 var(--space-2);
}

.duration-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.duration-row .form-group {
  margin-bottom: 0;
}

.speed-row {
  display: flex;
  gap: var(--space-2);
}

.speed-row .form-select--sm {
  flex: 1;
}

.speed-row .form-input--sm {
  flex: 1;
}

/* ── Modal / Bottom Sheet ────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-normal);
}

.modal-overlay--visible {
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}

.modal-overlay--sheet {
  align-items: flex-end;
}

.modal {
  background: var(--c-surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  width: 100%;
  max-width: var(--max-width);
  max-height: 92dvh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform var(--t-slow) cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-lg);
  -webkit-overflow-scrolling: touch;
}

.modal--visible {
  transform: translateY(0);
}

.modal:not(.modal--sheet) {
  border-radius: var(--r-xl);
  max-width: 360px;
  transform: scale(0.9);
  opacity: 0;
  transition: transform var(--t-normal), opacity var(--t-normal);
  margin: var(--space-4);
}

.modal:not(.modal--sheet).modal--visible {
  transform: scale(1);
  opacity: 1;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-5) 0;
  position: sticky;
  top: 0;
  background: var(--c-surface);
  z-index: 1;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--c-border);
}

.modal__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--c-text);
}

.modal__close {
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  border: none;
  background: var(--c-surface-2);
  color: var(--c-text-2);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
  flex-shrink: 0;
}

.modal__close:hover {
  background: var(--c-surface-3);
  color: var(--c-text);
}

.modal__body {
  padding: var(--space-5);
}

.modal__message {
  font-size: 14px;
  color: var(--c-text-2);
  line-height: 1.6;
}

.modal__actions {
  display: flex;
  gap: var(--space-3);
  padding: 0 var(--space-5) var(--space-6);
  flex-wrap: wrap;
}

.modal__actions .btn {
  flex: 1;
  min-width: 120px;
}

/* ── Toast ───────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--space-4));
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: calc(100% - var(--space-8));
  max-width: calc(var(--max-width) - var(--space-8));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--t-normal), transform var(--t-normal);
  border: 1px solid var(--c-border);
}

.toast--visible {
  opacity: 1;
  transform: translateY(0);
}

.toast--success { background: var(--c-surface); color: var(--c-green); border-color: rgba(74,222,128,0.3); }
.toast--error   { background: var(--c-surface); color: var(--c-red); border-color: rgba(248,113,113,0.3); }
.toast--info    { background: var(--c-surface); color: var(--c-text); border-color: var(--c-border-2); }
.toast--warning { background: var(--c-surface); color: var(--c-gold); border-color: rgba(245,166,35,0.3); }

.toast__icon {
  font-size: 16px;
  flex-shrink: 0;
}

.toast__msg {
  flex: 1;
  line-height: 1.4;
}

/* ── Loading & Empty States ──────────────────────────────── */
.loading-spinner {
  display: flex;
  justify-content: center;
  padding: var(--space-10);
}

.loading-spinner span {
  width: 36px;
  height: 36px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-gold);
  border-radius: var(--r-full);
  animation: spin 0.8s linear infinite;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-10) var(--space-6);
  gap: var(--space-3);
}

.empty-state__icon {
  font-size: 48px;
  margin-bottom: var(--space-2);
}

.empty-state__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--c-text);
}

.empty-state__desc {
  font-size: 13px;
  color: var(--c-text-3);
  line-height: 1.6;
  max-width: 280px;
}

.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-10);
  gap: var(--space-4);
  text-align: center;
  color: var(--c-text-2);
}

.error-state__icon {
  font-size: 48px;
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Countdown pulse when < 5 minutes */
.upgrade-card__countdown[data-urgent="true"] {
  color: var(--c-red);
  text-shadow: var(--shadow-glow-green);
}

/* ── Notification Banner (first-use) ─────────────────────── */
.notif-banner {
  background: linear-gradient(135deg, var(--c-primary-dim), var(--c-accent-dim));
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: var(--r-lg);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.notif-banner__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.notif-banner__desc {
  font-size: 13px;
  color: var(--c-text-2);
  line-height: 1.5;
}

.notif-banner__actions {
  display: flex;
  gap: var(--space-2);
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-border-2); border-radius: 2px; }

/* ── Selection ───────────────────────────────────────────── */
::selection { background: var(--c-primary-dim); color: var(--c-text); }

/* ── Focus visible ───────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* ── Responsive (Desktop) ────────────────────────────────── */
@media (min-width: 640px) {
  #app {
    border-left: 1px solid var(--c-border);
    border-right: 1px solid var(--c-border);
    min-height: 100dvh;
  }

  #bottom-nav {
    border-radius: 0;
  }

  .modal {
    border-radius: var(--r-xl) !important;
    max-width: 480px !important;
  }

  .modal-overlay--sheet {
    align-items: center !important;
  }
}

/* ── Input placeholder ───────────────────────────────────── */
::placeholder { color: var(--c-text-3); }

/* ── Select option styling (limited browser support) ─────── */
option {
  background: var(--c-surface);
  color: var(--c-text);
}

/* ── Splash / Install banner ─────────────────────────────── */
#install-prompt {
  display: none;
  position: fixed;
  bottom: calc(var(--nav-height) + var(--space-4));
  left: var(--space-4);
  right: var(--space-4);
  max-width: calc(var(--max-width) - var(--space-8));
  margin: 0 auto;
  background: var(--c-surface);
  border: 1px solid var(--c-border-2);
  border-radius: var(--r-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  animation: slideUp 0.3s ease;
}

#install-prompt.visible { display: flex; gap: var(--space-3); align-items: center; }
#install-prompt p { flex: 1; font-size: 13px; color: var(--c-text-2); }
