/* v1.8 design layer — loaded last. Palette unchanged; this file only adds hierarchy, numbers, focus and success moments. */

/* Money and counts line up in columns (Stripe / Mercury style) */
.stat,
.dashAmount,
.previewAmount,
td,
.kpi,
[class*='Amount'],
[class*='amount'] {
  font-variant-numeric: tabular-nums;
}

/* Less noise: per-card "?" marks hidden; the page "?" in the header stays */
#view .helpMark {
  display: none;
}

/* Visible keyboard focus everywhere (WCAG 2.2 focus-visible) */
:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Owner tools in Settings: clearly secondary */
.advancedSettings > summary {
  cursor: pointer;
  font-weight: 650;
  font-size: 1.05rem;
  padding: 0.25rem 0;
}
.advancedSettings[open] > summary {
  margin-bottom: 1rem;
}

/* Big centered success: drawn circle + tick, ~0.8s, then fades */
.hubCelebrate {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: rgba(14, 18, 32, 0.18);
  animation: hubCelFade 0.18s ease-out;
  cursor: pointer;
}
.hubCelebrate.out {
  opacity: 0;
  transition: opacity 0.25s ease-in;
}
.hubCelebrate .celBox {
  background: var(--paper-0);
  border-radius: 24px;
  padding: 2rem 2.5rem 1.75rem;
  min-width: min(340px, 88vw);
  max-width: 88vw;
  text-align: center;
  box-shadow: 0 24px 70px rgba(14, 18, 32, 0.25);
  animation: hubCelPop 0.32s var(--ease-out);
}
.hubCelebrate .celCheck {
  width: 96px;
  height: 96px;
  margin: 0 auto 1rem;
  display: block;
}
.hubCelebrate .celCheck circle {
  fill: var(--ok-soft);
  stroke: var(--ok);
  stroke-width: 3;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: hubCelDraw 0.45s ease-out forwards;
}
.hubCelebrate .celCheck path {
  fill: none;
  stroke: var(--ok);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: hubCelDraw 0.3s 0.38s ease-out forwards;
}
.hubCelebrate strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 720;
  color: var(--ink-0);
}
.hubCelebrate .celDetail {
  margin-top: 0.35rem;
  font-size: 1.05rem;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
@keyframes hubCelFade {
  from {
    opacity: 0;
  }
}
@keyframes hubCelPop {
  from {
    opacity: 0;
    transform: scale(0.86);
  }
}
@keyframes hubCelDraw {
  to {
    stroke-dashoffset: 0;
  }
}
/* Reduced motion: older CSS disables all animations, so show the finished tick instead of an empty circle */
@media (prefers-reduced-motion: reduce) {
  .hubCelebrate .celCheck circle,
  .hubCelebrate .celCheck path {
    stroke-dashoffset: 0;
  }
}

.hubCelebrate .celExtra:not(:empty) {
  margin-top: 0.6rem;
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* ---- v1.8 Smart Inbox ---- */
.inboxReview {
  border: 1px solid var(--rule-1);
  box-shadow: 0 8px 30px rgba(14, 18, 32, 0.07);
}
.inboxReviewHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.inboxFile {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  min-width: 0;
}
.inboxFile b {
  overflow-wrap: anywhere;
}
.inboxFileIcon {
  font-size: 1.6rem;
  line-height: 1;
}
.inboxAiNote {
  margin: 0 0 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  background: var(--paper-1);
  color: var(--ink-1);
}
.inboxAiNote span {
  color: var(--accent);
  margin-right: 0.25rem;
}
.inboxAiMissing {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  background: var(--paper-1);
}
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--paper-2);
  margin-bottom: 1rem;
}
.segmented button {
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 0.55rem 1rem;
  font: inherit;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  min-height: 44px;
}
.segmented button.isOn {
  background: var(--paper-0);
  color: var(--ink-0);
  box-shadow: 0 1px 3px rgba(14, 18, 32, 0.15);
}
.inboxMoney {
  margin-bottom: 0.5rem;
}
.inboxForm .onlySub {
  display: none;
}
.inboxForm[data-action='subscription'] .onlySub {
  display: grid;
}
.inboxForm[data-action='archive'] .inboxMoney {
  display: none;
}
.inboxWarn {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  background: var(--warn-soft);
  color: var(--warn);
}
.fieldLabel {
  font-weight: 600;
}
#cdFolderPicker > summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  cursor: pointer;
}
.pickerChange {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}
.inboxMore {
  margin-top: 1rem;
}
.inboxMore > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
  padding: 0.25rem 0;
}
.inboxActions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.25rem;
}
.inboxActions .buttonHighlight {
  min-width: 9rem;
}
.inboxReading {
  display: grid;
  gap: 0.6rem;
  padding: 0.5rem 0 0.25rem;
}
.skel {
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--paper-2) 25%, var(--paper-1) 50%, var(--paper-2) 75%);
  background-size: 200% 100%;
  animation: hubSkel 1.2s ease-in-out infinite;
}
.skel.short {
  width: 60%;
}
@keyframes hubSkel {
  to {
    background-position: -200% 0;
  }
}
.cdDrop.isUploading {
  opacity: 0.75;
  pointer-events: none;
}
.cdDrop.isUploading .cdDropIcon {
  width: 28px;
  height: 28px;
  margin: 0 auto 0.5rem;
  border: 3px solid var(--rule-1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: hubSpin 0.8s linear infinite;
}
@keyframes hubSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- v1.8 Documents (Finder-style) ---- */
.docsLayout {
  display: grid;
  grid-template-columns: minmax(220px, 260px) 1fr;
  gap: 1.25rem;
  align-items: start;
}
.docsSide {
  position: sticky;
  top: 1rem;
  display: grid;
  gap: 2px;
  padding: 0.75rem;
  background: var(--paper-0);
  border: 1px solid var(--rule-1);
  border-radius: 16px;
}
.docsSideItem {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 44px;
  padding: 0.45rem 0.7rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font: inherit;
  color: var(--ink-0);
  text-align: left;
  cursor: pointer;
}
.docsSideItem span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.docsSideItem small {
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.docsSideItem:hover {
  background: var(--paper-1);
}
.docsSideItem.isOn {
  background: var(--paper-2);
  color: var(--accent-strong);
  font-weight: 650;
}
.docsSideItem.sub {
  padding-left: 1.9rem;
  font-size: 0.95em;
}
.docsSideItem.drop-target,
.docsTile.drop-target {
  outline: 2px dashed var(--accent);
  background: var(--paper-1);
}
.docsAdd {
  color: var(--accent);
  font-weight: 600;
  margin-top: 0.25rem;
}
.docsStorage {
  margin-top: 0.75rem;
  padding: 0.6rem 0.7rem 0;
  border-top: 1px solid var(--paper-2);
  font-size: 0.85em;
  color: var(--ink-3);
  display: grid;
  gap: 0.4rem;
}
.docsStorageBar {
  height: 6px;
  border-radius: 6px;
  background: var(--paper-2);
  overflow: hidden;
}
.docsStorageBar span {
  display: block;
  height: 100%;
  background: var(--accent);
  min-width: 2px;
}
.docsMain {
  min-width: 0;
}
.docsHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.docsCrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 1.25rem;
}
.docsCrumbs button {
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  padding: 0.2rem 0.25rem;
  border-radius: 6px;
}
.docsCrumbs b {
  font-weight: 700;
}
.docsCrumbs span {
  color: var(--ink-4);
}
.docsTools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
}
.docsTools input[type='search'] {
  flex: 1 1 14rem;
}
.docsTools select {
  flex: 0 1 12rem;
}
.docsTiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.docsTile {
  position: relative;
  display: flex;
  border: 1px solid var(--rule-1);
  border-radius: 14px;
  background: var(--paper-0);
  min-height: 104px;
}
button.docsTile,
.docsTileOpen {
  display: grid;
  align-content: start;
  gap: 0.2rem;
  width: 100%;
  padding: 0.9rem 1rem;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink-0);
  text-align: left;
  cursor: pointer;
  border-radius: 14px;
}
button.docsTile {
  border: 1px solid var(--rule-1);
  background: var(--paper-0);
}
.docsTile:hover,
button.docsTile:hover {
  border-color: var(--rule-2);
  background: var(--paper-1);
}
.docsTileIcon {
  font-size: 1.6rem;
  line-height: 1;
  margin-bottom: 0.2rem;
}
.docsTile small,
button.docsTile small {
  color: var(--ink-3);
}
.docsTileAdd {
  border-style: dashed !important;
  color: var(--accent);
}
.docsTile .hubMenu {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
}
.docsSection {
  margin: 1.25rem 0 0.5rem;
  font-size: 1rem;
  color: var(--ink-2);
}
.docRow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.5rem;
  border-radius: 12px;
}
.docRow:hover {
  background: var(--paper-1);
}
.docIcon {
  font-size: 1.35rem;
}
.docName {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.1rem;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink-0);
  text-align: left;
  padding: 0.35rem 0;
  cursor: pointer;
}
.docName b {
  overflow-wrap: anywhere;
}
.hubMenu {
  position: relative;
}
.hubMenu > summary {
  list-style: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--ink-3);
  font-size: 1.2rem;
}
.hubMenu > summary::-webkit-details-marker {
  display: none;
}
.hubMenu > summary:hover,
.hubMenu[open] > summary {
  background: var(--paper-2);
}
.hubMenu > summary .hubIcon {
  width: 20px;
  height: 20px;
}
.hubMenuPanel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  min-width: 190px;
  padding: 6px;
  background: var(--paper-0);
  border: 1px solid var(--rule-1);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(14, 18, 32, 0.16);
  display: grid;
}
.hubMenuPanel button {
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink-0);
  min-height: 40px;
}
.hubMenuPanel button:hover {
  background: var(--paper-1);
}
.hubMenuPanel .dangerText {
  color: var(--bad);
}
@media (max-width: 860px) {
  .docsLayout {
    grid-template-columns: 1fr;
  }
  /* Phone: folder cards + breadcrumb already navigate, so no sideways folder strip; keep New folder and storage. */
  .docsSide {
    position: static;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.6rem 0.75rem;
  }
  .docsSide > .docsSideItem:not(.docsAdd),
  .docsSide .docsSideGroup {
    display: none;
  }
  .docsSide .docsAdd {
    width: auto;
    margin: 0;
  }
  .docsStorage {
    flex: 1 1 160px;
    margin: 0;
    padding: 0;
    border: 0;
  }
}

