*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Backgrounds — warm cream palette */
  --bg: #faf9f5;
  --surface: #ffffff;
  --surface-alt: #f4f4ec;
  --surface-hover: #f0eee6;
  --surface-deep: #e7e5db;

  /* Text — warm near-blacks */
  --text: #131312;
  --text-secondary: #3c3c39;
  --text-muted: #72716b;
  --text-faint: #9b9991;

  /* Accent — terracotta */
  --accent: #d87756;
  --accent-dark: #c6603f;
  --accent-muted: rgba(216, 119, 86, 0.10);
  --accent-text: #ffffff;

  /* Status */
  --success: #2f7613;
  --success-bg: #e7f1d9;
  --warning: #865a07;
  --warning-bg: #f8eedd;
  --error: #b43232;
  --error-bg: #f8ebeb;

  /* Borders — warm dark at low opacity */
  --border: rgba(31, 30, 29, 0.08);
  --border-strong: rgba(31, 30, 29, 0.15);
  --border-heavy: rgba(31, 30, 29, 0.22);

  /* Shadows — barely there */
  --shadow: 0 1px 3px rgba(0,0,0,0.03);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.05);

  /* Radii */
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;

  /* Layout */
  --nav-height: 64px;
  --header-height: 52px;

  /* Product line colors */
  --product-ice: #c6603f;
  --product-re: #2c83db;
  --product-s: #2f7613;
  --product-u: #5545a1;
  --product-bus: #865a07;
  --product-tram: #b43232;
  --product-ferry: #1a66b2;
  --product-walk: #9b9991;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
}

/* ── Header ───────────────────────────────── */
.app-header {
  background: var(--bg);
  padding: 0 20px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.app-header h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.header-date {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

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

.header-gear {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-xs);
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.15s;
}
.header-gear:active {
  background: var(--surface-alt);
  color: var(--accent-dark);
}

/* ── Content ──────────────────────────────── */
.app-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom);
}

#view-dashboard { padding: 16px; padding-bottom: 24px; }

/* ── Settings bottom sheet ───────────────── */
.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: visibility 0.3s;
}
.settings-overlay.hidden {
  visibility: hidden;
  pointer-events: none;
}
.settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  transition: opacity 0.3s;
}
.settings-overlay:not(.hidden) .settings-backdrop {
  opacity: 1;
}
.settings-sheet {
  position: relative;
  background: var(--bg);
  border-radius: var(--radius) var(--radius) 0 0;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
.settings-overlay:not(.hidden) .settings-sheet {
  transform: translateY(0);
}
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.settings-title {
  font-size: 17px;
  font-weight: 700;
}
.settings-done {
  background: none;
  border: none;
  color: var(--accent-dark);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  -webkit-tap-highlight-color: transparent;
}
.settings-content {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 16px 24px;
}

/* ── Week navigation ─────────────────────── */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.week-btn {
  background: none;
  border: none;
  font-size: 22px;
  font-weight: 600;
  color: var(--accent-dark);
  cursor: pointer;
  padding: 4px 12px;
  border-radius: var(--radius-xs);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.week-btn:active {
  background: var(--surface-alt);
}
.week-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

/* ── Day selector bar ─────────────────────── */
.day-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 0;
}
.day-bar::-webkit-scrollbar { display: none; }

.day-pill {
  flex: 1;
  min-width: 0;
  padding: 9px 0;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--border-strong);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  color: var(--text-muted);
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
}

.day-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.day-pill.today:not(.active) {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.day-pill.disabled:not(.active) {
  opacity: 0.35;
  border-color: var(--border);
}

/* ── Section headers ──────────────────────── */
.section {
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 0 2px;
}

.section-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  font-weight: 700;
}

