/* ==========================================================================
   Apex Suite — styles
   Minimal and soft: white space, one calm indigo accent, rounded surfaces.
   Change the brand by editing the tokens below. Module pages (tools built as
   artifacts) use public/css/module-shell.css for the parts around the module.
   ========================================================================== */

:root {
  --bg: #FAFAFC;          /* page background */
  --surface: #FFFFFF;     /* cards, panels, forms */
  --tint: #F3F4FB;        /* soft section backgrounds */
  --ink: #1E2235;         /* text */
  --muted: #646B80;       /* secondary text */
  --line: #E6E8F0;        /* borders */
  --accent: #4A50C8;      /* buttons, links, highlights */
  --accent-hover: #3C42B2;
  --accent-soft: #ECEDFC;
  --warm: #FCEFE7;        /* gentle warm tint for notices */
  --warm-ink: #8A4B2A;
  --ok: #1F7A52;
  --ok-soft: #E3F4EA;
  --warn: #A85A12;
  --danger: #B42335;

  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-s: 10px;
  --r-m: 16px;
  --r-l: 24px;
  --shadow: 0 1px 2px rgba(30, 34, 53, .04), 0 12px 32px rgba(30, 34, 53, .06);
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -0.015em; }
h1 { font-size: clamp(2rem, 4.2vw, 2.6rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; max-width: 70ch; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.page { padding-top: 48px; padding-bottom: 88px; }
.narrow { max-width: 600px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 12px; border-radius: var(--r-s); z-index: 10; }
.skip:focus { left: 8px; color: #fff; }
.lede-dark { font-size: 1.15rem; color: var(--muted); }
.meta { color: var(--muted); font-size: .9rem; }
.opt { color: var(--muted); font-weight: 400; }
.crumbs { margin-bottom: 10px; font-size: .95rem; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; color: var(--muted); }
.crumbs li { display: flex; gap: 6px; }
.crumbs li + li::before { content: "›"; color: #9AA0B2; }
.crumbs a { text-decoration: none; color: var(--muted); }
.crumbs a:hover { color: var(--accent); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px;
  font: inherit; font-weight: 600; font-size: 1rem; text-decoration: none; line-height: 1.2;
  border: 1px solid transparent; border-radius: 999px; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-link { background: none; border: 0; padding-left: 6px; padding-right: 6px; color: var(--accent); font-weight: 600; }
.btn-link:hover { text-decoration: underline; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #962030; color: #fff; }
.btn-small { min-height: 36px; padding: 6px 14px; font-size: .92rem; }
.btn-wide { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* ---------------------------------------------------------------- header */
.site-header { background: rgba(255, 255, 255, .92); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: saturate(1.4) blur(8px); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; }
.brand { display: flex; align-items: center; }
.brand-mark { display: none; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav ul a { display: block; padding: 8px 12px; color: var(--muted); text-decoration: none; font-weight: 500; border-radius: 999px; }
.site-nav ul a:hover { color: var(--ink); background: var(--tint); }
.site-nav ul a[aria-current=page] { color: var(--accent); background: var(--accent-soft); }
.nav-account { display: flex; align-items: center; gap: 8px; }
.nav-account form { margin: 0; }
.nav-toggle { display: none; }

/* Business tools menu */
.site-nav .nav-menu { position: relative; }
.site-nav .nav-menu-link { display: inline-flex; align-items: center; gap: 6px; }
.nav-chev { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.nav-menu-link[aria-expanded="true"] .nav-chev { transform: rotate(180deg); }
.nav-menu-panel { position: absolute; left: 0; top: calc(100% + 10px); z-index: 30; width: max-content; max-width: calc(100vw - 32px); padding: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow); }
.nav-menu-groups { display: flex; gap: 16px 24px; }
.site-nav .nav-menu-group a span:first-child { white-space: nowrap; }
.nm-head { margin: 0 0 6px; padding: 0 10px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.site-nav .nav-menu-group ul { display: grid; gap: 2px; }
.site-nav .nav-menu-group a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: var(--r-s); color: var(--ink); font-weight: 500; }
.site-nav .nav-menu-group a:hover { background: var(--tint); }
.nav-menu-foot { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 14px; padding: 12px 10px 0; border-top: 1px solid var(--line); font-size: .92rem; font-weight: 600; }
.nav-menu-foot a { text-decoration: none; }
.plan-tag { flex: none; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.plan-tag-free { color: var(--ok); background: var(--ok-soft); }
.plan-tag-basic { color: #2f348f; background: var(--accent-soft); }
.plan-tag-premium { color: #fff; background: var(--accent); }

.devbar { background: var(--tint); color: var(--muted); text-align: center; font-size: .88rem; padding: 6px var(--gutter); }

@media (max-width: 900px) {
  .brand-full { display: none; }
  .brand-mark { display: block; }
  .nav-toggle {
    display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; font: inherit; font-weight: 600;
    background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 999px;
  }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 72px; z-index: 5;
    flex-direction: column; align-items: stretch; gap: 12px; padding: 12px var(--gutter) 20px;
    background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; }
  .nav-account { flex-wrap: wrap; }
  .site-nav .nav-menu-link { width: 100%; justify-content: space-between; }
  .nav-menu-panel { position: static; width: auto; margin: 4px 0 8px; padding: 10px 4px; box-shadow: none; background: var(--tint); border: 0; }
  .nav-menu-groups { flex-direction: column; gap: 10px; }
  .site-nav .nav-menu-group a span:first-child { white-space: normal; }
}

/* ---------------------------------------------------------------- flash + notices */
.flash-stack { padding-top: 24px; }
.flash { margin: 0 0 16px; padding: 12px 16px; border-radius: var(--r-s); background: var(--surface); border: 1px solid var(--line); max-width: none; }
.flash p:last-child { margin-bottom: 0; }
.flash-success { background: var(--ok-soft); border-color: transparent; color: #165c3d; }
.flash-error { background: #FDE8EA; border-color: transparent; color: #8c1b2a; }
.flash-info { background: var(--accent-soft); border-color: transparent; color: #2f348f; }
.notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; margin-bottom: 24px; background: var(--warm); color: var(--warm-ink); border-radius: var(--r-m); }
.notice p { margin: 0; }
.notice form { margin: 0; }
.notice-inline { color: var(--warn); font-weight: 600; }

/* ---------------------------------------------------------------- home: hero */
.hero { padding: 32px 0 24px; }
.hero-panel { background: var(--tint); border-radius: var(--r-l); padding: clamp(32px, 6vw, 72px); display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero h1 { font-size: clamp(2.1rem, 4.2vw, 3rem); line-height: 1.08; letter-spacing: -0.03em; font-weight: 800; }
.hero .lede { font-size: 1.2rem; color: var(--muted); max-width: 44ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-note { margin-top: 18px; font-size: .92rem; color: var(--muted); }
@media (max-width: 900px) { .hero-panel { grid-template-columns: 1fr; } }

/* A small, real-looking invoice that shows what the main tool makes. */
.mock { position: relative; }
.mock-sheet { background: var(--surface); border-radius: var(--r-m); box-shadow: var(--shadow); padding: 28px 28px 24px; font-size: .88rem; border-top: 6px solid var(--accent); }
.mock-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.mock-biz { font-weight: 700; font-size: 1rem; }
.mock-muted { color: var(--muted); }
.mock-title { text-align: right; color: var(--accent); font-weight: 300; font-size: 1.4rem; letter-spacing: .04em; line-height: 1; }
.mock-num { text-align: right; font-weight: 700; margin-top: 6px; }
.mock-gap { height: 14px; }
.mock-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.mock-total { display: flex; justify-content: space-between; margin-top: 14px; font-weight: 800; font-size: 1.05rem; color: var(--accent); }
.mock-chip { position: absolute; right: -10px; bottom: -14px; background: var(--ok-soft); color: var(--ok); font-weight: 700; font-size: .85rem; padding: 6px 14px; border-radius: 999px; box-shadow: var(--shadow); }
@media (max-width: 520px) { .mock-chip { right: 8px; } }

/* ---------------------------------------------------------------- sections */
.section { padding: 72px 0 8px; }
.section-quiet { padding-bottom: 88px; }
.section-head { max-width: 62ch; margin-bottom: 28px; }
.section-head p { color: var(--muted); font-size: 1.08rem; }
.section-link { margin-top: 20px; font-weight: 600; }

/* Tool cards (used on home, tools, toolset and account pages) */
.tool-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.tool-row { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); transition: border-color .15s, box-shadow .15s; }
.tool-row:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: var(--shadow); }
.tool-row a { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 22px 22px 24px; text-decoration: none; color: inherit; border-radius: var(--r-m); }
.tool-row-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.tool-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.tool-icon svg { width: 22px; height: 22px; }
.tool-row-text { display: flex; flex-direction: column; gap: 6px; }
.tool-row-name { margin: 0; font-weight: 700; font-size: 1.1rem; line-height: 1.3; letter-spacing: -0.01em; }
.tool-row-summary { color: var(--muted); font-size: .97rem; }
.tool-row-extra { margin-top: 6px; padding: 10px 14px; background: var(--tint); border-radius: var(--r-s); color: var(--ink); font-size: .95rem; max-width: 70ch; }
.tool-row.featured { grid-column: 1 / -1; }
.tool-row.featured .tool-row-summary { max-width: 60ch; }
.tool-row.featured .tool-row-name { font-size: 1.3rem; }

.tool-list.compact { grid-template-columns: 1fr; gap: 8px; }
.tool-list.compact .tool-row a { flex-direction: row; align-items: center; gap: 14px; padding: 14px; }
.tool-list.compact .tool-row-top { display: contents; }
.tool-list.compact .tool-row .badges { order: 3; margin-left: auto; }
.tool-list.compact .badge-extra { display: none; }
.tool-list.compact .tool-icon { width: 34px; height: 34px; border-radius: 10px; }
.tool-list.compact .tool-row-text { gap: 0; }
.tool-list.compact .tool-row-summary { display: none; }
@media (prefers-reduced-motion: reduce) { .tool-row { transition: none; } }

.badge { display: inline-block; white-space: nowrap; font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; line-height: 1.5; }
.badge-public { color: var(--ok); background: var(--ok-soft); }
.badge-account { color: #2f348f; background: var(--accent-soft); }
.badge-premium { color: #fff; background: var(--accent); }
.badge-owned { color: var(--ok); background: var(--ok-soft); }
.badge-warn { color: var(--warn); background: #FDF0E1; }
.badge-muted { color: var(--muted); background: var(--tint); }
.badge-extra { color: var(--accent); background: var(--surface); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }

.toolset-block { margin-top: 48px; }
.toolset-block-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.toolset-block-head h2 { margin: 0; }
.toolset-block-head a { text-decoration: none; color: var(--ink); }
.toolset-block > p { color: var(--muted); }

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 24px; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; margin-bottom: 14px; }
.steps strong { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.steps span { color: var(--muted); }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

.cta-band { background: var(--tint); border-radius: var(--r-l); padding: clamp(28px, 5vw, 48px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.cta-band h2 { margin: 0 0 4px; }
.cta-band p { margin: 0; color: var(--muted); }

.upsell { margin-top: 48px; padding: 32px; background: var(--tint); border-radius: var(--r-l); }
.plan-inline { padding-left: 1.2em; }

/* ---------------------------------------------------------------- forms */
.stack-form { display: grid; gap: 18px; }
fieldset { border: 0; padding: 0; margin: 0 0 8px; display: grid; gap: 16px; }
legend { font-weight: 700; font-size: 1.15rem; margin-bottom: 8px; padding: 0; }
.field { display: grid; gap: 6px; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .field-pair { grid-template-columns: 1fr; } }
label { font-weight: 600; font-size: .97rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], select, textarea {
  width: 100%; min-height: 48px; padding: 11px 14px;
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid #8A90A3; border-radius: var(--r-s);
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: #646B80; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; box-shadow: 0 0 0 4px var(--accent-soft); }
input[aria-invalid=true] { border-color: var(--danger); }
.hint { font-size: .92rem; color: var(--muted); margin: 0; }

/* Info tips next to form labels: hover, keyboard focus or tap to open */
.label-row { position: relative; display: flex; align-items: center; gap: 8px; }
.info { display: inline-flex; }
.info-btn { width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--accent-soft); color: var(--accent); font: 700 12px/1 var(--font); font-style: italic; cursor: help; display: grid; place-items: center; flex: none; }
.info-btn:hover, .info.open .info-btn { background: var(--accent); color: #fff; border-color: var(--accent); }
/* The tip is anchored to the label row, so it never runs off the side of a narrow screen. */
.info-tip { display: none; position: absolute; left: 0; top: calc(100% + 8px); z-index: 30; width: max-content; max-width: min(340px, 100%);
  padding: 10px 12px; border-radius: var(--r-s); background: var(--ink); color: #fff; font-size: .9rem; font-weight: 400; line-height: 1.45;
  box-shadow: var(--shadow); }
.info:hover .info-tip, .info-btn:focus-visible + .info-tip, .info.open .info-tip { display: block; }
.info.dismissed .info-tip { display: none; }
.field-error { color: var(--danger); font-weight: 600; font-size: .93rem; margin: 0; }
.form-error { color: var(--danger); font-weight: 600; }
.form-foot { text-align: center; margin: 0; color: var(--muted); }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .affix { position: absolute; left: 14px; color: var(--muted); font-weight: 600; pointer-events: none; }
.input-wrap .affix-end { left: auto; right: 14px; }
.input-money input { padding-left: 30px; }
.input-percent input { padding-right: 34px; }

.check { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; }
.check input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--accent); }
.check label { font-weight: 400; }
.check-error label { color: var(--danger); }

.disclaimer-fieldset { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); }
.disclaimer-box { max-height: 300px; overflow-y: auto; padding: 18px; background: var(--tint); border-radius: var(--r-s); font-size: .94rem; }
.disclaimer-box h2 { font-size: 1rem; margin-top: 1em; }
.disclaimer-box h2:first-child { margin-top: 0; }

/* ---------------------------------------------------------------- calculator tool pages */
.tool-title { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.tool-title h1 { margin: 0; }
.tool-page .lede-dark { margin-top: 12px; }
.tool-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 32px; margin-top: 32px; align-items: start; }
@media (max-width: 880px) { .tool-layout { grid-template-columns: minmax(0, 1fr); } } /* minmax: a wide results table scrolls inside its box instead of widening the page */
.tool-main { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 32px; }
.tool-form { display: grid; gap: 16px; }
.tool-form .btn { justify-self: start; }
.tool-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 24px; }
.tool-side h2 { font-size: 1.05rem; }
.ticks { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.ticks li { padding-left: 28px; position: relative; }
.ticks li::before { content: ''; position: absolute; left: 3px; top: .5em; width: 12px; height: 7px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.side-ok { color: var(--ok); font-weight: 600; }
.side-warning { margin-top: 24px; padding: 16px 18px; background: var(--warm); color: var(--warm-ink); border-radius: var(--r-s); }
.side-warning h2 { color: var(--warm-ink); font-size: 1rem; margin-bottom: 4px; }
.side-warning p { margin: 0; font-size: .94rem; }

.tool-output { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 28px; }
.headline-result { background: var(--accent-soft); color: #2f348f; border-radius: var(--r-m); padding: 18px 22px; margin-bottom: 16px; }
.headline-label { margin: 0; font-weight: 600; }
.headline-value { margin: 0; font-size: clamp(2rem, 6vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; color: var(--accent); }
.result-list { display: grid; grid-template-columns: 1fr auto; margin: 0 0 16px; }
.result-list dt, .result-list dd { padding: 10px 0; border-bottom: 1px solid var(--line); margin: 0; }
.result-list dd { text-align: right; font-weight: 700; }
.result-table-wrap { overflow-x: auto; margin-bottom: 16px; position: relative; }
.result-table, .data-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.result-table caption { text-align: left; font-weight: 700; padding-bottom: 8px; }
.result-table th, .result-table td, .data-table th, .data-table td { padding: 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.result-table th, .data-table th { color: var(--muted); font-weight: 600; font-size: .88rem; }
.result-table th:first-child, .result-table td:first-child { text-align: left; }
.result-table.row-titles td:first-child { white-space: normal; min-width: 9em; }
/* Phones: each row of a results table is a small card, every value labelled with its column. */
@media (max-width: 560px) {
  .result-table thead { display: none; }
  .result-table, .result-table caption, .result-table tbody, .result-table tr { display: block; width: 100%; }
  .result-table tr { border-bottom: 1px solid var(--line); padding: 6px 0; }
  .result-table td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 0; white-space: normal; text-align: right; }
  .result-table td::before { content: attr(data-label); color: var(--muted); text-align: left; }
  .result-table.row-titles td:first-child { font-weight: 700; padding-bottom: 2px; }
  .result-table.row-titles td:first-child::before { content: none; }
}
.data-table th, .data-table td { text-align: left; }
.data-table .num { text-align: right; }
.result-notes { padding-left: 1.2em; color: var(--muted); font-size: .95rem; }
.premium-hint { padding: 12px 16px; background: var(--tint); border-radius: var(--r-s); font-size: .95rem; }
.save-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.save-row .save-title { flex: 1 1 220px; }
.save-status { font-weight: 600; color: var(--ok); }
.verify-note { font-size: .9rem; color: var(--muted); margin: 0; }

/* ---------------------------------------------------------------- pricing */
.pricing-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; }
.pricing-head h1 { margin-bottom: .3em; }
.pricing-head .lede-dark { margin: 0; }
.billing-toggle { display: inline-flex; padding: 4px; gap: 4px; background: var(--tint); border-radius: 999px; }
.billing-toggle button { border: 0; background: none; font: inherit; font-weight: 600; font-size: .95rem; color: var(--muted); padding: 8px 16px; border-radius: 999px; cursor: pointer; }
.billing-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.billing-toggle .save { color: var(--ok); font-weight: 700; font-size: .85rem; }
.pricing-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.currency-pick { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; font-size: .95rem; color: var(--muted); }
.currency-pick select { width: auto; min-height: 42px; padding: 8px 12px; border-radius: 999px; font-size: .95rem; color: var(--ink); }
.currency-note { margin: 14px 0 0; padding: 10px 14px; background: var(--tint); border-radius: var(--r-s); font-size: .9rem; color: var(--muted); max-width: none; }
.billed-aud { display: block; margin-top: 2px; font-size: .85rem; color: var(--muted); }
.plan-section { margin-top: 32px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; align-items: stretch; }
.plan { display: flex; flex-direction: column; gap: 10px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.plan-head h2 { font-size: 1.1rem; margin: 0; }
.plan .btn, .plan form { margin-top: auto; }
.plan form .btn, .plan > .btn { width: 100%; }
.plan .hint { margin-top: -2px; }
.plan-featured { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.plan-soon { background: var(--tint); border-style: dashed; }
.plan-price .amount { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.plan-price .per { color: var(--muted); }
.plan-sub { display: block; margin-top: 2px; font-size: .9rem; color: var(--ok); font-weight: 600; }
.plan-summary { color: var(--muted); margin: 0; font-size: .97rem; }
.plan .ticks { margin: 0 0 8px; gap: 6px; font-size: .95rem; }
.plan .side-ok { margin: auto 0 0; }
/* Tool guides: how-to, formulas and FAQs under each tool */
.guide { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--line); }
@media (max-width: 880px) { .guide { grid-template-columns: 1fr; } }
.guide h2 { font-size: 1.35rem; }
.guide h3 { font-size: 1.02rem; margin: 0 0 4px; }
.guide-steps { padding-left: 1.3em; display: grid; gap: 8px; margin: 0 0 20px; }
.guide-steps li::marker { color: var(--accent); font-weight: 700; }
.formulas { display: grid; gap: 10px; margin: 0 0 16px; }
.formulas > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); padding: 12px 16px; }
.formulas dt { font-size: .88rem; font-weight: 700; color: var(--muted); }
.formulas dd { margin: 2px 0 0; font-weight: 600; }
.guide-example { background: var(--tint); border-radius: var(--r-s); padding: 12px 16px; }
.guide-faqs .faq { padding: 14px 0; border-bottom: 1px solid var(--line); }
.guide-faqs .faq p { margin: 0; color: var(--muted); }
.guide-sources { margin-top: 16px; font-size: .93rem; }
.guide-note { font-size: .85rem; color: var(--muted); }

/* Home page FAQs */
.faq-list { display: grid; gap: 10px; max-width: 820px; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 0 20px; }
.faq-item summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.4rem; line-height: 1; color: var(--accent); flex: none; }
.faq-item[open] summary::after { content: '–'; }
.faq-item summary h3 { margin: 0; font-size: 1.02rem; }
.faq-item p { margin: 0 0 18px; color: var(--muted); }

/* "What's in each plan" table */
.compare { margin-top: 48px; }
.compare h2 { font-size: 1.35rem; }
.compare-table { width: 100%; min-width: 340px; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); font-size: .95rem; }
.compare-table th, .compare-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
.compare-table thead th { font-size: 1rem; font-weight: 700; padding-top: 16px; }
.compare-table th[scope="row"] { text-align: left; font-weight: 500; color: var(--ink); width: 46%; }
.compare-table thead th:not(:first-child) { width: 18%; } /* plan columns the same width */
.compare-table td.is-featured, .compare-table th.is-featured { background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }
.compare-table thead th.is-featured { color: var(--accent); }
.compare-table .group-row th { text-align: left; background: var(--tint); font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 9px; padding-bottom: 9px; }
.compare-table .lead-row th, .compare-table .lead-row td { font-size: .9rem; color: var(--muted); }
.compare-table tbody:last-child tr:last-child > * { border-bottom: 0; }
.tick-yes { display: inline-block; width: 22px; height: 22px; border-radius: 50%; background: var(--ok-soft); position: relative; vertical-align: middle; }
.tick-yes::after { content: ''; position: absolute; left: 7px; top: 5px; width: 6px; height: 10px; border: solid var(--ok); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.tick-no { color: #B5BACB; font-weight: 600; }
.cell-text { font-size: .88rem; font-weight: 600; color: var(--muted); }
@media (max-width: 560px) {
  .compare-table { min-width: 0; font-size: .88rem; }
  .compare-table th, .compare-table td { padding: 9px 4px; }
  .compare-table th[scope="row"] { width: auto; padding-left: 10px; }
  .compare-table thead th { font-size: .9rem; }
  .compare-table .lead-row { display: none; }
  .cell-text { font-size: .74rem; }
}

.fine-print { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); font-size: .93rem; color: var(--muted); }
.fine-print h2 { font-size: 1.05rem; color: var(--ink); }

/* ---------------------------------------------------------------- account */
.account-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; align-items: start; }
.account-layout > * { min-width: 0; }
.account-nav { position: sticky; top: 96px; }
.account-who { font-size: .95rem; word-break: break-word; }
.account-who span { color: var(--muted); }
.account-nav ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.account-nav a { display: block; padding: 9px 14px; border-radius: var(--r-s); text-decoration: none; color: var(--muted); font-weight: 500; }
.account-nav a:hover { background: var(--tint); color: var(--ink); }
.account-nav a[aria-current=page] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
@media (max-width: 820px) {
  .account-layout { grid-template-columns: 1fr; gap: 20px; }
  .account-nav { position: static; }
  .account-nav ul { display: flex; flex-wrap: wrap; gap: 4px; padding-bottom: 4px; }
  .account-nav a { white-space: nowrap; }
}
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 28px; margin-bottom: 20px; }
.panel h2 { font-size: 1.15rem; }
.panel h3 { margin-top: 16px; }
.plain-list { padding-left: 1.2em; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 24px; margin: 14px 0 18px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.sub-head, .saved-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.sub-head h2, .saved-head h2 { margin: 0; }
.saved-head form { margin: 0; }
.saved-headline span { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form { margin: 0; }
.danger-zone { border-color: #F2C7CD; }

/* ------------------------------------------------------------ admin area */
.admin-area .account-who strong { color: var(--accent); }
.admin-lock { margin-top: 16px; }
.admin-stats { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.admin-stats li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px 16px; display: grid; gap: 2px; }
.admin-stats strong { font-size: 1.6rem; line-height: 1.1; }
.admin-stats span { color: var(--muted); font-size: .9rem; }
.admin-search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-search input[type=text] { flex: 1 1 160px; width: auto; min-width: 0; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0; }
.admin-tabs a { padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); background: var(--tint); font-size: .92rem; font-weight: 600; }
.admin-tabs a:hover { color: var(--ink); }
.admin-tabs a[aria-current=page] { background: var(--accent-soft); color: var(--accent); }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table th, .admin-table td { white-space: normal; }
.admin-table td { overflow-wrap: anywhere; }
.admin-table td:last-child, .admin-table th:last-child { padding-right: 0; }
/* Phones: each row becomes a small block, so nothing scrolls sideways. */
@media (max-width: 640px) {
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .admin-table tr:last-child { border-bottom: 0; }
  .admin-table td { border: 0; padding: 2px 0; }
  .admin-table td.num { text-align: left; }
}
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .badge { white-space: nowrap; overflow-wrap: normal; }
.admin-table .nowrap { white-space: nowrap; overflow-wrap: normal; }
.admin-subs { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 12px; }
.admin-subs li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.admin-subs li > div:first-child { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.admin-inline { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 12px; }
.admin-inline .field { flex: 1 1 200px; }
.admin-history { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; font-size: .95rem; overflow-wrap: anywhere; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; color: var(--muted); }
.admin-area .facts dd { overflow-wrap: anywhere; min-width: 0; }
.admin-area .panel > .actions { margin-top: 12px; }
.admin-area h1 { overflow-wrap: anywhere; }
/* position: relative keeps hidden screen-reader labels inside the scroll box, so a wide table never widens the page */
.table-scroll { overflow-x: auto; position: relative; }
.mail-body { white-space: pre-wrap; font-family: inherit; background: var(--tint); padding: 14px; border-radius: var(--r-s); }

/* ---------------------------------------------------------------- legal */
.legal { max-width: 780px; }
.legal h2 { margin-top: 1.8em; font-size: 1.25rem; }
.legal h3 { margin-top: 1.5em; }
.legal-callout { padding: 18px 20px; background: var(--tint); border-radius: var(--r-m); }

/* ---------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); padding: 56px 0 36px; font-size: .95rem; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h2 { font-size: .95rem; color: var(--ink); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-brand p { margin-top: 12px; max-width: 36ch; }
.footer-legal { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: .87rem; }
.footer-legal a { text-decoration: underline; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* More tools at the foot of each tool page */
.related-tools { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }
.related-tools h2 { font-size: 1.2rem; }
.related-tools .tool-list.compact { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ---------------------------------------------------------------- accounts & tax */
.books-eyebrow { margin: 0 0 6px; font-size: .85rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
/* The tabs scroll sideways on small screens only; the grey line is drawn inside the list so nothing overflows downwards. */
.books-tabs { margin: 0 0 28px; }
.books-tabs ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; box-shadow: inset 0 -1px 0 var(--line); }
.books-tabs ul::-webkit-scrollbar { display: none; }
.books-tabs a { display: block; padding: 10px 14px; color: var(--muted); text-decoration: none; font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; }
.books-tabs a:hover { color: var(--ink); }
.books-tabs a[aria-current=page] { color: var(--accent); border-bottom-color: var(--accent); }
.books-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 8px; }
.books-title h1 { margin: 0; font-size: clamp(1.7rem, 3.6vw, 2.2rem); }
.books .lede-dark { margin-top: 8px; }
.books .reg-callout { border: 2px solid var(--accent); background: var(--accent-soft); }
.books .reg-actions { margin-top: 12px; }
.period-bar, .filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin: 20px 0 8px; }
.filter-bar { margin: 8px 0 20px; }
.period-field { display: grid; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.period-field select, .period-field input { min-height: 40px; padding: 7px 12px; font-size: .95rem; width: auto; }
.period-search { flex: 1 1 220px; }
.period-search input { width: 100%; }
.period-step { min-width: 40px; min-height: 40px; padding: 0 12px; font-size: 1.2rem; line-height: 1; }
.period-label { margin: 4px 0 20px; }
.js .js-hide { display: none; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 16px 0 20px; }
.stat { display: grid; gap: 4px; padding: 16px 18px; background: var(--tint); border-radius: var(--r-s); }
.stat span { color: var(--muted); font-size: .9rem; font-weight: 600; }
.stat strong { font-size: 1.5rem; letter-spacing: -0.02em; }
.stat-main { background: var(--accent-soft); color: #2f348f; }
.stat-main span { color: #2f348f; }
.bas-table th[scope=row] { width: 64px; color: var(--ink); font-weight: 700; }
.bas-table .row-extra th, .bas-table .row-extra td { color: var(--muted); }
.pl-table th[scope=row] { font-weight: 500; color: var(--ink); }
.pl-table .group-head th { padding-top: 18px; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pl-table .total-row th, .pl-table .total-row td { font-weight: 700; }
.pl-table .grand-row th, .pl-table .grand-row td { font-weight: 800; font-size: 1.05rem; border-top: 2px solid var(--ink); border-bottom: 0; }
.check-panel { border-color: #F0D3B5; background: #FFFBF6; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.check-list li { display: grid; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.check-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.check-list a { font-weight: 600; justify-self: start; }
.issue { color: var(--warn); font-size: .88rem; font-weight: 600; }
.block { display: block; }
.nowrap { white-space: nowrap; }
.tx-panel { padding: 8px 16px; }
.tx-table td { vertical-align: top; }
.tx-table .meta { font-size: .84rem; }
.tx-out td { color: var(--muted); }
.tx-out strong { font-weight: 600; }
.tx-kind { display: inline-block; min-width: 34px; margin-right: 6px; padding: 1px 7px; border-radius: 999px; font-size: .74rem; font-weight: 700; text-align: center; vertical-align: 1px; }
.tx-income { background: var(--ok-soft); color: var(--ok); }
.tx-expense { background: #FDF0E1; color: var(--warn); }
.kind-pick { display: flex; flex-wrap: wrap; gap: 10px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-s); font-weight: 500; cursor: pointer; }
.choice input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.copy-row { display: flex; gap: 8px; flex-wrap: wrap; }
.copy-row input { flex: 1 1 320px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88rem; }
.share-fresh { border: 2px solid var(--accent); }
.share-notice { margin-bottom: 24px; }
.books-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 28px 0; }
.books-features .panel { margin: 0; }
.books-features p { margin: 0; color: var(--muted); }
.books-disclaimer { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .88rem; color: var(--muted); max-width: 80ch; }
.danger-link { color: var(--danger); padding-left: 0; }
.panel.empty .actions { justify-content: flex-start; }
@media (max-width: 640px) {
  .period-field { flex: 1 1 40%; }
  .period-field select { width: 100%; }
  /* The year is short; give the period name the room. */
  .period-field:has(select[name=fy]) { flex: 0 1 auto; }
  /* Tabs that don't fit scroll sideways: fade the edge so it's clear there's more. */
  .books-tabs ul { padding-right: 32px; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
  .tx-table { font-size: .9rem; }
}
@media print {
  .site-header, .site-footer, .devbar, .books-tabs, .no-print, .period-bar, .filter-bar, .skip, .flash-stack { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; }
  .panel { border: 0; padding: 0; margin-bottom: 18px; break-inside: avoid; }
  .books a { color: inherit; text-decoration: none; }
}
.tx-link { font-weight: 700; color: var(--ink); text-decoration: none; }
.tx-link:hover { color: var(--accent); text-decoration: underline; }
.tx-out .tx-link { font-weight: 600; color: var(--muted); }
.tx-table { min-width: 680px; }
.tx-table td:nth-child(2) { min-width: 220px; }
.books .field-pair { align-items: start; }
.bas-table td:nth-child(2), .pl-table th[scope=row], .tx-table td, .books .data-table td:nth-child(2) { white-space: normal; }
.bas-table td:nth-child(2) { min-width: 150px; }
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .books .panel { padding: 20px 16px; }
  .books .data-table th, .books .data-table td { padding: 9px 6px; white-space: normal; }
  .books-title .actions { width: 100%; }
}

/* Plan filter on the tools page, and plan badges */
.plan-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 6px; }
.plan-filter a { padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
.plan-filter a:hover { border-color: var(--accent); color: var(--accent); }
.plan-filter a[aria-current=page] { background: var(--ink); border-color: var(--ink); color: #fff; }
.plan-filter-note { margin: 6px 0 0; }
.lede-dark .plan-tag { font-size: .8rem; vertical-align: 2px; }
.badge-tier-basic { color: #2f348f; background: var(--accent-soft); }
.badge-tier-premium { color: #fff; background: var(--accent); }
.badge-tier-free { color: var(--ok); background: var(--ok-soft); }

/* ---- phones and tablets (touch screens) */
@media (hover: none) and (pointer: coarse) {
  /* iPhones zoom the page when a field under 16px is tapped; 16px stops that. */
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]), select, textarea { font-size: 16px !important; }
  /* The little "i" buttons: same look, a bigger area to tap. */
  .info-btn { position: relative; }
  .info-btn::after { content: ""; position: absolute; inset: -10px; }
}
