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

:root {
  --bg: #F8F9FA;
  --bg-glow: rgba(79, 70, 229, 0.07);
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --surface-2: rgba(248, 249, 250, 0.95);
  --surface-3: #eef1f6;
  --border: rgba(15, 27, 45, 0.08);
  --text: #0f1b2d;
  --muted: #5d6b80;
  --text-muted: #5d6b80;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-weak: rgba(79, 70, 229, 0.10);
  --primary-grad: linear-gradient(135deg, #4f46e5, #7c3aed);
  --violet: #7c3aed;
  --violet-weak: rgba(124, 58, 237, 0.12);
  --glass-blur: blur(14px);
  --glass-border: rgba(255, 255, 255, 0.65);
  /* Liquid Glass — optik cam katmanı (Apple HIG yaklaşımı) */
  --liquid-glass-bg: rgba(255, 255, 255, 0.44);
  --liquid-glass-blur: blur(40px) saturate(1.85) brightness(1.05);
  --liquid-glass-rim: rgba(255, 255, 255, 0.72);
  --liquid-glass-shadow:
    0 0 0 0.5px rgba(255, 255, 255, 0.5),
    0 12px 40px rgba(15, 27, 45, 0.11),
    0 2px 8px rgba(15, 27, 45, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -0.5px 0 rgba(255, 255, 255, 0.18);
  --tab-bar-glass-bg: var(--liquid-glass-bg);
  --tab-bar-glass-blur: var(--liquid-glass-blur);
  --tab-bar-glass-border: color-mix(in srgb, var(--liquid-glass-rim) 55%, transparent);
  --tab-bar-glass-shadow: var(--liquid-glass-shadow);
  --tab-bar-active-pill-bg: rgba(255, 255, 255, 0.52);
  --tab-bar-active-pill-blur: blur(16px) saturate(1.6);
  --tab-bar-active-pill-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 1px 4px rgba(15, 27, 45, 0.07);
  --tab-bar-float-inset: max(14px, env(safe-area-inset-left));
  --tab-bar-float-bottom: max(10px, env(safe-area-inset-bottom));
  --tab-bar-offset: calc(74px + env(safe-area-inset-bottom));
  --accent: #f59e0b;
  --success: #16a34a;
  --success-weak: rgba(22, 163, 74, 0.12);
  --warning: #d97706;
  --warning-weak: rgba(217, 119, 6, 0.12);
  --danger: #dc2626;
  --danger-weak: rgba(220, 38, 38, 0.10);
  --on-primary: #ffffff;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 28px rgba(16, 24, 40, 0.07);
  --shadow-lg: 0 18px 48px rgba(16, 24, 40, 0.14);
  --ring: rgba(37, 99, 235, 0.30);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 10px;
}

:root[data-theme="dark"] {
    --bg: #0a0f17;
    --bg-glow: rgba(99, 102, 241, 0.14);
    --surface: rgba(18, 26, 38, 0.92);
    --surface-solid: #121a26;
    --surface-2: rgba(26, 36, 51, 0.95);
    --surface-3: #222e3f;
    --border: rgba(255, 255, 255, 0.08);
    --text: #e8eef6;
    --muted: #93a1b5;
    --text-muted: #93a1b5;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --primary-weak: rgba(99, 102, 241, 0.18);
    --primary-grad: linear-gradient(135deg, #6366f1, #a855f7);
    --violet: #a855f7;
    --violet-weak: rgba(168, 85, 247, 0.16);
    --glass-border: rgba(255, 255, 255, 0.08);
    --liquid-glass-bg: rgba(22, 30, 44, 0.52);
    --liquid-glass-blur: blur(44px) saturate(1.5) brightness(1.08);
    --liquid-glass-rim: rgba(255, 255, 255, 0.22);
    --liquid-glass-shadow:
      0 0 0 0.5px rgba(255, 255, 255, 0.14),
      0 14px 44px rgba(0, 0, 0, 0.45),
      0 2px 8px rgba(0, 0, 0, 0.28),
      inset 0 1px 0 rgba(255, 255, 255, 0.16),
      inset 0 -0.5px 0 rgba(255, 255, 255, 0.04);
    --tab-bar-glass-bg: var(--liquid-glass-bg);
    --tab-bar-glass-blur: var(--liquid-glass-blur);
    --tab-bar-glass-border: color-mix(in srgb, var(--liquid-glass-rim) 50%, transparent);
    --tab-bar-glass-shadow: var(--liquid-glass-shadow);
    --tab-bar-active-pill-bg: rgba(255, 255, 255, 0.12);
    --tab-bar-active-pill-blur: blur(16px) saturate(1.4);
    --tab-bar-active-pill-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.2),
      0 1px 4px rgba(0, 0, 0, 0.2);
    --accent: #fbbf24;
    --success: #22c55e;
    --success-weak: rgba(34, 197, 94, 0.15);
    --warning: #f59e0b;
    --warning-weak: rgba(245, 158, 11, 0.14);
    --danger: #ef4444;
    --danger-weak: rgba(239, 68, 68, 0.14);
    --on-primary: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 52px rgba(0, 0, 0, 0.55);
    --ring: rgba(96, 165, 250, 0.40);
}

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

html.native-app-shell {
  font-size: 16px;
  -webkit-text-size-adjust: none;
  -moz-text-size-adjust: none;
  text-size-adjust: none;
}

#create-track {
  scroll-margin-top: calc(72px + env(safe-area-inset-top));
}

#create-track .track-step,
#trackSettingsPanel {
  scroll-margin-top: calc(72px + env(safe-area-inset-top));
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background:
    radial-gradient(1200px 600px at 50% -200px, var(--bg-glow), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--tab-bar-offset) + 12px);
}

.home-page .container {
  padding-top: 8px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== App bar ===== */
.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: calc(10px + env(safe-area-inset-top)) 0 10px;
  margin-bottom: 16px;
  isolation: isolate;
  backdrop-filter: blur(28px) saturate(1.6) brightness(1.03);
  -webkit-backdrop-filter: blur(28px) saturate(1.6) brightness(1.03);
  background: color-mix(in srgb, var(--liquid-glass-bg, rgba(255, 255, 255, 0.44)) 88%, transparent);
  border-bottom: 1px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.appbar.scrolled {
  border-bottom-color: var(--border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 4px 24px rgba(15, 27, 45, 0.06);
}

.appbar-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.brand-text {
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}

.back-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* ===== Hero banner ===== */
.hero-banner {
  position: relative;
  margin: 6px 0 20px;
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-banner-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 100% 0%, color-mix(in srgb, var(--primary) 28%, transparent), transparent 55%),
    radial-gradient(ellipse 60% 50% at 0% 100%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 50%),
    linear-gradient(165deg, color-mix(in srgb, var(--primary) 8%, var(--surface)) 0%, var(--surface) 48%);
  pointer-events: none;
}

.hero-banner-body {
  position: relative;
  padding: 22px 20px 20px;
}

.hero-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.hero-banner-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-weak);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
}

.hero-banner-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-shrink: 0;
  min-width: 52px;
  height: 44px;
  padding: 0 10px;
  border-radius: 14px;
  line-height: 1;
  background: var(--primary-grad);
  box-shadow: 0 8px 20px var(--primary-weak);
}

.hero-banner-icon-em {
  display: block;
  font-size: 1.125rem;
  line-height: 1;
}

.hero-banner-title {
  margin: 0 0 8px;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.hero-banner-lead {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 36ch;
}

.hero-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.hero-benefits li {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.hero-banner-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.hero-cta-wide {
  grid-column: 1 / -1;
}

@media (max-width: 380px) {
  .hero-banner-actions {
    grid-template-columns: 1fr;
  }

  .hero-cta-wide {
    grid-column: auto;
  }
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  transition: filter 0.15s, transform 0.12s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.hero-cta:active {
  transform: scale(0.98);
}

.hero-cta-primary {
  color: var(--on-primary);
  background: var(--primary-grad);
  box-shadow: 0 8px 22px var(--primary-weak);
  border: 1px solid transparent;
}

.hero-cta-primary:hover {
  filter: brightness(1.06);
}

.hero-cta-ghost {
  color: var(--primary);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--primary) 30%, var(--border));
  backdrop-filter: blur(6px);
}

.hero-cta-ghost:hover {
  background: var(--primary-weak);
}

/* ===== Card ===== */
.card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: hidden;
}

.glass-card {
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow:
    var(--shadow-sm),
    0 8px 32px rgba(79, 70, 229, 0.06);
}

.card-title {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .ic {
  font-size: 1.1rem;
  line-height: 1;
}

.card-sub {
  color: var(--muted);
  font-size: 0.875rem;
  margin: -8px 0 16px;
}

/* ===== Form ===== */
.form-grid {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
  animation: rise 0.25s ease both;
}

label,
.field-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.field-label-row .field-label {
  margin-bottom: 0;
}

.map-inline-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}

.map-inline-link:hover {
  text-decoration: underline;
}

.job-map-link {
  display: inline-block;
  margin-top: 12px;
}

.field-hint {
  margin: -4px 0 4px;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.45;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  appearance: none;
}

select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238b9cb3' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
  background: var(--surface);
}

/* ===== Buttons ===== */
button {
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  font-weight: 700;
  font-size: 0.95rem;
  background: var(--primary-grad);
  color: var(--on-primary);
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s, background 0.15s;
  box-shadow: 0 6px 16px var(--primary-weak);
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 10px 22px var(--primary-weak);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

button.secondary,
.btn-ghost {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  color: var(--text);
  box-shadow: none;
}

button.secondary:hover:not(:disabled),
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-3);
  filter: none;
}

button.danger-ghost {
  background: var(--danger-weak);
  color: var(--danger);
  box-shadow: none;
}

button.resume-ghost {
  background: var(--primary-weak);
  color: var(--primary);
  box-shadow: none;
}

button.resume-ghost:hover:not(:disabled) {
  background: var(--primary-weak);
  filter: brightness(1.02);
}

.job-actions {
  margin-top: 18px;
  flex-direction: column;
}

.btn-block {
  width: 100%;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ===== Chips ===== */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.route-kind-filter {
  margin-bottom: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.12s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.chip:hover {
  border-color: var(--primary);
}

.chip:active {
  transform: scale(0.97);
}

.chip.selected {
  border-color: transparent;
  background: var(--primary-grad);
  color: var(--on-primary);
  box-shadow: 0 6px 14px var(--primary-weak);
}

.chip-sub {
  font-size: 0.78rem;
  font-weight: 500;
  opacity: 0.75;
}

/* ===== Selected box (chosen stop) ===== */
.selected-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--primary-weak);
  animation: rise 0.2s ease both;
}

.selected-box .sb-name {
  font-weight: 700;
}

.selected-box .sb-meta {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  opacity: 0.72;
  margin-top: 4px;
}

.pick-change-btn {
  flex-shrink: 0;
  padding: 8px 14px !important;
  font-size: 0.8125rem !important;
}

.saved-inline-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.saved-inline-actions .pick-change-btn {
  padding: 8px 10px !important;
}

/* ===== Stop picker list ===== */
.search {
  position: relative;
}

.route-list,
.stop-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 10px;
  padding-right: 2px;
}

.route-search-hint {
  margin-top: 8px;
  margin-bottom: 0;
}

.route-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
  box-shadow: none !important;
  font-weight: 500;
  color: var(--text);
}

.route-row:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--surface);
  transform: none !important;
  filter: none;
}

