/*!********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ../../node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[2].use[1]!../../node_modules/next/dist/build/webpack/loaders/next-font-loader/index.js??ruleSet[1].rules[14].oneOf[2].use[2]!../../node_modules/next/font/google/target.css?{"path":"src/app/layout.tsx","import":"Fraunces","arguments":[{"subsets":["latin"],"variable":"--font-display","style":["normal","italic"],"axes":["opsz","SOFT"]}],"variableName":"display"} ***!
  \********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/* vietnamese */
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url(/_next/static/media/6abc91adc2ea99a6-s.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url(/_next/static/media/7d08bfa01b04d053-s.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url(/_next/static/media/e0f4b1ebfdbd83f9-s.p.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/_next/static/media/e8c7e585bb5e69ba-s.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/_next/static/media/d02d66744511ad29-s.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/_next/static/media/26dc4a78f0c7af7f-s.p.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}@font-face {font-family: 'Fraunces Fallback';src: local("Times New Roman");ascent-override: 84.71%;descent-override: 22.09%;line-gap-override: 0.00%;size-adjust: 115.45%
}.__className_d3f1c8 {font-family: 'Fraunces', 'Fraunces Fallback'
}.__variable_d3f1c8 {--font-display: 'Fraunces', 'Fraunces Fallback'
}

/*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ../../node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[2].use[1]!../../node_modules/next/dist/build/webpack/loaders/next-font-loader/index.js??ruleSet[1].rules[14].oneOf[2].use[2]!../../node_modules/next/font/google/target.css?{"path":"src/app/layout.tsx","import":"Instrument_Sans","arguments":[{"subsets":["latin"],"variable":"--font-body"}],"variableName":"body"} ***!
  \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/* latin-ext */
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(/_next/static/media/adb45196eddef626-s.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(/_next/static/media/26d0ba92e140f0dc-s.p.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}@font-face {font-family: 'Instrument Sans Fallback';src: local("Arial");ascent-override: 94.42%;descent-override: 24.33%;line-gap-override: 0.00%;size-adjust: 102.74%
}.__className_3f4a4b {font-family: 'Instrument Sans', 'Instrument Sans Fallback';font-style: normal
}.__variable_3f4a4b {--font-body: 'Instrument Sans', 'Instrument Sans Fallback'
}

/*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ../../node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[2].use[1]!../../node_modules/next/dist/build/webpack/loaders/next-font-loader/index.js??ruleSet[1].rules[14].oneOf[2].use[2]!../../node_modules/next/font/google/target.css?{"path":"src/app/layout.tsx","import":"Spline_Sans_Mono","arguments":[{"subsets":["latin"],"variable":"--font-mono"}],"variableName":"mono"} ***!
  \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/* latin-ext */
@font-face {
  font-family: 'Spline Sans Mono';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(/_next/static/media/59829bb575d36b50-s.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Spline Sans Mono';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(/_next/static/media/e02f7a71372872a3-s.p.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}@font-face {font-family: 'Spline Sans Mono Fallback';src: local("Arial");ascent-override: 71.59%;descent-override: 17.57%;line-gap-override: 0.00%;size-adjust: 134.59%
}.__className_0abb9b {font-family: 'Spline Sans Mono', 'Spline Sans Mono Fallback';font-style: normal
}.__variable_0abb9b {--font-mono: 'Spline Sans Mono', 'Spline Sans Mono Fallback'
}

/*!*************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ../../node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[2]!../../node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[3]!./src/app/globals.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************************/
/*
 * KeepFlow design system — "ledger paper" direction (Mendy design bar,
 * 2026-09-01; Fable 5.1 polish pass 2026-09-02).
 *
 * Material: warm layered paper with a faint grain and a ledger-dot grid in
 * the work area; a deep evergreen rail; brass accents. Type: Fraunces
 * (display, with SOFT/opsz axes and italic accents) over Instrument Sans,
 * Spline Sans Mono for money and dates. Motion is purposeful and quiet —
 * content rises in as steps advance, the rail fills, rows stagger. No
 * vendor branding beyond the locked Google convenience button on sign-in.
 */

:root {
  /* Ink + surfaces */
  --ink: #1b2823;
  --ink-soft: #4f605a;
  --ink-faint: #7b8982;
  --paper: #f1ede2;
  --paper-deep: #e7e0cf;
  --panel: #fdfbf5;
  --panel-warm: #f9f4e8;
  --line: #e2dbc7;
  --line-strong: #cdc4aa;

  /* Evergreen + brass */
  --pine: #0e3a2d;
  --pine-deep: #08251e;
  --pine-mist: #e0eae3;
  --accent: #14684f;
  --accent-strong: #0d5240;
  --accent-tint: #dcebe1;
  --brass: #a77b2b;
  --brass-deep: #8c6520;
  --brass-soft: #f2e5c9;

  /* Standing colors */
  --good: #14684f;
  --good-bg: #dcebe1;
  --maybe: #8a6116;
  --maybe-bg: #f5e8ca;
  --no: #8c4a3b;
  --no-bg: #f0dfd8;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow:
    0 1px 2px rgba(27, 40, 35, 0.06),
    0 18px 44px -26px rgba(27, 40, 35, 0.38);
  --shadow-soft:
    0 1px 1px rgba(27, 40, 35, 0.04),
    0 12px 32px -24px rgba(27, 40, 35, 0.3);
  --shadow-lift:
    0 2px 4px rgba(27, 40, 35, 0.06),
    0 22px 48px -26px rgba(27, 40, 35, 0.42);

  /* Grain texture: tiny SVG turbulence, tiled. Tasteful, not noisy. */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");

  --font-display-stack: var(--font-display), "Iowan Old Style", Georgia, serif;
  --font-body-stack: var(--font-body), "Avenir Next", "Segoe UI", sans-serif;
  --font-mono-stack: var(--font-mono), "SF Mono", Menlo, monospace;

  --ease-out: cubic-bezier(0.22, 0.9, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);

  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(70rem 34rem at 8% -10rem, rgba(20, 104, 79, 0.09), transparent 65%),
    radial-gradient(52rem 30rem at 105% 8rem, rgba(167, 123, 43, 0.1), transparent 60%),
    var(--paper);
  font-family: var(--font-body-stack);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv05";
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: var(--grain);
  opacity: 0.05;
  mix-blend-mode: multiply;
  z-index: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

::selection {
  background: rgba(167, 123, 43, 0.28);
}

/* ---------- Motion ---------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes rail-fill {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(20, 104, 79, 0.35);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(20, 104, 79, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(20, 104, 79, 0);
  }
}

@keyframes shimmer {
  from {
    background-position: -40rem 0;
  }
  to {
    background-position: 40rem 0;
  }
}

.rise {
  animation: rise 0.6s var(--ease-out) both;
}

.rise-1 { animation-delay: 0.06s; }
.rise-2 { animation-delay: 0.14s; }
.rise-3 { animation-delay: 0.22s; }
.rise-4 { animation-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Page scaffolding (auth screens) ---------- */

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

.page-center {
  justify-content: center;
  align-items: center;
  padding: 2rem 1.25rem;
}

.auth {
  width: 100%;
  max-width: 26rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  animation: rise 0.6s var(--ease-out) both;
}

.auth-card h1 {
  font-size: 1.85rem;
  margin-bottom: 0.65rem;
}

.verify-page {
  width: 100%;
  max-width: 28rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.verify-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.verify-file input {
  display: block;
  margin-top: 0.35rem;
}

.verify-result {
  margin-top: 0.25rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--panel-warm);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.shell {
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  padding: 3rem 1.25rem;
}

.shell.wide {
  max-width: 44rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.page-foot {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

/* ---------- Brand ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
}

.brand-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  color: #f6efdd;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.16), transparent 45%),
    linear-gradient(150deg, var(--accent) 10%, var(--pine-deep));
  box-shadow: inset 0 0 0 1px rgba(246, 239, 221, 0.16);
}

.brand-name {
  font-family: var(--font-display-stack);
  font-size: 1.25rem;
  font-weight: 640;
  letter-spacing: -0.01em;
}

/* ---------- Type ---------- */

h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display-stack);
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.15;
  font-variation-settings: "SOFT" 30;
}

h1 em,
h2 em {
  font-style: italic;
  font-weight: 500;
  color: var(--brass-deep);
  font-variation-settings: "SOFT" 80;
}

h2 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display-stack);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  font-variation-settings: "SOFT" 30;
}

.lede {
  margin: 0 0 1.5rem;
  color: var(--ink-soft);
  font-size: 0.96rem;
  max-width: 46rem;
  text-wrap: pretty;
}

.note {
  margin: 1.25rem 0 0;
  font-size: 0.8125rem;
  color: var(--ink-faint);
  line-height: 1.55;
}

.note svg {
  vertical-align: -2px;
  margin-right: 0.2rem;
  color: var(--brass);
}

.eyebrow {
  display: block;
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
}

.mono {
  font-family: var(--font-mono-stack);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.optional {
  margin-left: 0.4rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}

/* ---------- Cards / panels ---------- */

.card,
.panel {
  position: relative;
  width: 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 5rem),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 2rem 1.9rem;
}

.card::after,
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background-image: var(--grain);
  opacity: 0.035;
  mix-blend-mode: multiply;
}

.card > *,
.panel > * {
  position: relative;
  z-index: 1;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

.panel-head .lede {
  margin-bottom: 1.2rem;
}

/* ---------- Actions ---------- */

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.actions-stack {
  margin-top: 1.25rem;
}

.check-email-steps {
  margin: 1rem 0 0;
  padding-left: 1.25rem;
  color: var(--ink-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.check-email-steps li {
  margin-bottom: 0.5rem;
}

.check-email-steps strong {
  color: var(--ink);
  font-weight: 600;
}

p.problem {
  color: var(--danger, #b42318);
  font-size: 0.9rem;
}

a.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.625rem 1.15rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    box-shadow 200ms ease,
    transform 180ms var(--ease-spring);
}

a.button:hover,
button:hover {
  background: var(--panel-warm);
  border-color: var(--ink-faint);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -14px rgba(27, 40, 35, 0.5);
}

a.button:active,
button:active {
  transform: translateY(0) scale(0.99);
  box-shadow: none;
}

a.button.primary,
button.primary {
  background: linear-gradient(160deg, #1a7b5e, var(--accent-strong));
  border-color: var(--accent-strong);
  color: #f4efe1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 10px 22px -14px rgba(13, 82, 64, 0.9);
}

a.button.primary:hover,
button.primary:hover {
  background: linear-gradient(160deg, #156b52, #0a4634);
  border-color: #0a4634;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 14px 26px -14px rgba(13, 82, 64, 0.95);
}

a.button.compact,
button.compact {
  width: auto;
  min-height: 2.3rem;
  padding: 0.4rem 1rem;
  font-size: 0.875rem;
}

a.button:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button.danger {
  width: auto;
  border-color: #d8b3a6;
  color: var(--no);
}

button.danger:hover {
  background: var(--no-bg);
  border-color: #c08379;
}

button.ghost,
a.button.ghost {
  width: 100%;
  border-color: transparent;
  background: transparent;
  font-weight: 600;
  color: var(--accent-strong);
  box-shadow: none;
}

button.ghost:hover,
a.button.ghost:hover {
  background: var(--accent-tint);
  border-color: transparent;
  box-shadow: none;
}

button.selected-btn {
  background: var(--accent-tint);
  border-color: #b9d4c5;
  color: var(--accent-strong);
}

.google-glyph {
  flex: none;
}

.text-link {
  color: var(--accent-strong);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  -webkit-text-decoration-color: rgba(20, 104, 79, 0.35);
          text-decoration-color: rgba(20, 104, 79, 0.35);
  transition: -webkit-text-decoration-color 140ms ease;
  transition: text-decoration-color 140ms ease;
  transition: text-decoration-color 140ms ease, -webkit-text-decoration-color 140ms ease;
}

.text-link:hover {
  -webkit-text-decoration-color: var(--accent-strong);
          text-decoration-color: var(--accent-strong);
}

.text-link.small {
  font-size: 0.8rem;
}

/* ---------- Forms ---------- */

.form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

fieldset.form-section {
  margin: 0;
  padding: 1.1rem 1.15rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

fieldset.form-section > legend {
  padding: 0 0.5rem;
  margin-left: -0.5rem;
  font-family: var(--font-display-stack);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
  font-variation-settings: "SOFT" 40;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.field label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
}

.label-lock {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--brass);
  letter-spacing: 0.02em;
}

.field input:not([type="radio"]):not([type="checkbox"]),
.field select,
.field textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.625rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  box-shadow: inset 0 1px 2px rgba(27, 40, 35, 0.05);
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.field input.mono {
  font-family: var(--font-mono-stack);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* Menus: same pill as inputs, brass chevron instead of the browser's arrow. */
.field select {
  -moz-appearance: none;
       appearance: none;
  -webkit-appearance: none;
  padding-right: 2.4rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%238c6520' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 16px 16px;
  cursor: pointer;
}

.field select:hover {
  border-color: var(--ink-faint);
}

.field input::placeholder {
  color: #a4aea8;
}

.field input:hover,
.field select:hover {
  border-color: var(--ink-faint);
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow:
    inset 0 1px 2px rgba(27, 40, 35, 0.04),
    0 0 0 3px rgba(20, 104, 79, 0.16);
}

.field input[readonly] {
  background: var(--paper-deep);
  color: var(--ink-soft);
  box-shadow: none;
}

.field-row {
  display: flex;
  gap: 0.75rem;
}

.field-row .field {
  flex: 1 1;
  min-width: 0;
}

.field-row .field-narrow,
.field.field-narrow {
  flex: none;
  width: 8.5rem;
}

.field-row .field-state {
  flex: none;
  width: 13rem;
}

.field-state select {
  text-overflow: ellipsis;
}

.hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.alert {
  margin: 0 0 0.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid #ddb9ad;
  border-radius: var(--radius-sm);
  background: var(--no-bg);
  color: var(--no);
  font-size: 0.875rem;
  animation: rise 0.35s var(--ease-out) both;
}

.confirm {
  margin: 0 0 0.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid #b9d4c5;
  border-radius: var(--radius-sm);
  background: var(--good-bg);
  color: var(--accent-strong);
  font-size: 0.875rem;
  animation: rise 0.35s var(--ease-out) both;
}

/* ---------- Divider ---------- */

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.125rem 0;
  color: var(--ink-faint);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1 1;
  height: 1px;
  background: var(--line);
}

/* ---------- Status chips ---------- */

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 1rem;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  background: var(--good-bg);
  color: var(--accent-strong);
  font-size: 0.78125rem;
  font-weight: 650;
}

.status-dot {
  width: 0.44rem;
  height: 0.44rem;
  border-radius: 50%;
  background: var(--accent);
}

.status-chip-pending {
  background: var(--maybe-bg);
  color: var(--maybe);
}

.status-dot-pending {
  background: #c4881f;
}

.status-chip-muted {
  background: var(--paper-deep);
  color: var(--ink-soft);
}

.status-dot-muted {
  background: var(--ink-faint);
}

/* ============================================================
   Signed-in app shell: evergreen rail + ledger-paper work area
   ============================================================ */

.app {
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr);
  min-height: 100dvh;
}

.sidebar {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.35rem 0.95rem 1.05rem;
  color: #ece8dc;
  background: #0d4029;
  overflow-y: auto;
  box-shadow: inset -1px 0 0 rgba(244, 239, 223, 0.08);
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--grain);
  opacity: 0.08;
}

.sidebar > * {
  position: relative;
  z-index: 1;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.2rem 0.6rem 0.9rem;
  color: #f4efdf;
}

.side-brand .brand-name {
  color: #f4efdf;
}

.side-brand .brand-glyph {
  box-shadow: inset 0 0 0 1px rgba(246, 239, 221, 0.28);
}

.side-groups {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.side-group-label {
  display: block;
  padding: 0 0.7rem 0.3rem;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(216, 207, 174, 0.6);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.side-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.7rem;
  border-radius: 11px;
  color: #d2ddd6;
  font-size: 0.89rem;
  font-weight: 550;
  text-decoration: none;
  transition: background-color 140ms ease, color 140ms ease, transform 180ms var(--ease-spring);
}

.side-nav a:hover {
  background: rgba(244, 239, 223, 0.08);
  color: #f4efdf;
  transform: translateX(2px);
}

.side-nav a.nav-active {
  background: rgba(30, 198, 119, 0.16);
  color: #faf6ea;
}

.side-nav a.nav-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22%;
  bottom: 22%;
  width: 3px;
  border-radius: 999px;
  background: #1ec677;
  box-shadow: 0 0 12px rgba(30, 198, 119, 0.55);
}

.side-nav svg {
  flex: none;
  opacity: 0.8;
}

.side-nav a.nav-active svg {
  opacity: 1;
  color: #1ec677;
}

.nav-label {
  flex: 1 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-tag {
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(244, 239, 223, 0.12);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d8cfae;
}

/* While the application is in progress, later-product entries sit back so
 * the journey — not "Later" / "Soon" — reads as the important thing. */
.side-nav a.nav-later {
  color: rgba(201, 211, 197, 0.62);
}

.side-nav a.nav-later svg {
  opacity: 0.45;
}

.side-nav a.nav-later .nav-tag {
  background: transparent;
  border: 1px solid rgba(244, 239, 223, 0.16);
  color: rgba(216, 207, 174, 0.6);
}

.side-nav a.nav-later:hover {
  color: #f4efdf;
}

.side-progress {
  margin-top: 0.4rem;
  padding: 0.85rem 0.9rem;
  border-radius: 13px;
  background: rgba(244, 239, 223, 0.07);
  border: 1px solid rgba(244, 239, 223, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: inherit;
  text-decoration: none;
  transition: background-color 140ms ease;
}

.side-progress:hover {
  background: rgba(244, 239, 223, 0.11);
}

.side-progress-track {
  display: block;
}

.side-progress-label {
  font-size: 0.78rem;
  font-weight: 650;
  color: #f0eadb;
}

.side-progress-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(244, 239, 223, 0.14);
  overflow: hidden;
}

.side-progress-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d5a453, #e9c98a);
  transition: width 600ms var(--ease-out);
}

.side-progress-count {
  font-size: 0.72rem;
  color: rgba(216, 207, 174, 0.8);
  font-family: var(--font-mono-stack);
}

.side-foot {
  margin-top: auto;
  padding-top: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border-top: 1px solid rgba(244, 239, 223, 0.12);
}

.side-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.5rem;
  min-width: 0;
}

.side-avatar {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(150deg, #d5a453, #a77b2b);
  color: #1b2823;
  font-family: var(--font-display-stack);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.side-user-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.side-user-name {
  font-size: 0.82rem;
  font-weight: 650;
  color: #f0eadb;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-user-email {
  font-size: 0.72rem;
  color: #aab6a6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-signout {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0.2rem;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  color: #c9d3c5;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
}

.side-signout:hover {
  background: rgba(244, 239, 223, 0.08);
  color: #f4efdf;
}

.main {
  min-width: 0;
  padding: 2.6rem 3.2rem 4.5rem;
  background-image:
    radial-gradient(rgba(27, 40, 35, 0.075) 1px, transparent 1px);
  background-size: 26px 26px;
  background-position: 6px 6px;
}

.main-inner {
  max-width: 62rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.flow-head h1 {
  font-size: 2.3rem;
  margin-bottom: 0.45rem;
  max-width: 30ch;
  text-wrap: balance;
}

.flow-head .lede {
  margin-bottom: 0;
  font-size: 1.02rem;
}

/* ---------- Journey rail (numbered nodes + filling track) ---------- */

.rail {
  display: flex;
  align-items: flex-start;
  margin: 0.3rem 0 0.1rem;
  padding: 1rem 0.9rem;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent 4rem),
    var(--panel-warm);
  box-shadow: var(--shadow-soft);
  animation: rise 0.6s var(--ease-out) both 0.04s;
}

.rail-step {
  position: relative;
  flex: 1 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0;
}

.rail-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.3rem 0.35rem 0.3rem 0.2rem;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: background-color 140ms ease;
}

a.rail-link:hover {
  background: rgba(20, 104, 79, 0.06);
}

.rail-link-static {
  cursor: default;
}

.rail-node {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink-faint);
  font-family: var(--font-mono-stack);
  font-size: 0.78rem;
  font-weight: 600;
  transition: transform 220ms var(--ease-spring), background-color 200ms ease;
}

.rail-node-done {
  background: linear-gradient(160deg, #1a7b5e, var(--accent-strong));
  border-color: var(--accent-strong);
  color: #f4efe1;
}

.rail-node-current {
  background: var(--panel);
  border-color: var(--accent);
  color: var(--accent-strong);
  border-width: 2px;
}

/* The pulse marks the step on screen, not the first unfinished one. */
.rail-here .rail-node {
  animation: pulse-ring 2.4s ease-out infinite 0.8s;
}

.rail-current .rail-link:hover .rail-node,
.rail-done .rail-link:hover .rail-node {
  transform: scale(1.06);
}

.rail-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.rail-title {
  font-size: 0.79rem;
  font-weight: 650;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rail-sub {
  font-size: 0.67rem;
  color: var(--ink-faint);
  white-space: nowrap;
}

.rail-done .rail-title {
  color: var(--accent-strong);
}

.rail-here .rail-title {
  color: var(--ink);
}

.rail-here .rail-sub {
  color: var(--accent-strong);
  font-weight: 600;
}

.rail-track {
  flex: 1 1;
  min-width: 0.5rem;
  height: 2px;
  margin: 0 0.45rem 0 0.1rem;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  overflow: hidden;
  min-width: 0.8rem;
}

.rail-track::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #1c8a68);
  transform-origin: left;
  transform: scaleX(0);
}

.rail-done .rail-track::after {
  transform: scaleX(1);
}

.rail-current .rail-track::after {
  animation: rail-fill 0.9s var(--ease-out) both 0.25s;
  transform: scaleX(0.45);
  opacity: 0.55;
}

/* ---------- Stat tiles ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  grid-gap: 0.9rem;
  gap: 0.9rem;
}

.stat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.1rem 1.2rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), transparent 3rem),
    var(--panel-warm);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.stat::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--grain);
  opacity: 0.04;
  mix-blend-mode: multiply;
}

.stat-hero {
  background:
    radial-gradient(26rem 12rem at 100% 0%, rgba(20, 104, 79, 0.16), transparent 65%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), transparent 3rem),
    var(--panel-warm);
}

.stat-value {
  display: block;
  font-family: var(--font-display-stack);
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.05;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-variation-settings: "opsz" 48, "SOFT" 20;
}

.stat-hero .stat-value {
  font-size: 2.5rem;
}

.stat-value.stat-good {
  color: var(--accent-strong);
}

.stat-value.stat-maybe {
  color: var(--maybe);
}

.stat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.stat-foot {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* ---------- Standing pills ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  vertical-align: middle;
}

.pill-dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

.pill-good {
  background: var(--good-bg);
  color: var(--good);
}

.pill-maybe {
  background: var(--maybe-bg);
  color: var(--maybe);
}

.pill-no {
  background: var(--no-bg);
  color: var(--no);
}

.pill-sample {
  margin-left: 0.45rem;
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-size: 0.62rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.14rem 0.5rem;
}

.pill-soon {
  background: var(--brass-soft);
  color: var(--brass-deep);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Invoice board ---------- */

.board {
  padding: 0;
  overflow: hidden;
}

.board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.6rem 1.15rem;
  border-bottom: 1px solid var(--line);
}

.board-head h2 {
  margin: 0;
}

.board-sub {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.board-head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.inv-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.inv-row {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(8rem, 1fr) minmax(0, 1.3fr) auto;
  grid-gap: 0.4rem 1.25rem;
  gap: 0.4rem 1.25rem;
  align-items: center;
  padding: 1.05rem 1.6rem;
  border-top: 1px solid var(--line);
  transition: background-color 160ms ease, box-shadow 160ms ease;
  animation: rise 0.55s var(--ease-out) both;
}

.inv-row:first-child {
  border-top: none;
}

.inv-row:hover {
  background: rgba(249, 244, 232, 0.8);
}

.inv-row.inv-selected {
  background: linear-gradient(90deg, rgba(20, 104, 79, 0.08), transparent 60%);
  box-shadow: inset 3px 0 0 0 var(--accent);
}

.inv-row.inv-not_qualified .inv-debtor,
.inv-row.inv-not_qualified .inv-amount {
  color: var(--ink-soft);
}

.inv-id {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.inv-mono {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  font-family: var(--font-display-stack);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--paper-deep);
  color: var(--ink-soft);
  box-shadow: inset 0 0 0 1px rgba(27, 40, 35, 0.05);
}

.inv-mono-qualified {
  background: var(--good-bg);
  color: var(--good);
}

.inv-mono-may_qualify {
  background: var(--maybe-bg);
  color: var(--maybe);
}

.inv-mono-not_qualified {
  background: var(--no-bg);
  color: var(--no);
}

.inv-id-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.1rem;
}

.inv-debtor {
  display: block;
  font-weight: 650;
  font-size: 0.96rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-meta {
  display: block;
  font-size: 0.79rem;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-money {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
}

.inv-amount {
  font-family: var(--font-mono-stack);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-size: 1.02rem;
  font-weight: 600;
  text-align: right;
}

.inv-due {
  display: block;
  font-size: 0.76rem;
  color: var(--ink-faint);
  text-align: right;
  white-space: nowrap;
}

.inv-standing {
  min-width: 0;
}

.why-line {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.79rem;
  line-height: 1.42;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.inv-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.inv-secondary {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.inv-locked-note {
  font-size: 0.76rem;
  color: var(--ink-faint);
  padding: 0.35rem 0.2rem;
}

.inv-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.6rem;
  border-top: 1px solid var(--line);
  background: var(--panel-warm);
  transition: background-color 300ms ease;
}

.inv-foot-ready {
  background: linear-gradient(90deg, rgba(20, 104, 79, 0.1), var(--panel-warm) 70%);
}

.inv-foot-note {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.inv-foot-note strong {
  color: var(--accent-strong);
  font-family: var(--font-mono-stack);
  font-weight: 600;
}

/* ---------- Disclosure (add-invoice) ---------- */

details.disclosure {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

details.disclosure > summary {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.05rem 1.6rem;
  cursor: pointer;
  list-style: none;
  transition: background-color 140ms ease;
}

details.disclosure > summary::-webkit-details-marker {
  display: none;
}

details.disclosure > summary::after {
  content: "+";
  margin-left: auto;
  font-family: var(--font-display-stack);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--ink-faint);
  transition: transform 200ms var(--ease-spring), color 140ms ease;
}

details.disclosure[open] > summary::after {
  transform: rotate(45deg);
  color: var(--accent-strong);
}

details.disclosure > summary:hover {
  background: var(--panel-warm);
}

.disclosure-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 11px;
  background: var(--brass-soft);
  color: var(--brass-deep);
}

.disclosure-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.disclosure-title {
  font-weight: 650;
  font-size: 0.97rem;
}

.disclosure-sub {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

details.disclosure > .disclosure-body {
  padding: 0.3rem 1.6rem 1.6rem;
  animation: rise 0.4s var(--ease-out) both;
}

/* ---------- Inline row disclosure (attach copy) ---------- */

details.inline-details {
  position: relative;
}

details.inline-details > summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.3rem 0.4rem;
}

details.inline-details > summary::-webkit-details-marker {
  display: none;
}

details.inline-details[open] > .doc-upload {
  margin-top: 0.4rem;
  animation: fade 0.25s ease both;
}

/* ---------- Empty states ---------- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 3.2rem 1.5rem;
  text-align: center;
}

.empty-hero {
  padding: 4rem 1.5rem 3.6rem;
}

.empty-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.4rem;
  height: 3.4rem;
  margin-bottom: 0.6rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.7), transparent 55%),
    var(--brass-soft);
  color: var(--brass-deep);
  box-shadow: 0 10px 24px -16px rgba(140, 101, 32, 0.7);
  animation: rise 0.6s var(--ease-spring) both;
}

.empty-state h2 {
  margin: 0;
  font-size: 1.45rem;
}

.empty-state p {
  margin: 0;
  max-width: 28rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
  text-wrap: pretty;
}

.empty-state .actions {
  flex-direction: row;
  justify-content: center;
  margin-top: 1.1rem;
  flex-wrap: wrap;
}

.empty-state .actions a.button,
.empty-state .actions button {
  width: auto;
}

/* ---------- Split panel (bank step) ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  grid-gap: 2rem;
  gap: 2rem;
  align-items: start;
}

.split-aside {
  padding: 1.15rem 1.2rem;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent 3rem),
    var(--panel-warm);
  border: 1px solid var(--line);
}

.assure {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.assure li {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.assure li svg {
  flex: none;
  margin-top: 0.15rem;
  color: var(--brass-deep);
}

.assure strong {
  color: var(--ink);
}

.aside-note {
  margin: 1rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--ink-faint);
}

/* ---------- People rows ---------- */

.person-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.person-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.person-row:first-child {
  border-top: none;
}

.person-avatar {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--accent-tint), #c9dccf);
  color: var(--accent-strong);
  font-family: var(--font-display-stack);
  font-size: 0.95rem;
  font-weight: 700;
}

.person-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1 1;
}

.person-name {
  font-weight: 650;
  font-size: 0.98rem;
}

.person-sub {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.person-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--maybe);
  font-weight: 600;
}

.person-status.is-done {
  color: var(--accent-strong);
}

.person-license-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  align-self: flex-start;
  margin-top: 0.15rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1.25;
  border: 1px solid var(--line-soft);
  background: var(--panel-warm);
  color: var(--ink-soft);
}

.person-license-badge.is-done {
  border-color: #b9d4c5;
  background: var(--good-bg);
  color: var(--accent-strong);
}

.person-license-badge.is-needed {
  border-color: #e8d4b8;
  background: #faf4ea;
  color: #8a5a1a;
}

.person-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
  flex: none;
}

.person-upload-tiles {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}

.person-list-compact .person-row-compact {
  align-items: flex-start;
}

.person-main-compact {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.person-main-compact .person-upload-tiles,
.person-main-compact .owner-license-tiles {
  align-items: flex-start;
  margin-top: 0.35rem;
}

.person-main-compact .person-phone-upload {
  align-self: flex-start;
}

.person-main-compact .person-license-cta {
  align-self: flex-start;
  width: auto;
  margin-top: 0.2rem;
}

.owner-form-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.owner-license-section-panel {
  margin-top: 0.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
}

.owner-license-section-head {
  margin-bottom: 0.65rem;
}

.owner-license-section-title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 650;
}

.owner-license-section-hint {
  margin: 0 0 0.75rem;
  max-width: 42rem;
}

.owner-license-section {
  margin-top: 0.35rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line-soft);
}

.owner-license-flow {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
}

.owner-license-phone-hint {
  margin: 0;
  font-size: 0.8rem;
}

.owner-license-tiles {
  align-items: stretch;
  width: 100%;
}

.owner-license-tiles .upload-tile {
  width: 100%;
  max-width: 28rem;
}

.license-on-file-stack {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
}

.license-on-file-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-md);
  background: var(--cream);
  border: 1px solid var(--line-soft);
}

