/* ==========================================================================
   North Kite Camp
   Renkler: Karadeniz'in koyu yeşil-mavisi zemin ve yazı; canlı olan her şey
   (kiterlar, dolu bayraklar) harita üzerinde en iyi seçilen uçurtma pembesi.
   ========================================================================== */

:root {
  --ink: #0F3038;        /* Karadeniz: üst bant, yazı */
  --ink-2: #4A656B;      /* ikincil yazı */
  --sea: #0A6F76;        /* spotlar, bağlantılar */
  --sea-soft: #D9ECEA;
  --mist: #EDF2F0;       /* sayfa zemini: sis */
  --foam: #FFFFFF;
  --line: #CFDBD8;
  --kite: #D62828;       /* canlı: kiterlar, ana düğme (kırmızı) */
  --kite-deep: #A31515;
  --spot: #4BA5C1;       /* deniz mavisi: üst bant, telefonun üst şeridi, spot daireleri */
  --sun: #E0A21A;        /* bekleyen, uyarı */
  --ok: #1F7A45;
  --danger: #B3261E;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wide: 112%;          /* başlıklarda kullanılan geniş kesim */
  --top-h: 56px;
}

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

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

body {
  margin: 0;
  /* Sayfa "sis" renginde görünür (üstteki tek renkli katman). Zemin rengi olarak ise üst bandın rengi verilir:
     iPhone'da ana ekrana eklenen sitede saatin ve pilin durduğu şerit bu rengi alır, üst bantla bütünleşir. */
  background: var(--spot) linear-gradient(var(--mist), var(--mist));
  color: var(--ink);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, legend { font-family: var(--font); font-weight: 800; font-stretch: var(--wide); line-height: 1.15; text-transform: uppercase; margin: 0; }

a { color: var(--sea); text-underline-offset: 2px; }
a:hover { color: var(--ink); }

code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; background: var(--sea-soft); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

[hidden] { display: none !important; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 3000; background: var(--foam); color: var(--ink); padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 8px; }

/* ---------- Üst bant ---------- */

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: var(--top-h);
  padding: 6px max(18px, env(safe-area-inset-right)) 6px max(18px, env(safe-area-inset-left));
  background: var(--spot); color: var(--ink);
  border-bottom: 1px solid #3F8FA8;
  flex: none;
}

/* Logo solda, menü sağda, hep tek satırda: yer daralınca logo küçülür */
.brand { display: flex; align-items: center; flex: 0 1 245px; min-width: 0; }
.brand img { display: block; width: 100%; height: auto; }

