
html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  background: #0f1115;
  color: rgba(255,255,255,.92);
}
/* InstallPro — Telegram WebApp starter
   Touch-first UI, safe areas, theme sync (dark/light)
*/
:root{
  --bg: #0b1220;
  --panel: rgba(255,255,255,.06);
  --panel2: rgba(255,255,255,.08);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.62);
  --hint: rgba(255,255,255,.45);
  --stroke: rgba(255,255,255,.12);
  --accent: #3b82f6; /* blue */
  --good: #22c55e;
  --warn: #f59e0b;
  --bad:  #ef4444;

  --radius: 16px;
  --radius2: 22px;
  --shadow: 0 12px 30px rgba(0,0,0,.28);

  --pad: 16px;
  --tap: 48px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*{ box-sizing:border-box; }
html,body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  background: #0f1115;
  color: rgba(255,255,255,.92);
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  background: #0f1115;
  color: rgba(255,255,255,.92);
}

button, input, select, textarea{
  font: inherit;
  color: inherit;
}

.app{
  min-height:100%;
  display:flex;
  flex-direction:column;
  padding-top: var(--safe-top);
  padding-bottom: calc(var(--safe-bottom) + 74px);
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 5;
  padding: calc(var(--pad) + 6px) var(--pad) 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  backdrop-filter: blur(14px);
  background: linear-gradient(to bottom, rgba(11,18,32,.92), rgba(11,18,32,.55));
  border-bottom: 1px solid var(--stroke);
}

.brand{ display:flex; gap:12px; align-items:center; }
.brand__logo{
  width:44px; height:44px;
  border-radius: 14px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(59,130,246,.9), rgba(16,185,129,.75));
  box-shadow: 0 10px 24px rgba(59,130,246,.25);
  font-weight:800;
  letter-spacing:.4px;
}
.brand__title{ font-weight:700; line-height:1.0; }
.brand__subtitle{ margin-top:2px; font-size:12px; color: var(--muted); }

.iconbtn{
  width: var(--tap);
  height: var(--tap);
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  display:grid; place-items:center;
}
.iconbtn:active{ transform: translateY(1px); }

.view{
  padding: var(--pad);
  display:flex;
  flex-direction:column;
  gap: 14px;
}

.card{
  background: rgba(255,255,255,.06);
  border: 1px solid var(--stroke);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
}

.card__inner{ padding: 14px; }

.sectionTitle{
  font-size: 14px;
  color: var(--muted);
  margin: 2px 0 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}

.row{
  display:flex;
  gap: 10px;
}

.kpi{
  flex:1;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--stroke);
}
.kpi__label{ font-size: 12px; color: var(--muted); }
.kpi__value{ margin-top:8px; font-size: 20px; font-weight: 700; }
.kpi__sub{ margin-top:4px; font-size:12px; color: var(--hint); }

.btn{
  height: var(--tap);
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  padding: 0 14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  font-weight: 600;
}
.btn--primary{
  border: none;
  background: linear-gradient(135deg, rgba(59,130,246,.95), rgba(16,185,129,.85));
  box-shadow: 0 12px 28px rgba(59,130,246,.22);
}
.btn:active{ transform: translateY(1px); }

.field{
  display:flex;
  flex-direction:column;
  gap: 6px;
  margin-bottom: 12px;
}
.label{ font-size: 12px; color: var(--muted); }
.input, .select, .textarea{
  width:100%;
  min-height: var(--tap);
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,.18);
  padding: 12px 12px;
  outline: none;
}
.textarea{ min-height: 96px; resize: vertical; }

.list{
  display:flex;
  flex-direction:column;
  gap: 10px;
}
.item, button.item{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 12px 12px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.05);
}
.item__title{ font-weight: 650; }
.item__meta{ font-size: 12px; color: var(--muted); margin-top: 4px; }
.pill{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  color: var(--muted);
}
.pill--good{ color: rgba(34,197,94,.95); border-color: rgba(34,197,94,.25); background: rgba(34,197,94,.08); }
.pill--warn{ color: rgba(245,158,11,.95); border-color: rgba(245,158,11,.25); background: rgba(245,158,11,.08); }
.pill--bad{  color: rgba(239,68,68,.95); border-color: rgba(239,68,68,.25); background: rgba(239,68,68,.08); }

