/* ─── Custom Properties ─────────────────────────────────────── */
:root {
  --bg: #e0e0e4;
  --bg-card: #f0f0f0;
  --bg-elevated: #e8e8ee;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --text-placeholder: #9ca3af;
  --accent: #7c3aed;
  --accent-light: #a855f7;
  --accent-faint: rgba(124, 58, 237, 0.12);
  --border: #d1d5db;
  --border-to: #7c3aed;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
  --transition: 200ms ease;
}

[data-theme="dark"] {
  --bg: #000000;
  --bg-card: #000000;
  --bg-elevated: #1a1a1a;
  --text: #f0f0f0;
  --text-muted: #9ca3af;
  --text-placeholder: #6b7280;
  --accent: #9333ea;
  --accent-light: #a855f7;
  --accent-faint: rgba(147, 51, 234, 0.15);
  --border: #2d2d2d;
  --border-to: #9333ea;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
}

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

html { height: 100%; font-size: 16px; }

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button { cursor: pointer; }

a { color: var(--accent); text-decoration: none; }

/* ─── App Layout ────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  max-width: 600px;
  margin: 0 auto;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}

/* ─── Top Bar ───────────────────────────────────────────────── */
#top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
}

#app-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
}

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

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: var(--bg-elevated);
  transition: background var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.icon-btn:active { background: var(--accent-faint); }

/* ─── Blocks Area ───────────────────────────────────────────── */
#blocks {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 16px;
  overflow-y: auto;
}

/* ─── Block Card ────────────────────────────────────────────── */
.block-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.block-card:active { background: var(--bg-elevated); }

.block-card.block-to {
  border: 2.5px solid var(--border-to);
  box-shadow: 0 0 0 3px var(--accent-faint), var(--shadow);
}

.block-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.block-to .block-label { color: var(--accent); }

.block-value {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
}

.block-value-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.block-value-text { flex: 1; }

.contact-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.contact-name.empty {
  color: var(--text-placeholder);
  font-style: italic;
}

.phone-number {
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.block-to .phone-number {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent-light);
}

.block-hint {
  color: var(--text-placeholder);
  font-style: italic;
  font-size: 0.9rem;
  align-self: center;
}

/* Delay block — compact */
.block-delay {
  padding: 10px 16px;
}

.block-delay .block-value { min-height: 28px; }
.block-delay .phone-number { font-size: 0.9rem; font-weight: 400; }

/* ─── Callback Button ───────────────────────────────────────── */
#callback-area {
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0));
  background: var(--bg);
}

#btn-callback {
  width: 100%;
  height: 64px;
  border-radius: var(--radius);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background var(--transition), transform 80ms ease, box-shadow var(--transition);
  box-shadow: var(--shadow-lg);
}

#btn-callback.ready {
  background: var(--success);
  color: #fff;
}

#btn-callback.counting {
  background: var(--danger);
  color: #fff;
  animation: pulse-red 1s ease infinite;
}

#btn-callback.disabled {
  background: var(--bg-elevated);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}

#btn-callback:active:not(.disabled) { transform: scale(0.97); }

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50% { box-shadow: 0 0 0 12px rgba(239,68,68,0); }
}

/* ─── Full-Screen Overlay ───────────────────────────────────── */
#overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 600px;
  margin: 0 auto;
}

#overlay.open { transform: translateY(0); }

#overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}

#overlay-title {
  font-size: 1.1rem;
  font-weight: 700;
}

#overlay-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

#overlay-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  -webkit-overflow-scrolling: touch;
}

/* ─── List Items ────────────────────────────────────────────── */
.list-item {
  position: relative;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: background var(--transition);
  overflow: hidden;
}

.list-item:active { background: var(--bg-elevated); }

.list-item.selected { background: var(--accent-faint); }
.list-item.selected::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.list-item-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.list-item.selected .list-item-icon { background: var(--accent-faint); }

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