.nav { display: flex; align-items: center; flex: none; gap: 18px; margin-left: auto; font-size: 13px; letter-spacing: .02em; text-transform: uppercase; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; padding: 8px 0; }
.nav a:hover { text-decoration: underline; }
.nav form { margin: 0; }
.nav a.nav-cta { background: var(--ink); color: #fff; padding: 7px 14px; border-radius: 6px; font-weight: 600; }
.nav a.nav-cta:hover { text-decoration: none; background: #1A4750; }

.pill { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 99px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; text-align: center; vertical-align: 1px; }

/* Üye menüsü: ada dokununca Profil, Yönetim ve Çıkış yap açılır */
.user-menu { position: relative; }
.user-menu > summary { display: flex; align-items: center; gap: 7px; min-height: 40px; list-style: none; border-radius: 6px; font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary::after { content: ""; flex: none; width: 7px; height: 7px; margin: -4px 3px 0 2px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.user-menu[open] > summary::after { margin-top: 4px; transform: rotate(-135deg); }
.user-menu .avatar-nav { flex: none; margin-right: 0; }
.nav-name { max-width: 20ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 2000; min-width: 210px; max-width: min(280px, calc(100vw - 28px)); padding: 6px; background: var(--foam); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 26px rgba(15, 48, 56, .22); letter-spacing: 0; text-transform: none; }
.user-menu-list a, .user-menu-list button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 6px; background: none; color: var(--ink); font: 500 15px/1.3 var(--font); text-align: left; text-decoration: none; cursor: pointer; }
.user-menu-list a:hover, .user-menu-list button:hover { background: var(--mist); text-decoration: none; }
.user-menu-list button:disabled { color: var(--ink-2); cursor: default; }
.user-menu-note { margin: 0; padding: 0 12px 10px; color: var(--ink-2); font-size: 13px; font-weight: 400; line-height: 1.4; }
.user-menu-list form { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }

/* Bildirim geçmişi */
ul.note-list { margin: 0; padding: 0; list-style: none; }
ul.note-list li { margin: 0; padding: 16px 0; border-top: 1px solid var(--line); }
ul.note-list li:first-child { border-top: 0; padding-top: 0; }
ul.note-list li h2 { margin: 0 0 4px; font-size: 17px; line-height: 1.3; letter-spacing: 0; text-transform: none; }
ul.note-list li p { margin: 0; }
ul.note-list time { display: block; margin-top: 6px; color: var(--ink-2); font-size: 13px; }

/* ---------- Düğmeler ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 20px;
  border: 1.5px solid transparent; border-radius: 6px;
  font: 600 14px/1.2 var(--font); letter-spacing: .03em; text-transform: uppercase; text-decoration: none; cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #1A4750; color: #fff; }
.btn-kite { background: var(--kite); color: #fff; }
.btn-kite:hover { background: var(--kite-deep); color: #fff; }
.btn-spot { background: var(--spot); color: var(--ink); }
.btn-spot:hover { background: #3F97B3; color: var(--ink); }
.btn-ghost { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--foam); }
.btn-danger { background: var(--foam); border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Bildirimler ---------- */

.notice { margin: 0 0 16px; padding: 12px 14px; background: var(--foam); border-left: 4px solid var(--sea); border-radius: 0 6px 6px 0; }
.notice.is-ok { border-left-color: var(--ok); }
.notice.is-warn { border-left-color: var(--sun); }
.notice.is-err { border-left-color: var(--danger); }
.flashes { flex: none; padding: 14px 18px 0; }
.flashes .notice { max-width: 760px; margin: 0 auto 10px; }

/* ---------- Harita düzeni: panel + harita ---------- */

body.is-app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }

.app { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(300px, 384px) 1fr; }

.panel { overflow-y: auto; border-right: 1px solid var(--line); }
.panel-in { padding: 26px 22px 28px; }
.panel h2 { font-size: 15px; margin: 30px 0 10px; }
.panel-foot { margin: 28px 0 0; font-size: 14px; }

.live { font-size: 20px; line-height: 1.2; margin: 0 0 10px; text-wrap: balance; }
.live b { font-weight: 900; font-variant-numeric: tabular-nums; }

.hint { margin: 0 0 16px; font-size: 14px; color: var(--ink-2); }
.hint.is-on { color: var(--ok); font-weight: 500; }
.hint.is-warn { color: #7A5600; font-weight: 500; }

.join { margin-top: 18px; padding: 16px; background: var(--foam); border: 1px solid var(--line); border-radius: 8px; }
.join p { margin: 0 0 14px; }

.share { margin-top: 18px; }
.share .hint { margin: 10px 0 0; min-height: 1.5em; }

.map { position: relative; z-index: 0; min-height: 320px; background: #DCE7E4; }
.map-msg { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 24px; text-align: center; color: var(--ink-2); }

/* Satır listeleri: spotlar, kiterlar */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows > li { border-bottom: 1px solid var(--line); }
.rows > li.empty { padding: 14px 0; color: var(--ink-2); font-size: 15px; }
.row {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px;
  width: 100%; padding: 12px 0;
  background: none; border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer;
}
.row:hover .row-title { text-decoration: underline; }
.row-main { min-width: 0; display: block; }
.row-title { display: block; font-weight: 600; overflow-wrap: anywhere; }
.row-sub { display: block; font-size: 14px; color: var(--ink-2); }
.row-count { display: flex; flex-direction: column; align-items: flex-end; color: var(--ink-2); }
.row-count b { font: 800 22px/1 var(--font); font-variant-numeric: tabular-nums; }
.row-count small { font-size: 12px; line-height: 1.2; }
.row-count.is-on { color: var(--kite-deep); }
.row-kiter { grid-template-columns: 28px 1fr; }
.row-kiter .dot { margin: 0; justify-self: center; }
.row.is-off { opacity: .55; }
.dot { width: 12px; height: 12px; margin-left: 3px; border-radius: 50%; background: var(--kite); box-shadow: 0 0 0 3px var(--foam); }
.dot.is-me { background: var(--ink); }

.rose { flex: none; display: block; }
.rose-on { fill: var(--sea); }
.rose-off { fill: #C3D2CF; }

/* ---------- Harita üzerindeki işaretler ---------- */

.leaflet-container { font-family: var(--font); font-size: 15px; background: #DCE7E4; }
.leaflet-container a { color: var(--sea); }
.leaflet-container .leaflet-control-attribution { font-size: 11px; }
.nk-icon { background: none; border: 0; }

/* Uydu / Harita seçici */
.leaflet-control-layers { border-radius: 6px; color: var(--ink); font: 500 14px/1.3 var(--font); }
.leaflet-control-layers-expanded { padding: 8px 12px 8px 10px; }
.leaflet-control-layers label { margin: 3px 0; cursor: pointer; }
.leaflet-control-layers input.leaflet-control-layers-selector { width: 16px; height: 16px; margin: 0 6px 0 0; top: 0; vertical-align: -3px; }

/* Uydu görüntüsü koyu olduğu için halkalar ve bayrak direği açık renge döner */
.leaflet-container.is-sat { background: #14232B; }
.is-sat .ring-region { stroke: #fff; }
.ring-draft { filter: drop-shadow(0 0 1.5px rgba(0, 0, 0, .6)); }

/* Spot işareti: yarı saydam turuncu daire; içindeki sayı o spottaki kiter sayısı */
.spot-dot { display: grid; place-items: center; width: 26px; height: 26px; border: 2px solid var(--spot); border-radius: 50%; background: rgba(75, 165, 193, .5); box-shadow: 0 0 0 1px rgba(15, 46, 54, .4); }
.spot-dot b { color: var(--ink); font: 800 12px/1 var(--font); font-stretch: 85%; }
.spot-dot.is-on { background: rgba(75, 165, 193, .95); }
/* Yakından bakarken spotun büyük dairesi yeter: küçük daire çizilmez, varsa yalnızca kiter sayısı kalır */
.spot-dot.is-wide { border-color: transparent; background: none; box-shadow: none; }
.spot-dot.is-wide b { font-size: 15px; text-shadow: 0 0 2px #fff, 0 0 4px #fff, 0 0 6px #fff; }
.spot-dot.is-draft { background: var(--spot); border-color: #fff; box-shadow: 0 0 0 2px rgba(15, 46, 54, .65); cursor: move; }
.spot-dot.is-off { opacity: .5; }

/* Kiter noktası ve ad etiketi */
.kiter { position: relative; width: 18px; height: 18px; }
.kiter-dot { position: absolute; inset: 2px; border-radius: 50%; background: var(--kite); box-shadow: 0 0 0 2.5px #fff, 0 1px 5px rgba(15, 48, 56, .55); }
.kiter-name { position: absolute; left: 23px; top: 50%; transform: translateY(-50%); padding: 3px 6px; border-radius: 4px; background: var(--foam); color: var(--ink); font: 600 12px/1.1 var(--font); white-space: nowrap; box-shadow: 0 0 0 1px var(--line), 0 1px 3px rgba(15, 48, 56, .2); }
.kiter.is-me .kiter-dot { background: var(--ink); }
.kiter.is-old { opacity: .6; }
/* Resmi olan üye haritada yuvarlak resmiyle görünür */
.kiter.has-pic { width: 34px; height: 34px; }
.kiter-pic { display: block; width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--foam); box-shadow: 0 0 0 2.5px var(--kite), 0 0 0 4px #fff, 0 1px 6px rgba(15, 48, 56, .55); }
.kiter.has-pic .kiter-name { left: 43px; }
.kiter.is-me .kiter-pic { box-shadow: 0 0 0 2.5px var(--ink), 0 0 0 4px #fff, 0 1px 6px rgba(15, 48, 56, .55); }

/* ---------- Rüzgâr tahmini ---------- */
/* Tablo: satırlar spot, sütunlar gün. Kutuda rüzgârın gittiği yönü gösteren ok ve knot. */
.wind-scroll { overflow-x: auto; }
/* Tahmin panelin en üstünde; canlı durum bir çizgiyle ayrılarak hemen altında başlar. */
.panel .wind > h2 { margin-top: 0; }
.wind:not([hidden]) + .live { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.wind-table { width: 100%; min-width: 300px; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.wind-table th, .wind-table td { padding: 3px 1px; text-align: center; border-bottom: 1px solid var(--line); }
.wind-table thead th { padding-bottom: 6px; color: var(--ink-2); font-size: 11px; font-weight: 500; line-height: 1.25; }
.wind-table thead th span, .wind-table thead th small { display: block; }
.wind-table thead th small { color: var(--ink); font-size: 13px; font-weight: 700; }
.wind-table .wind-corner { width: 27%; text-align: left; vertical-align: bottom; }
.wind-table tbody th { text-align: left; }
.wind-spot { padding: 4px 4px 4px 0; border: 0; background: none; color: var(--ink); font: 600 13px/1.25 var(--font); text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.wind-spot:hover { text-decoration: underline; }
.wind-arrow { display: block; fill: currentColor; }
.wind-cell { display: grid; justify-items: center; gap: 2px; width: 100%; min-height: 40px; padding: 5px 0 4px; border: 0; border-radius: 6px; background: none; color: var(--ink); font: inherit; cursor: pointer; }
.wind-cell b { font: 700 14px/1 var(--font); }
.wind-cell.is-calm { color: var(--ink-2); }
.wind-cell.is-calm b { font-weight: 500; }
.wind-cell.is-night { opacity: .55; }
/* Yön uygunsa kutu rüzgârın gücüne göre renk alır: sarı (büyük kite), yeşil, kırmızı (güçlü rüzgâr) */
.wind-cell.is-kite { background: var(--ok); color: #fff; }
.wind-cell.is-big { background: var(--sun); color: var(--ink); }
.wind-cell.is-strong { background: var(--kite); color: #fff; }
.wind-cell:hover { box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.wind-cell.is-sel { box-shadow: inset 0 0 0 2.5px var(--ink); }
.wind-none { color: var(--ink-2); }
/* Kutunun köşesindeki mavi balon: o gün o spota gideceğini işaretleyenlerin sayısı */
.wind-cell, .wind-pin { position: relative; }
.wind-going { position: absolute; top: -6px; right: -1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--spot); color: var(--ink); box-shadow: 0 0 0 1.5px #fff; font: 800 11px/18px var(--font); text-align: center; }
.wind-going::after { content: ""; position: absolute; left: 3px; bottom: -3px; width: 6px; height: 6px; background: var(--spot); clip-path: polygon(0 0, 100% 0, 0 100%); }
.wind-pin .wind-going { top: -9px; right: -7px; }
#wind-note { margin-top: 10px; }

/* Seçilen spot ve gün: saat saat sütunlar */
.wind-day { margin-top: 12px; padding: 14px 12px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--foam); }
.wind-day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.wind-day h3 { margin: 0; font-size: 15px; text-transform: none; font-stretch: 100%; }
.wind-day p { margin: 2px 0 12px; color: var(--ink-2); font-size: 14px; }
.wind-day .wind-legend { margin: 10px 0 0; font-size: 12px; }
.wind-close { padding: 0; border: 0; background: none; color: var(--sea); font: 600 13px/1.2 var(--font); text-decoration: underline; cursor: pointer; }
.wind-hours { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: end; gap: 1px; }
.wind-hour { display: grid; justify-items: center; gap: 3px; min-width: 0; padding: 4px 0; border: 0; border-radius: 5px; background: none; color: var(--ink); font: inherit; cursor: pointer; }
.wind-hour b { font: 700 11px/1 var(--font); }
.wind-hour small { color: var(--ink-2); font-size: 10px; line-height: 1; }
.wind-bar { position: relative; width: 62%; max-width: 15px; height: 60px; }
.wind-bar i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 3px 3px 0 0; }
.wind-gust { background: #D6E0DD; }
.wind-speed { background: #8AA29F; }
.wind-hour.is-kite .wind-gust { background: #BCDCC8; }
.wind-hour.is-kite .wind-speed { background: var(--ok); }
.wind-hour.is-big .wind-gust { background: #F2E0AE; }
.wind-hour.is-big .wind-speed { background: var(--sun); }
.wind-hour.is-strong .wind-gust { background: #F2C0C0; }
.wind-hour.is-strong .wind-speed { background: var(--kite); }
.wind-hour.is-calm b { color: var(--ink-2); font-weight: 500; }
.wind-hour.is-past { opacity: .45; }
.wind-hour:hover { background: var(--mist); }
.wind-hour.is-sel { background: var(--sea-soft); box-shadow: inset 0 0 0 1.5px var(--ink); }

/* Gidenler, "Gidiyorum" düğmesi ve kite boyu önerisi */
.wind-go, .wind-kg { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.wind-day .wind-go-title { margin: 0 0 8px; color: var(--ink); font-weight: 600; }
.wind-goers { display: grid; gap: 6px; margin: 0 0 10px; padding: 0; list-style: none; }
.wind-goers li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.wind-goers b { margin-left: auto; font-variant-numeric: tabular-nums; }
.wind-go .hint { margin: 8px 0 0; }
.wind-kg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 14px; }
.wind-kg input[type=number] { width: 76px; min-height: 0; padding: 6px 8px; }
.wind-day .wind-kg-pick { flex-basis: 100%; margin: 0; color: var(--ink); font-weight: 600; }
.wind-kg .wind-legend { flex-basis: 100%; margin: 0; }
.wind-size { min-height: 11px; color: var(--ink); font: 700 11px/1 var(--font); }

/* Haritada: spotun üstünde rüzgâr oku ve hızı; köşede hangi saatin gösterildiği */
.wind-pin { display: flex; align-items: center; justify-content: center; gap: 2px; width: 46px; height: 22px; border-radius: 11px; background: var(--foam); color: var(--ink); box-shadow: 0 1px 4px rgba(15, 48, 56, .55); font: 700 13px/1 var(--font); font-variant-numeric: tabular-nums; }
.wind-pin.is-kite { background: var(--ok); color: #fff; }
.wind-pin.is-big { background: var(--sun); color: var(--ink); }
.wind-pin.is-strong { background: var(--kite); color: #fff; }
.wind-pin.is-calm { color: var(--ink-2); font-weight: 500; }
.wind-chip { position: absolute; left: 10px; top: 10px; z-index: 800; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 150px); padding: 7px 10px; border-radius: 6px; background: var(--foam); color: var(--ink); box-shadow: 0 1px 5px rgba(0, 0, 0, .4); font: 500 13px/1.2 var(--font); }
.wind-chip button { padding: 0; border: 0; background: none; color: var(--sea); font: 600 13px/1.2 var(--font); text-decoration: underline; cursor: pointer; white-space: nowrap; }
.pop .pop-wind { font-weight: 600; }

/* Üye resmi (ya da resmi yoksa adının baş harfi) */
.avatar { display: inline-block; flex: none; border-radius: 50%; object-fit: cover; background: var(--sea-soft); vertical-align: middle; }
.avatar-none { display: inline-grid; place-items: center; color: var(--ink); font-weight: 700; line-height: 1; text-transform: uppercase; }
.avatar-sm { width: 28px; height: 28px; font-size: 13px; }
.avatar-nav { width: 24px; height: 24px; margin-right: 7px; font-size: 11px; }
.avatar-lg { width: 96px; height: 96px; font-size: 36px; }
.avatar-edit { display: flex; align-items: center; gap: 18px; margin: 0 0 14px; }
.avatar-edit .hint { margin: 0; }
.cell-user { white-space: nowrap; }

/* Açılır bilgi kutusu */
.leaflet-popup-content-wrapper { border-radius: 8px; color: var(--ink); box-shadow: 0 8px 28px rgba(15, 48, 56, .3); }
.leaflet-popup-content { margin: 16px 18px; font-size: 15px; line-height: 1.45; }
.pop h3 { font-size: 16px; margin: 0 0 6px; text-transform: none; }
.pop p { margin: 0 0 10px; }
.pop-count { font-weight: 600; color: var(--ink-2); }
.pop-count.is-on { color: var(--kite-deep); }
.pop-desc { white-space: pre-line; }
.pop-facts { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 12px; margin: 0 0 12px; }
.pop-facts dt { font-size: 14px; color: var(--ink-2); }
.pop-facts dd { margin: 0; display: flex; align-items: center; gap: 8px; }
.pop .pop-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; font-weight: 600; }

/* ---------- "Sudayım" güvenlik işareti ---------- */

.water { margin-top: 10px; }
.water-form { margin-top: 12px; padding: 14px; background: var(--foam); border: 1px solid var(--line); border-radius: 8px; }
.water-form .field { margin-bottom: 14px; }
.water-q { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.water-times { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.water-times .btn { padding: 0 4px; }
.water-form .hint { margin: 0; }
.water-on { padding: 14px 16px; background: var(--foam); border-left: 4px solid var(--spot); border-radius: 0 8px 8px 0; }
.water-on.is-late { border-left-color: var(--sun); }
.water-on.is-overdue { border-left-color: var(--kite); }
.water-on p { margin: 0 0 10px; }
.water-on-title { font-size: 16px; }
.water-on .hint { margin: 12px 0 0; }
.water > .hint { margin: 10px 0 0; }
/* Gecikme uyarısı: sayfadaki en önemli şey; panelin en üstünde, sitenin uyarı kırmızısıyla. */
.water-alert { margin: 0 0 18px; padding: 14px 16px; background: #FDECEC; border: 2px solid var(--kite); border-radius: 8px; }
.water-alert p { margin: 0 0 8px; }
.water-alert-head { font-size: 17px; }
.water-alert a { font-weight: 700; }
.water-alert .btn-row { margin-top: 12px; }
.row-water.is-late .row-sub { color: #7A5600; font-weight: 500; }
.row-water.is-overdue .row-sub { color: var(--kite-deep); font-weight: 600; }
.lastseen { position: relative; width: 22px; height: 22px; border-radius: 50%; background: var(--kite); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--kite), 0 1px 6px rgba(15, 48, 56, .55); }
.lastseen-name { position: absolute; left: 31px; top: 50%; transform: translateY(-50%); padding: 3px 6px; border-radius: 4px; background: var(--kite); color: #fff; font: 600 12px/1.1 var(--font); white-space: nowrap; }

/* ---------- Anlık bildirim: Profil'deki cihaz kutusu (aç/kapat düğmesi üye menüsünde) ---------- */

.push-box { margin-top: 26px; padding: 16px; background: var(--foam); border: 1px solid var(--line); border-radius: 8px; }
.push-box h3 { margin: 0 0 8px; font-size: 15px; text-transform: none; font-stretch: 100%; }
.push-box p { margin: 0 0 12px; }
.push-box .hint { margin: 12px 0 0; }

/* ---------- Spot kartı (spot.php) ve yönetimdeki kart alanları ---------- */

.spot-card h1 { margin-bottom: 6px; }
.spot-live { margin: 0 0 20px; font-weight: 600; color: var(--ink-2); }
.spot-live.is-on { color: var(--kite-deep); }
.spot-figure { margin: 0 0 22px; }
.spot-figure img { display: block; width: 100%; height: auto; max-height: 460px; object-fit: cover; border-radius: 8px; background: var(--sea-soft); }
.spot-text { margin: 0 0 18px; white-space: pre-line; }
.spot-facts { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px 16px; margin: 0; }
.spot-facts dt { font-size: 14px; color: var(--ink-2); }
.spot-facts dd { margin: 0; display: flex; align-items: center; gap: 10px; }
.spot-part .spot-text { margin: 0; }
/* Tehlikeler kartın en önemli bölümü: sitenin uyarı rengiyle ayrılır. */
.spot-part.is-hazard { margin-top: 34px; padding: 16px 18px; background: var(--foam); border-left: 4px solid var(--kite); border-radius: 0 6px 6px 0; }
.spot-part.is-hazard h2 { margin-top: 0; color: var(--kite-deep); }
.spot-card .spot-actions { margin-top: 34px; }
.spot-card > .hint, .spot-card > .notice { margin-top: 26px; }
.spot-card > .notice:first-child { margin-top: 0; }

.form h2.form-part { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.spot-photo { margin: 0 0 14px; }
.spot-photo img { display: block; width: 100%; max-height: 200px; object-fit: cover; border-radius: 6px; margin-bottom: 8px; background: var(--sea-soft); }
input[type=file] { max-width: 100%; font: inherit; font-size: 14px; }

/* ---------- Belge sayfaları: giriş, kayıt, profil, yönetim ---------- */

.wrap { max-width: 468px; margin: 0 auto; padding: 44px 20px 40px; }
.wrap-text { max-width: 680px; }
.wrap-wide { max-width: 1080px; }
.wrap h1 { font-size: 27px; margin: 0 0 12px; }
.wrap h2 { font-size: 16px; margin: 34px 0 12px; }
.wrap-text li { margin-bottom: 6px; }
.lead { margin: 0 0 24px; color: var(--ink-2); }
.after { margin: 16px 0 0; font-size: 15px; color: var(--ink-2); }

.form { margin: 0; }
.form + .form { margin-top: 36px; border-top: 1px solid var(--line); }
.form h2 { margin-top: 28px; }
.form-danger h2 { color: var(--danger); }

fieldset { border: 0; margin: 0 0 28px; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 12px; font-size: 15px; }

.field { display: block; margin: 0 0 16px; }
.field > span { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 600; }
.field .hint { display: block; margin: 6px 0 0; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input:not([type]), select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px;
  border: 1.5px solid #8AA3A0; border-radius: 6px;
  background: var(--foam); color: var(--ink); font: inherit;
}
textarea { min-height: 92px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
input[type=range] { width: 100%; accent-color: var(--sea); }
input[type=checkbox], input[type=radio] { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--sea); }

.code { display: block; padding: 10px 12px; overflow-x: auto; white-space: nowrap; background: var(--foam); border: 1px solid var(--line); border-radius: 6px; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 16px; font-size: 15px; }
.check small { color: var(--ink-2); }

.dirs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.dirs .check { margin-bottom: 10px; }

/* Kurulum: SQLite seçilince MySQL alanları gizlenir */
form:has(input[name=driver][value=sqlite]:checked) #mysql-fields { display: none; }

.foot { display: flex; justify-content: center; gap: 22px; padding: 8px 20px 44px; font-size: 14px; }

/* ---------- Yönetim ---------- */

.tabs { display: flex; gap: 2px; margin: 0 0 22px; border-bottom: 2px solid var(--ink); }
.tabs a { padding: 8px 14px; border-radius: 6px 6px 0 0; color: var(--ink); font-size: 13px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; text-decoration: none; }
.tabs a:hover { background: var(--sea-soft); }
.tabs a[aria-current=page] { background: var(--ink); color: #fff; }

.table-wrap { overflow-x: auto; background: var(--foam); border: 1px solid var(--line); border-radius: 8px; }
.table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 15px; }
.table th { padding: 10px 12px; border-bottom: 1.5px solid var(--line); text-align: left; font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .muted { color: var(--ink-2); font-size: 14px; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.actions form { margin: 0; }
.actions .btn { white-space: nowrap; }
.actions details { position: relative; }
.actions summary { list-style: none; cursor: pointer; }
.actions summary::-webkit-details-marker { display: none; }
.actions details[open] summary { display: none; }

.tag { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.tag-pending { background: #FBEBC0; color: #6B4E00; }
.tag-active { background: var(--sea-soft); color: #064B50; }
.tag-banned { background: #F6D9D7; color: #7A1712; }
.tag-admin { background: var(--ink); color: #fff; }

.picker { position: relative; height: 340px; margin: 0 0 8px; border: 1.5px solid #8AA3A0; border-radius: 6px; overflow: hidden; z-index: 0; }
.region-pin { width: 22px; height: 22px; margin: 2px; border: 2.5px solid var(--kite); border-radius: 50%; background: rgba(255, 255, 255, .55); box-shadow: 0 0 0 2px #fff; cursor: move; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 0 16px; }

/* ---------- Dar ekran ---------- */

@media (max-width: 820px) {
  body.is-app { height: auto; display: block; overflow: visible; }
  .app { display: flex; flex-direction: column; }
  .map { order: -1; height: 58vh; height: 58dvh; min-height: 300px; }
  .panel { overflow: visible; border-right: 0; }
  .panel-in { padding: 22px 18px 32px; }
  .live { font-size: 19px; }
  .wrap { padding-top: 30px; }
  .wrap h1 { font-size: 23px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* Telefonda da logo solda, menü sağda kalır */
@media (max-width: 640px) {
  .top { gap: 14px; }
  .brand { flex-basis: 214px; }
  .nav-name { max-width: 14ch; }
}

@media (max-width: 420px) {
  .top { padding-left: 14px; padding-right: 14px; gap: 12px; }
  .nav { gap: 12px; font-size: 12px; }
  .nav-name { max-width: 11ch; }
}

@media (prefers-reduced-motion: reduce) {
  .btn:active { transform: none; }
  * { scroll-behavior: auto !important; }
}