.route-row:active:not(:disabled) {
  transform: scale(0.99) !important;
}

.route-row-code {
  flex-shrink: 0;
  min-width: 52px;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  background: var(--primary-weak);
  color: var(--primary);
  font-size: 0.8125rem;
  font-weight: 800;
  text-align: center;
}

.route-row-code.is-tram {
  background: color-mix(in srgb, #9333ea 14%, transparent);
  color: #9333ea;
}

.route-row-code.is-metro {
  background: color-mix(in srgb, #dc2626 14%, transparent);
  color: #dc2626;
}

.route-row-code.is-rail {
  background: color-mix(in srgb, #0891b2 14%, transparent);
  color: #0891b2;
}

.route-row-code.is-ferry {
  background: color-mix(in srgb, #0369a1 14%, transparent);
  color: #0369a1;
}

.route-row-code.is-funicular {
  background: color-mix(in srgb, #ca8a04 14%, transparent);
  color: #ca8a04;
}

.route-row-code.is-trolleybus {
  background: color-mix(in srgb, #059669 14%, transparent);
  color: #059669;
}

.sb-name.is-tram,
.sb-name.is-tram-route { color: #9333ea; }
.sb-name.is-metro { color: #dc2626; }
.sb-name.is-rail { color: #0891b2; }
.sb-name.is-ferry { color: #0369a1; }
.sb-name.is-funicular { color: #ca8a04; }
.sb-name.is-trolleybus { color: #059669; }

.route-badge.is-tram {
  background: linear-gradient(180deg, #a855f7 0%, #7e22ce 100%);
  color: #fff;
}

.route-badge.is-metro {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
}

.route-badge.is-rail {
  background: linear-gradient(180deg, #22d3ee 0%, #0891b2 100%);
  color: #fff;
}

.route-badge.is-ferry {
  background: linear-gradient(180deg, #38bdf8 0%, #0369a1 100%);
  color: #fff;
}

.route-badge.is-funicular {
  background: linear-gradient(180deg, #facc15 0%, #ca8a04 100%);
  color: #1f2937;
}

.route-badge.is-trolleybus {
  background: linear-gradient(180deg, #34d399 0%, #059669 100%);
  color: #fff;
}

.route-row-name {
  flex: 1;
  min-width: 0;
  font-size: 0.9375rem;
  line-height: 1.35;
}

.route-row.is-favorite-manage {
  justify-content: space-between;
}

.route-row.is-favorite-manage.is-favorited {
  border-color: color-mix(in srgb, var(--success) 50%, var(--border));
  background: color-mix(in srgb, var(--success-weak) 55%, var(--surface-2));
}

.route-row-fav-pill {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.route-row-fav-pill.is-on {
  color: var(--success);
  background: var(--success-weak);
  border-color: color-mix(in srgb, var(--success) 40%, transparent);
}

.route-row-fav-pill.is-off {
  color: var(--primary);
  background: var(--primary-weak);
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
}

.stop-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}

.stop-row:hover {
  border-color: var(--primary);
}

.stop-row:active {
  transform: scale(0.99);
}

.stop-row.selected {
  border-color: var(--primary);
  background: var(--primary-weak);
}

.stop-seq {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--muted);
}

.stop-row.selected .stop-seq {
  background: var(--primary);
  color: var(--on-primary);
}

.stop-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stop-name {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.35;
}

.stop-no {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  opacity: 0.72;
  letter-spacing: 0.01em;
}

.muted-note {
  color: var(--muted);
  margin: 8px 2px;
  font-size: 0.9rem;
}

/* ===== Badges / pills ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge.active { background: var(--success-weak); color: var(--success); }
.badge.waiting { background: var(--warning-weak); color: var(--warning); }
.badge.paused { background: var(--surface-3); color: var(--muted); }
.badge.completed { background: var(--primary-weak); color: var(--primary); }
.badge.expired { background: var(--warning-weak); color: var(--warning); }
.badge.cancelled { background: var(--surface-3); color: var(--muted); }

/* ===== Job list (home) ===== */
.job-list {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.job-swipe {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  min-width: 0;
}

.job-swipe-actions {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
  background: transparent;
}

.job-swipe-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0 !important;
  border: none !important;
  border-radius: var(--radius-xs) !important;
  background: transparent !important;
  color: var(--muted) !important;
  box-shadow: none !important;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}

.job-swipe-delete:hover:not(:disabled),
.job-swipe-delete:active:not(:disabled) {
  color: var(--danger) !important;
  background: var(--surface-3) !important;
  transform: none !important;
}

.job-swipe-delete-ic {
  display: block;
  width: 20px;
  height: 20px;
}

.job-swipe-routine {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0 !important;
  border: none !important;
  border-radius: var(--radius-xs) !important;
  background: transparent !important;
  color: var(--primary) !important;
  box-shadow: none !important;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}

.job-swipe-routine:hover:not(:disabled),
.job-swipe-routine:active:not(:disabled) {
  color: var(--primary) !important;
  background: color-mix(in srgb, var(--primary) 12%, transparent) !important;
  transform: none !important;
}

.job-swipe-routine-ic {
  display: block;
  width: 20px;
  height: 20px;
}

.job-routine-badge {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2px;
}

.job-card.is-alarm-job .route-badge.is-alarm-badge {
  min-width: 52px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.routine-managed-banner.routine-managed-banner-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px 12px;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  background: color-mix(in srgb, var(--primary) 7%, var(--surface-solid));
}

.routine-managed-banner.routine-managed-banner-compact .routine-managed-banner-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.routine-managed-banner.routine-managed-banner-compact .routine-managed-banner-title::before {
  content: '⏰ ';
}

.routine-managed-banner.routine-managed-banner-compact .routine-managed-banner-cta {
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 0.78rem;
}

.routine-managed-banner.routine-managed-banner-compact .routine-managed-banner-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
}

.routine-managed-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
  background: color-mix(in srgb, var(--primary) 8%, var(--surface-solid));
}

.routine-managed-banner.hidden {
  display: none;
}

.routine-managed-banner-kicker {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
}

.routine-managed-banner-title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
}

.routine-managed-banner-text {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}

.routine-managed-banner-cta {
  flex-shrink: 0;
  align-self: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff !important;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.job-footer .routine-manage-btn {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface-solid));
}

.job-swipe-content {
  position: relative;
  z-index: 1;
  background: var(--surface);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
  touch-action: pan-y;
}

.job-swipe.is-open .job-swipe-content {
  transform: translateX(-48px);
}

.job-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  transition: box-shadow 0.15s, border-color 0.15s;
}

@media (max-width: 640px) {
  .job-swipe {
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    background: var(--surface);
  }

  .job-card {
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .job-card:hover {
    transform: none;
    border-color: transparent;
  }
}

@media (min-width: 641px) {
  .job-swipe {
    display: flex;
    align-items: stretch;
    gap: 8px;
    overflow: visible;
    background: transparent;
  }

  .job-swipe-actions {
    position: static;
    width: auto;
    z-index: 1;
  }

  .job-swipe-delete {
    align-self: center;
  }

  .job-swipe-delete:hover:not(:disabled) {
    transform: none !important;
  }

  .job-swipe-content {
    flex: 1;
    min-width: 0;
    transform: none !important;
    transition: none;
    touch-action: auto;
  }

  .job-swipe.is-open .job-swipe-content {
    transform: none !important;
  }
}

.job-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

@media (min-width: 641px) {
  .job-card:hover {
    transform: translateY(-2px);
  }
}

.job-card-inactive {
  opacity: 0.88;
}

.job-card-inactive:hover {
  border-color: var(--border);
}

.job-resume-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--surface-2);
  color: var(--primary);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  box-shadow: none !important;
}

.job-resume-btn:hover:not(:disabled) {
  background: var(--primary-weak);
  transform: none !important;
  filter: none;
}

.job-resume-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

@media (max-width: 640px) {
  .job-resume-btn {
    border-radius: 0;
  }
}

.route-badge {
  flex-shrink: 0;
  min-width: 52px;
  height: 44px;
  padding: 0 10px;
  border-radius: var(--radius-xs);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.9rem;
  background: var(--primary-grad);
  color: var(--on-primary);
  letter-spacing: -0.01em;
}

.job-main {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.job-target {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-meta {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.job-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.chevron {
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
}

/* ===== Empty state ===== */
.empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--muted);
}

.empty .empty-ic {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
  opacity: 0.8;
}

.empty-modern {
  padding: 32px 20px;
}

.empty-illustration {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--muted);
}

.empty-title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.empty-desc {
  margin: 0 0 18px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 28ch;
  margin-left: auto;
  margin-right: auto;
}

.empty-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border: none;
  border-radius: 999px;
  background: var(--primary-grad);
  color: var(--on-primary);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px var(--primary-weak);
  -webkit-tap-highlight-color: transparent;
}

.empty-cta:active {
  transform: scale(0.98);
}

.empty-state {
  color: var(--muted);
  font-size: 0.9375rem;
  margin: 0;
  padding: 12px 0;
}

/* ===== Status messages ===== */
.status-msg {
  padding: 11px 14px;
  border-radius: var(--radius-xs);
  font-size: 0.875rem;
  margin-top: 12px;
  border: 1px solid transparent;
}

.status-msg.error {
  background: var(--danger-weak);
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}

.status-msg.info {
  background: var(--primary-weak);
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 25%, transparent);
}

.status-msg.success {
  background: var(--success-weak);
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 30%, transparent);
}

.aots-foreground-push-banner {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 12px;
  right: 12px;
  z-index: 10050;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  border-radius: var(--radius-xs);
  background: var(--primary-weak);
  color: var(--primary);
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.12));
  cursor: pointer;
}

.aots-foreground-push-banner strong {
  font-weight: 600;
}

.aots-offline-banner {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  left: 12px;
  right: 12px;
  z-index: 10060;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--warning, #d97706) 35%, transparent);
  border-radius: var(--radius-xs);
  background: color-mix(in srgb, var(--warning, #d97706) 12%, var(--card, #fff));
  color: var(--text, #111827);
  font: inherit;
  font-size: 0.875rem;
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.12));
}

.aots-offline-banner.hidden {
  display: none;
}

.aots-offline-banner__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.aots-offline-banner__text {
  margin: 0;
  flex: 1;
  line-height: 1.35;
}

.aots-offline-banner__retry {
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--card, #fff);
  color: var(--primary);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

html.has-offline-banner body.home-page .home-header,
html.has-offline-banner body.job-page .appbar {
  margin-top: 52px;
}

.aots-battery-hint-banner {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: 12px;
  right: 12px;
  z-index: 10055;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 14px;
  align-items: start;
  margin: 0;
  padding: 14px 14px 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent);
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--primary) 14%, var(--card, #fff)) 0%,
    var(--card, #fff) 55%
  );
  color: var(--text, #111827);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.4;
  box-shadow: 0 10px 32px rgba(17, 24, 39, 0.14);
  animation: aots-battery-hint-in 0.28s ease-out;
}

@keyframes aots-battery-hint-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.aots-battery-hint-banner__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  color: var(--primary);
  flex-shrink: 0;
}

.aots-battery-hint-banner__icon svg {
  display: block;
}

.aots-battery-hint-banner__content {
  min-width: 0;
  padding-right: 28px;
}

.aots-battery-hint-banner__title {
  display: block;
  margin: 0 0 4px;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text, #111827);
}

.aots-battery-hint-banner__text {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted, #6b7280);
}

.aots-battery-hint-banner__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: color-mix(in srgb, var(--text, #111) 6%, transparent);
  color: var(--text-muted, #6b7280);
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
}

.aots-battery-hint-banner__actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.aots-battery-hint-banner__btn {
  flex: 1;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 0;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.aots-battery-hint-banner__btn--primary {
  background: var(--primary);
  color: #fff;
}

.aots-battery-hint-banner__btn--ghost {
  background: color-mix(in srgb, var(--text, #111) 6%, transparent);
  color: var(--text, #111827);
}

html.has-battery-hint body.home-page .home-header,
html.has-battery-hint body.job-page .appbar {
  margin-top: 118px;
}

html.has-battery-hint.has-offline-banner body.home-page .home-header,
html.has-battery-hint.has-offline-banner body.job-page .appbar {
  margin-top: 170px;
}

.job-stale-note {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  background: color-mix(in srgb, var(--warning, #d97706) 10%, transparent);
  color: var(--text-muted, #6b7280);
  font-size: 0.8125rem;
  line-height: 1.35;
}

.job-stale-note.hidden {
  display: none;
}

.job-pulse.is-offline-stale {
  opacity: 0.92;
}

.job-pulse.is-offline-stale .job-pulse-ring {
  filter: grayscale(0.15);
}

.job-list-offline-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  background: color-mix(in srgb, var(--warning, #d97706) 10%, transparent);
  color: var(--text-muted, #6b7280);
  font-size: 0.875rem;
  line-height: 1.35;
}

.badge.is-stale-offline {
  background: color-mix(in srgb, var(--warning, #d97706) 18%, transparent);
  color: var(--text, #111827);
}

/* ===== Tracking: hero remaining ===== */
.track-hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 22px 20px 24px;
}

.track-hero-top {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}

.remaining-ring {
  width: 168px;
  height: 168px;
  margin: 8px auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, var(--surface) 56%, transparent 57%),
    conic-gradient(var(--ring-color, var(--primary)) var(--ring-pct, 0deg), var(--surface-3) 0);
  transition: --ring-pct 0.5s ease;
}

.remaining-ring.near {
  --ring-color: var(--warning);
}

.remaining-inner {
  display: grid;
  place-items: center;
  gap: 2px;
}

.remaining-num {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--primary);
}

.remaining-num.warn { color: var(--warning); }
.remaining-num.ok { color: var(--success); }

.remaining-unit {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.remaining-cap {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 4px 0 0;
}

.remaining-cap strong {
  color: var(--text);
}

/* ===== Tracking: summary strip ===== */
.summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.summary-item {
  background: var(--surface);
  padding: 13px 14px;
}

.summary-item .s-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 3px;
}

.summary-item .s-value {
  font-size: 0.95rem;
  font-weight: 700;
}

/* ===== Notify card ===== */
.notify-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.notify-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  background: var(--primary-weak);
}

.notify-head .nh-text {
  flex: 1;
}

.notify-head .nh-title {
  font-weight: 700;
  font-size: 1.02rem;
}

.notify-head .nh-sub {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 2px;
}

/* ===== Collapsible card (bus list) ===== */
.collapsible-card {
  padding-top: 14px;
}

.collapsible-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 4px 0 14px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.collapsible-head:hover .collapsible-title {
  color: var(--primary);
}

.collapsible-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.collapsible-title .ic {
  font-size: 1.1rem;
  line-height: 1;
}

.collapsible-meta {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.collapsible-meta:empty {
  display: none;
}

.collapsible-chevron {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  margin-top: -4px;
  transition: transform 0.2s ease, margin 0.2s ease;
}

.collapsible-card.is-open .collapsible-chevron {
  transform: rotate(-135deg);
  margin-top: 2px;
}

.collapsible-card.is-open .collapsible-head {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.collapsible-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s ease;
}

.collapsible-card.is-open .collapsible-body {
  grid-template-rows: 1fr;
}

.collapsible-body-inner {
  overflow: hidden;
  min-height: 0;
}

.collapsible-card.is-open .collapsible-body-inner {
  padding-top: 14px;
}

.bus-list-scroll {
  max-height: min(42vh, 340px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

/* ===== Bus cards ===== */
.bus-list {
  display: grid;
  gap: 10px;
}

.bus-list-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 12px;
  padding: 0;
}

.bus-focus-clear {
  margin-left: auto;
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 45%, transparent);
  background: var(--primary-weak);
}

.bus-focus-clear:hover:not(:disabled) {
  background: color-mix(in srgb, var(--primary) 18%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 55%, transparent);
}

.bus-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  transition: border-color 0.15s, background 0.15s;
  animation: rise 0.25s ease both;
  min-width: 0;
  max-width: 100%;
}

.bus-card-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.bus-card.focused {
  border-color: color-mix(in srgb, var(--primary) 50%, transparent);
  background: var(--primary-weak);
}

.bus-card-actions {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  margin-top: -2px;
}

.bus-focus-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: 100%;
  padding: 5px 10px;
  border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent);
  border-radius: 6px;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}

.bus-focus-btn:hover:not(:disabled) {
  background: var(--primary-weak);
}

.bus-focus-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.bus-focus-btn-secondary {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}

.bus-focus-btn-secondary:hover:not(:disabled) {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
  background: var(--primary-weak);
}

.bus-focus-active-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
}

.bus-card.near {
  border-color: color-mix(in srgb, var(--warning) 45%, transparent);
  background: var(--warning-weak);
}

.bus-card.arrived {
  border-color: color-mix(in srgb, var(--success) 40%, transparent);
  background: var(--success-weak);
}

.bus-plate {
  flex-shrink: 0;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.bus-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.bus-stop {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.3;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bus-info .bi-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
}

.bus-remaining {
  flex-shrink: 0;
  text-align: center;
  min-width: 52px;
  padding-left: 4px;
}

.bus-remaining .br-num {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.bus-card.near .br-num { color: var(--warning); }
.bus-card.arrived .br-num { color: var(--success); font-size: 1rem; }

.bus-remaining .br-cap {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .bus-list {
    gap: 8px;
  }

  .bus-card {
    padding: 12px;
  }

  .bus-card-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "plate remaining"
      "info info";
    gap: 8px 10px;
    align-items: center;
  }

  .bus-plate {
    grid-area: plate;
    justify-self: start;
    font-size: 0.76rem;
    padding: 6px 8px;
  }

  .bus-info {
    grid-area: info;
    width: 100%;
  }

  .bus-stop {
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    word-break: break-word;
  }

  .bus-remaining {
    grid-area: remaining;
    justify-self: end;
    min-width: 44px;
    padding-left: 0;
  }

  .bus-remaining .br-num {
    font-size: 1.2rem;
  }
}

/* ===== Timeline (events) ===== */
.event-feed-desc {
  color: var(--muted);
  font-size: 0.875rem;
  margin: -8px 0 16px;
}

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 520px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.tl-item {
  position: relative;
  padding: 0 0 18px 28px;
  animation: rise 0.3s ease both;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 18px;
  bottom: -2px;
  width: 2px;
  background: var(--border);
}

.tl-item:first-child::before {
  display: none;
}

.tl-dot {
  position: absolute;
  left: 0;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--muted);
  z-index: 1;
}

.tl-item.THRESHOLD_REACHED .tl-dot { border-color: var(--warning); }
.tl-item.BUS_SIGHTED .tl-dot { border-color: var(--primary); }
.tl-item.ARRIVED .tl-dot { border-color: var(--success); }
.tl-item.BUS_DISCOVERED .tl-dot { border-color: var(--success); }
.tl-item.STOP_CHANGED .tl-dot { border-color: var(--primary); }
.tl-item.REMAINING_UPDATED .tl-dot { border-color: var(--primary); }
.tl-item.JOB_STARTED .tl-dot { border-color: var(--primary); }
.tl-item.JOB_RESUMED .tl-dot { border-color: var(--primary); }
.tl-item.JOB_EXPIRED .tl-dot { border-color: var(--danger); }
.tl-item.JOB_CANCELLED .tl-dot { border-color: var(--danger); }
.tl-item.USER_BOARDED .tl-dot { border-color: var(--success); }
.tl-item.NO_BUSES .tl-dot { border-color: var(--muted); }
.tl-item.SCHEDULED_DEPARTURE .tl-dot { border-color: var(--accent, #2563eb); }
.tl-item.SCHEDULED_DEPARTURE.no-more-today .tl-dot { border-color: var(--danger, #dc2626); }
.tl-item.SCHEDULED_DEPARTURE.no-more-today .tl-label { color: var(--danger, #dc2626); }
.tl-item.POSITION_UNKNOWN .tl-dot { border-color: var(--warning); }
.tl-item.BUS_FOCUS_STARTED .tl-dot,
.tl-item.BUS_FOCUS_CHANGED .tl-dot { border-color: var(--primary); }
.tl-item.BUS_FOCUS_RELEASED .tl-dot { border-color: var(--muted); }

.tl-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.tl-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.tl-time {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.tl-msg {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--muted);
}

.tl-item.THRESHOLD_REACHED .tl-msg,
.tl-item.BUS_SIGHTED .tl-msg,
.tl-item.JOB_RESUMED .tl-msg,
.tl-item.ARRIVED .tl-msg,
.tl-item.SCHEDULED_DEPARTURE .tl-msg {
  color: var(--text);
}

/* ===== Utilities ===== */
.hidden {
  display: none !important;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 16px auto;
}

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

/* ===== Boot / page-nav loading overlay ===== */
.aots-load-overlay,
.aots-boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(24px + env(safe-area-inset-top, 0px))
    24px
    calc(24px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(90% 55% at 50% -10%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 55%),
    var(--bg, #f3f5f7);
  color: var(--text, #0c1222);
  opacity: 1;
  transition: opacity 0.22s ease;
  pointer-events: all;
}

.aots-boot-overlay[hidden],
.aots-load-overlay[hidden] {
  display: none !important;
}

.aots-boot-overlay.is-leaving,
.aots-load-overlay.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.aots-load-overlay__inner,
.aots-boot-overlay__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  max-width: 280px;
}

.aots-load-overlay__logo,
.aots-boot-overlay__logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  box-shadow: 0 10px 32px color-mix(in srgb, var(--primary) 22%, transparent);
}

.aots-load-overlay__brand,
.aots-boot-overlay__brand {
  margin: 0;
  font-family: var(--font-display, system-ui, sans-serif);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.aots-load-overlay__spinner,
.aots-boot-overlay__spinner {
  width: 28px;
  height: 28px;
  margin-top: 6px;
  border: 3px solid color-mix(in srgb, var(--primary) 18%, transparent);
  border-top-color: var(--primary, #8700fc);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.aots-load-overlay__status,
.aots-boot-overlay__status {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted, #5a6578);
  line-height: 1.4;
  min-height: 1.4em;
}

html.aots-boot-active,
html.aots-page-nav-active {
  overflow: hidden;
}

/* Handoff sırasında sayfa içi spinner'lar markalı overlay ile çakışmasın */
html.aots-page-nav-active .map-loading,
html.aots-boot-active .map-loading,
html.aots-page-nav-active .planner-map-loading,
html.aots-boot-active .planner-map-loading,
html.aots-page-nav-active #stopLoading,
html.aots-boot-active #stopLoading,
html.aots-page-nav-active .nearby-widget-loading,
html.aots-boot-active .nearby-widget-loading {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .aots-load-overlay,
  .aots-boot-overlay {
    transition-duration: 0.05s;
  }

  .aots-load-overlay__spinner,
  .aots-boot-overlay__spinner {
    animation: none;
    border-top-color: transparent;
    background: var(--primary, #8700fc);
    opacity: 0.55;
  }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Confirm modal ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  pointer-events: none;
  visibility: hidden;
}

.modal[hidden] {
  display: none !important;
}

.modal.is-open {
  pointer-events: auto;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 27, 45, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.22s ease;
}

:root[data-theme="dark"] .modal-backdrop {
  background: rgba(0, 0, 0, 0.58);
}

.modal.is-open .modal-backdrop {
  opacity: 1;
}

.modal-sheet {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 12px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

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

.modal-handle {
  width: 36px;
  height: 4px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: var(--surface-3);
}

.modal-icon-wrap {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--danger-weak);
  color: var(--danger);
}

.modal-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.02em;
}

.modal-text {
  margin: 0 0 22px;
  font-size: 0.9375rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.55;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-btn {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px !important;
  font-size: 0.9375rem !important;
  box-shadow: none !important;
}

.modal-btn:hover:not(:disabled) {
  transform: none !important;
}

.modal-btn-danger {
  background: var(--danger) !important;
  color: #fff !important;
}

.modal-btn-danger:hover:not(:disabled) {
  filter: brightness(1.06);
}

@media (min-width: 641px) {
  .modal {
    align-items: center;
    padding: 24px;
  }

  .modal-sheet {
    border-radius: var(--radius);
    padding: 28px 24px 24px;
    transform: translateY(16px) scale(0.96);
    opacity: 0;
    transition:
      transform 0.24s cubic-bezier(0.32, 0.72, 0, 1),
      opacity 0.24s ease;
  }

  .modal.is-open .modal-sheet {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  .modal-handle {
    display: none;
  }
}

@media (max-width: 640px) {
  .modal-actions {
    grid-template-columns: 1fr;
  }

  .modal-btn-danger {
    order: -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal-backdrop,
  .modal-sheet {
    transition: none !important;
  }
}

/* ===== City picker (GPS yok / izin yok) ===== */
.city-picker-modal--required .city-picker-backdrop {
  pointer-events: none;
}

.city-picker-modal--required .city-picker-sheet {
  box-shadow: var(--shadow-lg);
}

.city-picker-modal .city-picker-sheet {
  max-height: min(85vh, 640px);
  display: flex;
  flex-direction: column;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

.city-picker-title {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

.city-picker-sub {
  margin: 0 0 14px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-muted);
  text-align: center;
}

.city-picker-search {
  width: 100%;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}

.city-picker-search:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.city-picker-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.city-picker-item {
  display: block;
  width: 100%;
  padding: 14px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.city-picker-item:hover,
.city-picker-item:focus-visible {
  background: var(--surface-2);
  outline: none;
}

.city-picker-item-name {
  display: block;
}

.city-picker-empty {
  padding: 20px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .hero-banner-body { padding: 18px 16px 16px; }
  .hero-banner-title { font-size: 1.45rem; }
  .hero-banner-actions { grid-template-columns: 1fr; }
  .summary { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ===== Soft-prompt banner ===== */
.notif-prompt-banner {
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom));
  left: 16px;
  right: 16px;
  max-width: 520px;
  margin: 0 auto;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transform: translateY(calc(100% + 32px));
  transition: transform 0.32s cubic-bezier(0.34, 1.26, 0.64, 1);
}

.notif-prompt-banner[hidden] {
  display: none;
}

.notif-prompt-banner.is-visible {
  transform: translateY(0);
}

.npb-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.npb-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.npb-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.npb-sub {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.4;
}

.npb-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.npb-btn-allow {
  padding: 9px 18px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s;
}

.npb-btn-allow:hover {
  filter: brightness(1.08);
}

.npb-btn-dismiss {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.npb-btn-dismiss:hover {
  background: var(--surface-2);
  color: var(--text);
}

.npb-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  margin-top: -2px;
  margin-right: -4px;
}

.npb-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Banner icindeki aksiyon satirini tam genislik yap */
.notif-prompt-banner .npb-text {
  flex-basis: 100%;
}

/* Ikon + kapat buton + metin + aksiyonlar: flex-wrap ile iki satir */
.notif-prompt-banner {
  flex-wrap: wrap;
}

.notif-prompt-banner .npb-icon {
  flex-basis: auto;
  flex-shrink: 0;
}

.notif-prompt-banner .npb-close {
  margin-left: auto;
}

.notif-prompt-banner .npb-text {
  flex: 1;
  min-width: 0;
  flex-basis: calc(100% - 44px - 28px - 24px);
  order: 1;
}

.notif-prompt-banner .npb-actions {
  order: 2;
  width: 100%;
  margin-top: 10px;
}

/* ===== iOS rehber karti ===== */
.ios-guide-card {
  margin-bottom: 16px;
  border-color: color-mix(in srgb, var(--primary) 30%, transparent);
  background: var(--primary-weak);
}

.ios-guide-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.ios-guide-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.ios-guide-text {
  flex: 1;
  min-width: 0;
}

.ios-guide-text strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.ios-guide-text p {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

.ios-guide-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.ios-guide-close:hover {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.ios-guide-steps {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ios-guide-steps li {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text);
}

.ios-share-icon {
  font-size: 0.9em;
  vertical-align: middle;
  opacity: 0.8;
}

/* ===== Job page — compact layout ===== */
.job-page .job-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: calc(var(--tab-bar-offset) + 12px);
}

.job-page .hero {
  display: none;
}

.job-pulse {
  padding: 12px 14px;
}

.job-pulse-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.job-pulse-ring-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.job-pulse-ring {
  --ring-pct: 0deg;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(var(--primary) var(--ring-pct), var(--surface-3) 0);
  position: relative;
}

.job-pulse-ring::before {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--surface);
}

.job-pulse-num {
  position: relative;
  z-index: 1;
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.job-pulse-num.warn {
  color: var(--warning, #d97706);
}

.job-pulse-num.ok {
  color: var(--success, #16a34a);
}

.job-pulse-ring.near {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning, #d97706) 35%, transparent);
}

.job-pulse-unit {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.job-pulse-text {
  flex: 1;
  min-width: 0;
}

.job-pulse-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  margin-bottom: 2px;
}

.job-pulse-route-line {
  margin: 2px 0 0;
  font-size: 0.9375rem;
  line-height: 1.25;
}

.job-route-code {
  color: var(--primary);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.job-route-code.is-tram {
  color: #9333ea;
}

.job-route-code--hero {
  font-size: 1.125rem;
}

.job-route-sep {
  color: var(--muted);
  font-weight: 500;
}

.job-route-headsign {
  color: var(--text);
  font-weight: 600;
  font-size: 0.9375rem;
}

.job-pulse-route-line .job-route-headsign {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.8125rem;
}

.job-pulse-stop {
  margin: 4px 0 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-pulse-status {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.job-pulse-status-code {
  font-weight: 600;
  color: var(--text);
}

.job-pulse-status-muted {
  color: var(--muted);
  font-weight: 400;
}

.job-pulse-route {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-pulse-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-pulse-sub {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.job-pulse-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.job-notify-btn {
  position: relative;
  overflow: hidden;
}

.job-pulse-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
  transform: none;
  filter: none;
  -webkit-tap-highlight-color: transparent;
}

.job-pulse-icon-btn:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}

.job-pulse-icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.job-pulse-map-btn {
  color: var(--primary);
}

.job-pulse-map-btn:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
}

.job-notify-btn.is-on {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 50%, var(--border));
  background: color-mix(in srgb, var(--primary) 10%, var(--surface-2));
}

.job-notify-btn.is-on svg {
  fill: color-mix(in srgb, var(--primary) 22%, transparent);
}

.job-notify-btn.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

.job-pulse-icon-btn svg {
  display: block;
  pointer-events: none;
}

.job-panel {
  padding: 12px 14px;
}

.job-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.job-panel-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.job-route-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.job-route-head.hidden {
  display: none;
}

.job-route-head-title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.9375rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-route-head-count {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--muted);
}

.job-panel-meta {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.job-panel-meta:empty {
  display: none;
}

.job-panel-empty {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.4;
}

.job-panel-empty.hidden {
  display: none;
}

.bus-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.bus-strip::-webkit-scrollbar {
  display: none;
}

.bus-strip.hidden {
  display: none;
}

.bus-chip.is-tram {
  border-color: color-mix(in srgb, #9333ea 35%, transparent);
}

.bus-chip.is-tram.focused {
  border-color: #9333ea;
  border-width: 2px;
  box-shadow: none;
}

.bus-chip {
  flex: 0 0 auto;
  width: 128px;
  min-height: 104px;
  padding: 10px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  box-shadow: none;
}

.bus-chip.near {
  border-color: color-mix(in srgb, var(--warning, #d97706) 55%, var(--border));
  background: color-mix(in srgb, var(--warning, #d97706) 8%, var(--bg));
}

.bus-chip.arrived {
  opacity: 0.65;
  border-color: var(--border);
}

.bus-chip.focused {
  border-color: var(--primary);
  border-width: 2px;
  box-shadow: none;
}

.bus-chip-plate {
  display: block;
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}

.bus-chip-remaining {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.bus-chip-cap {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}

.bus-chip.near .bus-chip-remaining {
  color: var(--warning, #d97706);
}

.bus-chip.arrived .bus-chip-remaining {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--muted);
}

.bus-chip-stop {
  margin-top: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.bus-chip-dist {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 2px;
}

.bus-chip-actions {
  margin-top: 8px;
}

.bus-chip-actions .bus-focus-btn {
  width: 100%;
  padding: 6px 8px;
  font-size: 0.6875rem;
}

.bus-chip-actions .bus-focus-active-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
}

.stop-legs-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: min(320px, 42vh);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-right: 2px;
  scrollbar-width: thin;
}

.stop-leg-section {
  flex-shrink: 0;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
}

.stop-leg-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.stop-leg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.stop-leg-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  min-width: 0;
}

.stop-leg-route {
  color: var(--primary);
  font-weight: 800;
  font-size: 1rem;
}

.stop-leg-route.is-tram {
  color: #9333ea;
}

.stop-leg-headsign {
  color: var(--text);
  font-weight: 600;
}

.stop-leg-count {
  flex-shrink: 0;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.stop-leg-empty {
  margin: 0 0 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stop-leg-chip-scroll {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0;
  padding: 0 2px 6px;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.stop-leg-chip-scroll .bus-chip {
  scroll-snap-align: start;
}

.nearest-vehicles-sheet {
  max-width: 380px;
  padding: 0 0 calc(10px + env(safe-area-inset-bottom, 0px));
}

.nearest-vehicles-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 0;
}

.nearest-vehicles-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
}

.nearest-vehicles-sub {
  margin: 2px 16px 10px;
  font-size: 0.75rem;
  color: var(--muted);
}

.nearest-vehicles-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nearest-vehicles-close:hover {
  background: var(--surface-3);
  color: var(--text);
}

.nearest-vehicles-close svg {
  display: block;
  pointer-events: none;
}

.nearest-vehicles-rows {
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 42vh;
  overflow-y: auto;
}

.nearest-vehicles-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.nearest-vehicles-row.is-near {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  background: color-mix(in srgb, var(--primary) 6%, var(--surface-2));
}

.nearest-vehicles-row.is-waiting {
  border-style: dashed;
  opacity: 0.92;
}

.nearest-vehicles-row.is-offline {
  opacity: 0.85;
}

.nearest-vehicles-row-main {
  flex: 1;
  min-width: 0;
}

.nearest-vehicles-plate {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nearest-vehicles-meta {
  display: block;
  margin-top: 1px;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nearest-vehicles-focus {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.popup-stops {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  line-height: 1;
  text-align: center;
}

.popup-stops-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.popup-stops-label {
  margin-top: 2px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: lowercase;
}

.popup-stops.is-near .popup-stops-num {
  color: var(--primary);
}

.job-map-picker-sheet {
  max-width: 380px;
  padding: 0 0 calc(10px + env(safe-area-inset-bottom, 0px));
}

.job-map-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 0;
}

.job-map-picker-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
}

.job-map-picker-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.job-map-picker-close svg {
  display: block;
  pointer-events: none;
}

.job-map-picker-close:hover {
  background: var(--surface-3);
  color: var(--text);
}

.job-map-picker-sub {
  margin: 2px 16px 10px;
  font-size: 0.75rem;
  color: var(--muted);
}

.job-map-picker-rows {
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 42vh;
  overflow-y: auto;
}

.job-map-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  transition: border-color 0.12s, background 0.12s;
}

.job-map-picker-row:hover,
.job-map-picker-row:focus-visible {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  background: color-mix(in srgb, var(--primary) 5%, var(--surface-2));
  outline: none;
}

.job-map-picker-row-main {
  flex: 1;
  min-width: 0;
}

.job-map-picker-plate {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-map-picker-meta {
  display: block;
  margin-top: 1px;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.3;
}

.job-map-picker-chevron {
  flex-shrink: 0;
  font-size: 1.125rem;
  line-height: 1;
  color: var(--muted);
  opacity: 0.7;
}

.timeline-compact {
  max-height: 220px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.timeline-compact .tl-item {
  padding: 8px 0 8px 22px;
  border-bottom: 1px solid var(--border);
}

.timeline-compact .tl-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.timeline-compact .tl-dot {
  left: 0;
  top: 10px;
  width: 10px;
  height: 10px;
}

.timeline-compact .tl-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.timeline-compact .tl-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
}

.tl-route-code {
  font-weight: 800;
  font-size: 0.9375rem;
  letter-spacing: 0.0125em;
  color: var(--text);
}

.timeline-compact .tl-time {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}

.timeline-compact .tl-msg {
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.timeline-compact .tl-item.SCHEDULED_DEPARTURE .tl-msg {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  -webkit-box-orient: unset;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.job-more {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}

.job-more summary {
  padding: 12px 14px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}

.job-more summary::-webkit-details-marker {
  display: none;
}

.job-more summary::after {
  content: '›';
  float: right;
  color: var(--muted);
  transform: rotate(90deg);
  transition: transform 0.15s;
}

.job-more[open] summary::after {
  transform: rotate(-90deg);
}

.job-more-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--border);
}

.job-more .notify-card {
  padding: 12px 0 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

.notify-compact {
  margin: 0 0 10px;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.4;
}

.job-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
}

.job-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8125rem;
}

.job-detail-label {
  color: var(--muted);
  font-weight: 500;
  flex-shrink: 0;
}

.job-detail-value {
  font-weight: 600;
  text-align: right;
  color: var(--text);
}

.job-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.job-footer .btn-block {
  padding: 12px 16px;
  font-size: 0.875rem;
}

/* ---- Install (Ana Ekrana Ekle) overlay ---- */
html.install-locked,
html.install-locked body,
html.install-required body {
  overflow: hidden;
}

html.install-required body > :not(.install-overlay) {
  pointer-events: none;
  user-select: none;
}

.install-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(8, 12, 20, 0.72);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  backdrop-filter: blur(12px) saturate(120%);
  animation: installFade 0.22s ease;
}

.install-overlay.is-required {
  align-items: center;
  justify-content: center;
}

@keyframes installFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.install-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 22px 20px calc(20px + env(safe-area-inset-bottom));
  animation: installSlide 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  margin: auto;
}

.install-overlay.is-required .install-card {
  max-width: 440px;
  min-height: auto;
}

@media (min-width: 560px) {
  .install-overlay:not(.is-required) {
    align-items: flex-end;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .install-overlay:not(.is-required) .install-card {
    max-height: none;
    margin: 0;
  }

  .install-overlay.is-required {
    align-items: center;
    padding: 24px;
    padding-top: calc(24px + env(safe-area-inset-top));
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }

  .install-overlay.is-required .install-card {
    max-height: calc(100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
}

@keyframes installSlide {
  from { transform: translateY(28px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.install-overlay.is-required .install-close {
  display: none;
}

.install-required-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 8px;
  margin-bottom: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  color: var(--primary);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.install-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: none;
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.install-close:hover {
  background: var(--surface-3);
  color: var(--text);
}

.install-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding-right: 0;
}

.install-overlay.is-required .install-head {
  padding-right: 0;
}

.install-icon {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.install-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.install-name {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
}

.install-sub {
  font-size: 0.8125rem;
  color: var(--muted);
}

.install-text {
  margin: 0 0 16px;
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.55;
}

.install-text[data-install-lead] {
  margin-bottom: 10px;
}

.install-status {
  margin: 0 0 12px;
  min-height: 1.25em;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.4;
}

.install-status:empty {
  display: none;
  margin: 0;
  min-height: 0;
}

.install-steps--compact li::before {
  display: none;
}

.install-steps--compact li {
  padding-left: 14px;
}

.install-steps {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  counter-reset: install-step;
}

.install-steps li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text);
  counter-increment: install-step;
}

.install-steps li::before {
  content: counter(install-step);
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.install-step-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.install-status.is-warn {
  color: #b45309;
  font-weight: 600;
}

.install-footer-note {
  margin: 12px 0 0;
  padding: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.45;
  text-align: center;
}

.install-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--primary) 10%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

.install-hint-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
  line-height: 0;
  animation: installBounce 1.4s ease-in-out infinite;
}

.install-hint-text {
  line-height: 1.35;
}

@keyframes installBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

.install-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.install-btn-primary {
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary-grad);
  color: var(--on-primary);
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.install-btn-primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

.install-btn-primary.is-preparing {
  cursor: pointer;
  opacity: 0.92;
}

.install-btn-primary.is-preparing::after {
  content: '';
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-left: 0.45em;
  vertical-align: -0.1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: installSpin 0.7s linear infinite;
}

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

.install-btn-primary:not(:disabled):hover {
  background: linear-gradient(135deg, var(--primary-hover), var(--primary-hover));
}

.install-btn-ghost {
  width: 100%;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

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

@media (prefers-reduced-motion: reduce) {
  .install-overlay,
  .install-card,
  .install-hint-arrow,
  .install-btn-primary.is-preparing::after {
    animation: none;
  }
}

/* Konum izni diyaloğu (ana sayfa takip + yakındaki duraklar ile aynı yapı) */
.geo-prompt,
.nearby-geo-prompt {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(4px);
}

.nearby-page .nearby-geo-prompt {
  position: absolute;
}

.geo-prompt.hidden,
.nearby-geo-prompt.hidden {
  display: none;
}

.geo-prompt-card,
.nearby-geo-prompt-card {
  width: 100%;
  max-width: 340px;
  padding: 20px 18px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.geo-prompt-title,
.nearby-geo-prompt-title {
  margin: 0 0 8px;
  font-size: 1.0625rem;
  font-weight: 700;
}

.geo-prompt-text,
.nearby-geo-prompt-text {
  margin: 0 0 16px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--muted);
}

.geo-prompt-allow,
.nearby-geo-allow {
  margin-bottom: 10px;
}

.geo-prompt-skip,
.nearby-geo-skip {
  display: block;
  width: 100%;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.geo-prompt-hint,
.nearby-geo-hint {
  margin: 12px 0 0;
  font-size: 0.6875rem;
  line-height: 1.4;
  color: var(--muted);
}

/* Bildirim izni diyaloğu */
.push-prompt {
  position: fixed;
  inset: 0;
  z-index: 750;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: color-mix(in srgb, var(--bg) 50%, transparent);
  backdrop-filter: blur(6px);
}

.push-prompt.hidden {
  display: none;
}

.push-prompt-card {
  width: 100%;
  max-width: 360px;
  padding: 22px 20px 18px;
  border-radius: calc(var(--radius) + 4px);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.push-prompt-icon-wrap {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--primary-weak), color-mix(in srgb, var(--primary) 18%, var(--surface)));
  color: var(--primary);
}

.push-prompt-icon {
  width: 28px;
  height: 28px;
}

.push-prompt-title {
  margin: 0 0 8px;
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.push-prompt-text {
  margin: 0 0 18px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: left;
}

.push-prompt-allow {
  margin-bottom: 8px;
  font-weight: 700;
}

.push-prompt-allow.hidden {
  display: none;
}

.push-prompt-skip {
  display: block;
  width: 100%;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.push-prompt-hint {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--muted);
  text-align: left;
}

.push-prompt-hint.hidden {
  display: none;
  margin: 0;
  padding: 0;
  border: none;
}

/* Takip oluştur: konum seçeneği (checkbox global input { width:100% } ile taşmasın) */
#geoSection {
  min-width: 0;
  max-width: 100%;
}
.job-geo-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 100%;
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  line-height: 1.4;
}
.job-geo-opt span {
  flex: 1;
  min-width: 0;
}
.job-geo-opt input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  min-width: 1.125rem;
  margin: 2px 0 0;
  padding: 0;
  flex-shrink: 0;
  appearance: auto;
  accent-color: var(--primary);
}
#geoSection .field-hint {
  margin-top: 4px;
}

/* ===== Kompakt takip sihirbazı (anasayfa) ===== */
.create-track-compact {
  padding: 14px 16px;
}

.create-track-compact.guide-highlight {
  animation: createTrackGuidePulse 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes createTrackGuidePulse {
  0% {
    box-shadow: var(--shadow-sm), 0 0 0 rgba(79, 70, 229, 0);
    border-color: var(--glass-border);
  }
  38% {
    box-shadow: var(--shadow), 0 0 0 10px color-mix(in srgb, var(--primary) 22%, transparent);
    border-color: color-mix(in srgb, var(--primary) 42%, var(--glass-border));
  }
  100% {
    box-shadow: var(--shadow-sm), 0 0 0 rgba(79, 70, 229, 0);
    border-color: var(--glass-border);
  }
}

.create-track-compact .create-track-title {
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.create-track-compact .track-wizard {
  gap: 10px;
}

.create-track-compact .track-step {
  display: grid;
  gap: 8px;
}

.create-track-compact .track-step.hidden {
  display: none !important;
  animation: none;
}

.create-track-compact .track-step:not(.hidden) {
  animation: trackStepReveal 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .create-track-compact .track-step:not(.hidden) {
    animation: none;
  }
}

.create-track-compact .track-step-kicker {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}

.create-track-compact .track-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.create-track-compact .track-step-hint {
  margin: 0;
  font-size: 0.75rem;
}

.create-track-compact .search-compact input {
  padding: 10px 12px;
  font-size: 0.875rem;
}

.create-track-compact .route-list-compact,
.create-track-compact .stop-list-compact {
  max-height: 148px;
  margin-top: 6px;
}

.create-track-compact .route-row {
  padding: 9px 10px;
}

.create-track-compact .stop-row {
  padding: 9px 10px;
}

.create-track-compact .stop-row-btn {
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}

.create-track-compact .stop-row-meta {
  font-size: 0.625rem;
}

.create-track-compact .selected-box-compact {
  padding: 10px 12px;
  gap: 8px;
}

.create-track-compact .selected-box-compact .sb-name {
  font-size: 0.9375rem;
}

.create-track-compact .pick-change-btn {
  padding: 6px 10px;
  font-size: 0.75rem;
}

.create-track-compact .track-chip-row {
  gap: 6px;
}

.create-track-compact .track-chip-row .chip {
  padding: 7px 11px;
  font-size: 0.8125rem;
  border-radius: 10px;
}

.create-track-compact .track-direction-chips .chip-sub {
  font-size: 0.7rem;
}

.create-track-compact .stop-map-btn {
  padding: 6px 10px;
  font-size: 0.75rem;
  min-height: auto;
}

.create-track-compact .saved-inline-actions {
  gap: 6px;
}

/* ===== Kompakt takip ayarları (anasayfa) ===== */
.track-settings-panel {
  margin-top: 0;
  animation: trackSettingsIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.track-settings-panel.hidden {
  animation: none;
}

@keyframes trackStepReveal {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes trackSettingsIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.track-settings-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  background: linear-gradient(
    165deg,
    color-mix(in srgb, var(--primary-weak) 70%, var(--surface-solid)) 0%,
    var(--surface-solid) 55%
  );
  box-shadow: var(--shadow-sm);
}

.track-settings-heading {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
}

.track-settings-block {
  display: grid;
  gap: 6px;
}

.track-settings-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.track-settings-panel .track-chip-row {
  gap: 6px;
}

.track-settings-panel .chip {
  padding: 7px 11px;
  font-size: 0.8125rem;
  border-radius: 10px;
}

.track-chip-row-threshold .chip {
  min-width: 2.5rem;
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.track-settings-geo {
  padding-top: 2px;
}

.track-geo-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.track-geo-toggle:has(input:checked) {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  background: var(--primary-weak);
}

.track-geo-toggle input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  margin: 0;
  accent-color: var(--primary);
}

.track-settings-submit {
  margin-top: 2px;
}

.track-settings-submit .btn-block {
  min-height: 48px;
  font-size: 0.9375rem;
}

/* Takip paneli: konum şeridi */
.job-geo-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.875rem;
}
.job-geo-strip.hidden {
  display: none;
}
.job-geo-strip-label {
  color: var(--text-muted);
  font-weight: 500;
}
.job-geo-strip-value {
  font-weight: 700;
  color: var(--text);
}
.job-geo-strip-zone {
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--text-muted);
}
.job-geo-strip-zone.is-at_stop {
  background: #ecfdf5;
  color: #065f46;
}
.job-geo-strip-zone.is-near_stop {
  background: #eff6ff;
  color: #1d4ed8;
}
.job-geo-strip-zone.is-far,
.job-geo-strip-zone.is-very_far {
  background: #fff7ed;
  color: #c2410c;
}
.job-geo-strip-zone.is-stale {
  background: #fef2f2;
  color: #991b1b;
}

/* ===== Anasayfa durak haritası seçici ===== */

.stop-map-btn {
  flex-shrink: 0;
  font-size: 0.8125rem;
  padding: 6px 12px;
  white-space: nowrap;
}

.stop-map-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.stop-map-picker {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.stop-map-picker.hidden {
  display: none;
}

body.stop-map-open {
  overflow: hidden;
}

.stop-map-toolbar {
  padding-left: 12px;
}

.stop-map-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.stop-map-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.stop-map-stage {
  flex: 1;
  position: relative;
  min-height: 0;
}

.stop-map-stage .nearby-geo-prompt {
  position: absolute;
  inset: 0;
  z-index: 650;
}

.stop-map-stage .map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.stop-map-stage .map-loading {
  position: absolute;
  inset: 0;
  z-index: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
}

.stop-map-stage .map-error {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  top: auto;
  z-index: 660;
  max-height: 40%;
  overflow-y: auto;
}

.stop-map-picker .map-stop-marker {
  cursor: pointer;
}

.leaflet-popup-content button.stop-picker-select-btn,
.leaflet-popup-content button.stop-picker-select-btn:hover,
.leaflet-popup-content button.stop-picker-select-btn:active {
  display: block;
  width: 100%;
  margin-top: 2px;
  padding: 11px 14px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff !important;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;
  line-height: 1.25;
  -webkit-tap-highlight-color: transparent;
}

.leaflet-popup-content button.stop-picker-select-btn:hover {
  filter: brightness(1.08);
}

/* ===== Mobil anasayfa ===== */

.home-page {
  min-height: 100vh;
}

.home-shell {
  min-height: 100vh;
}

.home-header {
  padding: calc(12px + env(safe-area-inset-top)) 16px 8px;
  max-width: 760px;
  margin: 0 auto;
}

.home-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.home-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.home-brand-logo-link {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin: -4px 0 -4px -4px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.home-brand-logo-link:hover,
.home-brand-logo-link:focus-visible {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  outline: none;
}

.home-brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.home-brand-city {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
  color: var(--text);
  font: inherit;
}

.home-brand-name-btn,
.home-brand-chevron-btn {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent !important;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  font-size: inherit;
  line-height: inherit;
  cursor: pointer;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.home-brand-name-btn {
  min-width: 0;
}

.home-brand-chevron-btn {
  padding-left: 2px;
  flex-shrink: 0;
}

.home-brand-name-btn:hover,
.home-brand-name-btn:focus-visible,
.home-brand-name-btn:active,
.home-brand-chevron-btn:hover,
.home-brand-chevron-btn:focus-visible,
.home-brand-chevron-btn:active {
  background: transparent !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
  outline: none;
}

.home-brand-name-btn:hover .home-brand-name,
.home-brand-name-btn:focus-visible .home-brand-name {
  opacity: 0.75;
}

.home-brand-chevron-btn:hover .home-brand-chevron,
.home-brand-chevron-btn:focus-visible .home-brand-chevron {
  opacity: 1;
}

.home-brand-city.is-location-locked .home-brand-chevron-btn {
  display: none;
}

.home-brand-name {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-brand-chevron {
  flex-shrink: 0;
  color: var(--muted);
  opacity: 0.85;
}

.home-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.home-header-btn,
.home-notif-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-solid);
  color: var(--muted);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

.home-header-btn:hover,
.home-notif-btn:hover {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
}

.home-notif-btn.is-push-blocked,
.job-notify-btn.is-push-blocked {
  opacity: 0.58;
  color: var(--muted);
  border-color: var(--border);
  box-shadow: none;
}

.home-notif-btn.is-push-blocked::after,
.job-notify-btn.is-push-blocked::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: color-mix(in srgb, var(--muted) 85%, transparent);
  border-radius: 1px;
  transform: rotate(-32deg);
  pointer-events: none;
}

.home-notif-btn.is-push-granted,
.job-notify-btn.is-push-granted {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 48%, var(--border));
  background: color-mix(in srgb, var(--primary) 10%, var(--surface-solid));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--primary) 18%, transparent),
    0 0 14px color-mix(in srgb, var(--primary) 28%, transparent);
  animation: notif-icon-glow 2.4s ease-in-out infinite;
}

.home-notif-btn.is-push-granted svg,
.job-notify-btn.is-push-granted svg {
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--primary) 35%, transparent));
}

.home-notif-btn.is-push-granted:hover,
.job-notify-btn.is-push-granted:hover {
  border-color: color-mix(in srgb, var(--primary) 60%, var(--border));
}

.home-routines-btn {
  text-decoration: none;
  color: var(--muted);
}

.home-routines-btn:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}

.home-routines-icon-wrap {
  position: relative;
  display: grid;
  place-items: center;
}

.home-routines-dot {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--surface-solid);
}

.home-routines-dot.hidden {
  display: none;
}

@keyframes notif-icon-glow {
  0%,
  100% {
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--primary) 16%, transparent),
      0 0 10px color-mix(in srgb, var(--primary) 22%, transparent);
  }
  50% {
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--primary) 28%, transparent),
      0 0 18px color-mix(in srgb, var(--primary) 38%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-notif-btn.is-push-granted,
  .job-notify-btn.is-push-granted {
    animation: none;
  }
}

.home-greeting {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text);
}

.home-assistant-trigger {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  margin-bottom: 22px;
  padding: 14px 16px 14px 14px;
  border: none;
  border-radius: 18px;
  background: var(--surface-solid);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.04),
    0 10px 28px rgba(79, 70, 229, 0.1);
}

.home-assistant-trigger::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(
    120deg,
    color-mix(in srgb, var(--primary) 70%, #a78bfa),
    color-mix(in srgb, var(--primary) 30%, transparent) 40%,
    color-mix(in srgb, var(--primary) 60%, #818cf8) 70%,
    color-mix(in srgb, var(--primary) 25%, transparent)
  );
  background-size: 200% 200%;
  animation: assistantShimmer 4s ease-in-out infinite;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.home-assistant-trigger__glow {
  position: absolute;
  inset: -20% auto auto -10%;
  width: 55%;
  height: 140%;
  background: radial-gradient(
    ellipse at center,
    color-mix(in srgb, var(--primary) 18%, transparent) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.home-assistant-trigger__icon {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--primary-grad);
  color: var(--on-primary);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 28%, transparent);
}

.home-assistant-trigger__copy {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-assistant-trigger__label {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.3;
}

.home-assistant-trigger__hint {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-assistant-trigger__chip {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--primary-grad);
  color: var(--on-primary);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 24%, transparent);
}

.home-assistant-trigger:hover {
  box-shadow:
    0 2px 4px rgba(16, 24, 40, 0.06),
    0 14px 32px rgba(79, 70, 229, 0.14);
}

.home-assistant-trigger:active {
  transform: scale(0.992);
}

.home-assistant-trigger:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent),
    0 10px 28px rgba(79, 70, 229, 0.12);
}

@keyframes assistantShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .home-assistant-trigger::before {
    animation: none;
  }
}

.home-search-icon {
  flex-shrink: 0;
  color: var(--primary);
  opacity: 0.85;
}

.home-quick-filters {
  margin-bottom: 22px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.home-quick-filters::-webkit-scrollbar {
  display: none;
}

.home-quick-filters .filter-pill {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.home-quick-filters .filter-pill:hover {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
}

.home-quick-filters .filter-pill.is-active {
  border-color: transparent;
  background: var(--primary-grad);
  color: var(--on-primary);
  box-shadow: 0 4px 14px var(--primary-weak);
}

.home-section {
  margin-bottom: 22px;
}

.home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.home-section-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.home-section-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  padding: 6px 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.home-section-link:hover {
  text-decoration: underline;
}

.favorite-carousel {
  margin: 0 -16px;
  padding: 0 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.favorite-carousel::-webkit-scrollbar {
  display: none;
}

.favorite-carousel-track {
  display: flex;
  gap: 8px;
  padding-bottom: 2px;
}

.favorite-card {
  flex: 0 0 auto;
  width: 128px;
  min-height: 84px;
  padding: 11px;
  border-radius: 13px;
  border: 1px solid var(--glass-border);
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.12s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.favorite-card:active {
  transform: scale(0.98);
}

.favorite-card-code {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--violet);
}

.favorite-card.is-tram .favorite-card-code {
  color: #9333ea;
}

.favorite-card-name {
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.favorite-card-eta {
  margin-top: auto;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text);
}

.favorite-card-eta.is-muted {
  color: var(--muted);
  font-weight: 500;
}

.favorite-card.is-stop {
  width: 144px;
}

.favorite-card.is-stop .favorite-card-title {
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.favorite-card.is-stop .favorite-card-meta {
  font-size: 0.6875rem;
  color: var(--muted);
  font-weight: 500;
}

.favorite-empty {
  padding: 16px;
  border-radius: 16px;
  border: 1px dashed var(--border);
  background: var(--surface-2);
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: center;
}

.nearby-widget {
  display: grid;
  gap: 10px;
}

.nearby-widget-loading,
.nearby-widget-fallback {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  font-size: 0.875rem;
  color: var(--muted);
}

.nearby-widget-loading .spinner {
  margin: 0;
  width: 18px;
  height: 18px;
}

.nearby-stop-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.nearby-stop-card:hover {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  box-shadow: var(--shadow);
}

.nearby-stop-main {
  flex: 1;
  min-width: 0;
}

.nearby-stop-name {
  display: block;
  font-size: 0.9375rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nearby-stop-meta {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--muted);
}

.nearby-stop-eta {
  flex-shrink: 0;
  text-align: right;
}

.nearby-stop-route {
  display: block;
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--violet);
}

.nearby-stop-route.is-tram {
  color: #9333ea;
}

.nearby-stop-time {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
}

.home-search-panel {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  animation: homeSearchIn 0.22s ease;
}

.home-search-panel.hidden {
  display: none;
}

@keyframes homeSearchIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.home-search-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.home-search-back {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

.home-search-back:hover {
  background: var(--surface-2);
  transform: none;
  filter: none;
}

.home-search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
}

.home-search-input {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
}

.home-search-input:focus {
  outline: none;
  box-shadow: none;
  border: none;
  background: transparent;
}

.home-search-type-tabs {
  display: flex;
  gap: 6px;
  margin: 0 16px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.home-search-type-tabs.hidden {
  display: none;
}

.home-search-type-tab {
  flex: 1;
  min-height: 36px;
  padding: 8px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.home-search-type-tab.is-active {
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.home-search-panel.is-stop-mode .home-search-filters {
  display: none;
}

.home-search-filters {
  padding: 12px 16px 0;
  margin-bottom: 0;
}

.home-search-stop-list {
  display: grid;
  gap: 6px;
}

.home-search-stop-list.hidden {
  display: none !important;
}

.home-search-results .route-list.hidden {
  display: none !important;
}

.home-search-results {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px 24px;
}

.home-search-results .route-list {
  max-height: none;
}

body.home-search-open {
  overflow: hidden;
}

@view-transition {
  navigation: auto;
}

.tab-bar {
  position: fixed;
  left: var(--tab-bar-float-inset);
  right: var(--tab-bar-float-inset);
  bottom: var(--tab-bar-float-bottom);
  z-index: 100;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  max-width: 760px;
  margin: 0 auto;
  padding: 5px 6px;
  border: 1px solid var(--tab-bar-glass-border);
  border-radius: 24px;
  background: var(--tab-bar-glass-bg);
  backdrop-filter: var(--tab-bar-glass-blur);
  -webkit-backdrop-filter: var(--tab-bar-glass-blur);
  box-shadow: var(--tab-bar-glass-shadow);
  isolation: isolate;
  overflow: visible;
  view-transition-name: app-tab-bar;
}

/* Üst kenar speküler yansıma — Liquid Glass optik katmanı */
.tab-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.42) 0%,
    rgba(255, 255, 255, 0.1) 22%,
    transparent 52%
  );
  pointer-events: none;
  z-index: 0;
}

.tab-bar > * {
  position: relative;
  z-index: 1;
}

:root[data-theme="dark"] .tab-bar::before {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.14) 0%,
    rgba(255, 255, 255, 0.04) 24%,
    transparent 54%
  );
}

:root[data-theme="dark"] .appbar {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .appbar.scrolled {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 4px 24px rgba(0, 0, 0, 0.28);
}

::view-transition-old(app-tab-bar),
::view-transition-new(app-tab-bar) {
  animation-duration: 0s;
}

::view-transition-old(root) {
  animation: tab-page-out 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
}

::view-transition-new(root) {
  animation: tab-page-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes tab-page-out {
  to {
    opacity: 0;
    transform: scale(0.992);
  }
}

@keyframes tab-page-in {
  from {
    opacity: 0;
    transform: scale(1.006);
  }
}

.tab-bar > :nth-child(2) {
  padding-inline-end: 0;
}

.tab-bar > :nth-child(4) {
  padding-inline-start: 0;
}

.tab-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 50px;
  padding: 6px 4px;
  border: none;
  border-radius: 14px;
  background: transparent;
  position: relative;
  color: var(--muted);
  font: inherit;
  font-size: 0.625rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
  transition:
    color 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-tap-highlight-color: transparent;
}

.tab-bar-item svg {
  flex-shrink: 0;
  transition:
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    stroke 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.tab-bar-item:hover,
.tab-bar-item.is-active {
  color: var(--primary);
  transform: none;
  filter: none;
  box-shadow: none;
}

.tab-bar-item.is-active {
  background: transparent;
}

/* Seçili sekme — cam pill seçici (iOS Liquid Glass tab bar) */
.tab-bar-item.is-active::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(100% - 2px);
  height: calc(100% - 4px);
  transform: translate(-50%, -50%);
  border-radius: 13px;
  background: var(--tab-bar-active-pill-bg);
  backdrop-filter: var(--tab-bar-active-pill-blur);
  -webkit-backdrop-filter: var(--tab-bar-active-pill-blur);
  box-shadow: var(--tab-bar-active-pill-shadow);
  z-index: -1;
  transition:
    opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.tab-bar-item.is-active svg {
  stroke: var(--primary);
  transform: scale(1.1);
}

.tab-bar-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 18px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.5625rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
  z-index: 2;
}

.tab-bar-badge[hidden] {
  display: none;
}

.tab-bar-item.is-active .tab-bar-badge {
  background: var(--primary);
  box-shadow: 0 0 0 2px var(--tab-bar-glass-bg);
}

.tab-bar-item.is-active:active:not(.is-disabled) svg {
  transform: scale(1.04);
}

.tab-bar-item:active:not(.is-active):not(.is-disabled) svg {
  transform: scale(0.94);
}

.tab-bar-item.is-disabled {
  color: var(--muted);
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.tab-bar-item.is-disabled:hover {
  color: var(--muted);
  background: transparent;
}

.tab-bar-fab-slot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 52px;
  pointer-events: none;
}

.tab-bar-fab {
  position: relative;
  z-index: 3;
  transform: translateY(-9px);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 14px;
  background: var(--success);
  color: #fff;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  pointer-events: auto;
  appearance: none;
  -webkit-appearance: none;
  box-shadow:
    0 0 0 3px var(--tab-bar-glass-bg),
    0 3px 12px -4px color-mix(in srgb, var(--success) 30%, transparent);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

.tab-bar-fab svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  stroke: currentColor;
  pointer-events: none;
}

@media (hover: hover) {
  .tab-bar-fab:hover {
    transform: translateY(-6px);
    filter: brightness(1.04);
    box-shadow:
      0 0 0 3px var(--tab-bar-glass-bg),
      0 4px 14px -3px color-mix(in srgb, var(--success) 34%, transparent);
  }
}

.tab-bar-fab:active {
  transform: translateY(-4px) scale(0.97);
  filter: brightness(0.98);
}

@media (prefers-reduced-motion: reduce) {
  .tab-bar-fab {
    transition: box-shadow 0.16s ease, filter 0.16s ease;
  }

  @media (hover: hover) {
    .tab-bar-fab:hover {
      transform: translateY(-9px);
    }
  }

  .tab-bar-fab:active {
    transform: translateY(-9px);
  }
}

.home-main {
  display: grid;
}

.home-main > .home-panel {
  grid-area: 1 / 1;
  min-width: 0;
  transition:
    opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.32s;
}

.home-panel.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.985);
}

.saved-hub {
  padding: 16px;
}

.saved-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.saved-action-btn {
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: none;
}

.saved-action-btn:hover {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  color: var(--primary);
}

.saved-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.saved-card {
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 12px;
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

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

.saved-card-head h3 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
}

.saved-card-link {
  border: none;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 0;
  box-shadow: none;
}

.saved-list {
  display: grid;
  gap: 8px;
}

.saved-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-solid);
  color: var(--text);
  text-align: left;
  text-decoration: none;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  box-shadow: none;
}

.saved-item:hover {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}

.saved-item-main {
  flex: 1;
  min-width: 0;
}

.saved-item-main strong {
  display: block;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-item-main span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-item-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--primary-weak);
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 800;
}

.saved-item-remove {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.875rem;
  padding: 4px 6px;
  box-shadow: none;
}

.saved-item-remove:hover {
  color: var(--danger);
}

.saved-empty {
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
}

.saved-suggestions {
  margin-top: 10px;
  padding-top: 2px;
}

.saved-suggestion-list {
  display: grid;
  gap: 8px;
}

.saved-suggestion {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--violet-weak) 34%, var(--surface-solid));
  color: var(--text);
  text-align: left;
  font: inherit;
  box-shadow: none;
}

.saved-suggestion small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.6875rem;
}

@media (min-width: 640px) {
  .saved-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .saved-quick-actions {
    grid-template-columns: 1fr;
  }

  .saved-inline-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

.home-page .notif-prompt-banner {
  bottom: calc(var(--tab-bar-offset) + 8px);
}

@media (min-width: 641px) {
  .tab-bar {
    left: 50%;
    right: auto;
    width: min(760px, calc(100% - var(--tab-bar-float-inset) * 2));
    margin-left: 0;
    margin-right: 0;
    transform: translateX(-50%);
    border-radius: 24px;
  }

  .home-search-panel {
    max-width: 760px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-search-panel {
    animation: none;
  }

  .create-track-compact.guide-highlight {
    animation: none;
    border-color: color-mix(in srgb, var(--primary) 42%, var(--glass-border));
  }

  .home-main > .home-panel {
    transition: opacity 0.15s, visibility 0.15s;
  }

  .home-panel.hidden {
    transform: none;
  }

  .tab-bar-item,
  .tab-bar-item svg {
    transition: color 0.15s, stroke 0.15s;
  }

  .tab-bar-item.is-active::before {
    transition: none;
  }

  .tab-bar-item.is-active svg {
    transform: none;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

/* Apple HIG: şeffaflık azaltma tercihi */
@media (prefers-reduced-transparency: reduce) {
  :root {
    --liquid-glass-bg: rgba(255, 255, 255, 0.94);
    --liquid-glass-blur: none;
    --tab-bar-active-pill-bg: var(--surface-3);
    --tab-bar-active-pill-blur: none;
  }

  .tab-bar::before,
  .appbar {
    box-shadow: none;
  }

  .tab-bar,
  .appbar {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .tab-bar-item.is-active::before {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  :root[data-theme="dark"] {
    --liquid-glass-bg: rgba(22, 30, 44, 0.96);
    --tab-bar-active-pill-bg: var(--surface-3);
  }
}

.track-wizard-mode-tabs {
  margin-bottom: 0.25rem;
}

.track-wizard-subtitle {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted);
}

.create-track-anchor {
  display: none;
}

#create-track.is-in-quick-launch {
  margin: 0;
  box-shadow: none;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
  overflow: visible;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#create-track.is-in-quick-launch .create-track-title.hidden {
  display: none;
}

.quick-track-launch-modal {
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}

.quick-track-launch-modal .modal-backdrop {
  background: rgba(0, 0, 0, 0.48);
}

.quick-track-launch-modal .modal-sheet {
  display: flex;
  flex-direction: column;
  max-width: 440px;
  max-height: min(82vh, calc(100vh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  transform: scale(0.96) translateY(0) !important;
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.quick-track-launch-modal.is-open .modal-sheet {
  transform: scale(1) translateY(0) !important;
  opacity: 1;
}

.quick-track-launch-head {
  flex-shrink: 0;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.quick-track-launch-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--text);
}

.quick-track-launch-sub {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted);
}

.quick-track-launch-slot {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px;
}

.quick-track-launch-slot .create-track-compact {
  gap: 8px;
}

.quick-track-launch-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.quick-track-launch-later {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none !important;
}

.quick-track-launch-later:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface-3);
  transform: none !important;
  filter: none;
}

body.quick-track-launch-active {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
}

.stop-row-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font-weight: 500;
  font-size: 0.9375rem;
  box-shadow: none !important;
  transition: border-color 0.15s, background 0.15s;
}

.stop-row-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--surface);
  transform: none !important;
  filter: none;
}

.stop-row-btn:active:not(:disabled) {
  transform: scale(0.99) !important;
}

.stop-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stop-row-meta {
  font-size: 0.6875rem;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.3;
}

.stop-row-btn.is-favorite-manage {
  align-items: center;
  gap: 10px;
}

.stop-row-btn.is-favorite-manage.is-favorited {
  border-color: color-mix(in srgb, var(--success) 50%, var(--border));
  background: color-mix(in srgb, var(--success-weak) 55%, var(--surface-2));
}

.stop-row-fav-pill {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.stop-row-fav-pill.is-on {
  color: var(--success);
  background: var(--success-weak);
  border-color: color-mix(in srgb, var(--success) 40%, transparent);
}

.stop-row-fav-pill.is-off {
  color: var(--primary);
  background: var(--primary-weak);
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
}

.stop-row-name {
  flex: 1;
  min-width: 0;
  text-align: left;
  color: var(--text);
  font-weight: 600;
  line-height: 1.35;
}

.stop-row-dist {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: 8px;
}

.stop-line-toolbar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.text-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  box-shadow: none !important;
  border-radius: 0;
}

.text-btn:hover:not(:disabled) {
  transform: none !important;
  filter: none;
  text-decoration: underline;
}

.stop-line-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: min(220px, 36vh);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-right: 2px;
  scrollbar-width: thin;
}

.create-track-compact .stop-line-list {
  max-height: min(180px, 30vh);
}

.stop-line-list-hint {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
}

.stop-line-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex-shrink: 0;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.stop-line-row.is-selected {
  border-color: color-mix(in srgb, var(--primary) 50%, var(--border));
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}

.stop-line-check {
  width: 2.125rem;
  flex-shrink: 0;
  border: none;
  border-right: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.8125rem;
  color: var(--primary);
  padding: 0;
  box-shadow: none !important;
  border-radius: 0;
}

.stop-line-check:hover:not(:disabled) {
  background: var(--surface-3);
  transform: none !important;
  filter: none;
}

.stop-line-body {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.35rem 0.5rem;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font-weight: 500;
  font-size: 0.8125rem;
  box-shadow: none !important;
  border-radius: 0;
}

.stop-line-body:hover:not(:disabled) {
  background: color-mix(in srgb, var(--primary) 4%, transparent);
  transform: none !important;
  filter: none;
}

.stop-line-row .route-badge {
  min-width: 40px;
  height: 28px;
  padding: 0 6px;
  font-size: 0.75rem;
  border-radius: 7px;
}

.stop-line-headsign {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* —— Yazılı asistan (tam ekran modal) —— */
body.chat-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

.chat-assistant {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  pointer-events: none;
}

.chat-assistant.is-open {
  pointer-events: auto;
}

.chat-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 20, 0.48);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.chat-assistant.is-open .chat-overlay {
  opacity: 1;
}

.chat-overlay[hidden] {
  display: none !important;
}

.chat-modal,
.chat-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  height: min(92vh, 820px);
  max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  background: var(--surface-solid);
  border: 1px solid color-mix(in srgb, var(--primary) 12%, var(--border));
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  box-shadow:
    0 -8px 40px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: var(--chat-keyboard-inset, 0px);
}

html.is-standalone-app .chat-modal,
html.is-standalone-app .chat-panel {
  max-height: calc(var(--app-height, 100vh) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}

.chat-modal.is-open,
.chat-panel.is-open {
  transform: translateY(0);
}

.chat-modal[hidden],
.chat-panel[hidden] {
  display: none !important;
}

@media (min-width: 640px) {
  .chat-assistant {
    align-items: center;
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  }

  .chat-modal,
  .chat-panel {
    height: min(88vh, 820px);
    border-radius: 20px;
    border-bottom: 1px solid color-mix(in srgb, var(--primary) 12%, var(--border));
    transform: translateY(16px) scale(0.98);
    opacity: 0;
    transition:
      transform 0.24s cubic-bezier(0.32, 0.72, 0, 1),
      opacity 0.2s ease;
  }

  .chat-modal.is-open,
  .chat-panel.is-open {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--primary) 6%, var(--surface-solid)) 0%,
    var(--surface-solid) 100%
  );
}

.chat-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.chat-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-grad);
  color: var(--on-primary);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent),
    0 6px 16px color-mix(in srgb, var(--primary) 22%, transparent);
}

.chat-avatar svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.chat-avatar--ai {
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.42), transparent 48%),
    var(--primary-grad);
}

.chat-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.chat-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chat-beta-badge {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--primary-grad);
  color: var(--on-primary);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
}

.chat-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.2;
}

.chat-status--beta {
  color: color-mix(in srgb, var(--primary) 55%, var(--muted));
}

.chat-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px color-mix(in srgb, #22c55e 25%, transparent);
}

.chat-close-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-close-btn:hover {
  background: color-mix(in srgb, var(--text) 7%, transparent);
  color: var(--text);
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 60%),
    color-mix(in srgb, var(--bg) 55%, var(--surface-solid));
}

.chat-msg {
  display: flex;
}

.chat-msg--user {
  justify-content: flex-end;
}

.chat-msg--bot {
  justify-content: flex-start;
}

.chat-msg-bubble {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-word;
}

.chat-msg--user .chat-msg-bubble {
  background: var(--primary-grad);
  color: var(--on-primary);
  border-bottom-right-radius: 3px;
}

.chat-msg--bot .chat-msg-bubble {
  background: var(--surface-solid);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--primary) 14%, var(--border));
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.04);
}

.chat-welcome-card {
  align-self: stretch;
  padding: 10px 10px 8px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 12%, var(--border));
  background: color-mix(in srgb, var(--primary) 4%, var(--surface-solid));
}

.chat-welcome-lead {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--muted);
}

.chat-scenario-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-scenario-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 10px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
  transition: background 0.12s, border-color 0.12s;
}

.chat-scenario-btn__label {
  line-height: 1.2;
}

.chat-scenario-btn:hover {
  background: color-mix(in srgb, var(--primary) 8%, var(--surface-solid));
  border-color: color-mix(in srgb, var(--primary) 24%, var(--border));
}

.chat-scenario-btn--primary {
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
  background: color-mix(in srgb, var(--primary) 10%, var(--surface-solid));
}

.chat-msg--typing .chat-msg-bubble {
  min-width: 44px;
  padding: 9px 11px;
}

.chat-typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chat-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--text) 40%, transparent);
  animation: chatTypingBounce 1.2s ease-in-out infinite;
}

