:root {
  --bg: #0B0F14; --card: #151A21; --card2: #1B212A; --line: #232A34; --nav: #0F141A;
  --text: #EEF2F6; --muted: #A3ADBB; --dim: #8B95A3;
  --green: #34D399; --amber: #FBBF24; --orange: #FB923C; --blue: #60A5FA; --teal: #2DD4BF;
  --radius: 20px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); height: 100%; overflow: hidden; overscroll-behavior: none;
  /* Застосунок жорстко тримає розмір екрана: без масштабування двома пальцями й подвійним дотиком, текст не збільшується сам. */
  touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Каркас: прокручується лише вміст, нижнє меню — окремий нерухомий блок (не position: fixed — на iPhone після
   клавіатури чи списку Safari зсуває «прикріплені» елементи). */
#app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; line-height: 1.4; min-height: 100vh;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--green); text-decoration: none; }
.wrap { max-width: 480px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 18px) 16px 24px; display: flex; flex-direction: column; gap: 12px; }
.boot { height: 100%; display: flex; align-items: center; justify-content: center; }
.logo { width: 72px; height: 72px; border-radius: 22px; background: var(--green) url("/icon-192.png") center/cover; }
h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
h2 { margin: 0; font-size: 15px; font-weight: 600; }
.muted { color: var(--muted); } .dim { color: var(--dim); } .small { font-size: 13px; } .tiny { font-size: 12px; }
b, .b { font-weight: 600; color: var(--text); }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card.on { background: linear-gradient(180deg, #11261E 0%, var(--card) 100%); border-color: #1F3A2E; }
.card.wait { background: linear-gradient(180deg, #2A230C 0%, var(--card) 100%); border-color: #5A4A14; }
.card.off { background: linear-gradient(180deg, #2A1810 0%, var(--card) 100%); border-color: #4A2A18; }
.card.warn { background: #2A1E0C; border-color: #5A4114; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.big { font-size: 21px; font-weight: 800; letter-spacing: -0.01em; }
.huge { font-size: 26px; font-weight: 800; }
.ico { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.chip { font-size: 12px; font-weight: 700; color: var(--bg); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.status { border-radius: 14px; display: flex; flex-direction: column; background: rgba(0,0,0,0.22); }
.status > div { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; gap: 8px; }
.status > div + div { border-top: 1px solid rgba(255,255,255,0.06); }
.btn { border: 0; cursor: pointer; border-radius: 14px; padding: 13px 16px; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; }
.btn.primary { background: var(--green); color: var(--bg); }
.btn.light { background: var(--text); color: var(--bg); }
.btn.ghost { background: var(--card2); color: var(--text); }
.btn.danger { background: #3A1A14; color: #FCA5A5; }
.btn:disabled, .btn.primary:disabled { background: #232A34; color: #5E6875; opacity: 1; cursor: default; }   /* змін немає — сіра, неактивна */
.btn.primary.busy:disabled { background: var(--green); color: var(--bg); opacity: 0.85; }                 /* іде збереження — та сама кнопка з кружечком */
.btn .spin { width: 18px; height: 18px; border-width: 2px; border-color: rgba(0,0,0,0.2); border-top-color: currentColor; flex: none; }
.btn.block { width: 100%; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.seg button { border: 0; background: none; padding: 10px; border-radius: 10px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.sel { background: var(--text); color: var(--bg); }
.chips { display: grid; gap: 6px; }
.chips button { border: 0; cursor: pointer; padding: 10px 0; border-radius: 10px; font-size: 13px; font-weight: 600; background: var(--card2); color: var(--muted); }
.chips button.sel { background: var(--green); color: var(--bg); }
.chips.light button.sel { background: var(--text); color: var(--bg); }
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.list > * { padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.list > * + * { border-top: 1px solid var(--line); }
.list .grow { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.switch { width: 50px; height: 30px; border-radius: 999px; background: #2A323D; border: 0; position: relative; cursor: pointer; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--muted); transition: left .15s; }
.switch.on { background: var(--green); } .switch.on::after { left: 23px; background: var(--bg); }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--card2); font-size: 22px; font-weight: 600; cursor: pointer; }
.stepper .val { flex-grow: 1; text-align: center; display: flex; flex-direction: column; gap: 2px; }
input.field, select.field { width: 100%; background: #0F141A; border: 1px solid #2A323D; border-radius: 12px; padding: 13px 14px; color: var(--text); font-size: 16px; }
select.field { appearance: none; }
label.lbl { font-size: 13px; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: #C9D3E0; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--green); flex-shrink: 0; }
.err { background: #3A1A14; color: #FCA5A5; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.note { background: var(--card2); border-radius: 12px; padding: 10px 12px; font-size: 13px; color: var(--muted); }
.ok { background: #10261D; color: #86EFAC; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
nav.tabs { flex-shrink: 0; background: var(--nav); border-top: 1px solid #1C222B; padding: 6px 8px max(6px, calc(env(safe-area-inset-bottom) - 16px)); display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
nav.tabs button { border: 0; background: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; min-height: 48px; justify-content: center; cursor: pointer; }
nav.tabs button.sel { color: var(--green); }
nav.tabs .inner { max-width: 480px; }
.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: end; height: 140px; }
.bars > div { display: flex; flex-direction: column-reverse; gap: 2px; height: 100%; }
.bars span { display: block; border-radius: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }
.lane { position: relative; height: 16px; border-radius: 6px; overflow: hidden; background: #0F141A; }
.lane span { position: absolute; top: 0; bottom: 0; }
.ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); }
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 10; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--card); border-radius: 22px 22px 0 0; width: 100%; max-width: 480px; padding: 18px 16px calc(env(safe-area-inset-bottom) + 18px); display: flex; flex-direction: column; gap: 10px; max-height: 85vh; overflow: auto; }
.spin { width: 22px; height: 22px; border: 3px solid rgba(255,255,255,0.15); border-top-color: var(--green); border-radius: 50%; animation: sp 0.8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.center { display: flex; justify-content: center; align-items: center; padding: 30px 0; gap: 10px; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: #C9D3E0; }
.hidden { display: none !important; }
table.cmp { width: 100%; border-collapse: collapse; font-size: 13px; }
table.cmp td, table.cmp th { padding: 7px 4px; text-align: left; }
table.cmp th { color: var(--dim); font-size: 11px; font-weight: 500; }
table.cmp tr + tr td { border-top: 1px solid var(--line); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 84px); z-index: 20; max-width: 440px; width: calc(100% - 32px); box-shadow: 0 8px 30px rgba(0,0,0,0.5); text-align: center; }
.pull { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 6px); transform: translate(-50%, -60px); opacity: 0; z-index: 15; background: var(--card2); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; pointer-events: none; transition: opacity .15s; }
.pull .spin { width: 16px; height: 16px; border-width: 2px; }
.fs-bg { position: fixed; inset: 0; z-index: 30; background: var(--bg); overflow: hidden; }
.fs { position: absolute; left: 0; top: 0; width: 100vw; height: 100vh; height: 100dvh; box-sizing: border-box; padding: calc(env(safe-area-inset-top) + 10px) max(16px, calc(env(safe-area-inset-right) + 8px)) max(10px, env(safe-area-inset-bottom)) max(16px, calc(env(safe-area-inset-left) + 8px)); display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
/* Повернуто за годинниковою: лівий край вмісту = верх екрана (годинник, «острівець»), правий = низ (смужка «додому») */
.fs-rot { width: 100vh; width: 100dvh; height: 100vw; transform-origin: top left; transform: translateX(100vw) rotate(90deg);
  padding: 14px calc(env(safe-area-inset-bottom) + 16px) 14px calc(env(safe-area-inset-top) + 20px); }
.fs #f-box svg:nth-of-type(1) { height: 15vmin !important; }
.fs #f-box svg:nth-of-type(2), .fs #f-box svg:nth-of-type(3) { height: 11vmin !important; }
.fs #f-box h2 { font-size: 12px; }
.fs #f-box .between { margin-top: 2px !important; }
.fs #f-box .lane { height: 10px !important; margin-top: 2px !important; }
.fs #f-box .tiny.dim { display: none; }
.fs .ticks { font-size: 10px; }
.fs #f-box h2 { background: var(--bg); padding-right: 6px; position: relative; z-index: 1; }
.fs .ticks { padding-top: 2px; }

/* дзвіночок і журнал сповіщень */
.bell { position: relative; flex-shrink: 0; width: 46px; height: 46px; border-radius: 15px; background: var(--card); border: 1px solid var(--line); color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.bell .badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box; border-radius: 10px; background: #FB923C; color: #0B0F14; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); }
.nlist > .nitem { padding: 0; display: block; }
.nhead { all: unset; box-sizing: border-box; width: 100%; padding: 13px 14px; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.nhead .ntitle { font-weight: 500; font-size: 14px; line-height: 1.35; }
.nitem.new .ntitle { font-weight: 700; }
.nitem.new { background: rgba(251, 146, 60, 0.07); }
.nhead .chev { display: flex; transition: transform .15s; }
.nitem.open .chev { transform: rotate(180deg); }
.nbody { padding: 0 14px 14px 36px; display: flex; flex-direction: column; gap: 8px; }
.nbody[hidden] { display: none; }
.capin { all: unset; box-sizing: border-box; width: 100%; text-align: center; font-size: 26px; font-weight: 800; color: var(--text); border-bottom: 1px dashed #3A4250; padding-bottom: 1px; }
.capin:focus { border-bottom-color: var(--green); }
/* шапка «Зараз»: менша і прикріплена зверху під час прокрутки */
.nowhead { position: sticky; top: 0; z-index: 5; background: var(--bg);
  margin: calc(-1 * (env(safe-area-inset-top) + 18px)) -16px 0; padding: calc(env(safe-area-inset-top) + 10px) 16px 8px;
  border-bottom: 1px solid #1C222B; gap: 10px; }
.nowtitle { font-size: 19px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.nowhead .bell { width: 40px; height: 40px; border-radius: 13px; }
.nowhead .bell svg { width: 20px; height: 20px; }

/* поле пароля з «оком» */
.pwf { position: relative; }
.pwf .field { padding-right: 52px; width: 100%; }
.pwf .eye { position: absolute; right: 2px; top: 0; bottom: 0; width: 48px; border: 0; background: none; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pwf .eye.on { color: var(--text); }
.pwf .eye.on .slash { display: none; }

/* кнопки банків (сторінка «Підтримати фонд») — як у Ярмарці */
.banks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.banks .btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
.btn.bank { color: #fff; min-height: 64px; padding: 0 10px; }
.btn.bank .plate { display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 6px; width: 100%; max-width: 150px; height: 46px; overflow: hidden; color: #1F2430; font-weight: 700; }
.btn.bank .plate img { display: block; height: 46px; width: auto; max-width: 100%; object-fit: contain; }
.btn.bank.mono { background: #090606; } .btn.bank.privat { background: #4EA524; } .btn.bank.pumb { background: #E60C2E; }
.btn.bank.raif { background: #FEE600; } .btn.bank.abank { background: #00D352; }
.btn.bank:active { filter: brightness(.9); }

/* смуга прогресу (оновлення плати) */
.bar { height: 10px; border-radius: 6px; background: var(--card2); overflow: hidden; border: 1px solid var(--line); }
.bar > div { height: 100%; background: var(--green); transition: width .3s; }
.switch:disabled { cursor: default; }   /* керує автоматика (напр., автозапуск генератора) */