.section-icon.outbound { background: var(--accent-muted); color: var(--accent-dark); }
.section-icon.return { background: rgba(85, 69, 161, 0.08); color: #5545a1; }

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.section-route {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.section-meta {
  margin-left: auto;
  text-align: right;
}

.section-time {
  font-size: 12px;
  color: var(--text-faint);
  font-weight: 500;
}

/* ── Journey cards ────────────────────────── */
.journey-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.journey-card:active {
  background: var(--surface-alt);
}

.journey-card.expanded {
  border-color: var(--border-heavy);
  box-shadow: var(--shadow-md);
}

.journey-summary {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.journey-times-row {
  position: relative;
  display: flex;
  align-items: center;
}

.journey-time {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.journey-time-delayed {
  text-decoration: line-through;
  color: var(--text-faint);
  font-size: 14px;
  font-weight: 500;
}

.journey-time-actual {
  color: var(--error);
}

.journey-arrow {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  margin: 0 12px;
}

.journey-arrow-line {
  flex: 1;
  height: 1px;
  background: var(--border-heavy);
  min-width: 10px;
}

.journey-arrow-tip {
  color: var(--text-faint);
  font-size: 8px;
  line-height: 1;
  margin-left: -1px;
}

.journey-duration {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--text-faint);
  background: var(--surface);
  padding: 0 8px;
  font-weight: 600;
}

.journey-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.journey-lines {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  flex: 1;
}

.line-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.journey-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.journey-transfers {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.delay-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.delay-badge.on-time {
  background: var(--success-bg);
  color: var(--success);
}

.delay-badge.delayed {
  background: var(--warning-bg);
  color: var(--warning);
}

.delay-badge.severe {
  background: var(--error-bg);
  color: var(--error);
}

/* ── Journey details (expanded) ───────────── */
.journey-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.journey-card.expanded .journey-details {
  max-height: 800px;
}

.journey-details-inner {
  padding: 2px 16px 16px;
  border-top: 1px solid var(--border);
}

.leg {
  display: flex;
  gap: 14px;
  padding: 12px 0 0;
}

.leg-timeline {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 14px;
  flex-shrink: 0;
}

.leg-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 3px solid;
  background: var(--surface);
  flex-shrink: 0;
  z-index: 1;
}

.leg-line {
  flex: 1;
  width: 3px;
  min-height: 24px;
  border-radius: 2px;
}

.leg-dot-end {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  z-index: 1;
}

.leg-content {
  flex: 1;
  min-width: 0;
  padding-bottom: 12px;
}

.leg-station {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leg-time {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.leg-time-delayed {
  text-decoration: line-through;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 500;
}

.leg-time-actual {
  color: var(--error);
  font-weight: 700;
}

.leg-platform {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.leg-transport {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.leg-direction {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leg-walk {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Setup prompt ─────────────────────────── */
.setup-prompt {
  text-align: center;
  padding: 72px 28px;
}

.setup-icon {
  font-size: 44px;
  margin-bottom: 20px;
  opacity: 0.7;
}

.setup-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
  color: var(--text);
}

.setup-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  line-height: 1.6;
}

.setup-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-xs);
  border: none;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.setup-btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}

/* ── No commute message ───────────────────── */
.no-commute {
  text-align: center;
  padding: 56px 28px;
  color: var(--text-secondary);
}

.no-commute-icon {
  font-size: 40px;
  margin-bottom: 14px;
  opacity: 0.5;
}

.no-commute h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.no-commute p {
  font-size: 13px;
  line-height: 1.6;
}

/* ── Loading ──────────────────────────────── */
.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 20px 16px;
  margin-bottom: 10px;
}

.skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, var(--surface-alt) 25%, var(--surface-hover) 50%, var(--surface-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
  margin-bottom: 12px;
}

.skeleton-line:last-child { margin-bottom: 0; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.tall { height: 24px; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Last updated / refresh ───────────────── */
.last-updated {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--text-faint);
}

.refresh-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.refresh-btn:active { transform: scale(0.92); background: var(--surface-alt); }
.refresh-btn.spinning svg { animation: spin 0.8s linear infinite; }

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

/* ── Error state ──────────────────────────── */
.error-card {
  background: var(--error-bg);
  border: 1px solid rgba(180, 50, 50, 0.15);
  border-radius: var(--radius-sm);
  padding: 18px;
  text-align: center;
  margin-bottom: 10px;
}

.error-card p {
  font-size: 13px;
  color: var(--error);
  margin-bottom: 12px;
}

.error-retry {
  padding: 8px 22px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--error);
  background: transparent;
  color: var(--error);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.error-retry:active { background: var(--error-bg); }

/* ── Schedule view ────────────────────────── */
.schedule-section {
  margin-bottom: 24px;
}

.schedule-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-faint);
  margin-bottom: 10px;
  padding: 0 4px;
}

.station-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
}

.station-row {
  display: flex;
  align-items: center;
  padding: 16px;
  gap: 14px;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.station-row:active { background: var(--surface-alt); }
.station-row + .station-row { border-top: 1px solid var(--border); }

.station-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.station-icon.home { background: var(--accent-muted); }
.station-icon.work { background: rgba(85, 69, 161, 0.08); }

.station-label {
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.station-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-top: 2px;
}

.station-name.placeholder {
  color: var(--text-faint);
  font-weight: 400;
}

.station-chevron {
  margin-left: auto;
  color: var(--text-faint);
  font-size: 18px;
}

/* ── Day schedule cards ───────────────────── */
.day-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  transition: opacity 0.2s;
}

.day-card.disabled { opacity: 0.45; }

.day-card-header {
  display: flex;
  align-items: center;
  padding: 16px;
  gap: 12px;
}

.day-card-name {
  font-size: 15px;
  font-weight: 700;
  flex: 1;
  color: var(--text);
}

.toggle {
  position: relative;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

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

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--surface-deep);
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.25s;
}

.toggle input:checked + .toggle-track {
  background: var(--accent);
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.25s;
  pointer-events: none;
}

.toggle input:checked ~ .toggle-thumb {
  transform: translateX(20px);
}

.day-card-times {
  display: flex;
  gap: 12px;
  padding: 0 16px 16px;
}

.time-field {
  flex: 1;
}

.time-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.time-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-alt);
  -webkit-appearance: none;
  appearance: none;
  font-variant-numeric: tabular-nums;
  color-scheme: light;
}

