/* ═══════════════════════════════════════
   apptcdd — corporate refresh
   Navy + red accent, system UI, lightweight
   Powered by Design Tokens
═══════════════════════════════════════ */

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

:root {
  /* ── BRAND COLORS ── */
  --navy:        #0b2545;
  --navy-700:    #13315c;
  --navy-600:    #1c4373;
  --navy-50:     #eef2f7;
  --red:         #c8102e;
  --red-dark:    #a80d26;
  --red-50:      #fdecef;

  /* ── NEUTRALS ── */
  --ink:         #0f172a;
  --ink-2:       #334155;
  --ink-3:       #64748b;
  --ink-4:       #94a3b8;
  --line:        #e2e8f0;
  --line-2:      #cbd5e1;
  --bg:          #f6f7f9;
  --surface:     #ffffff;
  --surface-2:   #f8fafc;

  /* ── SEMANTIC COLORS ── */
  --ok:          #15803d;
  --ok-bg:       #ecfdf5;
  --ok-line:     #bbf7d0;
  --warn:        #b45309;
  --warn-bg:     #fffbeb;
  --danger:      #b91c1c;
  --danger-bg:   #fef2f2;

  /* ── DESIGN TOKENS: SPACING (Altın Standart) ── */
  --space-xs:    4px;
  --space-sm:    8px;
  --space-md:    12px;
  --space-lg:    16px;
  --space-xl:    24px;
  --space-2xl:   32px;

  /* ── DESIGN TOKENS: SHAPE & RADIUS ── */
  --radius-sm:   6px;
  --radius:      8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-pill: 999px;

  /* ── SHADOWS ── */
  --shadow-sm:   0 1px 2px rgba(15,23,42,.04), 0 1px 1px rgba(15,23,42,.04);
  --shadow:      0 1px 3px rgba(15,23,42,.06), 0 4px 12px -2px rgba(15,23,42,.06);
  --shadow-lg:   0 8px 24px -4px rgba(15,23,42,.12), 0 2px 6px rgba(15,23,42,.06);

  /* ── TYPOGRAPHY ── */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* ── SYSTEM ── */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100%;
  line-height: 1.5;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
[x-cloak] { display: none !important; }
button { font-family: inherit; }

/* SVG icons inherit color and align cleanly */
.icon { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 40px; height: 40px; }

/* ═══════════════════════════════════════
   NAVBAR
═══════════════════════════════════════ */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding-top: var(--safe-top);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-row {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  height: 60px;
  display: flex;
  align-items: center;
  gap: 0;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--navy);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm) 14px var(--space-sm) 0;
  flex-shrink: 0;
  white-space: nowrap;
}
.nav-logo-mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.nav-logo-mark .icon { width: 40px; height: 40px; }
.nav-logo-text { display: flex; align-items: baseline; gap: 1px; }
.nav-logo-text b { color: var(--navy); }
.nav-logo-text i { color: var(--red); font-style: normal; }

.nav-tabs {
  display: none;
  align-items: center;
  gap: 2px;
  margin-left: var(--space-md);
  flex: 1;
}
.nav-tab {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm) var(--space-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-3);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background .12s, color .12s;
  white-space: nowrap;
}
.nav-tab:hover { background: var(--navy-50); color: var(--navy); }
.nav-tab.is-active { background: var(--navy-50); color: var(--navy); font-weight: 600; }
.nav-tab.is-active .icon { color: var(--red); }
.nav-tab-badge {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 18px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 0 6px;
  border-radius: 9px;
  margin-left: 2px;
}
.nav-user {
  display: none;
  align-items: center;
  gap: var(--space-md);
  margin-left: auto;
  font-size: 13px;
  color: var(--ink-3);
}
.nav-user-token {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600;
  color: var(--navy);
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--navy-50);
  padding: 5px 10px;
  border-radius: var(--radius-pill);
}
.nav-mobile {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-left: auto;
}
.nav-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 9px;
  border-radius: var(--radius);
  color: var(--ink-2);
  display: grid; place-items: center;
  -webkit-tap-highlight-color: transparent;
}
.nav-icon-btn:hover { background: var(--navy-50); color: var(--navy); }

/* ═══════════════════════════════════════
   LAYOUT
═══════════════════════════════════════ */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg) calc(var(--safe-bottom) + 80px);
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.page-sub {
  font-size: 13.5px;
  color: var(--ink-3);
  margin-top: 2px;
}
.page-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════
   LOGIN
