/* Styles, part 1 of 8 (order matters: later rules win). Sections: Layout, header. */
/* Layout: single-column phone ledger, sticky month header, bottom tab bar, sheets slide up from the bottom */
:root {
  --bg: #f2f4ef;
  --surface: #ffffff;
  --sunk: #e6eae3;
  --ink: #17201c;
  --muted: #5b6962;
  --line: #d3dad1;
  --accent: #1d6a50;
  --accent-ink: #ffffff;
  --accent-soft: #dbeae2;
  --plan: #2b5797;
  --plan-soft: #e2eaf6;
  --num: #1e4a86;
  --bal: #7a4fa0;
  --pos: #1f7a4a;
  --neg: #b2452d;
  --neg-soft: #f5e0d9;
  --warn: #9a6210;
  --warn-soft: #f5e7cc;
  --scrim: rgba(15, 22, 19, 0.45);
  --f-display: "Readex Pro", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --f-body: "IBM Plex Sans Arabic", "Readex Pro", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --r: 14px;
  --nav-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1513;
    --surface: #18201d;
    --sunk: #212b27;
    --ink: #e6eee9;
    --muted: #9aaba2;
    --line: #2c3833;
    --accent: #5fbf98;
    --accent-ink: #0b1712;
    --accent-soft: #1c3229;
    --plan: #8db2ec;
    --plan-soft: #1a2436;
    --num: #9ec3f2;
    --bal: #c9a6ec;
    --pos: #62c890;
    --neg: #ef8a70;
    --neg-soft: #3a221b;
    --warn: #e3b05a;
    --warn-soft: #382c15;
    --scrim: rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1513;
  --surface: #18201d;
  --sunk: #212b27;
  --ink: #e6eee9;
  --muted: #9aaba2;
  --line: #2c3833;
  --accent: #5fbf98;
  --accent-ink: #0b1712;
  --accent-soft: #1c3229;
  --plan: #8db2ec;
  --plan-soft: #1a2436;
  --num: #9ec3f2;
  --bal: #c9a6ec;
  --pos: #62c890;
  --neg: #ef8a70;
  --neg-soft: #3a221b;
  --warn: #e3b05a;
  --warn-soft: #382c15;
  --scrim: rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html {
  color-scheme: light;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
body {
  margin: 0;
}
img {
  max-width: 100%;
}
[hidden] {
  display: none !important;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--bg);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
.num {
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
}
.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* header */
.top {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 10px;
}
.brand {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  cursor: pointer;
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand::after {
  content: " ▾";
  font-size: 12px;
  color: var(--muted);
}
.top.shared {
  background: var(--accent-soft);
}
.top.shared .brand {
  color: var(--accent);
}
.month {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
}
.month span,
.perbtn {
  min-width: 96px;
  text-align: center;
  font-weight: 500;
  font-size: 14px;
}
.perbtn {
  border: 0;
  background: none;
  cursor: pointer;
  padding: 4px 2px;
  white-space: nowrap;
  max-width: 48vw;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
}
.top .wrap > * {
  min-width: 0;
}
.month {
  min-width: 0;
  flex-shrink: 1;
}
main {
  overflow-x: clip;
}
.perbtn:hover {
  color: var(--accent);
}
.iconbtn {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--muted);
}
.iconbtn:hover {
  background: var(--sunk);
  color: var(--ink);
}
[dir="ltr"] .flip {
  transform: scaleX(-1);
}

main {
  padding-bottom: calc(var(--nav-h) + 96px + env(safe-area-inset-bottom, 0px));
}
main .wrap {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-block: 18px;
}

/* Styles, part 2 of 8 (order matters: later rules win). Sections: summary slip, sections, segmented. */
/* summary slip */
.slip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.slip .net {
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.label {
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.01em;
  font-weight: 500;
}
.big {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 34px;
  line-height: 1.15;
}
.big small {
  font-size: 15px;
  font-weight: 400;
  color: var(--muted);
  margin-inline-start: 6px;
}
.perf {
  height: 0;
  border-top: 2px dashed var(--line);
  margin: 0 12px;
}
.slip .split {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.slip .split > div {
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.slip .split > div + div {
  border-inline-start: 1px solid var(--line);
}
.mid {
  font-family: var(--f-display);
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pos {
  color: var(--pos);
}
.neg {
  color: var(--neg);
}
.warn {
  color: var(--warn);
}
.muted {
  color: var(--muted);
}

/* sections */
.sec {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sec-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.sec-h h2 {
  margin: 0;
  font-family: var(--f-display);
  font-size: 17.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.link {
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
}
.list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  min-width: 0;
}
.row + .row {
  border-top: 1px solid var(--line);
}
.row.tap {
  cursor: pointer;
}
.row.tap:hover {
  background: var(--sunk);
}
.row .main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.row .t {
  font-weight: 500;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row .s {
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}
.row .amt {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 15.5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.glyph {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 14px;
  background: var(--sunk);
  color: var(--muted);
}
.glyph.in {
  background: var(--accent-soft);
  color: var(--accent);
}
.empty {
  padding: 22px 16px;
  text-align: center;
  color: var(--muted);
}
.daylbl {
  font-size: 12px;
  color: var(--muted);
  padding: 10px 14px 4px;
  background: var(--bg);
}

.pill {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--sunk);
  color: var(--muted);
  white-space: nowrap;
}
.pill.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.pill.neg {
  background: var(--neg-soft);
  color: var(--neg);
}
.pill.ok {
  background: var(--accent-soft);
  color: var(--accent);
}

.btn {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover {
  background: var(--sunk);
}
.btn.pri {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn.pri:hover {
  filter: brightness(1.07);
}
.btn.sm {
  padding: 5px 12px;
  font-size: 13.5px;
}
.btn.danger {
  color: var(--neg);
  border-color: var(--neg-soft);
}
.btn.block {
  width: 100%;
  padding: 12px;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.banner {
  background: var(--warn-soft);
  color: var(--ink);
  border-radius: var(--r);
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.hint {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

/* segmented */
.seg {
  display: flex;
  background: var(--sunk);
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
}
.seg button {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 8px 6px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.seg button.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* Styles, part 3 of 8 (order matters: later rules win). Sections: obligation cards, reports, nav + fab. */
/* obligation cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card .hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--f-display);
}
.kv {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.kv div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.kv b {
  font-weight: 600;
}
.bar {
  height: 8px;
  border-radius: 99px;
  background: var(--sunk);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}
.bar i.warn {
  background: var(--warn);
}
.bar i.neg {
  background: var(--neg);
}
.acts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* reports */
.catbar {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px 14px;
}
.catbar + .catbar {
  border-top: 1px solid var(--line);
}
.catbar .l {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 15px;
}
.catbar .l > span:last-child {
  font-family: var(--f-display);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pct {
  font-family: var(--f-body);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--sunk);
  border-radius: 999px;
  padding: 1px 7px;
  margin-inline-start: 6px;
}
.cols {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  align-items: end;
  height: 150px;
  padding: 14px 14px 0;
}
.cols .c {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
}
.cols .c i {
  display: block;
  width: 40%;
  max-width: 16px;
  border-radius: 4px 4px 0 0;
  min-height: 2px;
}
.cols .c i.a {
  background: var(--accent);
}
.cols .c i.b {
  background: var(--neg);
}
.btn.block {
  white-space: normal;
  line-height: 1.35;
}
.colsx span {
  overflow: hidden;
  white-space: nowrap;
}
.cmp.h span {
  overflow-wrap: anywhere;
  min-width: 0;
}
.colsx {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 6px 14px 12px;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
}
.legend {
  display: flex;
  gap: 14px;
  font-size: 12.5px;
  color: var(--muted);
  padding: 0 14px 12px;
}
.legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-inline-end: 6px;
  vertical-align: -1px;
  background: var(--c);
}

/* nav + fab */
.nav {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 20;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.nav .in {
  max-width: 560px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: var(--nav-h);
}
.nav button {
  border: 0;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11.5px;
  color: var(--muted);
  cursor: pointer;
}
.nav button.on {
  color: var(--accent);
  font-weight: 600;
}
.nav svg {
  width: 22px;
  height: 22px;
}
.fab {
  position: fixed;
  z-index: 21;
  bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px));
  inset-inline-end: max(18px, calc((100vw - 560px) / 2 + 18px));
  width: 58px;
  height: 58px;
  border-radius: 18px;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(20, 60, 45, 0.28);
}
.fab svg {
  width: 26px;
  height: 26px;
}

/* Styles, part 4 of 8 (order matters: later rules win). Sections: sheet. */
/* sheet */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet .scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
}
.panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 92%;
  overflow: auto;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 6px max(18px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px))
    max(18px, env(safe-area-inset-left, 0px));
  animation: up 0.22s ease-out;
}
@keyframes up {
  from {
    transform: translateY(30px);
    opacity: 0.6;
  }
}
@media (prefers-reduced-motion: reduce) {
  .panel {
    animation: none;
  }
}
.grab {
  width: 40px;
  height: 4px;
  border-radius: 9px;
  background: var(--line);
  margin: 6px auto 8px;
}
.shh {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  position: sticky;
  top: -6px;
  background: var(--surface);
  z-index: 2;
  padding-top: 4px;
}
.panel h3 {
  margin: 0 0 14px;
  font-family: var(--f-display);
  font-size: 18px;
  font-weight: 600;
}
.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fld {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.fld > span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.in-f {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 10px;
  padding: 11px 12px;
  min-width: 0;
}
.in-f.amt {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 600;
}
textarea.in-f {
  min-height: 90px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  direction: ltr;
}
.blk {
  border-radius: 14px;
  padding: 10px 0 2px;
  border: 1px solid var(--line);
  margin: 4px 0;
}
.blk.act {
  background: var(--accent-soft);
  border-color: transparent;
}
.blk.plan {
  background: var(--plan-soft);
  border-color: transparent;
}
.blk-h {
  font-weight: 600;
  font-size: 15px;
  padding: 0 14px 2px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.blk.act .blk-h {
  color: var(--accent);
}
.blk.plan .blk-h {
  color: var(--plan);
}
.blk .flowb {
  border-top: 0;
}
.flowb b {
  white-space: nowrap;
  unicode-bidi: plaintext;
}
.blk .flowb b {
  color: var(--ink);
  font-size: 17px;
}
.blk .flowb b.pos {
  color: var(--accent);
}
.blk .flowb b.neg {
  color: var(--neg);
}
.blk.plan .flowb b:not(.neg) {
  color: var(--plan);
}
.blk details {
  padding: 0 14px 8px;
}
.blk summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  list-style: none;
}
.blk .ln {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  padding: 5px 0;
  border-top: 1px solid var(--line);
}
.blk .ln span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.blk .list {
  margin: 6px 10px 10px;
}
.addrow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.addrow .btn {
  padding-inline: 6px;
  white-space: nowrap;
}
.two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
.two > * {
  min-width: 0;
}
.dwrap {
  position: relative;
  display: block;
  min-width: 0;
}
.dwrap .dshow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 44px;
  white-space: nowrap;
  overflow: hidden;
}
.dwrap .dshow::after {
  content: "📅";
  font-size: 14px;
  opacity: 0.6;
}
.dwrap > input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
input[type="date"].in-f,
input[type="month"].in-f,
input[type="time"].in-f {
  min-width: 0;
  max-width: 100%;
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
  text-align: start;
}
.flowb {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 10px 14px;
  border-top: 1px dashed var(--line);
}
.flowb > div > span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.row .amt:not(.pos):not(.neg),
.flowb b:not(.neg):not(.pos),
.sumline b:not(.pos):not(.neg),
.cmp b:not(.pos):not(.neg) {
  color: var(--num);
}
.balaft {
  color: var(--bal) !important;
  font-weight: 600;
}
.glance {
  background: var(--surface);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--accent);
  border-radius: var(--r);
  padding: 12px 14px;
  margin: 0 0 10px;
  line-height: 1.75;
  font-size: 14.5px;
  cursor: pointer;
}
.glance b {
  font-family: var(--f-display);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.glance .gnum {
  color: var(--num);
}
.glance .gneg {
  color: var(--neg);
}
.glance .gl2 {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
.row.mend {
  background: var(--sunk);
}
.row.mend .t {
  font-weight: 700;
}
.grp.mhead {
  display: flex;
  justify-content: space-between;
}
.balaft b {
  font-variant-numeric: tabular-nums;
}
.flowb b {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.cmp.fc {
  grid-template-columns: minmax(0, 0.9fr) repeat(4, minmax(0, 1fr));
  font-size: 12px;
  padding-inline: 10px;
}

/* Styles, part 5 of 8 (order matters: later rules win). Continues the previous part. */
.cmp {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 4px 8px;
  padding: 8px 14px;
  align-items: center;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.cmp.h {
  font-size: 12px;
  color: var(--muted);
}
.cmp.t {
  font-weight: 600;
}
.cmp b,
.cmp span:not(:first-child) {
  text-align: end;
  font-variant-numeric: tabular-nums;
}
.cmp > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chk {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chk input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.foot {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.foot .grow {
  flex: 1;
}

.toast {
  max-width: min(92vw, 520px);
  text-align: center;
  line-height: 1.6;
  cursor: pointer;
  position: fixed;
  z-index: 60;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-h) + 90px + env(safe-area-inset-bottom, 0px));
  background: var(--ink);
  color: var(--bg);
  padding: 9px 16px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 14px;
}

.setrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  flex-wrap: wrap;
}
.setrow > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.setrow > .btn {
  flex: none;
  margin-inline-start: auto;
}
.setrow.stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.setrow.stack .label {
  font-size: 12.5px;
  color: var(--muted);
}
.setrow + .setrow {
  border-top: 1px solid var(--line);
}
.catrow {
  height: 52px;
  padding: 0 14px;
  box-sizing: border-box;
}
.catrow.sub {
  background: var(--sunk);
  padding-inline-start: 28px;
  height: 44px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 14px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 6px 3px 10px;
  font-size: 13.5px;
}
[dir="rtl"] .chip {
  padding: 3px 10px 3px 6px;
}
.chip button {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  width: 22px;
  height: 22px;
  border-radius: 99px;
}
.chip button:hover {
  background: var(--neg-soft);
  color: var(--neg);
}
.search {
  display: flex;
  gap: 8px;
}
.cur {
  font-size: 0.72em;
  font-weight: 500;
  color: var(--muted);
}
.tblw {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.stmt {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.stmtf {
  gap: 8px;
}
.stmtbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.stmtsum {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 4px !important;
}
.stmtsum > div {
  padding: 6px 8px !important;
  min-width: 0;
}
.stmtsum .label {
  font-size: 10.5px !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.stmtsum b.num {
  font-size: 13px !important;
  white-space: nowrap;
}
.stmtsum small.cur {
  display: none;
}
.stmtf [data-eq] {
  font-size: 11px;
}
.srow .main .t {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.srow .s {
  font-size: 12px;
  white-space: normal;
}
.srow.open {
  background: var(--sunk);
}
.srow.open .amt {
  font-size: 13px;
}
details.box > summary {
  flex-wrap: wrap;
}
.sumline {
  flex-basis: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  align-items: stretch;
}
.sumline > div {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sumline > div + div {
  border-inline-start: 1px solid var(--line);
}
.sumline > div > span {
  display: block;
}
.sumline b {
  display: block;
  font-size: 14px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.sumline small {
  display: block;
  font-size: 11px;
}
#view .list:has(> .cmp.h) .grp {
  top: calc(var(--topH) + 72px);
}
details.box[open] > summary .sumline {
  display: none;
}
.stickbar {
  position: sticky;
  top: var(--topH);
  z-index: 4;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 0;
  margin: -6px 0;
}
#view .daylbl {
  position: sticky;
  top: calc(var(--topH) + var(--stickH, 0px));
  z-index: 1;
}
#privacy {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
}
#privacy[hidden] {
  display: none;
}

/* Styles, part 6 of 8 (order matters: later rules win). Sections: headers stay on screen while you scroll . */
/* headers stay on screen while you scroll through what they head; once scrolled they shrink so the content keeps most of the screen */
body.scr .top .wrap {
  padding-block: 4px;
}
body.scr .stickbar .seg {
  display: none;
}
body.scr .stickbar {
  gap: 4px;
  padding: 4px 0;
}
body.scr .totbar > div {
  padding: 5px 10px;
  gap: 0;
}
body.scr .totbar > div > span {
  font-size: 11px;
}
body.scr .totbar b {
  font-size: 14px;
}
body.scr #view details.box > summary {
  padding: 6px 2px 4px;
}
body.scr #view details.box > summary h2 {
  font-size: 14.5px;
}
body.scr #view details.box > summary .sumline {
  display: none;
}
body.scr #view .grp {
  padding: 5px 14px;
  font-size: 12px;
}
body.scr #view .cmp.h {
  padding-block: 4px;
}
body.scr #view .sec-h {
  padding: 4px 2px 3px;
}
body.scr #view .daylbl {
  padding-block: 3px;
  font-size: 11.5px;
}
:root {
  --topH: 64px;
  --shH: 48px;
}
#view .sec-h {
  position: sticky;
  top: var(--topH);
  z-index: 3;
  background: var(--bg);
  padding: 8px 2px 6px;
  margin: -8px -2px 0;
}
#view details.box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 0 12px 12px;
}
#view details.box > summary {
  position: sticky;
  top: var(--topH);
  z-index: 3;
  background: var(--surface);
  padding: 12px 2px 8px;
  border-radius: var(--r) var(--r) 0 0;
}
#view details.box > summary h2 {
  font-size: 16px;
}
#view details.box > .list,
#view details.box .list {
  border-radius: 12px;
}
#view details.box[open] > summary {
  box-shadow: 0 1px 0 var(--line);
}
#view .grp,
#view .cmp.h {
  position: sticky;
  top: calc(var(--topH) + 40px);
  z-index: 2;
}
#view .cmp.h {
  background: var(--surface);
}
.panel .grp,
.panel .cmp.h {
  position: sticky;
  top: calc(var(--shH) - 6px);
  z-index: 1;
}
.panel .cmp.h {
  background: var(--surface);
}
.tblw {
  max-height: 62vh;
  overflow: auto;
}
.stmt thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.stmt th {
  font-weight: 600;
  color: var(--muted);
  text-align: start;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--surface);
}
.stmt td {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.stmt td.n {
  white-space: nowrap;
  text-align: end;
  font-variant-numeric: tabular-nums;
  direction: ltr;
}
.stmt td.d {
  white-space: nowrap;
  color: var(--muted);
}
.stmt tr.tap {
  cursor: pointer;
}
.stmt tr.tap:hover td {
  background: var(--sunk);
}
.stmt tr.open td {
  color: var(--muted);
  font-style: italic;
}
.sumgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.sumgrid div {
  background: var(--sunk);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
details.box > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
details.box > summary::-webkit-details-marker {
  display: none;
}
details.box > summary h2 {
  margin: 0;
  font-family: var(--f-display);
  font-size: 17.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.sumv {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.sumv small {
  font-family: var(--f-body);
  font-weight: 500;
  color: var(--muted);
  font-size: 0.75em;
}
details.box > summary h2::before {
  content: "▸";
  display: inline-block;
  margin-inline-end: 6px;
  color: var(--muted);
  transition: transform 0.15s;
}
[dir="rtl"] details.box > summary h2::before {
  transform: scaleX(-1);
}
details.box[open] > summary h2::before {
  transform: rotate(90deg);
}
details.box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
details.box > .list {
  margin-top: 8px;
}
.grp {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--sunk);
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  border-top: 1px solid var(--line);
}
.grp:first-child {
  border-top: 0;
}
.grp .num {
  font-family: var(--f-display);
}
.grp + .row {
  border-top: 0;
}
.tile {
  cursor: pointer;
}
.tile:hover {
  background: var(--sunk);
}
.sub {
  padding-inline-start: 30px;
}
.row.sub .t {
  font-size: 14px;
  color: var(--muted);
}
.balchips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.balchip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 999px;
  padding: 4px 11px;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.balchip:hover {
  border-color: var(--accent);
}
.balchip.add {
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 13px;
  color: var(--accent);
  border-style: dashed;
}
.totbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.totbar > div {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.totbar > div + div {
  border-inline-start: 1px solid var(--line);
}
.why {
  text-decoration: underline dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  cursor: pointer;
}

/* Styles, part 7 of 8 (order matters: later rules win). Continues the previous part. */
.biobtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 4px auto 2px;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.biobtn svg {
  width: 76px;
  height: 76px;
  padding: 14px;
  border-radius: 50%;
  background: var(--accent-soft);
  box-sizing: border-box;
}
#splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  pointer-events: none;
  animation: splOut 0.45s ease 1.5s forwards;
}
#splash .spl-mark {
  opacity: 0;
  transform: scale(0.6) rotate(-8deg);
  animation: splIn 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.3) 0.1s forwards;
}
#splash .spl-name {
  font-family: var(--f-display);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 0.5px;
  opacity: 0;
  transform: translateY(18px);
  animation: splUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.35s forwards;
}
#splash .spl-sub {
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: uppercase;
  opacity: 0;
  animation: splFade 0.5s ease 0.8s forwards;
}
@keyframes splIn {
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes splUp {
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes splFade {
  to {
    opacity: 0.75;
  }
}
@keyframes splOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}
@media (prefers-reduced-motion: reduce) {
  #splash {
    animation-delay: 0.4s;
  }
  #splash * {
    animation-duration: 0.01s !important;
    animation-delay: 0s !important;
  }
}
.info {
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 13px;
  padding: 0 2px;
  cursor: pointer;
  vertical-align: middle;
}
.totbar > div.on {
  background: var(--accent-soft);
}
.balchip.on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.totbar > div.tap {
  cursor: pointer;
}
.totbar b {
  font-family: var(--f-display);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qbox {
  position: relative;
  flex: 1;
  min-width: 0;
}
.qbox .in-f {
  padding-inline-end: 40px;
}
.qx {
  position: absolute;
  inset-inline-end: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  background: none;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
}
.qx:hover {
  background: var(--sunk);
  color: var(--ink);
}
.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.filters .seg {
  grid-column: 1/-1;
}
.qadd {
  display: flex;
  gap: 8px;
}
.qadd .btn {
  padding: 8px 14px;
  font-size: 16px;
}
.qchips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  margin-top: -12px;
}
.qchips .balchip {
  white-space: nowrap;
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 13.5px;
}
.cal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px;
}
.cwd,
.cgrid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.cwd span {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.cday {
  position: relative;
  aspect-ratio: 1/1.05;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px;
  cursor: pointer;
  overflow: hidden;
  color: var(--ink);
  min-width: 0;
}
.cday::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: calc(var(--h) * 100%);
  background: var(--neg-soft);
  z-index: 0;
}
.cday > * {
  position: relative;
  z-index: 1;
}
.cday .dn {
  font-size: 12px;
  font-weight: 600;
}
.cday .dv {
  font-size: 10px;
  font-weight: 600;
  color: var(--neg);
  font-variant-numeric: tabular-nums;
}
.cday.today {
  border-color: var(--accent);
  border-width: 2px;
}
.cday.on {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.din,
.ddue {
  position: absolute;
  top: 4px;
  width: 6px;
  height: 6px;
  border-radius: 9px;
}
.din {
  inset-inline-start: 4px;
  background: var(--accent);
}
.ddue {
  inset-inline-end: 4px;
  background: var(--warn);
}
.card .hd.tap {
  cursor: pointer;
}
#txf,
#obf {
  flex-wrap: wrap;
}