.license-on-file-icon {
  flex: none;
  display: inline-flex;
  color: var(--accent-strong);
}

.license-on-file-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.license-on-file-title {
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.25;
}

.license-on-file-meta {
  font-size: 0.75rem;
  color: var(--ink-soft);
  line-height: 1.3;
}

.license-picked-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-md);
  background: var(--good-bg);
  border: 1px solid #b9d4c5;
  max-width: 28rem;
}

.license-picked-change {
  flex: none;
  margin-left: auto;
  padding: 0.15rem 0.25rem;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
}

.license-file-tile-wrap {
  position: relative;
  width: 100%;
  max-width: 28rem;
}

.license-file-tile-wrap .upload-tile-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.license-file-tile-error {
  margin: 0.25rem 0 0;
}

.owner-license-later {
  margin: 0.35rem 0 0;
  text-align: right;
}

.person-phone-upload-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.85rem 1rem;
  border: 2px solid var(--accent-strong);
  border-radius: var(--radius-lg, 1rem);
  background: linear-gradient(135deg, var(--accent-tint) 0%, var(--panel) 55%);
  box-shadow: 0 2px 12px rgb(26 86 58 / 0.12);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    box-shadow 200ms ease,
    transform 180ms var(--ease-spring);
}

.person-phone-upload-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 18px rgb(26 86 58 / 0.18);
  transform: translateY(-1px);
}

