/* ── CA Bundals · CA portal ─────────────────────────────────────────────
   Design system: Plus Jakarta Sans, #F4F6FA canvas, white 16px cards,
   brand blue #1A56DB, soft tinted pills. No gradients, no emoji. */
:root {
  --bg: #F4F6FA; --card: #fff; --ink: #1F2433; --ink-2: #3A4154;
  --blue: #1A56DB; --blue-deep: #1240A8; --blue-soft: #EEF3FD; --blue-soft-2: #DDE6F8;
  --line: #E6E9F0; --line-2: #D5DAE3; --line-3: #F0F2F6;
  --muted: #5B6275; --muted-2: #7A8194;
  --ok-bg: #E5F6EE; --ok-fg: #067647;
  --warn-bg: #FEF3E2; --warn-fg: #8A4B00;
  --bad-bg: #FDECEC; --bad-fg: #B42318;
  --neu-bg: #F2F4F8; --neu-fg: #5B6275;
  --info-bg: #EEF3FD; --info-fg: #1A56DB;
  --display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --body: 'Plus Jakarta Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; cursor: pointer; }
a:hover { color: var(--blue-deep); }
::selection { background: var(--blue); color: #fff; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; margin: 0; }
h2 { font-size: 16px; font-weight: 700; letter-spacing: 0; }
h3 { font-size: 15px; font-weight: 700; letter-spacing: 0; }
input, select, button, textarea { font-family: inherit; }

@keyframes pPulse { 0%,100% { opacity: .3 } 50% { opacity: 1 } }
@keyframes pIn { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
@keyframes pGrow { from { transform: scaleX(0) } to { transform: scaleX(1) } }

/* ── atoms ── */
.p-card { border-radius: 16px; border: 1px solid var(--line); background: #fff; box-shadow: none; }
.p-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; line-height: 1;
  border: 1px solid transparent; background: var(--blue-soft); color: var(--blue); transition: background .15s, border-color .15s; }
.p-btn:hover:not(:disabled) { background: var(--blue-soft-2); color: var(--blue); }
.p-btn:disabled { opacity: .5; cursor: not-allowed; }
.p-cta { background: var(--blue); color: #fff; font-weight: 600; }
.p-cta:hover:not(:disabled) { background: var(--blue-deep); color: #fff; }
.p-btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.p-tag { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.p-input, select.p-input { height: 42px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2);
  background: #fff; font-size: 14px; font-weight: 500; color: var(--ink); outline: none; width: 100%; }
textarea.p-input { height: auto; padding: 10px 14px; }
.p-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #DCE6FB; }
.p-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.p-kicker { font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); }
.p-muted { color: var(--muted); font-size: 13px; }
.p-hint { font-size: 12px; color: var(--muted); }
.p-num { font-family: var(--display); font-weight: 800; letter-spacing: -.03em; }

.p-bar { height: 6px; border-radius: 3px; background: #EEF0F4; overflow: hidden; }
.p-bar i { display: block; height: 100%; border-radius: 3px; background: var(--blue); transform-origin: left; animation: pGrow 1.2s cubic-bezier(.2,.8,.2,1) both; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11.5px; letter-spacing: .4px; text-transform: uppercase; color: var(--muted);
  font-weight: 700; padding: 10px 14px; background: #F8F9FC; border-bottom: 1px solid var(--line); }
td { padding: 11px 14px; font-size: 13px; border-bottom: 1px solid var(--line-3); vertical-align: middle; }
tbody tr.p-row:hover, tbody tr:hover { background: #F8FAFF; }
tbody tr.p-row:hover { cursor: pointer; }
.p-scroll { overflow-x: auto; }

/* ── shell: fixed left sidebar + slim header ── */
:root { --side-w: 248px; }
body.p-rail { --side-w: 68px; }
.p-shell { min-height: 100vh; }
.p-main { min-width: 0; margin-left: var(--side-w); display: flex; flex-direction: column; min-height: 100vh; transition: margin-left .18s ease; }
.p-top { height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 24px; background: #fff;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.p-launcher { display: none; width: 38px; height: 38px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; flex: none;
  place-items: center; padding: 0; color: var(--ink-2); }
.p-launcher:hover { background: var(--neu-bg); }
.p-top-titles { min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.p-crumb { font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.p-top-title { font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-searchbox { margin-left: auto; display: flex; align-items: center; gap: 8px; height: 38px; width: 320px; min-width: 160px;
  padding: 0 12px; background: var(--bg); border-radius: 8px; color: var(--muted); }
.p-searchicon { display: flex; }
.p-search { border: 0; outline: 0; background: transparent; font: 14px var(--body); color: var(--ink); flex: 1; min-width: 0; }
.p-top-cta { flex: none; }

.p-side { position: fixed; top: 0; left: 0; bottom: 0; width: var(--side-w); z-index: 60; background: #fff;
  border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 12px 12px;
  overflow-y: auto; overflow-x: hidden; transition: width .18s ease; }
.p-side-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 36px; padding: 0 4px; }
.p-side-logo { color: var(--ink); display: flex; min-width: 0; }
.p-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.p-rail-toggle { border: 0; background: none; color: var(--muted); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; flex: none; }
.p-rail-toggle:hover { background: var(--neu-bg); color: var(--blue); }
.p-firmname { font-size: 12px; color: var(--muted); margin: 6px 6px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-side-nav { display: flex; flex-direction: column; gap: 2px; }
.p-nicon { display: grid; place-items: center; width: 20px; flex: none; }
.p-nav { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; min-height: 36px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.p-nav .p-nicon { color: var(--muted-2); }
.p-nav:hover { background: var(--neu-bg); color: var(--blue); }
.p-nav:hover .p-nicon { color: var(--blue); }
.p-nav.on { background: var(--blue-soft); color: var(--blue); }
.p-nav.on .p-nicon { color: var(--blue); }
.p-nav.locked { color: var(--muted-2); }
.p-nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.p-lock { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--neu-bg); color: var(--neu-fg); }
.p-side-sep { height: 1px; background: var(--line-3); margin: 6px 4px; }
.p-navgroup { margin-top: 4px; }
.p-navgroup-title { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; background: none;
  padding: 8px 10px 4px; font: 700 11px var(--body); letter-spacing: .04em; text-transform: uppercase; color: var(--muted-2); cursor: pointer; }
.p-navgroup-title:hover { color: var(--ink-2); }
.p-navgroup-title .p-nicon { width: 14px; transform: rotate(90deg); transition: transform .15s; }
.p-navgroup-title .p-nicon svg { width: 14px; height: 14px; }
.p-navgroup.shut .p-navgroup-title .p-nicon { transform: none; }
.p-navgroup.shut .p-navgroup-items { display: none; }
.p-navgroup-items .p-nicon svg { width: 14px; height: 14px; }
.p-side-spacer { flex: 1; min-height: 12px; }
#p-support-slot:empty { display: none; }
#p-support-slot { margin-bottom: 8px; }

.p-user { position: relative; border-top: 1px solid var(--line-3); padding-top: 10px; }
.p-user-btn { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 6px; border-radius: 10px;
  cursor: pointer; font-family: inherit; text-align: left; }
.p-user-btn:hover { background: var(--neu-bg); }
.p-user-who { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.p-user-who b { font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-user-who span { font-size: 11.5px; color: var(--muted); white-space: nowrap; text-transform: capitalize; }
.p-av { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; background: #8B5CF6; }
.p-user-menu { display: none; position: fixed; left: 12px; bottom: 70px; width: 260px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 14px; box-shadow: 0 24px 50px -20px rgba(31,36,51,.35); z-index: 70; }
body.p-user-open .p-user-menu { display: block; animation: pIn .15s ease both; }
.p-user-name { font-weight: 700; font-size: 14px; }
.p-user-plan { margin: 12px 0 8px; padding: 12px; border-radius: 10px; background: var(--bg); }
.p-user-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 8px;
  font: 600 13.5px var(--body); color: var(--ink-2); cursor: pointer; }
.p-user-item:hover { background: var(--neu-bg); color: var(--blue); }
.p-user-out { color: var(--bad-fg); border-top: 1px solid var(--line-3); border-radius: 0 0 8px 8px; margin-top: 4px; }
.p-side-foot[hidden] { display: none; }
.p-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #22C55E; animation: pPulse 1.8s ease-in-out infinite; }
.p-plan { margin-top: 22px; padding: 14px; background: var(--blue-soft); border-color: transparent; }

/* icon rail (desktop only) */
@media (min-width: 1001px) {
  body.p-rail .p-side { padding: 14px 10px 12px; }
  body.p-rail .p-side-logo, body.p-rail .p-firmname, body.p-rail .p-nav-label, body.p-rail .p-lock,
  body.p-rail .p-navgroup-title, body.p-rail .p-user-who { display: none; }
  body.p-rail .p-side-top { justify-content: center; padding: 0; }
  body.p-rail .p-nav { justify-content: center; padding: 8px 0; }
  body.p-rail .p-navgroup.shut .p-navgroup-items { display: flex; }
  body.p-rail .p-navgroup-items { display: flex; flex-direction: column; gap: 2px; }
  body.p-rail .p-user-btn { justify-content: center; padding: 6px 0; }
}

.p-body { padding: 24px 32px 80px; animation: pIn .3s ease both; width: 100%; max-width: 1440px; margin: 0 auto; }

/* shared bits used by login + screens */
.p-lrow { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line-3); }
.p-lrow:first-of-type { border-top: 0; }
.p-lrow-t { flex: 1; min-width: 0; }
.p-lrow-t b { display: block; font-size: 14px; font-weight: 600; }
.p-lrow-t span { font-size: 12.5px; color: var(--muted); }
.p-ch { display: flex; align-items: center; gap: 10px; }
.p-ch h2 { flex: 1; }
.p-cnt { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--neu-bg); color: var(--ink-2); }
.p-kicker-blue { font-size: 13px; font-weight: 700; color: var(--blue); }

.p-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.p-head h1 { font-size: 34px; }
.p-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.p-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.p-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.p-stack { display: flex; flex-direction: column; gap: 16px; }
.p-pad { padding: 22px; }

/* dashboard hero */
.p-hero { padding: 26px; }
.p-hero .p-num { font-size: 52px; margin: 8px 0 4px; }
.p-hero-sub { font-size: 13px; color: var(--muted); }

.p-list-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid rgba(31,36,51,.07); }
.p-list-row:last-child { border-bottom: 0; }
.p-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

.p-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.p-chip { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff;
  font-size: 13px; cursor: pointer; white-space: nowrap; }
.p-chip[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 500; }

/* calendar */
.p-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; min-width: 720px; }
.p-cal-h { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 4px; }
.p-cal-cell { min-height: 96px; border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: #fff; }
.p-cal-day { font-size: 11px; color: var(--muted); }
.p-cal-ev { display: block; margin-top: 4px; padding: 3px 6px; border-radius: 6px; font-size: 10px;
  font-weight: 500; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* pipeline */
.p-pipe { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.p-pipe-step { padding: 8px 14px; border-radius: 999px; font-size: 13px; background: var(--neu-bg); color: var(--neu-fg); }

/* wizard */
.p-wizard { display: grid; grid-template-columns: 1fr 400px; gap: 16px; align-items: start; }
.p-derived { padding: 20px; position: sticky; top: 90px; }
.p-fam { border-top: 1px solid var(--line); padding: 12px 0 4px; }
.p-fam-name { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--blue-deep); }
.p-fam-item { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 5px 0; }

/* toasts */
#lc-toast { position: fixed; right: 20px; bottom: 20px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.lc-toast { padding: 12px 18px; border-radius: 14px; font-size: 14px; color: #fff; background: #1F2433;
  box-shadow: 0 12px 30px rgba(31,36,51,.25); transition: opacity .4s, transform .4s; max-width: 380px; }
.lc-toast-bad { background: #b4232a; }
.lc-toast-ok { background: #1c6b3f; }

/* login */
.p-login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.p-login-card { width: 100%; max-width: 400px; padding: 30px; }

.p-empty { padding: 40px; text-align: center; color: var(--muted); font-size: 14px; }

/* desktop: the phone-only chrome is invisible */
.p-drawer-close, .p-scrim, .p-only-narrow, .p-drawer-search { display: none; }

@media (max-width: 1180px) {
  .p-searchbox { width: 220px; }
}

@media (max-width: 1000px) {
  /* the sidebar becomes an off-canvas drawer */
  .p-main { margin-left: 0; }
  .p-side { width: min(290px, 86vw); transform: translateX(-102%); transition: transform .22s ease; }
  body.p-drawer-open .p-side { transform: translateX(0); box-shadow: 0 0 60px rgba(31,36,51,.28); }
  .p-rail-toggle { display: none; }
  .p-scrim {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(31,36,51,.4); opacity: 0; pointer-events: none; transition: opacity .22s ease;
  }
  body.p-drawer-open .p-scrim { opacity: 1; pointer-events: auto; }
  body.p-drawer-open { overflow: hidden; }
  .p-drawer-close { display: block; border: 0; background: none; cursor: pointer; font-size: 26px; line-height: 1; color: var(--muted); padding: 0 6px; }
  .p-launcher { display: grid; }
  .p-top { padding: 0 12px; gap: 8px; }
  .p-top-titles { margin-right: auto; }
  .p-searchbox { display: none; }
  .p-drawer-search { display: block; margin: 0 0 10px; }
  .p-drawer-search .p-search { width: 100%; display: block; height: 40px; padding: 0 12px; border-radius: 8px; background: var(--bg); }
  .p-only-narrow { display: inline; }
  .p-hide-narrow { display: none !important; }

  .p-grid-2, .p-grid-3, .p-grid-4, .p-wizard { grid-template-columns: 1fr; }
  .p-derived { position: static; }
  .p-body { padding: 16px 14px 70px; }

  .p-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .p-head h1 { font-size: 24px; }

  .p-filterbar { padding: 12px; gap: 8px; }
  .p-filterbar .p-input, .p-filterbar .p-select { flex: 1 1 100%; max-width: 100%; width: 100%; }

  /* A scroll container only works if its ancestors let it shrink. */
  .p-main, .p-body, .p-body > *, .p-card, .p-pad,
  .p-grid-2 > *, .p-grid-3 > *, .p-grid-4 > *, .p-wizard > * { min-width: 0; }
  .p-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .p-scroll table { min-width: 760px; }
  .p-scroll table td:first-child, .p-scroll table th:first-child { min-width: 170px; }
  .p-filterbar > .p-hint, .p-filterbar > span:last-child { margin-left: 0; }

  .p-modal { padding: 18px; border-radius: 16px; }
  .p-fee-input { width: 90px; }
}

@media (max-width: 560px) {
  .p-body { padding: 14px 12px 70px; }
  .p-head h1 { font-size: 22px; }
  .p-num { font-size: 24px !important; }
  .p-pad { padding: 16px; }
  .p-chk-actions { flex-wrap: wrap; }
  .p-user-menu { width: auto; right: 12px; }
}


/* a file, as a chip. Decoration only — nothing here reads the contents. */
.p-pill-file {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 6px 11px; border-radius: 99px;
  border: 1px solid var(--line-2); background: var(--card);
  font-size: 12.5px; color: var(--ink); text-decoration: none;
  max-width: 100%; white-space: nowrap;
}
.p-pill-file:hover { border-color: var(--blue); color: var(--blue); }


.p-link-btn {
  border: 0; background: transparent; padding: 0; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--blue);
}
.p-link-btn:hover { text-decoration: underline; }


.p-step-n {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--blue); color: #fff; font-weight: 700; font-size: 14px;
}


/* modal for the small "add something by hand" flows */
.p-modal-back {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(31,36,51,.34); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px;
}
.p-modal {
  background: var(--card); border-radius: 20px; padding: 24px;
  width: min(520px, 100%); max-height: 86vh; overflow: auto;
  border: 1px solid var(--line-2); box-shadow: 0 24px 60px rgba(31,36,51,.22);
}

.p-file-wrap { display: inline-flex; align-items: center; }
.p-file-del {
  border: 0; background: transparent; cursor: pointer; color: var(--muted);
  font-size: 15px; line-height: 1; padding: 4px 6px; border-radius: 50%;
  margin-left: -4px; opacity: 0; transition: opacity .12s;
}
.p-file-wrap:hover .p-file-del { opacity: 1; }
.p-file-del:hover { background: var(--bad-bg); color: var(--bad-fg); }


/* one filter row instead of three rows of pills */
.p-filterbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 14px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px;
}
.p-select {
  appearance: none;
  padding: 8px 30px 8px 12px;
  border: 1px solid var(--line-2); border-radius: 99px;
  /* longhand, so the active state can swap the arrow without losing
     the position and no-repeat and tiling the SVG across the pill */
  background-color: var(--card);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M1 1l4 4 4-4' stroke='%236b7688' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px 6px;
  font: inherit; font-size: 13px; color: var(--ink); cursor: pointer;
  max-width: 210px;
}
.p-select:hover { border-color: var(--blue); }
.p-select-on {
  background-color: var(--blue); color: #fff; border-color: var(--blue);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M1 1l4 4 4-4' stroke='white' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>");
}


/* ── checklists ─────────────────────────────────────────────────────
   Two columns that keep their own height: the template list scrolls
   inside its card instead of spilling past the rounded corner. */
.p-chk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 1080px) { .p-chk-grid { grid-template-columns: 1fr; } }

.p-col { min-width: 0; }
.p-col-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; min-height: 32px;
}
.p-col-head h3 { margin-right: auto; }

.p-chk-card { margin-bottom: 10px; }
.p-chk-head { display: flex; align-items: flex-start; gap: 10px; }
.p-chk-actions { margin-left: auto; display: flex; gap: 6px; flex: none; }

/* template list: fixed height, scrolls inside, nothing bleeds out */
.p-tpl-search { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.p-tpl-search .p-input { width: 100%; }
.p-tpl-list { max-height: 460px; overflow-y: auto; }
.p-tpl-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-bottom: 1px solid var(--line);
}
.p-tpl-row:last-child { border-bottom: 0; }
.p-tpl-text { flex: 1; min-width: 0; }
.p-tpl-name {
  font-weight: 600; font-size: 14px;
  display: flex; align-items: baseline; gap: 8px;
}
.p-tpl-fam {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted);
  background: rgba(31,36,51,.06); padding: 2px 6px; border-radius: 5px;
}
/* one line only — the whole list wrapped to three lines before */
.p-tpl-items {
  font-size: 12.5px; color: var(--muted); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.p-tpl-row .p-btn { flex: none; }

/* editor rows */
.p-chk-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.p-chk-row .p-input { flex: 1; }
.p-chk-n {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: rgba(31,36,51,.06); color: var(--muted);
}
.p-icon-btn {
  flex: none; border: 1px solid var(--line-2); background: var(--card);
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  color: var(--muted); font-size: 15px; line-height: 1;
}
.p-icon-btn:hover { border-color: #B42318; color: #B42318; }


/* editable price cells — a default still showing our figure is muted, so
   the firm can see at a glance what they have not set yet */
.p-fee-input { width: 110px; text-align: right; font-variant-numeric: tabular-nums; }
.p-fee-default { color: var(--muted); border-style: dashed; }
.p-fee-input:focus { color: var(--ink); border-style: solid; }


/* ── year folders ───────────────────────────────────────────────────
   A shelf of financial years, because that is how a CA hands papers over. */
.p-folder { cursor: pointer; transition: border-color .14s, transform .14s; }
.p-folder:hover { border-color: var(--blue); transform: translateY(-1px); }
.p-folder-top { display: flex; align-items: flex-start; justify-content: space-between; }
.p-folder-icon { font-size: 26px; line-height: 1; }

/* ── chat ─────────────────────────────────────────────────────────── */
.p-select-sm { padding: 4px 26px 4px 9px; font-size: 13px; border-radius: 9px; }
.p-chat-scroll {
  max-height: min(62vh, 540px); overflow-y: auto;
  padding: 18px; display: flex; flex-direction: column; gap: 11px;
  background: #FAFBFD;
}
.p-chat-row { display: flex; }
.p-chat-row.mine { justify-content: flex-end; }
.p-bubble {
  max-width: 66%; padding: 9px 13px; border-radius: 15px;
  background: #fff; border: 1px solid var(--line);
  font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word;
}
.p-chat-row.mine .p-bubble {
  background: var(--blue); border-color: var(--blue); color: #fff;
  border-bottom-right-radius: 5px;
}
.p-chat-row:not(.mine) .p-bubble { border-bottom-left-radius: 5px; }
.p-bubble-who { font-size: 11.5px; font-weight: 600; opacity: .75; margin-bottom: 2px; }
.p-chat-row.mine .p-bubble-who { color: rgba(255,255,255,.85); opacity: 1; }
.p-bubble-at { font-size: 11px; opacity: .55; margin-top: 3px; text-align: right; }
.p-chat-note { align-self: center; text-align: center; max-width: 80%; font-size: 12.5px; color: var(--muted); }
.p-chat-bar {
  display: flex; gap: 10px; align-items: flex-end;
  padding: 13px 16px; border-top: 1px solid var(--line); background: #fff;
}
.p-chat-input {
  flex: 1; min-width: 0; resize: none; font: inherit; font-size: 14.5px;
  padding: 10px 13px; border-radius: 13px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); max-height: 160px;
}
.p-chat-input:focus { outline: none; border-color: var(--blue); background: #fff; }
.p-linkbox { margin-top: 12px; padding: 12px 13px; border-radius: 13px; background: var(--bg); border: 1px solid var(--line); }
.p-linkurl {
  margin-top: 5px; font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all; color: var(--blue-deep);
}

/* ── grouped nav ─────────────────────────────────────────────────── */
.p-navgroup { margin-top: 14px; }
.p-navgroup:first-of-type { margin-top: 0; }
.p-navgroup-title {
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  font-weight: 700; color: rgba(31,36,51,.42); padding: 0 12px 6px;
}

/* ── per-item accepted file kinds ────────────────────────────────── */
.p-item-edit { padding: 10px 0; border-bottom: 1px solid var(--line); }
.p-kindrow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 7px 0 0 26px; }
.p-kindlabel { font-size: 11px; color: rgba(31,36,51,.5); margin-right: 2px; }
.p-kind {
  font: inherit; font-size: 11.5px; padding: 3px 9px; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--line-2); background: #fff; color: var(--muted);
}
.p-kind:hover { border-color: var(--blue); }
.p-kind.on { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }

/* ── modal ───────────────────────────────────────────────────────── */
.p-modal-scrim {
  position: fixed; inset: 0; z-index: 60; display: flex;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(31,36,51,.42); backdrop-filter: blur(2px);
}
.p-modal {
  width: min(460px, 100%); max-height: 88vh; overflow-y: auto;
  background: #fff; border-radius: 20px; padding: 22px;
  border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(31,36,51,.22);
}
.p-modal-foot { display: flex; gap: 9px; justify-content: flex-end; margin-top: 20px; }

/* ── plan ladder ─────────────────────────────────────────────────── */
.p-ladder { display: grid; gap: 10px; margin-top: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.p-rung { padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: var(--bg); }
.p-rung.on { border-color: var(--blue); background: var(--blue-soft); }
.p-nav.locked { opacity: .55; }
.p-lock { margin-left: auto; font-size: 11px; }

/* ── bring old files in ──────────────────────────────────────────── */
.p-drop {
  border: 2px dashed var(--line-2); border-radius: 18px;
  padding: 30px 20px; text-align: center; background: var(--bg);
  transition: border-color .12s, background .12s;
}
.p-drop.over { border-color: var(--blue); background: var(--blue-soft); }
.p-mig-list { margin-top: 12px; max-height: 320px; overflow-y: auto; }
.p-mig-row {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 2px; font-size: 12.5px; border-bottom: 1px solid var(--line);
}
.p-mig-path { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-mig-fy { color: var(--blue-deep); font-weight: 600; white-space: nowrap; }
.p-mig-row .p-mig-state { color: var(--muted); white-space: nowrap; min-width: 74px; text-align: right; }
.p-mig-row.sending { opacity: .7; }
.p-mig-row.failed .p-mig-state { color: var(--bad-fg); font-weight: 600; }
.p-mig-row.failed .p-mig-fy { opacity: .4; }
.p-google { width: 100%; justify-content: center; gap: 9px; padding: 12px; font-weight: 600; }
.p-google-g {
  display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%;
  background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0);
  color: #fff; font-size: 11px; font-weight: 800;
}
.p-or { display: flex; align-items: center; gap: 10px; margin: 16px 0 2px; color: var(--muted); font-size: 12px; }
.p-or::before, .p-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ── sheet ───────────────────────────────────────────────────────── */
.p-sheet-scrim {
  position: fixed; inset: 0; z-index: 55; display: flex;
  align-items: flex-start; justify-content: center;
  padding: clamp(12px, 4vh, 48px) 16px;
  background: rgba(31,36,51,.42); backdrop-filter: blur(2px);
  overflow-y: auto;
}
.p-sheet {
  width: min(880px, 100%); background: var(--bg);
  border-radius: 22px; border: 1px solid var(--line);
  box-shadow: 0 30px 70px rgba(31,36,51,.26); overflow: hidden;
}
.p-sheet-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1;
}
.p-sheet-body { padding: 20px; }
/* the wizard prints its own title; the sheet already has one */
.p-sheet-body .p-head h1 { display: none; }
body.p-sheet-open { overflow: hidden; }


/* ══ design-system pass (Track A) ═══════════════════════════════════ */

/* page heads, cards, heroes */
.p-head { align-items: flex-end; margin-bottom: 20px; }
.p-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -.8px; }
.p-pad { padding: 22px 24px; }
.p-hero { padding: 22px 24px; }
.p-hero .p-num { font-size: 36px; letter-spacing: -1px; }
.p-hero-sub { font-size: 13px; color: var(--muted); font-weight: 500; }
.p-list-row { border-bottom: 1px solid var(--line-3); padding: 12px 0; }
.p-grid-2, .p-grid-3, .p-grid-4 { gap: 16px; }
.p-empty { color: var(--muted); }

/* chips / segmented filters */
.p-chip { height: 32px; padding: 0 12px; display: inline-flex; align-items: center; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.p-chip:hover { color: var(--blue); }
.p-chip[aria-pressed="true"] { background: var(--blue-soft); border-color: var(--blue-soft); color: var(--blue); font-weight: 700; }
.p-select { border-radius: 8px; border-color: var(--line-2); font-weight: 600; height: 34px; }
.p-select-on { background-color: var(--blue-soft); color: var(--blue); border-color: var(--blue-soft);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M1 1l4 4 4-4' stroke='%231A56DB' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>"); }
.p-filterbar { border-radius: 12px; }

/* calendar */
.p-cal-h { font-size: 12px; font-weight: 700; text-transform: none; letter-spacing: 0; }
.p-cal-cell { border-radius: 12px; border-color: var(--line); transition: box-shadow .2s, transform .2s; }
.p-cal-cell:hover { box-shadow: 0 14px 26px -16px rgba(31,36,51,.35); }
.p-cal-day { font-size: 12px; font-weight: 700; color: var(--muted); }
.p-cal-ev { border-radius: 6px; font-size: 11px; font-weight: 700; }

/* pipeline, wizard */
.p-pipe-step { border-radius: 8px; font-weight: 600; }
.p-fam-name { font-size: 12px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--blue); }
.p-derived { top: 84px; }

/* toasts */
.lc-toast { border-radius: 10px; background: var(--ink); font-weight: 600; font-size: 13.5px; }
.lc-toast-bad { background: var(--bad-fg); }
.lc-toast-ok { background: var(--ok-fg); }

/* modals, sheets */
.p-modal, .p-sheet { border-radius: 16px; border-color: var(--line); }
.p-modal-scrim, .p-modal-back, .p-sheet-scrim { background: rgba(31,36,51,.42); }
.p-sheet-top { border-bottom-color: var(--line); }

/* chat */
.p-chat-scroll { background: #FAFBFD; }
.p-bubble { border-radius: 12px; }
.p-chat-input { border-radius: 10px; }

/* misc */
.p-rung { border-radius: 12px; }
.p-rung.on { border-color: var(--blue); background: var(--blue-soft); }
.p-drop { border-radius: 16px; }
.p-drop.over { background: var(--blue-soft); }
.p-pill-file { border-radius: 8px; }
.p-lock { margin-left: auto; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--neu-bg); color: var(--muted); }
.p-navgroup { margin-top: 0; }
.p-navgroup-title { font-size: 11.5px; letter-spacing: .4px; text-transform: uppercase; font-weight: 700; color: var(--muted); padding: 8px 10px 4px; }
.p-icon-btn:hover { border-color: var(--bad-fg); color: var(--bad-fg); }
.p-google { width: 100%; justify-content: center; gap: 9px; height: 44px; background: #fff; border: 1px solid var(--line-2); color: var(--ink); }
.p-google:hover:not(:disabled) { background: var(--bg); color: var(--ink); }
.p-google-g { background: #4285F4; }
.p-folder:hover { border-color: var(--blue); }

/* ── login: split screen with product glimpse ── */
.p-login { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 560px) 1fr; place-items: stretch; padding: 0; background: #fff; }
.p-login-side { padding: 44px clamp(24px, 5vw, 72px); display: flex; flex-direction: column; gap: 22px; border-right: 1px solid var(--line); }
.p-login-head { margin-top: 20px; }
.p-login-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -.8px; }
.p-login-head p { margin: 6px 0 0; font-size: 14px; }
.p-login-back { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 700; }
.p-login-form { display: flex; flex-direction: column; gap: 16px; }
.p-login-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.p-fld { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.p-login-submit { height: 46px; font-size: 15px; justify-content: center; width: 100%; }
.p-login-err { background: var(--bad-bg); color: var(--bad-fg); border-radius: 10px; padding: 10px 14px; font-size: 13px; font-weight: 600; }
.p-login-demo { background: var(--blue-soft); border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.p-login-switch { border-top: 1px solid var(--line-3); padding-top: 18px; font-size: 14px; }
.p-login-switch .p-link-btn { font-size: 14px; font-weight: 700; }
.p-login-foot { margin-top: auto; font-size: 12.5px; color: var(--muted); }
.p-or { margin: 16px 0 0; }
.p-login-glimpse { background: #EAF0FC; position: relative; overflow: hidden; padding: 64px; display: flex; flex-direction: column; gap: 24px; }
.p-blob { position: absolute; border-radius: 50%; }
.p-blob-1 { right: -120px; top: -120px; width: 420px; height: 420px; background: #C9D8F8; }
.p-blob-2 { left: -80px; bottom: -140px; width: 360px; height: 360px; background: #FFD9CC; mix-blend-mode: multiply; }
.p-glimpse-head { position: relative; }
.p-glimpse-head h2 { margin-top: 6px; font-size: 26px; font-weight: 800; letter-spacing: -.6px; max-width: 560px; line-height: 1.25; }
.p-glimpse-card { position: relative; max-width: 640px; padding: 22px 24px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 30px 60px -30px rgba(26,86,219,.45); }
.p-glimpse-meta { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); font-weight: 600; flex-wrap: wrap; }
.p-glimpse-msg { position: relative; width: min(380px, 100%); margin: -40px 0 0 auto; max-width: 380px; padding: 18px 20px;
  display: flex; flex-direction: column; gap: 8px; box-shadow: 0 30px 60px -30px rgba(31,36,51,.4); }
.p-glimpse-msg .p-tag { align-self: flex-start; }
.p-glimpse-wa { font-size: 12px; font-weight: 700; color: var(--ok-fg); }
.p-glimpse-bubble { background: var(--ok-bg); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
@media (max-width: 900px) {
  .p-login { grid-template-columns: 1fr; }
  .p-login-glimpse { display: none; }
  .p-login-side { border-right: 0; padding: 28px 20px; max-width: 560px; margin: 0 auto; width: 100%; }
}
@media (max-width: 560px) { .p-login-2 { grid-template-columns: 1fr; } }

/* screens write lower-case labels; show them in sentence case */
.p-kicker::first-letter, .p-card h2::first-letter, .p-card h3::first-letter, th::first-letter, .p-empty::first-letter { text-transform: uppercase; }
/* keep support launcher + user block always visible at the sidebar foot */
.p-side-bottom { position: sticky; bottom: -12px; z-index: 2; background: #fff; margin: 0 -12px -12px; padding: 6px 12px 12px; box-shadow: 0 -10px 12px -10px rgba(31,36,51,.12); }
body.p-rail .p-side-bottom { margin: 0 -10px -12px; padding: 6px 10px 12px; }
.p-nini i { display: block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.p-nini b { display: none; font-size: 10.5px; font-weight: 800; letter-spacing: .02em; }
body.p-rail .p-nini { width: 28px; height: 22px; border-radius: 6px; background: var(--neu-bg); }
body.p-rail .p-nini i { display: none; }
body.p-rail .p-nini b { display: block; }
@media (max-width: 1000px) { body.p-rail .p-nini { width: 20px; height: auto; background: none; } body.p-rail .p-nini i { display: block; } body.p-rail .p-nini b { display: none; } body.p-rail .p-side-bottom { margin: 0 -12px -12px; padding: 6px 12px 12px; } }
.p-side > * { flex-shrink: 0; }

/* sign-in / sign-up: give the film most of the screen */
@media (min-width: 901px) {
  .p-login { grid-template-columns: minmax(360px, 460px) 1fr; }
  .p-login-glimpse { padding: 40px 36px; justify-content: center; }
  .p-login-film { width: 100%; max-width: none; margin: 0; position: relative; z-index: 1; }
}