.time-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── Mode toggle ──────────────────────────── */
.mode-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
}

.mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  gap: 12px;
}

.mode-row + .mode-row {
  border-top: 1px solid var(--border);
}

.mode-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.mode-toggle {
  display: flex;
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.mode-btn {
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

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

/* ── Search overlay ───────────────────────── */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(19, 19, 18, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.search-overlay.hidden {
  display: none;
}

.search-modal {
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  border-top: 1px solid var(--border-strong);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.search-header {
  display: flex;
  align-items: center;
  padding: 16px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.search-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-faint);
  pointer-events: none;
}

.search-header input {
  width: 100%;
  padding: 11px 14px 11px 36px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  font-size: 16px;
  background: var(--surface-alt);
  color: var(--text);
  outline: none;
}

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

.search-cancel {
  background: none;
  border: none;
  color: var(--accent-dark);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  padding: 8px;
}

.search-results {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  padding-bottom: env(safe-area-inset-bottom);
}

.search-result {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.search-result:active { background: var(--surface-alt); }
.search-result + .search-result { border-top: 1px solid var(--border); }

.search-result-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-xs);
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.search-result-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.search-result-type {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 2px;
}

.search-result-products {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.search-result-product {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-alt);
  color: var(--text-muted);
  font-weight: 600;
}

.search-empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--text-faint);
  font-size: 14px;
}

.search-loading {
  text-align: center;
  padding: 24px;
  color: var(--text-faint);
  font-size: 14px;
}

/* ─── Via stops & product filter ──────────────────── */
.station-icon.via {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: var(--accent-muted);
  color: var(--accent);
  flex-shrink: 0;
  font-weight: 700;
}

.via-add { opacity: 0.7; }
.via-add:hover { opacity: 1; }

.via-remove {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-faint);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.via-remove:hover {
  color: var(--error);
  background: var(--error-bg);
}

.product-filter {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.product-filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.product-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.product-chip {
  padding: 5px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  text-decoration: line-through;
  opacity: 0.6;
}
.product-chip.active {
  background: var(--accent-muted);
  border-color: var(--accent);
  color: var(--accent-dark);
  text-decoration: none;
  opacity: 1;
}

/* ─── Timetable settings ─────────────────────────── */
.timetable-url-row {
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}
.timetable-url-row:last-of-type { border-bottom: none; }

.timetable-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 120px;
}

.timetable-input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}
.timetable-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}
.timetable-input.short { max-width: 80px; flex: 0; font-size: 16px; text-align: center; }

.timetable-hint {
  font-size: 12px;
  color: var(--text-faint);
}

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

.timetable-refresh-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.timetable-refresh-btn:hover { background: var(--accent-dark); }
.timetable-refresh-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.timetable-error {
  font-size: 12px;
  color: var(--error);
  flex: 1;
}
.timetable-status {
  font-size: 12px;
  color: var(--success);
  flex: 1;
}

.day-card-off {
  font-size: 12px;
  color: var(--text-faint);
}
.day-card-count {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}
.time-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ─── Timetable events on dashboard ──────────────── */
.timetable-events {
  margin: 0 16px 12px;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border);
}
.timetable-events-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.timetable-events-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.timetable-event {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.timetable-event-time {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  min-width: 95px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.timetable-event-info { flex: 1; min-width: 0; }
.timetable-event-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}
.timetable-event-meta {
  display: flex;
  gap: 8px;
  margin-top: 2px;
  flex-wrap: wrap;
}
.timetable-event-code,
.timetable-event-room {
  font-size: 11px;
  color: var(--text-faint);
}
.timetable-event-room::before {
  content: '\1F4CD';
  margin-right: 2px;
  font-size: 10px;
}