.tabbar{
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  padding: 10px var(--pad) calc(var(--safe-bottom) + 10px);
  display:flex;
  gap: 10px;
  background: linear-gradient(to top, rgba(11,18,32,.92), rgba(11,18,32,.35));
  border-top: 1px solid var(--stroke);
  backdrop-filter: blur(14px);
  z-index: 10;
}

.tab{
  flex:1;
  height: 54px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.05);
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
}
.tab__label{ font-size: 12px; font-weight: 650; color: var(--muted); }
.tab--active{
  border: none;
  background: rgba(59,130,246,.18);
}
.tab--active .tab__label{ color: rgba(255,255,255,.88); }

.hr{
  height:1px; width:100%;
  background: var(--stroke);
  margin: 10px 0;
}

.small{ font-size: 12px; color: var(--muted); }
.muted{ color: var(--muted); }
.hint{ color: var(--hint); }
.h1{ font-size: 20px; font-weight: 750; letter-spacing:-.2px; }
.h2{ font-size: 16px; font-weight: 720; }

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.badge{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.06);
}

.toastHost{
  position: fixed;
  left: 0; right:0;
  bottom: calc(74px + var(--safe-bottom) + 10px);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  pointer-events:none;
  z-index: 20;
}
.toast{
  pointer-events:none;
  width: min(520px, calc(100% - 26px));
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(12px);
  padding: 12px 14px;
  color: rgba(255,255,255,.9);
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
}

@media (max-width: 380px){
  .tab__label{ display:none; }
}

/* Light theme overrides (Telegram can switch) */
html[data-theme="light"]{
  --bg: #f4f6fb;
  --panel: rgba(0,0,0,.04);
  --panel2: rgba(0,0,0,.06);
  --text: rgba(10,18,32,.95);
  --muted: rgba(10,18,32,.62);
  --hint: rgba(10,18,32,.45);
  --stroke: rgba(10,18,32,.12);
  --shadow: 0 12px 28px rgba(10,18,32,.10);
}
html[data-theme="light"] body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  background: #0f1115;
  color: rgba(255,255,255,.92);
}
html[data-theme="light"] .topbar{
  background: linear-gradient(to bottom, rgba(244,246,251,.92), rgba(244,246,251,.60));
}
html[data-theme="light"] .input, 
html[data-theme="light"] .select,
html[data-theme="light"] .textarea{
  background: rgba(255,255,255,.7);
}

/* Modal (bottom sheet) */
.modalOverlay{
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding: 14px 14px calc(var(--safe-bottom) + 14px);
  z-index: 30;
}
.modalSheet{
  width: min(720px, 100%);
  border-radius: 22px;
  border: 1px solid var(--stroke);
  background: rgba(11,18,32,.92);
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
  overflow:hidden;
}
html[data-theme="light"] .modalSheet{
  background: rgba(244,246,251,.96);
}
.modalHeader{
  padding: 14px 14px 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom: 1px solid var(--stroke);
}
.modalTitle{ font-weight: 800; }
.modalBody{ padding: 12px 14px; max-height: 60vh; overflow:auto; }
.modalFooter{
  padding: 12px 14px;
  display:flex;
  gap: 10px;
  border-top: 1px solid var(--stroke);
}
.modalFooter .btn{ flex:1; }

/* Proposal checkbox */
.check{
  display:flex;
  gap:10px;
  align-items:center;
  padding:10px 12px;
  border-radius:16px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  user-select:none;
}
.check input{ width:18px; height:18px; }

/* Section header inside lists */
.subhead{
  margin: 10px 0 6px;
  padding: 6px 10px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .2px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
}

/* section chips */
.chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}
.chip{
  appearance:none;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
  padding: 8px 10px;
  border-radius: 999px;
  font-weight: 750;
  font-size: 12px;
  line-height: 1;
}
.chip:active{
  transform: scale(.98);
}

/* Screen spacing */
.screen{
  display:flex;
  flex-direction:column;
  gap:18px;
  padding-bottom:40px;
}

/* Make item buttons look like cards */
button.item{
  border: 0;
  background: transparent;
  padding: 0;
  width: 100%;
}
button.item .item{
  width: 100%;
}
