/* Split the Cash theme styles.
   Layout: single reading column (760px) with a full-width header and footer. */

:root {
  --ps-bg: #f3f5f7;
  --ps-surface: #ffffff;
  --ps-line: #d9dfe5;
  --ps-ink: #17212b;
  --ps-muted: #5b6875;
  --ps-accent: #1f5f8b;
  --ps-accent-ink: #ffffff;
  --ps-accent-soft: #e3eef6;
  --ps-warn: #a4541a;
  --ps-warn-soft: #fbeee3;
  --ps-ok: #2f7a4f;
  --ps-s1: #1f5f8b; --ps-s2: #3f9a8c; --ps-s3: #c98a2b; --ps-s4: #8a5a9e; --ps-s5: #c2574a; --ps-s6: #5f7f2e;
  --ps-display: "Avenir Next", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --ps-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ps-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --ps-width: 760px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ps-bg: #11171d; --ps-surface: #18212a; --ps-line: #2b3743; --ps-ink: #e6edf3; --ps-muted: #9aa8b5;
    --ps-accent: #6fb0dc; --ps-accent-ink: #0d1a24; --ps-accent-soft: #1c3446;
    --ps-warn: #e89a5e; --ps-warn-soft: #3a2718; --ps-ok: #6cc494;
    --ps-s1: #6fb0dc; --ps-s2: #5fc2b2; --ps-s3: #e0aa55; --ps-s4: #b98bcc; --ps-s5: #e2877a; --ps-s6: #9cc062;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ps-bg); color: var(--ps-ink);
  font-family: var(--ps-body); font-size: 17px; line-height: 1.6;
}
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: var(--ps-accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ps-accent); outline-offset: 2px; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
  position: fixed; top: 8px; left: 8px; width: auto; height: auto; clip: auto; z-index: 100;
  background: var(--ps-surface); padding: 8px 12px; border-radius: 6px;
}

