/* ===================== KRONBERG mobile app ===================== */
:root{
  --bg:#ffffff;
  --ink:#111315;
  --ink-2:#3a3f45;
  --muted:#8a9099;
  --muted-2:#aeb4bc;
  --line:#ececef;
  --card:#f6f6f8;
  --card-2:#f1f1f4;
  --dark:#16181c;        /* primary / user bubble */
  /* Akcents = tā pati zilā, ko `/legal` lieto pogām (`--accent-btn` → #1d4ed8) */
  --accent:#1d4ed8;
  --accent-2:#1e40af;
  --danger:#d8453b;
  --radius:16px;
  --radius-sm:10px;
  --safe-t:env(safe-area-inset-top,0px);
  --safe-b:env(safe-area-inset-bottom,0px);
  --kb:0px;
  --topbar-h:54px;
  font-size:16px;
}

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{height:100%}
body{
  margin:0;
  background:#e9e9ec;
  color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,'SF Pro Text','Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  overflow:hidden;
}

#app{
  position:relative;
  height:100dvh;
  height:calc(100dvh - var(--kb));
  max-width:480px;
  margin:0 auto;
  background:var(--bg);
  overflow:hidden;
  box-shadow:0 0 40px rgba(0,0,0,.06);
}

/* ---------- views ---------- */
.view{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  background:var(--bg);
  transform:translateX(100%);
  visibility:hidden;
  pointer-events:none; /* neaktīvie skati nedrīkst ēst tapus (iOS transform quirk) */
  transition:transform .28s cubic-bezier(.22,.61,.36,1),visibility .28s;
}
.view.is-active{transform:translateX(0);visibility:visible;z-index:2;pointer-events:auto}
.view.is-prev{transform:translateX(-22%);visibility:visible;z-index:1;pointer-events:none}

/* ---------- topbar ---------- */
.topbar{
  flex:0 0 auto;
  height:calc(var(--topbar-h) + var(--safe-t));
  padding:var(--safe-t) 8px 0;
  display:flex;
  align-items:center;
  gap:6px;
  border-bottom:1px solid var(--line);
  background:rgba(255,255,255,.92);
  backdrop-filter:saturate(180%) blur(12px);
  position:relative;
  z-index:5;
}
.topbar__title{
  flex:1;
  text-align:center;
  font-size:16px;
  font-weight:600;
  margin:0;
  letter-spacing:-.01em;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.topbar__title--left{text-align:left;padding-left:8px;font-size:22px;font-weight:700}
.topbar__right{margin-left:auto}

.iconbtn{
  flex:0 0 auto;
  width:40px;height:40px;
  display:grid;place-items:center;
  border:0;background:transparent;
  border-radius:10px;color:var(--ink);cursor:pointer;
}
.iconbtn:active{background:var(--card)}
.iconbtn--ghost{visibility:hidden}
.iconbtn svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}

/* ---------- brand ---------- */
.brand{display:inline-flex;align-items:center;gap:9px}
.brand--center{flex:1;justify-content:center}
.brand__mark{
  width:26px;height:26px;border-radius:7px;flex:0 0 auto;
  background:var(--dark) url("./icons/icon.svg") center/120% no-repeat;
  background-blend-mode:normal;
}
.brand__mark--lg{width:30px;height:30px;border-radius:8px}
.brand__text{display:flex;flex-direction:column;line-height:1}
.brand__text b{font-size:15px;font-weight:800;letter-spacing:.14em}
.brand__text i{font-size:7.5px;font-style:normal;color:var(--muted);letter-spacing:.22em;margin-top:3px}
.brand-logo{height:22px;width:auto;display:block}
.brand-logo--lg{height:30px}

/* ---------- app mode switch ---------- */
.modeswitch{
  flex:0 0 auto;
  display:flex;
  gap:4px;
  margin:8px 12px 0;
  padding:6px;
  background:var(--card);
  border-radius:12px;
  border:1px solid var(--line);
}
.modeswitch__btn{
  flex:1;
  border:0;
  background:transparent;
  color:var(--muted);
  font:inherit;
  font-size:12.5px;
  font-weight:600;
  letter-spacing:-.01em;
  padding:8px 6px;
  border-radius:8px;
  cursor:pointer;
}
.modeswitch__btn.is-active{
  background:#fff;
  color:var(--ink);
  box-shadow:0 1px 2px rgba(0,0,0,.06);
}
.modeswitch__btn:active{opacity:.85}