/* ---- v1.8 Payment accounts & categories dialog ---- */
.hubLists {
  width: min(620px, 94vw);
}
.hubLists .hubDialogHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.hubLists section {
  margin-top: 1rem;
}
.hubLists h3 {
  margin: 0 0 0.25rem;
}
.listRow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--paper-2);
}
.listRow b {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.listRow select {
  flex: 0 0 9rem;
}
.listAdd {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.listAdd input {
  flex: 1 1 12rem;
}
.listAdd select {
  flex: 0 0 9rem;
}

/* ---- v1.8 File preview ---- */
.hubPreview {
  width: min(980px, 96vw);
  height: min(88vh, 1100px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.hubPreview:not([open]) {
  display: none;
}
.hubPreview::backdrop {
  background: rgba(14, 18, 32, 0.55);
}
.previewHead {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--rule-1);
}
.previewHead b {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.previewBody {
  flex: 1;
  min-height: 0;
  background: var(--paper-2);
  display: grid;
  place-items: center;
  overflow: auto;
}
.previewBody iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--paper-0);
}
.previewBody img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.previewBody pre {
  align-self: stretch;
  justify-self: stretch;
  margin: 0;
  padding: 1rem;
  background: var(--paper-0);
  white-space: pre-wrap;
  font-size: 0.9rem;
}
.previewBody .skel {
  width: 60%;
}
.previewHead .dialogClose {
  position: static;
  flex: 0 0 auto;
}
.dashAllClear {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem;
  border-radius: 12px;
  background: var(--ok-soft);
  color: var(--ok);
  font-weight: 600;
}
.dashAllClear span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ok-solid);
  color: #fff;
}
.finMore {
  margin-top: 0.25rem;
}
.finMore > summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  padding: 0.25rem 0;
}
.finSearchBox {
  flex: 2 1 16rem;
}
.finActions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
/* Segmented control built from radio inputs (forms) */
.segmented label {
  position: relative;
}
.segmented label input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.segmented label span {
  display: block;
  border-radius: 10px;
  padding: 0.55rem 1rem;
  font-weight: 600;
  color: var(--ink-2);
  min-height: 44px;
  box-sizing: border-box;
  line-height: 1.9;
}
.segmented label:has(input:checked) span {
  background: var(--paper-0);
  color: var(--ink-0);
  box-shadow: 0 1px 3px rgba(14, 18, 32, 0.15);
}
.segmented label:has(input:focus-visible) span {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
}
.kpiWithCur {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.kpiCur {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}
.dashIntro {
  justify-content: flex-end;
}
.dlRemoved {
  margin-top: 0.4rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  background: var(--warn-soft);
  color: var(--warn);
  display: grid;
  gap: 0.5rem;
}
.dlRemoved span {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Phone/tablet nav: 4 main tabs + "More" sheet */
@media (max-width: 1050px) {
  body .mobileNav {
    overflow: visible;
    justify-content: space-around;
  }
  body .mobileNav > button,
  .mobileMore {
    flex: 1 1 0;
    min-width: 0;
    max-width: 7.5rem;
  }
  .mobileMore {
    position: relative;
  }
  .mobileMore summary {
    list-style: none;
    cursor: pointer;
    min-height: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 8px 5px;
    border-radius: 8px;
    color: var(--paper-2);
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.25;
  }
  .mobileMore summary::-webkit-details-marker {
    display: none;
  }
  .mobileMore summary.active,
  .mobileMore[open] summary {
    background: var(--accent-strong);
    color: #fff;
  }
  .mobileMore summary .hubIcon {
    width: 1.4rem;
    height: 1.4rem;
  }
  .mobileMoreSheet {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.6rem);
    min-width: 13rem;
    padding: 0.4rem;
    display: grid;
    gap: 0.2rem;
    background: var(--ink-0);
    border-radius: 12px;
    box-shadow: 0 -6px 24px #0003;
  }
  body .mobileNav .mobileMoreSheet button {
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.7rem;
    max-width: none;
    width: 100%;
    padding: 0.7rem 0.8rem;
  }
}

@media (max-width: 520px) {
  body .mobileNav > button,
  .mobileMore summary {
    font-size: 0.75rem;
    padding: 6px 2px;
  }
  body .mobileNav > button span,
  .mobileMore summary span {
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Transactions on phone and narrow laptops: each row becomes a card */
@media (max-width: 1200px) {
  body .finTable {
    min-width: 0;
  }
  .finTable thead {
    display: none;
  }
  .finTable,
  .finTable tbody {
    display: block;
  }
  .finTable tr {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: 'who amount' 'date state' 'where actions';
    gap: 0.35rem 0.75rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--paper-2);
  }
  body .finTable td,
  body .finTable td:nth-child(n) {
    display: block;
    padding: 0;
    border: 0;
    min-width: 0; /* beats readability.css column widths that pushed the row wider than its card */
  }
  .finTable td:nth-child(1) {
    grid-area: date;
  }
  .finTable td:nth-child(1) .muted {
    display: none;
  }
  .finTable td:nth-child(2) {
    grid-area: who;
  }
  .finTable td:nth-child(3) {
    grid-area: where;
  }
  .finTable td:nth-child(4) {
    grid-area: amount;
    text-align: right;
    font-variant-numeric: tabular-nums;
  }
  .finTable td:nth-child(5) {
    grid-area: state;
    text-align: right;
  }
  .finTable td:nth-child(6) {
    grid-area: actions;
    align-self: end;
  }
  .finTable td[colspan] {
    grid-column: 1 / -1;
  }
}

/* ───────── Hub 2026 look: light, airy, electric blue. Tokens live in tokens.css ───────── */

/* Type: one modern grotesk, tight display tracking, big confident numbers */
.top h1 {
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--ink-0);
}
.main h2 {
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ink-0);
}
.dashKpiNumber,
.kpiNum,
.stat,
.previewAmount,
.amountIn,
.amountOut,
.finTable td:nth-child(4) b {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.dashKpiNumber,
.kpiNum {
  font-weight: 650;
}
.kpiCur {
  color: var(--ink-3);
}

/* Money colours: expenses are normal text; red only for a loss */
.metricOut .dashKpiNumber,
.amountOut {
  color: var(--ink-0);
}
.kpiNum.isLoss,
.metricNet.isNegative .dashKpiNumber {
  color: var(--bad);
}

/* Sidebar: white, quiet, the active page is a soft blue pill */
body .side {
  background: var(--paper-0);
  border-right: 1px solid var(--rule-1);
  color: var(--ink-2);
}
body .nav button {
  color: var(--ink-2);
  border-radius: 10px;
  transition:
    background-color 0.18s var(--ease-out),
    color 0.18s var(--ease-out);
}
body .nav button:hover {
  background: var(--paper-2);
  color: var(--ink-0);
}
body .nav button.active,
body .nav button[aria-current='page'] {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 650;
  box-shadow: none;
}
body .nav button.active .hubIcon {
  color: var(--accent);
}
body .sidenote {
  color: var(--ink-3);
  border-color: var(--rule-1);
}

/* Wordmark: blue tile monogram + name, tagline as a quiet label */
body .brand,
.authBrand {
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: -0.035em;
  text-transform: none;
}
body .brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.35rem;
  color: var(--ink-0);
  padding: 0 10px;
}
body .brand::before {
  content: 'A';
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 9px;
  background: linear-gradient(140deg, #6a8bff, var(--accent) 55%, var(--accent-strong));
  color: #fff;
  font-size: 1.05rem;
  letter-spacing: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 4px 12px rgba(47, 91, 255, 0.3);
}
body .brand b,
.authBrand span {
  font-weight: 500;
  color: var(--accent);
}
body .tagline,
.authTagline {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-3);
}
body .tagline {
  margin: 0.55rem 10px 1.6rem;
  padding: 0;
  letter-spacing: 0.1em;
  font-size: 0.66rem;
  white-space: nowrap;
}
.authTagline {
  color: #aab4c8;
}

/* Cards: white sheets, hairline border, soft depth */
.card {
  background: var(--paper-0);
  border-color: var(--rule-1);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}
.dashMetric {
  transition:
    transform 0.25s var(--ease-out),
    box-shadow 0.25s var(--ease-out);
}
.dashMetric:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

/* Buttons: tactile — lit from above, lift on hover, press in on click */
.btn {
  transition:
    transform 0.18s var(--ease-out),
    box-shadow 0.18s var(--ease-out),
    background-color 0.18s var(--ease-out),
    border-color 0.18s var(--ease-out);
}
.btn:not(.light):not(.ghost):not(.danger):not(.dangerPrimary) {
  background: linear-gradient(180deg, #4a72ff, #2f5bff);
  color: #fff;
  border: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 1px 2px rgba(31, 69, 224, 0.3),
    0 4px 14px rgba(47, 91, 255, 0.22);
}
.btn:not(.light):not(.ghost):not(.danger):not(.dangerPrimary):hover:not(:disabled) {
  filter: none;
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 2px 4px rgba(31, 69, 224, 0.3),
    0 10px 24px rgba(47, 91, 255, 0.3);
}
.btn.light {
  background: var(--paper-0);
  border: 1px solid var(--rule-2);
  color: var(--ink-1);
  box-shadow: 0 1px 2px rgba(14, 18, 32, 0.05);
}
.btn.light:hover:not(:disabled) {
  filter: none;
  border-color: var(--ink-4);
  background: var(--paper-1);
}
.btn.ghost {
  color: var(--accent-strong);
}
.btn.ghost:hover:not(:disabled) {
  filter: none;
  background: var(--accent-soft);
}
.btn:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
  transition-duration: 0.06s;
}

/* Inputs: calm border, blue halo on focus */
input:not([type='checkbox']):not([type='radio']):not([type='file']),
select,
textarea {
  border-radius: 10px;
  transition:
    border-color 0.15s var(--ease-out),
    box-shadow 0.15s var(--ease-out);
}
input:not([type='checkbox']):not([type='radio']):not([type='file']):focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 91, 255, 0.14);
  outline: none;
}

/* Phone nav: frosted white bar, blue active tab */
body .mobileNav {
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  backdrop-filter: blur(16px) saturate(1.6);
  border-top: 1px solid var(--rule-1);
  box-shadow: 0 -4px 24px rgba(14, 18, 32, 0.06);
}
body .mobileNav button,
.mobileMore summary {
  color: var(--ink-3);
}
body .mobileNav button.active,
.mobileMore summary.active,
.mobileMore[open] summary {
  color: var(--accent-strong);
  background: var(--accent-soft);
}
.mobileMoreSheet {
  background: var(--paper-0);
  border: 1px solid var(--rule-1);
  box-shadow: var(--shadow-lift);
  transform-origin: bottom right;
  animation: hubSheetIn 0.22s var(--ease-out);
}
body .mobileNav .mobileMoreSheet button {
  color: var(--ink-1);
}
@keyframes hubSheetIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.96);
  }
}

/* Page change (View Transitions): the active pill slides, the page rises in */
@media (prefers-reduced-motion: no-preference) {
  #view {
    view-transition-name: hub-view;
  }
  body .nav button.active,
  body .mobileNav > button.active {
    view-transition-name: hub-nav-pill;
  }
  /* Phone tab bar is its own layer, so the page rising in never paints over it */
  .mobileNav {
    view-transition-name: hub-mobile-nav;
  }
  ::view-transition-group(hub-mobile-nav),
  ::view-transition-old(hub-mobile-nav),
  ::view-transition-new(hub-mobile-nav) {
    animation: none;
  }
  ::view-transition-old(hub-mobile-nav) {
    display: none;
  }
  ::view-transition-group(hub-nav-pill) {
    animation-duration: 0.35s;
    animation-timing-function: var(--ease-out);
  }
  ::view-transition-old(hub-view) {
    animation: hubFadeOut 0.12s ease-in both;
  }
  ::view-transition-new(hub-view) {
    animation: hubRiseIn 0.32s var(--ease-out) both;
  }
}
@keyframes hubFadeOut {
  to {
    opacity: 0;
  }
}
@keyframes hubRiseIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* Browser surfaces in the palette */
::selection {
  background: var(--accent-mid);
  color: var(--ink-0);
}
:root {
  accent-color: var(--accent);
  caret-color: var(--accent);
}
body #authGate .authFooter {
  color: #aab4c8;
}

/* Icons inline with text default to the text size; specific places override */
:where(.hubIcon) {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
  flex: 0 0 auto;
}
.cdDropIcon .hubIcon {
  width: 2rem;
  height: 2rem;
  color: var(--accent);
}
.docsTile .hubIcon,
.cdTreeRoot .hubIcon,
.docsSideItem .hubIcon {
  color: var(--accent);
}
.docsTile .docsTileIcon .hubIcon,
.docsTile > .hubIcon {
  width: 1.6rem;
  height: 1.6rem;
}

/* ───────── Apple-style details ───────── */

/* iOS switch for on/off settings */
.v12-toggle input[type='checkbox'] {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 2.75rem;
  height: 1.65rem;
  margin: 0;
  border-radius: 999px;
  background: var(--rule-2);
  position: relative;
  cursor: pointer;
  transition: background-color 0.25s var(--ease-out);
}
.v12-toggle input[type='checkbox']::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.65rem - 4px);
  height: calc(1.65rem - 4px);
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.15),
    0 0 1px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s var(--ease-spring);
}
.v12-toggle input[type='checkbox']:checked {
  background: #34c759;
}
.v12-toggle input[type='checkbox']:checked::after {
  transform: translateX(1.1rem);
}

/* Segmented control (Light / Dark / Auto) */
.hubSegmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 11px;
  background: var(--paper-2);
}
.hubSegmented button {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-weight: 550;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  min-height: 2.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition:
    background-color 0.2s var(--ease-out),
    box-shadow 0.2s var(--ease-out),
    color 0.2s var(--ease-out);
}
.hubSegmented button[aria-pressed='true'] {
  background: var(--paper-0);
  color: var(--ink-0);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.12),
    0 0 0 0.5px rgba(0, 0, 0, 0.04);
}

/* Header theme button: round, like the help button beside it */
.hubThemeToggle {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--rule-2);
  background: var(--paper-0);
  color: var(--ink-1);
  cursor: pointer;
  transition: transform 0.3s var(--ease-spring);
}
.hubThemeToggle:active {
  transform: scale(0.9) rotate(-20deg);
}

/* Login is always a deep blue night, in both themes */
body .authGate,
body #authGate {
  background: radial-gradient(circle at 50% 0%, #1d2a5c 0%, #0b0e1a 60%, #07080f 100%);
}

/* ───────── Dark theme adjustments ───────── */
:root[data-theme='dark'] .toast,
:root[data-theme='dark'] .profileAvatar,
:root[data-theme='dark'] .tabs button.active {
  color: var(--paper-0);
}
:root[data-theme='dark'] body .mobileNav {
  background: rgba(28, 28, 30, 0.82);
  box-shadow: none;
}
:root[data-theme='dark'] .card {
  border-color: var(--rule-1);
}
:root[data-theme='dark'] .btn.light {
  box-shadow: none;
}
:root[data-theme='dark'] img:not(.authQR) {
  opacity: 0.92;
}
.projectLocal {
  display: block;
  font-size: 0.9rem;
  font-weight: 450;
  color: var(--warn);
  line-height: 1.4;
}

/* Phone: the three totals become one compact card, one tappable row each */
@media (max-width: 640px) {
  body .dashMetrics {
    display: block;
    background: var(--paper-0);
    border: 1px solid var(--rule-1);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
  }
  body .dashMetrics .dashMetric {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1rem;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.85rem 1rem;
    min-height: 3.25rem;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: none;
  }
  body .dashMetrics .dashMetric + .dashMetric {
    border-top: 1px solid var(--rule-1);
  }
  body .dashMetrics .dashMetric .kpiWithCur {
    margin: 0;
  }
  body .dashMetrics .dashKpiNumber {
    font-size: 1.35rem;
  }
  /* The View button stretches over the whole row; a chevron shows it is tappable */
  body .dashMetrics .dashMetric .btn {
    position: static;
    padding: 0;
    min-height: 0;
    font-size: 0;
    background: none;
    border: 0;
    box-shadow: none;
    color: var(--ink-4);
  }
  /* No press-scale here: a transform would shrink the stretched tap area mid-tap */
  body .dashMetrics .dashMetric .btn,
  body .dashMetrics .dashMetric .btn:active,
  body .dashMetrics .dashMetric .btn:hover {
    transform: none;
  }
  body .dashMetrics .dashMetric .btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
  }
  body .dashMetrics .dashMetric .btn::after {
    content: '›';
    font-size: 1.4rem;
    line-height: 1;
  }
  body .dashMetrics .dashMetric:active {
    background: var(--paper-1);
  }
  body .dashMetrics .dashMetric .btn:focus-visible {
    outline: none;
  }
  body .dashMetrics .dashMetric:has(.btn:focus-visible) {
    box-shadow: inset 0 0 0 2px var(--accent);
  }
}