.chat-typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.chat-typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes chatTypingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.chat-msg--progress .chat-msg-bubble {
  max-width: min(88%, 260px);
  padding: 6px 10px;
  border-style: dashed;
  background: color-mix(in srgb, var(--surface-solid) 92%, transparent);
}

.chat-progress-bubble {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chat-progress-ring {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--primary) 16%, transparent);
  border-top-color: var(--primary);
  animation: chatProgressSpin 0.85s linear infinite;
}

.chat-progress-label {
  font-size: 0.75rem;
  line-height: 1.25;
  color: color-mix(in srgb, var(--text) 72%, transparent);
  transition: opacity 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-msg--progress-out {
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  .chat-progress-ring {
    animation: none;
    border-top-color: color-mix(in srgb, var(--primary) 45%, transparent);
  }

  .chat-progress-label,
  .chat-msg--progress-out {
    transition: none;
  }
}

.voice-assistant {
  position: fixed;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.voice-mic-status {
  max-width: 180px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  line-height: 1.25;
  text-align: center;
  color: color-mix(in srgb, var(--text) 82%, transparent);
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--text) 8%, transparent);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.voice-assistant.is-processing .voice-mic-status,
.voice-assistant.is-processing .voice-mic-status:not(:empty) {
  opacity: 1;
  transform: translateY(0);
}

.chat-action-dock {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 10px 0;
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: var(--surface-solid);
}

.chat-action-dock.hidden {
  display: none;
}

.chat-menu-btn {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 6%, var(--surface-solid));
  color: color-mix(in srgb, var(--text) 88%, transparent);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.chat-menu-btn:hover {
  border-color: color-mix(in srgb, var(--primary) 36%, var(--border));
  background: color-mix(in srgb, var(--primary) 10%, var(--surface-solid));
}

.chat-menu-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent);
}