.list-item-title {
  font-size: 1rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--accent-faint);
  color: var(--accent);
  flex-shrink: 0;
}

.list-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 20px;
}

.list-section-header {
  padding: 12px 20px 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ─── Swipe Delete ──────────────────────────────────────────── */
.swipeable {
  position: relative;
  overflow: hidden;
}

.swipe-actions {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  transform: translateX(100%);
  transition: transform var(--transition);
}

.swipe-btn {
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  gap: 6px;
}

.swipe-btn.delete { background: var(--danger); color: #fff; }
.swipe-btn.pin { background: var(--accent); color: #fff; }

.swipe-content {
  transition: transform var(--transition);
}

/* ─── Undo Row ──────────────────────────────────────────────── */
.undo-row {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  margin: 4px 20px;
}

.undo-text { font-size: 0.9rem; color: var(--text-muted); }

.undo-bar-wrap {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 8px;
}

.undo-bar {
  height: 100%;
  background: var(--accent);
  width: 100%;
  border-radius: 2px;
  transition: width 5s linear;
}

.undo-btn {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  padding: 4px 8px;
}

/* ─── Number Entry Input ────────────────────────────────────── */
.input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
}

.input-field {
  flex: 1;
  height: 44px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 1rem;
  border: 1.5px solid transparent;
  transition: border-color var(--transition);
}

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

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

.input-submit {
  height: 44px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* ─── Settings Panel ────────────────────────────────────────── */
#settings-panel {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  max-width: 600px;
  margin: 0 auto;
  background: var(--bg);
  transform: translateX(100%);
  transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

#settings-panel.open { transform: translateX(0); }

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.settings-title { font-size: 1.15rem; font-weight: 700; }

.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.settings-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  cursor: pointer;
  transition: background var(--transition);
}

.settings-item:active { background: var(--bg-elevated); }

.settings-item-icon {
  font-size: 1.3rem;
  width: 40px;
  text-align: center;
}

.settings-item-content { flex: 1; }

.settings-item-title { font-size: 1rem; font-weight: 500; }

.settings-item-sub { font-size: 0.78rem; color: var(--text-muted); }

.settings-item-arrow {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.settings-item.danger .settings-item-title { color: var(--danger); }

/* ─── Modal ─────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-backdrop.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 400px;
  transform: translateY(20px);
  transition: transform var(--transition);
}

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

.modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 12px; }

.modal-text { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 20px; line-height: 1.6; }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-secondary {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  background: var(--bg-elevated);
  color: var(--text);
}

.btn-danger {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  background: var(--danger);
  color: #fff;
}

.btn-primary {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  background: var(--accent);
  color: #fff;
}

/* ─── Toast ─────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: calc(90px + env(safe-area-inset-bottom, 0));
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(calc(100vw - 32px), 400px);
}

.toast {
  background: var(--text);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: 99px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in 200ms ease forwards;
  pointer-events: none;
  text-align: center;
}

.toast.success { background: var(--success); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(-8px) scale(0.95); }
}

/* ─── Form fields in overlay ────────────────────────────────── */
.form-group {
  padding: 12px 20px;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  height: 48px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 1rem;
  transition: border-color var(--transition);
}

.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-placeholder); }

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

.form-error {
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 6px;
}

.form-success {
  font-size: 0.8rem;
  color: var(--success);
  margin-top: 6px;
}

.form-submit {
  margin: 8px 20px 16px;
  width: calc(100% - 40px);
  height: 50px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1rem;
}

/* ─── Balance chip ──────────────────────────────────────────── */
.balance-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--accent-faint);
  color: var(--accent);
}

/* ─── Countdown ring ────────────────────────────────────────── */
.countdown-ring {
  width: 28px;
  height: 28px;
  position: relative;
  flex-shrink: 0;
}

.countdown-ring svg {
  width: 28px;
  height: 28px;
  transform: rotate(-90deg);
}

.countdown-ring circle {
  fill: none;
  stroke-width: 3;
}