/* Logo is a link to Dashboard */
body a.brand {
  text-decoration: none;
  border-radius: 12px;
}
body a.brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---- Team (AirDrop-style): circles grouped by project ---- */
.teamPage {
  display: grid;
  gap: 1rem;
}
.teamHead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
body .teamHead .teamCompany {
  margin: 0.1rem 0 0;
  font-size: 1.35rem;
}
.teamActions {
  display: flex;
  gap: 0.5rem;
}
.teamActions .btn .hubIcon {
  width: 1.05em;
  height: 1.05em;
}
.teamHint {
  margin: -0.25rem 0.25rem 0;
}
.teamCard {
  padding: 0.5rem 1.25rem;
}
.teamGroup {
  padding: 1rem 0 1.1rem;
}
.teamGroup + .teamGroup {
  border-top: 1px solid var(--rule-1);
}
body .teamGroup .teamGroupTitle {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.teamGroupTitle span {
  margin-left: 0.35rem;
  color: var(--ink-4);
}
.teamRow {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 0.75rem;
}
body .teamPerson {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  width: 5.5rem;
  padding: 0.4rem 0.2rem;
  border: 0;
  border-radius: 14px;
  background: none;
  box-shadow: none;
  color: var(--ink-1);
  cursor: pointer;
  transition:
    transform 0.18s var(--ease-out),
    background-color 0.18s var(--ease-out);
}
body .teamPerson:hover {
  background: var(--paper-1);
}
body .teamPerson:active {
  transform: scale(0.94);
}
body .teamPerson:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.teamAvatar {
  --hue: 225;
  display: grid;
  place-items: center;
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(145deg, hsl(var(--hue) 75% 62%), hsl(calc(var(--hue) + 25) 70% 46%));
  color: #fff;
  font-weight: 650;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 14px hsl(var(--hue) 60% 45% / 0.25);
}
.teamAvatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.teamAvatar.isLarge {
  width: 5.5rem;
  height: 5.5rem;
  font-size: 1.8rem;
}
.teamName {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 600;
}
.teamSub {
  font-size: 0.72rem;
  color: var(--ink-3);
}
.teamPerson.isInvited .teamAvatar {
  opacity: 0.45;
}
.teamAdd .teamAvatar {
  background: none;
  border: 1.5px dashed var(--rule-2);
  box-shadow: none;
  color: var(--accent);
}
.teamAdd .teamAvatar .hubIcon {
  width: 1.4rem;
  height: 1.4rem;
}
.teamAdd .teamName {
  color: var(--accent);
}
/* Sheet + wizard */
.teamSheet,
.teamWizard {
  width: min(28rem, calc(100vw - 2rem));
}
.teamSheetHead {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  text-align: center;
  margin: 0.5rem 0 1rem;
}
.teamSheetHead h2 {
  margin: 0.5rem 0 0;
}
.teamSheetHead p {
  margin: 0;
}
.teamSheet .field,
.teamWizard .field {
  margin-bottom: 0.9rem;
}
.teamSheet .field input,
.teamWizard .field input {
  width: 100%;
}
.teamNote {
  text-align: center;
  color: var(--ink-3);
}
.teamProjects {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}
.teamProjects legend {
  margin-bottom: 0.35rem;
  font-weight: 600;
}
.teamCheck {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  border: 1px solid var(--rule-1);
  border-radius: 12px;
  cursor: pointer;
}
.teamCheck:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.teamSheetButtons {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1.25rem;
}
.teamSheetButtons .btn .hubIcon {
  width: 1em;
  height: 1em;
}
.teamChoices {
  display: grid;
  gap: 0.6rem;
}
body .teamChoice {
  display: grid;
  gap: 0.2rem;
  width: 100%;
  padding: 0.9rem 1rem;
  text-align: left;
  border: 1.5px solid var(--rule-1);
  border-radius: 14px;
  background: var(--paper-0);
  color: var(--ink-1);
  box-shadow: none;
  cursor: pointer;
  transition:
    border-color 0.18s var(--ease-out),
    background-color 0.18s var(--ease-out),
    transform 0.18s var(--ease-out);
}
body .teamChoice span {
  color: var(--ink-3);
  font-size: 0.88rem;
  font-weight: 400;
}
body .teamChoice small {
  margin-left: 0.4rem;
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.7rem;
  font-weight: 600;
}
body .teamChoice[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent-soft);
}
body .teamChoice:active {
  transform: scale(0.98);
}
.teamDots {
  display: flex;
  gap: 0.35rem;
  margin: 0.25rem 0 1rem;
}
.teamDots span {
  width: 1.5rem;
  height: 0.25rem;
  border-radius: 99px;
  background: var(--rule-1);
  transition: background-color 0.25s var(--ease-out);
}
.teamDots span.on {
  background: var(--accent);
}
.teamSummary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
  margin: 0;
}
.teamSummary dt {
  color: var(--ink-3);
}
.teamSummary dd {
  margin: 0;
  font-weight: 600;
}
.teamSent {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  padding: 1rem 0;
  text-align: center;
}
.teamSent > .hubIcon {
  width: 3rem;
  height: 3rem;
  padding: 0.6rem;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
}
.profileAvatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
@media (max-width: 640px) {
  .teamCard {
    padding: 0.25rem 1rem;
  }
  .teamRow {
    gap: 0.75rem 0.25rem;
  }
  body .teamPerson {
    width: 4.9rem;
  }
  /* Member sheet slides up from the bottom, like iOS */
  dialog.teamSheet,
  dialog.teamWizard {
    width: 100vw;
    max-width: none;
    margin: auto 0 0;
    border-radius: 20px 20px 0 0;
    animation: hubSheetIn 0.32s var(--ease-out);
  }
}

/* Team: "Everyone" list + faces under projects */
.teamActions {
  flex-wrap: wrap;
  align-items: center;
}
.teamList {
  padding: 0.25rem 0;
}
body .teamListRow {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.35rem 0.85rem;
  width: 100%;
  padding: 0.8rem 1.1rem;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--ink-1);
  text-align: left;
  cursor: pointer;
}
body .teamListRow + .teamListRow {
  border-top: 1px solid var(--rule-1);
}
body .teamListRow:hover {
  background: var(--paper-1);
}
.teamListText {
  display: grid;
  gap: 0.1rem;
}
.teamChips {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.teamChip {
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 600;
}
.teamAvatar.isSmall {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 0.9rem;
  grid-row: span 2;
}
.teamAvatar.isTiny {
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.62rem;
  border: 2px solid var(--paper-0);
  box-shadow: none;
}
body .projectFaces {
  display: flex;
  align-items: center;
  margin: 0.6rem 0 0.2rem;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  cursor: pointer;
}
.projectFaces .teamAvatar + .teamAvatar {
  margin-left: -0.45rem;
}
.projectFacesMore {
  margin-left: 0.35rem;
  font-size: 0.75rem;
  color: var(--ink-3);
}
@media (min-width: 900px) {
  body .teamListRow {
    grid-template-columns: auto 1fr auto;
  }
  .teamAvatar.isSmall {
    grid-row: auto;
  }
  .teamChips {
    grid-column: auto;
    justify-content: flex-end;
  }
}

/* Settings: profile & team card */
.profileRow {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.75rem 0 0.25rem;
}
.profileButtons {
  justify-content: flex-start;
  flex-wrap: wrap;
}
.teamSheetHead #teamResend {
  margin-top: 0.5rem;
}

/* Profile photo window */
.photoDialog {
  width: min(24rem, calc(100vw - 2rem));
  text-align: center;
}
.photoDialog h2 {
  margin-bottom: 1rem;
}
.photoDrop {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  padding: 1.5rem 1rem;
  border: 2px dashed var(--rule-2);
  border-radius: 20px;
  cursor: pointer;
  transition:
    border-color 0.18s var(--ease-out),
    background-color 0.18s var(--ease-out);
}
.photoDrop:hover,
.photoDrop.isOver {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.photoDrop:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.photoDropText {
  display: grid;
  gap: 0.15rem;
}
.teamAvatar.isHuge {
  width: 7rem;
  height: 7rem;
  font-size: 2.4rem;
}
.photoCanvas {
  display: block;
  width: min(15rem, 70vw);
  height: auto;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--paper-2);
  box-shadow:
    0 0 0 4px var(--paper-0),
    0 0 0 6px var(--accent-mid);
  cursor: grab;
  touch-action: none;
}
.photoCanvas:active {
  cursor: grabbing;
}
.photoCanvas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 8px;
}
.photoZoom {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0 0.25rem;
}
.photoZoom input {
  flex: 1;
  accent-color: var(--accent);
}
/* On a phone there is nothing to drag from: show only the button */
@media (pointer: coarse) {
  .photoDropText {
    display: none;
  }
}

/* Appearance card without the sample preview: one column */
body .appearanceGrid {
  grid-template-columns: minmax(0, 36rem);
}
/* Account menu header: photo + name */
.accountHeader {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.accountHeaderText {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}
.accountHeaderText span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.accountMenuAvatar:empty {
  display: none;
}
.authHint {
  font-weight: 400;
  color: var(--ink-3);
  font-size: 0.85em;
}

/* Settings: edit my name */
.profileName {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 1rem 0 0;
}
.profileName .field {
  flex: 1 1 14rem;
  margin: 0;
}
.profileName .field input {
  width: 100%;
}

/* Card last 4 digits + "Added by" on transactions */
.listAdd .last4 {
  width: 6.5rem;
  flex: 0 0 auto;
}
.authorTag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--ink-3);
}
.authorTag .teamAvatar.isTiny {
  width: 1.25rem;
  height: 1.25rem;
  font-size: 0.5rem;
  border: 0;
}

/* Approval: "Waiting for approval" panel */
.approvalPanel {
  border-color: var(--warn-line);
  background: linear-gradient(180deg, var(--warn-soft), var(--paper-0) 4.5rem);
  margin-bottom: 1rem;
}
body .approvalPanel h2 {
  margin: 0;
  font-size: 1.1rem;
}
.approvalPanel h2 span {
  margin-left: 0.35rem;
  padding: 0.05rem 0.5rem;
  border-radius: 99px;
  background: var(--warn-solid);
  color: #fff;
  font-size: 0.8rem;
}
.approvalRow {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.75rem 0;
}
.approvalRow + .approvalRow {
  border-top: 1px solid var(--rule-1);
}
.approvalMain {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}
.approvalNote {
  margin-top: 0.25rem;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  background: var(--warn-soft);
  color: var(--ink-1);
  font-size: 0.82rem;
}
.approvalActions {
  display: flex;
  gap: 0.4rem;
}
@media (max-width: 640px) {
  .approvalRow {
    grid-template-columns: 1fr auto;
  }
  .approvalActions {
    grid-column: 1 / -1;
  }
  .approvalActions .btn {
    flex: 1;
  }
}

/* Header bell with count */
body .hubBell {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--rule-1);
  border-radius: 50%;
  background: var(--paper-0);
  color: var(--ink-1);
  cursor: pointer;
}
body .hubBell[hidden] {
  display: none;
}
.hubBellIcon .hubIcon {
  width: 1.15rem;
  height: 1.15rem;
}
.hubBellCount {
  position: absolute;
  top: -0.2rem;
  right: -0.2rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 99px;
  background: var(--bad-solid);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.15rem;
  text-align: center;
}
@media (prefers-reduced-motion: no-preference) {
  body .hubBell:not([hidden]) {
    animation: hubBellIn 0.5s var(--ease-spring);
  }
}
@keyframes hubBellIn {
  from {
    transform: scale(0.6);
  }
}
.approvalRow.isRemoved .approvalNote {
  background: var(--paper-1);
}

/* Row "⋯" menu pops over the table instead of pushing the row */
body .finMenu[open] > div {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 20;
  margin: 0;
  padding: 0.35rem;
  min-width: 10rem;
  background: var(--paper-0);
  border: 1px solid var(--rule-1);
  border-radius: 12px;
  box-shadow: var(--shadow-lift);
}
body .finMenu[open] > div .btn {
  justify-content: flex-start;
  width: 100%;
}
.finRowActions {
  position: relative;
  flex-wrap: nowrap;
}

/* Notification center under the bell (Wealthsimple-style) */
.headerTools {
  position: relative;
}
.hubBellCount[hidden] {
  display: none;
}
.hubBellMenu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 60;
  width: min(24rem, calc(100vw - 1.5rem));
  max-height: min(70vh, 32rem);
  overflow: auto;
  padding: 0.5rem;
  background: var(--paper-0);
  border: 1px solid var(--rule-1);
  border-radius: 16px;
  box-shadow: var(--shadow-lift);
  animation: hubSheetIn 0.22s var(--ease-out);
}
.bellHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.5rem 0.6rem;
}
.bellRow {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.35rem 0.6rem;
  align-items: start;
  padding: 0.7rem 0.5rem;
  border-top: 1px solid var(--rule-1);
}
.bellDot {
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
}
.bellRow.is-approve .bellDot,
.bellRow.is-fix .bellDot {
  background: var(--warn-solid);
}
.bellRow.is-approved .bellDot {
  background: var(--ok-solid);
}
.bellRow.is-removed .bellDot {
  background: var(--ink-4);
}
.bellText {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
  font-size: 0.9rem;
}
.bellText .authorTag {
  margin: 0;
}
.bellActions {
  grid-column: 2 / -1;
  display: flex;
  gap: 0.4rem;
}
.bellEmpty {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  padding: 1.5rem 0.5rem;
  color: var(--ink-3);
}
.bellEmpty .hubIcon {
  width: 2rem;
  height: 2rem;
  padding: 0.4rem;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
}
@media (max-width: 640px) {
  .hubBellMenu {
    position: fixed;
    top: 4rem;
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
  }
}

/* Bell: close button, read items, footer link; Trash filters */
.bellHead {
  gap: 0.5rem;
}
.bellHead b {
  flex: 1;
}
.bellHead .dialogClose {
  position: static;
}
.bellRow.isRead {
  opacity: 0.6;
}
.bellRow.isRead .bellDot {
  background: var(--rule-2);
}
.bellRow.is-edited .bellDot {
  background: var(--accent);
}
.bellHome {
  width: 100%;
  margin-top: 0.25rem;
  border-top: 1px solid var(--rule-1);
  border-radius: 0 0 12px 12px;
}
.trashFilters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0.75rem;
  margin: 0.75rem 0;
}
.trashFilters .field {
  margin: 0;
}
.trashFilters input,
.trashFilters select {
  width: 100%;
}
@media (max-width: 640px) {
  .trashFilters {
    grid-template-columns: 1fr 1fr;
  }
  .trashFilters .field:first-child {
    grid-column: 1 / -1;
  }
}

/* Notifications: face + "Makar approved …" */
.bellWho {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}
.bellWho .teamAvatar.isTiny {
  flex: 0 0 auto;
  width: 1.3rem;
  height: 1.3rem;
  font-size: 0.5rem;
  border: 0;
}

