:root {
  --green-900: #0f3d22;
  --green-800: #14532d;
  --green-700: #166534;
  --green-50: #effaf2;
  --accent: #f59e0b;
  --accent-dark: #b45309;
  --ink: #17221b;
  --muted: #5f6d64;
  --line: #e2e8e3;
  --bg: #f6f7f4;
  --card: #fff;
  --danger: #b91c1c;
  --kolay: #15803d;
  --orta: #ca8a04;
  --zor: #ea580c;
  --uzman: #7c1d6f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 40, 24, .06), 0 4px 16px rgba(16, 40, 24, .06);
  --bottom-h: 64px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom)); }
a { color: var(--green-700); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
p { line-height: 1.55; }

/* ---------- üst ve alt menü ---------- */
.topbar {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--green-800); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.brand img { border-radius: 8px; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.topnav { display: none; gap: 4px; }
.topnav a { color: #d7eadc; text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 500; font-size: .95rem; }
.topnav a.active, .topnav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.bottomnav {
  position: fixed; inset: auto 0 0 0; z-index: 1000;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--bottom-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff; border-top: 1px solid var(--line);
}
.bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600; }
.bottomnav svg { width: 24px; height: 24px; fill: currentColor; }
.bottomnav a.active { color: var(--green-800); }
@media (min-width: 860px) {
  .topnav { display: flex; }
  .bottomnav { display: none; }
  body { padding-bottom: 0; }
}

/* ---------- genel ---------- */
#view { outline: none; }
.page { max-width: 880px; margin: 0 auto; padding: 18px 16px 32px; }
.page.narrow { max-width: 480px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.stack > * + * { margin-top: 14px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  background: var(--green-800); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--green-900); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--green-800); border-color: var(--line); }
.btn.secondary:hover { background: var(--green-50); }
.btn.accent { background: var(--accent); color: #1c1203; }
.btn.accent:hover { background: #e48f06; }
.btn.danger { background: #fff; color: var(--danger); border-color: #f1c6c6; }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: .9rem; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--green-700); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number],
input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cfd8d1; border-radius: 10px;
  font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green-700); outline-offset: 1px; border-color: transparent; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .9rem; line-height: 1.45; }
.check input { width: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--green-800); }
.otp { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }
.error { background: #fdecec; color: var(--danger); border-radius: 10px; padding: 10px 12px; font-size: .9rem; }
.notice { background: #fff7e6; border: 1px solid #f7d79b; color: #6b4206; border-radius: 10px; padding: 10px 12px; font-size: .88rem; }

/* ---------- keşfet ---------- */
.explore { display: grid; grid-template-rows: auto auto 1fr; }
.explore-map { height: 42vh; min-height: 260px; }
.explore-panel { padding: 14px 16px 24px; }
@media (min-width: 860px) {
  .explore { grid-template-columns: 430px 1fr; grid-template-rows: none; height: calc(100vh - 58px); }
  .explore-panel { order: -1; overflow-y: auto; border-right: 1px solid var(--line); background: var(--bg); }
  .explore-map { height: 100%; }
}
.tabs { display: inline-flex; background: #e7ece8; border-radius: 999px; padding: 4px; margin-bottom: 12px; }
.tabs button { border: 0; background: none; padding: 8px 18px; border-radius: 999px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button.on { background: #fff; color: var(--green-800); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 13px; font: inherit; font-size: .85rem; font-weight: 600; color: var(--ink); cursor: pointer; }
.chip.on { background: var(--green-800); border-color: var(--green-800); color: #fff; }
.search { margin-bottom: 10px; }
.list { display: grid; gap: 10px; }
.item {
  display: grid; grid-template-columns: 54px 1fr; gap: 12px; align-items: start;
  background: #fff; border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow);
  text-decoration: none; color: inherit; border: 2px solid transparent;
}
.item:hover, .item.hl { border-color: #a7d7b6; }
.date { background: var(--green-50); color: var(--green-800); border-radius: 10px; text-align: center; padding: 6px 0; line-height: 1.1; }
.date b { display: block; font-size: 1.35rem; }
.date span { font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.routeicon { background: var(--green-50); border-radius: 10px; height: 54px; display: grid; place-items: center; }
.routeicon svg { width: 28px; height: 28px; fill: none; stroke: var(--green-800); stroke-width: 2; }
.item h3 { font-size: 1rem; margin: 0 0 3px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .82rem; color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #eef1ee; color: var(--ink); }
.badge.d { color: #fff; }
.badge.d.kolay { background: var(--kolay); }
.badge.d.orta { background: var(--orta); }
.badge.d.zor { background: var(--zor); }
.badge.d.uzman { background: var(--uzman); }
.badge.demo { background: #fff7e6; color: #8a5300; }
.badge.full { background: #fdecec; color: var(--danger); }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }

/* ---------- detay ---------- */
.detail-map { height: 46vh; min-height: 280px; border-radius: 0; }
@media (min-width: 860px) { .detail-map { height: 420px; border-radius: var(--radius); margin-top: 18px; } }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { background: var(--green-50); border-radius: 12px; padding: 10px 8px; text-align: center; }
.stat b { display: block; font-size: 1.15rem; color: var(--green-900); }
.stat span { font-size: .72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
@media (max-width: 420px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.profile svg { width: 100%; height: 120px; display: block; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: .93rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.people { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.people li { display: flex; gap: 10px; align-items: center; font-size: .92rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--green-800); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.progress { height: 8px; background: #e7ece8; border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); }
.sticky-cta { position: sticky; bottom: calc(var(--bottom-h) + 8px); z-index: 500; }
@media (min-width: 860px) { .sticky-cta { bottom: 12px; } }

/* ---------- rota çizim ---------- */
.draw-map { height: 380px; border-radius: var(--radius); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.seg button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px; font: inherit; font-weight: 600; cursor: pointer; }
.seg button.on { border-color: var(--green-800); background: var(--green-50); color: var(--green-800); }
.dropzone { border: 2px dashed #b9c9bd; border-radius: var(--radius); padding: 22px; text-align: center; background: #fff; cursor: pointer; }
.dropzone.over { border-color: var(--green-700); background: var(--green-50); }

/* ---------- harita işaretleri ---------- */
.pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.pin.kolay { background: var(--kolay); } .pin.orta { background: var(--orta); } .pin.zor { background: var(--zor); } .pin.uzman { background: var(--uzman); }
.pin.meet { background: var(--accent); }
.dot { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 4px solid var(--green-800); }
.dot.end { border-color: var(--danger); }
.leaflet-popup-content { font: inherit; font-size: .9rem; }
.leaflet-popup-content a { font-weight: 700; }

/* ---------- toast ve modal ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--bottom-h) + 18px); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: .9rem; font-weight: 500;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 3000; max-width: 92vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.modal { position: fixed; inset: 0; z-index: 2500; background: rgba(10, 25, 15, .5); display: grid; place-items: end center; }
.modal[hidden] { display: none; }
.modal .sheet { background: #fff; width: 100%; max-width: 520px; border-radius: 20px 20px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; }
@media (min-width: 600px) { .modal { place-items: center; } .modal .sheet { border-radius: 20px; } }
.spinner { width: 28px; height: 28px; border: 3px solid #d6e3d9; border-top-color: var(--green-800); border-radius: 50%; animation: spin 1s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.legal h2 { margin-top: 1.2rem; }