/* Header */
.ps-header { background: var(--ps-surface); border-bottom: 1px solid var(--ps-line); }
.ps-header-inner {
  max-width: 1100px; margin: 0 auto; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.ps-brand { font-family: var(--ps-display); font-weight: 700; font-size: 1.25rem; color: var(--ps-ink); text-decoration: none; letter-spacing: -0.01em; }
.ps-brand { display: inline-flex; align-items: center; gap: 10px; }
.ps-brand img { max-height: 40px; width: auto; display: block; }
.ps-brand .ps-brand-mark { width: 30px; height: 30px; }
.ps-nav-toggle {
  display: none; font: inherit; font-weight: 600; background: none; border: 1px solid var(--ps-line);
  color: var(--ps-ink); border-radius: 7px; padding: 6px 12px; cursor: pointer;
}
.ps-nav ul, .ps-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.ps-nav a { color: var(--ps-ink); text-decoration: none; font-size: 0.95rem; font-weight: 500; }
.ps-nav a:hover, .ps-nav .current-menu-item > a { color: var(--ps-accent); }
.ps-nav li { position: relative; display: flex; align-items: center; flex-wrap: wrap; }
.ps-sub-toggle {
  font: inherit; background: none; border: 0; color: var(--ps-muted); cursor: pointer;
  padding: 4px 6px; margin-left: 2px; line-height: 1; border-radius: 5px;
}
.ps-sub-toggle::after { content: ""; display: inline-block; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.ps-sub-toggle[aria-expanded="true"]::after { transform: translateY(1px) rotate(-135deg); }
.ps-nav .sub-menu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 50; flex-direction: column; gap: 0;
  min-width: 15rem; padding: 6px; background: var(--ps-surface); border: 1px solid var(--ps-line);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.ps-nav .sub-menu a { display: block; padding: 7px 10px; border-radius: 5px; white-space: nowrap; }
.ps-nav .sub-menu a:hover { background: var(--ps-accent-soft); }
.ps-nav .sub-menu li { display: block; }
@media (min-width: 821px) {
  .ps-nav li:hover > .sub-menu, .ps-nav li:focus-within > .sub-menu, .ps-nav li.is-open > .sub-menu { display: flex; }
  .ps-nav .sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
}
@media (max-width: 820px) {
  .ps-nav-toggle { display: inline-block; }
  .ps-nav { display: none; width: 100%; }
  .ps-nav.is-open { display: block; }
  .ps-nav ul, .ps-menu { flex-direction: column; gap: 0; }
  .ps-nav a { display: block; padding: 10px 0; border-top: 1px solid var(--ps-line); }
  .ps-nav li > a { flex: 1 1 auto; }
  .ps-sub-toggle { padding: 10px 12px; border-top: 1px solid var(--ps-line); align-self: stretch; }
  .ps-nav .sub-menu { position: static; width: 100%; min-width: 0; border: 0; box-shadow: none; padding: 0 0 6px 14px; background: none; }
  .ps-nav li.is-open > .sub-menu { display: flex; }
  .ps-nav .sub-menu a { white-space: normal; padding: 8px 0; }
}

/* Content column */
.ps-main { max-width: var(--ps-width); margin: 0 auto; padding: 32px 16px 56px; }
.ps-main h1 {
  font-family: var(--ps-display); font-size: clamp(1.8rem, 5vw, 2.5rem); line-height: 1.15;
  letter-spacing: -0.015em; margin: 0 0 12px; text-wrap: balance;
}
.ps-main h2 { font-family: var(--ps-display); font-size: 1.45rem; line-height: 1.25; margin: 2.2em 0 0.5em; text-wrap: balance; }
.ps-main h3 { font-size: 1.1rem; line-height: 1.35; margin: 1.6em 0 0.3em; }
.ps-main p, .ps-main li { max-width: 68ch; }
.ps-main ul, .ps-main ol { padding-left: 1.3em; }
.ps-main li { margin: 0.3em 0; }
.ps-main table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.entry-content > table, .wp-block-table { overflow-x: auto; display: block; }
.wp-block-table table { display: table; }
.entry-content th, .entry-content td { border-bottom: 1px solid var(--ps-line); padding: 8px; text-align: left; }
.ps-lead { font-size: 1.12rem; color: var(--ps-muted); }
.ps-formula {
  font-family: var(--ps-mono); font-size: 0.95rem; background: var(--ps-surface); border: 1px solid var(--ps-line);
  border-radius: 8px; padding: 12px 14px; overflow-x: auto;
}
.wp-block-code, pre { overflow-x: auto; }

/* Calculator */
.ps-calc { display: grid; gap: 14px; margin: 24px 0 8px; font-size: 15px; line-height: 1.5; }
/* Reserve space until the script draws the calculator, to avoid layout shift. */
.ps-calc:not(.ps-ready) { min-height: 940px; }
@media (max-width: 600px) { .ps-calc:not(.ps-ready) { min-height: 1080px; } }
.ps-panel { background: var(--ps-surface); border: 1px solid var(--ps-line); border-radius: 10px; padding: 16px; display: grid; gap: 14px; }
.ps-lbl { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ps-muted); font-weight: 600; }
.ps-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.ps-field { display: grid; gap: 6px; min-width: 0; }
.ps-calc input, .ps-calc select {
  font: inherit; color: var(--ps-ink); background: var(--ps-bg); border: 1px solid var(--ps-line);
  border-radius: 7px; padding: 9px 11px; min-width: 0; max-width: 100%;
}
.ps-calc .ps-amount { font-family: var(--ps-mono); font-size: 1.25rem; font-weight: 600; width: 12ch; }
.ps-calc .ps-basis { max-width: 16rem; }
.ps-num { font-family: var(--ps-mono); font-variant-numeric: tabular-nums; text-align: right; }
.ps-methods { display: flex; flex-wrap: wrap; gap: 6px; }
.ps-methods button {
  font: inherit; font-weight: 500; border: 1px solid var(--ps-line); background: var(--ps-bg); color: var(--ps-ink);
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
}
.ps-methods button[aria-pressed="true"] { background: var(--ps-accent); border-color: var(--ps-accent); color: var(--ps-accent-ink); }
.ps-hint { color: var(--ps-muted); font-size: 0.88rem; margin: 0; }
.ps-mix-row { align-items: center; }
.ps-calc .ps-mix-range { flex: 1 1 12rem; padding: 0; accent-color: var(--ps-accent); }
.ps-calc .ps-mix-pct { width: 6rem; }
.ps-people { display: grid; gap: 8px; }
.ps-person { display: grid; grid-template-columns: 14px minmax(0, 1fr) 8.5rem 34px; gap: 8px; align-items: center; }
.ps-person.ps-hide-w { grid-template-columns: 14px minmax(0, 1fr) 34px; }
.ps-person.ps-hide-w .ps-w, .ps-person.ps-hide-w .ps-wlabel { display: none; }
.ps-head .ps-wlabel { text-align: right; }
.ps-dot { width: 10px; height: 10px; border-radius: 50%; }
.ps-calc .ps-w { width: 100%; }
.ps-del { font: inherit; background: none; border: 1px solid transparent; color: var(--ps-muted); border-radius: 6px; cursor: pointer; height: 34px; font-size: 1.1rem; }
.ps-del:hover { border-color: var(--ps-line); color: var(--ps-ink); }
.ps-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.ps-btn { font: inherit; font-weight: 600; border: 1px solid var(--ps-line); background: var(--ps-surface); color: var(--ps-ink); padding: 8px 14px; border-radius: 7px; cursor: pointer; }
.ps-btn-primary { background: var(--ps-accent-soft); border-color: transparent; color: var(--ps-accent); }
.ps-status { font-size: 0.9rem; padding: 9px 12px; border-radius: 7px; }
.ps-status.ps-warn { background: var(--ps-warn-soft); color: var(--ps-warn); }
.ps-status.ps-ok { background: var(--ps-accent-soft); color: var(--ps-ok); }
.ps-result-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ps-result-head h3 { margin: 0; font-family: var(--ps-display); font-size: 1.2rem; }
.ps-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--ps-line); }
.ps-bar span { height: 100%; }
.ps-tablewrap { overflow-x: auto; }
.ps-calc table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; margin: 0; }
.ps-calc th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ps-muted); text-align: left; font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--ps-line); white-space: nowrap; }
.ps-calc td { padding: 9px 8px; border-bottom: 1px solid var(--ps-line); }
.ps-calc .ps-r { text-align: right; white-space: nowrap; }
.ps-calc .ps-muted { color: var(--ps-muted); font-family: var(--ps-mono); font-size: 0.9em; }
.ps-calc .ps-amt { font-family: var(--ps-mono); font-weight: 600; }
.ps-calc tfoot td { border-bottom: 0; font-weight: 600; }
.ps-calc .ps-unassigned td { color: var(--ps-warn); }
.ps-copytext { width: 100%; min-height: 8rem; font-family: var(--ps-mono); font-size: 0.85rem; }
@media (max-width: 480px) {
  .ps-person { grid-template-columns: 12px minmax(0, 1fr) 6.5rem 30px; }
}
@media (prefers-reduced-motion: no-preference) { .ps-bar span { transition: flex-grow 0.25s ease; } }