/* Styles, part 8 of 8 (order matters: later rules win). Sections: lock screen. */
/* lock screen */
.lock {
  position: fixed;
  inset: 0;
  z-index: 80;
  --fpB: 5vh;
  background: radial-gradient(120% 70% at 50% 0%, var(--accent-soft), var(--bg) 60%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: max(9vh, env(safe-area-inset-top, 0px)) !important;
  padding-bottom: calc(26vh + 80px) !important;
  overflow: auto;
  padding-block: 24px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.lockbox {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
}
.lockmark {
  width: 68px;
  height: 68px;
  margin: 0 auto;
  border-radius: 22px;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 24px -10px var(--accent);
  display: grid;
  place-items: center;
}
.lockmark svg {
  width: 30px;
  height: 30px;
}
.lockbox .brand {
  font-size: 24px;
  max-width: none;
  cursor: default;
}
.lockbox .brand::after {
  content: none;
}
.fpbtn {
  position: fixed;
  left: 50%;
  bottom: calc(var(--fpB, 5vh) + env(safe-area-inset-bottom, 0px));
  touch-action: none;
  transform: translateX(-50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.25);
  transition: opacity 0.15s;
}
.fpbtn svg {
  width: 40px;
  height: 40px;
}
.fpbtn.on {
  color: var(--accent);
  border-color: var(--accent);
}
.fpbtn.wait {
  color: var(--accent);
  border-color: var(--accent);
  animation: fpP 1.4s ease-in-out infinite;
}
.fpbtn.move {
  outline: 2px dashed var(--accent);
  outline-offset: 6px;
  color: var(--accent);
}
@keyframes fpP {
  50% {
    box-shadow: 0 0 0 10px var(--accent-soft);
  }
}
.err.ok {
  color: var(--accent);
}
.lock.typing .fpbtn {
  opacity: 0;
  pointer-events: none;
}
.lockbox h3 {
  margin: 0;
  font-family: var(--f-display);
  font-size: 17px;
  font-weight: 600;
}
.pin {
  font-family: var(--f-display);
  font-size: 24px;
  letter-spacing: 0.3em;
  text-align: center;
}
/* the wide spacing is for the dots of the PIN; on the Arabic hint it breaks the letters apart */
.pin::placeholder {
  font-family: var(--f-body);
  font-size: 17px;
  letter-spacing: normal;
}
.err {
  color: var(--neg);
  font-size: 14px;
  min-height: 21px;
  margin: 0;
}
.lockbox .form {
  text-align: start;
}
.acct {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 10px 12px;
}
.acct .em {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  text-align: start;
}
.acct .ok {
  color: var(--accent);
  font-weight: 700;
}
.g {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font:
    700 14px/1 Arial,
    sans-serif;
  color: #fff;
  background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0);
  flex: none;
}
.gbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