/* Member card: extra access; Dashboard: by team member */
.teamPerms {
  margin: 1rem 0 0;
  padding: 0.75rem 0 0;
  border: 0;
  border-top: 1px solid var(--rule-1);
}
.teamPerms legend {
  padding: 0;
  font-weight: 600;
}
.byMemberRow {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0;
}
.byMemberRow + .byMemberRow {
  border-top: 1px solid var(--rule-1);
}
.byMemberName {
  display: grid;
  gap: 0.1rem;
}
.byMemberWaiting {
  color: var(--warn);
  font-weight: 600;
}
.byMemberNums {
  display: flex;
  gap: 1.25rem;
  text-align: right;
}
.byMemberNums span {
  display: grid;
}
.byMemberNums small {
  color: var(--ink-3);
  font-size: 0.72rem;
}
.byMemberRow .teamAvatar.isSmall {
  grid-row: auto;
}
@media (max-width: 640px) {
  .byMemberRow {
    grid-template-columns: auto 1fr;
  }
  .byMemberNums {
    grid-column: 1 / -1;
    justify-content: flex-start;
    text-align: left;
  }
}

/* Subscriptions: lighter rows, status pill, cancelled hidden by default */
.subHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.subShowCancelled {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--ink-3);
}
.subStatus {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.5rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  vertical-align: 0.1em;
}
.subStatus.is-active {
  background: var(--ok-soft);
  color: var(--ok);
}
.subStatus.is-paused {
  background: var(--warn-soft);
  color: var(--warn);
}
.subStatus.is-cancelled {
  background: var(--paper-2);
  color: var(--ink-3);
}
.finSubRow.isCancelled {
  opacity: 0.65;
}
.finSubRow {
  padding: 0.8rem 0;
}
[data-sub-delete] {
  margin-top: 0.5rem;
}

/* Phone: summary cards (Subscriptions, Money) become one compact block, like the Dashboard totals */
@media (max-width: 640px) {
  body .columns:has(> .card .kpiNum) {
    display: block;
    background: var(--paper-0);
    border: 1px solid var(--rule-1);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
  }
  body .columns:has(> .card .kpiNum) > .card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem 0.75rem;
    margin: 0;
    padding: 0.8rem 1rem;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  body .columns:has(> .card .kpiNum) > .card + .card {
    border-top: 1px solid var(--rule-1);
  }
  body .columns:has(> .card .kpiNum) .kpiNum {
    font-size: 1.3rem;
  }
}

/* ═══════════ Unslop layer (28.11.2026) ═══════════
   After unslop by Damir Sokolovsky (@heydamir), CC BY 4.0. Last in the cascade, so it wins.
   Direction — Product: bookkeeping for a small Canadian company, receipts in, money and deadlines out.
   Character: exact, calm, trustworthy. World: a bookkeeper's desk (light) / the same desk at night (dark).
   Moments: the money figures. Signature: the selection that slides along the sidebar. */

/* Pass 5 · Type: hierarchy from size and color, weights 400–500 (600 rare), sentence case */
body h1,
body #heading {
  font-weight: 500;
  font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
body h2,
body .card h2,
body .dashSectionTitle h2 {
  font-weight: 500;
  letter-spacing: -0.005em;
}
body h3 {
  font-weight: 500;
}
body .dashKpiNumber,
body .kpiNum,
body .stat,
body .previewAmount {
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
body .tagline,
body .authTagline,
body .eyebrow,
body .quietLabel,
body th,
body .teamGroup .teamGroupTitle,
body .dataTable th {
  text-transform: none;
  letter-spacing: 0;
}
body .tagline,
body .authTagline {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--ink-4);
}
body .teamGroup .teamGroupTitle {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-3);
}

/* Logo: the name plus a flat one-color mark (no gradient tile, no glow) */
body .brand::before {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 7px;
  background: var(--ink-0);
  color: var(--paper-0);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: none;
}
body .brand {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
body .brand b {
  color: var(--ink-4);
  font-weight: 500;
}

/* Pass 2 · Color: flat surfaces, hairlines, quiet shadows */
body {
  background: var(--paper-1);
}
body .card,
body .dashMetric {
  border: 1px solid var(--rule-1);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}
body .side {
  background: var(--paper-deep);
  border-right: 1px solid var(--rule-1);
}
/* Login: a calm graphite night instead of a blue glow */
body #authGate {
  background: #0f0f10;
}

/* Buttons: one accent, flat; hover = color, press = tiny scale */
body .btn {
  box-shadow: none;
  transition:
    background-color 0.15s var(--ease-out),
    border-color 0.15s var(--ease-out),
    color 0.15s var(--ease-out),
    transform 0.12s var(--ease-out);
}
body .btn:not(.light):not(.ghost):not(.danger):not(.dangerPrimary) {
  background: var(--accent-fill);
  box-shadow: none;
}
body .btn:not(.light):not(.ghost):not(.danger):not(.dangerPrimary):hover {
  background: var(--accent-strong);
  transform: none;
  box-shadow: none;
}
body .btn:active {
  transform: scale(0.98);
}
body .btn.light {
  background: var(--paper-0);
  border: 1px solid var(--rule-2);
  box-shadow: none;
}
body .btn.light:hover {
  background: var(--paper-2);
}
/* Dark: the primary button is an off-white from the ramp with dark text */
:root[data-theme='dark'] body .btn:not(.light):not(.ghost):not(.danger):not(.dangerPrimary) {
  background: var(--ink-1);
  color: #141415;
}
:root[data-theme='dark'] body .btn:not(.light):not(.ghost):not(.danger):not(.dangerPrimary):hover {
  background: #ffffff;
}
:root[data-theme='dark'] body .btn.light {
  background: var(--paper-2);
  border-color: var(--rule-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Focus: a visible ring for keyboard users, not a glow */
body input:focus-visible,
body select:focus-visible,
body textarea:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

/* Pass 9 · Motion: nothing moves on hover, no springs, no loops */
body .dashMetric:hover,
body .card:hover {
  transform: none;
  box-shadow: var(--shadow-card);
}
body .teamPerson:active {
  transform: scale(0.97);
}
body .hubBell:not([hidden]) {
  animation: none;
}

/* Pass 7 · Details: quiet badges and avatars */
body .teamAvatar {
  background: hsl(var(--hue) 38% 38%);
  box-shadow: none;
  font-weight: 500;
}
:root[data-theme='dark'] body .teamAvatar {
  background: hsl(var(--hue) 30% 34%);
}
body .approvalPanel {
  background: var(--paper-0);
  border-color: var(--warn-line);
}
body .approvalPanel h2 span,
body .countBadge {
  background: var(--warn-soft);
  color: var(--warn);
  font-weight: 500;
}
body .hubBellCount {
  font-weight: 600;
}

/* Signature: the selection slides along the sidebar (js/app/16-nav-pill.js draws .navPill) */
body .nav {
  position: relative;
  view-transition-name: hub-sidebar;
}
::view-transition-group(hub-sidebar),
::view-transition-old(hub-sidebar),
::view-transition-new(hub-sidebar) {
  animation: none;
}
::view-transition-old(hub-sidebar) {
  display: none;
}
body .nav button.active,
body .nav > button.active {
  view-transition-name: none;
}
body .nav button {
  position: relative;
  z-index: 1;
  min-height: 36px;
  border-radius: 8px;
  font-weight: 400;
  color: var(--ink-3);
}
body .nav button:hover {
  background: color-mix(in srgb, var(--ink-1) 4%, transparent);
  color: var(--ink-1);
}
body .nav button.active,
body .nav button.active:hover {
  color: var(--ink-0);
  font-weight: 500;
}
body .nav.hasPill button.active {
  background: transparent;
  box-shadow: none;
}
body .nav button.active .hubIcon {
  color: var(--accent);
}
.navPill {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1px var(--rule-1);
}
:root[data-theme='dark'] .navPill {
  background: linear-gradient(180deg, #2b2b2e, #232325);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Dark · floating layers are frosted glass (and only they are) */
:root[data-theme='dark'] body .hubAccountMenu,
:root[data-theme='dark'] body .hubBellMenu,
:root[data-theme='dark'] body .finMenu[open] > div,
:root[data-theme='dark'] body .mobileMoreSheet,
:root[data-theme='dark'] body .mobileNav {
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-lift);
}
:root[data-theme='dark'] body .mobileNav {
  border-width: 1px 0 0;
}

/* ═══════════ Glass themes (28.11.2026) — owner's choice from reference videos ═══════════
   Light = video 4 (frosted glass over a warm room). Dark = video 5 (graphite glass, red accent).
   Backdrops are drawn in CSS (no photos): soft shapes that read as a blurred room / a night with warm light. */

/* Backdrop: a fixed layer behind everything */
html {
  background: var(--paper-1);
  scrollbar-gutter: stable; /* pages with and without a scrollbar no longer shift 7px sideways */
}
/* body must be transparent: its own background would paint over the backdrop layer */
html body {
  background: transparent;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* A blurred room: window light, lamp, sofa, plant, wall and floor */
  background:
    radial-gradient(30% 42% at 80% 16%, rgba(255, 252, 242, 1), rgba(255, 252, 242, 0) 70%),
    radial-gradient(9% 13% at 64% 44%, rgba(255, 226, 170, 0.85), transparent 70%),
    radial-gradient(62% 30% at 24% 100%, rgba(146, 112, 72, 0.8), transparent 72%),
    radial-gradient(40% 22% at 30% 82%, rgba(214, 196, 166, 0.9), transparent 70%),
    radial-gradient(20% 42% at 96% 74%, rgba(70, 96, 68, 0.62), transparent 70%),
    radial-gradient(26% 30% at 6% 26%, rgba(150, 160, 150, 0.55), transparent 70%),
    linear-gradient(180deg, #b7bfb7 0%, #cbc6ba 56%, #b49b78 100%);
}
:root[data-theme='dark'] body::before {
  /* A room at night: cool window light on the left, warm lamps and city bokeh on the right */
  background:
    radial-gradient(28% 50% at 8% 34%, rgba(110, 140, 175, 0.34), transparent 70%),
    radial-gradient(22% 30% at 84% 18%, rgba(255, 150, 80, 0.32), transparent 70%),
    radial-gradient(5% 7% at 72% 30%, rgba(255, 196, 120, 0.55), transparent 70%),
    radial-gradient(3% 4% at 90% 44%, rgba(255, 120, 90, 0.5), transparent 70%),
    radial-gradient(4% 5% at 62% 58%, rgba(255, 210, 150, 0.32), transparent 70%),
    radial-gradient(3% 4% at 95% 70%, rgba(140, 180, 255, 0.35), transparent 70%),
    radial-gradient(60% 34% at 50% 104%, rgba(60, 44, 34, 0.7), transparent 72%),
    linear-gradient(180deg, #1c222b 0%, #12161c 55%, #0d0f13 100%);
}

/* Glass panels: cards, sidebar, header tools, floating layers */
body .card,
body .dashMetric,
body .side,
body .hubAccountMenu,
body .hubBellMenu,
body .finMenu[open] > div,
body .mobileMoreSheet,
body .mobileNav {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line);
  box-shadow: var(--shadow-card);
}
body .card,
body .dashMetric {
  border-radius: var(--radius-card);
  transition:
    background-color 0.25s var(--ease-out),
    border-color 0.25s var(--ease-out);
}
/* A panel inside a panel: lighter, no second blur (cheaper, calmer) */
body .card .card {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: color-mix(in srgb, var(--paper-0) 42%, transparent);
  box-shadow: none;
}
/* Hover: the glass brightens a little; nothing moves */
body .card:hover {
  background: var(--glass-hover);
}
body .hubAccountMenu,
body .hubBellMenu,
body .finMenu[open] > div,
body .mobileMoreSheet {
  background: var(--glass-strong);
  box-shadow: var(--shadow-lift);
}

/* Floating glass sidebar (desktop) */
@media (min-width: 1051px) {
  body .side {
    position: sticky;
    top: 12px;
    height: calc(100dvh - 24px);
    margin: 12px 0 12px 12px;
    border-radius: 26px;
  }
}
body .side {
  border-right: 1px solid var(--glass-line);
}

/* Inputs read as glass too, solid enough to type on */
body input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']),
body select,
body textarea {
  background: color-mix(in srgb, var(--paper-0) 72%, transparent);
  /* Visible edge on the plain white cards: 3.3:1 against paper (WCAG 1.4.11); the white glass line vanished */
  border-color: #958b7c;
}
:root[data-theme='dark']
  body
  input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']),
:root[data-theme='dark'] body select,
:root[data-theme='dark'] body textarea {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}
/* Dialogs stay solid (forms need calm), with the theme's radius */
body dialog.workspaceDialog {
  background: var(--paper-0);
  border-radius: 22px;
}

/* Sidebar selection: light = bright glass pill; dark = the red pill from video 5 */
.navPill {
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    0 1px 2px rgba(60, 48, 30, 0.08),
    0 6px 16px rgba(60, 48, 30, 0.1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.9);
}
:root[data-theme='dark'] .navPill {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent-fill));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 8px 24px var(--accent-glow);
}
:root[data-theme='dark'] body .nav button.active,
:root[data-theme='dark'] body .nav button.active:hover,
:root[data-theme='dark'] body .nav button.active .hubIcon {
  color: var(--accent-on);
}
body .nav button:hover {
  background: color-mix(in srgb, var(--paper-0) 40%, transparent);
}
:root[data-theme='dark'] body .nav button:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Dark primary button: the red accent (video 5); light keeps the brand blue */
:root[data-theme='dark'] body .btn:not(.light):not(.ghost):not(.danger):not(.dangerPrimary) {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent-fill));
  color: var(--accent-on);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 6px 18px var(--accent-glow);
}
:root[data-theme='dark'] body .btn:not(.light):not(.ghost):not(.danger):not(.dangerPrimary):hover {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent-hi));
}
body .btn.light {
  background: color-mix(in srgb, var(--paper-0) 70%, transparent);
  border-color: var(--glass-line);
}
:root[data-theme='dark'] body .btn.light {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}
/* Header round buttons and avatar sit on glass too */
body .hubBell,
body .hubThemeToggle,
body #hubHelp,
body .profileButton {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-color: var(--glass-line);
}

