/* ======================================================================
   Perisso v12: calm layout, green and gold.
   Loaded after app.css and overrides it. Light ("ivory" id): a soft green-white with deep emerald and gold.
   Dark ("luxe" id): deep emerald with gold. Text colours were picked for WCAG AA contrast on their backgrounds.
   ====================================================================== */
:root, :root[data-theme="ivory"] {
  --bg: #F2F7F5; --panel: #FFFFFF; --panel2: #E9F1EE; --text: #0B241F; --muted: #4F6A63; --faint: #8DA19B; --line: #DCE7E3;
  --accent: #19443C; --accent-ink: #FFFFFF; --accent-soft: #E1EDE9; --emerald: #19443C; --emerald-deep: #0B241F; --sel: #19443C; --sel-ink: #FFFFFF;
  --gold: #A77E01; --gold-text: #876600; --gold-soft: #E9D9A6; --gold-deep: #A77E01; --gold-hi: #C9A33A;
  --neg: #BE1212; --neg-soft: #F8E6E7; --pos: #21964A; --hi: #21964A; --lo: #BE1212; --today: #A77E01;
  --tint: #E6F0EC; --tint2: #D7E7E1; --strip: #E6F0EC;
  --shadow: 0 1px 2px rgba(11,36,31,.05), 0 6px 22px rgba(11,36,31,.06);
  --r: 16px; --serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  color-scheme: light;
}
:root[data-theme="luxe"] {
  --bg: #0A1D19; --panel: #102823; --panel2: #16332D; --text: #EDF4F1; --muted: #A3BAB3; --faint: #6F8C84; --line: #234139;
  --accent: #D4B25C; --accent-ink: #0B241F; --accent-soft: #1D3A2F; --emerald: #2E6B5C; --emerald-deep: #0B241F; --sel: #2F7564; --sel-ink: #FFFFFF;
  --gold: #D4B25C; --gold-text: #D9BA68; --gold-soft: #5A4B22; --gold-deep: #B8963E; --gold-hi: #E8CF8A;
  --neg: #F1A1A6; --neg-soft: #3A2226; --pos: #82D2AA; --hi: #82D2AA; --lo: #F1A1A6; --today: #D4B25C;
  --tint: #143029; --tint2: #1B3B33; --strip: #143029;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}
body { -webkit-font-smoothing: antialiased; }

/* ---------- header (all sizes): fewer boxes, quieter icons ---------- */
.topbar { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 90%, transparent); }
.topbar::after { display: none !important; }
.brand { color: var(--emerald); }
:root[data-theme="luxe"] .brand { color: var(--gold); }
.iconbtn { border-color: transparent; background: transparent; color: var(--muted); }
.iconbtn:not(:disabled):hover { color: var(--text); }
.hdrline, #dailyLine { display: none !important; }      /* the line of the day now sits at the top of the Menu */
.hdrcal { display: none; }
.btn { border-radius: 12px; background: var(--panel); }
.btn.primary { background: var(--emerald); border-color: var(--emerald); color: #fff; }
:root[data-theme="luxe"] .btn.primary { background: var(--gold); border-color: var(--gold); color: var(--emerald-deep); }
.calbtn { background: transparent; border-color: transparent; color: var(--muted); }
.calbtn.active, .calbtn:hover { color: var(--text); border-color: var(--line); }
.menubtn { background: transparent; border-color: transparent; }
.badge { background: var(--neg); color: #fff; }

/* Menu: the line of the day at the top, quiet items */
.navpanel { border-radius: 18px; border-color: var(--line); box-shadow: var(--shadow); }
.menuquote { margin: 4px 8px 6px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 15px; line-height: 1.3; color: var(--emerald); display: flex; gap: 6px; align-items: flex-start; }
:root[data-theme="luxe"] .menuquote { color: var(--gold-text); }
.menuquote .qtext { flex: 1; }
.navpanel button:disabled { opacity: .45; cursor: default; }

/* ---------- account tabs: plain text with a gold underline ---------- */
.tabs.acctabs { gap: 20px; padding: 4px 18px 0; border-bottom: 1px solid var(--line); }
.tabs.acctabs button { min-width: 0; flex-direction: column; align-items: flex-start; gap: 0; background: transparent; border: 0; border-radius: 0; padding: 8px 0 9px; box-shadow: none; position: relative; color: var(--muted); }
.tabs.acctabs button .n { font-size: 14px; color: inherit; letter-spacing: 0; }
.tabs.acctabs button .sw { display: none; }
.tabs.acctabs button .b { font-size: 12px; font-weight: 500; color: var(--faint); margin-top: 1px; }
.tabs.acctabs button.active { color: var(--text); background: transparent; box-shadow: none; }
.tabs.acctabs button.active .n { font-weight: 650; color: var(--text); }
.tabs.acctabs button.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--gold); }
.tabs.acctabs button:hover:not(.active) { background: transparent; color: var(--text); }
.tabs.acctabs .reorderbtn { border: 0; background: transparent; color: var(--faint); align-self: center; margin-left: -8px; }
.envtabs button { border-radius: 999px; }