.person-phone-upload-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: var(--accent-strong);
  color: #fff;
}

.person-phone-upload-card-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.person-phone-upload-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-strong);
}

.person-phone-upload-card-hint {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-muted);
  line-height: 1.35;
}

.owner-phone-upload-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.15rem;
  width: 100%;
}

button.owner-phone-upload-btn {
  width: 100%;
}

button.owner-phone-upload-btn--bright {
  border-color: var(--accent-strong);
  background: linear-gradient(135deg, var(--accent-tint) 0%, var(--panel) 70%);
  color: var(--accent-strong);
  font-weight: 700;
  box-shadow: 0 2px 10px rgb(26 86 58 / 0.1);
}

button.owner-phone-upload-btn--bright:hover {
  background: var(--accent-tint);
  border-color: var(--accent);
}

.owner-phone-upload-hint {
  margin: 0;
  text-align: center;
  line-height: 1.35;
}

.owner-tag {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent-strong);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: middle;
}

/* ---------- Document rows (tax step) ---------- */

.docx-list {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.docx-row:has(.debt-schedule) {
  flex-wrap: wrap;
  align-items: flex-start;
}

.docx-row:has(.debt-schedule) .docx-main {
  flex: 1 1 100%;
}

.docx-row {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  padding: 0.95rem 0;
  border-top: 1px solid var(--line);
}

.docx-row:first-child {
  border-top: none;
}

.docx-status {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink-faint);
  font-family: var(--font-mono-stack);
  font-size: 0.76rem;
  font-weight: 600;
  transition: background-color 200ms ease, transform 220ms var(--ease-spring);
}

.docx-status.is-done {
  background: linear-gradient(160deg, #1a7b5e, var(--accent-strong));
  border-color: var(--accent-strong);
  color: #f4efe1;
}

.docx-main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1 1;
}

.docx-title {
  font-weight: 650;
  font-size: 0.94rem;
}

.docx-row.is-done .docx-title {
  color: var(--accent-strong);
}

.docx-sub {
  font-size: 0.8rem;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

/* ---------- Legacy doc/owner rows (owner detail page, documents page) ---------- */

.doc-list,
.owner-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.doc-row,
.owner-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
}

.doc-row:first-child,
.owner-row:first-child {
  border-top: none;
}