═══════════════════════════════════════ */
.login-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  background: radial-gradient(120% 80% at 50% 0%, #e8edf4 0%, var(--bg) 60%);
}
.login-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px 32px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.login-mark {
  width: 256px; height: 256px;
  margin: 0 auto 18px;
  display: grid; place-items: center;
}
.login-mark .icon { width: 256px; height: 256px; }
.login-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xs);
  color: var(--navy);
}
.login-title i { color: var(--red); font-style: normal; }
.login-sub {
  font-size: 13.5px;
  color: var(--ink-3);
  margin-bottom: 26px;
}
.login-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.login-foot {
  margin-top: 18px;
  font-size: 11.5px;
  color: var(--ink-4);
  letter-spacing: .02em;
}

/* ═══════════════════════════════════════
   FORM ELEMENTS
═══════════════════════════════════════ */
.label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.input {
  width: 100%;
  padding: 11px 13px; /* Optik form hizalaması için px korundu */
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font-size: 16px;
  font-family: var(--font);
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
  appearance: none;
}
.input:hover { border-color: var(--ink-4); }
.input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(11,37,69,.12); }
.input::placeholder { color: var(--ink-4); }

/* ═══════════════════════════════════════
   BUTTONS
═══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px var(--space-lg);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s, box-shadow .12s, transform .08s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-primary:hover:not(:disabled) { background: var(--navy-700); border-color: var(--navy-700); }

.btn-red { background: var(--red); color: #fff; border-color: var(--red); box-shadow: 0 1px 2px rgba(200,16,46,.18); }
.btn-red:hover:not(:disabled) { background: var(--red-dark); border-color: var(--red-dark); }

.btn-full { width: 100%; padding: var(--space-md) var(--space-lg); font-size: 14.5px; }
.btn-sm { padding: 6px 11px; font-size: 13px; gap: 5px; }
.btn-sm .icon { width: 14px; height: 14px; }

.btn-ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--navy-50); color: var(--navy); border-color: var(--line-2); }

.btn-soft { background: var(--navy-50); color: var(--navy); border-color: transparent; }
.btn-soft:hover { background: #e0e7ef; }

.btn-danger { background: var(--surface); color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: var(--danger-bg); border-color: #fca5a5; }

.btn-danger-solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger-solid:hover { background: #991b1b; }

.btn-icon { padding: var(--space-sm); gap: 0; }

/* ═══════════════════════════════════════
   ALARM CARDS
═══════════════════════════════════════ */
.alarm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
}

.alarm-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: border-color .12s, box-shadow .12s;
}
.alarm-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); }

.alarm-route {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  min-width: 0;
  width: 100%;
}
.alarm-route span.from, .alarm-route span.to {
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 0 1 auto;
}
.alarm-route .icon { 
  color: var(--red); 
  width: 14px; 
  height: 14px; 
  flex-shrink: 0; 
}

.alarm-time-row { display: flex; align-items: baseline; gap: 10px; }
.alarm-time {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.alarm-date { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.alarm-train { font-size: 12.5px; color: var(--ink-3); margin-top: var(--space-xs); }
.alarm-train b { color: var(--ink-2); font-weight: 600; }

.cabin-row { display: flex; flex-wrap: wrap; gap: 6px; }
.cabin-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600;
  padding: 4px 9px; border-radius: var(--radius-pill);
  border: 1px solid transparent; letter-spacing: -0.005em;
}
.cabin-tag-avail   { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.cabin-tag-full    { background: var(--danger-bg); color: var(--danger); border-color: #fecaca; }
.cabin-tag-unknown { background: var(--surface-2); color: var(--ink-4); border-color: var(--line); }

.alarm-meta {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--space-sm);
  padding-top: var(--space-md);
  border-top: 1px solid var(--line);
}
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600;
  padding: 3px 9px 3px 7px; border-radius: var(--radius-pill);
}
.status-active { background: var(--ok-bg); color: var(--ok); }
.status-paused { background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-active .status-dot { box-shadow: 0 0 0 3px rgba(21,128,61,.18); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

.last-check { display: block; font-size: 11px; color: var(--ink-4); margin-top: var(--space-xs); }
.alarm-actions { display: flex; gap: 6px; }

/* ═══════════════════════════════════════
   SEARCH LAYOUT
═══════════════════════════════════════ */
.search-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-xl); }

.search-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.search-box-title {
  display: flex; align-items: center; gap: var(--space-sm);
  font-size: 15px; font-weight: 700;
  margin-bottom: 18px; color: var(--navy); letter-spacing: -0.01em;
}
.search-box-title .icon { color: var(--red); }
.search-field { margin-bottom: 14px; }

/* ═══════════════════════════════════════
   TRAIN RESULT CARDS
═══════════════════════════════════════ */
.results-label {
  font-size: 11.5px; font-weight: 700; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: var(--space-md);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
}
.train-list { display: flex; flex-direction: column; gap: 10px; }

.train-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); cursor: pointer;
  transition: border-color .12s, box-shadow .12s, transform .08s;
  box-shadow: var(--shadow-sm); width: 100%; max-width: 100%;
  box-sizing: border-box; display: flex; flex-direction: column;
  padding: 0; overflow: hidden;
}
.train-card-top {
  display: flex; align-items: flex-start;
  gap: var(--space-md);
  padding: 14px var(--space-lg);
}
.train-card:hover { border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(11,37,69,.08), var(--shadow); }

