:root {
  /* палитра бренда с trigger-fish.ru: акцент #ff5300, тёмные #071420/#17253a */
  --bg: #ffffff;
  --text: #17253a;
  --muted: #6f8497;
  --line: #e6eaef;
  --accent: #ff5300;
  --accent-soft: #fff1e9;
  --paid: #ff5300;
  --catch: #10b981;
  --shadow: 0 4px 16px rgba(16, 32, 43, .12);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  font: 15px/1.45 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  color: var(--text); background: var(--bg); overflow: hidden;
}
#map { position: absolute; inset: 0; }

.top { position: absolute; z-index: 5; top: 0; left: 0; right: 0; padding: 10px 12px 0; }
.search { position: relative; }
#q {
  width: 100%; padding: 12px 14px; border: none; border-radius: 12px;
  background: var(--bg); box-shadow: var(--shadow); font-size: 16px; color: var(--text);
}
#q:focus { outline: 2px solid var(--accent); }
.suggest {
  position: absolute; top: 52px; left: 0; right: 0; background: var(--bg);
  border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; max-height: 46vh; overflow-y: auto;
}
.suggest div { padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.suggest div:last-child { border-bottom: none; }
.suggest .sub { color: var(--muted); font-size: 13px; }

.chips { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 8px 14px; border: none; border-radius: 999px;
  background: var(--bg); box-shadow: var(--shadow); font-size: 14px; color: var(--text); cursor: pointer;
}
.chip.active { background: var(--accent); color: #fff; }

.locate, .add {
  position: absolute; z-index: 5; border: none; box-shadow: var(--shadow); cursor: pointer;
}
.locate {
  right: 12px; bottom: 84px; width: 46px; height: 46px; border-radius: 50%;
  background: var(--bg); font-size: 20px;
}
.add {
  left: 12px; right: 12px; bottom: 20px; padding: 15px; border-radius: 14px;
  background: var(--accent); color: #fff; font-size: 16px; font-weight: 600;
}

.sheet {
  position: absolute; z-index: 6; left: 0; right: 0; bottom: 0;
  background: var(--bg); border-radius: 18px 18px 0 0; box-shadow: var(--shadow);
  padding: 8px 16px 22px; max-height: 62vh; overflow-y: auto;
  transition: transform .22s ease;
}
.sheet.hidden { transform: translateY(105%); }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 12px; }
.sheet h2 { font-size: 18px; margin: 0 0 4px; }
.sheet .meta { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.sheet .tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 13px; }
.tag.paid { background: var(--accent-soft); color: #b53b00; }
.tag.free { background: #e8eef5; color: #17253a; }
.tag.catch { background: #d1fae5; color: #065f46; }
.sheet .row { display: flex; gap: 10px; margin-top: 14px; }
.sheet button {
  flex: 1; padding: 13px; border: none; border-radius: 12px; font-size: 15px;
  background: #eef2f7; color: var(--text); cursor: pointer;
}
.sheet button.primary { background: var(--accent); color: #fff; }

.skeleton { position: absolute; z-index: 4; inset: 0; background: var(--bg); padding: 96px 16px; }
.skeleton.hidden { display: none; }
.sk-line { height: 14px; border-radius: 7px; background: #eef2f7; margin-bottom: 12px; animation: pulse 1.3s infinite; }
.sk-line.short { width: 55%; }
.sk-note { color: var(--muted); text-align: center; margin-top: 26px; font-size: 14px; }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .5 } }

.nokey { position: absolute; z-index: 9; inset: 0; display: flex; flex-direction: column;
         align-items: center; justify-content: center; text-align: center; padding: 30px; background: var(--bg); }
.nokey.hidden { display: none; }
.nokey p { color: var(--muted); }
.hidden { display: none; }

@media (prefers-color-scheme: dark) {
  :root { --bg: #071420; --text: #eaf0f6; --muted: #a8b2bd; --line: #17253a; --accent-soft: #2a1409; }
  .sheet button { background: #17253a; color: var(--text); }
  .sk-line { background: #17253a; }
  .chip { background: #17253a; }
}

/* экран добавления улова поверх карты */
.screen {
  position: absolute; z-index: 8; inset: 0; background: var(--bg);
  padding: 14px 16px 24px; overflow-y: auto;
}
.screen.hidden { display: none; }
.screen-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.back { border: none; background: none; font-size: 24px; color: var(--text); cursor: pointer; padding: 0 4px; }
.step.hidden { display: none; }
.lead { font-size: 16px; margin: 0 0 14px; }
.rules { list-style: none; padding: 0; margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.rules li { padding: 5px 0; }
.btn-main {
  display: block; width: 100%; padding: 15px; border: none; border-radius: 14px;
  background: var(--accent); color: #fff; font-size: 16px; font-weight: 600;
  text-align: center; cursor: pointer; margin-bottom: 10px;
}
.btn-main input[type=file] { display: none; }
.btn-ghost {
  display: block; width: 100%; padding: 14px; border: none; border-radius: 14px;
  background: transparent; color: var(--muted); font-size: 15px; cursor: pointer;
}
#place-q, #fish-other {
  width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--text); font-size: 16px; margin-bottom: 12px;
}
.suggest-inline div { padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.fish-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.fish {
  padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg);
  color: var(--text); font-size: 16px; cursor: pointer;
}
.fish:active { background: var(--accent-soft); }
.done-icon { font-size: 44px; text-align: center; margin: 20px 0 10px; }
.reason { color: var(--muted); margin-bottom: 22px; }

/* фото улова: листаются пальцем */
.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin-bottom: 12px; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img {
  flex: 0 0 auto; width: 82%; max-height: 240px; object-fit: cover;
  border-radius: 12px; scroll-snap-align: center; background: var(--line);
}
.gallery img:only-child { width: 100%; }

/* закрыть карточку: крестик, тап по карте или потянуть вниз */
.sheet-close {
  position: absolute; top: 10px; right: 12px; width: 32px; height: 32px;
  border: none; border-radius: 50%; background: var(--line); color: var(--text);
  font-size: 20px; line-height: 1; cursor: pointer;
}
.sheet { padding-top: 8px; }
.sheet-grip { cursor: grab; }

/* короткая пояснялка к фильтру — показывается один раз */
.hint-toast {
  position: absolute; z-index: 7; left: 12px; right: 12px; top: 108px;
  background: var(--text); color: var(--bg); padding: 11px 14px; border-radius: 12px;
  font-size: 14px; box-shadow: var(--shadow); opacity: .96;
}
.hint-toast.hidden { display: none; }