/* ---------- the summary strip ---------- */
.v12strip { display: flex; align-items: center; gap: 12px; width: 100%; margin: 10px 0 6px; padding: 10px 14px; border: 0; border-radius: 14px; background: var(--strip); color: var(--text); text-align: left; cursor: pointer; position: relative; font: inherit; }
.v12strip:hover { background: var(--tint2); }
.v12strip > span { display: flex; flex-direction: column; min-width: 0; }
.v12strip .v12k { font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.v12strip .v12v { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.v12strip .v12sts b { font-size: 19px; font-weight: 650; color: var(--emerald); letter-spacing: -.01em; }
:root[data-theme="luxe"] .v12strip .v12sts b { color: var(--gold-text); }
.v12strip .v12sts b.neg, :root[data-theme="luxe"] .v12strip .v12sts b.neg { color: var(--neg); }
.v12strip .v12u { font-size: 12px; color: var(--muted); }
.v12strip .v12sep { align-self: stretch; width: 1px; flex: none; background: var(--line); margin: 2px 2px; }
.v12strip .v12bal b { font-size: 15px; font-weight: 550; }
.v12strip .v12chev { margin-left: auto; color: var(--muted); flex: none; }
.v12strip .v12flag { position: absolute; top: 9px; right: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--neg); }
.typehint { display: none !important; }
.modal .typehint { display: block !important; }
.ovh { margin: 14px 0 6px; font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 21px; color: var(--text); }
.ovacc .sw { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
#ovStsAcc { border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px 4px; }

/* ---------- calendar (all sizes): no grid lines, calm cells ---------- */
.calnav h2 { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 28px; color: var(--emerald); line-height: 1; }
:root[data-theme="luxe"] .calnav h2 { color: var(--gold-text); }
.calnav .btn { background: transparent; }
.calnav .btn[data-nav] { border-color: transparent; color: var(--muted); }
.calnav .btn[data-today] { border-color: transparent; color: var(--gold-text); font-weight: 650; letter-spacing: .06em; text-transform: uppercase; font-size: 12.5px; }
.grid, body.calfit .grid { background: transparent; gap: 0; border: 0; border-radius: 0; box-shadow: none; overflow: visible; }
.grid .dow { background: transparent; color: var(--faint); font-size: 10.5px; letter-spacing: .1em; text-align: center; border-bottom: 1px solid var(--line); }
.day, body.calfit .day { background: transparent; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.day:hover { background: var(--tint); }
.day.other { background: transparent; opacity: 1; }
.day.other .dn span { color: var(--faint); opacity: .7; }
.day.today .dn span { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--gold); border-radius: 999px; }
.day.sel .dn span, .day.sel.today .dn span { background: var(--sel); color: var(--sel-ink); box-shadow: none; border-radius: 999px; }
.day.sel, .day.sel.hiday, .day.hiday { box-shadow: none !important; background: transparent; }
.day.negday { background: transparent; }
.day .bal { color: var(--muted); font-weight: 450; }
.day.negday .bal { color: var(--neg); }
.day.payday .bal { color: var(--pos); font-weight: 650; }
.cellmark { display: none !important; }
.edot { display: none; }

/* ---------- day panel ---------- */
.dp .dphd { display: flex; align-items: baseline; gap: 10px; }
.dp .dphd h3.dptitle { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 22px; line-height: 1.1; color: var(--text); margin: 0; }
.dp .dpbal { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.dp .dpbal b { color: var(--text); font-weight: 650; margin-left: 3px; }
.dp .row { border-bottom: 1px solid var(--line); }
.dp .row .num.neg { color: var(--text); }
.dp .row .num.pos { color: var(--pos); }
.dp .row .pill { background: transparent; border: 0; color: var(--faint); padding: 0 2px; }
.dp .row .bin { opacity: 0; transition: opacity .12s; filter: grayscale(1); }
.dp .row:hover .bin, .dp .row .bin:focus-visible { opacity: .75; }
.dp .row input[data-done] { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); background: transparent; margin: 0; flex: none; cursor: pointer; }
.dp .row input[data-done]:checked { background: var(--emerald); border-color: var(--emerald); box-shadow: inset 0 0 0 3px var(--panel); }
.dp .v11pbtns .btn { background: transparent; }
.v12hint { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 6px; padding: 8px 10px; border-radius: 12px; background: var(--tint); color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.v12hint span { flex: 1; }
.v12hint .x { border: 0; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 2px; cursor: pointer; }
.dpagain { display: none; }
@media (hover: hover) and (pointer: fine) { .v12hint { display: none; } }

/* swipe feedback */
.dp .row { position: relative; touch-action: pan-y; }
.dp .row.swiping > * { transform: translateX(var(--dx, 0)); transition: none; }
.dp .row.swiping.swl { background: var(--neg-soft); }
.dp .row.swiping.swr { background: color-mix(in srgb, var(--pos) 14%, var(--panel)); }
.dp .row.swiping::after { position: absolute; top: 50%; transform: translateY(-50%); font-size: 12.5px; font-weight: 650; letter-spacing: .04em; }
.dp .row.swiping.swl::after { content: 'Delete'; right: 12px; color: var(--neg); }
.dp .row.swiping.swr::after { content: 'Done'; left: 12px; color: var(--pos); }

/* ---------- the + (desktop quick categories button) and toast ---------- */
.fab { background: var(--emerald); color: var(--gold-hi); border: 1.5px solid var(--gold-soft); box-shadow: 0 6px 18px rgba(11,36,31,.25); }
.toast { background: var(--emerald-deep); color: #fff; border-radius: 14px; }
:root[data-theme="luxe"] .toast { background: #EDF4F1; color: var(--emerald-deep); }
.toast .toastbtn { color: var(--gold-hi); }
:root[data-theme="luxe"] .toast .toastbtn { color: var(--gold-deep); }

/* login: emerald glow instead of brown */
.login { background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--emerald) 22%, var(--bg)) 0%, var(--bg) 62%); }
.loginname { color: var(--emerald); }
:root[data-theme="luxe"] .loginname { color: var(--gold); }

/* ======================================================================
   Phones and the installed app (up to 700px)
   ====================================================================== */
@media (max-width: 700px) {
  /* header: menu, month, arrows, TODAY */
  .topbar { min-height: 54px; padding: calc(8px + env(safe-area-inset-top)) 14px 4px 10px; gap: 4px; border-bottom: 0; background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  #undoBtn, #redoBtn, #helpBtn, #searchBtn, #themeBtn, #calBtn, #invBtn, #pageHelpBtn, #pageSearchBtn, .v11qtop { display: none !important; }
  body[data-view="investments"] #calBtn { display: none !important; }
  .menubtn { width: 38px; height: 38px; border-radius: 12px; color: var(--text); }
  .navwrap { order: -1; }
  .menubtn .badge { position: absolute; top: 2px; right: 0; min-width: 16px; line-height: 16px; font-size: 10px; padding: 0 4px; }
  .menubtn { position: relative; }
  body[data-view="calendar"] .brand:not(.v12keep) { display: none; }
  body[data-view="calendar"] .hdrcal:not([hidden]) { display: flex; }
  .brand { position: static; transform: none; margin-left: 4px; gap: 8px; }
  .brand img { width: 28px; height: 28px; box-shadow: none; }
  .brand > span { display: inline !important; font-size: 24px; }
  .hdrcal { flex: 1; min-width: 0; align-items: center; gap: 2px; }
  .hcmonth { flex: 1 1 auto; min-width: 0; text-align: left; border: 0; background: transparent; padding: 0 0 2px 4px; font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 29px; line-height: 1.05; color: var(--emerald); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
  :root[data-theme="luxe"] .hcmonth { color: var(--gold-text); }
  .hcmonth .mshort { display: none; }
  .hcnav { display: flex; flex: none; }
  .hcbtn { width: 32px; height: 36px; border: 0; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; padding: 0; }
  .hctoday { flex: none; border: 0; background: transparent; color: var(--gold-text); font-size: 12.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; padding: 8px 0 8px 8px; }
  .navpanel { top: calc(56px + env(safe-area-inset-top)); left: 10px; right: auto; width: min(300px, calc(100vw - 20px)); max-height: calc(100vh - 150px); overflow-y: auto; }
  body.navfrommore .navpanel { top: auto; bottom: calc(76px + env(safe-area-inset-bottom)); left: auto; right: 10px; position: fixed; }

  /* account tabs */
  .tabs.acctabs { gap: 20px; padding: 2px 16px 0; }
  .tabs.acctabs button { padding: 7px 0 9px; }
  .tabs.acctabs button .n { font-size: 14px; }
  .tabs.acctabs button .b, .tabs.acctabs .reorderbtn { display: none; }
  .envtabs { padding-top: 8px; }

  /* the month bar moves into the header on phones */
  #view-calendar .calnav { display: none !important; }
  .v12strip { margin: 10px 0 4px; }
  main { padding: 0 10px calc(84px + env(safe-area-inset-bottom)); }
  html.phonecal main { padding-bottom: 0; }

  /* calendar cells: date, a small dot, a muted balance */
  .grid .dow { padding: 6px 0 3px; border-bottom: 0; }
  .day, body.calfit .day { height: var(--rowh, 52px); padding: 4px 0 0; align-items: center; gap: 0; border-bottom: 0; overflow: visible; }
  .day:hover { background: transparent; }
  .day .dn, body.calfit .day .dn { padding: 0; justify-content: center; font-size: 15px; line-height: 1; font-weight: 500; width: 100%; }
  .day .dn span, .day.today .dn span { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border-radius: 50%; }
  .day.sel .dn span { font-weight: 650; }
  .day .bm { position: absolute; top: 2px; right: 3px; font-size: 9px; color: var(--gold); }
  .day .it, .day .more, .day .dots { display: none !important; }
  .edot { display: block; position: absolute; left: 50%; top: calc(4px + 28px + 1px); width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--gold); }
  .day.payday .edot { background: var(--pos); }
  .day .bal, body.calfit .day .bal { position: static; margin-top: 7px; font-size: 10.5px; line-height: 1; letter-spacing: .01em; text-align: center; width: 100%; }
  .grid.tight .day .dn span { width: 25px; height: 25px; }
  .grid.tight .edot { top: calc(4px + 25px + 1px); }
  .grid.tight .day .bal { margin-top: 6px; }

  /* the day sheet below the calendar */
  html.phonecal .side#dayPanel { margin: 8px -10px 0; border: 0; border-radius: 22px 22px 0 0; background: var(--panel); box-shadow: 0 -1px 0 var(--line), 0 -8px 24px rgba(11,36,31,.05); }
  html.phonecal .dp .dphd { margin: 0 -14px 2px; padding: 14px 18px 8px; border-bottom: 0; background: var(--panel); pointer-events: none; }   /* v12.13: the sticky heading was overlapping the first row and eating its swipe */
  .dp .dphd h3.dptitle { font-size: 22px; }
  #dayPanel .card.dp { padding-left: 18px; padding-right: 18px; }
  .dp .row { padding: 10px 0; gap: 10px; }
  .dp .row input[data-done], .dp .row .bin { display: none !important; }
  .dp .row .ttl { font-size: 15px; font-weight: 500; }
  .dp .row .meta { font-size: 12.5px; color: var(--muted); }
  .dp .row .num { font-size: 15px; font-weight: 500; }
  .dp .row.picked { background: var(--tint); }
  .dp .row input[data-cpick], .dp .row input[data-pick] { accent-color: var(--emerald); }
  #dpSelect { display: none !important; }
  .dp .schedrow:has(.schedhd.none) { display: block; }
  .dp .schedhd.none { color: var(--muted); font-weight: 400; font-size: 14px; margin: 8px 0; }
  .dpagain { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; overflow-x: auto; scrollbar-width: none; }
  .dpagain::-webkit-scrollbar { display: none; }
  .dpagain .qalab { flex: none; font-size: 12px; color: var(--muted); }
  .dpagain .qachips { display: flex; gap: 8px; flex-wrap: nowrap; }
  .dpagain .chip { flex: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text); font-size: 13px; white-space: nowrap; }
  .dp .bmk { font-size: 13px; margin: 12px 0 8px; }

  /* bottom bar: Calendar, Accounts, +, Investments, More */
  .bottomnav { display: flex !important; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; height: calc(64px + env(safe-area-inset-bottom)); padding: 6px 4px env(safe-area-inset-bottom); align-items: flex-start; justify-content: space-around;
    background: color-mix(in srgb, var(--panel) 94%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--line); box-shadow: none; }
  .bottomnav button { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: transparent; color: var(--faint); font-size: 10.5px; padding: 4px 0 0; min-width: 0; position: relative; }
  .bottomnav button.active, #moreBtn.active, #moreBtn[aria-expanded="true"] { color: var(--emerald); font-weight: 650; }
  :root[data-theme="luxe"] .bottomnav button.active, :root[data-theme="luxe"] #moreBtn.active, :root[data-theme="luxe"] #moreBtn[aria-expanded="true"] { color: var(--gold-text); }
  .bottomnav button.bnadd { flex: 0 0 auto; width: 52px; height: 52px; margin: -20px 6px 0; border-radius: 50%; background: var(--emerald); color: var(--gold-hi); box-shadow: 0 6px 16px rgba(11,36,31,.28), inset 0 0 0 1.5px var(--gold-soft); justify-content: center; padding: 0; }
  .bottomnav button.bnadd svg { width: 26px; height: 26px; stroke-width: 2; }
  .bottomnav .dot { position: absolute; top: 2px; right: calc(50% - 15px); width: 7px; height: 7px; border-radius: 50%; background: var(--neg); }
  .morepanel { display: none !important; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .calsel { bottom: calc(72px + env(safe-area-inset-bottom)) !important; }
  body.loginopen .bottomnav { display: none !important; }
}

/* ======================================================================
   Wide screens: same palette, roomier, no bottom bar
   ====================================================================== */
@media (min-width: 701px) {
  .bottomnav, .morepanel { display: none !important; }
  .navpanel .v12mi { display: none; }   /* wide screens keep Search, Undo, ? and the theme as header icons */
  .day .bal, body.calfit .day .bal { font-size: 12px; }
  .day .dn span { display: inline-block; min-width: 24px; text-align: center; padding: 1px 6px; }
  .day.sel { background: var(--tint); }
  .day .it { border-radius: 6px; }
  .edot { display: none !important; }
  .dp { border: 0; box-shadow: var(--shadow); }
  .card { border-color: var(--line); }
  .v12strip { max-width: none; }
}

/* v12 fixes over older rules */
#dailyLine:not([hidden]), .hdrline:not([hidden]) { display: none !important; }
.card h3 { color: var(--gold-text); }
.dp .dphd h3.dptitle { text-transform: none; letter-spacing: 0; }
.dp .row .cdot { width: 7px; height: 7px; box-shadow: none; margin-right: 8px; vertical-align: 2px; }
@media (max-width: 700px) {
  .bottomnav button span.bl { font-size: 10.5px; line-height: 1.2; }
  .bottomnav button svg { width: 22px; height: 22px; }
}

.navpanel { padding-top: 6px; }
.menubtn.active { border-color: transparent; color: var(--text); }
#view-accounts .envhd h3 { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 21px; letter-spacing: 0; text-transform: none; color: var(--text); }
.dpagain .qalab { text-transform: none; letter-spacing: 0; font-weight: 500; }
@media (min-width: 701px) {
  .calnav h2, body.calfit .calnav h2 { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 30px; line-height: 1.1; color: var(--emerald); min-width: 230px; text-align: center; }
  :root[data-theme="luxe"] .calnav h2, :root[data-theme="luxe"] body.calfit .calnav h2 { color: var(--gold-text); }
  .calnav .caret { font-size: 12px; color: var(--faint); font-family: var(--font); font-style: normal; vertical-align: 4px; }
  .calnav .btn[data-nav] { font-size: 18px; }
}

.navpanel > * { flex-shrink: 0; }

/* ======================================================================
   v12.1: gold daily balances, day grid lines, Balance figure removed from the strip
   Light: balances in a deepened brand gold (#8F6C00, 4.5:1 on the page) so small figures stay readable; brand gold #A77E01 is 3.45:1.
   Dark: #D4AF37 (8.3:1 on the page). Lowest day stays rose, payday stays green, below-$0 stays rose.
   ====================================================================== */
:root, :root[data-theme="ivory"] { --cellbal: #8F6C00; --gridline: #E4D9B4; }
:root[data-theme="luxe"] { --cellbal: #D4AF37; --gridline: rgba(212,175,55,.16); }
.day .bal { color: var(--cellbal); font-weight: 600; }
.day.negday .bal { color: var(--neg); }
.day.payday .bal { color: var(--pos); font-weight: 700; }
.day.payday.negday .bal { color: var(--neg); }
.day.other .bal { color: var(--faint); }

/* a thin gold line between days, so each day has its own place */
.grid .dow { border-bottom: 1px solid var(--gridline); }
.grid > .day, body.calfit .grid > .day { border-bottom: 1px solid var(--gridline); border-right: 1px solid var(--gridline); }
.grid > .day:nth-child(7n) { border-right: 0; }

/* the summary row (Detailed, phone) */
.v12strip .v12sep, .v12strip .v12bal { display: none; }

/* longer figures (with cents) fit a cell */
.day .bal.long { letter-spacing: -.01em; }
@media (max-width: 700px) {
  .grid > .day, body.calfit .grid > .day { border-bottom: 1px solid var(--gridline); }
  .day .bal.long, body.calfit .day .bal.long { font-size: 9.5px; letter-spacing: -.02em; }
  .day .bal.xlong, body.calfit .day .bal.xlong { font-size: 8.5px; letter-spacing: -.03em; }
  /* v12.1: balances show under the account names on phones too (the strip's Balance figure was removed) */
  .tabs.acctabs button .b { display: block; font-size: 11.5px; }
}
@media (min-width: 701px) {
  .day .bal.xlong, body.calfit .day .bal.xlong { font-size: 11px; }
}
/* the account tab balances: gold, so they stand out like the calendar figures */
.tabs.acctabs button .b { color: var(--cellbal); font-weight: 600; }
.tabs.acctabs button .b.neg { color: var(--neg); }
@media (max-width: 700px) {
  /* v12.1: a little more room between the entry dot and the daily figure */
  .day .bal, body.calfit .day .bal { margin-top: 9px; }
  .grid.tight .day .bal { margin-top: 8px; }
  .edot { top: calc(4px + 28px + 1.5px); }
  .grid.tight .edot { top: calc(4px + 25px + 1.5px); }
}

/* v12.3: no underline on entries anywhere: calendar entries, the day's hover card, the day panel rows under Quick add, and lists, at rest and on hover.
   A soft background stays as the hover cue. (The "cross out done entries" setting keeps its line-through on done entries.) */
.day .it:not(.done), .day .it:not(.done) *, .dayhover .dh-it:not(.done), .dayhover .dh-it:not(.done) *, .dp .row:not(.done), .dp .row:not(.done) *,
.list .row:not(.done), .list .row:not(.done) *, .grow.click .ttl, .catrow[data-cat] .nm { text-decoration: none !important; }
@media (hover: hover) {
  .day .it:not(.done):hover, .day .it:not(.done):hover *, .dayhover .dh-it:not(.done):hover *, .dp .row:not(.done):hover *, .grow.click:hover .ttl, .catrow[data-cat]:hover .nm { text-decoration: none !important; }
  .day .it[data-key]:hover { background: color-mix(in srgb, var(--tint2) 70%, transparent); }
  .dp .row[data-key]:hover { background: var(--tint); }
}

/* ======================================================================
   v12.3: negative figures in red; a calmer, more compact day list
   Red: light #B3261E (6.0:1 on the page), dark #FF7B72 (6.9:1). Positives stay green, normal daily balances gold.
   ====================================================================== */
:root, :root[data-theme="ivory"] { --neg: #BE1212; --neg-soft: #FBE9E7; --lo: #BE1212 }
:root[data-theme="luxe"] { --neg: #FF7B72; --neg-soft: #3A2224; --lo: #FF7B72 }
.num.neg, .neg.num, b.neg, .tabs.acctabs button .b.neg, .v12strip .v12sts b.neg, :root[data-theme="luxe"] .v12strip .v12sts b.neg { color: var(--neg) !important; }
.day .it .num.neg, .dp .row .num.neg, .dp .row .num.neg { color: var(--neg); }
.day.negday .bal { color: var(--neg); }

/* the day's entries (desktop panel and phone sheet): lighter and tighter */
.dp .row { padding: 7px 2px; gap: 9px; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.dp .row:last-of-type { border-bottom: 0; }
.dp .row .ttl { font-size: 14px; font-weight: 500; line-height: 1.25; letter-spacing: 0; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp .row .meta { font-size: 12px; line-height: 1.3; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp .row .num { font-size: 14px; font-weight: 550; letter-spacing: 0; }
.dp .row .num.pos { color: var(--pos); }
.dp .row .num:not(.neg):not(.pos) { color: var(--gold-text); }
.dp .row .cdot { width: 6px; height: 6px; margin-right: 7px; vertical-align: 2px; }
.dp .row .pill { font-size: 11px; color: var(--faint); padding: 0 1px; }
.dp .row input[data-done] { width: 16px; height: 16px; border-width: 1.25px; border-color: color-mix(in srgb, var(--muted) 45%, transparent); }
.dp .row input[data-done]:checked { box-shadow: inset 0 0 0 2.5px var(--panel); }
.dp .grow.click { padding: 2px 6px; margin: -2px -2px; }
.dp .row.done .ttl, .dp .row.done .meta, .dp .row.done .num { opacity: .55; }
.dp .bmk { margin-top: 8px; font-size: 12.5px; color: var(--faint); }
@media (max-width: 700px) {
  .dp .row { padding: 9px 2px; }   /* a little more room for fingers on a phone */
  .dp .row .ttl { font-size: 15px; }
  .dp .row .meta { font-size: 12.5px; }
  .dp .row .num { font-size: 15px; }
}

/* v12.3: light theme on a soft green page so gold, green and red figures stand out. Text colours re-checked on the new page (#E6EFEA):
   gold #7F5F00 5.1:1, green #176A48 5.6:1, red #B3261E 5.6:1, muted #4A645D 5.5:1, text 13.9:1. Day lines a deeper light gold. */
:root, :root[data-theme="ivory"] {
  --bg: #E6EFEA; --panel: #EDF4F0; --panel2: #E1EBE6; --line: #CFDDD6; --muted: #4A645D; --faint: #7D928B;
  --tint: #DCE8E2; --tint2: #D7E5DE; --strip: #DCE8E2; --accent-soft: #D6E6DF;
  --cellbal: #7F5F00; --gold-text: #7F5F00; --pos: #21964A; --hi: #21964A; --gridline: #D4C38A;
}

/* v12.3: Categories panel — compact rows like the day list; sections and groups fold away (chevron), remembered per device */
.cp .cpsec h4 { margin: 10px 0 2px; padding: 0 0 3px; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--muted); }
.cp .cpsec h4 button, .cp .cgl { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 6px; width: 100%; cursor: pointer; border-radius: 6px; }
.cp .cpsec h4 button { padding: 3px 2px; text-transform: uppercase; }
.cp .cgl { margin: 6px 0 1px; padding: 2px 2px; font-size: 11.5px; font-weight: 550; color: var(--muted); }
.cp .cpsec h4 button:focus-visible, .cp .cgl:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (hover: hover) { .cp .cpsec h4 button:hover, .cp .cgl:hover { background: var(--tint); } }
.cp .chev { width: 6px; height: 6px; flex: none; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin: -3px 3px 0 2px; transition: transform .15s; opacity: .8; }
.cp .folded > h4 .chev, .cp .cpgrp.folded > .cgl .chev { transform: rotate(-45deg); margin-top: 0; }
.cp .cpsec.folded > .cpsb, .cp .cpgrp.folded > .cpgb { display: none; }
.cp .cprow { grid-template-columns: 16px 7px minmax(0, 1fr) auto; gap: 8px; padding: 5px 6px; margin: 0 -4px; border-bottom: 1px solid color-mix(in srgb, var(--line) 40%, transparent); border-radius: 6px; }
.cp .cprow input { width: 15px; height: 15px; }
.cp .cprow .sw { width: 7px; height: 7px; box-shadow: none; }
.cp .cprow .cn { font-size: 14px; font-weight: 500; line-height: 1.25; }
.cp .cprow .ctot { font-size: 13px; font-weight: 550; } .cp .cprow .ctot small { font-size: 11.5px; }
.cp .cprow .ctot.muted { color: var(--muted); }
@media (max-width: 700px) { .cp .cprow { padding: 7px 6px; } .cp .cprow .cn { font-size: 15px; } }

/* v12.3: Investments totals in the Calendar's text-tab style. Balance beneath in gold, owing/negative in red, Net worth marked like the selected tab. */
.tabs.acctabs.invtabs { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 20px; scrollbar-width: none; }
.tabs.acctabs.invtabs::-webkit-scrollbar { display: none; }
.tabs.acctabs.invtabs .nwchip { flex: none; min-width: 0; max-width: none; display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 0 9px; background: transparent; border: 0; border-radius: 0; position: relative; color: var(--muted); grid-column: auto; }
.tabs.acctabs.invtabs .nwchip .n { font-size: 14px; color: inherit; white-space: nowrap; line-height: 1.3; }
.tabs.acctabs.invtabs .nwchip .b { display: block; font-size: 12px; font-weight: 600; color: var(--cellbal); margin-top: 1px; white-space: nowrap; }
.tabs.acctabs.invtabs .nwchip .b.neg { color: var(--neg) !important; }
.tabs.acctabs.invtabs .nwchip.hi { color: var(--text); background: transparent; }
.tabs.acctabs.invtabs .nwchip.hi .n { font-weight: 650; color: var(--text); }
.tabs.acctabs.invtabs .nwchip.hi::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--gold); }
.tabs.acctabs.invtabs .reorderbtn { display: inline-flex; flex: none; margin-left: -8px; }
@media (max-width: 700px) {
  .tabs.acctabs.invtabs { display: flex; gap: 18px; padding: 2px 16px 0; }
  .tabs.acctabs.invtabs .nwchip { padding: 7px 0 9px; }
  .tabs.acctabs.invtabs .nwchip .b { font-size: 11.5px; }
}

/* v12.3 phones: no line of the day; steady add/edit sheet; the day list scrolls all the way to "Bookmark this day"; tighter entry rows */
@media (max-width: 700px) {
  .menuquote, #dailyLineMenu { display: none !important; }
  html.modalopen, html.modalopen body { overflow: hidden; overscroll-behavior: none; }
  .modal { height: 100dvh; }
  .sheet { max-height: 92dvh; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; transform: none; transition: none; }
  /* 16px or more in every box, after the text-size zoom, so iOS never zooms in when a box is tapped */
  .sheet input:not([type=checkbox]):not([type=radio]), .sheet select, .sheet textarea, .qa input, .qa select { font-size: max(16px, 1rem); }
  html[data-text="std"] .sheet input:not([type=checkbox]):not([type=radio]), html[data-text="std"] .sheet select, html[data-text="std"] .sheet textarea { font-size: calc(16px / .92); }
  html.phonecal .side#dayPanel { overscroll-behavior-y: none; scroll-padding-bottom: 24px; }   /* v12.13: none, so a swipe on the first row is not cancelled by edge overscroll */
  html.phonecal .side#dayPanel > .card.dp { min-height: 0; padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  /* compact rows, like the computer's day panel */
  .dp .row { padding: 6px 2px; gap: 8px; }
  .dp .row .ttl { font-size: 14px; line-height: 1.2; }
  .dp .row .meta { font-size: 12px; line-height: 1.25; margin-top: 0; }
  .dp .row .num { font-size: 14px; }
  .list .row { padding-top: 7px; padding-bottom: 7px; }
  .list .row .ttl { font-size: 14px; font-weight: 500; }
  .list .row .meta { font-size: 12px; }
}

/* v12.3: the day heading in the same gold as the balances */
.dp .dphd h3.dptitle { color: var(--cellbal); }
/* v12.3: no plain white in the light theme; boxes get a pale green */
:root[data-theme="ivory"] input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), :root[data-theme="ivory"] select, :root[data-theme="ivory"] textarea,
:root:not([data-theme]) input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), :root:not([data-theme]) select, :root:not([data-theme]) textarea { background-color: #F2F7F4; }

/* v12.3: the wordmark in the balance gold */
.brand > span, :root[data-theme="luxe"] .brand > span { color: var(--cellbal); }

/* v12.3: Investments totals fold into one Net worth bar */
.tabs.acctabs.invtabs { flex-direction: column; align-items: stretch; gap: 0; overflow: visible; padding-top: 6px; padding-bottom: 6px; }
.nwbar { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 2px; cursor: pointer; border-radius: 8px; }
.nwbar .n { font-size: 14px; font-weight: 650; color: var(--text); }
.nwbar b { font-size: 15px; font-weight: 650; color: var(--cellbal); }
.nwbar b.neg { color: var(--neg); }
.nwbar .chev { margin-left: auto; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); margin-top: -4px; transition: transform .15s; }
.nwbar[aria-expanded="true"] .chev { transform: rotate(-135deg); margin-top: 3px; }
.nwbar:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (hover: hover) { .nwbar:hover { background: var(--tint); } }
.nwcards { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 20px; scrollbar-width: none; border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.nwcards::-webkit-scrollbar { display: none; }
.nwcards[hidden] { display: none; }
@media (max-width: 700px) { .tabs.acctabs.invtabs { display: flex; flex-direction: column; padding: 4px 16px 4px; } .nwcards { gap: 18px; } }

/* View summary: the same totals as cards */
.nwcardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 6px 0 4px; }
.nwcard { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--tint); border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); min-width: 0; }
.nwcard .n { font-size: 12px; color: var(--muted); }
.nwcard b { font-size: 14px; font-weight: 650; color: var(--cellbal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nwcard b.neg { color: var(--neg) !important; }
.nwcard small { font-size: 11px; line-height: 1.25; }
.nwcard.hi { grid-column: 1 / -1; background: var(--accent-soft); }
.nwcard.hi .n { font-weight: 650; color: var(--text); }
.nwcard.hi b { font-size: 16px; }
.tabs.acctabs.invtabs button.nwbar { flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; padding: 6px 2px; width: 100%; color: var(--text); min-width: 0; }
.tabs.acctabs.invtabs button.nwbar::after { display: none; }
.tabs.acctabs.invtabs button.nwbar:hover { color: var(--text); }

/* ======================================================================
   v12.3: a richer light theme that stands out like the dark one. Dark is unchanged.
   Page #D9E7DF (deeper soft green), panels #E4EEE8, no white anywhere. Text #0B241F (12.8:1), headings and day numbers #19443C,
   balances gold #755500 bold (5.4:1 on the page, 5.8:1 on panels), positives #0B6138 (5.9:1), negatives #A3201A (5.9:1), muted #3E5A52 (5.9:1).
   ====================================================================== */
:root, :root[data-theme="ivory"] {
  --bg: #D9E7DF; --panel: #E4EEE8; --panel2: #D2E2D9; --line: #B9CFC4; --text: #0B241F; --muted: #3E5A52; --faint: #546E66;
  --tint: #D0E1D7; --tint2: #C9DCD1; --strip: #19443C; --accent-soft: #CFE2D8;
  --cellbal: #755500; --gold-text: #755500; --pos: #21964A; --hi: #21964A; --neg: #BE1212; --lo: #BE1212;
  --gridline: #BFA35A; --emerald-ink: #19443C;
}
:root[data-theme="ivory"] input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), :root[data-theme="ivory"] select, :root[data-theme="ivory"] textarea,
:root:not([data-theme]) input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), :root:not([data-theme]) select, :root:not([data-theme]) textarea { background-color: #EAF2ED; }
:root:not([data-theme="luxe"]) .day .bal { font-weight: 700; }
:root:not([data-theme="luxe"]) .day .dn, :root:not([data-theme="luxe"]) .dp .dphd h3, :root:not([data-theme="luxe"]) .calnav h2, :root:not([data-theme="luxe"]) .hcmonth { color: var(--emerald-ink); }
:root:not([data-theme="luxe"]) .day.other .dn { color: color-mix(in srgb, var(--emerald-ink) 45%, transparent); }
:root:not([data-theme="luxe"]) .dp .dphd h3.dptitle { color: var(--cellbal); }
:root:not([data-theme="luxe"]) .grid .dow { color: var(--muted); font-weight: 650; }
/* The summary row: a deep emerald card with gold, as rich as the dark theme */
:root:not([data-theme="luxe"]) .v12strip { background: var(--strip); color: #E6EFEA; box-shadow: 0 4px 14px rgba(11, 36, 31, .18); }
:root:not([data-theme="luxe"]) .v12strip:hover { background: #1E4E45; }
:root:not([data-theme="luxe"]) .v12strip .v12k { color: #E2C35A; }
:root:not([data-theme="luxe"]) .v12strip .v12sts b { color: #F0D77A; }
:root:not([data-theme="luxe"]) .v12strip .v12sts b.neg { color: #FF8F87 !important; }
:root:not([data-theme="luxe"]) .v12strip .v12u, :root:not([data-theme="luxe"]) .v12strip .v12v, :root:not([data-theme="luxe"]) .v12strip svg { color: #CFE0D7; }
/* selected tab: bold deep emerald with a thicker gold line */
:root:not([data-theme="luxe"]) .tabs.acctabs button.active .n, :root:not([data-theme="luxe"]) .tabs.acctabs.invtabs .nwchip.hi .n { color: #0B241F; font-weight: 700; }
:root:not([data-theme="luxe"]) .tabs.acctabs button.active::after, :root:not([data-theme="luxe"]) .tabs.acctabs.invtabs .nwchip.hi::after { height: 3px; background: #B8901A; }
:root:not([data-theme="luxe"]) .tabs.acctabs button .b, :root:not([data-theme="luxe"]) .nwbar b { font-weight: 700; }
/* the day sheet, bottom bar and menus on the green, not white */
:root:not([data-theme="luxe"]) .bottomnav, html.phonecal:not([data-theme="luxe"]) .side#dayPanel, :root:not([data-theme="luxe"]) .navpanel, :root:not([data-theme="luxe"]) .sheet { background: var(--panel); }
:root:not([data-theme="luxe"]) .bottomnav { border-top-color: var(--line); }
:root:not([data-theme="luxe"]) .bottomnav button.active { color: #0B241F; font-weight: 700; }

/* ======================================================================
   v12.3: light theme redesign on wide screens: layered greens (header, page, cells, panel each distinct; nothing white),
   deep emerald text, gold-green grid lines, heavier gold/green/red figures, a defined selected day and today.
   Contrast on the cells (#E4EEE8): gold #6F5200 6.1:1, green #0B6138 6.4:1, red #A3201A 6.4:1, muted #3E5A52 6.3:1.
   ====================================================================== */
@media (min-width: 701px) {
  :root:not([data-theme="luxe"]) { --cellbal: #6F5200; --gold-text: #6F5200; --gridline: #B09246; }
  :root:not([data-theme="luxe"]) body { background: var(--bg); }
  :root:not([data-theme="luxe"]) .topbar { background: #CBDDD2; border-bottom: 1px solid #B2C9BC; }
  :root:not([data-theme="luxe"]) #accountTabs { background: #D2E3D9; }
  :root:not([data-theme="luxe"]) .tabs.acctabs { border-bottom-color: #B2C9BC; }
  :root:not([data-theme="luxe"]) .tabs.acctabs button .n { color: #3E5A52; font-weight: 550; }
  :root:not([data-theme="luxe"]) .grid { border-top: 1px solid var(--gridline); border-left: 1px solid var(--gridline); border-radius: 10px; overflow: hidden; background: #E4EEE8; box-shadow: 0 2px 10px rgba(11, 36, 31, .08); }
  :root:not([data-theme="luxe"]) .grid .dow { background: #C9DCD0; color: #19443C; font-weight: 700; letter-spacing: .08em; }
  :root:not([data-theme="luxe"]) .grid > .day { background: #E4EEE8; border-color: var(--gridline); }
  :root:not([data-theme="luxe"]) .grid > .day.other { background: #D3E3D9; }
  :root:not([data-theme="luxe"]) .grid > .day.other .bal { opacity: .55; }
  :root:not([data-theme="luxe"]) .day .dn { color: #19443C; font-weight: 700; }
  :root:not([data-theme="luxe"]) .day .bal { font-weight: 750; font-size: 12.5px; }
  :root:not([data-theme="luxe"]) .day .it .t { color: #0B241F; font-weight: 500; }
  :root:not([data-theme="luxe"]) .day .it .num { font-weight: 700; }
  :root:not([data-theme="luxe"]) .day .it .num.pos { color: var(--pos); }
  /* selected day: a soft emerald wash with an inner ring; today: a filled emerald dot with gold numerals */
  :root:not([data-theme="luxe"]) .grid > .day.sel { background: #CFE3D8; box-shadow: inset 0 0 0 2px #19443C !important; }
  :root:not([data-theme="luxe"]) .day.today .dn span { background: #19443C; color: #F0D77A; box-shadow: none; }
  :root:not([data-theme="luxe"]) .day.sel .dn span { background: #19443C; color: #F0D77A; }
  @media (hover: hover) { :root:not([data-theme="luxe"]) .grid > .day:not(.sel):hover { background: #DAE8E0; } }
  /* the right panel: its own green layer with a defined edge */
  :root:not([data-theme="luxe"]) .side#dayPanel > .card, :root:not([data-theme="luxe"]) .card.dp, :root:not([data-theme="luxe"]) .card.cp { background: #DFEAE4; border: 1px solid #B9CFC4; box-shadow: 0 2px 10px rgba(11, 36, 31, .08); }
  :root:not([data-theme="luxe"]) .card { background: #E1ECE6; }
  :root:not([data-theme="luxe"]) .dp .row .ttl { color: #0B241F; }
  :root:not([data-theme="luxe"]) .dp .row .num { font-weight: 650; }
  :root:not([data-theme="luxe"]) .qa, :root:not([data-theme="luxe"]) .dp .qa { background: #D2E2D9; }
  :root:not([data-theme="luxe"]) .btn:not(.primary) { background: #D6E5DC; border-color: #B2C9BC; color: #0B241F; }
  :root:not([data-theme="luxe"]) .calnav h2 { color: #19443C; }
}

/* v12.3: the line of the day is back at the top on a computer (gold italic, beside the name); not on phones or in the installed app */
.menuquote, #dailyLineMenu { display: none !important; }
@media (min-width: 760px) {
  .hdrline:not([hidden]) { display: flex !important; align-items: center; justify-content: center; gap: 4px; flex: 1 1 auto; min-width: 0; margin: 0 16px; font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 15px; line-height: 1.2; color: var(--cellbal); white-space: nowrap; overflow: hidden; }
  .hdrline .qtext { overflow: hidden; text-overflow: ellipsis; }
  .hdrline .qnext { flex: none; }
}
@media (display-mode: standalone), (max-width: 759px) { .hdrline, .hdrline:not([hidden]) { display: none !important; } }

/* v12.3: nothing underlines on hover or focus, anywhere (done entries keep their strike-through). A soft highlight instead, and a clear focus ring. */
:not(.done):not(.done *):hover, :not(.done):not(.done *):focus, :not(.done):not(.done *):focus-visible { text-decoration-line: none !important; }
a:hover, a:focus-visible, .linkbtn:hover, .linkbtn:focus-visible { background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 4px; }
button:not(:disabled):hover, [role="button"]:hover, [role="tab"]:hover { filter: brightness(1.04); }
:root[data-theme="luxe"] button:not(:disabled):hover, :root[data-theme="luxe"] [role="button"]:hover, :root[data-theme="luxe"] [role="tab"]:hover { filter: brightness(1.12); }
.navpanel button:hover, .navpanel a:hover { background: var(--tint); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:root[data-theme="luxe"] :focus-visible { outline-color: var(--gold); }

/* v12.3: every daily balance is gold, rising or falling (paydays, highs, today, selected); only below $0 is red */
.day .bal, .day.payday .bal, .day.hiday .bal, .day.today .bal, .day.sel .bal, body.calfit .day .bal, body.calfit .day.payday .bal { color: var(--cellbal) !important; }
.day.negday .bal, .day.payday.negday .bal, body.calfit .day.negday .bal { color: var(--neg) !important; }
/* v12.3: no underlines at all, at rest or on hover (links stay in the accent colour; done entries keep their strike-through) */
:not(.done):not(.done *) { text-decoration-line: none !important; }
a[href], .linkbtn, .toast .toastbtn { font-weight: 600; }

/* v12.3: a small tick on each calendar entry (computer): shows on hover or keyboard focus, marks it done in one click */
.day .it { position: relative; }
.day .it .itick { display: none; }
@media (min-width: 701px) {
  .day .it .itick { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 13px; height: 13px; margin: 0 4px 0 0; padding: 0; border-radius: 50%; border: 1.25px solid color-mix(in srgb, var(--muted) 70%, transparent); background: transparent; cursor: pointer; opacity: 0; width: 0; margin-right: 0; overflow: hidden; transition: opacity .12s; vertical-align: -2px; }
  .day .it:hover .itick, .day .it .itick:focus-visible, .day .it.done .itick { opacity: 1; width: 13px; margin-right: 4px; }
  .day .it .itick:hover { background: color-mix(in srgb, var(--pos) 18%, transparent); border-color: var(--pos); filter: none; }
  .day .it.done .itick { background: var(--pos); border-color: var(--pos); }
  .day .it.done .itick::after { content: '✓'; font: 800 8.5px/1 system-ui, sans-serif; color: #fff; }
  :root[data-theme="luxe"] .day .it.done .itick::after { color: #0B1F1B; }
  .day .it:hover { background: color-mix(in srgb, var(--tint2) 70%, transparent); }
  .calselecting .day .it .itick { display: none; }
  .dayhover .dh-it .dh-c { cursor: pointer; }
  .dayhover .dh-it .dh-c:hover { box-shadow: 0 0 0 3px color-mix(in srgb, var(--pos) 22%, transparent); border-color: var(--pos); }
}
.day .it .t { flex: 1 1 auto; min-width: 0; }

/* v12.3 Preferences, Balance colours: Highlight high and low. Light: up #08703A (5.2:1 on cells), down amber #8F4300 (6.0:1). Dark: up #3DDC84 (9.6:1), down #F0A04B (8.0:1). */
:root, :root[data-theme="ivory"] { --balup: #08703A; --baldown: #8F4300; }
:root[data-theme="luxe"] { --balup: #3DDC84; --baldown: #F0A04B; }
.grid.balhl .day.up .bal, body.calfit .grid.balhl .day.up .bal { color: var(--balup) !important; }
.grid.balhl .day.down .bal, body.calfit .grid.balhl .day.down .bal { color: var(--baldown) !important; }
.grid.balhl .day.negday .bal, body.calfit .grid.balhl .day.negday .bal { color: var(--neg) !important; }
.grid.balhl .day.other .bal { opacity: .6; }

/* ---------- v12.4: daily balances sit fully inside their day cells (not on the grid lines) ---------- */
.grid > .day .bal { white-space: nowrap; overflow: hidden; box-sizing: border-box; }
@media (min-width: 701px) {
  /* a clear gap above the bottom line and beside the side lines; the entries stop above the figure */
  .grid > .day, body.calfit .grid > .day { padding-bottom: 24px; }
  .grid > .day .bal, body.calfit .grid > .day .bal { position: absolute; left: 8px; right: 8px; bottom: 5px; line-height: 15px; max-width: calc(100% - 16px); }
}
@media (max-width: 700px) {
  /* the cell is exactly one row tall; the day number shrinks a little on short rows so the dot and the figure fit inside */
  .grid > .day, body.calfit .grid > .day { box-sizing: border-box; height: var(--rowh, 52px); padding: 2px 2px 0; overflow: hidden; position: relative; }
  .grid > .day .dn span, .grid > .day.today .dn span, .grid.tight > .day .dn span { width: clamp(18px, calc(var(--rowh, 52px) - 23px), 28px); height: clamp(18px, calc(var(--rowh, 52px) - 23px), 28px); }
  .grid .edot, .grid.tight .edot { top: auto; bottom: 15.5px; }   /* 2.5px above the figure */
  .grid > .day .bal, body.calfit .grid > .day .bal, .grid.tight > .day .bal { position: absolute; left: 2px; right: 2px; bottom: 3px; margin: 0; line-height: 10px; width: auto; max-width: calc(100% - 4px); text-align: center; }
}

/* ---------- v12.5 PREVIEW: a flat right-hand panel (computer). Small labels above each field, lightly filled boxes, no boxes around sections ---------- */
@media (min-width: 701px) {
  #dayPanel > .card.dp { padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); box-shadow: none; }
  .dp .v11pbtns { justify-content: flex-start; gap: 6px; margin: 0 0 10px; }
  .dp .qaedhd { display: flex; align-items: baseline; gap: 8px; margin: 0 0 6px; }
  .dp .qaedhd .grow { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
  .dp .qaedhd b { font-size: 13px; font-weight: 650; letter-spacing: .02em; color: var(--text); }
  .dp .qaedhd .muted { font-size: 11.5px; }
  .dp .qaedhd.qanew { justify-content: space-between; }
  .dp .qaedhd .x { margin-left: auto; background: none; border: 0; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 2px; }
  .qa.qaflat, :root:not([data-theme="luxe"]) .dp .qa.qaflat { background: transparent; padding: 0; margin: 0 0 6px; border-radius: 0; gap: 7px; }
  .qa.qaflat .qaf { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .qa.qaflat .qaf > span { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
  .qa.qaflat .qaf[hidden] { display: none; }
  .qa.qaflat .qar { display: flex; gap: 8px; align-items: flex-end; }
  .qa.qaflat .qar[hidden] { display: none; }
  .qa.qaflat .qar > .grow { flex: 1 1 0; }
  .qa.qaflat input, .qa.qaflat select { border: 0; border-bottom: 1px solid transparent; border-radius: 7px; background: var(--panel2); padding: 6px 8px; font-size: 13.5px; height: 32px; box-shadow: none; color: var(--text); }
  .qa.qaflat input:focus, .qa.qaflat select:focus { outline: none; border-bottom-color: var(--gold); background: color-mix(in srgb, var(--panel2) 70%, var(--panel)); }
  .qa.qaflat input[type=checkbox] { height: auto; width: auto; }
  .qa.qaflat .qamt { text-align: left; font-variant-numeric: tabular-nums; }
  .qa.qaflat .qaseg { display: flex; gap: 5px; padding-bottom: 2px; }
  .qa.qaflat .qak { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line); background: transparent; color: var(--muted); font-size: 15px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
  .qa.qaflat .qak[aria-pressed=true].qak-income { border-color: var(--pos); color: var(--pos); background: color-mix(in srgb, var(--pos) 10%, transparent); }
  .qa.qaflat .qak[aria-pressed=true].qak-expense { border-color: var(--neg); color: var(--neg); background: color-mix(in srgb, var(--neg) 9%, transparent); }
  .qa.qaflat .qak[aria-pressed=true].qak-move { border-color: var(--gold); color: var(--cellbal, var(--gold)); background: color-mix(in srgb, var(--gold) 12%, transparent); }
  .qa.qaflat .qak:disabled { opacity: .35; cursor: not-allowed; }
  .qa.qaflat .check.qadone { margin: 0; padding: 0; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
  .qa.qaflat .qabtns { margin-top: 2px; gap: 6px; }
  .qa.qaflat .qabtns .primary { flex: 1; }
  .qa.qaflat .qascopes { margin-top: 0; }
  .qa.qaflat .qascopes .btn { flex: 1; }
  .qa.qaflat .qaextras { margin-top: 2px; }
  .qa.qaflat .qaextras .qalab { font-size: 11px; }
  :root:not([data-theme="luxe"]) .qa.qaflat input, :root:not([data-theme="luxe"]) .qa.qaflat select { background: #F3F8F5; }
  .qa.qaedit { box-shadow: inset 3px 0 0 var(--gold); padding-left: 9px; }
  .dp .schedrow { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 6px; }
}

/* ---------- v12.5 PREVIEW: slim pill buttons everywhere (match the account / envelope chips at the top) ---------- */
.btn, .btn.sm, .chipbtn.ghost, .calnav .btn, body.calfit .calnav .btn, .qa .qabtns .btn, .v11pbtns .btn, .helpjump .btn {
  border-radius: 999px; padding: 3px 11px; font-size: 12.5px; line-height: 18px; min-height: 26px; font-weight: 500; border: 1px solid var(--line); background: transparent; box-shadow: none;
}
.btn.primary, .qa .qabtns .btn.primary, .v11pbtns .btn.primary, .calnav .btn.primary { background: var(--emerald); border-color: var(--emerald); color: #fff; font-weight: 600; }
.btn.danger { color: var(--neg); border-color: color-mix(in srgb, var(--neg) 35%, var(--line)); }
.btn.sel, .btn[aria-pressed=true]:not(.primary) { border-color: var(--gold); color: var(--text); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.btn:hover { border-color: var(--gold); }
.chipbtn.ghost { align-self: center; }
@media (max-width: 700px) { .btn, .btn.sm, .calnav .btn { min-height: 30px; padding: 4px 12px; } }   /* a little taller on phones for the finger */
@media (max-width: 700px) {
  #dayPanel .qaedhd { display: none !important; }
  /* the envelope chips at the top: one slim line on phones too (name, then balance) */
  .envtabs .chipbtn, .envtabs .chipbtn.active { display: inline-flex; flex-direction: row; align-items: baseline; gap: 6px; padding: 4px 12px; min-height: 30px; border-radius: 999px; }
  .envtabs .chipbtn .n, .envtabs .chipbtn .b { font-size: 12.5px; line-height: 18px; }
  .envtabs .chipbtn .b { font-weight: 650; }
}
@media (min-width: 701px) {
  .dp .qa.qaflat.qaedit { padding-left: 11px; }
  .day .it.editing { outline: 1.5px solid var(--gold); outline-offset: 0; border-radius: 4px; background: color-mix(in srgb, var(--gold) 14%, transparent); }   /* the entry open in the panel */
}
@media (min-width: 701px) { :root .dp .qa.qaflat.qaedit, :root:not([data-theme="luxe"]) .dp .qa.qaflat.qaedit { padding-left: 11px; } }
/* v12.5 PREVIEW: on a computer the right-hand panel is just the entry form (the day's entries are in the calendar cell) */
@media (min-width: 701px) { #dayPanel .schedrow, #dayPanel .selbar, #dayPanel .v12hint, #dayPanel .list, #dayPanel .bmk { display: none !important; } }
/* v12.5 PREVIEW: the full entry editor docked in the right-hand panel: flat, small labels above light boxes, no boxes around sections */
@media (min-width: 701px) {
  #dayPanel > .card.dp { position: sticky; top: 8px; max-height: calc(100vh - 96px); overflow-y: auto; }
  .dpeditor .hd { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 8px; }
  .dpeditor .hd .grow { flex: 1; min-width: 0; }
  .dpeditor .hd h2 { margin: 0; font-family: inherit; font-style: normal; font-size: 13.5px; font-weight: 650; letter-spacing: .02em; color: var(--text); }
  .dpeditor .hd .muted { font-size: 11.5px; margin-top: 1px; }
  .dpeditor .hd .x { background: none; border: 0; width: auto; height: auto; padding: 0 2px; font-size: 18px; line-height: 1; color: var(--muted); box-shadow: none; }
  .dpeditor .form { gap: 7px; }
  .dpeditor .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .dpeditor .field { margin: 0; }
  .dpeditor .field label, .dpeditor .colourx summary .cxl { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .02em; margin-bottom: 2px; }
  .dpeditor input:not([type=checkbox]):not([type=radio]):not([type=color]), .dpeditor select, .dpeditor textarea { border: 0; border-bottom: 1px solid transparent; border-radius: 7px; background: var(--panel2); padding: 6px 8px; font-size: 13.5px; min-height: 32px; height: auto; box-shadow: none; width: 100%; min-width: 0; color: var(--text); }
  :root:not([data-theme="luxe"]) .dpeditor input:not([type=checkbox]):not([type=radio]):not([type=color]), :root:not([data-theme="luxe"]) .dpeditor select, :root:not([data-theme="luxe"]) .dpeditor textarea { background: #F3F8F5; }
  .dpeditor input:focus, .dpeditor select:focus, .dpeditor textarea:focus { outline: none; border-bottom-color: var(--gold); }
  .dpeditor textarea { min-height: 48px; resize: vertical; }
  .dpeditor .note { font-size: 11px; margin: 3px 0 0; }
  .dpeditor .check.donefirst { order: 0; margin: 0; padding: 0; background: none; border: 0; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
  .dpeditor .seg { display: flex; border: 0; gap: 5px; background: none; overflow: visible; }
  .dpeditor .seg button { flex: 1; border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 3px 8px; font-size: 12.5px; min-height: 26px; color: var(--muted); }
  .dpeditor .seg button.active { border-color: var(--emerald); background: var(--emerald); color: #fff; font-weight: 600; }
  .dpeditor .colourx { border: 0; background: none; padding: 0; }
  .dpeditor .colourx summary { padding: 0; background: none; border: 0; font-size: 12.5px; }
  .dpeditor .qaextras { margin: 0; }
  .dpeditor .actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; position: sticky; bottom: -12px; background: var(--panel); padding: 8px 0 4px; }
  .dpeditor .actions .spacer { flex: 1; }
  .dpeditor .files, .dpeditor .filesfield { font-size: 12.5px; }
}
@media (min-width: 701px) { .dpeditor .check input[type=checkbox] { width: 16px; height: 16px; margin: 0; } .dpeditor .check.donefirst { min-height: 0; } }
/* v12.5: the summary row as one slim row: label, chevron at the far right */
.v12strip, :root:not([data-theme="luxe"]) .v12strip { padding: 4px 12px 4px 14px; gap: 10px; border-radius: 999px; min-height: 0; margin: 8px 0 6px; box-shadow: none; }
.v12strip > span.v12sts { flex-direction: row; align-items: baseline; gap: 10px; min-width: 0; }
.v12strip .v12k { font-size: 10.5px; line-height: 20px; white-space: nowrap; }
.v12strip .v12v { margin-top: 0; display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.v12strip .v12sts b, :root:not([data-theme="luxe"]) .v12strip .v12sts b { font-size: 15px; line-height: 20px; }
.v12strip .v12u { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v12strip .v12chev svg { width: 16px; height: 16px; display: block; }
.v12strip .v12flag { top: 50%; margin-top: -3px; right: 34px; }
@media (min-width: 701px) { #dayPanel .dp .v11pbtns, .dp .v11pbtns { justify-content: center !important; margin-left: auto; margin-right: auto; } }   /* v12.5 PREVIEW: Categories and the month summary centred at the top of the entry panel */
.nwnotes { font-size: 11.5px; margin: 2px 4px 6px; }
/* v12.5 PREVIEW: Count in net worth as small pill toggles inside the Net worth card */
.nwhero .nwgrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 6px; margin-top: 10px; }
.nwhero .nwgl { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; opacity: .75; margin-right: 2px; }
.nwhero .nwgt { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px 2px 7px; border-radius: 999px; border: 1px solid color-mix(in srgb, currentColor 35%, transparent); font-size: 12px; line-height: 18px; cursor: pointer; }
.nwhero .nwgt input { width: 13px; height: 13px; margin: 0; accent-color: #D4B25C; }
.nwhero .nwgt:has(input:checked) { border-color: #D4B25C; }
.nwhero .nwgt:has(input:not(:checked)) span { opacity: .6; text-decoration: none; }
.nwhero .nwgrow, .nwhero .nwgrow .nwgt { color: #F3EBD6; }
.nwhero .nwgrow .nwgl { white-space: nowrap; }
.nwhero .nwgt { white-space: nowrap; background: rgba(255,255,255,.06); }
/* v12.5: View summary removed from Investments; the Net worth card takes the full width */
.nwtop.nwsolo, .nwtop.nwsolo { grid-template-columns: minmax(0, 1fr) !important; }

/* ======================================================================
   v12.5: wordmark. Jost 400 (SIL Open Font License, self-hosted in fonts/), spaced capitals, a hairline gold rule like the logo's base line.
   ====================================================================== */
@font-face { font-family: 'Jost'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/jost-latin-400.woff2') format('woff2'); }
:root, :root[data-theme="ivory"] { --wm-ink: var(--head, var(--emerald)); --wm-rule: linear-gradient(90deg, #8E6A36, #C9A869 40%, #8E6A36); }
:root[data-theme="luxe"] { --head: #D9BA68; --wm-ink: var(--head); --wm-rule: linear-gradient(90deg, #A57F4B, #E9CE9F 40%, #B8915A); }
:root[data-theme="luxe"][data-pal="onyx-rosegold"] { --wm-rule: linear-gradient(90deg, #A86F5E, #F0C6B4 40%, #B98270); }
.brand > span, .topbar .brand::after, :root[data-theme="luxe"] .brand > span {
  font-family: 'Jost', 'Futura', 'Century Gothic', 'Avenir Next', system-ui, sans-serif; font-style: normal; font-weight: 400; text-transform: uppercase;
  font-size: 17px; letter-spacing: .48em; line-height: 1; color: var(--wm-ink); padding: 0 0 6px; margin-right: -.48em;
  background: var(--wm-rule) left bottom / calc(100% - .48em) 1px no-repeat; }
@media (min-width: 701px) { .brand > span { display: inline-block !important; font-size: 17px !important; } }
@media (max-width: 700px) { .brand > span, .topbar .brand::after { font-size: 15px; letter-spacing: .42em; margin-right: -.42em; background-size: calc(100% - .42em) 1px; } }

/* ======================================================================
   v12.5: colour themes. js/themes.js sets the colours as custom properties on <html> and data-pal="<id>"
   (not for the dark default, Emerald & Gold, which is the dark look above). These rules replace the fixed
   greens of the earlier light theme with the chosen theme's colours.
   ====================================================================== */
:root[data-pal][data-theme="ivory"] input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), :root[data-pal][data-theme="ivory"] select, :root[data-pal][data-theme="ivory"] textarea,
:root[data-pal] .qa.qaflat input, :root[data-pal] .qa.qaflat select, :root[data-pal] .dpeditor input:not([type=checkbox]):not([type=radio]):not([type=color]), :root[data-pal] .dpeditor select, :root[data-pal] .dpeditor textarea { background-color: var(--input) !important; }
:root[data-pal][data-theme="ivory"] .v12strip { background: var(--strip); color: var(--strip-text); box-shadow: 0 2px 10px color-mix(in srgb, var(--strip) 18%, transparent); }
:root[data-pal][data-theme="ivory"] .v12strip:hover { background: color-mix(in srgb, var(--strip) 90%, #ffffff); }
:root[data-pal][data-theme="ivory"] .v12strip .v12k, :root[data-pal][data-theme="ivory"] .v12strip .v12sts b { color: var(--strip-metal); }
:root[data-pal][data-theme="ivory"] .v12strip .v12sts b.neg { color: var(--strip-neg) !important; }
:root[data-pal][data-theme="ivory"] .v12strip .v12u, :root[data-pal][data-theme="ivory"] .v12strip .v12v, :root[data-pal][data-theme="ivory"] .v12strip svg { color: var(--strip-text); }
:root[data-pal][data-theme="ivory"] .tabs.acctabs button.active .n, :root[data-pal][data-theme="ivory"] .tabs.acctabs.invtabs .nwchip.hi .n, :root[data-pal][data-theme="ivory"] .bottomnav button.active { color: var(--text); }
:root[data-pal] .tabs.acctabs button.active::after, :root[data-pal] .tabs.acctabs.invtabs .nwchip.hi::after { background: var(--cellbal); }
:root[data-pal][data-theme="ivory"] .toast { background: var(--strip); color: var(--strip-text); }
:root[data-pal][data-theme="ivory"] .toast .toastbtn { color: var(--strip-metal); }
:root[data-pal] .fab, :root[data-pal] .bottomnav button.bnadd { background: var(--fab); color: var(--fab-ink); }
:root[data-pal] .nwhero { --nw-bg: var(--strip); --nw-gold: var(--strip-metal); }
:root[data-pal][data-theme="luxe"] .nwhero { border: 1px solid var(--line); }
:root[data-pal] .nwhero .nwbtn { background: var(--strip-metal); color: var(--strip); }
:root[data-pal] .nwhero .nwbtn:hover { background: color-mix(in srgb, var(--strip-metal) 88%, #ffffff); }
:root[data-pal] .nwhero .nwgt input { accent-color: var(--strip-metal); }
:root[data-pal] .nwhero .nwgt:has(input:checked) { border-color: var(--strip-metal); }
:root[data-pal][data-theme="ivory"] .day.today .dn span, :root[data-pal][data-theme="ivory"] .day.sel .dn span { background: var(--fab); color: var(--fab-ink); }
:root[data-pal][data-theme="luxe"] .btn.primary, :root[data-pal][data-theme="luxe"] .qa .qabtns .btn.primary, :root[data-pal][data-theme="luxe"] .v11pbtns .btn.primary, :root[data-pal][data-theme="luxe"] .calnav .btn.primary { background: var(--cellbal); border-color: var(--cellbal); color: var(--bg); }
:root[data-pal][data-theme="ivory"] .btn.primary, :root[data-pal][data-theme="ivory"] .qa .qabtns .btn.primary, :root[data-pal][data-theme="ivory"] .v11pbtns .btn.primary, :root[data-pal][data-theme="ivory"] .calnav .btn.primary, :root[data-pal] .dpeditor .seg button.active { background: var(--sel); border-color: var(--sel); color: var(--sel-ink); }
@media (min-width: 701px) {
  :root[data-pal][data-theme="ivory"] { --cellbal: var(--gold); }
  :root[data-pal][data-theme="ivory"] .topbar { background: var(--panel); border-bottom: 1px solid var(--line); }
  :root[data-pal][data-theme="ivory"] #accountTabs { background: var(--bg); }
  :root[data-pal][data-theme="ivory"] .tabs.acctabs { border-bottom-color: var(--line); }
  :root[data-pal][data-theme="ivory"] .tabs.acctabs button .n { color: var(--muted); }
  :root[data-pal][data-theme="ivory"] .grid { background: var(--panel); box-shadow: 0 1px 6px color-mix(in srgb, var(--text) 6%, transparent); }
  :root[data-pal][data-theme="ivory"] .grid .dow { background: var(--panel2); color: var(--head); }
  :root[data-pal][data-theme="ivory"] .grid > .day { background: var(--panel); }
  :root[data-pal][data-theme="ivory"] .grid > .day.other { background: color-mix(in srgb, var(--panel2) 60%, var(--panel)); }
  :root[data-pal][data-theme="ivory"] .day .dn, :root[data-pal][data-theme="ivory"] .calnav h2 { color: var(--head); }
  :root[data-pal][data-theme="ivory"] .day .it .t, :root[data-pal][data-theme="ivory"] .dp .row .ttl { color: var(--text); }
  :root[data-pal][data-theme="ivory"] .grid > .day.sel { background: var(--tint); box-shadow: inset 0 0 0 2px var(--sel) !important; }
  :root[data-pal][data-theme="ivory"] .grid > .day:not(.sel):hover { background: color-mix(in srgb, var(--head) 4%, var(--panel)); }
  :root[data-pal][data-theme="ivory"] .side#dayPanel > .card, :root[data-pal][data-theme="ivory"] .card.dp, :root[data-pal][data-theme="ivory"] .card.cp { background: var(--panel); border: 1px solid var(--line); box-shadow: 0 1px 6px color-mix(in srgb, var(--text) 6%, transparent); }
  :root[data-pal][data-theme="ivory"] .card { background: var(--panel); }
  :root[data-pal][data-theme="ivory"] .qa, :root[data-pal][data-theme="ivory"] .dp .qa { background: var(--panel); }
  :root[data-pal][data-theme="ivory"] .btn:not(.primary) { background: var(--panel2); border-color: var(--line); color: var(--text); }
}
:root[data-pal][data-theme="ivory"] .dp .dphd h3, :root[data-pal][data-theme="ivory"] .hcmonth { color: var(--head); }
:root[data-pal][data-theme="ivory"] .day.other .dn { color: color-mix(in srgb, var(--head) 45%, transparent); }
:root[data-pal][data-theme="ivory"] .btn:not(.primary) { border-color: var(--line); }
/* light themes: fields are the panel colour, so they get a fine edge */
:root[data-pal][data-theme="ivory"] input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), :root[data-pal][data-theme="ivory"] select, :root[data-pal][data-theme="ivory"] textarea { border: 1px solid var(--line) !important; }
:root[data-pal][data-theme="ivory"] input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):focus, :root[data-pal][data-theme="ivory"] select:focus, :root[data-pal][data-theme="ivory"] textarea:focus { border-color: var(--head) !important; }
/* v12.5: overall investment totals on the Show row (they used to be in View summary) */
.colbar .invsum { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; font-size: 13px; color: var(--muted); }
.colbar .invsum b { color: var(--text); font-weight: 650; }
.colbar .invsum .erow { display: inline; padding: 0; border: 0; }
@media (max-width: 700px) { .colbar .invsum { margin-left: 0; width: 100%; } }
/* ======================================================================
   v12.5: compact Net worth card (Investments): a ~30px figure with a slim Refresh now pill on the same row,
   the sync line as small plain text, Count in net worth as small toggles. Less padding.
   ====================================================================== */
.nwhero.nwcompact, .nwtop .nwhero.nwcompact { padding: 10px 14px 10px; border-radius: 12px; height: auto; }
.nwhero.nwcompact .nwrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nwhero.nwcompact .nwfig { font-size: 30px !important; line-height: 1.1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nwhero.nwcompact .nwbtn { flex: none; display: inline-flex; align-items: center; margin: 0; padding: 3px 12px; min-height: 26px; font-size: 12.5px; line-height: 1.2; }
.nwhero.nwcompact .nwpill.nwsync { display: block; margin: 2px 0 0; padding: 0; background: none; border-radius: 0; max-width: none; font-size: 12px; font-weight: 400; line-height: 1.35; color: var(--strip-text, #CFDCD5); }
.nwhero.nwcompact .nwgrow { margin-top: 6px; gap: 5px; }
.nwhero.nwcompact .nwgt { padding: 1px 9px 1px 6px; font-size: 11.5px; line-height: 17px; }
.nwhero.nwcompact .nwgt input { width: 12px; height: 12px; }
@media (max-width: 700px) {
  .nwhero.nwcompact, .nwtop .nwhero.nwcompact { padding: 9px 12px; }
  .nwhero.nwcompact .nwfig { font-size: 28px !important; }
  .nwhero.nwcompact .nwpill.nwsync { font-size: 11.5px; }
  .nwhero.nwcompact .nwbtn { min-height: 28px; }
}

/* ======================================================================
   v12.5 PREVIEW: holdings as a flat list. No card boxes: each group, sub-group and holding is a row with a hairline
   divider; sub-groups are indented with a thin accent rule; one small column header (Value | Invested | Gain or loss).
   ====================================================================== */
.invflat { --flind: 0px; margin: 0 0 16px; border-top: 1px solid var(--line); }
.invflat .flrow { display: grid; grid-template-columns: minmax(0, 1fr) var(--flcols) 64px; align-items: center; column-gap: 10px; padding: 7px 4px 7px calc(6px + var(--flind)); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.invflat .flhead { padding-top: 5px; padding-bottom: 5px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.invflat .flc { text-align: right; font-size: 13.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.invflat .flc small { font-size: 11.5px; font-weight: 600; margin-left: 3px; }
.invflat .flc b { font-weight: 650; }
.invflat .flact { display: flex; justify-content: flex-end; align-items: center; gap: 2px; }
.invflat .flnm { min-width: 0; }
/* groups: no box, no fill; name in the accent, count muted */
.invflat .invgroup.flat, .invflat .invgroup.flat.top, .invflat .invgroup.flat.sub { border: 0 !important; background: none !important; box-shadow: none !important; margin: 0 !important; padding: 0 !important; border-radius: 0 !important; }
.invflat .invgroup.flat > .ighead { background: none !important; border-radius: 0; cursor: pointer; margin: 0; }
.invflat .invgroup.flat > .ighead .nm { display: inline; font-weight: 650; font-size: 14.5px; color: var(--accent); }
:root[data-theme="luxe"] .invflat .invgroup.flat > .ighead .nm { color: var(--gold-text); }
.invflat .invgroup.flat > .ighead .flcount { font-size: 12px; margin-left: 4px; }
.invflat .invgroup.flat > .ighead .flcount::before { content: '· '; }
.invflat .invgroup.flat > .ighead .v11chev { display: inline-block; width: 14px; font-size: 11px; color: var(--muted); transition: transform .15s; }
.invflat .invgroup.flat.v11closed > .ighead .v11chev { transform: rotate(-90deg); }
.invflat .invgroup.flat.v11closed > .igbody { display: none; }
.invflat .invgroup.flat > .igbody { padding: 0 !important; margin: 0 !important; background: none !important; border: 0 !important; }
.invflat .fltag { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; margin-left: 4px; vertical-align: 1px; }
/* sub-groups: indented, with a thin accent rule instead of their own box */
.invflat .subgroups { margin: 0; padding: 0; border: 0; background: none; }
.invflat .invgroup.flat .invgroup.flat { --flind: 18px; }
.invflat .invgroup.flat .invgroup.flat > .ighead { box-shadow: inset calc(var(--flind) - 6px) 0 0 -1px transparent; position: relative; }
.invflat .invgroup.flat .invgroup.flat > .ighead::before, .invflat .invgroup.flat .invgroup.flat .hrow::before { content: ''; position: absolute; left: 10px; top: 0; bottom: -1px; width: 1.5px; background: color-mix(in srgb, var(--accent) 45%, transparent); }
:root[data-theme="luxe"] .invflat .invgroup.flat .invgroup.flat > .ighead::before, :root[data-theme="luxe"] .invflat .invgroup.flat .invgroup.flat .hrow::before { background: color-mix(in srgb, var(--gold) 45%, transparent); }
.invflat .invgroup.flat .invgroup.flat > .ighead .nm { font-size: 13.5px; font-weight: 600; }
/* holdings: one row each, a step further in than their group */
.invflat .hrow { position: relative; padding-left: calc(26px + var(--flind)); }
.invflat .hrow .hsym { font-weight: 650; font-size: 13.5px; letter-spacing: .02em; }
.invflat .hrow .fltype { font-size: 11px; color: var(--muted); margin-left: 4px; }
.invflat .flsub { font-size: 11.5px; line-height: 1.3; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; }
.invflat .flsub.neg { color: var(--neg); }
.invflat .sublabel { font-size: 11px; color: var(--muted); padding: 6px 4px 2px calc(26px + var(--flind)); text-transform: uppercase; letter-spacing: .06em; }
.invflat .flempty { margin: 0; padding: 7px 4px 7px calc(26px + var(--flind)); font-size: 12.5px; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.invflat .fllinks { display: flex; gap: 14px; margin: 0; padding: 5px 4px 7px calc(26px + var(--flind)); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); background: none; border-top: 0; }
.invflat .fllinks .linkbtn { all: unset; cursor: pointer; font-size: 12px; color: var(--muted); }
.invflat .fllinks .linkbtn:hover, .invflat .fllinks .linkbtn:focus-visible { color: var(--accent); }
.invflat .flcards { margin: 6px 4px 10px calc(26px + var(--flind)); }
/* actions: small icons that show on row hover (computer); a single ⋯ on phones */
.invflat .flicons { display: flex; gap: 1px; opacity: 0; transition: opacity .12s; }
.invflat .ighead:hover .flicons, .invflat .ighead:focus-within .flicons { opacity: 1; }
.invflat .ib { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 999px; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.invflat .ib:hover:not(:disabled), .invflat .ib:focus-visible { background: var(--tint2); color: var(--text); }
.invflat .ib.danger:hover { color: var(--neg); }
.invflat .ib:disabled { opacity: .35; cursor: default; }
.invflat .flgmenu { display: none; }
.invflat .hrow .kebab { opacity: .55; }
.invflat .hrow:hover .kebab, .invflat .hrow .kebab:focus-visible, .invflat .hrow .kebab[aria-expanded="true"] { opacity: 1; }
@media (hover: hover) { .invflat .hrow:hover, .invflat .ighead:hover { background: color-mix(in srgb, var(--accent) 4%, transparent) !important; } }
@media (max-width: 700px), (hover: none) and (pointer: coarse) {
  .invflat .flicons { display: none; }
  .invflat .flgmenu { display: inline-block; }
  .invflat .hrow .kebab { opacity: 1; }
}
@media (max-width: 700px) {
  .invflat .flrow { grid-template-columns: minmax(0, 1fr) var(--flcols-ph, var(--flcols)) 26px; column-gap: 6px; padding-right: 0; }
  .invflat { --flcols-ph: auto auto auto; }
  .invflat .flc { font-size: 12px; } .invflat .flc small { font-size: 10.5px; display: block; margin: 0; }
  .invflat .flhead { font-size: 9.5px; letter-spacing: .04em; }
  .invflat .invgroup.flat > .ighead .nm { font-size: 13.5px; }
  .invflat .flsub { white-space: normal; }
}
.invflat .kebab { border: 0; width: 26px; height: 22px; border-radius: 999px; font-size: 15px; color: var(--muted); }
.invflat .kebab:hover, .invflat .kebab[aria-expanded="true"] { background: var(--tint2); color: var(--text); }
@media (max-width: 700px) {
  .invflat { --flcols-ph: 64px 60px 68px; }
  .invflat .flrow { column-gap: 4px; padding-left: calc(2px + var(--flind)); grid-template-columns: minmax(0, 1fr) var(--flcols-ph) 22px; }
  .invflat .hrow, .invflat .sublabel, .invflat .flempty, .invflat .fllinks { padding-left: calc(16px + var(--flind)); }
  .invflat .invgroup.flat .invgroup.flat { --flind: 12px; }
  .invflat .invgroup.flat .invgroup.flat > .ighead::before, .invflat .invgroup.flat .invgroup.flat .hrow::before { left: 6px; }
  .invflat .flc { font-size: 11.5px; } .invflat .flc b { font-weight: 600; }
  .invflat .flsub .flsubname { display: none; }
  .invflat .kebab { width: 22px; }
}
:root[data-pal][data-theme="ivory"] .dp .dphd h3.dptitle { color: var(--cellbal); }   /* the day heading stays the same gold as the balances */
.invflat .flpx { font-variant-numeric: tabular-nums; }

/* ---------- v12.6: the right-hand entry panel never scrolls sideways; everything shrinks to the panel's width ---------- */
@media (min-width: 701px) {
  #dpEditor, #dpEditor * { box-sizing: border-box; }
  #dpEditor { min-width: 0; max-width: 100%; }
  #dpEditor .form { grid-template-columns: minmax(0, 1fr); min-width: 0; }
  #dpEditor .form > *, #dpEditor .field, #dpEditor .two > * { min-width: 0; max-width: 100%; }
  #dpEditor .two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #dpEditor input:not([type=checkbox]):not([type=radio]), #dpEditor select, #dpEditor textarea { width: 100%; min-width: 0; max-width: 100%; }
  #dpEditor .seg button { min-width: 0; flex: 1 1 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 4px; padding-right: 4px; }
  #dpEditor .hd h2, #dpEditor .hd .muted { overflow-wrap: break-word; }
  #dpEditor .actions { flex-wrap: wrap; }
  #dpEditor .actions .btn { min-width: 0; flex: 1 1 auto; white-space: nowrap; }
  #dpEditor .actions .spacer { flex: 1 0 0; min-width: 0; }
  #dayPanel > .card.dp { overflow-x: hidden; }
}
/* v12.6: a compact panel form, so the whole entry fits without a scrollbar on common computer screens */
@media (min-width: 701px) {
  #dayPanel > .card.dp { padding: 10px 12px; }
  #dayPanel .dp .v11pbtns { margin-bottom: 6px; }
  #dpEditor .hd { margin: 0 0 6px; align-items: center; gap: 8px; }
  #dpEditor .hd h2 { font-size: 13px; line-height: 17px; }
  #dpEditor .hd .muted { font-size: 11px; line-height: 14px; }
  #dpEditor .hd .check.hddone { flex: none; margin: 0; padding: 0; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; min-height: 0; background: none; border: 0; white-space: nowrap; }
  #dpEditor .hd .check.hddone input { width: 14px; height: 14px; margin: 0; }
  #dpEditor .form { gap: 6px; }
  #dpEditor .two { gap: 6px; }
  #dpEditor .two:has(> [hidden]), #dpEditor .two.dkpair:has(> .field[hidden]) { grid-template-columns: minmax(0, 1fr); }
  #dpEditor .field label, #dpEditor .colourx summary .cxl { font-size: 10.5px; line-height: 13px; margin-bottom: 2px; }
  #dpEditor input:not([type=checkbox]):not([type=radio]):not([type=color]), #dpEditor select { min-height: 30px; height: 30px; padding: 4px 8px; font-size: 13px; }
  #dpEditor textarea { min-height: 30px; height: 44px; padding: 5px 8px; font-size: 13px; }
  #dpEditor .note:empty, #dpEditor .form > p.note:not([id]), #dpEditor .field > p.note:not([id]), #dpEditor .colourx p.note { display: none; }
  #dpEditor .note { font-size: 10.5px; line-height: 13px; margin: 2px 0 0; }
  #dpEditor .seg button { min-height: 26px; padding-top: 2px; padding-bottom: 2px; font-size: 12px; }
  #dpEditor .ivrow { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; }
  #dpEditor .ivrow input { width: 56px !important; flex: none; }
  #dpEditor .dows { display: flex; gap: 3px; flex-wrap: wrap; }
  #dpEditor .dows .dowbtn { flex: 1 1 0; min-width: 0; padding: 2px 0; font-size: 11.5px; min-height: 24px; }
  #dpEditor .dkmore { border: 0; padding: 0; margin: 0; }
  #dpEditor .dkmore > summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 0; border-top: 1px solid var(--line); font-size: 12px; min-width: 0; }
  #dpEditor .dkmore > summary::-webkit-details-marker { display: none; }
  #dpEditor .dkmore .dkml { font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: .02em; text-transform: none; }
  #dpEditor .dkmore .dkmv { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 11.5px; }
  #dpEditor .dkmore[open] .cxc { transform: rotate(180deg); }
  #dpEditor .dkmore .dkmbody { display: grid; gap: 6px; padding-top: 4px; min-width: 0; }
  #dpEditor .colourx summary { min-height: 0; }
  #dpEditor .filebtns .btn { min-height: 24px; padding: 2px 10px; }
  #dpEditor .actions { position: static; display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; padding: 6px 0 0; border-top: 1px solid var(--line); background: none; }
  #dpEditor .actions .btn { flex: 1 1 0; min-width: 0; padding: 3px 6px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
  #dpEditor .actions .spacer { display: none; }
  #dpEditor .actions [data-del] { order: 9; flex: 0 0 auto; border-color: transparent; padding-left: 0; background: none; }
}
/* v12.6: the calendar's top row. Left space | centred month group | Search and Select on the right. Today is a small slim pill:
   just left of « inside the month group (phones: top right of the month header, next to the arrows) */
@media (min-width: 701px) {
  .calnav, body.calfit .calnav { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .calnav .calnavsp { justify-self: start; }
  .calnav .calnavr { justify-self: end; display: flex; align-items: center; gap: 6px; }
  .calnav .calmid .todaypill { margin-right: 4px; }
  .btn.iconpill { display: inline-flex; align-items: center; gap: 5px; }
  .btn.iconpill svg { display: block; }
  body[data-view="calendar"] #fab, body[data-view="calendar"] .fab { display: none !important; }   /* Search is on the calendar's top row instead */
}
.btn.todaypill, .calnav .btn.todaypill, body.calfit .calnav .btn.todaypill { min-height: 22px; height: 22px; padding: 0 10px; font-size: 10.5px; line-height: 20px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--gold-text, var(--gold)); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); background: transparent; border-radius: 999px; flex: none; }
.btn.todaypill:hover { border-color: var(--gold); }
@media (max-width: 700px) {
  .hctoday.todaypill { padding: 0 10px; margin-left: 4px; height: 24px; min-height: 24px; font-size: 11px; line-height: 22px; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); border-radius: 999px; }
}
@media (min-width: 701px) {
  #dpEditor .dkmore textarea { height: 32px; }
  #dpEditor .dkcf { align-items: start; }
  #dpEditor .dkcf #filesField { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
  #dpEditor .dkcf #filesField > label { margin: 0; }
  #dpEditor .dkcf #fileList:empty { display: none; }
  #dpEditor .dkcf .colourx summary { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
  #dpEditor .dkcf .colourx summary .cxl { width: 100%; }
  #dpEditor .dkcf .colourx[open] { grid-column: 1 / -1; }
  #dpEditor #remField .remrow { gap: 6px; }
}
@media (min-width: 701px) {
  #dayPanel > .card.dp { max-height: calc(100vh - 82px); }
  #dpEditor .dkcf #fileNote, #dpEditor .dkcf #fileList > .muted:only-child, #dpEditor .dkcf #fileList > p.note:only-child { display: none; }
  #dpEditor .dkmore > summary { padding: 3px 0; }
}
@media (min-width: 701px) { body[data-view="calendar"] .side#dayPanel { padding-bottom: 0; } }   /* v12.6: the space kept for the round Search button is no longer needed (Search is on the top row) */
/* v12.6: tighter still (no scrolling in the entry panel) - 28px boxes, labels closer to their boxes */
@media (min-width: 701px) {
  #dpEditor .form, #dpEditor .dkmore .dkmbody { gap: 5px; }
  #dpEditor .two { column-gap: 6px; row-gap: 5px; }
  #dpEditor .field label, #dpEditor .colourx summary .cxl, #dpEditor .dkmore .dkml { font-size: 10px; line-height: 12px; margin-bottom: 1px; }
  #dpEditor input:not([type=checkbox]):not([type=radio]):not([type=color]), #dpEditor select { min-height: 28px; height: 28px; padding: 3px 7px; font-size: 12.5px; border-radius: 6px; }
  #dpEditor textarea, #dpEditor .dkmore textarea { min-height: 28px; height: 28px; padding: 4px 7px; font-size: 12.5px; border-radius: 6px; }
  #dpEditor .seg button { min-height: 24px; font-size: 11.5px; }
  #dpEditor .dknr #remField .remrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #dpEditor .dknr #remField .remrow input[type=time] { padding-left: 4px; padding-right: 2px; }
  #dpEditor .dknr { align-items: start; }
  #dpEditor .actions .btn { min-height: 24px; line-height: 16px; }
  #dpEditor .hd { margin-bottom: 4px; }
}
/* v12.6: Net worth card sync line - the short form on phones, one line */
.nwhero .nwsync .nwss { display: none; }
@media (max-width: 700px) {
  .nwhero .nwsync .nwsl { display: none; }
  .nwhero .nwsync .nwss { display: inline; }
  .nwhero .nwsync { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
/* v12.6: the flat holdings list on narrow screens - no column header; two lines per row:
   line 1 name (count / Super tag) ... Value ... ⋯ ;  line 2 Invested $x ... gain or loss $ (%). Full-width hairlines, a little more padding. */
@media (max-width: 700px) {
  .invflat { border-top: 1px solid var(--line); }
  .invflat .flhead { display: none !important; }
  .invflat .flrow, .invflat .flrow.hrow, .invflat .invgroup.flat > .ighead.flrow {
    grid-template-columns: minmax(0, 1fr) auto 26px !important; grid-template-areas: "nm fv act" "fi fg act"; column-gap: 8px; row-gap: 3px;
    align-items: baseline; padding-top: 10px; padding-bottom: 10px; padding-right: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 85%, transparent); border-top: 0; }
  .invflat .flrow > .flnm { grid-area: nm; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .invflat .flrow > .fv { grid-area: fv; font-size: 13px; }
  .invflat .flrow > .fi { grid-area: fi; justify-self: start; text-align: left; font-size: 11.5px; color: var(--muted); }
  .invflat .flrow > .fi::before { content: 'Invested '; }
  .invflat .flrow > .fi b, .invflat .flrow > .fi .num { font-weight: 500; color: var(--muted); }
  .invflat .flrow > .fg { grid-area: fg; justify-self: end; font-size: 11.5px; }
  .invflat .flrow > .fg b { font-weight: 600; }
  .invflat .flrow > .fg small { display: inline; font-size: 11px; margin-left: 3px; }
  .invflat .flrow > .fg small::before { content: '('; } .invflat .flrow > .fg small::after { content: ')'; }
  .invflat .flrow > .flact { grid-area: act; align-self: center; justify-self: end; }
  .invflat .flrow:not(:has(> .fi)) { grid-template-areas: "nm fv act" "fg fg act"; }
  /* a holding: symbol, then its quantity × price on the same line (the type tag is left out to save room) */
  .invflat .hrow .fltype { display: none; }
  .invflat .hrow .flnm > .flsub:first-of-type { display: inline; margin: 0 0 0 6px; font-size: 11px; }
  .invflat .hrow .flnm > .flsub ~ .flsub { white-space: normal; }
  .invflat .flsub .flsubname { display: none; }
  .invflat .hrow::before { top: 0; bottom: 0; }
  .invflat .fllinks, .invflat .flempty { border-bottom: 1px solid color-mix(in srgb, var(--line) 85%, transparent); padding-top: 8px; padding-bottom: 8px; }
  .invflat .flcards { margin-top: 8px; margin-bottom: 8px; }
}
/* v12.6: tablet widths (701-1100px): slimmer action column and one-line holding details, so names are not squeezed */
@media (min-width: 701px) and (max-width: 1100px) {
  .invflat .flrow { grid-template-columns: minmax(0, 1fr) var(--flcols) 34px; column-gap: 8px; }
  .invflat .flsub { white-space: nowrap; }
  .invflat .flc { font-size: 13px; }
}

/* ---------- v12.8 (phone): the entry screen. Full height, a slim top bar, hairline rows; never wider than the screen ---------- */
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 700px) {
  html.peopen .modal { align-items: stretch; }
  .sheet.pe, html[data-text] .sheet.pe { zoom: 1 !important; width: 100vw !important; max-width: 100vw; height: 100dvh; max-height: none; border: 0; border-radius: 0; box-shadow: none;
    padding: 0 0 calc(24px + env(safe-area-inset-bottom)); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; background: var(--panel); }
  .sheet.pe *, .sheet.pe *::before, .sheet.pe *::after { box-sizing: border-box; }
  .sheet.pe .hd { position: sticky; top: 0; z-index: 6; display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; align-items: center; gap: 6px; margin: 0;
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: var(--panel); border-bottom: 1px solid var(--line); }
  .sheet.pe .hd .grow { text-align: center; min-width: 0; }
  .sheet.pe .hd h2 { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 21px; line-height: 1.15; color: var(--text); }
  .sheet.pe .hd .muted { font-size: 11.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sheet.pe .hd .x { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); }
  .petick { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border-radius: 50%; border: 1px solid var(--gold-deep, var(--accent)); background: var(--gold, var(--accent)); color: var(--accent-ink, #fff); justify-self: end; }
  .petick svg, .sheet.pe .hd .x svg { width: 20px; height: 20px; stroke-width: 2; }
  .sheet.pe .form { display: block; padding: 0 16px; margin: 0; }
  .sheet.pe .form > .note, .sheet.pe .field > .note:not([id]), .sheet.pe #envNote, .sheet.pe #fileNote, .sheet.pe .colourx > .note, .sheet.pe .colourx p.note { display: none; }
  .sheet.pe input:not([type=checkbox]):not([type=radio]), .sheet.pe select, .sheet.pe textarea { font-size: 16px !important; min-width: 0; max-width: 100%; }
  /* title + done */
  .petitle { display: grid; grid-template-columns: minmax(0, 1fr) 34px; align-items: center; gap: 10px; padding: 14px 0 8px; border-bottom: 1px solid var(--line); }
  #sheet.pe .petitle input[name=title] { width: 100%; height: auto; min-height: 0; border: 0 !important; border-radius: 0 !important; background: transparent !important; padding: 6px 0 !important; font-size: 19px !important; font-weight: 500; color: var(--text); box-shadow: none !important; outline: none; }
  .petitle input[name=title]::placeholder { color: var(--faint, var(--muted)); font-weight: 400; }
  .sheet.pe .pedone { position: relative; width: 32px; height: 32px; min-height: 0; margin: 0 !important; padding: 0 !important; border-radius: 50% !important; box-shadow: none !important; border: 1.5px solid var(--line); background: transparent !important; display: grid; place-items: center; cursor: pointer; }
  .pedone input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
  .pedone .pedonei { width: 16px; height: 16px; stroke-width: 2.2; color: transparent; pointer-events: none; }
  /* v12.13: .sheet.pe .pedone's transparent !important beat the old :has rule, so the circle never filled and the white tick vanished on the ivory sheet. */
  .sheet.pe .pedone:has(input:checked), .sheet.pe .pedone.on { background: var(--emerald, var(--pos)) !important; border-color: var(--emerald, var(--pos)) !important; }
  .sheet.pe .pedone:has(input:checked) .pedonei, .sheet.pe .pedone.on .pedonei { color: #fff !important; }
  /* type + amount */
  .peamt { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .sheet.pe .seg.pekind { display: inline-flex; gap: 0; margin: 0; padding: 0; background: transparent; border: 0; width: auto; }
  .sheet.pe .seg.pekind button { flex: none; width: 60px; overflow: visible; height: auto; min-height: 0; padding: 0; display: grid; justify-items: center; gap: 3px; border: 0; border-radius: 0; background: transparent !important; color: var(--muted); box-shadow: none; }
  .sheet.pe .seg.pekind .pekc { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); }
  .sheet.pe .seg.pekind .pekc svg { width: 19px; height: 19px; stroke-width: 1.9; }
  .sheet.pe .seg.pekind .pekl { font-size: 10px; line-height: 1.1; letter-spacing: .02em; white-space: nowrap; color: var(--muted); }
  .sheet.pe .seg.pekind button.active .pekc { background: var(--emerald, var(--accent)); border-color: var(--emerald, var(--accent)); color: #fff; }
  .sheet.pe .seg.pekind button.active[data-k="-1"] .pekc { background: var(--neg); border-color: var(--neg); }
  .sheet.pe .seg.pekind button.active .pekl { color: var(--text); font-weight: 600; }
  .peamtin { display: flex; align-items: baseline; gap: 3px; min-width: 0; justify-content: flex-start; }
  .pecur { font-size: 22px; color: var(--muted); }
  #sheet.pe .peamtin input[name=amount] { width: 100%; min-width: 0; height: auto; min-height: 0; border: 0 !important; border-radius: 0 !important; background: transparent !important; padding: 2px 0 !important; text-align: left; font-size: 28px !important; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--text); box-shadow: none !important; outline: none; }
  .peamtw { display: grid; justify-items: start; min-width: 0; padding-left: 4px; } .petype { padding-left: 1px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); line-height: 1; }
  /* rows */
  .perows { margin: 0; }
  .sheet.pe .perow { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 14px; align-items: center; column-gap: 12px; min-height: 48px; margin: 0; padding: 0;
    border: 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent); background: transparent; width: 100%; text-align: left; color: var(--text); font: inherit; }
  .sheet.pe .perow .pei { color: var(--gold-text, var(--accent)); width: 20px; height: 20px; }
  .sheet.pe .perow > label, .sheet.pe .perow .pel { grid-column: 2; margin: 0; font-size: 15px; font-weight: 450; color: var(--text); text-transform: none; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sheet.pe .perow .pev { grid-column: 3; justify-self: end; max-width: 52vw; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sheet.pe .perow .pev.none { color: var(--faint, var(--muted)); }
  .sheet.pe .perow .pec { grid-column: 4; width: 14px; height: 14px; color: var(--faint, var(--muted)); stroke-width: 2; }
  .sheet.pe .perow.open .pec { transform: rotate(90deg); }
  /* the real picker covers the whole row, invisible: a tap opens the phone's own list or calendar */
  .sheet.pe .pepick > select, .sheet.pe .pepick > input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; padding: 0; border: 0; z-index: 2; -webkit-appearance: none; appearance: none; cursor: pointer; }
  .sheet.pe .pepick[hidden] { display: none; }
  .pesub { padding: 6px 0 12px 34px; border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent); display: grid; gap: 8px; min-width: 0; }
  .sheet.pe .pesub .perow { min-height: 42px; border-bottom: 0; }
  .sheet.pe .pesub .perow > label { font-size: 14px; }
  .pesub[hidden], .pesub:not(:has(> :not([hidden]))) { display: none; }
  .pesub .field { margin: 0; min-width: 0; }
  .pesub .field > label { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
  .pesub input, .pesub select, .pesub textarea { width: 100%; height: 38px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
  .pesub textarea { height: 84px; resize: none; }
  .pesub .two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .pesub .ivrow { display: flex; align-items: center; gap: 8px; } .pesub .ivrow input { width: 64px; flex: none; }
  .pesub .dows { display: flex; flex-wrap: wrap; gap: 4px; } .pesub .dowbtn { flex: 1 1 0; min-width: 0; padding: 6px 0; font-size: 12px; }
  .pesub .note { font-size: 11.5px; margin: 0; }
  .peremsub #remField > label, .peremsub .remrow > select { display: none; }
  .peremsub .remrow { display: block; }
  .petimel { display: flex; align-items: center; justify-content: space-between; gap: 10px; } .petimel span { font-size: 14px; color: var(--muted); }
  .petimel input[type=time] { width: auto; flex: 0 0 auto; min-width: 0; max-width: 60%; text-align: right; }
  .sheet.pe .colourx.peinline > summary { display: none; }
  .sheet.pe .colourx.peinline { border: 0; padding: 0; margin: 0; background: transparent; }
  .sheet.pe .pesub #filesField > label, .sheet.pe .pesub > .field:has(> textarea) > label { display: none; }
  .sheet.pe .pesub .qaextras { margin: 0; } .sheet.pe .pesub .qachips { display: flex; flex-wrap: wrap; gap: 6px; }
  .sheet.pe .pesub .qalab { display: none; }
  .pedel { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; margin: 10px 0 0; padding: 0 16px; border: 0; background: transparent; color: var(--neg); font: inherit; font-size: 15px; }
  .pedel svg { width: 20px; height: 20px; }
  /* which dates to change (a repeating entry) */
  .pescope { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; background: rgba(8, 20, 30, .35); }
  .pescope[hidden] { display: none; }
  .pesc { width: 100%; background: var(--panel); border-radius: 18px 18px 0 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); display: grid; gap: 8px; box-shadow: 0 -8px 30px rgba(0, 0, 0, .18); }
  .pesh { margin: 0 0 2px; text-align: center; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .pescb { display: flex; flex-direction: column; align-items: center; gap: 1px; width: 100%; min-height: 48px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; }
  .pescb b { font-weight: 600; font-size: 15px; } .pescb small { font-size: 11.5px; color: var(--muted); }
  .pescb.pri { background: var(--gold, var(--accent)); border-color: var(--gold-deep, var(--accent)); color: var(--accent-ink, #fff); } .pescb.pri small { color: inherit; opacity: .8; }
  .pescx { min-height: 42px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; }
}

/* ---------- v12.8 (phone calendar): a steady top. The calendar screen is one fixed page - only the day list scrolls - so the header,
   the account strip and the month never move or bounce. The page itself is held still (iPhone Safari lets an overflow:hidden page
   rubber-band, and the sticky header then stayed put while the strip under it slid up and down). The header is no longer sticky here, so the
   header and the strip always move as one block. With very large text, where the page has to scroll, everything scrolls together. ---------- */
@media (max-width: 700px) {
  html.phonecal:not(.phonecalscroll) body { position: fixed; inset: 0; width: 100%; overflow: hidden; overscroll-behavior: none; }
  html.phonecal:not(.phonecalscroll) { overscroll-behavior: none; }
  html.phonecal .topbar { position: relative; }
  html.phonecal #accountTabs { overscroll-behavior-x: contain; touch-action: pan-x; }
}

/* v12.9: on a computer the entry panel can be tucked away so the calendar fills the screen (kept on this device). */
@media (min-width: 1001px) {
  .calwrap { position: relative; --dpw: 360px; --dpg: 16px; }
  body.calfit .calwrap { --dpg: 12px; }
  .calwrap.dphid, body.calfit .calwrap.dphid { grid-template-columns: minmax(0, 1fr); }
  .calwrap.dphid.cat3, body.calfit .calwrap.dphid.cat3 { grid-template-columns: minmax(0, 1fr) 300px; }
  .calwrap.dphid > #dayPanel { display: none; }
  /* a small round chevron on the seam between the calendar and the panel, and a slim tab on the screen edge to bring it back */
  .dptuck, .dpshow { position: absolute; z-index: 6; display: grid; place-items: center; padding: 0; cursor: pointer; color: var(--muted); background: var(--panel); border: 1px solid var(--line); transition: color .15s, border-color .15s, width .15s, opacity .15s; }
  .dptuck { width: 22px; height: 22px; border-radius: 50%; top: 50%; right: calc(var(--dpw) + var(--dpg) / 2 - 11px); transform: translateY(-50%); opacity: .75; box-shadow: 0 1px 3px rgba(11, 36, 31, .08); }
  .dpshow { width: 16px; height: 64px; color: var(--gold-text); top: 50%; right: -16px; transform: translateY(-50%); border-right: 0; border-radius: 10px 0 0 10px; box-shadow: -1px 0 4px rgba(11, 36, 31, .06); }
  .dptuck:hover, .dptuck:focus-visible { opacity: 1; color: var(--gold-text); border-color: var(--gold-hi); }
  .dpshow:hover, .dpshow:focus-visible { width: 20px; color: var(--gold-text); border-color: var(--gold-hi); }
  .dptuck svg, .dpshow svg { width: 12px; height: 12px; }
  /* the panel sliding back for one entry */
  .calwrap.dpin > #dayPanel { animation: dpin .18s ease-out; }
  @keyframes dpin { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
}
@media (min-width: 1500px) and (min-height: 540px) {
  body.calfit .calwrap { --dpw: 400px; }
  body.calfit .calwrap.dphid.cat3 { grid-template-columns: minmax(0, 1fr) 320px; }
}
/* wide cells with the panel tucked away: slightly larger entry text so the extra room reads as space, not gaps */
@media (min-width: 1500px) and (min-height: 800px) {
  body.calfit .calwrap.dphid .day .it { font-size: 13px; line-height: 1.3; }
  body.calfit .calwrap.dphid .day .dn { font-size: 14px; }
  body.calfit .calwrap.dphid .day { padding-left: 8px; padding-right: 8px; }
}
/* v12.11: from 701px to 1000px the entry panel slides in over the grid (month bar stays visible).
   Above 1000px and on phones the layout is unchanged. The form itself is the same docked editor. */
@media (min-width: 701px) and (max-width: 1000px) {
  .calwrap { position: relative; --dpw: 360px; }
  .calwrap.dphid > #dayPanel { display: none; }
  .calwrap.dpover:not(.dphid) > #dayPanel {
    position: fixed;
    top: var(--dpo-top, 200px);
    right: 0;
    bottom: 0;
    left: auto;
    width: var(--dpw);
    z-index: 40;
    margin: 0;
    padding: 12px 14px 16px;
    max-height: none;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--panel);
    border: 0;
    border-left: 1px solid var(--line);
    border-top: 1px solid var(--line);
    border-radius: 16px 0 0 0;
    box-shadow: -16px 8px 48px rgba(0, 0, 0, .38);
  }
  .calwrap.dpover:not(.dphid) > #dayPanel > .card.dp {
    position: static;
    max-height: none;
    overflow: visible;
    margin: 0;
    box-shadow: none;
    border: 0;
    background: transparent;
    padding: 4px 2px 8px;
  }
  .calwrap.dpover:not(.dphid)::after {
    content: '';
    position: fixed;
    top: var(--dpo-top, 200px);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 35;
    background: rgba(4, 8, 7, .36);
    pointer-events: none;
  }
  /* a clear tab on the panel's left edge hides it; a matching tab on the screen edge brings it back */
  .calwrap.dpover .dptuck, .calwrap.dpover .dpshow {
    position: fixed;
    z-index: 45;
    display: grid;
    place-items: center;
    padding: 0;
    cursor: pointer;
    color: var(--gold-text, var(--accent));
    background: var(--panel);
    border: 1px solid var(--line);
    width: 18px;
    height: 64px;
    border-right: 0;
    border-radius: 10px 0 0 10px;
    box-shadow: -1px 0 4px rgba(11, 36, 31, .12);
    transition: color .15s, border-color .15s, width .15s, opacity .15s;
  }
  .calwrap.dpover .dptuck {
    top: calc(var(--dpo-top, 200px) + (100vh - var(--dpo-top, 200px)) / 2);
    right: var(--dpw);
    transform: translateY(-50%);
  }
  .calwrap.dpover .dpshow {
    top: calc(var(--dpo-top, 200px) + (100vh - var(--dpo-top, 200px)) / 2);
    right: 0;
    transform: translateY(-50%);
  }
  .calwrap.dpover .dptuck:hover, .calwrap.dpover .dptuck:focus-visible,
  .calwrap.dpover .dpshow:hover, .calwrap.dpover .dpshow:focus-visible {
    width: 22px;
    color: var(--gold-text, var(--accent));
    border-color: var(--gold-hi, var(--accent));
  }
  .calwrap.dpover .dptuck svg, .calwrap.dpover .dpshow svg { width: 12px; height: 12px; }
  .calwrap.dpover.dpin > #dayPanel { animation: dpin-over .18s ease-out; }
  @keyframes dpin-over { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
}
@media (min-width: 701px) and (max-width: 1000px) and (min-height: 540px) {
  /* fit the month on screen so the bar stays visible; compact-header rules used above 1000px are left alone */
  body { --fitmode: 1; }
  body.calfit { height: 100vh; height: 100dvh; overflow: hidden; }
  body.calfit #app { height: 100%; display: flex; flex-direction: column; }
  body.calfit .topbar { position: static; }
  body.calfit main { flex: 1; min-height: 0; width: 100%; padding-bottom: 10px; }
  body.calfit #view-calendar.active { height: 100%; }
  body.calfit .calwrap { height: 100%; align-items: stretch; grid-template-rows: minmax(0, 1fr); gap: 12px; }
  body.calfit .calwrap > div:first-child { display: flex; flex-direction: column; min-height: 0; }
  body.calfit .calnav { margin: 2px 0 6px; flex: none; flex-wrap: nowrap; }
  body.calfit .grid { flex: 1; min-height: 0; grid-template-rows: auto repeat(var(--weeks, 6), minmax(0, 1fr)); }
  body.calfit .grid .dow { padding: 4px 8px; font-size: 11px; }
  body.calfit .day { min-height: 0; overflow: hidden; padding: 3px 6px 20px; gap: 1px; }
  body.calfit .day .dn { font-size: 13px; line-height: 1.2; }
  body.calfit .day .it { font-size: 12px; line-height: 1.25; }
  body.calfit .day .bal { font-size: 13px; bottom: 3px; }
  body.calfit .calwrap .note { flex: none; margin: 4px 0 0; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (prefers-reduced-motion: reduce) { .calwrap.dpover.dpin > #dayPanel { animation: none; } }
@media (prefers-reduced-motion: reduce) { .calwrap.dpin > #dayPanel { animation: none; } }


/* ======================================================================
   v12.11: entry style C (a filled colour dot; amounts stay green/red,
   with a plus on incoming amounts and a minus on outgoing),
   no hover underline on completed entries (line-through is kept),
   and italic Cormorant headings use the PERISSO wordmark font
   (Jost 400, uppercase). Colours on those headings are unchanged.
   ====================================================================== */
:root { --display: 'Jost', 'Futura', 'Century Gothic', 'Avenir Next', system-ui, sans-serif; }

.day .it[data-key] {
  border-left: 0;
  padding-left: 1px;
  align-items: center;
  margin: 0 0 1px;
}
.day .it[data-key] .t::before {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cc, var(--muted));
  margin-right: 4px;
  vertical-align: 0.5px;
  flex: none;
}
:root:not([data-theme="luxe"]) .day .it[data-key]:not(.nocc) .t::before {
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.16);
}
.dp .row[data-key], .dayhover .dh-it { border-left: 0; }
/* Select mode still uses a check before the title in place of the dot */
.day .it.picked .t::before {
  content: '✓ ';
  width: auto; height: auto;
  border-radius: 0;
  background: none;
  box-shadow: none;
  font-weight: 800;
  color: var(--accent);
  margin-right: 0;
  vertical-align: 0;
}

/* completed entries keep their strike-through; hovering them no longer adds an underline */
.dayhover .dh-it:hover .dh-t,
.grow.click:hover .ttl,
.day .it:hover,
.day .it:hover *,
.dp .row:hover,
.dp .row:hover * {
  text-decoration-line: none !important;
}
html[data-done="cross"] .dayhover .dh-it.done .dh-t,
html[data-done="cross"] .day .it.done .t,
html[data-done="cross"] .row.done .ttl {
  text-decoration-line: line-through !important;
}

/* the day pop-out stays above the mid-width entry drawer so another entry can still be picked */
.dayhover { z-index: 50; }

/* --- headings: Jost uppercase. Sizes and tracking are set per spot. --- */
.calnav h2,
body.calfit .calnav h2,
.hcmonth {
  font-family: var(--display);
  font-style: normal;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .20em;
  font-size: 17px;
  line-height: 1.2;
  min-width: 0;
}
.calnav h2 .caret,
.hcmonth .caret {
  letter-spacing: 0;
  text-transform: none;
  margin-left: .35em;
  font-size: .85em;
  opacity: .7;
  font-family: var(--font);
  font-style: normal;
  font-weight: 400;
}
.dp .dphd h3.dptitle,
h3.dptitle {
  font-family: var(--display);
  font-style: normal;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 15px;
  line-height: 1.2;
  min-width: 0;
}
.ovh {
  font-family: var(--display);
  font-style: normal;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 15px;
  line-height: 1.25;
}
#view-accounts .envhd h3 {
  font-family: var(--display);
  font-style: normal;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .10em;
  font-size: 15px;
  line-height: 1.25;
}
.sheet.pe .hd h2,
html[data-text] .sheet.pe .hd h2 {
  font-family: var(--display);
  font-style: normal;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 15px;
  line-height: 1.2;
}
.fc-head h2 {
  font-family: var(--display);
  font-style: normal;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 17px;
  line-height: 1.2;
}
.loginname {
  font-family: var(--display);
  font-style: normal;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: 28px;
  line-height: 1.15;
  padding: 0 0 8px;
  margin-right: -.28em;
  background: var(--wm-rule) left bottom / calc(100% - .28em) 1px no-repeat;
}
.nwhero .nwfig {
  font-family: var(--display);
  font-style: normal;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .04em;
}
/* The line of the day is a sentence: PERISSO font (Jost), sentence case, tight tracking. */
.menuquote,
.hdrline,
.hdrline:not([hidden]),
#dailyLine,
#dailyLine:not([hidden]),
.dailyline {
  font-family: var(--display);
  font-style: normal;
  font-weight: 400;
  text-transform: none;
  letter-spacing: .02em;
  font-size: 14px;
  line-height: 1.3;
}
/* Empty-day notes: same Jost sentence case as the daily quotes (no italic, no caps). */
.dp .schedhd.none,
.dayhover .dh-empty {
  font-family: var(--display);
  font-style: normal;
  font-weight: 400;
  text-transform: none;
  letter-spacing: .02em;
  font-size: 14px;
  line-height: 1.3;
}
@media (max-width: 700px) {
  .hcmonth,
  .calnav h2,
  body.calfit .calnav h2 {
    font-size: 15px;
    letter-spacing: .16em;
  }
  .dp .dphd h3.dptitle,
  h3.dptitle {
    font-size: 14px;
    letter-spacing: .12em;
  }
  .fc-head h2 { font-size: 15px; letter-spacing: .14em; }
  .loginname { font-size: 24px; letter-spacing: .24em; margin-right: -.24em; background-size: calc(100% - .24em) 1px; }
  .sheet.pe .hd h2,
  html[data-text] .sheet.pe .hd h2 { font-size: 14px; letter-spacing: .10em; }
  #view-accounts .envhd h3 { font-size: 14px; letter-spacing: .08em; }
}



/* v12.12: investment price status. Wording carries the meaning; the left edge is only a marker. */
.invbanner, .invstatus {
  margin: 8px 0 10px;
  padding: 10px 12px 10px 14px;
  border: 1px solid var(--line, #c5d0cb);
  border-left-width: 4px;
  border-radius: 10px;
  background: var(--panel, #fff);
  color: var(--text, #1b2b27);
  font-size: 14px;
  line-height: 1.4;
}
.invbanner { border-left-color: var(--accent, #7F5F00); }
.invstatus { border-left-color: var(--ink, #1b2b27); }
.invbanner b, .invstatus b { font-weight: 650; }
.invnoload { font-weight: 650; }


/* v12.14: budget currency. Codes and prefixes carry the meaning; colour is not the only cue. */
abbr.ccytag { font-size: 10px; font-weight: 650; letter-spacing: .06em; color: var(--muted); margin-left: 4px; text-decoration: none; font-style: normal; }
.dualccy { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 1px; line-height: 1.25; text-align: right; }
.dualccy .native { font-size: 11px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.invflat .flc .dualccy { white-space: normal; }
.invflat .flc .dualccy b { font-weight: 650; }
.nwhero .nwccy { font-family: var(--font, inherit); font-style: normal; font-size: 14px; font-weight: 650; letter-spacing: .06em; color: color-mix(in srgb, var(--nw-gold, #e6cf8a) 70%, #fff); margin-left: 8px; vertical-align: middle; }
#currencyField .inp { max-width: 28rem; }
@media (max-width: 720px) {
  .invflat .flc .dualccy { font-size: 11px; }
  .invflat .flc .dualccy .native { font-size: 10px; }
  .nwhero .nwccy { font-size: 12px; margin-left: 6px; }
}
.ccychange { margin: 10px 0 0; padding: 10px 12px; border: 1.5px solid var(--gold, #C9A43A); background: color-mix(in srgb, var(--gold, #C9A43A) 14%, var(--panel, #fff)); border-radius: 10px; color: var(--text); font-size: 13.5px; line-height: 1.4; }
.ccychange b { display: block; margin: 0 0 4px; font-weight: 650; }
#guideCurrencyField .inp { max-width: 28rem; }


/* ---------- v12.16: Simple and Detailed layout ---------- */
body[data-layout="simple"] #accountTabs,
body[data-layout="simple"] #envTabs { display: none !important; }
body[data-layout="simple"] #invBtn,
body[data-layout="simple"] #mainnav [data-view="accounts"],
body[data-layout="simple"] #mainnav [data-view="categories"],
body[data-layout="simple"] #mainnav [data-view="reports"] { display: none !important; }
body[data-layout="simple"] .calnav [data-calsearch],
body[data-layout="simple"] .calnav [data-cselect] { display: none !important; }

/* the balance line: "Main account ▾ $1,217.05 today" with a pick list */
.simpleacct { position: relative; display: flex; align-items: baseline; padding: 0 0 6px; min-width: 0; z-index: 20; }
.simpleacct-btn { display: flex; align-items: baseline; gap: 8px; margin: 0; padding: 6px 2px; min-height: 32px; border: 0; background: transparent; cursor: pointer; font: inherit; color: inherit; max-width: 100%; }
.simpleacct-btn:hover .n, .simpleacct-btn:hover .chev { color: var(--text); }
.simpleacct-btn:focus-visible { outline: 2px solid var(--gold, #C9A43A); outline-offset: 2px; border-radius: 6px; }
.simpleacct .n { font-size: 13px; color: var(--muted); font-weight: 550; display: inline-flex; align-items: baseline; gap: 3px; white-space: nowrap; }
.simpleacct .chev { font-size: 9px; line-height: 1; color: var(--muted); transform: translateY(-1px); }
.simpleacct.open .chev { transform: translateY(-1px) rotate(180deg); }
.simpleacct .b { font-weight: 650; color: var(--cellbal); font-size: 15px; font-variant-numeric: tabular-nums; }
.simpleacct .b.neg { color: var(--neg) !important; }
.simpleacct .when { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.simpleacct.in-nav { display: none; padding: 0 10px 0 0; }
.simplepick { position: absolute; top: calc(100% + 4px); left: 0; min-width: 240px; max-width: min(320px, 92vw); padding: 4px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 28px color-mix(in srgb, var(--text) 12%, transparent); z-index: 80; }
.simpleacct.in-nav .simplepick { left: auto; right: 0; }
.simplepick[hidden] { display: none; }
.simplepick button { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; width: 100%; margin: 0; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: inherit; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.simplepick button:hover { background: var(--panel2, var(--tint)); }
.simplepick button.on { background: color-mix(in srgb, var(--sel, var(--emerald)) 12%, transparent); box-shadow: inset 3px 0 0 var(--sel, var(--emerald)); }
.simplepick .pn { font-weight: 550; min-width: 0; }
.simplepick .pb { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--cellbal); white-space: nowrap; }
.simplepick .pb.neg { color: var(--neg) !important; }

/* Detailed on a phone: a quiet row for balances and the month summary */
.v12strip.v12sumrow, :root:not([data-theme="luxe"]) .v12strip.v12sumrow, :root[data-pal][data-theme="ivory"] .v12strip.v12sumrow { background: transparent; box-shadow: none; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; margin: 6px 0 4px; }
.v12strip.v12sumrow:hover, :root:not([data-theme="luxe"]) .v12strip.v12sumrow:hover, :root[data-pal][data-theme="ivory"] .v12strip.v12sumrow:hover { background: var(--tint2); }
.v12strip.v12sumrow .v12k, :root:not([data-theme="luxe"]) .v12strip.v12sumrow .v12k, :root[data-pal][data-theme="ivory"] .v12strip.v12sumrow .v12k { color: var(--muted); }
.v12strip.v12sumrow svg, :root:not([data-theme="luxe"]) .v12strip.v12sumrow svg, :root[data-pal][data-theme="ivory"] .v12strip.v12sumrow svg { color: var(--muted); }

.v11settings .setseg { display: flex; width: 100%; max-width: 420px; border-radius: 12px; overflow: hidden; }
.v11settings .setseg button { flex: 1 1 0; font: inherit; font-size: 14px; padding: 9px 12px; cursor: pointer; }
.v11settings .setseg button.active { background: var(--sel, var(--accent)); color: var(--sel-ink, var(--accent-ink)); font-weight: 650; }

body[data-layout="simple"]:not([data-view="calendar"]) #bottomnav { display: none !important; }
@media (max-width: 700px) {
  body[data-layout="simple"] #bottomnav button:not(.bnadd) { display: none !important; }
  body[data-layout="simple"] #bottomnav { background: transparent; border: 0; box-shadow: none; pointer-events: none; height: calc(72px + env(safe-area-inset-bottom)); }
  body[data-layout="simple"] #bottomnav button.bnadd { pointer-events: auto; margin: 8px 0 0; }
  html.phonecal body[data-layout="simple"] #views,
  html.phonecal body[data-layout="simple"] main { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}
@media (min-width: 701px) {
  .simpleacct.in-cal { display: none !important; }
  body[data-layout="simple"] .simpleacct.in-nav { display: block; }
}

/* Simple on a computer: a lighter day panel. The day's entries come first; the form opens from + or an entry; templates, files, reminders and the month summary stay in Detailed. */
#dayPanel .card.simpledp { display: flex; flex-direction: column; }
#dayPanel .card.simpledp .dphd { order: 1; }
#dayPanel .card.simpledp .schedrow,
#dayPanel .card.simpledp .v12hint,
#dayPanel .card.simpledp .selbar { order: 2; }
#dayPanel .card.simpledp .list { order: 3; }
#dayPanel .card.simpledp details.bmk { order: 4; }
#dayPanel .card.simpledp #dpEditor { order: 5; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
body[data-layout="simple"] #dpEditor .qaextras,
body[data-layout="simple"] #dpEditor #remField,
body[data-layout="simple"] #dpEditor #filesField,
body[data-layout="simple"] #dayPanel .v11pbtns { display: none !important; }
@media (min-width: 701px) {
  body[data-layout="simple"] #dayPanel .list { display: flex !important; flex-direction: column; }
  body[data-layout="simple"] #dayPanel .bmk { display: block !important; }
}
/* v12.16: the flag on the summary row is a mark as well as a colour (an exclamation sign in a ring), so it is not colour alone */
.v12strip .v12flag { width: 16px; height: 16px; margin-top: -8px; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-weight: 700; font-size: 11px; line-height: 1; color: var(--neg); background: transparent; border: 1.5px solid var(--neg); }
/* v12.16: totals of the ticked categories, in the space beside Select all / Clear */
.cptools .cptot { flex: 1 1 8em; min-width: 0; display: flex; flex-wrap: wrap; gap: 0 4px; align-items: baseline; font-size: 12.5px; line-height: 1.5; color: var(--text); margin-left: 4px; }
.cptools .cptot > span { white-space: nowrap; }
.cptools .cptot b { font-weight: 650; }
.cptools .cptot i { font-style: normal; color: var(--muted); }
.cptools .cptot ~ .spacer { display: none; }
/* v12.16: Investments gain or loss. Positive uses the scheme's incoming colour (--pos) and negative its outgoing colour (--neg), exactly as the calendar does in every scheme.
   The sign (+ or minus) stays on every figure, and positive figures are a little bolder, so colour is never the only cue. */
.num.gn.pos, .num.gn.pos small { color: var(--pos) !important; font-weight: 650 !important; }
.num.gn.neg, .num.gn.neg small { color: var(--neg) !important; }

/* ======================================================================
   v12.17: the calendar's top bar takes the tint the earlier summary strip had (--strip, each colour scheme's own value).
   Desktop: the month bar (Today, « ‹ Month ▾ › », Search, Select, or the Simple balance line).
   Phone: the top header (menu, month, arrows, Today) and, in Simple, the balance line under it.
   Text is the scheme's own strip text colour (light schemes) or its normal text colour (dark schemes), figures and the month are the strip's metal colour.
   Buttons keep an outline and a label, so nothing depends on colour alone. Contrast of every pair is checked in tests-e2e/run-v12-17.js.
   ====================================================================== */
:root[data-theme="luxe"] { --bar-bg: var(--strip, #143029); --bar-text: var(--text); --bar-metal: var(--strip-metal, #D9BA68); --bar-neg: var(--strip-neg, var(--neg)); }
:root[data-theme="ivory"] { --bar-bg: var(--strip, #0F3D2E); --bar-text: var(--strip-text, #E3E8E1); --bar-metal: var(--strip-metal, #E6C877); --bar-neg: var(--strip-neg, #FFB4AB); }
.calnav .btn:focus-visible, .hdrcal button:focus-visible, .simpleacct-btn:focus-visible { outline: 2px solid var(--bar-metal); outline-offset: 2px; }

@media (min-width: 701px) {
  #view-calendar .calnav { background: var(--bar-bg); color: var(--bar-text); border-radius: 14px; padding: 5px 12px; }
  #view-calendar .calnav h2, :root[data-pal] #view-calendar .calnav h2, :root[data-theme] #view-calendar .calnav h2 { color: var(--bar-metal) !important; }
  #view-calendar .calnav .caret { color: var(--bar-text) !important; opacity: .85; }
  #view-calendar .calnav .btn, #view-calendar .calnav .btn[data-nav] { background: transparent; color: var(--bar-text) !important; border-color: color-mix(in srgb, var(--bar-text) 40%, transparent); }
  #view-calendar .calnav .btn[data-nav] { border-color: transparent; }
  #view-calendar .calnav .btn[data-today], #view-calendar .calnav .btn.todaypill { color: var(--bar-metal) !important; border-color: color-mix(in srgb, var(--bar-metal) 60%, transparent); }
  #view-calendar .calnav .btn:hover { background: color-mix(in srgb, var(--bar-text) 14%, transparent); }
  #view-calendar .calnav .btn.sel, #view-calendar .calnav .btn[aria-pressed="true"] { background: color-mix(in srgb, var(--bar-text) 22%, transparent); border-color: var(--bar-text); font-weight: 650; }
  #view-calendar .calnav .simpleacct .n, #view-calendar .calnav .simpleacct .chev, #view-calendar .calnav .simpleacct .when { color: var(--bar-text); }
  #view-calendar .calnav .simpleacct .b { color: var(--bar-metal); }
  #view-calendar .calnav .simpleacct .b.neg { color: var(--bar-neg) !important; }
  #view-calendar .calnav .simpleacct { padding-bottom: 0; }
  #view-calendar .calnav .simplepick { color: var(--text); }
  #view-calendar .calnav .simplepick .pn { color: var(--text); }
}

@media (max-width: 700px) {
  body[data-view="calendar"] .topbar { background: var(--bar-bg); color: var(--bar-text); padding-bottom: 8px; border-radius: 0 0 14px 14px; }
  body[data-view="calendar"] .topbar .menubtn { color: var(--bar-text); border: 1px solid color-mix(in srgb, var(--bar-text) 40%, transparent); background: transparent; }
  body[data-view="calendar"] .hcmonth, :root[data-pal] body[data-view="calendar"] .hcmonth, :root[data-theme] body[data-view="calendar"] .hcmonth { color: var(--bar-metal) !important; }
  body[data-view="calendar"] .hcbtn { color: var(--bar-text); }
  body[data-view="calendar"] .hctoday, body[data-view="calendar"] .hctoday.todaypill { color: var(--bar-metal); border-color: color-mix(in srgb, var(--bar-metal) 60%, transparent); }
  body[data-view="calendar"] .simpleacct.in-cal { background: var(--bar-bg); color: var(--bar-text); border-radius: 12px; padding: 0 12px; margin: 0 0 8px; }
  body[data-view="calendar"] .simpleacct.in-cal .n, body[data-view="calendar"] .simpleacct.in-cal .chev, body[data-view="calendar"] .simpleacct.in-cal .when { color: var(--bar-text); }
  body[data-view="calendar"] .simpleacct.in-cal .b { color: var(--bar-metal); }
  body[data-view="calendar"] .simpleacct.in-cal .b.neg { color: var(--bar-neg) !important; }
  body[data-view="calendar"] .simpleacct.in-cal .simplepick, body[data-view="calendar"] .simpleacct.in-cal .simplepick .pn { color: var(--text); }
}
/* v12.17: Repeats lives in More on the computer's entry form */
#dpEditor .dkrepeat { display: grid; gap: 6px; min-width: 0; }
#dpEditor .dkrepeat > .two, #dpEditor .dkrepeat > .field { margin: 0; }

/* v12.18: day label (with the year) under "New transaction" in the computer's docked form; one-time install tip */
.dpeditor .hd .dayline, .hd .muted.dayline { font-size: 13px; margin-top: 2px; }
.v12hint.installtip { align-items: center; }
.v12hint.installtip .btn.sm { flex: 0 0 auto; min-height: 30px; padding: 3px 12px; font-size: 12.5px; }
.v12hint.installtip .x { min-width: 28px; min-height: 28px; }
@media (hover: hover) and (pointer: fine) { .v12hint.installtip { display: none; } }
/* v12.18: the day heading now always has the year; if a long name (Wednesday 30 September 2026) must wrap on a phone, split it evenly */
.dp .dphd h3.dptitle { text-wrap: balance; }

/* v12.19: the docked New / Edit transaction heading and date, computer only.
   The heading uses the PERISSO wordmark font (Jost, spaced capitals, theme gold/green and a hairline).
   The date matches the phone day heading (Jost, spaced capitals, theme gold). Phone layout is unchanged. */
@media (min-width: 701px) {
  #dpEditor .hd {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "title done close"
      "sub sub sub"
      "who who who";
    align-items: start;
    column-gap: 8px;
    row-gap: 0;
  }
  #dpEditor .hd .grow { display: contents; }
  #dpEditor .hd h2 { grid-area: title; min-width: 0; }
  #dpEditor .hd .hddone { grid-area: done; }
  #dpEditor .hd .x { grid-area: close; }
  #dpEditor .hd .grow > .muted { grid-area: sub; }
  #dpEditor .hd .grow > .muted.who { grid-area: who; margin-top: 2px; }   /* v12.21: the "Added by / last edited" line gets its own row under the date, so the two lines no longer sit on top of each other */
  #dpEditor .hd h2,
  .dpeditor .hd h2 {
    font-family: var(--display);
    font-style: normal;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: .16em;
    font-size: 13px;
    line-height: 1.15;
    color: var(--wm-ink);
    padding: 0 0 2px;
    margin: 0 -.16em 0 0;
    width: max-content;
    max-width: 100%;
    background: var(--wm-rule) left bottom / calc(100% - .16em) 1px no-repeat;
  }
  #dpEditor .hd .dayline,
  #dpEditor .hd .muted.dayline,
  .dpeditor .hd .dayline {
    font-family: var(--display);
    font-style: normal;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: .10em;
    font-size: 13px;
    line-height: 1.25;
    color: var(--cellbal);
    margin-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* v12.22 (computer only; phones keep their layout): the calendar's top row never lets the month group slide under Search / Select.
   The right column is at least as wide as its buttons; when space is short the month title tightens instead. */
@media (min-width: 701px) {
  .calnav, body.calfit .calnav { grid-template-columns: minmax(0, 1fr) auto minmax(max-content, 1fr); }
  .calnav .calnavr { flex: none; }
}
@media (min-width: 701px) and (max-width: 1240px) {
  .calnav .calmid { gap: 2px; }
  .calnav .calmid .btn[data-nav] { padding-left: 7px; padding-right: 7px; }
  .calnav h2, body.calfit .calnav h2 { letter-spacing: .12em; min-width: 0; margin: 0 2px; }
}
/* v12.22: narrow calendar cells (computer at about 1024 to 1280 wide) show a compact amount (no A$, no .00 on whole dollars)
   so it is never cut off, and the entry name keeps at least a few letters. The full amount is in the day panel. */
@media (min-width: 701px) {
  #view-calendar .day { container-type: inline-size; }
  .day .it .num { flex: none; }
  .day .it .num .as { display: none; }
  @container (max-width: 132px) {
    .day .it .num .af { display: none; }
    .day .it .num .as { display: inline; }
    .day .it .t { min-width: 27px; flex: 1 1 auto; }
    .day .it[data-key] .t::before { width: 5px; height: 5px; margin-right: 2px; }
    .day .it { gap: 2px; padding-left: 2px; }
    .day .it .num { font-size: 11px; letter-spacing: -.01em; }
  }
}
/* v12.22 (computer only): Repeats takes most of the row so long choices such as "Monthly (same day each month)" are not cut off; How often shrinks to "[1] month". */
@media (min-width: 701px) {
  #dpEditor .two.freqrow, .modal .two.freqrow { grid-template-columns: minmax(0, 1fr) max-content; }
  .two.freqrow #ivField .ivrow > span:first-child { display: none; }   /* the "How often" label already says it, so the row reads "1 month" and stays narrow */
  .two.freqrow #ivField .ivrow { min-height: 0; }
  .two.freqrow #ivField .ivrow input { width: 46px !important; }
}
/* v12.22: Menu sync state as a symbol and a word (✓ Synced, ⟳ Syncing, ! Sync problem) instead of a coloured dot alone */
.navpanel .menuemail { display: flex; align-items: baseline; gap: 8px; }
.navpanel .menuemail::before { content: none; display: none; }
.navpanel .menuemail .memail { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.navpanel .menuemail .msync { flex: none; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.navpanel .menuemail[data-sync="error"] .msync { color: var(--neg); font-weight: 700; }
/* v12.23: Create account on the sign-in screen (create form and "check your email") */
#createForm, .loginsent { width: 100%; text-align: left; }
.loginh { margin: 2px 0 12px; font-size: 13px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-text, var(--accent)); text-align: center; }
.loginh:focus { outline: none; }
.loginhint { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
#createForm .loginbtn { margin-top: 6px; }
.loginlinks { align-items: baseline; gap: 2px; font-size: 13px; }
.loginlinks .muted { font-size: 13px; }
.logincreateline { margin: 20px 0 10px; }
.loginbox .btn.logincreate { width: 100%; padding: 11px 16px; border-radius: 999px; font-size: 15px; font-weight: 600; background: transparent; border: 1px solid color-mix(in srgb, var(--emerald) 70%, transparent); color: var(--text); }
:root[data-theme="luxe"] .loginbox .btn.logincreate { border-color: color-mix(in srgb, var(--gold) 65%, transparent); }
:root[data-pal][data-theme="ivory"] .loginbox .btn.logincreate, :root:not([data-theme="luxe"]) .loginbox .btn.logincreate { background: transparent; border-color: color-mix(in srgb, var(--emerald) 70%, transparent); }
.loginbox .btn.logincreate:hover, .loginbox .btn.logincreate:focus-visible { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.loginsent { padding: 18px 18px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.loginsentmsg { margin: 0 0 8px; font-size: 14.5px; line-height: 1.5; color: var(--text); text-align: center; }
.loginsentmsg b { word-break: break-all; }
.loginsent .note { margin: 0 0 14px; font-size: 12.5px; line-height: 1.45; color: var(--muted); text-align: center; }
#createForm #lgErr, .loginsent #lgErr, #loginForm #lgErr { margin: 8px 0 0; min-height: 1em; font-size: 13px; text-align: center; }
#createForm #lgErr:empty, .loginsent #lgErr:empty, #loginForm #lgErr:empty { margin: 0; min-height: 0; }
.logincreateline { margin-top: 16px; }

/* ---------- v12.24: looking around without an account ---------- */
.guestbar { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; margin: 6px 12px 4px; padding: 8px 12px; border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 10px; background: var(--panel); color: var(--text); }
.guestbar p { margin: 0; font-size: 13.5px; line-height: 1.35; }
.guestbar p span { color: var(--muted); }
.guestbtns { display: flex; gap: 8px; flex: 0 0 auto; }
.guestbtns .btn { white-space: nowrap; }
body.guest #accountTabs, body.guest #envTabs, body.guest #syncBtn, body.guest .day .bal, body.guest #dayPanel .dpbal { visibility: hidden; }
body.guest [data-cselect], body.guest .v11pbtns { display: none; }
body.guest #accountTabs, body.guest #envTabs { display: none; }
@media (max-width: 700px) {
  .guestbar { margin: 4px 10px 2px; padding: 7px 10px; }
  .guestbar p { font-size: 12.5px; flex: 1 1 100%; }
  .guestbtns { flex: 1 1 100%; }
  .guestbtns .btn { flex: 1 1 0; }
}
.guestask { text-align: center; padding: 8px 4px 4px; }
.guestask h2 { margin: 4px 0 8px; }
.guestask p { margin: 0 auto 16px; max-width: 34ch; color: var(--muted); line-height: 1.45; }
.guestask .actions { justify-content: center; }
.guestask .linkbtn { margin-top: 10px; background: none; border: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; cursor: pointer; padding: 6px; }
.login .logincal { align-self: flex-start; margin: 0 0 8px; text-decoration: none; }
/* v12.24: signed in, no accounts yet: the empty calendar (no day balances, no stand-in totals) */
body.noacc .day .bal, body.noacc #dayPanel .dpbal { visibility: hidden; }
body.noacc [data-cselect], body.noacc .v11pbtns, body.noacc #v12Strip, body.noacc [data-calsearch], body.noacc #accountTabs, body.noacc #envTabs { display: none; }
.noaccdp { padding: 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.noaccdp p { margin: 0; line-height: 1.45; }
/* v12.24: "Show me how" in the first-account bar: a text link marked by a line under it (not colour alone) that opens the setup guide. A border, because a global rule turns text underlines off */
.firstaccbar .guestbtns { align-items: center; gap: 14px; }
.firstaccbar .showhow { background: none; border: 0; border-bottom: 1px solid currentColor; border-radius: 0; padding: 2px 0 1px; margin: 4px 2px; color: var(--accent); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.firstaccbar .showhow:hover, .firstaccbar .showhow:focus-visible { border-bottom-width: 2px; padding-bottom: 0; }
@media (max-width: 700px) { .firstaccbar .guestbtns { flex-direction: row-reverse; } }
/* v12.24: a recurring entry's date line in the computer's Edit transaction panel uses the same size and style as a one-off's (it was the small muted line).
   The ↻ label stays and the date always shows in full. Windows 760px tall or more: "↻ Every fortnight", then the date on its own line if the panel is narrow.
   Shorter windows: one line, "↻ Friday 18 December 2026", so the panel gains no scrollbar (the words stay for screen readers, in the tooltip, and under More, Repeats). */
#dpEditor .hd .muted.dayline.repline, .dpeditor .hd .dayline.repline { display: flex; flex-wrap: wrap; column-gap: .7em; row-gap: 2px; white-space: normal; overflow: visible; text-overflow: clip; }
#dpEditor .hd .muted.dayline.repline > span, .dpeditor .hd .dayline.repline > span { white-space: nowrap; }
#dpEditor .hd .muted.dayline.repline .sep, .dpeditor .hd .dayline.repline .sep { display: none; }
@media (max-height: 759px) {
  #dpEditor .hd .muted.dayline.repline, .dpeditor .hd .dayline.repline { flex-wrap: nowrap; column-gap: .45em; overflow: hidden; }
  #dpEditor .hd .muted.dayline.repline .rw, .dpeditor .hd .dayline.repline .rw { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
}


/* v12.27: the bell in the top bar (next to Menu, same pill as Calendar / Investments). The alert count is a number on it, never colour alone.
   It opens the Alerts page. On phones it is an icon button beside the month arrows. */
.bellbtn { display: inline-flex; align-items: center; gap: 6px; position: relative; }
.bellbtn .bellico { flex: none; color: var(--gold-text); }
.bellbtn .badge { margin-left: 2px; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.bellbtn .badge[hidden] { display: none; }
@media (max-width: 700px) {
  .topright #bellBtn { display: inline-flex !important; width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--text); }
  .bellbtn .belltxt { display: none; }
  .bellbtn .bellico { width: 20px; height: 20px; }
  .bellbtn .badge { position: absolute; top: 1px; right: -1px; margin: 0; min-width: 16px; height: 16px; line-height: 16px; font-size: 10px; padding: 0 4px; }
  body[data-view="calendar"] .topbar .bellbtn { color: var(--bar-text); }
  body[data-view="calendar"] .topbar .bellbtn .bellico { color: var(--bar-metal); }
}

/* v12.27: the Alerts page */
.alertspage { max-width: 760px; margin: 0 auto; padding: 4px 2px 24px; }
.alertspage .alhead { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 6px 0 2px; }
.alertspage .alhead h2 { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 32px; line-height: 1.1; color: var(--emerald); }
:root[data-theme="luxe"] .alertspage .alhead h2 { color: var(--gold-text); }
.alertspage .alcount { font-size: 13px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--gold-text); }
.alertspage .alsub { margin: 2px 0 14px; font-size: 13.5px; }
.allist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.alrow { position: relative; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.allist.quiet .alrow { border-left-color: var(--line); box-shadow: none; }
.alrow .alopen { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: transparent; color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.alrow .alopen:hover { background: var(--tint); }
.alrow .alopen:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.alrow .alsign { flex: none; width: 22px; font-size: 17px; line-height: 1.3; text-align: center; color: var(--gold-text); }
.alrow .albody { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.alrow .altop { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.alrow .alwho { font-size: 15.5px; font-weight: 650; }
.alrow .altag { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; }
.alrow .alwhat { font-size: 14px; }
.alrow .alwhen { font-weight: 600; }
.alrow .almore { font-size: 12.5px; color: var(--muted); }
.alrow .algo { flex: none; align-self: center; font-size: 11.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-text); white-space: nowrap; }
.alrow .aldismiss { position: absolute; right: 14px; bottom: 10px; font-size: 12.5px; }
.alertspage .alnone { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); font-size: 14px; }
.alertspage .alnotes { margin: 20px 0 8px; font-size: 13px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.alertspage .alnotes .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
.alertspage .alfoot { margin: 18px 0 0; font-size: 13px; }
@media (max-width: 700px) {
  .alertspage { padding: 2px 12px 90px; }
  .alertspage .alhead h2 { font-size: 29px; }
  .alrow .algo { display: none; }
  .alrow .alopen::after { content: '›'; flex: none; align-self: center; font-size: 20px; color: var(--gold-text); }
}
.alertspage .alset { border: 0; border-bottom: 1px solid currentColor; border-radius: 0; background: transparent; padding: 0 0 1px; font: inherit; font-weight: 650; color: var(--emerald); cursor: pointer; }
:root[data-theme="luxe"] .alertspage .alset { color: var(--gold-text); }
.alrow .nw { white-space: nowrap; }
body[data-view="alerts"] #accountTabs, body[data-view="alerts"] #envTabs { display: none; }
@media (max-width: 700px) { body:not([data-view="calendar"]) .topright #bellBtn { margin-left: auto; } }
/* v12.27: Settings, Alerts: its own section straight after Preferences, with the same list as the Alerts page */
.v11sec[data-setsec="alerts"] summary h3 { display: inline-flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.v11sec[data-setsec="alerts"] summary .alcount { font-family: inherit; font-style: normal; font-size: 11.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-text); }
.alertspage.insettings { max-width: none; margin: 0; padding: 0; }
.alertspage.insettings .alsub { margin-top: 0; }
@media (max-width: 700px) { .alertspage.insettings { padding: 0; } }
#view-settings .v11sec[data-setsec="alerts"] { scroll-margin-top: calc(72px + env(safe-area-inset-top)); }
.alertspage.insettings .actions { margin-top: 12px; }

/* v12.25b: the "Finish the setup steps" line (same slim bar as "Add your first account") and the next step in the guide, marked in words ("Next step") as well as a border */
.finishsetupbar p b { white-space: nowrap; }
.guide .step { scroll-margin-top: 84px; }
.guide .step.next { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 10px; }
.guide .step .nextlbl { display: inline-block; margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text); border-bottom: 1px solid currentColor; }
.guide .step h3:focus { outline: none; }
/* v12.27: Help, "Check an entry" (Entry check left the Menu): a quiet text link marked by a line under it, not colour alone */
.textlink { border: 0; border-bottom: 1px solid currentColor; border-radius: 0; background: transparent; padding: 0 0 1px; font: inherit; font-weight: 650; color: var(--emerald); cursor: pointer; }
:root[data-theme="luxe"] .textlink { color: var(--gold-text); }
.helpfoot .helpcheck { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