/* ---------- CITS law picker ---------- */
.lawpick{
  flex:0 0 auto;
  margin:8px 12px 0;
  position:relative;
  z-index:4; /* zem topbar (5), lai menu/X nav zem overlay */
}
.lawpick__input{
  width:100%;
  box-sizing:border-box;
  border:1px solid var(--line);
  background:var(--card);
  border-radius:12px;
  padding:10px 12px;
  font:inherit;
  font-size:14px;
  color:var(--ink);
}
.lawpick__input:focus{
  outline:none;
  border-color:var(--muted-2);
  background:#fff;
}
.lawpick__drop{
  position:absolute;
  left:0;right:0;top:calc(100% + 4px);
  max-height:240px;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  box-shadow:0 8px 24px rgba(0,0,0,.12);
  z-index:35;
  pointer-events:auto;
}
.lawpick__drop[hidden]{
  display:none !important;
  pointer-events:none;
}
.lawpick__item{
  display:block;width:100%;
  text-align:left;
  border:0;background:transparent;
  padding:12px 14px;
  font:inherit;font-size:14px;
  color:var(--ink);cursor:pointer;
  -webkit-tap-highlight-color:rgba(0,0,0,.06);
  touch-action:manipulation;
}
.lawpick__item:active,.lawpick__item:hover{background:var(--card)}
.lawpick__empty{
  padding:12px;color:var(--muted);font-size:13px;
}
.lawpick__selected{
  display:flex;align-items:center;gap:8px;
  padding:8px 10px;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:12px;
}
.lawpick__label{
  flex:1;font-size:13.5px;font-weight:600;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.lawpick__clear{
  flex:0 0 auto;width:32px;height:32px;
  border:0;border-radius:8px;background:transparent;
  color:var(--muted);font-size:20px;line-height:1;cursor:pointer;
  position:relative;z-index:2;
  -webkit-tap-highlight-color:rgba(0,0,0,.06);
  touch-action:manipulation;
}
.lawpick__clear:active{background:#fff;color:var(--ink)}

/* ---------- scroll area ---------- */
.scroll{
  flex:1 1 auto;
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  padding:16px;
  padding-bottom:24px;
}
.scroll--paper{background:#f4f4f6}

/* ---------- welcome ---------- */
.welcome{padding:8px 4px 18px}
.welcome h1{font-size:26px;line-height:1.18;font-weight:700;margin:0 0 12px;letter-spacing:-.02em}
.welcome p{margin:0;color:var(--muted);font-size:14.5px;line-height:1.5;max-width:88%}

/* ---------- page head ---------- */
.page-head{padding:6px 2px 18px}
.page-head__title{font-size:30px;font-weight:700;margin:0 0 6px;letter-spacing:-.02em}
.page-head__sub{margin:0;color:var(--muted);font-size:14.5px}

/* ---------- chat ---------- */
.proc-status{
  flex:0 0 auto;
  text-align:center;
  color:var(--muted);
  font-size:13px;
  line-height:1.35;
  padding:8px 16px;
  min-height:20px;
  border-bottom:1px solid var(--line);
  background:rgba(255,255,255,.94);
}
.proc-status[hidden]{display:none!important;border-bottom:none;padding:0;min-height:0}

.chat{display:flex;flex-direction:column;gap:14px;padding:4px 0 8px}
.chat[hidden]{display:none!important}

/* ---------- asistenta režīms (kopīgais modulis) ---------- */
/* `asistents-ui.css` krāsas ņem no mainīgajiem — appā tie ir citi, tāpēc te
   moduļa apakškokam padodam tos pašus, kas `/legal` lapā. */
/* `--surface` apzināti nav definēts — `/legal` lapā tā arī nav, un `.msg-dl`
   fons tur paliek caurspīdīgs; definējot to, app izskatītos citādi nekā `/legal`. */
.asist-ui{
  --panel:#ffffff;
  --surface-2:#f8fafc;
  --border:#e3e8ef;
  --line-strong:#d5dce6;
  --muted:#687387;
  --text:#172033;
  --accent:#1d4ed8;
  --accent-2:#1e40af;
  --accent-soft:#eef4ff;
  --gold:#9a6700;
  --radius:12px;
  --shadow-sm:0 1px 2px rgba(16,24,40,.05);
  color:var(--text);
  font-size:14.5px;
  padding:4px 0 8px;
}
.asist-ui[hidden]{display:none!important}

.asist-notice{
  margin:0 0 12px;padding:10px 12px;
  border:1px solid #e3e8ef;border-radius:10px;
  background:#f8fafc;color:#687387;font-size:13.5px;line-height:1.5;
}
.asist-notice a{color:#1d4ed8}
.asist-notice[hidden]{display:none!important}
.msg{max-width:84%;min-width:0;display:flex;flex-direction:column;gap:6px}
.msg__bubble{
  padding:12px 14px;border-radius:18px;font-size:14.5px;line-height:1.5;
  white-space:pre-wrap;word-wrap:break-word;overflow-wrap:anywhere;
  word-break:break-word;max-width:100%;min-width:0;
}
.msg__time{font-size:11px;color:var(--muted-2)}
.msg--user{align-self:flex-end;align-items:flex-end}
.msg--user .msg__bubble{background:var(--dark);color:#fff;border-bottom-right-radius:6px}
.msg--ai{align-self:flex-start}
.msg--ai .msg__bubble{background:transparent;color:var(--ink);padding:2px 0;border-radius:0}
.msg__ava{
  width:26px;height:26px;border-radius:7px;flex:0 0 auto;margin-bottom:2px;
  background:var(--dark) url("./icons/icon.svg") center/120% no-repeat;
}
.msg:has(.msg__choices){max-width:100%}
.msg__choices{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:12px;width:100%;max-width:100%}
.msg__choice{
  font:inherit;font-size:15px;font-weight:600;color:#1a1a1a;
  flex:0 1 calc(50% - 5px);min-width:120px;max-width:240px;
  display:flex;align-items:center;justify-content:center;text-align:center;
  background:#fff;border:1.5px solid #1a1a1a;border-radius:10px;
  padding:13px 18px;cursor:pointer;line-height:1.25;transition:background .15s,color .15s
}
.msg__choice:hover{background:#1a1a1a;color:#fff}
.msg__choice:active{transform:translateY(1px)}
.msg__docactions{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0 4px 40px;width:calc(100% - 40px)}
.msg__action{
  display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:0 14px;
  border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink);
  font-size:13.5px;font-weight:600;cursor:pointer
}
.msg__action--primary{background:var(--dark);color:#fff;border-color:var(--dark)}
.msg__action--ghost{background:var(--card-2)}
.msg__action:active{opacity:.88;transform:translateY(1px)}
.confirm-gate{
  position:fixed;inset:0;background:rgba(0,0,0,.34);display:grid;place-items:center;
  padding:20px;z-index:60
}
.confirm-gate[hidden]{display:none}
.confirm-card{
  width:min(420px,100%);background:#fff;border-radius:12px;padding:22px 20px 18px;
  box-shadow:0 12px 40px rgba(0,0,0,.14)
}
.confirm-card h3{margin:0 0 8px;font-size:17px;font-weight:700;color:var(--ink)}
.confirm-card p{margin:0 0 18px;font-size:14px;line-height:1.45;color:var(--ink-2)}
.confirm-actions{display:flex;gap:10px;justify-content:flex-end}
.confirm-actions .btn{min-width:88px;height:42px;border-radius:8px;font-size:14px;font-weight:600;cursor:pointer;border:0}
.msg__foot{display:flex;align-items:center;gap:14px;margin-top:2px}
.msg__sources{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;color:var(--ink-2);font-weight:500;background:none;border:0;padding:0;cursor:pointer}
.msg__sources svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.msg__rate{display:inline-flex;gap:12px;margin-left:auto}
.msg__rate button{background:none;border:0;padding:0;cursor:pointer;color:var(--muted)}
.msg__rate button.is-on{color:var(--ink)}
.msg__rate svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}

/* typing dots */
.typing .msg__bubble{display:flex;gap:5px;align-items:center;padding:14px}
.typing span{width:7px;height:7px;border-radius:50%;background:var(--muted-2);animation:blink 1.2s infinite}
.typing span:nth-child(2){animation-delay:.2s}
.typing span:nth-child(3){animation-delay:.4s}
@keyframes blink{0%,60%,100%{opacity:.35}30%{opacity:1}}

/* ---------- composer ---------- */
.composer{
  flex:0 0 auto;
  padding:10px 14px calc(10px + var(--safe-b));
  border-top:1px solid var(--line);
  background:rgba(255,255,255,.94);
  backdrop-filter:saturate(180%) blur(12px);
}
.composer--single{border-top:1px solid var(--line)}
.composer__files{display:none}
.composer__files.has-files{display:flex;flex-wrap:wrap;gap:6px;padding:0 2px 8px}
.filechip{display:inline-flex;align-items:center;gap:6px;max-width:220px;padding:5px 8px;background:var(--card);border:1px solid var(--line);border-radius:10px;font-size:13px;color:var(--ink)}
.filechip svg{flex:0 0 auto;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;color:var(--muted)}
.filechip__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.filechip__x{flex:0 0 auto;border:0;background:transparent;color:var(--muted);font-size:18px;line-height:1;cursor:pointer;padding:0 2px}
.filechip__x:active{color:var(--ink)}
/* Sagatavota dokumenta lejupielādes poga čatā */
.msg__doc{margin:8px 0 2px 40px}
.msg__dl{display:inline-flex;align-items:center;gap:7px;padding:9px 14px;background:var(--dark);color:#fff;border-radius:8px;font-size:14px;font-weight:600;text-decoration:none}
.msg__dl svg{fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.msg__dl:active{opacity:.88}
.litem__dl{flex:0 0 auto;fill:none;stroke:var(--muted);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
/* Ievades rinda: viens rāmis, pogas iekšā (tā pati forma, kas `/legal` lapā) */
.composer__field{
  display:flex;align-items:center;gap:6px;
  border:1px solid var(--line);background:var(--card);
  border-radius:12px;padding:5px 6px 5px 14px;
}
/* Ar pielikuma pogu kreisajā pusē teksta atkāpe nāk no pašas pogas */
.composer__field--ar-pielikumu{padding-left:6px}
.composer__field:focus-within{border-color:var(--muted-2);background:#fff}
/* Pielikuma poga — tā pati ģeometrija, kas sūtīšanas pogai otrā galā */
.composer__attach{
  flex:0 0 auto;width:34px;height:34px;border:0;border-radius:8px;
  display:grid;place-items:center;background:transparent;color:var(--muted);
  cursor:pointer;transition:color .15s ease;
}
.composer__attach:active{color:var(--accent)}
.composer__attach svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.composer__field input{
  flex:1;min-width:0;height:34px;border:0;background:transparent;
  padding:0;font-size:14.5px;color:var(--ink);outline:none;
}
.composer__field input::placeholder{color:var(--muted)}
/* Izmēri un radius = `/legal` `.action-btn`; tukšs lauks → pelēka kontūra */
.composer__send{
  flex:0 0 auto;width:34px;height:34px;border:0;border-radius:8px;
  display:grid;place-items:center;background:transparent;color:var(--muted);
  cursor:pointer;transition:background .15s ease,color .15s ease;
}
.composer__field.has-text .composer__send{background:var(--accent);color:#fff}
.composer__field.has-text .composer__send:active{background:var(--accent-2)}
.composer__send svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
/* Apturēšana — tā pati ģeometrija, kas sūtīšanas pogai; redzama tikai gaidot */
.composer__stop{
  flex:0 0 auto;width:34px;height:34px;border:0;border-radius:8px;
  display:grid;place-items:center;background:var(--accent);color:#fff;
  cursor:pointer;transition:background .15s ease;
}
.composer__stop:active{background:var(--accent-2)}
.composer__stop svg{width:19px;height:19px;fill:currentColor;stroke:none;pointer-events:none}

/* ---------- buttons ---------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  border:0;border-radius:var(--radius-sm);font-size:15px;font-weight:600;
  cursor:pointer;padding:0 18px;height:46px;font-family:inherit;
}
.btn--primary{background:var(--dark);color:#fff}
.btn--primary:active{opacity:.88}
.btn--block{width:100%}
.btn--lg{height:52px;font-size:15.5px}
.btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* ---------- big card (new chat) ---------- */
.bigcard{
  width:100%;display:flex;flex-direction:column;align-items:center;gap:6px;
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
  padding:26px 18px;cursor:pointer;margin-bottom:26px;font-family:inherit;
}
.bigcard:active{background:var(--card-2)}
.bigcard__icon{width:48px;height:48px;border-radius:14px;background:var(--dark);color:#fff;display:grid;place-items:center;margin-bottom:4px}
.bigcard__icon svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.bigcard__title{font-size:16px;font-weight:600;color:var(--ink)}
.bigcard__sub{font-size:13px;color:var(--muted)}

/* ---------- section title ---------- */
.section-title{font-size:13px;font-weight:600;color:var(--muted);text-transform:none;margin:0 2px 12px;letter-spacing:.01em}
.section-title--top{margin-top:4px}

/* ---------- lists ---------- */
.list{display:flex;flex-direction:column;gap:10px}
.litem{
  display:flex;align-items:center;gap:13px;width:100%;text-align:left;
  background:var(--card);border:1px solid var(--line);border-radius:14px;
  padding:14px;cursor:pointer;font-family:inherit;color:var(--ink);
}
.litem:active{background:var(--card-2)}
.litem__icon{width:40px;height:40px;flex:0 0 auto;border-radius:11px;background:#eceef1;display:grid;place-items:center;color:var(--ink-2)}
.litem__icon svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.litem__body{flex:1;min-width:0;display:flex;flex-direction:column}
.litem__title{font-size:14.5px;font-weight:600;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.litem__sub{font-size:12.5px;color:var(--muted);margin-top:3px}
.litem__meta{font-size:12px;color:var(--muted-2);flex:0 0 auto}
.chev{flex:0 0 auto;width:8px;height:8px;border-right:2px solid var(--muted-2);border-top:2px solid var(--muted-2);transform:rotate(45deg)}
.emptyhint{font-size:13.5px;color:var(--muted);padding:14px 2px;text-align:center}

/* ---------- search ---------- */
.search{display:flex;align-items:center;gap:10px;background:var(--card);border:1px solid var(--line);border-radius:12px;padding:0 14px;height:44px;margin-bottom:20px}
.search svg{width:18px;height:18px;flex:0 0 auto;fill:none;stroke:var(--muted);stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.search input{flex:1;border:0;background:transparent;outline:none;font-size:14.5px;color:var(--ink);font-family:inherit}
.search input::placeholder{color:var(--muted)}

/* ---------- profile ---------- */
.profile-head{display:flex;align-items:center;gap:14px;padding:6px 2px 22px}
.avatar{width:62px;height:62px;border-radius:50%;background:#e7e9ed;color:var(--ink-2);display:grid;place-items:center;font-size:20px;font-weight:700;flex:0 0 auto}
.profile-head__name{font-size:18px;font-weight:700}
.profile-head__email{font-size:13px;color:var(--muted);margin-top:2px}
.badge{display:inline-flex;align-items:center;gap:5px;margin-top:8px;font-size:11.5px;font-weight:600;color:var(--ink-2);background:var(--card);border:1px solid var(--line);border-radius:999px;padding:4px 10px}
.badge svg{width:12px;height:12px;fill:currentColor;stroke:none}

.balance-card{position:relative;background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:18px;margin-bottom:24px}
.balance-card__label{font-size:13px;font-weight:600;color:var(--ink-2)}
.balance-card__hint{position:absolute;top:18px;right:18px;font-size:12px;color:var(--muted)}
.balance-card__amount{font-size:32px;font-weight:700;letter-spacing:-.02em;margin:6px 0 16px}
.balance-card .btn{justify-content:space-between}

.menu{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}
.menu__item{display:flex;align-items:center;width:100%;background:transparent;border:0;border-bottom:1px solid var(--line);padding:15px 16px;font-size:14.5px;font-weight:500;color:var(--ink);cursor:pointer;font-family:inherit;text-align:left}
.menu__item span{flex:1}
.menu__item:last-child{border-bottom:0}
.menu__item:active{background:var(--card-2)}
.menu__item--danger{color:var(--danger)}
.menu__item--danger .chev{border-color:var(--danger)}

.footer-brand{text-align:center;padding:28px 0 8px;opacity:.6}
.footer-brand .brand{flex-direction:column;gap:6px}
.footer-brand__ver{font-size:11px;color:var(--muted);margin-top:10px}

/* ---------- topup ---------- */
.amounts{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:26px}
.chip{height:48px;border:1px solid var(--line);background:var(--card);border-radius:12px;font-size:15px;font-weight:600;color:var(--ink);cursor:pointer;font-family:inherit}
.chip:active{background:var(--card-2)}
.chip.is-selected{border-color:var(--dark);background:#fff;box-shadow:inset 0 0 0 1px var(--dark)}

.paylist{display:flex;flex-direction:column;gap:10px;margin-bottom:24px}
.payopt{display:flex;align-items:center;gap:12px;background:var(--card);border:1px solid var(--line);border-radius:12px;padding:15px 16px;cursor:pointer;font-family:inherit;width:100%;text-align:left}
.payopt:active{background:var(--card-2)}
.payopt__radio{width:20px;height:20px;border-radius:50%;border:2px solid var(--muted-2);flex:0 0 auto;position:relative}
.payopt.is-selected .payopt__radio{border-color:var(--dark)}
.payopt.is-selected .payopt__radio::after{content:"";position:absolute;inset:3px;border-radius:50%;background:var(--dark)}
.payopt__label{flex:1;font-size:14.5px;font-weight:500}
.payopt__tag{font-size:11px;font-weight:700;color:var(--ink-2);background:#e7e9ed;border-radius:6px;padding:3px 8px}

.fineprint{font-size:12px;color:var(--muted);text-align:center;margin:16px 4px 0;line-height:1.5}
.fineprint a{color:var(--ink-2);text-decoration:underline}

/* ---------- documents dropzone ---------- */
.dropzone{width:100%;display:flex;flex-direction:column;align-items:center;gap:8px;background:var(--card);border:1.5px dashed var(--muted-2);border-radius:var(--radius);padding:30px 18px;cursor:pointer;font-family:inherit;text-align:center}
.dropzone:active{background:var(--card-2)}
.dropzone__icon{width:46px;height:46px;border-radius:12px;background:#eceef1;color:var(--ink-2);display:grid;place-items:center;margin-bottom:4px}
.dropzone__icon svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.dropzone__title{font-size:14px;font-weight:600;color:var(--ink)}
.dropzone__sub{font-size:12px;color:var(--muted);line-height:1.5;max-width:80%}

/* ---------- docview paper ---------- */
.paper{background:#fff;border-radius:10px;box-shadow:0 4px 20px rgba(0,0,0,.06);padding:26px 24px;font-size:13px;line-height:1.65;color:#222}
.paper__title{text-align:center;font-size:17px;font-weight:700;letter-spacing:.04em;margin:0 0 4px}
.paper__place{text-align:center;color:var(--muted);margin:0;font-size:12px}
.paper__date{margin:14px 0 18px;font-size:12.5px}
.paper__h{font-weight:700;margin:16px 0 4px;font-size:13px}
.paper p{margin:0 0 4px}
.paper__more{color:var(--muted);font-size:18px;letter-spacing:2px}
.pageno{text-align:center;color:var(--muted);font-size:12px;padding:14px 0 4px}

.docbar{flex:0 0 auto;display:flex;border-top:1px solid var(--line);background:#fff;padding-bottom:var(--safe-b)}
.docbar__btn{flex:1;display:flex;align-items:center;justify-content:center;gap:8px;background:transparent;border:0;padding:15px;font-size:14px;font-weight:500;color:var(--ink);cursor:pointer;font-family:inherit}
.docbar__btn:first-child{border-right:1px solid var(--line)}
.docbar__btn:active{background:var(--card)}
.docbar__btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* ---------- history groups ---------- */
.histgroup{margin-bottom:22px}
.histgroup__title{font-size:13px;font-weight:600;color:var(--muted);margin:0 2px 12px}
.histitem{display:flex;align-items:center;gap:12px;width:100%;background:transparent;border:0;border-bottom:1px solid var(--line);padding:13px 2px;cursor:pointer;font-family:inherit;text-align:left;color:var(--ink)}
.histitem:active{opacity:.6}
.histitem__icon{width:20px;height:20px;flex:0 0 auto;color:var(--muted)}
.histitem__icon svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.histitem__title{flex:1;font-size:14.5px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.histitem__time{font-size:12.5px;color:var(--muted-2);flex:0 0 auto}

/* ---------- drawer ---------- */
.drawer-overlay{
  position:fixed;inset:0;background:rgba(0,0,0,.32);
  opacity:0;visibility:hidden;pointer-events:none;
  transition:opacity .25s,visibility .25s;z-index:90
}
.drawer-overlay.is-open{opacity:1;visibility:visible;pointer-events:auto}
.drawer{
  position:fixed;top:0;left:0;bottom:0;width:80%;max-width:320px;
  background:#fff;z-index:100;transform:translateX(-100%);
  transition:transform .28s cubic-bezier(.22,.61,.36,1);
  display:flex;flex-direction:column;
  padding-top:var(--safe-t);padding-bottom:var(--safe-b);
  box-shadow:2px 0 30px rgba(0,0,0,.12);
  pointer-events:none;
  visibility:hidden;
}
.drawer.is-open{
  transform:translateX(0);
  pointer-events:auto;
  visibility:visible;
}
.drawer__head{display:flex;align-items:center;justify-content:space-between;padding:16px 14px 16px 18px;border-bottom:1px solid var(--line)}
.drawer__links{flex:1;padding:12px 10px;display:flex;flex-direction:column;gap:2px;overflow-y:auto}
.drawer__foot{padding:10px;border-top:1px solid var(--line)}
.drawer__link{
  display:flex;align-items:center;gap:14px;width:100%;background:transparent;border:0;
  padding:14px 14px;border-radius:12px;font-size:15px;font-weight:500;color:var(--ink);
  cursor:pointer;font-family:inherit;text-align:left;
  -webkit-tap-highlight-color:rgba(0,0,0,.06);touch-action:manipulation;
  position:relative;z-index:2;
}
.drawer__link:active{background:var(--card)}
.drawer__link svg{width:21px;height:21px;flex:0 0 auto;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.drawer__link--danger{color:var(--danger)}

/* file input: ārpus ekrāna — NEDRĪKST left:0/top:0 (native file UI pārklāj menu) */
.sr-only{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  padding:0 !important;
  margin:-1px !important;
  overflow:hidden !important;
  clip:rect(0,0,0,0) !important;
  white-space:nowrap !important;
  border:0 !important;
  left:-10000px !important;
  top:auto !important;
  opacity:0 !important;
}

/* ---------- toast ---------- */
.toast{
  position:fixed;left:50%;bottom:calc(28px + var(--safe-b));transform:translateX(-50%) translateY(20px);
  background:var(--dark);color:#fff;font-size:13.5px;font-weight:500;
  padding:12px 20px;border-radius:999px;z-index:60;
  opacity:0;visibility:hidden;transition:opacity .25s,transform .25s,visibility .25s;
  max-width:88%;text-align:center;box-shadow:0 10px 30px rgba(0,0,0,.25);
}
.toast.is-show{opacity:1;visibility:visible;transform:translateX(-50%) translateY(0)}

/* ===================== LOGIN GATE ===================== */
.login-gate{
  position:fixed;inset:0;z-index:200;display:flex;align-items:center;justify-content:center;
  background:#e9e9ec;padding:24px;
  padding-top:calc(24px + var(--safe-t));padding-bottom:calc(24px + var(--safe-b));
}
.login-card{
  width:100%;max-width:360px;background:var(--bg);border:1px solid var(--line);
  border-radius:var(--radius);padding:32px 24px;text-align:center;
  box-shadow:0 8px 28px rgba(0,0,0,.10);
}
.login-logo{height:34px;width:auto;margin:0 auto 20px;display:block}
.login-card h2{margin:0 0 6px;font-size:20px;font-weight:700;color:var(--ink)}
.login-card p{margin:0 0 24px;font-size:14px;color:var(--muted)}
.login-google{
  display:flex;align-items:center;justify-content:center;gap:10px;width:100%;
  padding:13px 16px;border:1px solid var(--line);border-radius:8px;background:var(--bg);
  color:var(--ink);font-size:14px;font-weight:600;text-decoration:none;
  transition:background .15s;
}
.login-google:active{background:var(--card)}

/* ===================== RĒĶINI / FORMAS / IESTATĪJUMI ===================== */
/* ---------- form fields ---------- */
.field{display:flex;flex-direction:column;margin-bottom:14px}
.field__label{font-size:12.5px;font-weight:600;color:var(--ink-2);margin:0 2px 6px}
.field__input{
  width:100%;height:48px;border:1px solid var(--line);background:var(--card);
  border-radius:12px;padding:0 14px;font-size:14.5px;color:var(--ink);outline:none;
  font-family:inherit;-webkit-appearance:none;appearance:none;
}
select.field__input{background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a9099' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");background-repeat:no-repeat;background-position:right 14px center;background-size:16px;padding-right:38px}
.field__input::placeholder{color:var(--muted)}
.field__input:focus{border-color:var(--muted-2);background:#fff}
.field__input.is-invalid{border-color:var(--danger)}
.field__err{font-size:12px;color:var(--danger);margin:6px 2px 0;min-height:0;display:none}
.field__err.is-show{display:block}

/* ---------- toggle switch ---------- */
.switchrow{display:flex;align-items:center;gap:14px;background:var(--card);border:1px solid var(--line);border-radius:12px;padding:14px 16px;margin-bottom:12px}
.switchrow__label{flex:1;font-size:14px;font-weight:500;color:var(--ink);line-height:1.35}
.switch{flex:0 0 auto;width:50px;height:30px;border-radius:999px;border:0;background:var(--muted-2);position:relative;cursor:pointer;transition:background .2s;padding:0}
.switch__knob{position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:transform .2s}
.switch.is-on{background:var(--dark)}
.switch.is-on .switch__knob{transform:translateX(20px)}

/* ---------- invoice summary (topup) ---------- */
.invoice-summary{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:14px 16px;margin-bottom:20px}
.invoice-summary__row{display:flex;justify-content:space-between;gap:12px;font-size:13.5px;padding:4px 0}
.invoice-summary__row span:first-child{color:var(--muted)}
.invoice-summary__row span:last-child{font-weight:600;text-align:right}
.invoice-summary__link{display:inline-block;margin-top:8px;font-size:13px;font-weight:600;color:var(--ink-2);text-decoration:underline;background:none;border:0;padding:0;cursor:pointer;font-family:inherit}
.invoice-summary__missing{font-size:13.5px;color:var(--ink-2);margin:0 0 12px}
.invoice-note{font-size:12.5px;color:var(--muted);text-align:center;margin:12px 4px 0;line-height:1.5}

/* ---------- payment / invoice cards ---------- */
.pcard{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:14px 16px;margin-bottom:12px}
.pcard__top{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.pcard__amount{font-size:16px;font-weight:700}
.pcard__date{font-size:12.5px;color:var(--muted);margin-top:2px}
.pcard__meta{font-size:12.5px;color:var(--muted);margin-top:6px;line-height:1.5}
.pcard__meta b{color:var(--ink-2);font-weight:600}
.pcard__actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.istatus{display:inline-flex;align-items:center;gap:6px;font-size:11.5px;font-weight:600;padding:4px 10px;border-radius:999px;white-space:nowrap}
.istatus::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
.istatus--none{color:var(--muted);background:#eceef1}
.istatus--gen{color:#9a6b00;background:#fdf2d8}
.istatus--ok{color:#1d7a45;background:#e2f3e8}
.istatus--fail{color:var(--danger);background:#fbe6e4}
.btn--sm{height:38px;padding:0 14px;font-size:13px;border-radius:9px}
.btn--ghost{background:var(--card-2);color:var(--ink);border:1px solid var(--line)}
.btn--ghost:active{background:#e7e9ed}
.chat-stop-wrap{display:flex;justify-content:center;margin:6px 0 10px}
.chat-stop{appearance:none;border:1px solid var(--danger);background:#fff;color:var(--danger);font-weight:600;font-size:13px;padding:8px 16px;border-radius:8px;cursor:pointer;transition:background .15s ease}
.chat-stop:hover{background:#fbe6e4}
.chat-stop:active{background:#f6d6d3}

/* ===================== DESKTOP / WEB (≥768px) ===================== */
@media (min-width:768px){
  body{background:#e9e9ec}

  #app{
    max-width:960px;
    width:100%;
    margin:0 auto;
    box-shadow:0 0 40px rgba(0,0,0,.08);
  }

  .topbar{padding-left:20px;padding-right:20px}
  .scroll{padding:24px 28px 32px}
  .composer{padding:12px 28px calc(12px + var(--safe-b))}
  .proc-status{padding-left:28px;padding-right:28px}

  .welcome h1{font-size:32px}
  .welcome p{max-width:560px;font-size:15px}
  .page-head__title{font-size:34px}

  .msg{max-width:min(78%,640px)}
  .msg__choices{justify-content:flex-start}
  .msg__choice{flex:0 1 auto;max-width:none;min-width:140px}

  .amounts{grid-template-columns:repeat(4,1fr);max-width:640px}
}