.doc-main,
.owner-main {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.doc-title,
.owner-name {
  font-weight: 650;
  font-size: 0.9375rem;
}

.doc-files,
.owner-sub {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.doc-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  flex: none;
}

.doc-pills .pill-books {
  margin-left: 0;
}

.doc-files-empty {
  color: var(--ink-faint);
}

.doc-upload {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
}

.docx-license-uploads {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: none;
}

.file-input {
  max-width: 13rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.file-input::-webkit-file-upload-button {
  margin-right: 0.5rem;
  padding: 0.38rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-transition: background-color 140ms ease, border-color 140ms ease;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.file-input::file-selector-button {
  margin-right: 0.5rem;
  padding: 0.38rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.file-input::-webkit-file-upload-button:hover {
  background: var(--panel-warm);
  border-color: var(--ink-faint);
}

.file-input::file-selector-button:hover {
  background: var(--panel-warm);
  border-color: var(--ink-faint);
}

.card-danger {
  border-color: #ddb9ad;
}

.page-actions {
  margin: 0;
  text-align: right;
  font-size: 0.9375rem;
}

/* ---------- Flow step chrome ---------- */

.step-why {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  margin: 0 0 1.4rem;
  padding: 0.85rem 1.05rem;
  border: 1px solid var(--brass-soft);
  border-radius: var(--radius-sm);
  background: linear-gradient(120deg, rgba(242, 229, 201, 0.55), rgba(253, 251, 244, 0.4));
  color: var(--ink-soft);
  font-size: 0.865rem;
  line-height: 1.5;
}

.step-why svg {
  flex: none;
  margin-top: 0.1rem;
  color: var(--brass);
}

.cta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.3rem;
  flex-wrap: wrap;
}

.cta-bar .spacer {
  flex: 1 1;
}

.cta-bar a.button,
.cta-bar button {
  width: auto;
}

.bank-step-continue {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
}

.bank-step-continue-need {
  margin: 0;
  max-width: 28rem;
  text-align: right;
}

.bank-step-continue.bank-step-continue-page {
  align-items: flex-end;
  margin-top: 1.25rem;
}

/* Bank connection opened in a popup over the page: the step waits here. */
.bank-connect-hosted {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.bank-connect-hosted .note {
  margin-top: 0;
}

.bank-connect-hosted .cta-bar {
  justify-content: flex-start;
  margin-top: 0.7rem;
}

/* ---------- Alternate path (never a dead end) ---------- */

.alt-path {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--line-strong);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.alt-path-or {
  align-self: center;
  margin-top: -1.65rem;
  padding: 0 0.6rem;
  background: var(--panel);
  color: var(--ink-faint);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.alt-path-form,
.alt-path-form button {
  width: 100%;
}

/* The alternate primary: as prominent as Connect, brass instead of green. */
.alt-path-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 3.1rem;
  padding: 0.7rem 1.2rem;
  border: 1.5px solid var(--brass);
  border-radius: 999px;
  background: linear-gradient(160deg, #f6ecd6, var(--brass-soft));
  color: var(--brass-deep);
  font: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  box-shadow: 0 10px 22px -16px rgba(140, 101, 32, 0.8);
  transition: transform 180ms var(--ease-spring), box-shadow 200ms ease, background-color 150ms ease;
}

.alt-path-btn::-webkit-details-marker {
  display: none;
}

.alt-path-btn:hover {
  background: linear-gradient(160deg, #f2e4c6, #ead9b5);
  transform: translateY(-1px);
  box-shadow: 0 14px 26px -16px rgba(140, 101, 32, 0.9);
}

.alt-path-btn:focus-visible {
  outline: 2px solid var(--brass-deep);
  outline-offset: 3px;
}

details.statements[open] > .alt-path-btn {
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
}

.statements-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 0.7rem;
  padding: 1rem 1.1rem 1.1rem;
  border: 1px dashed var(--brass);
  border-radius: var(--radius-sm);
  background: rgba(246, 236, 214, 0.35);
  animation: rise 0.35s var(--ease-out) both;
}

.statements-label {
  font-size: 0.86rem;
  font-weight: 650;
}

.statements-input {
  max-width: none;
  padding: 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fffdf8;
}

.statements-form button {
  width: auto;
  align-self: flex-start;
}

.statements-more {
  margin-top: 1rem;
}

.statements-more > summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.86rem;
}

.statements-more > summary::-webkit-details-marker {
  display: none;
}

.alt-path-later {
  display: flex;
  justify-content: center;
}

.alt-path-later button {
  font-size: 0.82rem;
}

.alt-path-hint {
  margin: 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.cta-hero,
.cta-hero button {
  width: 100%;
}

button.cta-hero-btn {
  min-height: 3.1rem;
  font-size: 0.98rem;
}

.cta-hint {
  font-size: 0.82rem;
  color: var(--ink-faint);
}

details.add-owner {
  margin-top: 1rem;
}

.alert-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.alert-actions > span {
  flex: 1 1 18rem;
}

.alert-actions form {
  flex: none;
}

button.alert-btn {
  border-color: #c08379;
  background: #fff;
  color: var(--no);
}

button.alert-btn:hover {
  background: #fff7f5;
}

/* ---------- Address lookup (typeahead) ---------- */

/* The street field IS the house-bar: icon, pill, texture. Suggestions (when
   lookup is on) drop under this same field. */
.house-bar {
  position: relative;
}

.house-icon {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  color: var(--brass-deep);
  pointer-events: none;
  z-index: 1;
}

.house-icon .spinner {
  color: var(--brass-deep);
}

.field input.house-input {
  min-height: 3rem;
  padding: 0.7rem 1rem 0.7rem 2.6rem;
  border: 1.5px solid var(--brass);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent 2.5rem),
    var(--panel-warm);
  font-size: 0.96rem;
  box-shadow: 0 10px 22px -18px rgba(140, 101, 32, 0.8);
}

.field input.house-input::placeholder {
  color: #9a9483;
}

.field input.house-input:focus-visible {
  border-color: var(--brass-deep);
  background: #fffdf8;
  box-shadow:
    0 0 0 3px rgba(167, 123, 43, 0.18),
    0 10px 22px -18px rgba(140, 101, 32, 0.8);
}

.field input.house-input[aria-invalid="true"] {
  border-color: #c9857a;
}

/* Fixed-height hint under the bar so appearing/clearing never shifts layout. */
.house-hint {
  min-height: 1.25rem;
  line-height: 1.25rem;
  transition: color 200ms ease;
}

/* Fields a lookup pick just filled glow brass for a beat, then settle. */
@keyframes fill-glow {
  0% {
    background-color: var(--brass-soft);
    border-color: var(--brass);
    box-shadow: 0 0 0 3px rgba(167, 123, 43, 0.18);
  }
  100% {
    background-color: #fffdf8;
    border-color: var(--line-strong);
    box-shadow: inset 0 1px 2px rgba(27, 40, 35, 0.05);
  }
}

.field input.is-filled,
.field select.is-filled {
  animation: fill-glow 0.9s var(--ease-out) both;
}

/* The dropdown must float over whatever sits below the address card. The
   panels' entrance animation leaves a transform behind (a stacking context
   per panel, painted in DOM order), and disclosures clip overflow — so lift
   and un-clip any container that currently hosts an open list. */
.panel:has(.lookup-list),
details.disclosure:has(.lookup-list),
.disclosure-body:has(.lookup-list),
.house-field:has(.lookup-list),
.field:has(.lookup-list),
.naics-combo:has(.lookup-list),
.panel:has(.date-pop),
details.disclosure:has(.date-pop),
.disclosure-body:has(.date-pop),
.field:has(.date-pop) {
  z-index: 40;
}

.field:has(.date-pop) {
  position: relative;
}

details.disclosure:has(.lookup-list),
details.disclosure:has(.date-pop) {
  overflow: visible;
}

.house-field {
  position: relative;
}

.lookup-list {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 22rem;
  overflow-y: auto;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  box-shadow: var(--shadow-lift);
  animation: rise 0.22s var(--ease-out) both;
}

.lookup-item {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  padding: 0.6rem 0.8rem;
  border-radius: 9px;
  cursor: pointer;
}

.lookup-item:hover,
.lookup-item.is-active {
  background: var(--accent-tint);
}

.lookup-main {
  font-weight: 600;
  font-size: 0.92rem;
}

.lookup-secondary {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.lookup-entries {
  margin-left: 0.5rem;
}

.lookup-list li + li {
  margin-top: 0.1rem;
}

/* ---------- Masked identifiers (SSN / EIN) with an eye ---------- */

.secret-input {
  position: relative;
}

.secret-input input {
  padding-right: 3rem;
  letter-spacing: 0.06em;
}

.secret-input input[type="password"] {
  font-family: var(--font-mono-stack);
}

.secret-input .eye {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.1rem;
  min-height: 2.1rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-faint);
  box-shadow: none;
}

.secret-input .eye:hover {
  background: var(--paper-deep);
  color: var(--ink);
  transform: translateY(-50%);
  box-shadow: none;
}

.secret-input .eye[aria-pressed="true"] {
  color: var(--accent-strong);
}

/* ---------- Date field: type it, or pick it (month + year menus) ---------- */

.date-picker {
  position: relative;
}

.date-bar {
  position: relative;
}

.field .date-bar input.date-input {
  padding-right: 3rem;
  letter-spacing: 0.04em;
}

.date-picker .date-toggle {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.1rem;
  min-height: 2.1rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-faint);
  box-shadow: none;
}

.date-picker .date-toggle:hover,
.date-picker.is-open .date-toggle {
  background: var(--paper-deep);
  color: var(--accent-strong);
  transform: translateY(-50%);
  box-shadow: none;
}

.date-pop {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 40;
  width: 19.5rem;
  max-width: calc(100vw - 2rem);
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  box-shadow: var(--shadow-lift);
  animation: rise 0.22s var(--ease-out) both;
}

.date-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.date-picker .date-nav {
  flex: none;
  width: 2rem;
  min-height: 2rem;
  padding: 0;
  border-radius: 50%;
  color: var(--ink-soft);
}

.date-picker .date-nav:hover {
  transform: none;
  box-shadow: none;
}

.date-head .date-select {
  flex: 1 1;
  min-width: 0;
  min-height: 2.1rem;
  padding: 0.3rem 1.9rem 0.3rem 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  -moz-appearance: none;
       appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%238c6520' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 14px 14px;
  cursor: pointer;
}

.date-head .date-year {
  flex: none;
  width: 6.2rem;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.date-head .date-select:hover {
  border-color: var(--ink-faint);
}

.date-head .date-select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 104, 79, 0.16);
}

.date-weekdays,
.date-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-gap: 0.15rem;
  gap: 0.15rem;
}

.date-weekdays span {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  padding: 0.2rem 0 0.35rem;
}

.date-picker .date-day {
  width: 100%;
  min-height: 2.25rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 500;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.date-picker .date-day:hover {
  background: var(--accent-tint);
  border-color: transparent;
  transform: none;
  box-shadow: none;
}

.date-picker .date-day.is-today {
  border-color: var(--brass);
  color: var(--brass-deep);
  font-weight: 650;
}

.date-picker .date-day.is-selected,
.date-picker .date-day.is-selected:hover {
  background: linear-gradient(160deg, #1a7b5e, var(--accent-strong));
  border-color: var(--accent-strong);
  color: #f4efe1;
  font-weight: 650;
}

.date-picker .date-day:disabled {
  opacity: 0.28;
}

.date-foot {
  margin: 0.6rem 0 0;
  font-size: 0.74rem;
  color: var(--ink-faint);
  text-align: center;
}

/* ---------- Ownership ask (applicant under 80%) ---------- */

.owners-ask {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  margin: 1.1rem 0 0.6rem;
  padding: 1rem 1.15rem;
  border: 1.5px solid var(--brass);
  border-radius: var(--radius-sm);
  background:
    radial-gradient(24rem 8rem at 0% 0%, rgba(167, 123, 43, 0.12), transparent 70%),
    var(--panel-warm);
  animation: rise 0.45s var(--ease-out) both;
}

.owners-ask-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--brass-soft);
  color: var(--brass-deep);
}

.owners-ask-title {
  margin: 0 0 0.25rem;
  font-family: var(--font-display-stack);
  font-size: 1.12rem;
  font-weight: 600;
}

.owners-ask-copy {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

details.add-owner-urgent {
  border-color: var(--brass);
  box-shadow: 0 12px 28px -22px rgba(140, 101, 32, 0.7);
}

.owners-done {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
  padding: 0.75rem 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
}

.owners-done-copy {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.owners-done button {
  width: auto;
}

/* ---------- One-click uploads (pick = upload) ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.upload-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.3rem;
  padding: 0.4rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    box-shadow 200ms ease,
    transform 180ms var(--ease-spring);
}

.upload-btn:hover {
  background: var(--panel-warm);
  border-color: var(--ink-faint);
  transform: translateY(-1px);
}

.upload-btn-primary {
  background: linear-gradient(160deg, #1a7b5e, var(--accent-strong));
  border-color: var(--accent-strong);
  color: #f4efe1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 10px 22px -14px rgba(13, 82, 64, 0.9);
}

.upload-btn-primary:hover {
  background: linear-gradient(160deg, #156b52, #0a4634);
  border-color: #0a4634;
}

.upload-btn:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.upload-btn.is-pending {
  opacity: 0.85;
  cursor: progress;
  transform: none;
}

/* Sticky completion footer for detail pages (one Save story, one way on). */
.page-foot-bar {
  position: -webkit-sticky;
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 4rem),
    var(--panel-warm);
  box-shadow: 0 -12px 28px -22px rgba(27, 40, 35, 0.45), var(--shadow-soft);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
}

.page-foot-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.page-foot-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-foot-actions a.button,
.page-foot-actions button {
  width: auto;
}

.later-link {
  font-size: 0.85rem;
}

/* ---------- Page footer (owner page): status + the way forward ---------- */

.page-footer {
  position: -webkit-sticky;
  position: sticky;
  bottom: 0.75rem;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.9rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), transparent 3rem),
    var(--panel-warm);
  box-shadow: var(--shadow-lift);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
}

.page-footer-status {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  flex: 1 1 20rem;
}

.page-footer-copy {
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.page-footer a.button {
  width: auto;
  flex: none;
}

.docx-title .pill-good {
  margin-left: 0.5rem;
  font-size: 0.66rem;
}

/* ---------- One-step upload tile (pick = upload) ---------- */

.upload-form {
  display: block;
  min-width: 0;
}

.upload-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 15rem;
  padding: 0.65rem 0.9rem;
  border: 1.5px dashed var(--brass);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 2.5rem),
    var(--panel-warm);
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, transform 180ms var(--ease-spring), box-shadow 200ms ease;
}

.upload-tile:hover {
  border-color: var(--brass-deep);
  background: var(--brass-soft);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -18px rgba(140, 101, 32, 0.8);
}

.upload-tile:focus-within {
  outline: 2px solid var(--brass-deep);
  outline-offset: 3px;
}

.upload-tile.is-pending {
  cursor: progress;
  border-style: solid;
}

.upload-tile-replace {
  border-style: solid;
  border-color: #b9d4c5;
  background: var(--good-bg);
}

.upload-tile-replace:hover {
  border-color: var(--accent);
  background: #d1e6d9;
  box-shadow: 0 10px 22px -18px rgba(13, 82, 64, 0.7);
}

.upload-tile-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  color: var(--brass-deep);
}

.upload-tile-replace .upload-tile-icon {
  color: var(--accent-strong);
}

.upload-tile-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.upload-tile-label {
  font-weight: 650;
  font-size: 0.9rem;
}

.upload-tile-hint {
  font-size: 0.76rem;
  color: var(--ink-soft);
}

.upload-tile-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

/* ---------- Inline validation + pending states ---------- */

.field-error {
  margin: 0.1rem 0 0;
  font-size: 0.8rem;
  font-weight: 550;
  color: var(--no);
  animation: fade 0.25s ease both;
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.money-input:has(input[aria-invalid="true"]) input {
  border-color: #c9857a;
  box-shadow:
    inset 0 1px 2px rgba(27, 40, 35, 0.04),
    0 0 0 3px rgba(140, 74, 59, 0.14);
}

.money-input {
  position: relative;
}

.money-prefix {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono-stack);
  font-size: 0.9375rem;
  color: var(--ink-faint);
  pointer-events: none;
}

/* Also wins inside .field, whose input rule carries two :not() attribute selectors. */
.money-input input,
.field .money-input input:not([type="radio"]):not([type="checkbox"]) {
  padding-left: 1.7rem;
}

/* Same specificity fight: .field input:not(radio):not(checkbox) was covering the house icon. */
.field input.house-input:not([type="radio"]):not([type="checkbox"]) {
  padding-left: 2.6rem;
}

.naics-combo {
  position: relative;
}

.debt-inline-table .money-input {
  width: 100%;
}

.debt-inline-table .money-input input.debt-cell-input {
  width: 100%;
  box-sizing: border-box;
}

.spinner {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
  opacity: 0.85;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

button.is-pending,
a.button.is-pending {
  opacity: 0.85;
  cursor: progress;
}

/* Keyboard focus: one ring, everywhere it can land. */
a:focus-visible,
summary:focus-visible,
.rail-link:focus-visible,
.side-nav a:focus-visible,
.side-signout:focus-visible,
.side-progress:focus-visible,
.text-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.side-nav a:focus-visible,
.side-signout:focus-visible,
.side-progress:focus-visible {
  outline-color: #e8c887;
}

/* ---------- How it works ---------- */

details.disclosure-quiet {
  background: var(--panel-warm);
  box-shadow: none;
}

.how-steps {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-gap: 1rem;
  gap: 1rem;
}

.how-steps li {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.how-steps strong {
  color: var(--ink);
}

.how-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--brass-soft);
  color: var(--brass-deep);
  font-family: var(--font-display-stack);
  font-weight: 700;
  font-size: 0.85rem;
}

/* ---------- Two paths in: add an invoice OR connect QuickBooks ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.paths-head {
  margin-bottom: 1.1rem;
}

.paths-head .lede {
  margin-bottom: 0;
}

.paths-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-gap: 1rem;
  gap: 1rem;
  align-items: stretch;
}

.paths-or {
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel-warm);
  font-family: var(--font-display-stack);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-faint);
  font-variation-settings: "SOFT" 60;
}

.path-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1.25rem 1.3rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 3.5rem),
    var(--panel-warm);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: transform 220ms var(--ease-spring), box-shadow 220ms ease, border-color 160ms ease;
}

.path-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--grain);
  opacity: 0.04;
  mix-blend-mode: multiply;
}

.path-card > * {
  position: relative;
}

.path-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift, var(--shadow-soft));
  border-color: var(--line-strong);
}

.path-card-connected {
  border-color: #c7dccf;
  background:
    radial-gradient(26rem 10rem at 100% 0%, rgba(20, 104, 79, 0.14), transparent 65%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 3.5rem),
    var(--panel-warm);
}

.path-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  background: linear-gradient(150deg, var(--brass-soft), #ead9b5);
  color: var(--brass-deep);
}

.path-icon-books {
  background: linear-gradient(160deg, #1a7b5e, var(--accent-strong));
  color: #f4efe1;
}

.path-text {
  flex: 1 1;
}

.path-text h3 {
  margin: 0 0 0.25rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--font-display-stack);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variation-settings: "SOFT" 30;
}

.path-text p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.path-card a.button,
.path-card button {
  width: 100%;
}

.path-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
}

.path-actions form {
  width: 100%;
}

.path-actions .text-link {
  width: auto;
  min-height: 0;
  padding: 0.15rem 0.3rem;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--ink-faint);
}

.qb-connect {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.qb-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink-faint);
  line-height: 1.45;
}

/* Background-sync progress on the QuickBooks card: the server's real phase, no bar. */
.qb-progress-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  width: 100%;
  min-width: 0;
}

