/* ---------- Üst bölüm ---------- */
.hero {
  background: var(--brand-dark);
  border-bottom: 4px solid transparent;
  border-image: var(--t3-strip) 1;
  color: #fff;
  padding: calc(18px + env(safe-area-inset-top)) 16px 26px;
}

.hero-inner,
.toolbar-inner,
.announcement {
  max-width: 760px;
  margin-inline: auto;
}

/* İç boşluklu kaplar: kart genişliği filtre çubuğuyla aynı kalsın */
.content,
.footer {
  max-width: calc(760px + 32px);
  margin-inline: auto;
}

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

.hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 999px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s;
}

.admin-link:hover {
  background: rgb(255 255 255 / 14%);
}

.admin-link:focus-visible {
  outline: 3px solid rgb(255 255 255 / 55%);
  outline-offset: 2px;
}

/* Çok dar ekranlarda yalnızca kilit simgesi kalsın */
@media (max-width: 340px) {
  .admin-link span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
}

.brand-logo {
  display: block;
  width: auto;
  height: 46px;
}

.hero h1 {
  font-size: clamp(1.45rem, 5.5vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.hero-clock {
  margin-top: 12px;
  font-size: 0.9rem;
  color: rgb(255 255 255 / 85%);
}

.hero-clock strong {
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.dim {
  opacity: 0.7;
}

/* Canlı bağlantı göstergesi */
.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgb(255 255 255 / 12%);
  font-size: 0.8rem;
  font-weight: 600;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f5b64a;
}

.live[data-state='live'] .live-dot {
  background: #3ee08f;
  box-shadow: 0 0 0 0 rgb(62 224 143 / 60%);
  animation: pulse 2s infinite;
}

.live[data-state='offline'] .live-dot {
  background: #ff6b6b;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 8px rgb(62 224 143 / 0%);
  }
  100% {
    box-shadow: 0 0 0 0 rgb(62 224 143 / 0%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .live[data-state='live'] .live-dot {
    animation: none;
  }
}

.hero-viewer {
  margin-top: 8px;
  font-size: 0.9rem;
  color: rgb(255 255 255 / 85%);
}

.hero-viewer[hidden] {
  display: none;
}

.link-btn {
  margin-left: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font-weight: 650;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- Giriş (kayıtlı kişiler) ---------- */
.gate {
  padding: 22px 16px 8px;
}

.gate[hidden],
.toolbar[hidden],
.content[hidden] {
  display: none;
}

.gate-card {
  max-width: 420px;
  margin: 0 auto;
  padding: 24px 20px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.gate-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 1.4rem;
}

.gate-card h2 {
  font-size: 1.2rem;
  line-height: 1.3;
}

.gate-card h2 + .gate-field {
  margin-top: 16px;
}

.gate-field {
  display: grid;
  gap: 5px;
  margin-bottom: 14px;
}

.gate-field label {
  font-size: 0.88rem;
  font-weight: 650;
}

.gate-field input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 1.05rem;
}

.gate-field input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}

.gate-field.has-error input {
  border-color: var(--danger);
}

.gate-error {
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 600;
}

.gate-error:empty {
  display: none;
}

.gate-alert {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 600;
}

.gate-alert[hidden] {
  display: none;
}

.gate-submit {
  width: 100%;
  min-height: 48px;
}

.gate-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

/* ---------- Duyuru ---------- */
.announcement {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  margin-inline: max(16px, calc((100% - 760px) / 2));
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  color: var(--text);
  font-size: 0.95rem;
}

.announcement[hidden] {
  display: none;
}

.announcement .icon {
  color: var(--warn);
  margin-top: 2px;
}

.announcement p {
  flex: 1;
  min-width: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.announcement .announcement-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  margin: -6px -8px -6px 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.announcement .announcement-close .icon {
  width: 16px;
  height: 16px;
  margin: 0;
  color: inherit;
}

.announcement .announcement-close:hover {
  background: color-mix(in srgb, var(--warn) 18%, transparent);
  color: var(--text);
}

/* ---------- Filtre çubuğu ---------- */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.toolbar-inner {
  display: grid;
  gap: 10px;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: -2px;
  padding: 2px;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.chip[aria-selected='true'] {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--muted);
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
}

.search:focus-within {
  border-color: var(--primary);
}

/* ---------- İçerik ---------- */
.content {
  padding: 18px 16px 8px;
}

.section + .section {
  margin-top: 26px;
}

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

.section-head h2 {
  font-size: 1.05rem;
}

.section-head .count {
  color: var(--muted);
  font-size: 0.85rem;
}

.list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- Sefer kartı ---------- */
.trip {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 4px 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.trip.is-next {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--primary) 30%, transparent),
    var(--shadow);
}

.trip.is-past {
  opacity: 0.62;
  box-shadow: none;
}

.trip-time {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.trip-time .t {
  font-size: 1.55rem;
  font-weight: 750;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.trip-time .kind {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ring-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 1.5rem;
}

.trip-body {
  min-width: 0;
}

.route {
  position: relative;
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0 0 0 20px;
  list-style: none;
}

.route::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--border);
}

.route li {
  position: relative;
  font-weight: 650;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.route li::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 0.32em;
  width: 12px;
  height: 12px;
  border: 3px solid var(--primary);
  border-radius: 50%;
  background: var(--surface);
}

.route li.to::before {
  background: var(--primary);
}

.route .label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stops {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.note {
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 0.88rem;
  white-space: pre-line;
}

.trip-status {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.trip-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.88rem;
}

.driver {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.call {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  font-weight: 650;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}

@media (max-width: 420px) {
  .trip {
    grid-template-columns: 62px 1fr;
    gap: 4px 12px;
  }

  .trip-time .t {
    font-size: 1.3rem;
  }

  .trip-meta {
    margin-left: 0;
    width: 100%;
  }
}

/* Kalkmış seferler */
.past {
  margin-top: 16px;
}

.past summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 2px;
  color: var(--muted);
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

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

.past summary::before {
  content: '▸';
  transition: transform 0.15s;
}

.past[open] summary::before {
  transform: rotate(90deg);
}

/* Boş durum ve iskelet */
.empty {
  padding: 42px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.empty strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 1.05rem;
}

.skeleton {
  display: grid;
  gap: 10px;
}

.skeleton div {
  height: 118px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}

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

.error-box {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 600;
}

/* ---------- Alt bilgi ---------- */
.footer {
  padding: 24px 16px calc(28px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.footer p + p {
  margin-top: 4px;
}

/* ---------- Harita ---------- */
.trip-map-wrap {
  margin-top: 10px;
}

.map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.map-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--primary);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.map-btn:hover {
  background: var(--primary-soft);
}

.map-btn .icon {
  width: 17px;
  height: 17px;
}

.trip-map {
  height: 260px;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
}

@media (min-width: 700px) {
  .trip-map {
    height: 320px;
  }
}

.map-error {
  padding: 16px;
  color: var(--muted);
  font-size: 0.88rem;
}

.stop-popup {
  display: grid;
  gap: 4px;
  font: 0.85rem/1.35 var(--font);
}

.stop-popup a {
  color: var(--primary);
  font-weight: 650;
}

/* ---------- Bildirimler ---------- */
.notify-btn {
  background: transparent;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
}

.notify-btn .icon {
  width: 16px;
  height: 16px;
}

.notify-btn.is-on {
  border-color: rgb(255 184 28 / 70%);
  color: #ffd27a;
}

@media (max-width: 520px) {
  .notify-btn {
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .notify-btn .notify-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
}

.sheet {
  width: min(440px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.sheet::backdrop {
  background: rgb(10 20 40 / 55%);
}

.sheet-body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sheet-head h2 {
  font-size: 1.1rem;
}

.sheet-x {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
}

.sheet-x:hover {
  background: var(--surface-2);
}

.sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* iPhone: 1. adımda ok alttaki gerçek Paylaş düğmesini gösterir; pencere üstte durur. */
.sheet.is-guide {
  margin-top: calc(12px + env(safe-area-inset-top));
}

.sheet.is-guide:has(.guide-pointer.is-top) {
  margin-top: auto;
  margin-bottom: calc(12px + env(safe-area-inset-bottom));
}

.guide {
  display: grid;
  gap: 6px;
  text-align: center;
}

.guide h3 {
  font-size: 1rem;
}

.guide p {
  color: var(--muted);
  font-size: 0.9rem;
}

.guide .guide-lead {
  margin-bottom: 4px;
  color: var(--text);
}

.guide .guide-step {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.guide-art {
  display: grid;
  place-items: center;
  padding: 10px 0 4px;
}

.guide-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.guide-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
}

.guide-dot.is-on {
  background: var(--primary);
}

/* Telefon ekranı çizimleri */
.mock-screen {
  display: flex;
  flex-direction: column;
  width: 220px;
  height: 150px;
  overflow: hidden;
  border: 6px solid #1f2d3a;
  border-radius: 18px;
  background: #f4f6f8;
  color: #1f2d3a;
  text-align: left;
}

.mock-page {
  flex: 1;
  background:
    linear-gradient(#dfe7ec 0 0) 12px 14px / 60% 8px no-repeat,
    linear-gradient(#e6edf1 0 0) 12px 30px / 80% 6px no-repeat,
    linear-gradient(#e6edf1 0 0) 12px 42px / 70% 6px no-repeat,
    #fff;
}

.mock-toolbar,
.mock-url {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 4px;
  padding: 6px 4px;
  background: #eef1f4;
}

.mock-url {
  justify-content: flex-end;
}

.mock-address {
  flex: 1;
  padding: 3px 6px;
  border-radius: 6px;
  background: #fff;
  font-size: 0.55rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mock-btn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #0a7aff;
}

.mock-icon {
  width: 18px;
  height: 18px;
}

.is-hot,
.mock-btn.is-hot {
  position: relative;
  box-shadow: 0 0 0 2px var(--t3-yellow);
  animation: guide-pulse 1.4s ease-in-out infinite;
}

.mock-sheet {
  gap: 4px;
  padding: 8px;
  background: #eef1f4;
}

.mock-sheet-app {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 4px;
  font-size: 0.6rem;
  font-weight: 700;
}

.mock-sheet-app img {
  width: 22px;
  height: 22px;
  border-radius: 5px;
}

.mock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-radius: 6px;
  background: #fff;
  font-size: 0.65rem;
}

.mock-row .mock-icon {
  width: 14px;
  height: 14px;
}

.mock-row.is-hot {
  font-weight: 700;
}

.mock-add {
  background: #eef1f4;
}

.mock-add-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  background: #fff;
  font-size: 0.6rem;
}

.mock-add-bar span {
  color: #0a7aff;
}

.is-hot-text {
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
  box-shadow: 0 0 0 2px var(--t3-yellow);
  animation: guide-pulse 1.4s ease-in-out infinite;
}

.mock-add-app {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 10px;
  padding: 8px;
  border-radius: 8px;
  background: #fff;
  font-size: 0.7rem;
}

.mock-add-app img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.mock-home {
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: linear-gradient(160deg, #3b6f8f, #263746);
}

.mock-grid {
  display: grid;
  grid-template-columns: repeat(6, 22px);
  gap: 8px;
}

.mock-app {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgb(255 255 255 / 35%);
}

.mock-app.is-ours {
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0 0 2px var(--t3-yellow);
  animation: guide-pulse 1.4s ease-in-out infinite;
}

.mock-app.is-ours img {
  width: 100%;
  height: 100%;
}

.mock-home-label {
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
}

.guide-pointer {
  position: fixed;
  left: 50%;
  bottom: calc(6px + env(safe-area-inset-bottom));
  display: grid;
  justify-items: center;
  gap: 2px;
  transform: translateX(-50%);
  color: var(--t3-yellow);
  font-weight: 800;
  font-size: 0.85rem;
  text-shadow: 0 1px 3px rgb(0 0 0 / 60%);
  pointer-events: none;
  animation: guide-bounce 1.1s ease-in-out infinite;
}

.guide-pointer::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 18px solid var(--t3-yellow);
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 50%));
}

.guide-pointer.is-top {
  top: calc(6px + env(safe-area-inset-top));
  bottom: auto;
  left: auto;
  right: 72px;
  transform: none;
  animation-name: guide-bounce-up;
}

.guide-pointer.is-top::after {
  order: -1;
  border-top: 0;
  border-bottom: 18px solid var(--t3-yellow);
}

@keyframes guide-pulse {
  50% {
    box-shadow: 0 0 0 5px rgb(255 184 28 / 45%);
  }
}

@keyframes guide-bounce {
  50% {
    transform: translate(-50%, 6px);
  }
}

@keyframes guide-bounce-up {
  50% {
    transform: translateY(-6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .guide-pointer,
  .is-hot,
  .mock-btn.is-hot,
  .is-hot-text,
  .mock-app.is-ours {
    animation: none;
  }
}
