html, body { overscroll-behavior-y: none; }
/* «По месту» — тёмно-зелёная тема: стекло, оранжевые акценты. Подключается после app.css и переопределяет его. */
:root[data-theme="night"] {
  --bg: #06140d;
  --card: rgba(255, 255, 255, .045);
  --card-solid: #0e2218;
  --line: rgba(255, 255, 255, .085);
  --text: #eef4ef;
  --muted: #93a89b;
  --green: #4ade80;          /* яркий акцент: ссылки, значки, активное */
  --green-2: #34c46a;
  --green-soft: rgba(74, 222, 128, .12);
  --brand: #1f7a4c;          /* фирменный зелёный для залитых кнопок */
  --brand-2: #2a9a60;
  --orange: #f7841f;
  --orange-dark: #e66c0b;
  --cream: rgba(243, 236, 224, .06);
  --ok: #4ade80;
  --warn: #ffb35c;
  --warn-soft: rgba(247, 132, 31, .14);
  --danger: #ff8a7d;
  --danger-soft: rgba(255, 90, 80, .14);
  --radius: 18px;
  --shadow: 0 4px 14px rgba(0, 0, 0, .22);
  color-scheme: dark;
}
html[data-theme="night"] { background: #05110b; }
[data-theme="night"] body { color: var(--text); background: #05110b; min-height: 100vh; }
/* Фон — отдельный неподвижный слой на видеокарте: при прокрутке не перерисовывается */
[data-theme="night"] body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; transform: translateZ(0);
  background:
    radial-gradient(900px 520px at 100% -8%, rgba(52, 196, 106, .16), transparent 62%),
    radial-gradient(700px 520px at -20% 35%, rgba(31, 122, 76, .20), transparent 60%),
    linear-gradient(180deg, #071a11 0%, #05110b 100%);
}
[data-theme="night"] h1, [data-theme="night"] h2, [data-theme="night"] h3 { color: var(--text); }
[data-theme="night"] a { color: var(--green); }

/* стекло */
[data-theme="night"] .card, [data-theme="night"] .catlist, [data-theme="night"] .mcal, [data-theme="night"] .pcard,
[data-theme="night"] .tl2 .ev {
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
[data-theme="night"] .card.cream { background: linear-gradient(135deg, rgba(247,132,31,.13), rgba(247,132,31,.05)); border-color: rgba(247,132,31,.25); }
[data-theme="night"] .card.warn { background: var(--warn-soft); border-color: rgba(247,132,31,.25); color: var(--text); }
[data-theme="night"] .card.danger { background: var(--danger-soft); border-color: rgba(255,90,80,.25); color: var(--text); }

/* кнопки */
[data-theme="night"] button, [data-theme="night"] .btn { background: rgba(255,255,255,.06); color: var(--text); border: 1px solid var(--line); }
[data-theme="night"] .btn-ghost { background: transparent; border-color: transparent; color: var(--green); }
[data-theme="night"] .btn-green { background: linear-gradient(180deg, var(--brand-2), var(--brand)); color: #fff; border-color: rgba(74,222,128,.35);
  box-shadow: 0 6px 18px rgba(31,122,76,.35); }
[data-theme="night"] .btn-primary { background: linear-gradient(180deg, #ff9a3c, var(--orange)); color: #fff; border: 0;
  box-shadow: 0 8px 22px rgba(247,132,31,.35); }
[data-theme="night"] .btn-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(255,90,80,.25); }
[data-theme="night"] button:disabled { opacity: .45; }

/* поля */
[data-theme="night"] input[type=text], [data-theme="night"] input[type=search], [data-theme="night"] input[type=number],
[data-theme="night"] input[type=date], [data-theme="night"] input[type=time], [data-theme="night"] input[type=tel],
[data-theme="night"] textarea, [data-theme="night"] select {
  background: rgba(255,255,255,.05); color: var(--text); border: 1px solid var(--line); }
[data-theme="night"] input::placeholder, [data-theme="night"] textarea::placeholder { color: #6f8578; }
[data-theme="night"] select option, [data-theme="night"] select optgroup { background: #0e2218; color: var(--text); }
[data-theme="night"] input:focus, [data-theme="night"] textarea:focus, [data-theme="night"] select:focus { outline: 2px solid rgba(74,222,128,.55); }

/* переключатели и вкладки */
[data-theme="night"] .seg { background: rgba(255,255,255,.05); border: 1px solid var(--line); }
[data-theme="night"] .seg button { background: transparent; border: 0; color: var(--muted); }
[data-theme="night"] .seg button.on { background: rgba(74,222,128,.14); color: var(--green); box-shadow: none; }
[data-theme="night"] .tabs button { background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--text); }
[data-theme="night"] .tabs button.on { background: linear-gradient(180deg, var(--brand-2), var(--brand)); border-color: rgba(74,222,128,.4); color: #fff; }
[data-theme="night"] .tile { background: rgba(255,255,255,.05); border-color: var(--line); color: var(--text); }
[data-theme="night"] .tile.on { background: rgba(74,222,128,.13); border-color: var(--green-2); }

/* значки статусов */
[data-theme="night"] .pill { background: rgba(74,222,128,.13); color: var(--green); }
[data-theme="night"] .pill.draft, [data-theme="night"] .pill.pending { background: var(--warn-soft); color: var(--warn); }
[data-theme="night"] .pill.hidden, [data-theme="night"] .pill.paused { background: rgba(255,255,255,.08); color: var(--muted); }
[data-theme="night"] .pill.rejected, [data-theme="night"] .pill.blocked { background: var(--danger-soft); color: var(--danger); }

/* разное */
[data-theme="night"] .toast { background: #11291d; color: var(--text); border: 1px solid rgba(74,222,128,.25); }
[data-theme="night"] .toast.err { background: #3a1714; border-color: rgba(255,90,80,.35); }
[data-theme="night"] .sheet { background: #0b1d14; border-top: 1px solid var(--line); }
[data-theme="night"] .sheet-bg { background: rgba(0,0,0,.6); }
[data-theme="night"] .bottom-bar { background: linear-gradient(to top, #05110b 65%, rgba(5,17,11,0)); }
[data-theme="night"] .linkbox { background: rgba(74,222,128,.08); color: var(--text); }
[data-theme="night"] .thumb { background: rgba(255,255,255,.06); }
[data-theme="night"] .ph { background: rgba(255,255,255,.06); }
[data-theme="night"] .ph.add { border-color: rgba(255,255,255,.15); }
[data-theme="night"] .error { background: var(--danger-soft); color: var(--danger); }
[data-theme="night"] .steps i { background: rgba(255,255,255,.1); }
[data-theme="night"] .steps i.on { background: linear-gradient(90deg, var(--green-2), var(--orange)); }
[data-theme="night"] .pcard .noimg { background: rgba(255,255,255,.05); }
[data-theme="night"] .slots button { background: rgba(255,255,255,.05); border-color: var(--line); color: var(--text); }
[data-theme="night"] .slots button.on { background: linear-gradient(180deg, var(--brand-2), var(--brand)); color: #fff; border-color: rgba(74,222,128,.4); }
[data-theme="night"] .catrow { border-bottom-color: var(--line); background: transparent; border-left: 0; border-right: 0; border-top: 0; color: var(--text); }
[data-theme="night"] .catrow:active { background: rgba(74,222,128,.08); }
[data-theme="night"] .catrow .cnt { background: rgba(74,222,128,.12); color: var(--green); }
[data-theme="night"] .catrow .cnt.zero { background: rgba(255,255,255,.05); color: var(--muted); }
[data-theme="night"] .catrow .ci { border: 1px solid var(--line); }

/* календарь */
[data-theme="night"] .mcell { background: transparent; border-color: transparent; color: var(--text); }
[data-theme="night"] .mcell.today { border-color: rgba(74,222,128,.6); }
[data-theme="night"] .mcell.sel { background: linear-gradient(180deg, var(--brand-2), var(--brand)); border-color: rgba(74,222,128,.5); }
[data-theme="night"] .mcell.sel .num { color: #fff !important; }
[data-theme="night"] .mcell.off { background: repeating-linear-gradient(135deg, transparent 0 5px, rgba(255,255,255,.06) 5px 6px); }
[data-theme="night"] .mcell .b-cnt { background: rgba(74,222,128,.15); color: var(--green); }
[data-theme="night"] .mcell .load { background: rgba(255,255,255,.08); }
[data-theme="night"] .mcal-arrow { background: rgba(255,255,255,.06); }
[data-theme="night"] .mcal.applying .mcell:not(.past):not(.dis) { background: rgba(247,132,31,.10); }
[data-theme="night"] .cellb { color: var(--muted); border-color: rgba(255,255,255,.14); background: transparent; }
[data-theme="night"] .cellb.open { background: rgba(74,222,128,.12); color: var(--green); border-color: rgba(74,222,128,.5); }
[data-theme="night"] .cellb.busy { background: linear-gradient(180deg, var(--brand-2), var(--brand)); color: #fff; border-color: transparent; }
[data-theme="night"] .cellb.busy.pending { background: linear-gradient(180deg, #ff9a3c, var(--orange)); }
[data-theme="night"] .cellb.busy.blocked { background: rgba(255,255,255,.12); }
[data-theme="night"] .tl2 .ev.new, [data-theme="night"] .tl2 .ev.proposed { background: rgba(247,132,31,.10); }
[data-theme="night"] .tl2 .ev.block { background: repeating-linear-gradient(135deg, rgba(255,255,255,.04) 0 8px, transparent 8px 16px); }
[data-theme="night"] .tl2 .gap { border-color: rgba(74,222,128,.3); }
[data-theme="night"] .chip { background: rgba(74,222,128,.12); color: var(--green); }
[data-theme="night"] .chip.info { background: rgba(255,255,255,.07); color: var(--text); }
[data-theme="night"] .chip.muted { background: rgba(255,255,255,.06); color: var(--muted); }
[data-theme="night"] .apply-bar button { background: #fff; color: var(--orange-dark); border: 0; }

/* ================== каркас: верхняя строка, нижняя панель, боковое меню ================== */
#app { max-width: none; padding: 0; }
.page { max-width: 680px; margin: 0 auto; padding: 10px 14px 110px; }
.has-tabbar .page { padding-bottom: 150px; }
.has-tabbar .bottom-bar { bottom: calc(64px + env(safe-area-inset-bottom)); padding-bottom: 8px; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; display: flex; justify-content: space-around;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: #06140d;
  border-top: 1px solid var(--line); }
.tabbar button { flex: 1; min-height: 52px; background: transparent !important; border: 0 !important; box-shadow: none !important;
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 2px; color: var(--muted) !important;
  font-size: 11px; font-weight: 600; position: relative; }
.tabbar button svg { width: 23px; height: 23px; }
.tabbar button.on { color: var(--green) !important; }
.tabbar .dot { position: absolute; top: 4px; left: 54%; min-width: 16px; height: 16px; border-radius: 9px; background: var(--orange);
  color: #fff; font-size: 10px; line-height: 16px; padding: 0 4px; }

.side { display: none; }
@media (min-width: 980px) {
  .tabbar { display: none; }
  .has-tabbar .page, .page { padding-bottom: 110px; }
  .has-tabbar .bottom-bar { bottom: 0; }
  .side { display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; width: 248px; padding: 18px 14px;
    background: rgba(4, 14, 9, .55); border-right: 1px solid var(--line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); z-index: 7; }
  .side .brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 18px; margin: 0 6px 22px; }
  .side .brand img { width: 40px; height: 40px; border-radius: 11px; }
  .side button { justify-content: flex-start; gap: 12px; background: transparent; border: 0; color: var(--text); font-weight: 600;
    min-height: 46px; padding: 10px 14px; margin-bottom: 4px; border-radius: 14px; }
  .side button svg { width: 22px; height: 22px; color: var(--muted); }
  .side button.on { background: linear-gradient(180deg, var(--brand-2), var(--brand)); box-shadow: 0 6px 18px rgba(31,122,76,.35); }
  .side button.on svg { color: #fff; }
  .side .sp { flex: 1; }
  .with-side .page { margin-left: calc(248px + max(0px, (100vw - 248px - 920px) / 2)); max-width: 920px; padding: 18px 28px 110px; }
  .with-side .bottom-bar { left: 248px; }
}

/* ================== главная ================== */
.topbar { display: flex; align-items: center; gap: 10px; padding: 4px 0 10px; }
.topbar .mark { width: 38px; height: 38px; border-radius: 11px; }
.topbar .ttl { font-weight: 750; font-size: 18px; letter-spacing: -.02em; }
.topbar .city { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 600;
  padding: 6px 11px; border-radius: 99px; background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--text); min-height: 0; }
.topbar .city svg { width: 15px; height: 15px; color: var(--orange); }
.topbar .bell { width: 38px; min-height: 38px; padding: 0; border-radius: 12px; position: relative; }
.topbar .bell svg { width: 20px; height: 20px; }
.topbar .bell i { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 9px; background: var(--orange); }
@media (min-width: 980px) { .topbar .mark, .topbar .ttl { display: none; } .topbar .city { margin-left: 0; } .topbar .bell:first-of-type { margin-left: auto; } }

.hero2 { position: relative; overflow: hidden; border-radius: 22px; padding: 20px 18px 18px; margin-top: 4px;
  background: radial-gradient(420px 220px at 95% 10%, rgba(74,222,128,.22), transparent 60%),
              linear-gradient(135deg, rgba(31,122,76,.55), rgba(10,40,26,.6));
  border: 1px solid rgba(74,222,128,.18); box-shadow: var(--shadow); }
.hero2 h1 { margin: 0; font-size: 25px; line-height: 1.18; font-weight: 800; letter-spacing: -.025em; max-width: 64%; }
.hero2 h1 span { color: var(--orange); }
.hero2 .mk { position: absolute; right: -6px; top: 6px; width: 132px; opacity: .95; filter: drop-shadow(0 10px 24px rgba(0,0,0,.35)); }
.hero2 .city-skyline { position: absolute; left: 0; right: 0; bottom: 0; height: 46px; opacity: .25;
  background: linear-gradient(to top, rgba(74,222,128,.35), transparent); -webkit-mask: url('/img/skyline.svg') bottom / 100% 100% no-repeat; mask: url('/img/skyline.svg') bottom / 100% 100% no-repeat; }
.search2 { display: flex; gap: 0; margin-top: 16px; background: rgba(4,14,9,.55); border: 1px solid rgba(255,255,255,.12);
  border-radius: 15px; padding: 4px; position: relative; z-index: 1; }
.search2 svg { width: 19px; height: 19px; color: var(--muted); margin: 0 4px 0 10px; align-self: center; flex: none; }
.search2 input[type=search] { flex: 1; border: 0 !important; background: transparent !important; outline: 0 !important; min-height: 40px; padding: 6px 6px; }
.search2 button { border-radius: 12px; min-height: 40px; padding: 8px 16px; }
@media (min-width: 980px) { .hero2 { padding: 30px 30px 26px; } .hero2 h1 { font-size: 32px; } .hero2 .mk { width: 170px; right: 20px; } }

.hscroll { display: flex; gap: 10px; overflow-x: auto; margin: 0 -14px; padding: 2px 14px 6px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.near { flex: none; width: 172px; height: 196px; border-radius: 18px; overflow: hidden; position: relative; scroll-snap-align: start;
  border: 1px solid var(--line); background: rgba(255,255,255,.05); box-shadow: var(--shadow); cursor: pointer; text-align: left; padding: 0; }
.near img { width: 100%; height: 100%; object-fit: cover; display: block; }
.near .noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 44px;
  background: linear-gradient(135deg, rgba(31,122,76,.5), rgba(10,40,26,.6)); }
.near .ov { position: absolute; inset: 0; background: linear-gradient(to top, rgba(3,10,6,.92) 0%, rgba(3,10,6,.4) 45%, rgba(3,10,6,0) 70%); }
.near .tag { position: absolute; left: 8px; top: 8px; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 99px;
  background: rgba(4,14,9,.82); color: var(--text); }
.near .tag.free { color: var(--green); } .near .tag.price { color: #fff; background: rgba(247,132,31,.9); }
.near .tx { position: absolute; left: 10px; right: 10px; bottom: 10px; }
.near .tx b { display: block; font-size: 14.5px; line-height: 1.25; color: #fff; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.near .tx span { font-size: 12px; color: rgba(255,255,255,.72); }
@media (min-width: 980px) { .hscroll { margin: 0; padding: 2px 0 6px; } .near { width: 200px; height: 220px; } }

.promo { position: relative; overflow: hidden; margin-top: 18px; border-radius: 20px; padding: 18px 16px 16px 94px; min-height: 104px;
  background: linear-gradient(110deg, #1f7a4c 0%, #145234 38%, rgba(20,82,52,.4) 100%), url('/img/skyline.svg') right bottom / 60% 70% no-repeat;
  border: 1px solid rgba(74,222,128,.22); box-shadow: var(--shadow); }
.promo img { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 66px; }
.promo b { display: block; font-size: 17px; line-height: 1.2; color: #fff; }
.promo span { display: block; font-size: 12.5px; color: rgba(255,255,255,.78); margin: 4px 0 10px; }
.promo button { background: transparent !important; border: 1.5px solid var(--orange) !important; color: #fff !important;
  min-height: 34px; padding: 6px 14px; font-size: 13.5px; border-radius: 99px; }

/* сердечко и расстояние */
.heart { width: 36px; min-height: 36px; height: 36px; padding: 0; border-radius: 50%; flex: none;
  background: rgba(4,14,9,.72) !important; border: 1px solid rgba(255,255,255,.14) !important; color: #fff !important; }
.heart svg { width: 19px; height: 19px; }
.heart.on { color: var(--orange) !important; }
.heart.on svg { fill: var(--orange); }
.on-photo { position: absolute; top: 8px; right: 8px; z-index: 2; }
.dist { display: inline-block; font-size: 11.5px; font-weight: 600; color: var(--green); margin-left: 4px; white-space: nowrap; }
.near .tx .dist { display: block; margin: 3px 0 0; color: #b9f5cf; }
.tabbar button { font-size: 10.5px; }