.qb-progress {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.45;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.qb-progress-liabilities,
.qb-progress-liabilities-done {
  font-weight: 550;
  color: var(--ink);
}

.qb-progress .spinner {
  width: 0.85rem;
  height: 0.85rem;
}

.qb-progress-done {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
}

.qb-progress-done .confirm,
.qb-progress-done .alert {
  margin: 0;
  font-size: 0.8rem;
  padding: 0.5rem 0.7rem;
}

.qb-connect button:disabled:not(.is-pending),
.qb-connect a[aria-disabled="true"]:not(.is-pending) {
  opacity: 0.75;
  background: var(--paper-deep);
  border-color: var(--line-strong);
  border-style: dashed;
  color: var(--ink-soft);
  box-shadow: none;
}

.paths-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--ink-faint);
}

.paths-foot-form {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.paths-foot button.text-link {
  width: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  font-size: inherit;
}

/* Compact once the board has invoices: a slim row, same two cards. */
.paths-compact {
  padding: 0.9rem 1.1rem;
}

.paths-compact .paths-grid {
  gap: 0.75rem;
}

.paths-compact .path-card {
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.95rem;
  box-shadow: none;
}

.paths-compact .path-card:hover {
  transform: none;
}

.paths-compact .path-icon {
  width: 2.1rem;
  height: 2.1rem;
}

.paths-compact .path-text h3 {
  font-size: 0.98rem;
  margin-bottom: 0.1rem;
}

.paths-compact .path-text p {
  font-size: 0.78rem;
}

.paths-compact .path-card a.button,
.paths-compact .path-card button,
.paths-compact .qb-connect,
.paths-compact .path-actions {
  width: auto;
  flex: none;
}

.paths-compact .path-card a.button,
.paths-compact .path-card button.primary {
  min-height: 2.4rem;
  padding: 0.45rem 0.95rem;
  font-size: 0.86rem;
}

.paths-compact .paths-or {
  width: 1.9rem;
  height: 1.9rem;
  font-size: 0.85rem;
}

.pill-books {
  margin-left: 0.45rem;
  background: var(--good-bg);
  color: var(--good);
}

@media (max-width: 860px) {
  .paths-grid {
    grid-template-columns: 1fr;
  }

  .paths-or {
    justify-self: center;
  }

  .paths-compact .path-card {
    flex-wrap: wrap;
  }
}

/* ---------- Selection summary (sticky when ready) ---------- */

.inv-foot-ready {
  position: -webkit-sticky;
  position: sticky;
  bottom: 0;
  z-index: 2;
  box-shadow: 0 -12px 28px -22px rgba(27, 40, 35, 0.45);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
}

.sel-summary {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.sel-total {
  font-family: var(--font-display-stack);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent-strong);
  letter-spacing: -0.01em;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.sel-detail {
  font-size: 0.84rem;
  color: var(--ink-soft);
}

.sel-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
}

/* ---------- What's ahead ---------- */

.ahead-title {
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin-bottom: 0.7rem;
}

.ahead-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  grid-gap: 0.8rem;
  gap: 0.8rem;
}

.ahead-card {
  display: flex;
  gap: 0.8rem;
  padding: 0.95rem 1.05rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(253, 251, 245, 0.55);
}

.ahead-n {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  color: var(--ink-faint);
  font-family: var(--font-mono-stack);
  font-size: 0.72rem;
  font-weight: 600;
}

.ahead-step {
  display: block;
  font-weight: 650;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.ahead-items {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ---------- Per-file rows in document steps ---------- */

.docx-files {
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.docx-file {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem;
  border-radius: 9px;
  background: var(--panel-warm);
  font-size: 0.8rem;
  color: var(--ink-soft);
  min-width: 0;
}

.docx-file svg {
  flex: none;
  color: var(--accent-strong);
}

.docx-file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-weight: 550;
}

.docx-file-meta {
  flex: none;
  font-size: 0.72rem;
  color: var(--ink-faint);
}

.docx-file .pill {
  flex: none;
  margin-left: auto;
  font-size: 0.64rem;
}

.docx-title .pill {
  margin-left: 0.5rem;
  font-size: 0.66rem;
}

/* ---------- Empty-state "when" + settings rows ---------- */

.empty-when {
  margin-top: 0.35rem !important;
  font-size: 0.8rem !important;
  color: var(--brass-deep) !important;
  font-weight: 600;
}

.settings-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.95rem 0;
  border-top: 1px solid var(--line);
}

.settings-row:first-child {
  border-top: none;
}

.debt-schedule {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  grid-column: 1 / -1;
}

.debt-hints {
  padding: 0.65rem 0.75rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--wash);
  font-size: 0.85rem;
}

.debt-hints ul {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.debt-hints li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.debt-none {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
}

.debt-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.debt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.debt-table th,
.debt-table td {
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.debt-table input,
.debt-table select {
  width: 100%;
  min-width: 4.5rem;
  font-size: inherit;
}

.debt-payment-warn {
  margin: 0.35rem 0 0;
  color: var(--ink-muted, #5c6b64);
  font-size: 0.8125rem;
  line-height: 1.35;
}

.debt-inline-wrap {
  margin-top: 0.35rem;
}

.debt-inline-table {
  font-size: 0.78rem;
}

.debt-inline-table th {
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}

.debt-col-expand {
  width: 1.75rem;
  padding-left: 0.25rem !important;
  padding-right: 0.15rem !important;
}

.debt-col-remove {
  width: 2rem;
  text-align: center;
  padding-left: 0.15rem !important;
  padding-right: 0.25rem !important;
}

.debt-cell-input {
  width: 100%;
  min-width: 0;
  padding: 0.28rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs, 4px);
  background: var(--paper);
  font-size: inherit;
}

.debt-inline-table th:nth-child(2) {
  min-width: 9.5rem;
  width: 28%;
}

.debt-inline-table .debt-cell-input,
.debt-inline-table .debt-totals-row td {
  font-family: inherit;
}

.debt-sign-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
  max-width: 28rem;
  margin-top: 0.35rem;
}

.debt-sign-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.debt-sign-input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font: inherit;
  font-size: 0.95rem;
}

.debt-lender-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 7rem;
}

.pill-tight {
  font-size: 0.65rem;
  padding: 0.05rem 0.35rem;
}

.debt-expand-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: var(--radius-xs, 4px);
}

.debt-expand-btn:hover {
  background: var(--wash);
  color: var(--ink);
}

.debt-expand-open {
  transform: rotate(90deg);
}

.debt-remove-btn {
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius-xs, 4px);
  background: none;
  color: var(--ink-soft);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.debt-remove-btn:hover {
  background: var(--no-bg);
  color: var(--no);
}

.debt-row-books .debt-cell-input:not(:focus) {
  border-color: color-mix(in srgb, var(--accent-strong) 18%, var(--line));
}

.debt-expand-row td {
  background: var(--wash);
  border-bottom: 1px solid var(--line);
}

.debt-expand-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  padding: 0.35rem 0 0.45rem;
}

.debt-expand-fields label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.72rem;
  color: var(--ink-soft);
  min-width: 7rem;
}

