/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
textarea,
input {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.icon {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon.sm {
  width: 17px;
  height: 17px;
}

.icon.lg {
  width: 26px;
  height: 26px;
}

.num {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  letter-spacing: -0.01em;
}

/* ---------- Backdrop: lime light for the glass to catch ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
}

.backdrop i {
  position: absolute;
  border-radius: 50%;
  filter: blur(calc(60px * var(--k, 1))); /* Spread (Settings › Appearance) softens ... */
  scale: var(--sp, 1); /* ...and widens the lights */
  will-change: transform;
}

/* Six lights are in the page; the first four are Aurora's, the rest only some styles use */
.backdrop i:nth-child(n + 5) {
  display: none;
}

.backdrop i:nth-child(1) {
  width: 62vmax;
  height: 62vmax;
  left: -18vmax;
  top: -22vmax;
  background: radial-gradient(circle, var(--blob-1), transparent 65%);
  animation: drift-a 38s ease-in-out infinite alternate;
}

.backdrop i:nth-child(2) {
  width: 55vmax;
  height: 55vmax;
  right: -20vmax;
  top: 10vh;
  background: radial-gradient(circle, var(--blob-2), transparent 65%);
  animation: drift-b 46s ease-in-out infinite alternate;
}

.backdrop i:nth-child(3) {
  width: 48vmax;
  height: 48vmax;
  left: 22vw;
  bottom: -30vmax;
  background: radial-gradient(circle, var(--blob-1), transparent 62%);
  animation: drift-c 52s ease-in-out infinite alternate;
}

.backdrop i:nth-child(4) {
  width: 30vmax;
  height: 30vmax;
  left: 40vw;
  top: 8vh;
  background: radial-gradient(circle, var(--blob-3), transparent 65%);
  animation: drift-b 60s ease-in-out infinite alternate-reverse;
}

@keyframes drift-a {
  to {
    transform: translate3d(8vw, 6vh, 0) scale(1.08);
  }
}

@keyframes drift-b {
  to {
    transform: translate3d(-10vw, 8vh, 0) scale(0.92);
  }
}

@keyframes drift-c {
  to {
    transform: translate3d(6vw, -8vh, 0) scale(1.12);
  }
}

/* Backdrop styles (Settings › Appearance › Background › Style). <html data-bgstyle="…">. Aurora is the four
   drifting lights above; every other style starts from a clean slate and arranges the same lights its own way.
   Colours come from --blob-1…3 (lime) and --pb-1…3 (the second colour, Mix; lime again when it is Lime only). */
[data-bgstyle]:not([data-bgstyle="aurora"]) .backdrop i {
  inset: auto;
  transform: none;
}

[data-bgstyle="spotlight"] .backdrop i:nth-child(1) {width:95vmax;height:95vmax;left:-30vmax;top:-48vmax;background:radial-gradient(circle,var(--blob-1),transparent 62%);animation:sl-a 60s ease-in-out infinite alternate;filter:blur(calc(40px * var(--k,1)))}
[data-bgstyle="spotlight"] .backdrop i:nth-child(2) {width:40vmax;height:40vmax;left:8vmax;top:-6vmax;background:radial-gradient(circle,var(--pb-3),transparent 65%);opacity:.7;animation:sl-b 45s ease-in-out infinite alternate}
[data-bgstyle="spotlight"] .backdrop i:nth-child(n+3) {display:none}
@keyframes sl-a{to{transform:translate3d(6vw,4vh,0) scale(1.06)}}@keyframes sl-b{to{transform:translate3d(8vw,6vh,0) scale(.9)}}
[data-bgstyle="horizon"] .backdrop i:nth-child(1) {width:150vw;height:64vmax;left:-25vw;bottom:-44vmax;background:radial-gradient(ellipse at 50% 50%,var(--blob-1),transparent 66%);animation:hz-a 40s ease-in-out infinite alternate}
[data-bgstyle="horizon"] .backdrop i:nth-child(2) {width:70vw;height:30vmax;left:15vw;bottom:-18vmax;background:radial-gradient(ellipse,var(--pb-3),transparent 68%);opacity:.8;animation:hz-b 30s ease-in-out infinite alternate}
[data-bgstyle="horizon"] .backdrop i:nth-child(3) {width:40vmax;height:40vmax;left:-12vmax;bottom:-14vmax;background:radial-gradient(circle,var(--pb-2),transparent 66%);animation:hz-b 52s ease-in-out infinite alternate-reverse}
[data-bgstyle="horizon"] .backdrop i:nth-child(4) {display:none}
@keyframes hz-a{to{transform:translate3d(5vw,-3vh,0) scale(1.05)}}@keyframes hz-b{to{transform:translate3d(-6vw,-2vh,0) scale(1.1)}}
[data-bgstyle="mesh"] .backdrop i:nth-child(n+5) {display:block}
[data-bgstyle="mesh"] .backdrop i {width:34vmax;height:34vmax;filter:blur(calc(55px * var(--k,1)))}
[data-bgstyle="mesh"] .backdrop i:nth-child(1) {left:-8vmax;top:-8vmax;background:radial-gradient(circle,var(--blob-1),transparent 66%);animation:m-a 34s ease-in-out infinite alternate}
[data-bgstyle="mesh"] .backdrop i:nth-child(2) {right:-10vmax;top:6vh;background:radial-gradient(circle,var(--pb-2),transparent 66%);animation:m-b 41s ease-in-out infinite alternate}
[data-bgstyle="mesh"] .backdrop i:nth-child(3) {left:30vw;top:34vh;background:radial-gradient(circle,var(--pb-3),transparent 66%);opacity:.7;animation:m-c 47s ease-in-out infinite alternate}
[data-bgstyle="mesh"] .backdrop i:nth-child(4) {left:-12vmax;bottom:-8vmax;background:radial-gradient(circle,var(--pb-2),transparent 66%);animation:m-b 38s ease-in-out infinite alternate-reverse}
[data-bgstyle="mesh"] .backdrop i:nth-child(5) {right:-6vmax;bottom:-10vmax;background:radial-gradient(circle,var(--blob-1),transparent 66%);animation:m-a 44s ease-in-out infinite alternate-reverse}
[data-bgstyle="mesh"] .backdrop i:nth-child(6) {left:42vw;top:-10vmax;background:radial-gradient(circle,var(--pb-3),transparent 66%);opacity:.6;animation:m-c 50s ease-in-out infinite alternate}
@keyframes m-a{to{transform:translate3d(6vw,5vh,0) scale(1.1)}}@keyframes m-b{to{transform:translate3d(-7vw,4vh,0) scale(.92)}}@keyframes m-c{to{transform:translate3d(4vw,-6vh,0) scale(1.12)}}
[data-bgstyle="ribbon"] .backdrop i:nth-child(1) {width:150vmax;height:34vmax;left:-30vmax;top:22vh;background:radial-gradient(ellipse,var(--blob-1),transparent 66%);transform:rotate(-26deg);animation:rb-a 44s ease-in-out infinite alternate;filter:blur(calc(70px * var(--k,1)))}
[data-bgstyle="ribbon"] .backdrop i:nth-child(2) {width:120vmax;height:20vmax;left:-10vmax;top:50vh;background:radial-gradient(ellipse,var(--pb-3),transparent 68%);opacity:.65;transform:rotate(-26deg);animation:rb-b 56s ease-in-out infinite alternate;filter:blur(calc(60px * var(--k,1)))}
[data-bgstyle="ribbon"] .backdrop i:nth-child(n+3) {display:none}
@keyframes rb-a{to{transform:rotate(-26deg) translate3d(5vw,-6vh,0)}}@keyframes rb-b{to{transform:rotate(-26deg) translate3d(-6vw,5vh,0)}}
[data-bgstyle="quiet"] .backdrop i {animation:none!important}
[data-bgstyle="quiet"] .backdrop i:nth-child(1) {width:80vmax;height:50vmax;left:10vw;top:-26vmax;background:radial-gradient(ellipse,var(--blob-1),transparent 66%)}
[data-bgstyle="quiet"] .backdrop i:nth-child(2) {width:36vmax;height:36vmax;right:-8vmax;bottom:-14vmax;background:radial-gradient(circle,var(--pb-2),transparent 68%);opacity:.7}
[data-bgstyle="quiet"] .backdrop i:nth-child(n+3) {display:none}
[data-bgstyle="aurora"] .backdrop i:nth-child(2) {background:radial-gradient(circle,var(--pb-2),transparent 65%)}
[data-bgstyle="aurora"] .backdrop i:nth-child(4) {background:radial-gradient(circle,var(--pb-3),transparent 65%)}
[data-bgstyle="blend"] .backdrop i:nth-child(n+5) {display:block}
[data-bgstyle="blend"] .backdrop i {width:62vmax;height:62vmax;filter:blur(calc(70px * var(--k,1)))}
[data-bgstyle="blend"] .backdrop i:nth-child(1) {left:-20vmax;top:-22vmax;background:radial-gradient(circle,var(--blob-1),transparent 66%);animation:m-a 46s ease-in-out infinite alternate}
[data-bgstyle="blend"] .backdrop i:nth-child(2) {right:-24vmax;bottom:-26vmax;background:radial-gradient(circle,var(--pb-1),transparent 66%);animation:m-b 52s ease-in-out infinite alternate}
[data-bgstyle="blend"] .backdrop i:nth-child(3) {right:-14vmax;top:-18vmax;width:46vmax;height:46vmax;background:radial-gradient(circle,var(--pb-2),transparent 66%);opacity:.8;animation:m-c 58s ease-in-out infinite alternate}
[data-bgstyle="blend"] .backdrop i:nth-child(4) {left:-18vmax;bottom:-24vmax;width:50vmax;height:50vmax;background:radial-gradient(circle,var(--blob-2),transparent 66%);animation:m-b 49s ease-in-out infinite alternate-reverse}
[data-bgstyle="blend"] .backdrop i:nth-child(5) {left:28vw;top:30vh;width:40vmax;height:40vmax;background:radial-gradient(circle,var(--blob-3),transparent 66%);opacity:.5;animation:m-c 62s ease-in-out infinite alternate}
[data-bgstyle="blend"] .backdrop i:nth-child(6) {display:none}
[data-bgstyle="spots"] .backdrop i:nth-child(n+5) {display:block}
[data-bgstyle="spots"] .backdrop i {width:24vmax;height:24vmax;filter:blur(calc(38px * var(--k,1)))}
[data-bgstyle="spots"] .backdrop i:nth-child(1) {left:6vw;top:6vh;background:radial-gradient(circle,var(--blob-1),transparent 64%);animation:m-a 30s ease-in-out infinite alternate}
[data-bgstyle="spots"] .backdrop i:nth-child(2) {right:8vw;top:14vh;background:radial-gradient(circle,var(--pb-1),transparent 64%);animation:m-b 36s ease-in-out infinite alternate}
[data-bgstyle="spots"] .backdrop i:nth-child(3) {left:38vw;top:42vh;background:radial-gradient(circle,var(--blob-1),transparent 64%);opacity:.8;animation:m-c 40s ease-in-out infinite alternate}
[data-bgstyle="spots"] .backdrop i:nth-child(4) {left:4vw;bottom:6vh;background:radial-gradient(circle,var(--pb-1),transparent 64%);animation:m-b 33s ease-in-out infinite alternate-reverse}
[data-bgstyle="spots"] .backdrop i:nth-child(5) {right:6vw;bottom:2vh;background:radial-gradient(circle,var(--blob-1),transparent 64%);animation:m-a 38s ease-in-out infinite alternate-reverse}
[data-bgstyle="spots"] .backdrop i:nth-child(6) {left:60vw;top:-6vh;width:18vmax;height:18vmax;background:radial-gradient(circle,var(--pb-2),transparent 64%);opacity:.8;animation:m-c 44s ease-in-out infinite alternate}
[data-bgstyle="diag"] .backdrop i {filter:blur(calc(80px * var(--k,1)))}
[data-bgstyle="diag"] .backdrop i:nth-child(1) {width:90vmax;height:90vmax;left:-40vmax;bottom:-50vmax;background:radial-gradient(circle,var(--blob-1),transparent 66%);animation:dg-a 50s ease-in-out infinite alternate}
[data-bgstyle="diag"] .backdrop i:nth-child(2) {width:90vmax;height:90vmax;right:-40vmax;top:-50vmax;background:radial-gradient(circle,var(--pb-1),transparent 66%);animation:dg-b 56s ease-in-out infinite alternate}
[data-bgstyle="diag"] .backdrop i:nth-child(3) {width:50vmax;height:50vmax;left:25vw;top:20vh;background:radial-gradient(circle,var(--blob-3),transparent 66%);opacity:.45;animation:m-c 60s ease-in-out infinite alternate}
[data-bgstyle="diag"] .backdrop i:nth-child(n+4) {display:none}
@keyframes dg-a{to{transform:translate3d(6vw,-5vh,0) scale(1.06)}}@keyframes dg-b{to{transform:translate3d(-6vw,5vh,0) scale(1.06)}}

/* ---------- Liquid glass ---------- */

.glass {
  position: relative;
  isolation: isolate;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--glass-shadow);
}

.glass.strong {
  background: var(--glass-strong);
}

/* Sheen across the body of the glass */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(155deg, var(--glass-sheen), transparent 35%, transparent 72%, var(--glass-sheen));
}

/* Bright rim, strongest at the top-left and bottom-right edges */
.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: linear-gradient(145deg, var(--glass-rim), var(--glass-rim-soft) 28%, transparent 50%, var(--glass-rim-soft) 74%, var(--glass-rim));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* ---------- Shell ---------- */

.app {
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6) 0;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--sp-4);
  min-height: 52px;
}

.title-group {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

/* The app icon (icons/, docs/07-app-icon-guide.md): the glass tile, in the corner radius iOS would give it */
.app-mark {
  width: 44px;
  height: 44px;
  flex: none;
  overflow: hidden;
  border-radius: 14px;
}

.app-mark img {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
}

.page-title {
  font-size: var(--fs-xl);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1;
}

.top-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  position: relative;
}

.round-btn {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
}

.picker-btn {
  height: 48px;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-4) 0 var(--sp-4);
  border: 0;
  border-radius: var(--r-pill);
  cursor: pointer;
  font-weight: 650;
  white-space: nowrap;
}

.picker-btn .chev {
  color: var(--text-2);
  transition: transform 0.2s;
}

.picker-btn[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}

.picker-btn[hidden] {
  display: none;
}

/* Content area: one section at a time, no endless scroll */
.content {
  min-height: 0;
  padding-bottom: calc(var(--dock-h) + 44px);
}

.page {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.page[hidden],
.section[hidden] {
  display: none;
}

.section {
  height: 100%;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  /* room for card shadows inside the scroll area */
  margin: -12px -16px;
  padding: 12px 16px 24px;
  animation: section-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes section-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.section-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--sp-2);
}

.section-bar .pills {
  position: relative;
}

/* ---------- Cards: each one its own piece of glass ---------- */

.cards {
  display: grid;
  gap: var(--sp-4);
  align-content: start;
}

.cards.cols-1 { grid-template-columns: 1fr; }
.cards.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cards.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cards.cols-4 { grid-template-columns: repeat(4, 1fr); }

.cards.fill {
  flex: 1;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
}

.card.glass {
  background: var(--card);
  box-shadow: var(--card-shadow);
}

.card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: 20px 22px 22px;
  border-radius: 26px;
  transition: transform 0.25s cubic-bezier(0.3, 1.3, 0.5, 1);
}

.card:hover {
  transform: translateY(-2px);
}

.card.fill {
  min-height: 0;
  padding: 8px;
}

.card.fill:hover {
  transform: none;
}

.card.fill .table-wrap {
  flex: 1;
  min-height: 0;
  background: transparent;
  box-shadow: none;
}

.card.span-2 { grid-column: span 2; }
.card.span-all { grid-column: 1 / -1; }

.card-head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-base);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-head .icon {
  color: var(--text-2);
}

.card-head .aside {
  margin-left: auto;
}

/* ---------- Section pills ---------- */

/* Secondary pills: filters and switches inside a section. Smaller and quieter
   than the section pills, sitting in a recessed track. */
.pills {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: var(--r-pill);
  max-width: 100%;
  background: var(--recessed);
  box-shadow: inset 0 0 0 1px var(--line);
}

.pills button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-2);
  font-weight: 600;
  font-size: var(--fs-xs);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s;
}

.pills button:hover {
  color: var(--text);
}

.pills button[aria-selected="true"] {
  color: var(--good-text);
}

.pills button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* The bubble that slides under the active item: soft lime in secondary pills,
   solid lime in the dock */
.pill-bubble {
  position: absolute;
  z-index: 0;
  top: 3px;
  height: 30px;
  border-radius: var(--r-pill);
  background: var(--good-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good-text) 55%, transparent);
  transition: left 0.32s cubic-bezier(0.3, 1.3, 0.5, 1), width 0.32s cubic-bezier(0.3, 1.3, 0.5, 1);
}

.pills-host {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* Section pills: each one separate */
.tabs {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.tabs[hidden] {
  display: none;
}

.tabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 var(--sp-5);
  border: 0;
  border-radius: var(--r-pill);
  color: var(--text-2);
  font-weight: 650;
  font-size: var(--fs-sm);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s, transform 0.2s cubic-bezier(0.3, 1.4, 0.5, 1), background 0.2s;
}

.tabs button:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.tabs button[aria-selected="true"] {
  background: var(--select);
  color: var(--select-ink);
}

.tabs button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Dock: floating nav pill + separate + ---------- */

.dock {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.dock-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  height: var(--dock-h);
  padding: 6px;
  border-radius: var(--r-pill);
}

.dock-link {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 96px;
  height: calc(var(--dock-h) - 12px);
  padding: 0;
  border-radius: var(--r-pill);
  color: var(--text-2);
  text-decoration: none;
  font-size: 11px;
  font-weight: 650;
  transition: color 0.2s;
}

.dock-link:hover {
  color: var(--text);
}

.dock-link[aria-current="page"] {
  color: var(--select-ink);
}

.dock-link[aria-current="page"] .icon {
  stroke-width: 2.1;
}

.dock-nav .pill-bubble {
  top: 6px;
  height: calc(var(--dock-h) - 12px);
  background: var(--select);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.dock-add {
  width: var(--dock-h);
  height: var(--dock-h);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--good-ink);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.3, 1.4, 0.5, 1);
}

.dock-add:hover {
  transform: rotate(90deg);
}

.dock-add .icon {
  width: 26px;
  height: 26px;
  stroke-width: 2.4;
}

/* Holding the +: a ring draws itself around it, and logging opens as it closes.
   Let go early and it winds back. The length matches the hold in app.js (HOLD_MS). */
.dock-add .hold-ring {
  position: absolute;
  inset: -7px;
  width: calc(100% + 14px);
  height: calc(100% + 14px);
  transform: rotate(-90deg);
  pointer-events: none;
  overflow: visible;
}

.dock-add .hold-ring circle {
  fill: none;
  stroke: var(--good);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  opacity: 0;
  transition: stroke-dashoffset 0.2s ease-out, opacity 0.2s ease-out;
}

.dock-add.holding .hold-ring circle {
  stroke-dashoffset: 0;
  opacity: 1;
  transition: stroke-dashoffset 0.5s linear, opacity 0.08s;
}

/* Held: the + keeps still and sinks a little */
.dock-add.holding {
  transform: scale(0.94);
}

.dock-add.holding:hover {
  transform: rotate(90deg) scale(0.94);
}

/* ---------- Picker popover ---------- */

.popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 10px);
  right: 56px;
  width: 300px;
  padding: var(--sp-4);
  border-radius: var(--r);
  animation: pop 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-origin: top right;
}

.popover[hidden] {
  display: none;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-4px);
  }
}

.pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
  font-weight: 700;
}

.pop-head .round-btn {
  width: 34px;
  height: 34px;
  background: var(--raised);
}

.pop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.pop-grid button {
  position: relative;
  height: 44px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--raised);
  font-weight: 600;
  cursor: pointer;
}

.pop-grid button:hover {
  background: var(--raised-strong);
}

.pop-grid button[aria-selected="true"] {
  background: var(--select);
  color: var(--select-ink);
}

.pop-grid button.is-now::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: currentColor;
}

.pop-grid button:disabled {
  opacity: 0.35;
  cursor: default;
}

.pop-foot {
  margin-top: var(--sp-3);
  display: flex;
  justify-content: space-between;
}

/* Picker: a month of days, Sunday first; the picked day or days in lime glass */
.pop-title {
  padding: 6px 10px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.pop-title:hover {
  background: var(--raised);
}

.pop-grid.cal {
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.pop-grid.cal button {
  height: 34px;
  color: var(--text);
  font-size: 13px;
}

.pop-grid.cal .dow {
  display: grid;
  place-items: center;
  height: 22px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.pop-grid.cal .blank {
  visibility: hidden;
}

.pop-grid.cal button.mid[aria-selected="true"] {
  background: color-mix(in srgb, var(--select-glass) 55%, transparent);
  box-shadow: none;
}

.pop-hint {
  margin: var(--sp-3) 0 0;
  color: var(--text-3);
  font-size: 12px;
  text-align: center;
}

/* ---------- Building blocks inside sections ---------- */

.big {
  font-size: 44px;
  line-height: 1;
  font-weight: 750;
  letter-spacing: -0.03em;
  color: var(--text-3);
}

.sk {
  display: block;
  height: 10px;
  border-radius: var(--r-pill);
  background: var(--line-strong);
}

.sk.faint {
  background: var(--line);
}

.sk-lines {
  display: grid;
  gap: 10px;
}

.quiet {
  color: var(--text-3);
  font-size: var(--fs-sm);
}

/* Rows */
.group + .group {
  margin-top: var(--sp-5);
}

.group-label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  margin-bottom: var(--sp-2);
}

.row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 14px var(--sp-4);
  border-radius: 16px;
  background: var(--recessed);
  box-shadow: inset 0 0 0 1px var(--line);
}

.row + .row {
  margin-top: 6px;
}

.row .tick {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
}

.row .grow {
  flex: 1;
  display: grid;
  gap: 7px;
}

.row .amt {
  width: 72px;
}

.row-tag {
  white-space: nowrap;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-2);
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--raised);
}

/* Empty state */
.empty {
  height: 100%;
  min-height: 260px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--sp-3);
  text-align: center;
}

.empty-mark {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: var(--raised);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.empty h3 {
  font-size: var(--fs-md);
  font-weight: 700;
}

.empty p {
  color: var(--text-2);
  max-width: 34ch;
}

/* Tables */
.table-wrap {
  overflow: auto;
  border-radius: 18px;
  background: var(--recessed);
  box-shadow: inset 0 0 0 1px var(--line);
  max-height: 100%;
}

.grid-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: var(--fs-sm);
}

.grid-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: right;
  font-weight: 650;
  color: var(--text-2);
  white-space: nowrap;
  padding: 12px 14px;
  background: var(--glass-solid);
  border-bottom: 1px solid var(--line-strong);
}

.grid-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.grid-table tr:last-child td {
  border-bottom: 0;
}

.grid-table th:first-child,
.grid-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  min-width: 200px;
  background: var(--glass-solid);
}

.grid-table th:first-child {
  z-index: 3;
}

.grid-table td .sk {
  margin-left: auto;
  width: 46px;
}

.grid-table td:first-child .sk {
  margin-left: 0;
  width: 120px;
}

.grid-table tr.cat td {
  font-weight: 700;
}

.grid-table tr.cat td .sk {
  background: var(--text-3);
  opacity: 0.45;
}

/* Buttons */
.btn {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 42px;
  padding: 0 var(--sp-5);
  border: 0;
  border-radius: var(--r-pill);
  background: var(--raised);
  color: var(--text);
  font-weight: 700;
  font-size: var(--fs-xs);
  cursor: pointer;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--line);
}

.btn:hover {
  background: var(--raised-strong);
}

/* Primary actions: lime glass — fuller than a selection highlight, lighter than a solid fill */
.btn-primary,
.btn-primary:hover {
  background: var(--good-glass);
  color: var(--good-ink);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.btn-primary:disabled {
  opacity: 0.55;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ---------- Sheets ---------- */

dialog.sheet {
  border: 0;
  padding: 0;
  color: var(--text);
  max-height: calc(100vh - 32px);
  overflow: visible;
}

/* A pop-up stays where it opened while the page scrolls behind it: .glass sets position: relative, which beat the browser's own
   fixed rule for an open dialog, so every sheet but the log one scrolled away with the page */
dialog.sheet:modal {
  position: fixed;
}

dialog.sheet::backdrop {
  background: var(--scrim);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.sheet-inner {
  max-height: calc(100vh - 32px);
  overflow: auto;
  border-radius: inherit;
}

.sheet-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-5) var(--sp-3);
}

.sheet-head h2 {
  flex: 1;
  font-size: var(--fs-lg);
  font-weight: 750;
  letter-spacing: -0.02em;
}

.sheet-head .round-btn {
  width: 40px;
  height: 40px;
  background: var(--raised);
}

.sheet-body {
  padding: 0 var(--sp-5) var(--sp-5);
  display: grid;
  gap: var(--sp-4);
}

/* Settings is a page of its own: the whole screen, its groups as pills across the top */
#settings {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border-radius: 0;
}

#settings[open] {
  animation: fade-up 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

#settings .sheet-inner {
  height: 100dvh;
  max-height: 100dvh;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  border-radius: 0;
}

.set-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding-bottom: var(--sp-5);
}

#settings .sheet-head h2 {
  font-size: 26px;
}

.set-tabs {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 4px var(--sp-5) var(--sp-4);
  overflow-x: auto;
  scrollbar-width: none;
}

.set-tabs::-webkit-scrollbar {
  display: none;
}

.set-tabs button {
  flex: none;
}

/* A group: its sections side by side on a wide screen, one under another on a phone */
.set-pane {
  display: grid;
  gap: var(--sp-3);
  grid-column: 1 / -1;
}

.set-pane[hidden] {
  display: none;
}

@media (min-width: 700px) {
  .set-pane {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .set-pane .setting.wide {
    grid-column: 1 / -1;
  }
}

@keyframes slide-left {
  from {
    opacity: 0;
    transform: translateX(28px);
  }
}

/* Settings' own backdrop stays as it was: clear on a wide screen (the background shows as the user set it) */
@media (min-width: 700px) {
  #settings::backdrop {
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

.setting {
  display: grid;
  gap: var(--sp-2);
  padding: var(--sp-4);
  border-radius: 18px;
  background: var(--recessed);
  box-shadow: inset 0 0 0 1px var(--line);
}

.setting h3 {
  font-size: var(--fs-sm);
  font-weight: 700;
}

.setting p {
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.setting .row-btns {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.setting .pills {
  background: var(--recessed);
  position: relative;
  align-self: start;
  justify-self: start;
}

/* ---------- Capture ---------- */

#capture {
  width: 680px;
  max-width: calc(100vw - 32px);
  margin: 9vh auto auto;
  border-radius: var(--r-lg);
}

#capture[open] {
  animation: capture-in 0.3s cubic-bezier(0.2, 0.9, 0.25, 1.05);
}

@keyframes capture-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
}

.cap-month {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: var(--r-pill);
  background: var(--raised);
  font-size: var(--fs-sm);
}

.cap-month span {
  color: var(--text-2);
  padding-left: var(--sp-3);
  white-space: nowrap;
}

.cap-month strong {
  min-width: 92px;
  text-align: center;
  font-weight: 700;
}

.cap-month .round-btn {
  width: 32px;
  height: 32px;
}

.cap-well {
  position: relative;
  border-radius: 24px;
  background: var(--recessed);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 0.2s;
}

.cap-well:focus-within {
  box-shadow: inset 0 0 0 1.5px var(--good), 0 0 0 5px var(--good-soft);
}

.cap-input {
  display: block;
  width: 100%;
  min-height: 108px;
  max-height: 260px;
  padding: var(--sp-5) var(--sp-5) var(--sp-2);
  border: 0;
  background: transparent;
  resize: none;
  outline: none;
  font-size: var(--fs-lg);
  font-weight: 550;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.cap-input::placeholder {
  color: var(--text-3);
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: 0;
}

/* The sheet's head: Log, with what it counts toward under it, and a close button that keeps its size */
.cap-head-main {
  flex: 1;
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: var(--sp-2);
}

#capture .sheet-head {
  align-items: flex-start;
}

#capture .sheet-head > .round-btn {
  flex: none;
  width: 40px;
  height: 40px;
}

/* Log it, on the middle; what's about to be logged, small, above it, only when there's something */
#capture .cap-foot {
  flex-direction: column;
  justify-content: center;
  gap: var(--sp-2);
}

#capture .cap-foot .summary {
  flex: none;
  text-align: center;
  font-size: var(--fs-xs);
}

#capture .cap-foot .summary:empty {
  display: none;
}

.cap-well-foot {
  display: flex;
  padding: 0 var(--sp-4) var(--sp-3);
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.cap-well-foot .btn {
  height: 32px;
  padding: 0 var(--sp-3);
  font-size: var(--fs-xs);
}

.cap-well-foot .hint {
  margin-left: auto;
}

kbd {
  font: 600 11px var(--font);
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.cap-examples {
  display: grid;
  gap: var(--sp-2);
}

.cap-examples[hidden],
.entries[hidden] {
  display: none;
}

.cap-examples .label {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}

.example {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: 12px var(--sp-4);
  border: 0;
  border-radius: 16px;
  background: var(--raised);
  text-align: left;
  cursor: pointer;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s;
}

.example:hover {
  background: var(--raised-strong);
  color: var(--text);
}

.example .icon {
  color: var(--text);
}

.entries {
  display: grid;
  gap: var(--sp-2);
}

.entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-3) var(--sp-4);
  align-items: start;
  padding: var(--sp-4);
  border-radius: 20px;
  background: var(--raised);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 0 0 1px var(--line);
  animation: entry-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.entry.off {
  opacity: 0.45;
}

@keyframes entry-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.kind-badge {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--raised-strong);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

.kind-badge.income {
  background: var(--good);
  color: var(--good-ink);
}

.entry-main {
  min-width: 0;
  display: grid;
  gap: var(--sp-2);
}

.entry-what {
  font-size: var(--fs-md);
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-what .muted {
  color: var(--text-3);
  font-weight: 550;
}

.entry-amt {
  text-align: right;
  display: grid;
  gap: 2px;
  justify-items: end;
}

.entry-amt .num {
  font-size: var(--fs-lg);
}

.entry-amt small {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-2);
}

/* The entry's currency: reads like the label it was, opens as a picker */
.entry-cur {
  appearance: none;
  border: 0;
  border-radius: 6px;
  padding: 2px 16px 2px 6px;
  font: inherit;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-2);
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M1 1l3 3 3-3' fill='none' stroke='%23888' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 4px center;
  cursor: pointer;
}

.entry-cur:hover,
.entry-cur:focus-visible {
  background-color: var(--recessed);
  color: var(--text);
  outline: none;
}

.entry-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  color: var(--text-2);
  cursor: pointer;
}

.entry-toggle input {
  accent-color: var(--good);
  width: 16px;
  height: 16px;
}

.entry-raw {
  grid-column: 1 / -1;
  font-size: var(--fs-xs);
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: auto;
}

/* Something for the car: from the car fund, or not — asked until it's answered (lime rim while open) */
.fund-ask {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  border-radius: 12px;
  background: var(--recessed);
  font-size: var(--fs-sm);
  font-weight: 650;
}

.fund-ask.open {
  box-shadow: inset 0 0 0 1.5px var(--select-rim);
}

.fund-ask span {
  margin-right: auto;
  color: var(--text-2);
}

.fund-opt {
  height: 30px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--raised);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.fund-opt {
  white-space: nowrap;
}

/* A question with a sentence (too big? logged already?): the words on their own line, the answers under them */
.fund-ask:has([data-ask]) {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.fund-ask:has([data-ask]) > span {
  flex: 1 1 100%;
  margin-right: 0;
}

.fund-opt[aria-pressed="true"] {
  background: var(--good-glass);
  color: var(--good-ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

/* Paying something for the car on Home: the same question, on a small sheet */
#fund-sheet,
#track-sheet {
  width: min(400px, calc(100vw - 32px));
  border-radius: var(--r-lg);
}

#fund-sheet .fund-what,
#track-sheet .fund-what {
  margin: 0;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 600;
}

#fund-sheet .cap-foot,
#track-sheet .cap-foot {
  justify-content: flex-end;
  gap: 8px;
}

/* The tracking question (3 Dec 2026, the approved preview): its note sits under the sentence, left; a phone holds it at the
   bottom with full-width answers (09 §1) */
#track-sheet .set-note { margin: 0; text-align: left; }
@media (max-width: 699px) {
  #track-sheet:modal { margin: auto auto 16px; }
  #track-sheet .cap-foot .btn { flex: 1; }
}

/* A note of your own, under the entry: quiet until it has something in it */
.entry-memo {
  grid-column: 1 / -1;
  width: 100%;
  height: 34px;
  margin-top: -2px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  outline: none;
  background: var(--recessed);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 550;
}

.entry-memo::placeholder {
  color: var(--text-3);
}

.entry-memo:focus {
  box-shadow: inset 0 0 0 1.5px var(--select-rim);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--recessed);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.chip .icon {
  width: 14px;
  height: 14px;
  color: var(--text-2);
}

.chip:hover {
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.chip.guess {
  box-shadow: inset 0 0 0 1px var(--line-strong);
  background: transparent;
  color: var(--text-2);
}

.chip.flag {
  background: var(--bad-soft);
  color: var(--bad-text);
  box-shadow: none;
}

.chip.flag .icon {
  color: var(--bad-text);
}

.chip.note {
  background: var(--raised-strong);
}

.chip.act {
  background: var(--select);
  color: var(--select-ink);
  box-shadow: none;
}

.chip.act .icon,
.dock-link[aria-current="page"] .icon {
  color: var(--select-ink);
}

.chip.act .icon {
  color: var(--select-ink);
}

.cap-foot {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 var(--sp-5) var(--sp-5);
}

.cap-foot .summary {
  flex: 1;
  font-size: var(--fs-sm);
  color: var(--text-2);
}

/* Toast */
.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(var(--dock-h) + 40px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 12px var(--sp-5);
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: var(--fs-sm);
  animation: pop 0.2s ease-out;
}

.toast[hidden] {
  display: none;
}

/* The toast is a popover (3 Dec 2026) so it can show above an open window — Settings and every pop-up sit in the browser's top
   layer, above any z-index. The browser's own popover look (centred, a border, a white box) is cleared; the pill stays as it was */
.toast[popover] {
  top: auto;
  margin: 0;
  border: 0;
  overflow: visible;
  color: inherit;
  height: auto;
}

/* ---------- Style reference ---------- */

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--sp-3);
}

.swatch {
  border-radius: 18px;
  overflow: hidden;
  background: var(--recessed);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: var(--fs-xs);
}

.swatch b {
  display: block;
  height: 60px;
}

.swatch div {
  padding: var(--sp-2) var(--sp-3) var(--sp-3);
  display: grid;
}

.swatch code {
  color: var(--text-2);
  font-size: 11px;
}

.contrast {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.contrast th,
.contrast td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.contrast th {
  color: var(--text-2);
  font-weight: 650;
}

.contrast td.num {
  text-align: right;
}

.pass {
  color: var(--good-text);
}

.fail {
  color: var(--bad-text);
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: var(--sp-2);
}

.icon-cell {
  display: grid;
  justify-items: center;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-1) var(--sp-3);
  background: var(--recessed);
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: 16px;
  font-size: 11px;
  color: var(--text-2);
}

.icon-cell .icon {
  width: 28px;
  height: 28px;
  color: var(--text);
}

.meaning {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}

.bar {
  width: 220px;
  height: 12px;
  border-radius: var(--r-pill);
  background: var(--recessed);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

/* ---------- Phones: interim until mobile is redesigned ---------- */

@media (max-width: 699px) {
  .app {
    height: auto;
    min-height: 100vh;
    padding: var(--sp-4) var(--sp-4) 0;
  }

  .section {
    height: auto;
    overflow: visible;
  }

  .dock-link {
    width: 64px;
  }

  .cards.cols-2,
.cards.cols-3,
.cards.cols-4 {
    grid-template-columns: 1fr;
  }

  .card.span-2 {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .backdrop i,
.section,
.entry,
#capture[open],
#settings[open] {
    animation: none;
  }

  .pill-bubble {
    transition: none;
  }
}

/* ---------- Pills carry no drop shadow; the rim defines them ---------- */

.tabs button.glass,
.pills.glass,
.picker-btn.glass,
.round-btn.glass,
.dock-nav.glass,
.dock-add.glass {
  box-shadow: none;
}

.dock-add.glass {
  background: var(--good-glass);
}

/* ---------- Plan: a line's rules and sub-items open in a pane ---------- */

.cards.split {
  grid-template-columns: minmax(0, 1fr);
  transition: grid-template-columns 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cards.split.has-pane {
  grid-template-columns: minmax(0, 1fr) 400px;
}

.grid-table tr.line {
  cursor: pointer;
}

.grid-table tr.line:hover td {
  background: var(--recessed);
}

.grid-table tr.line:hover td:first-child {
  background: color-mix(in srgb, var(--glass-solid) 90%, var(--text) 10%);
}

.line-pane[hidden] {
  display: none;
}

.line-pane {
  min-height: 0;
  overflow: auto;
  animation: pane-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.line-pane:hover {
  transform: none;
}

@keyframes pane-in {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
}

.pane-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.pane-head .grow {
  flex: 1;
  display: grid;
  gap: 8px;
}

.pane-head .round-btn {
  width: 38px;
  height: 38px;
  background: var(--raised);
}

.pane-group {
  display: grid;
  gap: 2px;
}

.pane-group h3 {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  margin-bottom: var(--sp-2);
}

.field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 11px 14px;
  border-radius: 14px;
  background: var(--recessed);
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.field .sk {
  width: 70px;
}

.sub-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--recessed);
}

.sub-item .chips-row .sk {
  width: 52px;
  height: 22px;
}

/* ---------- Settings: backdrop colours ---------- */

.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bg-swatch {
  position: relative;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.bg-swatch[aria-pressed="true"] {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.bg-swatch.custom {
  display: grid;
  place-items: center;
  background: conic-gradient(#ff5c8a, #ffb13d, #c6f432, #3ee6b0, #3aa0ff, #a78bfa, #ff5c8a);
  color: #fff;
}

.bg-swatch.custom input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

@media (max-width: 699px) {
  .cards.split.has-pane {
    grid-template-columns: minmax(0, 1fr);
  }

  /* On phones the pane becomes a pop-up */
  .line-pane {
    position: fixed;
    z-index: 50;
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-height: 80vh;
  }
}

/* ---------- Buttons on the pill row ---------- */

.section-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.section-actions:empty {
  display: none;
}

.section-actions .btn {
  height: 48px;
  padding: 0 var(--sp-5);
}

.section-bar {
  justify-content: flex-start;
}

@media (max-width: 699px) {
  .desktop-only {
    display: none !important;
  }
}

/* ---------- Selection is lime glass, not a solid fill ---------- */

.tabs button.glass[aria-selected="true"],
.dock-nav .pill-bubble,
.pop-grid button[aria-selected="true"] {
  background: var(--select-glass);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--select-rim), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.tabs button.glass[aria-selected="true"] {
  font-weight: 750;
}

.dock-link[aria-current="page"],
.dock-link[aria-current="page"] .icon {
  color: var(--text);
}

/* ---------- Inputs in the line pane ---------- */

.ctl {
  width: 120px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: right;
  outline: none;
}

select.ctl {
  text-align: left;
  cursor: pointer;
}

.ctl:focus {
  box-shadow: inset 0 0 0 1.5px var(--select-rim), 0 0 0 4px var(--good-soft);
}

.ctl-check {
  width: 18px;
  height: 18px;
  accent-color: var(--good);
  cursor: pointer;
}

.field .ctl {
  width: 150px;
}

/* ---------- Buttons on the pill row ---------- */

.section-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.section-actions:empty {
  display: none;
}

.section-actions .btn {
  height: 48px;
  padding: 0 var(--sp-5);
}

.section-bar {
  justify-content: flex-start;
}

@media (max-width: 699px) {
  .desktop-only {
    display: none !important;
  }
}

/* ---------- Selection is lime glass, not a solid fill ---------- */

.tabs button.glass[aria-selected="true"],
.dock-nav .pill-bubble,
.pop-grid button[aria-selected="true"] {
  background: var(--select-glass);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--select-rim), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.tabs button.glass[aria-selected="true"] {
  font-weight: 750;
}

.dock-link[aria-current="page"],
.dock-link[aria-current="page"] .icon {
  color: var(--text);
}

/* ---------- Inputs in the line pane ---------- */

.ctl {
  width: 120px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: right;
  outline: none;
}

select.ctl {
  text-align: left;
  cursor: pointer;
}

.ctl:focus {
  box-shadow: inset 0 0 0 1.5px var(--select-rim), 0 0 0 4px var(--good-soft);
}

.ctl-check {
  width: 18px;
  height: 18px;
  accent-color: var(--good);
  cursor: pointer;
}

.field .ctl {
  width: 150px;
}

/* ---------- Several lines at once ---------- */

/* ---------- Editable cells ---------- */

.edit-grid td.cell {
  position: relative;
  padding: 3px 4px;
}

.cell-in {
  width: 100%;
  min-width: 70px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
  outline: none;
}

.cell-in:hover {
  background: var(--recessed);
}

.cell-in:focus {
  background: var(--raised);
  box-shadow: inset 0 0 0 1.5px var(--select-rim);
  cursor: text;
}

/* An edited, unsaved cell carries a lime corner mark */
.edit-grid td.cell.dirty::after,
.field.dirty::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 2px var(--glass-solid);
}

.field {
  position: relative;
}

.edit-grid td.calc {
  text-align: right;
  color: var(--text-2);
  font-weight: 650;
}

.edit-grid tr.cat td.calc {
  color: var(--text);
}

.expenses-grid td.line-name {
  cursor: pointer;
}

.expenses-grid tr.line:hover td {
  background: transparent;
}

.expenses-grid td.line-name:hover {
  background: color-mix(in srgb, var(--glass-solid) 88%, var(--text) 12%);
}

.edit-grid td.cell:has(.ctl-check) {
  text-align: center;
}

/* ---------- Rule columns, expanded with the gear ---------- */

.edit-grid:not(.show-rules) .rule-col {
  display: none;
}

.edit-grid .rule-col {
  text-align: left;
  background: color-mix(in srgb, var(--glass-solid) 70%, transparent);
}

.edit-grid th.rule-col {
  background: var(--glass-solid);
}

.edit-grid .rule-col .ctl {
  width: 128px;
}

.edit-grid td.rule-col:has(.ctl-check) {
  text-align: center;
}

.th-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.gear-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: var(--raised);
  color: var(--text-2);
  cursor: pointer;
  transition: transform 0.25s, background 0.2s, color 0.2s;
}

.gear-btn:hover {
  color: var(--text);
}

.gear-btn[aria-pressed="true"] {
  background: var(--select-glass);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--select-rim);
}

/* ---------- Right side of the pill row: a section's secondary pills, then its buttons ---------- */

.row-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.section-controls[hidden] {
  display: none;
}

/* ---------- Dock: icon over label ---------- */

.dock-link {
  font-size: 11px;
  gap: 3px;
}

/* ---------- Renaming ---------- */

[data-rename].renaming {
  outline: none;
  cursor: text;
  border-radius: 6px;
  box-shadow: 0 0 0 2px var(--select-rim);
  padding: 0 4px;
  margin: 0 -4px;
}

.tabs button .renaming,
.tabs button.renaming {
  box-shadow: inset 0 0 0 2px var(--select-rim);
  margin: 0;
  padding: 0 var(--sp-5);
}

/* ---------- Keep the pill row inside the window ---------- */

.pills-host {
  flex-wrap: wrap;
  row-gap: var(--sp-3);
}

.tabs button {
  padding: 0 16px;
}

.pills button {
  padding: 0 9px;
}

/* ---------- Headings inside a section ---------- */

/* Section headers (At a Glance, Coming Up, Breakdown …): small lime capitals, no rules */
.block-title {
  /* 34px above and 18px below (the sections' own gap is 16: 18 + 16 above, 2 + 16 below) */
  margin: 18px 4px 2px;
  color: var(--good-text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Home and Log's overview lay their blocks out 10px apart, not 16 */
.ov-mount > .block-title,
.ov-mount > .ov-head-row {
  margin-top: 24px;
  margin-bottom: 8px;
}

/* the first one: 34px below the section pills (the top bar and the section's own padding make up the other 22) */
.block-title:first-child,
.ov-mount > .block-title:first-child,
.ov-head-row:first-child,
.ov-mount > .ov-head-row:first-child {
  margin-top: 12px;
}

/* ---------- Day boxes and the rotating wheel ---------- */

.ctl.ctl-day,
.edit-grid .rule-col .ctl.ctl-day {
  width: 56px;
  min-width: 0;
  text-align: center;
  cursor: pointer;
  caret-color: transparent;
}

.wheel {
  position: fixed;
  z-index: 70;
  width: 120px;
  padding: 8px;
  border-radius: 22px;
  animation: pop 0.16s ease-out;
}

.wheel[hidden] {
  display: none;
}

.wheel-list {
  position: relative;
  z-index: 1;
  height: calc(38px * 5);
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  /* two empty rows above and below so the first and last days can sit in the centre */
  padding: calc(38px * 2) 0;
  -webkit-mask: linear-gradient(transparent, #000 30%, #000 70%, transparent);
  mask: linear-gradient(transparent, #000 30%, #000 70%, transparent);
}

.wheel-list::-webkit-scrollbar {
  display: none;
}

.wheel-list button {
  display: block;
  width: 100%;
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: 600 var(--fs-md) var(--font);
  font-variant-numeric: tabular-nums;
  scroll-snap-align: center;
  cursor: pointer;
  transition: color 0.12s, transform 0.12s;
}

.wheel-list button.on {
  color: var(--text);
  font-weight: 750;
  transform: scale(1.12);
}

/* the band marking the centre row */
.wheel-band {
  position: absolute;
  left: 8px;
  right: 8px;
  top: calc(8px + 38px * 2);
  height: 38px;
  border-radius: 12px;
  background: var(--select-glass);
  box-shadow: inset 0 0 0 1px var(--select-rim);
  pointer-events: none;
}

.wheel-foot {
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.wheel-foot .btn {
  height: 30px;
  padding: 0 12px;
}

/* ---------- What's left over, when it's short ---------- */

.edit-grid td.calc.short {
  color: var(--bad-text);
}

/* ---------- Plan › Expenses (real grid) ---------- */

.expenses-grid .cat-name,
.expenses-grid .name {
  position: relative;
  cursor: pointer;
  border-radius: 6px;
}

.expenses-grid .name {
  font-weight: 600;
}

.expenses-grid .name:hover {
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

.expenses-grid td.line-name.dirty::after,
.expenses-grid .cat-name.dirty::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 6px;
  vertical-align: middle;
  border-radius: 50%;
  background: var(--good);
}

.expenses-grid td.line-name.dirty::after {
  position: static;
}

.expenses-grid td.line-name {
  position: sticky;
}

.expenses-grid .span-col {
  color: var(--text-2);
}

.expenses-grid tr.add-row td {
  padding: 4px 14px 10px;
  border-bottom: 1px solid var(--line);
}

.add-line,
.link-btn {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: 700 var(--fs-xs) var(--font);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 6px 0;
}

.add-line:hover,
.link-btn:hover {
  color: var(--text);
}

.ctl.ctl-num {
  width: 64px;
  text-align: center;
}

.cell-in:invalid {
  color: var(--bad-text);
}

/* The question after changing an amount */
.carry {
  position: fixed;
  z-index: 65;
  max-width: 520px;
  padding: var(--sp-4);
  border-radius: 20px;
  display: grid;
  gap: var(--sp-3);
  animation: pop 0.16s ease-out;
}

.carry[hidden] {
  display: none;
}

.carry p {
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.carry p strong {
  color: var(--text);
}

.carry-btns {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.carry-btns .btn {
  height: 36px;
  padding: 0 14px;
}

/* Until… (30 Nov 2026): the carry's own button, with the month calendar's field laid over it (the calendar opens from a field) */
.carry-until { position: relative; display: grid; }
.carry-until .btn { width: 100%; pointer-events: none; }
.carry-until-in { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }

/* A line's pane */
.pane-title {
  font-size: var(--fs-md);
  font-weight: 750;
}

.pane-head .grow {
  display: grid;
  gap: 2px;
}

.sub-edit {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 10px;
  border-radius: 14px;
  background: var(--recessed);
}

.sub-edit .ctl {
  width: 100%;
  text-align: left;
}

.sub-edit .link-btn {
  justify-self: start;
  padding: 2px 0;
}

.pane-foot {
  margin-top: auto;
  padding-top: var(--sp-2);
}

.btn.danger {
  color: var(--bad-text);
}

/* The real grid's mount passes the card's height down so the table scrolls inside it */
.plan-mount {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.card.fill {
  overflow: hidden;
}

/* ---------- Categories stand apart from their lines ---------- */

.edit-grid tr.cat:not(.total) td {
  background: color-mix(in srgb, var(--glass-solid) 91%, var(--text) 9%);
  padding-top: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-strong);
  font-weight: 750;
}

.edit-grid tr.cat:not(.total) td:first-child {
  background: color-mix(in srgb, var(--glass-solid) 91%, var(--text) 9%);
}

.edit-grid .cat-name,
.edit-grid tr.total td:first-child {
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.edit-grid tr.cat:not(.total) td.calc {
  color: var(--text);
}

.edit-grid tr.total td {
  border-top: 2px solid var(--line-strong);
  font-weight: 800;
  color: var(--text);
}

/* ---------- Moving lines and categories ---------- */

.name-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.row-move {
  display: inline-flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
}

tr:hover .row-move,
.name-cell:focus-within .row-move,
.row-move.on {
  opacity: 1;
}

.row-move button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 7px;
  background: var(--raised);
  color: var(--text-2);
  font: 700 12px var(--font);
  cursor: pointer;
}

.row-move button:hover {
  color: var(--text);
  background: var(--raised-strong);
}

.row-move button:disabled {
  opacity: 0.3;
  cursor: default;
}

/* ---------- EGP beside every amount ---------- */

.cur {
  margin-left: 4px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: var(--text-3);
}

td.cell.money .cell-in {
  min-width: 104px;
  padding-right: 38px;
}

td.cell.money .cur {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  pointer-events: none;
}

td.cell.money:has(.cell-in:placeholder-shown) .cur {
  display: none;
}

/* ---------- Month names: full on desktop, short on phones ---------- */

.m-short {
  display: none;
}

@media (max-width: 699px) {
  .m-long {
    display: none;
  }

  .m-short {
    display: inline;
  }
}

/* ---------- Editing a dropdown's list ---------- */

.list-editor {
  position: fixed;
  z-index: 66;
  width: 340px;
  padding: var(--sp-4);
  border-radius: 20px;
  display: grid;
  gap: var(--sp-3);
  animation: pop 0.16s ease-out;
}

.list-editor[hidden] {
  display: none;
}

.list-editor header {
  display: grid;
  gap: 2px;
}

.le-rows {
  display: grid;
  gap: 6px;
  max-height: 300px;
  overflow: auto;
}

.le-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.le-row .ctl {
  flex: 1;
  width: auto;
  text-align: left;
}

.le-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.le-foot .btn {
  height: 34px;
}

/* ---------- Month calendar ---------- */

.month-pick {
  position: fixed;
  top: 0;
  right: auto;
  z-index: 70;
  transform-origin: top left;
}

.ctl.ctl-month,
.edit-grid .rule-col .ctl.ctl-month {
  width: 104px;
  text-align: center;
  cursor: pointer;
  caret-color: transparent;
}

/* ---------- The Year column: wider, its own band, pinned on the right ---------- */

.edit-grid th:last-child,
.edit-grid tr:not(.add-row) > td:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
  min-width: 150px;
  padding-left: 18px;
  padding-right: 18px;
  text-align: right;
  background: color-mix(in srgb, var(--glass-solid) 88%, var(--text) 12%);
  box-shadow: inset 1px 0 0 var(--line-strong);
  color: var(--text);
  font-weight: 750;
}

.edit-grid th:last-child {
  z-index: 3;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--fs-xs);
  font-weight: 800;
}

.edit-grid tr.cat:not(.total) > td:last-child {
  background: color-mix(in srgb, var(--glass-solid) 82%, var(--text) 18%);
}

.edit-grid tr.total > td:last-child {
  background: color-mix(in srgb, var(--glass-solid) 78%, var(--text) 22%);
  font-size: var(--fs-base);
}

.row-move .row-remove {
  width: auto;
  padding: 0 8px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bad-text);
}

.income-grid tr.summary td {
  font-weight: 700;
}

.income-grid tr.summary td .quiet {
  margin-left: 6px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

/* Short is short everywhere — in a month, in a summary row, in the Year column */
.edit-grid tr > td.calc.short,
.edit-grid tr.cat:not(.total) > td.calc.short,
.edit-grid tr:not(.add-row) > td.calc.short:last-child {
  color: var(--bad-text);
}

/* ---------- Paid in another currency ---------- */

td.fx .cell-in,
td.calc.fx {
  text-decoration: underline dotted var(--text-3);
  text-underline-offset: 4px;
}

.fx-tip {
  position: fixed;
  z-index: 80;
  padding: 7px 12px;
  border-radius: 12px;
  font-size: var(--fs-xs);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
}

.fx-tip[hidden] {
  display: none;
}

@media (hover: none) {
  .fx-tip {
    display: none;
  }
}

.rates {
  display: grid;
  gap: 6px;
}

.rates .field {
  background: var(--raised);
}

/* Opening a sheet focuses it; the sheet itself needs no focus ring */
dialog.sheet:focus-visible {
  outline: none;
}

/* ---------- Planned stays in view; red when a month outruns its income ---------- */

/* Remaining sits pinned under Planned: Planned rides one row-height above it */
.expenses-grid {
  --remaining-h: 44px;
}

.expenses-grid tr.total:not(.remaining) td {
  bottom: var(--remaining-h);
}

.expenses-grid tr.remaining td {
  height: var(--remaining-h);
  box-sizing: border-box;
  padding-top: 0;
  padding-bottom: 0;
}

.expenses-grid tr.total td {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: var(--glass-solid);
  box-shadow: inset 0 2px 0 var(--line-strong);
  border-top: 0;
}

.expenses-grid tr.total td:first-child,
.expenses-grid tr.total > td:last-child {
  z-index: 3;
}

.expenses-grid tr.total > td:last-child {
  box-shadow: inset 0 2px 0 var(--line-strong), inset 1px 0 0 var(--line-strong);
}

.expenses-grid td.cell.over .cell-in,
.expenses-grid td.cell.over .cur,
.expenses-grid tr.total td.calc.over {
  color: var(--bad-text);
}

/* ---------- Days: which weekdays a weekly line falls on ---------- */

.weekdays {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 10px;
  background: var(--recessed);
  box-shadow: inset 0 0 0 1px var(--line);
}

.weekdays button {
  width: 26px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-3);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.weekdays button:hover {
  color: var(--text);
}

.weekdays button[aria-pressed="true"] {
  background: var(--good);
  color: var(--good-ink);
}

/* A line worked out from its price and occurrence: italic; a month typed over it is upright,
   underlined, and gets a ↺ back to the worked-out figure */
.expenses-grid td.priced .cell-in {
  font-style: italic;
}

.expenses-grid td.overridden .cell-in {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

.cell-reset {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 6px;
  background: var(--raised);
  color: var(--text-2);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
}

td:hover > .cell-reset,
.cell-reset:focus-visible {
  opacity: 1;
}

.cell-reset:hover {
  color: var(--text);
}

/* Starts: the date an occurrence counts from */
.edit-grid .rule-col .ctl-date {
  width: 150px;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

/* ---------- Credit cards: charged lines count on the card's bill ---------- */

/* A card's own row shows its whole bill, in the same white as every other line */
.expenses-grid tr.card-bill td.calc {
  color: var(--text);
  font-weight: 600;
}

.expenses-grid tr.card-bill td.calc.over {
  color: var(--bad-text);
}

/* The rows a card's bill is made of, under the card's own line */
.expenses-grid tr.card-part td {
  padding-top: 8px;
  padding-bottom: 8px;
  font-size: var(--fs-xs);
  color: var(--text-2);
}

.expenses-grid tr.card-part td.calc {
  color: var(--text-2);
  font-weight: 600;
}

.card-part-name {
  padding-left: 32px; /* past the fold arrow's space, under the card's name */
  font-weight: 600;
}

.sub-edit.auto {
  display: grid;
  gap: 2px;
}

/* Interest %: a few digits, a narrow box */
.edit-grid .rule-col .ctl.ctl-rate {
  width: 64px;
}

/* Fold a card's bill rows away */
.name-fold {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.fold-space {
  flex: none;
  width: 22px;
  margin-left: -4px;
}

.fold-btn {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  margin-left: -4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}

.fold-btn:hover,
.fold-btn:focus-visible {
  background: var(--recessed);
  color: var(--text);
  outline: none;
}

/* The plan's icon tools on the pill row: nothing to undo or redo reads as faded */
.section-actions .round-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* A phone's Plan shows one month: just that month beside each line, no Year column */
.edit-grid.one-month th:last-child,
.edit-grid.one-month tr > td:last-child:not([colspan]) {
  display: none;
}

/* …and the names wrap, so that month fits beside them on a phone */
.edit-grid.one-month th:first-child,
.edit-grid.one-month td:first-child {
  min-width: 0;
  white-space: normal;
}

.edit-grid.one-month .name-cell,
.edit-grid.one-month .name-fold {
  min-width: 0;
}

.edit-grid.one-month td.cell.money .cell-in {
  min-width: 96px;
}

/* The ↑/↓ move buttons take no room there until you tap into that row */
.edit-grid.one-month .row-move {
  display: none;
}

.edit-grid.one-month tr:focus-within .row-move {
  display: flex;
}

/* ---------- Phones: tighter padding, a smaller bar, and a clean one-month table ---------- */

@media (max-width: 699px) {
  /* Narrower edges and gaps */
  .app {
    padding: 10px 10px 0;
    gap: 10px;
  }

  /* A section reaches into the edge by exactly as much as the edge, so nothing spills sideways */
  .section {
    margin: -10px;
    padding: 10px 10px 24px;
  }

  .topbar {
    gap: 10px;
    min-height: 40px;
  }

  .app-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .page-title {
    font-size: var(--fs-lg);
  }

  /* Picker and Settings, and the plan's icon tools with them, drop to 36px */
  .round-btn {
    width: 36px;
    height: 36px;
  }

  .round-btn .icon {
    width: 18px;
    height: 18px;
  }

  .picker-btn {
    height: 36px;
    padding: 0 12px;
    gap: 4px;
    font-size: var(--fs-sm);
  }

  .top-actions {
    gap: 6px;
  }

  /* Income / Expenses and the icon tools share one row */
  .pills-host {
    flex-wrap: nowrap;
  }

  .tabs {
    gap: 4px;
  }

  .tabs button {
    height: 36px;
    padding: 0 12px;
    font-size: var(--fs-xs);
  }

  .row-right,
.section-actions {
    gap: 6px;
  }

  .section-actions .btn {
    height: 36px;
    padding: 0 12px;
    font-size: var(--fs-xs);
  }

  .card.fill {
    padding: 0;
  }

  /* The one-month table: one solid surface, tighter cells, no repeated EGP */
  .edit-grid.one-month tr.line > td,
.edit-grid.one-month tr.card-part > td,
.edit-grid.one-month tr.add-row > td {
    background: var(--glass-solid);
  }

  .edit-grid.one-month th,
.edit-grid.one-month td {
    padding: 10px 10px;
  }

  .edit-grid.one-month td.cell {
    padding: 2px 4px;
  }

  .edit-grid.one-month td.cell.money .cell-in {
    min-width: 0;
    width: 100%;
    padding-right: 8px;
  }

  .edit-grid.one-month .cur {
    display: none;
  }

  .edit-grid.one-month tr.cat:not(.total) td {
    padding-top: 12px;
    padding-bottom: 10px;
  }

  .edit-grid.one-month th:first-child,
.edit-grid.one-month td:first-child {
    width: 62%;
  }
}

/* ---------- Phones, the Plan as lists: category pills, a card per category, roomy rows ---------- */

/* Categories as pills on one row that swipes; the picked one is lime glass */
.cat-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 0 -10px 4px;
  padding: 2px 10px 6px;
  scrollbar-width: none;
}

.cat-pills::-webkit-scrollbar {
  display: none;
}

.cat-pills button,
.cat-bar .cat-pill-add {
  flex: none;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: var(--fs-xs);
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

.cat-pills button[aria-selected="true"] {
  background: var(--select-glass);
  border-color: var(--select-rim);
  color: var(--text);
}

/* What's inside shows on the pill: lime when every bill in it was paid on time, red when one is
   overdue — selected or not (the selected one keeps its fill) */
/* (18 Oct) the lime outline for "all paid on time" is gone; a late category is a red outline, filled red when it is also the open one (below) */
.cat-pills button.cat-late {
  background: transparent;
  border-color: var(--bad);
  box-shadow: none;
}

.cat-bar .cat-pill-add {
  width: 34px;
  padding: 0;
  display: grid;
  place-items: center;
}

@media (max-width: 699px) {
  /* The panel around the table steps back: the categories are the cards */
  .section[data-section="amounts"] .card.fill,
.section[data-section="income"] .card.fill {
    background: none;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    overflow: visible;
  }

  .section[data-section="amounts"] .card.fill::before,
.section[data-section="amounts"] .card.fill::after,
.section[data-section="income"] .card.fill::before,
.section[data-section="income"] .card.fill::after {
    display: none;
  }

  .edit-grid.one-month {
    font-size: var(--fs-base);
  }

  .card.fill .table-wrap:has(.one-month) {
    border-radius: 0;
    overflow: visible;
    max-height: none;
  }

  /* No column headings: the month is in the picker at the top */
  .edit-grid.one-month thead {
    display: none;
  }

  .edit-grid.one-month td,
.edit-grid.one-month td.cell {
    border: 0;
  }

  /* A category is a small uppercase label and its total, sitting outside its card */
  .edit-grid.one-month tr.cat:not(.total) > td,
.edit-grid.one-month tr.cat:not(.total) > td:first-child,
.edit-grid.one-month tr.cat:not(.total) > td:last-child {
    background: transparent;
    border: 0;
    padding: 26px 6px 10px;
    color: var(--text-2);
    font-size: var(--fs-xs);
  }

  .edit-grid.one-month tr.cat:not(.total) td.calc {
    color: var(--text-2);
    font-weight: 650;
  }

  .edit-grid.one-month tr.cat .cur {
    display: none;
  }

  /* Its lines: a rounded card with tall rows and inset dividers */
  .edit-grid.one-month tr.line > td,
.edit-grid.one-month tr.card-part > td,
.edit-grid.one-month tr.add-row > td {
    background: var(--glass-solid);
    box-shadow: inset 0 -1px 0 var(--line);
  }

  .edit-grid.one-month tr.line > td {
    height: 58px;
    padding: 0 8px 0 14px;
  }

  .edit-grid.one-month tr.line > td.cell {
    padding: 0 8px 0 0;
  }

  .edit-grid.one-month tr.line .name {
    font-weight: 600;
  }

  .edit-grid.one-month tr.first > td:first-child {
    border-top-left-radius: 20px;
  }

  .edit-grid.one-month tr.first > td:last-child {
    border-top-right-radius: 20px;
  }

  .edit-grid.one-month tr.add-row > td {
    padding: 12px 14px;
    border-radius: 0 0 20px 20px;
    box-shadow: none;
    text-align: left;
  }

  .edit-grid.one-month tr.card-part > td {
    height: 44px;
    padding: 0 14px;
  }

  .edit-grid.one-month td.cell.money .cell-in {
    font-size: var(--fs-base);
    font-weight: 650;
    height: 40px;
  }

  /* Planned and Remaining: one card pinned just above the dock (68px tall, 12px up, a gap) */
  .expenses-grid.one-month tr.total > td,
.expenses-grid.one-month tr.total > td:nth-child(n) {
    position: sticky;
    background: var(--glass-solid);
    box-shadow: none;
    padding: 0 16px;
    height: 52px;
    color: var(--text);
    font-size: var(--fs-base);
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
  }

  .expenses-grid.one-month tr.total:not(.remaining) > td:nth-child(n) {
    bottom: calc(96px + var(--remaining-h));
    border-top: 14px solid transparent; /* a gap between the list and the card */
    background-clip: padding-box;
  }

  .expenses-grid.one-month tr.remaining > td:nth-child(n) {
    bottom: 96px;
    box-shadow: inset 0 1px 0 var(--line);
  }

  .expenses-grid.one-month tr.total td.calc {
    font-weight: 700;
  }

  .expenses-grid.one-month tr.total:not(.remaining) > td:first-child {
    border-top-left-radius: 20px 34px;
  }

  .expenses-grid.one-month tr.total:not(.remaining) > td:nth-last-child(2) {
    border-top-right-radius: 20px 34px;
  }

  .expenses-grid.one-month tr.remaining > td:first-child {
    border-bottom-left-radius: 20px;
  }

  .expenses-grid.one-month tr.remaining > td:nth-last-child(2) {
    border-bottom-right-radius: 20px;
  }

  .expenses-grid.one-month {
    --remaining-h: 52px;
  }

  /* The category's own row is its label above the card — no fold arrow, no gap above */
  .edit-grid.one-month tr.cat:not(.total) .fold-btn,
.edit-grid.one-month tr.cat:not(.total) .fold-space {
    display: none;
  }

  .expenses-grid.one-month tr.cat:not(.total) > td:nth-child(n) {
    padding-top: 6px;
  }

  /* Income: its sources form one card, the totals another */
  .income-grid.one-month tr.line:first-of-type > td:first-child {
    border-top-left-radius: 20px;
  }
}

@media (max-width: 699px) {
  /* The row paints under its cells too, so no hairline of backdrop shows between them */
  .edit-grid.one-month tr.line,
.edit-grid.one-month tr.card-part,
.edit-grid.one-month tr.total {
    background: var(--glass-solid);
  }
}

@media (max-width: 699px) {
  /* Whole-pixel columns: the amount is a fixed 132px, the name takes the rest */
  .edit-grid.one-month th:first-child,
.edit-grid.one-month td:first-child {
    width: auto;
  }

  .edit-grid.one-month tr > td:nth-child(n + 2):not([colspan]) {
    width: 132px;
  }
}

@media (max-width: 699px) {
  /* Corners go on the month cell — the Year cell after it is hidden on phones */
  .edit-grid.one-month tr.first > td:nth-last-child(2) {
    border-top-right-radius: 20px;
  }
}

@media (max-width: 699px) {
  /* Nothing scrolls sideways on a phone, so the name column needn't be pinned (pinning left a seam) */
  .edit-grid.one-month th:first-child,
.edit-grid.one-month td:first-child,
.edit-grid.one-month td.line-name {
    position: static;
  }

  /* Income: Total income, Left over and Balance form one summary card under the sources */
  .income-grid.one-month tr.cat.total > td,
.income-grid.one-month tr.cat.summary > td {
    height: 56px;
    padding: 0 16px;
    background: var(--glass-solid);
    background-clip: padding-box;
    box-shadow: inset 0 -1px 0 var(--line);
    color: var(--text);
    font-size: var(--fs-base);
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
  }

  .income-grid.one-month tr.cat.total > td {
    border-top: 16px solid transparent; /* the gap between the two cards */
  }

  /* 20px corners on the painted area: the radius reaches through the 16px gap above it */
  .income-grid.one-month tr.cat.total > td:first-child {
    border-top-left-radius: 20px 36px;
  }

  .income-grid.one-month tr.cat.total > td:nth-last-child(2) {
    border-top-right-radius: 20px 36px;
  }

  .income-grid.one-month tr.cat.summary:last-child > td {
    box-shadow: none;
  }

  .income-grid.one-month tr.cat.summary:last-child > td:first-child {
    border-bottom-left-radius: 20px;
  }

  .income-grid.one-month tr.cat.summary:last-child > td:nth-last-child(2) {
    border-bottom-right-radius: 20px;
  }

  .income-grid.one-month tr.cat.summary .quiet {
    display: block;
    font-size: var(--fs-xs);
    font-weight: 500;
  }

  .income-grid.one-month td.calc {
    font-weight: 700;
  }
}

@media (max-width: 699px) {
  /* Left over and Balance are summary rows, not category labels: outrank the label style */
  .income-grid.one-month tr.cat.summary > td:nth-child(n) {
    height: 56px;
    padding: 0 16px;
    background: var(--glass-solid);
    color: var(--text);
    font-size: var(--fs-base);
    font-weight: 600;
  }

  .income-grid.one-month tr.cat.summary > td.calc:nth-child(n) {
    font-weight: 700;
  }
}

/* ---------- Phones: each line is its own tile, with its details under its name ---------- */

.line-meta {
  display: none;
}

@media (max-width: 699px) {
  .name-stack {
    display: grid;
    gap: 2px;
    min-width: 0;
  }

  .edit-grid.one-month .line-meta {
    display: block;
    color: var(--text-3);
    font-size: var(--fs-xs);
    font-weight: 500;
    line-height: 1.3;
  }

  /* Gaps between rows turn the list into separate tiles */
  .expenses-grid.one-month {
    border-spacing: 0 8px;
    margin-top: -4px;
  }

  .expenses-grid.one-month tr.line > td,
.expenses-grid.one-month tr.card-part > td {
    box-shadow: none;
  }

  .expenses-grid.one-month tr.line > td {
    height: 64px;
  }

  .expenses-grid.one-month tr.line > td:first-child,
.expenses-grid.one-month tr.card-part > td:first-child {
    border-radius: 16px 0 0 16px;
  }

  .expenses-grid.one-month tr.line > td:nth-last-child(2),
.expenses-grid.one-month tr.card-part > td:nth-last-child(2) {
    border-radius: 0 16px 16px 0;
  }

  /* A card's parts are smaller tiles, tucked in under it */
  .expenses-grid.one-month tr.card-part > td {
    height: 46px;
    background: color-mix(in srgb, var(--glass-solid) 70%, transparent);
  }

  .expenses-grid.one-month tr.card-part > td:first-child {
    border-left: 16px solid transparent;
    background-clip: padding-box;
  }

  /* "+ Add line" is a quiet dashed tile, not part of a block */
  .expenses-grid.one-month tr.add-row > td {
    background: transparent;
    border: 1px dashed var(--line-strong);
    border-radius: 16px;
    padding: 12px 14px;
  }

  /* Planned and Remaining: two tiles pinned above the dock, 8px apart like the rest */
  .expenses-grid.one-month tr.total:not(.remaining) > td:nth-child(n) {
    border-top: 0;
    bottom: calc(96px + var(--remaining-h) + 8px);
  }

  .expenses-grid.one-month tr.remaining > td:nth-child(n) {
    box-shadow: none;
  }

  .expenses-grid.one-month tr.total > td:first-child {
    border-radius: 16px 0 0 16px;
  }

  .expenses-grid.one-month tr.total > td:nth-last-child(2) {
    border-radius: 0 16px 16px 0;
  }
}

@media (max-width: 699px) {
  /* Planned and Remaining read as one pinned card: Planned paints down over the 8px gap */
  .expenses-grid.one-month tr.total:not(.remaining) > td:nth-child(n) {
    box-shadow: 0 8px 0 var(--glass-solid);
  }

  .expenses-grid.one-month tr.remaining > td:nth-child(n) {
    box-shadow: inset 0 1px 0 var(--line);
  }

  .expenses-grid.one-month tr.total:not(.remaining) > td:first-child {
    border-radius: 18px 0 0 0;
  }

  .expenses-grid.one-month tr.total:not(.remaining) > td:nth-last-child(2) {
    border-radius: 0 18px 0 0;
  }

  .expenses-grid.one-month tr.remaining > td:first-child {
    border-radius: 0 0 0 18px;
  }

  .expenses-grid.one-month tr.remaining > td:nth-last-child(2) {
    border-radius: 0 0 18px 0;
  }
}

/* ---------- Phones: tighter tiles, one-line details, and a pinned bar of three ---------- */

.phone-totals {
  display: none;
}

/* One row, three columns: this category, Planned, Remaining — lime glass, above the dock */
.phone-totals {
  position: sticky;
  bottom: 96px;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
  padding: 12px 6px;
  border-radius: 22px;
  background: var(--select-glass);
  box-shadow: inset 0 0 0 1px var(--select-rim), 0 10px 30px rgba(0, 0, 0, 0.35);
}

.pt-cell {
  display: grid;
  gap: 3px;
  justify-items: center;
  min-width: 0;
  padding: 0 6px;
  text-align: center;
}

.pt-cell + .pt-cell {
  box-shadow: inset 1px 0 0 var(--line-strong);
}

.pt-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 650;
}

.pt-value {
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 750;
  white-space: nowrap;
}

.pt-value .cur {
  display: none;
}

.pt-cell.over .pt-value {
  color: var(--bad-text);
}

@media (max-width: 699px) {
  /* The name starts right at the tile's edge — no room kept for a fold arrow */
  .expenses-grid.one-month tr.line .fold-space {
    display: none;
  }

  .expenses-grid.one-month tr.line > td:first-child {
    padding-left: 14px;
  }

  /* Details stay on one line, trimmed with … when long */
  .edit-grid.one-month .name-cell,
.edit-grid.one-month .name-fold,
.edit-grid.one-month .name-stack {
    min-width: 0;
    max-width: 100%;
  }

  .edit-grid.one-month td.line-name {
    max-width: 0; /* lets the cell shrink to its column, so the details can be trimmed */
    overflow: hidden;
  }

  .edit-grid.one-month .line-meta {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* The pill already names the category: no label row above its tiles */
  .expenses-grid.one-month tr.cat:not(.total) {
    display: none;
  }

  /* The table's own Planned and Remaining give way to the pinned bar */
  .expenses-grid.one-month tr.total {
    display: none;
  }
}

/* Solid, lime-tinted: nothing shows through the pinned bar */
.phone-totals {
  background: color-mix(in srgb, var(--glass-solid) 74%, var(--good) 26%);
}

/* ---------- Phones: a tile is one button; tapping it opens the line's sheet ---------- */

.sheet-amount-in {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.sheet-amount-in .cell-in {
  width: 100%;
  min-width: 0;
  height: auto;
  padding: 0;
  text-align: left;
  font-size: var(--fs-lg);
  font-weight: 750;
  background: transparent;
}

.sheet-amount-in .cell-in:focus {
  box-shadow: none;
  background: transparent;
}

.sheet-amount-in .cur {
  position: static;
  transform: none;
}

/* Rules: a label on the left, its control on the right, one per row */
.rule-fields {
  display: grid;
  gap: 2px;
  border-radius: 16px;
  background: var(--recessed);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 4px 12px;
}

.rule-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
}

.rule-field + .rule-field {
  box-shadow: inset 0 1px 0 var(--line);
}

.rule-field > span:first-child {
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.rule-field .ctl {
  width: 150px;
}

.rule-field .ctl.ctl-day,
.rule-field .ctl.ctl-rate {
  width: 64px;
}

.rule-field .weekdays button {
  width: 24px;
}

@media (max-width: 699px) {
  /* The whole tile lights up together, never half of it */
  .expenses-grid.one-month tr[data-id] {
    cursor: pointer;
  }

  .expenses-grid.one-month tr[data-id]:hover > td:nth-child(n),
.expenses-grid.one-month tr[data-id]:active > td:nth-child(n) {
    background: color-mix(in srgb, var(--glass-solid) 88%, var(--text) 12%);
  }

  .expenses-grid.one-month tr[data-id] .cell-in {
    pointer-events: none; /* the amount is edited in the sheet */
  }

  .expenses-grid.one-month tr[data-id] .cell-in:hover {
    background: transparent;
  }

  /* A paid month: a lime tick before the amount, the amount quieter */
  .expenses-grid.one-month tr.paid td.cell.money::before {
    content: "";
    width: 14px;
    height: 12px;
    background: var(--good);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath d='M2.2 10.8 C 4.6 12.4, 6.8 14.6, 9.2 17.6 C 11.6 12.2, 16 6, 22.4 2.4' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath d='M2.2 10.8 C 4.6 12.4, 6.8 14.6, 9.2 17.6 C 11.6 12.2, 16 6, 22.4 2.4' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--good);
    font-weight: 800;
  }

  .expenses-grid.one-month tr.paid .cell-in {
    color: var(--text-2);
  }

  .expenses-grid.one-month tr.paid .line-meta {
    color: var(--good-text, var(--text-2));
  }

  /* The sheet: pinned to the bottom, over a dimmed page */
  .cards.has-pane::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(0, 0, 0, 0.45);
  }

  .line-pane {
    padding: 16px 16px 20px;
    border-radius: 26px;
    gap: 14px;
  }

  /* The month's amount, big, with Mark as paid beside it */
  .sheet-amount {
    display: flex;
    align-items: stretch;
    gap: 8px;
  }

  .sheet-amount-field {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 4px;
    padding: 10px 14px;
    border-radius: 18px;
    background: var(--recessed);
    box-shadow: inset 0 0 0 1px var(--line);
  }

  .sheet-amount-field > span:first-child {
    color: var(--text-2);
    font-size: var(--fs-xs);
    font-weight: 650;
  }

  .paid-btn {
    flex: none;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    width: 92px;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background: transparent;
    color: var(--text-2);
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 700;
    cursor: pointer;
  }

  .paid-btn[aria-pressed="true"] {
    background: var(--select-glass);
    border-color: var(--select-rim);
    color: var(--text);
  }
}

/* Save, as an icon on phones: lime, with the number of changes on its shoulder */
.save-btn {
  position: relative;
  background: var(--good);
  color: var(--good-ink);
}

.save-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--text);
  color: var(--glass-solid);
  font-size: 10px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
}

@media (max-width: 699px) {
  /* Five round buttons beside the tabs must still fit a 375px phone */
  .row-right,
.section-actions {
    gap: 4px;
  }

  .tabs button {
    padding: 0 10px;
  }

  .save-count {
    top: -3px;
    right: -2px;
  }
}

/* ---------- Phones: the bar stays put, and the sheet shows one group at a time ---------- */

/* Always in the same place, just above the dock, however long or short the list */
.phone-totals {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: 92px;
  margin: 0;
  z-index: 20;
}

.sheet-tabs {
  flex: none;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 0 -16px;
  padding: 2px 16px 4px;
  scrollbar-width: none;
}

.sheet-tabs::-webkit-scrollbar {
  display: none;
}

.sheet-tabs button {
  flex: none;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: var(--fs-xs);
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  -webkit-touch-callout: none;
  user-select: none;
}

.sheet-tabs button[aria-selected="true"] {
  background: var(--select-glass);
  border-color: var(--select-rim);
  color: var(--text);
}

.sheet-tabs .renaming {
  user-select: text;
  outline: none;
  border-bottom: 1px dashed currentColor;
}

@media (max-width: 699px) {
  /* Room under the last tile so it can scroll clear of the bar */
  .section[data-section="amounts"] {
    padding-bottom: 100px;
  }

  /* The sheet: a fixed height, so switching groups never makes it jump or grow */
  .line-pane {
    height: min(78vh, 620px);
    display: flex;
    flex-direction: column;
  }

  /* The picked group fills the space; only it scrolls, if it ever has to */
  .sheet-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
  }

  .sheet-body .pane-group {
    padding: 0;
  }

  .line-pane .pane-foot {
    flex: none;
    margin-top: 0;
  }
}

/* Outranks the shared glass so the bar stays solid */
.phone-totals.glass.strong {
  background: color-mix(in srgb, var(--glass-solid) 74%, var(--good) 26%);
}

@media (max-width: 699px) {
  /* Same edges as the amount above it (".sheet-body" also names the Log and Settings bodies) */
  .line-pane .sheet-body {
    padding: 0;
  }
}

/* ---------- Phones: currency on the tiles, a sheet that fits its content ---------- */

/* The month's amount, the category and Paid: the first rows, like the rules below */
.sheet-top {
  flex: none;
}

.sheet-amount-in {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sheet-amount-in .ctl {
  width: 120px;
  font-weight: 700;
}

.sheet-amount-in .cur {
  position: static;
  transform: none;
}

/* An on/off switch: lime when paid */
.switch {
  position: relative;
  flex: none;
  width: 46px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  cursor: pointer;
}

.switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text-2);
  transition: left 0.18s ease, background 0.18s ease;
}

.switch[aria-checked="true"] {
  background: var(--good);
  box-shadow: none;
}

.switch[aria-checked="true"] i {
  left: 21px;
  background: var(--good-ink);
}

@media (max-width: 699px) {
  /* Each tile's amount carries its currency, small and grey after it */
  .expenses-grid.one-month tr[data-id] td.cell.money .cur {
    display: inline;
  }

  .expenses-grid.one-month tr[data-id] td.cell.money .cell-in {
    padding-right: 34px;
  }

  .expenses-grid.one-month tr[data-id] td.cell.money .cur {
    right: 8px;
  }

  /* The sheet is as tall as what's in it, up to most of the screen */
  .line-pane {
    height: auto;
    max-height: 86vh;
  }
}

/* ---------- Phones: room between the rows, and a list that scrolls within its space ---------- */

.cat-pills {
  margin-bottom: 14px;
}

/* The bar sits clear of the dock: 14px above it */
.phone-totals {
  bottom: 104px;
}

@media (max-width: 699px) {
  /* Title, tabs and pills each get clear space */
  .topbar {
    row-gap: 18px;
  }

  /* The list scrolls inside the space it's given (sized by plan-view.js) */
  .card.fill .table-wrap:has(.expenses-grid.one-month) {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .card.fill .table-wrap:has(.expenses-grid.one-month)::-webkit-scrollbar {
    display: none;
  }

  /* The page itself no longer needs room under the list */
  .section[data-section="amounts"] {
    padding-bottom: 0;
  }
}

@media (max-width: 699px) {
  /* The tabs row and the content below it get the same clear space as the rows above */
  .app {
    gap: 18px;
  }

  /* The list fades out where it's cut, so a half tile reads as "more below" */
  .card.fill .table-wrap:has(.expenses-grid.one-month) {
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
  }
}

/* ---------- Phones: Income as tiles, like Expenses ---------- */

@media (max-width: 699px) {
  .income-grid.one-month {
    border-spacing: 0 8px;
    margin-top: -4px;
  }

  /* Totals move to the pinned bar; the table keeps just the sources */
  .income-grid.one-month tr.cat {
    display: none;
  }

  .income-grid.one-month tr.line > td,
.income-grid.one-month tr.line > td:nth-child(n) {
    height: 64px;
    background: var(--glass-solid);
    box-shadow: none;
  }

  .income-grid.one-month tr.line > td:first-child {
    padding-left: 14px;
    border-radius: 16px 0 0 16px;
  }

  .income-grid.one-month tr.line > td:nth-last-child(2) {
    border-radius: 0 16px 16px 0;
  }

  .income-grid.one-month tr.add-row > td {
    background: transparent;
    border: 1px dashed var(--line-strong);
    border-radius: 16px;
    box-shadow: none;
    padding: 12px 14px;
  }

  /* One tile, one tap: it lights up whole and opens the source's sheet */
  .income-grid.one-month tr[data-src] {
    cursor: pointer;
  }

  .income-grid.one-month tr[data-src]:hover > td:nth-child(n),
.income-grid.one-month tr[data-src]:active > td:nth-child(n) {
    background: color-mix(in srgb, var(--glass-solid) 88%, var(--text) 12%);
  }

  .income-grid.one-month tr[data-src] .cell-in {
    pointer-events: none;
    padding-right: 34px;
  }

  .income-grid.one-month tr[data-src] td.cell.money .cur {
    display: inline;
    right: 8px;
  }

  /* Arrived this month: the same lime tick as a paid expense */
  .income-grid.one-month tr.paid td.cell.money::before {
    content: "";
    width: 14px;
    height: 12px;
    background: var(--good);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath d='M2.2 10.8 C 4.6 12.4, 6.8 14.6, 9.2 17.6 C 11.6 12.2, 16 6, 22.4 2.4' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath d='M2.2 10.8 C 4.6 12.4, 6.8 14.6, 9.2 17.6 C 11.6 12.2, 16 6, 22.4 2.4' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--good);
    font-weight: 800;
  }

  .income-grid.one-month tr.paid .cell-in {
    color: var(--text-2);
  }

  /* The list scrolls inside its space, fading where it's cut; the page stays still */
  .card.fill .table-wrap:has(.income-grid.one-month) {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
  }

  .section[data-section="income"] {
    padding-bottom: 0;
  }

  /* Space between the tabs row and the first tile, as on Expenses */
  .section[data-section="income"] .plan-mount {
    padding-top: 6px;
  }
}

@media (max-width: 699px) {
  /* Room for the currency after each income amount (outranks the older tight padding) */
  .income-grid.one-month tr[data-src] td.cell.money .cell-in {
    padding-right: 34px;
  }
}

@media (max-width: 699px) {
  /* The Income sheet lives inside this card; the card mustn't trap it below the dock and bar */
  .section[data-section="income"] .card.fill {
    isolation: auto;
  }
}

/* ---------- Phones: 4 items or fewer are cards, two to a row ---------- */

@media (max-width: 699px) {
  .edit-grid.one-month.few {
    display: block;
    margin-top: 0;
  }

  .edit-grid.one-month.few tbody {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  /* A card: name and details at the top, the amount large at the bottom */
  .edit-grid.one-month.few tr.line,
.edit-grid.one-month.few tr.card-part {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    min-height: 124px;
    padding: 14px;
    border-radius: 20px;
    background: var(--glass-solid);
  }

  .edit-grid.one-month.few tr.line:hover,
.edit-grid.one-month.few tr.line:active,
.edit-grid.one-month.few tr.card-part:hover {
    background: color-mix(in srgb, var(--glass-solid) 88%, var(--text) 12%);
  }

  .edit-grid.one-month.few tr.line > td,
.edit-grid.one-month.few tr.line > td:nth-child(n),
.edit-grid.one-month.few tr.card-part > td:nth-child(n) {
    display: block;
    width: auto;
    max-width: none;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  /* Hidden columns stay hidden (the rules, the Year) */
  .edit-grid.one-month.few tr > td.rule-col,
.edit-grid.one-month.few tr > td:last-child:not([colspan]) {
    display: none;
  }

  .edit-grid.one-month.few tr.line > td.rule-col,
.edit-grid.one-month.few tr.line > td:last-child {
    display: none;
  }

  /* Details may take two lines on a card */
  .edit-grid.one-month.few .line-meta {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .edit-grid.one-month.few .name {
    font-size: var(--fs-base);
  }

  /* The amount: large, left-aligned, its currency after it */
  .edit-grid.one-month.few td.cell.money {
    display: flex;
    align-items: baseline;
    gap: 5px;
  }

  .edit-grid.one-month.few td.cell.money .cell-in,
.edit-grid.one-month.few tr[data-id] td.cell.money .cell-in,
.edit-grid.one-month.few tr[data-src] td.cell.money .cell-in {
    width: auto;
    min-width: 0;
    max-width: 100%;
    field-sizing: content;
    height: auto;
    padding: 0;
    text-align: left;
    font-size: var(--fs-lg);
    font-weight: 750;
  }

  .edit-grid.one-month.few td.cell.money .cur,
.edit-grid.one-month.few tr[data-id] td.cell.money .cur,
.edit-grid.one-month.few tr[data-src] td.cell.money .cur {
    position: static;
    transform: none;
    display: inline;
  }

  /* Paid / received: the tick sits in the card's top-right corner */
  .edit-grid.one-month.few tr.paid td.cell.money::before {
    content: none;
  }

  .edit-grid.one-month.few tr.paid::after {
    content: "";
    width: 14px;
    height: 12px;
    background: var(--good);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath d='M2.2 10.8 C 4.6 12.4, 6.8 14.6, 9.2 17.6 C 11.6 12.2, 16 6, 22.4 2.4' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath d='M2.2 10.8 C 4.6 12.4, 6.8 14.6, 9.2 17.6 C 11.6 12.2, 16 6, 22.4 2.4' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    position: absolute;
    top: 12px;
    right: 14px;
    color: var(--good);
    font-weight: 800;
  }

  /* "+ Add" spans the whole row under the cards */
  .edit-grid.one-month.few tr.add-row {
    display: block;
    grid-column: 1 / -1;
  }

  .edit-grid.one-month.few tr.add-row > td {
    display: block;
  }

  /* Rows that stay hidden in the phone list stay hidden here too */
  .edit-grid.one-month.few tr.cat,
.edit-grid.one-month.few tr.total {
    display: none;
  }
}

@media (max-width: 699px) {
  .edit-grid.one-month.few td.cell.money .cur {
    margin-left: 5px;
  }

  /* An empty card shows just the dash, no currency */
  .edit-grid.one-month.few td.cell.money:has(.cell-in:placeholder-shown) .cur {
    display: none;
  }
}

/* ---------- Phones: cards, four to a page, swiped sideways ---------- */

.card-pages,
.card-dots {
  display: none;
}

.card-pages {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0 -10px;
  padding: 0 10px;
  scroll-padding: 0 10px;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.card-pages::-webkit-scrollbar {
  display: none;
}

/* A page: 2 × 2, filling the height it's given; the next page peeks in by 18px */
.card-page {
  flex: none;
  width: calc(100% - 28px);
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 10px;
  scroll-snap-align: start;
}

.card-page:only-child {
  width: 100%;
}

/* A card: name, then its detail pills, then the month's amount, large, at the bottom */
.pcard {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px 14px 14px;
  border: 0;
  border-radius: 22px;
  background: var(--glass-solid);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

.pcard:hover,
.pcard:active {
  background: color-mix(in srgb, var(--glass-solid) 88%, var(--text) 12%);
}

.pcard-name {
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: 1.2;
}

.pcard-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.pcard .chip {
  height: auto;
  padding: 4px 9px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--glass-solid) 80%, var(--text) 20%);
  box-shadow: none;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.pcard .chip.ok {
  background: var(--select-glass);
  color: var(--text);
}

.pcard-amount {
  margin-top: auto;
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pcard-amount .cur {
  position: static;
  margin-left: 5px;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.pcard-amount.over {
  color: var(--bad-text);
}

.pcard.paid .pcard-amount {
  color: var(--text-2);
}

/* A category with nothing in it yet: a dashed box pointing at the dock's + */
.cards-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 200px;
  padding: 24px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 22px;
  color: var(--text-2);
  font-weight: 650;
  text-align: center;
}

/* A quiet picture, not a button: no circle, no lime, nothing that looks tappable */
.cards-empty i.idle {
  width: auto;
  height: auto;
  background: none;
  color: var(--text-3);
}

.cards-empty i.idle .icon {
  width: 34px;
  height: 34px;
}

.cards-empty i {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--glass-solid);
  color: var(--good);
}

/* Dots under the cards: which page is showing */
.card-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  height: 6px;
  margin-top: 10px;
}

.card-dots:empty {
  display: none;
}

.card-dots i {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--line-strong);
  transition: width 0.2s ease, background 0.2s ease;
}

.card-dots i.on {
  width: 18px;
  background: var(--good);
}

/* Long amounts still fit a half-width card */
.pcard-amount {
  font-size: min(26px, 6.6vw);
}

/* ---------- Phones: calmer cards — 16px around everything, smaller amounts, outlined pills ---------- */

.card-pages {
  margin: 0 -16px;
  padding: 0 16px;
  scroll-padding: 0 16px;
  gap: 12px;
}

.card-page {
  width: calc(100% - 30px); /* the next page peeks in by 18px */
  gap: 12px;
}

.cat-pills {
  margin-left: -16px;
  margin-right: -16px;
  padding-left: 16px;
  padding-right: 16px;
}

.phone-totals {
  left: 16px;
  right: 16px;
}

/* A card: 16px inside, a faint edge */
.pcard {
  gap: 0;
  padding: 16px;
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.pcard-name {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
}

/* Pills: 14px under the name, outlined, quiet */
.pcard-chips {
  margin-top: 14px;
  gap: 5px;
}

.pcard .chip {
  padding: 3px 8px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
}

.pcard .chip.ok {
  background: var(--select-glass);
  box-shadow: inset 0 0 0 1px var(--select-rim);
  color: var(--text);
}

/* The amount: clear, not shouting */
.pcard-amount {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.pcard-amount .cur {
  font-size: 10px;
}

/* Smaller dots */
.card-dots {
  gap: 5px;
  height: 5px;
}

.card-dots i {
  width: 5px;
  height: 5px;
}

.card-dots i.on {
  width: 14px;
}

.sheet-tabs {
  margin-left: -16px;
  margin-right: -16px;
  padding-left: 16px;
  padding-right: 16px;
}

@media (max-width: 699px) {
  /* 16px from the screen edge */
  .app {
    padding: 12px 16px 0;
  }

  .section {
    margin: -10px -16px;
    padding: 10px 16px 0;
  }
}

/* ---------- Phones: cards with share rings, and a bar that keys their colours ---------- */

/* The income blue, in both themes (lime, --good, is the category's) */
:root {
  --ring-inc: #8fb8ff;
  --ring-inc-text: #b9d2ff;
}





/* The name stays on one line, smaller; a very long one ends in … */
.pcard-name {
  max-width: 100%;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pcard-chips {
  margin-top: 12px;
}

/* The amount, with how it compares with last month under it */
.pcard-money {
  margin-top: auto;
  display: grid;
  gap: 3px;
}

.pcard-money .pcard-amount {
  margin-top: 0;
}

.pcard-vs {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
}

.pcard-vs.up {
  color: var(--bad-text);
}

.pcard-vs.down {
  color: var(--good-text);
}

/* Two small rings at the bottom */
.pcard-rings {
  display: flex;
  gap: 16px;
  margin-top: 14px;
}

.pring {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pring svg {
  display: block;
  flex: none;
}

.pring-track {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 2.5;
}

.pring-fill {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.pring.cat .pring-fill {
  stroke: var(--good);
}

.pring.inc .pring-fill {
  stroke: var(--ring-inc);
}

.pring b {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 650;
}

/* The bar: a calm dark surface; its Category and Income carry the rings' colours */
.phone-totals.glass.strong {
  background: var(--glass-solid);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 10px 30px rgba(0, 0, 0, 0.35);
}

.phone-totals.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pt-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pt-label i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}

.pt-cell.key-cat .pt-label i {
  background: var(--good);
}

.pt-cell.key-cat .pt-value {
  color: var(--good-text);
}

.pt-cell.key-inc .pt-label i {
  background: var(--ring-inc);
}

.pt-cell.key-inc .pt-value {
  color: var(--ring-inc-text);
}

/* 13px fits names like "Vodafone (Mobile)" on one line in a half-width card */
.pcard-name {
  font-size: 13px;
}

/* One whole page at a time, no peek of the next — the dots say there's more */
.card-page,
.card-page:only-child {
  width: 100%;
}

/* Pages sit further apart than the screen's 16px edge, so no sliver of the next one shows */
.card-pages {
  gap: 24px;
}

/* Card names: 15px, still one line (a long name ends in …) */
.pcard-name {
  font-size: 15px;
}


/* ---------- The Plan as cards: on a phone always, on a wide screen when Cards is picked ---------- */

/* The Plan's sections fade in without sliding: a moving section would carry the pinned bar with it */
[data-page="plan"] .section {
  animation-name: section-fade;
}

@keyframes section-fade {
  from {
    opacity: 0;
  }
}

/* Table · four cards · one card, on the pill row */
.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 40px;
  padding: 3px;
  border-radius: var(--r-pill);
  box-shadow: none;
}

.view-toggle button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}

.view-toggle button:hover {
  color: var(--text);
}

.view-toggle button[aria-pressed="true"] {
  background: var(--select-glass);
  box-shadow: inset 0 0 0 1px var(--select-rim);
  color: var(--text);
}

/* Cards: glass, like everything else sitting on the backdrop */
.pcard.glass {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.pcard.glass:hover,
.pcard.glass:active {
  background: var(--glass-strong);
}

/* Tighter: the amount sits right under the details, the rings at the foot */
.pcard {
  padding: 14px;
}

.pcard-chips {
  margin-top: 8px;
}

.pcard-money {
  margin-top: 10px;
}

.pcard-rings {
  margin-top: auto;
  padding-top: 10px;
  gap: 8px;
}

/* A ring with its figure inside */
.pring {
  position: relative;
  width: var(--ring, 38px);
  height: var(--ring, 38px);
  display: inline-grid;
  place-items: center;
  flex: none;
}

.pring svg {
  position: absolute;
  inset: 0;
}

.pring-track,
.pring-fill {
  stroke-width: 3.5;
}

.pring b {
  position: relative;
  color: var(--text);
  font-size: calc(var(--ring, 38px) * 0.26);
  font-weight: 750;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

/* The totals bar: a tile per figure, filled in its key colour, names in capitals, currency after */
:root {
  --ring-inc-ink: #0b1a33;
}





.phone-totals {
  gap: 6px;
  padding: 6px;
  border-radius: 24px;
}

.phone-totals.glass.strong {
  background: var(--glass-strong);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 10px 30px rgba(0, 0, 0, 0.3);
}

.pt-cell {
  gap: 2px;
  padding: 9px 6px 10px;
  border-radius: 18px;
  background: var(--recessed);
  color: var(--text);
}

.pt-cell + .pt-cell {
  box-shadow: none;
}

.pt-label {
  color: inherit;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  opacity: 0.8;
}

.pt-value,
.pt-cell.key-cat .pt-value,
.pt-cell.key-inc .pt-value {
  color: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.pt-value .cur {
  display: inline;
  margin-left: 3px;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

.pt-cell.key-cat {
  background: var(--good);
  color: var(--good-ink);
}

.pt-cell.key-inc {
  background: var(--ring-inc);
  color: var(--ring-inc-ink);
}

.pt-cell.over,
.pt-cell.over .pt-value {
  background: var(--bad);
  color: var(--bad-ink);
}

/* One card at a time: it fills the room, and everything about it is edited inside */
.card-single {
  display: flex;
  min-height: 0;
}

.scard {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px 14px;
  border-radius: 24px;
  background: var(--glass);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.scard-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.scard-head .round-btn {
  width: 36px;
  height: 36px;
  flex: none;
  background: var(--recessed);
}

.scard-head .round-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.scard-title {
  flex: 1;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 1px;
  text-align: center;
}

.scard-title .pane-title {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 750;
}

.scard-count {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
}

/* The month's amount, typed straight into, with the rings beside it */
.scard-money {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--recessed);
  box-shadow: inset 0 0 0 1px var(--line);
}

.scard-amount {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.scard-label {
  color: var(--text-3);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scard-amount .sheet-amount-in {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.scard-amount .sheet-amount-in .ctl {
  width: 100%;
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-align: left;
}

.scard-amount .sheet-amount-in .cur {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
}

.scard-amount.over .ctl {
  color: var(--bad-text);
}

.scard .pcard-rings {
  display: flex;
  flex: none;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.scard .sheet-top,
.scard .sheet-tabs,
.scard .pane-foot {
  flex: none;
}

.scard .sheet-tabs {
  margin: 0 -14px;
  padding: 2px 14px 4px;
}

/* Only the picked group scrolls, if it ever has to */
.scard .sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0;
  display: block;
}

.scard .pane-foot {
  margin-top: 0;
  padding: 0;
}

.scard .pane-foot .btn {
  width: 100%;
}

/* A wide screen: the cards wrap in a grid that scrolls, under a centred bar */
@media (min-width: 700px) {
  .plan-cards [data-page="plan"] .card.fill {
    background: none;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    overflow: visible;
  }

  .plan-cards [data-page="plan"] .card.fill::before,
.plan-cards [data-page="plan"] .card.fill::after,
.plan-cards [data-page="plan"] .line-pane {
    display: none;
  }

  .plan-cards [data-page="plan"] .cards.split {
    grid-template-columns: 1fr;
  }

  /* Two rows, always; more cards add columns to the right and the row scrolls sideways.
     --cols (set by fitList): as many 220px-or-wider columns as fit across, or fewer when the cards run out,
     so a short list stretches to fill the width; the two rows fill the height down to the dock */
  .card-pages {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    grid-auto-columns: calc((100% - (var(--cols, 4) - 1) * 14px) / var(--cols, 4));
    align-content: start;
    gap: 14px;
    margin: 0;
    padding: 2px 2px 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: none;
  }

  /* The cards run down to just above the dock: only room for their shadows under them */
  .plan-cards [data-page="plan"] .section {
    padding-bottom: 0;
  }

  .plan-cards .content:has(> [data-page="plan"]:not([hidden])) {
    padding-bottom: 96px;
  }

  .plan-cards [data-page="plan"] .card.fill {
    padding-bottom: 0;
  }

  .card-pages {
    padding-bottom: 6px;
  }

  /* Income: left to right, three to a row, while they fit on the two rows */
  .card-pages.by-row {
    grid-auto-flow: row;
    grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
  }

  .card-page {
    display: contents;
  }

  .card-dots {
    display: none;
  }

  .pcard-name {
    font-size: 16px;
  }

  .pcard-amount {
    font-size: 24px;
  }

  .cat-pills {
    margin: 0 0 14px;
    padding: 2px 0 4px;
  }

  .card-single {
    justify-content: center;
  }

  .scard {
    max-width: 620px;
    padding: 16px 20px 20px;
  }

  .scard .sheet-tabs {
    margin: 0 -20px;
    padding: 2px 20px 4px;
  }

  .phone-totals {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: calc(22px + var(--dock-h) + 14px);
    width: min(640px, calc(100% - 48px));
    transform: translateX(-50%);
    z-index: 20;
    margin: 0;
  }
}

@media (max-width: 699px) {
  /* Dock: every page name fits its slot, so the highlight is the same size under each and the
     names sit evenly apart */
  .dock-link {
    width: 62px;
    font-size: 10.5px;
    white-space: nowrap;
  }

}

/* An income card: what the source brings in over the year, and what its ring means */
.pcard-extra {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
}

.pcard-extra b {
  color: var(--text-2);
  font-weight: 700;
}

.pcard-rings {
  align-items: center;
}

.pring-cap {
  max-width: 80px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.25;
}

/* The one card's amount box is as wide as its figure */
.scard-amount .sheet-amount-in .ctl {
  width: auto;
  max-width: 100%;
}

/* Delete: pinned to the card's foot, whatever group is showing */
.scard-foot {
  flex: none;
}

.scard-foot .btn {
  width: 100%;
}

/* The category's full name fits: the dropdown takes the row's room, not a fixed width */
.scard .rule-field select[data-line-category] {
  flex: 1;
  width: auto;
  max-width: none;
  min-width: 0;
  margin-left: 16px;
}

/* Four cards: the amount sits lower, halfway between the details and the rings */
.pcard-money {
  margin-top: auto;
}

.scard-amount .sheet-amount-in .ctl {
  font-variant-numeric: proportional-nums;
}

/* ---------- Cards, second pass: key colours, a slim glowing totals bar, the expense card's new layout ---------- */

/* The two key colours: a category's share (lavender) and the month's income (blue) */
:root {
  --key-cat: #b39dff;
  --key-inc: #008cb4;
}

/* Lavender is pale on a light backdrop, so it deepens there to stay readable */




/* Rings take the key colours, and glow in them on a dark backdrop. The glow is an SVG filter
   with room around the ring (a CSS drop-shadow is cut off in a square at the ring's edges). */
.pring svg {
  overflow: visible;
}

.pring.cat .pring-fill {
  stroke: var(--key-cat);
  filter: url(#ring-glow);
}

.pring.inc .pring-fill {
  stroke: var(--key-inc);
  filter: url(#ring-glow);
}





/* The totals bar: one slim glass capsule; a tiny name over each figure and its currency.
   Colour arrives as a soft pool of light behind each keyed figure (dark), or as coloured text (light). */
.phone-totals.glass.strong {
  gap: 3px;
  padding: 4px;
  border-radius: 22px;
  background: var(--glass);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  isolation: isolate;
}

.phone-totals.glass.strong::after {
  opacity: 0.5;
}

.pt-cell,
.pt-cell.key-cat,
.pt-cell.key-inc,
.pt-cell.key-left,
.pt-cell.over {
  position: relative;
  z-index: 0;
  gap: 0;
  padding: 4px 4px 5px;
  border-radius: 18px;
  background: none;
  box-shadow: none;
  color: var(--text);
  --key: color-mix(in srgb, var(--text) 40%, transparent);
}

.pt-cell + .pt-cell {
  box-shadow: none;
}

.pt-cell.key-cat {
  --key: var(--key-cat);
}

.pt-cell.key-inc {
  --key: var(--key-inc);
}

.pt-cell::after {
  content: none;
}

.pt-label {
  opacity: 1;
  color: var(--text-2);
  font-size: 8.5px;
  line-height: 1.2;
  letter-spacing: 0.07em;
  overflow: visible;
}

.pt-value,
.pt-cell.key-cat .pt-value,
.pt-cell.key-inc .pt-value {
  color: var(--text);
  font-size: 13px;
  line-height: 1.15;
}

.pt-value .cur {
  display: inline;
  margin-left: 3px;
  opacity: 1;
  color: var(--text-2);
  font-size: 8px;
}

.pt-cell.over .pt-value {
  color: var(--bad-text);
}

.pt-cell.key-cat::before,
.pt-cell.key-inc::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -4px 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--key) 55%, transparent), transparent);
  filter: blur(6px);
}

.pt-cell.key-cat .pt-label,
.pt-cell.key-inc .pt-label {
  color: color-mix(in srgb, var(--key) 45%, var(--text));
}









/* Switches and pressed buttons stay glass when on; on a light backdrop they get a fuller lime and dark ink */
.switch {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

.switch[aria-checked="true"] {
  background: color-mix(in srgb, var(--good) 28%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 70%, transparent);
}

.switch[aria-checked="true"] i {
  background: var(--good);
}

/* The expense card: the head */
.scard.v2 {
  gap: 12px;
}

.scard.v2 .scard-head .round-btn {
  width: 32px;
  height: 32px;
}

.scard.v2 .scard-title {
  justify-items: start;
  margin-left: 4px;
  text-align: left;
}

.scard.v2 .scard-subs,
.scard.v2 .scard-paid {
  color: var(--text-2);
}

.scard.v2 .scard-delete {
  color: var(--bad-text);
}

.scard.v2 .scard-delete:hover {
  background: var(--bad-soft);
}

.scard.v2 .scard-subs[aria-pressed="true"],
.scard.v2 .scard-paid[aria-pressed="true"],
.scard.v2 .weekdays button[aria-pressed="true"],
.scard.v2 .sheet-tabs button[aria-selected="true"] {
  color: var(--text);
  background: color-mix(in srgb, var(--good) 22%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 60%, transparent);
}

.scard.v2 .scard-paid[aria-pressed="true"] {
  color: var(--good);
}







/* The amount box: the figure and its rings on one row, the category pill across the row under them */
.scard.v2 .scard-money {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 16px;
}

.scard.v2 .money-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.scard.v2 .money-fig {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.scard.v2 .money-fig .ctl {
  flex: none;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-align: left;
  font-variant-numeric: proportional-nums;
}

.scard.v2 .money-fig .ctl:focus {
  box-shadow: none;
}

.scard.v2 .money-fig.over .ctl {
  color: var(--bad-text);
}

.scard.v2 .money-fig .cur {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
}

.scard.v2 .scard-money .pcard-rings {
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.scard.v2 .cat-select {
  width: 100%;
  max-width: none;
  min-width: 0;
  height: 32px;
  padding: 0 30px 0 14px;
  border-radius: 999px;
  background-color: color-mix(in srgb, var(--text) 8%, transparent);
  font-size: 13px;
  text-align: left;
  text-overflow: ellipsis;
  /* the arrow sits 16 px in from the pill's edge, not on it (19 Oct) */
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c2c8b6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
}

/* Three tabs share the row */
.scard.v2 .sheet-tabs {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  overflow: visible;
}

.scard.v2 .sheet-tabs button {
  flex: 1;
  height: 32px;
}

/* One field a row; the rows share the room (their height is set from script, 38–52px) */
.scard.v2 .sheet-body {
  overflow-y: auto;
}

.scard.v2 .sheet-body > .rule-fields {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  padding: 6px 14px;
}

.scard.v2 .sheet-body .rule-field {
  min-height: 0;
}

.scard.v2 .rule-field > span:first-child {
  flex: none;
}

.scard.v2 .rule-field .ctl {
  width: auto;
  min-width: 64px;
  max-width: 60%;
  height: 30px;
  padding: 0 10px;
}

.scard.v2 .rule-field .ctl.ctl-num,
.scard.v2 .rule-field .ctl.ctl-day {
  width: 64px;
}

.scard.v2 .rule-field .ctl.ctl-month {
  width: 112px;
  cursor: pointer;
}

.scard.v2 .combo {
  display: inline-flex;
  gap: 6px;
}

.scard.v2 .combo .ctl {
  min-width: 0;
}

/* Weekly and biweekly: just the day circles, no pill around them */
.scard.v2 .weekdays {
  display: flex;
  gap: 4px;
  padding: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.scard.v2 .weekdays button {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 650;
}

/* Sub-items, shown in place of a tab from the head's list button */
.scard.v2 .sheet-body > .pane-group {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 4px 2px;
}

.scard.v2 .sheet-body > .pane-group h3 {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Starts: a calendar of days, in the app's popover glass */
.popover.day-pick {
  position: fixed;
  z-index: 70;
  top: 0;
  right: auto;
  width: 300px;
}

.day-pick .pop-grid {
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.day-pick .pop-grid button {
  height: 34px;
  color: var(--text);
  font-size: 13px;
}

.day-pick .pop-grid .dow {
  display: grid;
  place-items: center;
  height: 22px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.day-pick .pop-grid .blank {
  visibility: hidden;
}

.scard.v2 .money-fig .cur {
  margin-left: 0;
}

/* ---------- A wide screen: one card opens over the card grid ---------- */

.card-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--scrim);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: section-fade 0.18s ease-out;
}

/* Clear of the dock, which stays on top; as tall as the biggest tab needs, not the whole screen */
.card-overlay {
  padding-bottom: calc(22px + var(--dock-h) + 22px);
}

.card-overlay .card-single {
  width: min(460px, 100%);
  height: min(520px, calc(100vh - 24px - 22px - var(--dock-h) - 22px));
}

.card-overlay .scard {
  max-width: none;
  box-shadow: var(--glass-shadow);
}

.scard.v2 .scard-close {
  color: var(--text-2);
}

/* The overlay, roomier: a bigger card, more space around and between things, a legend for the rings */
.card-overlay {
  animation: none;
}

.card-overlay.opening {
  animation: section-fade 0.18s ease-out;
}

.card-overlay .card-single {
  width: min(560px, 100%);
  height: min(640px, calc(100vh - 24px - 22px - var(--dock-h) - 22px));
  flex-direction: column;
  gap: 12px;
}

.card-overlay .scard.v2 {
  gap: 16px;
  padding: 22px 24px 24px;
  border-radius: 28px;
}

.card-overlay .scard.v2 .scard-head .round-btn {
  width: 36px;
  height: 36px;
}

.card-overlay .scard.v2 .pane-title {
  font-size: 19px;
}

.card-overlay .scard.v2 .scard-money {
  gap: 14px;
  padding: 20px 22px;
  border-radius: 22px;
}

.card-overlay .scard.v2 .money-fig .ctl {
  font-size: 32px;
}

.card-overlay .scard.v2 .sheet-tabs button {
  height: 38px;
  font-size: 13px;
}

.card-overlay .scard.v2 .sheet-body > .rule-fields {
  padding: 8px 18px;
}

.card-overlay .scard.v2 .rule-field > span:first-child {
  font-size: 14px;
}

/* Save or Discard, under the open card when there are unsaved changes */
.scard-commit {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.scard-commit[hidden] {
  display: none;
}

/* ---------- The open card on a wide screen: your layout (stacked · side tabs · captions beside) ---------- */

.card-overlay .card-single {
  width: min(731px, 100%);
  height: min(575px, calc(100vh - 24px - 22px - var(--dock-h) - 22px));
}

.card-overlay .scard.v2.ov {
  gap: 22px;
  padding: 21px;
}

.scard.ov .scard-head .round-btn {
  width: 36px;
  height: 36px;
}

.scard.ov .pane-title {
  font-size: 20px;
}

/* Mark as paid (or received) and Delete, in words */
.scard.ov .btn-small {
  height: 34px;
  padding: 0 14px;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  text-transform: none;
}

.scard.ov .ov-paid {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  box-shadow: none;
  color: var(--text-2);
}

.scard.ov .ov-paid[aria-pressed="true"] {
  background: color-mix(in srgb, var(--good) 22%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 60%, transparent);
  color: var(--text);
}

.scard.ov .ov-delete {
  background: transparent;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad-text) 45%, transparent);
  color: var(--bad-text);
}

.scard.ov .ov-delete:hover {
  background: var(--bad-soft);
}

/* The figure and its rings on top; the tabs and fields under them */
.scard.ov .ov-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 22px;
}

.scard.ov .ov-left {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-radius: 22px;
  background: var(--recessed);
  box-shadow: inset 0 0 0 1px var(--line);
}

.scard.ov .money-fig {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.scard.ov .money-fig .ctl {
  flex: none;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-size: 39px;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-align: left;
  font-variant-numeric: proportional-nums;
}

.scard.ov .money-fig .ctl:focus {
  box-shadow: none;
}

.scard.ov .money-fig.over .ctl {
  color: var(--bad-text);
}

.scard.ov .money-fig .cur {
  margin-left: 0;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 700;
}

.scard.ov .ov-rings {
  display: flex;
  gap: 22px;
}

/* Each ring with what its share is of, beside it */
.scard.ov .ov-ring {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scard.ov .ov-ring .cap {
  max-width: 130px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

/* Tabs as a list down the side, beside the open tab's fields */
.scard.ov .ov-right {
  display: flex;
  gap: 16px;
  min-width: 0;
  min-height: 0;
}

.scard.ov .ov-tabs {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 124px;
}

.scard.ov .ov-tabs button {
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.scard.ov .ov-tabs button:hover {
  color: var(--text);
}

.scard.ov .ov-tabs button[aria-selected="true"] {
  background: var(--select-glass);
  box-shadow: inset 0 0 0 1px var(--select-rim);
  color: var(--text);
}

.scard.ov .sheet-body {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 0;
}

.scard.ov .sheet-body > .rule-fields {
  padding: 8px 18px;
}

.scard.ov .rule-field > span:first-child {
  font-size: 14px;
}

.scard.ov .rule-field .ctl {
  min-width: 72px;
  height: 34px;
  padding: 0 12px;
  font-size: 13.5px;
}

.scard.ov .rule-field .ctl.ctl-num,
.scard.ov .rule-field .ctl.ctl-day {
  width: 72px;
}

.scard.ov .rule-field .ctl.ctl-month {
  width: 124px;
}

.scard.ov .rule-field select[data-line-category] {
  flex: 0 1 auto;
  max-width: 65%;
  margin-left: 16px;
}





/* ---------- Wide screens: the top row carries the tools, the pill row the totals ---------- */
.top-tools {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.top-tools:empty,
.top-totals:empty {
  display: none;
}

@media (max-width: 699px) {
  .top-tools,
.top-totals {
    display: none;
  }
}

@media (min-width: 700px) {
  [data-page="plan"] .phone-totals {
    display: none;
  }

  .top-tools .round-btn {
    width: 44px;
    height: 44px;
  }

  .top-tools .btn {
    height: 44px;
  }

  /* The totals: a small capsule where the view buttons were */
  .top-totals .phone-totals.glass.strong {
    position: static;
    transform: none;
    display: flex;
    width: auto;
    margin: 0;
    padding: 3px;
    gap: 2px;
    border-radius: 18px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  }

  .top-totals .pt-cell {
    min-width: 104px;
    padding: 3px 12px 4px;
  }

  .top-totals .pt-label {
    font-size: 8px;
  }

  .top-totals .pt-value {
    font-size: 12.5px;
  }

  /* Each ring names its share beside it */
  .pcard .pcard-rings {
    gap: 14px;
  }

  .pring-pair {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
  }

  .pring-pair .pring-cap {
    max-width: 64px;
    font-size: 10.5px;
  }

  /* Icons with the open card's words and tabs, where the phone keeps them */
  .scard.ov .scard-head .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .scard.ov .ov-tabs button {
    display: flex;
    align-items: center;
    gap: 9px;
  }

  .scard.ov .ov-tabs button .icon,
.scard.ov .scard-head .btn .icon {
    flex: none;
    opacity: 0.85;
  }
}

/* The Table · Cards switch sits right after Income and Expenses */
.pills-host > .tabs {
  order: 0;
}

.view-slot {
  order: 1;
  display: flex;
}

.view-slot:empty {
  display: none;
}

.pills-host > .row-right {
  order: 2;
}

/* ---------- Wide screens: the whole year fits across, no sideways scroll ----------
   With the rules hidden: a narrower Line column, short month names, no EGP on each figure
   (every figure here is in EGP), and tighter cells. The rules (the gear) still scroll. */
@media (min-width: 700px) {
  .edit-grid:not(.show-rules) {
    font-size: 12px;
  }

  .edit-grid:not(.show-rules) th,
.edit-grid:not(.show-rules) td {
    padding-left: 4px;
    padding-right: 4px;
  }

  .edit-grid:not(.show-rules) th:first-child,
.edit-grid:not(.show-rules) td:first-child {
    width: 190px;
    min-width: 0;
    max-width: 190px;
    padding-left: 14px;
  }

  .edit-grid:not(.show-rules) .name-cell,
.edit-grid:not(.show-rules) .name-fold,
.edit-grid:not(.show-rules) .name-stack {
    min-width: 0;
    overflow: hidden;
  }

  .edit-grid:not(.show-rules) .name {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* A long category name stays on one line and shrinks to fit its cell (app.js, 21 Nov 2026) */
  .edit-grid:not(.show-rules) .cat-name {
    white-space: nowrap;
  }

  /* The move arrows take room only while the row is pointed at */
  .edit-grid:not(.show-rules) tr:not(:hover):not(:focus-within) .row-move {
    display: none;
  }

  .edit-grid:not(.show-rules) th:last-child,
.edit-grid:not(.show-rules) tr:not(.add-row) > td:last-child {
    width: 96px;
    min-width: 0;
    padding-left: 10px;
    padding-right: 12px;
  }

  .edit-grid:not(.show-rules) td.cell {
    padding: 3px 2px;
  }

  /* December keeps a gap before the Year band */
  .edit-grid:not(.show-rules) th:nth-last-child(2),
.edit-grid:not(.show-rules) tr > td:nth-last-child(2) {
    padding-right: 12px;
  }

  .edit-grid:not(.show-rules) td.cell.money .cell-in {
    min-width: 0;
    padding: 0 4px;
  }

  .edit-grid:not(.show-rules) .m-long {
    display: none;
  }

  .edit-grid:not(.show-rules) .m-short {
    display: inline;
  }

  .edit-grid:not(.show-rules) td .cur {
    display: none;
  }
}

/* The totals bar below zero: red text and a soft red pool of light, like the other keyed
   figures; an older rule filled the figure with a solid red box */
.phone-totals .pt-cell.over .pt-value {
  background: none;
  color: var(--bad-text);
}

.phone-totals .pt-cell.over .pt-label {
  color: var(--bad-text);
}

.phone-totals .pt-cell.over::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -4px 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--bad) 45%, transparent), transparent);
  filter: blur(6px);
}







/* Background: page brightness, glow, spread and style */
.tone-sliders {
  display: grid;
  gap: 10px;
  margin-top: var(--sp-3);
}

.tone {
  display: grid;
  grid-template-columns: 76px 1fr; /* room for Light blur and Glass blur on one line (15 Oct) */
  align-items: center;
  gap: 10px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 650;
}

.tone input[type="range"] {
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.tone input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 99px;
  background: var(--recessed);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.tone input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 99px;
  background: var(--recessed);
}

.tone input.hue::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, #f00, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00);
}

.tone input.hue::-moz-range-track {
  background: linear-gradient(90deg, #f00, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00);
}

.tone input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.15);
  -webkit-appearance: none;
  appearance: none;
}

.tone input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.tone input[type="range"]:focus-visible {
  outline: 2px solid var(--select-rim);
  outline-offset: 2px;
  border-radius: 99px;
}

/* Background: the second colour and the styles */
.bg-mix {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: var(--sp-3);
}

.bg-mix .tone-label {
  width: 54px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 650;
}

.bg-mix .bg-swatch {
  width: 26px;
  height: 26px;
}

.bg-mix .bg-name {
  color: var(--text-3);
  font-size: 12px;
}

.bg-styles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--sp-3);
}

.bg-styles button {
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--raised);
  color: var(--text-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
}

.bg-styles button[aria-pressed="true"] {
  background: var(--select-glass);
  box-shadow: inset 0 0 0 1px var(--select-rim);
  color: var(--text);
}

.bg-note {
  min-height: 16px;
  margin: 8px 0 0;
  color: var(--text-3);
  font-size: 12px;
}

/* ---------- The period picker: arrows either side on a wide screen, a swipe across it on a phone ---------- */

.picker-step:disabled {
  opacity: 0.35;
  cursor: default;
}

@media (max-width: 699px) {
  .picker-step {
    display: none;
  }

  /* A sideways swipe is the picker's, not the page's */
  .picker-btn {
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
  }
}

/* The new month slides in from the side it came from */
#picker-label.slide-next {
  animation: picker-from-right 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#picker-label.slide-prev {
  animation: picker-from-left 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes picker-from-right {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
}

@keyframes picker-from-left {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
}

/* ---------- The wide screen's tables: names are typed into like the amounts ---------- */

.edit-grid:not(.one-month) :is(.name[data-line-name], .name[data-src-name], .cat-name) {
  cursor: text;
  border-radius: 7px;
  padding: 2px 6px;
  margin: -2px -6px;
  outline: none;
}

.edit-grid:not(.one-month) :is(.name[data-line-name], .name[data-src-name], .cat-name):hover {
  background: var(--recessed);
}

.edit-grid:not(.one-month) :is(.name[data-line-name], .name[data-src-name], .cat-name):focus {
  background: var(--raised);
  box-shadow: inset 0 0 0 1.5px var(--select-rim);
  text-overflow: clip;
}

/* ---------- The wide screen's tables: locked until Edit ---------- */

/* The pill row's far right: the rules gear, as tall as the Lock | Edit pill beside it, lit while the rules show */
.round-btn.table-rules {
  width: 40px;
  height: 40px;
}

/* A wide screen: every pill on the row as tall as Income and Expenses (44px) */
@media (min-width: 700px) {
  .pills-host .view-toggle {
    height: 44px;
  }

  .pills-host .view-toggle button {
    width: 38px;
    height: 38px;
  }

  .pills-host .round-btn.table-rules {
    width: 44px;
    height: 44px;
  }
}

/* Lit like the pills' chosen buttons: a soft lime glass with a rim, not solid lime */
.table-rules[aria-pressed="true"] {
  background: var(--select-glass);
  box-shadow: inset 0 0 0 1px var(--select-rim);
  color: var(--text);
}

/* Before a name: i (locked, an expense line's pane) or ≡ (Edit, drag to reorder) */
.row-info,
.row-grip,
.row-del {
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0; /* no browser padding, so the icon sits dead centre */
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
}

.row-info,
.row-grip,
.row-lead-space {
  margin-right: 4px;
}

.row-lead-space {
  flex: none;
  width: 24px;
}

.row-info:hover {
  background: var(--raised);
  color: var(--text);
}

/* Focused from the keyboard: a rim inside the button, so the name cell's edge can't clip it */
.row-info:focus-visible,
.row-grip:focus-visible,
.row-del:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1.5px var(--select-rim);
}

.row-del:focus-visible {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--bad) 55%, transparent);
}

/* The bin, pointed at: red on a faint red wash, not on a grey tile */
.row-del:hover,
.row-del:focus-visible {
  background: color-mix(in srgb, var(--bad) 14%, transparent);
  color: var(--bad-text);
}

.row-grip {
  cursor: grab;
  touch-action: none;
}

.row-grip:hover {
  color: var(--text);
}

.row-del {
  margin-left: auto;
}

/* Dragging: the row fades, and a line shows where it will land */
tr.dragging > td {
  opacity: 0.45;
}

tr.drop-before > td {
  box-shadow: inset 0 2px 0 var(--good);
}

tr.drop-after > td {
  box-shadow: inset 0 -2px 0 var(--good);
}

body.row-dragging,
body.row-dragging * {
  cursor: grabbing !important;
  user-select: none;
  -webkit-user-select: none;
}

/* Locked: nothing looks typeable, and there's nothing to add */
.edit-grid.locked .add-row {
  display: none;
}

.edit-grid.locked :is(.name[data-line-name], .name[data-src-name], .cat-name),
.edit-grid.locked .cell-in {
  cursor: default;
}

.edit-grid.locked :is(.name[data-line-name], .name[data-src-name], .cat-name):hover,
.edit-grid.locked .cell-in:hover {
  background: transparent;
}

.edit-grid.locked .cell-in:focus {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
}

/* …and so does a line's pane: its changes wait for Edit */
.line-pane.locked :is([data-line-delete], [data-sub-add], [data-sub-remove]) {
  display: none;
}

/* ---------- Icons for items, categories and income sources (item-icons.js) ---------- */

/* The tile: before a row's name in the table, where the i was */
.item-ic {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: var(--raised);
  color: var(--text-2);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.item-ic .icon {
  width: 17px;
  height: 17px;
}

.item-ic .up-ic {
  width: 72%;
  height: 72%;
  object-fit: contain;
  border-radius: 4px;
}

button.item-ic {
  cursor: pointer;
}

button.item-ic:hover {
  background: var(--raised-strong);
  color: var(--text);
}

button.item-ic:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1.5px var(--select-rim);
}

.edit-grid .name-fold .item-ic {
  margin-right: 8px;
}

/* Edit: a lime outline round every tile says its icon can be changed */
.edit-grid:not(.locked) .item-ic[data-pick-icon] {
  box-shadow: inset 0 0 0 1.5px var(--select-rim);
  color: var(--icon-tile-ink);
}

.edit-grid:not(.locked) .item-ic[data-pick-icon]:hover {
  background: var(--select-glass);
}

/* Cards: the icon leads the card's name */
.pcard-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.pcard-head .pcard-name {
  min-width: 0;
}

.item-ic.card-ic {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.item-ic.card-ic .icon {
  width: 23px; /* about two-thirds of the tile, so the drawing reads */
  height: 23px;
}

/* Lime icons (2026-10-10): a lime glyph on a light lime tile — the cards' item icons, and every icon in
   the table (rows, category strips). Brand logos keep the text colour on the lime tile. */
:root {
  --icon-tile: rgba(198, 244, 50, 0.16);
  --icon-tile-hover: rgba(198, 244, 50, 0.26);
  --icon-tile-ink: #c6f432;
}

.edit-grid .item-ic,
.pcard .item-ic.card-ic,
.scard-head .pane-ic {
  background: var(--icon-tile);
  color: var(--icon-tile-ink);
}

.edit-grid button.item-ic:hover {
  background: var(--icon-tile-hover);
  color: var(--icon-tile-ink);
}

.edit-grid .item-ic .icon.brand,
.pcard .item-ic .icon.brand,
.scard-head .pane-ic .icon.brand {
  color: var(--text);
}

/* A card pane's header: the item's icon, tappable — it opens the icon picker */
.scard-head .pane-ic {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  cursor: pointer;
}

.scard-head .pane-ic .icon {
  width: 62%;
  height: 62%;
}

.scard-head .pane-ic:hover {
  background: var(--icon-tile-hover);
}

.scard-head .pane-ic:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1.5px var(--select-rim);
}

/* The category pills: the category's icon before its name */
.cat-pills button[data-phone-cat],
.cat-pills button[data-inc-cat] {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.cat-pills button[data-phone-cat] > .icon,
.cat-pills button[data-phone-cat] > .up-ic,
.cat-pills button[data-inc-cat] > .icon,
.cat-pills button[data-inc-cat] > .up-ic {
  width: 15px;
  height: 15px;
  flex: none;
}

.cat-pills button[data-phone-cat] > .up-ic,
.cat-pills button[data-inc-cat] > .up-ic {
  object-fit: contain;
  border-radius: 3px;
}

/* The picker */
.icon-picker {
  position: fixed;
  z-index: 70;
  width: min(340px, calc(100vw - 32px));
  padding: 14px;
  border-radius: 20px;
  display: grid;
  gap: 10px;
}

.icon-picker h3 {
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.icon-picker h3 span {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
}

.icon-groups {
  display: grid;
  gap: 8px;
  max-height: min(50vh, 400px);
  overflow-y: auto;
  padding: 2px;
}

.icon-group {
  margin: 0;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.icon-set {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.icon-set button {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--raised);
  color: var(--text-2);
  cursor: pointer;
}

.icon-set button:hover {
  background: var(--raised-strong);
  color: var(--text);
}

.icon-set button[aria-pressed="true"] {
  background: var(--select-glass);
  box-shadow: inset 0 0 0 1px var(--select-rim);
  color: var(--text);
}

.icon-set button .icon {
  width: 19px;
  height: 19px;
}

.icon-set button .up-ic {
  width: 70%;
  height: 70%;
  object-fit: contain;
  border-radius: 4px;
}

.icon-upload {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.icon-upload span {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
}

.icon-upload:hover {
  border-color: var(--select-rim);
  background: var(--raised);
}

.icon-error {
  margin: 0;
  color: var(--bad-text);
  font-size: 12px;
  font-weight: 650;
}

.icon-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.icon-picker[hidden],
.icon-error[hidden] {
  display: none;
}

/* The name column makes room for the icon tile (and, in Edit, for ≡ and the bin) */
@media (min-width: 700px) {
  .edit-grid:not(.show-rules) th:first-child,
.edit-grid:not(.show-rules) td:first-child {
    width: 214px;
    max-width: 214px;
  }

  .edit-grid:not(.show-rules):not(.locked) th:first-child,
.edit-grid:not(.show-rules):not(.locked) td:first-child {
    width: 250px;
    max-width: 250px;
  }
}

/* The table's scrollbars take their own room (a Mac's float over the content, and the pinned
   Year column sat right under them); slim, and only as strong as the glass around them */
/* Firefox: its own slim scrollbar (in Chrome and Safari these two would switch off the ::-webkit-scrollbar styling below) */
@supports not selector(::-webkit-scrollbar) {
  .card.fill .table-wrap {
    scrollbar-width: thin;
    scrollbar-color: var(--raised-strong) transparent;
  }
}

.card.fill .table-wrap::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.card.fill .table-wrap::-webkit-scrollbar-track,
.card.fill .table-wrap::-webkit-scrollbar-corner {
  background: transparent;
}

.card.fill .table-wrap::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 10px;
  background: var(--raised-strong) padding-box;
}

.card.fill .table-wrap::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-3);
}

/* Locked: an item's name opens its details, like its icon */
.edit-grid.locked .name[data-line-name] {
  cursor: pointer;
}

.edit-grid.locked .name[data-line-name]:hover {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

/* ---------- Table look: glass strips for the header, categories, Year and totals ----------
   Desktop table only (the phone's one-month table keeps its own look). The tint colour and each
   part's strength come from Settings › Table (app.js writes the --strip-* values); the defaults
   here match its defaults. Each strip is painted as the colour its tint makes over the glass
   (--strip-*-solid), as the cells' own backgrounds: a see-through tint shows hairlines where
   cells meet and lets pinned rows show the lines scrolling under them. */

:root {
  --strip-head: rgba(255, 255, 255, 0.1);
  --strip-cat: rgba(255, 255, 255, 0.14);
  --strip-tot: rgba(255, 255, 255, 0.18);
  --strip-head-ink: var(--text);
  --strip-head-ink-2: var(--text-2);
  --strip-cat-ink: var(--text);
  --strip-tot-ink: var(--text);
  --strip-badge: rgba(255, 255, 255, 0.31);
  --strip-badge-ink: var(--text);
  --strip-good: var(--good-text);
  --strip-bad: var(--bad-text);
  --strip-rim: rgba(255, 255, 255, 0.14);
  --strip-head-solid: color-mix(in srgb, #fff 10%, var(--glass-solid));
  --strip-cat-solid: color-mix(in srgb, #fff 14%, var(--glass-solid));
  --strip-tot-solid: color-mix(in srgb, #fff 18%, var(--glass-solid));
}

/* No rules or fills on the lines; a faint wash on hover is the only guide */
.edit-grid:not(.one-month) td,
.edit-grid:not(.one-month) th {
  border: 0 !important;
}
.edit-grid:not(.one-month) tr.line > td {
  background: transparent;
  box-shadow: none;
}
.edit-grid:not(.one-month) tr.line:hover > td:not(:last-child) {
  background: color-mix(in srgb, var(--text) 5%, transparent);
}
.edit-grid:not(.one-month) tr.line:hover > td:first-child { border-radius: 12px 0 0 12px; }

/* Round icon badges */
.edit-grid:not(.one-month) .item-ic { border-radius: 50%; }

/* The strips */
.edit-grid:not(.one-month) thead th,
.edit-grid:not(.one-month) tr.cat > td,
.edit-grid:not(.one-month) tr:not(.add-row) > td:last-child {
  background: var(--strip) !important;
  background-clip: padding-box !important;
  box-shadow: none !important;
}
/* Scrolled sideways, the pinned names get a solid back that fades at its edge, so what slides
   under them doesn't show through. plan-view.js marks the scroll box .scrolled-x — Safari has no
   scroll-state container queries, so this can't wait for one. */
.table-wrap.scrolled-x .edit-grid:not(.one-month) tr.line > td:first-child {
  background: linear-gradient(to right, var(--glass-solid) calc(100% - 18px), transparent) !important;
}

/* Header: no "Line"/"Source" over the names (still read out); the Year label like the months */
.edit-grid:not(.one-month) thead th {
  --strip: var(--strip-head-solid);
  color: var(--strip-head-ink-2);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 var(--strip-rim) !important;
}
.edit-grid:not(.one-month) thead th:first-child { border-radius: 16px 0 0 16px; }
.edit-grid:not(.one-month) thead th:first-child .th-line {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Categories: a gap above (a clear top border the strip doesn't paint), then the strip */
.edit-grid:not(.one-month) tr.cat:not(.total):not(.summary) > td {
  --strip: var(--strip-cat-solid);
  border-top: 14px solid transparent !important;
  padding-top: 12px;
  padding-bottom: 12px;
  color: var(--strip-cat-ink);
  font-weight: 800;
  box-shadow: inset 0 1px 0 var(--strip-rim) !important;
}
.edit-grid:not(.one-month) tr.cat:not(.total):not(.summary) > td * { color: var(--strip-cat-ink); }
/* 16px across, 30px down: less the 14px border, the strip's own corner is round */
.edit-grid:not(.one-month) tr.cat:not(.total):not(.summary) > td:first-child {
  border-top-left-radius: 16px 30px;
  border-bottom-left-radius: 16px;
}
.edit-grid:not(.one-month) tr.cat:not(.total):not(.summary) .item-ic {
  width: 32px;
  height: 32px;
  background: var(--icon-tile-hover);
}
.edit-grid:not(.one-month) tr.cat:not(.total):not(.summary) .item-ic,
.edit-grid:not(.one-month) tr.cat:not(.total):not(.summary) .item-ic * { color: var(--icon-tile-ink); }
.edit-grid:not(.one-month) tr.cat:not(.total):not(.summary) .item-ic .icon.brand { color: var(--text); }

/* The Year column matches the totals: one piece from the header down, through the gaps */
.edit-grid:not(.one-month) th:last-child,
.edit-grid:not(.one-month) tr:not(.add-row) > td:last-child {
  --strip: var(--strip-tot-solid);
  padding-left: 26px;
  color: var(--strip-tot-ink);
  font-weight: 800;
}
.edit-grid:not(.one-month) tr:not(.add-row) > td:last-child * { color: inherit; }
.edit-grid:not(.one-month) thead th:last-child { color: var(--strip-tot-ink); border-radius: 0 16px 0 0; }
.edit-grid:not(.one-month) tr.cat:not(.total):not(.summary) > td:last-child {
  --strip: var(--strip-tot-solid);
  border-top: 0 !important;
  padding-top: 26px;
  color: var(--strip-tot-ink);
  box-shadow: none !important;
}
.edit-grid:not(.one-month) tr.cat:not(.total):not(.summary) > td:last-child * { color: inherit; }

/* Totals (Planned and Remaining; Total income, Left over and Balance): one block, the same
   size as the rest of the table */
.edit-grid:not(.one-month) tr.total > td,
.edit-grid:not(.one-month) tr.summary > td {
  --strip: var(--strip-tot-solid);
  color: var(--strip-tot-ink);
  font-size: var(--fs-sm);
  font-weight: 800;
}
.edit-grid:not(.one-month) tr.total > td *,
.edit-grid:not(.one-month) tr.summary > td * { color: inherit; }
.edit-grid:not(.one-month) tr.total > td:first-child,
.edit-grid:not(.one-month) tr.summary > td:first-child { letter-spacing: 0.1em; text-transform: uppercase; font-size: var(--fs-xs); }
/* A gap between the last line and the totals, like the one above each category (the Year
   column runs on through it) */
.edit-grid:not(.one-month) tr.total:not(.remaining) > td { border-top: 14px solid transparent !important; }
.edit-grid:not(.one-month) tr.total:not(.remaining) > td:last-child { border-top: 0 !important; padding-top: 27px; }
.edit-grid:not(.one-month) tr.total:not(.remaining) > td:first-child { border-radius: 16px 0 0 0 / 30px 0 0 0; }
.edit-grid:not(.one-month) tr.remaining > td:first-child,
.edit-grid:not(.one-month) tr.summary:last-child > td:first-child { border-radius: 0 0 0 16px; }
.edit-grid:not(.one-month) tr.remaining > td:last-child,
.edit-grid:not(.one-month) tr.summary:last-child > td:last-child { border-radius: 0 0 16px 0; }
.edit-grid:not(.one-month) tr.remaining > td,
.edit-grid:not(.one-month) tr.summary > td { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--strip-tot-ink) 10%, transparent) !important; }
.edit-grid:not(.one-month) tr.remaining > td:not(:first-child),
.edit-grid:not(.one-month) tr.summary > td:not(:first-child) { color: var(--strip-good); }
.edit-grid:not(.one-month) tr.total > td.over,
.edit-grid:not(.one-month) tr.total > td.short,
.edit-grid:not(.one-month) tr.summary > td.short { color: var(--strip-bad) !important; }
.edit-grid:not(.one-month) tr.summary > td .quiet { color: var(--strip-tot-ink); opacity: 0.6; }

/* Settings › Table: its slider names are longer than the Background ones */
.tone-sliders.wide .tone { grid-template-columns: 76px 1fr; }

/* The hold line only lives on phone cards */
.pcard-hold { display: none; }

/* ---------- Plan cards: designed in Settings › Cards ----------
   Top row: icon and name, then the due day and the Paid (or Received) button. Then the pills —
   paid, how it's paid and the line's rules — in whatever room there is (plan-view.js fitPills
   hides any that don't fit whole), and the amount and rings at the foot. Spacing, sizes and which
   pills show are the viewer's choice (app.js writes --card-* and data-card-* on <html>). */

:root {
  --card-pad: 16px;
  --card-space: 10px;
  --card-icon: 40px;
  --card-name: 18px;
  --card-amount: 36px;
  --card-ring: 38px;
  --card-pill: 12px;
}

.pcard-in { display: contents; }
.pcard-top { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; }
.pcard-top .pcard-head { flex: 1; min-width: 0; }
.pcard-acts { display: flex; align-items: center; gap: 6px; flex: none; }

.pcard-due,
.pcard-pay {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 30px;
  border-radius: var(--r-pill);
  background: var(--raised);
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  white-space: nowrap;
}
.pcard-due { padding: 0 10px 0 8px; }
.pcard-due .icon,
.pcard-pay .icon { width: 14px; height: 14px; }
.pcard-pay {
  width: 30px;
  padding: 0;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.pcard-pay > span { display: none; }
.pcard-pay:hover { background: var(--raised-strong); color: var(--text); }
.pcard-pay:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Paid: the button itself says so, filled lime */
.pcard-pay.on,
.pcard-pay.on:hover { background: var(--select); color: var(--select-ink); }

.pcard-chips .chip.gone { display: none; }

@media (min-width: 700px) {
  .card-pages .pcard {
    container-type: size;
    display: flex;
    padding: var(--card-pad);
  }
  .card-pages .pcard-in {
    display: grid;
    flex: 1;
    align-self: stretch;
    width: 100%;
    min-width: 0;
    min-height: 0;
    /* the top row; the pills (only as tall as they are — they give way first on a short card); the
       amount and its verdict in the middle of the room left, as far from the pills as from the rings
       (user, 2026-10-06); the rings at the foot. Each part keeps its row when the pills are hidden. */
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, max-content) 1fr auto;
    align-items: start;
    justify-items: start;
    gap: var(--card-space) 0;
  }
  .card-pages .pcard-in > * { margin: 0 !important; padding-top: 0 !important; }
  .card-pages .pcard-in > .pcard-money { grid-row: 3; align-self: center; }
  .card-pages .pcard-in > .pcard-rings { grid-row: 4; }
  /* No pills on the page: their row goes, so the amount sits midway between the top row and the rings */
  .card-pages .pcard-in:has(> .pcard-chips.empty) { grid-template-rows: auto 1fr auto; }
  .card-pages .pcard-in:has(> .pcard-chips.empty) > .pcard-money { grid-row: 2; }
  .card-pages .pcard-in:has(> .pcard-chips.empty) > .pcard-rings { grid-row: 3; }
  .card-pages .pcard-chips {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    align-self: stretch;
    gap: 6px;
    width: 100%;
    overflow: hidden;
  }
  .card-pages .pcard .chip { font-size: var(--card-pill); }

  .card-pages .pcard .pcard-name { font-size: var(--card-name); font-weight: 700; }
  .card-pages .pcard .item-ic.card-ic { width: var(--card-icon); height: var(--card-icon); }
  .card-pages .pcard .item-ic.card-ic .icon { width: 62%; height: 62%; } /* fills the tile — 45% read as tiny */
  .card-pages .pcard .pcard-amount { font-size: var(--card-amount); letter-spacing: -0.02em; }
  .card-pages .pcard .pcard-amount .cur { font-size: max(10px, calc(var(--card-amount) * 0.3)); }
  .card-pages .pcard .pring { --ring: var(--card-ring) !important; }
  /* The ring's circle grows with the ring (its figure already does) */
  .card-pages .pcard .pring svg { width: 100%; height: 100%; }

  /* What shows */
  :root[data-card-chips="off"] .card-pages .pcard-chips { visibility: hidden; }
  :root[data-card-vs="off"] .card-pages .pcard-vs,
:root[data-card-extra="off"] .card-pages .pcard-extra,
:root[data-card-rings="off"] .card-pages .pcard-rings,
:root[data-card-ringnames="off"] .card-pages .pring-cap,
:root[data-card-pay="off"] .card-pages .pcard-pay { display: none; }
}

/* The button's words, once there's room beside the name and due day */
@container (min-width: 380px) {
  :root:not([data-card-paywords="off"]) .pcard .pcard-pay { width: auto; padding: 0 13px 0 9px; }
  :root:not([data-card-paywords="off"]) .pcard .pcard-pay > span { display: inline; }
}

/* Settings › Cards */
.setting-sub {
  margin: 14px 0 8px;
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}
.check-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.check-grid input { width: 16px; height: 16px; margin: 0; accent-color: var(--select); flex: none; }

/* Phone cards stay as they were: name, how it's paid, the amount and rings, with just the tick
   (the due day and the rule pills are for the wider cards on a computer) */
@media (max-width: 699px) {
  .pcard .pcard-due,
.pcard .pcard-chips .chip[data-k]:not([data-k="paidWith"]) { display: none; }
  /* no button: holding the card marks it paid (plan-view.js), a lime line drawing round it */
  /* (18 Oct, a test) the action icon is back at the top right of a phone card — the name gives way (fitNames) */
  .pcard .pcard-pay { display: inline-flex; flex: none; }
  .card-pages .pcard { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
  .pcard-hold {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
  }
  .pcard-hold rect {
    fill: none;
    stroke: var(--good);
    stroke-width: 6; /* half of it shows, inside the card's edge */
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    opacity: 0;
    transition: stroke-dashoffset 0.2s ease-out, opacity 0.2s ease-out;
  }
  .pcard.holding .pcard-hold rect {
    stroke-dashoffset: 0;
    opacity: 1;
    transition: stroke-dashoffset 0.5s linear, opacity 0.08s;
  }
  .pcard.holding { transform: scale(0.98); }
  /* Paid (or received): the line stays, closed */
  .pcard.paid .pcard-hold rect { stroke-dashoffset: 0; opacity: 1; transition: none; }
  .pcard .pcard-top { gap: 6px; }
}

/* The name always shows in full (plan-view.js fitNames): what a tight card gives up first */
:root .pcard.no-words .pcard-pay { width: 30px !important; padding: 0 !important; }
:root .pcard.no-words .pcard-pay > span,
:root .pcard.no-due .pcard-due { display: none !important; }

/* ---------- Logging (Step 3) ---------- */

/* A chip that opens its correction */
button.chip[data-edit]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* The chip menu: a correction beside the chip, inside the sheet */
#capture .sheet-inner {
  position: relative;
}

.chip-menu {
  right: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-2);
  overflow: hidden;
  transform-origin: top left;
}

.chip-menu > * {
  flex-shrink: 0;
}

.chip-menu > .menu-list {
  flex-shrink: 1;
  min-height: 0;
  overflow: auto;
}

.chip-menu .menu-list,
.chip-menu .menu-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chip-menu .menu-row {
  flex-direction: row;
}

.menu-opt {
  display: block;
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.menu-opt:hover,
.menu-opt:focus-visible {
  background: var(--raised);
  outline: none;
}

.menu-opt.on {
  background: var(--select-glass);
  box-shadow: inset 0 0 0 1px var(--select-rim);
}

.menu-opt.sub {
  padding-left: 22px;
  color: var(--text-2);
}

.menu-group {
  padding: 8px 10px 2px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.menu-group:empty {
  padding: 0;
  margin: 4px 0;
  border-top: 1px solid var(--line);
}

.menu-note {
  margin: 0;
  padding: 0 4px;
  color: var(--text-3);
  font-size: var(--fs-xs);
}

.menu-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: 0 4px;
  font-size: var(--fs-sm);
  font-weight: 600;
}

.chip-menu .ctl {
  width: 100%;
  min-height: 36px;
}

.chip-menu .menu-search {
  text-align: left;
}

.menu-field .ctl {
  width: 110px;
}

/* Plan cards: what's been logged against the line this month */
.pcard-logged {
  display: flex;
  flex-direction: column;
  gap: 1px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
}

.pcard-logged b {
  color: var(--text);
  font-weight: 700;
}

.pcard-logged .over,
.pcard-logged .over b {
  color: var(--bad-text);
}

/* ---------- Transactions › Logged: the Plan's cards (logged-view.js) ----------
   Same card, pages, rings and bar as the Plan's; only what a logged entry adds is here. */

/* The pills that say something's odd, and the ones that only inform */
.pcard .chip.flag {
  background: var(--bad-soft);
  color: var(--bad-text);
}

.pcard .chip.note {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

/* Delete and Refund sit where the Plan's Paid button does: 30px buttons, never squeezed or hidden */
.pcard .pcard-pay.pcard-del,
.pcard .pcard-pay.pcard-refund {
  flex: none;
  width: 30px;
  min-width: 30px;
  height: 30px;
}

/* Delete is a red trash can */
.pcard .pcard-pay.pcard-del {
  background: var(--bad-soft);
  color: var(--bad-text);
  transition: background 0.15s, color 0.15s;
}

.pcard .pcard-pay.pcard-del:hover {
  background: var(--bad);
  color: var(--bad-ink);
}

/* Nothing left to take back: still there, faded */
.pcard .pcard-pay.pcard-refund[aria-disabled="true"] {
  opacity: 0.4;
  cursor: default;
}

/* A phone: the card slides left to show a red Delete (app.js). Past halfway the red turns solid
   and letting go deletes it. */
.log-swipe {
  position: relative;
  border-radius: 22px;
}

.log-swipe-del,
.log-swipe-refund {
  display: none;
}

@media (max-width: 699px) {
  /* The wrapper doesn't clip: the card keeps its own shadow and glass edge, like Platinum CC.
     The delete / refund strips are cut to the card's shape instead (their own radius, below) */
  .log-swipe {
    overflow: visible;
    border-radius: 18px;
  }

  .log-swipe > .pcard {
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
  }

  /* Just the strip the card has uncovered (--x, set by app.js as it moves) */
  .log-swipe-del {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--x, 0px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    overflow: hidden;
    padding: 0;
    border: 0;
    border-radius: 18px;
    background: var(--bad-soft);
    color: var(--bad-text);
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
  }

  /* Refund: lime, in the strip a card uncovers by moving right (--xr, set by app.js) */
  .log-swipe-refund {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--xr, 0px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    overflow: hidden;
    padding: 0;
    border: 0;
    border-radius: 18px;
    background: color-mix(in srgb, var(--select) 30%, transparent);
    color: var(--select);
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
  }

  .log-swipe.anim .log-swipe-refund {
    transition: width 0.22s ease-out, background 0.15s, color 0.15s;
  }

  /* icons only, so they can be large */
  .log-swipe-refund .icon,
.log-swipe-del .icon {
    width: 28px;
    height: 28px;
    flex: none;
  }

  .log-swipe.past-r .log-swipe-refund {
    background: var(--select);
    color: var(--select-ink);
  }

  .log-swipe.anim .log-swipe-del {
    transition: width 0.22s ease-out, background 0.15s, color 0.15s;
  }

  .log-swipe.past .log-swipe-del,
.log-swipe.going .log-swipe-del {
    background: var(--bad);
    color: var(--bad-ink);
  }
}

@media (max-width: 699px) {
  .pcard .pcard-pay.pcard-del,
.pcard .pcard-pay.pcard-refund {
    display: inline-flex;
  }

  /* A phone shows how it was paid and anything odd; the line is on the Plan */
  .pcard .pcard-chips .chip.flag[data-k="flag"] {
    display: inline-flex;
  }
}

/* A card's charges: summed on a card of their own */
.pcard.log-charges .pcard-amount {
  color: var(--text-2);
}

/* An odometer reading, being corrected */
.pcard-amount .odo-in {
  width: 7ch;
  height: auto;
  min-height: 0;
  padding: 2px 6px;
  font: inherit;
  text-align: left;
}

/* The month's figures: four cards across, above the list; a phone leaves them out */
.log-totals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.pcard.log-total {
  cursor: default;
  gap: 0;
}

.pcard.log-total:hover {
  background: var(--glass);
}

.pcard.log-total .pcard-money {
  margin-top: 10px;
  gap: 4px;
}

.pcard.log-total .pcard-amount {
  font-size: clamp(20px, 2.4vw, 28px);
}

.pcard.log-total.over .pcard-amount {
  color: var(--bad-text);
}

.pcard.log-total .pcard-vs {
  line-height: 1.35;
}

/* The list: one card to a row — the name and its pills, then its rings, the amount and when it
   was paid, and Delete at the far end */
.log-list {
  display: grid;
  gap: 10px;
  padding-bottom: 8px;
}

.log-list .pcard {
  display: block;
  padding: 14px 16px;
  cursor: default;
}

.log-list .pcard-in {
  display: grid;
  /* fixed columns, so rings, amounts and Delete line up down the list */
  grid-template-columns: minmax(0, 1fr) 250px 150px 66px;
  grid-template-areas:
    "head rings money acts"
    "chips rings money acts";
  align-items: center;
  column-gap: 18px;
  row-gap: 8px;
}

.log-list .pcard-top {
  display: contents;
}

.log-list .pcard-head {
  grid-area: head;
  min-width: 0;
}

.log-list .pcard-acts {
  grid-area: acts;
  justify-content: flex-end; /* Delete keeps the right edge; Refund sits left of it */
}

.log-list .pcard-chips {
  grid-area: chips;
  flex-wrap: nowrap; /* the pills stand side by side, never under one another */
  min-width: 0;
  margin: 0;
  overflow: hidden;
}

/* A card too narrow to give the name its room (app.js fitLogged) gives up the rings first */
.log-list.no-rings .pcard-in {
  grid-template-columns: minmax(0, 1fr) 150px 66px;
  grid-template-areas:
    "head money acts"
    "chips money acts";
}

.log-list.no-rings .pcard-in:has(.pcard-note:not([hidden])) {
  grid-template-areas:
    "head money acts"
    "chips money acts"
    "note money acts";
}

.log-list.no-rings .pcard-rings {
  display: none;
}

.log-list .pcard-rings {
  grid-area: rings;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  gap: 12px;
}

/* A card with only the income ring keeps it in the income column */
.log-list .pcard-rings > .pring-pair:only-child:has(.pring.inc) {
  grid-column: 2;
}

/* Your note's i, after the name: quiet until it's open, then lime (the user, 2026-10-08) */
.note-i {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin: -5px -6px -5px -6px; /* a bigger target than it looks, sitting close to the name */
  border-radius: 50%;
  color: var(--text-3);
  cursor: pointer;
}

.note-i:hover,
.note-i.open {
  color: var(--good);
}

.note-i:focus-visible {
  outline: 2px solid var(--good);
  outline-offset: -2px;
}

/* Your note, under its pills once its i is tapped: a quiet line that wraps to show the whole note, however long —
   a hairline above it, on a phone and a wide screen alike (the user, 2026-10-08) */
.log-list .pcard-note {
  margin-top: 4px;
  padding-top: 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  white-space: normal;
  overflow-wrap: anywhere;
}

.pcard-note {
  grid-area: note;
  min-width: 0;
  overflow: hidden;
  color: var(--text-2);
  font-size: 12.5px;
  font-style: italic;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-list .pcard-in:has(.pcard-note:not([hidden])) {
  grid-template-areas:
    "head rings money acts"
    "chips rings money acts"
    "note rings money acts";
}

.log-list .pcard-money {
  grid-area: money;
  margin: 0;
  justify-items: end;
  text-align: right;
}

.log-list .pcard-amount {
  font-size: 22px;
}

.log-list .pcard-name {
  font-size: 15px;
}

/* A list card opens to be corrected */
.log-list .pcard {
  cursor: pointer;
}

.log-list .pcard.log-charges {
  cursor: default;
}

.log-list .pcard.log-charges.glass:hover {
  background: var(--glass);
}

/* The day the entries under it were paid */
.log-day {
  margin: 24px 4px 8px; /* with the list's own 10px gap: 34px above, 18px below */
  color: var(--good-text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* …and what came in and went out that day, at its end, in the same type */
.log-day {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.log-day-sum {
  display: inline-flex;
  gap: 18px;
  white-space: nowrap;
}
.log-day-sum > span {
  white-space: nowrap;
}
.log-day-sum .cur {
  margin-left: 3px;
  font-size: 8px; /* smaller than a card's EGP (10), under capitals (user, 2026-10-06) */
}
/* A phone: the figures a little tighter, so a long day (28 SEPTEMBER, IN 185,487 EGP) still fits one
   row; anything wider takes the next line, at the right — never a sideways scroll */
@media (max-width: 699px) {
  .log-day {
    flex-wrap: wrap;
    row-gap: 4px;
  }
  .log-day-sum {
    gap: 12px;
    margin-left: auto;
    letter-spacing: 0.06em;
  }
}
.log-day-sum b {
  color: var(--text); /* the amounts in white; In and Out stay lime (user, 2026-10-06) */
  font-weight: inherit;
}

/* Every pill shows here on a wide screen; a phone keeps the category and how it was paid */
.log-list .pcard .pcard-chips .chip[data-k] {
  display: inline-flex;
}

@media (max-width: 699px) {
  .log-list .pcard .pcard-chips .chip[data-k]:not([data-k="category"]):not([data-k="paidWith"]):not([data-k="fund"]):not([data-k="recur"]):not([data-k="account"]):not([data-k="transfer"]):not([data-k="transferTo"]) {
    display: none;
  }
  /* An internal transfer says so and where it went, in place of its category (it isn't spending) */
  .log-list .pcard .pcard-chips:has(.chip[data-k="transfer"]) .chip[data-k="category"] {
    display: none;
  }
}

/* A fixed bill: whether it came in as planned, in place of a share ring */
.log-plan {
  justify-self: start;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.log-plan.ok {
  background: var(--select-glass);
  color: var(--good-text);
}

.log-plan.over {
  background: var(--bad-soft);
  color: var(--bad-text);
}

/* Each kind its own colour: expenses the plain glass, income the income blue, readings amber */
:root {
  --log-reading: #e0a84e;
}





.log-list .pcard.log-income.glass,
.log-list .pcard.log-income.glass:hover {
  background: color-mix(in srgb, var(--glass) 80%, var(--ring-inc) 20%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ring-inc) 45%, transparent), 0 8px 24px rgba(0, 0, 0, 0.1);
}

.log-list .pcard.log-income .pcard-amount {
  color: var(--ring-inc-text);
}

.log-list .pcard.log-refund.glass,
.log-list .pcard.log-refund.glass:hover {
  background: color-mix(in srgb, var(--glass) 78%, var(--select) 22%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--select) 55%, transparent), 0 8px 24px rgba(0, 0, 0, 0.1);
}

.log-list .pcard.log-refund .pcard-amount {
  color: var(--select);
}

/* An odometer reading: violet — a light tint, its rim, the km and the bar toward the next service */
.log-list .pcard.log-odometer {
  --odo: #b49cf0; /* violet, the user's pick */
}

.log-list .pcard.log-odometer.glass,
.log-list .pcard.log-odometer.glass:hover {
  background: color-mix(in srgb, var(--glass) 88%, var(--odo) 12%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--odo) 45%, transparent), 0 8px 24px rgba(0, 0, 0, 0.1);
}

.log-list .pcard.log-odometer .pcard-amount {
  color: var(--odo);
}

.log-list .pcard.log-odometer .lb-this {
  background: var(--odo);
  box-shadow: 0 0 10px color-mix(in srgb, var(--odo) 45%, transparent);
}

@media (max-width: 699px) {
  .log-totals {
    display: none;
  }

  /* A phone: the name over its pills on the left; the amount on the right, when it was paid
     under it. Delete is inside the card, once it's opened */
  .log-list .pcard-in {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "head money"
      "chips money";
    column-gap: 12px;
  }

  .log-list .pcard-in:has(.pcard-note:not([hidden])) {
    grid-template-areas:
      "head money"
      "chips money"
      "note note";
  }

  /* A phone has the swipes (left deletes, right refunds), so no buttons on the card */
  .log-list .pcard-acts,
.log-list .pcard-rings {
    display: none;
  }

  .log-list .pcard-amount {
    font-size: 20px;
  }

  /* A phone has no bar: an expense's verdict sits under its amount instead (the user, 2026-10-08) —
     "As planned", "213 left this week", "Over by 120" and "Unplanned" in red */
  .log-list .pcard-money:has(.lb-say) {
    row-gap: 3px;
  }

  .lb-say {
    display: block;
    color: var(--text-2);
    font-size: 11.5px;
    font-weight: 650;
    white-space: nowrap;
  }

  .lb-say .bad {
    color: var(--bad-text);
  }
}

/* A wide screen has the bar across the card, its verdict in it: the phone's stays hidden */
@media (min-width: 700px) {
  .lb-say {
    display: none;
  }
}

/* The entry's sheet: the Plan card's rows, on a rounded sheet like the Log's */
#entry-edit {
  width: min(460px, calc(100vw - 32px));
  border-radius: var(--r-lg);
}

#entry-edit .sheet-body {
  display: grid;
  gap: 10px;
}

#entry-edit .rule-field[hidden] {
  display: none;
}

#entry-edit .rule-field > .ctl {
  width: 190px;
}

#entry-edit .combo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 190px;
}

#entry-edit .combo .ctl {
  flex: 1;
  min-width: 0;
  width: auto;
}

#entry-edit .combo .ctl-cur {
  flex: none;
  width: 76px;
}

#entry-edit .combo .cur {
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.ee-raw {
  margin: 0 4px;
  color: var(--text-3);
  font-size: var(--fs-xs);
}

/* The edit sheet's Delete and Refund: icons. The bin asks twice — armed, it's filled red. */
#entry-edit .cap-foot {
  gap: 8px;
}

#entry-edit .cap-foot .summary {
  min-width: 0;
}

.round-btn.ee-icon {
  flex: none;
  width: 44px;
  height: 44px;
  background: var(--raised);
}

.round-btn.ee-icon.danger {
  background: var(--bad-soft);
  color: var(--bad-text);
}

#ee-delete.armed {
  background: var(--bad);
  color: var(--bad-ink);
}

#ee-refund:disabled {
  opacity: 0.4;
}

/* No sideways scroll inside a sheet, whatever its width */
.sheet-inner {
  overflow-x: hidden;
}

/* The refund sheet: rounded like the entry's, and everything on the middle line */
#refund-sheet {
  width: min(380px, calc(100vw - 32px));
  border-radius: var(--r-lg);
}

#refund-sheet .sheet-inner {
  border-radius: var(--r-lg);
}

#refund-sheet .sheet-head {
  position: relative;
  justify-content: center;
  padding-left: 60px;
  padding-right: 60px;
  min-height: 72px;
}

#refund-sheet .sheet-head h2 {
  font-size: var(--fs-md, 18px);
  flex: 0 1 auto;
  min-width: 0;
  text-align: center;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

#refund-sheet .sheet-head .round-btn {
  position: absolute;
  top: var(--sp-5);
  right: var(--sp-5);
}

#refund-sheet .sheet-body {
  justify-items: center;
  text-align: center;
}

#refund-sheet .rule-fields {
  width: 100%;
}

#refund-sheet .rule-field {
  justify-content: center;
  gap: 16px;
}

#refund-sheet .combo {
  justify-content: center;
  width: auto;
}

#refund-sheet .combo .ctl {
  width: 150px;
  text-align: center;
}

#refund-sheet .cap-foot {
  justify-content: center;
}

@media (max-width: 699px) {
  #entry-edit .rule-field > .ctl,
#entry-edit .combo {
    width: 170px;
  }
}

/* Each ring's caption says what it's a share of, with the room its column has */
.log-list .pring-pair .pring-cap {
  max-width: none;
}


/* ---------- Transactions › Overview (Step 4) ---------- */

/* Four figures across, then how far through the month against how much of the plan has gone.
   A phone has them two by two. */
.ov-mount {
  display: grid;
  gap: 14px;
}

.ov-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

/* The verdict is words, not a figure */
.pcard.ov-verdict .pcard-amount {
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.15;
}

.pcard.ov-verdict.ok .pcard-amount {
  color: var(--good-text);
}

.pcard.ov-verdict.above .pcard-amount {
  color: var(--log-reading);
}

.pcard.ov-verdict.over .pcard-amount {
  color: var(--bad-text);
}

/* Over: only the amount is red — the card keeps its normal glass rim */

.pcard.ov-progress {
  cursor: default;
  display: grid;
  gap: 12px;
  padding: var(--g-pad-t) var(--g-pad-x) var(--g-pad-b); /* the same edges as the figure cards above it */
}

.pcard.ov-progress:hover {
  background: var(--glass);
}

.ov-bars {
  display: grid;
  gap: 10px;
}

.ov-bar {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.ov-bar-label {
  color: var(--text-2);
  font-weight: 650;
}

.ov-bar-pct {
  color: var(--text);
  font-weight: 750;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ov-track {
  height: 10px;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: var(--raised);
}

.ov-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.ov-fill.time {
  background: var(--ring-inc);
}

.ov-fill.spent {
  background: var(--good);
}

.ov-fill.spent.past {
  background: var(--bad);
}

@media (max-width: 699px) {
  .ov-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .ov-mount {
    gap: 10px;
  }

  .ov-bar {
    grid-template-columns: 92px minmax(0, 1fr) 38px;
    gap: 8px;
    font-size: 12px;
  }
}

/* ---------- Transactions › Overview: Payments and Breakdown (Step 4) ---------- */

/* Each part under its own heading; Breakdown's switch sits at the heading's right */
.ov-head {
  margin: 18px 4px 2px;
}

.ov-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  margin-bottom: 2px;
}

.ov-head-row .ov-head {
  margin: 0 0 0 4px;
}

.ov-head-row .block-title:first-child {
  margin-top: 0;
}

.ov-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  align-items: start;
}

.ov-list .card-head .aside {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ov-none {
  margin: 2px 0 0;
  font-size: 13px;
}

/* A payment: its name and when, then what it cost against its plan */
.pay-list {
  display: grid;
}

.pay-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name amt"
    "when amt";
  align-items: center;
  column-gap: 12px;
  row-gap: 2px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.pay-row:first-child {
  border-top: 0;
  padding-top: 2px;
}

.pay-name {
  grid-area: name;
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pay-when {
  grid-area: when;
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 600;
}

.pay-amt {
  grid-area: amt;
  display: grid;
  justify-items: end;
  gap: 3px;
  font-size: 15px;
  font-weight: 750;
}

.pay-of {
  color: var(--text-2);
  font-size: 15px;
  font-weight: 750;
}

.pay-tag {
  justify-self: start;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.pay-amt .pay-tag {
  justify-self: end;
}

.pay-tag.ok {
  background: var(--select-glass);
  color: var(--good-text);
}

.pay-tag.over {
  background: var(--bad-soft);
  color: var(--bad-text);
}

.pay-tag.under {
  background: var(--raised);
  color: var(--text-2);
}

.pay-tag.gap {
  background: color-mix(in srgb, var(--log-reading) 18%, transparent);
  color: var(--log-reading);
  white-space: normal;
}

.ov-overdue {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 50%, transparent), 0 8px 24px rgba(0, 0, 0, 0.1);
}

.ov-overdue .card-title {
  color: var(--bad-text);
}

/* The unplanned: a question each — a one-off, or a line? */
.pay-row.unpl {
  grid-template-areas:
    "name amt"
    "when amt"
    "gap gap"
    "acts acts";
}

.pay-gap {
  grid-area: gap;
  margin-top: 4px;
}

.pay-acts {
  grid-area: acts;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 6px;
}

.pay-acts .btn.sm {
  height: 30px;
  padding: 0 12px;
  font-size: 11px;
}

/* Breakdown: spent against planned, a row each */
.ov-variance {
  grid-column: 1 / -1;
}

.bd-table {
  display: grid;
}

.bd-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.3fr) minmax(80px, 2fr) 90px 90px 120px;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}

.bd-row:first-child {
  border-top: 0;
}

.bd-head {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bd-name {
  min-width: 0;
  overflow: hidden;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bd-num {
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bd-var {
  justify-self: end;
  text-align: right;
}

.bd-left {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 650;
}

.bd-table.sub .bd-row {
  grid-template-columns: minmax(110px, 1.3fr) minmax(80px, 2fr) 90px 160px;
}

/* Reconcile: two balances, then whether the ledger agrees */
.rec-fields {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.rec-fields .ov-bal {
  width: 150px;
  text-align: right;
}

.rec-verdict {
  margin: 4px 0 8px;
  font-size: 13.5px;
  font-weight: 650;
}

.rec-verdict.ok {
  color: var(--good-text);
}

.rec-verdict.over {
  color: var(--bad-text);
}

.rec-verdict.above {
  color: var(--log-reading);
}

.rec-sum {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  color: var(--text-2);
  font-size: 12.5px;
}

.rec-sum .num {
  text-align: right;
  font-weight: 700;
}

.rec-sum span:nth-last-child(-n + 2) {
  padding-top: 4px;
  border-top: 1px solid var(--line);
  color: var(--text);
}

.ov-cuts {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 50%, transparent), 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* Cuts: the page's width; how short the month is, big and red, "short in October" under it; each cut's
   amount, typed over on a wide screen, with APPROVE / REJECT (red) beside it; a phone swipes the row
   instead — right approves, left rejects (the user, 2026-10-09) */
.ov-cuts {
  grid-column: 1 / -1;
}

.cuts-short {
  display: grid;
  justify-items: start;
  gap: 2px; /* "short in October" under the figure, on a phone and a wide screen (the user, 2026-10-09) */
  margin: 2px 0 12px;
}

.cuts-fig {
  color: var(--bad-text);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.cuts-fig small {
  margin-left: 6px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.cuts-sub {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 650;
}

.cut-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "name amt acts"
    "when amt acts";
  column-gap: 16px;
  padding: 12px 0;
}

.cut-row .pay-name {
  white-space: normal;
}

.cut-swipe:first-child .cut-row {
  border-top: 0;
}

.cut-acts {
  grid-area: acts;
  display: flex;
  gap: 8px;
}

.cut-btn.btn.sm {
  height: 32px;
  min-width: 96px;
  padding: 0 14px;
  font-size: 10.5px;
}

/* The amount is typed over (Home's bill amounts, .due-amt), on a phone too (the user, 2026-10-09) */
.cut-row .pay-amt {
  align-content: center;
}

.cut-amt.due-amt {
  width: 9ch;
  height: 34px;
  background: var(--recessed); /* always looks typeable, not only on hover */
  font-size: 15px;
}

.cut-swipe {
  position: relative;
}

.cut-swipe-yes,
.cut-swipe-no {
  display: none;
}

/* Under 700px the buttons are a tick and a cross, 36px round, down to 450px; under that the row swipes (the user, 2026-10-09) */
.cut-btn .icon {
  display: none;
}

@media (max-width: 699px) {
  .cuts-fig {
    font-size: 34px;
  }

  .cut-row {
    column-gap: 12px;
  }

  .cut-btn.btn.sm {
    display: grid;
    place-items: center;
    width: 36px;
    min-width: 0;
    height: 36px;
    padding: 0;
    border-radius: 50%;
  }

  .cut-btn .icon {
    display: block;
    width: 18px;
    height: 18px;
    stroke-width: 2.4;
  }

  .cut-word {
    display: none;
  }
}

@media (max-width: 449px) {
  /* A phone: no buttons — the row swipes: right approves (lime) what's typed, left rejects (red, the user, 2026-10-09) */
  .cut-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name amt"
      "when amt";
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
  }

  .cut-acts {
    display: none;
  }

  /* the row can't be selected (it swipes), but its amount can be typed and selected */
  .cut-amt.due-amt {
    -webkit-user-select: text;
    user-select: text;
  }

  .cut-swipe-yes,
  .cut-swipe-no {
    position: absolute;
    top: 4px;
    bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 14px;
    transition: background 0.15s, color 0.15s;
  }

  .cut-swipe-yes {
    left: 0;
    width: var(--cx, 0px);
    background: color-mix(in srgb, var(--select) 30%, transparent);
    color: var(--select);
  }

  .cut-swipe-no {
    right: 0;
    width: var(--cxl, 0px);
    background: var(--bad-soft);
    color: var(--bad-text);
  }

  .cut-swipe .icon {
    width: 26px;
    height: 26px;
    flex: none;
  }

  .cut-swipe.past-yes .cut-swipe-yes {
    background: var(--select);
    color: var(--select-ink);
  }

  .cut-swipe.past-no .cut-swipe-no {
    background: var(--bad);
    color: var(--bad-ink);
  }
}


/* Home › What would fix it — leads Insights, the page's width (an insight row shares one height, so it
   stands on its own): the figure now, every cut on a line, the figure after (the user, 2026-10-09).
   A wide card runs the line straight, or winds it like a snake when the cuts don't fit one line — an odd
   number of rows, so it ends on the right (app.js fitSnakes); a phone runs it down the left, from beside
   the figure now into the figure after, the cuts centred between them and the figure after beside SEE
   THE CUTS. Nothing here blurs in private mode (the user, 2026-10-09). */
.insight.ins-cuts {
  min-width: 0;
  margin-bottom: 14px;
}

.snake {
  --sn-line: rgba(255, 255, 255, 0.24);
  position: relative;
  min-width: 0;
  contain: inline-size; /* its width is the card's, never its contents' */
}

.sn-probe {
  display: flex;
  align-items: center;
  width: max-content;
  visibility: hidden;
}

.sn-fig {
  display: grid;
  gap: 1px;
}

.sn-fig b {
  color: var(--bad-text);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.sn-fig b.ok {
  color: var(--good-text);
}

.sn-fig small {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 650;
}

.sn-pill {
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, var(--good) 35%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--good) 14%, #15190f);
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.sn-pill b {
  margin-left: 4px;
  color: var(--good-text);
  font-weight: 800;
}

/* wide: rows, the line through the middle of each, turning at the edge into the next */
.snake.sn-rows {
  display: grid;
  gap: 14px;
}

.sn-row {
  position: relative;
  display: flex;
  align-items: center;
}

.sn-row.rev {
  flex-direction: row-reverse;
}

.sn-row.pad-r {
  padding-right: 18px;
}

.sn-row.pad-l {
  padding-left: 18px;
}

.sn-seg {
  flex: 1 1 22px;
  min-width: 22px;
  height: 2px;
  background: var(--sn-line);
}

.sn-row .sn-start + .sn-seg {
  margin-left: 12px;
}

/* the arrowhead, then room before the figure after */
.sn-seg.to {
  position: relative;
  margin-right: 22px;
}

.sn-seg.to::after {
  content: "";
  position: absolute;
  top: -5px;
  right: -10px;
  border: 6px solid transparent;
  border-right: 0;
  border-left: 10px solid var(--sn-line);
}

.sn-row .sn-end {
  justify-items: end;
  text-align: right;
}

.sn-row.turn-r::after,
.sn-row.turn-l::after {
  content: "";
  position: absolute;
  top: calc(50% - 1px);
  width: 18px;
  height: calc(var(--turn-h, 40px) + 2px); /* + the border, so the bend lands on the next row's line */
  border: 2px solid var(--sn-line);
}

.sn-row.turn-r::after {
  right: 0;
  border-left: 0;
  border-radius: 0 16px 16px 0;
}

.sn-row.turn-l::after {
  left: 0;
  border-right: 0;
  border-radius: 16px 0 0 16px;
}

/* a phone: down the left, a hook into the figure after; the cuts centred between the two figures */
.snake.sn-col {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding-left: 26px;
}

.snake.sn-col .sn-start {
  margin-bottom: 22px;
}

.snake.sn-col::before {
  content: "";
  position: absolute;
  top: var(--s-mid, 20px);
  bottom: var(--e-mid, 20px);
  left: 0;
  width: 14px;
  border: 2px solid var(--sn-line);
  border-right: 0;
  border-radius: 12px 0 0 12px;
}

.snake.sn-col::after {
  content: "";
  position: absolute;
  bottom: calc(var(--e-mid, 20px) - 5px);
  left: 12px;
  border: 6px solid transparent;
  border-right: 0;
  border-left: 9px solid var(--sn-line);
}

.sn-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: 22px;
}

.sn-foot .insight-acts {
  margin: 0;
  padding: 0;
}

@media (max-width: 699px) {
  .insight.ins-cuts {
    margin-bottom: 10px;
  }
}


@media (max-width: 699px) {
  .ov-cards {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  /* A phone: the name and its bar on one line, the figures under it */
  .bd-row {
    grid-template-columns: minmax(0, 1fr) 80px;
    grid-template-areas:
      "name var"
      "bar bar"
      "spent planned";
    gap: 4px 10px;
  }

  .bd-row .bd-name { grid-area: name; }
  .bd-row .bd-bar { grid-area: bar; }
  .bd-row .bd-var { grid-area: var; }
  .bd-row .bd-num:nth-of-type(3) { grid-area: spent; text-align: left; }
  .bd-row .bd-num:nth-of-type(4) { grid-area: planned; }

  .bd-head {
    display: none;
  }

  .bd-table.sub .bd-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name var"
      "bar bar";
  }

  .bd-table.sub .bd-num {
    display: none;
  }

  .rec-fields .ov-bal {
    width: 130px;
  }
}

.bd-bar .ov-track {
  display: block;
}

/* Payments: five rows to a card, the rest scroll inside it (app.js fitPayments) */
.pay-list.scrolls {
  position: relative;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-right: -6px;
  padding-right: 6px;
  scrollbar-width: thin;
}

.pay-dots {
  display: none;
}

/* A phone: one card at a time, swiped sideways, the next one peeking in; a dot each under them */
@media (max-width: 699px) {
  .ov-cards.pay {
    display: flex;
    gap: 10px;
    margin: 0 -16px;
    padding: 0 16px 2px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 16px;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .ov-cards.pay::-webkit-scrollbar {
    display: none;
  }

  .ov-cards.pay > .ov-list {
    flex: 0 0 calc(100% - 22px);
    scroll-snap-align: start;
  }

  .pay-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: -2px;
  }

  .pay-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--line-strong);
    transition: background 0.2s, width 0.2s;
  }

  .pay-dots span.on {
    width: 16px;
    border-radius: var(--r-pill);
    background: var(--select);
  }
}

/* Payments' cards all as tall as the tallest */
.ov-cards.pay {
  align-items: stretch;
}

/* A phone: each Payments card takes the full width, nothing of the next one showing */
@media (max-width: 699px) {
  .ov-cards.pay {
    gap: 32px;
    scroll-padding: 0;
  }

  .ov-cards.pay > .ov-list {
    flex: 0 0 100%;
    scroll-snap-align: center;
  }
}

/* The Plan's table: whatever's been paid has its figure in lime — the month's figure in the
   year, the row's figure in a single month. The cell itself stays as it is. */
.edit-grid tr.line > td.cell.paid .cell-in,
.edit-grid tr.line > td.calc.paid,
.edit-grid.one-month tr.line.paid td.cell.money .cell-in {
  color: var(--good-text);
  font-weight: 750;
}

/* Paid with nothing planned: the paid figure in orange (Streak's), not lime — it wasn't in the plan
   (user, 2026-10-06) */
.edit-grid tr.line > td.cell.took .cell-in::placeholder,
.edit-grid tr.line > td.calc.took {
  color: #ff9a3d;
  font-weight: 750;
}

.ov-cards.pay {
  position: relative; /* the cards' offsets are measured from the strip (app.js) */
}

/* ---------- Tracker (Step 5) ---------- */

.pcard.log-total.warn .pcard-amount {
  color: var(--log-reading);
}

/* The loan's path to zero: a timeline — a mark a year, prominent, what's still owed when the year
   ends under it. Across on a wide screen, down on a phone. */
.timeline {
  position: relative;
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.tl-step {
  position: relative;
  display: grid;
  grid-template-rows: 26px 16px auto auto;
  justify-items: center;
  row-gap: 8px;
  text-align: center;
}

/* The line between one mark and the next, under the marks */
.tl-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: calc(26px + 8px + 7px);
  left: 50%;
  right: -50%;
  height: 2px;
  background: var(--line-strong);
}

.tl-year {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 26px;
  font-variant-numeric: tabular-nums;
}

.tl-dot {
  position: relative;
  z-index: 1;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--glass-solid);
  box-shadow: inset 0 0 0 2px var(--text-3);
}

.tl-amt {
  font-size: var(--g-ins-amt);
  font-weight: 750;
  white-space: nowrap;
}

.tl-amt .cur {
  margin-left: 4px;
  color: var(--text-3);
  font-size: 0.72em;
  font-weight: 700;
}

.tl-sub {
  margin-top: -6px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 650;
}

.tl-step.now .tl-year {
  color: var(--text-2);
}

.tl-step.now .tl-dot {
  background: var(--good);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 25%, transparent);
}

.tl-step.this .tl-dot {
  box-shadow: inset 0 0 0 2px var(--good);
}

.tl-step.clear .tl-year,
.tl-step.clear .tl-amt {
  color: var(--good-text);
}

.tl-step.clear .tl-dot {
  background: var(--good);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 25%, transparent);
}

@media (max-width: 699px) {
  .timeline {
    grid-auto-columns: auto;
    grid-auto-flow: row;
  }

  .tl-step {
    grid-template-columns: 56px 16px minmax(0, 1fr);
    grid-template-rows: 26px auto;
    grid-template-areas:
      "year dot amt"
      ". . sub";
    column-gap: 14px;
    row-gap: 0;
    align-items: center;
    justify-items: start;
    padding-bottom: 16px;
    text-align: left;
  }

  .tl-step:last-child {
    padding-bottom: 0;
  }

  .tl-year { grid-area: year; }
  .tl-dot { grid-area: dot; }
  .tl-amt { grid-area: amt; }
  .tl-sub { grid-area: sub; margin: 0; }

  .tl-step:not(:last-child)::after {
    top: 13px;
    bottom: -13px;
    left: calc(56px + 14px + 7px);
    right: auto;
    width: 2px;
    height: auto;
  }
}

/* Tracker › Cards: a card each, one under the other — on a phone one at a time, swiped sideways */
.card-strip {
  position: relative; /* the slides' offsets are measured from the strip (app.js) */
  display: grid;
  gap: 14px;
}

.card-slide {
  display: grid;
  gap: 14px;
  min-width: 0;
}

@media (max-width: 699px) {
  .card-strip {
    display: flex;
    gap: 32px;
    align-items: start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .card-strip::-webkit-scrollbar {
    display: none;
  }

  .card-slide {
    flex: 0 0 100%;
    gap: 10px;
    scroll-snap-align: center;
  }

  /* Above the strip, so it shows there's another card before scrolling down to it */
  .card-dots {
    margin: 4px 0 -4px;
  }
}

/* The loan's path to zero: a bar a year */
.bd-row.loan-row {
  grid-template-columns: minmax(90px, 1fr) minmax(80px, 3fr) 110px;
}

.loan-free {
  margin: 2px 0 0;
  font-size: 14px;
  line-height: 1.5;
}

/* A card's cycle: where today sits between its start and its closing */
.card-cycle {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.card-cycle .ov-bar {
  grid-template-columns: 120px minmax(0, 1fr) 44px;
}

.card-dates {
  margin: 4px 0 0;
  font-size: 12.5px;
}

.card-past {
  margin-top: 10px;
}

/* The car: Done sits under the next service's figures */
.pcard.ov-card .car-done {
  justify-self: start;
  margin-top: 10px;
  height: 30px;
  padding: 0 14px;
  font-size: 11px;
}

.gap-tag {
  color: var(--log-reading);
  font-weight: 700;
}

button.pay-row.odo-row {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

button.pay-row.odo-row:first-child {
  border-top: 0;
}

.ov-list > .btn.sm {
  justify-self: start;
  margin-top: 10px;
  height: 30px;
  padding: 0 14px;
  font-size: 11px;
}

/* The schedule: service, predicted date, cost, status */
.bd-row.sched-row {
  grid-template-columns: 90px minmax(120px, 1.4fr) 80px minmax(110px, 1fr);
}

.sched-when {
  font-size: 13px;
  font-weight: 600;
}

.sched-when s {
  color: var(--text-3);
  font-weight: 500;
}

.bd-row.sched-row.done .bd-name,
.bd-row.sched-row.done .sched-when {
  color: var(--text-3);
}

@media (max-width: 699px) {
  .car-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .bd-row.loan-row {
    grid-template-columns: minmax(0, 1fr) 100px;
    grid-template-areas:
      "name num"
      "bar bar";
  }

  .bd-row.loan-row .bd-name { grid-area: name; }
  .bd-row.loan-row .bd-bar { grid-area: bar; }
  .bd-row.loan-row .bd-num { grid-area: num; text-align: right; }

  .bd-row.sched-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name var"
      "when cost";
  }

  .bd-row.sched-row .bd-name { grid-area: name; }
  .bd-row.sched-row .sched-when { grid-area: when; }
  .bd-row.sched-row .bd-num:nth-of-type(3) { grid-area: cost; }
  .bd-row.sched-row .bd-var { grid-area: var; }
}

.fix-steps {
  margin: -2px 0 10px;
  padding-left: 18px;
  font-size: 13.5px;
  line-height: 1.6;
}

/* A page with no period (Tracker) has no month to step through: its arrows stay hidden on a
   wide screen too, where the round buttons are laid out as a grid */
.picker-step[hidden] {
  display: none !important;
}

/* The car's four figures, two to a row: Odometer and Next Service, then Fund and Papers (the user, 7 Oct) */
.ov-grid.car-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* A card's charges, behind a button each */
.card-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.card-btns .btn.sm {
  height: 30px;
  padding: 0 12px;
  font-size: 11px;
}

.card-btns .btn.sm.on {
  background: var(--select-glass);
  box-shadow: inset 0 0 0 1px var(--select);
  color: var(--text);
}

.card-charges {
  margin-top: 8px;
}

@media (max-width: 699px) {
  .ov-grid.car-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* A phone: a section's switch (Tracker › Cards: All · Platinum · Explore) gets a row of its own
   under the section pills, rather than running off the edge beside them */
@media (max-width: 699px) {
  .pills-host:has(.section-controls:not([hidden])) {
    flex-wrap: wrap;
  }

  .row-right:has(.section-controls:not([hidden])) {
    flex: 1 0 100%;
    min-width: 0;
    margin-left: 0;
  }

  .section-controls:not([hidden]) {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
}

/* The question after changing an amount never runs past the screen; on a phone it's a bar
   across the bottom, just above the dock (plan-view.js askCarry) */
.carry {
  max-width: min(520px, calc(100vw - 32px));
}

.carry.sheet {
  left: 16px;
  right: 16px;
  top: auto;
  bottom: calc(var(--dock-h) + 36px);
  max-width: none;
}

.carry.sheet .carry-btns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.carry.sheet .carry-btns .btn {
  height: 42px;
  white-space: normal;
}

/* Under an open card's amount it takes the amount box's width (plan-view.js askCarry) */
.carry[style*="width"] {
  max-width: none;
}

/* ---------- The Plan's cards: a bill paid, or past due and not (plan-view.js billState) ---------- */

/* Paid: a lime rim, "Paid Oct 1" where the due date was, the amount at full strength, and one ring
   of paid against planned — lime up to the plan, red past it */
.pcard.bill-paid .pcard-amount {
  color: var(--text);
}

.pcard .pcard-due.paid-chip {
  background: var(--select-glass);
  color: var(--good-text);
}

.pcard .pring.paid-ring .pring-fill {
  stroke: var(--good);
}

.pcard .pring.paid-ring.over .pring-fill {
  stroke: var(--bad);
}

.pcard-logged .over {
  color: var(--bad-text);
}

/* Past due: a red rim, the due date in red, "Overdue · N days" in red under the amount; Mark as
   paid stays a small lime icon */
.pcard .pcard-due.late-chip {
  background: var(--bad-soft);
  color: var(--bad-text);
}

.pcard-logged .late-pill {
  color: var(--bad-text);
  font-weight: 700;
}

:root .pcard .pcard-pay.late {
  width: 30px !important;
  padding: 0 !important;
  background: var(--select-glass);
  color: var(--good-text);
  box-shadow: inset 0 0 0 1px var(--select-rim);
}

:root .pcard .pcard-pay.late > span {
  display: none !important;
}

@media (min-width: 700px) {
  .pcard.bill-paid.glass,
.pcard.bill-paid.glass:hover {
    box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--good) 70%, transparent), 0 8px 24px rgba(0, 0, 0, 0.12);
  }

  .pcard.bill-late.glass,
.pcard.bill-late.glass:hover {
    box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--bad) 70%, transparent), 0 8px 24px rgba(0, 0, 0, 0.12);
  }
}

/* A phone: the paid card keeps its lime line round the edge (the hold's), and a past-due one gets
   the same line in red */
@media (max-width: 699px) {
  .pcard.bill-late .pcard-hold rect {
    stroke: var(--bad);
    stroke-dashoffset: 0;
    opacity: 1;
    transition: none;
  }
}

/* The wording under a card's amount sits up against it (the amount's line runs tall) */
.pcard-money .pcard-amount + .pcard-logged {
  margin-top: calc(var(--card-amount, 32px) * -0.1);
}

/* A ring reading 100% or more: a size down, so it fits inside */
.pring b.wide {
  font-size: calc(var(--ring, 38px) * 0.21);
  letter-spacing: -0.04em;
}

/* The date as the first pill: a phone always; a wide screen only on cards that gave up the date
   beside the name for lack of room (no-due), so the date never disappears */
.pcard .pcard-chips .chip.due-m {
  display: none;
}

:root .pcard.no-due .pcard-chips .chip.due-m[data-k="dueM"] {
  display: inline-flex;
}

:root .pcard.no-due .pcard-chips .chip.due-m.ok {
  background: var(--select-glass);
  border-color: transparent;
  color: var(--good-text);
}

:root .pcard.no-due .pcard-chips .chip.due-m.late {
  background: var(--bad-soft);
  border-color: transparent;
  color: var(--bad-text);
}

@media (max-width: 699px) {
  .pcard .pcard-chips .chip.due-m[data-k="dueM"] {
    display: inline-flex;
  }

  .pcard .pcard-chips .chip.due-m.ok {
    background: var(--select-glass);
    border-color: transparent;
    color: var(--good-text);
  }

  .pcard .pcard-chips .chip.due-m.late {
    background: var(--bad-soft);
    border-color: transparent;
    color: var(--bad-text);
  }
}

/* A phone: past due shows as a red ! on the corner of the card's icon (the name keeps its room); a paid card
   has no mark of its own any more (15 Oct) — its lime wash says it */
@media (max-width: 699px) {
  .pcard.bill-late .item-ic {
    position: relative;
    overflow: visible;
  }

  .pcard.bill-late .item-ic::after {
    position: absolute;
    right: -5px;
    bottom: -5px;
    display: grid;
    place-items: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--glass-solid);
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
  }

  .pcard.bill-late .item-ic::after {
    content: "!";
    background: var(--bad);
    color: var(--bad-ink);
  }
}

/* A phone: a card's pills stay on one line; what doesn't fit drops out on every card alike
   (fitPills), the date first to stay */
@media (max-width: 699px) {
  .card-pages .pcard .pcard-chips {
    max-height: 22px;
    overflow: hidden;
    margin-top: 14px; /* 9px clear of the paid / late badge on the icon's corner */
  }
}

/* No pill left on any card of the page: the empty row takes no room (plan-view.js fitPills) */
.pcard .pcard-chips.empty {
  display: none;
}

/* The paid date says "Paid" only when the button beside it doesn't: once the button shows its
   word (PAID), the chip is just the date */
@container (min-width: 380px) {
  :root:not([data-card-paywords="off"]) .pcard .paid-chip .pc-word {
    display: none;
  }
}

:root .pcard.no-words .paid-chip .pc-word {
  display: inline !important;
}

/* No pills on the page: the amount (and whatever's under it) sits in the middle of the room
   between the name and the rings, instead of rising to the top of it */
@media (min-width: 700px) {
  .card-pages .pcard:has(.pcard-chips.empty) .pcard-money {
    align-self: center;
  }
}

/* A phone's card is a column: there align-self is the sideways axis, so the amount is centred up and down with
   auto margins and stays on the left like the cards that show pills (17 Oct, the user's call) */
@media (max-width: 699px) {
  .card-pages .pcard:has(.pcard-chips.empty) .pcard-money {
    align-self: flex-start;
    margin-bottom: auto;
  }

  .card-pages .pcard:has(.pcard-chips.empty) .pcard-rings {
    margin-top: 0; /* the amount's two auto margins share the room, so it sits in the middle */
  }
}

/* What's been logged under the amount: one line. A wide card runs its pieces together with a
   dot between; a phone keeps only the first, in its shorter wording */
.pcard-logged .lg-short {
  display: none;
}

.card-pages .pcard .pcard-logged {
  flex-direction: row;
  flex-wrap: nowrap;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  display: block;
}

.card-pages .pcard .pcard-logged > span {
  display: inline;
}

.card-pages .pcard .pcard-logged > span + span::before {
  content: " · ";
  color: var(--text-3);
}

@media (max-width: 699px) {
  .card-pages .pcard .pcard-logged > span + span {
    display: none;
  }

  .card-pages .pcard .pcard-logged .lg-long {
    display: none;
  }

  .card-pages .pcard .pcard-logged .lg-short {
    display: inline;
  }
}

.card-pages .pcard .pcard-money {
  min-width: 0;
  max-width: 100%;
}

/* A piece of the logged line that didn't fit, and the first piece's shorter wording when even
   that is too long (plan-view.js fitLogged) */
.card-pages .pcard .pcard-logged > .lg-off {
  display: none !important;
}

.card-pages .pcard .pcard-logged.lg-tight .lg-long {
  display: none;
}

.card-pages .pcard .pcard-logged.lg-tight .lg-short {
  display: inline;
}

/* Rings on a tight card: a size down, then another; their captions on one line (fitRings) */
.card-pages .pcard .pcard-rings .pring-cap {
  white-space: nowrap;
}

.card-pages .pcard .pcard-rings.rings-tight .pring {
  --ring: calc(var(--card-ring, 38px) * 0.8) !important;
}

.card-pages .pcard .pcard-rings.rings-tight .pring-cap {
  font-size: 10px;
}

.card-pages .pcard .pcard-rings.rings-tighter .pring {
  --ring: calc(var(--card-ring, 38px) * 0.66) !important;
}

.card-pages .pcard .pcard-rings.rings-tighter .pring-cap {
  font-size: 9.5px;
}

.card-pages .pcard .pcard-rings.rings-tight .pring-pair,
.card-pages .pcard .pcard-rings.rings-tighter .pring-pair {
  gap: 5px;
}

/* ---------- Home (Step 6) ---------- */

/* At a glance: four tall cards in three blocks — title, main number (with its note), supporting
   insight. The cards share their rows (subgrid), so each block starts at the same height on every
   card of a row. Every size is a setting below, so they can be tuned in one place. */
:root {
  /* The card */
  --g-pad: 25px;              /* padding round the card (the three below win) */
  --g-pad-t: 22px;
  --g-pad-b: 25px;
  --g-pad-x: 27px;
  --g-gap: 20px;              /* between the three blocks */
  --g-insight: 40px;          /* the insight block's least height */
  /* Block 1: the title */
  --g-title: 19px;
  --g-title-mt: 0px;
  --g-title-mb: 0px;
  /* Block 2: the main number */
  --g-num: 35px;
  --g-unit: 14px;             /* EGP, days */
  --g-note: 13px;             /* the line under the number */
  --g-num-gap: 8px;           /* between the number and its note */
  --g-num-mt: 0px;
  --g-num-mb: 9px;
  /* Block 3: the supporting insight */
  --g-ins-name: 15.5px;       /* every name in an insight (Upcoming's list, a card's) */
  --g-ins-amt: 15.5px;        /* every amount in an insight, with its EGP */
  --g-ring-name: 12px;        /* the names under Allowance's rings — their own, smaller */
  --g-row-gap: 10px;
  --g-ring: 53px;
  --g-ring-in: 0.26;          /* the figure inside a ring, as a share of the ring */
  --g-bar-w: 22px;            /* Streak's bars */
  --g-bar-h: 75%;
  --g-bar-gap: 2px;
  --g-ins-mt: 0px;
  --g-ins-mb: 0px;
  --g-word: 24px;             /* a main "number" that's words (Verdict) */
}

.ov-grid.glances {
  grid-auto-rows: auto auto minmax(0, 1fr);
  row-gap: 0;
}

/* Under 1100px wide, four across is too tight: two to a row */
@media (max-width: 1099px) {
  .ov-grid.glances {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ov-grid.glances .pcard.glance {
  grid-row: span 3;
  display: grid;
  grid-template-rows: subgrid;
  row-gap: var(--g-gap);
  align-items: start;
  margin-bottom: 14px;
  padding: var(--g-pad-t, var(--g-pad)) var(--g-pad-x, var(--g-pad)) var(--g-pad-b, var(--g-pad));
}

/* Each block's own room above and below it (0 unless set) */
.glance .pcard-name {
  margin-top: var(--g-title-mt, 0px);
  margin-bottom: var(--g-title-mb, 0px);
}

.glance .pcard-money {
  margin-top: var(--g-num-mt, 0px) !important;
  margin-bottom: var(--g-num-mb, 0px) !important;
}

.glance .glance-viz {
  margin-top: var(--g-ins-mt, 0px);
  margin-bottom: var(--g-ins-mb, 0px);
}

.glance .pcard-name {
  font-size: var(--g-title);
  line-height: 1.2;
}

.glance .pcard-money,
.pcard.log-total.glance .pcard-money {
  min-width: 0;
  margin: 0;
  gap: var(--g-num-gap);
}

.glance .pcard-amount {
  white-space: nowrap;
}

/* One size for every card's main number, on every page — app.js sets a whole row smaller (--g-fit)
   when one of its numbers doesn't fit its card, so a row never mixes sizes. Words (a verdict) take
   their own, smaller size. */
.ov-grid.glances .pcard .pcard-amount {
  font-size: var(--g-fit, var(--g-num));
  line-height: 1;
}

.ov-grid.glances .pcard.g-words .pcard-amount {
  font-size: min(var(--g-fit, var(--g-num)), var(--g-word));
  line-height: 1.15;
  white-space: normal;
}

.glance .pcard-amount .cur {
  font-size: var(--g-unit);
}

.glance .pcard-vs {
  font-size: var(--g-note);
  line-height: 1.35;
}

/* The insight: under the number, from the top */
.glance-viz {
  align-self: stretch;
  display: grid;
  align-content: start;
  gap: var(--g-row-gap);
  min-height: var(--g-insight);
  container: glance-insight / inline-size; /* its text grows with its width (cqi); the card itself can't be a container — it shares its rows (subgrid) */
}

/* Streak: the days start where the other cards' insights start, and stand three quarters of the
   block — slim bars with room round them */
.glance-viz.fill {
  align-content: start;
  grid-template-rows: minmax(64px, var(--g-bar-h, 75%));
}

.glance-viz.fill .g-week {
  height: 100%;
}

/* Allowance and Cards: a ring each, side by side, from the top of the block — every ring in a
   column of the same width, so they sit evenly apart */
.g-rings {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  column-gap: 6px;
}

.g-ring {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  text-align: center;
}

.g-ring .pring {
  --ring: var(--g-ring) !important; /* over the ring's own size */
  width: var(--ring);
  height: var(--ring);
  margin-bottom: 4px;
}

.g-ring .pring svg {
  width: 100%;
  height: 100%;
}

/* No room for the rings side by side (a narrow card, any screen): a ring a row, its name beside it.
   The container is the insight block, not the card — a size container can't share its rows with
   its neighbours (subgrid). */
@media (min-width: 700px) {
@container glance-insight (max-width: 210px) {
  .g-rings {
    grid-auto-flow: row;
    gap: 8px;
  }

  .g-ring {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    column-gap: 10px;
    text-align: left;
  }

  .g-ring .pring {
    --ring: clamp(38px, 18cqi, 52px) !important;
    margin: 0;
  }

  .g-ring-name {
    text-wrap: nowrap;
    white-space: nowrap;
  }
}
}

/* A figure inside the ring rather than its share */
.g-ring .pring b.amt {
  font-size: calc(var(--ring) * var(--g-ring-in));
}

/* Home's rings are lime, the app's "good"; red when it's past */
.pring.good .pring-fill {
  stroke: var(--good);
  filter: url(#ring-glow);
}

.pring.good.over .pring-fill {
  stroke: var(--bad);
}

/* Cards: a row a card under the number — the card's name, then what its next statement will
   come to */
.g-cards .g-cards-list {
  grid-auto-flow: row;
  row-gap: var(--g-row-gap); /* the same as Upcoming's list */
}

.g-amt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 10px;
  min-width: 0;
}

.g-amt .g-ring-name {
  grid-row: 1;
  grid-column: 1;
  font-size: calc(var(--g-ins-name-size) * var(--g-k, 1));
}

.g-amt .g-amt-fig {
  grid-row: 1;
  grid-column: 2;
}

.g-amt-fig {
  color: var(--text);
  font-size: calc(var(--g-ins-amt-size) * var(--g-k, 1));
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.1;
  white-space: nowrap;
}

.g-amt-fig .cur {
  margin-left: 4px;
  color: var(--text-3);
  font-size: 0.72em; /* always under the figure it follows */
  font-weight: 700;
}

.g-amt.over .g-amt-fig {
  color: var(--bad-text);
}

/* One look for every insight: a name, and an amount with its currency — the same on every card.
   --g-k is app.js's shrink, when a row doesn't fit. */
.glance {
  --g-ins-name-size: var(--g-ins-name);
  --g-ins-amt-size: var(--g-ins-amt);
}

/* The name under a ring may take two lines (Social / Spending) */
.g-ring-name {
  max-width: 100%;
  color: var(--text-2);
  font-size: var(--g-name, calc(var(--g-ring-name) * var(--g-k, 1))); /* their own size; app.js sets --g-name smaller, for a whole row of rings, when a word doesn't fit */
  font-weight: 650;
  line-height: 1.2;
  overflow-wrap: normal;
  text-wrap: balance;
}



.g-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 8px;
  row-gap: 4px;
  font-size: calc(var(--g-ins-name-size) * var(--g-k, 1));
}

.g-name {
  overflow: hidden;
  color: var(--text-2);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.g-name small {
  color: var(--text-3);
  font-size: 0.88em;
  font-weight: 600;
}

.g-val {
  color: var(--text);
  font-size: calc(var(--g-ins-amt-size) * var(--g-k, 1));
  font-weight: 750;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.g-val .cur {
  margin-left: 4px;
  color: var(--text-3);
  font-size: 0.72em; /* always under the figure it follows */
  font-weight: 700;
}

/* A row's figure: red past its plan, lime when it's good news */
.g-row.over .g-val {
  color: var(--bad-text);
}

.g-row.ok .g-val {
  color: var(--good-text);
}

.g-none {
  margin: 0;
  font-size: var(--g-note);
}

/* A bar in parts (Left: bills and day-to-day), and a meter with a label at each end */
.g-bar,
.g-meter {
  display: grid;
  gap: 6px;
  margin-bottom: 2px;
}

.g-track {
  display: flex;
  gap: 3px;
  height: 10px;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--raised) 70%, transparent);
}

.g-seg {
  display: block;
  min-width: 6px;
  border-radius: var(--r-pill);
}

.g-meter .g-seg {
  flex: none;
}

.g-seg.time { background: var(--ring-inc); }
.g-seg.good { background: var(--good); }
.g-seg.bad { background: var(--bad); }
.g-seg.muted { background: color-mix(in srgb, var(--text-3) 35%, transparent); }

.g-ends {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-3);
  font-size: calc(var(--g-ins-name-size) * 0.8);
  font-weight: 650;
}

/* A card's own button (the car's DONE) sits under its insight */
.glance-viz > .btn.sm {
  justify-self: start;
  height: 30px;
  margin-top: 2px;
  padding: 0 14px;
  font-size: 11px;
}

/* The last seven days: a bar each, lit when something was logged */
.g-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--g-bar-gap);
}

.g-day {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 6px;
  min-height: 0;
}

.g-day i {
  justify-self: center;
  width: 60%; /* of its column: room round every bar, on any card */
  max-width: var(--g-bar-w, 20px);
  min-height: 26px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--raised) 70%, transparent);
}

.g-day.on i {
  background: var(--good);
}

.g-day.today i {
  box-shadow: 0 0 0 2px var(--glass-solid), 0 0 0 3.5px var(--text-3);
}

.g-day small {
  justify-self: center;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 700;
}

.g-day.today small {
  color: var(--text);
}

/* Streak past the week: a ring of seven segments that refills each Sunday, the days in the middle.
   A month adds an outer halo, a hundred days an inner dotted ring, a year a crown of ticks. */
.g-streak {
  --amb: #ff9a3d; /* the last six hours of a day with nothing logged; the last hour goes red */
}

.glance-viz.fill.ring {
  grid-template-rows: minmax(64px, 100%);
}

.sk-ring {
  position: relative;
  height: 100%;
  max-height: 150px;
  aspect-ratio: 1;
  margin: auto;
  align-self: center;
}

.sk-ring svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.sk-seg {
  fill: none;
  stroke: color-mix(in srgb, var(--raised) 70%, transparent);
  stroke-linecap: round;
}

.sk-seg.on {
  stroke: var(--good);
}

.sk-seg.now {
  filter: drop-shadow(0 0 3px var(--good));
}

.sk-halo {
  fill: none;
  stroke: var(--good);
  stroke-width: 1.1;
  opacity: 0.85;
}

.sk-halo.in {
  opacity: 0.5;
  stroke-dasharray: 1 2.2;
}

.sk-tick {
  stroke: var(--good);
  stroke-width: 0.8;
  stroke-linecap: round;
}

.sk-ring.t3 svg {
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--good) 45%, transparent));
}

.sk-ring.t4 svg {
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--good) 65%, transparent));
}

.sk-ring.t5 svg {
  filter: drop-shadow(0 0 9px color-mix(in srgb, var(--good) 80%, transparent));
}

.sk-ring.t5 .sk-seg.on {
  stroke: #f4ffc8;
}

.sk-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.sk-num b {
  color: var(--text);
  font-size: 30px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.sk-ring.t4 .sk-num b,
.sk-ring.t5 .sk-num b {
  font-size: 27px;
}

.sk-num small {
  margin-top: 3px;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Today still to log: its segment (or bar) dashed and pulsing; orange from 6 pm, red in the last hour */
.sk-seg.pend {
  stroke: var(--good);
  stroke-dasharray: 1.5 3;
  animation: sk-pulse 1.8s ease-in-out infinite;
}

.g-day.pend i {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--good);
  animation: sk-pulse 1.8s ease-in-out infinite;
}

.g-day.pend.amb i {
  box-shadow: inset 0 0 0 1.5px var(--amb);
}

.g-day.pend.crit i {
  box-shadow: inset 0 0 0 1.5px var(--bad);
}

.sk-ring.amb .sk-seg.pend,
.sk-ring.amb .sk-seg.on {
  stroke: var(--amb);
}

.sk-ring.crit .sk-seg.pend,
.sk-ring.crit .sk-seg.on {
  stroke: var(--bad);
}

.sk-ring.amb .sk-seg.pend,
.sk-ring.crit .sk-seg.pend,
.g-day.pend.amb i,
.g-day.pend.crit i {
  animation-duration: 1.1s;
}

.sk-ring.amb svg {
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--amb) 55%, transparent));
}

.sk-ring.crit svg {
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--bad) 55%, transparent));
}

.sk-ring.crit .sk-halo,
.sk-ring.crit .sk-tick {
  stroke: var(--bad);
  opacity: 0.4;
}

.sk-ring.amb .sk-num small,
.risk.amb .pcard-amount,
.risk.amb .pcard-vs {
  color: var(--amb);
}

.sk-ring.crit .sk-num small,
.sk-ring.crit .sk-num b,
.risk.crit .pcard-amount,
.risk.crit .pcard-vs {
  color: var(--bad-text);
}

@keyframes sk-pulse {
  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sk-seg.pend,
.g-day.pend i {
    animation: none;
  }
}

/* Coming up: Today leads, tomorrow and the week beside it; the rest of the month underneath */
.due-groups {
  display: grid;
  gap: 18px;
}

.due-top-row {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch; /* the two columns always one height */
}

.due-top-row.solo {
  grid-template-columns: minmax(0, 1fr);
}

/* Tomorrow and This week share the height beside Today, each growing with what it holds */
.due-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.due-side > .due-card {
  flex: 1 1 auto;
}

.due-group {
  display: grid;
  gap: 10px;
}

.due-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 30px;
}

.due-group > .due-head {
  margin: 0 4px;
}

.due-label {
  margin: 0;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.due-label.today {
  color: var(--good-text);
}

.due-count {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 650;
}

/* A card's PAY ALL / PAY SELECTED, when there's nothing for it to do (the button's own display
   would otherwise win over [hidden]) */
.due-all[hidden] {
  display: none;
}

.due-all.btn.sm {
  height: 30px;
  margin-left: auto;
  padding: 0 14px;
  font-size: 11px;
}

.due-card.card {
  gap: 0;
  padding: 14px 18px 8px;
}

/* The lead card: a lime edge; red when something's late */
.due-card.now.card {
  box-shadow: inset 0 0 0 1px var(--select-rim), var(--card-shadow);
}

.due-card.now.has-late.card {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 60%, transparent), var(--card-shadow);
}

.due-card .due-head {
  margin-bottom: 4px;
}

.due-none {
  padding: 8px 0 12px;
}

/* A row: tick, name and how (and when), the amount, the button */
.due-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.due-head + .due-line {
  border-top: 0;
}

.due-line.lead {
  padding: 10px 0;
}

.due-who {
  display: grid;
  min-width: 0;
}

.due-name {
  overflow: hidden;
  font-size: 14.5px;
  font-weight: 750;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.due-name,
.due-line.lead .due-name,
.due-row .due-name {
  font-size: var(--g-ins-name);
}

.due-line.on .due-name,
.due-row.on .due-name {
  color: var(--good-text);
}

.due-sub {
  overflow: hidden;
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.due-sub em {
  color: var(--text-2);
  font-style: normal;
  font-weight: 750;
}

.due-sub em.late {
  color: var(--bad-text);
}

/* The amount reads as the row's figure, and is typed over in place when the real one differs */
.due-amt {
  width: 7.5ch;
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 9px;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 750;
  text-align: right;
}

.due-amt:hover,
.due-amt:focus {
  background: var(--recessed);
}

.due-amt:focus {
  box-shadow: inset 0 0 0 1.5px var(--select-rim);
}

.due-amt,
.due-amt.sm,
.due-line.lead .due-amt {
  height: 34px;
  font-size: var(--g-ins-amt);
}

.due-amt::placeholder {
  color: var(--text-3);
  font-weight: 600;
}

.edited .due-amt {
  color: var(--log-reading);
}

.due-go.btn {
  flex: none;
}

.due-go .icon {
  display: none;
}

.due-go.btn.sm {
  height: 32px;
  padding: 0 13px;
  font-size: 10.5px;
}

/* Select: a round tick at the front */
.due-tick {
  flex: none;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}

.due-tick:hover {
  box-shadow: inset 0 0 0 1.5px var(--text-3);
}

.due-tick[aria-pressed="true"] {
  background: var(--select-glass) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c6f432' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat;
  box-shadow: inset 0 0 0 1.5px var(--good);
}

/* Later in the month: a row each in one card, the date in front */
.due-later.card {
  gap: 0;
  padding: 14px 18px 8px; /* the label is inside the card, like Today and Tomorrow */
}

.due-head + .due-row {
  border-top: 0;
}

.due-row {
  display: grid;
  grid-template-columns: auto 44px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.due-row:first-child {
  border-top: 0;
}

.due-date {
  display: grid;
  justify-items: center;
  line-height: 1.05;
}

.due-date b {
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.due-date small {
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
}



.due-amt.sm {
  width: 8ch;
  height: 34px;
}

.due-row .due-go.btn {
  height: 34px;
  padding: 0 14px;
  font-size: 11px;
}

/* Insights: what kind, then the sentence, then where to act on it — read first, then act. At most two
   to a row, every card the same height (the user, 7 Oct) */
.insights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 14px;
  align-items: stretch;
}

.insight {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.insight-kind {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.insight-text {
  margin: 0;
  font-size: 16px;
  font-weight: 550;
  line-height: 1.4;
}

.insight-text b {
  font-weight: 800;
}

.insight.bad {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 50%, transparent), 0 8px 24px rgba(0, 0, 0, 0.1);
}

.insight.bad .insight-kind {
  color: var(--bad-text);
}

/* The buttons under the sentence, at the card's bottom right; two of them on one line, the same size */
.insight-acts {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
  margin: auto 0 0 auto;
  padding-top: 6px;
}

.insight-acts .btn {
  margin: 0;
  white-space: nowrap;
}

@media (max-width: 699px) {
  /* A phone: every figure card of a section shows at once, no scrolling — a card to a row, compact,
     its title and number on the left and what's behind it on the right */
  :root {
    --g-pad-t: 13px;
    --g-pad-b: 13px;
    --g-pad-x: 16px;
    --g-gap: 4px;
    --g-insight: 0px;
    --g-title: 14.5px;
    --g-num: 26px;
    --g-unit: 11px;
    --g-note: 11.5px;
    --g-num-gap: 3px;
    --g-num-mb: 0px;
    --g-ring: 36px;
    --g-ins-name: 13px;
    --g-ins-amt: 13.5px;
    --g-ring-name: 10.5px;
    --g-row-gap: 5px;
    --g-word: 18px;
  }

  .ov-grid.glances {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: auto; /* each as tall as what it holds, no matching to the tallest */
    row-gap: 8px;
  }

  .ov-grid.glances .pcard.glance {
    grid-row: auto;
    grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
    grid-template-rows: auto minmax(0, 1fr);
    column-gap: 14px;
    margin-bottom: 0;
  }

  .ov-grid.glances .glance .pcard-name {
    grid-area: 1 / 1;
  }

  .ov-grid.glances .glance .pcard-money {
    grid-area: 2 / 1;
  }

  .ov-grid.glances .glance .glance-viz {
    grid-area: 1 / 2 / 3 / 3;
    align-self: center;
    min-height: 0;
  }

  /* An empty insight (Clears with nothing left): the number takes the card's width */
  .ov-grid.glances .glance .glance-viz:empty {
    display: none;
  }

  .ov-grid.glances .glance:has(.glance-viz:empty) {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Streak's bars: short, beside the number */
  .glance-viz.fill {
    grid-template-rows: 58px;
  }

  .g-day {
    gap: 3px;
  }

  .g-day i {
    min-height: 18px;
  }

  .g-day small {
    font-size: 9px;
  }

  /* Rings beside the number: side by side, names under them */
  .g-rings {
    column-gap: 4px;
  }

  .g-ring {
    gap: 3px;
  }

  .g-ring .pring {
    margin-bottom: 0;
  }

  .glance-viz > .btn.sm {
    height: 26px;
    padding: 0 12px;
    font-size: 10px;
  }

  /* Upcoming's list: a name and its figure on one line */
  .g-row .g-name {
    overflow: visible;
  }

  .due-top-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .due-card.card {
    padding: 12px 14px 6px;
  }

  .due-side {
    gap: 10px;
  }

  /* A row's button: a round lime button with a tick (a pencil for the odometer), so the name
     and how it's paid keep their room — and that line may take two lines rather than be cut */
  .due-go.btn,
.due-go.btn.sm,
.due-row .due-go.btn,
.due-line.lead .due-go.btn {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    background: var(--good-glass);
    color: var(--good-ink);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  }

  .due-go .icon {
    display: block;
    width: 18px;
    height: 18px;
    stroke-width: 2.4;
  }

  .due-go-word {
    display: none;
  }

  .due-sub {
    white-space: normal;
    text-overflow: clip;
    line-height: 1.3;
  }

  .due-line {
    gap: 8px;
  }

  .due-row {
    grid-template-columns: auto 36px minmax(0, 1fr) auto auto;
    gap: 8px;
  }

  .due-amt,
.due-amt.sm,
.due-line.lead .due-amt {
    width: 8ch; /* room for 35,700 at the one row size */
    padding: 0 4px;
  }

  .insights {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: auto;
    gap: 10px;
  }
}

.due-label.late {
  color: var(--bad-text);
}

/* ---------- Behind the dock: the page runs on under it, blurred — no band ---------- */

/* A wide screen: each section scrolls to the foot of the window, behind the dock, with room at its
   end so the last card can scroll clear of it (the space used to sit under the section, which
   cut the cards off in a hard line above an empty strip) */
@media (min-width: 700px) {
  .content {
    padding-bottom: 0;
  }

  .section {
    padding-bottom: calc(var(--dock-h) + 44px + 24px);
  }
}

/* Whatever passes behind the dock is blurred, fading in from above it — no colour of its own.
   The blur builds up in steps (four layers, each stronger and each fading on an eased curve over
   its own band) so there is no line where the page turns from sharp to blurred. Each keeps the
   reach the single blur had; --f is how much of it is the fade. */
.edge-blur {
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

.edge-blur i {
  position: absolute;
  inset: 0;
  -webkit-backdrop-filter: blur(var(--b));
  backdrop-filter: blur(var(--b));
  /* solid up to --s, eased out to nothing at --e */
  --m: linear-gradient(
    var(--dir),
    #000 var(--s),
    rgba(0, 0, 0, 0.84) calc(var(--s) + (var(--e) - var(--s)) * 0.25),
    rgba(0, 0, 0, 0.5) calc(var(--s) + (var(--e) - var(--s)) * 0.5),
    rgba(0, 0, 0, 0.16) calc(var(--s) + (var(--e) - var(--s)) * 0.75),
    transparent var(--e)
  );
  -webkit-mask-image: var(--m);
  mask-image: var(--m);
}

.edge-blur i:nth-child(1) {
  --b: 14px;
  --s: calc(100% - var(--f));
  --e: calc(100% - var(--f) * 0.55);
}

.edge-blur i:nth-child(2) {
  --b: 7px;
  --s: calc(100% - var(--f) * 0.8);
  --e: calc(100% - var(--f) * 0.35);
}

.edge-blur i:nth-child(3) {
  --b: 3px;
  --s: calc(100% - var(--f) * 0.6);
  --e: calc(100% - var(--f) * 0.15);
}

.edge-blur i:nth-child(4) {
  --b: 1px;
  --s: calc(100% - var(--f) * 0.4);
  --e: 100%;
}

.edge-blur-bottom {
  --f: 80px;
  --dir: to top;
  position: fixed;
  z-index: 29; /* under the dock (30) */
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--dock-h) + 52px + env(safe-area-inset-bottom, 0px));
}

.edge-blur-top {
  --f: 48px;
  --dir: to bottom;
}

/* ---------- A phone: the page's top stays put ---------- */
/* The whole page scrolls on a phone, so its top — title, month, settings, section pills — sticks to
   the top of the screen. What scrolls under it is blurred, fading out below it, as behind the dock:
   no colour of its own. (A wide screen scrolls only the section, so its top already stays.) */
@media (max-width: 699px) {
  .topbar {
    position: sticky;
    z-index: 25;
    top: 0;
    isolation: isolate;
    margin: -12px -16px -10px;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 10px;
  }

  .edge-blur-top {
    --f: 16px;
    inset: 0;
  }

  /* From the screen's foot up to the dock's top edge, nothing more — the totals bar above it stays sharp */
  .edge-blur-bottom {
    --f: 16px;
    height: calc(var(--dock-b, 22px) + var(--dock-h));
  }
}

/* ---------- A wide screen: the page runs on under its top too, blurred ---------- */
/* The section's scroll box starts at the very top, behind the title and pills, with room at its
   start so it rests where it always did (--top-h, the top's height, is kept by app.js). What
   scrolls up under the top is blurred, fading out below it — no colour, no hard line. */
@media (min-width: 700px) {
  .topbar {
    grid-row: 1;
    grid-column: 1;
    position: relative;
    z-index: 25;
    isolation: isolate;
  }

  .edge-blur-top {
    inset: calc(-1 * var(--sp-5)) calc(-1 * var(--sp-6)) -22px;
  }

  .content {
    grid-row: 1 / -1;
    grid-column: 1;
  }

  .section {
    padding-top: calc(var(--top-h, 0px) + var(--sp-4) + 12px);
  }

  /* An open card covers the top as well — the top drops under it, blur and all, while it shows
     (a card left open on a hidden tab or page doesn't count) */
  .app:has(.card-overlay:not([hidden] *)) .topbar {
    z-index: auto;
  }
}

/* ---------- Home: the Balance card, under At a glance, on a row of its own ---------- */
.ov-grid.glances.balance-row {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 14px;
}

/* Where the bank's figure is typed, under the insight */
.g-balance .g-bal-set {
  width: 100%;
  margin-top: 10px;
  text-align: left;
}

/* The Balance card's title picks the account */
.g-balance .pcard-name {
  overflow: visible;
}
.g-balance .g-acct-pick {
  width: auto;
  min-width: max-content; /* the whole account name, never cut */
  max-width: 100%;
  padding-right: 30px;
  font-weight: 700;
}
/* A phone: as on a wide row of its own — the account picker top left, the main figure top right,
   and the rows under both, across the card */
@media (max-width: 699px) {
  .ov-grid.glances .pcard.glance.g-balance {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 12px;
  }
  .ov-grid.glances .g-balance .pcard-name {
    grid-area: 1 / 1;
    align-self: start;
  }
  .ov-grid.glances .g-balance .pcard-money {
    grid-area: 1 / 2;
    justify-self: end;
    align-self: start;
    text-align: right;
  }
  .ov-grid.glances .g-balance .glance-viz {
    grid-area: 2 / 1 / 3 / 3;
    margin-top: 10px;
  }
}

/* An entry in the log sheet: an internal transfer, From → To (the car fund question's look) */
.xfer-ask {
  flex-wrap: wrap;
}
.xfer-ask.on {
  box-shadow: inset 0 0 0 1.5px var(--select-rim);
}
.xfer-ask .xfer-sel {
  width: auto;
  height: 30px;
  font-size: 12px;
}

/* On or off is a switch, with no words; on, To then From, each on a line of its own */
.xfer-switch {
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 13px;
  background: var(--raised-strong);
  cursor: pointer;
  transition: background 0.15s;
}

.xfer-switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.15s, background 0.15s;
}

.xfer-switch[aria-checked="true"] {
  background: var(--select);
}

.xfer-switch[aria-checked="true"] i {
  transform: translateX(18px);
  background: var(--select-ink);
}

.xfer-switch:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.xfer-line {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.xfer-line b {
  flex: none;
  width: 40px;
  font-size: 12px;
  color: var(--text-2);
}

.xfer-line .xfer-sel {
  flex: 1;
  min-width: 0;
}
/* The Balance card (a wide screen): the account picker top left, its main figure top right, and the
   rows under both, across the card */
@media (min-width: 700px) {
  .ov-grid.glances.balance-row > .pcard.glance.g-balance {
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 20px;
  }
  .ov-grid.glances.balance-row > .g-balance .pcard-name {
    grid-area: 1 / 1;
    align-self: start;
  }
  .ov-grid.glances.balance-row > .g-balance .pcard-money {
    grid-area: 1 / 2 / 3 / 3;
    justify-self: end;
    align-self: start;
    text-align: right;
  }
  .ov-grid.glances.balance-row > .g-balance .glance-viz {
    grid-area: 3 / 1 / 4 / 3;
  }
}

/* ---------- Private (the eye in the top bar): incomes and account balances blurred, on every page ---------- */
html[data-private="on"]
  :is(
    .pt-cell.key-inc .pt-value,
    .pt-cell.key-left .pt-value,
    .expenses-grid tr.remaining > td:not(:first-child),
    [data-section="income"] :is(.pcard-amount, .pcard-extra, .pcard-vs, .money-fig, .scard-amount, td.cell, td.calc, .phone-totals .pt-value),
    .pcard.log-income .pcard-amount,
    .log-bar:not(.unp) .lb-fig:not(.lb-due), /* Log's plan bar: "55 EGP under plan", "176 EGP left this week" (user, 2026-10-05); on a card charge the verdict on top (user, 2026-10-08). A card's statement total ("9,611 EGP due Nov 15") stays, planned or unplanned (user, 2026-10-08); so does a phone's verdict under the amount (user, 2026-10-08) */
    .g-balance :is(.pcard-amount, .pcard-vs, .g-val),
    .g-bal2 :is(.pcard-amount, .pcard-vs), /* Home's balance card on the glass-card parts (17 Oct): both figures and what's set aside */
    /* Track › Accounts: each card's balance (stacked and picked) and the header's figures (user,
       2026-10-04); the Saving Plan's items, their progress and the pop-ups stay */
    .acc-card :is(.acc-sbal, .acc-bal, .acc-sum-i b),
    .g-row.sensitive .g-val,
    .upc-row .ra, /* Home's Upcoming: each charge's amount (23 Oct) */
    .cu-row .due-amt, .cu-tot, .cu-fv, /* Home's Coming Up: each charge's amount, the week totals, the footer's figure (23 Oct) */
    .cu-dt, /* Coming Up's calendar: each day's total (1 Dec 2026) */
    .g-cards .upc-who .num, /* Home's Credit Cards, one card: what is charged so far (23 Oct) */
    .glance.g-upc .pcard-amount, /* … and its total */
    [data-page="transactions"] .ov-verdict .pcard-vs, /* Log's Verdict: "…income, N to spare" (Home's cards share the class) */
    .ov-rec :is(.num, input, .rec-verdict b),
    /* Every total (user, 2026-10-02) — never an expense on its own: the Plan's totals bar, its
       table's category rows and totals; the cards that are totals (.g-total: Log's
       Spent/Planned/Verdict/Left, Home's Cards, Tracker's Outstanding/Building/Still expected/
       Statements/Fund — figure, note and rows; .g-total-head: Home's Allowance, figure, note and each
       line's ring or row, 3 Nov 2026: every amount blurs); Logged's totals cards; Breakdown by category or necessity.
       Stays: a plan item,
one logged entry,
a bill (Upcoming, Coming up),
Breakdown by line. */
    .pt-value,
.cats-sum b, /* the phone's All view: its grand total and each category's total (user, 2026-10-15) */
.cats-amt,
.edit-grid :is(tr.cat, tr.total, tr.summary) > td:not(:first-child),
.glance.g-total :is(.pcard-amount, .pcard-vs, .g-val, .g-ring b, .g-amt-fig),
.glance.g-total-head :is(.pcard-amount, .pcard-vs, .g-ring b, .g-ring-list .g-val),
.log-totals .pcard :is(.pcard-amount, .pcard-vs),
.log-totals-g .pcard :is(.pcard-amount, .pcard-vs), /* Log's four figure cards, now glance cards (17 Oct): figure and insight blur as before */
.od-card :is(.g-od-stats b, .g-od-step b, .g-od-scale), /* Overdraft's new widgets: used and available, owed now and after, the limit's scale (17 Oct) */
[data-page="transactions"] .bd-table:is(.by-category, .by-necessity) :is(.bd-num, .bd-var),
.log-day .day-fig,
/* Track › Overdraft (user, 2026-10-07): what's owed and everything it adds — its three figure cards
   are .g-total; the movements' amounts and what each payment cleared; the admin fee typed */
.od-moves :is(.pay-amt, .pay-when),
.inst-sched :is(.pay-amt, .aside), /* Track › Installments: each payment's amount (18 Oct) */
.od-card .g-ends,
.od-rules input[data-od="adminFee"],
/* Saved under a line — an internal transfer kept, not paid (user, 2026-10-08): a Plan card's "N saved";
   Track › Loan's Saved toward it is in Outstanding (.g-total), Monthly's Paid / Saved in rows .sensitive;
   Outstanding's meter labels (N paid of N) blur with it */
.pcard-logged .saved-fig,
.glance.loan-out .g-ends,
/* A Plan line's saving plan (17 Oct, the user's call: blur all): the card's "N saved" pill and its phone line,
   and the over-income prompt's two amounts */
.pcard-saving .sv-n,
.pcard-sv-line > span,
.carry .over-fig
  ) {
  filter: blur(max(7px, 0.4em)); /* the bigger the figure, the harder the blur */
  user-select: none;
}
/* the saved / goal figures also sit in a hover tooltip on the pill and on the table's piggy: no tooltip while private */
html[data-private="on"] :is(.pcard-saving, .pcard-sv-line, .cell-saving, .glance.g-total-head .g-ring .pring) {
  pointer-events: none;
}

#private-btn[aria-pressed="true"] {
  color: var(--good-text);
}

/* The password that shows them again */
#lock-sheet {
  width: min(380px, calc(100vw - 32px));
  border-radius: var(--r-lg);
}
#lock-sheet .sheet-body {
  display: grid;
  gap: 10px;
}
#lock-sheet .lock-note {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
}
#lock-sheet input[hidden] {
  display: none;
}
#lock-sheet .lock-err {
  min-height: 1.2em;
  margin: 0;
  color: var(--bad-text);
  font-size: 13px;
  font-weight: 650;
}
#lock-sheet .cap-foot {
  justify-content: flex-end;
}
#lock-sheet input.ctl {
  width: 100%;
  height: 44px;
  font-size: 16px; /* 16px or more: a phone doesn't zoom in on it */
  text-align: left;
}

/* ---------- Locked (three wrong passwords): the whole app covered until the right one ---------- */
.app-lock {
  display: none;
}
html[data-locked="on"] .app-lock {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(28px);
  backdrop-filter: blur(28px);
}
html[data-locked="on"] body > :not(.app-lock):not(.backdrop) {
  visibility: hidden;
}
.app-lock-card {
  display: grid;
  gap: 12px;
  width: min(360px, 100%);
  padding: 24px;
  border-radius: var(--r-lg);
}
.app-lock-card h2 {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 750;
}
.app-lock-card p {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
}
.app-lock-card input.ctl {
  width: 100%;
  height: 44px;
  font-size: 16px;
  text-align: left;
}
.app-lock-card .lock-err {
  min-height: 1.2em;
  color: var(--bad-text);
  font-size: 13px;
}
.app-lock-card .btn {
  justify-self: end;
}

/* The PIN pad: dots for what's typed, then 1–9, ⌫ 0 ✓ */
.pin {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 6px 0 2px;
}
.pin-dots {
  display: flex;
  gap: 12px;
  min-height: 14px;
}
.pin-dots i {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--text-3);
}
.pin-dots i.on {
  background: var(--good);
  box-shadow: none;
}
.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 64px);
  gap: 12px 20px;
}
.pin-key {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  background: var(--raised);
  color: var(--text);
  font: 600 24px var(--font);
  cursor: pointer;
  touch-action: manipulation;
}
.pin-key:active {
  background: var(--recessed);
}
.pin-key.soft {
  background: transparent;
  color: var(--text-2);
  font-size: 22px;
}
.pin-key.ok {
  /* no lime fill on a button (3 Dec 2026): a raised key with lime ink */
  background: var(--raised);
  color: var(--select);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}
/* the sign-in wall's PIN page: the private-mode keypad, centred under the words */
.auth-pin {
  display: grid;
  justify-items: center;
  margin: 18px 0 0;
}
#lock-sheet .lock-err,
.app-lock-card .lock-err {
  text-align: center;
}
#lock-sheet .lock-note {
  text-align: center;
}

/* Path to zero, cramped: the short figures (2.1M, 321K) in place of the full ones (app.js fitTimelines) */
.tl-short {
  display: none;
}
.timeline.compact .tl-full {
  display: none;
}
.timeline.compact .tl-short {
  display: inline;
}

/* How an item is paid: a button per way, several can be on (no default then — each payment says which) */
.pay-picks {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.pay-pick {
  height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--raised);
  color: var(--text-2);
  font: 650 12px var(--font);
  white-space: nowrap;
  cursor: pointer;
}
.pay-pick[aria-pressed="true"] {
  background: var(--good-glass);
  color: var(--good-ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.pay-pick:disabled {
  cursor: default;
  opacity: 0.75;
}
.edit-grid .pay-picks {
  flex-wrap: nowrap;
  justify-content: flex-start;
}
/* Paid with? on Home */
#method-sheet {
  width: min(400px, calc(100vw - 32px));
  border-radius: var(--r-lg);
}
#method-sheet .fund-what {
  margin: 0;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 600;
}
#method-sheet .method-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* A wide screen (1000px up — tried at the user's ask; was 1500): every account at once — one glass card, a column per account
   (the total first) with a line between each, every block lined up across them and each "Update
   total" box in the same place at the foot; narrower, the one card with the picker */
.ov-grid.glances.accounts-row {
  display: none;
}
@media (min-width: 1000px) {
  .ov-grid.glances.balance-row {
    display: none;
  }
  .ov-grid.glances.accounts-row {
    display: grid;
    grid-template-columns: none;
    grid-auto-columns: minmax(0, 1fr); /* side by side, one row, however many accounts */
    grid-auto-flow: column;
    column-gap: 0;
    margin-top: 14px;
    border-radius: var(--r-lg);
  }
  /* The columns: the card's glass is the row's, so each column has none of its own */
  .ov-grid.glances.accounts-row > .pcard.glance {
    margin-bottom: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .ov-grid.glances.accounts-row > .pcard.glance::before,
.ov-grid.glances.accounts-row > .pcard.glance::after {
    display: none;
  }
  .ov-grid.glances.accounts-row > .pcard.glance + .pcard.glance {
    box-shadow: inset 1px 0 0 var(--line-strong);
  }
  /* The insight runs to the foot, and the box sits there, the same on every account */
  .ov-grid.glances.accounts-row .glance-viz {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    min-height: 0; /* no rows any more: just the figure, what's free, and the box — the card as short as that */
  }
  .ov-grid.glances.accounts-row .g-bal-set {
    margin-top: auto;
    padding-top: 0;
  }
  .ov-grid.glances.accounts-row .glance-viz .g-row + .g-bal-set,
.ov-grid.glances.accounts-row .glance-viz > .g-bal-set:first-child {
    margin-top: auto;
  }
}

/* The Balance card (one account at a time) spans the page. On a wide card its rows would drift
   far from their amounts, so there (500px up) they read across instead: each figure a small block — its name
   over its amount — side by side with a line between, and Update balance at the end of the line.
   A phone keeps the list. Rows are one size at every width (a phone's smaller ones looked lost). */
.ov-grid.glances.balance-row .g-balance .g-row {
  --g-ins-name-size: 15.5px;
  --g-ins-amt-size: 15.5px;
}
@media (min-width: 500px) {
  .ov-grid.glances.balance-row > .g-balance .glance-viz {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    row-gap: 14px;
  }
  .ov-grid.glances.balance-row > .g-balance .g-row {
    flex: 1 1 0; /* spread evenly along the line, up to the box */
    min-width: 120px;
    grid-template-columns: auto;
    justify-items: start;
    row-gap: 4px;
    padding: 0 26px;
    box-shadow: inset 1px 0 0 var(--line-strong);
  }
  .ov-grid.glances.balance-row > .g-balance .g-row:first-child {
    padding-left: 0;
    box-shadow: none;
  }
  .ov-grid.glances.balance-row > .g-balance .g-row .g-name {
    font-size: 13px;
  }
  .ov-grid.glances.balance-row > .g-balance .g-row .g-val {
    font-size: 18px;
  }
  .ov-grid.glances.balance-row > .g-balance .g-bal-set {
    flex: 0 0 min(280px, 100%);
    margin: 0 0 0 26px;
  }
}
/* 700px up: one line, the box always at its right end; the columns keep their content's width, side
   by side from the left with a line between, and under 1000px "set aside" goes (the category and
   name stay) */
@media (min-width: 700px) {
  .ov-grid.glances.balance-row > .g-balance .glance-viz {
    flex-wrap: nowrap;
  }
  .ov-grid.glances.balance-row > .g-balance .g-row {
    flex: 0 1 auto; /* each its content's width, never stretched — stretched, they read as gaps */
    min-width: auto;
    padding: 0 clamp(20px, 3vw, 40px);
  }
  .ov-grid.glances.balance-row > .g-balance .g-row:first-child {
    padding-left: 0;
  }
  .ov-grid.glances.balance-row > .g-balance .g-bal-set {
    flex: 0 1 260px;
    min-width: 170px;
    margin-left: auto; /* at the line's right end */
  }
}
@media (min-width: 700px) and (max-width: 999px) {
  .ov-grid.glances.balance-row > .g-balance .g-row .g-name small {
    display: none;
  }
}
/* A wide phone or a small window (500–699px): the columns take the line, the box the one under it */
@media (min-width: 500px) and (max-width: 699px) {
  .ov-grid.glances.balance-row > .g-balance .g-bal-set {
    flex-basis: 100%;
    margin: 0;
  }
}

/* A set-aside's category before its name (Finance › Loan) — on a wide card, where the rows read across */
.g-cat {
  display: none;
}
@media (min-width: 700px) {
  .ov-grid.glances.balance-row .g-cat {
    display: inline;
  }
}

/* Every account at once, on a window narrower than very wide: tighter columns, the figures a size
   down so six fit across */
@media (min-width: 1000px) and (max-width: 1499px) {
  .ov-grid.glances.accounts-row > .pcard.glance {
    --g-pad-x: 16px;
    --g-num: 26px;
  }
  .ov-grid.glances.accounts-row .g-row {
    --g-ins-name-size: 13px;
    --g-ins-amt-size: 13.5px;
  }
}

/* ---------- Logging on a phone: everything a size smaller, so it reads as one tidy sheet ---------- */
@media (max-width: 699px) {
  #capture {
    width: calc(100vw - 32px);
    max-width: none;
    position: fixed; /* to the screen, not the page behind it, which may be scrolled */
    inset: 0;
    height: fit-content;
    margin: auto; /* in the middle of the screen, growing both ways as entries appear */
    max-height: calc(100dvh - 24px);
    border-radius: 22px;
  }

  #capture .sheet-inner {
    max-height: calc(100dvh - 24px);
  }

  #capture .sheet-head {
    padding: 14px 14px 8px;
    gap: 8px;
  }

  #capture .sheet-head h2 {
    font-size: 24px;
  }

  #capture .sheet-head > .round-btn {
    width: 32px;
    height: 32px;
  }

  #capture .cap-head-main {
    gap: 12px;
  }

  #capture .cap-month {
    font-size: 11px;
    padding: 6px 6px;
    margin-bottom: 4px;
  }

  #capture .cap-month span {
    padding-left: 8px;
  }

  #capture .cap-month .round-btn {
    width: 26px;
    height: 26px;
  }

  #capture .cap-month strong {
    min-width: 76px;
  }

  #capture .sheet-body {
    padding: 0 14px 10px;
    gap: 10px;
  }

  #capture .cap-well {
    border-radius: 16px;
  }

  #capture .cap-input {
    min-height: 60px;
    padding: 12px 14px 2px;
    font-size: 15px;
  }

  #capture .cap-input::placeholder {
    font-size: 12px;
  }

  #capture .cap-well-foot {
    padding: 0 8px 8px;
  }

  #capture .cap-well-foot .hint {
    display: none;
  }

  #capture #cap-paste {
    height: 28px;
    padding: 0 12px;
    font-size: 10px;
  }

  #capture .entries {
    gap: 6px;
  }

  #capture .entry {
    padding: 10px 12px;
    gap: 6px 10px;
    border-radius: 16px;
  }

  #capture .entry-what {
    font-size: 14px;
  }

  #capture .entry-amt .num {
    font-size: 16px;
  }

  #capture .entry-cur,
#capture .entry-amt small {
    font-size: 11px;
  }

  #capture .chip {
    height: 22px;
    padding: 0 8px;
    font-size: 11px;
  }

  #capture .fund-ask {
    padding: 6px 6px 6px 10px;
    gap: 6px;
    border-radius: 10px;
    font-size: 12px;
  }

  #capture .fund-opt {
    height: 26px;
    padding: 0 12px;
    font-size: 11px;
  }

  #capture .entry-memo {
    height: 28px;
    padding: 0 10px;
    font-size: 12px;
  }

  #capture .cap-foot {
    padding: 0 14px 14px;
  }

  #capture #cap-log {
    height: 36px;
    padding: 0 24px;
    font-size: 11px;
  }
}

/* ---------- Phone: the pill on the middle, and Allowance listed ---------- */
@media (max-width: 699px) {
  /* Log and ✕ on the top line; what it counts toward under them, centred */
  #capture .sheet-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    row-gap: 12px;
  }

  #capture .cap-head-main {
    display: contents;
  }

  #capture .sheet-head h2 {
    grid-area: 1 / 1;
  }

  #capture .sheet-head > .round-btn {
    grid-area: 1 / 2;
  }

  #capture .cap-month {
    grid-area: 2 / 1 / 3 / 3;
    justify-self: center;
    margin-bottom: 0;
  }

  /* A phone lists Allowance's lines (name, what's over or left) instead of ringing them: four rings
     don't fit beside the number */
  .g-rings:has(+ .g-ring-list) {
    display: none;
  }

  .g-ring-list {
    display: grid;
    gap: var(--g-row-gap, 5px);
  }
}

/* Allowance's list is for a phone; a wide screen keeps its rings */
@media (min-width: 700px) {
  .g-ring-list {
    display: none;
  }
}

/* Phone, Home: Upcoming, Streak, Allowance and Cards stand at one height — the tallest's */
@media (max-width: 699px) {
  [data-page="dashboard"] .ov-grid.glances:not(.balance-row):not(.accounts-row) {
    grid-auto-rows: 1fr;
  }

  /* One set of margins for all four: the name at the top, the figure and its note at the bottom,
     the list or bars on the right filling the height between — each the same distance from the
     card's edges, whatever it holds */
  [data-page="dashboard"] .ov-grid.glances:not(.balance-row):not(.accounts-row) .pcard.glance {
    grid-template-rows: auto 1fr auto;
    padding: var(--g-pad-t) var(--g-pad-x) var(--g-pad-b);
    row-gap: 0;
    min-height: 116px;
  }

  [data-page="dashboard"] .ov-grid.glances:not(.balance-row):not(.accounts-row) .pcard.glance .pcard-name {
    grid-area: 1 / 1;
    margin: 0;
    padding: 0;
  }

  [data-page="dashboard"] .ov-grid.glances:not(.balance-row):not(.accounts-row) .pcard.glance .pcard-money {
    grid-area: 3 / 1;
    align-self: end;
    margin: 0;
    padding: 0;
  }

  [data-page="dashboard"] .ov-grid.glances:not(.balance-row):not(.accounts-row) .pcard.glance .glance-viz {
    grid-area: 1 / 2 / 4 / 3;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center; /* a short list (Upcoming, Cards) sits close together, in the middle of the height */
    gap: 10px;
    margin: 0;
    padding: 0;
  }

  [data-page="dashboard"] .ov-grid.glances:not(.balance-row):not(.accounts-row) .glance-viz > :is(.g-ring-list, .g-cards-list) {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
  }

  /* Allowance's four lines have the height to themselves, spread through it */
  [data-page="dashboard"] .ov-grid.glances:not(.balance-row):not(.accounts-row) .glance-viz > .g-ring-list {
    flex: 1;
    justify-content: space-evenly;
    gap: 0;
  }

  /* Streak's bars take the whole height */
  [data-page="dashboard"] .ov-grid.glances:not(.balance-row):not(.accounts-row) .glance-viz.fill {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
  }
}

/* ---------- App admin (Settings › Admin) ---------- */
.nav-off,
.dock-link[hidden],
.tabs button[hidden] {
  display: none !important;
}

.admin-tree {
  display: grid;
  gap: var(--sp-3);
  margin: var(--sp-3) 0;
}

.adm-group {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 16px;
  background: var(--recessed);
  box-shadow: inset 0 0 0 1px var(--line);
}

.adm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.adm-row.off .adm-name,
.adm-row.off .adm-title {
  opacity: 0.45;
}

.adm-section {
  padding-left: 14px;
}

.adm-card {
  padding-left: 30px;
  font-size: var(--fs-xs);
  color: var(--text-2);
}

.adm-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adm-name {
  flex: 1;
  min-width: 0;
  width: auto;
  height: 32px;
  font-size: 13px;
  text-align: left;
}

.adm-page .adm-name {
  font-weight: 700;
}

.adm-row .round-btn {
  flex: none;
  width: 28px;
  height: 28px;
}

.adm-up .icon {
  transform: rotate(180deg);
}

.adm-row .round-btn:disabled,
.adm-row .xfer-switch:disabled {
  opacity: 0.3;
}

.adm-open {
  flex: none;
  height: 30px;
  padding: 0 12px;
  font-size: 11px;
}

/* The admin tree, compact: groups side by side on a wide screen, the cards of a section two to a line */
.adm-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.adm-group > .adm-page,
.adm-group > .adm-section {
  flex: 0 0 100%;
}

.adm-group > .adm-card {
  flex: 0 0 calc(50% - 4px);
  padding-left: 30px;
  box-sizing: border-box;
  min-width: 0;
}

@media (min-width: 700px) {
  .admin-tree {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

/* ---------- Settings' previews ---------- */
/* Appearance: the preview is a column of its own beside the controls on a wide screen, in view as they're used */
@media (min-width: 700px) {
  .set-pane .setting.preview {
    grid-column: 2;
    grid-row: 1 / span 6;
    position: sticky;
    top: 70px; /* under the pills */
    z-index: 2;
  }
}

.pv {
  display: grid;
  gap: var(--sp-3);
  pointer-events: none; /* a picture, not controls */
}

.pv .phone-totals {
  position: static;
  transform: none;
  margin: 0;
  width: auto;
}

/* The table in miniature, taking the table look's colours */
.pv-table-wrap {
  border-radius: 16px;
  overflow: hidden;
}

.pv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-xs);
}

.pv-table th,
.pv-table td {
  padding: 7px 10px;
  text-align: right;
  white-space: nowrap;
}

.pv-table th:first-child,
.pv-table td:first-child {
  text-align: left;
}

.pv-table thead th {
  background: var(--strip-head-solid);
  color: var(--strip-head-ink-2);
  font-weight: 700;
}

.pv-table tr.cat td {
  background: var(--strip-cat-solid);
  color: var(--strip-cat-ink);
  font-weight: 700;
}

.pv-table td.yr,
.pv-table thead th:last-child {
  background: var(--strip-tot-solid);
  color: var(--strip-tot-ink);
}

.pv-table tr.cat.total td {
  background: var(--strip-tot-solid);
  color: var(--strip-tot-ink);
}

/* The sample cards lay out on their own: two across, as tall as they need to be */
.pv .card-pages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: none;
  grid-auto-rows: auto;
  gap: 12px;
  height: auto;
  margin: 0;
  padding: 0;
  overflow: visible;
}

.pv .card-pages.one {
  grid-template-columns: minmax(0, 1fr);
}

.pv .card-page,
.pv .card-page:only-child {
  display: contents;
}

.pv .pcard {
  height: 250px; /* a card's contents are laid out inside it, so it's given a height (the Plan's grid gives them theirs) */
  min-height: 0;
  flex: none;
}

.pv .card-dots {
  display: none;
}

/* Appearance on a phone: the preview stays in view while the colours under it are picked, so it's kept small —
   the name, the amount and the two rings, the things the colours touch */
@media (max-width: 699px) {
  .set-pane .setting.preview {
    position: sticky;
    top: 66px;
    z-index: 2;
    background: var(--glass-solid);
    box-shadow: inset 0 0 0 1px var(--line-strong), 0 10px 24px rgba(0, 0, 0, 0.3);
  }

  #pv-look .pcard {
    height: 150px;
  }

  #pv-look .pcard-chips,
#pv-look .pcard-vs {
    display: none;
  }
}

/* Settings scrolls as one page (its .sheet-inner), so a pinned preview can hold its place */
#settings .sheet-body {
  overflow: visible;
}

/* Admin: a heading of a section, named here, on a line of its own */
.adm-group > .adm-heading {
  flex: 0 0 100%;
}

.adm-tag {
  flex: none;
  width: 44px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* Settings › Backup */
.backup-restore {
  display: flex;
  gap: 8px;
  align-items: center;
}

.backup-restore .ctl {
  flex: 1;
  min-width: 0;
  width: auto;
}

#backup-restore.armed {
  background: var(--bad);
  color: var(--bad-ink);
}

.backup-file {
  justify-self: start;
  cursor: pointer;
}

/* ---------- Tracker › Accounts ----------
   The five accounts as a wallet stack of bank cards (CIB for all, until each has its own bank), the
   three figures beside it, then one account at a time: its card, the ring, and what's set aside in
   it. Every card keeps a real card shape (1.586) and everything inside it is sized in the card's own
   units (cqw), so it scales as one piece. Approved 2026-10-03 — keep. */

.acc-mount .acc-title {
  margin: 28px 0 12px;
}

.ov-grid.glances.acc-one {
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: auto;
}

/* The glass card: bank card(s) on the left, figures or ring on the right */
.acc-card {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  align-items: stretch;
  gap: 20px;
  margin-bottom: 0;
  padding: clamp(32px, 3.5vw, 44px) clamp(22px, 3vw, 32px);
  overflow: visible; /* clipping the glass itself leaks square corners past its rounded edge */
}

.acc-card.acc-has-stack {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  padding-bottom: 0;
}

.acc-left {
  display: grid;
  align-content: center;
  min-width: 0;
}

/* The bank card (also each card of the stack): an emblem, the bank and the account, the balance */
.acc-bank,
.acc-scard {
  container-type: inline-size;
  position: relative;
  aspect-ratio: 1.586;
  padding: 0;
  border-radius: 5.5% / 8.7%;
  color: #f4f1ea;
  background: linear-gradient(160deg, var(--c1) 0%, var(--c2) 55%, var(--c3) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  overflow: hidden; /* the graphic sweeps in past the right edge and is cut by it */
}

.acc-bank {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 18px 40px rgba(0, 0, 0, 0.45);
}

.acc-top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2.4cqw;
  min-width: 0;
}

.acc-bank .acc-top {
  margin: 0 5.6cqw;
  height: 15.5cqw;
}

.acc-logo {
  display: block;
  width: auto;
  height: 7.44cqw;
}

.acc-sep {
  align-self: center;
  width: 1px;
  height: 4.4cqw;
  background: rgba(244, 241, 234, 0.45);
}

.acc-name {
  font-size: 5cqw;
  font-weight: 500;
  white-space: nowrap;
}

.acc-bottom {
  position: relative;
  display: grid;
  gap: 4px;
  margin: 0 5.6cqw 5cqw;
  z-index: 1;
}

.acc-lab {
  color: rgba(244, 241, 234, 0.7);
  font-size: 3.4cqw;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.acc-bal {
  font-size: 8cqw;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.acc-cur {
  margin-left: 8px;
  color: rgba(244, 241, 234, 0.65);
  font-size: 0.38em;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* The stack: each card shows its top strip; the last is tucked into the bottom of the glass card, with
   the emblem on it (half hidden). The stack sets its own height from its cards, so the glass follows it. */
.acc-left.acc-has-stack {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.acc-stack-wrap {
  position: relative;
  flex: none;
  height: 0;
  padding-bottom: calc((var(--acc-n, 5) - 1) * var(--acc-step) + 31.8%);
  clip-path: inset(-40px -40px 0 -40px); /* cuts only at the bottom: corners and shadows stay whole */
}

.acc-stack {
  position: absolute;
  inset: 0 0 auto 0;
  display: grid;
  width: 100%;
}

.acc-scard {
  margin-top: calc(var(--acc-step) - 63.05%); /* a card is 63.05% tall: --acc-step of it (the header and the top of the graphic) shows */
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 -8px 18px rgba(0, 0, 0, 0.35);
}

.acc-scard:first-child {
  margin-top: 0;
}

.acc-srow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  height: 15.5cqw;
  padding: 0 5.6cqw;
}

.acc-srow .acc-top {
  flex: none;
}

.acc-sbal {
  font-size: 5cqw;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
}

.acc-sbal .acc-cur {
  margin-left: 5px;
  font-size: 0.62em;
}

.acc-bal .acc-cur {
  font-size: 0.5em;
}

/* The card graphic (24 Oct 2026): Quarter Tiles in the card's graphic colour, 70% clear, sweeping in from the right edge
   under the header; in a stack's bar only its top shows */
.acc-qt {
  position: absolute;
  top: 11cqw; /* 15% bigger (24 Oct, the user), raised so its top shows in a bar even in the tightest stack */
  right: -39cqw;
  width: 92cqw;
  height: auto;
  color: var(--em);
  opacity: 0.7;
  pointer-events: none;
}

/* The ring and its key (one account) */
.acc-ringbox {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-self: center;
  justify-content: center;
  gap: clamp(36px, 6vw, 80px);
  min-width: 0;
}

.acc-ring {
  position: relative;
  width: clamp(220px, 24vw, 300px);
  aspect-ratio: 1;
}

.acc-ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.acc-ring-track {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 14;
}

.acc-ring-arc {
  fill: none;
  stroke-width: 14;
  stroke-linecap: round;
  filter: url(#ring-glow);
}

.acc-ring-in {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
  text-align: center;
}

.acc-ring-l {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.acc-ring-l.acc-t-good {
  margin-top: 8px;
}

.acc-ring-v {
  color: var(--text);
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.acc-ring-v.acc-t-good {
  color: var(--good-text);
}

.acc-ring-c {
  margin-top: 6px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
}

.acc-key {
  display: grid;
  justify-content: start;
  gap: 12px;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 650;
}

.acc-key span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.acc-key i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.acc-key b {
  margin-left: 6px;
  font-weight: 750;
}

/* What's set aside */
.acc-aside {
  margin-top: 14px;
}

.acc-aside .card-head {
  min-height: 40px;
}

.acc-aside .card-title {
  font-size: 22px;
  letter-spacing: -0.02em;
}

.acc-plus {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: auto;
  border: 0;
  background: var(--good-glass);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  color: var(--good-ink);
  cursor: pointer;
}

.acc-plus .icon {
  width: 20px;
  height: 20px;
}

.acc-lines {
  display: grid;
  margin-top: 6px;
}

.acc-line {
  display: grid;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.acc-line:first-child {
  border-top: 0;
}

.acc-line-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}

.acc-line-id {
  display: grid;
  justify-items: start;
  gap: 8px;
  min-width: 0;
}

.acc-line-name {
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  white-space: nowrap;
}

.acc-line-chip {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.acc-line-fig {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-left: auto;
}

.acc-line-amt {
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.acc-line-cur {
  color: var(--text-3);
  font-size: 0.55em;
  font-weight: 700;
}

.acc-line-btns {
  display: flex;
  flex: none;
  gap: 10px;
}

.acc-line-btns .btn {
  height: 38px;
  padding: 0 18px;
  font-size: 12px;
}

.acc-info {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text-2);
  cursor: pointer;
}

.acc-info .icon {
  width: 20px;
  height: 20px;
}

.acc-info.on {
  background: var(--select-glass);
  box-shadow: inset 0 0 0 1px var(--select-rim);
  color: var(--text);
}

.acc-tx {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  padding-left: 12px;
  border-left: 2px solid var(--line-strong);
}

.acc-tx-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-2);
  font-size: 13px;
}

.acc-tx-row small {
  color: var(--text-3);
  font-size: inherit;
}

.acc-tx-del {
  margin-left: 10px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--text-3);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.acc-tx-del:hover {
  color: var(--bad-text);
}

/* The pop-ups: centred on the screen, everything centred in them */
#acc-sheet {
  width: min(460px, calc(100vw - 32px));
  border-radius: var(--r-lg);
}

#acc-sheet[open] {
  position: fixed;
  inset: 0;
  height: fit-content;
  margin: auto;
}

.acc-sx-body {
  display: grid;
  gap: 22px;
  padding: 6px 24px 8px;
  text-align: center;
}

.acc-sx-lab {
  display: block;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.acc-sx-hero,
.acc-tu-add {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 18px 12px;
  border-radius: 18px;
  background: var(--recessed);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: text;
}

.acc-sx-hero:focus-within,
.acc-tu-add:focus-within {
  box-shadow: inset 0 0 0 1.5px var(--select-rim);
}

.acc-sx-amt {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.acc-sx-big {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: clamp(34px, 9vw, 46px);
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1;
  text-align: center;
}

.acc-sx-amt .acc-sx-big {
  width: auto;
  min-width: 2ch;
  max-width: 70%;
  field-sizing: content;
}

.acc-sx-big::placeholder {
  color: var(--text-3);
  opacity: 0.6;
}

.acc-sx-cur {
  color: var(--text-3);
  font-size: 16px;
  font-weight: 700;
}

.acc-sx-sec {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.acc-sx-sec[hidden] {
  display: none;
}

.acc-sx-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.acc-sx-chip {
  height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.acc-sx-chip small {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
}

.acc-sx-chip[aria-pressed="true"] {
  border-color: var(--select-rim);
  background: var(--select-glass);
}

.acc-sx-new {
  border-style: dashed;
  color: var(--good-text);
}

.acc-sx-in {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  outline: 0;
  background: var(--recessed);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  text-align: center;
}

.acc-sx-in:focus {
  box-shadow: inset 0 0 0 1.5px var(--select-rim);
}

.acc-sx-in[hidden] {
  display: none;
}

.acc-sx-sw {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.acc-sx-dot {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.acc-sx-dot[aria-pressed="true"] {
  box-shadow: 0 0 0 3px var(--glass-solid), 0 0 0 5px var(--text);
}

.acc-sx-foot {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 12px 24px 24px;
}

.acc-sx-foot .btn {
  min-width: 200px;
  height: 48px;
}

/* Edit Saving Plan: DELETE on the left of SAVE */
.acc-sx-foot.has-del {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.acc-sx-foot.has-del .btn {
  min-width: 0;
  flex: 1 1 0;
  max-width: 200px;
}

.acc-sx-foot .btn.danger.is-sure {
  background: var(--bad-text);
  color: #1b0d0b;
}

.acc-sx-for {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
}

.acc-tu-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  align-items: stretch;
  width: 100%;
  margin-top: 4px;
}

.acc-tu-stats > div,
.acc-tu-add {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 14px 6px;
  border-radius: 16px;
  background: var(--recessed);
  box-shadow: inset 0 0 0 1px var(--line);
}

.acc-tu-stats span {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.acc-tu-stats b {
  font-size: clamp(24px, 7vw, 34px);
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1;
}

.acc-tu-add .acc-sx-big {
  font-size: clamp(24px, 7vw, 34px);
}

.acc-tu-stats .acc-tu-new {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 40%, transparent);
}

.acc-tu-stats .acc-tu-new b {
  color: var(--good-text);
}

.acc-tu-cur {
  margin: -6px 0 0;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
}

/* Tracker › Accounts, picking a card: the stack's cards are buttons. The one picked comes up in full on
   top of the others, in the stack's own space and at the stack's size; the rest dim. Tap it to put it back. */
.acc-scard[data-acc-pick] {
  cursor: pointer;
  transition: filter 0.25s ease;
}

.acc-scard.is-dim {
  filter: brightness(0.5) saturate(0.7);
}

.acc-scard.is-dim:hover {
  filter: brightness(0.72) saturate(0.85);
}

.acc-scard:focus-visible {
  outline: 2px solid var(--select-rim);
  outline-offset: 2px;
}

/* The card picked, in full, over the stack: placed where that card sits (margin-top, % of the width),
   kept inside the stack's space */
.acc-pop {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 60;
  margin-top: max(0%, min(calc(var(--pop-i, 0) * var(--acc-step)), calc((var(--acc-n, 5) - 1) * var(--acc-step) - 34.25%))); /* where its place in the stack is, kept inside the stack's space */
  cursor: pointer;
  animation: acc-pop-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}

.acc-pop:focus-visible {
  outline: 2px solid var(--select-rim);
  outline-offset: 2px;
}

@keyframes acc-pop-in {
  from {
    transform: translateY(6%) scale(0.97);
    opacity: 0.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  .acc-pop {
    animation: none;
  }
}

/* The stack sits at the bottom of its column, so its last card stays tucked into the glass card's edge
   however tall the panel beside it grows */
.acc-left.acc-has-stack {
  justify-content: flex-end;
}

/* Across the top: the card picked (or All accounts), its + and its figures; under it the stack and,
   beside the stack, what's set aside */
.acc-card.acc-has-stack {
  --acc-step: 22%; /* how much of each stacked card shows: its header and the top of the graphic */
  grid-template-rows: auto 1fr;
  row-gap: 22px;
}

.acc-head {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
}

/* Beside the stack: what's set aside in the card picked (or in all of them) */
.acc-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
  padding-bottom: clamp(24px, 3vw, 40px);
}

.acc-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
}

.acc-panel-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.acc-sum {
  display: flex;
  flex-wrap: wrap;
  gap: 10px clamp(22px, 3.4vw, 44px);
}

.acc-sum-i {
  display: grid;
  justify-items: start;
  gap: 3px;
}

.acc-sum-i span {
  color: var(--text-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.acc-sum-i b {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.acc-sum-i i {
  margin-left: 4px;
  color: var(--text-3);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.acc-sum-i.acc-c-inc b {
  color: var(--ring-inc-text);
}

.acc-sum-i.acc-c-cat b {
  color: var(--key-cat);
}

.acc-sum-i.acc-c-good b {
  color: var(--good-text);
}

.acc-panel .acc-plus {
  margin-left: auto;
}

.acc-line-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* The ring beside the items */
.acc-detail {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: clamp(24px, 4vw, 56px);
  margin-top: 10px;
}

.acc-detail .acc-ringbox {
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 18px;
  align-self: start;
}

.acc-detail .acc-ring {
  width: clamp(190px, 18vw, 230px);
}

.acc-detail .acc-ring-v {
  font-size: clamp(20px, 2vw, 26px);
}

.acc-detail .acc-key {
  font-size: 13px;
  gap: 8px;
}

.acc-detail .acc-lines {
  margin-top: 0;
}

/* A phone: one column — what's set aside, then the stack */
@media (max-width: 700px) {
  .acc-card,
  .acc-card.acc-has-stack {
    grid-template-columns: minmax(0, 1fr);
  }

  .acc-card.acc-has-stack {
    gap: 22px;
    padding-top: 20px;
  }

  /* the figures, what's set aside, then the stack, tucked into the glass card's bottom edge */
  .acc-head {
    order: -2;
  }

  .acc-panel {
    order: -1;
    padding-bottom: 0;
  }

  .acc-left.acc-has-stack {
    order: 2;
  }

  .acc-sum {
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 12px;
  }

  .acc-sum-i b {
    font-size: 15px;
  }

  .acc-detail {
    grid-template-columns: minmax(0, 1fr);
  }

  .acc-detail .acc-ringbox {
    flex-direction: row;
    justify-content: flex-start;
  }

  .acc-ringbox {
    justify-content: flex-start;
    gap: 16px 24px;
  }

  .acc-ring {
    width: clamp(170px, 46vw, 220px);
  }

  .acc-ring-v {
    font-size: 22px;
  }
}

@media (max-width: 560px) {
  .acc-line-fig {
    justify-content: space-between;
    width: 100%;
    margin-left: 0;
  }
}

/* Tracker › Accounts, round 3 (2026-10-03):
   - the totals sit over the stack and are never wider than it: sized in the stack column's own units,
     and shrunk to fit (fitCardAmounts) when a figure is long
   - each item: its name with its pills under it on the left, a smaller amount on the right, one row
   - (tried: the ring on top, the items under it — too tall beside the stack; back to side by side) */
.acc-head {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  column-gap: 20px;
  align-items: end;
}

.acc-head .acc-panel-head {
  grid-column: 1 / -1;
}

.acc-sum-box {
  grid-column: 1;
  container-type: inline-size;
  min-width: 0;
}

.acc-sum {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 0.7em;
  font-size: 6.4cqw; /* the figures: 1em */
}

.acc-sum-i {
  gap: 0.25em;
}

.acc-sum-i span {
  font-size: 0.42em;
}

.acc-sum-i b {
  font-size: 1em;
}

.acc-sum-i i {
  margin-left: 0.25em;
  font-size: 0.42em;
}

/* the ring (key under it) beside the items: kept no taller than the stack, so nothing leaves a gap */
.acc-detail {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0;
}

.acc-detail .acc-ringbox {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
  gap: 16px;
  padding-inline: clamp(16px, 2.5vw, 40px);
}

.acc-line {
  padding: 10px 0;
}

.acc-line-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.acc-line-id {
  gap: 6px;
}

.acc-line-name {
  font-size: clamp(18px, 1.6vw, 22px);
}

.acc-line-fig {
  margin-left: 0;
  gap: 12px;
}

.acc-line-amt {
  font-size: clamp(16px, 1.4vw, 19px);
}

@media (max-width: 700px) {
  .acc-head {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Tracker › Accounts, round 4: the figures over the stack on the left; on the right, from the top of the
   card, the ring with its key beside it and the items right under them; less room above the title */
.acc-card.acc-has-stack {
  grid-template-rows: auto 1fr;
  padding-top: clamp(18px, 2vw, 26px);
}

.acc-card.acc-has-stack .acc-head {
  grid-column: 1;
  grid-row: 1;
  grid-template-columns: minmax(0, 1fr);
}

.acc-card.acc-has-stack .acc-left {
  grid-column: 1;
  grid-row: 2;
}

.acc-card.acc-has-stack .acc-panel {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.acc-card.acc-has-stack .acc-detail {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.acc-card.acc-has-stack .acc-detail .acc-ringbox {
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: clamp(28px, 4vw, 64px);
  padding-inline: 0;
}

@media (max-width: 700px) {
  .acc-card.acc-has-stack .acc-head,
  .acc-card.acc-has-stack .acc-left,
  .acc-card.acc-has-stack .acc-panel {
    grid-column: 1;
    grid-row: auto;
  }
}

/* Tracker › Accounts, round 5 (the user's mock-up): a clear margin between the stack and the right side;
   the ring, bigger, with a bigger key beside it, centred across the top; the items fill the rest */
@media (min-width: 701px) {
  .acc-card.acc-has-stack {
    column-gap: clamp(40px, 4.5vw, 72px);
  }

  .acc-card.acc-has-stack .acc-panel {
    align-content: stretch;
    grid-template-rows: auto 1fr;
  }

  .acc-card.acc-has-stack .acc-detail {
    grid-template-rows: auto 1fr;
    gap: clamp(16px, 2vw, 28px);
  }

  .acc-card.acc-has-stack .acc-detail .acc-ringbox {
    justify-content: center;
    gap: clamp(32px, 5vw, 80px);
  }

  .acc-card.acc-has-stack .acc-detail .acc-ring {
    width: clamp(220px, 17vw, 280px);
  }

  .acc-card.acc-has-stack .acc-detail .acc-ring-v {
    font-size: clamp(24px, 2.2vw, 32px);
  }

  .acc-card.acc-has-stack .acc-detail .acc-key {
    gap: 12px;
    font-size: 16px;
  }

  .acc-card.acc-has-stack .acc-detail .acc-key i {
    width: 11px;
    height: 11px;
  }
}

/* Tracker › Accounts, round 6 (the user's three-column mock-up): the stack | the account's figures, a row
   each | the ring and key on top, the items under them */
@media (min-width: 701px) {
  .acc-card.acc-has-stack {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr) minmax(0, 2.1fr);
    grid-template-rows: auto;
    column-gap: clamp(20px, 2.2vw, 36px);
  }

  .acc-card.acc-has-stack .acc-left {
    grid-column: 1;
    grid-row: 1;
  }

  .acc-card.acc-has-stack .acc-head {
    grid-column: 2;
    grid-row: 1;
    align-content: start;
    gap: clamp(18px, 2vw, 28px);
    padding-bottom: clamp(24px, 3vw, 40px);
  }

  .acc-card.acc-has-stack .acc-panel {
    grid-column: 3;
    grid-row: 1;
  }

  .acc-card.acc-has-stack .acc-sum-box {
    grid-column: 1;
  }

  .acc-card.acc-has-stack .acc-sum {
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.75em;
    font-size: 12.5cqw;
  }

  .acc-card.acc-has-stack .acc-sum-i {
    justify-items: start;
    gap: 0.22em;
  }

  .acc-card.acc-has-stack .acc-sum-i span,
  .acc-card.acc-has-stack .acc-sum-i i {
    font-size: 0.34em;
  }
}

/* Tracker › Accounts, round 7: the stack starts at the top (no gap above it), the ring 20% smaller,
   the figures smaller */
@media (min-width: 701px) {
  .acc-card.acc-has-stack .acc-left.acc-has-stack {
    justify-content: flex-start;
  }

  .acc-card.acc-has-stack .acc-detail .acc-ring {
    width: clamp(176px, 13.6vw, 224px);
  }

  .acc-card.acc-has-stack .acc-detail .acc-ring-v {
    font-size: clamp(20px, 1.8vw, 26px);
  }

  .acc-card.acc-has-stack .acc-sum {
    font-size: 9cqw;
  }

  .acc-card.acc-has-stack .acc-sum-i span,
  .acc-card.acc-has-stack .acc-sum-i i {
    font-size: 0.4em;
  }

  .acc-card.acc-has-stack .acc-panel {
    padding-bottom: 20px;
  }
}

/* the stack starts at the top and reaches the glass card's bottom edge however tall the right side is:
   its height is at least what its cards need (the spacer) and grows with the column; the last card is
   cut at the edge */
@media (min-width: 701px) {
  .acc-card.acc-has-stack .acc-stack-wrap {
    flex: 1 1 auto;
    height: auto;
    padding-bottom: 0;
  }

  .acc-card.acc-has-stack .acc-stack-wrap::before {
    content: "";
    display: block;
    padding-bottom: calc((var(--acc-n, 5) - 1) * var(--acc-step) + 31.8%);
  }
}

/* Tracker › Accounts, round 8: no ring or key any more — the items take the right column; the + sits
   in the glass card's own top right corner */
.acc-card.acc-has-stack {
  position: relative;
}

.acc-plus-corner {
  position: absolute;
  top: clamp(14px, 1.6vw, 22px);
  right: clamp(14px, 1.6vw, 22px);
  z-index: 5;
}

@media (min-width: 701px) {
  .acc-card.acc-has-stack .acc-detail {
    grid-template-rows: none;
  }

  .acc-card.acc-has-stack .acc-panel {
    padding-top: 44px; /* clear of the + in the corner */
  }
}

/* Tracker › Accounts, round 9: the items get a title (Saving Plan) (a line between them and the figures
   was tried and taken out); with a card picked, its balance (already on the card) leaves the figures */
.acc-plan-title {
  margin: 0;
}

@media (min-width: 701px) {
  .acc-card.acc-has-stack .acc-panel {
    align-content: start;
    gap: 14px;
    padding-top: 0;
  }

  .acc-card.acc-has-stack .acc-plan-title {
    min-height: 40px;
    display: flex;
    align-items: center;
  }

  .acc-card.is-picked .acc-sum-bal {
    display: none;
  }
}

/* Tracker › Accounts, round 10, resizing: the figures sit right next to the stack and scale with the
   window as the items do; the open space between the figures and the Saving Plan gives way first,
   down to a minimum; the Saving Plan items scale with their own column */
@media (min-width: 701px) {
  .acc-card.acc-has-stack {
    /* the figures column is about as wide as its figures (a steady width whatever card is picked, so the
       Saving Plan never moves); no spare column after it, so the Saving Plan takes the rest of the width */
    grid-template-columns: minmax(0, 1.55fr) clamp(160px, 10.5vw, 210px) minmax(0, 2.4fr);
    column-gap: clamp(24px, 3vw, 56px);
  }

  .acc-card.acc-has-stack .acc-panel {
    grid-column: 3;
  }

  .acc-card.acc-has-stack .acc-sum-box {
    container-type: normal;
  }

  .acc-card.acc-has-stack .acc-sum {
    font-size: clamp(18px, 1.8vw, 28px);
  }

  .acc-card.acc-has-stack .acc-panel {
    container-type: inline-size;
  }

  .acc-card.acc-has-stack .acc-line-name {
    font-size: clamp(15px, 3.6cqi, 22px);
  }

  .acc-card.acc-has-stack .acc-line-amt {
    font-size: clamp(14px, 3.1cqi, 19px);
  }

  .acc-card.acc-has-stack .acc-line-chip {
    font-size: clamp(9px, 1.7cqi, 11px);
  }

  .acc-card.acc-has-stack .acc-line {
    padding: clamp(6px, 1.4cqi, 10px) 0;
  }
}

/* Tracker › Accounts, Safari fix: Safari sized the stack's one column to the cards' content (the names and
   balances don't wrap), so the cards grew past their column, over the figures, and were cut on the right.
   The column is now set to the stack's own width and each card may not be wider than it. */
.acc-stack {
  grid-template-columns: minmax(0, 1fr);
}

.acc-stack > .acc-scard,
.acc-stack-wrap > .acc-bank,
.acc-stack-wrap {
  min-width: 0;
  max-width: 100%;
}

.acc-stack > .acc-scard {
  width: 100%;
}

/* Tracker › Accounts, round 11: the Saving Plan items in plain text (no item colours); the first item
   sits as far under the Saving Plan title as the first figure does under the account title */
@media (min-width: 701px) {
  .acc-card.acc-has-stack .acc-panel {
    gap: clamp(18px, 2vw, 28px); /* the same as the figures' side */
  }

  .acc-card.acc-has-stack .acc-detail {
    margin-top: 0;
  }

  .acc-card.acc-has-stack .acc-lines > .acc-line:first-child {
    padding-top: 0;
  }
}

/* Tracker › Accounts, Safari: each stack card is exactly as wide as the stack's column, never wider
   (Safari could leave the cards at an older, wider size and run them over the figures) */
.acc-stack {
  grid-template-columns: minmax(0, 1fr);
}

.acc-stack > .acc-scard,
.acc-stack-wrap > .acc-pop {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.acc-stack-wrap {
  min-width: 0;
  max-width: 100%;
}

/* Tracker › Accounts, round 12: a smaller +; top-up is an icon (an arrow up), lime, the size of the
   i beside it; on a phone too, the first item sits as far under Saving Plan as the figures do under
   the account's name */
.acc-card .acc-plus-corner {
  width: 32px;
  height: 32px;
}

.acc-card .acc-plus-corner .icon {
  width: 16px;
  height: 16px;
}

.acc-line-btns .acc-topup {
  width: 38px;
  height: 38px;
  margin-left: 0;
}

@media (max-width: 700px) {
  .acc-card.acc-has-stack .acc-panel {
    gap: 12px; /* the same as the figures' side (.acc-head) */
  }

  .acc-card.acc-has-stack .acc-detail {
    margin-top: 0;
  }

  .acc-card.acc-has-stack .acc-lines > .acc-line:first-child {
    padding-top: 0;
  }

  .acc-card.acc-has-stack .acc-plan-title {
    min-height: 40px; /* the account name's own row height */
    display: flex;
    align-items: center;
  }
}

/* Tracker › Accounts, round 13: the corner button (a piggy bank: add to the saving plan) lines up with
   the section titles — centred on their row, at the card's own inner edge; the i and top-up (a stack
   of coins with a plus) are the size of it */
.acc-card .acc-plus-corner {
  top: calc(clamp(18px, 2vw, 26px) + 4px); /* the title row is 40px tall, the button 32px */
  right: clamp(22px, 3vw, 32px);
}

.acc-card .acc-plus-corner .icon {
  width: 17px;
  height: 17px;
}

.acc-line-btns {
  gap: 8px;
}

.acc-line-btns .acc-info,
.acc-line-btns .acc-topup {
  width: 32px;
  height: 32px;
}

.acc-line-btns .acc-info .icon,
.acc-line-btns .acc-topup .icon {
  width: 16px;
  height: 16px;
}

/* A phone, no card picked: the glass card reaches down to the dock, the stack at its bottom; the
   figures a row each */
@media (max-width: 700px) {
  .acc-card.acc-has-stack:not(.is-picked) {
    min-height: calc(100dvh - 136px - var(--dock-h) - var(--dock-b, 20px) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    grid-template-rows: auto 1fr;
  }

  .acc-card.acc-has-stack:not(.is-picked) .acc-left.acc-has-stack {
    align-self: end;
    justify-content: flex-end;
  }

  .acc-card.acc-has-stack:not(.is-picked) .acc-sum {
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-size: clamp(26px, 8cqw, 34px);
  }

  .acc-card.acc-has-stack:not(.is-picked) .acc-sum-i {
    gap: 4px;
  }

  .acc-card.acc-has-stack:not(.is-picked) .acc-sum-i span,
  .acc-card.acc-has-stack:not(.is-picked) .acc-sum-i i {
    font-size: 0.38em;
  }

  .acc-card.acc-has-stack:not(.is-picked) .acc-sum-i b {
    font-size: 1em;
  }
}

/* with a card picked its balance is already on the card: on a phone too, only Set aside and Free to use */
.acc-card.is-picked .acc-sum-bal {
  display: none;
}

/* Tracker › Accounts, round 14: Total balance and Set aside in white (Free to use stays lime); the
   Saving Plan two items to a page */
.acc-sum-i.acc-c-inc b,
.acc-sum-i.acc-c-cat b {
  color: var(--text);
}

/* wider than a phone, the pages are simply one list */
.acc-page {
  display: contents;
}

.acc-page + .acc-page > .acc-line:first-child {
  border-top: 1px solid var(--line);
}

.acc-dots {
  display: none;
}

@media (max-width: 700px) {
  /* a phone: the pages side by side, scrolled sideways one at a time, the dots under them */
  .acc-paged {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .acc-paged::-webkit-scrollbar {
    display: none;
  }

  .acc-page {
    display: grid;
    align-content: start;
    scroll-snap-align: start;
  }

  .acc-page + .acc-page > .acc-line:first-child {
    border-top: 0;
  }

  .acc-card.acc-has-stack .acc-page > .acc-line:first-child {
    padding-top: 0;
  }

  .acc-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding-top: 4px;
  }

  .acc-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-3);
    opacity: 0.45;
    transition: width 0.2s ease, opacity 0.2s ease;
  }

  .acc-dots i.on {
    width: 16px;
    border-radius: 3px;
    background: var(--text);
    opacity: 1;
  }

  /* smaller Saving Plan title and item names */
  .acc-card.acc-has-stack .acc-plan-title {
    font-size: 18px;
  }

  .acc-card.acc-has-stack .acc-line-name {
    font-size: 16px;
  }

  /* a card picked: Set aside and Free to use bigger, side by side from the left */
  .acc-card.is-picked .acc-sum {
    justify-content: flex-start;
    gap: 32px;
    font-size: clamp(22px, 8cqw, 28px);
  }
}

/* Tracker › Accounts, round 15 (a phone): the page doesn't scroll up or down — the glass card is the
   room between the tabs and the dock, the stack cut at its bottom; with nothing picked, Total balance
   a row of its own, Set aside and Free to use side by side under it */
@media (max-width: 700px) {
  html:has(.page[data-page="tracker"]:not([hidden]) .section[data-section="accounts"]:not([hidden])),
  html:has(.page[data-page="tracker"]:not([hidden]) .section[data-section="accounts"]:not([hidden])) body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .acc-card.acc-has-stack,
  .acc-card.acc-has-stack:not(.is-picked) {
    height: calc(100dvh - 136px - var(--dock-h) - var(--dock-b, 20px) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    min-height: 0;
  }

  .acc-card.acc-has-stack.is-picked {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .acc-card.acc-has-stack.is-picked .acc-left.acc-has-stack {
    align-self: stretch;
    justify-content: flex-start;
    min-height: 0;
    clip-path: inset(-40px -40px 0 -40px); /* cut at the glass card's bottom edge only */
  }

  .acc-card.acc-has-stack.is-picked .acc-stack-wrap {
    flex: 1 1 auto; /* down to the glass card's bottom edge, where the stack is cut */
    height: auto;
    min-height: 0;
    padding-bottom: 0;
  }

  /* the card picked comes up at the top of the stack, so it's always whole */
  .acc-card.acc-has-stack.is-picked .acc-pop {
    margin-top: 0;
  }

  .acc-card.acc-has-stack:not(.is-picked) .acc-sum {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    justify-content: start;
    gap: 18px 32px;
    font-size: clamp(22px, 8cqw, 28px);
  }

  .acc-card.acc-has-stack:not(.is-picked) .acc-sum-bal {
    grid-column: 1 / -1;
    font-size: 1.45em;
  }
}

@media (max-width: 700px) {
  /* its label the same size as the others' (the figure is 1.45 times theirs) */
  .acc-card.acc-has-stack:not(.is-picked) .acc-sum-bal span {
    font-size: calc(0.38em / 1.45);
  }
}

/* Tracker › Accounts, round 16 (a phone): Set aside and Free to use the same size picked or not — a
   size up from before; the labels and EGP the same in both; Total balance (nothing picked) a size
   above them */
@media (max-width: 700px) {
  .acc-card.acc-has-stack .acc-sum,
  .acc-card.acc-has-stack:not(.is-picked) .acc-sum,
  .acc-card.is-picked .acc-sum {
    gap: 18px 32px;
    font-size: clamp(24px, 9cqw, 30px);
  }

  .acc-card.acc-has-stack .acc-sum-i span,
  .acc-card.acc-has-stack:not(.is-picked) .acc-sum-i span {
    font-size: 10px;
  }

  .acc-card.acc-has-stack .acc-sum-i i,
  .acc-card.acc-has-stack:not(.is-picked) .acc-sum-i i {
    font-size: 0.36em;
  }

  .acc-card.acc-has-stack:not(.is-picked) .acc-sum-bal {
    font-size: 1.35em;
  }

  .acc-card.acc-has-stack:not(.is-picked) .acc-sum-bal span {
    font-size: 10px;
  }
}

/* the card picked has come up out of the stack: its place in the stack stays empty, so what shows
   under it is the card behind it (picking the last card shows the end of the one before it) */
.acc-stack.has-pop .acc-scard[aria-pressed="true"] {
  visibility: hidden;
}

/* a phone, no card picked: no Saving Plan (desktop shows all the accounts' items together) */
@media (max-width: 700px) {
  .acc-card .acc-panel-all {
    display: none;
  }
}

/* Tracker › Accounts, round 17: on a phone and a narrow window the buttons are icons; from 1000px
   wide (room for the words beside the item names), they're words — New Saving Plan, Details, Top Up */
.acc-btn-label {
  display: none;
}

@media (min-width: 1000px) {
  .acc-card .acc-plus-corner {
    width: auto;
    height: 32px;
    padding: 0 14px;
    border-radius: 999px;
  }

  .acc-card .acc-plus-corner .icon {
    display: none;
  }

  .acc-plus-corner .acc-btn-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }
}

/* the picked card's pop-up animation plays when it's picked only — not again when the section is
   redrawn (opening Details), which made the cards under it flash through */
.acc-pop {
  animation: none;
}

.acc-pop.acc-pop-new {
  animation: acc-pop-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}

@media (prefers-reduced-motion: reduce) {
  .acc-pop.acc-pop-new {
    animation: none;
  }
}

/* All accounts: an item opens its account with its details — a row (and each account pill) answers
   the pointer */
.acc-line-open {
  position: relative;
  cursor: pointer;
}

/* the hover/focus highlight reaches a little past the row on every side, so the text keeps its place
   and has room around it */
.acc-line-open::before {
  content: "";
  position: absolute;
  inset: 0 -14px;
  z-index: -1;
  border-radius: 12px;
  background: var(--raised);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.acc-lines > .acc-line-open:first-child::before,
.acc-lines > .acc-page:first-child > .acc-line-open:first-child::before {
  top: calc(-1 * clamp(6px, 1.4cqi, 10px) - 1px); /* the first row has no padding above its name nor
     the 1px line the others have: reach up by exactly those, so every highlight is the same height */
}

.acc-line-open:hover::before {
  opacity: 1;
}

.acc-line-open:focus-visible {
  outline: none;
}

.acc-line-open:focus-visible::before {
  opacity: 1;
  box-shadow: inset 0 0 0 2px var(--select-rim);
}

.acc-line-open .acc-line-acct:hover {
  color: var(--text);
  border-color: var(--text-3);
}

/* the first item has no padding above its name whether or not the items are in pages (3 items or
   more), so it lines up with the figures and its highlight matches the others */
@media (min-width: 701px) {
  .acc-card.acc-has-stack .acc-lines > .acc-page:first-child > .acc-line:first-child {
    padding-top: 0;
  }
}

/* Tracker › Accounts, round 18: saving plans with a goal.
   The New Saving Plan pop-up: the goal amount big; By (a day) and Save now side by side; then the
   category, the item and the account to save in */
.acc-sx-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  text-align: left;
}

.acc-sx-pair .acc-sx-sec {
  display: grid;
  gap: 8px;
}

.acc-sx-date {
  color-scheme: dark;
}

.acc-sx-now {
  position: relative;
  display: block;
}

.acc-sx-now .acc-sx-in {
  padding-right: 52px;
}

.acc-sx-now .acc-sx-cur {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  font-size: 11px;
}

/* Each item's progress (every width): one bar — what's saved fills it, a tick marks where an even
   pace would have it today — with what's saved of the goal above it on the left, and how it's doing and
   the time left on the right. An item without a goal keeps the same height (what's saved, "No goal",
   an empty bar). The name has its category and account pills beside it, on one row. */
@media (min-width: 0px) {
  .acc-card.acc-has-stack .acc-line-id {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }

  /* Pills show whole or not at all: the category first, then the item, then the account — whatever
     doesn't fit beside the name and buttons wraps to a second row and is hidden, never cut */
  .acc-card.acc-has-stack .acc-line-chips {
    flex-wrap: wrap;
    align-content: flex-start;
    min-width: 0;
    max-height: 19px;
    overflow: hidden;
  }

  .acc-card.acc-has-stack .acc-line-chip {
    box-sizing: border-box;
    height: 19px;
    padding-block: 3px;
    line-height: 13px;
  }

  .acc-card.acc-has-stack .acc-line-amt {
    display: none; /* it's above the bar */
  }

  .acc-prog {
    display: grid;
    gap: 7px;
    padding-top: 8px;
  }

  .acc-prog-nums {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-3);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
  }

  .acc-prog-nums b {
    color: var(--text);
    font-size: 15px;
    font-weight: 750;
  }

  .acc-prog-nums i {
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.04em;
  }

  .acc-prog-right {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
  }

  .acc-prog-status {
    font-weight: 700;
  }

  .acc-prog-status.is-on {
    color: var(--good);
  }

  .acc-prog-status.is-off {
    color: var(--bad-text);
  }

  .acc-prog-bar {
    position: relative;
    height: 8px;
    border-radius: 4px;
    background: var(--raised);
  }

  .acc-prog-fill {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
    background: var(--good);
  }

  /* where an even pace would have it today */
  .acc-prog-due {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 2px;
    border-radius: 1px;
    background: var(--text);
    transform: translateX(-50%);
  }

  .acc-prog.is-nogoal .acc-prog-bar {
    background: var(--raised);
    opacity: 0.5;
  }

  /* under the bar: what's left to save, and the days left with the day */
  .acc-prog-foot {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    min-height: 1.3em; /* a plan without a goal keeps the same height */
    color: var(--text-3);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
  }

  .acc-prog-foot b {
    color: var(--text);
    font-size: 12px;
    font-weight: 750;
  }

  .acc-prog-foot i {
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.04em;
  }

  .acc-when-short {
    display: none;
  }

  /* the line's words when there's no amount or no day to show */
  .acc-prog-msg {
    font-style: italic;
    font-weight: 500;
  }

  .acc-prog-msg.is-win {
    color: var(--good);
    font-weight: 600;
  }
}

/* Tracker › Accounts, round 19: desktop doesn't scroll up or down either — the glass card is at most the
   room between the tabs and the dock; the stack is cut at its bottom edge and only the Saving Plan
   scrolls, inside the card */
html:has(.page[data-page="tracker"]:not([hidden]) .section[data-section="accounts"]:not([hidden])),
html:has(.page[data-page="tracker"]:not([hidden]) .section[data-section="accounts"]:not([hidden])) body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

@media (min-width: 701px) {
  .acc-card.acc-has-stack {
    max-height: calc(100dvh - var(--top-h, 108px) - 130px); /* the top (its height kept by app.js) and
       the section's room above it, the dock below — 16px clear of it */
    grid-template-rows: minmax(0, auto); /* as tall as the stack or the Saving Plan, whichever is taller —
       never past the max */
  }

  .acc-card.acc-has-stack .acc-left.acc-has-stack {
    min-height: 0;
    clip-path: inset(-40px -40px 0 -40px);
  }

  .acc-card.acc-has-stack .acc-head {
    min-height: 0;
  }

  .acc-card.acc-has-stack .acc-panel {
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
    padding-bottom: 0;
  }

  /* the list scrolls on its own; room at the sides and top for the hover highlight, the text where it was */
  .acc-card.acc-has-stack .acc-detail {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: -12px -16px 0;
    padding: 12px 16px 22px;
    scrollbar-width: thin;
    scrollbar-color: var(--raised) transparent;
  }
}

@media (min-width: 701px) {
  /* the stack fills its column; its last card grows down to the glass card's bottom edge, where it's
     cut (its emblem is placed by the card's width, so it stays put) — when that last card is the one
     picked, it leaves the stack and the card behind it grows instead */
  .acc-card.acc-has-stack .acc-stack {
    inset: 0;
    display: flex;
    flex-direction: column;
  }

  .acc-card.acc-has-stack .acc-scard {
    flex: none;
  }

  .acc-card.acc-has-stack .acc-stack > .acc-scard:last-child,
  .acc-card.acc-has-stack .acc-stack:has(> .acc-scard:last-child[aria-pressed="true"]) > .acc-scard:nth-last-child(2) {
    margin-bottom: -31.25%; /* only its top 31.8% shows: cut at the edge, its emblem half hidden */
  }

  .acc-card.acc-has-stack .acc-stack.has-pop > .acc-scard:last-child[aria-pressed="true"] {
    display: none;
  }
}

/* Tracker › Accounts, round 20 (desktop): the glass card always fills the screen down to the dock; the
   stack fans out to fill that height (the cards spaced out evenly, each strip taller), its last card still
   cut at the edge with its emblem half hidden; the Saving Plan scrolls inside */
@media (min-width: 701px) {
  .acc-card.acc-has-stack {
    height: calc(100dvh - var(--top-h, 108px) - 130px);
  }

  .acc-card.acc-has-stack .acc-panel {
    contain: size; /* the list scrolls in the card's height rather than stretching it */
    align-self: stretch;
  }

  .acc-card.acc-has-stack .acc-stack {
    justify-content: space-between;
  }
}

/* The New Saving Plan pop-up, shorter: a smaller goal box; Category, Item and Save in as dropdowns, a row
   each — the label on the left, the dropdown on the right */
#acc-sheet .acc-sx-body {
  gap: 16px;
}

#acc-sheet .acc-sx-hero {
  padding: 12px;
  gap: 4px;
}

#acc-sheet .acc-sx-hero .acc-sx-big {
  font-size: clamp(28px, 7vw, 36px);
}

.acc-sx-rows {
  display: grid;
  gap: 10px;
  text-align: left;
}

.acc-sx-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.acc-sx-sel {
  text-align: left;
  text-align-last: left;
  height: 42px;
  padding: 0 38px 0 14px;
  appearance: none;
  color-scheme: dark;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c2c8b6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

.acc-sx-rows > input[name="newname"] {
  height: 42px;
  margin-left: 88px;
  width: calc(100% - 88px);
}

#acc-sheet .acc-sx-pair .acc-sx-in {
  height: 42px;
}

/* Tracker › Accounts, round 22: each Saving Plan item is a glass tile of its own inside the big glass card
   — room between them, no lines; in All accounts the tile brightens to say it opens */
@media (min-width: 0px) {
  .acc-card.acc-has-stack .acc-lines,
  .acc-card.acc-has-stack .acc-paged {
    display: grid;
    gap: 12px;
  }

  .acc-card.acc-has-stack .acc-detail .acc-line,
  .acc-card.acc-has-stack .acc-lines > .acc-line:first-child,
  .acc-card.acc-has-stack .acc-page > .acc-line:first-child,
  .acc-card.acc-has-stack .acc-lines > .acc-page:first-child > .acc-line:first-child {
    padding: 14px 16px 16px;
    border-top: 0;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.045);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  }

  .acc-card.acc-has-stack .acc-page + .acc-page > .acc-line:first-child {
    border-top: 0;
  }

  /* the opening highlight is the tile itself, a little brighter */
  .acc-card.acc-has-stack .acc-line-open::before,
  .acc-card.acc-has-stack .acc-lines > .acc-line-open:first-child::before,
  .acc-card.acc-has-stack .acc-lines > .acc-page:first-child > .acc-line-open:first-child::before {
    inset: 0;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
  }

}

@media (min-width: 701px) {
  /* the list's own edge room, now that nothing reaches past the tiles */
  .acc-card.acc-has-stack .acc-detail {
    margin: -4px -6px 0;
    padding: 4px 6px 22px;
  }
}

/* Tracker › Accounts, round 23 (a phone): the Saving Plan as on a wide screen — glass tiles, the name with
   its pills, the one progress bar — one tile to a page, swiped sideways, the dots under it (the page
   doesn't scroll, so the card picked keeps its room) */
@media (max-width: 700px) {
  .acc-card.acc-has-stack .acc-detail .acc-line,
  .acc-card.acc-has-stack .acc-lines > .acc-line:first-child,
  .acc-card.acc-has-stack .acc-page > .acc-line:first-child,
  .acc-card.acc-has-stack .acc-lines > .acc-page:first-child > .acc-line:first-child {
    padding: 12px 14px 14px;
  }

  .acc-card.acc-has-stack .acc-paged {
    gap: 0;
  }

  .acc-card.acc-has-stack .acc-page {
    padding: 0 1px; /* the tile's edge isn't cut by the sideways scroll */
  }

  .acc-card.acc-has-stack .acc-line-chips {
    gap: 4px;
  }

  .acc-card.acc-has-stack .acc-prog-nums {
    font-size: 11px;
  }

  .acc-card.acc-has-stack .acc-prog-foot {
    font-size: 11px;
  }

  .acc-card.acc-has-stack .acc-when-year {
    display: none; /* a phone drops the year: 1 Dec */
  }

  .acc-card.acc-has-stack .acc-when-short {
    display: inline;
  }
}

/* New Saving Plan: By and Save now each keep to their half of the row (a date field has its own minimum
   width, which pushed it into Save now) */
.acc-sx-pair > .acc-sx-sec,
.acc-sx-pair .acc-sx-now {
  min-width: 0;
}

.acc-sx-pair .acc-sx-in,
.acc-sx-pair .acc-sx-date {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.acc-sx-date {
  padding: 0 12px;
  text-align: left;
}

.acc-sx-date::-webkit-date-and-time-value {
  text-align: left;
}

/* Edit Saving Plan: what's saved so far, quietly, between the amounts and the fixed choices */
.acc-sx-saved {
  margin: 0;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
}

.acc-sx-saved b {
  color: var(--text);
  font-size: 14px;
}

.acc-sx-sel:disabled {
  opacity: 0.6;
  cursor: default;
  background-image: none;
}

/* The dock, after the user's reference bar: bigger icons over the same small names (about 2.5 : 1), the
   bar's height unchanged */
.dock-link {
  gap: 2px;
}

.dock-link .icon {
  width: 28px;
  height: 28px;
}

/* The dock's highlight: solid lime glass — no outline, a soft light from the top, the backdrop blurred
   through it */
.dock-nav .pill-bubble {
  background: linear-gradient(180deg, rgba(198, 244, 50, 0.58) 0%, rgba(198, 244, 50, 0.4) 100%);
  box-shadow: none;
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
}

/* The dock, measured from the user's full-screen reference (to its screen's width): 54px tall, the highlight
   4px inside it, the + a circle as tall as the bar 8px from it, 24px icons over 10px names, 20px from the
   bottom; a phone's tabs 65px (about 19px each side on a 375px screen), a wide screen's 84px */
:root {
  --dock-h: 54px;
}

.dock {
  bottom: 20px;
  gap: 8px;
}

.dock-nav {
  padding: 4px;
}

.dock-link {
  height: calc(var(--dock-h) - 8px);
  font-size: 10px;
  font-weight: 600;
}

.dock-link .icon {
  width: 24px;
  height: 24px;
}

.dock-nav .pill-bubble {
  top: 4px;
  height: calc(var(--dock-h) - 8px);
}

@media (max-width: 699px) {
  .dock-link {
    width: 65px;
    font-size: 10px;
  }
}

/* The dock's tabs on a wide screen: 84px (the user's pick, B — 96px was too wide) */
@media (min-width: 700px) {
  .dock-link {
    width: 84px;
  }
}

/* A phone's top, measured from the user's full-screen reference (to its screen's width): a smaller app mark
   (28px), a bolder 24px title, 38px round buttons; the page's pills 32px tall with 13px names, 14px in from
   their edges and 8px apart, 15px under the title row; 22px from the pills to the page */
@media (max-width: 699px) {
  .app {
    row-gap: 22px;
  }

  .topbar {
    row-gap: 15px;
  }

  .title-group {
    gap: 10px;
  }

  .app-mark {
    width: 28px;
    height: 28px;
    border-radius: 9px;
  }

  .page-title {
    font-size: 24px;
    font-weight: 800;
  }

  .top-actions .round-btn {
    width: 38px;
    height: 38px;
  }

  .top-actions .picker-btn {
    height: 38px;
  }

  .pills-host .tabs {
    gap: 7px;
  }

  .pills-host .tabs button {
    height: 32px;
    padding: 0 13px; /* Track's five pills still fit a 375px screen */
    font-size: 13px;
    font-weight: 600;
  }
}

/* The + sits within the bar's height: the bar's glass fades at its edges, the solid lime + doesn't, so at the
   same size the + reads taller — 6px less keeps it visibly inside the bar's top and bottom */
.dock-add {
  width: calc(var(--dock-h) - 6px);
  height: calc(var(--dock-h) - 6px);
}

/* A wide screen keeps the bigger dock (the reference's sizes are a phone's): 68px tall, the highlight 6px
   inside it, 28px icons over 11px names, the + 6px less than the bar, 84px tabs */
@media (min-width: 700px) {
  :root {
    --dock-h: 68px;
  }

  .dock-nav {
    padding: 6px;
  }

  .dock-link {
    height: calc(var(--dock-h) - 12px);
    font-size: 11px;
    font-weight: 650;
  }

  .dock-link .icon {
    width: 28px;
    height: 28px;
  }

  .dock-nav .pill-bubble {
    top: 6px;
    height: calc(var(--dock-h) - 12px);
  }

  /* the Accounts card keeps 16px clear of the taller dock */
  .acc-card.acc-has-stack {
    height: calc(100dvh - var(--top-h, 108px) - 144px);
    max-height: calc(100dvh - var(--top-h, 108px) - 144px);
  }
}

/* Safari draws a blurred glass background with too small a corner when the radius is "999px": the page's
   pills get their exact radius (half their height) and clip to it, so the glass, the rim and the shape
   match */
.pills-host .tabs button {
  border-radius: calc(var(--pill-h, 44px) / 2);
  overflow: hidden;
  isolation: isolate;
}

@media (max-width: 699px) {
  .pills-host .tabs button {
    --pill-h: 32px;
  }
}

/* Small round glass controls (page pills, the Plan view switch, the picker, round buttons, the dock): the
   card glass's diagonal rim and sheen (bright top-left and bottom-right) made a pill look tilted, and Safari
   let the blur spill past the round ends. Here the rim is even all round (a touch brighter on top), the
   sheen falls from the top, and the glass is clipped to the pill's own shape */
.tabs button.glass,
.pills.glass,
.picker-btn.glass,
.round-btn.glass,
.dock-nav.glass,
.dock-add.glass {
  clip-path: inset(0 round 999px);
}

.tabs button.glass::after,
.pills.glass::after,
.picker-btn.glass::after,
.round-btn.glass::after,
.dock-nav.glass::after,
.dock-add.glass::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.1) 45%, rgba(255, 255, 255, 0.1) 70%, rgba(255, 255, 255, 0.16) 100%);
}

.tabs button.glass::before,
.pills.glass::before,
.picker-btn.glass::before,
.round-btn.glass::before,
.dock-nav.glass::before,
.dock-add.glass::before {
  background: linear-gradient(180deg, var(--glass-sheen), transparent 60%);
}

/* a goal without a day: its status is just "No date", quiet */
.acc-prog-status.is-none {
  color: var(--text-3);
  font-weight: 600;
}

/* Saving plans' "Add to plan": a checkbox row under the dropdowns, with what the line will hold */
.acc-sx-plan {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.acc-sx-plan b {
  color: var(--text);
}

.acc-sx-plan input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--good);
  cursor: pointer;
}

/* A phone's dock grows with the screen: 375px wide keeps the reference's sizes (bar 54px, tabs 65px, 24px
   icons, 10px names, 20px from the bottom); from there it grows faster than the screen, by the user's ask
   ("make it bigger") — a 440px phone (iPhone 17 Pro Max) gets a 70px bar, 78px tabs, 26px icons, 11px
   names (30/12 was too big), the + 64px, about 20px each side; it stops growing a little past that (a 78px bar was tried and
   was too much) */
@media (max-width: 699px) {
  :root {
    --dock-grow: max(0px, 100vw - 375px);
    --dock-h: min(74px, calc(54px + var(--dock-grow) * 0.246));
    --dock-b: min(25px, calc(20px + var(--dock-grow) * 0.0615)); /* the Accounts card's height counts it, to stay 16px above the dock */
  }

  .dock {
    bottom: var(--dock-b);
    gap: min(10px, calc(8px + var(--dock-grow) * 0.0308));
  }

  .dock-link {
    width: min(82px, calc(65px + var(--dock-grow) * 0.2));
    font-size: min(11px, calc(10px + var(--dock-grow) * 0.0154));
  }

  .dock-link .icon {
    width: min(27px, calc(24px + var(--dock-grow) * 0.0308));
    height: min(27px, calc(24px + var(--dock-grow) * 0.0308));
  }
}

/* A phone, nothing picked: Total balance 8px under the title row (was 12px) and Set aside and Free to use
   6px under it (was 18px) — the user moved the row up, then Total balance a little down on its own */
@media (max-width: 700px) {
  .acc-card.acc-has-stack:not(.is-picked) .acc-head {
    row-gap: 8px;
  }

  .acc-card.acc-has-stack:not(.is-picked) .acc-sum {
    row-gap: 6px;
  }

  /* the Total balance figure alone 4px closer to its label (only it moves, nothing around it) */
  .acc-card.acc-has-stack:not(.is-picked) .acc-sum-bal b {
    position: relative;
    top: -4px;
  }
}

/* ---------- Phone pop-ups: 16px clear of the screen's edges on both sides ---------- */
@media (max-width: 699px) {
  #picker-pop {
    position: fixed;
    left: 16px;
    right: 16px;
    width: auto;
    top: calc(env(safe-area-inset-top, 0px) + 70px);
    transform-origin: top center;
  }

  .popover.month-pick,
  .popover.day-pick,
  .popover.chip-menu {
    max-width: calc(100vw - 32px);
  }

  #service-sheet,
  dialog.sheet:not(#settings) {
    max-width: calc(100vw - 32px);
  }
}

/* ---------- A phone held sideways: no desktop layout — a cover asks to turn it back ---------- */
.rotate-cover {
  display: none;
}

@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  .rotate-cover {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    text-align: center;
    padding: 24px;
    background: var(--bg);
    color: var(--text);
    font-weight: 700;
  }

  .rotate-cover small {
    color: var(--text-2);
    font-weight: 500;
  }
}

/* No double-tap zoom */
html {
  touch-action: manipulation;
}

/* ---------- Behind the dock: the blur reaches no higher than the dock's top edge (5 Oct) ---------- */
.edge-blur-bottom {
  --f: 16px;
  height: calc(var(--dock-b, 22px) + var(--dock-h));
}

/* A wide screen: no blur behind the dock (the user's call, 5 Oct) */
@media (min-width: 700px) {
  .edge-blur-bottom {
    display: none;
  }
}

/* ---------- A phone: pages show at once — no fade or slide between them ---------- */
/* The fade replayed on every switch and, with the glass cards' blur under it, left the page empty for a moment */
@media (max-width: 699px) {
  .section,
  [data-page="plan"] .section {
    animation: none;
  }
}

/* ---------- No rectangle behind the cards ---------- */
/* A section scrolls inside a box only 12–16px bigger than its cards, so the cards' big soft shadow
   was cut at the box's edge — a visible rectangle of shade. Inside a section the shadow is small
   enough to fit; an opened card (fixed, never clipped) keeps the big one. */
.section {
  --card-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  --glass-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.card-overlay {
  --card-shadow: 0 18px 44px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.35);
  --glass-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ---------- Log on a wide screen: a plan bar on each card, two cards to a row from 1440px ----------
   The user's measurements (tuner, 5 Oct): card 18/20 padding, 18 radius; name column 172px, name
   17px/650 (a longer one is set smaller on its own card, never wrapped); pills 10.5px, 3/8 padding,
   6 apart, 9 under the name; bar 8 thick, its words 12px, 5 from it; amount column 136px, amount 27,
   EGP 12; Refund and Delete 34, 9 apart; parts 20 apart; cards 19 across and 15 down; a day
   heading 33 above, 20 below. A phone keeps its list as it was (no bar; swipes). */
@media (min-width: 700px) {
  .log-list .pcard {
    padding: 18px 20px;
    border-radius: 18px;
  }

  /* Three lines on every card: the name, then two lines for the pills — what doesn't fit the first
     carries on to the second (app.js fitLogged drops what fits neither). An open note adds a
     fourth line across the whole card, so nothing on it gives way (the user, 2026-10-08). */
  .log-list .pcard-in,
  .log-list.no-rings .pcard-in {
    /* an amount too wide for its 136px is set smaller on its own card (app.js fitAmounts) */
    grid-template-columns: 172px minmax(0, 1fr) 136px auto;
    grid-template-rows: 24px 22px 22px; /* a name set smaller keeps the same line, so every card is one height */
    grid-template-areas:
      "head rings money acts"
      "chips rings money acts"
      "chips rings money acts";
    column-gap: 20px;
    row-gap: 7px;
  }

  .log-list .pcard-in:has(.pcard-note:not([hidden])),
  .log-list.no-rings .pcard-in:has(.pcard-note:not([hidden])) {
    grid-template-rows: 24px 22px 22px auto;
    grid-template-areas:
      "head rings money acts"
      "chips rings money acts"
      "chips rings money acts"
      "note note note note";
  }

  /* nothing for the third line (no note, the pills on one): the name and pills in the middle, the
     card keeping its height */
  .log-list .pcard.two-lines .pcard-in {
    grid-template-rows: 24px 22px;
    grid-template-areas:
      "head rings money acts"
      "chips rings money acts";
    align-content: center;
    min-height: 82px;
  }

  .log-list .pcard-chips {
    flex-wrap: wrap;
    align-content: flex-start;
    row-gap: 7px;
    height: 100%;
  }

  .log-list .pcard-rings,
  .log-list.no-rings .pcard-rings {
    display: block;
    min-width: 0;
  }

  .log-list .pcard-name {
    font-size: 17px;
    font-weight: 650;
  }

  .log-list .pcard-chips {
    column-gap: 6px;
  }

  .log-list .pcard-chips .chip {
    font-size: 10.5px;
    padding: 3px 8px;
  }

  .log-list .pcard-amount {
    font-size: 27px;
  }

  .log-list .pcard-amount .cur {
    font-size: 12px;
  }

  .log-list .pcard-acts {
    gap: 9px;
  }

  .log-list .pcard .pcard-pay.pcard-del,
  .log-list .pcard .pcard-pay.pcard-refund {
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding: 0;
  }

  /* the list's own gap is 10: 33 above a day, 20 below it */
  .log-list > .log-day {
    margin: 23px 4px 10px;
  }

  /* The bar */
  .log-bar {
    display: grid;
    gap: 5px;
    min-width: 0;
  }

  /* the bar's words are never cut: on a tight card they wrap */
  .lb-cap {
    min-width: 0;
    color: var(--text-2);
    font-size: 12px;
    line-height: 1.3;
    overflow-wrap: anywhere;
  }

  .lb-cap.top {
    color: var(--text-3);
  }

  .lb-cap b {
    color: var(--text);
    font-weight: 650;
  }

  .lb-cap .bad,
  .lb-cap .un {
    color: var(--bad-text);
    font-weight: 650;
  }

  /* a Daily line's week cut short by the over weeks before it — the Streak's orange, as unplanned is */
  .lb-cap .lb-trim {
    color: #ff9a3d;
    font-weight: 650;
  }

  .lb-track {
    position: relative;
    display: flex;
    height: 8px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.08);
  }

  .lb-track i {
    display: block;
    height: 100%;
  }

  .lb-track i:first-child {
    border-radius: 99px 0 0 99px;
  }

  .lb-before {
    background: color-mix(in srgb, var(--good) 38%, transparent);
  }

  .lb-this {
    background: var(--good);
    box-shadow: 0 0 10px color-mix(in srgb, var(--good) 45%, transparent);
    border-radius: 0 99px 99px 0;
  }

  .lb-this.mid {
    border-radius: 0;
  }

  .lb-over {
    background: var(--bad);
    box-shadow: 0 0 10px color-mix(in srgb, var(--bad) 45%, transparent);
    border-radius: 0 99px 99px 0;
  }

  .lb-tick {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 2px;
    margin-left: -1px;
    border-radius: 2px;
    background: #fff;
  }

  /* an unplanned card charge: the rest of its statement after it, dim, rounded at the end */
  .lb-track .lb-end {
    border-radius: 0 99px 99px 0;
  }
}

/* two to a row only where the bar keeps about 200px beside the fixed columns */
@media (min-width: 1440px) {
  .log-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 19px;
    row-gap: 15px;
  }

  /* a day and the card charges run across both */

  .log-list > .log-day,
  .log-list > .log-charges-row {
    grid-column: 1 / -1;
  }

  .log-list > .log-day {
    margin: 18px 4px 5px;
  }
}

/* ---------- Logging an income: one-time or recurring, and the account it goes into, side by side ---------- */
.income-ask {
  gap: 8px 14px;
}

.income-ask .xfer-line {
  flex: 1 1 200px;
}

.income-ask .xfer-line b {
  width: auto;
  white-space: nowrap;
}

.income-ask .xfer-sel:disabled {
  opacity: 0.7;
  cursor: default;
}

/* ---------- Log: the card charges, a row of their own — one card takes it all, two share it ---------- */
.log-charges-row {
  display: grid;
  gap: 10px;
}

@media (min-width: 700px) {
  .log-charges-row {
    grid-template-columns: repeat(var(--n, 1), minmax(0, 1fr));
    column-gap: 19px;
  }

  /* no buttons on these cards: the amount sizes to itself and ends at the card's right padding */
  .log-list .pcard.log-charges .pcard-in {
    grid-template-columns: max-content minmax(0, 1fr) auto;
    grid-template-areas:
      "head rings money"
      "chips rings money"
      "chips rings money";
  }

  .log-list .pcard.log-charges.two-lines .pcard-in {
    grid-template-areas:
      "head rings money"
      "chips rings money";
  }
}

/* Log's plan bar, over the plan: the bar is everything paid — the plan's share in solid green, the rest in red */
@media (min-width: 700px) {
  .lb-track .lb-full {
    border-radius: 99px 0 0 99px;
    background: var(--good);
    box-shadow: 0 0 10px color-mix(in srgb, var(--good) 45%, transparent);
  }
}

/* Log's income bar: its share of the month's plan, in income blue */
@media (min-width: 700px) {
  .log-bar.inc .lb-this {
    background: var(--key-inc);
    box-shadow: 0 0 10px color-mix(in srgb, var(--key-inc) 55%, transparent);
    border-radius: 99px;
  }
}

/* Home's account cards: Balance and Free to use, labelled, the same size (Free to use in lime); a pencil
   level with the title, on the card's right margin, opens the balance box (lime on hover) */
.pcard.log-total.glance.g-split .pcard-money {
  display: grid;
  gap: 22px; /* room between Balance and Free to use */
  margin-bottom: 6px !important;
}

.g-split .g-fig {
  display: grid;
  gap: 4px;
}

.g-split .g-fig-lab {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.g-split .g-fig.free .pcard-amount {
  color: var(--good-text);
}

.g-balance .g-bal-edit {
  position: absolute;
  z-index: 2;
  top: calc(var(--g-pad-t, 22px) + (var(--g-title, 19px) * 1.2 - 32px) / 2 + 6px); /* a little below the title's first line */
  right: var(--g-pad-x, 27px);
  width: 32px;
  height: 32px;
  transition: background 0.15s, color 0.15s;
}

.g-balance .g-bal-edit:hover,
.g-balance .g-bal-edit:focus-visible {
  background: var(--select);
  color: var(--select-ink);
}

.g-balance .g-bal-edit .icon {
  width: 16px;
  height: 16px;
}

/* the name keeps clear of the pencil, and wraps onto a second line when it can't fit beside it (the
   user's call for these cards, 5 Oct) */
.pcard.glance.g-balance:has(.g-bal-edit) > .pcard-name {
  padding-right: calc(32px + 8px);
  white-space: normal;
  overflow-wrap: break-word;
  text-overflow: clip;
}

.g-balance .g-bal-set[hidden] {
  display: none;
}

/* the wide row of accounts: nothing under the figures until the box opens */
@media (min-width: 1000px) {
  .ov-grid.glances.accounts-row .glance-viz:not(:has(.g-bal-set:not([hidden]))) {
    min-height: 0;
    height: 0;
    margin: 0;
    padding: 0;
  }

  .ov-grid.glances.accounts-row .g-bal-set:not([hidden]) {
    margin-top: 10px;
  }

  .ov-grid.glances.accounts-row > .pcard.glance.g-split {
    padding-bottom: 26px;
  }
}

/* the wide row of accounts: every name takes two lines (a one-word name keeps the room), so the
   figures start level on every card */
@media (min-width: 1000px) {
  .ov-grid.glances.accounts-row > .pcard.glance.g-split > .pcard-name {
    min-height: calc(var(--g-title, 19px) * 1.2 * 2);
  }
}

/* ---------- Every grey button turns lime under the pointer (the user's rule, 5 Oct) ----------
   Round buttons (the top bar's arrows, eye and settings, a sheet's close, the pencil…), grey buttons
   (PAY, PAY ALL, OPEN…), a card's grey Paid / Refund, the pop-ups' answers and the PIN keys. Red
   buttons (Delete) and buttons already lime or pressed keep their own look. */
@media (hover: hover) {
  :is(
      .round-btn:not(.danger):not(:disabled),
      .btn:not(.btn-primary):not(.danger):not(.armed):not(:disabled),
      .pcard-pay:not(.on):not(.pcard-del):not(.late):not([aria-disabled="true"]),
      .fund-opt:not([aria-pressed="true"]),
      .pin-key
    ):hover {
    color: var(--select) !important;
    box-shadow: inset 0 0 0 1px rgba(198, 244, 50, .55) !important;
  }
  /* No lime fill under the pointer either (3 Dec 2026, the user: "why?" at a lime-filled Sign In): the words and icon turn
     lime, the button keeps its glass */
}

/* ---------- A card's action, top right (the user's rule, 7 Oct) ----------
   A figure card's button (DONE, RENEWED, PAY BACK) sits at its top right; two of them share one line
   at the same size. Insights are the exception: read first, then act — their buttons sit under the
   sentence (above). */
.pcard.glance.has-act {
  position: relative;
}

.g-act {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 2;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
}

.g-act .btn {
  margin: 0;
}

@media (max-width: 699px) {
  /* A phone: a card with an action, and Overdraft's Charges, take the full width for their rows,
     under the title, the figure and the button */
  .g-act {
    top: 13px;
    right: 14px;
  }

  .ov-grid.glances > .pcard.glance:is(.has-act, .od-stack) {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .ov-grid.glances > .pcard.glance:is(.has-act, .od-stack) .glance-viz {
    width: 100%;
    margin-top: 10px;
  }

  .insights > .insight {
    min-height: 0;
  }
}

/* ---------- Track › Car › Papers: each date a box that reads as text; amber when it's due, red once
   it's run out ---------- */
.paper-date {
  position: relative;
  display: inline-block;
  font-weight: 700;
  cursor: pointer;
}

.paper-date input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  color-scheme: dark;
}

.paper-date:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.paper-date.unset {
  color: var(--text-3);
  font-weight: 600;
}

.paper-date.soon {
  color: var(--log-reading, #e0a84e);
}

.paper-date.over {
  color: var(--bad-text);
}

/* ---------- Track › Overdraft ---------- */
.ov-grid.od-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Interest & Fees and Movements: side by side, the same height */
.ov-cards.od-pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.ov-cards.od-pair > .card {
  height: 100%;
  box-sizing: border-box;
}

.od-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* Five boxes of one size, what each holds in its label */
.od-fields {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-top: 6px;
}

.od-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
}

.od-field > span {
  overflow: hidden;
  color: var(--text-2);
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.od-field :is(input, select) {
  width: 100%;
  min-width: 0;
  height: 38px;
  box-sizing: border-box;
  padding: 0 12px;
  text-align: right;
}

.od-note {
  margin: 12px 0 0;
  font-size: 12px;
}

@media (max-width: 999px) {
  .ov-cards.od-pair {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 699px) {
  .ov-grid.od-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .od-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .od-field > span {
    white-space: normal;
  }
}

/* ---------- Plan › Table › Spent ---------- */
.view-toggle.sv-toggle button {
  width: auto;
  padding: 0 14px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
}

th .sv-head {
  display: block;
  margin-top: 2px;
  color: var(--text-3);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

th .sv-head.on {
  color: var(--good-text);
}

td.cell.money.sv-cell {
  position: relative;
}

td.cell.money.sv-cell.sv-over .cell-in {
  color: var(--bad-text);
}

.sv-diff {
  position: absolute;
  right: 12px;
  bottom: 3px;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.sv-over .sv-diff {
  color: var(--bad-text);
}

td.cell.money.sv-ahead .cell-in,
td.calc.sv-ahead {
  opacity: 0.45;
}

/* Plan vs Spending: outside the table's glass, its header like every section header */
.sv-out {
  flex: none;
}

.sv-recs .pay-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "name amt btn"
    "when amt btn";
}

.sv-recs .pay-row .btn {
  grid-area: btn;
}

/* A phone: Track's six tabs (Overdraft joined, 7 Oct) don't fit 375 px — the row swipes sideways, as
   the Plan's category pills do, rather than pushing the page wider */
@media (max-width: 699px) {
  .tabs[data-pills="sections:tracker"] {
    min-width: 0;
    max-width: 100%;
  }

  .tabs[data-pills="sections:tracker"]::-webkit-scrollbar {
    display: none;
  }

  .tabs[data-pills="sections:tracker"] > button {
    flex: none;
  }
}

/* Track › Loan › Clears: the months to go as the figure, the loan as a grid of months under it —
   a row a year, a cell a month (tracker-view.js) */
.g-clears .pcard-amount .cur {
  text-transform: lowercase;
}

.cl-grid {
  display: grid;
  gap: 6px;
}

.cl-row {
  display: grid;
  grid-template-columns: 2.4em 1fr;
  align-items: center;
  gap: 6px;
}

.cl-year {
  color: var(--text-3);
  font-size: calc(var(--g-ins-name-size) * 0.72);
  font-variant-numeric: tabular-nums;
}

.cl-cells {
  display: grid;
  grid-template-columns: repeat(12, minmax(8px, 1fr));
  gap: 3px;
}

/* the months' initials over the grid */
.cl-head .cl-cells b {
  color: var(--text-3);
  font-size: 9px;
  font-weight: 600;
  text-align: center;
  line-height: 1;
}

.cl-grid .cl-head {
  margin-bottom: -2px;
}

.cl-cell {
  display: block;
  aspect-ratio: 1;
  border-radius: 3px;
  background: color-mix(in srgb, var(--text-3) 22%, transparent);
}

.cl-cell.none { background: none; }
.cl-cell.paid { background: var(--good); }
.cl-cell.last { background: none; box-shadow: inset 0 0 0 1.5px var(--good); }
.cl-cell.last.paid { background: var(--good); }

.cl-key {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 10px;
  color: var(--text-3);
  font-size: calc(var(--g-ins-name-size) * 0.8);
}

.cl-key span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cl-key .cl-cell {
  width: 9px;
  height: 9px;
}

/* Saving plans, name and notes (2026-10-15): an optional Name above the Goal amount; Notes under Save in;
   on the tile the note is hidden behind an i after the name (as in the Log) and opens under the progress, wrapped, a hairline above it. The name replaces the item's name there and
   the item moves into a pill. Neither is a money figure, so private mode leaves them be */
#acc-sheet .acc-sx-namebox {
  margin-bottom: 4px;
}

#acc-sheet .acc-sx-name {
  text-align: center;
}

.acc-sx-notesrow {
  align-items: start;
}

.acc-sx-notesrow .acc-sx-lab {
  padding-top: 14px;
}

#acc-sheet textarea.acc-sx-notes {
  height: auto;
  min-height: 84px;
  padding: 12px 14px;
  resize: none;
  text-align: left;
  line-height: 1.4;
}

.acc-line-note {
  margin: 12px 0 0;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12.5px;
  font-style: italic;
  font-weight: 550;
  line-height: 1.4;
  overflow-wrap: anywhere;
  white-space: normal;
}

.acc-line-id .note-i {
  margin-left: -2px;
}

/* Saving plans (2026-10-15): Details is a chevron (expand / collapse), not an i — the i after a plan's name
   is for its notes alone; the chevron turns up while the list is open */
.acc-info .acc-chev {
  transition: transform 0.2s ease;
}

.acc-info.on .acc-chev {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .acc-info .acc-chev {
    transition: none;
  }
}

/* Plan, desktop card view (2026-10-15): the cards run sideways, so a row of dots under them — one for each
   screenful, the one in view long — says there is more to the right; click a dot to go there. None when the
   cards all fit. A phone keeps its own .card-dots */
.card-screens {
  display: none;
}

@media (min-width: 700px) {
  .card-screens {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    height: 6px;
    margin-top: 10px;
  }

  .card-screens button {
    width: 6px;
    height: 6px;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: var(--text-3);
    opacity: 0.45;
    cursor: pointer;
    transition: width 0.2s ease, opacity 0.2s ease;
  }

  .card-screens button::before {
    content: "";
    position: absolute;
    inset: -8px -3px; /* a bigger target than the dot */
  }

  .card-screens button {
    position: relative;
  }

  .card-screens button.on {
    width: 18px;
    background: var(--text);
    opacity: 1;
  }

  .card-screens button:focus-visible {
    outline: 2px solid var(--good);
    outline-offset: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card-screens button {
    transition: none;
  }
}

/* Plan on a phone (2026-10-15): an All pill first in the category row opens every category with its total,
   in place of the cards; a tap on a category there opens its cards. A wide screen has no All pill */
.cat-pills button.cat-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 15px 0 12px;
}

.cat-pills button.cat-all .icon {
  width: 15px;
  height: 15px;
  flex: none;
}

.cat-pills button.cat-all span {
  display: block;
  line-height: 1;
}

@media (min-width: 700px) {
  .cat-pills button.cat-all {
    display: none;
  }
}

.cats-page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
}

.cats-sum {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px 10px;
  border-bottom: 1px solid var(--line);
}

.cats-lab {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cats-sum b {
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.cats-sum small,
.cats-amt small {
  margin-left: 3px;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 600;
}

.cats-list {
  display: grid;
  gap: 8px;
  align-content: start;
  overflow-y: auto;
  padding: 2px 2px 6px;
  scrollbar-width: none;
}

.cats-list::-webkit-scrollbar {
  display: none;
}

.cats-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 14px 0 10px;
  border: 0;
  border-radius: 18px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.cats-ic {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--raised);
  color: var(--good-text);
}

.cats-ic .icon {
  width: 18px;
  height: 18px;
}

.cats-name {
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
}

.cats-amt {
  font-size: 16px;
  font-weight: 700;
}

/* A paid bill's card (2026-10-15, the user's pick, "lime wash"): the glass is tinted lime from its top corner,
   fading to plain glass, with a hairline lime edge and a faint inner glow — no thick rim. Past due keeps its red
   rim. The line that closes round the edge while holding to pay still plays, then goes */
.pcard.paid.glass,
.pcard.paid.glass:hover {
  background: linear-gradient(150deg, color-mix(in srgb, var(--good) 26%, transparent), color-mix(in srgb, var(--good) 7%, transparent) 62%), var(--card);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 38%, transparent), inset 0 0 44px color-mix(in srgb, var(--good) 9%, transparent), 0 8px 24px rgba(0, 0, 0, 0.12);
}

.pcard.paid:not(.holding) .pcard-hold rect {
  opacity: 0;
}

/* Plan cards' icons (2026-10-15, the user's final word): the rounded-square tile is back, the lime glyph on its
   light lime tile as before (no circle), now duotone — the closed shapes tinted a little inside the line. The
   name sits 10 px beside it as before */
.card-pages .pcard .item-ic.card-ic .icon :is(rect, circle, ellipse, polygon, path[d$="z"], path[d$="Z"]):not([fill]) {
  fill: color-mix(in srgb, currentColor 24%, transparent);
}

/* Plan cards' item names (2026-10-15): 18 px by default (was 16), on a phone as on a wide screen; Settings › Cards
   › Name still changes it, and a name too long for its card still shrinks on that card alone */
.card-pages .pcard .pcard-name {
  font-size: var(--card-name);
}

/* Each Plan card icon sits on the middle of its tile (2026-10-15): moved by what its drawing is off-centre in
   its box (--icy, measured in icons.js; a percentage of the icon's own height, so any icon size) */
.card-pages .pcard .item-ic.card-ic .icon {
  transform: translateY(calc(var(--icy, 0) * 4.1667%));
}

/* Plan cards' amounts, bigger (2026-10-15): 36 px on a wide screen (--card-amount, was 32; Settings › Cards › Amount
   still changes it) and 26 px on a phone (was 20); a figure too long for its card is still shrunk to fit */
@media (max-width: 699px) {
  .card-pages .pcard .pcard-amount {
    font-size: 26px;
  }
}

/* No glow on the percentage rings (2026-10-16, the user's call): the key colour stays, the soft halo round the
   arc goes — Plan cards, Home and Log alike. (The streak's rings and the Accounts arcs keep theirs.) */
.pring .pring-fill,
.pring.cat .pring-fill,
.pring.inc .pring-fill,
.pring.good .pring-fill {
  filter: none !important;
}

/* A fully paid bill's amount is lime (2026-10-16); past its plan it stays red */
.pcard.bill-paid .pcard-amount:not(.over) {
  color: var(--good-text);
}

/* Backdrop colours and darkness (2026-10-15): the second-colour row gains a "none" swatch; past the default, a black
   layer (--scrim, set in app.js) dims the lights so the page can go nearly black */
.bg-swatch.none {
  background: repeating-linear-gradient(45deg, #2a2e24 0 6px, #1b1f16 6px 12px);
}

.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(0, 0, 0, var(--scrim, 0));
  pointer-events: none;
}

/* A Plan line with a saving plan (17 Oct): the card's lime pill under the amount (it hides when there's no room) and
   the table's lime coin beside a month's amount */
/* the money block runs the card's width so the pill has the room to the right of the amount; its one column stays
   as wide as the amount, so the amount and the line under it sit exactly as on a card without a pill */
.pcard-money:has(.pcard-saving) {
  position: relative;
  width: 100%;
  justify-self: stretch;
  grid-template-columns: max-content;
  justify-content: start;
}

.pcard-saving {
  position: absolute;
  right: 0;
  top: calc(var(--card-amount, 36px) * 0.62);
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--good) 12%, transparent);
  color: var(--good);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.pcard-saving .icon {
  width: 14px;
  height: 14px;
  flex: none;
}

.pcard-saving.sv-compact .sv-w,
.pcard-saving.sv-coin .sv-w,
.pcard-saving.sv-coin .sv-n,
.pcard-saving.gone {
  display: none;
}

.pcard-saving.sv-coin {
  padding: 5px 6px;
}

/* no room for even the coin beside the amount: a lime coin on the corner of the item's icon */
.pcard.sv-badge .card-ic {
  position: relative;
}

.pcard.sv-badge .card-ic::after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--good);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b2307' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 5c-1.5 0-2.8 1.4-3 2-3.5-1.5-11-.3-11 5 0 1.8 0 3 2 4.5V20h4v-2h3v2h4v-4c1-.5 1.7-1 2-2h2v-4h-2c0-1-.5-1.5-1-2V5z'/%3E%3Cpath d='M2 9v1c0 1.1.9 2 2 2h1'/%3E%3C/svg%3E");
  background-size: 11px;
  background-position: center;
  background-repeat: no-repeat;
}

.cell-saving {
  position: absolute;
  right: var(--coin-right, 100px); /* set by placeCoins(): the figure's measured width + 6px */
  top: 50%;
  transform: translateY(-50%);
  display: inline-grid;
  color: var(--good);
}

.cell-saving .icon {
  width: 15px;
  height: 15px;
}

/* A phone (17 Oct): the saving pill replaces the verdict line under the amount — no hover there, and little room
   beside the amount. A wide screen keeps the pill beside the amount and hides this line. */
.pcard-sv-line {
  display: none;
  align-items: center;
  gap: 5px;
  color: var(--good);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pcard-sv-line .icon {
  width: 14px;
  height: 14px;
  flex: none;
}

@media (max-width: 699px) {
  .pcard-sv-line {
    display: inline-flex;
  }

  .pcard-money:has(.pcard-sv-line) .pcard-vs,
  .pcard-money:has(.pcard-sv-line) .pcard-logged,
  .pcard-money:has(.pcard-sv-line) .pcard-extra,
  .pcard-saving {
    display: none !important;
  }

  .pcard.sv-badge .card-ic::after {
    display: none;
  }
}

/* ---------- Plan cards: four circles of one size and one style (17 Oct, the user's final layout) ----------
   the item icon (top left), the done button (top right), the % ring and the due date (the foot, the date at
   the right end). Waiting: a soft grey disc, white glyph (the done button's look). Paid: filled lime, dark
   glyph. Overdue: filled red. The size is the ring's (Settings › Cards › Ring), 4 px less on a phone. */
:root {
  --card-circle: var(--card-ring, 38px);
}

@media (max-width: 699px) {
  :root {
    --card-circle: calc(var(--card-ring, 38px) - 4px);
  }
}

.pcard .item-ic.card-ic,
.card-pages .pcard .item-ic.card-ic {
  width: var(--card-circle);
  height: var(--card-circle);
  border-radius: 50%;
  background: var(--raised);
  color: var(--text);
}

.pcard.bill-paid .item-ic.card-ic {
  background: var(--select);
  color: var(--select-ink);
}

.pcard.bill-late .item-ic.card-ic {
  background: var(--bad);
  color: #2b0f0c;
}

.card-pages .pcard .item-ic.card-ic .icon :is(rect, circle, ellipse, polygon, path[d$="z"], path[d$="Z"]):not([fill]) {
  fill: none; /* the tile's glyph is a plain line, white on the grey disc, dark on lime or red */
}

.pcard .pcard-pay,
:root .pcard .pcard-pay.late {
  width: var(--card-circle) !important;
  height: var(--card-circle) !important;
  padding: 0 !important;
  border-radius: 50%;
  background: var(--raised);
  color: var(--text);
}

.pcard .pcard-pay .icon {
  width: 17px;
  height: 17px;
}

/* the done button is a check in a circle at every card width: the PAID / MARK AS PAID word that a wide card
   used to show beside it is gone (its tooltip says it) */
:root .pcard .pcard-pay > span {
  display: none !important;
}

.pcard .pcard-pay.on,
.pcard .pcard-pay.on:hover {
  background: var(--select);
  color: var(--select-ink);
}

:root .pcard .pcard-pay.late {
  background: var(--bad);
  color: #2b0f0c;
}

/* the foot: the rings, and the due-date circle at the right end, on the same line */
.pcard-rings {
  align-items: center;
}

/* the foot runs the card's width so the due-date circle can sit at its right end */
.pcard-rings:has(.pcard-due.dc) {
  width: 100%;
  justify-self: stretch;
}

.pcard .pcard-due.dc {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: var(--card-circle);
  height: var(--card-circle);
  padding: 0;
  gap: 0;
  margin-left: auto;
  flex: none;
  border-radius: 50%;
  background: var(--raised);
  color: var(--text);
  line-height: 1;
}

.pcard .pcard-due.dc i {
  margin-bottom: 1px;
  font-size: 6.5px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.07em;
}

.pcard .pcard-due.dc b {
  font-size: 15px;
  font-weight: 750;
}

.pcard .pcard-due.dc .icon {
  width: 17px;
  height: 17px;
}

.pcard .pcard-due.dc.paid {
  background: var(--select);
  color: var(--select-ink);
}

.pcard .pcard-due.dc.late {
  background: var(--bad);
  color: #2b0f0c;
}

@media (max-width: 699px) {
  .pcard .pcard-due.dc i {
    font-size: 6px;
  }

  .pcard .pcard-due.dc b {
    font-size: 13.5px;
  }
}

/* a phone's ring is the circle's size too (34 px, not 38) */
@media (max-width: 699px) {
  .card-pages .pcard .pring {
    --ring: var(--card-circle) !important;
  }

  /* the drawing scales with the ring, so it stays centred on its figure (it was left at 38 px in a 34 px box) */
  .card-pages .pcard .pring svg {
    width: 100%;
    height: 100%;
  }
}

/* Optical centring of the amount block (17 Oct): its box is centred between the pills and the rings, but the big
   figure's line box has about 13 px of air above the digits and the insight under it only about 4 px below its
   baseline (and its descenders), so the gap above the figure looked bigger. The block moves up by half the
   difference (0.16 of the figure's size) so the visible space above the digits and below the insight is the same. */
@media (min-width: 700px) {
  .card-pages .pcard .pcard-money {
    position: relative;
    top: calc(var(--card-amount, 36px) * -0.16);
  }
}

@media (max-width: 699px) {
  .card-pages .pcard:has(.pcard-chips.empty) .pcard-money {
    position: relative;
    top: -4px;
  }
}

/* ---------- The unpaid done button invites a tap (17 Oct, the user's pick: C) ----------
   Waiting: an empty lime ring with a lime check — an open checkbox. Due within 3 days: the ring pulses softly.
   Overdue: the red fill pulses. Paid keeps its solid lime. */
.pcard .pcard-pay:not(.on):not(.late) {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--select);
  color: var(--select);
}

.pcard .pcard-pay:not(.on):not(.late):hover {
  background: color-mix(in srgb, var(--select) 22%, transparent);
  color: var(--select);
}

.pcard .pcard-pay.soon:not(.on):not(.late) {
  animation: pay-pulse 1.8s ease-in-out infinite;
}

:root .pcard .pcard-pay.late {
  animation: pay-pulse-late 1.8s ease-in-out infinite;
}

@keyframes pay-pulse {
  0%, 100% { box-shadow: inset 0 0 0 2px var(--select), 0 0 0 0 color-mix(in srgb, var(--select) 45%, transparent); }
  50% { box-shadow: inset 0 0 0 2px var(--select), 0 0 0 6px color-mix(in srgb, var(--select) 0%, transparent); }
}

@keyframes pay-pulse-late {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad) 50%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--bad) 0%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  .pcard .pcard-pay.soon,
  :root .pcard .pcard-pay.late {
    animation: none;
  }
}

/* Brand logos on the Plan cards' round tile follow the tile's ink (17 Oct): white on the grey disc, dark on the
   lime (paid) or red (overdue) fill — they were white on lime, which didn't read */
.pcard .item-ic.card-ic .icon.brand {
  color: inherit;
}

/* ---------- Home › At a Glance: one frame, each card its own content (17 Oct, the user's design) ----------
   Title, figure and insight on shared lines; under them a content zone of the same height (120 px) that holds the
   card's own kind of content — the Upcoming timeline, the Streak bar, the Allowance rings, the Credit Cards rows.
   The cards are as tall as that frame, so no empty floor and no gap above the content; a phone stacks them in
   the same frame. */
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) {
  grid-template-rows: none;
  grid-auto-rows: auto;
  row-gap: 12px;
  align-items: stretch;
}

:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) > .pcard.glance {
  grid-row: auto;
  display: flex;
  flex-direction: column;
  grid-template-rows: none;
  align-items: stretch;
  gap: 0;
  margin-bottom: 0;
  min-height: 0;
  padding: 16px;
  border-radius: 20px;
}

:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) > .pcard.glance > .pcard-name {
  grid-area: auto;
  height: 24px;
  line-height: 24px;
  font-size: 18px;
}

:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) > .pcard.glance > .pcard-money {
  grid-area: auto;
  display: block;
  margin-top: 0;
  padding-top: 16px; /* air between the title and the figure */
  margin-bottom: 0; /* (an older rule left 9 px under it) */
}

:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) > .pcard.glance .pcard-amount {
  display: block;
  height: 44px;
  line-height: 44px;
  margin: 0;
  font-size: 34px;
}

:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) > .pcard.glance .pcard-vs {
  display: block;
  height: 16px;
  margin-top: 2px;
  overflow: hidden;
  font-size: 12px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) > .pcard.glance > .glance-viz {
  grid-area: auto;
  flex: none;
  height: 104px;
  min-height: 104px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: stretch;
}

/* Streak: a bar to the next step */
.gspec .sk-bar {
  position: relative;
  display: flex;
  align-items: center;
  height: 64px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--raised);
}

.gspec .sk-bar u {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: var(--good);
}

.gspec .sk-bar.amb u {
  background: var(--warn, #e6b455);
}

.gspec .sk-bar.crit u {
  background: var(--bad);
}

.gspec .sk-bar span {
  position: relative;
  padding-left: 24px;
  color: var(--select-ink);
  font-size: 14px;
  font-weight: 700;
}

.gspec .sk-bar b {
  font-size: 28px;
  font-weight: 800;
}

/* Allowance: up to three rings across the zone (the lines list a phone used to show is not needed) */
.gspec .g-rings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: center;
  gap: 6px;
  height: 100%;
}

.gspec .g-ring-list {
  display: none !important;
}

/* Credit Cards: a row a card — its name with its due date under it, the amount at the right */
.gspec .g-cards-list {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.gspec .g-amt {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
}

.gspec .g-amt .g-ring-name {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
  font-size: 15px;
  font-weight: 650;
}

.gspec .g-amt .g-ring-name i {
  color: var(--text-3);
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
}

.gspec .g-amt .g-amt-fig {
  font-size: 20px;
}

/* the frame is the same on a phone: the figure and its insight on the left, and the zone has no backdrop of its own */
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) > .pcard.glance > .pcard-money {
  align-self: stretch;
  justify-self: stretch;
  text-align: left;
}

:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) > .pcard.glance .pcard-amount,
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) > .pcard.glance .pcard-vs {
  text-align: left;
  justify-self: start;
}

:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) > .pcard.glance > .glance-viz {
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
  width: auto;
}

:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) > .pcard.glance > .glance-viz::before,
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) > .pcard.glance > .glance-viz::after {
  content: none;
}

/* Allowance's rings: 74 px across (the design's 64 px, 15% bigger), the stroke drawn at 6 of 64 (it scales with the ring) */
.gspec .g-ring .pring {
  --ring: 74px !important; /* 64 px × 1.15 */
}

.gspec .g-ring .pring circle {
  r: 29px;
  stroke-width: 6px;
}

/* the figure inside Allowance's rings, smaller (17 Oct): 0.2 of the ring (it was 0.26) */
.gspec .g-ring .pring b.amt {
  font-size: calc(var(--ring) * 0.2);
}

/* ---------- Home on a phone: all four cards in one screen, 2 × 2 (17 Oct, the user's layout) ----------
   12 px padding; title 18 px, 6 px, figure 32 px, insight 14 px, 10 px, a 66 px content zone: a card is about
   174 px tall and the two rows leave room for the Accounts cards under them. Given up against the wide
   cards: the insight lines are the short ones, Upcoming shows names and amounts only (no dates, no timeline),
   Allowance is a list of its lines instead of rings, Credit Cards keeps its due dates. */
@media (max-width: 699px) {
  :is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 10px;
    row-gap: 10px;
  }

  :is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) > .pcard.glance {
    padding: 12px;
    border-radius: 20px;
  }

  :is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) > .pcard.glance > .pcard-name {
    height: 18px;
    font-size: 15px;
    line-height: 18px;
  }

  :is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) > .pcard.glance > .pcard-money {
    padding-top: 8px;
  }

  :is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) > .pcard.glance .pcard-amount {
    height: 32px;
    font-size: 26px;
    line-height: 32px;
  }

  :is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) > .pcard.glance .pcard-amount .cur {
    font-size: 9px;
  }

  :is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) > .pcard.glance .pcard-vs {
    height: 14px;
    margin-top: 0;
    font-size: 11px;
    line-height: 14px;
  }

  :is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) > .pcard.glance > .glance-viz {
    height: 66px;
    min-height: 66px;
    margin-top: 8px;
  }

  /* Streak: a 58 px bar */
  .gspec .sk-bar {
    height: 58px;
  }

  .gspec .sk-bar span {
    padding-left: 16px;
    font-size: 11px;
  }

  .gspec .sk-bar b {
    font-size: 26px;
  }

  /* Allowance: the lines as a list, not rings */
  .gspec .g-rings {
    display: none;
  }

  .gspec .g-ring-list {
    display: grid !important;
    align-content: center;
    gap: 0;
    height: 100%;
  }

  .gspec .g-ring-list .g-row {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 22px;
    margin: 0;
    padding: 0;
  }

  .gspec .g-ring-list {
    margin: 0;
    padding: 0;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    justify-items: stretch;
    align-self: stretch;
    justify-self: stretch;
    width: 100%;
  }

  .gspec .g-ring-list .g-name {
    padding: 0;
    margin: 0;
    text-align: left;
  }

  .gspec .g-ring-list .g-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-size: 12px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .gspec .g-ring-list .g-val {
    font-size: 12px;
    font-weight: 750;
  }

  .gspec .g-ring-list .g-val .cur {
    display: none;
  }

  /* Credit Cards: two 33 px rows */
  .gspec .g-amt {
    height: 33px;
    gap: 8px;
  }

  .gspec .g-amt .g-ring-name {
    font-size: 12.5px;
    gap: 1px;
  }

  .gspec .g-amt .g-ring-name i {
    font-size: 10px;
  }

  .gspec .g-amt .g-amt-fig {
    font-size: 14px;
  }

  .gspec .g-amt .g-amt-fig .cur {
    display: none;
  }
}

/* ---------- The glass cards' shared frame, on Home, Log, Loan, Cards and Overdraft (17 Oct, docs/08-glass-cards.md) ----------
   Parts in order: title, figure, insight (in its state's colour), an optional meter line, an optional widget zone
   (104 px; a phone 66 px; three rows at most, or one widget). Lime good, red over or late, bright orange something close. */
:root {
  --soon: #ff9f1c;
}

:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) > .pcard.glance .pcard-vs.t-good { color: var(--good-text); }
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) > .pcard.glance .pcard-vs.t-bad { color: var(--bad-text); }
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) > .pcard.glance .pcard-vs.t-soon { color: var(--soon); }

.ov-grid.glances.gspec.log-totals-g { margin-bottom: 14px; }

/* the zone is left out when a card has nothing for it */
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) > .pcard.glance > .glance-viz:empty { display: none; }

/* the meter line, under the insight */
.gspec .g-ml {
  flex: none;
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--raised);
}
.gspec .g-ml u { display: block; height: 100%; border-radius: inherit; background: var(--good); }
.gspec .g-ml.bad u { background: var(--bad); }

/* rows in the zone: a name (and a small line under it), the amount at the right */
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) .glance-viz .g-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 28px;
  font-size: 14px;
}
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) .glance-viz .g-row.s2 { height: 34px; }
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) .glance-viz .g-name { flex: 1; min-width: 0; font-size: 14px; }
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) .glance-viz .g-name small { display: block; margin-top: 1px; font-size: 11px; line-height: 1.1; }
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) .glance-viz .g-val { font-size: 14px; }
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) .glance-viz .g-val .cur { display: none; }

/* a split bar (Cards, Home › Credit Cards): each card's share, in its own colour */
.gspec .g-split {
  display: flex;
  flex: none;
  height: 10px;
  margin-bottom: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--raised);
}
.gspec .g-split u { display: block; height: 100%; }

/* Loan › Clears: the loan month by month, no legend and no month letters */
.gspec .cl-grid { gap: 5px; width: 100%; }
.gspec .cl-row { grid-template-columns: 34px 1fr; gap: 8px; height: 12px; }
.gspec .cl-year { font-size: 11px; font-weight: 700; }
.gspec .cl-cells { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; }
.gspec .cl-cell { aspect-ratio: auto; height: 10px; }

/* Loan › Of Income: a ring and three rows */
.gspec .g-incm { display: flex; align-items: center; gap: 14px; height: 100%; }
.gspec .g-incm-rows { flex: 1; min-width: 0; }
.gspec .g-pie {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 72px;
  height: 72px;
}
.gspec .g-pie::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--good) calc(var(--p) * 1%), var(--raised) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
}
.gspec .g-pie i { font-size: 15px; font-style: normal; font-weight: 750; color: #fff; }

/* Overdraft: Owed's limit bar, Charges' countdown, Next Added's before and after */
.gspec .g-od-bar { position: relative; flex: none; height: 22px; border-radius: 999px; background: var(--raised); }
.gspec .g-od-bar u { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--good); }
.gspec .g-od-bar.warn u { background: var(--soon); }
.gspec .g-od-bar.bad u { background: var(--bad); }
.gspec .g-od-bar i { position: absolute; top: 0; bottom: 0; width: 1px; background: color-mix(in srgb, var(--text) 30%, transparent); }
.gspec .g-od-bar.thin { height: 10px; }
.gspec .g-od-scale, .gspec .g-od-ends { display: flex; justify-content: space-between; margin-top: 5px; color: var(--text-3); font-size: 11px; font-weight: 650; }
.gspec .g-od-ends { margin: 0 0 5px; }
.gspec .g-od-ends span:nth-child(2) { color: var(--text-2); }
.gspec .g-od-track { margin-bottom: 6px; }
.gspec .g-od-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.gspec .g-od-stats div, .gspec .g-od-step div { display: grid; gap: 2px; padding: 8px 10px; border-radius: 12px; background: color-mix(in srgb, var(--text) 7%, transparent); }
.gspec .g-od-stats em, .gspec .g-od-step em { color: var(--text-3); font-size: 11px; font-style: normal; font-weight: 650; }
.gspec .g-od-stats b, .gspec .g-od-step b { font-size: 15px; font-weight: 750; }
.gspec .g-od-stats b.ok { color: var(--good-text); }
.gspec .g-od-step { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-bottom: 6px; }
.gspec .g-od-step svg { width: 16px; height: 16px; color: var(--text-3); }

/* a card's action is a round icon in the title row, at the right (no written buttons on a card) */
.gspec .g-act { top: 16px; right: 16px; } /* the button is as tall as the title's line (24 px; a phone 18) */
.gspec .g-act-btn {
  display: grid;
  width: 24px;
  height: 24px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--good);
  color: var(--select-ink);
  cursor: pointer;
}
.gspec .g-act-btn svg { width: 14px; height: 14px; }

/* Log's credit cards: the next row, sharing it, in their wallet colours; Cycle and Due as two blocks in the zone */
.log-charges-row.gspec { column-gap: 12px; }
.gspec > .pcard.glance.g-cc[style] {
  background: linear-gradient(160deg, var(--c1), var(--c2) 60%, var(--c3));
  border-color: color-mix(in srgb, var(--em) 40%, transparent);
}
.gspec > .pcard.glance.g-cc[style] > .pcard-name { color: var(--em); }
.gspec .cc-two { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; height: 100%; }
.gspec .cc-blk { display: grid; gap: 6px; }
.gspec .cc-top { display: flex; align-items: baseline; justify-content: space-between; color: var(--text-2); font-size: 14px; font-weight: 650; }
.gspec .cc-top b { color: var(--text); font-size: 18px; font-weight: 750; }
.gspec .cc-sub { display: flex; justify-content: space-between; color: var(--text-3); font-size: 12px; font-weight: 600; }
.gspec .cc-blk .g-ml { margin-top: 0; }

@media (max-width: 699px) {
  .gspec .g-ml { height: 6px; margin-top: 8px; }
  :is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) .glance-viz .g-row, :is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) .glance-viz .g-row.s2 { height: 22px; font-size: 12px; }
  :is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) .glance-viz .g-name, :is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) .glance-viz .g-val { font-size: 12px; }
  :is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) .glance-viz .g-name small { display: none; }
  .gspec .g-split { height: 8px; margin-bottom: 4px; }
  .gspec .cl-grid { gap: 2px; }
  .gspec .cl-row { grid-template-columns: 22px 1fr; gap: 5px; height: 7px; }
  .gspec .cl-year { font-size: 8px; line-height: 1; }
  .gspec .cl-cells { gap: 2px; }
  .gspec .cl-cell { height: 5px; border-radius: 2px; }
  .gspec .g-pie { display: none; }
  .gspec .g-od-bar { height: 14px; }
  .gspec .g-od-bar.thin { height: 8px; }
  .gspec .g-od-scale, .gspec .g-od-ends { margin-top: 3px; font-size: 10px; }
  .gspec .g-od-ends { margin: 0 0 3px; }
  .gspec .g-od-track { margin-bottom: 2px; }
  .gspec .od-owed { justify-content: space-between; }
  .gspec .od-owed .g-od-stats { order: -1; display: flex; justify-content: space-between; gap: 6px; margin: 0; }
  .gspec .od-owed .g-od-stats div { display: flex; gap: 4px; padding: 0; background: none; }
  .gspec .od-owed .g-od-stats em, .gspec .od-owed .g-od-stats b { font-size: 12px; }
  .gspec .od-owed .g-od-stats div:first-child em::after { content: ""; }
  .gspec .od-owed .g-od-bar { flex: 1; min-height: 20px; margin-block: 5px; border-radius: 10px; }
  .gspec .od-owed .g-od-bar u { border-radius: 10px; }
  .gspec .od-owed .g-od-scale { margin: 0; }
  .gspec .od-charges .g-row, .gspec .od-charges .g-row.s2 { height: 20px; }
  .gspec .g-od-step { gap: 6px; margin-bottom: 2px; }
  .gspec .g-od-step div { padding: 5px 7px; border-radius: 9px; }
  .gspec .g-od-step b { font-size: 12px; }
  .gspec .g-od-step em { font-size: 10px; }
  .gspec .g-od-step svg { width: 12px; height: 12px; }
  .gspec .g-act { top: 12px; right: 12px; }
  .gspec .g-act-btn { width: 18px; height: 18px; }
  .gspec .g-act-btn svg { width: 11px; height: 11px; }
  /* Log's credit cards stay half width on a phone, two to a row, the two blocks stacked */
  .log-charges-row.gspec { grid-template-columns: repeat(var(--n, 1), minmax(0, 1fr)); column-gap: 10px; }
  .gspec .cc-two { grid-template-columns: 1fr; gap: 12px; height: auto; }
  .gspec .cc-top { height: 16px; font-size: 12px; }
  .gspec .cc-top b { font-size: 12px; }
  .gspec .cc-sub { display: none; }
  .gspec .cc-blk { gap: 4px; }
}

/* the figure block keeps no margin of its own under it (an older variable left 9 px there, so the zone sat 27 px under the insight) */
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) { --g-num-mb: 0px; --g-num-mt: 0px; }

/* Home's zone content fits the 104 px zone: timeline rows and ring names on tight lines */
.gspec .g-ring { gap: 4px; }
.gspec .g-ring .g-ring-name { line-height: 1.15; }
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) .g-ring .g-ring-name { max-width: 100%; margin: 0; font-size: 11px; line-height: 1.15; }
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) .g-ring { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: auto; line-height: 1; }
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) .g-ring { height: 94px; justify-content: flex-start; }
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) .g-ring .pring { margin: 0; }
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) .g-ring { height: 100px; gap: 2px; }
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) .g-ring .g-ring-name { font-size: 10.5px; }
.gspec .g-rings { align-content: start; padding-top: 2px; }
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) .glance-viz { gap: 0; }
.gspec .g-od-bar { height: 20px; }
.gspec .g-od-bar.thin { height: 10px; }
.gspec .g-od-scale { margin-top: 4px; line-height: 14px; }
.gspec .g-od-stats { margin-top: 8px; }
.gspec .g-od-stats div, .gspec .g-od-step div { padding: 6px 10px; }
@media (max-width: 699px) {
  .gspec .g-od-bar { height: 14px; }
  .gspec .g-od-bar.thin { height: 8px; }
  .gspec .g-od-stats div, .gspec .g-od-step div { padding: 0; }
  .gspec .g-od-step div { padding: 5px 7px; }
}

/* an insight is one line: it ends in an ellipsis rather than leaving the card */
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) > .pcard.glance > .pcard-money { min-width: 0; overflow: hidden; }
@media (max-width: 699px) {
  /* an odd last card (Overdraft's third) takes the whole row */
  .ov-grid.glances.gspec > .pcard.glance:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (max-width: 699px) {
  .gspec .od-owed .g-od-stats div:last-child em { display: none; }
  .gspec .od-owed .g-od-stats div:last-child b::after { content: " free"; color: var(--text-2); font-weight: 650; }
}

@media (max-width: 699px) {
  /* "2.1 Million" in the figure: smaller, so the unit stays beside it */
  .gspec > .pcard.glance.g-million .pcard-amount { font-size: 21px; }
}

/* ---------- Track › Car: the four cards on the glass-card spec (17 Oct, docs/08) ----------
   Four across (two from 700 to 1099 px, 2 × 2 on a phone); the amounts keep their unit in the small grey tag (EGP, km),
   which the other glass cards' rows leave out */
.ov-grid.glances.gspec.car-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1099px) {
  .ov-grid.glances.gspec.car-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 699px) {
  .ov-grid.glances.gspec.car-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.car-grid.gspec .glance-viz .g-val .cur { display: inline; margin-left: 4px; color: var(--text-3); font-size: 0.72em; font-weight: 700; }
.car-grid.gspec .glance-viz .paper-date { font-weight: 750; }
.car-grid.gspec .glance-viz .g-name { color: var(--text-2); }

/* ---------- Home › Accounts: the header carries the picker, the balance card is on the glass-card parts (17 Oct, docs/08) ---------- */
.ov-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 8px;
}
.ov-head-row > .ov-head { margin: 0; }
.ov-head-row .g-acct-pick {
  width: auto;
  min-width: max-content; /* the whole account name, never cut */
  max-width: 62%;
  height: 28px;
  padding: 0 28px 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
/* the very wide screen shows every account side by side and needs no picker */
@media (min-width: 1000px) {
  .ov-head-row .g-acct-pick { display: none; }
}
.ov-grid.glances.balance-row { margin-top: 0; }

.ov-grid.glances.balance-row > .pcard.g-bal2 {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  padding: 16px;
  border-radius: 20px;
}
.g-bal2 .pcard-name { height: 24px; margin: 0; font-size: 18px; line-height: 24px; }
.g-bal2 .g-bal-edit {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 24px;
  height: 24px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--text) 16%, transparent);
  color: var(--text);
}
.g-bal2 .g-bal-edit .icon { width: 14px; height: 14px; }
.g-bal2 .g-figs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.g-bal2 .g-fig { display: grid; min-width: 0; }
.g-bal2 .g-fig-lab { height: 16px; color: var(--text-3); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; line-height: 16px; text-transform: uppercase; }
.g-bal2 .pcard-amount { height: 44px; font-size: 34px; font-weight: 750; line-height: 44px; white-space: nowrap; }
.g-bal2 .pcard-amount .cur { margin-left: 5px; color: var(--text-3); font-size: 11px; }
.g-bal2 .g-fig.free .pcard-amount { color: var(--good-text); }
.g-bal2.over .g-fig:first-child .pcard-amount { color: var(--bad-text); }
.g-bal2 .pcard-vs { display: block; height: 16px; margin-top: 2px; overflow: hidden; color: var(--text-3); font-size: 12px; font-weight: 600; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
.g-bal2 .pcard-vs.t-good { color: var(--good-text); }
.g-bal2 .g-ml { flex: none; height: 8px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: var(--raised); }
.g-bal2 .g-ml u { display: block; height: 100%; border-radius: inherit; background: var(--good); }
.g-bal2 .g-bal-set { width: 100%; margin-top: 10px; text-align: left; }
.g-bal2 .g-bal-set[hidden] { display: none; }

@media (max-width: 699px) {
  /* the headers on a phone: 20 px above, 10 below */
  /* the mount is a grid with its own 10 px gap, so the margins are 10 above and none below; the first header sits 20 under the pills */
  .ov-mount.home > .ov-head,
  .ov-mount.home > .ov-head-row { margin: 10px 0 0; }
  .ov-mount.home > .ov-head:first-child { margin-top: -2px; }
  .ov-mount.home > .ov-head-row > .ov-head { margin: 0; }
  .ov-grid.glances.balance-row > .pcard.g-bal2 { padding: 12px; }
  .g-bal2 .pcard-name { height: 18px; font-size: 15px; line-height: 18px; }
  .g-bal2 .g-bal-edit { top: 12px; right: 12px; width: 18px; height: 18px; }
  .g-bal2 .g-bal-edit .icon { width: 11px; height: 11px; }
  .g-bal2 .g-figs { margin-top: 8px; }
  .g-bal2 .g-fig-lab { height: 14px; font-size: 11px; line-height: 14px; }
  .g-bal2 .pcard-amount { height: 32px; font-size: 26px; line-height: 32px; }
  .g-bal2 .pcard-amount .cur { margin-left: 4px; font-size: 9px; }
  .g-bal2 .pcard-vs { height: 14px; font-size: 11px; line-height: 14px; }
  .g-bal2 .g-ml { height: 6px; margin-top: 8px; }
}

/* the balance card's parts fill its width (the card centres what is narrower than it, which left the meter line at no width and the two figures huddled left) */
.g-bal2 > .g-figs, .g-bal2 > .pcard-vs, .g-bal2 > .g-ml, .g-bal2 > .g-bal-set { align-self: stretch; width: 100%; }

/* Home › Credit Cards on a phone: two 33 px rows fill the 66 px zone — a colour tag, the name over its due date, the amount */
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) .glance-viz .cc-r2 { display: flex; align-items: center; gap: 8px; height: 33px; }
.gspec .cc-tag { flex: none; width: 3px; height: 26px; border-radius: 2px; }
.gspec .cc-nm { display: grid; flex: 1; min-width: 0; }
.gspec .cc-nm b { font-size: 12px; font-weight: 700; line-height: 1.2; }
.gspec .cc-nm i { color: var(--text-3); font-size: 10.5px; font-style: normal; font-weight: 600; line-height: 1.2; }
.gspec .cc-r2 .g-val { font-size: 12px; font-weight: 750; }
.gspec .cc-r2.over .g-val { color: var(--bad-text); }
/* Home's own zone rule gave the zone a 10 px gap: none, so a phone's two 33 px rows fill it */
[data-page="dashboard"] .ov-grid.glances.gspec:not(.balance-row):not(.accounts-row) .pcard.glance .glance-viz { gap: 0; }

/* Home › Allowance's rings: every ring on one line 3 px under the zone's top, its name 6 px under it (17 Oct) — the names no longer hug
   the rings on a wide card and no longer drop to the zone's floor; the rings stay level when one name wraps to two lines */
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) .g-rings { align-content: start; padding-top: 3px; }
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) .g-ring { height: auto; justify-content: flex-start; gap: 6px; }
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) .g-ring .g-ring-name { line-height: 1.1; }

/* Home › Allowance: the rings give way on a compact card — 74 px when the zone has room for three with 8 px between, smaller when it has not,
   so they never touch (17 Oct); the figure inside scales with the ring */
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) .g-rings { container-type: inline-size; gap: 8px; }
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) .g-ring .pring { --ring: min(74px, calc((100cqw - 16px) / 3)) !important; }


/* ---------- Home › Insights on the glass-card spec (17 Oct, docs/08): two to a row, a full row on a phone; Make Cuts takes the row ---------- */
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row).ins-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 699px) {
  :is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row).ins-grid { grid-template-columns: minmax(0, 1fr); }
}
.gspec .g-act { gap: 6px; }
.gspec .g-act-btn.sec { background: color-mix(in srgb, var(--text) 16%, transparent); color: var(--text); }

/* the month as a strip of days */
.gspec .ins-strip { display: grid; grid-template-columns: repeat(var(--n, 31), 1fr); gap: 2px; height: 26px; flex: none; }
.gspec .ins-strip i { display: block; border-radius: 2px; background: var(--raised); }
.gspec .ins-strip i.s { background: var(--good); }
.gspec .ins-strip i.c { background: var(--soon); }
.gspec .ins-strip i.u { background: var(--bad); }
.gspec .ins-slab { display: flex; justify-content: space-between; margin: 4px 0 6px; color: var(--text-3); font-size: 11px; font-weight: 650; }
@media (max-width: 699px) {
  .gspec .ins-strip { height: 18px; gap: 1px; }
  .gspec .ins-slab { margin: 3px 0 2px; font-size: 10px; }
}

/* Make Cuts: the whole row — over now, the cuts as pills, over after */
:is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) > .pcard.glance.ins-cuts-card { grid-column: 1 / -1; height: auto; }
.ins-cuts-body { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: start; margin-top: 16px; }
.ins-fig b { display: block; color: var(--bad-text); font-size: 34px; font-weight: 750; line-height: 44px; }
.ins-fig b.ok { color: var(--good-text); }
.ins-fig small { display: block; color: var(--text-3); font-size: 12px; font-weight: 650; }
.ins-fig.end { text-align: right; }
.ins-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ins-pill { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--text) 6%, transparent); font-size: 12px; font-weight: 650; white-space: nowrap; }
.ins-pill b { margin-left: 4px; color: var(--good-text); font-weight: 750; }
.ins-pill.more { border-style: dashed; color: var(--text-2); }
.ins-cuts-rows { margin-top: 8px; }
/* the card's own width decides: wide enough, over now / the cuts as pills / over after on one line; narrower (a phone, a half window),
   the two figures side by side and the first cuts as rows */
.ins-cuts-card { container-type: inline-size; container-name: ins; }
.ins-cuts-rows { display: none; margin-top: 8px; }
@container ins (max-width: 559px) {
  .ins-cuts-body { grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
  .ins-pills { display: none; }
  .ins-cuts-rows { display: block; }
  .ins-fig b { font-size: 26px; line-height: 32px; }
  .ins-fig small { font-size: 11px; }
  .ins-cuts-rows .g-row { display: flex; align-items: center; justify-content: space-between; height: 22px; font-size: 12px; }
}

/* the pop-up */
.cuts-sheet { width: min(640px, calc(100vw - 32px)); max-height: min(720px, 88vh); padding: 0; overflow: hidden; }
.cuts-sheet .sheet-inner { display: flex; flex-direction: column; max-height: min(720px, 88vh); padding: 0; }
.cuts-sheet .sheet-head { padding: 18px 20px 4px; }
.cuts-sum { margin: 0; padding: 0 20px 12px; color: var(--text-2); font-size: 13px; }
.cuts-sum b { color: var(--bad-text); font-weight: 750; }
.cuts-list { flex: 1; min-height: 0; overflow: auto; padding: 4px 12px; border-block: 1px solid var(--line); }
.cuts-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 8px; border-radius: 12px; cursor: pointer; }
.cuts-row:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.cuts-cb { display: grid; width: 22px; height: 22px; place-items: center; border: 2px solid color-mix(in srgb, var(--text) 35%, transparent); border-radius: 7px; color: transparent; }
.cuts-cb .icon { width: 13px; height: 13px; stroke-width: 3; }
.cuts-row.on .cuts-cb { border-color: var(--good); background: var(--good); color: var(--select-ink); }
.cuts-nm { display: grid; min-width: 0; }
.cuts-nm b { overflow: hidden; font-size: 14px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.cuts-nm i { color: var(--text-3); font-size: 12px; font-style: normal; font-weight: 600; }
.cuts-sv { display: flex; align-items: center; color: var(--good-text); font-size: 15px; font-weight: 750; }
.cuts-sv .cut-amt { width: 76px; height: 30px; padding: 0 4px; border: 0; background: transparent; color: inherit; font: inherit; text-align: right; }
.cuts-sv .cut-amt:focus { background: color-mix(in srgb, var(--text) 10%, transparent); border-radius: 8px; outline: none; }
.cuts-row:not(.on) .cuts-nm b, .cuts-row:not(.on) .cuts-sv { color: var(--text-3); }
.cuts-row:not(.on) .cut-amt { text-decoration: line-through; }
.cuts-foot { display: grid; gap: 10px; padding: 12px 16px 16px; }
.cuts-res { margin: 0; color: var(--text-2); font-size: 13px; }
.cuts-res b { color: var(--text); font-weight: 750; }
.cuts-res b.ok { color: var(--good-text); }
.cuts-btns { display: flex; gap: 10px; }
.cuts-btns .btn { flex: 1; height: 44px; }
.cuts-toast { display: flex; align-items: center; justify-content: space-between; margin: 0 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--text) 8%, transparent); font-size: 13px; font-weight: 650; }
.cuts-toast[hidden] { display: none; }
.cuts-toast button, .toast-undo { border: 0; background: none; color: var(--good-text); font: inherit; font-weight: 800; cursor: pointer; }
.cuts-sv .cut-amt { width: auto; min-width: 3ch; field-sizing: content; }
.cuts-sv > span { margin-right: 1px; }
.cuts-sv .cut-amt { min-width: 0; padding: 0 2px; }
.cuts-sv > span { margin-right: 0; }

.cuts-sheet .sheet-inner:focus { outline: none; }

/* the pop-up has the app's rounded corners */
dialog.cuts-sheet { border-radius: 26px; }

/* "+N more": a pill on a wide card, a row on a narrow one, each with an arrow — it opens the pop-up */
.ins-pill.more { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
.ins-pill.more .icon { width: 12px; height: 12px; }
.ins-more-row { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 22px; padding: 0; border: 0; background: none; color: var(--text-2); font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
.ins-more-ic { display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--text) 16%, transparent); color: var(--text); }
.ins-more-ic .icon { width: 11px; height: 11px; }

/* "+N more" opens the Make Cuts card down: the rest of the cuts show, the arrow turns up, the words say Show less */
.ins-cuts-card .extra { display: none; }
.ins-cuts-card.expanded .ins-pill.extra { display: inline-block; }
.ins-cuts-card.expanded .g-row.extra { display: flex; }
.ins-cuts-card .mt-less { display: none; }
.ins-cuts-card.expanded .mt-more { display: none; }
.ins-cuts-card.expanded .mt-less { display: inline; }
.ins-cuts-card .ins-chev { transition: transform 0.2s ease; }
.ins-cuts-card.expanded .ins-chev { transform: rotate(180deg); }

/* insight fixes: the lanes in a pop-up, the Update all bar */
.cuts-lane { padding: 10px 10px 2px; color: var(--text-3); font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.cuts-sv.bad { color: var(--bad-text); }
.cuts-row:not(.on) .cuts-sv.bad { color: var(--text-3); }
.cuts-res b.bad { color: var(--bad-text); }
.cuts-res b.ok { color: var(--good-text); }
.ins-bar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; margin-top: 4px; color: var(--good-text); font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.ins-bar button { padding: 6px 12px; border: 0; border-radius: 999px; background: var(--good); color: var(--select-ink); font: inherit; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; cursor: pointer; }

/* ---------- Logged cards: Refund and Delete are round (17 Oct, the user's report: they looked oval) ----------
   The Plan's circle rules made them 38 px tall while an older rule kept them 34 px wide. Both are now the
   card circle (the ring's size; a phone 4 px less). Refund is the lime ring (an action); Delete is a red
   ring with a red trash that fills red under the pointer. */
:root:root .pcard .pcard-pay.pcard-del,
:root:root .pcard .pcard-pay.pcard-refund {
  flex: none;
  width: var(--card-circle) !important;
  min-width: var(--card-circle);
  height: var(--card-circle) !important;
  padding: 0 !important;
}

:root:root .pcard .pcard-pay.pcard-del {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--bad);
  color: var(--bad-text);
}

:root:root .pcard .pcard-pay.pcard-del:hover {
  background: var(--bad);
  color: var(--bad-ink);
}

/* ---------- Home › Accounts (18 Oct): All Accounts pinned, the accounts paged beside it, a dot per page ----------
   Three accounts a page from 1100 px, two under that, one on a phone (the pinned card 42% wide). The pager snaps a
   page at a time; its dots sit under it (the current page a white pill). Every account card is tinted all over in
   its Track › Accounts card colour (--c1..--c3, --acc from CARD_TONES); a tap opens it in Track. */
.acc-pager {
  --pin: 260px;
  --per: 3;
  display: grid;
  grid-template-columns: var(--pin) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
@media (max-width: 1100px) {
  .acc-pager { --per: 2; }
}
@media (max-width: 699px) {
  .acc-pager { --pin: 42%; --per: 1; }
}
.acc-pg { min-width: 0; }
.acc-pg-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  border-radius: 20px;
}
.acc-pg-track::-webkit-scrollbar { display: none; }
.acc-pg-track > .pcard.g-acc { flex: 0 0 calc((100% - 12px * (var(--per) - 1)) / var(--per)); scroll-snap-align: start; }
.acc-pager .pcard.g-acc {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  min-height: 0;
  padding: 16px;
  border-radius: 20px;
  cursor: pointer;
}
.acc-pager .g-acc .g-figs { grid-template-columns: 1fr; }
.acc-pager .g-acc .g-acc-note { margin-top: 8px; }
.acc-pager .pcard.glass.g-acc.tinted {
  background: linear-gradient(135deg, var(--c1), var(--c2) 55%, var(--c3)) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--acc) 38%, transparent);
}
.acc-pager .pcard.glass.g-acc.tinted::before,
.acc-pager .pcard.glass.g-acc.tinted::after { opacity: 0.5; }
.acc-pager .g-acc.tinted .g-acc-note { color: color-mix(in srgb, var(--acc) 70%, #fff); }
.acc-pager .g-acc:focus-visible { outline: 2px solid var(--select); outline-offset: 2px; }
.acc-pg-dots { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 12px; margin-top: 14px; }
.acc-pg-dots button {
  all: unset;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: width 0.2s, background 0.2s;
}
.acc-pg-dots button[aria-current="true"] { width: 36px; background: #fff; }
.acc-pg-dots button:focus-visible { outline: 2px solid var(--select); outline-offset: 3px; }
@media (max-width: 699px) {
  .acc-pager .pcard.g-acc { padding: 12px; }
  .acc-pager .g-acc .pcard-amount { font-size: 24px; }
  .acc-pager .g-acc .g-acc-note { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .acc-pg-dots button { transition: none; }
}
@media (max-width: 699px) {
  .acc-pager .g-acc .acc-long { display: none; } /* "free to use" reads "free" beside the pinned card's narrow 116 px */
}

/* ---------- Track: the Add wizard and several trackers of a type (2026-10-18) ---------- */

/* The wizard: tracker-wizard.html in a frame, over a scrim — a bottom sheet on a phone, a centred panel from 700 px */
.tw-host {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.tw-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  animation: tw-fade 0.2s ease-out;
}

.tw-frame {
  position: relative;
  width: 100%;
  height: min(94dvh, 860px);
  max-height: 94dvh;
  max-width: 560px;
  border: 0;
  border-radius: 30px 30px 0 0;
  background: transparent;
  animation: tw-rise 0.34s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition: height 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* A wide screen: a centred panel that simply appears (the slide from the bottom is the phone's) */
@media (min-width: 700px) {
  .tw-host {
    align-items: center;
  }

  .tw-frame {
    border-radius: 30px;
    max-height: 94vh;
    animation: none;
    transition: none;
  }
}

@keyframes tw-fade {
  from {
    opacity: 0;
  }
}

@keyframes tw-rise {
  from {
    transform: translateY(100%);
  }
}

html.tw-open {
  overflow: hidden;
}

/* The Add pill: a lime ring, like the other + buttons */

/* One tracker of a type open, the others picked by name */
.tk-pick {
  display: flex;
  flex: none;
  gap: 6px;
  margin: 0 0 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tk-pick::-webkit-scrollbar {
  display: none;
}

.tk-pill {
  flex: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--text-2);
  font: inherit;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}

.tk-pill:hover {
  color: var(--text);
}

.tk-pill[aria-selected="true"] {
  background: var(--select);
  color: var(--select-ink);
  border-color: var(--select);
  font-weight: 600;
}

/* An account of another bank: its name where the logo would be */
.acc-bankname {
  font-size: 5cqw;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Track's pills carry their type's icon; a coin's $ is cut out in the pill's own colour */
.tabs button {
  --icon-cut: #1d2410;
}

.tabs button[aria-selected="true"] {
  --icon-cut: var(--select);
}

.tabs button .icon {
  width: 18px;
  height: 18px;
  margin-right: -1px;
}

/* A pill's name being typed over it */
.tk-rename {
  position: fixed;
  z-index: 400;
  box-sizing: border-box;
  padding: 0 16px;
  border-radius: 999px;
  border: 2px solid var(--select);
  background: #14190c;
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 650;
  outline: none;
}

/* Edit mode of the wizard: its progress bars are buttons; the edit pencil on Track's pill row; the small chooser under it */
.tk-edit {
  flex: none;
}

.tk-menu {
  position: fixed;
  z-index: 350;
  display: grid;
  gap: 4px;
  min-width: 190px;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: #14190c;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.tk-menu button {
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tk-menu button:hover {
  background: var(--select);
  color: var(--select-ink);
}

/* Track's sections are one dropdown (18 Oct): the open one is the button, a chevron on it; the others are in the menu it opens
   (sectionMenu in app.js). The add + sits beside the edit pencil on the far right. */
@media (max-width: 699px) {
  .tabs[data-pills="sections:tracker"] > button:not([aria-selected="true"]) {
    display: none;
  }
}

.tk-chev {
  display: none;
  flex: none;
  width: 7px;
  height: 7px;
  margin: -3px 0 0 6px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

@media (max-width: 699px) {
  .tabs[data-pills="sections:tracker"] .tk-chev {
    display: block;
  }
}

.tk-sections .tk-chev {
  display: none !important;
}

/* Accounts and Credit Cards stay first: no grip, nothing dragged above them */
.tk-sections .is-pinned .tk-grip {
  visibility: hidden;
}

.tabs.tk-dragging {
  user-select: none;
}

.tabs .is-dragged {
  opacity: 0.7;
  transform: scale(1.04);
}

.tk-sections {
  min-width: 210px;
}

.tk-sections button {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.tk-sections button[aria-current="true"] {
  font-weight: 700;
  color: var(--good-text, #c6f432);
}

.tk-sections button:hover .icon {
  --icon-cut: var(--select);
}

/* The grip at the end of a section row in Track's dropdown: drag to reorder */
.tk-grip {
  flex: none;
  width: 14px;
  height: 18px;
  margin-left: auto;
  background: radial-gradient(circle, currentColor 1.4px, transparent 1.6px) 0 0 / 7px 6px;
  opacity: 0.45;
  cursor: grab;
  touch-action: none;
}

.tk-sections .dragging {
  background: var(--select);
  color: var(--select-ink);
}

/* A mark-done button that isn't done yet is an outline of its colour, not filled (18 Oct): lime for what is waiting, red for what is
   late; once it is marked it fills lime (.on). Refund and delete buttons keep their own look. */
:root .pcard .pcard-pay:not(.on):not(.late):not(.pcard-del):not(.pcard-refund) {
  background: transparent;
  color: var(--good-text);
  box-shadow: inset 0 0 0 1.5px var(--select);
}

:root .pcard .pcard-pay.late:not(.on) {
  background: transparent;
  color: var(--bad-text);
  box-shadow: inset 0 0 0 1.5px var(--bad);
}

/* Track cards' mark-done buttons (service done, papers renewed): the same outline until it's done */
.gspec .g-act-btn:is([data-service-done], [data-paper-renew]) {
  background: transparent;
  color: var(--good-text);
  box-shadow: inset 0 0 0 1.5px var(--select);
}

/* One size for a card's action button (18 Oct): 32 px, the same as the buttons on the Saving Plan items, on every card and at every width */
:root {
  --act-size: 32px;
}

.gspec .g-act-btn,
.gspec .g-act-btn:is([data-service-done], [data-paper-renew]) {
  width: var(--act-size) !important;
  height: var(--act-size) !important;
}

.gspec .g-act-btn svg {
  width: 16px !important;
  height: 16px !important;
}

:root .pcard .pcard-pay,
:root .pcard .pcard-pay.late {
  width: var(--act-size) !important;
  height: var(--act-size) !important;
}

/* Home's account cards' edit pencil: the standard action size too */
.g-bal2 .g-bal-edit {
  width: var(--act-size) !important;
  height: var(--act-size) !important;
  top: 14px;
  right: 14px;
}

/* a phone's card is narrow: the pencil tucks into the corner so the name keeps its room */
@media (max-width: 699px) {
  .g-bal2 .g-bal-edit {
    top: 6px;
    right: 6px;
  }

  .g-bal2.has-edit .pcard-name,
  .g-bal2:has(.g-bal-edit) .pcard-name {
    padding-right: 28px;
  }
}

.g-bal2 .g-bal-edit .icon {
  width: 16px !important;
  height: 16px !important;
}

/* Insights: the approve and review buttons are outlines too (they mark nothing done yet); the grey "Not now" stays as it is */
.gspec .ins-card .g-act-btn:not(.sec) {
  background: transparent;
  color: var(--good-text);
  box-shadow: inset 0 0 0 1.5px var(--select);
}

/* Plan's categories are pills again on a phone (a test, 18 Oct): the dropdown's chevron stays off — flip `.cat-chev` to display: block inside a phone media query to bring it back */
.cat-chev {
  display: none;
}

.tk-sections .cat-chev {
  display: none !important;
}


.tk-sections button.cat-late {
  color: var(--bad-text);
}

.tk-sections {
  max-height: min(64vh, 520px);
  overflow-y: auto;
}


/* Plan's categories: the pills scroll in their own box and the + that adds a category stands beside it at the far right (18 Oct) */
.cat-bar {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 4px;
}

.cat-bar .cat-pills {
  flex: 1;
  min-width: 0;
  margin: 0 !important;
  padding-left: 3px !important;
  padding-right: 2px !important;
}

.cat-bar .cat-pill-add {
  flex: none;
  margin-top: 0; /* level with the pills (it was 2 px lower: the user, 7 Nov 2026) */
}

@media (max-width: 699px) {
  .cat-bar {
    margin-bottom: 14px;
  }
}

/* A wide screen: the pills scroll under the + (it floats over their end, with a soft edge) */
@media (min-width: 0) {
  .cat-bar {
    position: relative;
  }

  .cat-bar .cat-pill-add {
    position: absolute;
    top: 2px;
    right: 0;
    z-index: 2;
  }

  /* the pills fade out where they pass under the + (no box behind it), and the last one can scroll clear of it */
  .cat-bar .cat-pills {
    padding-right: 60px !important;
    -webkit-mask-image: linear-gradient(to right, transparent 0, rgba(0, 0, 0, 0.5) calc(var(--fl) / 2), #000 var(--fl), #000 calc(100% - 40px - var(--fr)), rgba(0, 0, 0, 0.55) calc(100% - 40px - var(--fr) * 0.55), rgba(0, 0, 0, 0.15) calc(100% - 40px - var(--fr) * 0.2), transparent calc(100% - 40px));
    mask-image: linear-gradient(to right, transparent 0, rgba(0, 0, 0, 0.5) calc(var(--fl) / 2), #000 var(--fl), #000 calc(100% - 40px - var(--fr)), rgba(0, 0, 0, 0.55) calc(100% - 40px - var(--fr) * 0.55), rgba(0, 0, 0, 0.15) calc(100% - 40px - var(--fr) * 0.2), transparent calc(100% - 40px));
    transition: --fl 0.35s ease, --fr 0.35s ease;
  }
}


/* The category pills snap — one pill at the start edge at a time, never a free scroll (18 Oct) */
.cat-bar .cat-pills {
  scroll-snap-type: x mandatory;
  scroll-padding-left: 3px;
}

.cat-bar .cat-pills button {
  scroll-snap-align: start;
}


/* The left fade's width is a registered length, so it eases in while the pills move and eases out when they settle (no flick) */
@property --fl {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

@property --fr {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

/* the right fade stays on at rest (more pills lie beyond the +) and goes only when the row is scrolled to its end, so the last category is solid */
.cat-bar .cat-pills {
  --fr: 80px;
}

.cat-bar .cat-pills.at-end {
  --fr: 0px;
}

.cat-bar .cat-pills.is-moving {
  --fl: 18px;
}

/* The open category pill: lime filled, dark inside (18 Oct rule) — whatever is in the category (paid on time / overdue) */
.cat-pills button[aria-selected="true"] {
  background: var(--select);
  border-color: var(--select);
  box-shadow: none;
  color: var(--select-ink);
}

.cat-pills button[aria-selected="true"] .icon {
  color: var(--select-ink);
}

/* open and late: red filled */
.cat-pills button[aria-selected="true"].cat-late {
  background: var(--bad);
  border-color: var(--bad);
  color: #2b0f0c;
}

.cat-pills button[aria-selected="true"].cat-late .icon {
  color: #2b0f0c;
}

/* A category with a late payment pulses red (outline or filled) until it is dealt with */
@keyframes cat-late-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 90, 78, 0.55);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(255, 90, 78, 0);
  }
}

.cat-pills button.cat-late {
  animation: cat-late-pulse 1.8s ease-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .cat-pills button.cat-late {
    animation: none;
  }
}

/* A late bill's red date circle pulses (18 Oct) — it replaces the "Overdue · N days" line */
@keyframes due-late-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 90, 78, 0.6);
  }

  50% {
    box-shadow: 0 0 0 7px rgba(255, 90, 78, 0);
  }
}

.pcard .pcard-due.dc.late {
  animation: due-late-pulse 1.8s ease-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .pcard .pcard-due.dc.late {
    animation: none;
  }
}

/* Log's "At a Glance" heading gets the same room above its cards as Home's (22 px) */
.log-glance-head {
  margin-bottom: 22px;
}

/* Plan › Income, a received card (18 Oct): its icon is lime filled, as a paid bill's is */
.pcard.paid[data-src] .item-ic.card-ic {
  background: var(--select);
  color: var(--select-ink);
}

/* …and on a phone the ring caption ("of the month's income") goes, the % ring is the date circle's size, and the date circle
   sits at the card's right edge on the same line as the ring */
@media (max-width: 699px) {
  .card-pages .pcard .pcard-rings .pring-cap {
    display: none;
  }

  .card-pages .pcard .pcard-rings.rings-tight .pring,
  .card-pages .pcard .pcard-rings.rings-tighter .pring {
    --ring: var(--card-circle) !important;
  }

  .card-pages .pcard[data-src] .pcard-rings {
    justify-content: space-between;
    align-items: center;
  }

  .card-pages .pcard[data-src] .pcard-rings > .pcard-due {
    margin-left: auto;
  }
}

/* a received income's amount is lime, as a paid bill's is */
.pcard.paid[data-src] .pcard-amount {
  color: var(--good-text);
}

/* (18 Oct, a test) a phone's Plan cards drop the item icon, so the name has the room beside the action icon */
@media (max-width: 699px) {
  .card-pages .pcard .pcard-head .item-ic.card-ic {
    display: none;
  }
}

/* (18 Oct, a test) a phone card's item name is set smaller (15 px) — a name that still doesn't fit goes down from there (fitNames) */
@media (max-width: 699px) {
  .card-pages .pcard .pcard-head .pcard-name {
    font-size: 15px;
  }
}

/* (18 Oct, a test) a phone card's pill sits right under the item name (was 14 px below the name's row) */
@media (max-width: 699px) {
  .card-pages .pcard .pcard-chips {
    margin-top: 0;
  }
}

/* (18 Oct, a test) the pill's TEXT starts at the name's first letter (the pill's outline hangs 8 px to the left of it, less 1 px for the
   letter's side bearing), and the pill sits 2 px lower */
@media (max-width: 699px) {
  .card-pages .pcard .pcard-chips {
    margin-top: 2px;
    margin-left: -7px;
  }
}

/* (18 Oct, a test) on a phone the item name and the pill under it are one block, and the action icon is centred on that block */
@media (max-width: 699px) {
  .card-pages .pcard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto 1fr auto;
    column-gap: 8px;
  }

  .card-pages .pcard .pcard-top {
    display: contents;
  }

  .card-pages .pcard .pcard-head {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    min-width: 0;
  }

  .card-pages .pcard .pcard-chips {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    min-width: 0;
  }

  .card-pages .pcard .pcard-acts {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
  }

  .card-pages .pcard .pcard-money {
    grid-column: 1 / -1;
    grid-row: 3;
    align-self: center;
    margin-block: 0 !important;
  }

  .card-pages .pcard .pcard-rings {
    grid-column: 1 / -1;
    grid-row: 4;
    align-self: end;
    margin-top: 0 !important;
  }
}

/* (18 Oct, a test) the "paid with" pill on a phone card in other shapes — set html[data-chip-style] to "plain" (no pill: the account as quiet text),
   "tag" (a squared tag) or "dot" (quiet text led by a small dot); with none set the pill stays */
@media (max-width: 699px) {
  html[data-chip-style="plain"] .card-pages .pcard .pcard-chips,
  html[data-chip-style="dot"] .card-pages .pcard .pcard-chips {
    margin-left: 0;
  }

  html[data-chip-style="plain"] .card-pages .pcard .pcard-chips .chip,
  html[data-chip-style="dot"] .card-pages .pcard .pcard-chips .chip {
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    color: var(--text-2);
    font-size: 10.5px;
  }

  html[data-chip-style="dot"] .card-pages .pcard .pcard-chips .chip::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-right: 6px;
    border-radius: 50%;
    background: currentColor;
    vertical-align: middle;
    opacity: 0.7;
  }

  html[data-chip-style="tag"] .card-pages .pcard .pcard-chips {
    margin-left: -7px;
  }

  html[data-chip-style="tag"] .card-pages .pcard .pcard-chips .chip {
    border-radius: 4px;
  }
}

/* A phone: the open item (and income source) card is a sheet that pops up from the bottom, and the item's name has a line of its own
   (empty app, 18 Oct) */
@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
}

@media (max-width: 699px) {
  .card-single {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 25; /* over the page, under the dock (30), which stays on top of the sheet's foot */
    width: 100%;
    height: auto;
    max-height: calc(100dvh - 108px); /* stays under the page header and the Expenses | Income pills */
  }

  .card-single.opening {
    animation: sheet-up 0.34s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .card-single .scard.v2 {
    padding: 18px 18px calc(22px + var(--dock-h, 70px) + 22px); /* the dock stays on top of the sheet's foot */
    border-radius: 28px 28px 0 0;
    background: #11160b;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 0 100vmax rgba(0, 0, 0, 0.55);
    overflow-y: auto;
  }

  /* the glass rim would outline the sheet's bottom and sides too; the top edge is drawn above */
  .card-single .scard.v2::before,
  .card-single .scard.v2::after {
    display: none !important;
  }

  /* row 1: the icon and the name; row 2: previous, next … list, paid, delete, close */
  .card-single .scard-head {
    flex-wrap: wrap;
    row-gap: 12px;
  }

  .card-single .scard-head > :nth-child(3) {
    order: 0;
  }

  .card-single .scard-head .scard-title {
    order: 1;
    flex: 1 1 calc(100% - 52px);
    justify-items: start;
    text-align: left;
  }

  .card-single .scard-head .scard-title .pane-title {
    font-size: 20px;
  }

  .card-single .scard-head > :nth-child(1),
  .card-single .scard-head > :nth-child(2) {
    order: 2;
  }

  .card-single .scard-head .scard-subs {
    order: 3;
    margin-left: auto;
  }

  .card-single .scard-head .scard-paid {
    order: 4;
  }

  .card-single .scard-head .scard-delete {
    order: 5;
  }

  .card-single .scard-head .scard-close {
    order: 6;
  }
}

/* the sheet's rows (item and income source) get room to breathe */
@media (max-width: 699px) {
  .card-single .scard.v2 .rule-field {
    min-height: 46px;
    padding-block: 6px;
  }
}

/* The item sheet (phone) follows the income source sheet: no icon, no previous / next, and the name with the sub-items, paid, delete and close buttons on one line (empty app, 19 Oct) */
@media (max-width: 699px) {
  .card-single .scard.v2:not(.src-sheet) .scard-head {
    flex-wrap: nowrap;
    row-gap: 0;
  }

  .card-single .scard.v2:not(.src-sheet) .scard-head .scard-title {
    order: 0;
    flex: 1 1 auto;
    min-width: 0;
  }

  .card-single .scard.v2:not(.src-sheet) .scard-head .scard-title .pane-title {
    overflow: visible;
    white-space: normal; /* a long name goes onto a second line beside the buttons, never cut */
    text-overflow: clip;
    overflow-wrap: anywhere;
    line-height: 1.15;
  }

  .card-single .scard.v2:not(.src-sheet) .scard-head .scard-subs,
  .card-single .scard.v2:not(.src-sheet) .scard-head .scard-paid,
  .card-single .scard.v2:not(.src-sheet) .scard-head .scard-delete,
  .card-single .scard.v2:not(.src-sheet) .scard-head .scard-close {
    order: 1;
    margin-left: 0;
  }
}

/* The income source sheet (phone): the name, received, delete and close on one line; Type as chips (empty app, 18 Oct) */
@media (max-width: 699px) {
  .card-single .scard.src-sheet .scard-head {
    flex-wrap: nowrap;
  }

  .card-single .scard.src-sheet .scard-head .scard-title {
    order: 0;
    flex: 1 1 auto;
  }

  .card-single .scard.src-sheet .scard-head .scard-paid,
  .card-single .scard.src-sheet .scard-head .scard-delete,
  .card-single .scard.src-sheet .scard-head .scard-close {
    order: 1;
    margin-left: 0;
  }
}

.seg-chips {
  display: inline-flex;
  gap: 6px;
}

.seg-chip {
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.seg-chip[aria-pressed="true"] {
  background: var(--select);
  box-shadow: none;
  color: var(--select-ink);
}

/* A long press on a category's pill: its name opens for typing and a red × pops up on the pill's edge (empty app, 18 Oct) */
.cat-pills button[data-phone-cat],
.cat-pills button[data-inc-cat] {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.cat-x {
  position: fixed;
  z-index: 600;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--bad);
  color: #2b0f0c;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  animation: cat-x-pop 0.18s ease-out;
}

.cat-x .icon {
  width: 10px;
  height: 10px;
}

@keyframes cat-x-pop {
  from {
    transform: scale(0.3);
    opacity: 0;
  }
}

/* A phone: the toast ("Groceries removed — DISCARD brings it back") takes the full width of the totals bar — 16 px from each edge, its
   words centred — instead of a narrow pill (19 Oct) */
@media (max-width: 699px) {
  .toast {
    left: 16px;
    right: 16px;
    width: auto;
    transform: none;
    justify-content: center;
    padding: 20px 20px;
    border-radius: 24px;
    text-align: center;
  }
}

/* A toast for an action that can be taken back: the whole toast is the button, and says so with the undo icon (19 Oct) */
.toast.is-undo {
  cursor: pointer;
}

.toast .toast-msg {
  min-width: 0;
}

/* Layout D (19 Oct): a lime round undo icon, then the message with "Tap to undo" under it; the pill is as wide as its content, centred */
.toast.is-undo {
  left: 50%;
  right: auto;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  justify-content: flex-start;
  gap: 14px;
  padding: 14px 22px 14px 14px;
  text-align: left;
}

.toast .toast-dot {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--select);
  color: var(--select-ink);
}

.toast .toast-dot .icon {
  width: 18px;
  height: 18px;
}

.toast .toast-words {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.toast .toast-undo {
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* The undo toast counts down from 5 (19 Oct): a lime ring drains round the icon (no number) */
.toast .toast-ring {
  position: absolute;
  inset: -5px;
  width: 48px;
  height: 48px;
  transform: rotate(-90deg);
  pointer-events: none;
}

.toast .toast-ring circle {
  fill: none;
  stroke: var(--select);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 125.7;
  stroke-dashoffset: calc(125.7px * (1 - var(--left, 1)));
  transition: stroke-dashoffset 1s linear;
}

/* Plan (19 Oct): the first-category pill and the first-item glass card — a lime-outlined pill, as wide as its text */
.cat-first,
.plan-first {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 16px 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--select);
  color: var(--good-text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.cat-first .icon,
.plan-first .icon {
  width: 16px;
  height: 16px;
}

.card.glass.plan-empty {
  box-sizing: border-box;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  width: 100%;
  height: 160px;
  min-height: 160px;
  max-height: 160px;
  margin: 0;
}

/* Deleting a category that has items in it: a warning first (19 Oct) */
.cat-warn {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(8, 10, 5, 0.6);
}

.cat-warn-card {
  width: min(100%, 340px);
  padding: 22px 20px 18px;
  text-align: center;
}

.cat-warn-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.cat-warn-card p {
  margin: 0 0 18px;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.45;
}

.cat-warn-btns {
  display: grid;
  gap: 10px;
}


/* The item sheet (phone) is one page: a kind question first, then the rows that apply, the rare ones under More options (empty app, 19 Oct) */
.kind-q {
  display: grid;
  gap: 8px;
  padding: 4px 0 8px;
}

.kind-q h3 {
  margin: 0;
  font-size: 16px;
}

.kind-q p {
  margin: 0 0 4px;
  color: var(--text-2);
  font-size: 13px;
}

.kind-opt {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-radius: 18px;
  background: color-mix(in srgb, var(--text) 7%, transparent);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.kind-opt strong {
  font-size: 14px;
}

.kind-opt span {
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.35;
}

.kind-opt:hover,
.kind-opt[aria-pressed="true"] {
  box-shadow: inset 0 0 0 1.5px var(--select);
}

.seg-field {
  flex-wrap: wrap;
  row-gap: 8px;
}

.seg-chips.wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.seg-field > .seg-chips.wrap {
  flex: 1 1 100%;
}

.more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  margin-top: 6px;
  border: 0;
  background: none;
  color: var(--good-text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* The three-step wizard for a new item (phone, empty app, 19 Oct) — in the look of the Add-a-Tracker wizard (tracker-wizard.html) */
.card-single:has(.scard.wizard) {
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.55);
  border-radius: 30px 30px 0 0;
}

.scard.wizard {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 20px 18px 96px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 30px 30px 0 0;
  background: rgba(14, 17, 10, 0.72);
  backdrop-filter: blur(24px) saturate(180%);
}

.scard.wizard .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.scard.wizard .kicker {
  color: var(--text-3);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scard.wizard .x {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-2);
  cursor: pointer;
}

.scard.wizard .dots {
  display: flex;
  gap: 6px;
}

.scard.wizard .dots i {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
}

.scard.wizard .dots i.on {
  background: var(--select);
}

.scard.wizard h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  text-wrap: balance;
}

.scard.wizard .help {
  margin: 4px 0 0;
  color: var(--text-2);
  font-size: 13px;
}

.scard.wizard .wiz-body {
  display: grid;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
}

.scard.wizard .fields {
  display: grid;
  gap: 14px;
}

.scard.wizard .f {
  display: grid;
  gap: 6px;
  min-width: 0;
  align-content: start;
}

.scard.wizard .lab {
  color: var(--text-3);
  font-size: 12px;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}

.scard.wizard .in {
  width: 100%;
  height: 48px;
  min-width: 0;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background-color: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font: inherit;
  text-align: left;
}

.scard.wizard input.in,
.scard.wizard .ctl-num.in {
  width: 100% !important;
  max-width: none;
  flex: none;
}

.scard.wizard select.in {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c2c8b6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
}

.scard.wizard .note {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text-2);
  font-size: 13px;
}

.scard.wizard .note b {
  color: var(--text);
}

.scard.wizard .note.lime {
  border-left: 3px solid var(--select);
}

.scard.wizard .linkbtn {
  padding: 0 0 0 6px;
  border: 0;
  background: none;
  color: var(--good-text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.scard.wizard .kind-q {
  gap: 10px;
  padding: 0;
}

.scard.wizard .kind-opt {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: none;
}

.scard.wizard .kind-opt:hover,
.scard.wizard .kind-opt[aria-pressed="true"] {
  border-color: var(--select);
  background: rgba(198, 244, 50, 0.16);
  box-shadow: none;
}

.scard.wizard .rule-fields {
  display: grid;
  gap: 14px;
}

.scard.wizard .rule-field {
  display: grid;
  gap: 6px;
  padding: 0;
  border: 0;
  min-height: 0;
}

.scard.wizard .rule-field > span:first-child {
  color: var(--text-3);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.scard.wizard .seg-chip {
  padding: 10px 16px;
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.28);
  box-shadow: none;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
}

.scard.wizard .seg-chip[aria-pressed="true"] {
  border-color: var(--select);
  background: rgba(198, 244, 50, 0.16);
  color: var(--select);
}

.scard.wizard .nav {
  display: flex;
  gap: 10px;
}

.scard.wizard .wbtn {
  flex: 1;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.scard.wizard .wbtn.p {
  border-color: var(--select);
  background: var(--select);
  color: var(--select-ink);
}

/* The wizard, second round (19 Oct): amount and currency side by side, Expense Type as a row of tiles to swipe through, a wheel picker for Repeats */
.scard.wizard .pair {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
  align-items: start;
}

.type-rail {
  display: flex;
  gap: 12px;
  margin: 0 -18px;
  padding: 4px 18px 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 18px;
  scrollbar-width: none;
}

.type-rail::-webkit-scrollbar {
  display: none;
}

.type-tile {
  display: grid;
  flex: none;
  align-content: start;
  gap: 8px;
  width: 210px;
  min-height: 250px;
  padding: 20px 18px;
  scroll-snap-align: start;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 26px;
  background: linear-gradient(160deg, rgba(198, 244, 50, 0.1), rgba(0, 0, 0, 0.3) 60%);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.type-tile[aria-pressed="true"],
.type-tile:hover {
  border-color: var(--select);
  background: linear-gradient(160deg, rgba(198, 244, 50, 0.28), rgba(0, 0, 0, 0.3) 70%);
}

.type-ic {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: rgba(198, 244, 50, 0.16);
  box-shadow: inset 0 0 0 1.5px var(--select);
  color: var(--select);
}

.type-ic .icon {
  width: 28px;
  height: 28px;
}

.type-tile strong {
  font-size: 18px;
  line-height: 1.2;
}

.type-hint {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.4;
}

.swipe {
  margin: 0;
  color: var(--text-3);
  font-size: 12px;
  text-align: center;
}

.scard.wizard .kicker:empty {
  display: none;
}

.scard.wizard .top .x {
  margin-left: auto;
}

.dd,
.dd-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background-color: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.dd em {
  color: var(--text-3);
  font-style: normal;
}

.dd i {
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c2c8b6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.dd-select,
.scard.wizard .rule-field select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c2c8b6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
}

.scard.wizard .rule-field select,
.scard.wizard .rule-field input.ctl {
  width: 100%;
  max-width: none;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background-color: rgba(0, 0, 0, 0.28);
  text-align: left;
}

.need-note {
  flex: 1 1 100%;
  margin: 0;
  color: var(--text-2);
  font-size: 12.5px;
}


.scard.wizard .wiz-body {
  scrollbar-width: none;
}

.scard.wizard .wiz-body::-webkit-scrollbar {
  display: none;
}

.scard.wizard .rule-fields {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.scard.wizard .rule-field {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  justify-content: stretch;
}

.scard.wizard .rule-field .weekdays {
  display: flex;
  justify-content: space-between;
}

.scard.wizard .sheet-body .rule-fields {
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
}

.scard.wizard .rule-field .ctl,
.scard.wizard .rule-field select,
.scard.wizard .rule-field input {
  width: 100% !important;
  max-width: none !important;
}


/* The wizard, third round (19 Oct): the title beside the ✕, Expense Type as small tiles four to a page, Repeats and On on one line */
.scard.wizard .top h2 {
  flex: 1;
}

.type-rail {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, auto);
  grid-auto-columns: calc(50% - 6px);
  gap: 10px 12px;
  margin: 0 -18px;
  padding: 4px 18px 8px;
  scroll-padding-inline: 18px;
}

.type-tile {
  align-content: start;
  gap: 6px;
  width: auto;
  min-height: 0;
  padding: 12px 12px 14px;
  scroll-snap-align: none;
  border-radius: 18px;
}

.type-tile:nth-child(4n + 1) {
  scroll-snap-align: start;
}

.type-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.type-ic {
  flex: none;
  width: 28px;
  height: 28px;
  margin: 0;
  box-shadow: inset 0 0 0 1.5px var(--select);
}

.type-ic .icon {
  width: 14px;
  height: 14px;
}

.type-tile strong {
  font-size: 14px;
  line-height: 1.15;
}

.type-hint {
  font-size: 12px;
  line-height: 1.35;
}

.scard.wizard .pair2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
}

.pair2 {
  display: contents;
}

.scard.wizard .combo {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 10px;
}

.scard.wizard .rule-field select,
.scard.wizard .rule-field input {
  height: 48px !important;
  font-weight: 500;
}

/* Expense Type tiles: no icon, narrower, so the next column peeks in from the right (19 Oct) */
.type-rail {
  grid-auto-columns: 40%;
}

.type-tile:nth-child(odd) {
  scroll-snap-align: start;
}

.type-tile:nth-child(4n + 1) {
  scroll-snap-align: start;
}

.sheet-q {
  margin: 0 0 4px;
  font-size: 18px;
}

.sheet-body > .help {
  margin: 0 0 8px;
  color: var(--text-2);
  font-size: 13px;
}

/* Expense Type as a list: every type on one screen (19 Oct, a test; TYPE_LAYOUT in plan-view.js switches back to the tiles) */
.type-list {
  display: grid;
  gap: 5px;
}

.type-row {
  display: grid;
  gap: 1px;
  width: 100%;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.type-row strong {
  font-size: 14px;
}

.type-row .type-hint {
  color: var(--text-2);
  font-size: 12px;
}

.type-row:hover,
.type-row[aria-pressed="true"] {
  border-color: var(--select);
  background: rgba(198, 244, 50, 0.16);
}

.type-row .type-hint {
  white-space: nowrap;
}

/* The list rows lead with the type's icon (19 Oct) */
.type-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.type-row .type-ic {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: 0;
  border-radius: 50%;
  background: rgba(198, 244, 50, 0.16);
  box-shadow: inset 0 0 0 1.5px var(--select);
  color: var(--select);
}

.type-row .type-ic .icon {
  width: 16px;
  height: 16px;
}

.type-txt {
  display: grid;
  gap: 1px;
  min-width: 0;
}

/* The four types as cards, two by two (19 Oct) */
.type-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.type-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 168px;
  padding: 16px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(198, 244, 50, 0.1), rgba(0, 0, 0, 0.3) 60%);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.type-card:hover,
.type-card[aria-pressed="true"] {
  border-color: var(--select);
  background: linear-gradient(160deg, rgba(198, 244, 50, 0.28), rgba(0, 0, 0, 0.3) 70%);
}

.type-card .type-ic {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0 0 4px;
  border-radius: 50%;
  background: rgba(198, 244, 50, 0.16);
  box-shadow: inset 0 0 0 1.5px var(--select);
  color: var(--select);
}

.type-card .type-ic .icon {
  width: 20px;
  height: 20px;
}

.type-card strong {
  font-size: 17px;
}

.type-card .type-hint {
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.35;
}

/* The type icons: solid lime, no outline, a dark icon inside (19 Oct) */
.type-ic,
.type-card .type-ic,
.type-row .type-ic {
  background: var(--select);
  box-shadow: none;
  color: var(--select-ink);
}

/* Type (Utility | Credit Card): the label and its two pills on one line (19 Oct) */
.rule-field[data-row="usageType"],
.scard.wizard .rule-field[data-row="usageType"] {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rule-field[data-row="usageType"] > .seg-chips.wrap {
  flex: 0 1 auto;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

/* The Importance / card dropdowns: the text keeps clear of the arrow, in the sheet and in the wizard (19 Oct) */
.scard .rule-field select.dd-select {
  appearance: none;
  padding: 0 40px 0 14px !important;
  text-align: left;
  text-align-last: left;
  text-overflow: ellipsis;
  background-position: right 14px center !important;
  background-size: 16px !important;
}

/* Keywords panel (19 Oct) */
.kw-panel {
  display: grid;
  gap: 10px;
}

.kw-panel h3 {
  margin: 0;
  font-size: 16px;
}

.kw-panel p {
  margin: 0;
}

.kw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kw-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--select);
  border-radius: 999px;
  background: rgba(198, 244, 50, 0.16);
  color: var(--select);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.kw-add {
  display: flex;
  gap: 8px;
}

.kw-add .in {
  flex: 1;
  min-width: 0;
  height: 40px;
}

.kw-add .in {
  padding: 0 14px;
  border-radius: 999px;
  text-align: left;
}

/* A toggled icon button is active when it is lime with a dark icon: the item sheet's Keywords (19 Oct) */
.scard-head .round-btn.scard-subs[aria-pressed="true"],
.scard-head .round-btn.scard-subs[aria-pressed="true"]:hover {
  border-color: var(--select) !important;
  background: var(--select) !important;
  box-shadow: none !important;
  color: var(--select-ink) !important;
}

.scard-head .round-btn.scard-subs[aria-pressed="true"] .icon {
  color: var(--select-ink);
}

/* The two questions (How Far Does It Go?, Make a Saving Plan?) on a phone: a sheet from the bottom in the look of the wizards (19 Oct) */
.carry .top {
  display: none;
}

.carry.sheet {
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 27; /* over the cards, under the dock */
  padding: 20px 18px calc(var(--dock-h) + 28px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 30px 30px 0 0;
  background: rgba(14, 17, 10, 0.72) !important;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.55) !important;
  backdrop-filter: blur(24px) saturate(180%);
  gap: 14px;
}

.carry.sheet .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.carry.sheet .top h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.carry.sheet .x {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-2);
  cursor: pointer;
}

.carry.sheet p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.carry.sheet .carry-btns {
  gap: 10px;
}

.carry.sheet .carry-btns .btn {
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-transform: none;
}

.carry.sheet .carry-btns .btn.btn-primary {
  border-color: var(--select);
  background: var(--select);
  color: var(--select-ink);
}

/* The saving plan sheets (New / Edit Saving Plan) on a phone: a sheet from the bottom in the look of the wizards (19 Oct) */
@media (max-width: 699px) {
  #acc-sheet {
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(14, 17, 10, 0.9) !important;
    color: var(--text);
  }

  #acc-sheet[open] {
    inset: auto 0 0 0;
    width: 100%;
    max-width: none;
    height: auto;
    max-height: calc(100dvh - 108px);
    margin: 0;
    overflow: hidden;
    border-radius: 30px 30px 0 0;
    backdrop-filter: blur(24px) saturate(180%);
  }

  #acc-sheet::backdrop {
    background: rgba(0, 0, 0, 0.55);
  }

  #acc-sheet .sheet-inner {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    max-height: calc(100dvh - 110px);
    overflow: hidden;
    border-radius: 30px 30px 0 0;
  }

  #acc-sheet .sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 18px 0;
  }

  #acc-sheet .sheet-head h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    text-align: left;
  }

  #acc-sheet .sheet-head .round-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-2);
  }

  #acc-sheet .acc-sx-body {
    overflow-y: auto;
    gap: 14px;
    padding: 14px 18px 8px;
    text-align: left;
    scrollbar-width: none;
  }

  #acc-sheet .acc-sx-body::-webkit-scrollbar {
    display: none;
  }

  #acc-sheet .acc-sx-lab {
    display: block;
    color: var(--text-3);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
  }

  #acc-sheet .acc-sx-sec,
  #acc-sheet .acc-sx-hero {
    display: grid;
    gap: 6px;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
  }

  #acc-sheet .acc-sx-in,
  #acc-sheet .acc-sx-sel,
  #acc-sheet .acc-sx-name,
  #acc-sheet .acc-sx-notes {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    background-color: rgba(0, 0, 0, 0.28);
    color: var(--text);
    font: inherit;
    text-align: left;
  }

  #acc-sheet .acc-sx-sel {
    padding-right: 40px;
  }

  #acc-sheet .acc-sx-notes {
    height: auto;
    padding: 12px 14px;
  }

  #acc-sheet .acc-sx-amt {
    display: flex;
    align-items: baseline;
    gap: 8px;
    height: 48px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.28);
  }

  #acc-sheet .acc-sx-hero .acc-sx-big {
    width: auto;
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0;
    border: 0;
    background: none;
    font-size: 22px;
    text-align: left;
  }

  #acc-sheet .acc-sx-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  #acc-sheet .acc-sx-now {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  #acc-sheet .acc-sx-rows {
    display: grid;
    gap: 14px;
  }

  #acc-sheet .acc-sx-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    align-items: stretch;
  }

  #acc-sheet .acc-sx-rows > input[name="newname"] {
    width: 100%;
    margin-left: 0;
  }

  #acc-sheet .acc-sx-foot,
  #acc-sheet .acc-sx-foot.has-del {
    display: flex;
    gap: 10px;
    padding: 12px 18px 28px;
  }

  #acc-sheet .acc-sx-foot .btn,
  #acc-sheet .acc-sx-foot.has-del .btn {
    flex: 1;
    min-width: 0;
    max-width: none;
    min-height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    text-transform: none;
  }

  #acc-sheet .acc-sx-foot .btn.btn-primary {
    border-color: var(--select);
    background: var(--select);
    color: var(--select-ink);
  }

  #acc-sheet .acc-sx-foot .btn.danger {
    color: var(--bad-text);
  }
}

@media (max-width: 699px) {
  #acc-sheet[open] {
    width: 100% !important;
    max-width: none !important;
    left: 0 !important;
    right: 0 !important;
  }

  #acc-sheet .acc-sx-sec,
  #acc-sheet .acc-sx-hero,
  #acc-sheet .acc-sx-namebox {
    justify-items: stretch !important;
    text-align: left !important;
  }

  #acc-sheet .acc-sx-lab {
    justify-self: start !important;
    text-align: left !important;
  }
}

/* The new-item wizard on a wide screen (19 Oct): the same three steps, as a centred dialog over the dimmed page */
@media (min-width: 700px) {
  .card-overlay .card-single:has(.scard.wizard) {
    width: min(520px, 100%);
    height: auto;
    max-height: calc(100vh - 24px - 22px - var(--dock-h) - 22px);
    border-radius: 30px;
    box-shadow: none;
  }

  .card-overlay .scard.wizard {
    max-height: inherit;
    overflow-y: auto;
    padding: 22px 24px 24px;
    border-radius: 30px;
  }
}

/* The wide wizard is one page: the body scrolls, the buttons stay at the foot, and the rows have no rules between them (19 Oct) */
@media (min-width: 700px) {
  .card-overlay .scard.wizard {
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
  }

  .card-overlay .scard.wizard .wiz-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 2px;
  }

  .card-overlay .scard.wizard .rule-field,
  .card-overlay .scard.wizard .sheet-body .rule-field {
    padding: 0;
    border: 0;
    min-height: 0;
  }

  .card-overlay .scard.wizard .nav {
    flex: none;
  }

  .card-overlay .scard.wizard .wiz-body .seg-chips.wrap {
    margin-top: 6px;
  }
}

@media (min-width: 700px) {
  .card-overlay .scard.wizard.wide-wiz {
    gap: 12px;
  }

  .card-overlay .wide-wiz .fields {
    grid-template-columns: 1fr 1fr;
    column-gap: 14px;
  }

  .card-overlay .wide-wiz .fields > * {
    grid-column: 1 / -1;
  }

  .card-overlay .wide-wiz .fields > .f:nth-last-child(-n + 2) {
    grid-column: auto; /* Category and Starts share a row */
  }

  .card-overlay .wide-wiz .wiz-body {
    gap: 12px;
  }
}

/* The wide wizard's detail rows: as tall as they need to be (they were fixed at 56 px and overlapped), no divider lines */
@media (min-width: 700px) {
  .card-overlay .scard.wizard .rule-fields {
    grid-auto-rows: auto;
    grid-template-rows: none;
    gap: 14px;
  }

  .card-overlay .scard.wizard .rule-field,
  .card-overlay .scard.wizard .sheet-body .rule-field {
    box-shadow: none;
  }
}

/* The wide wizard's first page holds the four types and Recurring's four kinds together, so the kinds sit two by two */
@media (min-width: 700px) {
  .card-overlay .wide-wiz .type-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 700px) {
  .card-overlay .wide-wiz .type-list,
  .card-overlay .wide-wiz .type-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-overlay .wide-wiz .type-row,
  .card-overlay .wide-wiz .type-card {
    min-width: 0;
  }

  .card-overlay .wide-wiz .type-row .type-hint,
  .card-overlay .wide-wiz .type-row strong,
  .card-overlay .wide-wiz .type-card .type-hint {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .card-overlay .wide-wiz .wiz-body {
    overflow-x: hidden;
  }
}

/* The wide wizard: a picked type shrinks the four cards to a row of small ones, and page 2 shows what was picked as selected cards without their lines (19 Oct) */
@media (min-width: 700px) {
  .card-overlay .wide-wiz .type-cards.compact .type-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-height: 0;
    padding: 10px 14px;
  }

  .card-overlay .wide-wiz .type-cards.compact .type-card .type-hint {
    display: none;
  }

  .card-overlay .wide-wiz .type-cards.compact .type-card .type-ic {
    flex: none;
    width: 32px;
    height: 32px;
  }

  .card-overlay .wide-wiz .type-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .card-overlay .wide-wiz .type-pair .type-row {
    align-items: center;
    min-width: 0;
  }

  .card-overlay .wide-wiz .type-pair .type-row .type-hint {
    display: none;
  }
}

/* Anything but Recurring: its one card spans the width (19 Oct) */
@media (min-width: 700px) {
  .card-overlay .wide-wiz .type-pair.single {
    grid-template-columns: 1fr;
  }
}

/* The wizard's detail rows on a phone: the label and its control on one line (19 Oct) */
@media (max-width: 699px) {
  .scard.wizard .rule-field {
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: center;
    column-gap: 10px;
    row-gap: 4px;
  }

  .scard.wizard .rule-field > .need-note {
    grid-column: 1 / -1;
  }

  .scard.wizard .pair2 {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .scard.wizard .rule-field select,
  .scard.wizard .rule-field input.ctl {
    height: 44px !important;
  }

  .scard.wizard .rule-field .weekdays {
    gap: 4px;
    justify-content: flex-end;
  }

  .scard.wizard .rule-field .weekdays button {
    flex: none;
    width: 30px;
    min-width: 0;
    height: 30px;
    padding: 0;
    border-radius: 50%;
    font-size: 11px;
  }

  .scard.wizard .rule-field.seg-field {
    grid-template-columns: 92px minmax(0, 1fr);
  }
}

/* The wizard's boxes, smaller everywhere (19 Oct): name, amount, currency, category, starts, repeats, on, paid with, importance */
.scard.wizard .in,
.scard.wizard select.in,
.scard.wizard input.in,
.scard.wizard .rule-field select,
.scard.wizard .rule-field input,
.scard.wizard .rule-field input.ctl,
.scard.wizard .rule-field .ctl {
  height: 38px !important;
  min-height: 0 !important;
  padding-top: 0;
  padding-bottom: 0;
  border-radius: 12px;
  font-size: 14px;
}

.scard.wizard select.in,
.scard.wizard .rule-field select {
  padding-right: 36px;
  background-position: right 12px center;
  background-size: 14px;
}

/* The wizard's detail boxes are as wide as the longest thing in them (Wealth Current, Convenience…), not the whole row (19 Oct) */
.scard.wizard .rule-field select,
.scard.wizard .rule-field input.ctl:not(.ctl-num),
.scard.wizard .rule-field .ctl:not(.ctl-num) {
  width: 11.5em !important;
  max-width: 100% !important;
  justify-self: end; /* against the right edge, the labels on the left */
}

.scard.wizard .rule-field .ctl-num {
  justify-self: end;
}

/* The wizard's detail rows: each sits in the middle of its two divider lines (the space was all above the line) (19 Oct) */
.scard.wizard .rule-fields,
.card-overlay .scard.wizard .rule-fields {
  gap: 0;
}

.scard.wizard .rule-field,
.card-overlay .scard.wizard .rule-field,
.card-overlay .scard.wizard .sheet-body .rule-field {
  padding: 10px 0;
  min-height: 0;
}

.scard.wizard .pair2 {
  gap: 0;
}

/* The picked type on the phone wizard's Check the Details: the same selected cards as the wide screen's (19 Oct) */
@media (max-width: 699px) {
  .scard.wizard .type-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .scard.wizard .type-pair.single {
    grid-template-columns: 1fr;
  }

  .scard.wizard .type-pair .type-row {
    align-items: center;
    min-width: 0;
    padding: 8px 12px;
  }

  .scard.wizard .type-pair .type-row .type-hint {
    display: none;
  }
}

/* Private mode: a blurred figure's blur may spread past the small box that holds it (the box clipped it into a hard-edged rectangle); the card's own edge still contains it (19 Oct) */
html[data-private="on"] :is(.pcard-money, .sheet-amount-in) {
  overflow: visible !important; /* a card rule with more weight clips it otherwise */
}

/* The dock stays out of the way while the keyboard is up (19 Oct) */
.dock {
  transition: opacity 0.15s ease;
}

html[data-kb="on"] .dock {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ---------- Pop-up pass (19 Oct): buttons in Title Case, Log's date bar, Entry and Refund layouts, one toast pill ---------- */

/* A button inside a pop-up is Title Case (Save, Log It, Not Now); the small action buttons on cards (PAY, DONE) stay in caps. Settings is a page, not a pop-up. */
dialog.sheet:not(#settings) .btn,
.carry.sheet .btn,
.cuts-btns .btn {
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
}

/* Log: "Counts toward" is a bar — a calendar, the label over the month in full, the month arrows at the right */
#capture .cap-head-main {
  width: 100%;
}

#capture .cap-month {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 8px 8px 12px;
  border-radius: 18px;
  background: var(--recessed);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: var(--fs-sm);
  margin-bottom: 0;
}

#capture .cap-cal {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  background: var(--good-soft);
  color: var(--good-text);
}

#capture .cap-cal .icon {
  width: 18px;
  height: 18px;
}

#capture .cap-when {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}

#capture .cap-when span {
  padding: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

#capture .cap-when strong {
  min-width: 0;
  text-align: left;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

#capture .cap-month .round-btn {
  flex: none;
  width: 34px;
  height: 34px;
}

@media (max-width: 699px) {
  #capture .cap-month {
    grid-area: 2 / 1 / 3 / 3;
    justify-self: stretch;
    font-size: 11px;
    padding: 6px 6px 6px 10px;
    margin-bottom: 0;
  }

  #capture .cap-cal {
    width: 32px;
    height: 32px;
  }

  #capture .cap-when strong {
    min-width: 0;
    font-size: 16px;
  }

  #capture .cap-month .round-btn {
    width: 30px;
    height: 30px;
  }
}

/* Entry: Delete is a trash can beside the ✕; the foot is only Refund and Save */
#entry-edit .sheet-head .round-btn.ee-icon {
  width: 40px;
  height: 40px;
}

#entry-edit .cap-foot .btn {
  flex: none;
}

#ee-refund:disabled {
  opacity: 0.4;
}

/* Refund: aligned to the left, the main button on the right */
#refund-sheet .sheet-head {
  justify-content: flex-start;
  padding: var(--sp-5) var(--sp-5) var(--sp-3);
  min-height: 0;
}

#refund-sheet .sheet-head h2 {
  flex: 1;
  font-size: var(--fs-lg);
  text-align: left;
}

#refund-sheet .sheet-head .round-btn {
  position: static;
}

#refund-sheet .sheet-body {
  justify-items: stretch;
  text-align: left;
}

#refund-sheet .rule-field {
  justify-content: space-between;
}

#refund-sheet .combo {
  justify-content: flex-end;
}

#refund-sheet .combo .ctl {
  text-align: left;
}

#refund-sheet .cap-foot {
  justify-content: flex-end;
}

/* The question after an amount (Make a Saving Plan?): No on the left, Yes — the main one — on the right, on a phone too */
.carry-btns {
  justify-content: flex-end;
}

/* A phone: the answers one under the other, each the sheet's full width (30 Nov 2026, the user) */
.carry.sheet .carry-btns {
  grid-template-columns: minmax(0, 1fr);
}

/* A wide screen: How Far Does It Go? and Make a Saving Plan? in the phone sheet's look (30 Nov 2026, the user: the pop-up had the
   old style) — the title and round ✕ on one line, Title Case glass pills two to a row, the suggested one lime; still beside the cell */
.carry:not(.sheet) { width: 440px; padding: 20px; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 30px; background: rgba(14, 17, 10, 0.72) !important; backdrop-filter: blur(24px) saturate(180%); gap: 14px; }
.carry:not(.sheet) .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.carry:not(.sheet) .top h2 { margin: 0; font-size: 20px; font-weight: 700; }
.carry:not(.sheet) .x { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 50%; background: rgba(255, 255, 255, 0.1); color: var(--text-2); cursor: pointer; }
.carry:not(.sheet) .x:hover { color: var(--select); }
.carry:not(.sheet) p { margin: 0; font-size: 14px; line-height: 1.45; }
.carry:not(.sheet) .carry-btns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.carry:not(.sheet) .carry-btns .btn { height: 44px; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 999px; background: rgba(255, 255, 255, 0.1); color: var(--text); font-size: 14px; font-weight: 600; text-transform: none; letter-spacing: 0; white-space: normal; }
.carry:not(.sheet) .carry-btns .btn:not(.btn-primary):hover { color: var(--select); }
.carry:not(.sheet) .carry-btns .btn.btn-primary { border-color: var(--select); background: var(--select); color: var(--select-ink); }

/* A plain toast is the undo toast's pill without the undo */
.toast.is-plain {
  cursor: default;
}

.toast.is-plain .toast-words {
  align-content: center;
}

.toast.is-warn .toast-dot {
  background: var(--bad-soft);
  color: var(--bad-text);
}

/* Service Done: the cost carries its EGP like the entry sheet's amount */
#service-sheet .combo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 190px;
}

#service-sheet .combo .ctl {
  flex: 1;
  min-width: 0;
  width: auto;
}

/* The wide wizard's detail rows (19 Oct): each label and its box on one line, the boxes one width against the right edge — Repeats and On as rows of their own, like a phone's */
@media (min-width: 700px) {
  .card-overlay .scard.wizard .rule-field,
  .card-overlay .scard.wizard .rule-field.seg-field {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 12px;
    row-gap: 4px;
  }

  .card-overlay .scard.wizard .rule-field > select,
  .card-overlay .scard.wizard .rule-field > input.ctl,
  .card-overlay .scard.wizard .rule-field > .ctl {
    width: 160px !important;
    justify-self: end;
  }

  .card-overlay .scard.wizard .rule-field > .need-note {
    grid-column: 1 / -1;
  }

  .card-overlay .scard.wizard .pair2 {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .card-overlay .scard.wizard .rule-field .weekdays {
    justify-content: flex-end;
    gap: 6px;
  }
}

/* The wide wizard: Repeats and On share a line, each with its label over its box like Category and Starts (19 Oct) */
@media (min-width: 700px) {
  .card-overlay .scard.wizard .pair2 {
    grid-template-columns: 1fr 1fr;
    column-gap: 14px;
    row-gap: 0;
  }

  .card-overlay .scard.wizard .pair2 .rule-field {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    row-gap: 6px;
  }

  .card-overlay .scard.wizard .pair2 .rule-field > select,
  .card-overlay .scard.wizard .pair2 .rule-field > input.ctl,
  .card-overlay .scard.wizard .pair2 .rule-field > .ctl {
    width: 100% !important;
    justify-self: stretch;
  }
}

/* Repeats and On, sharing a line, look like Category and Starts: the same small label, the same box (19 Oct) */
@media (min-width: 700px) {
  .card-overlay .scard.wizard .pair2 .rule-field > span:first-child {
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.06em;
    line-height: normal;
  }

  .card-overlay .scard.wizard .pair2 .rule-field > select,
  .card-overlay .scard.wizard .pair2 .rule-field > input.ctl,
  .card-overlay .scard.wizard .pair2 .rule-field > .ctl {
    height: 38px !important;
    font-weight: 400;
    padding-left: 14px;
  }

  .card-overlay .scard.wizard .pair2 .rule-field > input.ctl {
    padding-right: 14px;
  }
}

/* Paid With and Importance share a line like Repeats and On; Importance's one-line note runs under both (19 Oct) */
.scard.wizard .pair2 > .need-note {
  grid-column: 1 / -1;
  margin: 8px 0 0;
}

/* Importance's explanation sits under the Importance box, in its column (19 Oct); a phone's single column keeps it full width */
@media (min-width: 700px) {
  .card-overlay .scard.wizard .pair2 > .need-note {
    grid-column: 2;
    margin: 6px 0 0;
    line-height: 1.35;
  }
}

/* Importance's explanation: back under its box, a couple of pixels closer and inset to line up with the text in the box (19 Oct) */
@media (min-width: 700px) {
  .card-overlay .scard.wizard .pair2 > .need-note {
    margin: 6px 0 0;
    padding-left: 14px;
  }
}

/* The wide wizard's rows are 14 px apart all the way down: Repeats / On and Paid With / Importance had 10 px of padding top and bottom on top of it (19 Oct) */
@media (min-width: 700px) {
  .card-overlay .scard.wizard.wide-wiz .rule-fields {
    gap: 14px;
    margin-top: 2px;
  }

  .card-overlay .scard.wizard.wide-wiz .rule-field,
  .card-overlay .scard.wizard.wide-wiz .sheet-body .rule-field {
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* An existing item on a wide screen, in the new-item wizard's look (19 Oct): the name, Keywords, trash can and ✕ on one line; Mark as Paid and Done at the foot */
@media (min-width: 700px) {
  .card-overlay .scard.wizard.edit-item .top {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .card-overlay .scard.wizard.edit-item .top h2 {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
  }

  .card-overlay .scard.wizard.edit-item .top .pane-title {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .card-overlay .scard.wizard.edit-item .top .scard-delete {
    color: var(--bad-text);
  }

  .card-overlay .scard.wizard.edit-item .top .scard-subs[aria-pressed="true"] {
    background: var(--select);
    color: var(--select-ink);
  }

  .card-overlay .scard.wizard.edit-item .wbtn.on {
    box-shadow: inset 0 0 0 2px var(--select-rim);
    color: var(--good-text);
  }
}

/* An existing item's header buttons (Keywords, trash can, ✕) are the sheets' 40 px circles (19 Oct) */
@media (min-width: 700px) {
  .card-overlay .scard.wizard.edit-item .top .x {
    width: 40px;
    height: 40px;
  }
}

/* Single rows (Repeats, Days, Type, Pay in Installments…) carry the same 12 px regular label as the paired fields (19 Oct) */
@media (min-width: 700px) {
  .card-overlay .scard.wizard .rule-field > span:first-child {
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.06em;
  }
}

/* Type (Utility | Credit Card) shares a line with Paid With, label over its two pills like the boxes beside it (19 Oct) */
@media (min-width: 700px) {
.card-overlay .scard.wizard .pair2 .rule-field[data-row="usageType"] {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  justify-content: stretch;
  row-gap: 6px;
}

.card-overlay .scard.wizard .pair2 .rule-field[data-row="usageType"] > .seg-chips.wrap {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: stretch;
}

.card-overlay .scard.wizard .pair2 .rule-field[data-row="usageType"] .seg-chip {
  flex: 1;
  min-height: 0;
  height: 38px;
  padding: 0 8px;
  font-size: 14px;
  white-space: nowrap;
}

}

/* Importance's note sits under the left box when Importance is the first of its pair */
@media (min-width: 700px) {
  .card-overlay .scard.wizard .pair2 > .need-note.note-left {
    grid-column: 1;
  }
}

/* The sentence under the Importance rows: what happens to this item in a tight month, full width (19 Oct) */
.scard.wizard .rule-fields > .need-note.need-logic {
  margin: 4px 0 0;
  padding: 0;
  line-height: 1.4;
}

/* Insight pop-up: the reset button beside the ✕ shows only once an amount has been typed over */
[data-fix-reset][hidden] {
  display: none;
}

/* Home › At a Glance on a phone (19 Oct, the user's numbers from the Card Layout Panel): 16 px on all four sides;
   title 24 px high at 18, 12 px to the figure (36 px high, 28), 2 px to the note (16 px high, 11); the widget zone runs from 124 to
   200 (76 px) so a card is 216 px. Log's and Track's cards keep the older frame. */
@media (max-width: 699px) {
  [data-page="dashboard"] :is(.ov-grid.glances).gspec:not(.balance-row):not(.accounts-row):not(.ins-grid) > .pcard.glance { padding: 16px; }
  [data-page="dashboard"] :is(.ov-grid.glances).gspec:not(.balance-row):not(.accounts-row):not(.ins-grid) > .pcard.glance > .pcard-name { height: 24px; font-size: 18px; line-height: 24px; }
  [data-page="dashboard"] :is(.ov-grid.glances).gspec:not(.balance-row):not(.accounts-row):not(.ins-grid) > .pcard.glance > .pcard-money { padding-top: 12px; }
  [data-page="dashboard"] :is(.ov-grid.glances).gspec:not(.balance-row):not(.accounts-row):not(.ins-grid) > .pcard.glance .pcard-amount { height: 36px; font-size: 28px; line-height: 36px; }
  [data-page="dashboard"] :is(.ov-grid.glances).gspec:not(.balance-row):not(.accounts-row):not(.ins-grid) > .pcard.glance .pcard-amount .cur { font-size: 12px; }
  [data-page="dashboard"] :is(.ov-grid.glances).gspec:not(.balance-row):not(.accounts-row):not(.ins-grid) > .pcard.glance .pcard-vs { height: 16px; margin-top: 2px; font-size: 11px; line-height: 16px; }
  [data-page="dashboard"] :is(.ov-grid.glances).gspec:not(.balance-row):not(.accounts-row):not(.ins-grid) > .pcard.glance > .glance-viz { height: 76px; min-height: 76px; margin-top: 18px; }
  [data-page="dashboard"] .gspec:not(.ins-grid) .g-ring-list .g-row,
  [data-page="dashboard"] .gspec:not(.ins-grid) .glance-viz .g-row { height: 25px; }
  [data-page="dashboard"] .gspec:not(.ins-grid) .g-amt { height: 38px; }
  [data-page="dashboard"] .gspec:not(.ins-grid) .sk-bar { height: 76px; }
}

/* Every other glass card on a phone: 16 px on all four sides, like Home's At a Glance (19 Oct, the user) */
@media (max-width: 699px) {
  :is(.ov-grid.glances, .log-charges-row).gspec:not(.balance-row):not(.accounts-row) > .pcard.glance { padding: 16px; }
  .ov-grid.glances.balance-row > .pcard.g-bal2 { padding: 16px; }
  .acc-pager .pcard.g-acc.g-bal2 { padding: 16px; }
  /* the pinned All Accounts card is 44 % of the row (was 42 %) so "61,708 EGP set aside" fits between the 16 px sides */
  .acc-pager { --pin: 44%; }
}

/* Track › Overdraft (Owed, Charges), Credit Cards (the first four) and Car Loan (the four) on a phone: the same frame as Home's
   At a Glance (19 Oct, the user): 216 px cards, title 18/24, figure 28/36, insight 11/16, widget zone 124 to 200, rows 25 px */
@media (max-width: 699px) {
  [data-page="tracker"] .ov-grid.glances.gspec:not(.od-grid) > .pcard.glance:nth-child(-n+4),
  [data-page="tracker"] .ov-grid.glances.gspec.od-grid > .pcard.glance:nth-child(-n+2) { padding: 16px; }
  [data-page="tracker"] .ov-grid.glances.gspec:not(.od-grid) > .pcard.glance:nth-child(-n+4) > .pcard-name,
  [data-page="tracker"] .ov-grid.glances.gspec.od-grid > .pcard.glance:nth-child(-n+2) > .pcard-name { height: 24px; font-size: 18px; line-height: 24px; }
  [data-page="tracker"] .ov-grid.glances.gspec:not(.od-grid) > .pcard.glance:nth-child(-n+4) > .pcard-money,
  [data-page="tracker"] .ov-grid.glances.gspec.od-grid > .pcard.glance:nth-child(-n+2) > .pcard-money { padding-top: 12px; }
  [data-page="tracker"] .ov-grid.glances.gspec:not(.od-grid) > .pcard.glance:nth-child(-n+4) .pcard-amount,
  [data-page="tracker"] .ov-grid.glances.gspec.od-grid > .pcard.glance:nth-child(-n+2) .pcard-amount { height: 36px; font-size: 28px; line-height: 36px; }
  [data-page="tracker"] .ov-grid.glances.gspec:not(.od-grid) > .pcard.glance:nth-child(-n+4) .pcard-amount .cur,
  [data-page="tracker"] .ov-grid.glances.gspec.od-grid > .pcard.glance:nth-child(-n+2) .pcard-amount .cur { font-size: 12px; }
  [data-page="tracker"] .ov-grid.glances.gspec:not(.od-grid) > .pcard.glance:nth-child(-n+4) .pcard-vs,
  [data-page="tracker"] .ov-grid.glances.gspec.od-grid > .pcard.glance:nth-child(-n+2) .pcard-vs { height: 16px; margin-top: 2px; font-size: 11px; line-height: 16px; }
  [data-page="tracker"] .ov-grid.glances.gspec:not(.od-grid) > .pcard.glance:nth-child(-n+4) > .glance-viz,
  [data-page="tracker"] .ov-grid.glances.gspec.od-grid > .pcard.glance:nth-child(-n+2) > .glance-viz { height: 76px; min-height: 76px; margin-top: 18px; }
  [data-page="tracker"] .gspec .g-ring-list .g-row,
  [data-page="tracker"] .gspec .glance-viz .g-row { height: 25px; }
  [data-page="tracker"] .gspec .g-amt { height: 38px; }
  /* a card's round action sits in the title's line, 22 px, so a name like "Next Service" never runs under it */
  [data-page="tracker"] .gspec > .pcard.glance > .g-act { top: 17px; right: 16px; }
  [data-page="tracker"] .gspec > .pcard.glance > .g-act .g-act-btn { width: 22px !important; height: 22px !important; min-width: 0; }
  [data-page="tracker"] .gspec > .pcard.glance > .g-act .g-act-btn svg { width: 13px !important; height: 13px !important; }
  /* the car cards have no round buttons on a phone (the user: they don't work there) */
  [data-page="tracker"] .car-grid > .pcard.glance > .g-act { display: none !important; }
  /* Overdraft on a phone (19 Oct, the user): Owed's widget is a ring (the share of the limit used, no number inside) beside "Free" and
     what is free; Charges keeps its bar and two rows for now. A wide screen keeps the bar, scale and stats. */
  [data-page="tracker"] .gspec .od-owed :is(.g-od-bar, .g-od-scale, .g-od-stats) { display: none; }
  [data-page="tracker"] .gspec .od-owed .g-od-ring { display: flex; }
  /* Charges (the user's pick, N4): one bar split into interest and fees in two shades of lime, then the two rows with a dot of each shade */
  [data-page="tracker"] .gspec .od-charges .g-od-track { display: none; }
  [data-page="tracker"] .gspec .od-charges .g-od-splitbar { display: flex; }
  [data-page="tracker"] .gspec .od-charges .g-od-dot { display: inline-block; }
}

/* Owed's ring and its "Free" figure (phones only; shown by the Track block above) */
.g-od-ring { display: none; align-items: center; gap: 14px; }
.g-od-ringg { flex: none; width: 56px; height: 56px; border-radius: 50%; background: conic-gradient(var(--good) calc(var(--p) * 1%), var(--raised) 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px)); mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px)); }
.g-od-ringg.warn { background: conic-gradient(var(--warn, #ff9f1c) calc(var(--p) * 1%), var(--raised) 0); }
.g-od-ringg.bad { background: conic-gradient(var(--bad) calc(var(--p) * 1%), var(--raised) 0); }
.g-od-free { display: grid; min-width: 0; }
.g-od-free em { color: var(--text-3); font-size: 11px; font-style: normal; font-weight: 650; }
.g-od-free b { color: var(--good-text); font-size: 15px; font-weight: 750; }

/* Charges' split bar and its dots (phones only; shown by the Track block above) */
.g-od-splitbar { display: none; height: 12px; margin-bottom: 8px; overflow: hidden; border-radius: 999px; background: var(--raised); }
.g-od-splitbar u { display: block; height: 100%; }
.g-od-splitbar .a, .g-od-dot.a { background: var(--good); }
.g-od-splitbar .b, .g-od-dot.b { background: color-mix(in srgb, var(--good) 50%, #000); }
.g-od-dot { display: none; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; }

/* "At a Glance" section headers on a phone, like Home's (19 Oct, the user's example): flush with the cards' left edge (they were 4 px in),
   20 px below the controls above, 10 px above the cards */
@media (max-width: 699px) {
  [data-page="tracker"] .block-title.ov-head[data-name="At a Glance"] { margin: -4px 0 0; }
  .log-mount .block-title.ov-head.log-glance-head { margin: 8px 0 10px; }
}

/* Track › Car › Car Service (19 Oct): the schedule as a calendar-block timeline, a year a page (docs/02 §3.7) */
.svc-card { padding: 16px 0 14px; overflow: hidden; }
.svc-title { margin: 0 16px 4px; font-size: 18px; font-weight: 700; }
.svc-years { display: flex; gap: 6px; padding: 8px 16px 10px; overflow-x: auto; scrollbar-width: none; }
.svc-years::-webkit-scrollbar { display: none; }
.svc-years button { flex: none; padding: 3px 11px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text-3); font: inherit; font-size: 12px; font-weight: 750; letter-spacing: 0.06em; cursor: pointer; }
.svc-years button.on { border-color: var(--good); background: var(--good); color: var(--select-ink); }
.svc-pager { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.svc-pager::-webkit-scrollbar { display: none; }
.svc-page { flex: 0 0 100%; min-width: 0; padding: 0 16px; scroll-snap-align: start; }
.svc-dots { display: flex; justify-content: center; gap: 6px; padding-top: 10px; }
.svc-dots i { width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--text) 22%, transparent); transition: background 0.15s, width 0.15s; }
.svc-dots i.on { width: 18px; border-radius: 99px; background: var(--good); }

.svc-row { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 0 12px; align-items: center; padding: 9px 0; }
.svc-row::before { content: ""; position: absolute; left: 21px; top: 0; bottom: 0; width: 2px; background: color-mix(in srgb, var(--text) 9%, transparent); }
.svc-row:first-child::before { top: 34px; }
.svc-row:nth-last-child(2)::before { bottom: calc(100% - 34px); }
.svc-cal { position: relative; z-index: 1; display: block; width: 44px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--raised) 70%, #000); color: inherit; font: inherit; text-align: center; }
button.svc-cal { cursor: pointer; }
button.svc-cal:hover { border-color: var(--text-3); }
.svc-cal i { display: block; background: color-mix(in srgb, var(--text) 12%, transparent); color: var(--text-3); font-size: 9px; font-style: normal; font-weight: 800; line-height: 15px; letter-spacing: 0.1em; text-transform: uppercase; }
.svc-cal b { display: block; font-size: 20px; line-height: 26px; font-variant-numeric: tabular-nums; }
.svc-row.nx .svc-cal { border-color: var(--good); }
.svc-row.nx .svc-cal i { background: var(--good); color: var(--select-ink); }
.svc-row.fut .svc-cal { border-style: dashed; }
.svc-cal.edited::after { content: ""; position: absolute; right: 3px; top: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--good); }
.svc-cal.edited i { background: color-mix(in srgb, var(--good) 28%, transparent); color: var(--good-text); }
.svc-k { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.svc-ins { font-size: 12px; font-weight: 650; white-space: nowrap; }
.svc-ins.early { color: #ff9f1c; }
.svc-ins.plan { color: var(--good-text); }
.svc-ins.late { color: var(--bad-text); }
.svc-ins em { display: block; color: #ff9f1c; font-style: normal; font-weight: 700; }
.svc-c { text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; }
.svc-c small { display: block; color: var(--text-3); font-size: 11px; font-weight: 600; }
.svc-amt, .svc-amt-ro { display: inline-block; padding: 2px 6px; margin: -2px -6px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-weight: 750; font-variant-numeric: tabular-nums; text-align: right; }
.svc-amt { cursor: text; }
.svc-amt:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.svc-amt.edited { color: var(--good-text); }
.svc-amt.edited::after { content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 5px; border-radius: 50%; background: var(--good); vertical-align: middle; }
.svc-amt-in { width: 92px; margin: -3px -7px -3px 0; padding: 2px 6px; border: 1px solid var(--good); border-radius: 8px; background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); font: inherit; font-weight: 750; font-variant-numeric: tabular-nums; text-align: right; outline: none; }
.svc-row.editing { grid-template-columns: 44px minmax(0, 1fr); }
.svc-form { display: grid; gap: 8px; }
.svc-date { min-width: 0; padding: 6px 8px; border: 1px solid var(--good); border-radius: 10px; background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); font: inherit; font-size: 14px; font-weight: 700; color-scheme: dark; }
.svc-btns { display: flex; gap: 8px; }
.svc-btns button { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text-3); font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; }
.svc-btns .svc-save { border-color: var(--good); background: var(--good); color: var(--select-ink); }
.svc-hint { color: var(--text-3); font-size: 11px; font-weight: 600; }
.svc-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: baseline; margin-top: 6px; padding: 10px 0 2px; border-top: 1px dashed color-mix(in srgb, var(--text) 14%, transparent); color: var(--text-3); font-size: 12px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; }
.svc-foot b { color: var(--text); font-size: 15px; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; }
.svc-foot b small { margin-left: 4px; color: var(--text-3); font-size: 11px; font-weight: 600; }
@media (min-width: 700px) {
  .svc-card { max-width: 560px; }
}

/* Car Service, 20 Oct (the user's approved design): every date insight is lime, the next service's block is solid lime with a slow
   pulsing glow (still with reduced motion), and a wide screen gets one connected timeline scrolled sideways (docs/02 §3.7) */
.svc-ins, .svc-ins.early, .svc-ins.late, .svc-ins.plan, .svc-ins em { color: var(--good-text); }
.svc-row.nx .svc-cal, .svc-cell.nx .svc-cal { border-color: var(--good); background: var(--good); animation: svcpulse 2.4s ease-in-out infinite; }
.svc-row.nx .svc-cal i, .svc-cell.nx .svc-cal i { background: color-mix(in srgb, var(--select-ink) 22%, transparent); color: var(--select-ink); }
.svc-row.nx .svc-cal b, .svc-cell.nx .svc-cal b { color: var(--select-ink); }
@keyframes svcpulse {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 18%, transparent), 0 0 22px color-mix(in srgb, var(--good) 34%, transparent); }
  50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--good) 4%, transparent), 0 0 42px color-mix(in srgb, var(--good) 58%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .svc-row.nx .svc-cal, .svc-cell.nx .svc-cal { animation: none; box-shadow: 0 0 0 5px color-mix(in srgb, var(--good) 16%, transparent), 0 0 26px color-mix(in srgb, var(--good) 40%, transparent); }
}

.svc-wide { position: relative; padding: 18px 0; min-width: 0; }
.svc-wide .svc-title { margin: 0 22px 8px; font-size: 20px; font-weight: 700; }
.svc-scroll { position: relative; z-index: 1; overflow-x: auto; padding: 0 22px; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text) 18%, transparent) transparent; }
.svc-scroll::-webkit-scrollbar { height: 8px; }
.svc-scroll::-webkit-scrollbar-thumb { border-radius: 99px; background: color-mix(in srgb, var(--text) 18%, transparent); }
.svc-nav { position: absolute; top: 50%; z-index: 3; display: grid; place-items: center; width: 14px; height: 36px; padding: 0; border: 0; background: var(--good); color: var(--select-ink); cursor: pointer; transform: translateY(-50%); opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.svc-frame.moving .svc-nav { opacity: 1; pointer-events: auto; }
.svc-nav svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.svc-frame { position: relative; min-width: 0; max-width: 100%; }
.svc-nav.l { left: -15px; border-radius: 9px 0 0 9px; }
.svc-nav.r { right: -15px; border-radius: 0 9px 9px 0; }
.svc-nav[hidden] { display: none; }
.svc-nav:hover { filter: brightness(1.08); }
.svc-track { --cw: 124px; --yr: 106px; --bw: 54px; --bh: 52px; --pt: 14px; position: relative; display: flex; width: max-content; padding: var(--pt) 12px 6px 0; }
/* the timeline's line runs the whole width of the card, behind the scrolling blocks (its height is set from app.js) */
.svc-wide::after { content: ""; position: absolute; left: 0; right: 0; top: var(--svc-y, 50%); height: 2px; z-index: 0; pointer-events: none; background: color-mix(in srgb, var(--text) 13%, transparent); }
.svc-cell { position: relative; flex: 0 0 var(--cw); display: grid; grid-template-rows: var(--yr) var(--bh) auto; justify-items: center; padding: 0 4px; text-align: center; }
.svc-above { grid-row: 1; align-self: end; padding-bottom: 6px; }
.svc-wide .svc-cal { grid-row: 2; width: var(--bw); height: var(--bh); border-radius: 12px; }
.svc-wide .svc-cal i { line-height: 17px; font-size: 10px; }
.svc-wide .svc-cal b { font-size: 23px; line-height: 32px; }
.svc-cell.fut .svc-cal { border-style: dashed; }
.svc-det { grid-row: 3; display: grid; gap: 8px; margin-top: 9px; justify-items: center; }
.svc-wide .svc-k { font-size: 15px; white-space: nowrap; }
.svc-k small { margin-left: 2px; color: var(--text-3); font-size: 12px; font-weight: 700; }
.svc-ins { font-size: 10.5px; }
.svc-ins em { font-size: 9.5px; }
.svc-bigc { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 18px; line-height: 1.1; font-weight: 750; font-variant-numeric: tabular-nums; }
.svc-bigc small { color: color-mix(in srgb, var(--good-text) 60%, transparent); font-size: 10px; font-weight: 700; letter-spacing: 0.04em; }
.svc-big, .svc-big-ro { padding: 0; border: 0; background: none; color: var(--good-text); font: inherit; font-weight: 750; font-variant-numeric: tabular-nums; }
.svc-big { cursor: text; }
.svc-big.edited::after { content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 4px; border-radius: 50%; background: var(--good); vertical-align: middle; }
.svc-wide .svc-amt-in { width: 84px; margin: 0; text-align: center; }
.svc-ym { position: absolute; right: 0; top: calc(var(--pt) * -1); width: 2px; height: calc(var(--pt) + var(--yr) + var(--bh) / 2); background: color-mix(in srgb, var(--good) 55%, transparent); }
.svc-yl { position: absolute; right: 12px; top: 0; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; white-space: nowrap; }
.svc-yl b { color: var(--text); font-size: 19px; letter-spacing: 0.02em; }
.svc-yl span { color: var(--good-text); font-size: 15px; font-weight: 750; font-variant-numeric: tabular-nums; }
.svc-pop { position: fixed; z-index: 50; display: grid; gap: 8px; width: 220px; padding: 12px; border: 1px solid var(--good); border-radius: 14px; background: var(--glass-solid); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55); }
.svc-pt { font-size: 13px; font-weight: 750; }

/* Toasts, on the standards (09 §F): every toast is one pill — a full pill, not a rounded box — with a round icon, then the
   words. The error's icon is a red i like the tick's lime one: a solid round dot with the dark ink, not a faint tint (23 Oct) */
.toast.is-undo {
  border-radius: var(--r-pill);
}

.toast.is-warn .toast-dot {
  background: var(--bad);
  color: var(--bad-ink);
}

/* An error appears where it stays and nudges sideways a few times to say no — it never travels in from a side (the
   shared "pop" animation carried the centring transform away, so a toast swooped in from the left) */
@keyframes toast-nudge {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0.96);
  }

  20% {
    opacity: 1;
    transform: translateX(calc(-50% - 7px));
  }

  40% {
    transform: translateX(calc(-50% + 6px));
  }

  60% {
    transform: translateX(calc(-50% - 4px));
  }

  80% {
    transform: translateX(calc(-50% + 2px));
  }

  100% {
    opacity: 1;
    transform: translateX(-50%);
  }
}

@keyframes toast-appear {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.toast.is-warn {
  animation: toast-nudge 0.5s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .toast.is-warn {
    animation: toast-appear 0.15s ease-out;
  }
}

/* Home's At a Glance with fewer than four cards (23 Oct): Upcoming and Streak always show; Allowance and Credit Cards only once there
   is an allowance item or a credit card. The row then fills its width: two cards share it, three share a wide row, and on a
   narrower screen a lone third card takes the whole row. */
@media (min-width: 1100px) {
  .ov-grid.glances[data-glance-n="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ov-grid.glances[data-glance-n="3"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 700px) and (max-width: 1099px) {
  .ov-grid.glances[data-glance-n="3"] > .pcard.glance:last-child {
    grid-column: 1 / -1;
  }
}

/* (23 Oct, item 3) phone: a card with no pill still keeps the pill's row, so the amount sits where it does on the cards that show one;
   with no pill the item name is centred on the round action button */
@media (max-width: 699px) {
  .card-pages .pcard .pcard-chips.empty {
    display: block;
    visibility: hidden;
    height: 13px;
    min-height: 0;
    overflow: hidden;
  }
  .card-pages .pcard:has(.pcard-chips.empty) .pcard-head {
    grid-row: 1 / 3;
    align-self: center;
  }
  .card-pages .pcard:has(.pcard-chips.empty) .pcard-money {
    position: static;
  }
  /* the amount starts on the same line on every card, with or without a line under it */
  .card-pages .pcard .pcard-money {
    align-self: start;
    margin-top: 34px !important;
    margin-bottom: 0 !important;
  }
}

/* (23 Oct, item 4) a phone's account cards show three things — the name, the balance and what is free — and no longer the set-aside line or the
   bar: the three are spread down the card with room between them */
@media (max-width: 699px) {
  .acc-pager .g-acc .g-ml,
  .acc-pager .g-acc .g-acc-note { display: none; }
  .acc-pager .pcard.g-acc { justify-content: space-between; min-height: 156px; }
}

/* (23 Oct, item 5) the InstaPay fee, said in the log wizard before the entry is logged */
.fee-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin-top: 8px;
  padding: 0 2px;
  font-size: 13px;
  color: var(--text-2);
}
.fee-line b { color: var(--text); font-weight: 700; }
.fee-line .fee-total { flex: 1 0 100%; font-size: 12px; color: var(--text-3); }
.ctl-static { color: var(--text-2); font-size: 14px; }

/* Saving plans: spending has its own colour (23 Oct) — sky blue, neither the lime of what's saved nor the red of trouble.
   The two parts of the bar meet in a flush, straight seam: only the bar's outer ends are rounded. */
:root { --spent: #38bdf8; }
.acc-prog-spent { position: absolute; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--spent); }
.acc-prog-fill:has(+ .acc-prog-spent) { border-radius: 4px 0 0 4px; }
.acc-prog-spent-note { font-style: normal; font-weight: 600; color: var(--spent); }
.acc-arch { margin-top: 12px; }
.acc-arch-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 2px; background: none; border: 0; color: var(--text-3); font: 700 12px/1 inherit; letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer; }
.acc-arch-head .acc-chev { margin-left: auto; width: 16px; height: 16px; transition: transform 0.2s; }
.acc-arch.open .acc-chev { transform: rotate(180deg); }
.acc-arch-list { display: none; flex-direction: column; gap: 6px; }
.acc-arch.open .acc-arch-list { display: flex; }
.acc-arch-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--raised); cursor: pointer; }
.acc-arch-name { font-size: 14px; }
.acc-arch-end { font-weight: 700; font-size: 13px; text-align: right; }
.acc-arch-end i { font-style: normal; color: var(--text-3); font-weight: 600; }
.acc-arch-row small { color: var(--text-3); font-size: 11.5px; }
.acc-arch-row .acc-line-chip { justify-self: start; display: none; }

/* a saving plan's activity: one line each — the date and note shrink with an ellipsis, the amount stays whole */
.acc-tx-row { align-items: baseline; flex-wrap: nowrap; }
.acc-tx-what { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-tx-amt { flex: 0 0 auto; white-space: nowrap; }
.acc-arch-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.acc-arch-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-arch-row .acc-line-chip { display: inline-flex; justify-self: start; }
.acc-arch-row small { justify-self: end; }
.acc-arch-end { white-space: nowrap; }
/* the plan pop-ups never run off the screen: the form scrolls, Archive and Save stay in sight */
@media (min-width: 700px) {
  #acc-sheet[open] { max-height: calc(100dvh - 48px); overflow: hidden; }
  #acc-sheet .sheet-inner { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: calc(100dvh - 48px); overflow: hidden; }
  #acc-sheet .acc-sx-body { overflow-y: auto; }
}
.acc-tx-del { display: inline-block; width: 18px; margin-left: 6px; padding: 0; text-align: center; }
.acc-tx-sp { pointer-events: none; }
.acc-prog-fill[style*="width:0.0%"] + .acc-prog-spent { border-radius: 4px; }

/* A saving plan's name and its category pill both show whole: the name steps down in size to fit beside the pill (fitPlanName, tracker-view.js; 23 Oct) */
@media (max-width: 700px) {
  .acc-card.acc-has-stack .acc-line-name { flex: 0 0 auto; }
  .acc-card.acc-has-stack .acc-line-chips { flex: 0 1 auto; }
}

/* Private mode, the new saving-plan figures (23 Oct; the user's general rule: every amount blurs): a plan's "N spent" note, the amounts in its Details and in the archived plan pop-up, and the Archived list's amounts */
html[data-private="on"] :is(.acc-prog-spent-note, .acc-tx-amt, .acc-arch-end, #acc-sheet .acc-tu-stats b) {
  filter: blur(max(7px, 0.4em));
}

/* Upcoming (23 Oct, the user's design): the week's charges — two small calendar blocks (the Car Service block) with name and amount, "+N more" under them;
   one charge a single big block; none a calm message. No panel behind any of it (docs/08 §4) */
.gspec .upc-none { display: grid; gap: 4px; align-content: center; justify-items: center; height: 100%; padding: 0 12px; text-align: center; }
.gspec .upc-none b { font-size: 14px; font-weight: 650; }
.gspec .upc-none i { color: var(--text-3); font-size: 12px; font-style: normal; font-weight: 600; }
.gspec .upc-big { display: flex; flex-direction: column; justify-content: center; height: 100%; padding-left: 4px; }
.gspec .upc-one { display: flex; align-items: center; gap: 16px; }
.gspec .upc-cal { flex: none; width: 54px; height: 52px; border-color: var(--good); border-radius: 12px; }
.gspec .upc-cal i { background: var(--good); color: var(--select-ink); font-size: 10px; line-height: 17px; }
.gspec .upc-cal b { font-size: 23px; line-height: 32px; }
.gspec .upc-who { display: grid; flex: 1; gap: 3px; min-width: 0; }
.gspec .upc-who b { font-size: 18px; font-weight: 700; line-height: 1.15; }
.gspec .upc-who i { color: var(--text-3); font-size: 12px; font-style: normal; font-weight: 600; }
.gspec .upc-rows { display: flex; flex-direction: column; justify-content: center; gap: 6px; height: 100%; padding-left: 4px; }
.gspec .upc-row { display: flex; align-items: center; gap: 14px; }
.gspec .upc-row .upc-cal { width: 38px; height: auto; border-radius: 10px; }
.gspec .upc-row .upc-cal i { font-size: 8px; line-height: 12px; }
.gspec .upc-row .upc-cal b { font-size: 16px; line-height: 20px; }
.gspec .upc-row .rn { flex: 1; min-width: 0; font-size: var(--g-ins-name); font-weight: 650; }
.gspec .upc-row .ra { font-size: var(--g-ins-amt); font-weight: 750; white-space: nowrap; }
.gspec .upc-row .ra .cur { margin-left: 3px; font-size: 9px; }
.gspec .upc-more { padding-left: 52px; color: var(--text-3); font-size: 12px; font-weight: 600; line-height: 14px; }
@media (max-width: 699px) {
  .gspec .upc-none b { font-size: 12px; }
  .gspec .upc-none i { font-size: 11px; }
  .gspec .upc-none .wide, .gspec .upc-who .wide { display: none; }
  .gspec .upc-big { padding-left: 0; }
  .gspec .upc-one { gap: 10px; }
  .gspec .upc-cal { width: 32px; height: auto; border-radius: 8px; }
  .gspec .upc-cal i { font-size: 7px; line-height: 10px; letter-spacing: 0.06em; }
  .gspec .upc-cal b { font-size: 15px; line-height: 19px; }
  .gspec .upc-who b { font-size: 13px; }
  .gspec .upc-who i { font-size: 10.5px; }
  .gspec .upc-rows { gap: 3px; padding-left: 0; }
  .gspec .upc-row { gap: 8px; }
  .gspec .upc-row .upc-cal { width: 26px; border-radius: 7px; }
  .gspec .upc-row .upc-cal i { font-size: 6px; line-height: 8px; }
  .gspec .upc-row .upc-cal b { font-size: 12px; line-height: 15px; }
  .gspec .upc-row .rn, .gspec .upc-row .ra { font-size: 12px; }
  .gspec .upc-row .ra .cur { display: none; }
  .gspec .upc-more { padding-left: 34px; font-size: 10.5px; line-height: 12px; }
}

/* Credit Cards (23 Oct): the due date's calendar block in the card's own colour, and its row (3 cards; 4 and more) */
.gspec .cc-cal { border-color: var(--cc); }
.gspec .cc-cal i { background: var(--cc); color: var(--select-ink); }
.gspec .upc-row.over .ra { color: var(--bad-text); }
.gspec .upc-who b.num, .gspec .upc-who i .num { font-variant-numeric: tabular-nums; }
/* A narrow card (a window just past 1100 px, or a phone): the rows tighten before a name can touch its amount — smaller gaps and
   type, EGP dropped from the rows (the figure above says it) */
.gspec .glance-viz.cc-widget { container-type: inline-size; }
@container (max-width: 215px) {
  .upc-row { gap: 8px; }
  .upc-row .rn, .upc-row .ra { font-size: 13px; }
  .upc-row .rn { flex: 1 0 auto; }
  .upc-row .ra .cur { display: none; }
  .upc-row .upc-cal { width: 32px; }
  .upc-who b { font-size: 15px; }
}
/* A phone's rows keep the full calendar block (month over day, as Upcoming's); type at the 11 px floor so the longest names
   (Platinum, Everyday, Cashback) sit clear of their amounts in the zone's width */
@media (max-width: 699px) {
  .gspec .cc-widget .upc-row { gap: 6px; }
  .gspec .cc-widget .upc-row .rn, .gspec .cc-widget .upc-row .ra { font-size: 11px; }
  .gspec .cc-widget .upc-row .rn { flex: 1 0 auto; }
  .gspec .cc-widget .upc-rows { gap: 7px; } /* two rows and the more line: 25 + 7 + 25 + 7 + 12 = 76 */
}
/* Three rows on a wide screen (104 px zone): the blocks a little smaller so 3 × 30 + 2 × 6 fits */
@media (min-width: 700px) {
  .gspec .cc-widget .upc-rows.cc3 .upc-row .upc-cal { width: 33px; border-radius: 8px; }
  .gspec .cc-widget .upc-rows.cc3 .upc-row .upc-cal i { font-size: 7px; line-height: 10px; }
  .gspec .cc-widget .upc-rows.cc3 .upc-row .upc-cal b { font-size: 14px; line-height: 18px; }
}

/* ---------- Home › Coming Up on the timeline style (23 Oct, the user's update deck; docs/02 §3.8) ----------
   The Car Service blocks, vertical: a block per day (a dot for the day's other charges), a name and how it is paid, an amount
   typed over in place, a round pay button. Phone: pills above the card, built from what is due. Wide: the weeks are the pills
   (inside the card), the amount and action in the title row. */
.cu-card.card { min-width: 0; padding: 14px 16px 8px; }
.cu-pills { display: flex; gap: 6px; padding: 2px 0 12px; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.cu-pills::-webkit-scrollbar { display: none; }
.cu-pills button { flex: none; display: flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text-3); font: inherit; font-size: 12.5px; font-weight: 750; letter-spacing: 0.01em; white-space: nowrap; cursor: pointer; }
.cu-pills button.on { border-color: var(--good); background: var(--good); color: var(--select-ink); }
.cu-pills button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.cu-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bad); }
.cu-none { margin: 0; padding: 14px 0 18px; }
.cu-list { position: relative; }
.cu-list::before { content: ""; position: absolute; left: 21px; top: 30px; bottom: 30px; width: 2px; background: color-mix(in srgb, var(--text) 9%, transparent); }
/* a row: the day's block (on its first charge only), the name and how it is paid, the amount, the pay button. Tap it to select it. */
.cu-row { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 0 10px; align-items: center; min-height: 78px; padding: 10px 6px; margin: 4px -6px; border-radius: 14px; cursor: pointer; }
.cu-row .due-name, .cu-row .due-sub { overflow: visible; white-space: normal; text-overflow: clip; }
.cu-row .due-sub { line-height: 1.3; }
.cu-row .due-amt { width: 9.5ch; }
.cu-nob { position: relative; z-index: 1; display: grid; place-items: center; height: 43px; }
.cu-nob::before { content: ""; display: block; width: 7px; height: 7px; border-radius: 50%; background: color-mix(in srgb, var(--text) 24%, transparent); }
/* the block's states: upcoming (neutral), next due (solid lime, pulsing), late (red), paid (solid lime, still), no due day (dashed) */
.cu-cal { position: relative; z-index: 1; cursor: inherit; }
.cu-cal.late { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 20%, color-mix(in srgb, var(--raised) 70%, #000)); }
.cu-cal.late i { background: color-mix(in srgb, var(--bad) 38%, transparent); color: var(--bad-text); }
.cu-cal.late b { color: var(--bad-text); }
.cu-cal.nx, .cu-cal.paid { border-color: var(--good); background: var(--good); }
.cu-cal.nx { animation: svcpulse 2.4s ease-in-out infinite; }
.cu-cal.nx i, .cu-cal.paid i { background: color-mix(in srgb, var(--select-ink) 22%, transparent); color: var(--select-ink); }
.cu-cal.nx b, .cu-cal.paid b { color: var(--select-ink); }
.cu-cal.cu-void { border-style: dashed; opacity: 0.55; }
@media (prefers-reduced-motion: reduce) { .cu-cal.nx { animation: none; } }
.due-sub em.paid { color: var(--good-text); }
/* the pay button: outline until paid, filled once paid */
.cu-row .due-go.btn { border: 1.5px solid var(--good); background: transparent; box-shadow: none; color: var(--good-text); }
.cu-row .due-go.btn.paid { background: var(--good); color: var(--select-ink); cursor: default; }
/* selected: the row gets a lime outline and tint; while anything is selected the pay buttons step aside and every block goes
   neutral, except the paid ones */
.cu-row[aria-selected="true"] { box-shadow: inset 0 0 0 1.5px var(--good); background: color-mix(in srgb, var(--good) 10%, transparent); }
.cu-row[aria-selected="true"] .due-name { color: var(--good-text); }
.cu-selecting .due-go:not(.paid) { display: none; }
.cu-selecting .cu-cal:not(.paid):not(.cu-void) { border-color: var(--line); background: color-mix(in srgb, var(--raised) 70%, #000); animation: none; box-shadow: none; }
.cu-selecting .cu-cal:not(.paid):not(.cu-void) i { background: color-mix(in srgb, var(--text) 12%, transparent); color: var(--text-3); }
.cu-selecting .cu-cal:not(.paid):not(.cu-void) b { color: var(--text); }
/* a week's marker (the start of a new week, Sunday) with its total; the Today marker starts This Week */
.cu-mark { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 0 10px; align-items: center; padding: 8px 0 2px; }
.cu-mark::before { content: ""; justify-self: center; z-index: 1; width: 10px; height: 10px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 22%, transparent); }
.cu-mark b { color: var(--good-text); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.cu-mark.today b { justify-self: start; padding: 2px 9px; border-radius: 99px; background: var(--good); color: var(--select-ink); font-size: 11.5px; letter-spacing: 0.04em; text-transform: none; }
.cu-tot { grid-column: 3; color: var(--good-text); font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* the footer, like Car Service's: what is left to pay (or what is selected), and the one action for it */
.cu-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; padding: 12px 0 6px; border-top: 1px dashed color-mix(in srgb, var(--text) 14%, transparent); }
.cu-ft { display: grid; gap: 1px; }
.cu-fl { color: var(--text-3); font-size: 11px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; }
.cu-fv { font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; }
.cu-fv small { margin-left: 4px; color: var(--text-3); font-size: 11px; font-weight: 600; }
.cu-foot[hidden], .cu-foot .due-all[hidden] { display: none; }
/* wide: one column; the amount and action in the title row, level with Coming Up */
.cu-deskcol { display: grid; gap: 10px; width: 100%; }
.cu-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cu-titlebar .block-title { margin: 0; }
.cu-foots { display: flex; justify-content: flex-end; }
.cu-foot.top { margin: 0; padding: 0; border-top: 0; gap: 16px; }
.cu-foot.top .cu-ft { display: flex; align-items: baseline; gap: 10px; }
.cu-deskcard .cu-pills { padding: 0 0 10px; }
/* on a phone the pills sit above the card and run to the screen edges */
@media (max-width: 699px) { .cu-pills { margin: 0 -16px; padding-inline: 16px; } }

/* ---------- Log: the Logs header, the day row, search and filters (23 Oct, the user's design) ----------
   Under At a Glance: a Logs header with a search pill and a filter button at its right, the whole month in a row of days
   (it scrolls and snaps like the Plan's category pills), then the entries a day at a time under quiet sub-headers.
   A wide screen (900px+) opens the filters as a pane on the right half of the page, the entries keep the left half; a phone
   opens a condensed sheet under the day row, its groups collapsed. */
.log-logs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 30px 0 14px;
  min-height: 40px;
}

.log-logs-row .block-title {
  margin: 0;
}

.log-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.round-btn.log-ib {
  flex: none;
  width: 40px;
  height: 40px;
}

.round-btn.log-ib .icon {
  width: 20px;
  height: 20px;
}

.round-btn.log-ib[aria-pressed="true"] {
  background: var(--select);
  color: var(--select-ink);
}

/* the search pill: a button that grows into a field. Closed it is the button alone; open, the magnifier stays at its right end */
.log-sx {
  display: flex;
  align-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  overflow: hidden;
  z-index: 2;
  transition: width 0.32s cubic-bezier(0.4, 0, 0.2, 1), margin-right 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.log-sx .log-ib {
  order: 2;
}

/* the search button is clear glass like the filter's: the browser's own dark-mode button grey showed through it (7 Nov 2026, the user) */
.log-sx .log-ib:not([aria-pressed="true"]) {
  background: transparent;
}

.log-sin {
  order: 1;
  flex: 0 0 0;
  width: 0;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  outline: none;
  color: var(--text);
  font: 500 14px var(--font);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.log-sin::placeholder {
  color: var(--text-3);
}

.log-logs-row.searching .log-sin {
  flex: 1 1 auto;
  width: auto;
  padding: 0 4px 0 18px;
  opacity: 1;
  transition-delay: 0.14s;
}

.log-fwrap {
  position: relative;
  z-index: 1;
  transition: opacity 0.15s ease;
}

.log-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--select);
  color: var(--select-ink);
  font-size: 10px;
  font-weight: 700;
}

.log-badge[hidden] {
  display: none;
}

@media (max-width: 699px) {
  .log-logs-row.searching .log-fwrap {
    opacity: 0;
    pointer-events: none;
  }
}

/* the day row */
.log-page,
.log-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.log-strip {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ld {
  flex: none;
  width: 48px;
  padding: 7px 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--glass);
  color: var(--text);
  font: inherit;
  text-align: center;
  cursor: pointer;
  scroll-snap-align: start;
}

.ld span {
  display: block;
  color: var(--text-3);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ld b {
  display: block;
  margin-top: 1px;
  font-size: 17px;
  font-weight: 650;
}

.ld i {
  display: block;
  width: 4px;
  height: 4px;
  margin: 3px auto 0;
  border-radius: 50%;
  background: var(--select);
  opacity: 0;
}

.ld.has i,
.ld-all i {
  opacity: 0.9;
}

.ld.fut {
  opacity: 0.4;
}

.ld[aria-pressed="true"] {
  background: var(--select);
  border-color: var(--select);
  color: var(--select-ink);
  opacity: 1;
}

.ld[aria-pressed="true"] span {
  color: var(--select-ink);
  opacity: 0.65;
}

.ld[aria-pressed="true"] i {
  background: var(--select-ink);
}

/* the same scroll rules as the Plan's category pills (--fl and --fr are registered above): one pill snaps to the start edge, the
   left fade shows only while the row moves, the right fade stays until the row reaches its end */
.log-days {
  --fr: 60px;
  position: relative;
  flex: 1 1 0;
  width: 0; /* a definite width, so its 31 days don't set the page's minimum width */
  min-width: 0;
  display: flex;
  gap: 6px;
  padding: 2px 6px 2px 3px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 3px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, rgba(0, 0, 0, 0.5) calc(var(--fl) / 2), #000 var(--fl), #000 calc(100% - var(--fr)), rgba(0, 0, 0, 0.55) calc(100% - var(--fr) * 0.55), rgba(0, 0, 0, 0.15) calc(100% - var(--fr) * 0.2), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, rgba(0, 0, 0, 0.5) calc(var(--fl) / 2), #000 var(--fl), #000 calc(100% - var(--fr)), rgba(0, 0, 0, 0.55) calc(100% - var(--fr) * 0.55), rgba(0, 0, 0, 0.15) calc(100% - var(--fr) * 0.2), transparent 100%);
  transition: --fl 0.35s ease, --fr 0.35s ease;
}

.log-days::-webkit-scrollbar {
  display: none;
}

.log-days.at-end {
  --fr: 0px;
}

.log-days.is-moving {
  --fl: 18px;
}

/* the filters: a pane / sheet of rows — a label on the left, its control beside it */
.log-filters {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 22px;
}

.log-filters[hidden] {
  display: none;
}

.log-filters h4 {
  margin: 0;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lf-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.lf-row.lf-amt {
  padding-top: 0;
  border-top: 0;
}

.lf-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: 38px;
  border-radius: 14px;
  background: var(--recessed);
  transition: box-shadow 0.15s ease;
}

.lf-pair:focus-within {
  box-shadow: 0 0 0 1.5px var(--select);
}

.lf-pair label {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  padding: 0 10px;
}

.lf-pair label + label {
  border-left: 1px solid var(--line-strong);
}

.lf-pair span {
  color: var(--text-3);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lf-pair input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  outline: none;
  color: var(--text);
  font: 600 14px var(--font);
}

.lf-ms {
  position: relative;
}

.lf-ms summary {
  position: relative;
  min-height: 38px;
  padding: 10px 30px 10px 12px;
  border-radius: 14px;
  background: var(--recessed);
  list-style: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.lf-ms summary::-webkit-details-marker {
  display: none;
}

.lf-ms summary::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  width: 6px;
  height: 6px;
  border: solid var(--text-3);
  border-width: 0 2px 2px 0;
  transform: translateY(-70%) rotate(45deg);
}

.lf-ms[open] summary::after {
  transform: translateY(-30%) rotate(225deg);
}

.lf-ms.on summary {
  color: var(--good-text);
}

.lf-opts {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--glass-solid);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6);
}

.lf-opts label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
}

.lf-opts label:hover {
  background: var(--raised);
}

.lf-opts input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--select);
}

.lf-grp {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.lf-grp > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  cursor: pointer;
}

.lf-grp > summary::-webkit-details-marker {
  display: none;
}

.lf-gs {
  color: var(--text-3);
  font-size: 11px;
}

.lf-gs.on {
  color: var(--good-text);
}

.lf-pills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 5px;
  margin-top: 8px;
}

.lf-p {
  height: 26px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--raised);
  color: var(--text-2);
  font: 600 11px var(--font);
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
}

.lf-p[aria-pressed="true"] {
  background: var(--select);
  border-color: var(--select);
  color: var(--select-ink);
}

.lf-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lf-res {
  color: var(--text-3);
  font-size: 12px;
}

.lf-clear {
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: none;
  color: var(--text-2);
  font: 600 12px var(--font);
  cursor: pointer;
}

/* a wide screen: the pane takes the right half, the entries the left half (one card to a row there) */
@media (min-width: 900px) {
  .log-page.open {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 20px;
    align-items: start;
  }

  .log-page.open .log-col {
    grid-column: 1;
    min-width: 0;
  }

  .log-page.open .log-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .log-page.open .log-filters {
    grid-column: 2;
    grid-row: 1;
    align-self: start; /* as tall as its filters need (Nov 2026): the page scrolls, never the card */
  }

  /* the groups are always open in the pane */
  .lf-grp > summary {
    pointer-events: none;
  }

  .lf-gs {
    display: none;
  }
}

/* under 900px the sheet is condensed: tighter, the groups collapsed to a row each */
@media (max-width: 899px) {
  .log-filters {
    gap: 10px;
    padding: 12px 14px;
    border-radius: 18px;
  }

  .log-filters h4 {
    font-size: 10px;
  }

  .lf-row {
    padding-top: 10px;
  }

  .lf-pair input {
    font-size: 14px;
  }

  .lf-ms summary {
    min-height: 36px;
    padding: 9px 26px 9px 10px;
    font-size: 12px;
  }

  .lf-pills {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 4px;
  }

  .lf-p {
    height: 24px;
    padding: 0 4px;
    font-size: 10.5px;
  }
}

/* a day in the list is a quiet sub-header under the Logs header: the weekday in lime, the date, In and Out at the right end,
   a hairline under (it was a section header's style until 23 Oct) */
.log-day,
.log-list > .log-day {
  margin: 14px 4px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--text-2);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.log-day em {
  margin-right: 6px;
  color: var(--good-text);
  font-style: normal;
}

.log-day-sum {
  gap: 12px;
  color: var(--text-3);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.log-day-sum .cur {
  font-size: 8px;
}

/* nothing on the day (or nothing matching): a glass card with the note alone */
.log-empty {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 24px;
  border-radius: 18px;
  text-align: center;
}

.log-empty p {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 300px;
  margin: 0;
}

.le-h {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  text-wrap: balance;
}

.le-s {
  display: block;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  text-wrap: balance;
}

@media (max-width: 699px) {
  .le-s .tap {
    display: block;
    margin-top: 4px;
  }
}

/* ---------- Log: the Logs row and the day row stay pinned (23 Oct, the user) ----------
   Scrolling down the list, the Logs header, its buttons and the day row stop under the page's top and everything below
   them scrolls under them, blurred and fading out beneath, as under the top itself. A phone scrolls the whole page
   (the top is sticky, --top-h tall, its bottom 10px pulled up); a wide screen scrolls the section, which starts under
   the top, so the pin sits where the section's padding ends. On a wide screen the pane is pinned at the same height. */
.log-page {
  margin-top: 30px;
}

.log-logs-row {
  margin: 0;
}

.log-head {
  position: sticky;
  z-index: 6;
  top: var(--log-pin, 0px);
  isolation: isolate;
  padding: 6px 0 10px;
}

.log-head::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -6px -20px -14px;
  pointer-events: none;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 16px), transparent);
}

@media (max-width: 699px) {
  .log-head {
    --log-pin: calc(var(--top-h, 0px) - 10px);
  }

  /* the blur backing reaches the screen's edges (the page's side gutter is 16px), no further */
  .log-head::before {
    inset: -6px -16px -14px;
  }
}

@media (min-width: 700px) {
  /* the blur backing reaches up under the top (16px of gap sits between the top's blur and the pinned row) and fades in there,
     so no entry shows through in a band between them */
  .log-head::before {
    inset: -30px -20px -14px;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16px, #000 calc(100% - 16px), transparent);
    mask-image: linear-gradient(to bottom, transparent 0, #000 16px, #000 calc(100% - 16px), transparent);
  }

  /* a sticky offset counts from inside the section's padding (which already clears the top), so the pin is 0 */
  .log-head,
  .log-filters {
    --log-pin: 0px;
  }
}

/* under 900px the head, the sheet and the list stand one under the other (the column dissolves into the page) */
@media (max-width: 899px) {
  .log-col {
    display: contents;
  }

  .log-head {
    order: 1;
  }

  .log-filters {
    order: 2;
  }

  .log-list {
    order: 3;
  }
}

/* Learned keywords (23 Oct): what logging learned from a bank message's vendor is purple — apart from the lime
   keywords made from an item's name. Same chip, its own colour; the Keywords pane and the log entry's Remembers line. */
:root { --learned: #b794f6; }
.kw-chip.learned { border-color: var(--learned); background: rgba(183, 148, 246, 0.2); color: var(--learned); }
.kw-chip.learned.pending { border-style: dashed; }
.vk-x { margin: 0 -4px 0 0; padding: 0 4px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
/* The log entry sheet's Keyword row, under Line (23 Oct): purple pills at the boxes' right edge, no divider above it. Tap a pill to
   edit it, × removes it, the dashed + Add pill makes a new one; the pills wrap, the label stays centred against them. */
#entry-edit .kw-row { align-items: center; box-shadow: none; padding-block: 2px 6px; }
#entry-edit .kw-row[hidden] { display: none; }
#entry-edit .kw-col { display: flex; justify-content: flex-end; width: 190px; min-width: 0; }
#entry-edit .kw-pills { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
#entry-edit .kw-row .kw-chip { cursor: default; flex: none; }
#entry-edit .kw-t { border: 0; background: none; color: inherit; font: inherit; padding: 0; cursor: text; }
.kw-add-pill { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; line-height: 1.35; border: 1px dashed var(--learned); border-radius: 999px; background: none; color: var(--learned); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.kw-add-pill:hover, .kw-add-pill:focus-visible { background: rgba(183, 148, 246, 0.14); }
.kw-add-in { width: 92px; padding: 6px 12px; line-height: 1.35; border: 1px solid var(--learned); border-radius: 999px; background: rgba(183, 148, 246, 0.1); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; outline: none; }

/* Paid from saving plan (24 Oct, the user's design): under its switch, the plans of the account the expense comes out of on a full-width row, then what is left in the one picked; the Note row after it keeps its line */
#entry-edit .full-row { display: block; }
#entry-edit .full-row .ctl { width: 100%; }
#entry-edit .fund-note { margin: 0; padding: 6px 0 12px; font-size: 13px; }
#entry-edit .fund-note b { color: var(--text); }
#entry-edit .fund-note + .rule-field { box-shadow: inset 0 1px 0 var(--line); }
#entry-edit [data-row="plan"][hidden], #entry-edit [data-row="plannote"][hidden] { display: none; }
html[data-private="on"] #entry-edit .fund-note .amt { filter: blur(max(7px, 0.4em)); }

/* The card redesign, a phone (24 Oct 2026): the stack must still fit the glass card's room, so each bar is a little shorter
   (a 13.5-wide header, 5 of the graphic showing) */
@media (max-width: 700px) {
  .acc-card.acc-has-stack {
    --acc-step: 18.5%;
  }

  .acc-scard .acc-srow {
    height: 13.5cqw;
  }

  .acc-scard .acc-qt {
    top: 9cqw;
  }
}

/* Tracker › Accounts, a phone, a card picked (24 Oct 2026, the user): the Saving Plans area is tightened so the picked card shows at
   the glass card's full width, with the plans whole (tile, dots, Archived) above it and the stack beneath it */
@media (max-width: 700px) {
  .acc-card.acc-has-stack.is-picked {
    row-gap: 10px;
  }

  .acc-card.acc-has-stack.is-picked .acc-panel {
    gap: 6px;
  }

  .acc-card.acc-has-stack.is-picked .acc-detail,
  .acc-card.acc-has-stack.is-picked .acc-lines,
  .acc-card.acc-has-stack.is-picked .acc-paged {
    gap: 4px;
  }

  .acc-card.acc-has-stack.is-picked .acc-detail .acc-line {
    padding: 10px 14px 12px;
  }

  .acc-card.acc-has-stack.is-picked .acc-arch-head {
    padding-block: 6px;
  }
}

/* a phone, a card picked: the Archived row sits close under the page dots (24 Oct 2026, the user) */
@media (max-width: 700px) {
  .acc-card.acc-has-stack.is-picked .acc-arch {
    margin-top: -4px;
  }

  .acc-card.acc-has-stack.is-picked .acc-arch-head {
    padding-block: 4px;
  }
}

/* the card's words and amounts stay above the graphic */
.acc-srow,
.acc-bank .acc-top,
.acc-bank .acc-bottom {
  position: relative;
  z-index: 1;
}

/* A picked card changes colour (24 Oct 2026, the user): swipe it, or tap a ring under it. One ring a colour combo — the card's face with
   its graphic colour around it; the card's own is larger and has a white ring */
.acc-pop[data-acc-tracker] {
  touch-action: pan-y;
  cursor: grab;
}

.acc-tones {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 70;
  display: flex;
  justify-content: center;
  gap: 12px;
  pointer-events: none;
}

.acc-tone {
  position: relative;
  pointer-events: auto;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: linear-gradient(160deg, var(--a), var(--b));
  box-shadow: inset 0 0 0 2.5px var(--e);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.acc-tone::after {
  content: "";
  position: absolute;
  inset: -9px;
}

.acc-tone[aria-pressed="true"] {
  transform: scale(1.55);
  box-shadow: inset 0 0 0 2.5px var(--e), 0 0 0 1.5px rgba(255, 255, 255, 0.9);
}

.acc-tone:focus-visible {
  outline: 2px solid var(--select-rim, #c6f432);
  outline-offset: 3px;
}

/* ---------- Track › Credit Cards (24 Oct 2026, approved with the user) ----------
   Accounts' glass card with the cards as the stack: the stack | the figures | the Transactions list. Each bar shows what is
   left of the card's limit; a picked card shows Remaining (bottom left), its due date (top right), a meter of the limit used. */
.cc-card.acc-has-stack {
  grid-template-columns: minmax(0, 1fr) minmax(200px, 0.64fr) minmax(0, 1.5fr);
  grid-template-rows: 1fr;
  row-gap: 0;
}

.cc-card .acc-left { grid-column: 1; grid-row: 1; }
.cc-card .cc-head { grid-column: 2; grid-row: 1; align-self: start; align-content: start; }
.cc-card .acc-panel { grid-column: 3; grid-row: 1; }

.cc-figs { display: grid; gap: 18px; }
.cc-fig { display: grid; gap: 3px; min-width: 0; }
.cc-fl { color: var(--text-3); font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.cc-fv { display: flex; align-items: baseline; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; white-space: nowrap; }
.cc-fv i { margin-left: 4px; color: var(--text-2); font-size: 12px; font-style: normal; font-weight: 700; letter-spacing: 0.06em; }
.cc-good .cc-fv { color: var(--good-text); }
.cc-fn { color: var(--text-3); font-size: 12.5px; font-style: normal; white-space: nowrap; }
.cc-ln { display: block; }
.cc-stin { min-width: 0; padding: 0; border: 0; border-radius: 6px; outline: 0; background: none; color: inherit; font: inherit; font-variant-numeric: tabular-nums; field-sizing: content; }
.cc-stin:focus { background: var(--raised); box-shadow: 0 0 0 2px var(--good); }
.cc-tap { cursor: text; }
.cc-fig.cc-tap:focus-within { box-shadow: inset 0 0 0 1.5px var(--good); }

/* the picked card: its due date where the amount was, Remaining and a meter at the foot, the pattern fading under the words */
.cc-pop .acc-qt { opacity: 0.55; }
.cc-pop::after { content: ""; position: absolute; inset: 38% 0 0 0; z-index: 0; pointer-events: none; background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--c3) 88%, transparent) 62%); }
.cc-pop .cc-due { margin-left: auto; color: rgba(244, 241, 234, 0.7); font-size: 5cqw; font-weight: 500; line-height: 1; white-space: nowrap; }
.cc-pop .cc-due b { margin-left: 0.3em; color: #f4f1ea; font-weight: 700; }
.cc-meter { display: block; height: 1.5cqw; margin-top: 2cqw; overflow: hidden; border-radius: 99px; background: rgba(255, 255, 255, 0.16); }
.cc-meter i { display: block; height: 100%; border-radius: 99px; background: #fff; }
.cc-sub { display: flex; justify-content: space-between; margin-top: 1.4cqw; color: rgba(244, 241, 234, 0.75); font-size: 3.4cqw; font-weight: 500; }

/* Transactions: the title and, at the right, search and filters as in Logs */
.cc-lh { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.cc-lh .log-tools { display: flex; align-items: center; gap: 10px; }
.cc-lh.searching .acc-panel-title { display: none; }
.cc-lh.searching .log-tools { flex: 1; min-width: 0; }
.cc-lh.searching .log-sx { flex: 1 1 auto; width: auto; min-width: 0; }
.cc-lh.searching .log-sin { flex: 1 1 auto; width: auto; padding: 0 4px 0 18px; opacity: 1; transition-delay: 0.14s; }
.cc-fpane { display: grid; gap: 10px; }
.cc-fpane[hidden] { display: none; }
.cc-frow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cc-frow .cc-fl { min-width: 44px; }
.cc-p[data-cc-card]::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--em); }
.cc-dd { position: relative; margin-left: auto; }
.cc-ddb { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px 5px 12px; border: 0; border-radius: 999px; background: none; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text-2); font-size: 12px; font-weight: 600; cursor: pointer; }
.cc-ddb .icon { width: 16px; height: 16px; }
.cc-ddb[aria-expanded="true"] { box-shadow: inset 0 0 0 1px var(--select-rim); color: var(--text); }
.cc-ddm { position: absolute; right: 0; top: calc(100% + 6px); z-index: 6; display: flex; flex-direction: column; gap: 2px; width: 210px; max-height: 210px; padding: 6px; overflow: auto; border-radius: 16px; background: var(--glass-solid); box-shadow: inset 0 0 0 1px var(--glass-rim-soft), 0 18px 40px rgba(0, 0, 0, 0.5); }
.cc-ddi { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--text-2); font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; }
.cc-ddi:hover { background: var(--raised); }
.cc-ddi i { flex: none; width: 16px; height: 16px; border-radius: 5px; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.3); }
.cc-ddi[aria-selected="true"] { color: var(--text); }
.cc-ddi[aria-selected="true"] i { background: var(--good); box-shadow: none; }

.cc-tiles { display: flex; flex-direction: column; gap: 10px; }
.cc-tile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--raised); box-shadow: inset 0 0 0 1px var(--glass-rim-soft); }
.cc-cal { flex: none; border-color: color-mix(in srgb, var(--em) 55%, transparent); background: var(--c2); }
.cc-cal i { background: color-mix(in srgb, var(--em) 30%, transparent); color: var(--em); }
.cc-t { display: grid; flex: 1; gap: 4px; min-width: 0; }
.cc-name { overflow: visible; font-size: 14px; font-weight: 600; line-height: 1.25; }
.cc-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-left: -6px; }
.cc-up { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 50%, transparent); color: var(--good-text); }
.cc-amt { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cc-amt i { margin-left: 3px; color: var(--text-2); font-size: 10px; font-style: normal; font-weight: 700; }

/* A phone: the figures as glass tiles, the list, then the stack at the bottom */
@media (max-width: 700px) {
  .cc-card.acc-has-stack { grid-template-columns: minmax(0, 1fr); }
  .cc-card.acc-has-stack .cc-head { grid-column: 1; grid-row: 1; }
  .cc-card.acc-has-stack .acc-panel { grid-column: 1; grid-row: 2; }
  .cc-card.acc-has-stack .acc-left { grid-column: 1; grid-row: 3; }
  .cc-figs { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cc-fig { padding: 12px 14px; border-radius: 18px; background: rgba(26, 31, 18, 0.6); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1); }
  .cc-fl { font-size: 10px; }
  .cc-fv { font-size: 22px; }
  .cc-fv i { margin-left: 3px; font-size: 10px; }
  .cc-fn { font-size: 11px; line-height: 1.3; }
  .cc-figs.three .cc-fig:first-child, .cc-figs.p3 .cc-fig:last-child { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; align-items: end; column-gap: 12px; }
  .cc-figs.three .cc-fig:first-child .cc-fl, .cc-figs.p3 .cc-fig:last-child .cc-fl { grid-column: 1 / -1; }
  .cc-figs.three .cc-fig:first-child .cc-fn, .cc-figs.p3 .cc-fig:last-child .cc-fn { margin-bottom: 4px; text-align: right; }
}

/* Private mode (every amount blurs, 23 Oct): the figures, each transaction's amount, what's used of the limit, the amounts in the notes */
html[data-private="on"] .cc-card :is(.cc-fv, .cc-amt, .cc-sub .sensitive, .cc-fn .sensitive) {
  filter: blur(max(7px, 0.4em));
}

/* the Credit Cards page doesn't scroll either (as Accounts): the Transactions list scrolls inside the glass card */
html:has(.page[data-page="tracker"]:not([hidden]) .section[data-section="cards"]:not([hidden])),
html:has(.page[data-page="tracker"]:not([hidden]) .section[data-section="cards"]:not([hidden])) body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

.cc-card .acc-panel { display: flex; flex-direction: column; gap: 14px; }
.cc-card .acc-detail { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: -12px -16px 0; padding: 12px 16px 22px; scrollbar-width: thin; scrollbar-color: var(--raised) transparent; }

@media (max-width: 700px) {
  .cc-card.acc-has-stack,
  .cc-card.acc-has-stack:not(.is-picked) {
    height: calc(100dvh - 136px - var(--dock-h) - var(--dock-b, 20px) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) auto; /* the figures, the list, the stack docked at the bottom as in Accounts */
    row-gap: 12px;
  }
  .cc-card.acc-has-stack.is-picked { grid-template-rows: auto minmax(0, 1fr) auto; } /* (Accounts' picked card has the 1fr on its third row) */
  .cc-card .acc-panel { min-height: 0; padding-bottom: 0; }
  /* the card picked comes up whole at the top of the stack, with its colour rings under it: the stack's room is that card's height */
  .cc-card.acc-has-stack.is-picked .acc-stack-wrap { flex: none; padding-bottom: calc(63.05% + 30px); }
  .cc-card.acc-has-stack.is-picked .acc-stack { display: none; } /* the others are out of the way, so the list keeps its room */
  .cc-card.acc-has-stack.is-picked .acc-left.acc-has-stack { align-self: start; }
}

/* (24 Oct) Home's account cards, phone and desktop: name, balance, and at the foot the free amount with a bar under it (the free share of the balance).
   The ring of the same day is gone; the set-aside line is gone. The amount keeps .pcard-vs so private mode blurs it. */
.acc-pager .g-acc .g-free { display: flex; flex-direction: column; gap: 7px; min-width: 0; margin-top: auto; padding-top: 10px; }
.acc-pager .g-acc .g-free .pcard-vs { margin-top: 0; }
.acc-pager .g-acc .g-free-bar { display: block; height: 5px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--text) 16%, transparent); }
.acc-pager .g-acc .g-free-bar u { display: block; height: 100%; border-radius: inherit; background: var(--good); }
@media (min-width: 700px) {
  .acc-pager .pcard.g-acc { min-height: 190px; }
  .acc-pager .g-acc .g-free { gap: 9px; padding-top: 22px; }
  .acc-pager .g-acc .g-free-bar { height: 6px; }
}
/* a phone: name, then the balance 22 px under it (5 px higher than the first design put it), the free amount and its bar at the foot */
@media (max-width: 699px) {
  .acc-pager .pcard.g-acc { justify-content: flex-start; }
  .acc-pager .g-acc .g-figs { margin-top: 22px; }
  .acc-pager .g-acc .g-free { padding-top: 0; }
}

/* (24 Oct) Streak: the month's puzzle fills the widget area (drawn by fitStreak in app.js at the area's own size); the next piece pulses */
.glance-viz.sk-wrap { display: block; }
.sk-pz { display: block; width: 100%; height: 100%; }
.sk-pz svg { display: block; width: 100%; height: 100%; }
@keyframes sk-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.sk-pz .sk-next { animation: sk-pulse 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .sk-pz .sk-next { animation: none; } }

/* ---------- The neon cards (25 Oct 2026, approved with the user) ----------
   A card is one flat colour with its shape over the whole face — rings on an account, a flowing shape on a credit card — and the words
   are white. Debit (Accounts) and credit (Credit Cards) are told apart by the shape. The old Quarter Tiles graphic is gone. */
.acc-bgart { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--em); pointer-events: none; }
.acc-scard .acc-srow { position: relative; z-index: 1; }
.acc-bank .acc-top, .acc-bank .acc-bottom { position: relative; z-index: 2; }
:is(.acc-scard, .acc-bank) :is(.acc-top, .acc-sbal, .acc-bal, .acc-bottom, .cc-due, .cc-sub) { color: #fff; text-shadow: 0 0 5px rgba(0, 0, 0, 0.6); }
:is(.acc-scard, .acc-bank) .acc-lab { color: #fff; opacity: 1; }
:is(.acc-scard, .acc-bank) .acc-cur { color: rgba(255, 255, 255, 0.75); }
.cc-pop::after { display: none; }
.acc-sep { background: rgba(255, 255, 255, 0.45); }
/* Home's account cards are tinted in the card's colour: their free amount and its bar are white on it, not lime */
.acc-pager .g-acc.tinted .pcard-vs, .acc-pager .g-acc.tinted .pcard-vs.t-good { color: #fff; }
.acc-pager .g-acc.tinted .g-free-bar { background: rgba(255, 255, 255, 0.3); }
.acc-pager .g-acc.tinted .g-free-bar u { background: #fff; }
.acc-pager .g-acc.tinted .g-fig-lab { color: #fff; }
.acc-pager .g-acc.tinted .pcard-amount .cur { color: rgba(255, 255, 255, 0.75); }
.cc-cal { background: rgba(12, 10, 20, 0.6); }

/* Track › Credit Cards, a phone with no card picked (24 Oct, the user): laid out like Accounts — the title, the limit big, remaining and
   spent on one line under, and the stack filling the rest of the glass card: fewer cards fan out further, the first dragged up to the top */
.cc-phone-head { display: none; }
@media (max-width: 700px) {
  .cc-card.acc-has-stack:not(.is-picked) .cc-head { display: none; }
  .cc-card.acc-has-stack:not(.is-picked) .cc-phone-head { display: grid; grid-column: 1; grid-row: 1; }
  .cc-card.acc-has-stack.is-picked .cc-phone-head { display: none; }
  .cc-card.acc-has-stack:not(.is-picked) { grid-template-rows: auto minmax(0, 1fr); }
  .cc-card.acc-has-stack:not(.is-picked) .acc-left { grid-row: 2; align-self: end; }
  .cc-card.acc-has-stack:not(.is-picked) .acc-stack-wrap { padding-bottom: var(--acc-room, calc((var(--acc-n, 5) - 1) * var(--acc-step) + 31.8%)); }
}

.acc-addcard .icon { color: #fff; opacity: 1; }

/* ---------- Home's account cards as tinted glass (25 Oct 2026, approved with the user) ----------
   Soft diagonal: the card's colour melts into its second tone over a see-through glass face, dark like the All Accounts card; the free bar is lime. */
.acc-pager .pcard.glass.g-acc.tinted {
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.10), color-mix(in srgb, var(--c1) 7%, transparent) 45%, rgba(255, 255, 255, 0.02)),
    linear-gradient(135deg, color-mix(in srgb, var(--c1) 30%, transparent), color-mix(in srgb, var(--acc) 30%, transparent)),
    linear-gradient(#080a05, #080a05) !important;
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -1px 0 color-mix(in srgb, var(--c1) 30%, transparent);
}
.acc-pager .g-acc.tinted .g-free-bar { background: rgba(255, 255, 255, 0.14); }
.acc-pager .g-acc.tinted .g-free-bar u { background: var(--good); }

/* the free line runs the card's full width, so its bar does too (25 Oct) */
.acc-pager .g-acc.tinted .g-free { align-self: stretch; }

/* ---------- Backdrop looks (24 Oct, the user, after previews): the breathing backdrop and its picker in Settings › Background ---------- */
/* The ground drifts under three lights that swell and fade a third of a breath apart (11 s a breath); lime stays the accent */
[data-bgstyle="breathe"] .backdrop::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: radial-gradient(120% 80% at 20% 0%, var(--wash), transparent 60%), radial-gradient(100% 70% at 100% 100%, var(--wash-2), transparent 60%);
  animation: bd-wash 33s ease-in-out infinite alternate;
}
[data-bgstyle="breathe"] .backdrop i:nth-child(n + 4) { display: none; }
[data-bgstyle="breathe"] .backdrop i:nth-child(1) { width: 62vmax; height: 62vmax; left: -16vmax; top: -18vmax; background: radial-gradient(circle, var(--blob-1), transparent 66%); animation: bd-breathe 11s ease-in-out infinite; }
[data-bgstyle="breathe"] .backdrop i:nth-child(2) { width: 56vmax; height: 56vmax; right: -20vmax; top: 30vh; background: radial-gradient(circle, var(--blob-2), transparent 66%); animation: bd-breathe 11s ease-in-out -3.67s infinite; }
[data-bgstyle="breathe"] .backdrop i:nth-child(3) { width: 50vmax; height: 50vmax; left: 14vw; bottom: -24vmax; left: 14vw; background: radial-gradient(circle, var(--blob-3), transparent 66%); animation: bd-breathe 11s ease-in-out -7.33s infinite; }
@keyframes bd-wash { to { transform: translate3d(4%, -3%, 0) rotate(4deg) scale(1.08); } }
@keyframes bd-breathe {
  0%, 100% { transform: translate3d(0, 0, 0) scale(0.86); opacity: 0.55; }
  50% { transform: translate3d(5%, 4%, 0) scale(1.14); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  [data-bgstyle="breathe"] .backdrop::before, [data-bgstyle="breathe"] .backdrop i { animation: none; }
}

/* The picker: a live window on the chosen look (a Home At a Glance card; a phone shows the four, 2 × 2) and six orbs */
.bl-sub { margin: 6px 0 -4px; font-size: 12px; font-weight: 650; color: var(--text-2); }
.bl-hero { position: relative; overflow: hidden; isolation: isolate; border-radius: 18px; padding: 14px; margin-top: var(--sp-3); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-strong); touch-action: pan-y; cursor: grab; }
.bl-hero > i { position: absolute; border-radius: 50%; filter: blur(26px); z-index: -1; }
.bl-hero > i:nth-of-type(1) { width: 80%; aspect-ratio: 1; left: -20%; top: -30%; background: radial-gradient(circle, var(--blob-1), transparent 66%); animation: bd-breathe 11s ease-in-out infinite; }
.bl-hero > i:nth-of-type(2) { width: 70%; aspect-ratio: 1; right: -24%; top: 18%; background: radial-gradient(circle, var(--blob-2), transparent 66%); animation: bd-breathe 11s ease-in-out -3.67s infinite; }
.bl-hero > i:nth-of-type(3) { width: 60%; aspect-ratio: 1; left: 14%; bottom: -40%; background: radial-gradient(circle, var(--blob-3), transparent 66%); animation: bd-breathe 11s ease-in-out -7.33s infinite; }
.bl-hero.swap > * { animation: bl-swap 0.45s ease-out; }
@keyframes bl-swap { from { opacity: 0.2; transform: scale(0.97); } }
.bl-gl { position: relative; display: grid; gap: 2px; padding: 16px; border-radius: 20px; background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--glass-shadow); }
.bl-gl::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(155deg, var(--glass-sheen), transparent 35%, transparent 72%, var(--glass-sheen)); }
.bl-gl::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; background: linear-gradient(145deg, var(--glass-rim), var(--glass-rim-soft) 28%, transparent 50%, var(--glass-rim-soft) 74%, var(--glass-rim)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.bl-name { font-size: 15px; font-weight: 700; }
.bl-fig { margin-top: 8px; font-size: 28px; line-height: 34px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.bl-cur, .bl-am small { margin-left: 4px; font-size: 11px; font-weight: 700; color: var(--text-3); letter-spacing: 0; }
.bl-ins { font-size: 11.5px; font-weight: 650; color: var(--good-text); }
.bl-viz { display: grid; gap: 8px; margin-top: 12px; }
.bl-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.bl-cal { display: grid; width: 30px; overflow: hidden; border-radius: 7px; box-shadow: inset 0 0 0 1px var(--line-strong); text-align: center; line-height: 1; }
.bl-cal em { font-style: normal; font-size: 7px; font-weight: 800; letter-spacing: 0.08em; padding: 2px 0; background: var(--select-glass); color: var(--good-text); }
.bl-cal b { font-size: 13px; padding: 3px 0 4px; }
.bl-nm { font-size: 12.5px; font-weight: 650; min-width: 0; }
.bl-nm small { display: block; font-size: 10.5px; font-weight: 500; color: var(--text-3); }
.bl-am { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bl-gp { display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bl-gs { min-width: 0; }
.bl-gs { padding: 12px; border-radius: 16px; gap: 1px; }
.bl-gs .bl-name { font-size: 13px; }
.bl-gs .bl-fig { margin-top: 4px; font-size: 20px; line-height: 26px; }
.bl-gs .bl-cur { font-size: 9px; margin-left: 3px; }
.bl-gs .bl-ins { font-size: 10.5px; white-space: nowrap; }
.bl-gs .bl-viz { gap: 5px; margin-top: 8px; }
.bl-gs .bl-row { gap: 7px; }
.bl-gs .bl-cal { width: 24px; }
.bl-gs .bl-cal em { font-size: 6px; }
.bl-gs .bl-cal b { font-size: 11px; padding: 2px 0 3px; }
.bl-gs .bl-nm { font-size: 10.5px; white-space: nowrap; }
.bl-gs .bl-am { font-size: 10.5px; }
.bl-puz { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; height: 46px; }
.bl-puz u { border-radius: 2px; background: var(--good); opacity: 0.85; }
.bl-puz .nx { background: transparent; box-shadow: inset 0 0 0 1px var(--good); }
.bl-puz .no { background: var(--raised); opacity: 1; }
.bl-lr, .bl-cc { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 10.5px; color: var(--text-2); }
.bl-lr b, .bl-cc b { color: var(--text); font-variant-numeric: tabular-nums; }
.bl-lr b.over { color: var(--bad-text); }
.bl-cc { justify-content: flex-start; }
.bl-cc i { width: 7px; height: 7px; border-radius: 50%; }
.bl-cc span { flex: 1; }
@media (max-width: 699px) {
  .bl-hero > .bl-gl:not(.bl-gs) { display: none; }
  .bl-gp { display: grid; }
}
.bl-orbs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-top: var(--sp-3); }
@media (max-width: 400px) { .bl-orbs { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 10px; } }
.bl-orb { all: unset; cursor: pointer; display: grid; gap: 6px; justify-items: center; font-size: 11px; font-weight: 650; color: var(--text-3); text-align: center; }
.bl-orb .bl-o { position: relative; width: 100%; max-width: 52px; aspect-ratio: 1; border-radius: 50%; overflow: hidden; isolation: isolate; box-shadow: inset 0 0 0 1px var(--line-strong); }
.bl-orb .bl-o u { position: absolute; border-radius: 50%; filter: blur(7px); animation: bd-breathe 7s ease-in-out infinite; }
.bl-orb .bl-o u:nth-child(2) { animation-delay: -2.3s; }
.bl-orb .bl-o u:nth-child(3) { animation-delay: -4.6s; }
.bl-orb[aria-pressed="true"] .bl-o { outline: 2px solid var(--text); outline-offset: 3px; }
.bl-orb[aria-pressed="true"] { color: var(--text); }
.bl-orb:focus-visible .bl-o { outline: 2px solid var(--focus); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .bl-hero > i, .bl-orb .bl-o u { animation: none; } }
/* Private mode: the sample figures in the picker's window blur like every amount */
html[data-private="on"] :is(.bl-fig, .bl-am, .bl-lr b, .bl-cc b) { filter: blur(max(7px, 0.4em)); }

/* ---------- Track › Accounts and Credit Cards, a phone's stack (27 Oct 2026, the user's guide: "Credit Card Stack Guide") ----------
   The stack is docked at the glass card's bottom edge with one step for every number of cards — the step that fits six, 18.5% of the stack's
   width on a tall glass card and 15.5% on a short one (fitAccountStack sets --acc-step and --acc-room): few cards show whole with the free
   space above them, six fit, the sixth cut by the edge. Seven or more: a View All pill floats over the sixth card; it opens the whole list
   over the glass card — the figures fold into one line and a Done button, in a blurred band the cards scroll under — and the cards leave on
   their own beat (toggleStackOpen). */
.acc-open-bar, .acc-more { display: none; }
@media (max-width: 700px) {
  .acc-card.acc-has-stack:not(.is-picked) .acc-stack-wrap { padding-bottom: var(--acc-room, calc((var(--acc-n, 5) - 1) * var(--acc-step) + 31.8%)); }
  .acc-card.acc-has-stack:not(.is-picked) .acc-left { position: relative; }
  .acc-card.acc-has-stack:not(.is-picked) .acc-more {
    position: absolute; left: 50%; bottom: 14px; z-index: 50; transform: translateX(-50%);
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 16px; border-radius: 999px; cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(10, 12, 7, 0.62); color: #fff; font: 700 13px var(--font); white-space: nowrap;
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  }
  /* only six show: the others wait behind the pill until the list opens */
  .acc-card.acc-has-stack:not(.stack-open):not(.is-picked) .acc-stack > .acc-scard:nth-child(n + 7) { visibility: hidden; }
  .acc-more .icon { width: 14px; height: 14px; }
  .acc-more:hover { background: var(--good); border-color: var(--good); color: #11140a; }

  /* opened */
  .acc-card.acc-has-stack.stack-open { overflow: hidden; }
  .acc-card.acc-has-stack.stack-open .acc-left {
    position: absolute; left: 22px; right: 22px; top: 0; bottom: 0; grid-column: auto; grid-row: auto; z-index: 1; width: auto !important; max-width: none !important; justify-self: stretch !important; align-self: stretch !important; /* from the glass card's own edges, not the grid's column area */
    justify-content: flex-start !important; overflow-y: auto; overflow-anchor: none; overscroll-behavior: contain; scrollbar-width: none; padding-top: 104px; padding-bottom: 18px;
  }
  .acc-card.acc-has-stack.stack-open .acc-left::-webkit-scrollbar { display: none; }
  .acc-card.acc-has-stack.stack-open .acc-stack-wrap { clip-path: none; padding-bottom: calc((var(--acc-n, 5) - 1) * var(--acc-step, 18.5%) + 63.05%) !important; }
  .acc-card.acc-has-stack.stack-open .acc-more { display: none; }
  .acc-card.acc-has-stack.stack-open .acc-plus-corner { display: none; }
  .acc-card.acc-has-stack.stack-open:not(.is-picked) .acc-head {
    position: absolute; z-index: 40; left: 0; right: 0; top: 0; grid-column: auto; grid-row: auto; display: block; margin: 0;
    padding: 18px 22px 14px; background: linear-gradient(to bottom, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.045));
    -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: acc-band-in 0.35s ease both;
  }
  .acc-card.acc-has-stack.stack-open:not(.is-picked) .acc-sum-box { display: none; }
  .acc-card.acc-has-stack.stack-open:not(.is-picked) .acc-open-bar { display: block; }
  .acc-card.acc-has-stack.stack-open:not(.is-picked) .acc-open-sub { display: block; margin-top: 4px; color: var(--text-2); font-size: 13px; font-weight: 600; }
  .acc-card.acc-has-stack.stack-open:not(.is-picked) .acc-done {
    position: absolute; right: 22px; top: 18px; display: inline-block; height: 30px; padding: 0 14px; border: 0; border-radius: 999px;
    background: var(--good); color: #11140a; font: 700 13px var(--font); cursor: pointer;
  }
}
@keyframes acc-band-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .acc-card.stack-open .acc-head { animation: none !important; } }
/* Private mode: the total in the opened list's sub-line blurs like every amount */
html[data-private="on"] .acc-open-fig { filter: blur(max(7px, 0.4em)); }

/* ---------- Log's pills on a phone (27 Oct 2026, the user: no pill is ever cut; the first two only) ----------
   fitLogged marks the pills that don't show with .gone; a later display rule on the paid-with and note pills had been beating the first
   .gone rule, so they stayed on screen, clipped by the amount column. */
.pcard .pcard-chips .chip.gone { display: none !important; }

/* ---------- The active pill is a solid lime fill, not an outline (27 Oct 2026, the user) ----------
   Section pills (Overview / Insights, Expenses / Income, Track's open section) and the tabs inside the sheets were lime glass with a lime rim;
   they now say "on" the way every other pill does: the lime fill with dark words and icon, no rim. */
.tabs button.glass[aria-selected="true"],
.sheet-tabs button[aria-selected="true"],
.scard.v2 .sheet-tabs button[aria-selected="true"],
.scard.ov .ov-tabs button[aria-selected="true"] {
  background: var(--select);
  border-color: var(--select);
  color: var(--select-ink);
  box-shadow: none;
}

/* The day and month pickers' selection is the solid lime fill too (27 Oct 2026, the user); a range's middle days keep their soft tint */
.pop-grid button[aria-selected="true"]:not(.mid) {
  background: var(--select);
  color: var(--select-ink);
  box-shadow: none;
}

/* ---------- Loading wireframes (27 Oct 2026, approved with the user: "Ledger Loading Wireframes" preview) ----------
   Until the app has drawn the real page (index.html puts these in; app.js takes them out after the first show()), the page keeps its shape:
   grey blocks the size of the real cards, no words — titles can be renamed in Admin, so a placeholder never guesses a name — with a soft light
   sweeping across (still under reduced motion). The backdrop is the one you chose: index.html applies its saved colours before the first paint. */
.bk { display: none; }
html[data-boot="home"] .bk[data-bk="home"],
html[data-boot="log"] .bk[data-bk="log"],
html[data-boot="plan"] .bk[data-bk="plan"],
html[data-boot="track"] .bk[data-bk="track"] { display: grid; }
.bk-page { gap: 14px; align-content: start; padding: 0; min-width: 0; }
.bk-hp { display: none; }
html[data-boot="home"] .bk-hp[data-bk="home"],
html[data-boot="plan"] .bk-hp[data-bk="plan"],
html[data-boot="track"] .bk-hp[data-bk="track"] { display: flex; align-items: center; gap: 8px; }
.bk-page .bk-row { display: flex; align-items: center; gap: 8px; }
.bk-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bk-g { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-radius: 22px; overflow: hidden; min-width: 0; }
.bk-entry { padding: 14px 18px; gap: 10px; }
.bk-bar { height: 42px; flex-direction: row; align-items: center; justify-content: space-between; padding: 0 20px; border-radius: 999px; }
.bk-sk, .bk-pill, .bk-day, .bk-rnd, .bk-circ, .bk-ring, .bk-sq, .bk-card, .bk-h { position: relative; display: block; overflow: hidden; flex: none; }
.bk-sk { width: var(--w, 100%); height: var(--h, 12px); border-radius: var(--r, 999px); background: rgba(255, 255, 255, 0.075); }
.bk-pill { height: 34px; border-radius: 999px; background: rgba(255, 255, 255, 0.075); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); }
.bk-pill.on { background: var(--select); box-shadow: none; }
.bk-day { width: 48px; height: 66px; border-radius: 16px; background: rgba(255, 255, 255, 0.075); }
.bk-day.on { background: var(--select); }
.bk-rnd { width: 40px; height: 40px; border-radius: 50%; }
.bk-circ { width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); }
.bk-ring { width: 38px; height: 38px; border-radius: 50%; border: 5px solid rgba(255, 255, 255, 0.08); }
.bk-sq { width: 36px; height: 36px; border-radius: 14px; background: rgba(255, 255, 255, 0.1); }
.bk-h { width: 96px; height: 11px; margin: 6px 0 -2px 2px; border-radius: 999px; background: color-mix(in srgb, var(--select) 34%, transparent); }
.bk-tglass { height: max(400px, calc(100dvh - 212px)); padding: 18px 22px 22px; gap: 10px; }
.bk-stack { display: grid; margin-top: auto; flex: none; }
.bk-card { height: 0; padding-bottom: 63.05%; border-radius: 5.5% / 8.7%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 -6px 14px rgba(0, 0, 0, 0.4); }
.bk-sk::after, .bk-pill::after, .bk-day::after, .bk-rnd::after, .bk-circ::after, .bk-ring::after, .bk-sq::after, .bk-card::after, .bk-h::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.15) 50%, transparent 80%); animation: bk-sweep 1.6s ease-in-out infinite;
}
.bk-pill.on::after, .bk-day.on::after { background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.35) 50%, transparent 80%); }
@keyframes bk-sweep { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .bk-sk::after, .bk-pill::after, .bk-day::after, .bk-rnd::after, .bk-circ::after, .bk-ring::after, .bk-sq::after, .bk-card::after, .bk-h::after { animation: none; } }
/* a wide screen has its own layouts: no wireframes there, the page just appears */
@media (min-width: 701px) { .bk, html[data-boot] .bk[data-bk], html[data-boot] .bk-hp[data-bk] { display: none !important; } }

/* A card picked travels from its strip (playPick in tracker-view.js, 27 Oct 2026); the small fade it had before is no longer needed */
.acc-pop.acc-pop-new { animation: none; }

/* ---------- A picked card, Credit Cards and Accounts (27 Oct 2026, the user's design: "Picked Card Layout" preview) ----------
   The card's edit icon (it replaced the due date and the colour rings) opens the Card Style pop-up. On a phone the list under the figures — the
   charges, the saving plans — swipes side to side with a search, a filter row that opens in line and an expand button that opens the whole list
   over the glass card; the figures of a credit card are three on one line. A wide screen keeps its layout (the pencil and the pop-up apply there too). */
.pk-t1 { display: none; }
.acc-card:not(.cc-card) .pk-t2 { display: none; }
.acc-card:not(.cc-card) .pk-t1 { display: inline; }
.cc-pk-name { display: none; }
.pk-xp { box-shadow: inset 0 0 0 1px rgba(198, 244, 50, 0.5); }
.pk-xp .xp-in, .pk-xp[aria-pressed="true"] .xp-out { display: none; }
.pk-xp[aria-pressed="true"] .xp-in { display: inline; }
.acc-edit { flex: none; width: 26px; height: 26px; margin-left: auto; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.28); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28); color: #fff; cursor: pointer; }
.acc-edit .icon { position: static; inset: auto; width: 13px; height: 13px; }
.acc-edit:hover { background: var(--select); color: var(--select-ink); }
.acc-pop .acc-top { align-items: center; }
@media (min-width: 701px) { .pk-xp { display: none !important; } .cc-dots { display: none; } }

/* the Card Style pop-up */
#style-sheet { width: min(330px, calc(100vw - 32px)); border-radius: var(--r-lg); }
#style-sheet .sheet-body { display: grid; gap: 14px; justify-items: center; }
.style-live { width: 278px; max-width: 100%; }
.style-live .acc-bank { position: relative; inset: auto; width: 100%; margin: 0; animation: none; cursor: default; }
.style-tones { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px 8px; width: 100%; }
.style-tone { display: grid; gap: 5px; justify-items: center; padding: 0; border: 0; background: none; color: var(--text-3); font: 600 9.5px var(--font); cursor: pointer; }
.style-sw { position: relative; display: block; width: 100%; aspect-ratio: 1.586; border-radius: 5.5% / 8.7%; overflow: hidden; background: var(--c1); color: var(--em); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.style-tone[aria-pressed="true"] { color: var(--text); }
.style-tone[aria-pressed="true"] .style-sw { box-shadow: 0 0 0 2px #fff; }
.style-name { text-align: center; line-height: 1.15; }

@media (max-width: 700px) {
  .cc-card .pk-t1 { display: inline; }
  .cc-card .pk-t2 { display: none; }
  .cc-card.is-picked .cc-pk-name { display: block; }
  /* the credit card's figures: three on one line, spread across the width, no tiles */
  .cc-card.is-picked .cc-figs.p3 { display: flex; justify-content: space-between; gap: 16px; }
  .cc-card.is-picked .cc-figs.p3 .cc-fig, .cc-card.is-picked .cc-figs.p3 .cc-fig:last-child { display: grid; grid-template-columns: none; grid-column: auto; gap: 3px; padding: 0; border-radius: 0; background: none; box-shadow: none; }
  .cc-card.is-picked .cc-figs.p3 .cc-fl { grid-column: auto; font-size: 9px; letter-spacing: 0.1em; }
  .cc-card.is-picked .cc-figs.p3 .cc-fv { font-size: 20px; }
  .cc-card.is-picked .cc-figs.p3 .cc-fv i { font-size: 9px; }
  .cc-card.is-picked .cc-figs.p3 .cc-fn { display: none; }
  .cc-card.is-picked .cc-figs.p3 .cc-lx { display: none; } /* the labels shorten to Owed and Planned so three figures share one line */
  /* the charges swipe, one to a page, with dots (or the count when there are many) */
  .cc-card.is-picked .acc-detail { flex: none; margin: 0; padding: 0; overflow: visible; }
  .cc-card.is-picked .cc-tiles { flex-direction: row; gap: 0; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .cc-card.is-picked .cc-tiles::-webkit-scrollbar { display: none; }
  .cc-card.is-picked .cc-tile { flex: 0 0 100%; scroll-snap-align: start; min-width: 0; }
  .cc-card.is-picked .cc-tiles > .quiet { flex: 0 0 100%; }
  .cc-dots { display: flex; justify-content: center; gap: 6px; min-height: 8px; margin-top: 10px; }
  .cc-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.25); }
  .cc-dots i.on { background: var(--select); }
  .cc-count { color: var(--text-3); font-size: 12px; font-weight: 600; }
  /* the filter row: the Min / Max pair is as wide as the credit card's Show cluster (label + both pills) and as tall as the Category pill */
  .cc-ddb { height: 26px; padding: 0 8px 0 12px; }
  .pk-pair { flex: none; width: 172px; min-height: 0; height: 26px; border-radius: 999px; background: var(--recessed); }
  .pk-pair label { gap: 3px; padding: 0 5px; }
  .pk-pair span { font-size: 8px; letter-spacing: 0.06em; }
  .pk-pair input { font-size: 13px; font-variant-numeric: tabular-nums; }
  .acc-pl-lh { margin-bottom: 0; }
  /* the picked card sits flush: the rings under it are gone */
  .cc-card.acc-has-stack.is-picked .acc-stack-wrap { padding-bottom: calc(63.05% + 22px); }

  /* opened: the list fills the glass card under a blurred band with the name, search, filters and the collapse button */
  .acc-card.pk-open { overflow: hidden; }
  .acc-card.pk-open .acc-head, .acc-card.pk-open .acc-left, .acc-card.pk-open .acc-plus-corner { display: none; }
  .acc-card.pk-open .acc-panel { position: absolute; inset: 0; grid-column: auto; grid-row: auto; z-index: 2; display: block; margin: 0; padding: 0; gap: 0; align-self: auto; }
  .acc-card.pk-open .cc-lh { position: absolute; z-index: 5; left: 0; right: 0; top: 0; height: 72px; min-height: 0; padding: 0 22px; background: linear-gradient(to bottom, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.045)); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 1px 0 rgba(255, 255, 255, 0.1); }
  .acc-card.pk-open .pk-t1 { display: none; }
  .acc-card.pk-open .pk-t2 { display: inline; }
  .acc-card.pk-open .cc-lh .acc-panel-title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
  .acc-card.pk-open .cc-fpane:not([hidden]) { position: absolute; z-index: 4; top: 72px; left: 0; right: 0; height: 46px; padding: 0 22px; display: flex; align-items: center; background: linear-gradient(to bottom, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.045)); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 1px 0 rgba(255, 255, 255, 0.1); }
  .acc-card.pk-open .cc-fpane .cc-frow { width: 100%; flex-wrap: nowrap; }
  .acc-card.pk-open .acc-detail { position: absolute; inset: 0; margin: 0; padding: 84px 22px 18px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
  .acc-card.pk-open.pk-fopen .acc-detail { padding-top: 130px; }
  .acc-card.pk-open .cc-tiles { flex-direction: column; gap: 10px; overflow: visible; scroll-snap-type: none; }
  .acc-card.pk-open .cc-tile { flex: none; }
  .acc-card.pk-open .cc-dots, .acc-card.pk-open .acc-dots { display: none; }
  .acc-card.pk-open .acc-paged, .acc-card.pk-open .acc-lines { display: flex; flex-direction: column; gap: 10px; overflow: visible; }
  .acc-card.pk-open .acc-page { flex: none; width: auto; }
  .acc-card.pk-open .acc-detail { display: block; }
  .acc-card.pk-open .acc-arch { margin-top: 14px; }
}

/* ---------- A wide screen's stack: docked at the glass card's bottom like a phone's (27 Oct 2026, the user), and every charge in the empty area ----------
   The cards keep the same step as on a phone (18.5% of the stack's width, never under 15.5%) and rest on the glass card's bottom edge, the last
   one whole while the cards fit (fitAccountStack sets --acc-step and --acc-room); they no longer fan out to fill the height. With no credit card
   picked the third column lists every charge of every card, with the search and filters; a phone has no list there. */
@media (min-width: 701px) {
  .acc-card.acc-has-stack .acc-left.acc-has-stack { justify-content: flex-end; }
  .acc-card.acc-has-stack .acc-stack-wrap { flex: none; height: 0; padding-bottom: var(--acc-room, calc((var(--acc-n, 5) - 1) * var(--acc-step, 18.5%) + 31.8%)); }
  .acc-card.acc-has-stack .acc-stack-wrap::before { display: none; }
  .acc-card.acc-has-stack .acc-stack { inset: 0 0 auto 0; display: grid; justify-content: normal; }
  .acc-card.acc-has-stack .acc-stack > .acc-scard:last-child,
  .acc-card.acc-has-stack .acc-stack:has(> .acc-scard:last-child[aria-pressed="true"]) > .acc-scard:nth-last-child(2) { margin-bottom: 0; }
  .cc-cardchip { color: var(--em); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--em) 55%, transparent); }
}
@media (max-width: 700px) { .cc-card:not(.is-picked):not(.pk-open) .cc-panel { display: none; } }

/* ---------- The charges by statement cycle (27 Oct 2026, the user: "by statement"; show the cycle's dates and back / forward buttons) ----------
   A wide screen shows the navigator always; a phone only in the opened list (the swipe shows the open statement). With no card picked each card sits
   under its own cycle's dates; a phone reaches that list with the View All Charges button. */
.cc-nav { display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px; gap: 8px; align-items: center; }
.cc-nb { width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--recessed); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text); cursor: pointer; }
.cc-nb:hover:not(:disabled) { background: var(--select); color: var(--select-ink); }
.cc-nb:disabled { opacity: 0.3; cursor: default; }
.cc-nb .icon { width: 18px; height: 18px; }
.cc-range { min-height: 42px; display: grid; align-content: center; justify-items: center; padding: 3px 10px; border-radius: 16px; background: var(--recessed); box-shadow: inset 0 0 0 1px var(--line-strong); text-align: center; }
.cc-range b { font-size: 15px; font-weight: 750; letter-spacing: -0.01em; white-space: nowrap; }
.cc-range em { color: var(--text-3); font-size: 11.5px; font-style: normal; white-space: nowrap; }
.cc-range em.cur { color: var(--select); }
.cc-grp { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 6px 2px 0; color: var(--text-3); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.cc-grp b { color: var(--text-2); font-weight: 700; }
.cc-grp[style] b { color: var(--em); }
.cc-grp i { color: var(--text-3); font-size: 12px; font-style: normal; font-weight: 600; letter-spacing: 0; text-transform: none; }
html[data-private="on"] .cc-grp .sensitive { filter: blur(max(7px, 0.4em)); }
@media (max-width: 700px) {
  .cc-card.acc-has-stack.pk-open:not(.is-picked) .cc-phone-head { display: none; }
  .cc-nav { display: none; }
  .cc-card:not(.pk-open) .cc-grp { display: none; }
  .cc-card.pk-open .cc-nav { display: grid; position: absolute; z-index: 5; top: 80px; left: 22px; right: 22px; }
  .cc-card.pk-open .cc-fpane:not([hidden]) { top: 134px; }
  .cc-card.pk-open .acc-detail { padding-top: 140px; }
  .cc-card.pk-open.pk-fopen .acc-detail { padding-top: 186px; }
}

/* 27 Oct 2026 — a picked credit card's expanded list: no separate band; the title sits on the card's own glass (the approved picked card's title), the statement navigator under it, the list scrolling in its own area below */
@media (max-width: 700px) {
  .cc-card.pk-open .cc-lh { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; height: 66px; }
  .cc-card.pk-open .cc-nav { top: 66px; }
  .cc-card.pk-open .cc-fpane:not([hidden]) { top: 116px; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
  .cc-card.is-picked.pk-open .cc-grp { display: none; }
  .cc-card.pk-open .acc-detail { inset: 122px 0 0 0; padding: 0 22px 18px; }
  .cc-card.pk-open.pk-fopen .acc-detail { inset: 168px 0 0 0; padding-top: 0; }
}

/* 27 Oct 2026 — with no credit card picked there is no statement navigator (each card shows its own dates in its heading) */
.cc-card:not(.is-picked) .cc-nav { display: none !important; }

/* 27 Oct 2026 — Credit Cards' three columns on a wide screen use Accounts' grid, so the charges list is as wide as the saving plans (682 px at 1,500 px, was 612) */
@media (min-width: 701px) {
  .cc-card.acc-has-stack { grid-template-columns: minmax(0, 1.55fr) clamp(160px, 10.5vw, 210px) minmax(0, 2.4fr); }
}

/* 27 Oct 2026 — on a wide screen Credit Cards' statement / month picker is the page header's (next to the eye), so the card's own navigator row is not drawn */
/* the card's own navigator row is never drawn (27 Oct 2026, the user: the picker lives next to the eye, phone included); the opened list starts right under the title row */
.cc-card .cc-nav { display: none !important; }
@media (max-width: 700px) {
  .cc-card.pk-open .cc-fpane:not([hidden]) { top: 70px; }
  .cc-card.pk-open .acc-detail { inset: 78px 0 0 0; }
  .cc-card.pk-open.pk-fopen .acc-detail { inset: 124px 0 0 0; }
}
.picker-btn.is-static { cursor: default; }
.picker-btn.is-static .chev { display: none; }

/* 27 Oct 2026 — on a wide screen the charges search opens to a sensible width (300 px) beside the title instead of covering the whole row; narrower, it still takes the row */
@media (min-width: 1300px) {
  .cc-lh.searching .acc-panel-title { display: block; }
  .cc-lh.searching .log-tools { flex: 0 0 auto; margin-left: auto; }
  .cc-lh.searching .log-sx { flex: 0 0 auto; width: 300px; }
  .cc-lh.searching .log-sin { flex: 1 1 auto; width: auto; }
}

/* 27 Oct 2026 — Accounts' Saving Plans header on a wide screen: search, filter and a round + (new saving plan) replace the corner "New Saving Plan" pill; a phone keeps its own + */
@media (min-width: 701px) {
  .acc-card:not(.cc-card) .acc-plus-corner { display: none; }
  .acc-panel:has(> .acc-pl-pane:not([hidden])) { grid-template-rows: auto auto minmax(0, 1fr); }
}

/* 27 Oct 2026 — a phone's picked card: search and filter (and, on an account, the +) sit at the card's top right, where the piggy-bank button was; the expand button stays in its row */
@media (max-width: 700px) {
  .acc-card.is-picked:not(.pk-open) .cc-lh .log-tools { position: absolute; z-index: 6; top: var(--tools-top, 22px); right: 22px; }
  .acc-card.is-picked:not(.pk-open):not(.cc-card) .acc-plus-corner { display: none; }
  .acc-card.is-picked:not(.pk-open) .cc-lh.searching .log-tools { left: 22px; }
  .acc-card.pk-open .pl-add { display: none; }
  .cc-card.is-picked:not(.pk-open) .cc-lh .log-tools { top: 14px; }
}

/* 27 Oct 2026 — a phone with no account picked has no corner button at all (the user: remove the plus when no account is selected) */
@media (max-width: 700px) {
  .acc-card:not(.cc-card):not(.is-picked) .acc-plus-corner { display: none; }
}

/* 27 Oct 2026 — on a phone the account / credit card tools (search, filter, +, expand) match the page header's round buttons: 36 px with 18 px icons (the user: they are too big) */
@media (max-width: 700px) {
  .acc-card .round-btn.log-ib { width: 36px; height: 36px; }
  .acc-card .round-btn.log-ib .icon { width: 18px; height: 18px; }
  .acc-card .log-sx { width: 36px; height: 36px; border-radius: 18px; }
  .cc-card.is-picked:not(.pk-open) .cc-lh .log-tools { top: 16px; }
}

/* 27 Oct 2026 — the phone's standard icon button: 36 px with an 18 px icon, everywhere (the page header's eye / gear, Logs' search / filter, a saving plan item's buttons, sheets' close, the account / credit card tools). Left as they are: the dock's + (52 px) and the plan's small *+* beside a category pill (it matches the pill row) */
@media (max-width: 699px) {
  .round-btn:not(.dock-add):not(.cat-pill-add) { width: 36px; height: 36px; }
  .round-btn:not(.dock-add):not(.cat-pill-add) .icon { width: 18px; height: 18px; }
  .top-actions .round-btn, .round-btn.log-ib, .round-btn.table-rules, .acc-line-btns .acc-topup { width: 36px; height: 36px; }
  .top-actions .picker-btn { height: 36px; }
  .log-sx { width: 36px; height: 36px; border-radius: 18px; }
}

/* 27 Oct 2026 — the search button on the account / credit card lists: no solid grey disc and no drop shadow (it showed as a grey circle with a dark crescent); it is the same dark glass as the filter beside it, lime when open. On a phone the card's name is hidden while the search is open (the field sits over it), and the expand button stays at the right */
.acc-card .log-sx { box-shadow: none; }
.acc-card .log-sx .log-ib[aria-pressed="false"] { background: transparent; }
@media (max-width: 700px) {
  .acc-card.is-picked:not(.pk-open):has(.cc-lh.searching) .acc-head .acc-panel-title,
  .acc-card.is-picked:not(.pk-open):has(.cc-lh.searching) .cc-head .acc-panel-title { visibility: hidden; }
  .acc-card .cc-lh .pk-xp { margin-left: auto; }
}

/* A charge on a credit card is counted in the month its statement is due, not the month it sits in (27 Oct 2026):
   its amount is grey (even on a paid card) with a clock before it — Plan cards, Plan table, Logged list */
:root { --later: #9da393; }
.pcard .pcard-amount.cc-late,
.pcard.paid .pcard-amount.cc-late { display: inline-flex; align-items: baseline; gap: 7px; color: var(--later); }
.pcard-amount.cc-late .cur { color: var(--later); }
.cc-mark { width: 22px; height: 22px; flex: none; color: var(--later); stroke: var(--later); }
.pcard-amount .cc-mark { align-self: center; position: relative; top: 1px; }
.cell.cc-late .cell-in,
.cell.cc-late.paid .cell-in,
.cell.cc-late.paid .cur,
.cell.cc-late .cur { color: var(--later) !important; }
.cell .cc-wrap { display: flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; width: 100%; }
.cell .cc-wrap .cell-in { width: 5.2ch !important; min-width: 0 !important; flex: none; text-align: center !important; padding: 0 !important; }
.cell .cc-wrap .cur { position: static; margin: 0; }

/* A foreign line's symbol before its figure in the table, rules hidden (30 Nov 2026): $ 22.8 — the figure's own font and colour
   (placeCoins copies them); right-aligned cells place it from the figure's measured width (--sym-right). The gear shows the USD label instead. */
.cur-sym { display: none; }
@media (min-width: 700px) {
  .edit-grid:not(.show-rules) td.cell.money .cur-sym { display: inline; position: absolute; top: 50%; right: var(--sym-right, 100px); transform: translateY(-50%); pointer-events: none; font-variant-numeric: tabular-nums; line-height: 1; }
  .edit-grid:not(.show-rules) td.cell.money .cc-wrap .cur-sym { position: static; transform: none; margin-right: -5px; }
  .edit-grid:not(.show-rules) td.cell.money:has(.cell-in:placeholder-shown) .cur-sym { display: none; }
}

/* ---------- Settings, like Apple's (27 Oct 2026): a list of sections and the section beside it; on a phone, a list page, then the section ---------- */
.set-new { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 0 32px; align-items: start; max-width: 1280px; margin: 0 auto; padding: 22px 28px 40px; }
.set-side { position: sticky; top: 22px; }
.set-side-head { display: flex; align-items: center; justify-content: space-between; margin: 0 8px 14px; }
.set-side-close { display: none; }
.set-side-title { margin: 0; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--select); font-weight: 650; }
.set-items { display: flex; flex-direction: column; gap: 4px; }
.set-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 0; border-radius: 12px; background: none; color: inherit; font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.set-item .item-ic { width: 30px; height: 30px; flex: none; }
.set-item .set-chev { display: none; }
.set-item[aria-selected="true"] { background: var(--select); color: var(--select-ink); font-weight: 600; }
.set-item[aria-selected="true"] .item-ic { background: var(--select-ink); color: var(--select); }
.set-main { min-width: 0; }
.set-top { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 940px; margin: 0 0 26px; }
.set-top h2 { flex: 1; margin: 0 0 0 6px; font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -0.01em; }
.set-top .round-btn[disabled] { opacity: 0.4; }
.set-pane { display: block; width: 100%; max-width: 940px; margin: 0; }
.set-pane[hidden] { display: none; }
.set-sec { margin: 0 0 28px; }
.set-h { margin: 4px 4px 14px; font-size: 19px; line-height: 1.2; font-weight: 700; color: var(--text); }
.set-group { border-radius: 22px; overflow: hidden; padding: 0 4px; }
.set-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 14px; position: relative; font: inherit; font-size: 17px; color: var(--text); background: none; border: 0; text-align: left; box-sizing: border-box; }
a.set-row { text-decoration: none; }
button.set-row, label.set-row, a.set-row { cursor: pointer; }
.set-row[hidden] { display: none; }
.set-row + .set-row::before { content: ""; position: absolute; left: 14px; right: 0; top: 0; height: 1px; background: rgba(255, 255, 255, 0.12); }
.set-row:disabled .set-l { color: var(--text-3); }
.set-l { flex: 1; min-width: 0; }
.set-r { color: var(--text-3); }
.set-in { width: 7em; text-align: right; background: transparent; border: 0; outline: 0; color: var(--text-2); font: inherit; padding: 0; }
.set-sel { background: transparent; border: 0; outline: 0; color: var(--text-2); font: inherit; font-size: 16px; text-align: right; max-width: 55%; }
.set-chev { width: 16px; height: 16px; color: var(--text-3); flex: none; }
.set-act { background: none; border: 0; padding: 0; color: var(--text-3); display: inline-flex; }
.set-small { min-height: 0; padding: 6px 14px; }
.set-wide { display: flex; width: 100%; justify-content: center; margin-top: 12px; box-sizing: border-box; }
.set-hero .bl-orbs { margin-top: 18px; }
@media (max-width: 699px) {
  .set-new { grid-template-columns: minmax(0, 1fr); padding: 14px 16px 36px; }
  .set-side { position: static; }
  .set-side-head { margin: 8px 4px 12px; }
  .set-side-title { font-size: 34px; line-height: 1.1; letter-spacing: -0.01em; text-transform: none; color: var(--text); font-weight: 700; }
  .set-side-close { display: inline-flex; }
  .set-item { padding: 0 14px; min-height: 52px; border-radius: 0; font-size: 17px; }
  .set-items { border-radius: 22px; padding: 0 4px; background: color-mix(in srgb, var(--glass-solid) 62%, transparent); -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%); border: 1px solid var(--glass-rim-soft); gap: 0; overflow: hidden; }
  .set-item + .set-item { box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.12) inset; }
  .set-item .set-name { flex: 1; }
  .set-item .set-chev { display: block; }
  .set-item[aria-selected="true"] { background: none; color: inherit; font-weight: 400; }
  .set-new[data-view="list"] .set-main { display: none; }
  .set-new[data-view="pane"] .set-side { display: none; }
  .set-top { margin-bottom: 18px; }
  .set-top .set-top-fwd, #set-fwd { display: none; }
  .set-top .round-btn[data-close] { display: none; }
}
@media (max-width: 699px) {
  /* the window's four small cards on a phone: the name and the figure on one line without touching */
  .set-hero .bl-gs .bl-row { gap: 6px; }
  .set-hero .bl-gs .bl-nm { font-size: 11px; min-width: 0; }
  .set-hero .bl-gs .bl-am { font-size: 11px; flex: none; }
}

/* Settings › General: the rates as tiles, one bar for Update daily and Refresh, Plan Span as two tiles (the user's pick, 27 Oct 2026) */
/* the line between the list and the section: pressed into the glass (a dark edge with a light edge beside it) */
@media (min-width: 700px) {
  .set-new { box-sizing: border-box; min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .set-main { position: relative; align-self: stretch; }
  .set-main::before { content: ""; position: absolute; left: -17px; top: -22px; bottom: -40px; width: 1px; background: rgba(0, 0, 0, 0.62); box-shadow: 1px 0 0 rgba(255, 255, 255, 0.17); pointer-events: none; }
}

/* Settings is no dark panel: it wears the app's own backdrop (the ground and the three lights of whichever look is picked), so the glass on it
   is lit like the glass on every page (27 Oct 2026, the user: *why are the glass cards black?*) */
#settings.glass,
#settings.glass.strong {
  background:
    radial-gradient(70% 55% at 10% -6%, var(--blob-1), transparent 72%),
    radial-gradient(42% 42% at 60% 36%, color-mix(in srgb, var(--blob-2) 65%, transparent), transparent 74%),
    radial-gradient(60% 60% at 100% 48%, var(--blob-2), transparent 72%),
    radial-gradient(55% 50% at 30% 108%, var(--blob-3), transparent 72%),
    var(--bg);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Settings' groups are frosted (22 Nov 2026, the user: *more frosted glass*, option B): a 28 px frost with a light sheen, so each
   group stands off the backdrop, on every width */
#settings .set-group.glass {
  background: linear-gradient(160deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .04) 45%, rgba(255, 255, 255, .07)) !important;
  -webkit-backdrop-filter: blur(28px) saturate(160%) !important;
  backdrop-filter: blur(28px) saturate(160%) !important;
}

/* Settings is a window in the middle of the screen on a wide screen (27 Oct 2026): a fixed size, the page behind it blurred; a phone keeps it full screen */
@media (min-width: 700px) {
  #settings {
    inset: 0;
    margin: auto;
    width: min(980px, calc(100vw - 48px));
    height: min(680px, calc(100dvh - 48px));
    max-height: none;
    border-radius: 28px;
    overflow: hidden;
  }
  #settings .sheet-inner { height: 100%; max-height: 100%; padding-top: 0; padding-bottom: 0; border-radius: 28px; }
  /* the page behind darkened, so its colours (the Log's lime) don't glow round the window (22 Nov 2026, the user) */
  #settings::backdrop {
    background: rgba(6, 8, 4, 0.78);
    -webkit-backdrop-filter: blur(30px);
    backdrop-filter: blur(30px);
  }
  /* the picked page in the menu wears the Log's picked-day glass, not a lime fill (22 Nov 2026, the user) */
  #settings .set-item[aria-selected="true"] {
    position: relative;
    background: linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, 0) 68%, rgba(255, 255, 255, .05)) !important;
    -webkit-backdrop-filter: saturate(120%);
    backdrop-filter: saturate(120%);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14) !important;
    border-color: transparent !important;
    color: var(--text) !important;
  }
  #settings .set-item[aria-selected="true"]::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .12) 38%, rgba(255, 255, 255, .05) 62%, rgba(255, 255, 255, .55));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
  }
  #settings .set-item[aria-selected="true"] .item-ic, #settings .set-item[aria-selected="true"] .item-ic * { color: var(--text) !important; background-color: rgba(255, 255, 255, .08) !important; }
  .set-new { min-height: 100%; }
}
.set-small { min-height: 0; padding: 7px 14px; font-size: 12px; }
.span-plus .icon { width: 20px; height: 20px; }
.span-plus:hover { background: var(--select); border-color: var(--select); color: var(--select-ink); }
}

/* Settings › General: one setting a line, like Cards and Privacy (27 Oct 2026) */
.set-in[data-rate] { width: 4ch; flex: none; }
.set-row .rt-s { font-size: 13px; letter-spacing: 0.08em; color: var(--text-3); }
.set-meta { font-size: 14px; color: var(--text-3); }
.set-small { min-height: 0; padding: 7px 14px; font-size: 12px; }
.span-plus { flex: none; width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.06); color: var(--text); cursor: pointer; }
.span-plus .icon { width: 16px; height: 16px; }
.span-plus:hover { background: var(--select); border-color: var(--select); color: var(--select-ink); }
.rate-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 6px 0; }
.rate-meta .set-meta { flex: 1; min-width: 0; }

/* Settings › Appearance: the six looks as lines in the glass — an orb, the name, a check on the one in use (27 Oct 2026, the user's pick: option A) */
.lk-line { cursor: pointer; }
.lk-orb { display: inline-flex; width: 30px; height: 30px; flex: none; }
.lk-orb .bl-o { width: 30px; height: 30px; border-radius: 50%; position: relative; overflow: hidden; display: block; }
.lk-orb .bl-o u { position: absolute; border-radius: 50%; filter: blur(8px); }
.lk-check { display: inline-flex; visibility: hidden; width: 20px; margin-left: auto; color: var(--select); }
.lk-check .icon { width: 20px; height: 20px; }
.lk-line[aria-pressed="true"] .lk-check { visibility: visible; }
.set-in.tm-fig { width: 4ch; flex: none; }
.set-in.tm-name { width: 10em; }
html[data-private="on"] .set-in.tm-egp:not(:focus) { filter: blur(max(7px, 0.4em)); }

/* Settings: an action is a line in the accent colour (red when it destroys), on its own, with grey text under it for information (27 Oct 2026) */
button.set-row, label.set-row, a.set-row { cursor: pointer; }
.set-row.act .set-l { color: var(--select); font-weight: 500; }
.set-row.bad .set-l { color: var(--bad-text); }
.set-row.act:hover { background: rgba(255, 255, 255, 0.06); }
.set-group + .set-group { margin-top: 12px; }
.set-note { margin: 12px 18px 0; font-size: 13px; line-height: 1.4; color: var(--text-3); }
.set-note + .set-group { margin-top: 20px; }

/* Settings on a phone (27 Oct 2026): the list sits lower, a line between every pair, every icon in its tile, the close cross centred, and a section's lines as wide as the list */
@media (max-width: 699px) {
  .set-side-close { display: inline-grid; place-items: center; }
  .set-side-head { margin: 36px 4px 26px; }
  .set-item { position: relative; box-shadow: none; }
  .set-item + .set-item { box-shadow: none; }
  .set-item + .set-item::before { content: ""; position: absolute; left: 14px; right: 0; top: 0; height: 1px; background: rgba(255, 255, 255, 0.12); }
  .set-new .sheet-body { padding: 0 0 24px; }
  .set-item[aria-selected="true"] .item-ic { background: rgba(255, 255, 255, 0.1); color: inherit; }
}
@media (max-width: 699px) {
  /* a section's bar (back circle and name) starts where the list's title does, and its first group where the list starts */
  .set-top { margin: 36px 0 26px; }
}

/* Home › Insights › Is Over Plan (2 Nov 2026): its note is two amounts, so it blurs with them (the amounts rule — every amount blurs) */
html[data-private="on"] .ins-money-note .pcard-vs { filter: blur(max(7px, 0.4em)); user-select: none; }

/* Installments as saving plan cards (Nov 2026, the user): the saving plan's markup and look, each card one item of the card's charges list (a phone swipes through them with the charges) */
.cc-tiles > .acc-line { min-width: 0; max-width: 100%; }
.cc-tiles > .acc-line .acc-tx[hidden] { display: none; }
@media (max-width: 700px) {
  /* the name keeps a real size and its pill sits under it, the way the saving plan's does wider (the user: "fix the name and the pill") */
  .cc-tiles > .acc-line .acc-line-top { align-items: center; }
  .cc-tiles > .acc-line .acc-line-id { display: grid; justify-items: start; align-content: center; gap: 2px; } /* name and pill together are as tall as the 36 px buttons beside them */
  .cc-tiles > .acc-line .acc-line-name { font-size: clamp(14px, 4.3vw, 16px); line-height: 1.05; }
  .cc-tiles > .acc-line .acc-line-chips { display: none; } /* a phone shows no category pill on an installment (the user); the name stands level with the buttons */
  .cc-card.is-picked .cc-tiles > .acc-line { flex: 0 0 100%; scroll-snap-align: start; }
}
/* The installment pop-up (Nov 2026, the user): every box the same width, its unit inside it at the right, every label on one line, everything left-aligned */
#inst-sheet .rule-field > span:first-child { font-size: 12px; white-space: nowrap; }
#inst-sheet .rule-field .ctl { flex: none; width: 144px; }
#inst-sheet .is-unit { position: relative; display: block; flex: none; width: 144px; }
#inst-sheet .is-unit .ctl { width: 100%; padding-right: 48px; }
#inst-sheet .is-unit em { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); color: var(--text-3); font-size: 11px; font-style: normal; font-weight: 700; pointer-events: none; white-space: nowrap; }
#inst-sheet .rule-field .ctl, #inst-sheet .rule-field .ctl.num { text-align: left; }

.cc-tiles > .acc-line .acc-tx-row[hidden] { display: none; }
.acc-tx-more { padding: 6px 0 2px 12px; color: var(--text-3); font-size: 13px; font-weight: 600; }

/* The list's two group headers wear the Logs day header (Nov 2026, the user): lime word, count, the figures at the right, a hairline under; a phone's swipe row hides them like the old ones */
.cc-tiles > .cc-day { margin: 14px 4px 0; }
@media (max-width: 700px) {
  .cc-card:not(.pk-open) .cc-day, .cc-card.is-picked.pk-open .cc-day { display: none; }
}

/* The installment pop-up is a sheet like the entry's: the same width and 30 px corners (Nov 2026, the user: "sharp edges") */
#inst-sheet { width: min(460px, calc(100vw - 32px)); border-radius: var(--r-lg); }
#inst-sheet .sheet-body { display: grid; gap: 10px; }
#inst-sheet .cap-foot { gap: 8px; }
#inst-sheet .cap-foot .summary { min-width: 0; }

/* Accounts' expanded list wears no band behind its title, like Credit Cards' (Nov 2026, the user: "a dark background that shouldn't exist"):
   the title sits on the card's own glass, the filters under it, the list scrolling in its own area below */
@media (max-width: 700px) {
  /* …and the title keeps its size and the collapse button takes the + button's place, the row at the same height as when the card is closed */
  .acc-card:not(.cc-card).pk-open .cc-lh { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; height: 80px; }
  .acc-card:not(.cc-card).pk-open .cc-lh { gap: 10px; justify-content: flex-start; }
  .acc-card:not(.cc-card).pk-open .cc-lh .log-tools { margin-left: auto; }
  .acc-card:not(.cc-card).pk-open .cc-lh .pk-xp { margin-left: 0; }
  .acc-card:not(.cc-card).pk-open .cc-lh .acc-panel-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; position: relative; top: -2px; } /* exactly the closed card's title, in the same place */
  .acc-card:not(.cc-card).pk-open .cc-fpane:not([hidden]) { top: 80px; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
  .acc-card:not(.cc-card).pk-open .acc-detail { padding-top: 92px; }
  .acc-card:not(.cc-card).pk-open.pk-fopen .acc-detail { padding-top: 138px; }
}

/* Archived, under the saving plans on a phone: as far below the last plan as it is above the card stack (Nov 2026, the user) */
@media (max-width: 700px) {
  .acc-card.acc-has-stack.is-picked:not(.pk-open) .acc-arch { margin-top: 6px; }
}

/* The + sheet's Installments (Nov 2026, the user): the switch, then the same boxes as the installment pop-up — one width, left-aligned, labels on one line */
.inst-ask .xfer-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.inst-ask .xfer-line b { font-size: 12px; white-space: nowrap; }
.inst-ask .xfer-line .ctl { flex: none; width: 144px; text-align: left; }
.inst-ask .fee-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }

/* Private mode (blur every amount): an installment's figures blur like every other amount */
html[data-private="on"] .cc-tiles > .acc-line :is(.acc-line-amt, .acc-prog-nums b, .acc-prog-status, .acc-prog-foot b, .acc-tx-amt) { filter: blur(max(7px, 0.4em)); }

/* Expanded saving plans (Accounts, a phone): Archived sits 16 px under the last plan too; and a card's swipe row keeps every charge line at its own height,
   whatever the tallest installment card is (Nov 2026, the user) */
@media (max-width: 700px) {
  .acc-card.acc-has-stack.is-picked.pk-open .acc-arch { margin-top: 10px; }
  .cc-card.is-picked:not(.pk-open) .cc-tiles { align-items: flex-start; }
}

/* The expanded header is one header (Nov 2026, the user): Credit Cards' title and buttons stand exactly where Accounts' do — the same title size, the search and filter 10 px apart
   against the collapse button, the row at the same height — and the collapse button, solid lime, is drawn a little smaller so it reads the same size as the dark ones */
@media (max-width: 700px) {
  .cc-card.pk-open .cc-lh { height: 80px; gap: 10px; justify-content: flex-start; }
  .cc-card.pk-open .cc-lh .log-tools { margin-left: auto; }
  .cc-card.pk-open .cc-lh .pk-xp { margin-left: 0; }
  .cc-card.pk-open .cc-lh .acc-panel-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; position: relative; top: -2px; }
  .cc-card.pk-open .cc-nav { top: 80px; }
  .cc-card.pk-open .cc-fpane:not([hidden]) { top: 80px; }
  .cc-card.pk-open .acc-detail { inset: 92px 0 0 0; } /* the list starts where Accounts' does: the statement navigator that once sat here is hidden */
  .cc-card.pk-open.pk-fopen .acc-detail { inset: 138px 0 0 0; }
  .acc-card.pk-open .cc-lh .pk-xp { transform: scale(0.92); }
}

/* Two charge lines a page in a phone's swipe row (Nov 2026, the user: "fit two charge lines"); in a list a pair is transparent */
.cc-pair { display: contents; }
@media (max-width: 700px) {
  .cc-card.is-picked:not(.pk-open) .cc-pair { display: grid; flex: 0 0 100%; min-width: 0; gap: 10px; align-content: start; scroll-snap-align: start; }
  .cc-card.is-picked:not(.pk-open) .cc-pair > .cc-tile { flex: none; }
}

/* An opened installment fills the glass card, and the extra height goes under its rows: the top part stays as it is (the user) */
.cc-tiles > .acc-line { align-content: start; }

/* The picked account's card is placed as the picked credit card is (Nov 2026, the user): on its own, whole, at the glass card's foot with the same space under it
   — the other cards are out of the way */
@media (max-width: 700px) {
  .acc-card:not(.cc-card).acc-has-stack.is-picked:not(.pk-open) { grid-template-rows: auto minmax(0, 1fr) auto; }
  .acc-card:not(.cc-card).acc-has-stack.is-picked .acc-stack { display: none; }
  .acc-card:not(.cc-card).acc-has-stack.is-picked .acc-stack-wrap { flex: none; padding-bottom: calc(63.05% + 22px); }
  .acc-card:not(.cc-card).acc-has-stack.is-picked .acc-left.acc-has-stack { align-self: start; clip-path: none; }
}


/* ---------- Log: a conversation and a form (the user's design, Nov 2026; capture-ui.js) ----------
   Full screen on a phone, wearing the app's own backdrop like Settings; a window on a wide screen. The message box rides up
   with the keyboard (--kb is how much visualViewport has lost to it, iOS's bar included). Rows, groups, the
   switch and the round buttons are Settings' own; the dent is the embossed line Settings parts its list and section with. */
#capture.cap2,
#capture.cap2.glass,
#capture.cap2.glass.strong {
  background:
    radial-gradient(70% 55% at 10% -6%, var(--blob-1), transparent 72%),
    radial-gradient(42% 42% at 60% 36%, color-mix(in srgb, var(--blob-2) 65%, transparent), transparent 74%),
    radial-gradient(60% 60% at 100% 48%, var(--blob-2), transparent 72%),
    radial-gradient(55% 50% at 30% 108%, var(--blob-3), transparent 72%),
    var(--bg);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  overflow: hidden;
}
@media (max-width: 699px) {
  dialog#capture.cap2.sheet { position: fixed; inset: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; border-radius: 0; }
}
@media (min-width: 700px) {
  dialog#capture.cap2.sheet { position: fixed; inset: 0; margin: auto; width: min(440px, calc(100vw - 48px)); max-width: none; height: min(760px, calc(100dvh - 48px)); max-height: none; border-radius: 28px; }
  #capture.cap2::backdrop { background: rgba(6, 8, 4, 0.42); -webkit-backdrop-filter: blur(22px) saturate(140%); backdrop-filter: blur(22px) saturate(140%); }
}
#capture .cap2-inner { position: relative; height: 100%; max-height: none; overflow: hidden; display: flex; flex-direction: column; border-radius: inherit; }
.cap2-top { flex: none; display: flex; align-items: center; gap: 12px; padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 10px; }
.cap2-top h2 { flex: 1; margin: 0; text-align: center; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.cap2-top .round-btn { flex: none; width: 36px; height: 36px; }
.cap2-top .round-btn .icon { width: 18px; height: 18px; }
.cap2-ok { background: var(--select); color: var(--select-ink); }
.cap2-ok:disabled { opacity: 0.4; cursor: default; }
.cap2-mid { position: relative; flex: 1; min-height: 0; }
.cap2-scroll { position: absolute; inset: 0; overflow: auto; padding: 4px 16px 24px; box-sizing: border-box; scrollbar-width: none; }
.cap2-scroll::-webkit-scrollbar { display: none; }
.cap2-scroll { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent); }
.cap2-scroll.fade { -webkit-mask-image: linear-gradient(to bottom, transparent 0, transparent var(--ph, 56px), #000 calc(var(--ph, 56px) + 26px), #000 calc(100% - 22px), transparent); mask-image: linear-gradient(to bottom, transparent 0, transparent var(--ph, 56px), #000 calc(var(--ph, 56px) + 26px), #000 calc(100% - 22px), transparent); }
.cap2-comp { flex: none; padding: 8px 12px calc(env(safe-area-inset-bottom, 0px) + 14px); }
/* the keyboard: the sheet and its backdrop stay put, the box rides up to 10px above it and the lines end where the box now starts */
.cap2-comp { transition: transform 0.3s cubic-bezier(0.22, 0.9, 0.3, 1); }
.cap2-scroll { transition: bottom 0.3s cubic-bezier(0.22, 0.9, 0.3, 1); }
#capture.kb-on .cap2-comp { transform: translateY(calc(env(safe-area-inset-bottom, 0px) + 4px - var(--kb, 0px))); }
#capture.kb-on .cap2-scroll { bottom: calc(var(--kb, 0px) - env(safe-area-inset-bottom, 0px) - 4px); }

/* the conversation */
#cap-greet, #cap-thread { display: grid; justify-items: start; gap: 8px; }
#cap-greet[hidden] { display: none; }
#cap-greet:not(:empty) { padding-bottom: 12px; }
#cap-thread:not(:empty) { padding-bottom: 12px; }
.cap2-b { max-width: 82%; padding: 10px 14px; border-radius: 20px; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; white-space: pre-line; }
.cap2-b.me { justify-self: end; background: var(--select); color: var(--select-ink); border-bottom-right-radius: 6px; }
.cap2-b.reply { width: 276px; max-width: 100%; border-bottom-left-radius: 6px; white-space: normal; display: block; }
#cap-greet .cap2-b.reply { width: fit-content; max-width: 276px; }
.cap2-pop { animation: cap2-pop 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes cap2-pop { from { opacity: 0; transform: translateY(10px) scale(0.96); } }
.cap2-rl { display: flex; justify-content: space-between; gap: 16px; padding-top: 4px; font-size: 14px; color: var(--text-2); }
.cap2-rl b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.nw { white-space: nowrap; }

/* a question: a bubble, and two answers as wide as it is */
.cap2-ask { width: 276px; max-width: 100%; display: grid; gap: 8px; margin: 0 0 12px; }
.cap2-ask .cap2-b.reply { width: 100%; }
.cap2-ans { justify-content: center; }
.cap2-ans .set-l { flex: none; text-align: center; font-weight: 600; }
.cap2-ans.again .set-l { color: var(--select); }
.cap2-ans.skip .set-l { color: var(--bad-text); }
.cap2-ans.again[aria-pressed="true"] { background: var(--select); }
.cap2-ans.again[aria-pressed="true"] .set-l { color: var(--select-ink); }
.cap2-ans.skip[aria-pressed="true"] { background: var(--bad); }
.cap2-ans.skip[aria-pressed="true"] .set-l { color: var(--bad-ink); }

/* the dent: a dark edge with a light edge beside it, parting the conversation from the entry */
.cap2-dent, #cap-pills:not(:empty)::before, .cap2-pinbar::before { height: 1px; background: rgba(0, 0, 0, 0.62); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.17); }
.cap2-dent { margin: 14px -16px 0; }
.cap2-dent[hidden], .cap2-dent.hide { display: none; }

/* the entries' pills: under the dent; past three they scroll sideways; scrolling down they stay under the title with no background and the lines fade beneath */
#cap-pills:not(:empty) { position: relative; margin: 0 -16px; padding: 10px 16px 8px; }
#cap-pills:not(:empty)::before, .cap2-pinbar::before { content: ""; position: absolute; left: 0; right: 0; top: 0; pointer-events: none; }
.cap2-pinbar { position: absolute; left: 0; right: 0; top: 0; z-index: 6; padding: 10px 16px 8px; box-sizing: border-box; }
.cap2-pinbar[hidden] { display: none; }
.cap2-tabs { margin: 0 !important; padding: 2px 0 4px !important; display: flex !important; flex-wrap: nowrap !important; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.cap2-tabs::-webkit-scrollbar { display: none; }
.cap2-tabs button { flex: 1 0 auto; height: 36px; padding: 0 16px; white-space: nowrap; }
.cap2-tabs.cap2-many { margin: 0 -16px !important; padding: 2px 16px 4px !important; }
.cap2-tabs button { display: inline-flex; align-items: center; gap: 8px; }
.cap2-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--select); flex: none; }
.cap2-tabs button[aria-selected="true"] .cap2-dot { background: var(--select-ink); }


/* the amount */
.cap2-amt { display: flex; align-items: baseline; justify-content: center; gap: 10px; padding: 12px 0 14px; }
.cap2-cur { appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 28px; font-weight: 700; padding: 0; }
.cap2-num { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 46px; font-weight: 700; letter-spacing: -0.02em; padding: 0; caret-color: var(--select); text-align: left; }
.cap2-num::placeholder { color: var(--text-3); }
.cap2-unit { font-size: 28px; font-weight: 700; }
.cap2-amt[hidden], .cap2-cur[hidden], .cap2-unit[hidden] { display: none; }

/* the lines (Settings') */
.cap2-gap { height: 12px; }
#cap-form .set-in.w { flex: 1; width: auto; min-width: 0; }
#cap-form .set-sel { max-width: 62%; -webkit-appearance: none; appearance: none; }
#cap-form .set-sel.nov, #cap-form .set-in::placeholder { color: var(--text-3); }
#cap-form .set-r { white-space: nowrap; }
#cap-form .set-note { margin-top: 10px; }
.cap2-date { position: relative; }
.cap2-date input[type="date"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.cap2-date .set-r { margin-left: auto; }

/* the message box, docked above the keyboard */
.cap2-well { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 16px; min-height: 52px; box-sizing: border-box; border-radius: 26px; background: var(--recessed); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 0.2s; }
.cap2-well:focus-within { box-shadow: inset 0 0 0 1.5px var(--good), 0 0 0 5px var(--good-soft); }
.cap2-well textarea { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; resize: none; color: var(--text); font: inherit; font-size: 16px; line-height: 1.3; padding: 0; height: 22px; overflow: hidden; }
.cap2-well { align-items: center; padding: 8px 8px 8px 16px; min-height: 52px; }
.cap2-well.multi { align-items: flex-end; }
.cap2-well textarea { align-self: center; }
.cap2-send { width: 36px; height: 36px; }
.cap2-send .icon { width: 18px; height: 18px; }
.cap2-well textarea::placeholder { color: var(--text-3); }
.cap2-send { flex: none; width: 38px; height: 38px; background: var(--select); color: var(--select-ink); }
.cap2-send:disabled { opacity: 0.4; cursor: default; }
.cap2-send .icon { width: 20px; height: 20px; }

/* private mode: every amount blurs, the figure you are typing excepted */
html[data-private="on"] :is(.cap-fig, .cap2-num:not(:focus)) { filter: blur(max(7px, 0.4em)); }
#cap-form .set-in[data-inst]:not([type="date"]) { width: 5ch; flex: none; }
/* the ✓ keeps its round shape: the old Log It button's padding and size rules still match its id */
#capture #cap-log.cap2-ok { width: 36px; height: 36px; min-width: 0; padding: 0; border-radius: 50%; font-size: inherit; letter-spacing: 0; }
#cap-form .set-in[data-month-pick] { flex: 1; width: auto; min-width: 0; text-align: right; cursor: pointer; caret-color: transparent; color: var(--text-2); }

/* Discard This Log?: a small sheet in the refund sheet's mould */
#cap-discard { width: min(340px, calc(100vw - 32px)); border-radius: var(--r-lg); }
#cap-discard .sheet-inner { border-radius: var(--r-lg); }
#cap-discard .sheet-head { justify-content: center; padding-top: var(--sp-5); }
#cap-discard .sheet-head h2 { flex: 0 1 auto; font-size: var(--fs-md, 18px); text-align: center; }
#cap-discard .sheet-body { justify-items: center; text-align: center; color: var(--text-2); padding-bottom: var(--sp-4); }
#cap-discard .sheet-body p { margin: 0; font-size: 14px; line-height: 1.4; }
#cap-discard .cap-foot { display: flex; gap: 10px; justify-content: center; padding: 0 20px 20px; }
#cap-discard .cap-foot .btn { flex: 1; text-transform: none; letter-spacing: 0; font-size: 14px; }

/* The navigation's active page: black on lime (the user's active state: solid lime fill, dark icon and name), not lime glass with light ink */
.dock-nav .pill-bubble {
  background: var(--select);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.dock-link[aria-current="page"],
.dock-link[aria-current="page"] .icon {
  color: var(--select-ink);
}

/* The + as well: solid lime with a dark plus, like the navigation's active page (not lime glass) */
.dock-add.glass {
  background: var(--select);
  color: var(--select-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.dock-add.glass::before,
.dock-add.glass::after {
  display: none;
}
.dock-add .icon {
  color: var(--select-ink);
}

/* the answers' fill runs edge to edge: the group's side padding left it floating short of the rim */
.cap2-ask .set-group { padding: 0; }
.cap2-ans { min-height: 52px; }

/* Home on a phone (Nov 2026): the ring, This Week, Streak, Quick Wins. Desktop is untouched. */
@media (max-width: 699px) {
  html[data-route="dashboard"] [data-pills="sections:dashboard"] { display: none !important; }
  :is(html[data-route="dashboard"], html[data-boot="home"]) :is(.picker-step, #picker-btn) { display: none !important; }
  .section:has(> .hph) { min-width: 0; }
  .hph { display: flex; flex-direction: column; gap: 20px; margin-top: -20px; width: 100%; min-width: 0; max-width: 100%; }
  .hph-ring-card { display: flex !important; flex-direction: row !important; align-items: center; gap: 18px; padding: 20px !important; border-radius: 20px; height: auto !important; }
  .hph-ring { position: relative; flex: none; width: 96px; height: 96px; }
  .hph-ring svg { display: block; overflow: visible; }
  .hph-ring em { position: absolute; inset: 0; display: grid; place-items: center; font: 700 14px var(--font); font-style: normal; }
  .hph-rt { fill: none; stroke: rgba(255, 255, 255, .12); stroke-width: 8; }
  .hph-rf { fill: none; stroke-width: 8; stroke-linecap: round; stroke: var(--good-text); }
  .hph-rf.s { stroke: #ff9f1c; } .hph-rf.b { stroke: var(--bad-text); } .hph-rf.q { stroke: var(--text-3); }
  .hph-rd { fill: #f4f6f0; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .7)); }
  .hph-ring em.g { color: var(--good-text); } .hph-ring em.s { color: #ff9f1c; } .hph-ring em.b { color: var(--bad-text); } .hph-ring em.q { color: var(--text-3); }
  .hph-rt-t { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
  .hph-rt-t b { font: 650 18px/23px var(--font); text-wrap: balance; }
  .hph-rt-t span { font-size: 14px; line-height: 20px; color: var(--text-2); }
  .hph-sec { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
  .hph-wk > :not(.hph-pills) { touch-action: pan-y; }
  /* the weeks in a row: one on screen, the ones either side just past the edges; the drag sets --wk-dx */
  .hph-wk { margin-inline: -16px; padding-inline: 16px; overflow-x: clip; } /* what slides stays inside the screen's width */
  .hph-wkw { position: relative; }
  /* the swipe's hint: small arrows in the side margins, level with the days, only where there's a week to go to; they fade while the week moves */
  .hph-warr { position: absolute; top: 27px; z-index: 1; width: 14px; height: 14px; color: var(--text-2); stroke-width: 2.4; pointer-events: none; transition: opacity .15s ease; }
  .hph-warr.l { left: -15px; }
  .hph-warr.r { right: -15px; }
  .hph-wk:is(.dragging, .settling) .hph-warr { opacity: 0; }
  .hph-wk:is(.in-l, .in-r):not(.dragging, .settling) .hph-warr { animation: hph-arr-in .3s ease; }
  @keyframes hph-arr-in { from { opacity: 0; } }
  .hph-wkv { margin: 0 -16px; padding: 0 16px; overflow: hidden; }
  .hph-track { display: flex; gap: 2px; transform: translateX(calc(-100% - 2px + var(--wk-dx, 0px))); will-change: transform; } /* one strip of days: the same gap between weeks as between days */
  .hph-track .hph-week { flex: 0 0 100%; min-width: 0; }
  .hph-wk:not(.dragging, .settling) .hph-week[aria-hidden] { visibility: hidden; } /* no sliver of the next week at the screen's edge at rest */
  .hph-wk .hph-pills, .hph-wk .hph-none { transform: translateX(var(--wk-dx, 0px)); opacity: var(--wk-fade, 1); }
  .hph-wk.settling :is(.hph-track, .hph-pills, .hph-none) { transition: transform .28s cubic-bezier(.22, .8, .24, 1), opacity .28s ease-out; }
  .hph-wk.in-r :is(.hph-pills, .hph-none) { animation: hph-in-r .26s cubic-bezier(.22, .8, .24, 1); }
  .hph-wk.in-l :is(.hph-pills, .hph-none) { animation: hph-in-l .26s cubic-bezier(.22, .8, .24, 1); }
  @keyframes hph-in-r { from { opacity: 0; transform: translateX(120px); } }
  @keyframes hph-in-l { from { opacity: 0; transform: translateX(-120px); } }
  .hph-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .hph-h { margin: 0; font: 750 20px/24px var(--font); letter-spacing: -.01em; color: var(--text); }
  .hph-count { font: 600 15px var(--font); color: var(--text-2); }
  .hph-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
  .hph-day { border: 0; background: transparent; color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 0 7px; border-radius: 14px; font: 600 12px var(--font); cursor: pointer; }
  .hph-day b { font-size: 18px; color: var(--text); }
  .hph-day u { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
  /* one dot, one meaning: white left to pay, orange today, red late, lime paid */
  .hph-day.has u { background: var(--text); }
  .hph-day.due u { background: #ff9f1c; }
  .hph-day.late u { background: var(--bad-text); }
  .hph-day.paid u { background: var(--good-text); }
  .hph-pills { display: flex; gap: 8px; contain: inline-size; min-width: 0; margin: 10px -16px 0; padding: 2px 16px; overflow-x: auto; scrollbar-width: none; }
  .hph-pills::-webkit-scrollbar { display: none; }
  .hph-pill { position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 12px; border-radius: 999px; color: var(--text); font: 600 15px var(--font); white-space: nowrap; cursor: pointer; box-shadow: none !important; }
  .hph-pill .icon { width: 18px; height: 18px; flex: none; }
  .hph-pill input, .hph-pill small, .hph-pill .hph-ok { display: none; }
  .hph-pill.late .icon { color: var(--bad-text); }
  .hph-pill.due .icon { color: #ff9f1c; }
  .hph-pill.late:not(.open)::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(135deg, rgba(255, 122, 112, .95), rgba(255, 122, 112, .25) 45%, rgba(255, 122, 112, .25) 58%, rgba(255, 122, 112, .8)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
  .hph-pill.due:not(.open)::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(135deg, rgba(255, 159, 28, .95), rgba(255, 159, 28, .25) 45%, rgba(255, 159, 28, .25) 58%, rgba(255, 159, 28, .8)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
  .hph-pill.done { background: transparent; color: var(--text-3); opacity: .7; }
  .hph-pill.done .icon { color: var(--good-text); }
  .hph-pill.open { padding: 0 4px 0 12px; gap: 6px; }
  .hph-pill.open::before { content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit; padding: 1px; background: linear-gradient(135deg, rgba(198, 244, 50, .95), rgba(198, 244, 50, .22) 42%, rgba(198, 244, 50, .22) 58%, rgba(198, 244, 50, .8)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
  .hph-pill.open input { display: block; width: 64px; border: 0; outline: 0; background: rgba(0, 0, 0, .28); border-radius: 10px; padding: 5px 6px; text-align: right; color: var(--text); font: 700 15px/20px var(--font); caret-color: var(--select); }
  .hph-pill.open small { display: inline; font: 650 12px var(--font); color: var(--text-3); }
  .hph-pill.open .hph-ok { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--select); color: var(--select-ink); cursor: pointer; }
  .hph-free i { display: inline-flex; align-items: center; height: 44px; padding: 0 18px; border-radius: 999px; border: 1.2px dashed rgba(255, 255, 255, .45); font: 600 15px var(--font); font-style: normal; color: var(--text-2); }
  .hph-none { display: flex; align-items: center; height: 48px; margin-top: 10px; padding: 0 4px; font: 500 15px/20px var(--font); color: var(--text-3); }
  .hph-none.hph-free { padding: 0; }
  .hph-dent { height: 3px; border-radius: 3px; background: rgba(0, 0, 0, .62); box-shadow: 0 1px 0 rgba(255, 255, 255, .17); margin: 4px 0; }
  .hph-streak { flex-direction: row; gap: 16px; align-items: stretch; }
  .hph-sl { flex: 0 0 104px; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
  .hph-sn { display: flex; flex-direction: column; gap: 2px; }
  .hph-sn b { font-weight: 750; line-height: .95; letter-spacing: -.03em; color: var(--text); }
  .hph-sn b.g { color: var(--good-text); }
  .hph-sn b.glow { text-shadow: 0 0 22px rgba(198, 244, 50, .6); }
  .hph-sn span { font-size: 14px; font-weight: 650; color: var(--text-3); }
  .hph-sp { margin: 0; font-size: 14px; line-height: 19px; font-weight: 600; color: var(--text-3); }
  .hph-sp.good { color: var(--good-text); } .hph-sp.soon { color: #ff9f1c; } .hph-sp.bad { color: var(--bad-text); }
  .hph-pz-w { position: relative; flex: 1; min-width: 0; height: 188px; }
  .hph-pz { display: block; width: 100%; height: 100%; }
  .hph-plus { position: absolute; display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: var(--select); cursor: pointer; }
  .hph-plus .icon { width: 20px; height: 20px; }
  /* Up Next: a calendar block and one calm sentence, no frame, not tappable (the user, 11 Nov 2026) */
  .hph-nxr { display: flex; align-items: center; gap: 14px; padding: 2px; }
  .hph-nx-cal { flex: none; width: 52px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .08); text-align: center; }
  .hph-nx-cal i { display: block; padding: 4px 0 3px; background: rgba(255, 255, 255, .1); color: var(--text-3); font: 700 10px/1.2 var(--font); font-style: normal; letter-spacing: .1em; text-transform: uppercase; }
  .hph-nx-cal b { display: block; padding: 3px 0 5px; font-size: 22px; line-height: 1.2; font-variant-numeric: tabular-nums; }
  .hph-nxt { flex: 1; min-width: 0; }
  .hph-nxt p { margin: 0; font-size: 16px; line-height: 21px; font-weight: 600; color: var(--text); }
  .hph-nxt p + p { margin-top: 2px; font-size: 14px; line-height: 19px; color: var(--text-3); }
  .hph-nxa { flex: none; text-align: right; }
  .hph-nxa b { display: block; font: 700 18px/22px var(--font); letter-spacing: -.01em; }
  .hph-nxa small, .hph-nxe small { display: block; font: 650 12px/16px var(--font); color: var(--text-3); }
  .hph-nxe { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
  .hph-nxb { width: 96px; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(0, 0, 0, .28); color: var(--text); font: 700 18px var(--font); text-align: right; outline: 0; caret-color: var(--select); }
  .hph-nxb::placeholder { color: rgba(255, 255, 255, .28); } .hph-nxb:focus { border-color: rgba(255, 255, 255, .55); }
  /* Quick Wins as highlights: a bigger circle with the key figure inside and what it's about under it (the user, 12 Nov 2026).
     The ring around the figure fills with how serious it is. The picked one has a white outer ring. The row scrolls inside its width. */
  .hph-rings { display: flex; align-items: flex-start; gap: 8px; width: 0; min-width: 100%; padding: 4px 16px 12px; margin: 8px -16px 0; scroll-padding-inline: 16px; box-sizing: content-box; overflow-x: auto; scrollbar-width: none; } /* the row runs to the screen's edge, so a circle isn't cut at the gutter */
  .hph-rings::-webkit-scrollbar { display: none; }
  .hph-hl { flex: none; width: 84px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; }
  .hph-hc { position: relative; width: 72px; height: 72px; display: grid; place-items: center; border-radius: 50%; }
  .hph-hl.on .hph-hc { box-shadow: 0 0 0 2px #000, 0 0 0 4px rgba(255, 255, 255, .85); }
  .hph-hr { position: absolute; inset: 0; width: 72px; height: 72px; transform: rotate(-90deg); fill: none; stroke-width: 7; }
  .hph-hr .t { stroke-opacity: .18; } .hph-hr .f { stroke-linecap: round; }
  .hph-hc .in { position: relative; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .07); font: 600 17px var(--font); letter-spacing: -.02em; color: #fff; }
  .hph-hc .in.long { font-size: 14px; letter-spacing: -.03em; }
  .hph-hlb { font: 650 13px/16px var(--font); color: var(--text-2); text-align: center; text-wrap: balance; overflow-wrap: anywhere; }
  .hph-hl.on .hph-hlb { color: var(--text); }
  /* the picture card: the state drawn small */
  .hph-qp .qp { margin-top: 16px; }
  .qp-viz { display: flex; flex-direction: column; gap: 8px; }
  .qp-cap { display: flex; justify-content: space-between; gap: 10px; font: 650 12px/16px var(--font); color: var(--text-3); }
  .qp-cap b { color: var(--text); font-weight: 700; }
  .qp-trk { position: relative; height: 12px; border-radius: 99px; background: rgba(255, 255, 255, .1); }
  .qp-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; }
  .qp-fill.red { background: #ff7a70; } .qp-fill.amb { background: #ff9f1c; } .qp-fill.grn { background: #c6f432; } .qp-fill.gry { background: rgba(255, 255, 255, .45); }
  .qp-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; border-radius: 2px; background: #fff; }
  .qp-gap { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: repeating-linear-gradient(135deg, rgba(255, 122, 112, .9) 0 4px, rgba(255, 122, 112, .25) 4px 8px); }
  .qp-pair { display: flex; align-items: center; gap: 12px; }
  .qp-pair .icon { width: 20px; height: 20px; flex: none; color: var(--text-3); }
  .qp-chip { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, .05); }
  .qp-chip small { display: block; font: 700 11px/14px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
  .qp-chip b { font: 750 24px/30px var(--font); }
  .qp-chip.n { border-color: rgba(255, 159, 28, .7); } .qp-chip.n b { color: #ff9f1c; }
  .qp-cd { display: flex; align-items: center; gap: 14px; } .qp-cd .qp-viz { flex: 1; min-width: 0; }
  .qp-cal { flex: none; width: 52px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .08); text-align: center; }
  .qp-cal i { display: block; padding: 4px 0 3px; background: rgba(255, 255, 255, .1); color: var(--text-3); font: 700 10px/1.2 var(--font); font-style: normal; letter-spacing: .1em; text-transform: uppercase; }
  .qp-cal b { display: block; padding: 3px 0 5px; font-size: 22px; line-height: 1.2; }
  .qp-dots { display: flex; flex-wrap: wrap; gap: 6px; }
  .qp-dots i { width: 14px; height: 14px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
  .qp-dots i.r { background: #ff7a70; } .qp-dots i.d { background: transparent; box-shadow: inset 0 0 0 2px #ff7a70; }
  .qp-bars { display: flex; align-items: flex-end; gap: 10px; height: 64px; }
  .qp-bars div { position: relative; flex: 1; border-radius: 8px 8px 3px 3px; background: rgba(255, 255, 255, .22); }
  .qp-bars div.now { background: #ff9f1c; }
  .qp-bars span { position: absolute; left: 0; right: 0; bottom: -18px; text-align: center; font: 650 11px var(--font); color: var(--text-3); }
  .qp-sp { height: 16px; }
  .hph-qg { display: block !important; }
  .hph-qc.pcard { position: relative; width: 100%; height: auto !important; min-height: 0 !important; padding: 22px 20px 0 !important; display: flex !important; flex-direction: column !important; gap: 0 !important; background: transparent !important; overflow: hidden; --bad-text: var(--text); --bad: var(--select); }
  .hph-qc .pcard-name { font-size: 19px !important; line-height: 26px !important; font-weight: 650 !important; height: auto !important; white-space: normal; }
  .hph-qc .pcard-money { margin-top: 18px !important; }
  .hph-qc .glance-viz { margin-top: 20px !important; height: auto !important; flex: none !important; min-height: 0 !important; }
  .hph-qc .ins-cuts-body { margin-top: 20px !important; }
  .hph-qc .g-row { height: 28px; }
  .hph-qc .t-bad, .hph-qc .t-soon { color: var(--good-text) !important; }
  .hph-qc .pcard-amount, .hph-qc .ins-fig b { color: var(--text) !important; }
  .hph-qc .g-row.over .g-val { color: var(--text) !important; } .hph-qc .g-row.over .g-name { color: var(--text-2) !important; }
  .hph-qc .ins-strip .u { background: rgba(255, 255, 255, .22) !important; } .hph-qc .ins-strip .c { background: var(--text) !important; } .hph-qc .ins-strip .s { background: var(--select) !important; }
  .hph-split { display: flex; margin: 20px -20px 0; border-top: 1px solid var(--line); }
  .hph-split button { flex: 1; height: 50px; border: 0; background: none; color: var(--text-2); font: 650 15px var(--font); cursor: pointer; }
  .hph-split button.go { color: var(--good-text); }
  .hph-split i { flex: none; width: 1px; background: var(--line); }
  /* Log's day row wears Home's week: no boxes, three-letter days, the picked day a lime tile, a lime dot where something was logged */
  .log-strip { gap: 2px; }
  .ld { width: 47px; padding: 8px 0 7px; border: 0; border-radius: 14px; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 5px; }
  .ld span { color: var(--text-2); font: 600 12px var(--font); letter-spacing: 0; text-transform: none; }
  .ld b { margin: 0; font-size: 18px; font-weight: 700; color: var(--text); }
  .ld i { width: 5px; height: 5px; margin: 0; background: var(--good-text); opacity: 0; }
  .ld.has i, .ld-all i { opacity: 1; }
  .ld.fut { opacity: 1; }
  .ld[aria-pressed="true"] { background: var(--select); }
  .ld[aria-pressed="true"] span { color: var(--select-ink); opacity: 1; }
  .ld[aria-pressed="true"] b { color: var(--select-ink); }
  .ld[aria-pressed="true"] i { background: var(--select-ink); }
  .ld-all b { font-size: 15px; }
  .log-days { gap: 2px; }
  /* the loading wireframe of Home on a phone: the same page in grey blocks, no words */
  .bk-page.bk-hph { gap: 20px; margin-top: -20px; }
  .bk-hring { flex-direction: row; align-items: center; gap: 18px; padding: 20px; border-radius: 20px; }
  .bk-hring .bk-ring { width: 96px; height: 96px; border-width: 8px; }
  .bk-htx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
  .bk-hsec { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
  .bk-hweek { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
  .bk-hweek .bk-day { width: 100%; height: 66px; border-radius: 14px; }
  .bk-hpills { display: flex; gap: 8px; margin-top: 14px; padding: 2px 0; overflow: hidden; }
  .bk-hpills .bk-pill { height: 44px; }
  .bk-hstreak { display: flex; gap: 16px; }
  .bk-hl { flex: 0 0 104px; display: flex; flex-direction: column; justify-content: space-between; }
  .bk-hpz { flex: 1; min-width: 0; height: 188px; display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(5, 1fr); gap: 4px; }
  .bk-hpz .bk-sk { height: 100%; }
  .bk-hrings { display: flex; align-items: center; gap: 10px; }
  .bk-hrings .bk-ring { width: 40px; height: 40px; border-width: 4px; }
  .bk-hrings .bk-ring:first-child { width: 56px; height: 56px; margin-right: 13px; }
  /* the pop-ups: the same clear glass as the card, in the middle of the screen over a blur */
  dialog.cuts-sheet.sheet { position: fixed; inset: 0; margin: auto; width: calc(100% - 24px); max-width: 420px; height: fit-content; max-height: 90dvh; border-radius: 20px !important; background: rgba(14, 17, 10, .3) !important; padding: 0; overflow: auto; transform: none !important; }
  dialog.cuts-sheet.sheet::backdrop { background: none; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
  .cuts-sheet .sheet-inner { padding: 20px 20px 0; }
  .cuts-sheet .sheet-head { padding: 0; align-items: center; }
  .cuts-sheet .sheet-head h2 { font: 650 19px/26px var(--font); text-align: left; }
  .cuts-sheet .sheet-head .round-btn { background: rgba(255, 255, 255, .1); box-shadow: none; width: 36px; height: 36px; }
  .cuts-sheet .cuts-sum { text-align: left; font-size: 14px; line-height: 20px; color: var(--text-2); padding: 0; margin: 8px 0 4px; }
  .cuts-sheet .cuts-sum b { color: inherit; font-weight: 650; }
  .cuts-sheet .cuts-row { background: none !important; padding: 10px 0; }
  .cuts-sheet .cuts-cb { border-radius: 50%; }
  .cuts-sheet .cut-amt { background: none !important; box-shadow: none !important; border: 0 !important; padding: 0; color: var(--good-text); font-size: 18px; font-weight: 700; }
  .cuts-sheet .cuts-sv, .cuts-sheet .cuts-sv.bad { color: var(--good-text); }
  .cuts-sheet .cuts-foot { padding: 0; margin: 8px -20px 0; background: none; box-shadow: none; }
  .cuts-sheet .cuts-res { padding: 0 20px 12px; text-align: left; font-size: 14px; color: var(--text-2); }
  .hph-warn { color: #ff9f1c; } .hph-full { color: var(--good-text); }
  .cuts-sheet .cuts-btns { display: flex; gap: 0; border-top: 1px solid var(--line); }
  .cuts-sheet .cuts-btns .btn { flex: 1; height: 50px; border-radius: 0; background: none !important; box-shadow: none !important; text-transform: none; letter-spacing: 0; font: 650 15px var(--font); color: var(--text-2); }
  .cuts-sheet .cuts-btns .btn + .btn { border-left: 1px solid var(--line); }
  .cuts-sheet .cuts-btns .btn-primary { color: var(--good-text); }
  .cuts-sheet .cuts-btns .btn.danger { color: var(--text-2); }
  .hph-into { display: flex; align-items: center; justify-content: space-between; min-height: 48px; border-top: 1px solid var(--line); font: 600 15px var(--font); }
  .hph-into select { border: 0; background: none; color: var(--good-text); font: 650 15px var(--font); text-align: right; }
  .hph-into b { color: var(--text-2); font-weight: 650; }
}
html[data-private="on"] :is(.hph-amt, .hph-nxa .num, .hph-hl .num, .hph-qc .num, .hph-qc .pcard-amount, .cuts-sheet .cut-amt, .cuts-sheet .cuts-sv, .cuts-sheet .cuts-res b, .cuts-sheet .cuts-sum b):not(:focus) { filter: blur(max(7px, 0.4em)); }

/* Faint Liquid (5 Nov 2026, the user): on a phone, glass resting on the backdrop has no fill and almost no
   blur, so the colour behind comes through and the bright rim draws the shape. Glass floating over the page
   (sheets, pop-ups, the wizards, the sticky top bar's buttons) stays frosted. It works through the glass variables, so a card's
   own state tint (paid, over) still shows. */
@media (max-width: 699px) {
  .glass {
    --glass: transparent;
    --blur: saturate(120%);
    --glass-sheen: transparent;
    --glass-shadow: inset 0 1px 1px rgba(255, 255, 255, .14);
  }
  .glass.strong, .scard.glass, .pl-add.glass, .topbar .glass, .log-head .glass, .plan-bar .glass, .inc-bar .glass {
    --glass: rgba(14, 17, 10, .55);
    --blur: blur(24px) saturate(180%);
    --glass-sheen: rgba(255, 255, 255, .07);
    --glass-shadow: 0 24px 60px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .3);
  }
  /* the dock is Soft Liquid: a very slight blur and the colour behind brightened, no fill */
  .dock-nav.glass { --glass: rgba(255, 255, 255, .04); --blur: blur(16px) saturate(180%) brightness(1.1); }
  /* Full Frost has no dark tint on a phone: the 24 px blur does the blocking and the backdrop's colour comes through.
     A selected pill's fill and the full Log screen keep their own. */
  /* Settings keeps its own backdrop, like the Log screen (22 Nov 2026: transparent, the page behind showed through) */
  .glass.strong:not(#capture):not(#settings):not(.view-toggle), .pl-add.glass, .topbar .glass:not(.view-toggle):not([aria-selected="true"]):not([aria-pressed="true"]), .log-head .glass:not(.view-toggle):not([aria-selected="true"]):not([aria-pressed="true"]), .plan-bar .glass:not([aria-selected="true"]):not([aria-pressed="true"]), .scard.glass { background: transparent !important; }
  /* Cards drawn with --card had their own dark fill: Path to Zero and every other list card go clear too */
  .card.glass:not(.strong) { background: transparent; }
  /* the big Accounts and Credit Cards card, and Track's section menu, had dark fills of their own */
  .acc-card.glass { background: transparent !important; }
  .pcard.glass.paid { background-color: transparent !important; } /* the lime wash stays, its dark base goes */
  .tk-menu { background: transparent !important; -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); }
  /* Track's Add wizard is a page in a frame, so the frost lives on the frame and the page behind it blurs as a pop-up's does */
  .tw-scrim { background: transparent; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
  .tw-frame { background: rgba(10, 10, 12, .25); -webkit-backdrop-filter: blur(24px) saturate(120%); backdrop-filter: blur(24px) saturate(120%); }
  /* Every bottom sheet matches Make Cuts: no dark tint, a 24 px frost on the sheet, the page behind it blurred and not dimmed */
  dialog.sheet:not(#capture):not(#settings)::backdrop { background: none; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
  /* Log's OK: clear glass, no lime and black */
  #capture #cap-log.cap2-ok { position: relative; background: linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, 0) 68%, rgba(255, 255, 255, .05)); color: var(--text); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5), inset 0 1px 1px rgba(255, 255, 255, .14); }
  /* Log's glass is stronger than the pages': a dark tint and a firm frost, never brighter, on every surface inside it */
  #capture .glass:not(.strong) { --glass: rgba(10, 10, 12, .18); --blur: blur(12px) saturate(180%); --glass-sheen: transparent; --glass-shadow: inset 0 1px 1px rgba(255, 255, 255, .14); }
  /* the text box: the same glass, and no lime rim when it's in use */
  .cap2-well { background: rgba(10, 10, 12, .18); -webkit-backdrop-filter: blur(12px) saturate(180%); backdrop-filter: blur(12px) saturate(180%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
  .cap2-well:focus-within { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .34); }
  .cap2-b.me { position: relative; background: rgba(10, 10, 12, .18); color: var(--text); -webkit-backdrop-filter: blur(12px) saturate(180%); backdrop-filter: blur(12px) saturate(180%); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14); }
  .cap2-b.me::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; background: linear-gradient(135deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .12) 38%, rgba(255, 255, 255, .05) 62%, rgba(255, 255, 255, .55)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
  /* the + is liquid too, a white icon inside the bright rim */
  .dock-add.glass { background: rgba(255, 255, 255, .04) !important; -webkit-backdrop-filter: blur(16px) saturate(180%) brightness(1.1) !important; backdrop-filter: blur(16px) saturate(180%) brightness(1.1) !important; box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14) !important; color: var(--text) !important; }
  .dock-add.glass .icon { color: var(--text) !important; }
  .dock-add.glass::after { display: block !important; content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; background: linear-gradient(135deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .12) 38%, rgba(255, 255, 255, .05) 62%, rgba(255, 255, 255, .55)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
  /* the dock's active page: clear glass, the same as the picked day, with a bright white rim and a white icon; nothing blurs behind the dock */
  .dock-nav .pill-bubble { background: linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, 0) 68%, rgba(255, 255, 255, .05)) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14) !important; }
  .dock-nav .pill-bubble::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; background: linear-gradient(135deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .12) 38%, rgba(255, 255, 255, .05) 62%, rgba(255, 255, 255, .55)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
  .dock-link[aria-current="page"], .dock-link[aria-current="page"] .icon { color: var(--text) !important; }
  .edge-blur-bottom { display: none !important; }
  /* Plan's Expenses and Income: the active one is clear glass, as the picked day and the dock's active tab */
  :is(.tabs[data-pills="sections:plan"], .tabs[data-pills="sections:tracker"]) button.glass[aria-selected="true"] { background: linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, 0) 68%, rgba(255, 255, 255, .05)) !important; color: var(--text) !important; box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14) !important; }
  :is(.tabs[data-pills="sections:plan"], .tabs[data-pills="sections:tracker"]) button.glass[aria-selected="true"] .icon { color: var(--text) !important; }
  :is(.tabs[data-pills="sections:plan"], .tabs[data-pills="sections:tracker"]) button.glass[aria-selected="true"]::after { background: linear-gradient(135deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .12) 38%, rgba(255, 255, 255, .05) 62%, rgba(255, 255, 255, .55)) !important; }
  /* Track's section menu: the open tracker is clear glass with white text, the others are quiet */
  .tk-sections button:not([aria-current="true"]) { color: var(--text-2); }
  .tk-sections button[aria-current="true"] { position: relative; color: var(--text); background: linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, 0) 68%, rgba(255, 255, 255, .05)); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14); }
  .tk-sections button[aria-current="true"]::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; background: linear-gradient(135deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .12) 38%, rgba(255, 255, 255, .05) 62%, rgba(255, 255, 255, .55)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
  .tk-sections button:hover { background: transparent; color: var(--text); }
  .tk-sections button[aria-current="true"]:hover { background: linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, 0) 68%, rgba(255, 255, 255, .05)); }
  /* Track's tracker pop-up: only as wide as its rows, calm frost with no colour boost, bright rows at the pill's text size */
  .tk-menu.tk-sections { width: max-content; min-width: 0; padding: 6px; gap: 0; -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); box-shadow: none; transform-origin: 24px 0; animation: tk-pop .2s cubic-bezier(.3, 1.12, .32, 1); }
  .tk-sections button, .tk-sections button:not([aria-current="true"]) { display: flex; align-items: center; gap: 5px; width: 100%; height: 40px; padding: 0 10px; color: var(--text); font-size: var(--fs-xs); font-weight: 650; }
  .tk-sections button .icon { color: var(--text); }
  .tk-sections .tk-grip { margin-left: auto; color: var(--text-3); touch-action: none; }
  .tk-sections button > span { margin-right: 8px; }
  @keyframes tk-pop { from { opacity: 0; transform: translateY(-4px) scale(.97); } }
  @media (prefers-reduced-motion: reduce) { .tk-menu.tk-sections { animation: none; } }
  /* The quiet neighbour: what isn't active drops its fill and dims, so the clear active pill stands out */
  :is(.tabs[data-pills="sections:plan"], .tabs[data-pills="sections:tracker"]) button.glass[aria-selected="true"] { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .tabs[data-pills="sections:plan"] button.glass:not([aria-selected="true"]) { background: transparent !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; box-shadow: none !important; color: var(--text-3) !important; }
  .tabs[data-pills="sections:plan"] button.glass:not([aria-selected="true"])::after { opacity: .5; }
  /* Plan's categories: the same two states. A late category has no red fill: a red glass rim and a red icon, as a late pill on Home */
  .cat-pills button:not([aria-selected="true"]) { color: var(--text-3); border-color: rgba(255, 255, 255, .1); }
  .cat-pills button:not([aria-selected="true"]) .icon { color: var(--text-3); }
  .cat-pills button[aria-selected="true"], .cat-pills button.cat-late { position: relative; border-color: transparent !important; }
  .cat-pills button[aria-selected="true"], .cat-pills button[aria-selected="true"].cat-late { background: linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, 0) 68%, rgba(255, 255, 255, .05)) !important; color: var(--text) !important; box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14) !important; }
  .cat-pills button[aria-selected="true"] .icon { color: var(--text) !important; }
  .cat-pills button[aria-selected="true"]::after, .cat-pills button.cat-late::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; background: linear-gradient(135deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .12) 38%, rgba(255, 255, 255, .05) 62%, rgba(255, 255, 255, .55)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
  .cat-pills button.cat-late::after { background: linear-gradient(135deg, rgba(255, 122, 112, .95), rgba(255, 122, 112, .25) 45%, rgba(255, 122, 112, .25) 58%, rgba(255, 122, 112, .8)); }
  .cat-pills button.cat-late .icon, .cat-pills button[aria-selected="true"].cat-late .icon { color: var(--bad-text) !important; }
  /* the picked day, Home's week and Log's row: the same liquid, its dot keeps its colour */
  .hph-day[aria-pressed="true"], .ld[aria-pressed="true"] {
    position: relative;
    background: linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, 0) 68%, rgba(255, 255, 255, .05));
    -webkit-backdrop-filter: saturate(120%);
    backdrop-filter: saturate(120%);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14);
  }
  .hph-day[aria-pressed="true"]::before, .ld[aria-pressed="true"]::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .12) 38%, rgba(255, 255, 255, .05) 62%, rgba(255, 255, 255, .55));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
  }
  .hph-day[aria-pressed="true"] { color: var(--text-2); }
  .ld[aria-pressed="true"] span { color: var(--text-2); }
  .ld[aria-pressed="true"] b { color: var(--text); }
  .ld[aria-pressed="true"] i { background: var(--good-text); }
}

/* Log's send button: a wider capsule of white glass with a white arrow, not a lime circle (5 Nov 2026, the user) */
@media (max-width: 699px) {
  .cap2-well .cap2-send { width: 50px; height: 36px; min-width: 50px; flex: 0 0 50px; border-radius: 18px; }
  .cap2-well .cap2-send .icon { width: 20px; height: 20px; color: var(--select); }
  .cap2-well .cap2-send:disabled, .cap2-well .cap2-send:disabled .icon { color: var(--text); }
  .cap2-well .cap2-send { position: relative; background: var(--raised-strong); color: var(--select); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14); }
  .cap2-well .cap2-send::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; background: linear-gradient(135deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .12) 38%, rgba(255, 255, 255, .05) 62%, rgba(255, 255, 255, .55)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
}

/* Every amount blurs in private mode (6 Nov 2026): the ones the rules above missed, found by an audit of every page */
html[data-private="on"] :is(.tab-amt, .cat-amt, .pcard-amount, .pcard-vs, .pcard-logged, .lb-say, .g-val, .tl-full, .tl-short, .tl-amt, .g-od-free .num, .svc-amt, .svc-foot .num) { filter: blur(max(7px, 0.4em)); user-select: none; }

/* No lime and black on a phone (6 Nov 2026, the user). What is selected is clear glass with white text; the button
   you're meant to press has lime text and no fill, like Apply Cuts. Lime fills stay only for paid, progress and charts. */
@media (max-width: 699px) {
  .tabs button.glass[aria-selected="true"], .pop-grid button[aria-selected="true"], .pop-grid.cal button.mid[aria-selected="true"], .weekdays button[aria-pressed="true"], .seg-chip[aria-pressed="true"], .tk-pill[aria-selected="true"], .svc-years button.on, .cu-pills button.on, .round-btn.log-ib[aria-pressed="true"], .lf-p[aria-pressed="true"], .scard-head .round-btn.scard-subs[aria-pressed="true"], .chip.act, .svc-row.nx .svc-cal, .svc-cell.nx .svc-cal {
    background: linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, 0) 68%, rgba(255, 255, 255, .05)) !important;
    border-color: rgba(255, 255, 255, .5) !important;
    color: var(--text) !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5), inset 0 1px 1px rgba(255, 255, 255, .14) !important;
  }
  :is(.pop-grid button[aria-selected="true"], .weekdays button[aria-pressed="true"], .seg-chip[aria-pressed="true"], .tk-pill[aria-selected="true"], .cu-pills button.on, .round-btn.log-ib[aria-pressed="true"], .lf-p[aria-pressed="true"], .chip.act) .icon { color: var(--text) !important; }
  .svc-row.nx .svc-cal :is(i, b), .svc-cell.nx .svc-cal :is(i, b) { background: transparent !important; color: var(--text) !important; }
  .save-btn, .btn.btn-primary, .svc-btns .svc-save, .scard.wizard .wbtn.p, .gspec .g-act-btn, .ins-bar button, .hph-ok, .hph-pill.open .hph-ok, .cap2-ok {
    background: transparent !important;
    border-color: rgba(255, 255, 255, .3) !important;
    color: var(--select) !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3) !important;
  }
  :is(.save-btn, .btn.btn-primary, .svc-btns .svc-save, .scard.wizard .wbtn.p, .gspec .g-act-btn, .ins-bar button, .hph-ok) .icon { color: var(--select) !important; }
  /* Log's done button wears the send button's glass: white glass, a bright rim, lime when it can be pressed, dim white when it can't */
  #capture #cap-log.cap2-ok { position: relative; background: var(--raised-strong) !important; color: var(--select); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14) !important; }
  /* Log's close button: the same glass and size as done, with a white icon */
  #capture .cap2-top .round-btn.glass { --glass: var(--raised-strong); --blur: none; --glass-shadow: inset 0 1px 1px rgba(255, 255, 255, .14); width: 36px; height: 36px; color: var(--text); }
  #capture .cap2-top .round-btn .icon { width: 18px; height: 18px; }
  #capture .cap2-top .round-btn.glass::after { background: linear-gradient(135deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .12) 38%, rgba(255, 255, 255, .05) 62%, rgba(255, 255, 255, .55)); }
  #capture #cap-log.cap2-ok::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; background: linear-gradient(135deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .12) 38%, rgba(255, 255, 255, .05) 62%, rgba(255, 255, 255, .55)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
  #capture #cap-log.cap2-ok:disabled, .btn.btn-primary:disabled, .save-btn:disabled { color: var(--text) !important; }
  .type-ic, .type-card .type-ic, .type-row .type-ic { background: transparent !important; color: var(--text) !important; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5) !important; }
}

/* No lime fill on a button, at any width (3 Dec 2026, the user: "why do you use lime filled buttons"). The phone's rule above,
   now on wide screens too: the button you're meant to press is glass with lime words and no fill — Save N changes, the carry
   question, the full-screen table's Save, every pop-up's suggested answer. Toggles, paid, progress and charts keep their lime. */
.save-btn, .btn.btn-primary, .svc-btns .svc-save, .scard.wizard .wbtn.p, .gspec .g-act-btn, .ins-bar button, .hph-ok, .hph-pill.open .hph-ok,
.save-pop .btn.btn-primary, .carry .carry-btns .btn.btn-primary, html.table-fs .topbar.fsb-v #top-tools .btn-primary {
  background: transparent !important;
  border-color: rgba(255, 255, 255, .3) !important;
  color: var(--select) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3) !important;
}
:is(.save-btn, .btn.btn-primary, .svc-btns .svc-save, .scard.wizard .wbtn.p, .gspec .g-act-btn, .ins-bar button, .hph-ok) .icon { color: var(--select) !important; }
.btn.btn-primary:disabled, .save-btn:disabled { color: var(--text) !important; }

/* A toggle that is on, everywhere (6 Nov 2026, the user's reference): a grey track, a lime rim and a lime knob */
.switch[aria-checked="true"], .xfer-switch[aria-checked="true"] { background: rgba(255, 255, 255, .22) !important; border: 1.5px solid #c6f432 !important; box-shadow: none !important; }
.switch[aria-checked="true"] i, .xfer-switch[aria-checked="true"] i { background: #c6f432 !important; top: 1.5px; }
.switch[aria-checked="true"] i { left: 19.5px; }
.xfer-switch[aria-checked="true"] i { transform: translateX(17px); }

/* Plan's Expenses and Income: one joined pill across the screen, cut in half by a thin line, the active half lit with a little white glass (6 Nov 2026, the user) */
@media (max-width: 699px) {
  .pills-host:has(.tabs[data-pills="sections:plan"]:not([hidden])) #row-right { display: none; }
  .tabs[data-pills="sections:plan"]:not([hidden]) { position: fixed; z-index: 20; left: 16px; right: 16px; bottom: calc(var(--dock-b, 22px) + var(--dock-h) + 12px); width: auto; max-width: none; display: grid; grid-template-columns: 1fr 1fr; gap: 0; height: 58px; overflow: hidden; border-radius: 22px; box-sizing: border-box; } /* stands above the dock, where the totals bar was (6 Nov 2026, the user) */
  .tabs[data-pills="sections:plan"]:not([hidden])::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; background: linear-gradient(135deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .1) 40%, rgba(255, 255, 255, .08) 60%, rgba(255, 255, 255, .28)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
  .tabs[data-pills="sections:plan"]:not([hidden]) > button.glass { display: flex; flex-direction: column; gap: 1px; align-items: center; justify-content: center; width: 100%; height: 100%; margin: 0; border: 0 !important; border-radius: 0 !important; font-size: 15px; clip-path: none; }
  .tabs[data-pills="sections:plan"]:not([hidden]) > button.glass::after { display: none !important; }
  .tabs[data-pills="sections:plan"]:not([hidden]) > button.glass[aria-selected="true"] { background: rgba(255, 255, 255, .12) !important; box-shadow: none !important; }
  .tabs[data-pills="sections:plan"]:not([hidden]) > button.glass:not([aria-selected="true"]) { color: var(--text-2) !important; }
  .tabs[data-pills="sections:plan"]:not([hidden]) > button.glass + button.glass { box-shadow: inset 1px 0 0 rgba(255, 255, 255, .14) !important; }
}

/* Plan's totals: the same joined pill as Expenses and Income, equal parts cut by thin lines, each keeping its own colour (6 Nov 2026, the user) */
@media (max-width: 699px) {
  .phone-totals.glass.strong { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; min-height: 44px; padding: 0; border: 0; border-radius: 22px; overflow: hidden; align-items: stretch; }
  .phone-totals.glass.strong.two { grid-template-columns: 1fr 1fr; }
  .phone-totals.glass.strong::after { background: linear-gradient(135deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .1) 40%, rgba(255, 255, 255, .08) 60%, rgba(255, 255, 255, .28)) !important; }
  .phone-totals .pt-cell, .phone-totals .pt-cell.key-cat, .phone-totals .pt-cell.key-inc, .phone-totals .pt-cell.over { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; margin: 0; padding: 7px 4px; border: 0; border-radius: 0; background: none !important; box-shadow: none !important; }
  .phone-totals .pt-cell::before, .phone-totals .pt-cell::after { display: none !important; }
  .phone-totals .pt-cell + .pt-cell { border: 0; box-shadow: inset 1px 0 0 rgba(255, 255, 255, .14) !important; }
  .phone-totals .pt-cell.over .pt-value { color: var(--text) !important; } /* every amount is white; the label carries the colour */
}

/* Plan on a phone: amounts in the Expenses and Income pill and in the active category; no totals bar; the dots 12 px from the cards and the pill (6 Nov 2026, the user) */
.tab-amt, .cat-amt { display: none; }
@media (max-width: 699px) {
  [data-page="plan"] .phone-totals.glass.strong { display: none; }
  [data-page="plan"] .section { margin-top: -32px; } /* the pill has left the top: the first row takes its place, 15 px under the header */
  [data-page="plan"] .card-dots { margin-top: 12px; }
  html:has([data-page="plan"] .section:not([hidden]) .card-single) .tabs[data-pills="sections:plan"]:not([hidden]) { display: none; } /* steps aside while a card is open */
  .tab-amt { display: block; font: 650 13px/17px var(--font); color: var(--text); }
  .cat-amt { display: inline; margin-left: 2px; font: 650 14px var(--font); color: var(--text); white-space: nowrap; }
  :is(.tab-amt, .cat-amt) .cur { margin-left: 3px; font-size: 10px; font-weight: 650; letter-spacing: .04em; color: var(--text-2); }
}


/* ==== Plan on a phone, redesigned (7 Nov 2026, the user; docs 02 §7) ====
   The list is plain rows on the backdrop with dented lines between them; an item opens as a sheet of three tabs. */
@media (max-width: 699px) {
  /* ---- the list ---- */
  [data-page="plan"] .card-pages { flex-direction: column !important; overflow-x: hidden !important; overflow-y: auto !important; scroll-snap-type: none !important; gap: 0 !important; margin: 0 !important; padding: 0 2px !important; }
  [data-page="plan"] .card-page { width: 100% !important; flex: none !important; display: grid !important; grid-template-columns: 1fr !important; grid-template-rows: none !important; grid-auto-rows: 56px !important; gap: 0 !important; height: auto !important; align-content: start; scroll-snap-align: none !important; }
  [data-page="plan"] .card-page + .card-page { box-shadow: inset 0 2px 0 rgba(0, 0, 0, .42), inset 0 3px 0 rgba(255, 255, 255, .11); }
  [data-page="plan"] .card-dots { display: none !important; }
  [data-page="plan"] .pcard, [data-page="plan"] .pcard.glass { background: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; outline: 0 !important; height: auto !important; min-height: 0 !important; padding: 0 !important; display: block !important; overflow: visible !important; }
  [data-page="plan"] .pcard::before, [data-page="plan"] .pcard::after, [data-page="plan"] .pcard-hold { display: none !important; }
  [data-page="plan"] .card-page .pcard + .pcard { box-shadow: inset 0 2px 0 rgba(0, 0, 0, .42), inset 0 3px 0 rgba(255, 255, 255, .11) !important; }
  /* a pressed row: a soft glass highlight that reaches 8 px past the dented lines on each side, so the date and the info icon are not touching its edge */
  [data-page="plan"] .pcard:active { background: transparent !important; }
  [data-page="plan"] .pcard:active .pcard-in::before { content: ""; position: absolute; inset: 0 -8px; z-index: -1; border-radius: 14px; background: rgba(255, 255, 255, .1); pointer-events: none; }
  [data-page="plan"] .card-pages { margin-left: -8px !important; margin-right: -8px !important; padding-left: 8px !important; padding-right: 8px !important; } /* room for that highlight */
  [data-page="plan"] .pcard-in { position: relative; display: grid !important; grid-template-columns: 1fr auto !important; grid-template-rows: 20px 16px !important; grid-template-areas: none !important; height: 100% !important; align-content: center !important; align-items: center; row-gap: 0 !important; column-gap: 12px; padding: 0 2px 0 48px !important; overflow: visible !important; box-sizing: border-box; }
  [data-page="plan"] .pcard .item-ic, [data-page="plan"] .pcard .pcard-acts, [data-page="plan"] .pcard .pcard-vs, [data-page="plan"] .pcard .pcard-logged, [data-page="plan"] .pcard .pring, [data-page="plan"] .pcard .pcard-note, [data-page="plan"] .pcard .pcard-extra, [data-page="plan"] .pcard .pcard-money > *:not(.pcard-amount), [data-page="plan"] .pcard .pcard-chips .chip:not([data-k="paidWith"]) { display: none !important; }
  [data-page="plan"] .pcard .pcard-top { display: block !important; grid-area: 1 / 1 / 2 / 2 !important; padding-right: 0 !important; margin: 0 !important; min-height: 0; align-self: stretch; }
  [data-page="plan"] .pcard .pcard-head { display: block !important; height: auto !important; min-height: 0 !important; margin: 0 !important; text-align: left; align-self: end; }
  [data-page="plan"] .pcard .pcard-name { font-size: 15px !important; line-height: 20px !important; }
  [data-page="plan"] .pcard .pcard-chips { display: block !important; grid-area: 2 / 1 / 3 / 2 !important; margin: 0 !important; padding: 0 !important; align-self: start; }
  [data-page="plan"] .pcard .pcard-chips .chip { padding: 0 !important; background: none !important; border: 0 !important; font-size: 12px !important; line-height: 16px !important; display: block !important; margin: 0 !important; }
  [data-page="plan"] .pcard .pcard-money { display: block !important; grid-area: 1 / 2 / 3 / 3 !important; position: static !important; margin: 0 !important; width: auto !important; align-self: stretch; }
  [data-page="plan"] .pcard .pcard-amount { position: absolute !important; right: 30px !important; top: 50% !important; transform: translateY(-50%) !important; margin: 0 !important; font-size: 17px !important; line-height: 1.1 !important; }
  [data-page="plan"] .pcard .pcard-rings { grid-area: auto !important; position: absolute !important; top: 50% !important; left: 2px !important; right: auto !important; transform: translateY(-50%); margin: 0 !important; padding: 0 !important; width: auto !important; display: block !important; }
  [data-page="plan"] .pcard .pcard-due.dc { width: 34px !important; height: auto !important; background: none !important; box-shadow: none !important; animation: none !important; border: 0 !important; outline: 0 !important; display: flex; flex-direction: column; align-items: center; }
  [data-page="plan"] .pcard .pcard-due.dc::before, [data-page="plan"] .pcard .pcard-due.dc::after { display: none !important; }
  [data-page="plan"] .pcard .pcard-due.dc i, [data-page="plan"] .pcard .pcard-due.dc b { color: var(--text) !important; background: none !important; }
  [data-page="plan"] .pcard .pcard-due.dc i { font-size: 10px !important; line-height: 12px !important; }
  [data-page="plan"] .pcard .pcard-due.dc b { font-size: 17px !important; line-height: 19px !important; }
  [data-page="plan"] .pcard .pcard-due.dc.late i, [data-page="plan"] .pcard .pcard-due.dc.late b { color: var(--text) !important; } /* a late date stays white: the amount's red underline says it (7 Nov 2026, the user) */
  [data-page="plan"] .pcard .pcard-due.dc.paid i, [data-page="plan"] .pcard .pcard-due.dc.paid b { color: var(--text) !important; } /* a paid row stays white; only its amount is struck through (7 Nov 2026, the user) */
  [data-page="plan"] .pcard.paid .pcard-amount, [data-page="plan"] .pcard.bill-paid .pcard-amount:not(.over), [data-page="plan"] .pcard.paid[data-src] .pcard-amount { color: var(--text) !important; }
  /* a paid row's amount is struck through by hand in lime, as a ledger strikes a figure that is no longer due (a test, 7 Nov 2026, the user): a wobbling pen line across the amount only, a slightly different one on every other row */
  [data-page="plan"] .pcard.paid:not([data-src]) .pcard-amount::after { content: ""; position: absolute; left: -6px; right: -6px; top: 50%; height: 12px; margin-top: -6px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M1 7.4 C 14 5.6, 26 8.8, 46 6.9 S 84 8.2, 106 6.1 S 148 8.4, 170 6.5 S 194 7.2, 199 5.9' fill='none' stroke='%23c6f432' stroke-width='1.8' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat; transform: rotate(-1.2deg); pointer-events: none; }
  [data-page="plan"] .card-page .pcard.paid:not([data-src]):nth-of-type(even) .pcard-amount::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 5.8 C 22 7.6, 38 5.2, 62 6.8 S 104 5.4, 128 7.2 S 170 5.6, 192 7.1 L 199 6.7' fill='none' stroke='%23c6f432' stroke-width='1.7' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); transform: rotate(1deg); }
  [data-page="plan"] .card-page .pcard.paid:not([data-src]):nth-of-type(3n) .pcard-amount::after { transform: rotate(-.5deg) translateY(1px); }
  /* a received income row is ticked off by hand, in lime, just left of its amount (a test, 7 Nov 2026, the user: *a tick, the same pen as the strike*); an expense is struck, an income is ticked */
  [data-page="plan"] .pcard.paid[data-src] .pcard-amount::before { content: ""; position: absolute; left: -26px; top: 50%; width: 20px; height: 17px; margin-top: -9px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath d='M2.2 10.6 C 4.6 12.4, 6.8 14.6, 9.2 17.6 C 11.6 12.2, 16 6, 22.4 2.4' fill='none' stroke='%23c6f432' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; transform: rotate(-4deg); pointer-events: none; }
  [data-page="plan"] .card-page .pcard.paid[data-src]:nth-of-type(even) .pcard-amount::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath d='M1.8 11.8 C 4 11.4, 7 14.2, 8.8 17.2 C 11 13, 15.4 5.4, 22.8 3.2' fill='none' stroke='%23c6f432' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); transform: rotate(3deg); }
  /* a late row's amount is underlined by hand in the late red (a test, 7 Nov 2026, the user: *an underline in the colour chosen for it*): paid is struck, received is ticked, late is underlined — the same pen */
  [data-page="plan"] .pcard:has(.pcard-due.dc.late) .pcard-amount::after { content: ""; position: absolute; left: -4px; right: -4px; bottom: -7px; height: 10px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 10' preserveAspectRatio='none'%3E%3Cpath d='M1 5.6 C 20 3.8, 40 6.8, 66 5 S 112 6.6, 140 4.6 S 184 6.2, 199 4.4' fill='none' stroke='%23ff7a70' stroke-width='1.8' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat; transform: rotate(-.8deg); pointer-events: none; }
  [data-page="plan"] .card-page .pcard:has(.pcard-due.dc.late):nth-of-type(even) .pcard-amount::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 10' preserveAspectRatio='none'%3E%3Cpath d='M2 4.4 C 28 6.2, 52 3.8, 84 5.6 S 128 4, 156 5.8 S 188 4.8, 198 5.4' fill='none' stroke='%23ff7a70' stroke-width='1.7' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); transform: rotate(.7deg); }
  [data-page="plan"] .pcard-in::after { content: ""; position: absolute; right: 0; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); background: var(--text-2); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 11v5.5'/%3E%3Ccircle cx='12' cy='7.8' r='1.2' fill='black' stroke='none'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 11v5.5'/%3E%3Ccircle cx='12' cy='7.8' r='1.2' fill='black' stroke='none'/%3E%3C/svg%3E") center / contain no-repeat; }

  /* ---- the sheet: three tabs ---- */
  .card-single:has(.scard[data-pv]) { top: auto !important; bottom: 0 !important; height: auto !important; max-height: none !important; }
  .scard.v2[data-pv] { height: auto !important; max-height: calc(100dvh - 60px) !important; overflow: auto !important; padding-bottom: 92px !important; box-sizing: border-box; scrollbar-width: none; }
  .scard[data-pv] .pv-recv { display: none !important; }
  .scard[data-pv] .pv-tabs { display: grid; grid-template-columns: repeat(3, 1fr); height: 44px; margin: 0 0 12px; border-radius: 22px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); flex: none; }
  .pv-tabs button { background: none; border: 0; padding: 0; color: var(--text-2); font: 650 15px var(--font); }
  .pv-tabs button + button { box-shadow: inset 1px 0 0 rgba(255, 255, 255, .14); }
  .pv-tabs button[aria-selected="true"] { background: rgba(255, 255, 255, .12); color: var(--text); }
  .scard[data-pv-tab="overview"] [data-pv-panel]:not([data-pv-panel="overview"]),
  .scard[data-pv-tab="logs"] [data-pv-panel]:not([data-pv-panel="logs"]),
  .scard[data-pv-tab="settings"] [data-pv-panel]:not([data-pv-panel="settings"]) { display: none; }
  .pv-top { text-align: center; }
  .pv-amt { display: block; font: 700 30px/34px var(--font); color: var(--text); letter-spacing: -.01em; }
  .pv-amt .cur { font-size: 12px; color: var(--text-2); margin-left: 6px; letter-spacing: .04em; font-weight: 650; }
  .pv-conv { display: flex; justify-content: center; align-items: center; gap: 5px; margin-top: 2px; font: 600 16px/20px var(--font); color: var(--text-3); }
  .pv-conv .cur { font-size: 11px; letter-spacing: .04em; margin-left: 3px; }
  .pv-rate { font: 550 13px var(--font); color: var(--text-3); }
  .pv-edit { display: inline-grid; place-items: center; width: 16px; height: 20px; margin-left: -1px; padding: 0; background: none; border: 0; color: var(--text-2); }
  .pv-rate-in { width: 64px; height: 28px; border-radius: 10px; padding: 0 6px; font: 600 14px var(--font); text-align: center; color: var(--text); }
  .pv-sub { margin-top: 2px; font: 550 14px/20px var(--font); color: var(--text-2); }
  .pv-sub b { font-weight: 650; }
  .pv-sub b.late { color: var(--bad-text); }
  .pv-sub b.ok { color: var(--good); }
  .pv-link { background: none; border: 0; padding: 0; color: var(--good); font: 650 14px/18px var(--font); }
  .pv-reset { display: block; margin: 6px auto 0; }
  .pv-pay { display: flex; align-items: center; justify-content: center; width: 100%; height: 44px; margin-top: 14px; border: 0; border-radius: 22px; background: rgba(255, 255, 255, .1); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14); color: var(--good); font: 650 15px var(--font); }
  .pv-pay.on { color: var(--text-2); }
  .pv-dent { display: block; height: 3px; margin: 12px 0 4px; background: linear-gradient(rgba(0, 0, 0, .42) 0 2px, rgba(255, 255, 255, .11) 2px 3px); }
  .pv-h { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 2px 2px; font: 650 15px/20px var(--font); color: var(--text); }
  .pv-h2 { margin-top: 4px; }
  .pv-none { margin: 24px 2px; color: var(--text-2); font: 550 15px var(--font); }
  .pv-log { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; height: 58px; padding: 0 2px; font: 650 16px var(--font); color: var(--text); }
  .pv-log + .pv-log { box-shadow: inset 0 2px 0 rgba(0, 0, 0, .42), inset 0 3px 0 rgba(255, 255, 255, .11); }
  .pv-d { display: flex; flex-direction: column; align-items: center; justify-self: start; width: fit-content; color: var(--text); }
  .pv-d i { font: 700 10px/12px var(--font); font-style: normal; letter-spacing: .08em; text-transform: uppercase; }
  .pv-d b { font: 700 17px/19px var(--font); }
  .pv-log em { font: 600 15px var(--font); font-style: normal; color: var(--text); }
  .pv-log em.late { color: var(--bad-text); }
  .pv-log .pv-fig { text-align: right; color: var(--text); }
  .pv-log .cur { font-size: 10px; color: var(--text-2); margin-left: 3px; letter-spacing: .04em; }
  .pv-orig { display: block; margin-top: 1px; font: 550 12px/14px var(--font); color: var(--text-3); }
  .pv-rings { display: flex; justify-content: space-around; padding: 2px 0 10px; }
  .pv-rw { display: flex; flex-direction: column; align-items: center; gap: 4px; }
  .pv-rw small { font: 600 11px/14px var(--font); color: var(--text-2); white-space: nowrap; }
  .pv-group { border-radius: 22px; overflow: hidden; padding: 0 4px; margin-bottom: 12px; --glass: rgba(10, 10, 12, .18); --blur: blur(12px) saturate(180%); }
  .pv-row { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 52px; padding: 0 14px !important; margin: 0 !important; position: relative; font-size: 17px; color: var(--text); background: none !important; border: 0 !important; box-sizing: border-box; }
  .pv-row + .pv-row::before { content: ""; position: absolute; left: 14px; right: 0; top: 0; height: 1px; background: rgba(255, 255, 255, .12); }
  .pv-row > span:first-child, .pv-row > .lab { flex: 1; min-width: 0; color: var(--text); font-size: 17px; font-weight: 400; }
  .pv-row select.ctl, .pv-row input.ctl, .pv-row select { background-color: transparent !important; border: 0 !important; box-shadow: none !important; outline: 0; color: var(--text) !important; font: inherit; font-size: 17px !important; text-align: right; max-width: 58%; -webkit-appearance: none; appearance: none; padding: 0 22px 0 0 !important; height: auto !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 9l4-4 4 4M8 15l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right center; background-size: 16px; }
  .pv-row input.ctl { background-image: none; padding-right: 0 !important; }
  .pv-row .sheet-amount-in { display: inline-flex; align-items: baseline; gap: 6px; margin: 0; }
  .pv-row .sheet-amount-in input { width: 9ch !important; font-size: 17px !important; text-align: right; }
  .pv-row .sheet-amount-in .cur { font-size: 12px; letter-spacing: .08em; color: var(--text-3); }
  .pv-row select.cat-select, .pv-row .cat-select { position: static !important; width: auto !important; min-width: 0; margin: 0 !important; flex: none; text-align-last: right; }
  .pv-row .sheet-amount-in .cur { position: static !important; }
  .pv-row .sheet-amount-in input { width: 7ch !important; }
  .pv-row > .seg-chip { background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 9l4-4 4 4M8 15l4 4 4-4'/%3E%3C/svg%3E") no-repeat right center / 16px !important; border: 0 !important; box-shadow: none !important; font: inherit; font-size: 17px; color: var(--text); padding: 0 22px 0 0; }
  .pv-row .cat-select, .pv-row select.cat-select { background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 9l4-4 4 4M8 15l4 4 4-4'/%3E%3C/svg%3E") no-repeat right center / 16px !important; padding: 0 22px 0 0 !important; }
  .pv-set .need-note, .pv-set .note, .pv-set > p { margin: 0 18px 12px; font-size: 13px; line-height: 1.4; color: var(--text-3); }
  [data-page="plan"] .cat-bar { margin-top: 6px; }
  .pv-rings { padding: 2px 0 22px; }
  .pv-row { height: 52px !important; }
  .pv-row .sheet-amount-in { margin-left: auto; width: auto !important; min-width: 0 !important; flex: none; padding-right: 22px; justify-content: flex-end; }
  .pv-row .sheet-amount-in input { width: var(--aw, 6ch) !important; flex: none; }
  /* the Expense Type question and the new-item wizard: glass, and no lime where a step is glass */
  .scard.v2 .dots i { background: rgba(255, 255, 255, .14) !important; }
  .scard.v2 .dots i.on { background: rgba(255, 255, 255, .6) !important; }
  .scard.v2 .type-card, .scard.v2 .type-row { background: rgba(10, 10, 12, .18) !important; -webkit-backdrop-filter: blur(12px) saturate(180%); backdrop-filter: blur(12px) saturate(180%); border: 1px solid rgba(255, 255, 255, .2) !important; }
  .scard.v2 .type-card:hover, .scard.v2 .type-card[aria-pressed="true"], .scard.v2 .type-row:hover, .scard.v2 .type-row[aria-pressed="true"] { background: rgba(255, 255, 255, .12) !important; border-color: rgba(255, 255, 255, .6) !important; }
  .scard.v2 .type-ic { color: var(--text) !important; background: none !important; border-color: rgba(255, 255, 255, .35) !important; }
  .scard.wizard .wbtn { background: rgba(255, 255, 255, .1) !important; border-color: rgba(255, 255, 255, .16) !important; color: var(--text) !important; }
  .scard.wizard .wbtn.p { color: var(--good) !important; }
  .scard.wizard .wbtn.p:disabled { color: rgba(255, 255, 255, .45) !important; }
}
html[data-private="on"] :is(.pv-fig, .pv-orig, .pv-conv, .pv-sub, .pv-rate-in) { filter: blur(max(7px, .4em)); user-select: none; }

/* ==== The All page on a phone, the way a category's page looks (7 Nov 2026, the user): plain rows on the backdrop,
   dented lines between them, an arrow at the right that opens the category's items inline ==== */
@media (max-width: 699px) {
  .cats-page { gap: 0; }
  .cats-sum { padding-bottom: 8px; }
  .cats-page, .cats-list { overflow-x: hidden; overscroll-behavior-x: none; touch-action: pan-y; }
  .cats-list { gap: 0; padding: 0 0 6px; }
  .cats-item + .cats-item { box-shadow: inset 0 2px 0 rgba(0, 0, 0, .42), inset 0 3px 0 rgba(255, 255, 255, .11); }
  .cats-row { position: relative; display: block; min-height: 0; height: 46px; padding: 0 0 0 48px; border: 0; border-radius: 0; background: none; box-shadow: none; -webkit-tap-highlight-color: transparent; }
  .cats-row:active { background: rgba(255, 255, 255, .1); border-radius: 14px; }
  .cats-ic { position: absolute; left: 2px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; background: none; border-radius: 0; color: var(--text-2); }
  .cats-ic .icon { width: 22px; height: 22px; }
  .cats-name { position: absolute; left: 48px; top: 50%; transform: translateY(-50%); font-size: 15px; line-height: 20px; font-weight: 650; }
  .cats-row .cats-amt { position: absolute; right: 38px; top: 50%; transform: translateY(-50%); font-size: 17px; line-height: 1.1; font-weight: 700; }
  .cats-go { position: absolute; right: -8px; top: 50%; width: 44px; height: 44px; margin-top: -22px; padding: 0; border: 0; background: none; color: var(--text-2); display: grid; place-items: center; cursor: pointer; border-radius: 14px; }
  .cats-go .icon { width: 20px; height: 20px; transition: transform .2s ease; }
  .cats-item.open .cats-go .icon { transform: rotate(180deg); }
  .cats-sub { padding: 0 38px 6px 48px; } /* the amounts end where the category's amount ends */
  .cats-it { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 30px; padding: 5px 0; box-sizing: border-box; font-size: 13px; line-height: 18px; color: var(--text-2); }
  .cats-cap { padding: 2px 0 2px; color: var(--text-3); font-size: 11px; line-height: 14px; font-weight: 700; letter-spacing: .04em; }
  .cats-it.none { display: block; color: var(--text-3); }
  .cats-in { min-width: 0; overflow-wrap: anywhere; }
  .cats-iv { color: var(--text); font-weight: 600; text-align: right; }
  .cats-iv small { margin-left: 3px; color: var(--text-3); font-size: 10px; font-weight: 600; }
  .cats-ip, .cats-cp { color: var(--text-3); white-space: nowrap; font-weight: 500; font-size: 13px; }
}
html[data-private="on"] .cats-iv, html[data-private="on"] .cats-ip, html[data-private="on"] .cats-cp { filter: blur(7px); }

/* A tick that is a letter-sized mark (a chip's ✓ Paid, the PIN pad's Enter): hand-drawn, in the text's colour (7 Nov 2026, the user: *replace the tick across the app with a hand-drawn one*) */
.hd-tick { display: inline-block; width: 1.05em; height: .9em; margin-right: .3em; vertical-align: -.1em; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath d='M2.2 10.8 C 4.6 12.4, 6.8 14.6, 9.2 17.6 C 11.6 12.2, 16 6, 22.4 2.4' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath d='M2.2 10.8 C 4.6 12.4, 6.8 14.6, 9.2 17.6 C 11.6 12.2, 16 6, 22.4 2.4' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.pin-key .hd-tick { margin: 0; width: 1.3em; height: 1.1em; vertical-align: middle; }

/* ==== The Log page's header on a phone (7 Nov 2026, the user's pick, option C): no At a Glance and no Logs title; the month picker
   with its arrows at the left of the row, search and filter at the right; searching takes the whole row ==== */
@media (max-width: 699px) {
  .log-glance-head, .log-totals-g, .log-logs-title { display: none; }
  .log-page { margin-top: 0; }
  .log-mount { margin-top: -14px; } /* the first row starts where the Plan page's first row does (top 71 px) */
  .log-head { padding-top: 0; }
  .log-logs-row { margin: 0 0 6px; min-height: 36px; }
  .log-nav { display: flex; align-items: center; gap: 8px; }
  .log-nav .picker-step:not([hidden]) { display: grid; }
  .log-nav .picker-btn { height: 36px; }
  .log-logs-row.searching .log-nav { display: none; }
}

/* ==== The Plan bar on a phone (7 Nov 2026, the user's design): one dropdown pill for the category, search and filter at the right;
   menus separate their SECTIONS with a dented line, never their options; a section's title (Home's header style) is never the same
   as the active option (a tick after its name) ==== */
@media (max-width: 699px) {
  .plan-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 6px; } /* the same 71 px from the top as the Log's first row */
  .plan-dd { height: 36px; padding: 0 12px; border: 0; border-radius: 999px; display: flex; align-items: center; gap: 8px; color: var(--text); font: 600 13px var(--font); cursor: pointer; } /* the Log's date pill's size and glass */
  .plan-dd .icon { flex: none; }
  .plan-dd-amt { color: var(--text-2); font-weight: 600; }
  /* the round arrows beside the category pill (8 Nov 2026): the Log's round buttons; the pill takes the room between and centres its name */
  .plan-bar .plan-step { flex: none; width: 36px; height: 36px; }
  .plan-bar .plan-dd { flex: 1 1 auto; min-width: 0; justify-content: center; }
  .plan-bar .plan-tools { flex: none; }
  .plan-bar.searching .plan-step { display: none; }
  .plan-dd-amt small { margin-left: 3px; font-size: 10px; }
  .plan-tools { display: flex; align-items: center; gap: 10px; }
  .plan-sx .log-ib { background: transparent; }
  .plan-bar.searching .plan-dd, .plan-bar.searching .log-fwrap { display: none; }
  .plan-bar.searching .plan-tools { flex: 1; }
  .plan-bar.searching .log-sx { flex: 1 1 auto !important; width: auto !important; }
  .plan-bar.searching .log-sin { flex: 1 1 auto; width: auto; padding: 0 4px 0 18px; opacity: 1; }
  /* an amount marked as later in the statement: a small clock before the figure, the figure and its EGP close together like every other amount (the 7 px flex gap pushed EGP away and the 22 px clock crowded the figure) */
  [data-page="plan"] .pcard .pcard-amount.cc-late { display: block !important; gap: 0; }
  [data-page="plan"] .pcard .pcard-amount.cc-late .cc-mark { display: inline-block; width: 15px; height: 15px; margin: 0 6px 0 0; vertical-align: -2px; }
  /* a row with no due date: its category's icon, bare and 26 px, where the date would be */
  [data-page="plan"] .pcard .pcard-due.dc.nodue { width: 34px !important; }
  [data-page="plan"] .pcard .pcard-due.dc.nodue b { display: grid !important; place-items: center; width: 34px; height: 34px; color: var(--text-2) !important; }
  [data-page="plan"] .pcard .pcard-due.dc.nodue b .icon, [data-page="plan"] .pcard .pcard-due.dc.nodue b svg, [data-page="plan"] .pcard .pcard-due.dc.nodue b img { width: 26px; height: 26px; }
  /* a test (7 Nov 2026, the user): the dates in the same grey as the no-date icons */
  [data-page="plan"] .pcard .pcard-due.dc:is(.ok, .late, .paid, .nodue) :is(i, b) { color: var(--text-2) !important; }
  /* a pressed row's highlight reaches the dented line's ends: the old press-and-hold shrink (scale .98) is gone from the phone list */
  [data-page="plan"] .pcard.holding, [data-page="plan"] .pcard:active { transform: none !important; }
  .plan-gh { display: flex; justify-content: space-between; align-items: baseline; margin: 24px 2px 0; padding: 0; min-height: 0; height: auto; line-height: 24px; font: 750 20px var(--font); letter-spacing: -0.2px; color: var(--text); }
  .plan-gh span:last-child { font: 500 15px var(--font); letter-spacing: 0; color: var(--text-2); }
  .plan-none { padding: 24px 4px; color: var(--text-2); font: 500 15px var(--font); }
  .all-items .card-page { display: block; height: auto; }
  .plan-menu { left: 16px; right: 16px; width: auto; max-height: none; padding: 6px 16px; }
  .pm-sec + .pm-sec { margin-top: 6px; padding-top: 6px; box-shadow: inset 0 2px 0 rgba(0, 0, 0, .4), inset 0 3px 0 rgba(255, 255, 255, .11); }
  .pm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 6px; }
  .pm-opt, .pm-row { display: flex; align-items: center; gap: 12px; height: 44px; width: auto; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; color: var(--text-2); font: 500 15px var(--font); text-align: left; cursor: pointer; }
  .pm-row { justify-content: space-between; width: 100%; }
  .pm-opt.on, .pm-row.on { color: var(--text); }
  .pm-opt .hd-tick, .pm-row .hd-tick { margin: 0 0 0 2px; color: var(--text); }
  .plan-menu { padding: 10px; }
  .tk-menu.plan-menu button.pm-pill, .tk-menu.plan-menu button.pm-sel, .tk-menu.plan-menu button.pm-tile { margin: 0; border: 0; background: transparent; color: var(--text); font: 400 16px var(--font); text-align: left; white-space: nowrap; cursor: pointer; }
  .tk-menu.plan-menu button.pm-pill { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; min-height: 0; padding: 0 12px; border-radius: 20px; }
  .tk-menu.plan-menu button.pm-pill.on, .tk-menu.plan-menu button.pm-tile.on { background: rgba(255, 255, 255, .16); }
  .pm-ic { display: grid; place-items: center; width: 22px; flex: none; }
  .tk-menu.plan-menu button.pm-sel { display: flex; align-items: center; width: 100%; height: 36px; min-height: 0; padding: 0; font-size: 17px; }
  .pm-tk { display: grid; place-items: center; width: 30px; flex: none; }
  .pm-tk .hd-tick { margin: 0; }
  .pm-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
  .tk-menu.plan-menu button.pm-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; height: auto; min-height: 0; padding: 12px 4px; border-radius: 20px; font-size: 15px; text-align: center; }
  .plan-menu .pm-title { margin: 8px 0 2px; padding-left: 2px; }
  .pm-title { margin: 8px 0 2px; padding-left: 10px; font: 750 17px var(--font); letter-spacing: -0.2px; color: var(--text); }
  .plan-sheet-ov { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .28); }
  .plan-sheet { position: fixed; left: 0; right: 0; bottom: 0; padding: 18px 16px calc(28px + env(safe-area-inset-bottom, 0px)); border-radius: 28px 28px 0 0; background: rgba(14, 12, 14, .5); -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
  .plan-sheet-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
  .plan-sheet-h h2 { margin: 0; font: 750 22px var(--font); letter-spacing: -0.2px; color: var(--text); }
  .plan-sheet .pm-grid { column-gap: 20px; row-gap: 0; }
  .plan-sheet .pm-opt.done { pointer-events: none; color: var(--text-3); }
}
html[data-private="on"] .plan-dd-amt { filter: blur(7px); }

/* ==== The Log's filters as a bottom sheet on a phone (7 Nov 2026, the user; it replaces the inline pane there): a row for each group
   with its value at the right (All; Amount: Any) and a chevron, opening inline; dented lines between the groups ==== */
@media (max-width: 699px) {
  .ls-sheet { max-height: 82vh; overflow-y: auto; }
  .ls-sheet button.ls-head { display: flex; align-items: center; gap: 8px; width: 100%; height: 46px; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; color: var(--text); font: 400 17px var(--font); text-align: left; cursor: pointer; }
  .ls-head > span:first-child { flex: 1; }
  .ls-val { color: var(--text-2); font: 400 15px var(--font); text-align: right; }
  .ls-chev { display: grid; place-items: center; width: 22px; color: var(--text-2); transition: transform .2s ease; }
  .ls-row.open .ls-chev { transform: rotate(180deg); }
  .ls-row + .ls-row { box-shadow: inset 0 2px 0 rgba(0, 0, 0, .4), inset 0 3px 0 rgba(255, 255, 255, .11); }
  .ls-body { display: none; }
  .ls-row.open .ls-body { display: block; }
  .ls-pills { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2px 6px; padding: 2px 0 10px; }
  .ls-pills.one { grid-template-columns: minmax(0, 1fr); max-height: 260px; overflow-y: auto; }
  .ls-sheet button.ls-pill { display: flex; align-items: center; width: 100%; min-height: 40px; height: auto; margin: 0; padding: 8px 14px; border: 0; border-radius: 20px; background: transparent; color: var(--text); font: 400 16px/1.25 var(--font); text-align: left; cursor: pointer; }
  .ls-sheet button.ls-pill[aria-pressed="true"] { background: rgba(255, 255, 255, .16); }
  .ls-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding: 2px 0 12px; }
  .ls-field { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px; border-radius: 22px; background: rgba(0, 0, 0, .28); color: var(--text-2); font: 500 13px var(--font); text-transform: uppercase; letter-spacing: .08em; }
  .ls-field input { flex: 1; width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: none; color: var(--text); font: 500 17px var(--font); text-transform: none; letter-spacing: 0; }
  .ls-field input::placeholder { color: var(--text-3); }
  .ls-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; padding-top: 12px; box-shadow: inset 0 2px 0 rgba(0, 0, 0, .4), inset 0 3px 0 rgba(255, 255, 255, .11); }
  .ls-res { color: var(--text-2); font: 400 15px var(--font); }
  .ls-sheet button.ls-clear { height: 36px; margin: 0; padding: 0 18px; border: 0; border-radius: 18px; background: rgba(255, 255, 255, .12); color: var(--text); font: 500 15px var(--font); cursor: pointer; }
}

/* ==== Income's category bar on a phone (7 Nov 2026, the user): at the same height as the other tabs' top bar (71 px from the top) and in the
   same frosted glass: the pills like the Log's date pill, the + like the search and filter buttons ==== */
@media (max-width: 699px) {
  [data-page="plan"] .inc-bar { margin-top: 0; } /* the pills then start 71 px from the top, as the Plan bar and the Log row do */
  .inc-bar .cat-pills button.picker-btn { height: 36px; padding: 0 12px; border: 0; font: 600 13px var(--font); background: transparent !important; }
  .inc-bar .cat-pill-add { width: 36px; height: 36px; margin: 0; background: transparent !important; }
}

/* Loading wireframes, phone Log and Plan (8 Nov 2026): the pages as they are now — a bar with the date or category pill and the round search and filter,
   the Log's day strip and day headers, the Plan's flat rows and the totals bar; in grey blocks, no words */
@media (max-width: 700px) {
  .bk-bar2 { justify-content: space-between; gap: 8px; }
  .bk-dayh { margin-top: 8px; padding: 0 2px; }
  .bk-plist { display: flex; flex-direction: column; margin-top: 4px; }
  .bk-prow { display: flex; align-items: center; gap: 14px; height: 56px; }
  .bk-prow + .bk-prow { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07); }
  .bk-pd { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 32px; }
  .bk-ptx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
  .bk-tot { position: fixed; left: 16px; right: 16px; bottom: 86px; height: 58px; flex-direction: row; justify-content: space-around; align-items: center; padding: 0 20px; border-radius: 999px; z-index: 1; }
  .bk-tot > span { display: flex; flex-direction: column; align-items: center; gap: 7px; width: 40%; }
  html[data-boot="log"] .topbar .picker-btn, html[data-boot="log"] .topbar .picker-step { display: none; }
}

/* ==== Track's phone bar like the Log's and Plan's (9 Nov 2026, option B): [<] [the open tracker's pill, centred, fills the row] [>] [edit] [add],
   all 36 px, 70 px from the top; the arrows step through the pill's menu in order and wrap ==== */
.tk-step { display: none; }
@media (max-width: 699px) {
  .pills-host:has(.tabs[data-pills="sections:tracker"]:not([hidden])) { flex-wrap: nowrap; gap: 10px; margin: 7px 0 -7px; }
  .pills-host:has(.tabs[data-pills="sections:tracker"]:not([hidden])) > .row-right { gap: 10px; margin-left: auto; }
  .tabs[data-pills="sections:tracker"] { flex: none; gap: 8px; }
  .tabs[data-pills="sections:tracker"] .tk-step { display: grid; flex: none; order: -1; cursor: pointer; }
  .tabs[data-pills="sections:tracker"] .tk-step[data-tk-step="1"] { order: 99; }
  .pills-host .tabs[data-pills="sections:tracker"] button[aria-selected="true"] { flex: none; width: 150px; min-width: max-content; height: 36px; --pill-h: 36px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px; font: 600 13px var(--font); background: var(--glass) !important; -webkit-backdrop-filter: var(--blur) !important; backdrop-filter: var(--blur) !important; box-shadow: none !important; }
  .pills-host .tabs[data-pills="sections:tracker"] button.glass[aria-selected="true"]::after { background: linear-gradient(180deg, rgba(255, 255, 255, .24) 0%, rgba(255, 255, 255, .1) 45%, rgba(255, 255, 255, .1) 70%, rgba(255, 255, 255, .16) 100%) !important; }
}

/* ==== 9 Nov 2026 (the user): the item sheet's Amount row runs to the right edge (no gap kept for an arrow it hasn't got); dented lines are 3 px (a 2 px dark groove over a 1 px light edge) everywhere ==== */
@media (max-width: 699px) {
  .pv-row .sheet-amount-in { padding-right: 0 !important; }
}

/* ==== A line with no amount this month that isn't monthly (a Yearly or Quarterly one, 9 Nov 2026, the user): dimmed, its date the next month it has an amount ==== */
@media (max-width: 699px) {
  .pcard.off-month { opacity: .45; }
}


/* Full-screen table (desktop Plan table): only the table, no controls; Esc leaves it */
html.table-fs .dock,
html.table-fs .section > :not(.cards),
html.table-fs .cards.split > :not(.card) { display: none !important; }
html.table-fs .section > .cards.fill { position: fixed; inset: 12px; z-index: 50; margin: 0; }
html.table-fs .section > .cards.fill > .card { height: 100%; }
/* Full screen shows more: snugger rows */
html.table-fs .grid-table td { padding-top: 5px; padding-bottom: 5px; }
html.table-fs .grid-table tr.cat td { padding-top: 7px; padding-bottom: 7px; }
html.table-fs .grid-table th { padding-top: 8px; padding-bottom: 8px; }

/* The few controls it keeps: a frosted-glass bar that rises from the bottom edge when the mouse goes there. Its grip moves it;
   the pin keeps it where it is; dragged to the left or right edge it turns upright. It takes no space. */
html.table-fs .topbar { position: fixed; z-index: 60; width: max-content; height: auto; display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  left: 50%; right: auto; top: auto; bottom: 0; border-radius: 28px 28px 0 0;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .16); border-bottom: 0;
  -webkit-backdrop-filter: blur(22px) saturate(180%) brightness(1.1); backdrop-filter: blur(22px) saturate(180%) brightness(1.1);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .18), 0 10px 30px rgba(0, 0, 0, .25);
  transform: translate(-50%, calc(100% - 12px)); opacity: 0; transition: transform .22s ease, opacity .22s ease; }
html.table-fs .topbar:hover { transform: translate(-50%, 0); opacity: 1; }
html.table-fs .topbar.fsb-pinned { top: var(--fy); left: var(--fx); bottom: auto; border-radius: 28px; border-bottom: 1px solid rgba(255, 255, 255, .16); transform: none; opacity: 1; transition: none; }
html.table-fs .topbar.fsb-pinned.fsb-v { flex-direction: column; padding: 12px 8px; }
html.table-fs .topbar .edge-blur, html.table-fs .topbar .title-group, html.table-fs .pills-host > :not(.row-right),
html.table-fs .row-right > :not(.section-actions), html.table-fs .section-actions > :not([data-action="table-rules"]),
html.table-fs #private-btn, html.table-fs #profile-btn { display: none !important; }
html.table-fs .pills-host, html.table-fs .row-right, html.table-fs .section-actions, html.table-fs .top-actions, html.table-fs .top-tools { display: contents; }
html.table-fs .topbar .fsb-grip { order: 0; } html.table-fs .topbar .section-actions { order: 1; } html.table-fs .topbar .top-actions { order: 2; } html.table-fs .topbar .fsb-pin { order: 3; }
html.table-fs .topbar .top-actions > *, html.table-fs .topbar .top-tools > *, html.table-fs .topbar .section-actions > * { order: 1; }
html.table-fs .topbar .top-tools > *, html.table-fs .topbar .top-actions > * { order: 2; }
html.table-fs .topbar.fsb-v { gap: 8px; }
html:not(.table-fs) .fsb-grip, html:not(.table-fs) .fsb-pin { display: none; }
.fsb-grip { flex: none; width: 22px; height: 40px; border-radius: 11px; cursor: grab; touch-action: none; background:
  radial-gradient(circle, rgba(255,255,255,.55) 1.5px, transparent 2px) 50% 50% / 8px 8px; }
.fsb-grip:active { cursor: grabbing; }
html.table-fs .topbar.fsb-v .fsb-grip { width: 40px; height: 22px; }
html.table-fs .topbar .top-actions .picker-btn { white-space: nowrap; }
/* Upright, the year is a round button like the rest: '26 */
html.table-fs .topbar.fsb-v .picker-btn { width: 44px; height: 44px; min-width: 0; padding: 0; border-radius: 50%; justify-content: center; gap: 0; }
html.table-fs .topbar.fsb-v .picker-btn .chev, html.table-fs .topbar.fsb-v #picker-label { display: none; }
html.table-fs .topbar.fsb-v .picker-btn .fsb-yr { display: block; font-size: 13px; font-weight: 650; }
.fsb-yr { display: none; }
html.table-fs .topbar.fsb-held:not(.fsb-pinned) { transform: translate(-50%, 0); opacity: 1; }
/* Upright bar: Discard and Save as 44 px round buttons (the size of Undo and Redo beside them), ✕ and a lime ✓ (21 Nov 2026) */
.fsb-ic { display: none; }
html.table-fs .topbar.fsb-v #top-tools .btn { width: 44px; height: 44px; min-width: 0; padding: 0; gap: 0; border-radius: 50%; font-size: 0; display: inline-flex; align-items: center; justify-content: center; }
html.table-fs .topbar.fsb-v #top-tools .btn .fsb-ic { display: flex; }
html.table-fs .topbar.fsb-v #top-tools .btn .fsb-ic .icon { width: 20px; height: 20px; }
html.table-fs .topbar.fsb-v #top-tools .btn-primary { background: var(--select); border-color: var(--select); color: var(--select-ink); }
/* Upright bar: every round button is 44 px, the size of Undo and Redo (the year arrows and the pin too) */
html.table-fs .topbar.fsb-v .picker-step, html.table-fs .topbar.fsb-v .fsb-pin { width: 44px; height: 44px; }

/* The Log, filtering (21 Nov 2026): a frosted-glass card over the list with how many match, the search and picks as chips, and their total —
   the frost of the dock and the full-screen bar, so it reads as a summary, not an entry; a day's heading and the filter footer give one total */
.log-sum { margin-bottom: 14px; }
.log-list .pcard.glass.log-sum-card, .log-list .pcard.glass.log-sum-card:hover, .pcard.glass.log-sum-card {
  cursor: default;
  background: rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(22px) saturate(180%) brightness(1.1);
  backdrop-filter: blur(22px) saturate(180%) brightness(1.1);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .18), inset 0 0 0 1px rgba(255, 255, 255, .14);
}
html[data-private="on"] :is(.ls-res, .lf-res) .day-fig { filter: blur(max(7px, 0.4em)); user-select: none; }

/* ==== The Log on a phone as rows (22 Nov 2026, the user, from the Log As Rows preview; docs 02 §7) ====
   Plain rows on the backdrop, as the Plan's: each day the Plan's heading (pinned under the day row while you scroll until the next
   day's pushes it away), its logs split by hairlines, days split by the dented line; under a day with two logs or more a recessed
   pill with what was spent (and received). A row: the item's icon, two lines that line up across it (name | amount, paid with |
   verdict), a third only for your note (handwritten) or a question, and the i. Wide screens keep the cards. */
@media (max-width: 699px) {
  [data-page="transactions"] .log-list:has(.lr-day) { display: block; gap: 0; }
  .lr-day { margin: 0 2px; padding-bottom: 4px; }
  .lr-day + .lr-day { box-shadow: inset 0 2px 0 rgba(0, 0, 0, .42), inset 0 3px 0 rgba(255, 255, 255, .11); padding-top: 10px; }
  .lr-gh { position: sticky; top: var(--lr-stick, 203px); z-index: 5; isolation: isolate; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 2px -4px; padding: 4px 0 6px; font: 750 20px/24px var(--font); letter-spacing: -0.2px; color: var(--text); }
  .lr-gh > span:first-child { white-space: nowrap; }
  .lr-gh > span:last-child { font: 500 15px var(--font); letter-spacing: 0; color: var(--text-2); white-space: nowrap; }
  .lr-gh::before { content: ""; position: absolute; inset: -6px -18px -8px; z-index: -1; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); -webkit-mask: linear-gradient(#000 calc(100% - 12px), transparent); mask: linear-gradient(#000 calc(100% - 12px), transparent); pointer-events: none; }
  .lr-day > .log-swipe { border-radius: 0; } /* square, so the hairline between rows stays straight */
  .lr-day > .log-swipe + .log-swipe { box-shadow: inset 0 1px 0 var(--line); }
  .lr-day .log-swipe-del, .lr-day .log-swipe-refund { border-radius: 14px; top: 3px; bottom: 3px; }
  .lr { position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 24px; grid-template-rows: 21px 17px; grid-auto-rows: auto; column-gap: 12px; align-content: center; min-height: 58px; padding: 9px 0; cursor: pointer; touch-action: pan-y; -webkit-user-select: none; user-select: none; outline: 0; }
  .lr:active::before, .lr:focus-visible::before { content: ""; position: absolute; inset: 0 -8px; z-index: -1; border-radius: 14px; background: rgba(255, 255, 255, .1); }
  .lr-ic { grid-column: 1; grid-row: 1 / 3; align-self: center; display: grid; place-items: center; width: 38px; height: 34px; color: var(--text-2); }
  /* the time it was paid, in the Plan date block's type: AM / PM in small capitals over the time */
  .lr-tm { display: flex; flex-direction: column; align-items: center; }
  .lr-tm i { font: 650 10px/12px var(--font); font-style: normal; letter-spacing: .08em; color: var(--text-2); }
  .lr-tm b { font: 650 14px/17px var(--font); color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; }
  .lr-ic .icon { width: 22px !important; height: 22px !important; }
  .lr-ic .up-ic { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; }
  .lr-i { grid-column: 4; grid-row: 1 / 3; align-self: center; justify-self: end; display: grid; place-items: center; width: 24px; height: 24px; color: var(--text-2); }
  .lr-i svg.icon { width: 24px !important; height: 24px !important; margin: 0 !important; }
  .lr.has-x .lr-i, .lr.has-x .lr-ic { grid-row: 1 / 4; }
  .lr-name { grid-column: 2; grid-row: 1; display: flex; align-items: center; gap: 7px; min-width: 0; max-width: 140px; font: 600 15px/21px var(--font); color: var(--text); white-space: nowrap; }
  .lr.odo .lr-name { color: #b49cf0; } /* the odometer's violet, its card tint until now */
  .lr-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
  .lr-pay { grid-column: 2; grid-row: 2; min-width: 0; font: 500 13px/17px var(--font); color: var(--text-2); white-space: nowrap; }
  .lr-amt { grid-column: 3; grid-row: 1; justify-self: end; position: relative; display: inline-flex; align-items: baseline; gap: 6px; margin-right: -6px; font: 650 20px/20px var(--font); color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
  .lr.solo .lr-amt { grid-row: 1 / 3; align-self: center; }
  .lr.solo.has-x .lr-amt { grid-row: 1 / 4; } /* level with the i, which centres on the note too */
  .lr-amt .cur { margin-left: -3px; font-size: 10px; line-height: 20px; font-weight: 650; letter-spacing: .04em; color: var(--text-3); }
  /* the verdict before the amount (22 Nov 2026): over a faded red arrow up, under a grey arrow down */
  .lr-v { align-self: center; width: 16px !important; height: 16px !important; flex: none; margin: 0 -4px 0 0 !important; }
  .lr-v.over { color: color-mix(in srgb, var(--bad-text) 62%, var(--text)); }
  .lr-v.under { color: var(--text-2); transform: rotate(180deg) !important; }
  .lr.later .lr-amt { color: var(--text-3); } /* a card charge that falls due in a later month */
  /* logged twice: a faded red alert snug before the name */
  .lr-dup { width: 15px !important; height: 15px !important; flex: none; margin: 0 -4px 0 0 !important; color: color-mix(in srgb, var(--bad-text) 62%, var(--text)); }
  .lr.inc .lr-amt, .lr.ref .lr-amt { color: var(--good-text); }
  .lr-say { grid-column: 3; grid-row: 2; justify-self: end; margin-right: -6px; display: inline-flex; align-items: center; gap: 4px; font: 500 13px/17px var(--font); color: var(--text-3); white-space: nowrap; }
  .lr-say.bad { color: color-mix(in srgb, var(--bad-text) 62%, var(--text)); }
  .lr-say.back { color: var(--good-text); font-weight: 650; }
  .lr-say.back svg { width: 14px; height: 14px; }
  .lr-x { grid-column: 2 / 4; grid-row: 3; margin-top: 3px; font: 500 13px/17px var(--font); color: var(--text-3); }
  .lr.has-x2 .lr-x.fx { grid-row: 4; } /* a foreign amount under a note */
  .lr.has-x2 :is(.lr-i, .lr-ic) { grid-row: 1 / 5; }
  .lr.solo.has-x2 .lr-amt { grid-row: 1 / 5; }
  /* your note, written by hand under the log (the phone's own handwriting faces: nothing to download) */
  .lr-note { display: block; margin: 1px 0 -2px; font: 400 17px/21px "Bradley Hand", "Noteworthy", "Segoe Print", cursive; color: var(--text-2); transform: rotate(-1.2deg); transform-origin: left center; white-space: normal; }
  .lr-clock { align-self: center; width: 15px; height: 15px; flex: none; color: var(--text-3); }
  /* a refunded log: the amount struck through diagonally by hand, what came back under it */
  .lr.refunded .lr-amt { color: var(--text-3); }
  .lr-num { position: relative; }
  .lr.refunded .lr-num::after { content: ""; position: absolute; left: -4px; right: -1px; top: 0; bottom: -1px; pointer-events: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 30' preserveAspectRatio='none'%3E%3Cpath d='M1.2 25.6 C 3.4 27.4, 6.2 26.8, 9.8 25.1 C 15.6 22.6, 19.4 22.9, 25.2 20.1 C 31.4 17.2, 34.8 18.4, 41.6 14.9 C 47.2 12.1, 51.6 13.6, 57.8 10.4 C 64.4 7.1, 68.1 8.9, 74.6 6.2 C 80.2 3.9, 84.6 5.1, 90.4 3.1 C 94.1 1.9, 96.6 2.6, 98.8 1.4' fill='none' stroke='%23c6f432' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
  /* the day's totals: a recessed pill, a cell for Spent and one for Received, cut by a thin line */
  .lr-tot { display: grid; grid-template-columns: 1fr; min-height: 50px; margin: 6px 0 10px; border-radius: 25px; overflow: hidden; background: rgba(0, 0, 0, .3); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .45), inset 0 -1px 0 rgba(255, 255, 255, .08); }
  .lr-tot.two { grid-template-columns: 1fr 1fr; }
  .lr-tot > div { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 7px 4px; min-width: 0; }
  .lr-tot > div + div { box-shadow: inset 1px 0 0 rgba(255, 255, 255, .14); }
  .lr-tot span { font: 650 11px/14px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); }
  .lr-tot b { font: 650 15px/19px var(--font); color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .lr-tot .cur { margin-left: 3px; font-size: 10px; letter-spacing: .04em; text-transform: none; color: var(--text-3); }
}
html[data-private="on"] :is(.lr-amt, .lr-say, .lr-x.fx, .lr-tot b) { filter: blur(max(7px, 0.4em)); user-select: none; }

/* ==== A log's sheet on a phone (22 Nov 2026, the user): the Plan item sheet's layout — a bottom sheet, three tabs ====
   Overview and History are drawn by logged-view.js (entrySheetParts); Details is the edit form and its Save. */
@media (max-width: 699px) {
  dialog#entry-edit.ee-v2:modal { inset: auto 0 var(--kb, 0px) 0; margin: 0; width: 100%; max-width: none !important; max-height: var(--sheet-max, calc(100dvh - 60px)); border-radius: 30px 30px 0 0; overflow: hidden; }
  #entry-edit.ee-v2 .sheet-inner { max-height: var(--sheet-max, calc(100dvh - 60px)); overflow: auto; scrollbar-width: none; padding: 20px 18px calc(18px + env(safe-area-inset-bottom, 0px)); box-sizing: border-box; }
  #entry-edit.ee-v2 .pv-tabs { display: grid; grid-template-columns: repeat(3, 1fr); height: 44px; margin: 0 0 12px; border-radius: 22px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
  #entry-edit.ee-v2 .pv-tabs button { background: none; border: 0; padding: 0; color: var(--text-2); font: 650 15px var(--font); }
  #entry-edit.ee-v2 .pv-tabs button + button { box-shadow: inset 1px 0 0 rgba(255, 255, 255, .14); }
  #entry-edit.ee-v2 .pv-tabs button[aria-selected="true"] { background: rgba(255, 255, 255, .12); color: var(--text); }
  #entry-edit.ee-v2:not([data-tab="overview"]) [data-ee-panel="overview"],
  #entry-edit.ee-v2:not([data-tab="logs"]) [data-ee-panel="logs"],
  #entry-edit.ee-v2:not([data-tab="details"]) #ee-body,
  #entry-edit.ee-v2:not([data-tab="details"]) .cap-foot,
  #entry-edit.ee-v2 #ee-refund { display: none; }
  /* Save takes the full width: the Overview's Refund button (.pv-pay), the word lime (24 Nov 2026, the user: one button = full width, two = half each) */
  #entry-edit.ee-v2 .cap-foot { display: block; }
  #entry-edit.ee-v2 .cap-foot .summary { display: none; }
  #entry-edit.ee-v2 #ee-save { display: flex; align-items: center; justify-content: center; width: 100%; height: 44px; padding: 0; border: 0 !important; border-radius: 22px; background: rgba(255, 255, 255, .1) !important; box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14) !important; color: var(--good) !important; font: 650 15px var(--font); }
  #entry-edit.ee-v2 .sheet-head { padding: 0; margin: 0 0 14px; min-height: 0; }
  #entry-edit.ee-v2 #ee-body { padding: 0; margin: 0; overflow: visible; max-height: none; }
  #entry-edit.ee-v2 .cap-foot { padding: 14px 0 0; margin: 0; }
  #entry-edit.ee-v2 .pv-sub b.ok { color: var(--text); font-weight: 650; }
}
/* The log sheet's Refund and Save on a wide screen wear the phone's glass (22 Nov 2026, the user): no fill, a thin white rim,
   Save's word lime, Refund's white — the same height, the pill shape, each half the width */
@media (min-width: 700px) {
  #entry-edit .cap-foot .btn { height: 44px; padding: 0 22px; border-radius: 22px; font: 650 15px var(--font); background: transparent !important; border-color: rgba(255, 255, 255, .3) !important; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3) !important; color: var(--text) !important; }
  #entry-edit .cap-foot .btn.btn-primary { color: var(--select) !important; }
  /* each takes half the width, side by side */
  #entry-edit .cap-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  #entry-edit .cap-foot .summary { display: none; }
  #entry-edit .cap-foot .btn { width: 100%; }
}

/* Details: the Plan sheet's settings look (22 Nov 2026; every width since the same day, the user: don't neglect desktop) —
   five glass blocks of plain rows, no boxed fields, the tick boxes drawn as the app's switch, the bank text grey under them */

  /* the blocks and rows themselves (the Plan sheet's .pv-group / .pv-row, which only a phone draws) */
  #entry-edit .ee-g { border-radius: 22px; overflow: hidden; padding: 0 4px; margin-bottom: 12px; --glass: rgba(10, 10, 12, .18); --blur: blur(12px) saturate(180%); }
  #entry-edit .ee-g > .pv-row { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 52px; padding: 0 14px !important; margin: 0 !important; position: relative; font-size: 17px; color: var(--text); background: none !important; border: 0 !important; box-sizing: border-box; }
  #entry-edit .ee-g > .pv-row::before { content: ""; position: absolute; left: 14px; right: 0; top: 0; height: 1px; background: rgba(255, 255, 255, .12); }
  #entry-edit .ee-g .pv-row select.ctl, #entry-edit .ee-g .pv-row input.ctl { background-color: transparent !important; border: 0 !important; box-shadow: none !important; outline: 0; color: var(--text) !important; font: inherit; font-size: 17px !important; text-align: right; height: auto !important; }
  #entry-edit .ee-g .pv-row select.ctl { -webkit-appearance: none; appearance: none; padding: 0 22px 0 0 !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 9l4-4 4 4M8 15l4 4 4-4'/%3E%3C/svg%3E") !important; background-repeat: no-repeat !important; background-position: right center !important; background-size: 16px !important; text-align-last: right; }
  #entry-edit .ee-g .pv-row input.ctl { padding: 0 !important; background-image: none !important; }

  #entry-edit #ee-body .rule-fields { display: block; padding: 0; background: none; box-shadow: none; border-radius: 0; }
  #entry-edit .ee-g[hidden], #entry-edit .ee-g > .pv-row[hidden], #entry-edit .ee-g > [hidden] { display: none !important; }
  #entry-edit .ee-g > .pv-row { box-shadow: none; }
  #entry-edit .ee-g > .pv-row::before { display: none; }
  #entry-edit .ee-g > .pv-row:not([hidden]) ~ .pv-row::before { display: block; }
  #entry-edit .ee-g > .pv-row > span:first-child { color: var(--text); font-size: 17px; font-weight: 400; }
  #entry-edit .ee-g .ctl { width: auto; min-width: 0; max-width: 60%; }
  #entry-edit .ee-g input.ctl { flex: 1; max-width: none; text-align: right; }
  #entry-edit .ee-g > .pv-row > span:first-child { flex: none; }
  #entry-edit .ee-g input.ctl[type="date"] { flex: none; -webkit-appearance: none; appearance: none; background: none !important; }
  #entry-edit .ee-g input.ctl[type="date"]::-webkit-calendar-picker-indicator { display: none; }
  #entry-edit .ee-g input.ctl::placeholder { color: var(--text-3); }
  #entry-edit .ee-g .combo { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; width: auto; margin-left: auto; background: none; box-shadow: none; border: 0; }
  #entry-edit .ee-g .combo input.ctl { width: 8ch; flex: none; }
  #entry-edit .ee-g .combo select.ctl { max-width: none; }
  #entry-edit .ee-g .ctl-static { color: var(--text-2); font-size: 15px; text-align: right; }
  #entry-edit .ee-g .full-row { padding-block: 0 !important; }
  #entry-edit .ee-g .full-row .ctl { max-width: none; width: 100%; text-align: left; }
  #entry-edit .ee-g .fund-note { margin: 0 14px 10px; }
  #entry-edit .ee-g .kw-row { height: auto !important; min-height: 52px; padding-block: 8px !important; }
  /* a tick box drawn as the app's switch (.switch): off a raised pill, on lime with the knob at the right */
  #entry-edit .ee-g input.ctl-check { -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 46px; height: 28px; margin: 0; padding: 0; border: 0; border-radius: var(--r-pill); background: var(--raised); box-shadow: inset 0 0 0 1px var(--line-strong); cursor: pointer; }
  #entry-edit .ee-g input.ctl-check::before { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--text-2); transition: left .18s ease, background .18s ease; }
  #entry-edit .ee-g input.ctl-check:checked { background: var(--good); box-shadow: none; }
  #entry-edit .ee-g input.ctl-check:checked::before { left: 21px; background: var(--good-ink); }
  #entry-edit #ee-body > .ee-raw { margin: 2px 18px 0; font-size: 13px; line-height: 1.4; color: var(--text-3); }

html[data-private="on"] #entry-edit.ee-v2 :is(.pv-fig, .pv-sub b, .pv-conv) { filter: blur(max(7px, 0.4em)); user-select: none; }

/* No logo before the page title, on any page or width (30 Nov 2026, the user: "remove the app icon from all pages"); the title
   starts at the page's edge, in line with the pills under it. The MRGN glass tile (22 Nov 2026) is gone from index.html. */

/* Wide screens catch up with the phone's active state and buttons (22 Nov 2026, the user: "catch up desktop to mobile in the sense of
   active state and buttons"): the phone's clear liquid glass with the bright white rim, in place of lime and black. */
@media (min-width: 700px) {
  /* the + is liquid, a white icon inside the bright rim */
  .dock-add.glass { background: rgba(255, 255, 255, .04) !important; -webkit-backdrop-filter: blur(16px) saturate(180%) brightness(1.1) !important; backdrop-filter: blur(16px) saturate(180%) brightness(1.1) !important; box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14) !important; color: var(--text) !important; }
  .dock-add.glass .icon { color: var(--text) !important; }
  .dock-add.glass::after { display: block !important; content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; background: linear-gradient(135deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .12) 38%, rgba(255, 255, 255, .05) 62%, rgba(255, 255, 255, .55)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
  /* the dock's active page: clear glass with a bright white rim and a white icon */
  .dock-nav .pill-bubble { background: linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, 0) 68%, rgba(255, 255, 255, .05)) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14) !important; }
  .dock-nav .pill-bubble::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; background: linear-gradient(135deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .12) 38%, rgba(255, 255, 255, .05) 62%, rgba(255, 255, 255, .55)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
  .dock-link[aria-current="page"], .dock-link[aria-current="page"] .icon { color: var(--text) !important; }
  /* the page's pills (Home, Plan, Track): the active one clear glass, the others quiet */
  :is(.tabs[data-pills="sections:dashboard"], .tabs[data-pills="sections:plan"], .tabs[data-pills="sections:tracker"]) button.glass[aria-selected="true"] { background: linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, 0) 68%, rgba(255, 255, 255, .05)) !important; color: var(--text) !important; box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  :is(.tabs[data-pills="sections:dashboard"], .tabs[data-pills="sections:plan"], .tabs[data-pills="sections:tracker"]) button.glass[aria-selected="true"] .icon { color: var(--text) !important; }
  :is(.tabs[data-pills="sections:dashboard"], .tabs[data-pills="sections:plan"], .tabs[data-pills="sections:tracker"]) button.glass[aria-selected="true"]::after { background: linear-gradient(135deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .12) 38%, rgba(255, 255, 255, .05) 62%, rgba(255, 255, 255, .55)) !important; }
  :is(.tabs[data-pills="sections:dashboard"], .tabs[data-pills="sections:plan"]) button.glass:not([aria-selected="true"]) { background: transparent !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; box-shadow: none !important; color: var(--text-3) !important; }
  :is(.tabs[data-pills="sections:dashboard"], .tabs[data-pills="sections:plan"]) button.glass:not([aria-selected="true"])::after { opacity: .5; }
  /* Plan's categories */
  .cat-pills button:not([aria-selected="true"]) { color: var(--text-3); border-color: rgba(255, 255, 255, .1); }
  .cat-pills button:not([aria-selected="true"]) .icon { color: var(--text-3); }
  .cat-pills button[aria-selected="true"] { position: relative; border-color: transparent !important; background: linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, 0) 68%, rgba(255, 255, 255, .05)) !important; color: var(--text) !important; box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14) !important; }
  .cat-pills button[aria-selected="true"] .icon { color: var(--text) !important; }
  .cat-pills button[aria-selected="true"]::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; background: linear-gradient(135deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .12) 38%, rgba(255, 255, 255, .05) 62%, rgba(255, 255, 255, .55)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
  /* the picked day, Log's day row: the same liquid, its dot keeps its colour */
  .ld[aria-pressed="true"] { position: relative; background: linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, 0) 68%, rgba(255, 255, 255, .05)) !important; -webkit-backdrop-filter: saturate(120%); backdrop-filter: saturate(120%); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14) !important; color: var(--text) !important; border-color: transparent !important; }
  .ld[aria-pressed="true"]::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(135deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .12) 38%, rgba(255, 255, 255, .05) 62%, rgba(255, 255, 255, .55)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
  .ld[aria-pressed="true"] span { color: var(--text-2) !important; }
  .ld[aria-pressed="true"] b { color: var(--text) !important; }
  .ld[aria-pressed="true"] i { background: var(--good-text) !important; }
}

/* The Log's day row on a wide screen wears the phone's: no boxes, three-letter days, a lime dot where something was logged, the
   picked day clear glass (22 Nov 2026, the user: *this is outdated*, then the phone look over glass tiles, *Build it*). */
@media (min-width: 700px) {
  .ld { width: 52px; padding: 8px 0 7px; border: 0; border-radius: 14px; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 5px; }
  .ld span { color: var(--text-2); font: 600 12px var(--font); letter-spacing: 0; text-transform: none; }
  .ld b { margin: 0; font-size: 18px; font-weight: 700; color: var(--text); }
  .ld i { width: 5px; height: 5px; margin: 0; background: var(--good-text); opacity: 0; }
  .ld.has i, .ld-all i { opacity: 1; }
}

/* Coming Up on a wide screen in the app's liquid glass (22 Nov 2026, the user: *fix the coming up widget … the style and the
   active state*; *it is too opaque, the buttons are not updated, the calendar block … still lime*). The card is the phone's
   Faint Liquid; what is picked or next is clear glass with the bright white rim; the blocks are the phone's Up Next block;
   the pay buttons are the round glass buttons. No lime fills. */
@media (min-width: 700px) {
  /* the card: no dark fill, the backdrop's colour comes through, the rim draws it */
  .cu-deskcard.glass { background: transparent !important; -webkit-backdrop-filter: saturate(120%); backdrop-filter: saturate(120%); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14); }
  .cu-deskcard.glass::before { background: none; }

  /* picked: clear glass, white words, the bright rim */
  .cu-pills button.on, .cu-mark.today b, .cu-row[aria-selected="true"] {
    position: relative; border-color: transparent !important; color: var(--text) !important;
    background: linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, 0) 68%, rgba(255, 255, 255, .05)) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14) !important;
  }
  .cu-pills button.on::after, .cu-mark.today b::after, .cu-row[aria-selected="true"]::after, .cu-cal.nx::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .12) 38%, rgba(255, 255, 255, .05) 62%, rgba(255, 255, 255, .55));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  }
  .cu-pills button:not(.on) { color: var(--text-3); border-color: rgba(255, 255, 255, .1); }
  .cu-row[aria-selected="true"] .due-name { color: var(--text) !important; }

  /* the day's block: the phone's Up Next block — clear glass, a grey month strip, a white day. Next due adds the bright rim;
     paid is the same quiet block (the button says it is paid); late keeps its red */
  .cu-cal, .cu-cal.paid, .cu-cal.nx, .cu-selecting .cu-cal:not(.paid):not(.cu-void) { width: 44px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; background: rgba(255, 255, 255, .08); animation: none; box-shadow: none; }
  .cu-cal.nx { border-color: transparent; background: linear-gradient(160deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .04) 42%, rgba(255, 255, 255, .04) 68%, rgba(255, 255, 255, .08)); }
  .cu-cal i, .cu-cal.paid i, .cu-cal.nx i, .cu-selecting .cu-cal:not(.paid):not(.cu-void) i { background: rgba(255, 255, 255, .1); color: var(--text-3); }
  .cu-cal b, .cu-cal.paid b, .cu-cal.nx b, .cu-selecting .cu-cal:not(.paid):not(.cu-void) b { color: var(--text); }
  .cu-cal.late { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 16%, transparent); }

  /* pay: the round glass button, a lime tick to press; paid: clear glass with the bright rim and a white tick */
  .cu-row .due-go.btn, .cu-row .due-go.btn.paid {
    position: relative; width: 36px; height: 36px; min-width: 36px; padding: 0; border: 0 !important; border-radius: 50%; display: grid; place-items: center;
    background: rgba(255, 255, 255, .06) !important; -webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14) !important; color: var(--select) !important;
  }
  .cu-row .due-go.btn::after, .cu-foot .due-all.btn::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, .24), rgba(255, 255, 255, .1) 45%, rgba(255, 255, 255, .1) 70%, rgba(255, 255, 255, .16));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  }
  .cu-row .due-go.btn.paid { color: var(--text) !important; background: linear-gradient(160deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .02) 42%, rgba(255, 255, 255, .02) 68%, rgba(255, 255, 255, .06)) !important; }
  .cu-row .due-go.btn.paid::after { background: linear-gradient(135deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .12) 38%, rgba(255, 255, 255, .05) 62%, rgba(255, 255, 255, .55)); }
  .cu-row .due-go .due-go-word { display: none; }
  .cu-selecting .cu-row .due-go.btn:not(.paid) { display: none; } /* while rows are selected the pay buttons step aside, as before */
  .cu-row .due-go .icon { display: block !important; width: 18px; height: 18px; margin: 0; }

  /* PAY ALL / PAY SELECTED: a glass pill, lime words */
  .cu-foot .due-all.btn { position: relative; height: 34px; padding: 0 16px; border: 0; border-radius: 17px; background: rgba(255, 255, 255, .06) !important; -webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14) !important; color: var(--select) !important; }
}

/* The log sheet's Payment (Monthly), when a card charge is put in installments (22 Nov 2026): its siblings' size, grey as on the + screen; blurred in private mode, as every amount */
#entry-edit .ee-inst-pay { font-size: inherit; color: var(--text-2); }
html[data-private="on"] #entry-edit .ee-inst-pay { filter: blur(max(7px, 0.4em)); user-select: none; }

/* The Log's filter pane on a wide screen in the phone Filters sheet's look (22 Nov 2026, the user: *the filter area is outdated in
   terms of style … needs to stick like the calendar*): rows with the label left in 17 px white and the value right in grey, dented
   lines between rows, Min / Max as the sheet's dark round fields, the options as the app's glass pills side by side, clear glass with a bright rim when picked
   (no lime; the user chose A, glass pills, over the phone's rows), the count and a quiet Clear all at the foot. It pins under the top like the day row and scrolls inside itself. */
@media (min-width: 700px) {
  .log-filters.glass { gap: 0; padding: 4px 20px 16px; border-radius: 28px; }
  .log-filters h4 { color: var(--text); font: 400 17px var(--font); letter-spacing: 0; text-transform: none; }
  .log-filters .lf-row, .log-filters .lf-grp { padding: 0; border-top: 0; box-shadow: inset 0 2px 0 rgba(0, 0, 0, .4), inset 0 3px 0 rgba(255, 255, 255, .11); }
  .log-filters .lf-row { grid-template-columns: 110px minmax(0, 1fr); min-height: 56px; }
  .log-filters .lf-row.lf-amt { box-shadow: none; }
  .log-filters .lf-pair { gap: 10px; min-height: 44px; border-radius: 0; background: none; box-shadow: none; }
  .log-filters .lf-pair label { align-items: center; gap: 10px; height: 44px; padding: 0 16px; border-radius: 22px; background: rgba(0, 0, 0, .28); }
  .log-filters .lf-pair label + label { border-left: 0; }
  .log-filters .lf-pair label:focus-within { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); }
  .log-filters .lf-pair span { color: var(--text-2); font: 500 13px var(--font); letter-spacing: .08em; }
  .log-filters .lf-pair input { font: 500 17px var(--font); }
  .log-filters .lf-pair input::placeholder { color: var(--text-3); }
  .log-filters .lf-ms summary { min-height: 44px; padding: 12px 26px 12px 0; border-radius: 0; background: none; color: var(--text-2); font: 400 15px var(--font); text-align: right; }
  .log-filters .lf-ms summary::after { right: 4px; border-color: var(--text-2); }
  .log-filters .lf-ms.on summary { color: var(--text); }
  .log-filters .lf-grp > summary { min-height: 46px; }
  .log-filters .lf-gs { color: var(--text-2); font: 400 15px var(--font); }
  .log-filters .lf-gs.on { color: var(--text); }
  .log-filters .lf-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 2px 0 14px; }
  .log-filters .lf-p { position: relative; flex: none; min-height: 34px; height: auto; padding: 0 14px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 17px; background: transparent; color: var(--text-2); font: 600 13.5px var(--font); white-space: nowrap; }
  .log-filters .lf-p[aria-pressed="true"] { border-color: transparent; background: linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, 0) 68%, rgba(255, 255, 255, .05)); color: var(--text); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5), inset 0 1px 1px rgba(255, 255, 255, .14); }
  .log-filters .lf-foot { margin-top: 4px; padding-top: 12px; box-shadow: inset 0 2px 0 rgba(0, 0, 0, .4), inset 0 3px 0 rgba(255, 255, 255, .11); }
  .log-filters .lf-res { color: var(--text-2); font: 400 15px var(--font); }
  .log-filters .lf-clear { height: 36px; padding: 0 18px; border: 0; border-radius: 18px; background: rgba(255, 255, 255, .12); color: var(--text); font: 500 15px var(--font); }
  /* the filter button, when its pane is open: clear glass, as on a phone (no lime) */
  .log-head .round-btn.log-ib[aria-pressed="true"] { position: relative; background: linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, 0) 68%, rgba(255, 255, 255, .05)) !important; border-color: transparent !important; color: var(--text) !important; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5), inset 0 1px 1px rgba(255, 255, 255, .14) !important; }
  .log-head .round-btn.log-ib[aria-pressed="true"] .icon { color: var(--text) !important; }
}
@media (min-width: 900px) {
  .log-page.open .log-filters { position: sticky; z-index: 5; top: var(--log-pin, 0px); max-height: calc(100dvh - var(--top-h, 0px) - 140px); overflow-y: auto; overscroll-behavior: contain; }
}

/* ---------- Profile and sign-in (30 Nov 2026, the user's approved preview v12; scripts/auth-ui.js) ---------- */

/* Profile's Verification row: words on a phone (Biometric), a dropdown on a wide screen */
@media (max-width: 699px) { #settings .pf-wide { display: none; } }
@media (min-width: 700px) { #settings .pf-phone { display: none; } }
/* the Log pills' "needs an answer" dot, on Recovery Codes until they are opened */
.pf-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--select); flex: none; }
.pf-dot[hidden] { display: none; }
/* Recovery Codes: one board, all eight in a 2 × 4 grid, no lines between them */
.rc-board { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 12px; padding: 24px 18px !important; justify-items: center;
  font: 600 18px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .06em; color: var(--text); }

/* The sign-in pages: a page of its own on the backdrop — no top bar, no dock — with the whole column, its title on top,
   in the middle of the screen on every width; titles, lines and buttons centred */
html[data-auth] .app, html[data-auth] .dock { display: none !important; }
.auth-page { position: fixed; inset: 0; z-index: 30; overflow-y: auto; display: grid; place-items: center;
  padding: max(24px, env(safe-area-inset-top, 0px)) 16px max(24px, env(safe-area-inset-bottom, 0px)); }
.auth-page[hidden] { display: none; }
.auth-col { width: min(400px, 100%); display: flex; flex-direction: column; gap: 12px; }
.auth-col > * { flex: none; }
.auth-col .auth-title { margin: 0 0 10px; text-align: center; }
.auth-lede { margin: 0 0 6px; font-size: 15px; line-height: 1.4; color: var(--text-2); text-align: center; }
.auth-legal { margin: 6px 0 0; font-size: 12px; line-height: 1.45; color: var(--text-3); text-align: center; }
.auth-legal a { color: var(--select); text-decoration: none; }
/* Terms and Privacy (3 Dec 2026): sign-in pages; each section a set-h heading over its text inside glass (look A) */
.legal-date { margin: -6px 0 4px; font-size: 13px; color: var(--text-2); text-align: center; }
.legal-sec { margin: 14px 0 0; }
.legal-sec .set-h { margin: 0 4px 10px; }
.legal-card { padding: 14px 18px; }
.legal-card p, .legal-card li { margin: 0 0 8px; font-size: 15px; line-height: 1.45; color: var(--text); }
.legal-card ul { margin: 0; padding-left: 1.1em; }
.legal-card :last-child { margin-bottom: 0; }
.auth-col .set-group, .auth-col .set-note { margin: 0; }
.auth-col .set-note { margin-top: -4px; text-align: center; }
.auth-col .set-in.auth-in { flex: 1.4; width: auto; min-width: 0; }
.auth-code:not(:placeholder-shown) { letter-spacing: .2em; font-variant-numeric: tabular-nums; }
.auth-bottom { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.auth-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-foot.one { grid-template-columns: 1fr; }
.auth-col .btn { text-transform: none; letter-spacing: 0; font-size: 15px; width: 100%; height: 50px; }
.auth-col .btn .icon { width: 18px; height: 18px; }
/* the main button wears the phone's look on every width: clear, a thin white rim, lime words; white while it can't be pressed */
.auth-col .btn.btn-primary { background: transparent !important; -webkit-backdrop-filter: none; backdrop-filter: none;
  border-color: rgba(255, 255, 255, .3) !important; color: var(--select) !important; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3) !important; }
.auth-col .btn.btn-primary:disabled { color: var(--text) !important; }
/* line buttons (Resend Code, Change Email, Forgot Password?, Use a Recovery Code): words in the middle */
.auth-col .set-row.act { justify-content: center; }
.auth-col .set-row.act .set-l { flex: none; text-align: center; }
/* Apple and Google: their own white buttons, their marks, their wording */
.auth-idp { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 50px; border: 0; border-radius: 999px;
  background: #fff; color: #000; font: 600 16px var(--font); cursor: pointer; }
.auth-idp .icon, .auth-idp .auth-g { width: 19px; height: 19px; flex: none; color: #000; }
/* a wide screen's verification choice: the picked row has a lime tick */
.auth-pick .set-row { width: 100%; }
.auth-pick .auth-tick { margin-left: auto; color: var(--select); visibility: hidden; }
.auth-pick [aria-checked="true"] .auth-tick { visibility: visible; }
.auth-qr { display: grid; place-items: center; padding: 14px 0 4px; }
.auth-qr > div { background: #fff; padding: 10px; border-radius: 16px; line-height: 0; }

/* ==== Desktop restyle (applied 1 Dec 2026, the user): on a wide screen (700 px and up) the phone's entry sheet, Log day headings and
   rows, line pane and month picker; Home and Log headings white and Title Case. Spec: docs/02 §Desktop restyle ==== */
@media (min-width: 700px) {
  .pv-tabs button { background: none; border: 0; padding: 0; color: var(--text-2); font: 650 15px var(--font); }
  .pv-tabs button + button { box-shadow: inset 1px 0 0 rgba(255, 255, 255, .14); }
  .pv-tabs button[aria-selected="true"] { background: rgba(255, 255, 255, .12); color: var(--text); }
  .pv-top { text-align: center; }
  .pv-amt { display: block; font: 700 30px/34px var(--font); color: var(--text); letter-spacing: -.01em; }
  .pv-amt .cur { font-size: 12px; color: var(--text-2); margin-left: 6px; letter-spacing: .04em; font-weight: 650; }
  .pv-conv { display: flex; justify-content: center; align-items: center; gap: 5px; margin-top: 2px; font: 600 16px/20px var(--font); color: var(--text-3); }
  .pv-conv .cur { font-size: 11px; letter-spacing: .04em; margin-left: 3px; }
  .pv-rate { font: 550 13px var(--font); color: var(--text-3); }
  .pv-edit { display: inline-grid; place-items: center; width: 16px; height: 20px; margin-left: -1px; padding: 0; background: none; border: 0; color: var(--text-2); }
  .pv-rate-in { width: 64px; height: 28px; border-radius: 10px; padding: 0 6px; font: 600 14px var(--font); text-align: center; color: var(--text); }
  .pv-sub { margin-top: 2px; font: 550 14px/20px var(--font); color: var(--text-2); }
  .pv-sub b { font-weight: 650; }
  .pv-sub b.late { color: var(--bad-text); }
  .pv-sub b.ok { color: var(--good); }
  .pv-link { background: none; border: 0; padding: 0; color: var(--good); font: 650 14px/18px var(--font); }
  .pv-reset { display: block; margin: 6px auto 0; }
  .pv-pay { display: flex; align-items: center; justify-content: center; width: 100%; height: 44px; margin-top: 14px; border: 0; border-radius: 22px; background: rgba(255, 255, 255, .1); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14); color: var(--good); font: 650 15px var(--font); }
  .pv-pay.on { color: var(--text-2); }
  .pv-dent { display: block; height: 3px; margin: 12px 0 4px; background: linear-gradient(rgba(0, 0, 0, .42) 0 2px, rgba(255, 255, 255, .11) 2px 3px); }
  .pv-h { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 2px 2px; font: 650 15px/20px var(--font); color: var(--text); }
  .pv-h2 { margin-top: 4px; }
  .pv-none { margin: 24px 2px; color: var(--text-2); font: 550 15px var(--font); }
  .pv-log { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; height: 58px; padding: 0 2px; font: 650 16px var(--font); color: var(--text); }
  .pv-log + .pv-log { box-shadow: inset 0 2px 0 rgba(0, 0, 0, .42), inset 0 3px 0 rgba(255, 255, 255, .11); }
  .pv-d { display: flex; flex-direction: column; align-items: center; justify-self: start; width: fit-content; color: var(--text); }
  .pv-d i { font: 700 10px/12px var(--font); font-style: normal; letter-spacing: .08em; text-transform: uppercase; }
  .pv-d b { font: 700 17px/19px var(--font); }
  .pv-log em { font: 600 15px var(--font); font-style: normal; color: var(--text); }
  .pv-log em.late { color: var(--bad-text); }
  .pv-log .pv-fig { text-align: right; color: var(--text); }
  .pv-log .cur { font-size: 10px; color: var(--text-2); margin-left: 3px; letter-spacing: .04em; }
  .pv-orig { display: block; margin-top: 1px; font: 550 12px/14px var(--font); color: var(--text-3); }
  .pv-rings { display: flex; justify-content: space-around; padding: 2px 0 10px; }
  .pv-rw { display: flex; flex-direction: column; align-items: center; gap: 4px; }
  .pv-rw small { font: 600 11px/14px var(--font); color: var(--text-2); white-space: nowrap; }
  .pv-group { border-radius: 22px; overflow: hidden; padding: 0 4px; margin-bottom: 12px; --glass: rgba(10, 10, 12, .18); --blur: blur(12px) saturate(180%); }
  .pv-row { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 52px; padding: 0 14px !important; margin: 0 !important; position: relative; font-size: 17px; color: var(--text); background: none !important; border: 0 !important; box-sizing: border-box; }
  .pv-row + .pv-row::before { content: ""; position: absolute; left: 14px; right: 0; top: 0; height: 1px; background: rgba(255, 255, 255, .12); }
  .pv-row > span:first-child, .pv-row > .lab { flex: 1; min-width: 0; color: var(--text); font-size: 17px; font-weight: 400; }
  .pv-row select.ctl, .pv-row input.ctl, .pv-row select { background-color: transparent !important; border: 0 !important; box-shadow: none !important; outline: 0; color: var(--text) !important; font: inherit; font-size: 17px !important; text-align: right; max-width: 58%; -webkit-appearance: none; appearance: none; padding: 0 22px 0 0 !important; height: auto !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 9l4-4 4 4M8 15l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right center; background-size: 16px; }
  .pv-row input.ctl { background-image: none; padding-right: 0 !important; }
  .pv-row .sheet-amount-in { display: inline-flex; align-items: baseline; gap: 6px; margin: 0; }
  .pv-row .sheet-amount-in input { width: 9ch !important; font-size: 17px !important; text-align: right; }
  .pv-row .sheet-amount-in .cur { font-size: 12px; letter-spacing: .08em; color: var(--text-3); }
  .pv-row select.cat-select, .pv-row .cat-select { position: static !important; width: auto !important; min-width: 0; margin: 0 !important; flex: none; text-align-last: right; }
  .pv-row .sheet-amount-in .cur { position: static !important; }
  .pv-row .sheet-amount-in input { width: 7ch !important; }
  .pv-row > .seg-chip { background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 9l4-4 4 4M8 15l4 4 4-4'/%3E%3C/svg%3E") no-repeat right center / 16px !important; border: 0 !important; box-shadow: none !important; font: inherit; font-size: 17px; color: var(--text); padding: 0 22px 0 0; }
  .pv-row .cat-select, .pv-row select.cat-select { background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 9l4-4 4 4M8 15l4 4 4-4'/%3E%3C/svg%3E") no-repeat right center / 16px !important; padding: 0 22px 0 0 !important; }
  .pv-set .need-note, .pv-set .note, .pv-set > p { margin: 0 18px 12px; font-size: 13px; line-height: 1.4; color: var(--text-3); }
  .pv-rings { padding: 2px 0 22px; }
  .pv-row { height: 52px !important; }
  .pv-row .sheet-amount-in { margin-left: auto; width: auto !important; min-width: 0 !important; flex: none; padding-right: 22px; justify-content: flex-end; }
  .pv-row .sheet-amount-in input { width: var(--aw, 6ch) !important; flex: none; }
  .pv-row .sheet-amount-in { padding-right: 0 !important; }
  dialog#entry-edit.ee-v2:modal { inset: auto 0 var(--kb, 0px) 0; margin: 0; width: 100%; max-width: none !important; max-height: var(--sheet-max, calc(100dvh - 60px)); border-radius: 30px 30px 0 0; overflow: hidden; }
  #entry-edit.ee-v2 .sheet-inner { max-height: var(--sheet-max, calc(100dvh - 60px)); overflow: auto; scrollbar-width: none; padding: 20px 18px calc(18px + env(safe-area-inset-bottom, 0px)); box-sizing: border-box; }
  #entry-edit.ee-v2 .pv-tabs { display: grid; grid-template-columns: repeat(3, 1fr); height: 44px; margin: 0 0 12px; border-radius: 22px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
  #entry-edit.ee-v2 .pv-tabs button { background: none; border: 0; padding: 0; color: var(--text-2); font: 650 15px var(--font); }
  #entry-edit.ee-v2 .pv-tabs button + button { box-shadow: inset 1px 0 0 rgba(255, 255, 255, .14); }
  #entry-edit.ee-v2 .pv-tabs button[aria-selected="true"] { background: rgba(255, 255, 255, .12); color: var(--text); }
  #entry-edit.ee-v2:not([data-tab="overview"]) [data-ee-panel="overview"], #entry-edit.ee-v2:not([data-tab="logs"]) [data-ee-panel="logs"], #entry-edit.ee-v2:not([data-tab="details"]) #ee-body, #entry-edit.ee-v2:not([data-tab="details"]) .cap-foot, #entry-edit.ee-v2 #ee-refund { display: none; }
  #entry-edit.ee-v2 .cap-foot { display: block; }
  #entry-edit.ee-v2 .cap-foot .summary { display: none; }
  #entry-edit.ee-v2 #ee-save { display: flex; align-items: center; justify-content: center; width: 100%; height: 44px; padding: 0; border: 0 !important; border-radius: 22px; background: rgba(255, 255, 255, .1) !important; box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14) !important; color: var(--good) !important; font: 650 15px var(--font); }
  #entry-edit.ee-v2 .sheet-head { padding: 0; margin: 0 0 14px; min-height: 0; }
  #entry-edit.ee-v2 #ee-body { padding: 0; margin: 0; overflow: visible; max-height: none; }
  #entry-edit.ee-v2 .cap-foot { padding: 14px 0 0; margin: 0; }
  #entry-edit.ee-v2 .pv-sub b.ok { color: var(--text); font-weight: 650; }

  /* ---- the desktop sheet is centred, not docked to the bottom ---- */
  dialog#entry-edit.ee-v2:modal { inset: 0; margin: auto; width: min(460px, calc(100vw - 48px)); max-height: calc(100dvh - 80px); border-radius: 30px; }
  #entry-edit.ee-v2 .sheet-inner { max-height: calc(100dvh - 80px); padding: 20px 18px 18px; }

  /* ---- 1. the period picker under the title (Home: right of the tabs; Log: in the Logs row), the phone's size and clear glass ---- */
  .log-nav { display: flex; align-items: center; gap: 8px; }
  .log-nav .picker-step:not([hidden]) { display: grid; }
  .log-nav .picker-btn { height: 36px; padding: 0 12px; font: 650 13px/18.85px var(--font); background-color: transparent; }
  .log-nav .picker-step { width: 36px; height: 36px; background-color: transparent; }
  .log-logs-row.searching .log-nav { display: none; }
  .log-logs-row .log-nav { margin: 0 auto 0 16px; }

  /* ---- 2. section headings on Home and the Log: white Title Case, the phone's 'This Week' ---- */
  .ov-mount.home .block-title.ov-head, .log-mount .block-title.ov-head, .ov-mount.home .cu-titlebar .block-title {
    font: 750 20px/24px var(--font); letter-spacing: -0.2px; text-transform: none; color: var(--text); }

  /* ---- 3. the Log's day heading: the phone's 'Mon 30 November', IN and OUT kept at the right ---- */
  .log-list .log-day { font: 750 20px/24px var(--font); letter-spacing: -0.2px; text-transform: none; color: var(--text); }
  .log-list .log-day em { font: inherit; font-style: normal; color: inherit; letter-spacing: inherit; text-transform: none; }
  .log-list .log-day .log-day-sum { font: 500 15px var(--font); letter-spacing: 0; text-transform: none; color: var(--text-2); }
  .log-list .log-day .log-day-sum b { color: var(--text); font-weight: 650; }
  .log-list .log-day .log-day-sum .cur { font-size: 10px; letter-spacing: .04em; color: var(--text-3); }

  /* ---- 4. the Log's entry cards in the phone's row look: no card, a line between, the time paid at the left; all data kept ---- */
  /* Log entries: glass cards again, in the clear glass (the user, 1 Dec 2026: the frameless rows were rejected) */
  .log-list .pcard.glass[data-entry] { background: transparent !important; }
  .pcard-tm .icon { width: 22px; height: 22px; color: var(--text-2); }
  .log-list .pcard[data-entry]:has(.pcard-tm) { display: flex !important; flex-direction: row !important; align-items: center; gap: 12px; }
  .pcard-tm { flex: none; width: 38px; display: flex; flex-direction: column; align-items: center; }
  .pcard-tm .lr-tm { display: flex; flex-direction: column; align-items: center; }
  .pcard-tm .lr-tm i { font: 650 10px/12px var(--font); font-style: normal; letter-spacing: .08em; color: var(--text-2); }
  .pcard-tm .lr-tm b { font: 650 14px/17px var(--font); color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; }
  .log-list .pcard[data-entry] .pcard-in { flex: 1; min-width: 0; }
  .log-list .pcard[data-entry] .pcard-name { font: 600 15px/21px var(--font); color: var(--text); }
  .log-list .pcard[data-entry] .pcard-amount { font: 650 20px/20px var(--font); }

  /* ---- 6. Plan's line details: the phone sheet's look — white Title Case group titles, rows on a glass block ---- */
  .line-pane .pane-group h3 { font: 700 17px/22px var(--font); letter-spacing: 0; text-transform: none; color: var(--text); }
  .line-pane .pane-group .field { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 14px; border-radius: 22px; background: rgba(10, 10, 12, .18); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), inset 0 1px 1px rgba(255, 255, 255, .14); }
  .line-pane .pane-group .field > span { font-size: 17px; font-weight: 400; color: var(--text); text-transform: none; letter-spacing: 0; }
  .line-pane .pane-group .field select { background-color: transparent !important; border: 0 !important; box-shadow: none !important; color: var(--text) !important; font: inherit; font-size: 17px !important; text-align: right; text-align-last: right; width: auto; }

  /* ---- 7. the month picker: the phone's clear glass and width ---- */
  #picker-pop { width: 343px; }
  #picker-pop.glass.strong { background: transparent !important; }
  #picker-pop .pop-grid button[aria-selected="true"], #picker-pop .pop-grid.cal button.mid[aria-selected="true"] { background: linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, 0) 68%, rgba(255, 255, 255, .05)) !important; border-color: rgba(255, 255, 255, .5) !important; color: var(--text) !important; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5), inset 0 1px 1px rgba(255, 255, 255, .14) !important; }
}

/* ==== Desktop restyle: on a wide screen (1,440 px and up) Coming Up is a calendar (30 Nov 2026, the user) — Sunday to
   Saturday; a day's charges one to a line with its total beside the date; every week the same height (a busy day scrolls in its
   cell); clicking a day opens its pop-up to pay, edit and Pay All. No week rows, no buttons in the days. ==== */
.cu-colhead, .cu-colfoot { display: none !important; }
@media (min-width: 1440px) {
  .cu-calendar { display: block; }
  .cu-dow, .cu-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .cu-dow span { padding: 0 10px 6px; color: var(--text-3); font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; } /* the date picker's weekday letters */
  .cu-days + .cu-days { box-shadow: inset 0 1px 0 var(--line); }
  .cu-day { min-width: 0; height: 150px; display: flex; flex-direction: column; padding: 8px 10px; }
  .cu-day + .cu-day { box-shadow: inset 1px 0 0 var(--line); }
  .cu-day.has { cursor: pointer; border-radius: 14px; }
  .cu-day.has:hover, .cu-day.has:focus-visible { background: rgba(255, 255, 255, .06); outline: 0; }
  .cu-dh { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
  .cu-dn { color: var(--text-2); font-size: 13px; font-weight: 650; white-space: nowrap; }
  .cu-day.is-past .cu-dn { color: var(--text-3); }
  .cu-day.is-today .cu-dn { padding: 2px 9px; border-radius: 99px; background: var(--good); color: var(--select-ink); font-size: 11.5px; letter-spacing: 0.04em; } /* Coming Up's own Today pill */
  .cu-dt { font-style: normal; color: var(--text); font-size: 13px; font-weight: 750; white-space: nowrap; }
  .cu-dt.paid { color: var(--good-text); }
  .cu-dl { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
  .cu-dl::-webkit-scrollbar { display: none; }
  .cu-ln { display: flex; justify-content: space-between; gap: 8px; height: 22px; align-items: center; font-size: 13px; }
  .cu-ln b { min-width: 0; font-weight: 550; color: var(--text-2); white-space: nowrap; }
  .cu-ln i { font-style: normal; font-weight: 650; color: var(--text-2); white-space: nowrap; }
  .cu-ln.paid i { color: var(--good-text); }
  .cu-ln.late b, .cu-ln.late i { color: var(--bad-text); }
  .cu-nod .cu-day { grid-column: 1 / -1; height: auto; }
  /* a day's pop-up: the list's own rows and footer, centred like the log's sheet */
  dialog.cu-daypop:modal { inset: 0; margin: auto; width: min(520px, calc(100vw - 48px)); max-height: calc(100dvh - 80px); border-radius: 30px; }
  .cu-daypop .sheet-inner { padding: 20px 18px 18px; }
  .cu-daypop .cu-list { max-height: calc(100dvh - 260px); overflow-y: auto; scrollbar-width: none; }
  /* the pop-up's title already says the day: no date block, no timeline; rows line up with the title */
  .cu-daypop .sheet-head { padding: 0; margin: 0 0 8px; min-height: 0; }
  .cu-daypop .cu-list::before { display: none; }
  .cu-daypop .cu-row > .svc-cal, .cu-daypop .cu-row > .cu-nob { display: none; }
  .cu-daypop .cu-row { grid-template-columns: minmax(0, 1fr) auto auto; margin: 4px 0; padding: 10px 0; }
  .cu-daypop .cu-colfoot:not([hidden]) { display: flex !important; align-items: center; gap: 14px; }
  .cu-daypop .cu-colfoot .cu-ft { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
}

/* ==== Pay All / Pay Selected: Title Case, no caps (30 Nov 2026, the user: "we don't do all caps buttons anymore") — the Filters'
   Clear All size with the sheet's Mark as Paid words (lime, 650 15px) on the same glass ==== */
@media (min-width: 700px) {
  .cu-foot .due-all.btn { height: 36px; padding: 0 18px; border-radius: 18px; font: 650 15px var(--font); letter-spacing: 0; text-transform: none; color: var(--good) !important; }
}

/* ==== The pickers' footer buttons (Whole Month, Today, This Month, Pick Days, Clear): Title Case, no caps, every width
   (30 Nov 2026, the user: "we don't do all caps buttons anymore") — the Filters' Clear All button ==== */
.pop-foot .btn { height: 36px; padding: 0 18px; border: 0; border-radius: 18px; background: rgba(255, 255, 255, .12) !important; color: var(--text) !important; font: 500 15px var(--font); letter-spacing: 0; text-transform: none; }

/* ==== Every pop-up wears the phone's clear glass (30 Nov 2026, the user: *apply clear glass to all pop-ups*): no 72% dark fill
   (--glass-strong), only the blur, so the backdrop's colours come through — the phone's own .glass.strong rule. Sheets, menus,
   date pickers and the Plan's floating panels. + Log and Settings keep their own looks, as on the phone. ==== */
@media (min-width: 700px) {
  :is(dialog.sheet, .popover, .fx-tip, .carry, .icon-picker, .list-editor).glass.strong:not(#capture):not(#settings) { background: transparent !important; }
}

/* ==== TEST (30 Nov 2026, the user): the calendar's days show the phone's This Week pills, no amounts — the phone's own .hph-pill
   rules, copied for the calendar; the pills wrap in the day and a busy day scrolls in its cell ==== */
@media (min-width: 1440px) {
  .cu-calendar .cu-dl { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; }
  .cu-calendar .cu-pill { position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 12px; border-radius: 999px; color: var(--text); font: 600 15px var(--font); white-space: nowrap; cursor: pointer; box-shadow: none !important; }
  .cu-calendar .cu-pill .icon { width: 18px; height: 18px; flex: none; }
  .cu-calendar .cu-pill.late .icon { color: var(--bad-text); }
  .cu-calendar .cu-pill.due .icon { color: #ff9f1c; }
  .cu-calendar .cu-pill.done { background: transparent; color: var(--text-3); opacity: .7; }
  .cu-calendar .cu-pill.done .icon { color: var(--good-text); }
  .cu-calendar .cu-pill { cursor: inherit; max-width: 100%; }
  /* much smaller in a day (the user: *they are humungous*): 26 px tall, 12 px words, 14 px icons */
  .cu-calendar .cu-pill { height: 26px; padding: 0 10px 0 8px; gap: 5px; font: 600 12px var(--font); }
  .cu-calendar .cu-pill .icon, .cu-calendar .cu-pill img, .cu-calendar .cu-pill svg { width: 14px !important; height: 14px !important; }
  .cu-calendar .cu-dl { gap: 5px; }
  /* The rule for every day (the user, 30 Nov 2026): when a day's pills don't all fit at this size, they lose their icons and shrink,
     a step at a time (app.js fitCuDays), until the whole day fits; paid ones stay faded, so nothing is lost */
  .cu-calendar .cu-dl.fit1 { gap: 4px; }
  .cu-calendar .cu-dl.fit1 .cu-pill { height: 21px; padding: 0 8px; font-size: 11px; }
  .cu-calendar .cu-dl.fit2 { gap: 3px; }
  .cu-calendar .cu-dl.fit2 .cu-pill { height: 18px; padding: 0 6px; font-size: 10px; }
  .cu-calendar .cu-dl:is(.fit1, .fit2) .cu-pill :is(.icon, img, svg) { display: none; }
}

/* ==== Coming Up's calendar: the gap under its heading matches the other sections (22 px), and the Log's filter button at the far
   right of the heading opens the Log's in-line pane beside the calendar (30 Nov 2026, the user) ==== */
@media (min-width: 1440px) {
  .cu-deskcol.cu-hascal { row-gap: 22px; }
  .cu-hascal .cu-titlebar { display: flex; align-items: center; justify-content: space-between; }
  .cu-hascal .cu-titlebar .log-fwrap { margin: -8px 0; } /* the round button overhangs the heading, so the gap is measured from the words */
  .cu-calwrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
}

/* ==== The top of every page (30 Nov 2026, the user's marked screenshot, *across the board*): the page's pills sit beside its title,
   and the period picker is back in the top row beside the eye and Settings; a page's own buttons (Plan's, Track's) sit before them ==== */
@media (min-width: 700px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 24px; }
  .topbar > .title-group { grid-column: 1; grid-row: 1; }
  .topbar > #section-pills { grid-column: 2; grid-row: 1; min-width: 0; }
  .topbar > .top-actions { grid-column: 3; grid-row: 1; }
}

/* ==== Coming Up's heading row (30 Nov 2026, the user): the filters as drop-downs — the period picker's pill, its options in a clear
   glass menu under it — then the full-screen button (the Plan table's) ==== */
@media (min-width: 1440px) {
  .cu-tools { display: flex; align-items: center; gap: 8px; margin: -8px 0; }
  .cu-dd { position: relative; }
  .cu-ddb { height: 40px; padding: 0 14px 0 16px; gap: 8px; display: inline-flex; align-items: center; }
  .cu-dd.on .cu-ddb { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); }
  .cu-dd.open .cu-ddb .chev { transform: rotate(180deg); }
  .cu-ddm { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: 300px; padding: 14px; }
  .cu-ddm[hidden] { display: none; }
  .cu-ddm .lf-pills { padding: 0; }
  .cu-ddm .lf-foot { margin-top: 12px; }
  .cu-fsb { width: 40px; height: 40px; }
  .cu-hascal .cu-titlebar .log-fwrap { display: none; }
  /* full screen: the calendar alone, filling the window; its weeks share the height */
  html.cu-fs .dock, html.cu-fs .topbar, html.cu-fs .ov-mount.home > :not(.cu-deskcol) { display: none !important; }
  html.cu-fs .cu-deskcol { position: fixed; inset: 12px; width: auto; height: auto; max-width: none; z-index: 50; display: flex; flex-direction: column; gap: 14px; }
  html.cu-fs .cu-titlebar { padding: 8px 8px 0 16px; }
  html.cu-fs .cu-calwrap { flex: 1; min-height: 0; display: flex; align-items: stretch; }
  html.cu-fs .cu-calendar { flex: 1; display: flex; flex-direction: column; }
  html.cu-fs .cu-days { flex: 1; min-height: 0; }
  html.cu-fs .cu-day { height: auto; min-height: 0; }
}

/* ==== The calendar's day total carries its currency; a card's statement date is its own pill — no fill, a dashed rim, the card icon
   (the Plan's 'Nothing Planned' dashed pill), so it never reads as a charge (30 Nov 2026, the user) ==== */
@media (min-width: 1440px) {
  .cu-dt .cur { margin-left: 3px; font-size: 10px; font-weight: 650; letter-spacing: .04em; color: var(--text-3); }
  .cu-dt.paid .cur { color: inherit; opacity: .7; }
  .cu-calendar .cu-pill.cu-stmt { background: transparent; border: 1.2px dashed rgba(255, 255, 255, .45); color: var(--text-2); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .cu-calendar .cu-pill.cu-stmt::before, .cu-calendar .cu-pill.cu-stmt::after { display: none; }
}

/* ==== Widgets that open something show a pointer; the top row's and Coming Up's round buttons and pills are the phone's clear glass,
   not the desktop's dark fill (1 Dec 2026, the user: *the glass is dark*) ==== */
@media (min-width: 700px) {
  article:is([data-cu-jump], [data-hw-log], [data-goto]).glass { cursor: pointer; }
  .topbar .glass:not(.view-toggle):not([aria-selected="true"]):not([aria-pressed="true"]),
  .log-head .glass:not(.view-toggle):not([aria-selected="true"]):not([aria-pressed="true"]),
  .plan-bar .glass:not([aria-selected="true"]):not([aria-pressed="true"]),
  .cu-tools > .cu-dd > .glass, .cu-tools > .glass { background: transparent !important; }
}


/* ==== Discard and Save: a pop-up held at the bottom, over the dock, in the toast's place and clear glass; the buttons in words,
   Title Case, never caps (1 Dec 2026, the user) ==== */
.save-pop { padding: 8px; gap: 8px; background: transparent !important; }
/* the buttons are the pop-up answers (docs 09: the How Far Does It Go? pills): quiet glass Discard, lime Save on the right */
.save-pop .btn { height: 44px; padding: 0 18px; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 999px; background: rgba(255, 255, 255, 0.1); color: var(--text); font-size: 14px; font-weight: 600; text-transform: none; letter-spacing: 0; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.save-pop .btn:not(.btn-primary):hover { color: var(--select); }
.save-pop .btn.btn-primary { border-color: var(--select); background: var(--select); color: var(--select-ink); }
#toast:not([hidden]) ~ .save-pop { bottom: calc(var(--dock-h) + 100px); }

/* ==== Plan's year table reaches down to the dock, 12px above it, instead of stopping short over an empty strip (1 Dec 2026, the user) ==== */
@media (min-width: 700px) {
  .page[data-page="plan"] .section:has(.cards.fill .table-wrap) { padding-bottom: calc(var(--dock-h) + var(--dock-b, 20px)); }
}
@media (min-width: 700px) {
  /* while Discard and Save are up, the table stops 12px above them so the totals stay in view */
  html:has(#save-pop:not([hidden])) .page[data-page="plan"] .section:has(.cards.fill .table-wrap) { padding-bottom: calc(var(--dock-h) + 40px + 60px); }
}

/* ==== Applied 1 Dec 2026 (the user: *this is outdated, all of it*): the saving plan sheets wear the entry sheet's Details look —
   clear glass, frosted groups of rows, the label left in white Title Case, the value right, a full-width glass Save with lime words ==== */
#acc-sheet.glass.strong { background: transparent !important; }
#acc-sheet .acc-sx-body { display: grid; gap: 12px; }
/* the goal: the entry sheet's Overview figure — big, centred, no box */
#acc-sheet .acc-sx-hero { display: grid; justify-items: center; gap: 2px; padding: 6px 0 4px; border: 0 !important; background: none !important; box-shadow: none !important; }
#acc-sheet .acc-sx-hero .acc-sx-lab { font: 500 13px var(--font); letter-spacing: 0; text-transform: none; color: var(--text-2); }
#acc-sheet .acc-sx-hero .acc-sx-amt { display: inline-flex; align-items: baseline; gap: 6px; }
#acc-sheet .acc-sx-hero .acc-sx-big { width: 6ch; field-sizing: content; min-width: 2ch; border: 0; background: none; text-align: center; font: 700 34px var(--font); color: var(--text); padding: 0; outline: 0; }
#acc-sheet .acc-sx-hero .acc-sx-cur { font: 650 13px var(--font); color: var(--text-3); letter-spacing: .04em; }
/* the groups */
#acc-sheet :is(.acc-sx-namebox, .acc-sx-pair, .acc-sx-rows) { display: block; padding: 0 4px; border: 0 !important; border-radius: 22px; background: rgba(10, 10, 12, .18) !important; -webkit-backdrop-filter: blur(12px) saturate(1.8); backdrop-filter: blur(12px) saturate(1.8); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14); }
#acc-sheet .acc-sx-pair { display: block !important; }
/* every row */
#acc-sheet :is(.acc-sx-namebox, .acc-sx-pair > .acc-sx-sec, .acc-sx-row) { position: relative; display: flex !important; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; margin: 0 !important; padding: 0 14px !important; background: none !important; border: 0 !important; box-shadow: none !important; }
#acc-sheet :is(.acc-sx-pair > .acc-sx-sec + .acc-sx-sec, .acc-sx-row + .acc-sx-row, .acc-sx-row + [name="newname"] + .acc-sx-row)::before { content: ""; position: absolute; left: 14px; right: 0; top: 0; height: 1px; background: rgba(255, 255, 255, .12); }
#acc-sheet :is(.acc-sx-namebox, .acc-sx-sec, .acc-sx-row) > .acc-sx-lab { flex: none; font: 400 17px var(--font); letter-spacing: 0; text-transform: none; color: var(--text); }
#acc-sheet :is(.acc-sx-namebox, .acc-sx-sec, .acc-sx-row) :is(input.acc-sx-in, select.acc-sx-in, textarea.acc-sx-in) { flex: 1; min-width: 0; height: auto; margin: 0; padding: 0; border: 0 !important; border-radius: 0; background-color: transparent !important; box-shadow: none !important; outline: 0; color: var(--text); font: 400 17px var(--font); text-align: right; }
#acc-sheet :is(input, textarea).acc-sx-in::placeholder { color: var(--text-3); }
#acc-sheet select.acc-sx-sel { -webkit-appearance: none; appearance: none; text-align-last: right; padding-right: 22px !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 9l4-4 4 4M8 15l4 4 4-4'/%3E%3C/svg%3E") !important; background-repeat: no-repeat !important; background-position: right center !important; background-size: 16px !important; }
#acc-sheet .acc-sx-date { color-scheme: dark; }
#acc-sheet .acc-sx-now { display: inline-flex; align-items: baseline; justify-content: flex-end; gap: 6px; flex: 1; min-width: 0; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; }
#acc-sheet .acc-sx-now .acc-sx-cur { font: 650 12px var(--font); color: var(--text-3); }
#acc-sheet input[name="newname"] { display: block; width: 100%; min-height: 52px; padding: 0 14px !important; border: 0 !important; background: none !important; box-shadow: none !important; color: var(--text); font: 400 17px var(--font); text-align: right; }
#acc-sheet input[name="newname"][hidden] { display: none; }
#acc-sheet .acc-sx-notesrow textarea { resize: none; height: 24px; line-height: 24px; overflow: hidden; }
/* Add to Plan: the entry sheet's switch at the right, what it adds in grey before it */
#acc-sheet .acc-sx-plan { display: inline-flex; align-items: center; gap: 10px; flex-direction: row-reverse; min-width: 0; }
#acc-sheet .acc-sx-plan > span { color: var(--text-3); font: 400 13px var(--font); text-align: right; }
#acc-sheet .acc-sx-plan input[type="checkbox"] { -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 44px; height: 26px; margin: 0; border-radius: 13px; background: var(--raised-strong); cursor: pointer; transition: background .15s; }
#acc-sheet .acc-sx-plan input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #dfe4d4; transition: transform .15s; }
#acc-sheet .acc-sx-plan input[type="checkbox"]:checked { background: var(--select); }
#acc-sheet .acc-sx-plan input[type="checkbox"]:checked::after { transform: translateX(18px); background: var(--select-ink); }
/* Save: the entry sheet's — full width, glass, lime words */
#acc-sheet .acc-sx-foot { padding-top: 4px; }
#acc-sheet .acc-sx-foot .btn { display: flex; align-items: center; justify-content: center; width: 100%; height: 44px; padding: 0; border: 0 !important; border-radius: 22px; background: rgba(255, 255, 255, .1) !important; box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14) !important; color: var(--good) !important; font: 650 15px var(--font); letter-spacing: 0; text-transform: none; }
@media (min-width: 700px) { #acc-sheet { width: min(460px, calc(100vw - 48px)); } }

/* ==== a saving plan's Top Up (and an installment's Settle) is the app's round glass button with a lime icon — Coming Up's
   pay button — not a solid lime disc ==== */
.round-btn.acc-plus.acc-topup { background: rgba(255, 255, 255, .1) !important; box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14) !important; border: 1px solid rgba(255, 255, 255, .16) !important; color: var(--good) !important; }
.round-btn.acc-plus.acc-topup:hover { color: var(--select) !important; }
#acc-sheet :is(.acc-sx-namebox, .acc-sx-sec, .acc-sx-row) { flex-direction: row !important; grid-template-columns: none !important; }
#acc-sheet .acc-sx-namebox { background: rgba(10, 10, 12, .18) !important; }
#acc-sheet .acc-sx-now { flex-direction: row !important; }
#acc-sheet .acc-sx-now input.acc-sx-in { flex: 1 1 auto; width: 100%; }
#acc-sheet .acc-sx-notesrow textarea.acc-sx-in { flex: 1; height: 24px !important; min-height: 0 !important; padding: 0 !important; }
#acc-sheet .acc-sx-hero .acc-sx-amt { justify-content: center; width: auto; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; }
#acc-sheet .acc-sx-hero .acc-sx-big { flex: none; width: 5ch; text-align: right; }
#acc-sheet .acc-sx-hero .acc-sx-cur { flex: none; }
#acc-sheet label.acc-sx-sec.acc-sx-namebox { background: rgba(10, 10, 12, .18) !important; box-shadow: inset 0 1px 1px rgba(255, 255, 255, .14) !important; border-radius: 22px; padding: 0 18px !important; }
#acc-sheet .acc-sx-name { background: none !important; }
#acc-sheet .acc-sx-now .acc-sx-cur { position: static !important; order: 2; }
#acc-sheet .acc-sx-now input.acc-sx-in { order: 1; }
#acc-sheet .acc-sx-notesrow, #acc-sheet .acc-sx-notesrow > * { margin: 0 !important; }
#acc-sheet .acc-sx-notesrow { padding-top: 0 !important; padding-bottom: 0 !important; }
#acc-sheet .acc-sx-notesrow > .acc-sx-lab { align-self: center; }
#acc-sheet .acc-sx-now { align-items: center !important; }
#acc-sheet .acc-sx-hero { display: grid !important; grid-template-columns: none !important; justify-items: center !important; text-align: center; }
#acc-sheet .acc-sx-notesrow { align-items: center !important; }
#acc-sheet .acc-sx-notesrow > .acc-sx-lab { padding: 0 !important; transform: none !important; }
/* ==== Track's Add wizard is clear glass on a wide screen too (the phone's since 22 Nov) ==== */
@media (min-width: 700px) {
  .tw-scrim { background: transparent; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
  .tw-frame { background: rgba(10, 10, 12, .25) !important; -webkit-backdrop-filter: blur(24px) saturate(120%); backdrop-filter: blur(24px) saturate(120%); }
}
/* Save Now: the figure and EGP on one line, the entry sheet's Amount row (962.05 EGP) — EGP the same size, level with it */
#acc-sheet .acc-sx-now { align-items: center !important; gap: 8px; }
#acc-sheet .acc-sx-now .acc-sx-cur { position: static !important; top: auto !important; transform: none !important; margin: 0 !important; align-self: center; font: 400 17px var(--font) !important; letter-spacing: 0; color: var(--text) !important; line-height: 1; }
#acc-sheet .acc-sx-now input.acc-sx-in { line-height: 1; }

/* ==== (1 Dec 2026, the user: *this glass is outdated and the title is outdated*): Track's cards in the phone's clear glass —
   no dark fill, the backdrop through, the bright inner edge — and its section headings white Title Case, as Home's and the Log's ==== */
@media (min-width: 700px) {
  .page[data-page="tracker"] .glass:not(.strong) { --glass: transparent; --blur: saturate(120%); --glass-sheen: transparent; --glass-shadow: inset 0 1px 1px rgba(255, 255, 255, .14); }
  .page[data-page="tracker"] .card.glass:not(.strong), .page[data-page="tracker"] .pcard.glass, .page[data-page="tracker"] .acc-card.glass { background: transparent !important; }
  .page[data-page="tracker"] .cc-tile { background: transparent; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), inset 0 1px 1px rgba(255, 255, 255, .14); }
  .page[data-page="tracker"] .block-title.ov-head { font: 750 20px/24px var(--font); letter-spacing: -0.2px; text-transform: none; color: var(--text); }
}

/* ==== Coming Up: a paid row's amount is struck through by hand in lime, the same pen as Plan's paid lines, so the whole row reads
   as paid at a glance (2 Dec 2026, the user: *the paid state is not clear*, picked B of three) ==== */
.cu-row .cu-paid-amt { display: inline-flex; align-items: center; justify-content: flex-end; pointer-events: none; }
.cu-row .cu-paid-amt:hover { background: transparent; }
.cu-paid-amt s { position: relative; text-decoration: none; }
.cu-paid-amt s::after { content: ""; position: absolute; left: -6px; right: -6px; top: 50%; height: 12px; margin-top: -6px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M1 7.4 C 14 5.6, 26 8.8, 46 6.9 S 84 8.2, 106 6.1 S 148 8.4, 170 6.5 S 194 7.2, 199 5.9' fill='none' stroke='%23c6f432' stroke-width='1.8' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat; transform: rotate(-1.2deg); pointer-events: none; }
.cu-row.is-paid:nth-child(even) .cu-paid-amt s::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 5.8 C 22 7.6, 38 5.2, 62 6.8 S 104 5.4, 128 7.2 S 170 5.6, 192 7.1 L 199 6.7' fill='none' stroke='%23c6f432' stroke-width='1.7' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); transform: rotate(1deg); }
.cu-row .due-go.btn.paid[data-cu-entry] { cursor: pointer; } /* a paid row's i opens its Log entry (2 Dec 2026) */

/* Desktop dock in the bottom-right corner, Plan's totals in the bottom-left (the user, 3 Dec 2026: *figures on the bottom
   left, nav bar on the far right*). The dock shows in full while the page is still; scrolling tucks it into the + and it
   sweeps back out of the + 0.6 s after the scroll stops (app.js sets html.dock-tucked); hovering the + brings it out
   (html.dock-peek). Phones keep their dock. */
@media (min-width: 700px) {
  .dock { left: auto; right: 32px; transform: none; }
  .dock-nav { transform-origin: right center; transition: clip-path 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s; clip-path: inset(0 0 0 0 round 999px); }
  html.dock-tucked:not(.dock-peek) .dock-nav { clip-path: inset(0 0 0 100% round 999px); transform: translateX(48px) scaleX(0.6); opacity: 0; pointer-events: none; }
}
@media (min-width: 700px) and (prefers-reduced-motion: reduce) {
  .dock-nav { transition: opacity 0.2s; }
  html.dock-tucked:not(.dock-peek) .dock-nav { transform: none; clip-path: none; }
}
/* From 1000 px the totals leave the top row for the bottom-left corner: the phone's bar, as tall as the dock and level with it */
@media (min-width: 1000px) {
  .top-totals { position: fixed; left: 32px; bottom: 20px; z-index: 30; }
  .top-totals .phone-totals.glass.strong { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; width: 470px; height: var(--dock-h, 68px); padding: 0; gap: 0; border-radius: 999px; }
  .top-totals .phone-totals.glass.strong.two { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 320px; }
  .top-totals .pt-cell { min-width: 0; padding: 0 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
  .top-totals .pt-cell .pt-label, .top-totals .pt-cell:is(.key-cat, .key-inc, .key-left, .over) .pt-label { font-size: 13px; }
  .top-totals .pt-cell .pt-value, .top-totals .pt-cell:is(.key-cat, .key-inc, .key-left, .over) .pt-value { font-size: 24px; }
}