.train-time-col { min-width: 82px; flex-shrink: 0; }
.train-dep { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; color: var(--navy); font-variant-numeric: tabular-nums; }
.train-arr { display: flex; align-items: center; gap: var(--space-xs); font-size: 13px; color: var(--ink-3); margin-top: var(--space-xs); font-variant-numeric: tabular-nums; }
.train-arr .icon { width: 12px; height: 12px; }
.train-dur { display: inline-flex; align-items: center; gap: var(--space-xs); font-size: 11.5px; color: var(--ink-4); margin-top: var(--space-xs); }
.train-dur .icon { width: 11px; height: 11px; }

.train-info-col { flex: 1 1 0%; min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.train-name { font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: -0.005em; min-width: 0; width: 100%; }
.train-route { display: flex; align-items: center; gap: 6px; min-width: 0; width: 100%; }
.train-route span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.train-route .icon { flex-shrink: 0; }
.train-num { font-size: 12px; color: var(--ink-4); margin-top: 2px; font-family: var(--font-mono); }

.train-cabins { 
  display: flex; flex-wrap: nowrap; gap: var(--space-sm); 
  padding: 10px var(--space-lg);
  border-top: 1px solid var(--line); background: var(--surface-2);
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.train-cabins::-webkit-scrollbar { display: none; }
.cabin-pill {
  font-size: 11.5px; font-weight: 600; padding: 3px 9px;
  border-radius: var(--radius-pill); border: 1px solid transparent;
  letter-spacing: -0.005em; flex-shrink: 0; 
}
.cabin-pill-avail { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.cabin-pill-full  { background: var(--surface-2); color: var(--ink-4); border-color: var(--line); }

/* ═══════════════════════════════════════
   AUTOCOMPLETE
═══════════════════════════════════════ */
.ac-wrap { position: relative; }
.ac-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 200;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 220px; overflow-y: auto; padding: 4px;
}
.ac-item {
  padding: 9px 10px; font-size: 14px; cursor: pointer;
  border-radius: var(--radius-sm); color: var(--ink-2);
  transition: background .1s, color .1s;
}
.ac-item:hover { background: var(--navy-50); color: var(--navy); }
.station-chip {
  display: flex; align-items: center; gap: 9px; padding: 0 10px 0 12px;
  height: 44px; background: var(--ok-bg); border: 1px solid var(--ok-line);
  border-radius: var(--radius); font-size: 15px; color: var(--ink);
  transition: border-color .12s;
}
.station-chip:hover { border-color: var(--ok); }
.station-chip-check { color: var(--ok); flex-shrink: 0; }
.station-chip-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-clear {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; background: none; border: none;
  cursor: pointer; color: var(--ink-4); border-radius: var(--radius-sm);
  flex-shrink: 0; transition: background .12s, color .12s;
}
.chip-clear:hover { background: rgba(15,23,42,.07); color: var(--ink-2); }

/* ═══════════════════════════════════════
   SETTINGS
═══════════════════════════════════════ */
.settings-wrap { max-width: 600px; }
.settings-group { margin-bottom: 28px; }
.settings-group-title {
  font-size: 11px; font-weight: 700; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 10px; padding-left: 2px;
}
.settings-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.settings-row { padding: var(--space-lg) 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: var(--space-md); }
.settings-row:last-child { border-bottom: none; }
.settings-row-body { flex: 1; min-width: 0; }
.settings-row-label { font-size: 13.5px; font-weight: 500; color: var(--ink-3); }
.settings-row-value { font-family: var(--font-mono); font-weight: 600; font-size: 14px; margin-top: 3px; color: var(--ink); }
.settings-row-hint { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.55; }
.tg-connected { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ok); }

/* ═══════════════════════════════════════
   MODAL / SHEET
═══════════════════════════════════════ */
.overlay {
  position: fixed; inset: 0; z-index: 300; background: rgba(15,23,42,.55);
  display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .15s ease;
}
.sheet {
  background: var(--surface); border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 22px 22px calc(var(--safe-bottom) + 22px);
  width: 100%; max-width: 480px; max-height: 92dvh; overflow-y: auto;
  animation: slideUp .22s cubic-bezier(.16,.84,.34,1);
}
@keyframes slideUp { from { transform: translateY(36px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes scaleIn { from { transform: scale(.97); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.sheet-handle { width: 36px; height: 4px; background: var(--line-2); border-radius: 2px; margin: -4px auto var(--space-lg); }
.sheet-title { font-size: 17px; font-weight: 700; margin-bottom: 4px; color: var(--ink); letter-spacing: -0.01em; }
.sheet-subtitle { font-size: 13px; color: var(--ink-3); margin-bottom: 18px; line-height: 1.5; }

.check-list { display: flex; flex-direction: column; gap: var(--space-sm); margin-bottom: 18px; }
.check-row {
  display: flex; align-items: center; gap: var(--space-md);
  padding: var(--space-md) 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; background: var(--surface);
  transition: border-color .12s, background .12s;
}
.check-row:hover { border-color: var(--line-2); }
.check-row.is-checked { border-color: var(--navy); background: var(--navy-50); }
.check-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--navy); flex-shrink: 0; }
.check-label { font-size: 14.5px; font-weight: 500; flex: 1; color: var(--ink); }
.check-avail { font-size: 12px; font-weight: 600; color: var(--ok); }
.check-full  { font-size: 12px; color: var(--ink-4); }

/* ═══════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════ */
.empty {
  text-align: center; padding: 56px var(--space-xl); color: var(--ink-3);
  display: flex; flex-direction: column; align-items: center;
  background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius-lg);
}
.empty-icon-wrap {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--navy-50); color: var(--navy);
  display: grid; place-items: center; margin-bottom: 14px;
}
.empty-icon-wrap .icon { width: 26px; height: 26px; }
.empty-title { font-size: 15.5px; font-weight: 600; color: var(--ink); }
.empty-sub { font-size: 13px; margin-top: var(--space-xs); color: var(--ink-3); }

/* ═══════════════════════════════════════
   FAB & TOAST & SPINNER
═══════════════════════════════════════ */
.fab {
  position: fixed; bottom: calc(var(--safe-bottom) + 22px); right: 22px;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--red); color: #fff; border: none; cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 8px 20px -4px rgba(200,16,46,.45), 0 2px 6px rgba(0,0,0,.12);
  -webkit-tap-highlight-color: transparent; transition: transform .12s, background .12s; z-index: 50;
}
.fab .icon { width: 22px; height: 22px; stroke-width: 2.4; }
.fab:active { transform: scale(.93); }
.fab:hover { background: var(--red-dark); }

.toast {
  position: fixed; bottom: calc(var(--safe-bottom) + 88px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: var(--radius-pill);
  font-size: 13.5px; font-weight: 500; white-space: nowrap; z-index: 500;
  box-shadow: var(--shadow-lg); display: inline-flex; align-items: center; gap: 7px;
  animation: toastIn .22s cubic-bezier(.16,.84,.34,1);
}
.toast .icon { color: #4ade80; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.spinner {
  width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35);
  border-top-color: currentColor; border-radius: 50%;
  animation: spin .65s linear infinite; display: inline-block; flex-shrink: 0;
}
.spinner-dark { border-color: var(--line); border-top-color: var(--navy); }
@keyframes spin { to { transform: rotate(360deg); } }

.err {
  display: flex; align-items: flex-start; gap: 7px;
  color: var(--danger); background: var(--danger-bg); border: 1px solid #fecaca;
  border-radius: var(--radius); padding: 8px 10px; font-size: 13px; line-height: 1.5; margin-top: 6px;
}
.err .icon { flex-shrink: 0; margin-top: 1px; width: 14px; height: 14px; }


/* ═══════════════════════════════════════
   RESPONSIVE DESIGN (MODERN STANDARDS)
   Desktop (Base) -> Tablet (768px) -> Mobile (480px)
═══════════════════════════════════════ */

/* TABLET VE KÜÇÜK EKRANLAR (max-width: 768px) */
@media (max-width: 768px) {
  .nav-tabs, .nav-user { display: none; } 
  .nav-mobile { display: flex; }         
  
  .wrap { padding: 20px var(--space-lg) 80px; } 
  .toast { bottom: calc(var(--safe-bottom) + 88px); } 
  
  .sheet { 
    border-radius: var(--radius-xl) var(--radius-xl) 0 0; 
    max-width: 100%; 
  }
  .sheet-handle { display: block; }
  .train-time-col { width: 78px; }
}

/* GERÇEK MOBİL & iOS OPTİMİZASYONU (max-width: 480px) */
@media (max-width: 480px) {
  .train-card { 
    padding: 0; 
    gap: 0; 
    align-items: stretch;
    border-radius: var(--radius); 
  }

  .train-card-top { 
    padding: var(--space-md) 14px; 
    gap: var(--space-md); 
  }

  .train-time-col { min-width: 72px; }
  .train-dep { font-size: 20px; letter-spacing: -0.04em; }
  .train-arr, .train-dur { font-size: 11px; }

  .train-info-col { min-width: 0; flex: 1; }
  .train-route { flex-wrap: nowrap; width: 100%; }
  
  /* MOBİLDE KART İÇİ İSTASYON İSİMLERİ İÇİN KESİN ELLİPSİS KURALI */
  .train-route span {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }

  .train-cabins { 
    padding: 10px 14px; 
    gap: 6px;
    border-top: 1px solid var(--line);
    background: var(--surface-2);
  }

  .cabin-pill {
    padding: 4px 10px;
    font-size: 11px;
    flex-shrink: 0; 
  }

}

/* MASAÜSTÜ ÖZEL */
@media (min-width: 769px) {
  .nav-tabs { display: flex; }
  .nav-user { display: flex; }
  .nav-mobile { display: none; }
  
  .search-layout { grid-template-columns: 320px minmax(0, 1fr); align-items: start; }
  .search-form-sticky { position: sticky; top: 76px; }
  
  .overlay { align-items: center; } 
  .sheet { border-radius: var(--radius-lg); max-width: 480px; }
  .sheet-handle { display: none; }
}
/* GENİŞ EKRAN (1080p ve üzeri 2K/4K) OPTİMİZASYONU*/
@media (min-width: 1080px) {
  /* 1. Tüm boşluk jetonlarını ekrana oranla büyütüyoruz */
  :root {
    --space-xs:    6px;
    --space-sm:    10px;
    --space-md:    16px;
    --space-lg:    24px;   /* Örn: 16px'den 24px'e çıktı, kartlar çok daha ferah olacak */
    --space-xl:    32px;
    --space-2xl:   48px;

    /* Kart köşelerini büyük ekrana yakışır şekilde biraz daha yumuşatalım */
    --radius-lg:   16px;   
  }

  /* 2. Sitenin ortalandığı ana iskeleti genişletiyoruz (1200px -> 1400px) */
  .wrap, .nav-row {
    max-width: 1400px;
  }

  /* 3. Dev ekranda cılız durmaması için temel yazıları büyütüyoruz */
  body { font-size: 16px; }
  .page-title { font-size: 28px; }
  .login-title { font-size: 28px; }
  
  /* Kalkış saati büyük ekranda daha devasa dursun */
  .train-dep, .alarm-time { font-size: 28px; }
  
  /* Rakamlar büyüdüğü için saat kolonuna biraz daha nefes aldırıyoruz */
  .train-time-col { min-width: 96px; } 

  /* 4. Alarmlarım sayfasındaki grid (ızgara) kartlarını daha geniş tutuyoruz */
  .alarm-grid {
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  }
}