.debt-totals-row td {
  border-top: 2px solid var(--line-strong);
  background: var(--wash);
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.debt-add-row {
  align-self: flex-start;
}

.debt-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.debt-field-with-tag {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.debt-empty {
  color: var(--muted);
  font-style: italic;
}

.debt-confirm {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
}

.debt-affirm {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.88rem;
}

.debt-affirm-warn {
  color: var(--no);
}

.debt-books-notice {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.86rem;
}

.debt-totals-hint {
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.debt-sign-hint {
  margin: 0;
}

.debt-stance {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.92rem;
}

.debt-pledged-question {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.debt-pledged-legend {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  padding: 0;
}

.debt-pledged-hint {
  margin: 0 0 0.45rem;
  max-width: 42rem;
}

.report-view-dialog:modal {
  overflow: hidden;
  overscroll-behavior: contain;
}

.report-view-panel-debt {
  width: min(100%, 52rem);
  max-height: min(92vh, 56rem);
  height: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
}

.report-view-debt-wrap {
  display: block;
  padding: 0;
  background: #f6f1e6;
  overflow: visible;
  flex: 0 1 auto;
}

.debt-schedule-editor {
  display: flex;
  flex-direction: column;
}

.debt-editor-main {
  padding: 0.85rem 1.1rem 0.5rem;
}

.debt-row-cards-scroll {
  max-height: min(46vh, 28rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
  padding-right: 0.15rem;
}

.debt-row-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1.25rem;
  margin-top: 0.15rem;
}

.debt-upload-link {
  margin-left: auto;
}

@media (max-width: 520px) {
  .debt-upload-link {
    margin-left: 0;
    width: 100%;
    text-align: left;
  }
}

.debt-rows-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.debt-row-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

@keyframes debt-row-enter {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.debt-row-card {
  position: relative;
  padding: 0.85rem 0.85rem 0.85rem 1rem;
  border: 1px solid color-mix(in srgb, var(--line) 85%, var(--ink) 5%);
  border-radius: var(--radius-sm);
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(24, 20, 14, 0.04);
}

.debt-row-card-enter {
  animation: debt-row-enter 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.debt-row-remove {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 999px;
  background: var(--wash);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.debt-row-remove:hover {
  background: color-mix(in srgb, var(--accent, #1ec677) 12%, var(--wash));
  color: var(--ink);
  transform: scale(1.04);
}

.debt-origin-tag {
  display: inline-block;
  margin: 0 2.4rem 0.45rem 0;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--pine-mist);
  color: var(--pine);
}

.debt-origin-tag.is-changed {
  background: var(--maybe-bg);
  color: var(--maybe);
}

.debt-origin-tag.is-added {
  background: var(--paper-deep);
  color: var(--ink-soft);
}

.debt-row-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 0.65rem 0.75rem;
  gap: 0.65rem 0.75rem;
  padding-right: 2rem;
}

@media (min-width: 640px) {
  .debt-row-card-grid {
    grid-template-columns: 1.2fr 1fr 1fr 1fr;
  }
}

.debt-field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
}

.debt-field-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.debt-required-star {
  margin-left: 0.12rem;
  color: var(--no, #8c4a3b);
  font-weight: 700;
}

.debt-field-input {
  width: 100%;
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs, 6px);
  background: #fff;
  font-size: 0.875rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.debt-field-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent, #1ec677) 55%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #1ec677) 18%, transparent);
}

.debt-field-input.debt-field-input-required {
  border: 1.5px solid #dc2626;
  background: #fef2f2;
}

.debt-field-input.debt-field-input-required:focus {
  border: 1.5px solid #dc2626;
  background: #fef2f2;
  box-shadow: 0 0 0 3px rgb(220 38 38 / 0.18);
}

.debt-row-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  padding: 0.55rem 0.65rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-soft);
  border-radius: var(--radius-xs, 6px);
  background: color-mix(in srgb, var(--wash) 80%, var(--paper));
}

.debt-add-row-btn {
  align-self: flex-start;
}

.debt-editor-sticky {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  background: var(--panel-warm);
  padding: 1rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.debt-choice-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.debt-choice-label {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}

.debt-choice-helper {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--ink-soft);
  max-width: 36rem;
}

.debt-choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 0.55rem;
  gap: 0.55rem;
}

.debt-choice-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.75rem 0.85rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.12s ease;
}

.debt-choice-card:hover {
  border-color: color-mix(in srgb, var(--accent, #1ec677) 45%, var(--line));
}

.debt-choice-card.is-selected {
  border-color: var(--accent, #1ec677);
  background: color-mix(in srgb, var(--accent, #1ec677) 10%, var(--paper));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent, #1ec677) 35%, transparent);
}

.debt-choice-card-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.debt-choice-card-hint {
  font-size: 0.75rem;
  color: var(--ink-soft);
  line-height: 1.35;
}

.debt-editor-save-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.15rem;
  padding-top: 0.65rem;
  border-top: 1px dashed color-mix(in srgb, var(--line) 70%, transparent);
}

.debt-save-hint {
  margin: 0;
  font-size: 0.8125rem;
  max-width: 18rem;
}

.debt-save-hint-spacer {
  flex: 1 1;
}

.debt-editor-save {
  margin: 0;
  margin-left: auto;
}

.debt-save-btn {
  min-width: 9.5rem;
  padding: 0.55rem 1.25rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 2px rgba(24, 20, 14, 0.08);
}

.debt-save-btn:disabled {
  opacity: 0.55;
  box-shadow: none;
}

.debt-upload-secondary {
  margin-top: 0.35rem;
}

.debt-source-files {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8125rem;
}

.debt-source-files li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs, 4px);
  background: var(--wash);
}

.debt-source-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.debt-undo-import {
  margin-top: 0.25rem;
}

.debt-import-alert {
  margin: 0.35rem 0 0;
}

.debt-import-hint,
.debt-import-onfile,
.debt-import-note {
  margin: 0;
  font-size: 0.8125rem;
}

.debt-editor-footer {
  margin-top: 0.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.debt-pledge-pick-title {
  margin: 0 0 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.debt-pledge-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.debt-pledge-pill {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.debt-pledge-pill:hover {
  border-color: var(--accent, #1ec677);
}

.debt-pledge-pill.is-on {
  background: color-mix(in srgb, var(--accent, #1ec677) 14%, var(--paper));
  border-color: var(--accent, #1ec677);
  color: var(--ink);
  font-weight: 600;
}

.debt-pledged-options {
  margin-top: 0.15rem;
}

.debt-col-pledged-check {
  text-align: center;
  vertical-align: middle;
}

.debt-col-pledged-check input {
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.debt-section-title {
  margin: 0 0 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.debt-card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.debt-card {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--wash);
}

.debt-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.debt-card-lender {
  font-weight: 600;
}

.debt-card-meta {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.debt-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.debt-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.88rem;
}

.debt-editor {
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.debt-editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  grid-gap: 0.5rem;
  gap: 0.5rem;
}

.debt-editor-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8rem;
}

.debt-preview {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.debt-preview-business {
  margin: 0 0 0.25rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.debt-preview-subtitle {
  margin: 0 0 0.5rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.debt-preview-meta {
  margin: 0.15rem 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.debt-preview-table {
  font-size: 0.72rem;
}

.debt-preview-table tr.debt-preview-row-bold td {
  font-weight: 600;
}

.debt-preview-table tr.debt-preview-row-rule td {
  border-top: 1px solid var(--line-strong);
}

.req {
  color: var(--brass-deep);
}

.settings-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 11px;
  background: var(--brass-soft);
  color: var(--brass-deep);
}

.settings-main {
  flex: 1 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.settings-title {
  font-weight: 650;
  font-size: 0.94rem;
}

.settings-sub {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.settings-row .button {
  flex: none;
}

/* ---------- Loading skeleton ---------- */

.sidebar-skeleton {
  min-height: 100dvh;
}

.sk {
  border-radius: 12px;
  background:
    linear-gradient(90deg, var(--paper-deep) 0%, #f3eee2 40%, var(--paper-deep) 80%);
  background-size: 80rem 100%;
  animation: shimmer 1.6s linear infinite;
}

.sk-eyebrow { width: 7rem; height: 0.8rem; }
.sk-title { width: 60%; height: 2.4rem; border-radius: 14px; }
.sk-lede { width: 80%; height: 1rem; }
.sk-row { display: flex; gap: 0.9rem; }
.sk-rail { flex: 1 1; height: 3.6rem; border-radius: 14px; }
.sk-stat { flex: 1 1; height: 6.5rem; border-radius: var(--radius); }
.sk-stat-hero { flex: 1.5 1; }
.sk-panel { height: 22rem; border-radius: var(--radius); }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    padding: 0.8rem 1rem;
  }

  .side-brand {
    padding: 0 0.4rem;
  }

  .side-groups {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.3rem;
  }

  .side-group-label {
    display: none;
  }

  .side-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.15rem;
  }

  .side-nav a {
    padding: 0.4rem 0.6rem;
  }

  .side-progress {
    display: none;
  }

  .side-foot {
    margin-top: 0;
    margin-left: auto;
    padding-top: 0;
    border-top: none;
    flex-direction: row;
    align-items: center;
  }

  .side-user-text {
    display: none;
  }

  .main {
    padding: 1.6rem 1.25rem 3rem;
  }

  .flow-head h1 {
    font-size: 1.9rem;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-hero {
    grid-column: 1 / -1;
  }

  .how-steps {
    grid-template-columns: 1fr;
  }

  .inv-foot-ready {
    position: static;
  }

  .inv-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .inv-standing {
    grid-column: 1 / -1;
  }

  .inv-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
  }

  .rail {
    flex-wrap: wrap;
    gap: 0.5rem 0;
  }

  .rail-step {
    flex: 1 1 33%;
  }

  .rail-track {
    display: none;
  }
}

/* ---------- Finish line: term sheet → accept → sign → factor ---------- */

.panel-title-sm {
  margin: 0 0 0.8rem;
  font-family: var(--font-display-stack);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variation-settings: "SOFT" 30;
}

.sample-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.65rem 0.95rem;
  border: 1px dashed var(--brass);
  border-radius: var(--radius-sm);
  background: var(--brass-soft);
  color: var(--brass-deep);
  font-size: 0.83rem;
  line-height: 1.45;
}

.sample-strip svg {
  flex: none;
}

.sample-strip > span {
  flex: 1 1 18rem;
}

.sample-strip-action {
  margin-left: auto;
  width: auto;
}

.sample-strip .text-link {
  width: auto;
  min-height: 0;
  padding: 0.1rem 0.2rem;
  font-size: 0.8rem;
}

.offer-wait .offer-glyph {
  color: var(--brass-deep);
  background: var(--brass-soft);
  animation: pulse-ring 2.6s ease-out infinite 0.6s;
}

.offer-wait .eyebrow {
  margin-bottom: 0.3rem;
}

.how-steps-tight li {
  padding: 0.85rem 0.95rem;
  background: var(--panel-warm);
}

.offer-wait-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.offer-wait-cta button {
  width: auto;
  min-height: 3rem;
  padding: 0.75rem 1.4rem;
  font-size: 0.98rem;
}

.offer-wait-note {
  max-width: 30rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--ink-faint);
}

.offer-wait-check {
  margin-top: 0.9rem;
}

.offer-wait-check button.text-link {
  width: auto;
  min-height: 0;
  padding: 0.15rem 0.3rem;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--ink-faint);
}

.offer-wait-check button.text-link:hover {
  color: var(--ink);
}

/* The term sheet card */

.terms {
  position: relative;
  margin-top: 0.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(30rem 12rem at 100% 0%, rgba(167, 123, 43, 0.12), transparent 65%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), transparent 4rem),
    var(--panel-warm);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.terms::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--grain);
  opacity: 0.05;
  mix-blend-mode: multiply;
}

.terms > * {
  position: relative;
}

.terms-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.1rem 1.3rem 1rem;
  border-bottom: 1px solid var(--line);
}

.terms-mark {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 12px;
  background: linear-gradient(160deg, #1a7b5e, var(--accent-strong));
  color: #f4efe1;
  font-family: var(--font-display-stack);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 16px -8px rgba(20, 104, 79, 0.7);
}

.terms-who {
  min-width: 0;
  flex: 1 1;
}

.terms-who .eyebrow {
  margin-bottom: 0.05rem;
}

.terms-who h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-family: var(--font-display-stack);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variation-settings: "SOFT" 40;
}

.terms-expires {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  font-size: 0.85rem;
  color: var(--ink);
}

.terms-expires-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.terms-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-gap: 0;
  gap: 0;
  margin: 0;
}

.term {
  padding: 1.05rem 1.3rem 1rem;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.term:nth-child(3),
.term-wide {
  border-right: 0;
}

.term-wide {
  grid-column: 1 / -1;
}

.term:last-child {
  border-bottom: 0;
}

.term dt {
  margin: 0 0 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.term dd {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.term-value {
  font-family: var(--font-display-stack);
  font-size: 1.9rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-variation-settings: "opsz" 48, "SOFT" 20;
  color: var(--ink);
}

.term-hero .term-value {
  font-size: 2.5rem;
  color: var(--accent-strong);
}

.term-foot {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.term-text {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink);
}

.terms-notes {
  list-style: none;
  margin: 0;
  padding: 0.9rem 1.3rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
}

.terms-notes li {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.terms-notes svg {
  flex: none;
  margin-top: 0.2rem;
  color: var(--accent-strong);
}

.terms-compact .terms-head {
  padding: 0.85rem 1.05rem;
}

.terms-compact .term {
  padding: 0.75rem 1.05rem;
}

.terms-compact .term-value,
.terms-compact .term-hero .term-value {
  font-size: 1.4rem;
}

.offer-cta {
  margin-top: 1.2rem;
  align-items: center;
}

.offer-cta-note {
  flex: 1 1;
  font-size: 0.83rem;
  color: var(--ink-soft);
}

.offer-compare-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.offer-compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  grid-gap: 1rem;
  gap: 1rem;
  align-items: stretch;
}

.offer-compare-card {
  position: relative;
  display: block;
  cursor: pointer;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  padding: 0.35rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.offer-compare-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.offer-compare-card.is-selected,
.offer-compare-card:focus-within {
  border-color: #7ab893;
  box-shadow: 0 0 0 1px #7ab89333;
}

.offer-compare-card .terms {
  border: none;
  box-shadow: none;
}

.offer-status-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.offer-status-step {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-gap: 0.75rem;
  gap: 0.75rem;
  align-items: start;
  color: var(--ink-soft);
}

.offer-status-step.is-done {
  color: var(--ink);
}

.offer-status-step.is-active strong {
  color: var(--ink);
}

.offer-status-mark {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  margin-top: 0.1rem;
}

.offer-status-step.is-done .offer-status-mark {
  background: #e8f5ec;
  border-color: #9fd0b0;
  color: #2f6b45;
}

.offer-status-step.is-active .offer-status-mark {
  border-color: #7ab893;
}

.offer-status-pulse {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #7ab893;
  animation: offer-pulse 1.2s ease-in-out infinite;
}

@keyframes offer-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.offer-status-step strong {
  display: block;
  font-size: 0.92rem;
}

.offer-status-step span {
  display: block;
  font-size: 0.82rem;
  margin-top: 0.15rem;
}

/* Signature */

.sign-panel {
  border-color: #c7dccf;
}

.sign-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.field input.sign-input {
  font-family: var(--font-display-stack);
  font-size: 1.35rem;
  font-style: italic;
  font-variation-settings: "SOFT" 60;
  letter-spacing: 0.01em;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  background:
    linear-gradient(transparent calc(100% - 2px), var(--brass) calc(100% - 2px)) no-repeat
      1rem calc(100% - 0.6rem) / calc(100% - 2rem) 1px,
    var(--panel);
}

.check-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-warm);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ink-soft);
  cursor: pointer;
}

.check-row input {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0.15rem 0 0;
  accent-color: var(--accent-strong);
}

.check-row strong {
  color: var(--ink);
}

.check-row.is-invalid {
  border-color: var(--no);
}

@media (max-width: 760px) {
  .terms-grid {
    grid-template-columns: 1fr 1fr;
  }

  .term:nth-child(3) {
    border-right: 1px solid var(--line);
  }

  .term:nth-child(2n) {
    border-right: 0;
  }
}

@media (max-width: 560px) {
  .doc-row,
  .owner-row,
  .person-row,
  .docx-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .doc-upload {
    width: 100%;
    justify-content: space-between;
  }

  .field-row {
    flex-direction: column;
  }

  .field-row .field-narrow,
  .field.field-narrow,
  .field-row .field-state {
    width: 100%;
  }

  .panel-head {
    flex-direction: column;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .board-head {
    flex-direction: column;
  }

  .board-head-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .card,
  .panel {
    padding: 1.5rem 1.25rem;
  }

  .shell {
    padding: 2rem 1rem;
  }
}

/* ---------- Invoices step: books picker + report cards (2026-10) ---------- */

.books-step-panel {
  padding: 1rem 1.15rem;
}

.books-step-panel:has(.books-picker-row.is-compact) {
  padding: 0.7rem 1rem;
}

.books-connected-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1.25rem;
  font-size: 0.92rem;
}

.books-connected-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--accent-strong);
  min-width: 0;
}

.books-connected-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  margin-left: auto;
}

.books-connected-actions form {
  display: inline-flex;
  margin: 0;
  width: auto;
}

.books-connected-actions button {
  width: auto;
}

.books-connected-note {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0.4rem 0 0;
}

.books-connected-note-line {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--ink);
}

.books-connected-note-line .spinner {
  flex: 0 0 auto;
  margin-top: 0.2rem;
}

.books-connected-note-line.is-updated {
  font-weight: 550;
}

.books-connected-note-line.is-error,
.books-connected-note-help.is-error {
  color: var(--no);
}

.books-connected-note-help {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--ink-faint);
}

.books-connected-meta {
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.books-picker-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.books-picker-row.is-compact {
  gap: 0.5rem;
}

.books-picker-primary .books-picker-qbo {
  width: 100%;
  justify-content: center;
  gap: 0.55rem;
  padding: 1rem 1.25rem;
  font-size: 1.05rem;
}

.books-picker-row.is-compact .books-picker-qbo {
  padding: 0.55rem 1rem;
  font-size: 0.95rem;
}

.books-picker-qbo-lead {
  margin: 0.65rem 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink-soft);
  text-align: center;
}

.books-picker-row.is-compact .books-picker-qbo-lead {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  line-height: 1.3;
}

.books-picker-manual-hint {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-faint);
  text-align: center;
}

.qb-logo {
  flex-shrink: 0;
}

.books-picker-others {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  grid-gap: 0.65rem;
  gap: 0.65rem;
}

.books-picker-row.is-compact .books-picker-others {
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.4rem;
}

.books-picker-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 0.85rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-warm);
  cursor: not-allowed;
  opacity: 0.75;
}

.books-picker-row.is-compact .books-picker-btn {
  padding: 0.45rem 0.4rem;
  gap: 0.25rem;
}

.books-picker-btn-live {
  cursor: pointer;
  opacity: 1;
}

.books-picker-btn-live.is-open {
  border-color: var(--ink-soft);
}

.qb-desktop-setup {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.qb-desktop-setup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.qb-desktop-setup-lead,
.qb-desktop-password,
.qb-desktop-password-muted {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.qb-desktop-steps {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ink);
}

.qb-desktop-password code {
  font-size: 0.86rem;
}

.qb-desktop-password .text-link {
  margin-left: 0.35rem;
}

.qb-desktop-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.qb-desktop-download {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.books-picker-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: var(--panel-muted, #ebe4d6);
  color: var(--ink-soft);
}

.books-picker-row.is-compact .books-picker-logo {
  width: 1.6rem;
  height: 1.6rem;
}

.books-picker-row.is-compact .books-picker-name {
  font-size: 0.75rem;
}

.books-picker-row.is-compact .books-picker-manual-hint {
  font-size: 0.76rem;
}

.books-picker-name {
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

.books-picker-soon {
  font-size: 0.68rem;
}

.report-cards-section {
  margin-top: 1.25rem;
}

.report-cards-leftover {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0 0 0.65rem;
}

.report-cards-leftover .hint {
  margin: 0;
}

.report-cards-last-sync {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ink-faint);
}

.report-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  grid-gap: 0.85rem;
  gap: 0.85rem;
  align-items: start;
}

.invoices-monthly-row {
  margin-top: 0.85rem;
  min-height: 0;
  max-width: 22rem;
}

.invoices-monthly-row .field {
  margin: 0;
}

.invoices-monthly-row .pill-books {
  margin-left: 0;
}

.report-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-warm);
  box-shadow: var(--shadow-soft);
  min-height: 9.5rem;
  overflow: hidden;
  transition: border-color 300ms ease;
}

