/* 1.87 (26 Oct 2026): the look of an iPhone money app, as Sultan asked (his MoneyWiz video): black (or iOS grey)
   ground, rounded cards, coloured pills on the account groups, a glass bar of buttons at the top and a floating
   glass tab bar at the bottom, the system font, blue for what you press. Loaded after app.css: only the look
   changes here; what each screen does stays in app.css and the views. */

:root {
  --paper: #f2f2f7;
  --sheet: #ffffff;
  --fill: #e9e9ee;
  --ink: #000000;
  --pencil: #6c6c70;
  --rule: #e2e2e6;
  --rule-strong: #c7c7cc;
  --green: #1f8a3b;
  --green-wash: #e2f4e6;
  --red: #d70015;
  --red-wash: #fde8ea;
  --amber: #a45a00;
  --amber-wash: #fff1d6;
  --accent: #007aff;
  --accent-wash: #e1efff;
  --glass: rgb(249 249 251 / 0.72);
  --glass-line: rgb(0 0 0 / 0.08);
  --pill-green: #34a853;
  --pill-red: #e5383b;
  --pill-amber: #e0a800;
  --pill-purple: #af52de;
  --pill-tan: #a2845e;
  --radius: 10px;
  --card: 22px;
  --font: "MM Currency", -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI Variable Text", "Segoe UI", system-ui, "Noto Sans Arabic", sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #000000;
  --sheet: #1c1c1e;
  --fill: #2c2c2e;
  --ink: #ffffff;
  --pencil: #98989f;
  --rule: #38383a;
  --rule-strong: #48484a;
  --green: #30d158;
  --green-wash: #10351c;
  --red: #ff453a;
  --red-wash: #3b1513;
  --amber: #ffcc33;
  --amber-wash: #3a2e0c;
  --accent: #0a84ff;
  --accent-wash: #0b2a4d;
  --glass: rgb(44 44 46 / 0.62);
  --glass-line: rgb(255 255 255 / 0.12);
  --pill-green: #2fb350;
  --pill-red: #e0393a;
  --pill-amber: #e6a700;
  --pill-purple: #b45cd8;
  --pill-tan: #8f7350;
} }
:root[data-theme="dark"] {
  --paper: #000000;
  --sheet: #1c1c1e;
  --fill: #2c2c2e;
  --ink: #ffffff;
  --pencil: #98989f;
  --rule: #38383a;
  --rule-strong: #48484a;
  --green: #30d158;
  --green-wash: #10351c;
  --red: #ff453a;
  --red-wash: #3b1513;
  --amber: #ffcc33;
  --amber-wash: #3a2e0c;
  --accent: #0a84ff;
  --accent-wash: #0b2a4d;
  --glass: rgb(44 44 46 / 0.62);
  --glass-line: rgb(255 255 255 / 0.12);
  --pill-green: #2fb350;
  --pill-red: #e0393a;
  --pill-amber: #e6a700;
  --pill-purple: #b45cd8;
  --pill-tan: #8f7350;
}

body { background: var(--paper); font-size: 16px; letter-spacing: -0.01em; }
:focus-visible { outline-color: var(--accent); }