.chat-menu-btn__icon {
  flex-shrink: 0;
  color: color-mix(in srgb, var(--primary) 80%, var(--text));
}

.chat-menu-btn__label {
  line-height: 1.2;
}

.chat-action-dock__dynamic {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}

.chat-action-dock__dynamic::-webkit-scrollbar {
  display: none;
}

.chat-action-dock__dynamic.hidden {
  display: none;
}

.chat-quick-btn {
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  background: var(--surface-solid);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 12px;
  min-height: 28px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.chat-quick-btn:hover {
  background: color-mix(in srgb, var(--primary) 10%, var(--surface-solid));
}

.chat-quick-btn:active {
  transform: scale(0.98);
}

.chat-quick-btn--accent {
  background: var(--primary-grad);
  border-color: transparent;
  color: var(--on-primary);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 22%, transparent);
}

.chat-quick-btn--accent:hover {
  filter: brightness(1.03);
}

.chat-quick-btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
  font-weight: 500;
}

.chat-quick-btn--ghost:hover {
  background: color-mix(in srgb, var(--text) 5%, var(--surface-solid));
  color: var(--text);
}

.chat-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface-solid);
}

.chat-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 16px;
  font: inherit;
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

.chat-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 14%, transparent);
}

.chat-send-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--primary-grad);
  color: var(--on-primary);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 28%, transparent);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.chat-send-btn:disabled,
.chat-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  .chat-modal,
  .chat-panel,
  .chat-overlay,
  .chat-menu-btn,
  .chat-quick-btn {
    transition: none;
  }
  .chat-typing-dot {
    animation: none;
    opacity: 0.65;
  }
}