.report-card::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

.report-card-done::before {
  opacity: 1;
}

.report-card-syncing {
  border-color: #c5d4e8;
}

.report-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.report-card-head h3 {
  margin: 0;
  font-family: var(--font-display-stack);
  font-size: 0.98rem;
}

.report-card-recommended {
  display: inline-block;
  margin-left: 0.4rem;
  font-family: var(--font-body-stack);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: var(--brass-soft);
  color: var(--brass-deep);
  vertical-align: middle;
}

.report-card-badge-answers {
  background: #fce8d8;
  color: #8c4a12;
}

.invoices-factoring-type {
  border: 0;
  padding: 0;
  margin: 0 0 0.85rem;
  min-width: 0;
}

.invoices-factoring-type legend {
  padding: 0;
  font-weight: 600;
}

.invoices-factoring-type-options {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-top: 0.35rem;
}

.invoices-factoring-type-options label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}

.invoices-funding-from-books {
  margin-top: 0.35rem;
}

.invoices-funding-from-books .pill-books {
  margin-left: 0;
}

.report-card-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.report-card-status-done {
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent-strong);
  font-weight: 600;
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
}

.report-card-status-done svg {
  color: var(--accent-strong);
}

.report-card-status-failed {
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--danger, #b42318) 12%, transparent);
  color: var(--danger, #b42318);
  font-weight: 600;
  font-size: 0.72rem;
  line-height: 1.2;
  max-width: 11rem;
  white-space: normal;
  text-align: right;
}

.report-card-metric {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
  line-height: 1.35;
  flex: 1 1;
}

.report-card-badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: #fce8d8;
  color: #8c4a12;
}

.report-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin-top: auto;
  min-height: 2.35rem;
}

.report-card-actions-spacer {
  display: block;
  min-height: 2.35rem;
  flex: 1 1;
}

.report-card-replace,
.report-card-remove {
  align-self: center;
  min-height: 2.35rem;
  display: inline-flex;
  align-items: center;
}

.needed-star {
  margin-left: 0.2rem;
  color: var(--accent);
  font-weight: 700;
  font-size: 1.15em;
  line-height: 1;
}

.report-card.is-needed {
  border-color: color-mix(in srgb, var(--brass-deep) 42%, var(--line));
}

.report-card.is-needed .needed-star,
.field.is-needed .needed-star,
.debt-sign-field.is-needed .needed-star {
  color: var(--accent);
}

.field.is-needed input:not([type="radio"]):not([type="checkbox"]),
.field.is-needed select,
.debt-sign-field.is-needed .debt-sign-input {
  border-color: color-mix(in srgb, var(--brass-deep) 40%, var(--line));
}

.invoices-factoring-type-options input[type="radio"] {
  -moz-appearance: auto;
       appearance: auto;
  -webkit-appearance: radio;
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  min-height: 1rem;
  max-width: 1rem;
  max-height: 1rem;
  padding: 0;
  margin: 0;
  flex: none;
  border: none;
  border-radius: 50%;
  background: none;
  box-shadow: none;
  accent-color: var(--accent-strong);
}

.invoices-factoring-type-options input[type="radio"]:hover,
.invoices-factoring-type-options input[type="radio"]:focus-visible {
  border: none;
  background: none;
  box-shadow: none;
}

.invoices-factoring-type-options input[type="radio"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.invoices-needed-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.debt-pledged-lender-reveal {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 220ms ease;
}

.debt-pledged-lender-reveal.is-open {
  grid-template-rows: 1fr;
  margin-top: 0.55rem;
}

.debt-pledged-lender-inner {
  overflow: hidden;
  min-height: 0;
}

.debt-pledged-lender-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-width: 22rem;
}

.debt-pledged-below {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.debt-pledged-picks {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.debt-pledged-picks-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
}

.debt-pledged-pick {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
}

.debt-pledged-picks.is-needed,
.debt-pledged-question.is-needed {
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brass-deep) 28%, var(--line));
  padding: 0.25rem 0.4rem;
}

.report-card-pledged {
  margin: 0.45rem 0 0;
}

.report-card-pledged .debt-pledged-legend {
  font-size: 0.82rem;
  line-height: 1.35;
}

.report-card-pledged.is-needed,
.debt-field.is-needed {
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brass-deep) 28%, var(--line));
  padding: 0.25rem 0.4rem;
}

.debt-field.is-needed .debt-field-input {
  border-color: color-mix(in srgb, var(--brass-deep) 40%, var(--line));
}

@media (prefers-reduced-motion: reduce) {
  .debt-pledged-lender-reveal {
    transition: none;
  }
}

.report-card-upload-form {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.report-card-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.sample-invoice-dialog .report-view-panel {
  display: flex;
  flex-direction: column;
  min-height: min(90vh, 40rem);
}

.sample-invoice-details {
  margin: 0;
  padding: 1rem 1.15rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 0.85rem 1.25rem;
  gap: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.sample-invoice-detail {
  min-width: 0;
}

.sample-invoice-details dt {
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-bottom: 0.15rem;
}

.sample-invoice-details dd {
  margin: 0;
  font-weight: 600;
  font-size: 0.92rem;
}

.sample-invoice-preview-unavailable {
  margin: 1rem 1.15rem 1.15rem;
  padding: 2rem 1.25rem;
  text-align: center;
  background: var(--panel-muted, #ebe4d6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.sample-invoice-preview-unavailable-title {
  margin: 0 0 0.35rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.sample-invoice-preview-unavailable-copy {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink-faint);
  line-height: 1.45;
}

.sample-invoice-copy-note {
  margin: 0.5rem 0 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

/* ---------- Invoices step: books tiles + reports checklist (legacy) ---------- */

.books-connect-head {
  margin-bottom: 1.25rem;
}

.books-connect-lede {
  margin-bottom: 0;
}

.books-manual-link {
  margin: 1.1rem 0 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.book-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  grid-gap: 0.85rem;
  gap: 0.85rem;
}

.book-tile {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem 1.05rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent 2.5rem),
    var(--panel-warm);
  box-shadow: var(--shadow-soft);
  min-height: 8.5rem;
  transition: transform 220ms var(--ease-spring), border-color 160ms ease, box-shadow 220ms ease;
}

.book-tile-qbo {
  grid-column: 1 / -1;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem 1.25rem;
  padding: 1.25rem 1.35rem;
}

.book-tile-connected {
  border-color: #c7dccf;
  background:
    radial-gradient(28rem 12rem at 100% 0%, rgba(20, 104, 79, 0.12), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 3rem),
    var(--panel-warm);
}

.book-tile-soon {
  opacity: 0.72;
  cursor: not-allowed;
  min-height: 7.5rem;
}

.book-tile-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 12px;
  flex-shrink: 0;
}

.book-tile-logo-qbo {
  background: linear-gradient(160deg, #1a7b5e, var(--accent-strong));
  color: #f4efe1;
}

.book-tile-logo-muted {
  background: var(--panel-muted, #ebe4d6);
  color: var(--ink-faint);
}

.book-tile-text {
  flex: 1 1;
  min-width: 12rem;
}

.book-tile-text h3 {
  margin: 0 0 0.35rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-family: var(--font-display-stack);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.book-tile-text p,
.book-tile-meta {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.book-tile-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  width: 100%;
}

.book-tile-qbo .book-tile-actions {
  width: auto;
  min-width: 10rem;
  margin-left: auto;
}

.reports-panel {
  margin-top: 1.25rem;
}

.reports-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.1rem;
}

.reports-head h2 {
  margin: 0 0 0.35rem;
}

.reports-sub {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
  max-width: 36rem;
  line-height: 1.5;
}

.reports-progress-line {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
  margin: 0;
  min-width: 12rem;
}

.reports-progress-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-strong);
  letter-spacing: 0.01em;
}

.reports-progress-track {
  display: block;
  width: 14rem;
  max-width: 100%;
  height: 0.35rem;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.reports-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-strong), #2d9b74);
  transition: width 480ms var(--ease-spring);
}

.reports-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.reports-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 11rem);
  align-items: center;
  grid-gap: 0.75rem 1rem;
  gap: 0.75rem 1rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  background: rgba(255, 255, 255, 0.35);
  animation: rise 520ms var(--ease-spring) both;
  transition: border-color 280ms ease, background 280ms ease, transform 280ms var(--ease-spring);
}

.reports-row.is-received {
  border-color: #c7dccf;
  background: linear-gradient(90deg, rgba(20, 104, 79, 0.06), transparent 70%);
}

.reports-row-syncing {
  border-color: #d4c4a0;
}

.reports-label {
  font-weight: 600;
  font-size: 0.92rem;
}

.reports-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  white-space: nowrap;
}

.reports-status-waiting {
  color: var(--ink-faint);
}

.reports-status-syncing {
  color: var(--brass-deep);
}

.reports-status-received {
  color: var(--accent-strong);
  font-weight: 600;
}

.reports-status-muted {
  color: var(--ink-soft);
  font-style: italic;
  font-size: 0.8rem;
  max-width: 11rem;
  white-space: normal;
  text-align: right;
}

.reports-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: rgba(20, 104, 79, 0.14);
  color: var(--accent-strong);
  animation: reports-pop 380ms var(--ease-spring);
}

@keyframes reports-pop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.reports-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

.reports-upload-form {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.reports-view {
  justify-self: end;
}

.report-view-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
}

.report-view-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.report-view-upload-error {
  margin: 0;
  font-size: 0.82rem;
  color: var(--danger);
  flex: 1 1 100%;
}

.report-view-close {
  margin-left: auto;
}

.sample-invoice {
  margin-top: 1.25rem;
}

.sample-invoice h2 {
  margin: 0 0 0.4rem;
}

.sample-invoice-sub {
  margin: 0 0 1rem;
  font-size: 0.86rem;
  color: var(--ink-soft);
  line-height: 1.5;
  max-width: 36rem;
}

.sample-invoice-upload {
  margin: 0;
}

.sample-invoice-drop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
  padding: 1.25rem 1.35rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel-warm);
  cursor: pointer;
}

.sample-invoice-drop-icon {
  display: inline-flex;
  color: var(--brass-deep);
  opacity: 0.85;
}

.sample-invoice-drop-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1 1;
  min-width: 12rem;
}

.sample-invoice-drop-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.sample-invoice-drop-hint {
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.sample-invoice-empty {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.invoices-continue {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-start;
}

.invoices-continue .button.primary {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
}

.books-sync-visual {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr) minmax(0, 1fr);
  grid-gap: 0.75rem 1rem;
  gap: 0.75rem 1rem;
  align-items: center;
  margin-bottom: 1.15rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(26, 123, 94, 0.06), transparent 40%, rgba(140, 101, 32, 0.08));
}

.books-sync-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  text-align: center;
}

.books-sync-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 14px;
}

.books-sync-icon-qbo {
  background: linear-gradient(160deg, #1a7b5e, var(--accent-strong));
  color: #f4efe1;
}

.books-sync-icon-file {
  background: linear-gradient(150deg, var(--brass-soft), #ead9b5);
  color: var(--brass-deep);
}

.books-sync-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.books-sync-lane {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  min-height: 3.2rem;
  position: relative;
}

.books-sync-card {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.65);
  font-size: 0.72rem;
  opacity: 0.35;
  transform: translateX(0);
  transition: opacity 200ms ease, transform 200ms ease, border-color 200ms ease;
}

.books-sync-card.is-flying {
  opacity: 1;
  border-color: var(--brass-deep);
  animation: books-card-fly 480ms var(--ease-spring) forwards;
}

.books-sync-card.is-landed {
  opacity: 1;
  border-color: #c7dccf;
  transform: translateX(0);
}

.books-sync-card-check {
  display: inline-flex;
  color: var(--accent-strong);
}

@keyframes books-card-fly {
  0% {
    transform: translateX(-28%) scale(0.92);
    opacity: 0.4;
  }
  55% {
    transform: translateX(12%) scale(1.02);
    opacity: 1;
  }
  100% {
    transform: translateX(22%) scale(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .books-sync-card.is-flying {
    animation: none;
    transform: none;
  }
}

.invoices-debt-panel {
  margin-top: 1.25rem;
  padding-top: 0.25rem;
}

.invoices-debt-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display-stack);
  font-size: 1.1rem;
}

.invoices-debt-sub {
  margin: 0 0 1rem;
  font-size: 0.86rem;
  color: var(--ink-soft);
  line-height: 1.5;
  max-width: 40rem;
}

.invoices-continue-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
}

.invoices-resign-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  max-width: 36rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-raised, var(--paper));
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.invoices-resign-notice-copy {
  margin: 0;
  flex: 1 1;
}

.invoices-resign-notice-dismiss {
  flex-shrink: 0;
  margin: -0.15rem -0.25rem 0 0;
  padding: 0.15rem 0.35rem;
  border: none;
  background: transparent;
  color: var(--ink-faint);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.invoices-resign-notice-dismiss:hover {
  color: var(--ink);
}

.invoices-debt-sign-blocker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--maybe-bg);
  border: 1px solid #e8d4a8;
  max-width: 36rem;
}

.invoices-debt-sign-blocker-copy {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--maybe);
}

.invoices-attention-blocker-list {
  margin: 0;
  padding-left: 1.1rem;
  flex: 1 1 12rem;
  font-size: 0.84rem;
  color: var(--ink-soft);
}