/* Money moments: Revenue / Expenses / Net figures a touch larger */
body .dashKpiNumber {
  font-size: clamp(1.9rem, 1.5rem + 1vw, 2.5rem);
}
/* Report bars (Money → Financial reports): the accent, softly lit in dark like video 5 */
:root[data-theme='dark'] body .finBarFill.expense {
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent-fill) 45%, black), var(--accent-hi));
}

/* ── Motion (a little more, never bouncy) ── */
/* Page change: cards arrive in a short wave (first 8, 45 ms apart) */
@media (prefers-reduced-motion: no-preference) {
  body .hubEnter {
    animation: hubCardIn 0.5s var(--ease-out) backwards; /* backwards: no transform stays behind, so menus inside position against the window */
    animation-delay: calc(var(--i, 0) * 45ms);
  }
  body .finBarFill {
    transform-origin: left center;
    animation: hubBarGrow 0.7s var(--ease-out) both;
  }
}
@keyframes hubCardIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}
@keyframes hubBarGrow {
  from {
    transform: scaleX(0);
  }
}

/* Phone: no floating sidebar; the compact totals block is glass too */
@media (max-width: 640px) {
  body .dashMetrics {
    background: var(--glass);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-line);
    border-radius: 20px;
  }
  body .dashMetrics .dashMetric {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: none;
    border: 0;
    box-shadow: none;
  }
}

/* ── Dashboard moments: icon tiles on the totals, spending chart ── */
body .dashMetric > .muted:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}
body .dashMetric > .muted:first-child::before {
  content: '';
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background-color: var(--tile, var(--accent));
  -webkit-mask: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  background-image: var(--tile-icon);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px;
}
body .dashMetric.metricIn {
  --tile: #22a35a;
  --tile-icon: 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.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M5 12l7-7 7 7'/%3E%3C/svg%3E");
}
body .dashMetric.metricOut {
  --tile: var(--accent-fill);
  --tile-icon: 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.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12l7 7 7-7'/%3E%3C/svg%3E");
}
body .dashMetric.metricNet {
  --tile: #8b5cf6;
  --tile-icon: 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.4' stroke-linecap='round'%3E%3Cpath d='M5 9h14M5 15h14'/%3E%3C/svg%3E");
}

.hubMonthHead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
body .hubMonthChart h2 {
  margin: 0 0 4px;
}
.hubMonthVs {
  color: var(--ink-3);
}
.hubMonthNow .kpiCur {
  margin-inline-start: 0.3rem;
}
.hubMonthNow {
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hubMonthBars {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  align-items: end;
  height: 210px;
  padding-top: 8px;
  border-bottom: 1px solid var(--rule-1);
}
.hubMonthCol {
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  align-items: end;
  height: 100%;
  gap: 6px;
}
.hubMonthBar {
  width: min(56px, 70%);
  height: var(--h);
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 55%, transparent),
    color-mix(in srgb, var(--accent) 22%, transparent)
  );
}
.hubMonthCol.isNow .hubMonthBar {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent-fill));
  box-shadow: 0 8px 22px var(--accent-glow);
}
:root[data-theme='dark'] .hubMonthCol.isNow .hubMonthBar {
  box-shadow: 0 0 26px var(--accent-glow);
}
.hubMonthVal {
  font-size: 0.72rem;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hubMonthLabel {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--ink-4);
  transform: translateY(26px);
}
.hubMonthBars {
  margin-bottom: 28px;
}
@media (prefers-reduced-motion: no-preference) {
  .hubMonthChart:not(.noAnim) .hubMonthBar {
    transform-origin: bottom;
    animation: hubBarUp 0.8s var(--ease-out) both;
    animation-delay: calc(200ms + var(--d, 0ms));
  }
}
@keyframes hubBarUp {
  from {
    transform: scaleY(0);
  }
}

/* ── Phone ── */
@media (max-width: 640px) {
  /* Title and the round buttons share one row */
  body .top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
  }
  body .top h1,
  body #heading {
    font-size: 1.6rem;
  }
  body .headerTools {
    flex-wrap: nowrap;
    gap: 6px;
    margin: 0;
  }
  body .headerTools .hubBell,
  body .headerTools .hubThemeToggle,
  body .headerTools #hubHelp {
    width: 36px;
    height: 36px;
    min-height: 36px;
  }
  /* The two filters side by side */
  body .main .dashIntro .dashActions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  body .main .dashIntro .dashActions .finFilter {
    min-width: 0;
    width: auto;
    margin: 0;
  }
  body .dashActions select {
    width: 100%;
  }
  /* Floating glass tab bar, like iOS */
  body .mobileNav {
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    border-radius: 26px;
    border: 1px solid var(--glass-line);
    box-shadow: var(--shadow-lift);
  }
  :root[data-theme='dark'] body .mobileNav {
    border-width: 1px;
  }
  body .main {
    padding-bottom: 110px;
  }
  body .card {
    border-radius: 20px;
  }
  .hubMonthBars {
    height: 170px;
    gap: 6px;
  }
  .hubMonthVal {
    visibility: hidden;
  }
  .hubMonthHead {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .hubMonthNow {
    font-size: 1.3rem;
  }
}

/* ═══════════ Themes: palettes + backgrounds (like Telegram / Instagram chat themes) ═══════════
   js/app/17-themes.js sets the accent variables and html[data-bg]. "scene" = the room (light) / night room (dark). */
/* Figures use the number font (tabular) */
body .dashKpiNumber,
body .kpiNum,
body .hubMonthNow,
body .amountOut,
body .amountIn,
body .byMemberNums b,
body .finTable td:nth-child(4) b {
  font-family: var(--font-num);
}
body {
  font-family: var(--font-ui);
}

/* Plain: one calm color */
:root[data-bg='plain'] body::before {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, #f6f4f0), #efece6);
}
:root[data-theme='dark'][data-bg='plain'] body::before {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, #12151a), #0c0e12);
}

/* Aurora: soft colored light from the palette, drifting slowly */
:root[data-bg='aurora'] body::before {
  inset: -10%;
  background:
    radial-gradient(40% 50% at 18% 22%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 70%),
    radial-gradient(
      38% 48% at 82% 26%,
      color-mix(in srgb, var(--accent-hi) 38%, #ffd2a8 22%),
      transparent 70%
    ),
    radial-gradient(46% 52% at 60% 92%, color-mix(in srgb, var(--accent) 28%, #a8e0d2 30%), transparent 72%),
    linear-gradient(180deg, #f3f1ee, #e9e6f0);
}
:root[data-theme='dark'][data-bg='aurora'] body::before {
  background:
    radial-gradient(40% 50% at 18% 22%, color-mix(in srgb, var(--accent) 40%, transparent), transparent 70%),
    radial-gradient(
      38% 48% at 82% 26%,
      color-mix(in srgb, var(--accent-hi) 26%, #6b3a8a 20%),
      transparent 70%
    ),
    radial-gradient(46% 52% at 60% 92%, color-mix(in srgb, var(--accent) 22%, #1d5b6b 30%), transparent 72%),
    linear-gradient(180deg, #13161c, #0b0d11);
}
@media (prefers-reduced-motion: no-preference) {
  :root[data-bg='aurora'] body::before {
    animation: hubAurora 40s ease-in-out infinite alternate;
  }
}
@keyframes hubAurora {
  to {
    transform: translate3d(2%, -2%, 0) scale(1.06);
  }
}

/* Doodles: a pattern of small bookkeeping icons over a palette gradient (Telegram style) */
:root[data-bg='doodles'] body::before {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' fill='none' stroke='%23000' stroke-opacity='.09' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 18h22v30l-5-3-6 3-6-3-5 3z M25 26h12 M25 33h9'/%3E%3Ccircle cx='120' cy='30' r='12'/%3E%3Cpath d='M120 23v14 M116 26h6a3 3 0 0 1 0 6h-4a3 3 0 0 0 0 6h6'/%3E%3Crect x='60' y='80' width='38' height='24' rx='4'/%3E%3Cpath d='M60 88h38 M66 98h8'/%3E%3Cpath d='M140 90v22 M150 100v12 M130 104v8 M126 116h30'/%3E%3Cpath d='M24 130l10 10 18-22'/%3E%3Crect x='100' y='140' width='22' height='28' rx='3'/%3E%3Cpath d='M105 148h12 M105 155h12 M105 162h6'/%3E%3Cpath d='M160 150l8-8 M166 142h2v2'/%3E%3C/svg%3E"),
    linear-gradient(
      160deg,
      color-mix(in srgb, var(--accent) 22%, #f4efe6),
      color-mix(in srgb, var(--accent-hi) 16%, #e8efe9)
    );
  background-size:
    180px 180px,
    cover;
}
:root[data-theme='dark'][data-bg='doodles'] body::before {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' fill='none' stroke='%23fff' stroke-opacity='.07' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 18h22v30l-5-3-6 3-6-3-5 3z M25 26h12 M25 33h9'/%3E%3Ccircle cx='120' cy='30' r='12'/%3E%3Cpath d='M120 23v14 M116 26h6a3 3 0 0 1 0 6h-4a3 3 0 0 0 0 6h6'/%3E%3Crect x='60' y='80' width='38' height='24' rx='4'/%3E%3Cpath d='M60 88h38 M66 98h8'/%3E%3Cpath d='M140 90v22 M150 100v12 M130 104v8 M126 116h30'/%3E%3Cpath d='M24 130l10 10 18-22'/%3E%3Crect x='100' y='140' width='22' height='28' rx='3'/%3E%3Cpath d='M105 148h12 M105 155h12 M105 162h6'/%3E%3Cpath d='M160 150l8-8 M166 142h2v2'/%3E%3C/svg%3E"),
    linear-gradient(
      160deg,
      color-mix(in srgb, var(--accent) 26%, #11141a),
      color-mix(in srgb, var(--accent-hi) 12%, #0b0d11)
    );
  background-size:
    180px 180px,
    cover;
}

/* Your photo: blur and dim are set in Settings */
:root[data-bg='photo'] body::before {
  inset: -60px;
  background:
    var(--bg-photo) center / cover no-repeat,
    #888;
  filter: blur(var(--bg-blur, 18px)) brightness(var(--bg-dim, 1));
}

/* Settings: theme picker */
.lookSwatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
}
body .lookSwatch {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 8px 6px 6px;
  border: 1px solid var(--rule-1);
  border-radius: 14px;
  background: color-mix(in srgb, var(--paper-0) 60%, transparent);
  color: var(--ink-2);
  font-size: 0.8rem;
  cursor: pointer;
  transition:
    border-color 0.15s var(--ease-out),
    background-color 0.15s var(--ease-out);
}
body .lookSwatch[aria-pressed='true'] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
}
.lookChip {
  display: flex;
  width: 52px;
  height: 34px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.lookChip span {
  flex: 1;
}
.lookBgs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}
body .lookBg {
  display: grid;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--rule-1);
  border-radius: 14px;
  background: color-mix(in srgb, var(--paper-0) 60%, transparent);
  color: var(--ink-2);
  font-size: 0.8rem;
  cursor: pointer;
}
body .lookBg[aria-pressed='true'] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
}
.lookBgPreview {
  height: 54px;
  border-radius: 10px;
  background-size: cover;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.lookRow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.lookRow input[type='range'] {
  width: 100%;
  accent-color: var(--accent);
}
.lookSection + .lookSection {
  margin-top: 20px;
}
.lookSection h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

/* The More sheet sits inside the glass tab bar, where a second blur cannot work: make it nearly solid */
body .mobileNav .mobileMoreSheet {
  background: rgba(255, 253, 249, 0.97);
}
:root[data-theme='dark'] body .mobileNav .mobileMoreSheet {
  background: rgba(30, 35, 43, 0.97);
}

/* Dropdown lists: the system list is painted by the OS, so options need a solid background in every theme */
body select option,
body select optgroup {
  background-color: var(--paper-0);
  color: var(--ink-1);
}

/* ── Typography (one family + mono for meta) ──
   Onest for everything people read; small muted meta (dates, currency, counts,
   chart labels and comparisons. Money is Onest with tabular figures. */
body #heading,
body .top h1 {
  font-size: clamp(1.75rem, 1.4rem + 1.1vw, 2.25rem);
  font-weight: 500;
  letter-spacing: -0.03em;
}
body .card h2,
body .dashSectionTitle h2 {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
body .dashKpiNumber,
body .hubMonthNow {
  font-weight: 500;
  letter-spacing: -0.035em;
  font-feature-settings: 'tnum' 1;
}
body .kpiCur,
body .hubMonthLabel,
body .hubMonthVal,
body .hubMonthVs,
body .countBadge,
body .dashDays,
body .finTable td:first-child,
body .byMemberRow .muted.small,
body .bellText .muted.small,
body .approvalMain .muted.small,
body .teamSub,
body .sidenote,
body .tagline,
body .dashMetric > .muted:first-child {
  font-family: var(--font-meta);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
body .kpiCur,
body .hubMonthLabel,
body .hubMonthVal,
body .countBadge,
body .finTable td:first-child,
body .sidenote,
body .tagline {
  font-size: 0.75rem;
}
body .dashMetric > .muted:first-child {
  font-size: 0.8rem;
  text-transform: none;
}

/* Login sits on a dark night in every theme: its small text uses light inks, not the page tokens */
body #authGate .authTagline,
body #authGate .authFooter {
  color: #b9b4ad;
}

/* ═══════════ Review fixes (impeccable + taste-skill) ═══════════ */
/* Keyboard: first Tab lands on "Skip to content" */
.skipLink {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink-0);
  color: var(--paper-0);
  font-weight: 500;
  transform: translateY(-160%);
  transition: transform 0.18s var(--ease-out);
}
.skipLink:focus-visible {
  transform: none;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
#view:focus {
  outline: none;
}
/* One visible focus ring for every control */
body button:focus-visible,
body a:focus-visible,
body summary:focus-visible,
body select:focus-visible,
body input:focus-visible,
body textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Net tile: no violet in our own design (taste-skill); graphite like the ink */
body .dashMetric.metricNet {
  --tile: #3f4650;
}
:root[data-theme='dark'] body .dashMetric.metricNet {
  --tile: #5b6573;
}

/* Clickable cards answer the pointer: a 2px lift (desktop only, never on touch) */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  body .dashMetric,
  body .dashProjectCard,
  body .teamListRow {
    transition:
      transform 0.2s var(--ease-out),
      background-color 0.2s var(--ease-out),
      box-shadow 0.2s var(--ease-out);
  }
  body .dashMetric:hover,
  body .dashProjectCard:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lift);
  }
}

/* Checkboxes big enough to hit */
body input[type='checkbox']:not(.v12-toggle input) {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

/* Phone: touch targets at least 40–44px with 8px between them */
@media (max-width: 640px) {
  body .headerTools {
    gap: 8px;
  }
  body .headerTools .hubBell,
  body .headerTools .hubThemeToggle,
  body .headerTools #hubHelp,
  body .headerTools .profileButton {
    width: 40px;
    height: 40px;
    min-height: 40px;
  }
  body .txNotes summary,
  body details.finFilters > summary,
  body .advancedSettings > summary,
  body details > summary {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  body .finMenu summary {
    width: 44px;
    height: 44px;
  }
  body .btn {
    min-height: 44px;
  }
  body .btn.sm {
    min-height: 40px;
  }
}
@media (max-width: 640px) {
  /* Long page names still leave room for the round buttons on one row */
  body .top h1,
  body #heading {
    font-size: 1.4rem;
  }
  /* Money filters: Period and Type side by side, search below */
  body .main .finFilters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  body .main .finFilters .finFilter {
    min-width: 0;
    margin: 0;
  }
  body .main .finFilters .finSearchBox {
    grid-column: 1 / -1;
  }
  body .main .finFilters select,
  body .main .finFilters input {
    width: 100%;
  }
}

/* ═══════════ Smart Inbox as steps (Resend style) ═══════════ */
.hubSteps {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  position: relative;
}
.hubStep {
  position: relative;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 16px;
  padding-bottom: 24px;
}
/* The line that joins the steps; it turns green under finished ones */
.hubStep:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 34px;
  bottom: 2px;
  width: 2px;
  border-radius: 2px;
  background: var(--rule-2);
}
.hubStep.is-done:not(:last-child)::before {
  background: color-mix(in srgb, var(--ok-solid) 55%, transparent);
}
.hubStepMark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--rule-2);
  background: color-mix(in srgb, var(--paper-0) 70%, transparent);
  color: var(--ink-4);
  font-family: var(--font-meta);
  font-size: 0.8rem;
  font-weight: 500;
}
.hubStepMark .hubIcon {
  width: 16px;
  height: 16px;
  stroke-width: 2.4;
}
.hubStep.is-done .hubStepMark {
  border-color: transparent;
  background: var(--ok-solid);
  color: #fff;
}
.hubStep.is-now .hubStepMark {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
.hubStepBody {
  min-width: 0;
  padding: 4px 0 0;
}
.hubStepHead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}
body .hubStepHead h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
}
.hubStepHead .muted {
  font-family: var(--font-meta);
  font-size: 0.75rem;
}
.hubStep.is-next .hubStepHead h3 {
  color: var(--ink-4);
}
/* The active step sits on its own soft panel, like Resend's highlighted card */
.hubStepContent {
  margin-top: 12px;
}
.hubStep.is-now .hubStepContent {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--glass-line);
  background: color-mix(in srgb, var(--paper-0) 55%, transparent);
}
.hubStep.is-done .hubStepContent {
  padding: 12px 16px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--ok-soft) 70%, transparent);
}
.hubStep.is-done .inboxAiNote {
  margin: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .hubStep.is-done .hubStepMark {
    animation: hubStepDone 0.4s var(--ease-out);
  }
}
@keyframes hubStepDone {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
}
@media (max-width: 640px) {
  .hubStep {
    grid-template-columns: 28px 1fr;
    gap: 12px;
  }
  .hubStepMark {
    width: 28px;
    height: 28px;
  }
  .hubStep:not(:last-child)::before {
    left: 13px;
    top: 30px;
  }
  .hubStep.is-now .hubStepContent {
    padding: 12px;
  }
}
/* Size and time live in the "Uploaded" step, so the head keeps just the name and actions */
.inboxSteps .inboxFile .muted.small {
  display: none;
}
.inboxSteps .inboxFile b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inboxSteps .inboxFile {
  min-width: 0;
}
@media (max-width: 640px) {
  body .inboxSteps .inboxReviewHead {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
  }
  body .inboxSteps .inboxReviewHead .row {
    flex-wrap: nowrap;
    gap: 4px;
    flex: 0 0 auto;
  }
  body .inboxSteps .inboxFile {
    flex: 1 1 auto;
  }
  /* Document type: a 2 × 2 grid instead of a tall column */
  body .inboxForm .segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }
}

