/* Fonts are served from this site (no requests to Google) */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 700; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Vazirmatn"; font-weight: 100 900; font-display: swap; src: url(/fonts/vazirmatn-var.woff2) format("woff2"); }

:root {
  --ink: #1B2A3A;
  --ink-2: #4A5868;
  --ink-3: #6B7785;
  --line: #E3E6EA;
  --line-2: #C5CDD6;
  --ground: #F4F5F7;
  --card: #FFFFFF;
  --accent: #0F766E;
  --accent-dark: #0B5A54;
  --accent-soft: #D7EDEA;
  --warn: #B45309;
  --warn-line: #D97706;
  --warn-soft: #FFFBF5;
  --warn-chip: #FDF1E3;
  --danger: #B42318;
  --radius: 12px;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
[dir="rtl"] { --sans: "Vazirmatn", "IBM Plex Sans", system-ui, sans-serif; }

* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.5; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
.skip { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { width: auto; height: auto; clip: auto; inset-inline-start: 16px; top: 16px; background: #fff; padding: 8px 12px; z-index: 10; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.hidden { display: none !important; }

/* Buttons */
.btn { font: inherit; font-weight: 600; border-radius: 8px; padding: 10px 18px; min-height: 44px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:hover { border-color: var(--ink-3); color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); color: #fff; }
.btn.dark { background: #fff; color: var(--ink); border: 0; }
.btn.link { border: 0; background: none; color: var(--accent); padding: 8px; min-height: 36px; font-weight: 500; }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* Header */
.topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 0 24px; min-height: 64px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 600; color: var(--ink); text-decoration: none; }
.topbar nav { display: flex; gap: 20px; }
.topbar nav a { color: var(--ink-2); text-decoration: none; padding: 20px 0; border-bottom: 2px solid transparent; }
.topbar nav a[aria-current="page"] { color: var(--ink); font-weight: 600; border-color: var(--accent); }
.topbar .right { margin-inline-start: auto; display: flex; align-items: center; gap: 12px; font-size: 14px; flex-wrap: wrap; }
.lang { display: flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.lang button { font: inherit; border: 0; background: #fff; color: var(--ink); padding: 6px 12px; min-height: 36px; cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* Layout */
main { max-width: 1216px; margin: 0 auto; padding: 32px 24px 64px; }
.cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.col-main { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.col-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.pad { padding: 20px; }

/* Upload */
.drop { background: #fff; border: 2px dashed #9FB3C3; border-radius: var(--radius); padding: 28px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.drop.over { border-color: var(--accent); background: #F2FAF9; }
.drop .text { flex: 1 1 240px; }
.drop .title { font-size: 17px; font-weight: 600; margin: 0; }
.drop .actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Table */
.table-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.chip { font-size: 13px; font-weight: 500; border-radius: 999px; padding: 3px 10px; }
.chip.warn { color: var(--warn); background: var(--warn-chip); }
.chip.ok { color: var(--accent); background: var(--accent-soft); }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
th { text-align: start; color: var(--ink-2); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; padding: 12px 8px; }
td { padding: 12px 8px; border-top: 1px solid #EEF0F3; }
th:first-child, td:first-child { padding-inline-start: 20px; }
th:last-child, td:last-child { padding-inline-end: 20px; }
td.r, th.r { text-align: end; }
td.num { white-space: nowrap; }
tr.flag { background: var(--warn-soft); }
.status-ready { color: var(--accent); font-weight: 500; }
.status-flag { color: var(--warn); font-weight: 600; }
.status-wait { color: var(--ink-2); }
.status-failed { color: var(--danger); font-weight: 600; }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-2); }

/* Side panel */
.summary { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.summary .label { margin: 0; font-size: 12px; color: #C9D4DE; }
.summary .value { margin: 2px 0 0; font-size: 22px; font-weight: 500; }
.summary .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.summary p.note { margin: 0; font-size: 13px; color: #C9D4DE; }
.radio { display: flex; gap: 10px; align-items: center; min-height: 32px; font-size: 14px; }
.meter { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); }

/* Review */
.review { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.preview { flex: 1 1 420px; min-width: 0; background: #E8EBEF; border-radius: var(--radius); padding: 24px; display: flex; justify-content: center; }
.preview img { max-width: 100%; max-height: 75vh; object-fit: contain; background: #fff; }
.preview iframe { width: 100%; height: 75vh; border: 0; background: #fff; }
.fields { flex: 1 1 440px; min-width: 0; padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field input, .field select { font: inherit; font-size: 15px; border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; min-height: 44px; background: #fff; color: var(--ink); width: 100%; }
.field input.num { font-family: var(--mono); }
.field.low label { color: var(--warn); font-weight: 600; }
.field.low input, .field.low select { border: 2px solid var(--warn-line); background: var(--warn-soft); }
.hint { margin: 0; font-size: 12px; }
.hint.ok { color: var(--accent); }
.hint.bad { color: var(--warn); }
.reasons { margin: 0; padding: 12px 16px; background: var(--warn-chip); border-radius: 8px; color: #7A3A06; font-size: 14px; }
.reasons ul { margin: 4px 0 0; padding-inline-start: 20px; }
.actions-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* Auth */
.auth { max-width: 420px; margin: 8vh auto; padding: 32px; }
.auth form { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.error { color: var(--danger); font-size: 14px; margin: 0; }

/* Plans */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.plan { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.plan .price { font-size: 28px; font-weight: 600; }

#toast { position: fixed; inset-inline-start: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 8px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100vw - 32px); }
[dir="rtl"] #toast { transform: translateX(50%); }
#toast.show { opacity: 1; }

@media (max-width: 640px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .topbar { padding: 8px 16px; }
  main { padding: 20px 16px 48px; }
}

/* Statements */
.chip.src { margin-inline-start: 8px; color: var(--ink-2); background: #EEF1F4; font-size: 12px; font-weight: 500; white-space: nowrap; }
td.money-in { color: var(--accent); }
.statement-card { padding: 16px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.statement-note { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--ground); font-size: 14px; }

/* History */
.filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.filters .field { flex: 0 1 170px; min-width: 140px; }
.filters .field.grow { flex: 1 1 220px; }
.filter-actions { margin-inline-start: auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { padding: 16px 20px; }
.tile .label { margin: 0; font-size: 13px; color: var(--ink-2); }
.tile .value { margin: 4px 0 0; font-size: 24px; font-weight: 500; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis { stroke: var(--line-2); stroke-width: 1; }
.chart .avg { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .lbl { font-family: var(--sans); font-size: 12px; fill: var(--ink-2); }
.chart .val { font-family: var(--mono); font-size: 11.5px; fill: var(--ink); }
.chart .bar { cursor: pointer; outline: none; }
.chart .bar .hit { fill: transparent; }
.chart .bar .fill { fill: #8CC9C1; }
.chart .bar:hover .fill, .chart .bar:focus-visible .fill { fill: var(--accent); }
.chart .bar.on .fill { fill: var(--accent); }
.catlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.catrow { width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: none; border: 0; border-radius: 8px; padding: 8px; cursor: pointer;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; text-align: start; }
.catrow:hover { background: var(--ground); }
.catrow.on { background: var(--accent-soft); }
.catname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catbar { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.catbar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.entry-form { display: flex; flex-direction: column; gap: 12px; }
.legend { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.legend .dash { width: 24px; border-top: 1px dashed var(--ink-3); }
.chip.muted-chip { color: var(--ink-2); background: #EEF1F4; }
a.rowlink { color: var(--ink); font-weight: 500; text-decoration: none; }
a.rowlink:hover { color: var(--accent); text-decoration: underline; }

/* Statistics */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.stat { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.stat.strong { background: var(--accent-soft); border-color: transparent; }
.stat .label { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.stat .value { margin: 2px 0 0; font-size: 19px; font-weight: 500; }
.stat .note { margin: 2px 0 0; font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.merchants { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.merchants li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; }
.merchants li .btn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; color: var(--ink); font-weight: 500; }
.selbar { position: sticky; bottom: 16px; z-index: 5; background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 18px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; font-size: 14px; box-shadow: 0 6px 20px rgba(27, 42, 58, 0.25); }
.selbar b { font-weight: 500; }
.selbar span { color: #C9D4DE; }
.selbar span b { color: #fff; }

/* Budget */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
table.budget th { position: relative; }
table.budget { min-width: 640px; }
table.budget td, table.budget th { padding-top: 9px; padding-bottom: 9px; }
table.budget tr.sect td { background: var(--ground); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); padding-top: 14px; }
table.budget tr.total td { font-weight: 600; border-top: 1px solid var(--line-2); }
table.budget tr.total.big td { font-size: 15px; }
table.budget tr.grand td { background: #EEF5F4; border-top: 2px solid var(--ink); }
table.budget tr.limit td { background: #F2FAF9; }
table.budget tr.limit.over td { background: #FDECEA; }
.good { color: var(--accent); }
.bad { color: var(--danger); }
.warn-text { color: var(--warn); }
td.good, td.bad, td.warn-text { font-weight: 500; white-space: nowrap; }
.barcell { width: 90px; }
.ubar { display: block; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; min-width: 60px; }
.ubar > span { display: block; height: 100%; background: var(--accent); }
.ubar.over > span { background: var(--danger); }
.linkish { font: inherit; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; text-align: start; }
.linkish:hover { color: var(--accent); text-decoration: underline; }
tr.sel td { background: var(--accent-soft); }
.tile-bad { border-color: #F3C2BD; background: #FFF7F6; }
.advice { display: flex; flex-direction: column; gap: 10px; }
.adv { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.adv ul { margin: 0; padding-inline-start: 18px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.unrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.unrow select { font: inherit; font-size: 14px; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px; min-height: 40px; max-width: 180px; }
.editor { display: flex; flex-direction: column; gap: 16px; }
.edsec { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px 8px; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.edsec legend { font-weight: 600; padding: 0 6px; }
.edrow { display: grid; grid-template-columns: minmax(140px, 1.2fr) 110px minmax(160px, 2fr) minmax(120px, 1.3fr) auto; gap: 8px; align-items: end; padding: 6px 0; border-top: 1px solid #F0F2F4; }
.edrow .field span { font-size: 12px; color: var(--ink-2); }
.edrow input { font: inherit; font-size: 14px; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; min-height: 40px; width: 100%; background: #fff; color: var(--ink); }
@media (max-width: 760px) { .edrow { grid-template-columns: 1fr 1fr; } .edrow .kw { grid-column: 1 / -1; } }

/* Statement balance check */
details.check { margin-top: 8px; font-size: 14px; }
details.check summary { cursor: pointer; color: var(--accent); font-weight: 500; }
.checktable { min-width: 0; width: auto; margin-top: 6px; font-size: 13.5px; }
.checktable td { padding: 4px 0; border: 0; }
.checktable td:first-child { padding-inline-end: 24px; color: var(--ink-2); }
.checktable tr.sum td { border-top: 1px solid var(--line-2); font-weight: 600; color: var(--ink); }
.checktable tr.bad td { color: var(--danger); font-weight: 600; }
.checktable tr.ok td { color: var(--accent); font-weight: 600; }

/* Pages */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 14px; }
.pager-btns { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager .btn { min-height: 36px; min-width: 36px; padding: 4px 10px; font-weight: 500; }
.pager .btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pager-size { margin-inline-start: auto; }
.pager-size select { font: inherit; border: 1px solid var(--line-2); border-radius: 8px; padding: 4px 6px; min-height: 36px; }

/* Admin */
.note-input { font: inherit; font-size: 14px; border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; width: 100%; resize: vertical; }
.btn.danger { color: var(--danger); border-color: #F3C2BD; }

/* Menu wraps on narrow screens instead of running off the edge */
.topbar nav { flex-wrap: wrap; column-gap: 18px; max-width: 100%; }
@media (max-width: 640px) { .topbar nav a { padding: 10px 0; } }
.field input[type="checkbox"], .field input[type="radio"] { width: auto; min-height: 0; padding: 0; border: 0; }

/* Accounts in this budget */
.srcrow{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:10px 0;border-top:1px solid var(--line, #e5e5e5)}
.srcrow:first-of-type{border-top:0}

/* To sort */
.badge { display:inline-block; min-width:20px; padding:0 6px; margin-inline-start:6px; border-radius:999px; background:var(--warn, #b45309); color:#fff; font-size:12px; font-weight:700; line-height:20px; text-align:center; }
.srt-group { display:flex; flex-direction:column; gap:12px; }
.srt-head { display:flex; gap:16px; flex-wrap:wrap; justify-content:space-between; }
.srt-sug { flex:0 1 300px; min-width:0; }
.srt-controls { display:flex; gap:10px 16px; flex-wrap:wrap; align-items:center; }
.srt-controls select { max-width:100%; min-height:40px; }
.srt-lines[hidden] { display:none; }
.srt-lines { display:flex; flex-direction:column; border-top:1px solid var(--line); }
.srt-line { display:flex; gap:8px 14px; flex-wrap:wrap; align-items:center; padding:8px 0; border-bottom:1px solid var(--line); font-size:14px; }
.srt-line select { min-height:34px; max-width:100%; }

.flow { display:inline-block; font-size:13px; border-radius:6px; padding:2px 8px; overflow-wrap:anywhere; }
.flow-out { color:var(--danger); background:#FDECEC; }
.flow-in { color:var(--accent); background:var(--accent-soft); }
.amt-out { color:var(--danger); font-weight:600; }
.amt-in { color:var(--accent); font-weight:600; }
.seg { display:flex; gap:8px; flex-wrap:wrap; }
.seg button { font:inherit; font-size:14px; border:1px solid var(--line-2); background:#fff; color:var(--ink); border-radius:999px; padding:6px 14px; min-height:36px; cursor:pointer; }
.seg button[aria-pressed="true"] { background:var(--ink); color:#fff; border-color:var(--ink); }

/* Uploads on the first page, and the statement page */
.up-list { display:flex; flex-direction:column; }
.up-row { display:flex; gap:10px 16px; flex-wrap:wrap; align-items:center; padding:14px 20px; border-top:1px solid var(--line); }
.ap-list { display:flex; flex-direction:column; }
.ap-row { display:flex; gap:12px 16px; flex-wrap:wrap; align-items:center; padding:14px 0; border-top:1px solid var(--line); }
.ap-why { margin:6px 0 0; padding-inline-start:18px; font-size:13px; color:var(--warn); }
.approve-panel { display:flex; flex-direction:column; gap:10px; border:2px solid var(--warn, #b45309); }
tr.dim td { color:var(--ink-2); text-decoration:line-through; }
tr.dim td:last-child { text-decoration:none; }
.scroll th { position: relative; }

/* Budget amount pop-up */
.amount-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
dialog.modal { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: 14px; box-shadow: 0 20px 60px rgba(15,23,42,.25); display: flex; flex-direction: column; }
dialog.modal:not([open]) { display: none; }
dialog.modal::backdrop { background: rgba(15,23,42,.45); }
.modal-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-body { overflow: auto; flex: 1 1 auto; }
.modal-body table { width: 100%; }
.modal-body tfoot td { border-top: 2px solid var(--ink); }
.modal-foot { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-body td { white-space: normal; }
.modal-body td a { overflow-wrap: anywhere; }
.modal-body td.num.r { white-space: nowrap; }
@media (max-width: 600px) {
  .modal-body th, .modal-body td { padding: 8px 10px; font-size: 13px; }
  .modal-head, .modal-foot { padding: 14px 14px; }
}
.modal-body table { min-width: 0; }

/* ---------- Landing page ---------- */
.ld-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; max-width: 1180px; margin: 0 auto; padding: 18px 24px; }
.ld-top .right { display: flex; gap: 12px; align-items: center; }
.ld-brand-fa { font-family: "Vazirmatn", sans-serif; font-weight: 600; color: var(--ink-3); margin-inline-start: 8px; font-size: 17px; }
.landing { max-width: 1180px; margin: 0 auto; padding: 8px 24px 40px; display: flex; flex-direction: column; gap: 88px; }

.ld-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr); grid-template-areas: "copy auth" "ledger auth"; gap: 28px 48px; align-items: start; padding-top: 24px; }
.ld-copy { grid-area: copy; }
.ld-ledger-wrap { grid-area: ledger; position: relative; }
.ld-auth { grid-area: auth; }
.ld-hero h1 { font-size: clamp(34px, 4.6vw, 56px); line-height: 1.05; font-weight: 700; letter-spacing: -0.025em; max-width: 14ch; }
[dir="rtl"] .ld-hero h1 { letter-spacing: 0; line-height: 1.25; max-width: 16ch; }
.ld-lead { font-size: 18px; line-height: 1.6; color: var(--ink-2); max-width: 54ch; margin: 18px 0 0; }

/* The ledger page */
.ld-ledger { position: relative; margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 4px 4px 14px 4px; padding: 22px 22px 18px 72px; overflow: hidden;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 47px, #E6EEF2 47px, #E6EEF2 48px);
  background-position: 0 66px; box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(27, 42, 58, .35); }
.ld-ledger::before { content: ""; position: absolute; top: 0; bottom: 0; inset-inline-start: 56px; width: 2px; background: #C2414B; opacity: .55; }
[dir="rtl"] .ld-ledger { padding: 22px 72px 18px 22px; border-radius: 4px 4px 4px 14px; }
.ld-ledger-word { position: absolute; left: 4px; bottom: 18px; width: 48px; height: 120px; display: flex; align-items: center; justify-content: center; font-family: "Vazirmatn", sans-serif; font-weight: 800; font-size: 38px; line-height: 1; color: var(--accent); }
.ld-ledger-word span { display: block; transform: rotate(-90deg); white-space: nowrap; }
[dir="rtl"] .ld-ledger-word { left: auto; right: 4px; }
[dir="rtl"] .ld-ledger-word span { transform: rotate(90deg); }
.ld-ledger figcaption { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; height: 44px; }
.ld-ledger figcaption strong { font-size: 16px; }
.ld-ledger figcaption .muted { font-size: 13px; }
.ld-ledger ol { list-style: none; margin: 0; padding: 0; }
.ld-ledger li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto 128px; gap: 12px; align-items: center; height: 48px; font-size: 14px; }
.ld-date { color: var(--ink-3); font-size: 13px; }
.ld-vendor { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: .01em; }
.ld-amt { text-align: end; font-size: 14px; color: var(--ink); }
.ld-amt.in { color: var(--accent); }
.ld-tag { justify-self: start; font-size: 12.5px; font-weight: 600; color: var(--accent-dark); background: var(--accent-soft); border-radius: 6px; padding: 3px 9px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ld-tag.muted-tag { color: var(--ink-2); background: #EEF1F4; }
.ld-check { margin: 10px 0 0; font-size: 13.5px; font-weight: 600; color: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .ld-tag { animation: ld-stamp .38s cubic-bezier(.2, .9, .3, 1.2) both; animation-delay: calc(500ms + var(--i) * 260ms); }
  .ld-check { animation: ld-fade .4s ease both; animation-delay: 2.2s; }
  @keyframes ld-stamp { from { opacity: 0; transform: translateX(-10px) scale(.92); } to { opacity: 1; transform: none; } }
  [dir="rtl"] .ld-tag { animation-name: ld-stamp-rtl; }
  @keyframes ld-stamp-rtl { from { opacity: 0; transform: translateX(10px) scale(.92); } to { opacity: 1; transform: none; } }
  @keyframes ld-fade { from { opacity: 0; } to { opacity: 1; } }
}

/* Sign up / sign in */
.ld-auth { position: sticky; top: 20px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.ld-auth h2 { font-size: 21px; }
.ld-auth form { display: flex; flex-direction: column; gap: 14px; }
.ld-auth .btn.primary { width: 100%; min-height: 48px; font-size: 16px; }
.ld-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--ground); border-radius: 10px; padding: 4px; }
.ld-tabs button { font: inherit; font-weight: 600; font-size: 14px; border: 0; background: none; color: var(--ink-2); border-radius: 7px; padding: 8px; min-height: 38px; cursor: pointer; }
.ld-tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(27, 42, 58, .15); }
.ld-fine { margin: 0; font-size: 13px; text-align: center; }

/* Sections */
.ld-section > h2 { font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.015em; font-weight: 700; }
[dir="rtl"] .ld-section > h2 { letter-spacing: 0; }
.ld-sub { color: var(--ink-2); margin: 10px 0 0; max-width: 60ch; }
.ld-steps { list-style: none; counter-reset: step; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.ld-steps li { counter-increment: step; border-top: 3px solid var(--ink); padding-top: 16px; }
.ld-steps li::before { content: counter(step); display: block; font-family: var(--mono); font-size: 15px; color: var(--accent); margin-bottom: 6px; }
.ld-steps h3, .ld-features h3 { font-size: 18px; }
.ld-steps p, .ld-features p { margin: 6px 0 0; color: var(--ink-2); max-width: 46ch; }
.ld-features { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 56px; }
.ld-features li { padding: 18px 0; border-bottom: 1px solid var(--line-2); }
.ld-prices { min-width: 560px; margin-top: 24px; background: #fff; border: 1px solid var(--line); border-radius: 12px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.ld-prices th[scope="row"] { font-size: 16px; font-weight: 600; color: var(--ink); text-transform: none; letter-spacing: 0; }
.ld-prices thead th { background: var(--ground); }
.ld-prices td { font-size: 15px; }
.ld-prices tr.free th, .ld-prices tr.free td { background: #F3FAF8; }
.ld-section > .btn.primary { margin-top: 20px; }
.ld-faq { margin-top: 18px; border-top: 1px solid var(--line-2); max-width: 820px; }
.ld-faq details { border-bottom: 1px solid var(--line-2); }
.ld-faq summary { cursor: pointer; padding: 16px 0; font-weight: 600; font-size: 16px; list-style-position: inside; }
.ld-faq p { margin: 0 0 18px; color: var(--ink-2); max-width: 70ch; }
.ld-foot { max-width: 1180px; margin: 0 auto; padding: 24px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13px; }
.ld-foot p { margin: 0; }

@media (max-width: 900px) {
  .ld-hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "auth" "ledger"; }
  .ld-auth { position: static; }
  .ld-steps { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .ld-features { grid-template-columns: minmax(0, 1fr); }
  .landing { gap: 64px; padding: 8px 16px 32px; }
  .ld-top { padding: 14px 16px; }
}
@media (max-width: 520px) {
  .ld-ledger { padding-inline-start: 50px; padding-inline-end: 14px; }
  [dir="rtl"] .ld-ledger { padding-inline-start: 50px; padding-inline-end: 14px; }
  .ld-ledger::before { inset-inline-start: 40px; }
  .ld-ledger-word { font-size: 28px; width: 36px; left: 2px; }
  [dir="rtl"] .ld-ledger-word { left: auto; right: 2px; }
  .ld-ledger li { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; height: 48px; row-gap: 0; column-gap: 8px; }
  .ld-date { display: none; }
  .ld-vendor { font-size: 13px; }
  .ld-tag { grid-column: 1; grid-row: 2; font-size: 11.5px; padding: 1px 7px; }
  .ld-amt { grid-column: 2; grid-row: 1 / span 2; }
  .ld-brand-fa { display: none; }
}

[dir="rtl"] .ld-ledger li { grid-template-columns: 70px minmax(0, 1fr) auto 112px; }
[dir="rtl"] .ld-date { white-space: nowrap; }
[dir="rtl"] .ld-amt { text-align: start; }
@media (max-width: 520px) {
  .ld-ledger figcaption .muted { display: none; }
  [dir="rtl"] .ld-ledger li { grid-template-columns: minmax(0, 1fr) auto; }
}

/* Account and two-step verification */
.acct h2, .acct-2fa h2 { font-size: 18px; }
.acct-2fa { display: flex; flex-direction: column; gap: 12px; }
.acct-link { font-weight: 500; text-decoration: none; }
.tf-steps { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 14px; }
.qr-wrap { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; margin-top: 10px; }
.qr { width: 200px; height: 200px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.qr svg { width: 100%; height: 100%; display: block; }
.secret { display: inline-block; margin-top: 6px; font-family: var(--mono); font-size: 15px; background: var(--ground); padding: 6px 10px; border-radius: 6px; word-break: break-all; }
.tf-confirm { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.tf-confirm-col { display: flex; flex-direction: column; gap: 12px; max-width: 420px; }
.recovery { display: flex; flex-direction: column; gap: 10px; background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: 10px; padding: 16px; }
.codes { margin: 0; padding-inline-start: 22px; display: grid; grid-template-columns: repeat(2, minmax(0, 9em)); gap: 4px 24px; font-size: 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Cookie banner */
.cookie-banner { position: fixed; inset-inline: 16px; bottom: 16px; z-index: 50; max-width: 760px; margin-inline: auto; background: #fff; border: 1px solid var(--line-2);
  border-radius: 12px; box-shadow: 0 16px 40px -12px rgba(27, 42, 58, .35); padding: 16px 18px; display: flex; gap: 12px 20px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.cookie-text { flex: 1 1 320px; min-width: 0; }
.cookie-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 520px) { .cookie-actions { width: 100%; } .cookie-actions .btn { flex: 1 1 auto; } .codes { grid-template-columns: minmax(0, 1fr); } }

/* Paste a statement */
.paste-card > summary { cursor: pointer; padding: 16px 20px; display: flex; gap: 4px 12px; flex-wrap: wrap; align-items: baseline; }
.paste-card > summary .muted { font-size: 14px; }
.paste-card[open] > summary { border-bottom: 1px solid var(--line); }
.paste-form { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.paste-area { width: 100%; min-height: 150px; font-family: var(--mono); font-size: 13px; line-height: 1.5; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; resize: vertical; }
.paste-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 600px) { .paste-row { grid-template-columns: minmax(0, 1fr); } }

.row-actions { display: inline-flex; gap: 14px; align-items: center; white-space: nowrap; }
.row-actions .btn.link { padding: 0; min-height: 0; }

/* Canada and the US: an open notebook, one country per page */
.ld-spread { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 28px; filter: drop-shadow(0 24px 40px rgba(27, 42, 58, .18)); }
.ld-page { position: relative; background: #fff; padding: 28px 32px 24px; min-height: 360px; display: flex; flex-direction: column;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 43px, #E6EEF2 43px, #E6EEF2 44px); background-position: 0 116px; }
.ld-page-ca { border-radius: 14px 0 0 14px; box-shadow: inset -26px 0 30px -26px rgba(27, 42, 58, .35); }
.ld-page-us { border-radius: 0 14px 14px 0; box-shadow: inset 26px 0 30px -26px rgba(27, 42, 58, .35); }
[dir="rtl"] .ld-page-ca { border-radius: 0 14px 14px 0; box-shadow: inset 26px 0 30px -26px rgba(27, 42, 58, .35); }
[dir="rtl"] .ld-page-us { border-radius: 14px 0 0 14px; box-shadow: inset -26px 0 30px -26px rgba(27, 42, 58, .35); }
.ld-page::before { content: ""; position: absolute; top: 0; bottom: 0; width: 2px; background: #C2414B; opacity: .45; inset-inline-start: 22px; }
.ld-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; height: 88px; padding-inline-start: 6px; }
.ld-page-head h3 { font-size: 24px; font-weight: 700; }
.ld-cur { font-family: var(--mono); font-weight: 500; font-size: clamp(40px, 6vw, 64px); line-height: .9; letter-spacing: -0.04em; color: var(--accent); }
.ld-page-us .ld-cur { color: var(--ink); }
.ld-banks { list-style: none; margin: 28px 0 0; padding: 0 0 0 6px; columns: 2; column-gap: 24px; }
[dir="rtl"] .ld-banks { padding: 0 6px 0 0; }
.ld-banks li { height: 44px; display: flex; align-items: flex-end; padding-bottom: 8px; font-size: 16px; font-weight: 500; break-inside: avoid; }
[dir="rtl"] .ld-banks li { justify-content: flex-end; }
.ld-page-note { margin: auto 0 0; padding: 18px 0 0 6px; font-size: 14px; color: var(--ink-2); max-width: 40ch; }
.ld-fine-print { margin: 16px 0 0; font-size: 13px; color: var(--ink-3); }
@media (max-width: 760px) {
  .ld-spread { grid-template-columns: minmax(0, 1fr); gap: 14px; filter: none; }
  .ld-page, .ld-page-ca, .ld-page-us, [dir="rtl"] .ld-page-ca, [dir="rtl"] .ld-page-us { border-radius: 14px; box-shadow: 0 1px 0 var(--line), 0 14px 30px -20px rgba(27, 42, 58, .35); min-height: 0; }
  .ld-page { padding: 22px 20px 20px 40px; }
  [dir="rtl"] .ld-page { padding: 22px 40px 20px 20px; }
  .ld-page::before { inset-inline-start: 24px; }
}

/* A paper receipt below the ledger's corner: read from a phone photo */
.ld-ledger-wrap { display: flex; flex-direction: column; }
.ld-receipt { position: relative; align-self: flex-end; width: 214px; margin: -40px -14px 0 0; transform: rotate(3deg); z-index: 2; }
[dir="rtl"] .ld-receipt { margin: -40px 0 0 -14px; }
[dir="rtl"] .ld-receipt { transform: rotate(-3deg); }
.ld-receipt figcaption { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #fff; background: var(--ink); border-radius: 999px; padding: 4px 10px; margin: 0 0 -8px 12px; position: relative; z-index: 1; }
.ld-rc-paper { position: relative; background: #FFFEFA; padding: 18px 16px 14px; font-size: 12.5px; color: #2E3A45; box-shadow: 0 16px 30px -14px rgba(27, 42, 58, .5); border-radius: 2px 2px 0 0; }
.ld-rc-paper::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 8px;
  background: linear-gradient(-45deg, transparent 6px, #FFFEFA 0) 0 0 / 12px 8px repeat-x, linear-gradient(45deg, transparent 6px, #FFFEFA 0) 0 0 / 12px 8px repeat-x; }
.ld-rc-store { margin: 0 0 2px; font-weight: 700; font-size: 12px; letter-spacing: .02em; text-align: center; }
.ld-rc-meta { margin: 0 0 10px; font-size: 11px; color: var(--ink-3); text-align: center; }
.ld-rc-meta:last-child { margin: 0; }
.ld-rc-row { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dashed #D9DEE3; }
.ld-rc-row.total { font-weight: 700; border-bottom: 0; padding-top: 6px; margin-bottom: 8px; }
.ld-rc-read { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-top: 16px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; box-shadow: 0 10px 24px -14px rgba(27, 42, 58, .4); }
.ld-rc-read .ld-tag { animation: none; align-self: flex-start; }
@media (prefers-reduced-motion: no-preference) {
  .ld-receipt { animation: ld-slip .6s cubic-bezier(.2, .9, .3, 1.1) both; animation-delay: 2.4s; }
  @keyframes ld-slip { from { opacity: 0; transform: translateY(18px) rotate(7deg); } to { opacity: 1; transform: rotate(3deg); } }
  [dir="rtl"] .ld-receipt { animation-name: ld-slip-rtl; }
  @keyframes ld-slip-rtl { from { opacity: 0; transform: translateY(18px) rotate(-7deg); } to { opacity: 1; transform: rotate(-3deg); } }
}
@media (max-width: 900px) { .ld-receipt, [dir="rtl"] .ld-receipt { margin-inline-end: 12px; } }
@media (max-width: 520px) { .ld-receipt, [dir="rtl"] .ld-receipt { align-self: center; transform: rotate(2deg); margin: 18px auto 0; width: 220px; animation: none; } [dir="rtl"] .ld-receipt { transform: rotate(-2deg); } }