.invoices-attention-blocker-list li {
  margin: 0.15rem 0;
}

.report-view-dialog {
  border: none;
  padding: 0;
  max-width: min(60rem, 96vw);
  width: 100%;
  background: transparent;
}

.report-view-dialog::-webkit-backdrop {
  background: rgba(24, 20, 14, 0.55);
  -webkit-backdrop-filter: blur(3px);
          backdrop-filter: blur(3px);
}

.report-view-dialog::backdrop {
  background: rgba(24, 20, 14, 0.55);
  -webkit-backdrop-filter: blur(3px);
          backdrop-filter: blur(3px);
}

.report-view-panel {
  background: var(--panel-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift, var(--shadow-soft));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(90vh, 52rem);
}

.report-view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel-warm);
}

.report-view-head-text {
  min-width: 0;
}

.report-view-title {
  margin: 0;
  font-family: var(--font-display-stack);
  font-size: 1.35rem;
  font-weight: 600;
}

.report-view-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.report-view-grid-wrap {
  flex: 1 1;
  overflow: auto;
  background: #f6f1e6;
  padding: 0.75rem 1rem 1rem;
}

.report-view-grid-meta {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.report-view-reset.linkish {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82rem;
  color: var(--accent-strong);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.report-view-grid {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.88rem;
  table-layout: fixed;
}

.report-view-grid.layout-aging,
.report-view-grid.layout-open_invoices {
  font-size: 0.78rem;
}

.report-view-grid.layout-aging td,
.report-view-grid.layout-aging th {
  padding: 0.3rem 0.35rem;
}

.report-col-name {
  text-align: left !important;
  white-space: nowrap;
  max-width: 0;
  width: 28%;
}

.report-view-grid.layout-aging .report-col-name {
  width: 32%;
}

.report-view-grid.layout-open_invoices .report-col-name {
  width: 30%;
}

.report-cell-truncate {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-view-grid.layout-aging .report-amount-input {
  width: 100%;
  max-width: 4.25rem;
  padding: 0.2rem 0.25rem;
  font-size: 0.78rem;
}

.report-view-grid.layout-aging .report-amount-field {
  max-width: 5rem;
}

.report-view-grid.layout-open_invoices .report-col-label:not(.report-col-name) {
  text-align: left;
}

.report-view-grid th {
  text-align: left;
  font-weight: 600;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--line);
  background: rgba(26, 123, 94, 0.06);
  color: var(--ink);
}

.report-view-grid th.report-col-amount,
.report-view-grid td.report-col-amount {
  text-align: right;
  white-space: nowrap;
}

.report-view-grid td {
  padding: 0.4rem 0.65rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  vertical-align: middle;
}

.report-row-section td {
  font-weight: 600;
  background: rgba(26, 123, 94, 0.1);
  border-bottom-color: rgba(26, 123, 94, 0.15);
}

.report-row-total td {
  font-weight: 600;
}

.report-row-grand td {
  font-weight: 700;
  border-top: 2px solid rgba(26, 123, 94, 0.35);
}

.report-amount-field {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  width: 100%;
  max-width: 11rem;
  margin-left: auto;
}

.report-amount-prefix {
  color: var(--ink-faint);
  font-size: 0.82rem;
}

.report-amount-input {
  width: 6.5rem;
  text-align: right;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.25rem 0.4rem;
  font: inherit;
  background: #fff;
}

.report-amount-input:focus {
  outline: 2px solid rgba(26, 123, 94, 0.35);
  border-color: var(--accent-strong);
}

.report-edited-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.68rem;
  color: var(--accent-strong);
  font-weight: 600;
  margin-left: 0.15rem;
}

.report-edited-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-strong);
}

.report-view-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
}

.report-view-footer-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
}

.report-upload-preview-wrap,
.sample-invoice-preview-wrap {
  flex: 1 1;
  min-height: 16rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f6f1e6;
}

.report-upload-preview-frame {
  flex: 1 1;
  width: 100%;
  min-height: 18rem;
  border: none;
  background: #fff;
}

.report-upload-media-wrap {
  flex: 1 1;
  overflow: auto;
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.report-upload-preview-img {
  max-width: 100%;
  max-height: min(70vh, 36rem);
  border-radius: 6px;
  box-shadow: var(--shadow-soft);
}

.report-upload-table-wrap {
  flex: 1 1;
  overflow: auto;
  padding: 0.75rem 1rem 1rem;
}

.report-upload-table-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-family: var(--font-display-stack);
}

.report-upload-table-meta {
  margin: 0 0 0.25rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.report-upload-table {
  width: 100%;
  font-size: 0.82rem;
}

.report-view-upload-only {
  padding: 2rem 1.25rem;
  text-align: center;
  background: #f6f1e6;
}

.report-view-file-name {
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.report-view-download {
  color: var(--accent-strong);
  font-weight: 600;
}

.report-view-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem 1rem;
  margin: 0;
  color: var(--ink-soft);
}

.phone-license-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--paper);
}

.phone-license-panel {
  width: min(100%, 24rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.phone-license-title {
  margin: 0;
  font-family: var(--font-display-stack);
  font-size: 1.6rem;
}

.phone-license-lede {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.45;
}

.phone-license-button {
  width: 100%;
  justify-content: center;
}

.phone-license-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.phone-license-preview {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.phone-license-video {
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--ink-faint);
}

.phone-license-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.phone-license-alert {
  margin: 0;
  color: var(--danger);
}

.phone-license-note {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.license-phone-panel {
  max-width: min(24rem, 96vw);
}

.license-phone-panel-body {
  padding: 1rem 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.license-phone-qr-wrap {
  display: flex;
  justify-content: center;
  margin: 0.75rem 0;
}

.license-phone-status {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.license-phone-status li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.license-phone-status li.is-done {
  color: var(--good);
}

.license-phone-dialog-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.session-idle-panel {
  max-width: 28rem;
}

.session-idle-body {
  padding: 0 1.25rem 1.25rem;
}

.session-idle-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

@media (max-width: 720px) {
  .book-tile-qbo {
    flex-direction: column;
  }

  .book-tile-qbo .book-tile-actions {
    margin-left: 0;
    width: 100%;
  }

  .reports-row {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .reports-status {
    justify-self: start;
  }

  .reports-row-actions {
    justify-content: flex-start;
  }

  .reports-progress-line {
    align-items: flex-start;
    width: 100%;
  }
}

/* ---------- Intake (card over the locked QuickBooks step) ---------- */

.invoices-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  min-height: 0;
}

.invoices-stage-surface {
  grid-area: 1 / 1;
  min-width: 0;
}

.invoices-stage.is-locked .invoices-stage-surface,
.invoices-stage.is-unlocking .invoices-stage-surface {
  filter: blur(6px) saturate(0.88);
  opacity: 0.4;
  pointer-events: none;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  transition:
    filter 240ms var(--ease-out),
    opacity 240ms var(--ease-out);
}

.invoices-stage.is-unlocking .invoices-stage-surface {
  filter: blur(0);
  opacity: 1;
}

/*
 * Pin the card to the visible viewport (not the tall invoices column).
 * The empty layer ignores pointer events so the page wheel still works.
 * The card itself has no overflow-y — compactness keeps Q4 on screen.
 */
.intake-layer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 17rem;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(0.65rem, env(safe-area-inset-top)) 1.1rem max(0.65rem, env(safe-area-inset-bottom));
  pointer-events: none;
}

.intake-layer.is-leaving {
  animation: intake-leave 240ms var(--ease-out) forwards;
}

@keyframes intake-leave {
  to {
    opacity: 0;
    transform: translateY(-12px) scale(0.985);
  }
}

.intake-unlock-hint {
  flex: 0 0 auto;
  margin: 0 0 0.4rem;
  color: var(--ink-soft);
  font-family: var(--font-body-stack);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  pointer-events: auto;
}

.intake-shell.panel {
  width: min(36rem, 100%);
  max-width: 100%;
  max-height: calc(100dvh - 1.6rem);
  height: auto;
  margin: 0 auto;
  padding: 0.85rem 1.05rem 0.9rem;
  display: flex;
  flex-direction: column;
  overflow: visible;
  pointer-events: auto;
  box-shadow: var(--shadow-lift);
}

.intake-toolbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 3.6rem 1fr 3.2rem;
  align-items: center;
  grid-gap: 0.65rem;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.intake-back,
.intake-back-spacer {
  justify-self: start;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 600;
  padding: 0.35rem 0.1rem;
  cursor: pointer;
}

.intake-back:hover {
  color: var(--accent-strong);
}

.intake-back:active {
  transform: none;
}

.intake-back-spacer {
  visibility: hidden;
  pointer-events: none;
}

.intake-progress {
  height: 0.42rem;
  border-radius: 999px;
  background: var(--paper-deep);
  box-shadow: inset 0 1px 2px rgba(27, 40, 35, 0.06);
  overflow: hidden;
}

.intake-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width 160ms var(--ease-out);
}

.intake-count {
  justify-self: end;
  color: var(--ink-faint);
  font-family: var(--font-mono-stack);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.intake-page {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  overflow: visible;
}

.intake-page-forward {
  animation: intake-in 160ms var(--ease-out);
}

.intake-page-back {
  animation: intake-in-back 160ms var(--ease-out);
}

@keyframes intake-in {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes intake-in-back {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.intake-head {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0 0.05rem;
}

.intake-head h2 {
  margin: 0;
  font-family: var(--font-display-stack);
  font-size: clamp(1.12rem, 2.2vw, 1.35rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-variation-settings: "SOFT" 30;
}

.intake-sub {
  margin: 0.05rem 0 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.35;
}

.intake-grid,
.intake-stack {
  display: grid;
  grid-gap: 0.35rem;
  gap: 0.35rem;
}

.intake-grid-industry {
  grid-template-columns: 1fr 1fr;
}

.intake-grid-industry .intake-card:last-child {
  grid-column: 1 / -1;
}

.intake-grid-amount {
  grid-template-columns: 1fr 1fr 1fr;
}

.intake-card {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  width: 100%;
  min-height: 2.7rem;
  padding: 0.5rem 0.75rem 0.48rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-warm);
  text-align: left;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  box-shadow: none;
  overflow: visible;
  transition:
    transform 120ms var(--ease-out),
    box-shadow 120ms var(--ease-out),
    border-color 120ms var(--ease-out),
    background 120ms var(--ease-out);
}

.intake-card:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.intake-card:active:not(:disabled) {
  transform: scale(0.985);
  box-shadow: none;
}

.intake-card:focus-visible {
  outline: 3px solid rgba(20, 104, 79, 0.32);
  outline-offset: 2px;
}

.intake-card.is-selected {
  border-color: var(--accent);
  border-style: solid;
  background: var(--pine-mist);
  box-shadow: 0 0 0 3px rgba(20, 104, 79, 0.14);
}

.intake-card.is-selected::after {
  content: "";
  position: absolute;
  top: 0.48rem;
  right: 0.5rem;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m2.5 6.2 2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
      center / 0.68rem no-repeat,
    var(--accent);
}

.intake-card-wide {
  min-height: 0;
  padding: 0.48rem 0.75rem 0.46rem;
}

.intake-card-amount {
  min-height: 2.55rem;
  justify-content: center;
  align-items: center;
}

.intake-card-title {
  font-family: var(--font-display-stack);
  font-size: 0.95rem;
  line-height: 1.18;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.intake-card-wide .intake-card-title {
  font-size: 0.98rem;
  padding-right: 1.2rem;
}

.intake-card-body {
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.3;
}

.intake-card-hint {
  margin-top: 0.12rem;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.intake-other {
  display: grid;
  grid-gap: 0.4rem;
  gap: 0.4rem;
  padding: 0.45rem 0 0;
  animation: rise 160ms var(--ease-out);
}

.intake-other label {
  font-weight: 600;
}

.intake-other input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.8rem;
  font: inherit;
  color: var(--ink);
  background: var(--panel);
}

.intake-other input:focus {
  outline: 3px solid rgba(20, 104, 79, 0.22);
  outline-offset: 1px;
  border-color: var(--accent);
}

.intake-other-go {
  justify-self: start;
}

.intake-alert {
  margin-top: 0.85rem;
}

.intake-edit-row {
  margin: 0 0 0.85rem;
  text-align: right;
}

@media (max-width: 980px) {
  .intake-layer {
    left: 0;
  }
}

@media (max-width: 640px) {
  .intake-shell.panel {
    width: 100%;
    max-height: calc(100dvh - 1.3rem);
    padding: 0.7rem 0.8rem 0.75rem;
  }

  .intake-grid-industry,
  .intake-grid-amount {
    grid-template-columns: 1fr;
  }

  .intake-card,
  .intake-card-wide,
  .intake-card-amount {
    min-height: 0;
  }

  .intake-head h2 {
    font-size: 1.08rem;
  }
}

@media (max-height: 720px) {
  .intake-shell.panel {
    padding: 0.65rem 0.85rem 0.7rem;
    max-height: calc(100dvh - 1.2rem);
  }

  .intake-toolbar {
    margin-bottom: 0.35rem;
  }

  .intake-page {
    gap: 0.35rem;
  }

  .intake-grid,
  .intake-stack {
    gap: 0.28rem;
  }

  .intake-head h2 {
    font-size: 1.05rem;
  }

  .intake-card,
  .intake-card-wide,
  .intake-card-amount {
    min-height: 0;
    padding: 0.38rem 0.65rem 0.36rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intake-page-forward,
  .intake-page-back,
  .intake-card,
  .intake-progress-fill,
  .intake-layer.is-leaving,
  .intake-other,
  .invoices-stage.is-locked .invoices-stage-surface,
  .invoices-stage.is-unlocking .invoices-stage-surface {
    animation: none;
    transition: none;
  }
}