/* Home page tool cards */
.ps-grid { display: grid; gap: 8px; margin: 24px 0 8px; }
.ps-main .ps-grid-title { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ps-muted); margin: 16px 0 10px; font-family: var(--ps-body); }
.ps-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 10px; }
.ps-card {
  display: grid; gap: 4px; padding: 14px 16px; text-decoration: none; color: var(--ps-ink);
  background: var(--ps-surface); border: 1px solid var(--ps-line); border-radius: 10px;
}
.ps-card:hover { border-color: var(--ps-accent); }
.ps-card:hover .ps-card-title { color: var(--ps-accent); }
.ps-card-title { font-weight: 600; line-height: 1.3; }
.ps-card-text { font-size: 0.9rem; color: var(--ps-muted); line-height: 1.45; }
@media (prefers-reduced-motion: no-preference) { .ps-card { transition: border-color 0.15s ease; } }

/* Settle-up and bill tools */
.ps-settle, .ps-bill { display: grid; gap: 14px; margin: 24px 0 8px; font-size: 15px; line-height: 1.5; }
.ps-settle:not(.ps-ready), .ps-bill:not(.ps-ready) { min-height: 1100px; }
.ps-settle input, .ps-settle select, .ps-bill input, .ps-bill select {
  font: inherit; color: var(--ps-ink); background: var(--ps-bg); border: 1px solid var(--ps-line);
  border-radius: 7px; padding: 9px 11px; min-width: 0; max-width: 100%;
}
.ps-settle table, .ps-bill table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; margin: 0; }
.ps-settle th, .ps-bill th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ps-muted); text-align: left; font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--ps-line); white-space: nowrap; }
.ps-settle td, .ps-bill td { padding: 9px 8px; border-bottom: 1px solid var(--ps-line); }
.ps-settle tfoot td, .ps-bill tfoot td { border-bottom: 0; font-weight: 600; }
.ps-settle .ps-r, .ps-bill .ps-r { text-align: right; white-space: nowrap; }
.ps-settle .ps-muted, .ps-bill .ps-muted { color: var(--ps-muted); font-family: var(--ps-mono); font-size: 0.9em; }
.ps-settle .ps-amt, .ps-bill .ps-amt { font-family: var(--ps-mono); font-weight: 600; }
.ps-pos { color: var(--ps-ok); }
.ps-neg { color: var(--ps-warn); }
.ps-expenses, .ps-items { display: grid; gap: 10px; }
.ps-line { display: grid; gap: 8px; padding: 10px 0; border-top: 1px solid var(--ps-line); }
.ps-line:first-child { border-top: 0; padding-top: 0; }
.ps-line-row { display: grid; grid-template-columns: minmax(0, 1fr) 7.5rem 34px; gap: 8px; align-items: center; }
.ps-line-row2 { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.ps-mini { font-size: 0.85rem; color: var(--ps-muted); display: inline-flex; gap: 6px; align-items: center; }
.ps-mini select { padding: 5px 8px; }
.ps-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ps-chip {
  font: inherit; font-size: 0.85rem; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--ps-line); background: var(--ps-bg); color: var(--ps-ink); border-radius: 999px; padding: 4px 10px;
}
.ps-chip[aria-pressed="true"] { border-color: var(--ps-accent); background: var(--ps-accent-soft); color: var(--ps-accent); font-weight: 600; }
.ps-chip .ps-dot { width: 8px; height: 8px; }
.ps-transfers { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; font-size: 1.05rem; }
.ps-transfers .ps-amt { margin-left: 4px; }
.ps-share { display: grid; gap: 8px; }
.ps-share .ps-link { width: 100%; font-family: var(--ps-mono); font-size: 0.8rem; }
@media (max-width: 480px) { .ps-line-row { grid-template-columns: minmax(0, 1fr) 6rem 30px; } }

/* Ads, related links, footer */
.ps-ad-slot, .ps-ad { margin: 16px 0; }
.ps-ad-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ps-muted); margin: 0 0 4px; }
.ps-related { margin-top: 48px; padding-top: 8px; border-top: 1px solid var(--ps-line); }
.ps-related h2 { font-size: 1.15rem; margin-top: 1em; }
.ps-related ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 8px 20px; }
.ps-related li { margin: 0; }
.ps-footer { border-top: 1px solid var(--ps-line); background: var(--ps-surface); color: var(--ps-muted); font-size: 0.9rem; }
.ps-footer-inner { max-width: 1100px; margin: 0 auto; padding: 24px 16px; display: grid; gap: 12px; }
.ps-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.ps-footer a { color: var(--ps-muted); }
.ps-footer p { margin: 0; max-width: 80ch; }

/* Blog/archive fallback */
.ps-post { padding: 16px 0; border-bottom: 1px solid var(--ps-line); }
.ps-post h2 { margin: 0 0 4px; font-size: 1.3rem; }
.ps-pagination { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }
