/* Компонування інтерфейсу; кольори й градієнти успадковуються з бренд-теми style.css. */
:root, [data-theme="dark"] {
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
}
html, body { font-family: 'Segoe UI Variable Text', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif; }
button, input, select, textarea { font: inherit; }
.header, [data-theme="light"] .header { gap: 8px; }
.header h1, [data-theme="light"] .header h1 { font-weight: 650; letter-spacing: -0.4px; }
.header-right .header-btn { min-width: 36px !important; height: 40px !important; padding: 8px !important; }
.role-badge { text-transform: none; letter-spacing: 0; border-radius: 6px; }
.nav {
  bottom: 0; width: 100%; max-width: 520px;
  padding: 5px 8px calc(5px + env(safe-area-inset-bottom, 0px));
  border: 0; border-top: 1px solid var(--separator);
  border-radius: 0;
}
.nav-btn { padding: 8px 4px !important; border-radius: 8px; font-size: 11px !important; font-weight: 500; }
.nav-btn.active, [data-theme="light"] .nav-btn.active { font-weight: 650; }
.nav-btn.active .nav-icon { transform: none; }
.content { padding-top: 18px; padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
.card, .ledger, .stat-card, .list-item, .quick-card,
[data-theme="light"] :is(.card, .ledger, .stat-card, .list-item, .quick-card) {
  transition: background 0.15s, border-color 0.15s;
}
.card:active, .stat-card:active, .quick-card:active, .list-item:active { transform: none; }
.stat-label, .t-label, .section-header, .eyebrow-row .eb, .eyebrow-row .eb-act {
  text-transform: none; letter-spacing: 0; font-weight: 600;
}
.stat-label { font-size: 11px; }
.section-header { margin: 22px 0 10px; padding: 0; font-size: 14px; }
.eyebrow-row { margin: 20px 0 10px; }
.eyebrow-row .eb { font-size: 14px; color: var(--text); }
.eyebrow-row .eb-act { font-size: 12px; color: var(--accent); }
.btn { border-radius: 10px; font-weight: 600; letter-spacing: 0; transition: background 0.15s; }
.btn-glow { animation: none; }
.btn-danger-soft { background: var(--tint-danger); color: var(--text); border: 1px solid var(--tint-danger); box-shadow: none; }
.pulse-dot { animation: none; }
.quick-card-label { letter-spacing: 0; }
.balance-label { text-transform: none; letter-spacing: 0; font-size: 13px; }
.gh-grid { gap: 10px; }
.gh-card { border-radius: 12px; }
.gh-badge { border-radius: 5px; letter-spacing: 0; }
.fade-in, .stagger > *, .empty-state-icon { animation: none; }
.home-tier + .home-tier { margin-top: var(--ui-tier-gap); }
.home-tier-low { padding-top: var(--ui-tier-gap); border-top: 1px solid var(--separator); }
.home-tier-mid > div:empty { display: none; }
.home-tier-mid > :not(:first-child) { margin-top: 10px; }
.home-tier-mid > div > .card { margin-bottom: 0; }
.home-wallet {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: var(--ui-card-pad); margin-bottom: 14px; border-radius: 14px;
  background: var(--card-bg); border: 1px solid var(--card-bd);
}
.home-wallet-main { min-width: 0; }
.home-hello { display: block; margin-bottom: 4px; font-size: clamp(12.5px, 11.6px + .3vw, 13.5px); font-weight: 600; color: var(--hint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-wallet .hero-amount { flex-wrap: wrap; }
.home-wallet .hero-amount b { font-size: clamp(24px, 19px + 1.6vw, 28px); font-weight: 650; overflow-wrap: anywhere; }
.home-wallet .hero-amount i { font-size: clamp(15px, 13px + .6vw, 18px); font-weight: 400; }
.home-topup { width: auto; flex-shrink: 0; }
.home-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 0 8px; }
.home-section-heading h2 { font-size: 16px; font-weight: 650; letter-spacing: -0.2px; }
.home-text-link { display: inline-flex; align-items: center; gap: 2px; padding: 8px 0 8px 6px; background: none; border: none; color: var(--accent); font-size: 12px; cursor: pointer; }
.home-giveaways { padding: 0 14px; margin-bottom: 16px; }
.home-giveaway { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--separator); text-align: left; color: var(--text); padding: var(--ui-row-py) 0; }
.home-gw-thumb { width: var(--ui-gw-thumb); height: var(--ui-gw-thumb); border-radius: var(--radius-xs); flex-shrink: 0; background: var(--glass); }
img.home-gw-thumb { object-fit: cover; }
div.home-gw-thumb { display: flex; align-items: center; justify-content: center; }
.home-giveaway .ledger-txt b { font-weight: 600; }
.home-giveaway .ledger-txt small { font-size: 11px; margin-top: 3px; }
.home-giveaway-arrow { color: var(--hint); flex-shrink: 0; display: flex; }
.home-bonus { padding: 12px 14px; margin: 0 0 18px; background: var(--tint-accent); border-radius: 10px; }
.home-bonus-link { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; text-align: left; color: var(--accent); cursor: pointer; }
.home-bonus-link span { flex: 1; }
.home-bonus-link b { display: block; font-size: 13px; font-weight: 600; }
/* Чотири швидкі дії: на найвужчих екранах 2×2, від 360 px — у рядок. */
.home-shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.home-shortcuts .quick-card {
  flex-direction: row; justify-content: flex-start; text-align: left;
  min-height: var(--ui-tile-h); padding: 8px 10px; gap: 9px; border-radius: 10px;
}
.home-shortcuts .quick-card-label { font-size: var(--ui-tile-fs); font-weight: 600; color: var(--text); line-height: 1.25; }
@media (min-width: 360px) {
  .home-shortcuts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .home-shortcuts .quick-card { flex-direction: column; justify-content: center; text-align: center; padding: 9px 4px; gap: 6px; }
}
.home-tier-title { margin: 0 0 4px; font-size: 12px; font-weight: 600; color: var(--hint); }
.home-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.home-link {
  display: flex; align-items: center; gap: 9px; min-width: 0; min-height: var(--ui-link-h);
  padding: 0 2px; background: none; border: 0; border-radius: 8px;
  color: var(--text); font-size: var(--ui-link-fs); font-weight: 500; text-align: left; cursor: pointer;
}
.home-link .ic { width: var(--ui-link-icon); height: var(--ui-link-icon); color: var(--accent); flex-shrink: 0; }
.home-link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 480px) { .home-links { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.profile-tier-low { margin-top: var(--ui-tier-gap); padding-top: var(--ui-tier-gap); border-top: 1px solid var(--separator); }
.profile-set-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: var(--ui-link-h); }
.profile-set-row + .profile-set-row { border-top: 1px solid var(--glass-border); }
.profile-set-label { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; font-weight: 600; color: var(--text); }
.profile-set-label span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Праворуч — місце під #bug-fab: інакше на дні сторінки кнопка «баг» лягає на останнє посилання. */
.home-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 8px; padding: 12px 48px 8px 0; color: var(--hint); font-size: 11px; }
.home-footer button { background: none; border: none; color: var(--hint); padding: 8px; font-size: 11px; cursor: pointer; }
#bug-fab { border-radius: 10px; }
:is(button, summary, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .card[onclick]:hover { transform: none; }
  .home-link:hover, .home-giveaway:hover { background: var(--glass); }
  .home-text-link:hover, .home-footer button:hover { color: var(--text); }
}
@media (min-width: 640px) { body, [data-theme="light"] body { box-shadow: none; } }
@media (min-width: 1280px) { .nav { max-width: 560px; } }
@media (max-width: 359px) {
  .home-section-heading { align-items: flex-start; flex-direction: column; gap: 0; }
  .home-text-link { padding-left: 0; }
  .home-links { gap: 0 8px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .nav { bottom: 0; padding: 3px 8px calc(3px + env(safe-area-inset-bottom, 0px)); }
  .header-right .header-btn { height: 32px !important; }
}

/* ── Розміри під екран (власник 07.11: «под каждый размер экранов, но поменьше чуть-чуть»).
   Тягнуться від 320 px до 430 px, далі стоять. Проти колишніх: кнопка 36→41 px заввишки замість 44,
   кнопки шапки 32→36 замість 40, іконка навігації 19→21 замість 22, плитка з фото 30→36 замість 44. ── */
:root {
  --ui-btn-py: 10px;
  --ui-btn-px: 15px;
  --ui-btn-fs: 13px;
  --ui-btn-sm-py: 6.5px;
  --ui-btn-sm-fs: 11.5px;
  --ui-hdr-btn: 34.5px;
  --ui-hdr-icon: 18px;
  --ui-hdr-py: 10px;
  --ui-nav-icon: 20px;
  --ui-nav-fs: 10px;
  --ui-nav-py: 7px;
  --ui-tile-h: 59.5px;
  --ui-tile-thumb: 32.5px;
  --ui-tile-fs: 11px;
  --ui-row-icon: 31px;
  --ui-row-py: 11px;
  --ui-gw-thumb: 38.5px;
  --ui-link-h: 39px;
  --ui-link-fs: 13px;
  --ui-link-icon: 15.5px;
  --ui-fab: 37px;
  --ui-card-pad: 13px;
  --ui-tier-gap: 17px;
}
/* Android WebView до 79-ї не знає clamp(): там лишаються сталі розміри екрана 390 px вище. */
@supports (width: clamp(1px, 1vw, 2px)) {
  :root {
    --ui-btn-py: clamp(9px, 5.2px + 1.2vw, 10.75px);
    --ui-btn-px: clamp(14px, 8.2px + 1.8vw, 18px);
    --ui-btn-fs: clamp(12.5px, 11.6px + .3vw, 13.5px);
    --ui-btn-sm-py: clamp(6px, 4.6px + .45vw, 7px);
    --ui-btn-sm-fs: clamp(11.5px, 11px + .15vw, 12px);
    --ui-hdr-btn: clamp(32px, 20.4px + 3.6vw, 36px);
    --ui-hdr-icon: clamp(17px, 11.2px + 1.8vw, 19px);
    --ui-hdr-py: clamp(9px, 3.2px + 1.8vw, 12px);
    --ui-nav-icon: clamp(19px, 13.2px + 1.8vw, 21px);
    --ui-nav-fs: clamp(9.5px, 6.6px + .9vw, 10.5px);
    --ui-nav-py: clamp(6px, 2.5px + 1.1vw, 7.5px);
    --ui-tile-h: clamp(54px, 31px + 7.3vw, 62px);
    --ui-tile-thumb: clamp(30px, 18.4px + 3.6vw, 36px);
    --ui-tile-fs: clamp(11px, 9.8px + .35vw, 12px);
    --ui-row-icon: clamp(30px, 24.2px + 1.8vw, 33px);
    --ui-row-py: clamp(10px, 6.5px + 1.1vw, 12px);
    --ui-gw-thumb: clamp(36px, 24.4px + 3.6vw, 40px);
    --ui-link-h: clamp(38px, 32.2px + 1.8vw, 42px);
    --ui-link-fs: clamp(12.5px, 11.6px + .3vw, 13px);
    --ui-link-icon: clamp(15px, 12.1px + .9vw, 17px);
    --ui-fab: clamp(36px, 30.2px + 1.8vw, 40px);
    --ui-card-pad: clamp(12px, 6.2px + 1.8vw, 15px);
    --ui-tier-gap: clamp(16px, 10.2px + 1.8vw, 20px);
  }
}
.btn { padding: var(--ui-btn-py) var(--ui-btn-px); font-size: var(--ui-btn-fs); gap: 7px; }
.btn > .ic { width: 1.15em; height: 1.15em; }
.btn-small { padding: var(--ui-btn-sm-py) 10px; font-size: var(--ui-btn-sm-fs); }
.btn-small > .ic { width: 1.1em; height: 1.1em; }
.header, [data-theme="light"] .header {
  padding-top: calc(var(--ui-hdr-py) + env(safe-area-inset-top, 0px)); padding-bottom: var(--ui-hdr-py);
}
.header-right .header-btn, .header-left .header-btn {
  min-width: var(--ui-hdr-btn) !important; height: var(--ui-hdr-btn) !important; padding: 0 !important;
}
.header-btn > .ic { width: var(--ui-hdr-icon); height: var(--ui-hdr-icon); }
.nav-btn { padding: var(--ui-nav-py) 2px !important; font-size: var(--ui-nav-fs) !important; gap: 3px !important; }
.nav-btn .nav-icon { width: var(--ui-nav-icon); height: var(--ui-nav-icon); }
.nav-btn .nav-icon .ic { width: var(--ui-nav-icon) !important; height: var(--ui-nav-icon) !important; }
.rowlead { width: var(--ui-row-icon); height: var(--ui-row-icon); }
.rowlead > .ic { width: calc(var(--ui-row-icon) * .5); height: calc(var(--ui-row-icon) * .5); }
.ledger-row { padding: var(--ui-row-py) 0; }
#bug-fab { width: var(--ui-fab); height: var(--ui-fab); }
#bug-fab .ic { width: calc(var(--ui-fab) * .48); height: calc(var(--ui-fab) * .48); }
@media (max-height: 500px) and (orientation: landscape) {
  :root { --ui-hdr-btn: 30px; --ui-hdr-py: 7px; --ui-nav-icon: 18px; --ui-nav-py: 4px; --ui-fab: 34px; }
}