.countdown-ring .bg { stroke: rgba(255,255,255,0.3); }
.countdown-ring .fg { stroke: #fff; stroke-dasharray: 75.4; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }

/* ─── Language selector ─────────────────────────────────────── */
.lang-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 999;
  min-width: 160px;
  display: none;
}

.lang-menu.open { display: block; }

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background var(--transition);
}

.lang-option:active, .lang-option.active { background: var(--accent-faint); }
.lang-option.active { font-weight: 600; }

/* ─── QR Code ───────────────────────────────────────────────── */
#qr-canvas {
  display: block;
  margin: 20px auto;
  border-radius: var(--radius-sm);
}

#qr-video-wrap {
  position: relative;
  margin: 16px 20px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}

#qr-video {
  width: 100%;
  display: block;
}

.qr-overlay-frame {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-frame {
  width: 200px;
  height: 200px;
  border: 3px solid var(--accent);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
}

/* ─── Delay Block ───────────────────────────────────────────── */
.delay-picker {
  padding: 16px 20px;
}

.delay-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.delay-option:last-child { border-bottom: none; }

.delay-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.delay-radio.checked {
  border-color: var(--accent);
  background: var(--accent);
}

.delay-radio.checked::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

.datetime-input {
  width: 100%;
  height: 48px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 1rem;
  margin-top: 8px;
  color-scheme: dark light;
}

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

/* ─── Credit Send ───────────────────────────────────────────── */
.credit-amount-input {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  width: 100%;
  background: none;
  border: none;
  color: var(--accent);
  padding: 8px;
}

.credit-account-input {
  font-size: 1.8rem;
  font-weight: 700;
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  padding: 4px 0;
}

.credit-account-input::placeholder { color: var(--text-placeholder); font-weight: 400; font-size: 1.2rem; }

/* ─── Send Credit Button ────────────────────────────────────── */
.btn-send-credit {
  width: 100%;
  height: 64px;
  border-radius: var(--radius);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background var(--transition), transform 80ms ease, box-shadow var(--transition);
}

.btn-send-credit.ready {
  background: var(--success);
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.btn-send-credit.counting {
  background: var(--danger);
  color: #fff;
  box-shadow: var(--shadow-lg);
  animation: pulse-red 1s ease infinite;
}

.btn-send-credit.disabled {
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn-send-credit:active:not(.disabled) { transform: scale(0.97); }

/* ─── Loading spinner ───────────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
  flex-shrink: 0;
}

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

/* ─── Preset Block ──────────────────────────────────────────── */
.preset-name-input {
  background: none;
  border: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  width: 100%;
  cursor: text;
  padding: 0;
}

.preset-name-input::placeholder { color: var(--text-placeholder); font-style: italic; }

.preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px 0 2px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.preset-grid-item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── Landing Page ──────────────────────────────────────────── */
.landing-wrap {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 24px calc(32px + env(safe-area-inset-bottom, 0));
}

.landing-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 32px;
}

.landing-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.landing-logo-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}

.landing-logo-icon img { width: 100%; height: 100%; object-fit: cover; }

.landing-app-name {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -1px;
}

.landing-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.landing-description {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 24px;
}

.landing-features {
  list-style: none;
  margin-bottom: 32px;
}

.landing-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 6px 0;
}

.landing-features li::before {
  content: '✓';
  color: var(--success);
  font-weight: 700;
  flex-shrink: 0;
}

.install-btn {
  width: 100%;
  height: 56px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 16px;
}

.install-btn:active { transform: scale(0.97); }
.install-btn:disabled { background: var(--bg-elevated); color: var(--text-muted); box-shadow: none; }

.open-btn {
  width: 100%;
  height: 50px;
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.pwa-section {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.pwa-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.pwa-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (min-width: 601px) {
  #app, #overlay, #settings-panel {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }

  body { background: var(--bg-elevated); }
  #app { box-shadow: var(--shadow-lg); }
}

/* ─── Accessibility ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
