/* ===== FIS H5 mobile client ===== */
#app { min-height: 100vh; }

.phone {
  max-width: 480px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;               /* fixed app shell: header + tabbar stay put */
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* ---------- Login ---------- */
.login {
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 26px;
  background: var(--bg);
}
.login .brand {
  text-align: center;
  margin-bottom: 6px;
}
.login .brand .wordmark {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--accent);
  line-height: 1;
}
.login .brand .sub {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 3px;
}
.login h1 {
  text-align: center;
  color: var(--text);
  font-size: 24px;
  margin: 22px 0 24px;
  font-weight: 700;
}
.field {
  margin-bottom: 12px;
}
.field input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 11px;
  border: 1.5px solid var(--border);
  background: var(--input-bg);
  color: var(--input-ink);
  font-size: 16px;
  outline: none;
}
.field input::placeholder { color: #9aa9b8; }
.login .forgot { text-align: right; color: var(--accent); font-size: 13px; margin: 2px 2px 16px; }
.btn-primary {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 28px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 18px;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.btn-primary:active { transform: translateY(1px); }
.login .foot { text-align: center; margin-top: 20px; color: var(--text-muted); font-size: 14px; }
.login .foot a { font-weight: 700; }
.err { color: var(--danger); text-align: center; margin: 8px 0; font-size: 13px; min-height: 16px; }
.ok { color: var(--pos); text-align: center; margin: 8px 0; font-size: 13px; min-height: 16px; }

/* ---------- Header ---------- */
.hdr {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 8px;
  color: var(--accent);
}
.hdr .burger {
  font-size: 22px;
  color: var(--accent);
  background: none; border: none; padding: 0; line-height: 1;
}
.hdr .title { font-size: 21px; font-weight: 800; color: var(--accent); flex: 1; }
.hdr .lang {
  border: 1.5px solid var(--accent);
  color: var(--accent);
  background: transparent;
  border-radius: 18px;
  padding: 4px 12px;
  font-weight: 700;
  font-size: 13px;
}

/* ---------- View / scroll area ---------- */
.view {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 14px 14px;
}

/* ---------- Cards / panels ---------- */
.panel {
  background: var(--panel);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}
.wcard {
  background: var(--card);
  color: var(--card-ink);
  border-radius: 12px;
  padding: 12px 14px;
}
.muted { color: var(--text-muted); }
.center { text-align: center; }

/* ---------- Global rates ---------- */
.panel .panel-title { color: var(--text); font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.rates-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rate-chip {
  flex: 1;
  background: var(--rate-chip);
  color: var(--card-ink);
  border-radius: 10px;
  padding: 9px 8px;
  text-align: left;
}
.rate-chip .ccy { font-size: 14px; font-weight: 700; }
.rate-chip .val { font-size: 14px; margin-top: 3px; }

/* ---------- Sector chips ---------- */
.section-head {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; color: var(--text); font-weight: 700; font-size: 15px; margin: 4px 2px 8px;
  width: 100%; background: none; border: none; padding: 2px 2px; font-family: inherit;
}
.section-head .chev { color: var(--accent); font-size: 14px; line-height: 1; }
.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.chip {
  border: 1.5px solid var(--accent);
  color: var(--text);
  background: transparent;
  border-radius: 20px;
  padding: 8px 6px;
  font-size: 14px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip.active { background: var(--accent); color: var(--accent-ink); font-weight: 700; }

/* ---------- Bond quote list ---------- */
.list-title { color: var(--accent); font-size: 18px; font-weight: 800; margin: 4px 0 8px; }
.quote {
  border-bottom: 1px solid var(--divider);
  padding: 11px 0;
}
.quote .qrow { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 10px; align-items: center; }
.quote .qcol-name { min-width: 0; }
.quote .qcol-m { text-align: right; }
.quote .qname { color: var(--text); font-weight: 800; font-size: 16px; line-height: 1.2; }
.quote .qsub { color: var(--text-muted); font-size: 13px; font-weight: 800; margin-top: 2px; }
.quote .qlabel { color: var(--text-muted); font-size: 12px; }
.quote .qval { color: var(--text); font-weight: 700; font-size: 14px; margin-top: 1px; }

/* ---------- Summary (assets/interest/income) ---------- */
.hero { text-align: center; }
.hero .hero-label { color: var(--text); font-size: 16px; }
.hero .hero-value { color: var(--text); font-size: 28px; font-weight: 800; margin: 4px 0 12px; }
.hero-2 { display: flex; gap: 10px; }
.hero-2 .wcard { flex: 1; }
.hero-2 .big { font-size: 18px; font-weight: 800; }
.hero-2 .big.loan { color: var(--card-muted); }
.wcard.rate-bg { background: var(--rate-chip); }
.hero-2 .lbl { font-size: 13px; color: var(--card-muted); margin-top: 3px; }

.asset-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.asset-nav { flex: 1; padding-left: 14px; }
.asset-nav .nav-l { color: var(--text); font-size: 15px; }
.asset-nav .nav-v { color: var(--text); font-size: 24px; font-weight: 800; }
.asset-ratio { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; }
.asset-ratio .nav-l { color: var(--text); font-size: 14px; }
.donut { position: relative; width: 56px; height: 56px; flex-shrink: 0; }
.donut svg { transform: rotate(-90deg); }
.donut .pct {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-weight: 800; font-size: 13px;
}

/* segmented toggle */
.seg {
  display: flex; border: 1.5px solid var(--accent); border-radius: 24px; overflow: hidden;
  margin: 12px 0; background: transparent;
}
.seg button {
  flex: 1; padding: 10px 6px; border: none; background: transparent;
  color: var(--text-muted); font-size: 15px; font-weight: 700;
}
.seg button.active { background: var(--accent); color: var(--accent-ink); border-radius: 24px; }

/* period selector */
.period {
  display: flex; border: 1.5px solid var(--accent); border-radius: 24px; overflow: hidden;
}
.period button {
  flex: 1; padding: 9px 2px; border: none; background: transparent;
  color: var(--text); font-size: 14px; font-weight: 600;
}
.period button.active { background: var(--accent); color: var(--accent-ink); border-radius: 24px; font-weight: 800; }

/* holdings / ledger rows */
.row-line {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--divider);
}
.row-line .rl-name { color: var(--text); font-weight: 800; font-size: 16px; }
.row-line .rl-sub { color: var(--text-muted); font-size: 13px; font-weight: 800; margin-top: 2px; }
.row-line .rl-mid { color: var(--text); text-align: center; font-size: 14px; }
.row-line .rl-ccy { color: var(--text); font-size: 14px; }
.row-line .rl-amt { color: var(--text); font-weight: 800; font-size: 16px; text-align: right; }
.rl-amt.neg { color: #ff8a80; }
.rl-amt.pos { color: #86e0ad; }
.rl-amt.loan { color: var(--card-muted); }

/* ledger record (income/interest) — fixed columns: name (flex) | currency | amount */
.rec { display: grid; grid-template-columns: 1fr 46px 104px; align-items: center; column-gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--divider); }
.rec > div:first-child { min-width: 0; }
.rec .rec-type { color: var(--text); font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec .rec-date { color: var(--text-muted); font-size: 12px; margin-top: 1px; }
.rec .rec-ccy { color: var(--text); font-size: 15px; text-align: center; }
.rec .rec-amt { color: var(--text); font-weight: 800; font-size: 16px; text-align: right; }
.rec .rec-amt.neg { color: var(--card-muted); }   /* lighter tone for negative (expense) values */

/* date range cards */
.range { display: flex; gap: 10px; margin-top: 10px; }
.range .wcard { flex: 1; }
.range .r-lbl { font-size: 16px; color: var(--card-ink); }
.range .r-val { font-size: 17px; font-weight: 800; color: var(--card-ink); margin-top: 6px; }
.range input[type="date"] {
  border: none; background: transparent; color: var(--card-ink);
  font-size: 16px; font-weight: 700; width: 100%; padding: 0; outline: none;
}

/* settings */
.settings-label { color: var(--text); font-size: 16px; margin: 6px 2px 8px; }
.card-form { background: var(--card); border-radius: 14px; padding: 18px; }
.card-form .settings-label { color: var(--card-ink); }
.card-form input {
  width: 100%; padding: 12px 14px; border: 1.5px solid #cdd8e2; border-radius: 10px;
  font-size: 16px; margin-bottom: 14px; color: #14304d; background: #fff;
}

/* ---------- Bottom tab bar ---------- */
.tabbar {
  flex-shrink: 0;
  display: flex; background: var(--tabbar-bg);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 14px rgba(0,0,0,0.18);
}
.tabbar button {
  flex: 1; border: none; background: none; color: var(--tabbar-inactive);
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 3px 2px;
  font-size: 11px; font-weight: 700;
}
.tabbar button.active { color: var(--tabbar-ink); }
.tabbar svg { width: 24px; height: 24px; }

.empty { text-align: center; color: var(--text-muted); padding: 32px 0; }
.spin { text-align: center; color: var(--text-muted); padding: 24px 0; }