/* Avatars are always circles: never shrink or stretch next to long text */
body .teamAvatar {
  flex: 0 0 auto;
  align-self: center;
  aspect-ratio: 1;
}
body .profileRow {
  align-items: center;
  min-width: 0;
}
body .profileRow > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 640px) {
  body .profileRow .teamAvatar.isLarge {
    width: 64px;
    height: 64px;
    font-size: 1.4rem;
  }
}
/* iOS switches: the switch and its label stay on one line */
body .v12-toggle {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
}
body .v12-toggle input {
  flex: 0 0 auto;
  margin: 0;
}

/* Bank statement matching (js/app/18-launch-tools.js) */
.hubBankDialog {
  width: min(760px, calc(100vw - 24px));
}
.hubBankDialog .line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.hubBankRight {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  text-align: right;
}

/* Phone: folders two per row so the list does not run several screens long. */
@media (max-width: 560px) {
  .docsTiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }
  .docsTile {
    min-width: 0;
  }
  .docsTile b {
    min-width: 0;
    overflow-wrap: anywhere; /* long names like OpenAI_API_Invoices */
  }
}

/* First run for new entrepreneurs (js/app/19-start.js) */
.startBar {
  height: 6px;
  border-radius: 6px;
  background: var(--paper-2);
  overflow: hidden;
  margin: 0.25rem 0 0.75rem;
}
.startBar span {
  display: block;
  height: 100%;
  background: var(--accent);
}
.startList {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}
.startList label {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.55rem 0.25rem;
  cursor: pointer;
}
.startList input {
  margin-top: 0.2rem;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
}
.startList span {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}
.startList small {
  color: var(--ink-3);
  line-height: 1.4;
}
.startList li.isDone b {
  text-decoration: line-through;
  color: var(--ink-3);
}
.startDates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.75rem 0;
  padding: 0.75rem;
  border-radius: 12px;
  background: var(--paper-1);
}
.startQ {
  margin: 1rem 0 0.4rem;
  font-weight: 600;
}

.startCard {
  margin-bottom: 1rem;
}
.startSeg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  width: 100%;
}
.startSeg label {
  min-width: 0;
  justify-content: center;
  text-align: center;
}
.startSeg label span {
  padding-inline: 0.2rem;
  white-space: nowrap;
  font-size: 0.92em;
}

/* Deadlines list: long notes never squeeze the title on phone */
.v12-deadline-line > .grow {
  flex: 1 1 260px;
  min-width: 0;
}
.dlNote {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

/* Settings: cards without .section had no gap and touched the card above */
.profileCard,
.appearanceCard {
  margin-top: 18px;
}
@media (max-width: 560px) {
  .v12-deadline-actions {
    flex-wrap: nowrap;
    gap: 4px;
  }
  .v12-deadline-actions .btn {
    padding-inline: 10px;
  }
}

/* Transactions on desktop: the table fits its card instead of showing a sideways scrollbar.
   Name and project wrap; date, amount, status and buttons stay on one line. */
@media (min-width: 1201px) {
  body .finTable {
    min-width: 0;
  }
  body .finTable td:nth-child(2) {
    min-width: 8rem;
  }
  body .finTable td:nth-child(2),
  body .finTable td:nth-child(3) {
    overflow-wrap: anywhere;
  }
  body .finTable td:nth-child(1),
  body .finTable td:nth-child(4),
  body .finTable td:nth-child(5),
  body .finTable td:nth-child(6),
  body .finTable .finRowActions .btn {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* ───────── Compact density (owner's choice 29.11.2026): more on one screen, same look ───────── */
body .card {
  padding: clamp(0.75rem, 1.1vw, 1rem);
}
body .section {
  margin-top: 14px;
}
body .card h2 {
  margin-bottom: 0.5rem;
}
body .dashMetric {
  min-height: 0;
  padding: 0.8rem 1rem;
  gap: 4px;
}
.hubMonthBars {
  height: 130px;
  margin-bottom: 20px;
}
@media (max-width: 760px) {
  .hubMonthBars {
    height: 110px;
  }
}
/* Mouse screens: the "View →" link in money tiles needs no 44px touch height */
@media (pointer: fine) and (min-width: 761px) {
  body .dashMetric .btn.sm {
    min-height: 0;
    padding-block: 2px;
  }
}
/* Dashboard filters moved into the title row on wide screens (js/app/19-start.js) */
body .main .top > .dashIntro {
  flex: none;
  margin: 0 12px 0 auto;
}
body .main .top > .dashIntro .dashActions {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  margin: 0;
}
body .main .top > .dashIntro .finFilter {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin: 0;
  width: auto;
  flex: none; /* an older rule fixed each filter at 176px, so the select spilled onto the next label */
}
body .main .top > .dashIntro select {
  width: 10rem;
  flex: none;
  border-color: #958b7c; /* same visible edge as every other field (3.3:1) */
}
:root[data-theme='dark'] body .main .top > .dashIntro select {
  border-color: rgba(255, 255, 255, 0.1);
}
body .main .top > .dashIntro .finFilter > span {
  flex: none;
  width: auto;
}

/* Funding (js/app/20-funding.js): one row per program inside a section card */
.fundList,
.fundAdmin {
  list-style: none;
  margin: 0;
  padding: 0;
}
.fundRow {
  padding: 14px 0;
  border-top: 1px solid var(--paper-2);
}
.fundRow:first-child {
  border-top: 0;
  padding-top: 4px;
}
.fundRow.isMuted {
  opacity: 0.6;
}
.fundRow p {
  margin: 6px 0 0;
  max-width: 72ch;
}
.fundHead {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
}
.fundHead h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}
.fundAmount {
  font-weight: 600;
}
.fundNote {
  padding: 8px 10px;
  border: 1px solid var(--paper-2);
  border-radius: 8px;
  font-size: 0.9em;
}
.fundNeeds summary,
.fundMore > summary {
  cursor: pointer;
}
.fundNeeds {
  margin-top: 6px;
}
.fundMore > summary {
  list-style: none;
}
.fundMore > summary h2 {
  display: inline;
  margin: 0;
}
.fundMore > summary::-webkit-details-marker {
  display: none;
}
.fundActions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px 12px;
  margin-top: 10px;
}
.fundActions .finFilter {
  margin: 0;
}
.fundFoot {
  margin: 14px 4px 0;
}
.fundAdmin li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--paper-2);
}
.fundAdmin li span {
  display: grid;
  min-width: 0;
}
.fundHead > div {
  min-width: 0;
}
.fundHead .countBadge {
  flex: none;
}
.fundNeeds summary {
  color: var(--accent);
  font-weight: 500;
}
@media (max-width: 560px) {
  .fundActions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .fundActions .finFilter select,
  .fundActions .finFilter input {
    width: 100%;
    min-width: 0;
  }
  .fundActions > .muted {
    grid-column: 1 / -1;
  }
}
.fundActions .btn {
  white-space: nowrap;
}

