    :root {
      --bg: #f4f6f5;
      --surface: #ffffff;
      --surface-2: #eef3f0;
      --text: #17201c;
      --muted: #5f6f68;
      --primary: #216344;
      --primary-2: #174f62;
      --accent: #b65f24;
      --danger: #a93838;
      --warning: #8a6500;
      --border: #d9e2dd;
      --shadow: 0 8px 22px rgba(20, 37, 31, 0.08);
      --shell-max: 1760px;
      --shell-pad: clamp(12px, 2vw, 28px);
    }

    * { box-sizing: border-box; }
    [x-cloak] { display: none !important; }
    body {
      margin: 0;
      background: var(--bg);
      color: var(--text);
      font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
      line-height: 1.45;
    }
    a { color: var(--primary-2); }
    .topbar {
      position: sticky;
      top: 0;
      z-index: 10;
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      box-shadow: 0 1px 0 rgba(20, 37, 31, 0.03);
    }
    .topbar-inner {
      max-width: var(--shell-max);
      margin: 0 auto;
      padding: 12px var(--shell-pad);
      display: flex;
      align-items: center;
      gap: 18px;
      justify-content: space-between;
    }
    .brand {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      color: var(--text);
      font-weight: 800;
      text-decoration: none;
      white-space: nowrap;
    }
    .brand-mark {
      display: inline-grid;
      place-items: center;
      width: 28px;
      height: 28px;
      border: 1px solid rgba(33, 99, 68, 0.22);
      border-radius: 8px;
      background: var(--surface-2);
      color: var(--primary);
    }
    .brand-mark svg {
      width: 20px;
      height: 20px;
    }
    .topbar-search {
      display: flex;
      align-items: center;
      flex: 1 1 280px;
      max-width: 380px;
      min-width: 220px;
      gap: 6px;
      margin: 0;
    }
    .topbar-search input {
      width: 100%;
      min-height: 36px;
      padding: 7px 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fbfcfb;
      color: var(--text);
      font: inherit;
      line-height: 1.2;
    }
    .topbar-search input:focus {
      outline: none;
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(33, 99, 68, 0.12);
    }
    .topbar-search button {
      min-height: 36px;
      padding: 7px 10px;
      border: 1px solid var(--primary);
      border-radius: 8px;
      background: var(--primary);
      color: #fff;
      font: inherit;
      cursor: pointer;
      white-space: nowrap;
    }
    .organization-switcher {
      display: flex;
      align-items: center;
      margin: 0;
    }
    .organization-switcher select {
      width: auto;
      min-width: 150px;
      max-width: 220px;
      min-height: 34px;
      padding: 6px 28px 6px 9px;
      border-radius: 8px;
      font-size: 0.9rem;
      background-color: var(--surface);
    }
    .nav {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }
    .nav form { margin: 0; }
    .nav a,
    .nav button {
      appearance: none;
      display: inline-flex;
      align-items: center;
      gap: 7px;
      border: 1px solid transparent;
      background: transparent;
      color: var(--text);
      border-radius: 8px;
      padding: 8px 10px;
      text-decoration: none;
      font: inherit;
      line-height: 1.1;
      cursor: pointer;
    }
    .nav-icon {
      display: inline-grid;
      place-items: center;
      flex: 0 0 auto;
      width: 18px;
      height: 18px;
      color: currentColor;
    }
    .nav-icon svg,
    .nav-icon [data-lucide] {
      width: 17px;
      height: 17px;
      stroke-width: 2;
    }
    .nav-icon-fallback {
      display: inline-grid;
      place-items: center;
      width: 17px;
      height: 17px;
      border: 1px solid currentColor;
      border-radius: 999px;
      font-size: 0.72rem;
      font-weight: 800;
      line-height: 1;
    }
    .has-lucide .nav-icon-fallback {
      display: none;
    }
    .nav-icon-only {
      position: relative;
      width: 38px;
      min-width: 38px;
      height: 38px;
      padding: 0;
      justify-content: center;
    }
    .nav-icon-only .badge {
      position: absolute;
      top: -4px;
      right: -5px;
      min-width: 18px;
      min-height: 18px;
      justify-content: center;
      padding: 2px 5px;
      font-size: 0.68rem;
    }
    .nav-link-label,
    .nav-desktop-label,
    .nav-mobile-only {
      min-width: 0;
    }
    .nav-mobile-only {
      display: none;
    }
    .nav-org-name {
      max-width: 180px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .nav-account-label {
      display: inline-block;
      max-width: 130px;
      overflow: hidden;
      text-overflow: ellipsis;
      vertical-align: bottom;
      white-space: nowrap;
    }
    .nav a:hover,
    .nav button:hover:not([data-nav-menu-button]),
    .nav .active {
      background: var(--surface-2);
      border-color: var(--border);
      color: var(--primary);
    }
    .nav-menu {
      position: relative;
      display: inline-flex;
      align-items: center;
    }
    .nav-menu-panel {
      position: absolute;
      right: 0;
      top: calc(100% + 6px);
      z-index: 40;
      display: none;
      width: min(360px, calc(100vw - 24px));
      max-height: min(78vh, 640px);
      overflow-y: auto;
      padding: 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--surface);
      box-shadow: 0 18px 38px rgba(23, 32, 28, 0.16);
    }
    .nav-menu.is-open .nav-menu-panel {
      display: grid;
      gap: 10px;
    }
    .nav-menu.is-open > button {
      background: var(--surface-2);
      border-color: var(--border);
      color: var(--primary);
    }
    .nav-menu-panel a {
      display: grid;
      grid-template-columns: 22px minmax(0, 1fr);
      gap: 8px;
      align-items: start;
      width: 100%;
      padding: 8px 9px;
      border-radius: 6px;
      white-space: normal;
    }
    .nav-menu-panel form {
      width: 100%;
      margin: 0;
    }
    .nav-menu-panel form button {
      display: grid;
      grid-template-columns: 22px minmax(0, 1fr);
      gap: 8px;
      align-items: start;
      width: 100%;
      padding: 8px 9px;
      border-radius: 6px;
      text-align: left;
      white-space: normal;
    }
    .nav-menu-panel .nav-icon {
      margin-top: 1px;
      color: var(--primary-2);
    }
    .nav-menu-panel a > span:last-child,
    .nav-menu-panel form button > span:last-child {
      display: grid;
      gap: 2px;
      min-width: 0;
    }
    .nav-menu-panel strong {
      font-size: 0.9rem;
    }
    .nav-menu-panel span {
      color: var(--muted);
      font-size: 0.78rem;
      line-height: 1.25;
    }
    .nav-menu-panel strong {
      color: var(--text);
    }
    .nav-menu-section {
      display: grid;
      gap: 3px;
    }
    .nav-menu-section + .nav-menu-section {
      padding-top: 8px;
      border-top: 1px solid var(--border);
    }
    .nav-menu-heading {
      padding: 0 9px 3px;
      color: var(--muted);
      font-size: 0.72rem;
      font-weight: 800;
      text-transform: uppercase;
    }
    .mobile-nav-drawer {
      display: none;
    }
    .mobile-nav-trigger {
      width: 100%;
    }
    .mobile-nav-trigger-main,
    .mobile-nav-trigger-context {
      display: inline-flex;
      align-items: center;
      min-width: 0;
    }
    .mobile-nav-trigger-main {
      gap: 7px;
      font-weight: 800;
    }
    .mobile-nav-trigger-context {
      max-width: 42vw;
      overflow: hidden;
      color: var(--muted);
      font-size: 0.8rem;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .mobile-drawer-head {
      display: none;
    }
    .mobile-drawer-close {
      appearance: none;
      display: inline-grid;
      place-items: center;
      width: 34px;
      height: 34px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--surface);
      color: var(--text);
      cursor: pointer;
      font: inherit;
      line-height: 1;
    }
    .mobile-drawer-close:hover {
      border-color: var(--primary);
      background: var(--surface-2);
      color: var(--primary);
    }
    .mobile-workspace-card {
      display: none;
    }
    .mobile-nav-group {
      border-top: 1px solid var(--border);
    }
    .mobile-nav-group summary {
      display: grid;
      grid-template-columns: 22px minmax(0, 1fr) auto;
      gap: 8px;
      align-items: center;
      padding: 10px 9px;
      border-radius: 6px;
      color: var(--text);
      cursor: pointer;
      list-style: none;
    }
    .mobile-nav-group summary::-webkit-details-marker {
      display: none;
    }
    .mobile-nav-group summary:hover {
      background: var(--surface-2);
      color: var(--primary);
    }
    .mobile-nav-group summary > span:nth-child(2) {
      display: grid;
      gap: 2px;
      min-width: 0;
    }
    .mobile-nav-group summary strong {
      font-size: 0.9rem;
    }
    .mobile-nav-group summary small {
      color: var(--muted);
      font-size: 0.78rem;
      line-height: 1.25;
    }
    .mobile-nav-group-chevron {
      color: var(--muted);
      transition: transform 140ms ease;
    }
    .mobile-nav-group[open] .mobile-nav-group-chevron {
      transform: rotate(180deg);
    }
    .mobile-nav-group-body {
      padding: 0 0 8px;
    }
    .account-organization-summary {
      display: grid;
      gap: 3px;
      padding: 8px 9px;
      border: 1px solid var(--border);
      border-radius: 6px;
      background: #fbfcfb;
    }
    .account-organization-summary strong {
      font-size: 0.9rem;
    }
    .account-organization-summary span {
      color: var(--muted);
      font-size: 0.78rem;
      line-height: 1.25;
    }
    .account-organization-switcher {
      display: grid;
      gap: 6px;
      padding: 8px 9px;
      border: 1px solid var(--border);
      border-radius: 6px;
      background: #fbfcfb;
    }
    .account-organization-switcher select {
      width: 100%;
      max-width: none;
    }
    .page-loader {
      position: fixed;
      inset: 0;
      z-index: 120;
      display: none;
      align-items: center;
      justify-content: center;
      background: rgba(244, 246, 245, 0.62);
      backdrop-filter: blur(1px);
      pointer-events: auto;
    }
    body.page-loading .page-loader {
      display: flex;
    }
    .page-loader.htmx-request {
      display: flex;
    }
    .page-loader-inner {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      min-width: 132px;
      min-height: 52px;
      padding: 10px 14px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--surface);
      box-shadow: 0 18px 42px rgba(23, 32, 28, 0.18);
    }
    .page-loader-spinner {
      width: 24px;
      height: 24px;
      border: 3px solid var(--border);
      border-top-color: var(--primary);
      border-radius: 999px;
      animation: spin 0.75s linear infinite;
    }
    .page-loader-text {
      color: var(--text);
      font-size: 0.9rem;
      font-weight: 800;
    }
    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }
    .browser-autofill-decoy {
      display: none !important;
    }
    @keyframes spin {
      to { transform: rotate(360deg); }
    }
    .layout {
      max-width: var(--shell-max);
      margin: 0 auto;
      padding: 24px var(--shell-pad) 52px;
    }
    .page-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 20px;
    }
    .page-head > div:first-child:not(.page-title) {
      display: grid;
      gap: 8px;
      min-width: 0;
    }
    .page-head.compact-head {
      align-items: center;
      margin-bottom: 12px;
    }
    .page-head.compact-head > div:first-child:not(.page-title) {
      gap: 4px;
    }
    .page-head h2,
    .page-head h3 {
      margin-bottom: 0;
    }
    .page-title {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }
    .page-title h1,
    .page-title h2,
    .page-title h3 {
      min-width: 0;
      margin-bottom: 0;
    }
    .panel > .page-title {
      margin-bottom: 12px;
    }
    .page-title-icon,
    .metric-icon,
    .button-icon {
      display: inline-grid;
      place-items: center;
      flex: 0 0 auto;
      color: currentColor;
    }
    .page-title-icon {
      width: 34px;
      height: 34px;
      border: 1px solid rgba(33, 99, 68, 0.18);
      border-radius: 8px;
      background: #eff6f2;
      color: var(--primary);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
    }
    .page-title-icon [data-lucide],
    .page-title-icon svg {
      width: 20px;
      height: 20px;
    }
    h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: 0; }
    h1 { font-size: clamp(1.55rem, 1.2rem + 1vw, 2.2rem); }
    h2 { font-size: 1.05rem; margin-bottom: 10px; }
    h3 { font-size: 0.95rem; margin-bottom: 8px; }
    .subtle {
      color: var(--muted);
      margin-block: 0;
    }
    .stack { display: grid; gap: 16px; }
    .grid {
      display: grid;
      gap: 16px;
    }
    .grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
    .grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
    .grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
    .dashboard-metrics {
      margin-bottom: 18px;
    }
    .dashboard-layout {
      display: grid;
      grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
      gap: 18px;
      align-items: start;
    }
    .dashboard-main,
    .dashboard-sidebar {
      min-width: 0;
    }
    .panel,
    .metric {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 8px;
      box-shadow: var(--shadow);
    }
    .panel {
      padding: 16px;
      overflow: hidden;
    }
    .metric { padding: 15px; min-height: 106px; }
    .metric {
      display: grid;
      gap: 8px;
      color: var(--text);
      text-decoration: none;
      transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
    }
    .metric-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }
    .metric-icon {
      width: 30px;
      height: 30px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #f4f8fc;
      color: var(--primary-2);
    }
    .metric-icon [data-lucide],
    .metric-icon svg {
      width: 17px;
      height: 17px;
    }
    .metric .label {
      color: var(--muted);
      font-size: 0.8rem;
      font-weight: 800;
      letter-spacing: 0.02em;
      text-transform: uppercase;
    }
    .metric .value {
      font-size: 1.8rem;
      font-weight: 800;
      margin-top: 2px;
      overflow-wrap: anywhere;
    }
    a.metric:hover {
      border-color: rgba(33, 99, 68, 0.45);
      box-shadow: 0 12px 28px rgba(20, 37, 31, 0.12);
      transform: translateY(-1px);
    }
    .module-card {
      display: grid;
      gap: 14px;
      min-height: 168px;
      padding: 16px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--surface);
      box-shadow: var(--shadow);
      color: var(--text);
      text-decoration: none;
      transition: border-color 160ms ease, box-shadow 160ms ease;
    }
    .module-card-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
    }
    .module-card:hover {
      border-color: rgba(33, 99, 68, 0.36);
      box-shadow: 0 12px 28px rgba(20, 37, 31, 0.12);
    }
    .link-list {
      display: grid;
      gap: 8px;
    }
    .link-list a {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 12px;
      padding: 9px 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fbfcfb;
      color: var(--text);
      text-decoration: none;
      transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
    }
    .link-list strong,
    .link-list span {
      min-width: 0;
    }
    .link-list a:hover {
      border-color: var(--primary);
      background: var(--surface-2);
      box-shadow: 0 6px 14px rgba(20, 37, 31, 0.07);
    }
    .link-list span {
      color: var(--muted);
      font-size: 0.8rem;
      text-align: right;
    }
    .search-panel {
      display: grid;
      gap: 16px;
    }
    .search-toolbar {
      display: flex;
      align-items: end;
      gap: 10px;
      padding: 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fbfcfb;
    }
    .search-field {
      display: grid;
      flex: 1 1 520px;
      gap: 6px;
      max-width: 760px;
      min-width: 0;
    }
    .search-input-wrap {
      position: relative;
    }
    .search-input-icon {
      position: absolute;
      top: 50%;
      left: 12px;
      display: inline-grid;
      place-items: center;
      width: 18px;
      height: 18px;
      color: var(--muted);
      transform: translateY(-50%);
      pointer-events: none;
    }
    .search-input-icon [data-lucide],
    .search-input-icon svg {
      width: 17px;
      height: 17px;
    }
    .search-input-wrap input {
      width: 100%;
      min-height: 44px;
      padding-left: 38px;
    }
    .search-results {
      display: grid;
      gap: 14px;
    }
    .search-summary {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      align-items: baseline;
      color: var(--muted);
    }
    .search-summary strong {
      color: var(--text);
    }
    .search-results-stack {
      display: grid;
      gap: 16px;
      margin-top: 0;
    }
    .search-group {
      display: grid;
      gap: 10px;
    }
    .search-group-head {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .search-group-head h2 {
      margin-bottom: 0;
    }
    .search-group-head .metric-icon {
      width: 28px;
      height: 28px;
    }
    .search-result-list {
      display: grid;
      gap: 8px;
    }
    .search-result-row {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) auto;
      align-items: center;
      gap: 10px;
      min-height: 58px;
      padding: 10px 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fbfcfb;
      color: var(--text);
      text-decoration: none;
      transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
    }
    .search-result-row:hover {
      border-color: var(--primary);
      background: var(--surface-2);
      box-shadow: 0 6px 14px rgba(20, 37, 31, 0.07);
    }
    .search-result-icon {
      display: inline-grid;
      place-items: center;
      width: 28px;
      height: 28px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--surface-2);
      color: var(--primary-2);
    }
    .search-result-icon [data-lucide],
    .search-result-icon svg {
      width: 16px;
      height: 16px;
    }
    .search-result-main {
      display: grid;
      gap: 3px;
      min-width: 0;
      text-align: left;
    }
    .search-result-main strong,
    .search-result-main span {
      min-width: 0;
      overflow-wrap: anywhere;
      text-align: left;
    }
    .search-result-main span {
      color: var(--muted);
      font-size: 0.82rem;
    }
    .search-result-row .badge {
      justify-self: end;
    }
    .toolbar {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      align-items: end;
      margin-bottom: 14px;
      padding: 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fbfcfb;
    }
    .inline-add-form {
      margin: 14px 0 0;
      padding-top: 14px;
      border-top: 1px solid var(--border);
    }
    .storage-summary-strip {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 10px 14px;
      margin-bottom: 12px;
      padding: 10px 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fbfcfb;
    }
    .storage-summary-main {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }
    .storage-summary-main strong {
      display: block;
      margin-bottom: 2px;
    }
    .storage-summary-main .subtle {
      overflow-wrap: anywhere;
    }
    .storage-summary-meta {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      gap: 6px;
    }
    .storage-summary-note {
      grid-column: 1 / -1;
      padding-top: 8px;
      border-top: 1px solid var(--border);
    }
    .summary-strip {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 12px;
    }
    .summary-strip span {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      min-height: 30px;
      padding: 4px 9px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fbfcfb;
      color: var(--muted);
      font-size: 0.84rem;
    }
    .summary-strip strong {
      color: var(--text);
    }
    .top-add-form {
      margin: 10px 0 14px;
      padding: 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fbfcfb;
    }
    .toolbar .field { min-width: 190px; flex: 1 1 190px; }
    .sticky-list-panel .toolbar .field {
      flex: 0 1 280px;
    }
    .sticky-list-panel .toolbar .field:first-child {
      flex-basis: 340px;
    }
    .toolbar .check-field {
      flex: 0 0 auto;
      min-width: 110px;
    }
    .advanced-filters {
      min-width: 0;
      margin: 0 0 12px;
    }
    .advanced-filters > summary,
    .bulk-actions > summary {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      min-height: 36px;
      padding: 7px 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--surface);
      list-style: none;
      user-select: none;
    }
    .advanced-filters > summary::-webkit-details-marker,
    .bulk-actions > summary::-webkit-details-marker {
      display: none;
    }
    .advanced-filters > summary::before,
    .bulk-actions > summary::before {
      content: "+";
      width: 16px;
      color: var(--muted);
      font-size: 1rem;
      line-height: 1;
      text-align: center;
    }
    .advanced-filters[open] > summary::before,
    .bulk-actions[open] > summary::before {
      content: "−";
    }
    .advanced-filter-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 10px;
      align-items: end;
      margin-top: 10px;
      padding: 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fbfcfb;
    }
    .advanced-filter-grid .field {
      min-width: 0;
      width: 100%;
    }
    .bulk-actions {
      margin: 0 0 12px;
    }
    .bulk-actions > summary {
      background: #fbfcfb;
    }
    .bulk-actions .toolbar,
    .sticky-list-panel .bulk-actions .toolbar {
      position: static;
      margin: 10px 0 0;
      box-shadow: none;
    }
    .button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 38px;
      gap: 8px;
      padding: 8px 12px;
      border-radius: 8px;
      border: 1px solid var(--primary);
      background: var(--primary);
      color: #fff;
      text-decoration: none;
      font: inherit;
      cursor: pointer;
      white-space: nowrap;
      transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
    }
    .button:hover {
      background: #174f35;
      border-color: #174f35;
      box-shadow: 0 8px 18px rgba(33, 99, 68, 0.16);
      transform: translateY(-1px);
    }
    .button.secondary {
      background: var(--surface);
      color: var(--primary);
    }
    .button.secondary:hover {
      background: var(--surface-2);
      border-color: var(--primary);
      box-shadow: 0 8px 18px rgba(20, 37, 31, 0.08);
    }
    .button.warning {
      border-color: var(--accent);
      background: var(--accent);
    }
    .button.danger {
      border-color: var(--danger);
      background: var(--danger);
    }
    .button.compact {
      min-height: 30px;
      padding: 5px 8px;
      font-size: 0.86rem;
    }
    .button-icon {
      width: 17px;
      height: 17px;
    }
    .button-icon [data-lucide],
    .button-icon svg {
      width: 16px;
      height: 16px;
      stroke-width: 2.2;
    }
    .count-button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 32px;
      min-height: 28px;
      padding: 3px 8px;
      border: 1px solid var(--border);
      border-radius: 999px;
      background: var(--surface-2);
      color: var(--primary-2);
      font: inherit;
      font-size: 0.86rem;
      font-weight: 800;
      line-height: 1;
      cursor: pointer;
    }
    .count-button:hover {
      border-color: var(--primary);
      background: #fff;
    }
    table {
      width: 100%;
      border-collapse: collapse;
      background: var(--surface);
    }
    th, td {
      border-bottom: 1px solid var(--border);
      padding: 10px 9px;
      text-align: left;
      vertical-align: top;
    }
    th {
      color: var(--muted);
      font-size: 0.78rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0;
    }
    table > tbody:last-child tr:last-child td { border-bottom: 0; }
    tbody tr {
      transition: background 120ms ease;
    }
    tbody tr:hover {
      background: #fbfcfb;
    }
    .table-wrap {
      overflow-x: auto;
      border-radius: 8px;
    }
    [data-billing-line-editor] .table-wrap {
      overflow: visible;
    }
    [data-billing-line-editor].panel {
      position: relative;
      z-index: 2;
      overflow: visible;
    }
    .sticky-list-panel {
      overflow: visible;
    }
    .sticky-list-panel .table-wrap {
      max-height: calc(100vh - 230px);
      overflow: auto;
      scrollbar-gutter: stable;
      border: 1px solid var(--border);
    }
    .sticky-list-panel .toolbar {
      position: sticky;
      top: 64px;
      z-index: 8;
      margin: -4px 0 14px;
      background: var(--surface);
      border: 1px solid var(--border);
      box-shadow: 0 8px 14px rgba(20, 37, 31, 0.04);
    }
    .sticky-table {
      border-collapse: separate;
      border-spacing: 0;
    }
    .sticky-table thead th {
      position: sticky;
      top: 0;
      z-index: 3;
      background: var(--surface);
      box-shadow: 0 1px 0 var(--border);
    }
    .badge {
      display: inline-flex;
      align-items: center;
      border-radius: 999px;
      padding: 3px 8px;
      background: var(--surface-2);
      color: var(--text);
      font-size: 0.78rem;
      white-space: nowrap;
    }
    .badge.danger { background: #f6e4e4; color: var(--danger); }
    .badge.warning { background: #fff1cc; color: var(--warning); }
    .badge.ok { background: #e1f0e7; color: var(--primary); }
    .badge.rating-regular { background: #e1f0e7; color: #1b6a43; }
    .badge.rating-high_value { background: #dbeafe; color: #1e4f91; }
    .badge.rating-occasional { background: #fff1cc; color: #7b5800; }
    .badge.rating-not_active { background: #eceff1; color: #596861; }
    .badge.status-active { background: #e1f0e7; color: #1b6a43; }
    .badge.status-follow_up { background: #fff1cc; color: #7b5800; }
    .badge.status-quiet { background: #e7edf6; color: #335985; }
    .badge.status-data_check { background: #e6f4f1; color: #12605a; }
    .badge.status-inactive { background: #eceff1; color: #596861; }
    .badge.follow-up-due { background: #f6e4e4; color: var(--danger); }
    .badge.follow-up-set { background: #e1f0e7; color: var(--primary); }
    .email-pill-list {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      align-items: center;
      max-width: 100%;
    }
    .email-pill {
      display: inline-flex;
      align-items: center;
      min-width: 0;
      max-width: 100%;
      padding: 3px 8px;
      border: 1px solid var(--border);
      border-radius: 999px;
      background: var(--surface-2);
      color: var(--muted);
      font-size: 0.78rem;
      line-height: 1.25;
      text-decoration: none;
    }
    .email-pill.primary {
      border-color: #b9d8c6;
      background: #e1f0e7;
      color: #1b6a43;
      font-weight: 800;
    }
    .email-pill span {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .assignee-pill-list {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      align-items: center;
      margin-top: 4px;
    }
    .assignee-pill {
      display: inline-flex;
      align-items: center;
      min-width: 0;
      max-width: 100%;
      padding: 3px 8px;
      border: 1px solid #bfd2e8;
      border-radius: 999px;
      background: #f4f8fc;
      color: var(--primary-2);
      font-size: 0.78rem;
      line-height: 1.25;
    }
    .assignee-pill span {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .product-pill-list {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }
    .product-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      max-width: 100%;
      padding: 6px 9px;
      border: 1px solid #bfd2e8;
      border-radius: 8px;
      background: #f4f8fc;
      color: var(--primary-2);
      font-size: 0.86rem;
      line-height: 1.25;
    }
    .product-pill.compact {
      padding: 4px 7px;
      font-size: 0.8rem;
    }
    .product-pill span {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .recipient-picker {
      display: grid;
      gap: 12px;
      padding: 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fbfcfb;
    }
    .recipient-picker-section {
      display: grid;
      gap: 6px;
    }
    .recipient-picker-label {
      color: var(--muted);
      font-size: 0.76rem;
      font-weight: 900;
      letter-spacing: 0;
      text-transform: uppercase;
    }
    .recipient-picker-selected,
    .recipient-picker-options {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      align-items: center;
      min-height: 28px;
    }
    .recipient-picker-selected {
      padding: 8px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--surface);
    }
    .recipient-picker-empty {
      color: var(--muted);
      font-size: 0.86rem;
    }
    .recipient-pill,
    .recipient-option {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      max-width: 100%;
      min-width: 0;
      padding: 5px 8px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--surface);
      color: var(--primary);
      font-size: 0.86rem;
      line-height: 1.25;
    }
    .recipient-option {
      cursor: pointer;
    }
    .recipient-pill.is-main {
      border-color: #a8d8c1;
      background: #eef8f2;
      color: var(--primary);
      font-weight: 800;
    }
    .recipient-pill.is-copy {
      border-color: #bfd2e8;
      background: #f4f8fc;
      color: var(--primary-2);
    }
    .recipient-role {
      flex: 0 0 auto;
      padding: 1px 5px;
      border-radius: 999px;
      background: rgba(33, 99, 68, 0.10);
      color: var(--muted);
      font-size: 0.68rem;
      font-weight: 900;
      text-transform: uppercase;
    }
    .recipient-option:hover,
    .recipient-option:focus {
      border-color: var(--primary);
      background: var(--surface-2);
    }
    .recipient-pill span,
    .recipient-option span {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .recipient-pill button {
      border: 0;
      background: transparent;
      color: var(--danger);
      cursor: pointer;
      font: inherit;
      font-weight: 900;
      padding: 0 2px;
    }
    .recipient-picker-add {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      align-items: center;
    }
    .recipient-picker-add-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      justify-content: flex-end;
    }
    .billing-add-customer-email {
      margin-top: 8px;
      padding: 7px 8px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--surface-2);
      font-size: 0.9rem;
    }
    .billing-customer-create-prompt {
      display: flex;
      gap: 12px;
      align-items: center;
      justify-content: space-between;
      padding: 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--surface-2);
    }
    .billing-customer-create-prompt p {
      margin: 2px 0 0;
      color: var(--muted);
      font-size: 0.88rem;
    }
    .billing-customer-status {
      display: none;
      align-items: center;
      gap: 6px;
      margin-top: 6px;
      color: var(--muted);
      font-size: 0.78rem;
      line-height: 1.25;
    }
    .billing-customer-status.is-visible {
      display: flex;
    }
    .billing-customer-status.is-valid {
      color: var(--primary);
    }
    .billing-customer-status.is-warning {
      color: var(--warning);
      font-weight: 700;
    }
    .billing-customer-field-needs-selection {
      padding: 10px;
      border: 1px solid #f0c5bd;
      border-radius: 8px;
      background: #fff8f6;
      box-shadow: inset 3px 0 0 var(--danger);
    }
    .billing-customer-field-needs-selection [name="customer_name"] {
      border-color: #dda3a3;
      background: #fffafa;
    }
    .field-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }
    .messages {
      position: fixed;
      top: 74px;
      right: 18px;
      z-index: 140;
      display: grid;
      gap: 10px;
      width: min(420px, calc(100vw - 36px));
      pointer-events: none;
    }
    .message {
      display: flex;
      gap: 10px;
      align-items: flex-start;
      border: 1px solid #b9d8c6;
      border-left: 5px solid var(--primary);
      background: var(--surface);
      border-radius: 8px;
      box-shadow: 0 16px 36px rgba(23, 32, 28, 0.18);
      padding: 12px 14px;
      pointer-events: auto;
      animation: toast-in 160ms ease-out, toast-auto-dismiss 200ms ease-in 3s forwards;
    }
    .message.success {
      border-color: #b9d8c6;
      border-left-color: var(--primary);
      background: #f3fbf6;
    }
    .message.error {
      border-color: #e3b9b9;
      border-left-color: var(--danger);
      background: #fff6f6;
    }
    .message.warning {
      border-color: #eedba8;
      border-left-color: var(--warning);
      background: #fffaf0;
    }
    .message.info {
      border-color: #bfd2e8;
      border-left-color: var(--primary-2);
      background: #f4f8fc;
    }
    .message.is-dismissing {
      opacity: 0;
      transform: translateY(-8px);
      transition: opacity 180ms ease, transform 180ms ease;
    }
    .message-text {
      flex: 1 1 auto;
      min-width: 0;
      font-weight: 700;
    }
    .message-close {
      display: inline-grid;
      place-items: center;
      width: 24px;
      height: 24px;
      border: 1px solid transparent;
      border-radius: 999px;
      background: transparent;
      color: var(--muted);
      cursor: pointer;
      font: inherit;
      line-height: 1;
    }
    .message-close:hover {
      border-color: var(--border);
      background: #fff;
      color: var(--text);
    }
    .hijack-banner {
      position: sticky;
      top: 0;
      z-index: 115;
      background: #fff1cc;
      border-bottom: 1px solid #e0c06f;
      color: #3f2f00;
      box-shadow: 0 8px 18px rgba(63, 47, 0, 0.12);
    }
    .hijack-banner-inner {
      max-width: var(--shell-max);
      margin: 0 auto;
      padding: 10px var(--shell-pad);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }
    .hijack-banner strong {
      font-weight: 900;
    }
    .hijack-banner form {
      margin: 0;
      flex: 0 0 auto;
    }
    .hijack-release {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 32px;
      padding: 6px 10px;
      border: 1px solid #8a6500;
      border-radius: 8px;
      background: #ffffff;
      color: #3f2f00;
      font: inherit;
      font-weight: 800;
      cursor: pointer;
      white-space: nowrap;
    }
    .hijack-release:hover {
      background: #fbf5e0;
    }
    body.has-role-preview-banner .layout {
      padding-bottom: 98px;
    }
    .role-preview-banner {
      position: fixed;
      right: var(--shell-pad);
      bottom: 14px;
      left: var(--shell-pad);
      z-index: 70;
      color: var(--primary);
      pointer-events: none;
    }
    .role-preview-banner-inner {
      max-width: var(--shell-max);
      margin: 0 auto;
      padding: 10px 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      border: 1px solid #b9d8c6;
      border-radius: 8px;
      background: #f5fbf7;
      box-shadow: 0 8px 22px rgba(20, 37, 31, 0.12);
      pointer-events: auto;
    }
    .role-preview-banner strong {
      color: var(--text);
      font-weight: 900;
    }
    .role-preview-banner span {
      color: var(--muted);
    }
    .role-preview-banner form {
      margin: 0;
      flex: 0 0 auto;
    }
    @keyframes toast-in {
      from {
        opacity: 0;
        transform: translateY(-8px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
    @keyframes toast-auto-dismiss {
      to {
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        pointer-events: none;
      }
    }
    form .fields {
      display: grid;
      gap: 14px;
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    form .field {
      position: relative;
    }
    form .field.full { grid-column: 1 / -1; }
    .settings-layout {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
      gap: 14px;
      align-items: start;
    }
    .settings-form {
      display: grid;
      gap: 18px;
    }
    .settings-section {
      display: grid;
      gap: 12px;
      padding-bottom: 18px;
      border-bottom: 1px solid var(--border);
    }
    .settings-section:last-of-type {
      padding-bottom: 0;
      border-bottom: 0;
    }
    .settings-section-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }
    .settings-section-head h2 {
      margin-bottom: 0;
    }
    .settings-note {
      margin: 0;
      color: var(--muted);
      font-size: 0.86rem;
    }
    .settings-status-list {
      display: grid;
      gap: 10px;
      margin: 0 0 14px;
    }
    .settings-status-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding-bottom: 10px;
      border-bottom: 1px solid var(--border);
    }
    .settings-status-row:last-child {
      padding-bottom: 0;
      border-bottom: 0;
    }
    .settings-status-row span:first-child {
      color: var(--muted);
      font-size: 0.82rem;
      font-weight: 700;
    }
    .password-field-row {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .password-field-row input {
      min-width: 0;
      flex: 1 1 auto;
    }
    label {
      display: block;
      color: var(--muted);
      font-size: 0.82rem;
      margin-bottom: 5px;
    }
    input, select, textarea {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fff;
      color: var(--text);
      font: inherit;
      padding: 9px 10px;
      min-height: 38px;
    }
    input:not([type="checkbox"]):not([type="radio"]),
    select {
      height: 42px;
    }
    input[type="checkbox"],
    input[type="radio"] {
      width: 18px;
      height: 18px;
      min-height: 0;
      padding: 0;
      accent-color: var(--primary);
    }
    .checkbox-row {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-height: 42px;
      margin: 0;
      color: var(--text);
    }
    .checkbox-row input {
      width: auto;
      min-height: 0;
    }
    .check-list {
      display: grid;
      gap: 8px;
      margin-top: 6px;
    }
    .check-list-row {
      display: flex;
      align-items: center;
      gap: 10px;
      min-height: 42px;
      margin: 0;
      padding: 9px 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fbfcfb;
      color: var(--text);
      font-size: 0.9rem;
      cursor: pointer;
    }
    .check-list-row:hover {
      border-color: var(--primary);
      background: var(--surface-2);
    }
    .check-list-row input {
      width: auto;
      min-height: 0;
    }
    .assignment-picker {
      display: grid;
      gap: 6px;
    }
    input:focus,
    select:focus,
    textarea:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(33, 99, 68, 0.12);
      outline: none;
    }
    .date-control {
      max-width: 260px;
      font-variant-numeric: tabular-nums;
    }
    .datetime-control {
      max-width: 320px;
    }
    .customer-table .date-control {
      max-width: 100%;
    }
    .flatpickr-calendar {
      width: 318px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fff;
      box-shadow: 0 18px 42px rgba(23, 32, 28, 0.2);
      color: var(--text);
      font: inherit;
      overflow: hidden;
    }
    .flatpickr-months,
    .flatpickr-weekdays {
      background: var(--surface);
    }
    .flatpickr-months {
      min-height: 58px;
      padding: 0 12px;
    }
    .flatpickr-months .flatpickr-month {
      height: 58px;
      line-height: normal;
      overflow: visible;
    }
    .flatpickr-months .flatpickr-prev-month,
    .flatpickr-months .flatpickr-next-month {
      top: 12px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 34px;
      height: 34px;
      padding: 8px;
      border: 1px solid var(--border);
      border-radius: 8px;
      color: var(--primary-2);
    }
    .flatpickr-months .flatpickr-prev-month.flatpickr-prev-month {
      left: 12px;
    }
    .flatpickr-months .flatpickr-next-month.flatpickr-next-month {
      right: 12px;
    }
    .flatpickr-months .flatpickr-prev-month svg,
    .flatpickr-months .flatpickr-next-month svg {
      width: 13px;
      height: 13px;
      fill: currentColor;
    }
    .flatpickr-months .flatpickr-prev-month:hover,
    .flatpickr-months .flatpickr-next-month:hover {
      border-color: var(--primary);
      background: var(--surface-2);
    }
    .flatpickr-months .flatpickr-prev-month:hover svg,
    .flatpickr-months .flatpickr-next-month:hover svg {
      fill: var(--primary);
    }
    .flatpickr-current-month {
      top: 12px;
      left: 52px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      width: calc(100% - 104px);
      height: 34px;
      padding: 0;
      font-size: 1rem;
      line-height: normal;
      overflow: visible;
    }
    .flatpickr-current-month .flatpickr-monthDropdown-months,
    .flatpickr-current-month input.cur-year {
      font: inherit;
      font-weight: 800;
      height: 34px;
      line-height: 20px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fff;
      color: var(--text);
      padding: 4px 8px;
    }
    .flatpickr-current-month .flatpickr-monthDropdown-months {
      flex: 1 1 auto;
      min-width: 0;
      max-width: 124px;
      margin: 0;
      text-align: center;
    }
    .flatpickr-current-month .numInputWrapper {
      flex: 0 0 76px;
      width: 76px;
      height: 34px;
      overflow: visible;
    }
    .flatpickr-current-month input.cur-year {
      width: 100%;
      text-align: center;
    }
    .flatpickr-current-month .flatpickr-monthDropdown-months:hover,
    .flatpickr-current-month input.cur-year:hover {
      border-color: var(--primary);
    }
    .flatpickr-current-month .flatpickr-monthDropdown-months:focus,
    .flatpickr-current-month input.cur-year:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(33, 99, 68, 0.12);
      outline: none;
    }
    .numInputWrapper span {
      display: none;
    }
    .flatpickr-weekdays {
      height: 34px;
      border-top: 1px solid var(--border);
      border-bottom: 1px solid var(--border);
    }
    span.flatpickr-weekday {
      color: var(--muted);
      font-size: 0.74rem;
      font-weight: 800;
      text-transform: uppercase;
    }
    .flatpickr-days {
      width: 318px;
      padding: 8px 12px 12px;
    }
    .dayContainer {
      gap: 3px;
      justify-content: center;
      min-width: 294px;
      max-width: 294px;
      padding: 0;
    }
    .flatpickr-day {
      width: 39px;
      max-width: 39px;
      height: 36px;
      line-height: 36px;
      border-radius: 8px;
      color: var(--text);
      font-weight: 600;
    }
    .flatpickr-day.today {
      border-color: #bfd2e8;
      background: #f4f8fc;
      color: var(--primary-2);
    }
    .flatpickr-day.selected,
    .flatpickr-day.startRange,
    .flatpickr-day.endRange {
      border-color: var(--primary);
      background: var(--primary);
      color: #fff;
    }
    .flatpickr-day:hover,
    .flatpickr-day:focus {
      border-color: var(--primary);
      background: var(--surface-2);
    }
    .flatpickr-day.flatpickr-disabled,
    .flatpickr-day.prevMonthDay,
    .flatpickr-day.nextMonthDay {
      color: #9aa8a1;
      font-weight: 400;
    }
    .flatpickr-time {
      height: 48px;
      max-height: 48px;
      border-top: 1px solid var(--border);
      background: var(--surface);
    }
    .flatpickr-time input,
    .flatpickr-time .flatpickr-am-pm {
      height: 36px;
      min-height: 0;
      border: 1px solid transparent;
      border-radius: 8px;
      background: transparent;
      color: var(--text);
      font: inherit;
      font-weight: 800;
      line-height: 1.2;
    }
    .flatpickr-time input:hover,
    .flatpickr-time input:focus,
    .flatpickr-time .flatpickr-am-pm:hover,
    .flatpickr-time .flatpickr-am-pm:focus {
      border-color: var(--primary);
      background: #fff;
      box-shadow: none;
      outline: none;
    }
    .flatpickr-actions {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
      padding: 8px 10px;
      border-top: 1px solid var(--border);
      background: var(--surface);
    }
    .flatpickr-done {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 34px;
      min-width: 72px;
      padding: 6px 12px;
      border: 1px solid var(--primary);
      border-radius: 8px;
      background: var(--primary);
      color: #fff;
      font: inherit;
      font-weight: 800;
      cursor: pointer;
    }
    .flatpickr-done:hover,
    .flatpickr-done:focus {
      background: #174f35;
      outline: none;
    }
    .flatpickr-calendar.arrowTop:before {
      border-bottom-color: var(--border);
    }
    .flatpickr-calendar.arrowTop:after {
      border-bottom-color: var(--surface);
    }
    .help-text {
      color: var(--muted);
      font-size: 0.78rem;
      margin-top: 5px;
    }
    .selected-file-list {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 8px;
      padding: 0;
    }
    .selected-file-summary {
      display: flex;
      flex-wrap: wrap;
      flex: 1 0 100%;
      gap: 6px 10px;
      align-items: baseline;
      justify-content: flex-start;
      padding-inline: 2px;
      color: var(--muted);
      font-size: 0.78rem;
    }
    .selected-file-summary strong {
      color: var(--text);
      font-size: 0.84rem;
    }
    .selected-file-row {
      display: grid;
      grid-template-columns: 28px minmax(0, 1fr) 28px;
      flex: 1 1 240px;
      gap: 7px;
      align-items: center;
      min-height: 36px;
      max-width: 100%;
      padding: 4px 6px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fbfcfb;
      color: var(--text);
      font-size: 0.84rem;
    }
    .selected-file-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 24px;
      height: 24px;
      border: 1px solid rgba(33, 99, 68, 0.14);
      border-radius: 6px;
      background: var(--surface-2);
      color: var(--primary);
      font-size: 0.56rem;
      font-weight: 900;
      text-transform: uppercase;
    }
    .selected-file-main {
      display: grid;
      gap: 2px;
      min-width: 0;
    }
    .selected-file-main strong {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .selected-file-main span {
      color: var(--muted);
      font-size: 0.74rem;
    }
    .selected-file-remove {
      display: inline-grid;
      place-items: center;
      width: 26px;
      min-height: 26px;
      padding: 0;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fff;
      color: var(--danger);
      font: inherit;
      font-size: 0.86rem;
      font-weight: 800;
      line-height: 1;
      cursor: pointer;
    }
    .selected-file-remove:hover {
      border-color: #e4bcbc;
      background: #fdf4f4;
    }
    .is-hidden {
      display: none !important;
    }
    .location-picker {
      display: grid;
      gap: 8px;
      margin-top: 8px;
    }
    .location-search {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }
    .location-search-note {
      margin-top: 0;
    }
    .location-search-results {
      display: grid;
      gap: 6px;
      max-height: 220px;
      overflow-y: auto;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 6px;
      background: #fbfcfb;
    }
    .location-search-results:empty {
      display: none;
    }
    .location-search-result .subtle {
      display: block;
      margin-top: 2px;
    }
    .location-picker-map {
      min-height: 260px;
      height: 32vh;
      max-height: 360px;
      border: 1px solid var(--border);
      border-radius: 8px;
      overflow: hidden;
      background: var(--surface-2);
    }
    .location-picker-actions,
    .geo-capture,
    .geo-result,
    .note-location {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }
    .location-attribution {
      color: var(--muted);
      font-size: 0.74rem;
    }
    .geo-capture {
      justify-content: space-between;
      margin: 0 0 14px;
      padding: 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fbfcfb;
    }
    .geo-result {
      color: var(--muted);
      font-size: 0.82rem;
      margin-top: 4px;
    }
    .note-location {
      margin-top: 8px;
      font-size: 0.86rem;
    }
    .imported-phone-control {
      display: flex;
      gap: 8px;
      align-items: stretch;
    }
    .imported-phone-control input {
      background: #eef1f0;
      color: var(--muted);
      border-color: var(--border);
      box-shadow: none;
    }
    .imported-phone-control input:disabled {
      opacity: 1;
      cursor: not-allowed;
    }
    .clear-phone-hint {
      display: none;
      color: var(--danger);
      font-weight: 700;
    }
    .imported-phone-field.is-cleared .clear-phone-hint {
      display: block;
    }
    .imported-phone-field.is-cleared .imported-phone-control input {
      background: #f6e4e4;
      border-color: #e3b9b9;
      color: var(--danger);
    }
    textarea { resize: vertical; }
    .auth-shell {
      display: grid;
      max-width: 520px;
      margin: 28px auto 0;
    }
    .auth-shell form .fields {
      grid-template-columns: 1fr;
    }
    .auth-demo-cta {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) auto;
      gap: 12px;
      align-items: center;
      margin: 0 0 22px;
      padding: 15px;
      border: 1px solid #b9d8c8;
      border-radius: 10px;
      background: #edf7f1;
    }
    .auth-demo-cta-icon {
      display: inline-grid;
      width: 38px;
      height: 38px;
      place-items: center;
      border-radius: 9px;
      background: var(--primary);
      color: #fff;
    }
    .auth-demo-cta-icon svg {
      width: 20px;
      height: 20px;
    }
    .auth-demo-cta-copy {
      display: grid;
      gap: 3px;
      min-width: 0;
    }
    .auth-demo-cta-copy strong {
      color: var(--primary-2);
    }
    .auth-demo-cta-copy span {
      color: var(--muted);
      font-size: 0.85rem;
      line-height: 1.4;
    }
    .auth-demo-cta-button {
      white-space: nowrap;
    }
    .auth-support-link {
      color: var(--primary-2);
      font-weight: 700;
      text-underline-offset: 3px;
    }
    .auth-public-note {
      margin: -10px 0 18px;
      text-align: center;
      font-size: 0.88rem;
      font-weight: 700;
    }
    .public-nav {
      display: flex;
      gap: 8px;
      align-items: center;
    }
    .public-nav-mobile {
      display: none;
    }
    .public-nav-link {
      padding: 7px 9px;
      border-radius: 7px;
      color: var(--muted);
      font-size: 0.9rem;
      font-weight: 700;
      text-decoration: none;
    }
    .public-nav-link:hover,
    .public-nav-link.active {
      background: var(--surface-2);
      color: var(--primary-2);
    }
    .public-page {
      display: grid;
      gap: clamp(44px, 6vw, 76px);
      max-width: 1240px;
      margin: 10px auto 40px;
    }
    .public-hero {
      display: grid;
      grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.75fr);
      gap: clamp(28px, 5vw, 68px);
      align-items: center;
      padding: clamp(28px, 5vw, 64px);
      overflow: hidden;
      background: linear-gradient(135deg, #fff 0%, #f5faf7 100%);
    }
    .public-hero-copy {
      display: grid;
      gap: 17px;
      align-content: center;
    }
    .public-hero h1 {
      max-width: 760px;
      margin: 0;
      font-size: clamp(2.2rem, 5vw, 4.4rem);
      letter-spacing: -0.045em;
      line-height: 1.02;
    }
    .public-hero-copy > p {
      max-width: 760px;
      margin: 0;
      color: var(--muted);
      font-size: clamp(1rem, 1.6vw, 1.18rem);
      line-height: 1.65;
    }
    .public-eyebrow {
      color: var(--primary);
      font-size: 0.78rem;
      font-weight: 800;
      letter-spacing: 0.09em;
      text-transform: uppercase;
    }
    .public-hero-actions {
      margin-top: 5px;
    }
    .public-hero-summary {
      display: grid;
      gap: 2px;
      border: 1px solid var(--border);
      border-radius: 12px;
      overflow: hidden;
      background: var(--border);
      box-shadow: var(--shadow);
    }
    .public-hero-summary > div {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      gap: 12px;
      align-items: start;
      padding: 17px;
      background: #fff;
    }
    .public-hero-summary > div > span:last-child {
      display: grid;
      gap: 3px;
    }
    .public-hero-summary small {
      color: var(--muted);
      line-height: 1.4;
    }
    .public-summary-icon,
    .public-feature-icon {
      display: inline-grid;
      width: 40px;
      height: 40px;
      place-items: center;
      border-radius: 9px;
      background: #e5f2ea;
      color: var(--primary);
    }
    .public-summary-icon svg,
    .public-feature-icon svg {
      width: 21px;
      height: 21px;
    }
    .public-section {
      display: grid;
      gap: 24px;
    }
    .public-section-head {
      display: grid;
      gap: 8px;
      max-width: 760px;
    }
    .public-section-head h2,
    .public-final-cta h2 {
      margin: 0;
      font-size: clamp(1.65rem, 3vw, 2.45rem);
      letter-spacing: -0.025em;
      line-height: 1.12;
    }
    .public-section-head p,
    .public-final-cta p {
      margin: 0;
      color: var(--muted);
      font-size: 1rem;
      line-height: 1.6;
    }
    .public-feature-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 18px;
    }
    .public-feature-card {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      gap: 18px;
      align-content: start;
      padding: clamp(20px, 3vw, 30px);
    }
    .public-feature-icon.alt {
      background: #e7f0f2;
      color: var(--primary-2);
    }
    .public-feature-card h3,
    .public-pricing-card h3 {
      margin: 8px 0 5px;
      font-size: 1.25rem;
    }
    .public-feature-card p {
      margin: 0;
      color: var(--muted);
    }
    .public-check-list {
      display: grid;
      grid-column: 1 / -1;
      gap: 10px;
      margin: 4px 0 0;
      padding: 0;
      list-style: none;
    }
    .public-check-list li {
      position: relative;
      padding-left: 25px;
      line-height: 1.45;
    }
    .public-check-list li::before {
      position: absolute;
      left: 0;
      top: 0.08em;
      content: "✓";
      color: var(--primary);
      font-weight: 900;
    }
    .public-feature-card .public-card-note {
      grid-column: 1 / -1;
      padding-top: 14px;
      border-top: 1px solid var(--border);
      font-size: 0.86rem;
    }
    .public-pricing-section {
      padding: clamp(22px, 4vw, 42px);
      border-radius: 14px;
      background: #eaf3ee;
    }
    .public-pricing-card {
      display: grid;
      grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
      gap: clamp(24px, 5vw, 58px);
      padding: clamp(22px, 4vw, 38px);
    }
    .public-price-intro,
    .public-price-includes {
      display: grid;
      gap: 12px;
      align-content: start;
    }
    .public-price-intro p {
      margin: 0 0 4px;
      color: var(--muted);
      line-height: 1.6;
    }
    .public-price-amount {
      display: flex;
      align-items: baseline;
      flex-wrap: wrap;
      gap: 8px;
      margin: 2px 0;
    }
    .public-price-amount strong {
      color: var(--text);
      font-size: clamp(2.1rem, 5vw, 3.4rem);
      line-height: 1;
      letter-spacing: -0.04em;
    }
    .public-price-amount span {
      color: var(--muted);
      font-size: 1rem;
      font-weight: 700;
    }
    .public-price-intro .button {
      justify-self: start;
    }
    .public-price-includes {
      padding-left: clamp(0px, 3vw, 34px);
      border-left: 1px solid var(--border);
    }
    .public-price-includes .public-check-list {
      grid-column: auto;
    }
    .public-pricing-note {
      margin: -8px 0 0;
      color: var(--muted);
      font-size: 0.9rem;
    }
    .public-fit-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 16px;
    }
    .public-fit-grid > div {
      display: grid;
      gap: 9px;
      align-content: start;
      padding: 22px;
    }
    .public-fit-grid svg {
      width: 24px;
      height: 24px;
      color: var(--primary);
    }
    .public-fit-grid span {
      color: var(--muted);
      font-size: 0.9rem;
      line-height: 1.5;
    }
    .public-final-cta {
      display: flex;
      gap: 24px;
      align-items: center;
      justify-content: space-between;
      padding: clamp(24px, 4vw, 40px);
      border-color: #bad8c7;
      background: #f4fbf7;
    }
    .public-final-cta > div:first-child {
      display: grid;
      gap: 8px;
      max-width: 760px;
    }
    .field-label {
      display: block;
      margin-bottom: 6px;
      color: var(--muted);
      font-size: 0.86rem;
    }
    .public-inquiry-options {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }
    .public-inquiry-option {
      display: flex;
      gap: 9px;
      align-items: center;
      min-height: 48px;
      padding: 10px 11px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fbfcfb;
      color: var(--text);
      cursor: pointer;
    }
    .public-inquiry-option:hover {
      border-color: rgba(33, 99, 68, 0.48);
      background: #f5faf7;
    }
    .public-inquiry-option:has(input:checked) {
      border-color: var(--primary);
      background: #eaf3ee;
      box-shadow: 0 0 0 2px rgba(33, 99, 68, 0.1);
    }
    .public-inquiry-option input {
      flex: 0 0 auto;
      width: 17px;
      height: 17px;
      margin: 0;
      accent-color: var(--primary);
    }
    .public-inquiry-option span {
      min-width: 0;
      font-size: 0.9rem;
      font-weight: 700;
      line-height: 1.3;
    }
    .demo-starting-point {
      margin-top: 8px;
      padding-top: 20px;
      border-top: 1px solid var(--border);
    }
    .demo-starting-point-head {
      display: grid;
      gap: 4px;
      margin-bottom: 12px;
    }
    .demo-starting-point-head h3,
    .demo-starting-point-head p {
      margin: 0;
    }
    .demo-starting-point-head p {
      color: var(--muted);
      font-size: 0.86rem;
    }
    .demo-data-options {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }
    .demo-data-option {
      display: grid;
      grid-template-columns: auto auto minmax(0, 1fr);
      gap: 10px;
      align-items: start;
      margin: 0;
      padding: 15px;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: #fbfcfb;
      cursor: pointer;
      transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
    }
    .demo-data-option:hover {
      border-color: #8dbba2;
      background: #f5faf7;
    }
    .demo-data-option:has(input:checked) {
      border-color: var(--primary);
      background: #edf7f1;
      box-shadow: 0 0 0 2px rgba(33, 99, 68, 0.1);
    }
    .demo-data-option input {
      margin-top: 8px;
    }
    .demo-data-option-icon {
      display: inline-grid;
      width: 34px;
      height: 34px;
      place-items: center;
      border-radius: 8px;
      background: #e8efeb;
      color: var(--primary-2);
    }
    .demo-data-option:has(input:checked) .demo-data-option-icon {
      background: var(--primary);
      color: #fff;
    }
    .demo-data-option-icon svg {
      width: 18px;
      height: 18px;
    }
    .demo-data-option-copy {
      display: grid;
      gap: 5px;
      min-width: 0;
    }
    .demo-data-option-copy strong {
      color: var(--text);
    }
    .demo-data-option-copy span,
    .demo-data-option-copy small {
      color: var(--muted);
      line-height: 1.45;
    }
    .demo-data-option-copy span {
      font-size: 0.86rem;
    }
    .demo-data-option-copy small {
      font-size: 0.78rem;
      font-weight: 700;
    }
    .password-control {
      position: relative;
    }
    .password-control input {
      padding-right: 74px;
    }
    .password-toggle {
      position: absolute;
      top: 4px;
      right: 4px;
      width: 62px;
      height: 34px;
      border: 1px solid var(--border);
      border-radius: 7px;
      background: var(--surface-2);
      color: var(--primary-2);
      font: inherit;
      font-size: 0.84rem;
      cursor: pointer;
    }
    .password-toggle:hover {
      border-color: var(--primary);
      background: #fff;
    }
    .errorlist {
      color: var(--danger);
      margin: 6px 0 0;
      padding-left: 18px;
    }
    .actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      align-items: center;
      margin-top: 16px;
    }
    .page-head > .actions {
      justify-content: flex-end;
      margin-top: 0;
    }
    .actions form { margin: 0; }
    .row-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
    }
    .row-actions form { margin: 0; }
    .row-action-menu {
      position: relative;
      flex: 0 0 auto;
    }
    .row-action-menu summary {
      list-style: none;
      user-select: none;
    }
    .row-action-menu summary::-webkit-details-marker {
      display: none;
    }
    .row-action-panel {
      display: grid;
      gap: 4px;
      width: 100%;
      min-width: 0;
      margin-top: 6px;
      padding: 6px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--surface);
    }
    .row-action-panel a,
    .row-action-panel button {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      width: 100%;
      min-height: 32px;
      padding: 6px 8px;
      border: 1px solid transparent;
      border-radius: 6px;
      background: transparent;
      color: var(--text);
      font: inherit;
      font-size: 0.9rem;
      line-height: 1.2;
      text-align: left;
      text-decoration: none;
      cursor: pointer;
    }
    .row-action-panel a:hover,
    .row-action-panel button:hover {
      border-color: var(--border);
      background: var(--surface-2);
      color: var(--primary);
    }
    .inline-cell-form {
      margin: 0;
    }
    .editing-row td {
      background: #fbfcfb;
    }
    .inline-control {
      width: 100%;
      min-width: 112px;
      max-width: 190px;
      height: 34px;
      min-height: 34px;
      padding: 5px 8px;
      font-size: 0.9rem;
    }
    .compact-check {
      min-height: 34px;
      white-space: nowrap;
    }
    .customer-table {
      table-layout: fixed;
    }
    .customer-table th,
    .customer-table td {
      overflow-wrap: anywhere;
    }
    .customer-table .inline-control {
      max-width: 100%;
      min-width: 0;
    }
    .customer-table .row-actions {
      align-items: flex-start;
    }
    .customer-table .email-pill-list {
      max-height: 66px;
      overflow-y: auto;
      padding-right: 2px;
    }
    .email-cell-actions {
      flex-direction: column;
      align-items: flex-start;
    }
    .product-table,
    .document-table,
    .category-table {
      table-layout: fixed;
    }
    .product-table th,
    .product-table td,
    .document-table th,
    .document-table td,
    .category-table th,
    .category-table td {
      overflow-wrap: anywhere;
    }
    .empty {
      color: var(--muted);
      padding: 18px 0;
    }
    .customer-email-panel { margin-top: 14px; }
    .attachment-list {
      display: grid;
      gap: 10px;
    }
    .attachment-row {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 10px;
      padding-bottom: 10px;
      border-bottom: 1px solid var(--border);
    }
    .attachment-row:last-child {
      padding-bottom: 0;
      border-bottom: 0;
    }
    .attachment-row form {
      margin: 0;
      flex: 0 0 auto;
    }
    .attachment-main {
      display: grid;
      gap: 4px;
      min-width: 0;
      overflow-wrap: anywhere;
    }
    .attachment-main p {
      margin: 0;
    }
    .invoice-document {
      display: grid;
      gap: 18px;
    }
    .invoice-document-head {
      display: flex;
      justify-content: space-between;
      gap: 16px;
      padding-bottom: 14px;
      border-bottom: 1px solid var(--border);
    }
    .invoice-document-number {
      display: grid;
      justify-items: end;
      align-content: start;
      gap: 6px;
      text-align: right;
    }
    .invoice-document-number strong {
      font-size: 1.3rem;
    }
    .invoice-line-table input {
      min-width: 110px;
    }
    .invoice-line-table td:first-child input {
      min-width: 240px;
    }
    .line-description-cell {
      position: relative;
    }
    .line-product-suggestions {
      top: calc(100% - 4px);
      min-width: min(520px, 90vw);
      z-index: 35;
    }
    .line-product-status {
      display: none;
      align-items: center;
      gap: 6px;
      margin-top: 6px;
      color: var(--muted);
      font-size: 0.78rem;
      line-height: 1.25;
    }
    .line-product-status.is-visible {
      display: flex;
    }
    .line-product-status.is-valid {
      color: var(--primary);
    }
    .line-product-status.is-warning {
      color: var(--warning);
      font-weight: 700;
    }
    .invoice-line-table tr.line-row-needs-product td {
      background: #fff6f4;
    }
    .invoice-line-table tr.line-row-needs-product td:first-child {
      box-shadow: inset 3px 0 0 var(--danger);
    }
    .invoice-line-table tr.line-row-needs-product [data-line-description] {
      border-color: #dda3a3;
      background: #fffafa;
    }
    .invoice-line-table tr.line-row-needs-product:hover td {
      background: #fff1ee;
    }
    .picker-result-intro {
      color: var(--muted);
      font-size: 0.84rem;
      padding: 5px 6px 2px;
    }
    .line-product-missing {
      display: grid;
      gap: 4px;
      padding: 10px;
      border: 1px solid #ead79a;
      border-radius: 8px;
      background: #fffaf0;
    }
    .line-product-missing strong {
      font-size: 0.92rem;
    }
    .line-product-missing p {
      margin: 0;
      color: var(--muted);
      font-size: 0.86rem;
    }
    .line-product-result {
      display: grid;
      gap: 2px;
    }
    .line-items-head {
      align-items: end;
    }
    .line-total-cell {
      min-width: 86px;
      color: var(--muted);
      font-variant-numeric: tabular-nums;
      text-align: right;
      white-space: nowrap;
    }
    .line-row-removed {
      display: none;
    }
    .table-check-cell {
      text-align: center;
    }
    .invoice-totals {
      display: grid;
      justify-self: end;
      min-width: min(100%, 300px);
      border: 1px solid var(--border);
      border-radius: 8px;
      overflow: hidden;
    }
    .invoice-totals div {
      display: flex;
      justify-content: space-between;
      gap: 16px;
      padding: 10px 12px;
      border-top: 1px solid var(--border);
    }
    .invoice-totals div:first-child {
      border-top: 0;
    }
    .live-invoice-totals {
      margin-top: 14px;
    }
    .invoice-total {
      background: #fbfcfb;
    }
    .invoice-total {
      background: #fbfcfb;
      font-size: 1.05rem;
    }
    .vertical-actions {
      display: grid;
      gap: 8px;
    }
    .vertical-actions form,
    .vertical-actions .button {
      width: 100%;
    }
    .timeline-list {
      display: grid;
      gap: 0;
      position: relative;
    }
    .timeline-item {
      display: grid;
      grid-template-columns: 18px minmax(0, 1fr);
      gap: 10px;
      position: relative;
      padding-bottom: 14px;
    }
    .timeline-item:last-child {
      padding-bottom: 0;
    }
    .timeline-item::before {
      content: "";
      position: absolute;
      top: 14px;
      bottom: 0;
      left: 6px;
      width: 2px;
      background: var(--border);
    }
    .timeline-item:last-child::before {
      display: none;
    }
    .timeline-marker {
      width: 14px;
      height: 14px;
      margin-top: 4px;
      border: 2px solid var(--primary);
      border-radius: 999px;
      background: var(--surface);
      z-index: 1;
    }
    .timeline-content {
      display: grid;
      gap: 6px;
      min-width: 0;
      padding: 0 0 12px;
      border-bottom: 1px solid var(--border);
    }
    .timeline-item:last-child .timeline-content {
      padding-bottom: 0;
      border-bottom: 0;
    }
    .timeline-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 10px;
    }
    .timeline-head h3 {
      margin: 0;
    }
    .timeline-content p {
      margin: 0;
      max-width: 80ch;
    }
    .timeline-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      color: var(--muted);
      font-size: 0.82rem;
    }
    .timeline-drawer {
      margin-top: 18px;
    }
    .timeline-drawer > summary {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      cursor: pointer;
      list-style: none;
    }
    .timeline-drawer > summary::-webkit-details-marker {
      display: none;
    }
    .timeline-drawer > summary span:first-child {
      display: grid;
      gap: 3px;
      min-width: 0;
    }
    .timeline-drawer > summary strong {
      font-size: 1rem;
    }
    .timeline-drawer > summary span span {
      color: var(--muted);
      font-size: 0.86rem;
    }
    .timeline-drawer > summary::after {
      content: "Open";
      flex: 0 0 auto;
      color: var(--primary);
      font-size: 0.86rem;
      font-weight: 700;
    }
    .timeline-drawer[open] > summary {
      padding-bottom: 14px;
      border-bottom: 1px solid var(--border);
      margin-bottom: 14px;
    }
    .timeline-drawer[open] > summary::after {
      content: "Close";
    }
    .timeline-drawer-body {
      display: grid;
      gap: 12px;
    }
    .note-latest {
      display: grid;
      gap: 8px;
      padding: 0 0 12px;
      margin-bottom: 12px;
      border-bottom: 1px solid var(--border);
    }
    .note-summary {
      margin: 0;
      max-width: 76ch;
    }
    .note-section-label {
      color: var(--muted);
      font-size: 0.74rem;
      font-weight: 800;
      letter-spacing: 0;
      text-transform: uppercase;
    }
    .note-history-head {
      margin-bottom: 8px;
    }
    .note-history-head h3 {
      margin: 0;
    }
    .note-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: baseline;
      justify-content: space-between;
    }
    .note-meta h3 {
      margin: 0;
    }
    .note-card {
      padding-bottom: 12px;
      border-bottom: 1px solid var(--border);
    }
    .note-card:last-child {
      padding-bottom: 0;
      border-bottom: 0;
    }
    .note-card p {
      margin: 6px 0 8px;
    }
    .note-history-actions {
      margin-top: 12px;
      padding-top: 12px;
      border-top: 1px solid var(--border);
    }
    .note-products {
      margin-top: 8px;
    }
    .split {
      display: grid;
      grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
      gap: 18px;
      align-items: start;
    }
    .home-layout {
      grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
      gap: 20px;
    }
    .kv {
      display: grid;
      grid-template-columns: 130px minmax(0, 1fr);
      gap: 8px 12px;
    }
    .compact-kv {
      grid-template-columns: 96px minmax(0, 1fr);
      gap: 6px 10px;
      font-size: 0.9rem;
    }
    .kv dt { color: var(--muted); }
    .kv dd { margin: 0; white-space: pre-line; }
    .badge-list {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      align-items: center;
    }
    .merge-preview {
      display: grid;
      gap: 14px;
    }
    .merge-preview-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }
    .merge-preview-card {
      display: grid;
      gap: 8px;
      align-content: start;
      min-width: 0;
      padding: 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fbfcfb;
    }
    .merge-preview-card.keep {
      border-color: #b9d8c6;
      background: #f4fbf7;
    }
    .merge-preview-card.archive {
      border-color: #e3b9b9;
      background: #fff8f8;
    }
    .merge-preview-card h3 {
      margin-bottom: 0;
      overflow-wrap: anywhere;
    }
    .merge-preview-section {
      display: grid;
      gap: 8px;
      padding-top: 12px;
      border-top: 1px solid var(--border);
    }
    .merge-preview-section h3 {
      margin-bottom: 0;
    }
    .merge-count-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }
    .merge-count-grid div {
      display: grid;
      gap: 2px;
      min-width: 0;
      padding: 9px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fbfcfb;
    }
    .merge-count-grid strong {
      font-size: 1.2rem;
      line-height: 1;
    }
    .merge-count-grid span {
      color: var(--muted);
      font-size: 0.78rem;
      line-height: 1.25;
    }
    details summary {
      cursor: pointer;
      color: var(--primary-2);
      font-weight: 700;
    }
    pre {
      white-space: pre-wrap;
      word-break: break-word;
      background: #f7f9f8;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 10px;
      overflow-x: auto;
    }
    .pagination {
      display: flex;
      gap: 8px;
      align-items: center;
      justify-content: flex-end;
      margin-top: 14px;
    }
    .modal-backdrop {
      position: fixed;
      inset: 0;
      z-index: 50;
      display: grid;
      place-items: start center;
      overflow-y: auto;
      padding: 44px 18px;
      background: rgba(23, 32, 28, 0.42);
    }
    .modal-panel {
      width: min(720px, 100%);
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 8px;
      box-shadow: 0 20px 60px rgba(23, 32, 28, 0.25);
    }
    .modal-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 14px 16px;
      border-bottom: 1px solid var(--border);
    }
    .modal-body { padding: 16px; }
    .modal-panel.modal-submitting .modal-body {
      cursor: progress;
    }
    .modal-panel.modal-submitting .modal-body form > *:not(.actions) {
      opacity: 0.72;
      transition: opacity 120ms ease;
    }
    .modal-submit-loading {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      cursor: progress;
    }
    .modal-submit-spinner {
      width: 16px;
      height: 16px;
      flex: 0 0 16px;
      border: 2px solid currentColor;
      border-right-color: transparent;
      border-radius: 999px;
      animation: spin 0.7s linear infinite;
    }
    .htmx-action-loading {
      cursor: progress !important;
      opacity: 0.72;
    }
    button.htmx-action-loading,
    a.htmx-action-loading {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }
    a.htmx-action-loading {
      pointer-events: none;
    }
    button.htmx-action-loading::after,
    a.htmx-action-loading::after {
      width: 14px;
      height: 14px;
      flex: 0 0 14px;
      border: 2px solid currentColor;
      border-right-color: transparent;
      border-radius: 999px;
      animation: spin 0.7s linear infinite;
      content: "";
    }
    .icon-button {
      display: inline-grid;
      place-items: center;
      width: 34px;
      height: 34px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--surface);
      color: var(--text);
      cursor: pointer;
      font-size: 1.2rem;
      line-height: 1;
    }
    .picker {
      display: grid;
      gap: 8px;
      position: relative;
    }
    .picker-search {
      position: relative;
    }
    .picker-control {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
      min-height: 42px;
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fff;
      padding: 4px 8px;
    }
    .picker-control:focus-within {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(33, 99, 68, 0.12);
    }
    .picker-control input {
      flex: 1 1 180px;
      min-width: 140px;
      height: 32px;
      min-height: 32px;
      border: 0;
      border-radius: 0;
      box-shadow: none;
      padding: 4px 2px;
    }
    .picker-control input:focus {
      border-color: transparent;
      box-shadow: none;
      outline: none;
    }
    .picker-results {
      display: grid;
      gap: 6px;
      position: absolute;
      top: calc(100% + 6px);
      left: 0;
      right: 0;
      z-index: 20;
      max-height: 260px;
      overflow-y: auto;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 6px;
      background: #fbfcfb;
      box-shadow: 0 12px 28px rgba(23, 32, 28, 0.14);
    }
    .picker-result {
      display: block;
      width: 100%;
      border: 1px solid transparent;
      border-radius: 7px;
      background: transparent;
      color: var(--text);
      cursor: pointer;
      padding: 8px;
      line-height: 1.35;
      text-align: left;
    }
    .picker-result strong {
      font-weight: 900;
    }
    .picker-result:hover {
      border-color: var(--primary);
      background: var(--surface-2);
    }
    .picker-result-group {
      display: grid;
      gap: 6px;
    }
    .picker-result-group + .picker-result-group {
      margin-top: 8px;
      padding-top: 8px;
      border-top: 1px solid var(--border);
    }
    .picker-result-group-label {
      color: var(--muted);
      font-size: 0.72rem;
      font-weight: 900;
      letter-spacing: 0;
      text-transform: uppercase;
    }
    .picker-create-action {
      display: flex;
      justify-content: flex-end;
      margin-top: 8px;
      padding-top: 8px;
      border-top: 1px solid var(--border);
    }
    .customer-match-warning {
      display: grid;
      gap: 8px;
      margin-top: 8px;
      padding: 10px;
      border: 1px solid #ead79a;
      border-radius: 8px;
      background: #fffaf0;
      box-shadow: 0 10px 24px rgba(23, 32, 28, 0.12);
    }
    .customer-match-head {
      display: flex;
      gap: 8px;
      align-items: baseline;
      justify-content: space-between;
      min-width: 0;
    }
    .customer-match-head strong {
      flex: 0 0 auto;
      font-size: 0.92rem;
    }
    .customer-match-warning p {
      margin: 0;
      color: var(--muted);
      font-size: 0.86rem;
      min-width: 0;
      overflow: hidden;
      text-align: right;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .customer-match-actions {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
      align-items: center;
      padding-top: 2px;
    }
    .customer-match-suggestions {
      display: grid;
      gap: 6px;
      min-width: 0;
    }
    .customer-match-suggestions .button {
      display: grid;
      justify-content: stretch;
      min-width: 0;
      width: 100%;
      padding: 7px 9px;
      overflow: hidden;
      text-align: left;
    }
    .customer-match-name,
    .customer-match-meta {
      display: block;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .customer-match-name {
      color: var(--primary);
      font-weight: 800;
      line-height: 1.2;
    }
    .customer-match-meta {
      color: var(--muted);
      font-size: 0.82rem;
      line-height: 1.2;
    }
    .customer-match-note {
      margin-top: 8px;
      color: var(--muted);
      font-size: 0.86rem;
    }
    [data-billing-name-match-target],
    [data-billing-email-match-target] {
      position: relative;
      z-index: 28;
    }
    [data-billing-name-match-target] .customer-match-warning,
    [data-billing-name-match-target] .customer-match-note,
    [data-billing-email-match-target] .customer-match-warning,
    [data-billing-email-match-target] .customer-match-note {
      position: absolute;
      top: 6px;
      left: 0;
      right: 0;
    }
    [data-billing-name-match-target] .customer-match-note,
    [data-billing-email-match-target] .customer-match-note {
      padding: 7px 9px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--surface);
      box-shadow: 0 8px 20px rgba(23, 32, 28, 0.10);
    }
    .segmented-control {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 6px;
      padding: 4px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fbfcfb;
    }
    .segment-option {
      display: block;
      min-width: 0;
      margin: 0;
      color: var(--text);
      cursor: pointer;
    }
    .segment-option input {
      position: absolute;
      width: 1px;
      height: 1px;
      opacity: 0;
      pointer-events: none;
    }
    .segment-option span {
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 38px;
      width: 100%;
      padding: 8px 9px;
      border: 1px solid transparent;
      border-radius: 7px;
      font-weight: 800;
      line-height: 1.15;
      text-align: center;
    }
    .segment-option input:checked + span {
      border-color: var(--primary);
      background: var(--primary);
      color: #fff;
    }
    .segment-option input:focus-visible + span {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(33, 99, 68, 0.12);
      outline: none;
    }
    .segment-option:hover span {
      border-color: var(--primary);
      background: var(--surface-2);
    }
    .segment-option:hover input:checked + span {
      background: var(--primary);
      color: #fff;
    }
    .frequency-control {
      grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    }
    .permission-matrix {
      display: grid;
      gap: 14px;
      max-height: min(62vh, 640px);
      overflow: auto;
      padding-right: 2px;
    }
    .permission-app-group {
      display: grid;
      gap: 10px;
      padding-top: 4px;
      border-top: 1px solid var(--border);
    }
    .permission-app-group:first-child {
      border-top: 0;
      padding-top: 0;
    }
    .permission-app-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }
    .permission-app-head h3 {
      margin: 0;
    }
    .permission-resource-list {
      display: grid;
      gap: 10px;
    }
    .permission-resource-row {
      display: grid;
      grid-template-columns: minmax(120px, 170px) 1fr;
      gap: 10px;
      align-items: start;
      padding: 10px 0;
      border-top: 1px solid var(--border);
    }
    .permission-resource-row:first-child {
      border-top: 0;
      padding-top: 0;
    }
    .permission-resource-name {
      display: grid;
      gap: 2px;
    }
    .permission-resource-name span {
      color: var(--muted);
      font-size: 0.8rem;
    }
    .permission-toggle-list {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 8px;
    }
    .permission-toggle {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      min-width: 0;
      margin: 0;
      padding: 8px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fbfcfb;
      cursor: pointer;
    }
    .permission-toggle:has(input:checked) {
      border-color: rgba(33, 99, 68, 0.45);
      background: #eef7f2;
    }
    .permission-toggle input {
      flex: 0 0 auto;
      margin-top: 3px;
    }
    .permission-toggle-main {
      display: grid;
      gap: 2px;
      min-width: 0;
      flex: 1 1 auto;
    }
    .permission-toggle-label {
      font-weight: 800;
      line-height: 1.2;
    }
    .permission-toggle-detail,
    .permission-toggle-key {
      color: var(--muted);
      font-size: 0.78rem;
      line-height: 1.25;
    }
    .permission-toggle-key {
      font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    }
    .permission-toggle-state {
      flex: 0 0 auto;
      align-self: flex-start;
      color: var(--primary);
      font-size: 0.78rem;
      font-weight: 800;
    }
    .modal-body .permission-matrix {
      max-height: none;
      overflow: visible;
      padding-right: 0;
    }
    .modal-body .permission-resource-row {
      grid-template-columns: 1fr;
      gap: 8px;
    }
    .modal-body .permission-toggle-list {
      grid-template-columns: 1fr;
    }
    .modal-body .permission-toggle {
      align-items: flex-start;
      padding: 9px 10px;
    }
    .selected-list {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      min-height: 32px;
    }
    .selected-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      border: 1px solid var(--border);
      border-radius: 999px;
      background: var(--surface-2);
      padding: 5px 8px;
      font-size: 0.86rem;
      max-width: 100%;
    }
    .selected-pill span {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .selected-pill button {
      border: 0;
      background: transparent;
      color: var(--danger);
      cursor: pointer;
      font: inherit;
      padding: 0;
    }
    .selected-single {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      width: 100%;
      min-height: 32px;
    }
    .selected-single-label {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-weight: 600;
    }
    .selected-single-actions {
      display: inline-flex;
      gap: 6px;
      flex: 0 0 auto;
    }
    .text-button {
      border: 0;
      background: transparent;
      color: var(--primary-2);
      cursor: pointer;
      font: inherit;
      padding: 0;
    }
    .text-button.danger { color: var(--danger); }
    .error-page {
      min-height: calc(100vh - 180px);
      display: grid;
      align-items: center;
      padding: 32px 0;
    }
    .error-shell {
      display: grid;
      grid-template-columns: minmax(120px, 190px) minmax(0, 680px);
      gap: 22px;
      align-items: stretch;
      max-width: 920px;
      margin: 0 auto;
    }
    .error-code {
      display: grid;
      place-items: center;
      min-height: 210px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--surface-2);
      color: var(--primary-2);
      font-size: clamp(3rem, 9vw, 5.8rem);
      font-weight: 900;
      line-height: 1;
      box-shadow: var(--shadow);
    }
    .error-panel {
      display: grid;
      align-content: center;
      gap: 12px;
      min-height: 210px;
      padding: 24px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--surface);
      box-shadow: var(--shadow);
    }
    .error-panel h1 {
      max-width: 560px;
    }
    .error-message {
      max-width: 620px;
      margin: 0;
      color: var(--muted);
      font-size: 1rem;
    }
    .error-path {
      display: inline-flex;
      width: fit-content;
      max-width: 100%;
      padding: 5px 8px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fbfcfb;
      color: var(--muted);
      font-size: 0.86rem;
      overflow-wrap: anywhere;
    }
    .error-actions {
      margin-top: 6px;
    }
    @media (max-width: 720px) {
      body { font-size: 0.96rem; }
      .topbar { position: static; }
      .topbar-inner {
        padding: 8px 10px;
        gap: 10px;
      }
      .brand { font-size: 1.05rem; }
      .topbar-search {
        min-width: 0;
      }
      .topbar-search button {
        flex: 0 0 auto;
      }
      .nav {
        display: block;
        overflow: visible;
        padding-bottom: 2px;
        width: 100%;
      }
      .nav a,
      .nav button {
        white-space: nowrap;
      }
      .nav-menu-panel {
        left: 12px;
        right: 12px;
      }
      .layout {
        padding: 14px 10px 34px;
      }
      .page-head {
        gap: 10px;
        margin-bottom: 12px;
      }
      .messages {
        top: 10px;
        right: 10px;
        width: calc(100vw - 20px);
      }
      .hijack-banner-inner {
        align-items: flex-start;
        flex-direction: column;
        padding: 10px 12px;
      }
      .role-preview-banner-inner {
        align-items: stretch;
        flex-direction: column;
        padding: 10px 12px;
      }
      body.has-role-preview-banner .layout {
        padding-bottom: 132px;
      }
      .role-preview-banner {
        right: 10px;
        bottom: 10px;
        left: 10px;
      }
      h1 { font-size: 1.45rem; }
      .panel { padding: 12px; }
      .metric {
        min-height: 76px;
      }
      .dashboard-metrics.grid-3,
      .dashboard-metrics.grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
      }
      .dashboard-metrics.grid-3 .metric:last-child:nth-child(odd) {
        grid-column: 1 / -1;
      }
      .dashboard-metrics .metric {
        min-height: 96px;
        padding: 12px;
      }
      .dashboard-metrics .metric .label {
        font-size: 0.72rem;
      }
      .metric .value {
        font-size: 1.45rem;
      }
      .error-page {
        min-height: auto;
        padding: 18px 0;
      }
      .error-shell {
        grid-template-columns: 1fr;
        gap: 12px;
      }
      .error-code {
        min-height: 112px;
        font-size: 3rem;
      }
      .error-panel {
        min-height: 0;
        padding: 16px;
      }
      .toolbar {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
      }
      .storage-summary-strip {
        grid-template-columns: 1fr;
        align-items: start;
      }
      .storage-summary-meta {
        justify-content: flex-start;
      }
      .invoice-document-head {
        flex-direction: column;
      }
      .invoice-document-number {
        justify-items: start;
        text-align: left;
      }
      .invoice-line-table input,
      .invoice-line-table td:first-child input {
        min-width: 0;
      }
      .line-product-suggestions {
        min-width: 0;
      }
      .search-toolbar {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
        padding: 10px;
      }
      .search-field {
        max-width: none;
        width: 100%;
      }
      .search-result-row {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
        min-height: 0;
        padding: 10px;
      }
      .search-result-row .badge {
        grid-column: 2;
        justify-self: start;
      }
      .link-list a {
        grid-template-columns: 1fr;
        gap: 3px;
      }
      .link-list span {
        text-align: left;
      }
      .toolbar .field,
      .toolbar .check-field {
        min-width: 0;
        width: 100%;
      }
      .advanced-filter-grid {
        grid-template-columns: 1fr;
      }
      .advanced-filters > summary,
      .bulk-actions > summary {
        width: 100%;
        justify-content: flex-start;
      }
      .settings-layout {
        grid-template-columns: 1fr;
      }
      .settings-section-head {
        align-items: flex-start;
        flex-direction: column;
      }
      .password-field-row {
        align-items: stretch;
        flex-direction: column;
      }
      input,
      select,
      textarea {
        font-size: 16px;
      }
      .actions {
        align-items: stretch;
        width: 100%;
      }
      .actions > * {
        flex: 1 1 100%;
      }
      .auth-demo-cta {
        grid-template-columns: auto minmax(0, 1fr);
      }
      .auth-demo-cta-button {
        grid-column: 1 / -1;
        width: 100%;
      }
      .public-hero,
      .public-feature-grid,
      .public-pricing-card,
      .public-fit-grid,
      .public-inquiry-options {
        grid-template-columns: 1fr;
      }
      .public-hero {
        padding: 22px;
      }
      .public-price-includes {
        padding-top: 20px;
        padding-left: 0;
        border-top: 1px solid var(--border);
        border-left: 0;
      }
      .public-final-cta {
        align-items: stretch;
        flex-direction: column;
      }
      .demo-data-options {
        grid-template-columns: 1fr;
      }
      .row-actions {
        align-items: stretch;
      }
      .row-actions > *,
      .row-actions form {
        flex: 1 1 100%;
      }
      .row-action-menu {
        width: 100%;
      }
      .row-action-menu summary {
        width: 100%;
      }
      .row-action-panel {
        width: 100%;
      }
      .attachment-row {
        flex-direction: column;
      }
      .attachment-row form,
      .attachment-row .button {
        width: 100%;
      }
      .permission-resource-row {
        grid-template-columns: 1fr;
      }
      .permission-toggle-list {
        grid-template-columns: 1fr;
      }
      .merge-preview-grid,
      .merge-count-grid {
        grid-template-columns: 1fr;
      }
      .inline-control {
        max-width: 100%;
      }
      .table-wrap {
        overflow: visible;
      }
      .table-wrap table,
      .table-wrap thead,
      .table-wrap tbody,
      .table-wrap tr,
      .table-wrap td {
        display: block;
        width: 100%;
      }
      .table-wrap thead,
      .customer-table colgroup {
        display: none;
      }
      .table-wrap tr {
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 10px;
        margin-bottom: 10px;
        background: var(--surface);
      }
      .table-wrap td {
        display: grid;
        grid-template-columns: minmax(92px, 36%) minmax(0, 1fr);
        gap: 10px;
        align-items: start;
        border-bottom: 1px solid var(--border);
        padding: 8px 0;
      }
      .table-wrap td:last-child {
        border-bottom: 0;
      }
      .table-wrap td[data-label]::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 0;
        text-transform: uppercase;
      }
      .table-wrap td:not([data-label]) {
        display: block;
      }
      .table-wrap td.inline-selection-spacer {
        display: none;
      }
      .customer-table .email-pill-list {
        max-height: none;
        overflow: visible;
      }
      .table-wrap .empty {
        display: block;
        border: 0;
        padding: 12px 0;
      }
      .pagination {
        align-items: stretch;
        flex-direction: column;
      }
      .modal-backdrop {
        padding: 10px;
      }
      .modal-panel {
        max-height: calc(100vh - 20px);
        overflow-y: auto;
      }
      .modal-head,
      .modal-body {
        padding: 12px;
      }
      .picker {
        gap: 6px;
      }
      .picker-control {
        align-items: stretch;
        gap: 8px;
        min-height: 46px;
        padding: 7px 9px;
      }
      .picker-control input {
        flex-basis: 100%;
        min-width: 0;
        height: 34px;
        min-height: 34px;
        padding: 5px 2px;
      }
      .selected-pill {
        max-width: 100%;
        min-height: 30px;
      }
      .picker-results {
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        right: 0;
        max-height: min(260px, 38dvh);
        margin-top: 0;
        padding: 8px;
        border-radius: 8px;
        background: var(--surface);
        box-shadow: 0 12px 28px rgba(23, 32, 28, 0.14);
        overscroll-behavior: contain;
      }
      .picker-result {
        min-height: 48px;
        padding: 10px 11px;
        border-color: var(--border);
        background: #fbfcfb;
      }
      .picker-result + .picker-result {
        margin-top: 6px;
      }
      .picker-result:hover,
      .picker-result:focus {
        background: var(--surface-2);
      }
      .customer-match-warning {
        padding: 9px;
      }
      .customer-match-head {
        display: grid;
        gap: 2px;
      }
      .customer-match-actions {
        width: 100%;
      }
      .customer-match-suggestions {
        width: 100%;
      }
      .customer-match-actions .button {
        flex: 1 1 0;
      }
      .customer-match-warning p {
        text-align: left;
      }
      .recipient-picker-add {
        grid-template-columns: 1fr;
      }
      .billing-customer-create-prompt {
        align-items: stretch;
        flex-direction: column;
      }
      .picker-results .empty {
        padding: 12px;
      }
      .segmented-control {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }
    @media (max-width: 860px) {
      .topbar-inner {
        align-items: stretch;
        flex-direction: column;
        justify-content: flex-start;
        gap: 8px;
        padding: 8px 10px;
      }
      .page-head {
        align-items: stretch;
        flex-direction: column;
      }
      .page-head.compact-head {
        align-items: stretch;
      }
      .page-head.compact-head > .page-title {
        align-self: flex-start;
      }
      .topbar-search {
        flex: 0 0 auto;
        width: 100%;
        max-width: none;
        min-width: 0;
      }
      .topbar-search input {
        min-width: 0;
        min-height: 40px;
      }
      .topbar-search button {
        flex: 0 0 auto;
        width: auto;
        min-height: 40px;
        padding-inline: 12px;
      }
      .nav {
        display: block;
        width: 100%;
        overflow: visible;
        padding-bottom: 2px;
      }
      .nav > :not(.mobile-nav-drawer) {
        display: none !important;
      }
      .nav > .mobile-nav-drawer {
        display: block !important;
        width: 100%;
      }
      .public-topbar .topbar-inner {
        align-items: center;
        flex-direction: row;
        min-height: 52px;
        padding: 7px 10px;
      }
      .public-topbar .nav {
        display: flex;
        width: auto;
        margin-left: auto;
        padding: 0;
      }
      .nav > .public-nav-desktop {
        display: none !important;
      }
      .nav > .public-nav-mobile {
        position: relative;
        display: block !important;
      }
      .public-nav-mobile summary {
        list-style: none;
      }
      .public-nav-mobile summary::-webkit-details-marker {
        display: none;
      }
      .public-nav-mobile-trigger {
        display: inline-flex;
        gap: 7px;
        align-items: center;
        min-height: 38px;
        padding: 7px 10px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: #fbfcfb;
        color: var(--text);
        font-weight: 700;
        cursor: pointer;
      }
      .public-nav-mobile[open] .public-nav-mobile-trigger {
        border-color: var(--primary);
        color: var(--primary);
      }
      .public-nav-mobile-panel {
        position: absolute;
        top: calc(100% + 7px);
        right: 0;
        z-index: 60;
        display: grid;
        width: min(280px, calc(100vw - 20px));
        gap: 4px;
        padding: 8px;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--surface);
        box-shadow: 0 16px 34px rgba(20, 37, 31, 0.16);
      }
      .public-nav-mobile-panel a {
        justify-content: flex-start;
        width: 100%;
        min-height: 42px;
        padding: 10px 11px;
      }
      .public-nav-mobile-panel a.active:not(.button) {
        background: var(--surface-2);
        border-color: var(--border);
        color: var(--primary);
      }
      .public-nav-mobile-panel .button {
        justify-content: center;
        margin-top: 3px;
        color: #fff;
      }
      .public-nav-mobile-panel .button:hover {
        border-color: var(--primary-2);
        background: var(--primary-2);
        color: #fff;
      }
      .nav > a,
      .nav > .nav-menu {
        min-width: 0;
        width: 100%;
      }
      .mobile-nav-trigger {
        justify-content: space-between;
        min-height: 46px;
        padding: 8px 11px;
        border-color: var(--border);
        background: #fbfcfb;
      }
      .mobile-nav-trigger .nav-icon {
        width: 20px;
        height: 20px;
      }
      .mobile-nav-trigger-context {
        max-width: min(48vw, 220px);
      }
      .mobile-nav-drawer.is-open::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 70;
        background: rgba(23, 32, 28, 0.36);
      }
      body.nav-drawer-open {
        overflow: hidden;
      }
      .nav a,
      .nav button {
        justify-content: center;
        width: 100%;
        min-height: 46px;
        padding: 7px 5px;
        white-space: normal;
      }
      .nav .mobile-nav-trigger {
        justify-content: space-between;
        padding: 8px 11px;
      }
      .nav .nav-icon-only {
        width: 100%;
        min-width: 0;
        height: auto;
        padding: 7px 5px;
      }
      .nav-icon-only .badge {
        top: -5px;
        right: 8px;
      }
      .nav-link-label {
        display: block;
        max-width: 100%;
        overflow: hidden;
        color: inherit;
        font-size: 0.76rem;
        line-height: 1.05;
        text-overflow: ellipsis;
      }
      .nav-mobile-only {
        display: inline;
      }
      .nav-desktop-label {
        display: none;
      }
      .nav-help,
      .nav-organization-switcher,
      .nav-organization-name {
        display: none;
      }
      .nav-account-label {
        max-width: 100%;
        font-size: 0;
      }
      .nav-account-label::after {
        content: "Account";
        font-size: 0.76rem;
        line-height: 1.05;
      }
      .nav form {
        flex: 0 0 auto;
      }
      .nav .nav-menu-panel a,
      .nav .nav-menu-panel form button {
        display: grid;
        grid-template-columns: 22px minmax(0, 1fr);
        justify-content: stretch;
        width: 100%;
        min-height: 0;
        padding: 8px 9px;
        text-align: left;
      }
      .nav .nav-menu-panel form {
        width: 100%;
      }
      .nav-menu-panel {
        position: fixed;
        left: 12px;
        right: 12px;
        top: var(--nav-panel-top, 72px);
        min-width: 0;
        max-height: calc(100vh - var(--nav-panel-top, 72px) - 12px);
      }
      .mobile-nav-drawer .nav-menu-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 80;
        width: 100%;
        max-height: min(84dvh, 680px);
        padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 16px 16px 0 0;
        overscroll-behavior: contain;
      }
      .mobile-drawer-head {
        position: sticky;
        top: -10px;
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 4px 2px 10px;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
      }
      .mobile-drawer-head > span {
        display: grid;
        gap: 1px;
      }
      .mobile-drawer-head strong {
        font-size: 1rem;
      }
      .mobile-drawer-head span span {
        color: var(--muted);
        font-size: 0.78rem;
      }
      .nav .mobile-drawer-close {
        width: 34px;
        min-height: 34px;
        height: 34px;
        padding: 0;
      }
      .mobile-workspace-card {
        display: grid;
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 10px;
        align-items: center;
        padding: 10px 9px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: #fbfcfb;
      }
      .mobile-workspace-card .nav-icon {
        width: 28px;
        height: 28px;
        border: 1px solid rgba(33, 99, 68, 0.18);
        border-radius: 8px;
        background: var(--surface-2);
        color: var(--primary);
      }
      .mobile-workspace-card > span:last-child {
        display: grid;
        gap: 2px;
        min-width: 0;
      }
      .mobile-workspace-card strong {
        overflow: hidden;
        color: var(--text);
        font-size: 0.95rem;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .mobile-workspace-card span span {
        color: var(--muted);
        font-size: 0.78rem;
      }
      .mobile-nav-group-body.nav-menu-section {
        border-top: 0;
      }
      .mobile-nav-group-body.nav-menu-section + .mobile-nav-group-body.nav-menu-section {
        border-top: 0;
      }
      .grid-2, .grid-3, .grid-4, .split, form .fields {
        grid-template-columns: 1fr;
      }
      .dashboard-layout {
        grid-template-columns: 1fr;
        gap: 14px;
      }
      .dashboard-metrics {
        margin-bottom: 14px;
      }
      .kv { grid-template-columns: 1fr; }
      .button { width: 100%; }
      .count-button {
        width: auto;
        justify-self: start;
      }
      .sticky-list-panel .table-wrap {
        max-height: none;
        overflow-x: auto;
      }
      .sticky-list-panel .toolbar,
      .sticky-table thead th {
        position: static;
      }
    }
