:root {
  --ink: #17252a;
  --ink-soft: #4b5d63;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --line: #dfe3e0;
  --brand: #0f6b5c;
  --brand-dark: #0a4f44;
  --brand-tint: #e3f2ee;
  --green: #1d7a46; --green-bg: #e1f4e8;
  --amber: #8a5a00; --amber-bg: #fdf0cf;
  --red: #b3261e; --red-bg: #fde7e5;
  --grey: #55616a; --grey-bg: #e9ecee;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(23, 37, 42, .08), 0 2px 8px rgba(23, 37, 42, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 1rem; line-height: 1.5; color: var(--ink); background: var(--paper); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; }
a { color: var(--brand-dark); }
img { max-width: 100%; }
.container { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
.main { padding-top: 1.5rem; padding-bottom: 3rem; min-height: 60vh; }
.muted { color: var(--ink-soft); }
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 40rem; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid #2d8cff; outline-offset: 2px; }

/* Header: mobile-first. The nav is a stacked panel behind the Menu button until 900px.
   Logged-in header (.is-app): row 1 = logo + bell + user menu (+ Menu on phones), row 2 = nav bar. */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; min-height: 3.5rem; gap: .5rem; }
.logo { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.2rem; color: var(--ink); text-decoration: none; }
.logo-mark { width: 1.1rem; height: 1.4rem; background: var(--brand); border-radius: 2px 6px 2px 2px; display: inline-block; }
.menu-toggle { display: none; font: inherit; font-weight: 600; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: .45rem .9rem; min-height: 2.5rem; cursor: pointer; }
.site-nav { flex-basis: 100%; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.site-nav li a { display: block; padding: .65rem .25rem; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.site-nav li a:hover { color: var(--brand-dark); }
.site-nav li a.is-active { color: var(--brand-dark); font-weight: 700; }
.nav-actions { display: flex; align-items: center; gap: .75rem; padding: .75rem 0; }
.nav-actions form { margin: 0; }
/* Without JS the nav is simply visible. With JS (html.js) it collapses on small screens. */
.js .menu-toggle { display: inline-block; }
.js .site-nav { display: none; }
.js .site-nav.is-open { display: block; }

.header-tools { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: var(--radius); color: var(--ink); border: 1px solid var(--line); text-decoration: none; }
.bell:hover, .bell.is-active { background: var(--brand-tint); color: var(--brand-dark); }
.bell-count { position: absolute; top: -.35rem; right: -.35rem; min-width: 1.15rem; height: 1.15rem; padding: 0 .25rem; border-radius: 999px; background: var(--grey-bg); color: var(--grey); font-size: .72rem; font-weight: 700; line-height: 1.15rem; text-align: center; }
.bell-count:not([data-count="0"]) { background: var(--red); color: #fff; }

.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: .5rem; cursor: pointer; min-height: 2.5rem; padding: 0 .4rem; border: 1px solid var(--line); border-radius: var(--radius); }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover, .user-menu[open] summary { background: var(--brand-tint); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--brand); color: #fff; font-size: .75rem; font-weight: 700; }
.user-label { display: none; flex-direction: column; line-height: 1.15; text-align: left; max-width: 11rem; }
.user-name, .user-firm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-name { font-weight: 600; font-size: .9rem; }
.user-firm { color: var(--ink-soft); font-size: .78rem; }
.chev { display: none; }
.user-panel { position: absolute; right: 0; top: calc(100% + .35rem); min-width: 13rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .35rem; z-index: 30; display: flex; flex-direction: column; }
.user-panel-head { display: flex; flex-direction: column; padding: .5rem .6rem; border-bottom: 1px solid var(--line); margin-bottom: .25rem; word-break: break-word; }
.user-panel a, .user-panel button { display: block; width: 100%; text-align: left; font: inherit; color: var(--ink); text-decoration: none; background: none; border: 0; border-radius: 6px; padding: .6rem; min-height: 2.5rem; cursor: pointer; }
.user-panel a:hover, .user-panel button:hover { background: var(--brand-tint); }
.user-panel form { margin: 0; }

.trial-banner { background: var(--brand-tint); color: var(--brand-dark); border-bottom: 1px solid #b3d9d0; font-size: .92rem; padding: .45rem 0; }
.trial-banner.is-urgent { background: var(--amber-bg); color: var(--amber); border-bottom-color: #ecd596; }
.trial-banner a { color: inherit; font-weight: 700; margin-left: .35rem; }

@media (min-width: 600px) {
  .user-label { display: flex; }
  .chev { display: block; }
}
@media (min-width: 900px) {
  .js .menu-toggle, .menu-toggle { display: none; }
  .js .site-nav, .site-nav { display: flex; flex: 1; flex-basis: auto; align-items: center; justify-content: flex-end; gap: 1rem; }
  .site-nav ul { flex-direction: row; gap: .25rem; flex-wrap: wrap; }
  .site-nav li a { border-bottom: 2px solid transparent; padding: .5rem .6rem; }
  .site-nav li a.is-active { border-bottom-color: var(--brand); }
  .nav-actions { padding: 0; }
  /* App header: the nav drops to its own full-width row under the logo and tools. */
  .is-app .header-inner { padding-bottom: 0; }
  .js .is-app .site-nav, .is-app .site-nav { flex-basis: 100%; justify-content: flex-start; border-top: 1px solid var(--line); margin-top: .25rem; }
  .is-app .site-nav li a { padding: .6rem .8rem; }
}

/* Buttons */
.btn { display: inline-block; font: inherit; font-weight: 600; line-height: 1.2; padding: .65rem 1.1rem; border-radius: var(--radius); border: 1px solid transparent; cursor: pointer; text-decoration: none; text-align: center; min-height: 2.75rem; }
.btn-sm { padding: .4rem .8rem; min-height: 2.25rem; font-size: .92rem; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--ink-soft); }
.btn-secondary:hover { background: var(--grey-bg); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-danger { background: var(--red); color: #fff; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Forms */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .25rem; }
.field .hint { color: var(--ink-soft); font-size: .9rem; margin-top: .2rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], input[type=tel], select, textarea {
  width: 100%; font: inherit; padding: .6rem .7rem; border: 1px solid #aab4b8; border-radius: var(--radius); background: #fff; color: var(--ink); min-height: 2.75rem;
}
textarea { min-height: 6rem; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); background: #fffafa; }
.field-error { color: var(--red); font-size: .9rem; margin-top: .25rem; font-weight: 600; }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; max-width: 30rem; box-shadow: var(--shadow); }

/* Tables: stacked cards on phones (td needs data-label), real table from 720px */
table.stack { width: 100%; border-collapse: collapse; }
table.stack thead { position: absolute; left: -9999px; }
table.stack tr { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .75rem; padding: .5rem .75rem; }
table.stack td { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; border: 0; text-align: right; }
table.stack td::before { content: attr(data-label); font-weight: 600; color: var(--ink-soft); text-align: left; }
@media (min-width: 720px) {
  table.stack thead { position: static; }
  table.stack tr { display: table-row; background: none; border: 0; margin: 0; padding: 0; }
  table.stack th, table.stack td { display: table-cell; padding: .65rem .75rem; border-bottom: 1px solid var(--line); text-align: left; }
  table.stack th { font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-soft); }
  table.stack td::before { content: none; }
}

/* Badges */
.badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-grey { background: var(--grey-bg); color: var(--grey); }

/* Flash */
.flash { margin: 1rem 0 0; padding: .75rem 1rem; border-radius: var(--radius); border: 1px solid; font-weight: 600; }
.flash-success { background: var(--green-bg); color: var(--green); border-color: #a9d9bb; }
.flash-error { background: var(--red-bg); color: var(--red); border-color: #f0b4af; }
.flash-info { background: var(--brand-tint); color: var(--brand-dark); border-color: #b3d9d0; }

/* Empty state, progress, cards */
.empty-state { text-align: center; padding: 2.5rem 1rem; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.empty-state h2, .empty-state h3 { margin-bottom: .25rem; }
.empty-state p { color: var(--ink-soft); margin: 0 auto 1rem; max-width: 28rem; }
.progress { height: .75rem; background: var(--grey-bg); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .2s; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }

/* Auth pages, dashboard */
.auth-page { max-width: 30rem; margin: 0 auto; padding-top: 1rem; }
.btn-block { display: block; width: 100%; }
.form-alt { text-align: center; margin: .75rem 0 0; color: var(--ink-soft); }
.form-error { margin: 0 0 1rem; }
.notice { border: 2px dashed var(--amber); background: var(--amber-bg); color: var(--ink); border-radius: var(--radius); padding: 1rem; margin: 1rem 0; }
.notice p { word-break: break-all; margin: .5rem 0; }
.checklist { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: .75rem; max-width: 44rem; }
.checklist-item { display: grid; grid-template-columns: auto 1fr; gap: .75rem 1rem; align-items: center; }
.checklist-item h2 { font-size: 1.05rem; margin: 0; }
.checklist-item p { margin: 0; }
.checklist-item .btn { grid-column: 1 / -1; }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--brand-tint); color: var(--brand-dark); font-weight: 700; }
@media (min-width: 600px) {
  .checklist-item { grid-template-columns: auto 1fr auto; }
  .checklist-item .btn { grid-column: auto; }
}

/* Pages */
.hero { padding: 2rem 0; }
.hero h1 { font-size: 2.1rem; max-width: 36rem; }
.error-page { text-align: center; padding: 3rem 0; }
.error-code { font-size: 4rem; font-weight: 800; color: var(--brand); margin: 0; }
.site-footer { border-top: 1px solid var(--line); padding: 1.25rem 0; color: var(--ink-soft); font-size: .9rem; }
.site-footer a { margin-left: 1rem; color: var(--ink-soft); }
@media (min-width: 720px) { h1 { font-size: 2.1rem; } .hero h1 { font-size: 3rem; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Lists, filters, details */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.page-actions form { margin: 0; }
.filters { display: grid; gap: 0 1rem; grid-template-columns: 1fr; margin-bottom: 1rem; align-items: end; }
.filters .field { margin-bottom: .75rem; }
.field.check label { font-weight: 400; display: flex; gap: .5rem; align-items: center; min-height: 2.75rem; }
.field.check input { width: 1.2rem; height: 1.2rem; }
.filter-actions { margin-bottom: .75rem; display: flex; gap: .5rem; }
@media (min-width: 720px) { .filters { grid-template-columns: 2fr 1fr 1fr auto auto; } }
.narrow { max-width: 38rem; }
.form-card.wide { max-width: 38rem; }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.details { display: grid; gap: .75rem 1.5rem; grid-template-columns: 1fr; margin: 0; }
.details dt { font-size: .85rem; color: var(--ink-soft); font-weight: 600; }
.details dd { margin: 0; word-break: break-word; }
@media (min-width: 720px) { .details { grid-template-columns: repeat(2, 1fr); } }
.pre { white-space: pre-wrap; }
.section-gap { margin-top: 1rem; }
.plain-list { margin: 0; padding-left: 1.1rem; }
.plain-list li { margin-bottom: .25rem; }
.row-error { background: #fffafa; }
.row-messages { margin: .25rem 0 0; padding: 0; list-style: none; }
.row-messages .field-error { margin-top: 0; font-weight: 500; }
code { background: var(--grey-bg); padding: .05rem .3rem; border-radius: 4px; font-size: .9em; }

/* Templates */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row-actions { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; }
.row-actions form, .item-actions form, .inline-form { margin: 0; display: inline-block; }
table.stack td.row-actions::before { content: none; }
@media (min-width: 720px) { table.stack td.row-actions { display: table-cell; text-align: right; } .row-actions { justify-content: flex-end; } }
.items { list-style: none; margin: 0; padding: 0; }
.item { border-top: 1px solid var(--line); padding: .75rem 0; }
.item:first-child { border-top: 0; }
.item-main { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; align-items: flex-start; }
.item-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.item-edit { margin-top: .5rem; }
.item-edit summary { cursor: pointer; color: var(--brand-dark); font-weight: 600; min-height: 2rem; }
.item-edit form { margin-top: .75rem; max-width: 36rem; }

/* Dashboard */
.small { font-size: .85rem; }
.segmented { display: inline-flex; border: 1px solid var(--ink-soft); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.segmented a { padding: .5rem .9rem; min-height: 2.5rem; display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .92rem; }
.segmented a + a { border-left: 1px solid var(--ink-soft); }
.segmented a.is-active { background: var(--brand); color: #fff; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin: 0 0 1.25rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; box-shadow: var(--shadow); }
.stat dt { font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
.stat dd { margin: 0; font-size: 2rem; font-weight: 800; line-height: 1.2; }
.stat-red dd { color: var(--red); }
.stat-amber dd { color: var(--amber); }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.dash-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 960px) { .dash-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.dash-side { display: grid; gap: 1rem; }
.dash-card h2 { font-size: 1.2rem; margin-bottom: .25rem; }
.dash-card > .muted { margin-top: 0; }
.empty-line { color: var(--ink-soft); margin: .75rem 0 0; }
.client-groups { display: grid; gap: 1rem; margin-top: .75rem; }
.client-group { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; }
.client-group.has-overdue { border-left: 4px solid var(--red); }
.client-group h3 { margin: 0 0 .5rem; font-size: 1.05rem; overflow-wrap: anywhere; }
.due-list, .outstanding, .review-list, .activity-list { list-style: none; margin: 0; padding: 0; }
.due-request { padding: .6rem 0; border-top: 1px solid var(--line); }
.due-request:first-child { border-top: 0; padding-top: 0; }
.due-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem .75rem; margin-bottom: .4rem; }
.due-title { font-weight: 700; overflow-wrap: anywhere; }
.due-meta { display: inline-flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.due-count { margin: .25rem 0; font-size: .88rem; }
.outstanding { font-size: .92rem; padding-left: 1rem; list-style: disc; }
.tag { font-size: .75rem; background: var(--grey-bg); color: var(--grey); border-radius: 4px; padding: 0 .35rem; white-space: nowrap; }
.review-list li, .activity-list li { padding: .5rem 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; overflow-wrap: anywhere; }
.review-list li:first-child, .activity-list li:first-child { border-top: 0; }
.onboarding .checklist { margin: 1.25rem auto 0; text-align: left; }

/* Landing page */
.main-full { min-height: 60vh; }
.legal { max-width: 44rem; padding: 1.5rem 1rem 3rem; margin: 0 auto; }
.notice-line { background: var(--amber-bg); border: 1px solid #e8cf8d; border-radius: var(--radius); padding: .75rem 1rem; }
.band { padding: 2.5rem 0; }
.band-tint { background: var(--brand-tint); }
.section-title { font-size: 1.6rem; text-align: center; margin-bottom: .75rem; }
.section-title.left { text-align: left; }
.section-lead { text-align: center; max-width: 42rem; margin: 0 auto 1.5rem; color: var(--ink-soft); }
.center { text-align: center; }
.hero-band { padding: 2rem 0 2.5rem; background: linear-gradient(180deg, var(--brand-tint), var(--paper)); }
.hero-grid { display: grid; gap: 1.5rem; align-items: center; grid-template-columns: minmax(0, 1fr); }
.hero-band h1 { font-size: 2.1rem; }
.hero-art { width: 100%; max-width: 26rem; height: auto; justify-self: center; }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.25rem 0 .5rem; }
.tiles { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.tiles h3, .steps h3 { margin-bottom: .35rem; }
.tiles p, .steps p { margin: 0; }
.audience { list-style: none; padding: 0; margin: 0 auto; max-width: 40rem; display: grid; gap: .5rem; }
.audience li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.steps .step-num { margin-bottom: .5rem; }
.split { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); align-items: center; }
.mock { max-width: 24rem; }
.mock-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin: 0 0 .5rem; }
.mock-note { margin: 0 0 .75rem; }
.mock .btn { cursor: default; }
.final-cta { background: var(--brand-tint); }
.narrow-wide { max-width: 48rem; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .6rem; padding: 0 1rem; }
.faq summary { cursor: pointer; font-weight: 700; padding: .85rem 0; min-height: 2.75rem; }
.faq details p { margin: 0 0 1rem; color: var(--ink-soft); }
@media (min-width: 720px) {
  .hero-band h1 { font-size: 3rem; }
  .hero-grid { grid-template-columns: 1.1fr .9fr; }
  .section-title { font-size: 2rem; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1000px) { .tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Pricing: the monthly/annual toggle is two radio buttons and CSS, so it works without JavaScript */
.billing-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.billing { position: relative; }
.billing-toggle { display: flex; width: fit-content; max-width: 100%; margin: 0 auto 1.25rem; border: 1px solid var(--ink-soft); border-radius: 999px; background: var(--surface); padding: .2rem; }
.billing-toggle label { cursor: pointer; padding: .5rem 1rem; border-radius: 999px; font-weight: 600; min-height: 2.5rem; display: inline-flex; align-items: center; gap: .4rem; }
.save { font-size: .75rem; background: var(--green-bg); color: var(--green); border-radius: 999px; padding: 0 .4rem; }
#bill-month:checked ~ .billing-toggle label[for=bill-month], #bill-year:checked ~ .billing-toggle label[for=bill-year] { background: var(--brand); color: #fff; }
#bill-year:checked ~ .billing-toggle label[for=bill-year] .save { background: #fff; }
.billing-input:focus-visible ~ .billing-toggle { outline: 3px solid #2d8cff; outline-offset: 2px; }
.price-year { display: none; }
#bill-year:checked ~ .plans .price-year { display: block; }
#bill-year:checked ~ .plans .price-month { display: none; }
.plans { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); align-items: stretch; }
@media (min-width: 800px) { .plans { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.plan { display: flex; flex-direction: column; position: relative; }
.plan.is-popular { border: 2px solid var(--brand); }
.plan-flag { align-self: flex-start; margin-bottom: .5rem; }
.plan h3 { margin-bottom: .1rem; font-size: 1.4rem; }
.plan-blurb { margin: 0 0 .75rem; }
.price { margin: 0; }
.price .amount { font-size: 2.2rem; font-weight: 800; }
.price .per { color: var(--ink-soft); margin-left: .2rem; }
.price-note { margin: .1rem 0 1rem; }
.plan-list { list-style: none; padding: 0; margin: 0 0 1.25rem; flex: 1; }
.plan-list li { display: flex; gap: .5rem; align-items: flex-start; padding: .25rem 0; }
.plan-list svg { flex: none; margin-top: .25rem; color: var(--green); }
.landing { overflow-x: clip; overflow-wrap: break-word; }
.billing-toggle { flex-wrap: wrap; justify-content: center; }

/* Requests, timeline, outbox */
.link-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.link-row form { margin: 0; }
.link-input { flex: 1 1 18rem; min-width: 0; font: inherit; font-size: .9rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); min-height: 2.75rem; }
.summary-title { cursor: pointer; font-weight: 600; color: var(--brand-dark); min-height: 2rem; }
.narrow-form { max-width: 28rem; margin-top: .75rem; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--line); }
.timeline li { padding: .35rem 0 .35rem .5rem; }
.timeline li span.muted { display: block; }
.email-body { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 0 0 1rem; }

/* Client upload portal */
.portal-header .logo { font-size: 1rem; }
.portal { max-width: 40rem; margin: 0 auto; }
.portal-firm { margin: 0; color: var(--ink-soft); font-weight: 600; }
.portal-progress { margin: 1rem 0; }
.portal-progress .progress { height: 1rem; }
.portal-banner { background: var(--amber-bg); border: 1px solid #e8cf8d; border-radius: var(--radius); padding: .75rem 1rem; margin: 1rem 0; }
.portal-banner-ok { background: var(--green-bg); border-color: #a9d9bb; }
.portal-item { padding: 1rem 0; }
.portal-rejected { background: var(--red-bg); color: var(--red); border: 1px solid #f0b4af; border-radius: var(--radius); padding: .6rem .8rem; margin: .6rem 0; font-weight: 600; }
.portal-files { margin: .5rem 0; padding-left: 1.1rem; overflow-wrap: anywhere; }
.portal-note-ok { color: var(--green); font-weight: 600; margin: .5rem 0; }
.portal-upload { margin-top: .75rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; }
.portal-upload input[type="file"] { width: 100%; font: inherit; padding: .5rem 0; }
.portal-na { margin-top: .75rem; }
.portal-na summary { cursor: pointer; color: var(--brand-dark); font-weight: 600; min-height: 2.75rem; display: flex; align-items: center; }
.portal-na form { margin-top: .5rem; }
.portal-help { margin-top: 2rem; text-align: center; }
.upload-status { margin-top: .5rem; font-weight: 600; }
.upload-status .progress { margin-top: .35rem; }
.upload-status.is-error { color: var(--red); }

/* Review, files, reminders, notifications */
.file-list { list-style: none; margin: .5rem 0 0; padding: 0; }
.file-list li { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: center; padding: .25rem 0; overflow-wrap: anywhere; }
.review-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: flex-start; margin-top: .6rem; }
.review-actions form { margin: 0; }
.reject-box { flex-basis: 100%; }
.reject-box summary { list-style: none; cursor: pointer; display: inline-block; }
.reject-box summary::-webkit-details-marker { display: none; }
.reject-box form { margin-top: .5rem; max-width: 36rem; }
.inline-snooze { display: inline-flex; gap: .4rem; align-items: center; }
.run-reminders { margin: 1rem 0; display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; align-items: center; padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: .5rem; }
.notif.is-unread { border-left: 4px solid var(--brand); background: var(--brand-tint); }
.notif-main { display: flex; flex-direction: column; gap: .2rem; align-items: flex-start; min-width: 0; overflow-wrap: anywhere; }
.notif form { margin: 0; }

/* Team, settings, reports, batch */
.plain-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.plain-fieldset legend { font-weight: 600; padding: 0; margin-bottom: .35rem; }
.plain-fieldset.has-error legend { color: var(--red); }
.tabs { max-width: 100%; flex-wrap: wrap; }
.tabs a { white-space: nowrap; }
.invite-row { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: center; justify-content: space-between; padding: .25rem 0; list-style: none; }
.inline-form select { width: auto; min-width: 7rem; }
.inline-form { display: inline-flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.schedule { padding-left: 1.25rem; margin: .5rem 0; }
.schedule li { padding: .2rem 0; }
.preview-form { grid-template-columns: 1fr; box-shadow: none; padding: 0; border: 0; background: none; }
.export-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.export-list .card { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; margin: 0; }
.export-list h3, .export-list p { margin: 0; }
.notice-mock { margin: 1rem 0; }
.bars { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .6rem; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) 2.5rem; gap: .2rem .75rem; align-items: center; }
.bar-label { grid-column: 1 / -1; overflow-wrap: anywhere; }
.bar-track { background: var(--grey-bg); border-radius: 999px; height: .75rem; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--brand); border-radius: 999px; min-width: 2px; }
.bar-value { font-weight: 700; text-align: right; }
@media (min-width: 720px) {
  .bars li { grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr) 3rem; }
  .bar-label { grid-column: auto; }
  .range-form { grid-template-columns: 1fr 1fr auto; }
}
.list-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; align-items: baseline; }
.list-bar p { margin: .5rem 0; }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 1.25rem 0; flex-wrap: wrap; }
.client-picks { list-style: none; padding: 0; margin: 0; max-height: 24rem; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: .25rem .75rem; }
.client-picks .field { margin: 0; }
.client-picks label { flex-wrap: wrap; }
.select-all { border-bottom: 1px solid var(--line); margin-bottom: .25rem; }

/* Phone pass (360px): nothing may force sideways scrolling, tap targets are at least 44px */
.main, .container { overflow-wrap: break-word; }
.segmented { flex-wrap: wrap; max-width: 100%; }
.segmented a { min-height: 2.75rem; }
img, svg, table, pre { max-width: 100%; }
.email-body, .notice p, .link-input { overflow-wrap: anywhere; }
@media (max-width: 719px) {
  .btn-sm { min-height: 2.75rem; padding: .55rem .9rem; }
  .inline-form select { min-width: 0; flex: 1 1 8rem; }
  .invite-row { align-items: flex-start; }
  .bars li { grid-template-columns: minmax(0, 1fr) 2.5rem; }
  .client-picks label { align-items: flex-start; }
  /* Stacked tables: the table must not size itself to the longest unbreakable value (long emails, names) */
  table.stack, table.stack tbody { display: block; width: 100%; }
  table.stack td { overflow-wrap: anywhere; min-width: 0; }
  table.stack td > * { min-width: 0; }
  /* Small links and disclosure toggles get a 44px tap row (inline links inside sentences are left alone) */
  .logo, .site-footer a, .trial-banner a, .main h3 > a { min-height: 2.75rem; display: inline-flex; align-items: center; }
  .summary-title, .item-edit summary { min-height: 2.75rem; display: flex; align-items: center; }
  .site-footer a { margin-left: 0; margin-right: 1rem; }
  .trial-banner .container { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .35rem; }
  .trial-banner a { margin-left: 0; }
  .main h3 > a { display: inline-flex; }
  .user-menu summary { min-height: 2.75rem; }
  input[type=file] { min-height: 2.75rem; max-width: 100%; }
  input[type=file]::file-selector-button { min-height: 2.25rem; padding: 0 .9rem; margin-right: .6rem; }
  label:has(> input[type=checkbox]) { display: flex; align-items: center; gap: .5rem; min-height: 2.75rem; }
}