/* ───────── Your path (js/app/21-path.js): one smooth road, steps, chests, Loonie ───────── */
.pathPage {
  max-width: 560px;
  margin: 0 auto;
  --gold: #e0a422;
  --gold-ink: #5c3d00;
  --money-free: #a86a00;
  --money-loan: #0f7a5c;
  --money-tax: #5b4bc4;
  --money-wage: #1f5fbf;
}
.pathDeck {
  --money-free: #a86a00;
  --money-loan: #0f7a5c;
  --money-tax: #5b4bc4;
  --money-wage: #1f5fbf;
}
:root[data-theme='dark'] .pathPage,
:root[data-theme='dark'] .pathDeck {
  --money-free: #f2b84b;
  --money-loan: #4fd1a5;
  --money-tax: #a89cff;
  --money-wage: #7fb2ff;
}
.pathCoach {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 12px;
}
.loonie {
  width: 76px;
  height: 76px;
  flex: none;
}
.lnBody {
  fill: #8a5a35;
}
.lnTail {
  fill: #5b3a21;
}
.lnBelly,
.lnMuzzle {
  fill: #d9b48a;
}
.lnEye {
  fill: #23170f;
}
.lnShine {
  fill: #fff;
}
.lnNose {
  fill: #3a2414;
}
.lnMouth,
.lnToothLine {
  fill: none;
  stroke: #3a2414;
  stroke-width: 1.6;
  stroke-linecap: round;
}
.lnTooth {
  fill: #fffaf0;
  stroke: #3a2414;
  stroke-width: 1.2;
}
.pathBubble {
  position: relative;
  margin: 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-line);
  box-shadow: 0 6px 18px rgba(30, 20, 10, 0.08);
  font-size: 1rem;
  line-height: 1.45;
}
.pathMeter {
  height: 10px;
  border-radius: 99px;
  background: var(--paper-2);
  overflow: hidden;
}
.pathMeter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-fill);
  transition: width 0.9s var(--ease-out);
}
.pathStage {
  margin-top: 22px;
}
.pathStageHead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
}
.pathStageHead h2 {
  margin: 0;
  font-size: 1.05rem;
}
.pathRoad {
  position: relative;
  max-width: 360px;
  margin: 6px auto 0;
}
.pathSvg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.roadBase,
.roadFill {
  fill: none;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.roadBase {
  stroke: var(--paper-2);
  stroke-width: 18px;
}
.roadFill {
  stroke: var(--accent-fill);
  stroke-width: 10px;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: roadGrow 1.1s var(--ease-out) 0.15s both;
}
@keyframes roadGrow {
  from {
    stroke-dashoffset: var(--start, 0);
  }
}
.pathNode {
  position: absolute;
  width: 0;
  height: 0;
}
.pathDot {
  position: absolute;
  left: -32px;
  top: -32px;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--glass-line);
  background: var(--glass-strong);
  color: var(--ink-3);
  box-shadow: 0 8px 18px rgba(30, 20, 10, 0.12);
  cursor: pointer;
  transition:
    transform 0.2s var(--ease-out),
    box-shadow 0.2s var(--ease-out);
}
.pathDot svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pathDot:hover {
  box-shadow: 0 10px 24px rgba(30, 20, 10, 0.16);
}
.pathDot:active {
  transform: scale(0.94);
}
.is-done .pathDot {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  color: var(--accent-on);
}
.is-current .pathDot {
  width: 76px;
  height: 76px;
  left: -38px;
  top: -38px;
  border: 4px solid var(--accent-fill);
  color: var(--accent);
  box-shadow:
    0 0 0 8px color-mix(in srgb, var(--accent-fill) 16%, transparent),
    0 10px 24px rgba(30, 20, 10, 0.14);
}
.k-chest .pathDot {
  border-radius: 20px;
  background: var(--gold);
  border-color: #c58a12;
  color: var(--gold-ink);
}
.k-chest.is-done .pathDot {
  background: color-mix(in srgb, var(--gold) 45%, var(--glass-strong));
}
.k-lesson .pathDot {
  color: var(--money-tax);
}
.is-locked .pathDot {
  cursor: default;
  opacity: 0.55;
  box-shadow: none;
}
.pathLabel {
  position: absolute;
  top: -22px;
  width: 140px;
  font-size: 0.92rem;
  line-height: 1.3;
  color: var(--ink-1);
}
.sideR .pathLabel {
  left: 46px;
}
.sideL .pathLabel {
  right: 46px;
  text-align: right;
}
.is-current .pathLabel {
  font-weight: 500;
}
.pathLabel small {
  display: block;
  color: var(--ink-4);
}
.pathNow {
  display: inline-block;
  margin: 0 6px 2px 0;
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--accent-fill);
  color: var(--accent-on);
  font-size: 0.75rem;
  font-weight: 500;
}
.isLocked .pathLabel {
  color: var(--ink-4);
}
.pathFoot {
  margin: 20px 4px 0;
  text-align: center;
}
.pathPage.isFirst .pathDot {
  animation: nodeIn 0.45s var(--ease-out) both;
  animation-delay: calc(var(--i) * 60ms + 0.1s);
}
@keyframes nodeIn {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
}
.pathTeaser {
  display: flex;
  align-items: center;
  gap: 14px;
}
.pathTeaser > div {
  flex: 1;
  min-width: 0;
}
.pathTeaser h2 {
  margin: 0 0 2px;
}
.pathTeaser p {
  margin: 0 0 8px;
}
.pathTeaser .loonie {
  width: 64px;
  height: 64px;
}
@media (max-width: 560px) {
  .pathTeaser {
    flex-wrap: wrap;
  }
  .pathTeaser .btn {
    width: 100%;
  }
  .pathLabel {
    width: 118px;
    font-size: 0.86rem;
  }
}

/* The card deck */
.pathDeck {
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 16px;
  border: 1px solid var(--glass-line);
  border-radius: 24px;
  background: var(--paper-1);
  color: var(--ink-1);
  overflow: hidden;
}
.pathDeck::backdrop {
  background: rgba(15, 12, 8, 0.45);
  backdrop-filter: blur(6px);
}
.pathDeck[open] {
  animation: deckIn 0.35s var(--ease-out);
}
@keyframes deckIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
}
.deckTop {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 12px;
}
.deckTop h2,
.deckHint {
  margin: 0;
}
.deckStack {
  position: relative;
  height: min(430px, calc(100dvh - 230px));
}
.deckCard {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border-radius: 22px;
  border: 2px solid var(--glass-line);
  background: var(--paper-2);
  box-shadow: 0 14px 30px rgba(30, 20, 10, 0.14);
  overflow: auto;
  touch-action: pan-y;
  user-select: none;
  transition:
    transform 0.3s var(--ease-out),
    opacity 0.3s var(--ease-out),
    border-color 0.2s;
}
.deckCard:nth-last-child(2) {
  transform: translateY(14px) scale(0.95);
  opacity: 0.85;
}
.deckCard:nth-last-child(3) {
  transform: translateY(28px) scale(0.9);
  opacity: 0.6;
}
.deckCard:last-child {
  cursor: grab;
}
.deckCard.isDragging {
  transition: none;
  cursor: grabbing;
}
.deckCard[data-lean='yes'] {
  border-color: var(--money-loan);
}
.deckCard[data-lean='no'] {
  border-color: var(--ink-4);
}
.deckCard.isGone.toRight {
  transform: translateX(130%) rotate(14deg);
  opacity: 0;
}
.deckCard.isGone.toLeft {
  transform: translateX(-130%) rotate(-14deg);
  opacity: 0;
}
.deckKind {
  align-self: start;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--money-free);
  background: color-mix(in srgb, currentColor 13%, transparent);
}
.k-loan .deckKind {
  color: var(--money-loan);
}
.k-tax-credit .deckKind {
  color: var(--money-tax);
}
.k-wage-subsidy .deckKind,
.k-advice .deckKind {
  color: var(--money-wage);
}
.deckAmount {
  margin: 4px 0 0;
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.deckCard h3 {
  margin: 0;
  font-size: 1.05rem;
}
.deckWhat {
  margin: 0;
  color: var(--ink-3);
}
.deckNote {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 0.9rem;
}
.deckCard details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 500;
}
.deckCard > a {
  margin-top: auto;
}
.deckEnd {
  align-items: center;
  justify-content: center;
  text-align: center;
}
.deckEnd .loonie {
  width: 96px;
  height: 96px;
}
.deckButtons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.deckButtons .btn {
  min-height: 48px;
  font-size: 1rem;
}
.fundIntroBtns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
@media (prefers-reduced-motion: reduce) {
  .roadFill,
  .pathPage.isFirst .pathDot,
  .pathDeck[open] {
    animation: none;
  }
  .deckCard,
  .pathMeter > span {
    transition: none;
  }
}
.deckAmount {
  font-size: 2.6rem;
  letter-spacing: -0.03em;
}
.deckAmount.isText {
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}
.deckAmountMore {
  margin: -4px 0 4px;
  color: var(--ink-4);
  font-size: 0.88rem;
}
.deckCard .deckWhat {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.deckCard {
  scrollbar-width: thin;
}

/* Funding, simple version: Loonie + cards button, then "Your list" with 4 steps per program */
.fundHero {
  display: flex;
  align-items: center;
  gap: 16px;
  --money-free: #a86a00;
  --money-loan: #0f7a5c;
  --money-tax: #5b4bc4;
  --money-wage: #1f5fbf;
}
.fundHero > div {
  flex: 1;
  min-width: 0;
}
.fundHero h2 {
  margin: 0 0 4px;
  font-size: 1.35rem;
}
.fundHero p {
  margin: 0 0 12px;
}
.fundHero .loonie {
  width: 88px;
  height: 88px;
}
.fundHeroBtns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.fundList {
  --money-free: #a86a00;
  --money-loan: #0f7a5c;
  --money-tax: #5b4bc4;
  --money-wage: #1f5fbf;
}
:root[data-theme='dark'] .fundHero,
:root[data-theme='dark'] .fundList {
  --money-free: #f2b84b;
  --money-loan: #4fd1a5;
  --money-tax: #a89cff;
  --money-wage: #7fb2ff;
}
.fundRow .deckKind {
  display: inline-block;
  margin-bottom: 4px;
}
.fundShort {
  flex: none;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.fundSteps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.fundSteps button {
  position: relative;
  width: 100%;
  min-height: 40px;
  padding: 6px 4px 6px;
  border: 0;
  border-radius: 10px;
  background: var(--paper-2);
  color: var(--ink-3);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition:
    background 0.25s var(--ease-out),
    color 0.25s var(--ease-out);
}
.fundSteps button.isPast {
  background: color-mix(in srgb, var(--accent-fill) 22%, var(--paper-2));
  color: var(--ink-1);
}
.fundSteps button.isNow {
  background: var(--accent-fill);
  color: var(--accent-on);
  font-weight: 500;
}
.fundSteps button:disabled {
  cursor: default;
}
@media (max-width: 560px) {
  .fundHero {
    flex-direction: column;
    text-align: center;
  }
  .fundHeroBtns {
    justify-content: center;
  }
  .fundHeroBtns .btn {
    width: 100%;
  }
  .fundSteps button {
    font-size: 0.78rem;
  }
}
/* Folded sections show a chevron that turns when open */
.fundMore > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.fundMore > summary::after {
  content: '';
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  transform: rotate(45deg);
  transition: transform 0.25s var(--ease-out);
}
.fundMore[open] > summary::after {
  transform: rotate(225deg);
}

/* Settings for lazy people (js/app/22-settings-simple.js): folded rows with a hint */
.setFold > summary > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.setFold > summary h2 {
  display: block;
  margin: 0;
}
body .setInner {
  margin: 14px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body .setInner + .setInner {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--paper-2);
}
.setInner h2 {
  font-size: 1rem;
}
.setInner .setInnerTitle {
  display: none;
}
.advancedSettings > summary {
  cursor: pointer;
}
.setFold > summary .muted {
  font-weight: 400;
}

/* 60-second lessons (js/app/23-lessons.js) */
.lessonDots {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.lessonDots span {
  width: 22px;
  height: 6px;
  border-radius: 99px;
  background: var(--paper-2);
  transition: background 0.3s var(--ease-out);
}
.lessonDots .isPast {
  background: color-mix(in srgb, var(--accent-fill) 45%, var(--paper-2));
}
.lessonDots .isNow {
  background: var(--accent-fill);
}
.lessonCard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-height: 280px;
  padding: 22px 18px;
  border-radius: 22px;
  border: 2px solid var(--glass-line);
  background: var(--paper-2);
  text-align: center;
  animation: lessonIn 0.35s var(--ease-out);
}
@keyframes lessonIn {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
}
.lessonCard .loonie {
  width: 84px;
  height: 84px;
}
.lessonText {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.5;
  max-width: 34ch;
}
.lessonOptions {
  display: grid;
  gap: 8px;
  width: 100%;
}
.lessonOptions .btn {
  min-height: 46px;
  transition:
    background 0.2s var(--ease-out),
    border-color 0.2s var(--ease-out);
}
.lessonOptions .btn.isRight {
  background: color-mix(in srgb, #1d9e75 18%, var(--paper-2));
  border-color: #1d9e75;
}
.lessonOptions .btn.isWrong {
  background: color-mix(in srgb, #d85a30 14%, var(--paper-2));
  border-color: #d85a30;
}
.lessonWhy {
  margin: 0;
  min-height: 1.4em;
}
.lessonSrc {
  margin: 12px 0 0;
  text-align: center;
}
@media (prefers-reduced-motion: reduce) {
  .lessonCard {
    animation: none;
  }
}
.lessonOptions .btn:disabled {
  opacity: 1;
  color: var(--ink-3);
}
.lessonOptions .btn.isRight:disabled {
  color: var(--ink-1);
  font-weight: 500;
}
.pathLesson {
  overflow: auto;
}

/* Snap a receipt (js/app/24-snap.js): one big camera button; on a computer only when opened by the #snap link */
.snapCard {
  text-align: center;
}
.snapBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 64px;
  font-size: 1.1rem;
  cursor: pointer;
}
.snapBtn .hubIcon {
  width: 26px;
  height: 26px;
}
.snapBtn.isDisabled {
  opacity: 0.6;
  pointer-events: none;
}
.snapCard.isSnap .snapBtn {
  min-height: 120px;
  font-size: 1.25rem;
  border-radius: 22px;
}
.snapCard p {
  margin: 10px 0 0;
}
@media (pointer: fine) {
  .snapCard:not(.isSnap) {
    display: none;
  }
}

/* Hub on your phone (js/app/25-phone-setup.js): setup sheet and the looping 3-step mini-guide */
.phoneSetup {
  overflow: auto;
}
.phoneBody h3 {
  margin: 18px 0 8px;
  font-size: 1rem;
}
.phoneBody code {
  overflow-wrap: anywhere;
}
.phoneLink {
  margin-top: 8px;
}
.pgVideo {
  position: relative;
  height: 330px;
  border-radius: 18px;
  background: var(--paper-2);
  overflow: hidden;
}
.pgFrame {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px;
  opacity: 0;
  animation: pgShow 7.5s var(--ease-out) infinite;
  animation-delay: calc(var(--n) * 2.5s);
}
@keyframes pgShow {
  0% {
    opacity: 0;
    transform: translateX(14px);
  }
  4%,
  30% {
    opacity: 1;
    transform: none;
  }
  34%,
  100% {
    opacity: 0;
    transform: translateX(-14px);
  }
}
.pgFrame figcaption {
  text-align: center;
  font-size: 0.95rem;
  max-width: 30ch;
}
.pgFrame figcaption b {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--accent-fill);
  color: var(--accent-on);
  font-size: 0.8rem;
}
.pgPhone {
  position: relative;
  width: 132px;
  height: 236px;
  border-radius: 24px;
  border: 5px solid #1d1d1f;
  background: #2b2b30;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(20, 15, 10, 0.2);
}
.pgCC,
.pgWeb,
.pgHome {
  position: absolute;
  inset: 0;
  padding: 26px 10px 10px;
}
.pgGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.pgTile {
  height: 30px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
}
.pgTile.w2 {
  height: 52px;
}
.pgPlus {
  position: absolute;
  top: 6px;
  left: 10px;
  color: #fff;
  font-size: 15px;
}
.pgPill,
.pgSearch {
  display: block;
  margin: 0 auto 8px;
  padding: 3px 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.85);
  color: #1d1d1f;
  font-size: 9px;
  text-align: center;
}
.pgSheet {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  top: 40px;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 8px;
  border-radius: 14px;
  background: #f2f2f7;
}
.pgSheet.low {
  top: 96px;
}
.pgRow {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 18px;
  padding: 2px 6px;
  border-radius: 7px;
  background: #fff;
  color: #1d1d1f;
  font-size: 8.5px;
}
.pgRow.isPick {
  outline: 2px solid var(--accent-fill);
}
.pgRow .hubIcon {
  width: 11px;
  height: 11px;
}
.pgWeb {
  background: #fff;
}
.pgBar {
  display: block;
  height: 14px;
  margin-bottom: 10px;
  border-radius: 7px;
  background: #e5e5ea;
}
.pgLine {
  display: block;
  height: 7px;
  margin-bottom: 7px;
  border-radius: 4px;
  background: #e5e5ea;
}
.pgLine.s {
  width: 60%;
}
.pgShare {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  color: #0a84ff;
}
.pgShare .hubIcon {
  width: 16px;
  height: 16px;
}
.pgHome {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-content: start;
  gap: 8px;
  background: linear-gradient(#3a4a6b, #22283a);
}
.pgApp {
  aspect-ratio: 1;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.25);
}
.pgApp.isHub {
  grid-row: 1;
  grid-column: 1;
  display: grid;
  place-items: center;
  background: #1d1d1f;
  color: #fff;
  font-size: 8px;
  font-weight: 600;
}
.pgTap {
  position: absolute;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgba(255, 255, 255, 0.35);
  animation: pgTap 2.5s var(--ease-out) infinite;
}
@keyframes pgTap {
  0%,
  30% {
    transform: scale(1.4);
    opacity: 0;
  }
  45% {
    transform: scale(1);
    opacity: 1;
  }
  60% {
    transform: scale(0.8);
    opacity: 1;
  }
  80%,
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pgVideo {
    height: auto;
    display: grid;
    gap: 8px;
    padding: 10px;
  }
  .pgFrame {
    position: static;
    opacity: 1;
    animation: none;
  }
  .pgTap {
    animation: none;
  }
}

/* Time saved on Home (js/app/26-time-saved.js) */
.savedCard {
  display: flex;
  align-items: center;
  gap: 14px;
}
.savedCard h2 {
  margin: 0 0 2px;
}
.savedCard p {
  margin: 0;
}
.savedIcon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent-fill) 14%, transparent);
  color: var(--accent);
}