/* ---------- buttons, links and fields: blue, rounded, no outlines ---------- */
.btn { border: 0; background: var(--fill); color: var(--accent); border-radius: 12px; padding: 8px 16px; font-weight: 600; }
.btn:hover { border-color: transparent; filter: brightness(1.06); }
.btn.primary, html[data-theme="dark"] .btn.primary { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .btn.primary { color: #fff; } }
.btn.small { border-radius: 99px; padding: 5px 12px; }
.btn.danger, .btn.danger-line { background: var(--fill); color: var(--red); }
.btn.danger-fill { background: var(--red); color: #fff; }
.linkish { color: var(--accent); text-decoration: none; font-weight: 500; }
.linkish:hover { text-decoration: underline; }
.icon-btn:hover { background: var(--fill); }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select, textarea {
  border-radius: 10px;
}
.search, .side-search input { border: 0 !important; background: var(--fill) !important; border-radius: 12px !important; }

/* ---------- the top: a round app picture on the left, a glass bar of buttons on the right ---------- */
.app { grid-template-rows: 64px minmax(0, 1fr); }
.topbar { background: var(--paper); border-bottom: 0; padding: 0 16px; gap: 10px; }
.brand { gap: 10px; }
.brand img { width: 40px; height: 40px; padding: 7px; border-radius: 50%; background: var(--sheet); box-shadow: 0 0 0 1px var(--glass-line), 0 2px 8px rgb(0 0 0 / 0.25); }
.version { border: 0; background: var(--fill); color: var(--pencil); }
.top-pill { display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(22px) saturate(1.8); backdrop-filter: blur(22px) saturate(1.8); box-shadow: 0 6px 22px rgb(0 0 0 / 0.18); }
.top-pill .btn { min-height: 40px; min-width: 40px; padding: 0 12px; border-radius: 999px; background: transparent; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.top-pill .btn:hover { background: var(--fill); filter: none; }
.top-pill .btn svg { opacity: 0.9; }
.top-pill .sync-btn { color: var(--accent); }
.top-pill .sync-btn.is-error { color: var(--red); }
.top-pill #new-tx { background: var(--accent); color: #fff; font-size: 15px; }
.top-pill .lock-btn.is-on { color: var(--accent); }

/* ---------- the accounts list (the Accounts tab) ---------- */
.sidebar { background: var(--paper); border-inline-end: 1px solid var(--rule); padding: 6px 16px 120px; }
.side-title { font-size: 34px; font-weight: 700; letter-spacing: 0.01em; margin: 2px 4px 10px; }
.side-search { padding: 0 0 14px; }
.side-search input { padding: 11px 14px 11px 38px !important; font-size: 17px; }
.side-home { border: 0; border-radius: 14px; background: var(--sheet); padding: 12px 14px; }
.side-home.is-current { background: var(--accent-wash); color: var(--accent); }

.nw-card { background: var(--sheet); border-radius: var(--card); margin: 0 0 14px; overflow: hidden; }
.nw-card .networth { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; padding: 14px 12px 12px; cursor: pointer; }
.nw-card .nw-col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.nw-card .nw-label { color: var(--accent); font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }
.nw-card .amt.nw { font-size: 19px; font-weight: 600; color: var(--ink); }
.nw-card .amt.nw .frac { color: inherit; }
/* below zero, liabilities above all, in red (25 Oct 2026) */
.nw-card .amt.nw.neg, .nw-card .amt.nw.neg .frac, .nw-card .amt.nw.neg .cur, .nw-card .amt.nw.neg .sign { color: var(--red); opacity: 1; }
.nw-card .nw-others { grid-column: 1 / -1; text-align: center; }
.nw-card .inbox-link { width: calc(100% - 28px); margin: 0 14px; padding: 12px 2px; border: 0; border-top: 1px solid var(--rule); border-radius: 0; background: none; font-weight: 500; font-size: 17px; }
.nw-card .inbox-ico { width: 22px; height: 22px; background: none; color: var(--ink); display: grid; place-items: center; }
.nw-card .inbox-ico .side-ico { width: 20px; height: 20px; }
.nw-card .inbox-count { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.05; background: var(--accent); color: #fff; border-radius: 9px; padding: 4px 10px 3px; font-size: 16px; font-weight: 600; }
.nw-card .inbox-count small { font-size: 10px; font-weight: 500; }
.nw-card .chev-r { color: var(--pencil); font-size: 20px; }

.check { border-radius: 14px; }
/* the boxes under net worth (safe to spend, envelopes, who owes whom): cards, evenly 14px apart (25 Oct 2026) */
.sidebar .safe-box, .sidebar .env-box { width: 100%; margin: 0 0 14px; border: 0; border-radius: var(--card); padding: 14px 16px; }
.sidebar .owed { margin: 0 0 14px; }
.owed { background: var(--sheet); border-radius: var(--card); padding: 6px 10px 10px; }
.owed-row { border: 0; background: var(--fill); border-radius: 12px; }

.group { background: var(--sheet); border-radius: var(--card); margin-top: 14px; overflow: hidden; }
.group-toggle { padding: 14px 14px 12px 16px; color: var(--ink); font-size: 20px; font-weight: 600; gap: 10px; border-radius: 0; }
@media (hover: hover) { .group-toggle:hover { background: transparent; color: var(--ink); } }
.group-toggle .chev { width: 12px; height: 12px; }
.group-toggle .chev::before { width: 0; height: 0; border: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 10px solid currentColor; transform: none; }
.group-toggle[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.group-count { display: none; }
.group-total { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 14px; border-radius: 999px; background: var(--pill-green); color: #fff; font-size: 15px; }
.group-total .amt, .group-total .amt .frac, .group-total .amt .cur, .group-total .amt:not(.neg), .group-total .amt:not(.neg) .frac, .group-total .amt.neg, .group-total .amt.neg .frac { color: inherit; opacity: 1; font-size: 15px; font-weight: 500; }
.group-total .amt .frac { font-size: 15px; }
.group-total .mixed { color: inherit; font-size: 14px; }
.g-eye { display: grid; place-items: center; width: 22px; height: 22px; }
.tone-red .group-total { background: var(--pill-red); }
.tone-amber .group-total { background: var(--pill-amber); color: #fff; }
.tone-purple .group-total { background: var(--pill-purple); }
.tone-tan .group-total { background: var(--pill-tan); }
.acct-list { padding: 0 0 6px; }
.acct-list li + li .acct-text { border-top: 1px solid var(--rule); }
.acct { gap: 14px; padding: 0 14px 0 16px; border: 0; border-radius: 0; min-height: 76px; }
.acct .aicon { width: 52px; height: 52px; border-radius: 13px; font-size: 20px; }
.acct-text { flex: 1; min-width: 0; align-self: stretch; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 10px 0; }
.acct-name { flex: none; font-size: 18px; font-weight: 500; color: var(--ink); }
.acct-bal .amt { font-size: 16px; }
.acct-bal .amt .cur, .acct-bal .amt .frac { color: inherit; font-size: inherit; }
.acct-bal .amt .cur.is-code { font-size: inherit; margin-inline-end: 0.25em; }
.acct-bal.is-pos .amt { color: var(--green); }
.acct-bal.is-neg .amt, .acct-bal.is-neg .amt .frac { color: var(--red); }
.acct-bal:not(.is-pos):not(.is-neg) .amt { color: var(--ink); opacity: 0.85; }
.acct.is-current { background: var(--accent-wash); border: 0; }
@media (hover: hover) { .acct:hover { background: var(--fill); } }
.acct-pend { min-width: 34px; height: 24px; padding: 0 9px; border: 0; border-radius: 99px; background: var(--pill-amber); color: #fff; font-size: 14px; font-weight: 600; margin: 0; }
.side-new { margin: 16px 6px 0; }

/* the pages, under the accounts on a computer (on a phone they are the tabs) */
.side-nav { margin-top: 22px; gap: 18px; }
.side-gh { font-size: 13px; letter-spacing: 0.04em; margin: 0 8px; }
.side-group .side-links { margin: 6px 0 0; display: flex; flex-direction: column; gap: 0; background: var(--sheet); border-radius: var(--card); overflow: hidden; }
.side-links .linkish { display: flex; align-items: center; gap: 12px; padding: 9px 14px; color: var(--ink); font-weight: 500; font-size: 16px; text-decoration: none; }
.side-links .linkish + .linkish { border-top: 1px solid var(--rule); }
.side-links .linkish:hover { background: var(--fill); text-decoration: none; }
.side-links .linkish > span:nth-child(2) { flex: 1; text-align: start; }

/* coloured squares behind the page icons, as in iOS Settings */
.sq { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; background: #8e8e93; }
.sq .side-ico { width: 18px; height: 18px; color: #fff !important; }
.sq-red { background: #ff3b30; } .sq-orange { background: #ff9500; } .sq-yellow { background: #f5b800; } .sq-green { background: #34c759; }
.sq-teal { background: #30b0c7; } .sq-blue { background: #007aff; } .sq-indigo { background: #5856d6; } .sq-purple { background: #af52de; }
.sq-pink { background: #ff2d55; } .sq-brown { background: #a2845e; } .sq-gray { background: #8e8e93; }

/* ---------- a tab's own page (Budgets, Scheduled, Reports, Settings) ---------- */
.menu-page { background: var(--paper); }
.menu-title { font-size: 34px; font-weight: 700; margin: 6px 4px 14px; }
.menu-group { margin-bottom: 18px; }
.menu-list { border: 0; border-radius: var(--card); background: var(--sheet); }
.menu-item { grid-template-columns: 30px minmax(0, 1fr) auto auto; gap: 14px; min-height: 54px; padding: 0 16px; border-bottom: 0; font-size: 17px; }
.menu-item + .menu-item { border-top: 1px solid var(--rule); }
.menu-item:hover { background: var(--fill); }
.menu-static { cursor: default; }
.menu-static:hover { background: none; }
.menu-chev { font-size: 22px; }
.menu-val { color: var(--pencil); }
.menu-foot { text-align: center; color: var(--pencil); font-size: 13px; margin: 6px 0 18px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 99px; background: var(--fill); grid-column: 3 / 5; }
.seg button { width: 40px; height: 32px; border: 0; border-radius: 99px; background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.seg button.is-on { background: var(--sheet); box-shadow: 0 1px 4px rgb(0 0 0 / 0.25); }
.switch { -webkit-appearance: none; appearance: none; grid-column: 3 / 5; width: 51px; height: 31px; border-radius: 99px; background: var(--fill); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgb(0 0 0 / 0.3); transition: transform .2s; }
.switch:checked { background: #34c759; }
.switch:checked::after { transform: translateX(20px); }

/* ---------- pages, lists and sheets: cards on the ground ---------- */
.register { background: var(--paper); }
.reg-name { font-size: 26px; font-weight: 700; }
.reg-cols { background: var(--paper); }
.reg-rows .row { background: var(--sheet); }
.divider { background: var(--paper); }
.sheet-panel { background: var(--sheet); border-radius: var(--card); border: 0; }
html[data-theme="dark"] .sheet-panel, :root[data-theme="dark"] .sheet-panel { background: #1c1c1e; }
.sheet-head h2 { font-size: 20px; font-weight: 700; }
.imp-bring, .imp-wait, .need-card, .blist, .imp-rules, .credit-bar, .fx-box, .cl-ics, .rp-others, .hm-card, .hm-box { border-color: transparent; border-radius: var(--card); background: var(--sheet); }
.imp-bring { border: 2px dashed var(--rule-strong); }
.need-card { background: var(--fill); }
.imp-wait .need-card { background: var(--paper); }
.tabbar { display: none; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .app { grid-template-rows: 64px minmax(0, 1fr); }
  .topbar { padding: 0 14px; }
  .brand-name { display: none; }
  .brand { margin-inline-end: auto; }
  .app.show-register:not(.on-home) .brand img { display: none; }
  .theme-btn { display: none !important; } /* in Settings › Theme */
  .top-pill .btn { min-width: 44px; min-height: 44px; padding: 0 10px; }
  .top-pill #new-tx { min-width: 40px; min-height: 40px; width: 40px; padding: 0; font-size: 26px; font-weight: 400; line-height: 1; }
  .app.show-register .back { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--glass); border: 1px solid var(--glass-line); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); color: var(--ink); font-size: 30px; padding-bottom: 3px; }
  .app.on-home .back { display: none; }
  .sidebar { border: 0; padding: 0 14px 120px; }
  /* what has its own tab is not repeated in the accounts list */
  .sidebar .side-nav, .sidebar .side-home, .sidebar .owed, .sidebar .safe-box, .sidebar .env-box, .sidebar .credits, .sidebar .check, .sidebar .side-new { display: none; }
  .main { padding-bottom: 0; }
  .budget-scroll, .reg-scroll, .hm-scroll { padding-bottom: 120px !important; }

  /* the floating glass tab bar */
  .tabbar { position: fixed; z-index: 30; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom) * 0.6); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 6px;
    border: 1px solid var(--glass-line); border-radius: 999px; background: var(--glass); -webkit-backdrop-filter: blur(26px) saturate(1.9); backdrop-filter: blur(26px) saturate(1.9); box-shadow: 0 10px 30px rgb(0 0 0 / 0.35); }
  .app.is-empty .tabbar, body.sheet-open .tabbar { display: none; }
  .app.is-empty .side-title { display: none; }
  .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 54px; padding: 4px 0; border: 0; border-radius: 999px; background: none; color: var(--ink); font: inherit; font-size: 11px; font-weight: 500; cursor: pointer; }
  .tabbar button.is-current { color: var(--accent); font-weight: 600; background: var(--fill); }
  .tab-n { position: absolute; top: 1px; left: calc(50% + 4px); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: #ff3b30; color: #fff; font-size: 12px; font-weight: 600; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px var(--paper); }
  .menu-title { margin-top: 2px; }
  .sheet-panel, .sheet-panel.entry { border-radius: 0; }
}

/* ---------- computers: the same look, the accounts at the side ---------- */
@media (min-width: 761px) {
  .app { grid-template-columns: 380px minmax(0, 1fr); }
  .side-title { font-size: 28px; }
  .brand img { width: 34px; height: 34px; padding: 6px; }
  .main { background: var(--paper); }
}