/* Sign-up switch on the sign-in screen */
.authSwitch {
  margin: 16px 0 0;
  text-align: center;
}

/* Sign-up consent: checkbox beside the text, links underlined */
.authCard .authAgree {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 12px 0 4px;
  font-weight: 400;
  line-height: 1.4;
}
.authCard .authAgree input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
}
.authAgree a {
  color: var(--accent);
  text-decoration: underline;
}

/* Close account: folded by default, title reads as a normal card title */
.closeCard summary {
  cursor: pointer;
  list-style-position: inside;
}
.closeCard summary h2 {
  display: inline;
  color: var(--bad, #b3261e);
}
.closeCard input {
  max-width: 360px;
}

/* Phone MFA setup: the otpauth link looks like the secondary button */
.authMfaOpen {
  display: block;
  margin: 8px 0 12px;
  text-align: center;
  text-decoration: none;
}
.authMfaOpen[hidden] {
  display: none;
}

/* Bot check box (Cloudflare Turnstile): only takes space when a check is shown */
.hubCaptcha:not(:empty) {
  margin: 12px 0 4px;
}

/* Wide screens (owner, 01.12.2026: on a big monitor everything looked small and scattered).
   The page keeps a readable width (--hub-max 1280px, Settings can make it wide) and text grows one step. */
@media (min-width: 1600px) {
  html[data-reading-size='normal'] {
    font-size: 106.25%;
  }
  html[data-reading-size='comfortable'] {
    font-size: 125%;
  }
  html[data-reading-size='large'] {
    font-size: 137.5%;
  }
}

/* Money to set aside (Home): one total, one line per tax, plain arithmetic */
.asideHead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.asideHead h2 {
  margin: 0 0 2px;
}
.asideTotal {
  font-size: 1.6rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.asideRow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 10px 0;
  border-top: 1px solid var(--rule-1);
}
.asideRow > span {
  flex: 1;
  color: var(--ink-3);
}
.asideRow > b {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.asidePct {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.asidePct {
  white-space: nowrap;
}
body .asideCard .asidePct input {
  flex: none;
  width: 4.5em;
  min-width: 0;
  padding: 4px 8px;
  text-align: right;
}
.asideLink {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-strong); /* --accent on the beige card is 4.47:1, just under 4.5 */
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* Desktop menu: three groups (everyday, business tools, the rest) split by a thin line */
.navGroup + .navGroup {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--rule-1);
}

/* Home hero: the one main action, with the next path step under it */
.heroMain {
  display: flex;
  align-items: center;
  gap: 18px;
}
body .heroAdd {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 26px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 14px;
}
body .heroAdd .hubIcon {
  width: 24px;
  height: 24px;
}
.heroWhat {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink-1);
}
.heroSaved {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0;
}
.heroSaved .hubIcon {
  width: 16px;
  height: 16px;
  color: var(--ok, #1f8a4c);
}
.heroNext {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--rule-1);
}
.heroNext > div {
  flex: 1;
  min-width: 0;
}
.heroNext p {
  margin: 0 0 8px;
}
.heroNext .loonie {
  width: 48px;
  height: 48px;
  flex: none;
}
/* Money to set aside: folded to one line on Home */
.asideCard > summary {
  cursor: pointer;
  list-style: none;
}
.asideCard > summary::-webkit-details-marker {
  display: none;
}
.asideCard[open] > summary {
  margin-bottom: 8px;
}
@media (max-width: 560px) {
  .heroMain,
  .heroNext {
    flex-wrap: wrap;
  }
  body .heroAdd,
  .heroNext .btn {
    width: 100%;
    justify-content: center;
  }
}
.asideCard summary .muted {
  font-weight: 400;
}
.asideCard .asideName > span:first-child::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 10px;
  border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  transform: rotate(45deg) translateY(-3px);
}
.asideCard[open] .asideName > span:first-child::after {
  transform: rotate(-135deg) translateY(-1px);
}
.navGroup > button {
  width: 100%;
}

/* ── Unslop pass (01.12.2026): quiet chrome, one bright action ── */
/* Money on Home: one card, three figures split by hairlines, the figure itself opens Money */
.moneyFigs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
body .moneyFig {
  display: grid;
  gap: 4px;
  justify-items: start;
  padding: 4px 20px;
  border: 0;
  border-left: 1px solid var(--rule-1);
  border-radius: 0;
  background: none;
  color: var(--ink-0);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: color 0.18s var(--ease-out);
}
body .moneyFig:first-child {
  padding-left: 0;
  border-left: 0;
}
body .moneyFig:hover .moneyNum {
  color: var(--accent-strong);
}
.moneyNum {
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  transition: color 0.18s var(--ease-out);
}
.moneyFig.isLoss .moneyNum {
  color: var(--bad);
}
/* Set-aside: one quiet row at the bottom of the money card */
details.asideCard {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--rule-1);
}
details.asideCard > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
details.asideCard .asideTotal {
  font-size: 1.1rem;
}
/* Lists on Home: title, a muted date, and when it happens as plain text */
.dashWhen {
  color: var(--ink-3);
  font-size: 0.9rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.dashWhen.dashWarning {
  color: var(--ink-1);
  font-weight: 500;
}
.dashWhen.dashDanger {
  color: var(--bad);
  font-weight: 500;
}
body .dashFix {
  width: 100%;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.needsYou {
  color: var(--bad);
}
body .dashAmount {
  color: var(--ink-0);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
body .dashAmount.isIn {
  color: var(--ok, #1f8a4c);
}
@media (max-width: 640px) {
  /* Phone: the three figures stay in one row, smaller */
  body .moneyFig {
    padding: 2px 10px;
  }
  .moneyNum {
    font-size: 1.15rem;
  }
}
/* Money table: one line per payment, expenses in ink, one actions menu */
body .finTable th.num,
body .finTable td.num {
  text-align: right;
}
body .finTable .amountOut {
  color: var(--ink-0);
}
body .finTable td {
  vertical-align: middle;
}
body .txNeeds {
  white-space: nowrap;
}
/* Fewer frames: cards are flat surfaces with a hairline, no drop shadows */
body .card {
  box-shadow: none;
}
body .side .brand {
  margin-bottom: 20px;
}
body .finTable .finMenu {
  display: inline-block;
}
body .finTable .finMenu > summary {
  width: 36px;
  height: 36px;
  padding: 0;
  border-color: transparent;
}
body .finTable .finMenu > summary:hover {
  background: var(--paper-2);
}
body .finTable td:last-child {
  width: 48px;
  text-align: right;
}
/* On wide screens the table fits, so its row menus may hang outside it instead of being clipped */
@media (min-width: 900px) {
  body .tableScroll {
    overflow: visible;
  }
}

/* Settings as one list (unslop): rows inside one card, split by hairlines, no card-in-card */
body .setList {
  padding-top: 4px;
  padding-bottom: 4px;
}
body .setList > .card,
body .setList > details.card {
  margin: 0;
  padding: 16px 0;
  border: 0;
  border-top: 1px solid var(--rule-1);
  border-radius: 0;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
}
body .setList > :first-child {
  border-top: 0;
}
body .setList .setInner {
  padding: 12px 0;
  border: 0;
  background: none;
  box-shadow: none;
}
body .setList .setInner + .setInner {
  border-top: 1px solid var(--rule-1);
}
body .setInner .quietLabel {
  display: none;
}
body .moneyFig.isLoss:hover .moneyNum {
  color: var(--bad);
}
body .setList > .card:not(details) h2 {
  margin: 0 0 2px;
}
body .setList > .card:not(details) p {
  margin: 0;
}
body .setList > .card:not(details) {
  padding: 12px 0;
}
body .profileCard input {
  max-width: 420px;
}

.asideName {
  display: grid;
  gap: 2px;
  font-weight: 500;
}
/* Phone and narrow laptops: each payment is two lines (supplier and amount, then date and card), menu on the right */
@media (max-width: 1200px) {
  body .finTable tr {
    grid-template-columns: auto 1fr auto 36px;
    grid-template-areas: 'who who amount actions' 'date where state actions';
    align-items: center;
    gap: 2px 8px;
  }
  body .finTable td:nth-child(2) .muted {
    display: none;
  }
  body .finTable td:nth-child(1),
  body .finTable td:nth-child(3) {
    font-size: 0.85rem;
    color: var(--ink-3);
  }
  body .finTable td:nth-child(3)::before {
    content: '· ';
  }
  body .finTable td:nth-child(6) {
    align-self: center;
    width: auto;
  }
}

/* Continue with Apple / Google: brand colours kept (Apple black, Google white with grey outline), same size as Sign in */
.authOAuth {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.authOAuthBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 9px;
  font: 500 0.9375rem/1.2 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  cursor: pointer;
}
.authOAuthBtn.apple {
  border: 1px solid #000;
  background: #000;
  color: #fff;
}
.authOAuthBtn.google {
  border: 1px solid #747775;
  background: #fff;
  color: #1f1f1f;
}
.authOAuthBtn:focus-visible {
  outline: 2px solid var(--accent-mid);
  outline-offset: 2px;
}
.authOAuthLogo {
  flex: none;
  width: 18px;
  height: 18px;
}
.authOAuthBtn.apple .authOAuthLogo {
  width: 16px;
  height: 19px;
  margin-top: -2px;
}
.authCard .authOAuthNote {
  margin: 10px 0 0;
  font-size: 0.8125rem;
  line-height: 1.4;
}
.authOAuthNote a {
  color: var(--accent);
  text-decoration: underline;
}
.authOr {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 4px;
  color: var(--ink-2, #6b6b6b);
  font-size: 0.8125rem;
}
.authOr::before,
.authOr::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--rule-2);
}

/* Settings → Your plan: three plans side by side, the current one outlined (owner, 03.12.2026) */
.planTiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 10px;
}
.planTile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(60, 48, 30, 0.12);
  background: var(--paper-0);
}
.planTile.isCurrent {
  border: 2px solid var(--accent);
  padding: 13px;
}
.planTile .planPrice {
  font-size: 1.375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.planTile .planPrice small {
  font-size: 0.8125rem;
  font-weight: 400;
  opacity: 0.7;
}
.planTile .btn,
.planTile .planCurrent {
  margin-top: auto;
}
.planTile .planCurrent {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  padding: 6px 0;
}
:root[data-theme='dark'] .planTile {
  border-color: rgba(255, 255, 255, 0.12);
}
@media (max-width: 640px) {
  .planTiles {
    grid-template-columns: 1fr;
  }
}

/* Dialogs arrive with a small pop; a plan-limit dialog nudges its icon once so it is noticed */
body dialog.workspaceDialog[open] {
  animation: hubCelPop 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
body dialog.workspaceDialog.planLimit .dialogMark {
  animation: hubPlanNudge 0.5s 0.2s ease-in-out;
}
@keyframes hubPlanNudge {
  25% {
    transform: rotate(-10deg) scale(1.08);
  }
  60% {
    transform: rotate(8deg) scale(1.08);
  }
}

/* Lost authenticator: quiet fold under the code form */
.authLost {
  margin-top: 14px;
  font-size: 0.875rem;
}
.authLost summary {
  cursor: pointer;
  color: var(--accent);
  padding: 6px 0;
}
.authLost a {
  color: var(--accent);
  text-decoration: underline;
}

/* Two-step sign-in: Home reminder and the quiet Sign out under "Not now" */
.twoStepNudge p {
  margin: 0 0 10px;
}
.twoStepNudge .actions {
  margin: 0;
}
.authCard .authMfaSignout {
  display: block;
  margin: 6px auto 0;
}
