:root {
  --bg: #f5f9fd;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-muted: rgba(244, 249, 253, 0.92);
  --ink: #183044;
  --muted: #627386;
  --line: rgba(143, 166, 186, 0.22);
  --line-strong: rgba(143, 166, 186, 0.34);
  --accent: #7cc8f4;
  --accent-dark: #58b4eb;
  --accent-soft: rgba(124, 200, 244, 0.14);
  --lime: #d5dd94;
  --lime-dark: #c4d063;
  --lime-soft: rgba(213, 221, 148, 0.18);
  --navy: #203a52;
  --navy-soft: #2f5f7a;
  --navy-deep: #102030;
  --gold: #f1cf8c;
  --gold-soft: rgba(241, 207, 140, 0.2);
  --error: #b85d5d;
  --error-soft: rgba(248, 219, 219, 0.92);
  --danger: #cf6767;
  --shadow: 0 28px 80px rgba(64, 80, 96, 0.12);
  --radius: 30px;
}

[hidden] {
  display: none !important;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(143, 166, 186, 0.22);
  text-align: left;
  vertical-align: top;
}

.data-table th,
.data-table tfoot td {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table tfoot td {
  color: var(--ink);
  background: rgba(248, 250, 252, 0.72);
}

.accounting-setup-page {
  min-height: calc(100vh - 120px);
}

.accounting-setup-shell {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.35fr);
  gap: 18px;
  align-items: start;
}

.accounting-setup-hero {
  position: sticky;
  top: 18px;
}

.accounting-setup-hero h1,
.accounting-setup-form h2 {
  margin-bottom: 8px;
}

.accounting-setup-form fieldset {
  display: contents;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.accounting-setup-form fieldset:disabled {
  opacity: 1;
}

.accounting-setup-steps {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.accounting-setup-steps div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.accounting-setup-steps strong {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--navy);
}

.accounting-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.accounting-choice-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.accounting-choice-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 116px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  outline: none;
}

.accounting-choice-card:focus-within {
  outline: none;
}

.accounting-choice-card input[type="radio"] {
  outline: none;
}

.accounting-choice-card:has(input:checked) {
  border-color: var(--accent-dark);
  box-shadow: 0 16px 36px rgba(88, 180, 235, 0.16);
  background: linear-gradient(180deg, rgba(124, 200, 244, 0.12), rgba(255, 255, 255, 0.92));
}

.accounting-choice-card input {
  margin-top: 3px;
}

.accounting-choice-card strong,
.accounting-choice-card small {
  display: block;
}

.accounting-choice-card small {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.accounting-conditional-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-muted);
}

.accounting-setup-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(213, 221, 148, 0.22), rgba(124, 200, 244, 0.16));
}

.accounting-landing-tab-input,
.accounting-landing-tablist,
.crm-landing-tab-input,
.crm-landing-tablist,
.team-tab-input,
.team-tablist {
  display: none;
}

.accounting-first-run-prompt {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid rgba(88, 180, 235, 0.34);
  border-radius: 16px;
  background: rgba(124, 200, 244, 0.12);
  color: var(--navy);
}

.accounting-first-run-prompt span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.accounting-disabled-action {
  user-select: none;
}

.accounting-product-body {
  background: #f5f7fb;
  overflow-x: hidden;
}

.accounting-product-body .shell {
  width: 100%;
  max-width: none;
  padding: 26px 28px 0;
}

.accounting-product-body .topbar {
  display: flex;
  margin-bottom: 24px;
}

.accounting-product-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
  color: #111827;
}

.accounting-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 28px;
  padding: 28px 20px;
  background: rgba(255, 255, 255, 0.88);
  border-right: 1px solid rgba(226, 232, 240, 0.82);
  box-shadow: 14px 0 44px rgba(15, 23, 42, 0.05);
}

.accounting-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #111827;
  text-decoration: none;
  font-weight: 900;
}

.accounting-sidebar-brand img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.accounting-home-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  color: #475569;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 850;
}

.accounting-app-switcher {
  display: grid;
  gap: 7px;
  align-content: start;
}

.accounting-app-switcher a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #475569;
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 750;
}

.accounting-app-switcher a.is-active,
.accounting-app-switcher a:hover {
  color: #4f46e5;
  background: #ede9fe;
}

.accounting-menu-group {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
}

.accounting-menu-title {
  appearance: none;
  border: 0;
  background: transparent;
  color: #111827;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0;
  font: inherit;
  text-align: left;
}

.accounting-book-icon {
  width: 18px;
  height: 18px;
  border: 1.8px solid #111827;
  border-radius: 2px;
  box-shadow: inset 7px 0 0 rgba(79, 70, 229, 0.08);
}

.accounting-subnav {
  display: grid;
  gap: 2px;
  padding-left: 22px;
}

.accounting-subnav a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #1f2937;
  text-decoration: none;
  font-size: 0.93rem;
}

.accounting-subnav a span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accounting-subnav a.is-active,
.accounting-subnav a:hover {
  color: #6d28d9;
  background: #f3f0ff;
}

.accounting-subnav em {
  color: #db2777;
  font-style: normal;
  font-size: 0.72rem;
}

.accounting-nav-icon,
.accounting-kpi-icon,
.transaction-icon,
.bank-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 0.66rem;
  font-weight: 900;
}

.accounting-sidebar-help {
  display: grid;
  gap: 4px;
  padding: 16px;
  border-radius: 16px;
  background: #f3f0ff;
  color: #475569;
  font-size: 0.84rem;
}

.accounting-sidebar-help strong {
  color: #111827;
}

.accounting-product-main {
  display: grid;
  gap: 22px;
  padding: 34px;
}

.accounting-simple-shell {
  display: grid;
  gap: 22px;
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 34px 0;
}

/* Prevent grid items from expanding the shell beyond its width */
.accounting-simple-shell > * {
  min-width: 0;
  width: 100%;
}

.accounting-simple-header {
  padding: 22px 24px;
}

.accounting-product-header,
.accounting-panel,
.accounting-kpi-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  box-shadow: 0 16px 45px rgba(15, 23, 42, 0.06);
}

.accounting-product-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 22px;
}

.accounting-product-header h1,
.accounting-panel h2 {
  margin: 0;
  color: #0f172a;
  letter-spacing: 0;
}

.accounting-product-header p,
.accounting-panel p,
.accounting-kpi-card small {
  color: #64748b;
}

.accounting-header-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.accounting-new-button {
  background: #4f46e5;
  color: #fff;
}

.accounting-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.accounting-module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.accounting-module-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 220px;
}

.accounting-module-card h2 {
  margin: 0;
}

.accounting-module-card p {
  margin: 0;
}

.accounting-transaction-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

.accounting-transactions-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.accounting-tabs {
  display: flex;
  gap: 18px;
  border-bottom: 1px solid #e2e8f0;
  margin: -4px -4px 16px;
  padding: 0 4px;
  overflow-x: auto;
}

.accounting-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #334155;
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.accounting-tabs a.is-active {
  color: #4f46e5;
  border-color: #4f46e5;
}

.accounting-table-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  margin-bottom: 14px;
}

.accounting-search-field {
  display: block;
}

.accounting-search-field span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.accounting-transactions-table a {
  color: #4f46e5;
  font-weight: 850;
  text-decoration: none;
}

.transaction-type-badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 4px 9px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 850;
}

.accounting-filter-panel {
  display: grid;
  gap: 16px;
}

.accounting-filter-panel label {
  display: grid;
  gap: 7px;
}

.accounting-filter-panel label span {
  color: #475569;
  font-size: 0.82rem;
  font-weight: 800;
}

.accounting-saved-filters {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.accounting-saved-filters a {
  color: #475569;
  text-decoration: none;
  padding: 10px;
  border-radius: 10px;
}

.accounting-saved-filters a.is-active {
  color: #4f46e5;
  background: #f3f0ff;
}

.accounting-date-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #fff;
  font-weight: 850;
}

.accounting-back-link {
  display: inline-flex;
  color: #475569;
  text-decoration: none;
  font-weight: 850;
  margin-bottom: 8px;
}

.accounting-new-transaction-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.accounting-new-main,
.accounting-new-side {
  display: grid;
  gap: 18px;
}

.accounting-type-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.accounting-transaction-type-card {
  min-height: 92px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}

.accounting-transaction-type-card input {
  position: absolute;
  opacity: 0;
}

.accounting-transaction-type-card:has(input:checked) {
  border-color: #6d28d9;
  background: #f5f3ff;
  box-shadow: 0 14px 34px rgba(79, 70, 229, 0.12);
}

.accounting-transaction-type-card strong,
.accounting-transaction-type-card small {
  grid-column: 2;
}

.accounting-transaction-type-card small {
  color: #64748b;
}

.tax-inclusive-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tax-inclusive-toggle-label {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}

.tax-inclusive-toggle {
  display: flex;
  background: rgba(143, 166, 186, 0.12);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.tax-inclusive-opt {
  padding: 5px 14px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.tax-inclusive-opt.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
}

.accounting-toggle-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(124, 200, 244, 0.26);
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(213, 221, 148, 0.18), transparent 36%),
    linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.98));
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.accounting-toggle-card > span {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--ink);
}

.accounting-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.45;
}

.accounting-switch-input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.accounting-switch-track {
  position: relative;
  width: 42px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(238, 231, 223, 0.94), rgba(248, 244, 239, 0.96));
  flex: 0 0 auto;
  box-shadow: 0 8px 14px rgba(64, 80, 96, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.accounting-switch-track::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #9caebf;
  box-shadow: 0 5px 10px rgba(64, 80, 96, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.accounting-switch-input:checked + .accounting-switch-track {
  border-color: rgba(124, 200, 244, 0.38);
  background: linear-gradient(135deg, rgba(213, 221, 148, 0.95), rgba(124, 200, 244, 0.95));
  box-shadow: 0 8px 16px rgba(64, 80, 96, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.accounting-switch-input:checked + .accounting-switch-track::after {
  transform: translateX(18px);
  background: linear-gradient(180deg, #2f5f7a 0%, #203a52 100%);
  box-shadow: 0 6px 12px rgba(32, 58, 82, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.accounting-switch-input:focus-visible + .accounting-switch-track {
  outline: 3px solid rgba(124, 200, 244, 0.28);
  outline-offset: 3px;
}

.accounting-switch-input:disabled + .accounting-switch-track {
  opacity: 0.56;
  background: linear-gradient(180deg, rgba(226, 232, 240, 0.9), rgba(241, 245, 249, 0.92));
  box-shadow: none;
}

.accounting-switch-input:disabled ~ span:last-child {
  opacity: 0.68;
}

.accounting-partner-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(191, 219, 254, 0.9), rgba(167, 243, 208, 0.9));
  color: #0f172a;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  vertical-align: middle;
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.22);
}

.accounting-partner-select-field {
  display: grid;
  gap: 8px;
}

.accounting-partner-select-shell {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 54px;
  border: 1px solid rgba(124, 200, 244, 0.44);
  border-radius: 18px;
  background:
    radial-gradient(circle at 14% 50%, rgba(213, 221, 148, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  box-shadow: 0 14px 28px rgba(64, 80, 96, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.accounting-partner-select-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-left: 12px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(191, 219, 254, 0.95), rgba(167, 243, 208, 0.92));
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.2);
  pointer-events: none;
  z-index: 1;
}

.accounting-partner-select-shell select {
  min-height: 54px;
  width: 100%;
  border: 0;
  border-radius: 0;
  padding: 0 48px 0 12px;
  background: transparent;
  color: var(--ink);
  font-weight: 850;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-shadow: none;
}

.accounting-partner-select-shell::after {
  content: "⌄";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-54%);
  color: #2f5f7a;
  font-size: 1.15rem;
  font-weight: 900;
  pointer-events: none;
}

.accounting-partner-select-shell:focus-within {
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.10), 0 0 0 4px rgba(124, 200, 244, 0.16);
}

.accounting-partner-select-field .helper-text[data-partner-select-role] {
  margin-top: -2px;
  color: #64748b;
  font-weight: 700;
}

.accounting-total-box {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  margin: 4px 2px;
  border-radius: 12px;
  background: #dcfce7;
  color: #166534;
}

.accounting-tax-info-strip {
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(124, 200, 244, 0.12), rgba(167, 139, 250, 0.08));
  border: 1px solid rgba(124, 200, 244, 0.3);
}

.accounting-tax-info-strip:empty {
  display: none;
}

.accounting-tax-info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  padding: 16px 18px;
}

.accounting-tax-info-row > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.accounting-tax-info-row strong {
  font-size: 0.85rem;
  color: #1e293b;
}

.accounting-tax-info-row span {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.4;
}

.accounting-upload-box {
  position: relative;
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 150px;
  padding: 18px;
  border: 1.5px dashed rgba(37, 99, 235, 0.38);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.72), rgba(255, 255, 255, 0.94));
  color: #475569;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.accounting-upload-box:hover,
.accounting-upload-box:focus-within {
  border-color: rgba(37, 99, 235, 0.68);
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.12);
}

.accounting-upload-box input[type="file"],
.accounting-upload-box [data-accounting-receipt-input],
.accounting-upload-input {
  display: none !important;
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
}

.accounting-upload-box strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.accounting-upload-box small {
  max-width: 34ch;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.accounting-upload-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 16px;
  border-radius: 999px;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

[data-accounting-receipt-file] {
  color: #334155 !important;
  font-weight: 700;
}

.accounting-upload-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.9rem;
}

/* ── Floating "paperclip" bill/invoice attach control ─────────────────────── */
.clip-attach {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  text-align: left;
  gap: 16px;
  padding: 16px 52px 16px 18px;
  border-radius: 18px;
  border: 1.5px solid rgba(124, 200, 244, 0.45);
  background:
    linear-gradient(120deg, rgba(238, 247, 253, 0.92), rgba(245, 250, 253, 0.94));
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: border-color 0.18s ease, box-shadow 0.22s ease, transform 0.18s ease;
}
.clip-attach::before {
  /* slow sheen sweep */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 30%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 70%
  );
  transform: translateX(-120%);
  z-index: -1;
}
.clip-attach:hover,
.clip-attach:focus-within {
  border-color: var(--accent-dark);
  box-shadow: 0 18px 40px rgba(16, 32, 48, 0.16);
  transform: translateY(-2px);
}
.clip-attach:hover::before { animation: clipAttachSheen 1.1s ease; }
.clip-attach.is-dragover {
  border-color: var(--accent-dark);
  border-style: dashed;
  box-shadow: 0 0 0 4px rgba(124, 200, 244, 0.28);
  transform: translateY(-2px) scale(1.005);
}

.clip-attach-orb {
  position: relative;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: #fff;
  background: radial-gradient(circle at 30% 25%, var(--navy-soft), var(--navy-deep) 75%);
  box-shadow: 0 10px 24px rgba(16, 32, 48, 0.4);
  animation: clipAttachFloat 3.4s ease-in-out infinite;
}
.clip-attach-orb svg {
  width: 24px;
  height: 24px;
  transform: rotate(8deg);
}
.clip-attach-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(124, 200, 244, 0.6);
  opacity: 0;
}
.clip-attach:hover .clip-attach-ring { animation: clipAttachPulse 1.6s ease-out infinite; }

.clip-attach-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.clip-attach-title {
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.clip-attach-file {
  color: #1e293b !important;
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.clip-attach-status {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.clip-attach-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(124, 200, 244, 0.2);
  color: var(--navy);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

/* Attached / success state (brand green) */
.clip-attach.is-attached {
  border-color: rgba(22, 163, 74, 0.55);
  background: linear-gradient(120deg, rgba(240, 253, 244, 0.92), rgba(236, 253, 245, 0.92));
}
.clip-attach.is-attached .clip-attach-orb {
  background: radial-gradient(circle at 30% 25%, #4ade80, #16a34a 70%);
  box-shadow: 0 10px 24px rgba(22, 163, 74, 0.4);
  color: #fff;
  animation: clipAttachPop 0.4s ease;
}
.clip-attach.is-attached .clip-attach-badge {
  background: rgba(22, 163, 74, 0.14);
  color: #15803d;
}

@keyframes clipAttachFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes clipAttachPulse {
  0% { opacity: 0.8; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.55); }
}
@keyframes clipAttachSheen {
  to { transform: translateX(120%); }
}
@keyframes clipAttachPop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .clip-attach-orb,
  .clip-attach.is-attached .clip-attach-orb { animation: none; }
  .clip-attach:hover .clip-attach-ring { animation: none; }
  .clip-attach:hover::before { animation: none; }
}

/* ── Floating bill-attach action button (FAB) + expandable panel ──────────── */
.bill-inline {
  display: grid;
  gap: 8px;
  margin: 2px 0 4px;
}

.bill-inline-remove {
  display: none;
  justify-self: start;
  padding: 7px 16px;
  border: 1px solid rgba(184, 93, 93, 0.4);
  border-radius: 999px;
  background: rgba(248, 219, 219, 0.45);
  color: var(--error);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.bill-inline-remove:hover {
  background: rgba(248, 219, 219, 0.85);
  border-color: var(--danger);
}
.bill-inline.is-attached .bill-inline-remove { display: inline-flex; }

@media (max-width: 640px) {
  .bill-inline {
    margin-top: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .clip-attach,
  .clip-attach::before,
  .clip-attach-ring {
    animation: none !important;
  }
}

/* Reserve space at the bottom of the transaction form so the floating button
   never sits on top of an input or the Save button on small screens. */
.accounting-simple-shell { padding-bottom: 96px; }

/* Oversized-file error state on the drop zone (brand red) */
.clip-attach.has-error {
  border-color: rgba(184, 93, 93, 0.62);
  background: linear-gradient(120deg, var(--error-soft), rgba(255, 255, 255, 0.95));
}
.clip-attach.has-error .clip-attach-orb {
  background: radial-gradient(circle at 30% 25%, var(--danger), var(--error) 75%);
  box-shadow: 0 10px 24px rgba(184, 93, 93, 0.38);
  color: #fff;
  animation: none;
}
.clip-attach.has-error .clip-attach-status {
  color: var(--error);
  font-weight: 700;
}

.accounting-preview-card {
  display: grid;
  gap: 6px;
  padding: 18px;
  border-radius: 14px;
  background: #f8fafc;
}

.accounting-kpi-card {
  min-height: 150px;
  display: grid;
  gap: 10px;
  padding: 18px;
  overflow: hidden;
}

.accounting-kpi-top {
  display: flex;
  gap: 10px;
  align-items: center;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 800;
}

.accounting-kpi-card strong {
  color: #0f172a;
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1;
}

.accounting-kpi-income .accounting-kpi-icon,
.transaction-in {
  background: #dcfce7;
  color: #16a34a;
}

.accounting-kpi-expense .accounting-kpi-icon,
.transaction-out {
  background: #fee2e2;
  color: #dc2626;
}

.accounting-kpi-profit .accounting-kpi-icon {
  background: #ede9fe;
  color: #6d28d9;
}

.accounting-kpi-receivable .accounting-kpi-icon {
  background: #dbeafe;
  color: #2563eb;
}

.accounting-kpi-payable .accounting-kpi-icon {
  background: #ffedd5;
  color: #ea580c;
}

.accounting-sparkline {
  display: flex;
  align-items: end;
  gap: 4px;
  height: 26px;
  margin-top: 2px;
}

.accounting-sparkline span {
  flex: 1;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(180deg, #22c55e, #86efac);
}

.accounting-visual-grid,
.accounting-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 18px;
}

.accounting-panel {
  padding: 20px;
}

.accounting-ledger-panel {
  padding: 0;
  overflow: hidden;
}

/* Scroll fade hint on the right side of the table */
.accounting-ledger-panel .table-wrap {
  position: relative;
}

.accounting-ledger-panel .table-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 40px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.92));
  pointer-events: none;
  border-radius: 0 0 18px 0;
}

.accounting-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 18px;
}

.accounting-panel-header-padded {
  padding: 26px 26px 0;
  margin-bottom: 18px;
}

.accounting-ledger-panel .data-table th,
.accounting-ledger-panel .data-table td {
  padding-left: 20px;
  padding-right: 20px;
  white-space: nowrap;
}

/* Party/memo column can wrap since it has the most text */
.accounting-ledger-panel .data-table td:nth-child(3) {
  white-space: normal;
  min-width: 100px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.accounting-panel-header p {
  margin: 4px 0 0;
  font-size: 0.9rem;
}

/* ── Tax / GST / VAT Summary Report ─────────────────────────────── */
.tax-period-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.tax-period-label {
  font-size: 0.82rem;
  color: var(--muted);
}
.tax-period-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.tax-period-tab {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--muted);
  background: rgba(143, 166, 186, 0.10);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.tax-period-tab:hover {
  background: rgba(143, 166, 186, 0.20);
  color: var(--ink);
}
.tax-period-tab.active {
  background: var(--ink);
  color: #fff;
}
.tax-period-range {
  font-size: 0.78rem;
  color: var(--muted);
  margin-left: auto;
}

.tax-summary-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.tax-kpi-card {
  padding: 20px 22px;
}
.tax-kpi-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 8px;
}
.tax-kpi-tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(143, 166, 186, 0.12);
  color: var(--muted);
}
.tax-kpi-amount {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 4px;
}
.tax-kpi-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

.tax-kpi-out .tax-kpi-amount {
  color: #b45309;
}
.tax-kpi-out .tax-kpi-eyebrow {
  color: #b45309;
}
.tax-kpi-in .tax-kpi-amount {
  color: #15803d;
}
.tax-kpi-in .tax-kpi-eyebrow {
  color: #15803d;
}
.tax-net-payable .tax-kpi-amount {
  color: #b91c1c;
}
.tax-net-refund .tax-kpi-amount {
  color: #1d4ed8;
}
.tax-net-zero .tax-kpi-amount {
  color: var(--muted);
}

.accounting-ledger-panel .tax-summary-table-wrap::after {
  display: none;
}

.tax-summary-table {
  min-width: 560px;
  table-layout: fixed;
}

.tax-summary-table.is-tax-registered {
  min-width: 720px;
}

.accounting-ledger-panel .tax-summary-table th,
.accounting-ledger-panel .tax-summary-table td {
  white-space: normal;
}

.tax-summary-table .num {
  text-align: right;
  white-space: nowrap;
}

.tax-summary-table.is-tax-simple th:nth-child(1),
.tax-summary-table.is-tax-simple td:nth-child(1) {
  width: 36%;
}

.tax-summary-table.is-tax-simple th:nth-child(2),
.tax-summary-table.is-tax-simple td:nth-child(2),
.tax-summary-table.is-tax-simple th:nth-child(3),
.tax-summary-table.is-tax-simple td:nth-child(3) {
  width: 25%;
}

.tax-summary-table.is-tax-simple th:nth-child(4),
.tax-summary-table.is-tax-simple td:nth-child(4) {
  width: 16%;
}

.tax-count-label-short {
  display: none;
}

.tax-col-out {
  color: #92400e;
  background: rgba(251, 191, 36, 0.06);
}
.tax-col-in {
  color: #166534;
  background: rgba(22, 163, 74, 0.06);
}

/* ── Transactions highlight filter ──────────────────────────────── */
/* Ledger panel header: title + filters stacked */
.tx-ledger-header {
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  margin-bottom: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(143, 166, 186, 0.18);
}

.tx-ledger-title h2 {
  margin: 0;
}
.tx-ledger-title p {
  margin: 3px 0 0;
}

/* Transaction filter bar — custom dropdowns */
.tx-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Custom dropdown trigger */
.tx-filter-dropdown {
  position: relative;
}

.tx-filter-btn {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid rgba(100, 116, 139, 0.28);
  border-radius: 10px;
  background: var(--panel);
  font-size: 0.83rem;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tx-filter-btn::-webkit-details-marker {
  display: none;
}
.tx-filter-btn::marker {
  display: none;
}

.tx-filter-btn svg {
  flex-shrink: 0;
  transition: transform 0.15s;
  color: #64748b;
}

.tx-filter-dropdown[open] .tx-filter-btn {
  border-color: rgba(79, 70, 229, 0.5);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.tx-filter-dropdown[open] .tx-filter-btn svg {
  transform: rotate(180deg);
}

/* Dropdown menu panel */
.tx-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 200;
  background: var(--panel);
  border: 1px solid rgba(143, 166, 186, 0.25);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  min-width: 175px;
  padding: 4px;
  max-height: min(48vh, 320px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Individual option links */
.tx-filter-item {
  display: block;
  padding: 9px 12px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.83rem;
  border-radius: 8px;
  white-space: nowrap;
  transition: background 0.1s;
}

.tx-filter-item:hover {
  background: rgba(79, 70, 229, 0.07);
}

.tx-filter-item.active {
  color: var(--accent, #4f46e5);
  font-weight: 600;
  background: rgba(79, 70, 229, 0.05);
}

.tx-filter-clear {
  font-size: 0.78rem;
  color: #64748b;
  text-decoration: none;
  padding: 7px 10px;
  border-radius: 10px;
  white-space: nowrap;
  border: 1px solid rgba(100, 116, 139, 0.25);
  background: rgba(100, 116, 139, 0.06);
  transition: background 0.15s;
  align-self: center;
}

.tx-filter-clear:hover {
  background: rgba(100, 116, 139, 0.14);
  color: #334155;
}

.tx-highlight-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(251, 191, 36, 0.10);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 10px;
  font-size: 0.83rem;
  color: #92400e;
  margin-top: 12px;
}
.tx-highlight-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  flex-shrink: 0;
  animation: pulse-dot 1.5s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.3);
  }
}
.tx-highlight-clear {
  margin-left: auto;
  font-size: 0.78rem;
  color: #92400e;
  text-decoration: none;
  white-space: nowrap;
  opacity: 0.7;
}
.tx-highlight-clear:hover {
  opacity: 1;
}

.accounting-row-flagged td {
  background: rgba(251, 191, 36, 0.07);
  border-bottom-color: rgba(251, 191, 36, 0.25) !important;
}
.accounting-row-flagged {
  border-left: 3px solid #f59e0b;
}

.tx-missing-tax-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.15);
  color: #b45309;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.tax-warning-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  background: rgba(251, 191, 36, 0.10);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: var(--radius);
}
.tax-warning-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.tax-warning-banner strong {
  display: block;
  margin-bottom: 3px;
  color: #92400e;
}
.tax-warning-banner p {
  margin: 0;
  font-size: 0.85rem;
  color: #78350f;
}

.tax-reg-number {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.tax-reg-number code {
  background: rgba(143, 166, 186, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--ink);
}
.tax-reg-missing {
  margin: 6px 0 0;
  font-size: 0.83rem;
  color: #b45309;
}
.tax-reg-missing a {
  color: #b45309;
}

.tax-col-count {
  color: var(--muted);
  font-size: 0.82rem;
}

.tax-filing-note {
  padding: 20px 24px;
  font-size: 0.88rem;
  line-height: 1.6;
  background: rgba(124, 200, 244, 0.07);
  border: 1px solid rgba(124, 200, 244, 0.25);
}

@media (max-width: 700px) {
  /* KPI cards stack vertically */
  .tax-summary-kpi-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Period tabs: horizontally scrollable, no wrap */
  .tax-period-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    gap: 8px;
  }
  .tax-period-bar::-webkit-scrollbar {
    display: none;
  }
  .tax-period-label {
    display: none;
  }
  .tax-period-tabs {
    flex-wrap: nowrap;
    flex-shrink: 0;
  }
  .tax-period-tab {
    flex-shrink: 0;
  }
  .tax-period-range {
    display: none;
  }

  /* Header: stack title and buttons vertically */
  .split-row-dashboard {
    flex-direction: column;
    gap: 14px;
  }
  .split-row-dashboard .topbar-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  /* KPI cards: tighter padding on mobile */
  .tax-kpi-card {
    padding: 16px 18px;
  }
  .tax-kpi-amount {
    font-size: 1.25rem;
  }

  /* Warning banner: stack vertically */
  .tax-warning-banner {
    flex-direction: column;
    gap: 10px;
  }
  .tax-warning-banner .ghost-button {
    align-self: flex-start;
  }

  /* Filing note: smaller text */
  .tax-filing-note {
    font-size: 0.82rem;
  }

  /* Accounting simple header: tighter */
  .accounting-simple-header {
    padding: 16px;
  }

  /* Panel header padded: tighter */
  .accounting-panel-header-padded {
    padding: 14px 14px 0;
  }
  .accounting-ledger-panel .data-table th,
  .accounting-ledger-panel .data-table td {
    padding-left: 12px;
    padding-right: 12px;
    font-size: 0.8rem;
  }

  /* Filter bar: wrap text */
  .tx-highlight-filter-bar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .tx-highlight-clear {
    margin-left: 0;
  }

  /* Tx filter bar: wrap to 2 per row on mobile */
  .tx-filter-bar {
    gap: 8px;
  }
  .tx-filter-dropdown {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }
  .tx-filter-btn {
    width: 100%;
    box-sizing: border-box;
    justify-content: space-between;
  }
  .tx-ledger-header {
    padding: 14px 14px;
  }

  /* Row actions: hide inline buttons on ≤700px (kebab handled by separate 600px breakpoint) */

  /* Sticky actions column — ⋮ always visible at right edge while table scrolls */
  .accounting-ledger-panel .data-table th:last-child,
  .accounting-ledger-panel .data-table td:last-child {
    position: sticky;
    right: 0;
    background: var(--panel);
    z-index: 2;
    box-shadow: -2px 0 6px rgba(0, 0, 0, 0.06);
  }

  /* KPI grid: 2 columns on mobile — minmax(0,1fr) prevents content overflow */
  .accounting-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  /* KPI cards: tighter, shorter on mobile */
  .accounting-kpi-card {
    min-height: 110px;
    padding: 14px;
    gap: 6px;
  }
  .accounting-kpi-card strong {
    font-size: 1.15rem;
  }
  .accounting-kpi-card small {
    font-size: 0.72rem;
  }
  .accounting-sparkline {
    height: 18px;
  }

  /* Action buttons: full width stacked on mobile */
  .split-row-dashboard .topbar-actions {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }
  .split-row-dashboard .topbar-actions a,
  .split-row-dashboard .topbar-actions button {
    width: 100%;
    text-align: center;
    justify-content: center;
    box-sizing: border-box;
  }

  /* Ledger table: tighter cells on mobile */
  .accounting-ledger-panel .data-table th,
  .accounting-ledger-panel .data-table td {
    padding: 10px 8px;
    font-size: 0.82rem;
  }

  /* Hide Status column on mobile (party stays, table scrolls horizontally) */
  .accounting-ledger-panel .data-table .col-status,
  .accounting-ledger-panel .data-table td:nth-child(5) {
    display: none;
  }

  /* Actions column compact on mobile */
  .accounting-ledger-panel .data-table th:last-child,
  .accounting-ledger-panel .data-table td:last-child {
    padding: 6px 6px;
    width: 44px;
  }

  .accounting-ledger-panel .tax-summary-table th:last-child,
  .accounting-ledger-panel .tax-summary-table td:last-child {
    position: static;
    width: auto;
    background: transparent;
    box-shadow: none;
  }

  .accounting-ledger-panel .tax-summary-table.is-tax-simple th,
  .accounting-ledger-panel .tax-summary-table.is-tax-simple td {
    padding: 10px 8px;
    font-size: 0.8rem;
  }

  .accounting-ledger-panel .tax-summary-table.is-tax-simple th:last-child,
  .accounting-ledger-panel .tax-summary-table.is-tax-simple td:last-child {
    padding-right: 8px;
  }

  .tax-count-label-full {
    display: inline;
  }

  .tax-count-label-short {
    display: none;
  }
}

.accounting-pill,
.accounting-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 750;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.accounting-type-badge-expense {
  background: rgba(234, 88, 12, 0.1);
  color: #c2410c;
}

/* ── Tax report: not-registered info note ───────────────────────────────── */
.tax-not-registered-note {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 0.88rem;
}
.tax-not-registered-note > span {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.tax-not-registered-note strong {
  display: block;
  margin-bottom: 4px;
  color: #4338ca;
}
.tax-not-registered-note p {
  margin: 0;
  color: var(--ink);
}
.tax-not-registered-note a {
  color: #4338ca;
}

/* ── GST-unregistered notice ─────────────────────────────────────────────── */
.gst-unregistered-notice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: rgba(59, 130, 246, 0.07);
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.gst-unregistered-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.gst-unregistered-notice strong {
  display: block;
  margin-bottom: 3px;
  color: #1d4ed8;
}
.gst-unregistered-notice p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink);
}
.gst-unregistered-notice a {
  color: #1d4ed8;
}
.gst-unregistered-tax-note {
  font-size: 0.82rem;
  color: var(--muted);
  background: rgba(100, 116, 139, 0.07);
  border-radius: 6px;
  padding: 8px 12px;
  margin: 0;
  border: 1px solid rgba(100, 116, 139, 0.15);
}

/* ── Multi-currency: FX rate row ─────────────────────────────────────────── */
.fx-rate-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fx-rate-main {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
.fx-converted-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  padding: 8px 14px;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 110px;
  text-align: right;
}
.fx-converted-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 2px;
}
.fx-converted-box strong {
  font-size: 0.95rem;
  color: #059669;
}
.fx-rate-helper[data-fx-state="live"] {
  color: #059669;
}
.fx-rate-helper[data-fx-state="manual"] {
  color: #475569;
}
.fx-rate-helper[data-fx-state="error"] {
  color: #b91c1c;
}

/* ── Foreign currency badge in transaction list ──────────────────────────── */
.tx-foreign-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 5px;
  padding: 1px 6px;
  margin-left: 5px;
  white-space: nowrap;
  vertical-align: middle;
}

@media (max-width: 700px) {
  .gst-unregistered-notice {
    flex-direction: column;
    gap: 8px;
  }
  .fx-rate-main {
    flex-direction: column;
    align-items: stretch;
  }
  .fx-converted-box {
    text-align: left;
  }
}

.accounting-type-badge-revenue {
  background: rgba(79, 70, 229, 0.1);
  color: #4338ca;
}

.accounting-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 850;
  white-space: nowrap;
}

.accounting-status-received,
.accounting-status-paid {
  background: rgba(22, 163, 74, 0.1);
  color: #15803d;
}

.accounting-status-unpaid,
.accounting-status-pending {
  background: rgba(202, 138, 4, 0.1);
  color: #a16207;
}

.accounting-status-voided {
  background: rgba(185, 28, 28, 0.08);
  color: #b91c1c;
}

.accounting-row-voided td {
  opacity: 0.45;
  text-decoration: line-through;
}

.accounting-row-voided .accounting-status-pill {
  text-decoration: none;
}

.accounting-void-btn {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(185, 28, 28, 0.3);
  background: rgba(185, 28, 28, 0.06);
  color: #b91c1c;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.accounting-void-btn:hover {
  background: rgba(185, 28, 28, 0.14);
}

.accounting-row-actions {
  white-space: nowrap;
  padding: 0 4px;
}

.row-actions-inline {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Kebab (⋮) button — hidden on desktop, shown on mobile */
.row-kebab-btn {
  display: none; /* shown via mobile media query */
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(100, 116, 139, 0.22);
  background: var(--panel);
  color: #64748b;
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  line-height: 1;
  letter-spacing: 0;
  padding: 0;
  font-family: inherit;
  flex-shrink: 0;
}

.row-kebab-btn:active {
  background: rgba(79, 70, 229, 0.08);
  border-color: rgba(79, 70, 229, 0.5);
}

/* Fixed-position dropdown — JS sets top/right, we just style it */
@media (min-width: 600px) {
  .row-actions-inline {
    display: flex;
  }
  .row-kebab-btn {
    display: none !important;
  }
}

@media (max-width: 599px) {
  .row-actions-inline {
    display: none;
  }
  .row-kebab-btn {
    display: flex;
  }
}

/* Mobile action sheet — slides up from bottom, no z-index battle */
.tx-action-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tx-action-sheet {
  background: var(--panel);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 500px;
  padding: 0 0 8px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
}

.tx-action-sheet-handle {
  width: 36px;
  height: 4px;
  background: rgba(100, 116, 139, 0.25);
  border-radius: 2px;
  margin: 10px auto 8px;
}

.tx-action-sheet-items {
  padding: 0 12px;
}

.tx-sheet-item {
  display: block;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 500;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(143, 166, 186, 0.15);
  cursor: pointer;
  box-sizing: border-box;
  white-space: nowrap;
}

.tx-sheet-item:last-child {
  border-bottom: none;
}
.tx-sheet-item:active {
  background: rgba(100, 116, 139, 0.08);
}

/* Reset .accounting-detail-btn overrides when used as an action sheet item */
.tx-action-sheet .tx-sheet-item.accounting-detail-btn {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  border-radius: 0 !important;
  border: none !important;
  border-bottom: 1px solid rgba(143, 166, 186, 0.15) !important;
  background: none !important;
  text-align: left !important;
  padding: 14px 16px !important;
  justify-content: flex-start;
  color: var(--ink) !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
}

.tx-sheet-danger {
  color: #b91c1c;
}

.tx-action-sheet-cancel {
  display: block;
  width: calc(100% - 24px);
  margin: 8px 12px 0;
  padding: 14px;
  background: rgba(100, 116, 139, 0.08);
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.tx-action-sheet-cancel:active {
  background: rgba(100, 116, 139, 0.16);
}

.accounting-detail-btn,
.accounting-receipt-btn,
.accounting-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
}

.accounting-detail-btn:hover,
.accounting-receipt-btn:hover,
.accounting-edit-btn:hover {
  background: var(--accent-soft);
  color: var(--ink);
  border-color: var(--accent);
}

.accounting-receipt-btn {
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(37, 99, 235, 0.06);
}

.accounting-restore-btn {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(22, 163, 74, 0.3);
  background: rgba(22, 163, 74, 0.07);
  color: #16a34a;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.accounting-restore-btn:hover {
  background: rgba(22, 163, 74, 0.15);
}

.accounting-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: 4px;
  border-radius: 50%;
  border: 1px solid rgba(185, 28, 28, 0.25);
  background: rgba(185, 28, 28, 0.06);
  color: #b91c1c;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}

.accounting-delete-btn:hover {
  background: rgba(185, 28, 28, 0.12);
  border-color: rgba(185, 28, 28, 0.35);
}

.tx-detail-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 32, 48, 0.45);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.tx-receipt-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 32, 48, 0.54);
  z-index: 940;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.tx-detail-modal {
  background: var(--panel);
  border-radius: 24px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 28px 36px;
  box-shadow: 0 16px 60px rgba(16, 32, 48, 0.22);
  animation: txSlideUp 0.2s ease;
}

.tx-receipt-modal {
  background: var(--panel);
  border-radius: 18px;
  width: min(960px, 96vw);
  height: min(86vh, 820px);
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-shadow: 0 18px 70px rgba(16, 32, 48, 0.26);
  animation: txSlideUp 0.2s ease;
}

@keyframes txSlideUp {
  from {
    transform: translateY(16px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.tx-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.tx-detail-header strong {
  font-size: 1.05rem;
}

.tx-detail-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--muted);
}

.tx-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
  margin: 0;
}

.tx-detail-grid dt {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.tx-detail-grid dd {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 4px;
}

.tx-detail-receipt-open {
  width: auto;
  min-width: 0;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.tx-receipt-preview {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
}

.tx-receipt-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.tx-receipt-preview-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
}

.tx-receipt-preview-head span,
.tx-receipt-loading,
.tx-receipt-error {
  color: var(--muted);
  font-size: 0.78rem;
}

.tx-receipt-preview img,
.tx-receipt-preview iframe {
  display: block;
  width: 100%;
  flex: 1;
  height: auto;
  min-height: 0;
  border: 0;
  object-fit: contain;
  background: #ffffff;
}

.tx-receipt-loading,
.tx-receipt-error {
  padding: 18px;
}

.accounting-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 800;
}

.accounting-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.accounting-chart-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-income {
  background: #10b981;
}
.legend-expense {
  background: #f97316;
}
.legend-profit {
  background: #4f46e5;
}

.accounting-bar-chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(46px, 1fr));
  gap: 14px;
  align-items: end;
  min-height: 220px;
  padding-top: 20px;
}

.accounting-bar-group {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.accounting-bars {
  height: 150px;
  display: flex;
  align-items: end;
  gap: 5px;
  padding-inline: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.accounting-bars span {
  width: 12px;
  border-radius: 6px 6px 0 0;
}

.bar-income {
  background: #10b981;
}
.bar-expense {
  background: #fb923c;
}
.bar-profit {
  background: #6366f1;
}

.accounting-breakdown {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.accounting-donut {
  width: 176px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 42%, transparent 43%),
    conic-gradient(
    #4f46e5 0 28%,
    #22c55e 28% 60%,
    #f97316 60% 76%,
    #60a5fa 76% 88%,
    #a78bfa 88% 100%
  );
}

.accounting-donut strong,
.accounting-donut span {
  grid-area: 1 / 1;
}

.accounting-donut strong {
  align-self: center;
  color: #0f172a;
}

.accounting-donut span {
  align-self: end;
  margin-bottom: 54px;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
}

.accounting-breakdown-list {
  display: grid;
  gap: 12px;
}

.accounting-breakdown-list p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}

.accounting-breakdown-list span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.breakdown-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.breakdown-dot-0 {
  background: #4f46e5;
}
.breakdown-dot-1 {
  background: #22c55e;
}
.breakdown-dot-2 {
  background: #f97316;
}
.breakdown-dot-3 {
  background: #60a5fa;
}

.accounting-transaction-list,
.accounting-bank-list {
  display: grid;
  gap: 10px;
}

.accounting-transaction-row,
.accounting-bank-list div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 11px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}

.accounting-transaction-row strong,
.accounting-bank-list strong {
  display: block;
  color: #0f172a;
  font-size: 0.9rem;
}

.accounting-transaction-row small,
.accounting-bank-list small {
  color: #64748b;
}

.transaction-amount {
  font-size: 0.84rem;
  white-space: nowrap;
}

.accounting-bank-list div {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.bank-icon {
  background: #dbeafe;
  color: #2563eb;
}

.accounting-product-body .data-table {
  min-width: 520px;
}

@media (max-width: 1100px) {
  /* Transaction form inside accounting shell collapses to single column on medium screens */
  .accounting-simple-shell .grid-two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .grid-two,
  .form-grid,
  .accounting-setup-shell,
  .accounting-choice-grid,
  .accounting-choice-grid-compact,
  .accounting-setup-preview {
    grid-template-columns: 1fr;
  }

  .accounting-setup-hero {
    position: static;
  }

  .accounting-product-shell {
    grid-template-columns: 1fr;
  }

  .accounting-sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }

  .accounting-app-switcher {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .accounting-subnav {
    padding-left: 0;
  }

  .accounting-product-main {
    padding: 18px;
  }

  .accounting-simple-shell {
    width: 100%;
    padding: 18px 0;
  }

  .accounting-product-body .shell {
    padding: 18px 16px 0;
  }

  .accounting-product-header,
  .accounting-visual-grid,
  .accounting-lower-grid,
  .accounting-module-grid,
  .accounting-transaction-summary-grid,
  .accounting-transactions-layout,
  .accounting-new-transaction-layout,
  .accounting-type-grid,
  .accounting-breakdown {
    grid-template-columns: 1fr;
  }

  /* KPI grid: 2 columns on tablet/mobile — minmax(0,1fr) prevents content overflow */
  .accounting-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .accounting-table-toolbar {
    grid-template-columns: 1fr;
  }

  .accounting-product-header {
    display: grid;
  }

  .accounting-landing-tabs,
  .accounting-landing-tabs.dashboard-overview-grid,
  .accounting-landing-tabs.hub-app-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .accounting-landing-tablist {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 14px 34px rgba(64, 80, 96, 0.08);
  }

  .accounting-landing-tablist label {
    display: grid;
    min-height: 42px;
    place-items: center;
    padding: 8px 10px;
    border-radius: 13px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
    text-align: center;
    cursor: pointer;
  }

  #accounting-tab-open:checked ~ .accounting-landing-tablist label[for="accounting-tab-open"],
  #accounting-tab-settings:checked
    ~ .accounting-landing-tablist
    label[for="accounting-tab-settings"] {
    background: var(--ink);
    color: #fff;
    box-shadow: 0 10px 24px rgba(24, 48, 68, 0.16);
  }

  .accounting-landing-tabs .accounting-tab-panel {
    display: none;
  }

  #accounting-tab-open:checked ~ .accounting-tab-panel-open,
  #accounting-tab-settings:checked ~ .accounting-tab-panel-settings {
    display: grid;
  }

  .accounting-landing-tabs,
  .accounting-landing-tabs .hub-app-card,
  .accounting-landing-tabs .topbar-actions,
  .accounting-landing-tabs .hub-mini-stats,
  .accounting-landing-tabs .hub-mini-stat {
    min-width: 0;
    max-width: 100%;
  }

  .accounting-landing-tabs .topbar-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 10px;
  }

  .accounting-landing-tabs .topbar-actions a,
  .accounting-landing-tabs .topbar-actions span {
    width: 100%;
    box-sizing: border-box;
    white-space: normal;
  }

  .accounting-header-actions {
    justify-content: stretch;
  }

  .accounting-header-actions a {
    flex: 1;
  }

  .crm-landing-tabs,
  .crm-landing-tabs.dashboard-overview-grid,
  .crm-landing-tabs.hub-app-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .crm-landing-tablist {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 14px 34px rgba(64, 80, 96, 0.08);
  }

  .crm-landing-tablist label {
    display: grid;
    min-height: 42px;
    place-items: center;
    padding: 8px 10px;
    border-radius: 13px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
    text-align: center;
    cursor: pointer;
  }

  #crm-tab-overview:checked ~ .crm-landing-tablist label[for="crm-tab-overview"],
  #crm-tab-actions:checked ~ .crm-landing-tablist label[for="crm-tab-actions"] {
    background: var(--ink);
    color: #fff;
    box-shadow: 0 10px 24px rgba(24, 48, 68, 0.16);
  }

  .crm-landing-tabs .crm-tab-panel {
    display: none;
  }

  #crm-tab-overview:checked ~ .crm-tab-panel-overview,
  #crm-tab-actions:checked ~ .crm-tab-panel-actions {
    display: flex;
  }

  .crm-landing-tabs,
  .crm-landing-tabs .hub-app-card,
  .crm-landing-tabs .topbar-actions {
    min-width: 0;
    max-width: 100%;
  }
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: clip; /* clip doesn't force overflow-y to auto like "hidden" does */
}

/* Instant hide during route transitions — inline script sets this before first paint
   so there is zero flash of old/partial content while the new page loads */
html[data-transitioning] body > :not(#page-loader) {
  visibility: hidden;
}

html[data-transitioning] #page-loader {
  display: flex;
  visibility: visible;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(circle at 10% 12%, rgba(124, 200, 244, 0.24), transparent 22%),
    radial-gradient(circle at 88% 8%, rgba(201, 226, 101, 0.18), transparent 20%),
    radial-gradient(circle at 82% 78%, rgba(124, 200, 244, 0.16), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, #f3f8fd 100%);
  min-height: 100vh;
}

body.hub-page {
  /* overflow-x: clip instead of hidden — "hidden" forces overflow-y to auto (CSS spec),
     creating a body scroll container that swallows touch gestures on iOS.
     "clip" prevents horizontal overflow without creating a scroll container,
     so the window/html element remains the scroll container and touch works correctly. */
  overflow-x: clip;
}

body.hub-page .shell {
  min-height: 100vh; /* fallback */
  min-height: 100svh; /* svh avoids the mobile "scroll snaps to top" bug on short pages */
  height: auto;
  display: flex;
  flex-direction: column;
  padding-top: 22px;
  padding-bottom: 20px;
}

body.hub-page .topbar {
  margin-bottom: 18px;
}

body.hub-page.crm-fullscreen-page .shell {
  max-width: none;
  width: 100%;
  padding-left: 3px;
  padding-right: 3px;
  padding-top: 4px;
  padding-bottom: 4px;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
}

body.hub-page.crm-fullscreen-page .topbar {
  margin-bottom: 4px;
}

body.hub-page.crm-fullscreen-page::before,
body.hub-page.crm-fullscreen-page::after {
  opacity: 0.18;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  z-index: -1;
  border-radius: 999px;
  filter: blur(48px);
  pointer-events: none;
  opacity: 0.75;
}

body::before {
  width: 26rem;
  height: 26rem;
  top: -6rem;
  left: -7rem;
  background: radial-gradient(circle, rgba(124, 200, 244, 0.38) 0%, rgba(124, 200, 244, 0) 72%);
}

body::after {
  width: 24rem;
  height: 24rem;
  right: -6rem;
  bottom: -8rem;
  background: radial-gradient(circle, rgba(201, 226, 101, 0.32) 0%, rgba(201, 226, 101, 0) 72%);
}

body.is-loading {
  cursor: progress;
}

body.is-route-transitioning .shell {
  opacity: 0.995;
  transform: translateY(1px) scale(0.998);
  transition: opacity 160ms ease, transform 160ms ease;
}

a {
  color: inherit;
  text-decoration: none;
  touch-action: manipulation;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  touch-action: manipulation;
}

.shell {
  max-width: 1420px;
  margin: 0 auto;
  padding: 28px;
}

.page-loader {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 22% 18%, rgba(124, 200, 244, 0.14), transparent 22%),
    radial-gradient(circle at 78% 28%, rgba(201, 226, 101, 0.14), transparent 20%),
    rgba(245, 249, 253, 0.78);
  backdrop-filter: blur(12px) saturate(122%);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

html.is-native-mobile-app body {
  background:
    radial-gradient(circle at 22% 18%, rgba(124, 200, 244, 0.1), transparent 22%),
    radial-gradient(circle at 78% 28%, rgba(201, 226, 101, 0.1), transparent 20%),
    linear-gradient(180deg, #eef7fd 0%, #f5f9fd 58%, #eff5fb 100%);
}

.page-loader.is-visible {
  display: flex;
}

.page-loader.is-opening .page-loader-card {
  transform: translateY(2px) scale(0.98);
}

.page-loader-card {
  position: relative;
  min-width: 248px;
  padding: 24px 26px 22px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.92), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.94));
  box-shadow:
    0 28px 68px rgba(64, 80, 96, 0.18),
    0 10px 20px rgba(124, 200, 244, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -14px 24px rgba(14, 27, 44, 0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  overflow: hidden;
}

.page-loader-card strong,
.page-loader-card span {
  margin: 0;
}

.page-loader-card span {
  color: var(--muted);
}

.page-loader-card::before,
.page-loader-card::after {
  content: "";
  position: absolute;
  inset: auto;
  border-radius: 999px;
  pointer-events: none;
}

.page-loader-card::before {
  width: 92px;
  height: 92px;
  top: -18px;
  right: -22px;
  background: radial-gradient(circle, rgba(124, 200, 244, 0.22), rgba(124, 200, 244, 0));
  filter: blur(8px);
}

.page-loader-card::after {
  width: 68px;
  height: 68px;
  left: -16px;
  bottom: -18px;
  background: radial-gradient(circle, rgba(201, 226, 101, 0.2), rgba(201, 226, 101, 0));
  filter: blur(10px);
}

.page-loader-clay-art {
  position: relative;
  width: 94px;
  height: 72px;
  margin-bottom: 2px;
  animation: page-loader-art-float 2.8s ease-in-out infinite;
}

.page-loader-clay-sheet {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  border: 1px solid rgba(143, 166, 186, 0.2);
  box-shadow: 0 18px 24px rgba(64, 80, 96, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  transform-origin: center center;
}

.page-loader-clay-sheet-back {
  transform: translate(-10px, 8px) rotate(-12deg) scale(0.9);
  background: linear-gradient(145deg, rgba(124, 200, 244, 0.65), rgba(74, 161, 226, 0.55));
  animation: page-loader-sheet-shift-back 2.8s ease-in-out infinite;
}

.page-loader-clay-sheet-mid {
  transform: translate(0, 0) rotate(6deg) scale(0.94);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.94));
  animation: page-loader-sheet-shift-mid 2.8s ease-in-out infinite;
}

.page-loader-clay-sheet-front {
  transform: translate(10px, -6px) rotate(12deg) scale(0.9);
  background: linear-gradient(145deg, rgba(213, 221, 148, 0.88), rgba(213, 221, 148, 0.68));
  animation: page-loader-sheet-shift-front 2.8s ease-in-out infinite;
}

.page-loader-clay-orb {
  position: absolute;
  right: -4px;
  bottom: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(213, 221, 148, 0.98), rgba(124, 200, 244, 0.9));
  box-shadow:
    0 0 0 6px rgba(255, 255, 255, 0.74),
    0 18px 24px rgba(64, 80, 96, 0.18),
    0 0 0 0 rgba(213, 221, 148, 0.24);
  animation: page-loader-orb-pulse 1.4s ease-in-out infinite;
}

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

@keyframes page-loader-orb-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow:
      0 0 0 6px rgba(255, 255, 255, 0.74),
      0 18px 24px rgba(64, 80, 96, 0.18),
      0 0 0 0 rgba(213, 221, 148, 0.24);
  }

  50% {
    transform: scale(1.12);
    box-shadow:
      0 0 0 6px rgba(255, 255, 255, 0.74),
      0 18px 24px rgba(64, 80, 96, 0.18),
      0 0 0 10px rgba(213, 221, 148, 0);
  }
}

@keyframes page-loader-art-float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-3px);
  }
}

@keyframes page-loader-sheet-shift-back {
  0%,
  100% {
    transform: translate(-10px, 8px) rotate(-12deg) scale(0.9);
  }

  50% {
    transform: translate(-12px, 7px) rotate(-13deg) scale(0.91);
  }
}

@keyframes page-loader-sheet-shift-mid {
  0%,
  100% {
    transform: translate(0, 0) rotate(6deg) scale(0.94);
  }

  50% {
    transform: translate(0, -1px) rotate(7deg) scale(0.95);
  }
}

@keyframes page-loader-sheet-shift-front {
  0%,
  100% {
    transform: translate(10px, -6px) rotate(12deg) scale(0.9);
  }

  50% {
    transform: translate(11px, -7px) rotate(13deg) scale(0.91);
  }
}

.topbar,
.split-row,
.builder-header,
.invoice-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 28px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
}

.tagline,
.panel p,
.invoice-list-item p {
  color: var(--muted);
  margin: 0;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.brand-lockup-compact {
  gap: 14px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, #dfe79f 0%, #7cc8f4 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 16px 34px rgba(64, 80, 96, 0.2);
}

.brand-logo-image {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 18px;
  flex-shrink: 0;
  filter: drop-shadow(0 16px 28px rgba(64, 80, 96, 0.18));
}

body.hub-page .topbar {
  margin-bottom: 18px;
}

body.hub-page .brand-logo-image {
  filter: drop-shadow(0 10px 18px rgba(92, 124, 148, 0.1));
}

a.is-routing {
  transform: translateY(-1px) scale(0.98);
  filter: brightness(1.02);
}

body.hub-page .brand-link .brand-logo-image[src*="rapid-hub-icon-animated"] {
  transform-origin: 50% 50%;
  animation: hub-mark-float 5.6s ease-in-out infinite;
  will-change: transform; /* promote to GPU layer so float doesn't interfere with scroll */
}

/* On mobile: strip drop-shadow from all animated logo images.
   filter + transform animation forces GPU to composite the shadow every frame (60fps),
   competing with scroll compositing and causing jank. */
@media (max-width: 700px) {
  body.hub-page .brand-logo-image,
  .brand-logo-image {
    filter: none;
  }
  body.hub-page .hub-sidebar .brand-logo-image {
    transition: opacity 260ms ease, transform 260ms ease;
  }
}

body.hub-page .brand-link:hover .brand-logo-image[src*="rapid-hub-icon-animated"],
body.hub-page .brand-link:focus-visible .brand-logo-image[src*="rapid-hub-icon-animated"] {
  animation-duration: 4.2s;
}

body.hub-page .brand-link .brand-logo-image[src*="crm-icon"] {
  transform-origin: 50% 50%;
  animation: crm-mark-float 5.2s ease-in-out infinite;
}

body.hub-page .brand-link:hover .brand-logo-image[src*="crm-icon"],
body.hub-page .brand-link:focus-visible .brand-logo-image[src*="crm-icon"] {
  animation-duration: 4.2s;
}

body.hub-page .hub-sidebar .brand-logo-image {
  transition: opacity 260ms ease, transform 260ms ease, filter 260ms ease;
  animation: hub-sidebar-icon-float 5.8s ease-in-out infinite;
  transform-origin: 50% 50%;
}

body.hub-page .hub-sidebar.is-icon-swapping .brand-logo-image {
  opacity: 0.48;
  transform: translateY(2px) scale(0.92) rotate(-1deg);
  filter: drop-shadow(0 8px 14px rgba(92, 124, 148, 0.06));
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes hub-mark-float {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-1.5px) scale(1.02);
  }
}

@keyframes hub-sidebar-icon-float {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-2px) scale(1.015);
  }
}

@keyframes crm-mark-float {
  0%,
  100% {
    transform: translateY(0) scale(1) rotate(0deg);
    filter: drop-shadow(0 10px 18px rgba(92, 124, 148, 0.1));
  }

  50% {
    transform: translateY(-2px) scale(1.03) rotate(-1.1deg);
    filter: drop-shadow(0 14px 24px rgba(92, 124, 148, 0.14));
  }
}

.brand-mark-r,
.brand-mark-b {
  position: absolute;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
}

.brand-mark-r {
  color: #173454;
  transform: translate(-6px, -3px);
}

.brand-mark-b {
  color: white;
  transform: translate(7px, 7px);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand-badge {
  color: var(--navy-soft);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateY(-1px);
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.94rem;
}

.brand-lockup-compact .brand-title {
  font-size: 1.22rem;
  line-height: 1;
}

.brand-lockup-compact .brand-subtitle {
  font-size: 0.92rem;
}

.brand-lockup-compact .brand-badge {
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  line-height: 1;
  transform: none;
}

.brand-lockup-compact .brand-title-row {
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
  white-space: nowrap;
}

.eyebrow,
.meta-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--muted);
}

.auth-grid,
.invoice-page {
  display: grid;
  gap: 24px;
}

.auth-grid {
  grid-template-columns: 1.1fr 1fr;
}

.auth-grid-premium {
  gap: 28px;
  align-items: stretch;
  grid-template-columns: minmax(0, 1.18fr) minmax(420px, 0.82fr);
}

.dashboard-v2 {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

body.hub-page .dashboard-v2 {
  gap: 18px;
}

.hub-shell {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.hub-shell,
.settings-page .hub-shell {
  min-height: 0;
}

.settings-page {
  position: relative;
  isolation: isolate;
}

.settings-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background: transparent;
  backdrop-filter: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease, background-color 260ms ease, backdrop-filter 260ms ease;
}

body.modal-open .settings-page::before {
  z-index: 1500;
  opacity: 1;
  background:
    radial-gradient(circle at top, rgba(18, 24, 36, 0.58), rgba(4, 8, 14, 0.82)),
    rgba(3, 7, 12, 0.62);
  backdrop-filter: blur(10px) saturate(70%);
}

body.modal-open .settings-page-content {
  opacity: 0.18;
  transform: scale(0.992) translateY(4px);
  filter: blur(1px);
  transition: opacity 260ms ease, transform 260ms ease, filter 260ms ease;
}

.hub-sidebar {
  position: sticky;
  top: 24px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  scrollbar-width: none;
}

.hub-sidebar::-webkit-scrollbar {
  display: none;
}

body.hub-page .panel,
body.hub-page .hub-sidebar,
body.hub-page .hub-app-card,
body.hub-page .dashboard-metric-card,
body.hub-page .dashboard-link-card,
body.hub-page .hub-recent-item,
body.hub-page .account-summary-chip {
  border-color: rgba(255, 255, 255, 0.82);
  box-shadow:
    0 14px 28px rgba(92, 124, 148, 0.08),
    0 4px 10px rgba(124, 200, 244, 0.035),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -10px 16px rgba(14, 27, 44, 0.01);
}

.brand-link-hub {
  display: block;
  width: 100%;
}

.hub-sidebar-tagline {
  display: none;
  margin: -8px 0 2px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.hub-nav-mobile-head {
  display: none;
}

.hub-nav-view-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 11px;
  background: rgba(143, 166, 186, 0.14);
  border: 1px solid rgba(143, 166, 186, 0.2);
}

.hub-nav-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 26px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--navy);
  opacity: 0.5;
  cursor: pointer;
  transition: background 140ms ease, opacity 140ms ease, color 140ms ease;
}

.hub-nav-view-btn:hover {
  opacity: 0.8;
}

.hub-nav-view-btn.is-active {
  background: #fff;
  opacity: 1;
  color: var(--navy-deep);
  box-shadow: 0 1px 3px rgba(64, 80, 96, 0.16);
}

.hub-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hub-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(185, 201, 219, 0.92);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 252, 0.95));
  box-shadow:
    0 8px 18px rgba(92, 124, 148, 0.06),
    0 2px 5px rgba(124, 200, 244, 0.035),
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -12px 16px rgba(14, 27, 44, 0.01),
    inset 0 0 0 1px rgba(255, 255, 255, 0.3);
  color: var(--navy);
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.hub-nav-link span {
  font-size: 1rem;
  font-weight: 800;
  color: var(--navy-deep);
  letter-spacing: -0.03em;
}

.hub-nav-link small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.hub-nav-link:hover,
.hub-nav-link:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(124, 200, 244, 0.28);
  box-shadow:
    0 12px 22px rgba(92, 124, 148, 0.08),
    0 4px 10px rgba(124, 200, 244, 0.045),
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -12px 18px rgba(14, 27, 44, 0.01),
    inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.hub-nav-link.is-active {
  border-color: rgba(163, 205, 98, 0.55);
  background: linear-gradient(
    135deg,
    rgba(210, 239, 104, 0.22) 0%,
    rgba(255, 255, 255, 0.98) 46%,
    rgba(98, 184, 246, 0.18) 100%
  );
  box-shadow:
    0 14px 28px rgba(64, 80, 96, 0.1),
    0 0 0 1px rgba(163, 205, 98, 0.1) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -12px 18px rgba(14, 27, 44, 0.01);
  animation: nav-active-pulse 3.6s ease-in-out infinite;
}

.hub-nav-link--locked {
  opacity: 0.6;
  border-style: dashed;
  cursor: pointer;
  color: rgba(86, 102, 120, 0.9);
  background: linear-gradient(180deg, rgba(245, 247, 250, 0.92), rgba(236, 240, 244, 0.9));
  border-color: rgba(179, 191, 203, 0.82);
  filter: grayscale(0.12);
  user-select: none;
}

.hub-nav-link--locked:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}

.hub-nav-link--locked span,
.hub-nav-link--locked small {
  color: rgba(86, 102, 120, 0.88);
}

.hub-nav-lock-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--lime-dark, #c4d063);
  color: var(--navy-deep, #102030);
  border-radius: 4px;
  padding: 0.1em 0.45em;
  margin-left: 0.35rem;
  vertical-align: middle;
  line-height: 1.5;
}

/* Reusable inline plan-gate badge (PRO / BUSINESS) shown next to locked features */
.plan-gate-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: var(--lime-dark, #c4d063);
  color: var(--navy-deep, #102030);
  border-radius: 4px;
  padding: 0.12em 0.5em;
  line-height: 1.5;
  vertical-align: middle;
  flex-shrink: 0;
}

.hub-nav-link-coming-soon {
  opacity: 0.55;
  border-style: dashed;
  cursor: default;
  pointer-events: none;
  color: rgba(86, 102, 120, 0.9);
  background: linear-gradient(180deg, rgba(245, 247, 250, 0.92), rgba(236, 240, 244, 0.9));
  border-color: rgba(179, 191, 203, 0.82);
  filter: grayscale(0.12);
}

.hub-nav-link-coming-soon:hover {
  transform: none;
}

.hub-nav-link-coming-soon span,
.hub-nav-link-coming-soon small {
  color: rgba(86, 102, 120, 0.88);
}

.hub-sidebar-footer {
  padding: 16px 16px 2px;
  border-top: 1px solid rgba(214, 225, 236, 0.72);
}

.hub-sidebar-footer p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.hub-welcome-kicker {
  display: block;
  color: var(--navy-soft);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 2px;
  transition: opacity 220ms ease, transform 220ms ease;
  will-change: opacity, transform;
}

.hub-welcome-kicker.is-changing {
  opacity: 0;
  transform: translateY(-2px);
}

.hub-main {
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  padding-bottom: 24px;
}

.hub-nav-home-card {
  cursor: default;
}

.hub-nav-home-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: inherit;
  text-decoration: none;
}

.hub-nav-overview-btn {
  display: none;
  margin-top: 10px;
  padding: 7px 16px;
  border: 1.5px solid var(--accent-dark);
  border-radius: 20px;
  background: rgba(124, 200, 244, 0.1);
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  width: fit-content;
  transition: background 150ms ease;
}

.hub-nav-overview-btn:hover {
  background: rgba(124, 200, 244, 0.22);
}

@media (max-width: 640px) {
  .hub-nav-home-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .hub-nav-home-card .hub-nav-home-link {
    flex: 1;
    min-width: 0;
  }

  .hub-nav-overview-btn {
    display: inline-flex;
    align-items: center;
    margin-top: 0;
    flex-shrink: 0;
  }

}

.overview-standalone-page .hub-shell,
.overview-standalone-page .hub-sidebar {
  display: none;
}

.overview-page-shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 18px 48px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.overview-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.overview-back-btn:hover {
  text-decoration: underline;
}

.crm-fullscreen-page {
  overflow: hidden;
}

.crm-fullscreen-page .hub-main {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.crm-fullscreen-shell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.crm-fullscreen-frame-panel {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  padding: 0;
  margin: 0;
  overflow: hidden;
  display: flex;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.crm-fullscreen-frame-shell {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.crm-embed-frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: 0;
  background: transparent;
}

.crm-fullscreen-frame {
  height: 100%;
}

.billing-fullscreen-page .hub-sidebar {
  display: none;
}

.billing-fullscreen-shell {
  display: block;
}

.billing-fullscreen-shell .hub-main {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

.analytics-fullscreen-page {
  overflow: hidden;
}

.analytics-fullscreen-page .hub-sidebar {
  display: none;
}

.analytics-fullscreen-page .hub-main {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.analytics-fullscreen-shell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.analytics-fullscreen-page .shell {
  max-width: none;
  width: 100%;
  padding-left: 3px;
  padding-right: 3px;
  padding-top: 120px;
  padding-bottom: 4px;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
}

body.hub-page.analytics-fullscreen-page .shell {
  padding-top: 120px;
}

.analytics-fullscreen-page .topbar {
  position: fixed;
  top: 8px;
  left: 8px;
  right: 24px;
  z-index: 240;
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 18px;
  border: 1px solid rgba(185, 201, 219, 0.32);
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 20%, rgba(124, 200, 244, 0.22), transparent 32%),
    linear-gradient(135deg, rgba(238, 249, 255, 0.96), rgba(247, 252, 242, 0.94));
  box-shadow: 0 18px 34px rgba(64, 80, 96, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.analytics-fullscreen-page .topbar .brand-logo-image {
  width: 64px;
  height: 64px;
}

.analytics-fullscreen-page .sticky-note-center {
  z-index: 230;
}

@media (max-width: 640px) {
  .analytics-fullscreen-page .analytics-hub-main {
    padding: 12px 12px 20px;
    gap: 12px;
    overflow-x: hidden;
  }

  .analytics-fullscreen-page .analytics-hero {
    padding: 18px 16px 14px;
    border-radius: 22px;
  }

  .analytics-fullscreen-page .analytics-hero-inner {
    gap: 12px;
  }

  .analytics-fullscreen-page .analytics-hero-title {
    font-size: clamp(1.22rem, 5.1vw, 1.55rem);
    line-height: 1.05;
  }

  .analytics-fullscreen-page .analytics-hero-sub {
    max-width: 28ch;
    line-height: 1.45;
  }

  .analytics-fullscreen-page .analytics-hero-badge {
    width: 100%;
    padding: 12px 14px;
    align-items: flex-start;
    border-radius: 14px;
  }

  .analytics-fullscreen-page .analytics-filter-bar-form {
    padding: 12px;
    gap: 10px;
    border-radius: 24px;
    background:
      radial-gradient(circle at top right, rgba(124, 200, 244, 0.16), transparent 32%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 249, 253, 0.97));
    box-shadow:
      0 16px 34px rgba(64, 80, 96, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.94);
  }

  .analytics-fullscreen-page .analytics-filter-chips-row {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .analytics-fullscreen-page .analytics-filter-chips-row::-webkit-scrollbar {
    display: none;
  }

  .analytics-fullscreen-page .analytics-chip {
    flex: 0 0 auto;
    height: 36px;
    padding: 0 14px;
    border-radius: 14px;
    font-size: 0.78rem;
  }

  .analytics-fullscreen-page .analytics-filter-date-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-left: 0;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.66);
    border: 1px solid rgba(143, 166, 186, 0.18);
  }

  .analytics-fullscreen-page .analytics-date-input {
    width: 100%;
    min-width: 0;
    height: 42px;
    border-radius: 12px;
    font-size: 0.84rem;
  }

  .analytics-fullscreen-page .analytics-date-sep {
    font-size: 0.95rem;
  }

  .analytics-fullscreen-page .analytics-filter-right {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding-left: 0;
    border-left: 0;
  }

  .analytics-fullscreen-page .analytics-filter-right > :first-child {
    grid-column: 1 / -1;
  }

  .analytics-fullscreen-page .analytics-filter-right > :nth-child(2) {
    grid-column: 1 / -1;
  }

  .analytics-fullscreen-page .analytics-filter-right > :nth-child(3),
  .analytics-fullscreen-page .analytics-filter-right > :nth-child(4) {
    min-width: 0;
  }

  .analytics-fullscreen-page .analytics-currency-badge {
    width: 100%;
    justify-content: center;
    height: 38px;
  }

  .analytics-fullscreen-page .analytics-icon-btn {
    width: 100%;
    height: 42px;
    border-radius: 14px;
    justify-content: center;
  }

  .analytics-fullscreen-page .analytics-icon-btn--accent {
    grid-column: 1 / -1;
  }

  .analytics-fullscreen-page .analytics-body {
    gap: 12px;
  }
}

.hub-app-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.hub-app-card {
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 253, 0.96));
  box-shadow:
    0 14px 28px rgba(92, 124, 148, 0.08),
    0 4px 10px rgba(124, 200, 244, 0.035),
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -10px 16px rgba(14, 27, 44, 0.01);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.hub-app-card[data-hub-crm-stats-root].is-loading [data-hub-crm-stat],
.hub-app-card[data-hub-crm-stats-root].is-loading [data-hub-crm-quick-summary] {
  position: relative;
  display: inline-block;
  align-items: center;
  color: transparent;
  text-shadow: none;
  white-space: nowrap;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(220, 228, 236, 0.7),
    rgba(244, 249, 253, 0.96),
    rgba(220, 228, 236, 0.7)
  );
  background-size: 200% 100%;
  animation: hub-loading-shimmer 1.25s ease-in-out infinite;
}

.hub-app-card[data-hub-crm-stats-root].is-loading [data-hub-crm-stat] {
  min-width: 2.5ch;
  min-height: 1em;
  vertical-align: middle;
}

.hub-app-card[data-hub-crm-stats-root].is-loading [data-hub-crm-stat="pipelines"],
.hub-app-card[data-hub-crm-stats-root].is-loading [data-hub-crm-stat="deals"],
.hub-app-card[data-hub-crm-stats-root].is-loading [data-hub-crm-stat="contacts"] {
  min-width: 2ch;
}

.hub-app-card[data-hub-crm-stats-root].is-loading [data-hub-crm-stat="most-active-pipeline"] {
  min-width: 14ch;
  min-height: 1.1em;
}

.hub-app-card[data-hub-crm-stats-root].is-loading
  [data-hub-crm-stat="most-active-pipeline-detail"] {
  min-width: 18ch;
  min-height: 1em;
  opacity: 0.82;
}

.hub-app-card[data-hub-crm-stats-root].is-loading [data-hub-crm-quick-summary] {
  min-width: 17ch;
  min-height: 1em;
}

.hub-app-card[data-hub-crm-stats-root].is-loading .hub-action-summary {
  color: var(--muted);
}

.hub-app-card[data-hub-crm-stats-root].is-loading .hub-action-status::before {
  opacity: 1;
}

.hub-action-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hub-action-summary,
.hub-action-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hub-action-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.hub-action-status::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 999px;
  border: 2px solid rgba(34, 52, 78, 0.15);
  border-top-color: rgba(34, 52, 78, 0.7);
  opacity: 0;
  animation: hub-spin 0.8s linear infinite;
}

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

@keyframes hub-loading-shimmer {
  0% {
    background-position: 200% 50%;
  }

  100% {
    background-position: -200% 50%;
  }
}

.hub-app-card:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 200, 244, 0.35);
  box-shadow:
    0 18px 32px rgba(92, 124, 148, 0.1),
    0 6px 12px rgba(124, 200, 244, 0.045),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -10px 16px rgba(14, 27, 44, 0.01);
}

.hub-app-card h2,
.hub-app-card p {
  margin: 0;
}

.hub-app-card h2 {
  color: var(--navy-deep);
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.hub-app-card p {
  color: var(--muted);
  line-height: 1.5;
}

.hub-app-card-coming-soon {
  border-style: dashed;
  border-color: rgba(160, 180, 200, 0.32);
  cursor: default;
}

.hub-app-card-coming-soon:hover {
  transform: none;
}

.hub-quick-actions {
  margin-top: 2px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-usage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: 18px;
  align-items: stretch;
}

.dashboard-usage-panel {
  min-height: 100%;
}

.dashboard-usage-billing {
  background:
    radial-gradient(circle at top right, rgba(124, 200, 244, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.95));
}

.dashboard-usage-chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.dashboard-usage-chip {
  padding: 16px 16px 15px;
  border-radius: 18px;
  border: 1px solid rgba(214, 225, 236, 0.8);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 20px rgba(92, 124, 148, 0.06);
}

.dashboard-usage-chip span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dashboard-usage-chip strong {
  display: block;
  margin-top: 8px;
  color: var(--navy);
  font-size: 1.4rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.dashboard-usage-chip small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.dashboard-mini-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-mini-kpis > div {
  padding: 12px 10px;
  border-radius: 18px;
  border: 1px solid rgba(214, 225, 236, 0.8);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 20px rgba(92, 124, 148, 0.05);
  min-width: 0;
  overflow: visible;
}

.dashboard-mini-kpis .eyebrow {
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.dashboard-mini-kpis strong {
  display: block;
  margin-top: 8px;
  color: var(--navy);
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.dashboard-usage-footnote {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.dashboard-usage-footnote span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(214, 225, 236, 0.8);
  background: rgba(255, 255, 255, 0.88);
  color: var(--navy-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.dashboard-home-secondary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.hub-recent-list {
  display: grid;
  gap: 10px;
}

.hub-recent-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(214, 225, 236, 0.82);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 20px rgba(92, 124, 148, 0.06);
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.hub-recent-item:hover {
  transform: translateY(-1px);
  border-color: rgba(124, 200, 244, 0.26);
  box-shadow: 0 14px 24px rgba(92, 124, 148, 0.08);
}

.hub-recent-item strong {
  color: var(--navy-deep);
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}

.hub-recent-item span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.shell-document {
  max-width: none;
}

body.hub-page.docs-page {
  overflow-x: clip;
}

.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;
}

body.hub-page.docs-page .docs-page-content {
  min-width: 0;
}

/* Public /docs: no hub sidebar, centered content column. */
body.hub-page.docs-page .docs-public-shell {
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
}

body.hub-page.docs-page .docs-hero-meta-cta {
  gap: 10px;
}

/* ---- Hero ---------------------------------------------------------------- */
body.hub-page.docs-page .docs-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.75fr);
  gap: 26px;
  align-items: stretch;
  padding: 30px 34px;
  border-radius: var(--radius);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(124, 200, 244, 0.16), transparent 55%),
    radial-gradient(120% 140% at 100% 0%, rgba(213, 221, 148, 0.18), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.96));
}

body.hub-page.docs-page .docs-hero-glow {
  position: absolute;
  inset: auto -120px -160px auto;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 200, 244, 0.28), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}

body.hub-page.docs-page .docs-hero-main {
  position: relative;
  min-width: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

body.hub-page.docs-page .docs-hero h1 {
  margin: 0;
  font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.4rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

body.hub-page.docs-page .docs-hero-lede {
  margin: 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

body.hub-page.docs-page .docs-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
}

body.hub-page.docs-page .docs-meta-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.hub-page.docs-page .docs-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  border: 1px solid transparent;
}

body.hub-page.docs-page .docs-badge-workspace {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--line-strong);
  color: var(--navy-deep);
}

body.hub-page.docs-page .docs-badge-plan::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

body.hub-page.docs-page .docs-badge-plan-free {
  background: rgba(143, 166, 186, 0.16);
  border-color: rgba(143, 166, 186, 0.4);
  color: var(--navy-soft);
}

body.hub-page.docs-page .docs-badge-plan-pro {
  background: var(--accent-soft);
  border-color: rgba(124, 200, 244, 0.55);
  color: var(--accent-dark);
}

body.hub-page.docs-page .docs-badge-plan-business {
  background: var(--gold-soft);
  border-color: rgba(241, 207, 140, 0.6);
  color: #b08436;
}

/* ---- Search -------------------------------------------------------------- */
body.hub-page.docs-page .docs-search-panel {
  position: relative;
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

body.hub-page.docs-page .docs-search-field {
  position: relative;
  display: flex;
  align-items: center;
}

body.hub-page.docs-page .docs-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 19px;
  height: 19px;
  color: var(--navy-soft);
  opacity: 0.7;
  pointer-events: none;
}

body.hub-page.docs-page .docs-search-field input {
  font-weight: 500;
}

body.hub-page.docs-page .docs-search-field input {
  width: 100%;
  min-width: 0;
  padding: 15px 18px 15px 46px;
  border-radius: 16px;
  border: 1px solid rgba(185, 201, 219, 0.85);
  background: rgba(255, 255, 255, 0.95);
  color: var(--navy-deep);
  font: inherit;
  box-shadow:
    0 10px 24px rgba(92, 124, 148, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

body.hub-page.docs-page .docs-search-field input::placeholder {
  color: var(--muted);
}

body.hub-page.docs-page .docs-search-field input:focus {
  outline: none;
  border-color: rgba(124, 200, 244, 0.7);
  box-shadow:
    0 0 0 4px rgba(124, 200, 244, 0.18),
    0 12px 26px rgba(92, 124, 148, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

body.hub-page.docs-page .docs-search-results {
  display: grid;
  gap: 8px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 34px rgba(64, 80, 96, 0.1);
}

body.hub-page.docs-page .docs-search-empty {
  margin: 0;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

body.hub-page.docs-page .docs-search-result {
  display: grid;
  gap: 3px;
  padding: 11px 13px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--navy);
  transition: background 140ms ease;
}

body.hub-page.docs-page .docs-search-result:hover,
body.hub-page.docs-page .docs-search-result:focus-visible {
  background: var(--accent-soft);
  outline: none;
}

body.hub-page.docs-page .docs-search-result strong {
  color: var(--navy-deep);
  font-size: 0.94rem;
}

body.hub-page.docs-page .docs-search-result span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

body.hub-page.docs-page .docs-link-row {
  gap: 8px;
  flex-wrap: wrap;
}

/* ---- App catalogue carousel ---------------------------------------------- */
body.hub-page.docs-page .docs-catalogue {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 18px 16px;
  border-radius: 22px;
  border: 1px solid rgba(124, 200, 244, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(238, 247, 253, 0.94));
  box-shadow: 0 18px 44px rgba(64, 80, 96, 0.1);
}

body.hub-page.docs-page .docs-cat-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

body.hub-page.docs-page .docs-cat-kicker {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.hub-page.docs-page .docs-cat-arrows {
  display: flex;
  gap: 6px;
}

body.hub-page.docs-page .docs-cat-arrow {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.95);
  color: var(--navy);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

body.hub-page.docs-page .docs-cat-arrow svg {
  width: 16px;
  height: 16px;
}

body.hub-page.docs-page .docs-cat-arrow:hover {
  background: var(--accent-soft);
  border-color: rgba(124, 200, 244, 0.6);
  color: var(--navy-deep);
}

body.hub-page.docs-page .docs-cat-viewport {
  overflow: hidden;
  border-radius: 16px;
}

body.hub-page.docs-page .docs-cat-track {
  display: flex;
  align-items: stretch;
  transition: transform 460ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

body.hub-page.docs-page .docs-cat-slide {
  flex: 0 0 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.hub-page.docs-page .docs-cat-slide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

body.hub-page.docs-page .docs-cat-app {
  color: var(--navy-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.hub-page.docs-page .docs-cat-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

body.hub-page.docs-page .docs-cat-badge-ok {
  background: rgba(213, 221, 148, 0.28);
  color: #6b7320;
}

body.hub-page.docs-page .docs-cat-badge-lock {
  background: var(--gold-soft);
  color: #b08436;
}

body.hub-page.docs-page .docs-cat-title {
  color: var(--navy-deep);
  font-weight: 800;
  font-size: 1.04rem;
  line-height: 1.25;
}

body.hub-page.docs-page .docs-cat-bullets {
  list-style: none;
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
}

body.hub-page.docs-page .docs-cat-bullets li {
  position: relative;
  padding-left: 24px;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.4;
}

body.hub-page.docs-page .docs-cat-bullets li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

body.hub-page.docs-page .docs-steps {
  counter-reset: docs-step;
  list-style: none;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
}

body.hub-page.docs-page .docs-steps li {
  counter-increment: docs-step;
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 12px;
  align-items: start;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.45;
}

body.hub-page.docs-page .docs-steps li::before {
  content: counter(docs-step);
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--navy-soft);
  font-size: 0.8rem;
  font-weight: 800;
}

body.hub-page.docs-page .docs-cat-cta {
  margin-top: auto;
  text-align: center;
}

body.hub-page.docs-page .docs-cat-cta-upgrade {
  background: linear-gradient(135deg, var(--gold), #e9bf73);
  color: #5a4413;
}

body.hub-page.docs-page .docs-cat-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
}

body.hub-page.docs-page .docs-cat-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(124, 200, 244, 0.35);
  cursor: pointer;
  transition: width 200ms ease, background 200ms ease;
}

body.hub-page.docs-page .docs-cat-dot.is-active {
  width: 20px;
  border-radius: 999px;
  background: var(--accent-dark);
}

/* ---- Body: table of contents + sections ---------------------------------- */
body.hub-page.docs-page .docs-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

body.hub-page.docs-page .docs-toc {
  position: sticky;
  top: 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px 14px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 18px 44px rgba(64, 80, 96, 0.06);
}

body.hub-page.docs-page .docs-toc-title {
  margin-bottom: 8px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.hub-page.docs-page .docs-toc-link {
  position: relative;
  padding: 9px 12px;
  border-radius: 11px;
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease;
}

body.hub-page.docs-page .docs-toc-link:hover {
  background: rgba(124, 200, 244, 0.1);
}

body.hub-page.docs-page .docs-toc-link.is-active {
  background: var(--accent-soft);
  color: var(--navy-deep);
}

body.hub-page.docs-page .docs-sections {
  min-width: 0;
}

body.hub-page.docs-page .docs-sections > .panel {
  scroll-margin-top: 18px;
}

/* .stack-md has no global definition; give docs stacks consistent spacing. */
body.hub-page.docs-page .docs-sections .stack-md {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* TOC group labels */
body.hub-page.docs-page .docs-toc-group-label {
  margin: 14px 10px 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

body.hub-page.docs-page .docs-toc-group-label:first-child {
  margin-top: 0;
}

/* Bulleted lists inside docs cards */
body.hub-page.docs-page .docs-bullets {
  margin: 4px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.5;
}

body.hub-page.docs-page .docs-bullets li::marker {
  color: var(--accent-dark);
}

/* Plan comparison table */
body.hub-page.docs-page .docs-table-scroll {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
}

body.hub-page.docs-page .docs-plan-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

body.hub-page.docs-page .docs-plan-table th,
body.hub-page.docs-page .docs-plan-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

body.hub-page.docs-page .docs-plan-table thead th {
  background: var(--panel-muted);
  color: var(--navy-deep);
  font-weight: 800;
  position: sticky;
  top: 0;
}

body.hub-page.docs-page .docs-plan-table thead th:not(:first-child),
body.hub-page.docs-page .docs-plan-table tbody td {
  text-align: center;
}

body.hub-page.docs-page .docs-plan-table tbody th {
  color: var(--ink);
  font-weight: 600;
}

body.hub-page.docs-page .docs-plan-table tbody tr:nth-child(even) {
  background: rgba(244, 249, 253, 0.55);
}

body.hub-page.docs-page .docs-plan-table tbody tr:last-child th,
body.hub-page.docs-page .docs-plan-table tbody tr:last-child td {
  border-bottom: 0;
}

body.hub-page.docs-page .docs-plan-table td:last-child {
  color: var(--navy-deep);
  font-weight: 700;
}

@media (max-width: 720px) {
  body.hub-page.docs-page .docs-hero {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px 20px;
  }

  body.hub-page.docs-page .docs-hero-lede {
    font-size: 0.98rem;
  }

  body.hub-page.docs-page .docs-catalogue {
    padding: 16px;
  }

  body.hub-page.docs-page .docs-hero-meta {
    margin-top: 4px;
  }

  body.hub-page.docs-page .docs-hero-glow {
    inset: auto -160px -200px auto;
  }
}

.dashboard-v2 > * {
  animation: dashboard-rise-in 420ms ease both;
}

.dashboard-v2 > *:nth-child(2) {
  animation-delay: 40ms;
}

.dashboard-v2 > *:nth-child(3) {
  animation-delay: 80ms;
}

.dashboard-v2 > *:nth-child(4) {
  animation-delay: 120ms;
}

.app-nav {
  width: max-content;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(244, 249, 253, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.74);
  box-shadow:
    0 28px 58px rgba(64, 80, 96, 0.15),
    0 10px 18px rgba(124, 200, 244, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    inset 0 -12px 20px rgba(14, 27, 44, 0.03);
  backdrop-filter: blur(18px) saturate(120%);
}

/* Remove expensive backdrop-filter on mobile — causes scroll jank */
@media (max-width: 700px) {
  .app-nav {
    backdrop-filter: none;
    background: linear-gradient(180deg, #ffffff, #f4f9fd);
  }
}

.app-nav-link {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(143, 166, 186, 0.32);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.95));
  color: var(--navy);
  font-weight: 700;
  box-shadow:
    0 16px 28px rgba(64, 80, 96, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.82) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -12px 18px rgba(14, 27, 44, 0.03);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.app-nav-link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(213, 221, 148, 0.24), rgba(124, 200, 244, 0.22));
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.app-nav-link:hover {
  transform: translateY(-1px);
  border-color: rgba(124, 200, 244, 0.28);
  box-shadow:
    0 18px 32px rgba(64, 80, 96, 0.13),
    0 1px 0 rgba(255, 255, 255, 0.84) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -12px 18px rgba(14, 27, 44, 0.02);
}

.app-nav-link:hover::before {
  opacity: 1;
}

.app-nav-link.is-active {
  border-color: rgba(124, 200, 244, 0.38);
  background: linear-gradient(135deg, rgba(213, 221, 148, 0.18), rgba(124, 200, 244, 0.22));
  box-shadow:
    0 20px 36px rgba(64, 80, 96, 0.16),
    0 1px 0 rgba(255, 255, 255, 0.86) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -12px 18px rgba(14, 27, 44, 0.03);
  animation: nav-active-pulse 3.6s ease-in-out infinite;
}

.app-nav-link.is-active::before {
  opacity: 1;
}

@keyframes nav-active-pulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
    filter: saturate(100%);
  }
  50% {
    transform: translateY(-1px) scale(1.01);
    filter: saturate(108%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub-nav-link.is-active,
  .app-nav-link.is-active {
    animation: none;
  }
}

.app-nav-link-coming-soon {
  cursor: default;
  opacity: 0.88;
  color: var(--navy-soft);
  background:
    radial-gradient(circle at top right, rgba(213, 221, 148, 0.22), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 250, 254, 0.94));
  border-style: dashed;
  border-color: rgba(160, 180, 200, 0.34);
  box-shadow:
    0 12px 22px rgba(64, 80, 96, 0.08),
    0 5px 0 rgba(255, 255, 255, 0.42) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -10px 16px rgba(14, 27, 44, 0.012);
}

.app-nav-link-coming-soon:hover {
  transform: none;
  border-color: rgba(160, 180, 200, 0.34);
  box-shadow:
    0 12px 22px rgba(64, 80, 96, 0.08),
    0 5px 0 rgba(255, 255, 255, 0.42) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -10px 16px rgba(14, 27, 44, 0.012);
}

.app-nav-link-coming-soon::before {
  opacity: 0.18;
}

.app-nav-link-note {
  margin-left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(213, 221, 148, 0.26);
  color: var(--navy);
  font-size: 0.72rem;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), inset 0 -8px 12px rgba(14, 27, 44, 0.01);
}

.dashboard-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 20px;
  align-items: start;
}

.settings-shell {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.settings-rail {
  position: sticky;
  top: 24px;
  padding: 20px;
  max-height: calc(100dvh - 210px);
  overflow: hidden;
}

.settings-tabs-rail::-webkit-scrollbar {
  display: none;
}

.settings-content {
  min-width: 0;
}

.settings-page-content {
  min-width: 0;
}

.settings-section-hidden {
  display: none !important;
}

.settings-page.section-view .settings-shell {
  grid-template-columns: 1fr;
}

.settings-page.section-view .settings-mobile-nav,
.settings-page.section-view .settings-rail {
  display: none !important;
}

.settings-page.section-view .settings-content {
  width: 100%;
}

.settings-page:not(.section-view) .settings-shell {
  display: none;
}

.settings-mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
}

.settings-mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.settings-mobile-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.96));
  box-shadow:
    0 12px 24px rgba(64, 80, 96, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -10px 18px rgba(14, 27, 44, 0.02);
  color: var(--navy);
  font-weight: 800;
}

.settings-tabs-mobile {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.settings-tabs-mobile::-webkit-scrollbar {
  display: none;
}

.settings-tabs-mobile .settings-tab-rail {
  flex: 0 0 auto;
  min-width: 192px;
}

.settings-tabs-rail {
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 10px;
  margin-bottom: 0;
  max-height: max(240px, calc(100dvh - 410px));
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.settings-tab {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(185, 201, 219, 0.92);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 252, 0.95));
  box-shadow:
    0 10px 22px rgba(64, 80, 96, 0.08),
    0 2px 6px rgba(124, 200, 244, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -12px 16px rgba(14, 27, 44, 0.012),
    inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  color: var(--navy);
  text-decoration: none;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.settings-tab-rail {
  flex: none;
  width: 100%;
  min-height: 66px;
  padding: 12px 14px;
  border-radius: 18px;
  gap: 2px;
}

.settings-tab span {
  font-size: 1rem;
  font-weight: 800;
  color: var(--navy-deep);
  letter-spacing: -0.03em;
}

.settings-tab-rail span {
  font-size: 0.95rem;
}

.settings-tab small {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.settings-tab-rail small {
  font-size: 0.78rem;
}

.settings-tab:hover,
.settings-tab:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(165, 191, 214, 0.96);
  box-shadow:
    0 14px 26px rgba(64, 80, 96, 0.1),
    0 5px 12px rgba(124, 200, 244, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -12px 18px rgba(14, 27, 44, 0.014),
    inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.settings-tab.is-active {
  border-color: rgba(163, 205, 98, 0.55);
  background: linear-gradient(
    135deg,
    rgba(210, 239, 104, 0.28) 0%,
    rgba(255, 255, 255, 0.98) 48%,
    rgba(98, 184, 246, 0.24) 100%
  );
  box-shadow:
    0 14px 24px rgba(64, 80, 96, 0.08),
    0 4px 10px rgba(98, 184, 246, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -12px 18px rgba(14, 27, 44, 0.015),
    inset 0 0 0 1px rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.settings-tab-rail.is-active {
  background: linear-gradient(
    135deg,
    rgba(210, 239, 104, 0.2) 0%,
    rgba(255, 255, 255, 0.98) 46%,
    rgba(98, 184, 246, 0.18) 100%
  );
}

.settings-tab.is-active span {
  color: var(--navy);
}

.settings-tab.is-active::before {
  content: none;
}

.settings-tab.is-active::after {
  content: none;
}

.settings-integrations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.settings-integrations-placeholder {
  min-height: 100%;
}

.integration-category-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  text-align: left;
  font: inherit;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.78);
  cursor: pointer;
  color: inherit;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.98), transparent 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 249, 253, 0.95));
}

.settings-team-action-card {
  min-height: 100%;
  justify-content: flex-start;
}

.settings-team-action-card.is-active {
  border-color: rgba(124, 200, 244, 0.48);
  box-shadow:
    0 18px 34px rgba(64, 80, 96, 0.11),
    0 0 0 1px rgba(124, 200, 244, 0.18) inset,
    inset 0 -10px 18px rgba(14, 27, 44, 0.02);
}

.workspace-switch-card-active {
  position: relative;
  overflow: hidden;
  border-color: rgba(124, 200, 244, 0.64);
  background:
    radial-gradient(circle at top left, rgba(213, 221, 148, 0.2), transparent 34%),
    radial-gradient(circle at bottom right, rgba(124, 200, 244, 0.2), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 249, 253, 0.96));
  animation: workspace-active-card-pulse 3.8s ease-in-out infinite;
}

.workspace-switch-card-active::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 20px;
  border: 1px solid rgba(124, 200, 244, 0.24);
  opacity: 0;
  pointer-events: none;
  animation: workspace-active-ring-pulse 3.8s ease-in-out infinite;
}

.workspace-switch-card-current {
  cursor: default;
}

.workspace-switch-card-current:hover,
.workspace-switch-card-current:focus-visible {
  transform: none;
}

.workspace-active-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
}

.workspace-active-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #63b86d;
  box-shadow: 0 0 0 0 rgba(99, 184, 109, 0.34);
  animation: workspace-active-dot-pulse 1.9s ease-in-out infinite;
}

.workspace-active-dot::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: inherit;
  border: 1px solid rgba(99, 184, 109, 0.28);
  opacity: 0;
  animation: workspace-active-dot-ring 1.9s ease-in-out infinite;
}

@keyframes workspace-active-card-pulse {
  0%, 100% {
    box-shadow:
      0 18px 34px rgba(64, 80, 96, 0.11),
      0 0 0 0 rgba(124, 200, 244, 0),
      0 0 0 1px rgba(124, 200, 244, 0.18) inset,
      inset 0 -10px 18px rgba(14, 27, 44, 0.02);
  }
  50% {
    box-shadow:
      0 20px 38px rgba(64, 80, 96, 0.13),
      0 0 0 7px rgba(124, 200, 244, 0.08),
      0 0 0 1px rgba(124, 200, 244, 0.24) inset,
      inset 0 -10px 18px rgba(14, 27, 44, 0.02);
  }
}

@keyframes workspace-active-ring-pulse {
  0%, 100% {
    opacity: 0;
    transform: scale(0.992);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes workspace-active-dot-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(99, 184, 109, 0.34);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(99, 184, 109, 0.1);
  }
}

@keyframes workspace-active-dot-ring {
  0%, 100% {
    opacity: 0;
    transform: scale(0.72);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.settings-team-action-card .integration-category-meta {
  margin-top: auto;
}

.settings-team-action-card:hover .integration-category-meta,
.settings-team-action-card:focus-visible .integration-category-meta {
  background: rgba(124, 200, 244, 0.2);
}

.integration-category-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 2px;
}

.integration-category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  flex: 0 0 auto;
  color: var(--navy);
  box-shadow: 0 12px 22px rgba(64, 80, 96, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  position: relative;
  overflow: hidden;
}

.integration-category-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.9), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.integration-category-icon svg {
  width: 28px;
  height: 28px;
  position: relative;
  z-index: 1;
}

.integration-category-icon-email {
  background: linear-gradient(135deg, rgba(214, 239, 148, 0.92), rgba(114, 184, 239, 0.88));
}

.integration-category-icon-payments {
  background: linear-gradient(135deg, rgba(241, 207, 140, 0.9), rgba(124, 200, 244, 0.86));
}

.integration-category-icon-future {
  background: linear-gradient(135deg, rgba(124, 200, 244, 0.88), rgba(213, 221, 148, 0.9));
}

.integration-category-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: var(--navy);
  background: rgba(124, 200, 244, 0.11);
  font-size: 1.05rem;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
  transform: translateY(-1px);
}

.integration-category-card:hover,
.integration-category-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(124, 200, 244, 0.32);
  box-shadow:
    0 16px 28px rgba(64, 80, 96, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.84) inset,
    inset 0 -10px 18px rgba(14, 27, 44, 0.02);
}

.integration-category-card h3 {
  margin: 0;
}

.integration-category-card p {
  margin: 0;
}

.integration-category-meta {
  display: inline-flex;
  align-self: flex-start;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(124, 200, 244, 0.14);
  color: var(--navy);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.integrations-modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 2vw, 24px);
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  perspective: 2200px;
  isolation: isolate;
}

.integrations-modal.is-scrollable {
  align-items: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.integrations-modal.is-scrollable::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.integrations-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at top, rgba(255, 177, 102, 0.14), transparent 28%),
    radial-gradient(circle at 50% 20%, rgba(18, 30, 48, 0.46), rgba(8, 12, 20, 0.84)),
    rgba(4, 8, 14, 0.68);
  backdrop-filter: blur(8px) saturate(72%);
  opacity: 1;
  transition: opacity 280ms ease, background-color 280ms ease, backdrop-filter 280ms ease;
}

.integrations-modal-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(1260px, calc(100vw - 40px));
  max-width: calc(100vw - 40px);
  max-height: none;
  overflow: visible;
  margin: 0 auto;
  padding: clamp(18px, 2vw, 28px);
  border-radius: 36px;
  border: 1px solid rgba(255, 226, 180, 0.4);
  background:
    radial-gradient(circle at top right, rgba(255, 200, 120, 0.14), transparent 24%),
    radial-gradient(circle at top left, rgba(255, 236, 202, 0.12), transparent 20%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.996), rgba(250, 252, 254, 0.992));
  box-shadow:
    0 42px 96px rgba(4, 9, 18, 0.34),
    0 18px 34px rgba(14, 27, 44, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  transform: translate3d(0, 28px, 0) scale(0.972);
  transform-origin: center top;
  opacity: 0;
  transition:
    transform 460ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 320ms ease,
    box-shadow 360ms ease,
    border-color 360ms ease;
  isolation: isolate;
}

.integrations-modal-card::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: inherit;
  background: radial-gradient(
    ellipse at center top,
    rgba(255, 188, 114, 0.34) 0%,
    rgba(255, 188, 114, 0.22) 22%,
    rgba(255, 188, 114, 0.1) 40%,
    rgba(255, 188, 114, 0) 68%
  );
  filter: blur(18px);
  z-index: 0;
  opacity: 0.62;
  pointer-events: none;
  animation: integrations-border-pulse 4.8s ease-in-out infinite;
}

.integrations-modal-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    0 0 0 1px rgba(255, 224, 186, 0.18),
    0 0 24px rgba(255, 177, 92, 0.12),
    0 0 52px rgba(255, 177, 92, 0.08);
  z-index: 0;
  opacity: 0.7;
  pointer-events: none;
  animation: integrations-warm-glow 4.8s ease-in-out infinite;
}

.integrations-modal-card > * {
  position: relative;
  z-index: 1;
}

.integrations-modal-header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  margin-bottom: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(16, 28, 43, 0.08);
}

.integrations-modal-heading h3,
.integrations-modal-heading p {
  margin: 0;
}

.integrations-modal-heading {
  min-width: 0;
}

.integrations-modal-content {
  display: block;
  min-width: 0;
  overflow: hidden;
}

.integrations-modal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  min-width: 0;
}

.integrations-modal-grid.integrations-three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.integrations-future-layout {
  display: grid;
  gap: 16px;
  min-width: 0;
  justify-items: center;
}

.integrations-future-layout .integrations-panel-card {
  width: min(760px, 100%);
}

.integrations-panel-card {
  padding: 20px;
  min-height: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.93));
  box-shadow:
    0 22px 40px rgba(64, 80, 96, 0.11),
    0 4px 12px rgba(124, 200, 244, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -14px 18px rgba(14, 27, 44, 0.015);
}

.integrations-modal-close {
  justify-self: end;
  align-self: start;
  white-space: nowrap;
}

.integrations-modal-close:focus-visible,
.integrations-modal-card :focus-visible {
  outline: 3px solid rgba(255, 196, 108, 0.9);
  outline-offset: 3px;
}

.integrations-modal-card label,
.integrations-modal-card input,
.integrations-modal-card select,
.integrations-modal-card textarea {
  min-width: 0;
}

.integrations-modal:not(.is-hidden) .integrations-modal-backdrop {
  opacity: 1;
}

.integrations-modal:not(.is-hidden) {
  z-index: 9998;
}

.integrations-modal:not(.is-hidden) .integrations-modal-card {
  transform: translate3d(0, 0, 0) scale(1);
  opacity: 1;
  animation: integrations-modal-enter 460ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow:
    0 44px 110px rgba(4, 9, 18, 0.38),
    0 18px 34px rgba(14, 27, 44, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.integrations-modal:not(.is-hidden) .integrations-modal-card::before,
.integrations-modal:not(.is-hidden) .integrations-modal-card::after {
  opacity: 1;
}

.integrations-modal.is-scrollable .integrations-modal-card::-webkit-scrollbar {
  width: 0;
  height: 0;
}

@keyframes integrations-border-pulse {
  0%,
  100% {
    opacity: 0.5;
    filter: blur(18px) saturate(1.02) brightness(1.02);
  }
  50% {
    opacity: 0.85;
    filter: blur(20px) saturate(1.1) brightness(1.08);
  }
}

@keyframes integrations-warm-glow {
  0%,
  100% {
    transform: scale(1);
    box-shadow:
      0 0 0 1px rgba(255, 224, 186, 0.24),
      0 0 32px rgba(255, 177, 92, 0.16),
      0 0 64px rgba(255, 177, 92, 0.08);
  }
  50% {
    transform: scale(1.003);
    box-shadow:
      0 0 0 1px rgba(255, 230, 198, 0.34),
      0 0 40px rgba(255, 181, 92, 0.22),
      0 0 80px rgba(255, 181, 92, 0.12);
  }
}

@keyframes integrations-modal-enter {
  0% {
    opacity: 0;
    transform: translate3d(0, 40px, 0) scale(0.96);
    filter: blur(6px);
  }
  70% {
    opacity: 1;
    transform: translate3d(0, -4px, 0) scale(1.01);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }
}

.integrations-modal.is-hidden {
  display: flex;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.integrations-modal.is-hidden .integrations-modal-backdrop {
  opacity: 0;
}

.integrations-panel-card h3 {
  margin: 0;
}

.integrations-panel-card p,
.integrations-panel-card .helper-text {
  margin-top: 0;
}

.integrations-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: auto;
}

.integration-future-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  display: grid;
  gap: 8px;
}

.team-invite-list {
  display: grid;
  gap: 12px;
}

.team-invite-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.team-invite-pagination .team-invite-page-btn {
  padding: 6px 16px;
  flex: 0 0 auto;
}

.team-invite-pagination .team-invite-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.team-invite-page-indicator {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.team-invite-item {
  padding: 14px 15px;
  border-radius: 20px;
  border: 1px solid rgba(124, 200, 244, 0.16);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.96), transparent 56%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(244, 249, 253, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 10px 20px rgba(64, 80, 96, 0.06);
}

.team-invite-item-main {
  display: grid;
  gap: 8px;
}

.team-invite-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.team-invite-item-identity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.team-invite-item-identity strong {
  overflow-wrap: anywhere;
}

.team-invite-item p {
  margin: 0;
}

.team-invite-item .invoice-status-chip {
  margin-left: auto;
  flex: 0 0 auto;
}

/* Member cards */
.team-member-list {
  display: grid;
  gap: 10px;
}

.team-member-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 13px 14px;
  border-radius: 18px;
  border: 1px solid rgba(124, 200, 244, 0.16);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.96), transparent 56%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(244, 249, 253, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 10px 20px rgba(64, 80, 96, 0.06);
}

.team-member-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(124, 200, 244, 0.9), rgba(88, 180, 235, 0.7));
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.team-member-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.team-member-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.team-member-head strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.team-member-email {
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.team-member-you {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(163, 205, 98, 0.2);
  color: #4a6b16;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.team-role-badge {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.team-role-badge-owner {
  background: rgba(88, 180, 235, 0.18);
  color: #1f6c97;
}

.team-role-badge-admin {
  background: rgba(124, 92, 235, 0.16);
  color: #5b40b8;
}

.team-role-badge-member {
  background: rgba(143, 166, 186, 0.2);
  color: var(--ink);
}

.team-access-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.team-access-chip {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.team-access-chip-edit {
  background: rgba(163, 205, 98, 0.16);
  color: #4a6b16;
  border-color: rgba(163, 205, 98, 0.3);
}

.team-access-chip-view {
  background: rgba(88, 180, 235, 0.14);
  color: #1f6c97;
  border-color: rgba(88, 180, 235, 0.28);
}

.team-access-chip-none {
  background: rgba(143, 166, 186, 0.16);
  color: var(--muted);
  border-color: var(--line);
}

/* Per-app access level grid */
.team-app-access-grid {
  display: grid;
  gap: 6px;
}

.team-app-access-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(143, 166, 186, 0.18);
}

.team-app-access-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--navy);
  flex: 1 1 auto;
  min-width: 0;
}

.team-app-access-options {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.team-app-access-btn {
  display: block;
  cursor: pointer;
}

.team-app-access-btn input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.team-app-access-btn span {
  display: block;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  background: rgba(143, 166, 186, 0.08);
  border: 1px solid transparent;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}

.team-app-access-btn:hover span {
  background: rgba(143, 166, 186, 0.14);
  color: var(--navy);
}

/* No access — red */
.team-app-access-btn:has(input[value="none"]) input[type="radio"]:checked + span {
  background: rgba(185, 28, 28, 0.08);
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.28);
  font-weight: 800;
}
.team-app-access-btn:has(input[value="none"]):hover span {
  background: rgba(185, 28, 28, 0.06);
  color: #b91c1c;
}

/* View — brand blue */
.team-app-access-btn:has(input[value="view"]) input[type="radio"]:checked + span {
  background: rgba(124, 200, 244, 0.15);
  color: #1d7aad;
  border-color: rgba(124, 200, 244, 0.5);
  font-weight: 800;
}
.team-app-access-btn:has(input[value="view"]):hover span {
  background: rgba(124, 200, 244, 0.1);
  color: #1d7aad;
}

/* Edit — brand green */
.team-app-access-btn:has(input[value="edit"]) input[type="radio"]:checked + span {
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
  border-color: rgba(22, 163, 74, 0.3);
  font-weight: 800;
}
.team-app-access-btn:has(input[value="edit"]):hover span {
  background: rgba(22, 163, 74, 0.07);
  color: #16a34a;
}

.team-permissions-field {
  display: grid;
  gap: 8px;
}

.team-permissions-field > span {
  color: var(--navy);
  font-weight: 800;
}

.team-permissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.team-permission-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(124, 200, 244, 0.18);
  background: rgba(255, 255, 255, 0.7);
  color: var(--navy);
  font-weight: 700;
}

.team-permission-option input {
  width: 16px;
  height: 16px;
  accent-color: #42a8dc;
}

.team-role-field {
  display: grid;
  gap: 6px;
  max-width: 260px;
}

.team-role-field span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.team-role-field select {
  min-height: 42px;
  border-radius: 16px;
  border: 1px solid rgba(124, 200, 244, 0.24);
  background: rgba(255, 255, 255, 0.88);
  color: var(--navy);
  font-weight: 800;
  padding: 0 12px;
}

.team-permission-list {
  display: grid;
  gap: 12px;
}

.team-permission-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(124, 200, 244, 0.16);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.96), transparent 56%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(244, 249, 253, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 10px 20px rgba(64, 80, 96, 0.06);
}

.team-permission-form-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.team-permission-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.invoice-status-chip-invite,
.invoice-status-chip-draft {
  background: rgba(109, 193, 246, 0.14);
  color: #25537e;
}

.invoice-status-chip-paid,
.invoice-status-chip-accepted {
  background: rgba(6, 180, 136, 0.12);
  color: #067f62;
}

.invoice-status-chip-cancelled,
.invoice-status-chip-revoked,
.invoice-status-chip-not_paid {
  background: rgba(198, 61, 71, 0.12);
  color: #a12c3d;
}

body.modal-open {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

.settings-security-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 18px;
  align-items: start;
}

.settings-side {
  position: sticky;
  top: 24px;
}

.settings-card {
  padding: 18px;
  scroll-margin-top: 24px;
}

.settings-page .primary-button,
.settings-page .secondary-button,
.settings-page .ghost-button {
  min-height: 50px;
  border-radius: 999px;
  padding: 12px 22px;
}

.settings-page .primary-button {
  background: linear-gradient(135deg, rgba(223, 231, 159, 0.98) 0%, rgba(124, 200, 244, 0.98) 100%);
  color: var(--navy-deep);
  border-color: rgba(108, 175, 221, 0.2);
  box-shadow:
    0 20px 36px rgba(64, 80, 96, 0.16),
    0 6px 0 rgba(255, 255, 255, 0.48) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -10px 18px rgba(14, 27, 44, 0.04);
}

.settings-page .primary-button:hover,
.settings-page .primary-button:focus-visible {
  border-color: rgba(108, 175, 221, 0.4);
  box-shadow:
    0 24px 42px rgba(64, 80, 96, 0.18),
    0 6px 0 rgba(255, 255, 255, 0.5) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -10px 18px rgba(14, 27, 44, 0.045);
}

.settings-page .secondary-button {
  background: linear-gradient(135deg, rgba(32, 58, 82, 0.98) 0%, rgba(47, 95, 122, 0.98) 100%);
  color: white;
  border-color: rgba(32, 58, 82, 0.22);
  box-shadow:
    0 20px 36px rgba(64, 80, 96, 0.16),
    0 4px 0 rgba(255, 255, 255, 0.18) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -10px 18px rgba(14, 27, 44, 0.08);
}

.settings-page .ghost-button {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(243, 247, 251, 0.98));
  border-color: rgba(143, 166, 186, 0.28);
  color: var(--navy);
  box-shadow:
    0 14px 26px rgba(64, 80, 96, 0.1),
    0 4px 0 rgba(255, 255, 255, 0.5) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -8px 14px rgba(14, 27, 44, 0.014);
}

.settings-page .ghost-button:hover,
.settings-page .ghost-button:focus-visible {
  border-color: rgba(108, 175, 221, 0.36);
}

.account-summary-chip {
  position: relative;
  overflow: hidden;
  min-width: 260px;
  max-width: 360px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background:
    radial-gradient(circle at top right, rgba(124, 200, 244, 0.18), transparent 34%),
    radial-gradient(circle at bottom left, rgba(201, 226, 101, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.95));
  box-shadow:
    0 16px 32px rgba(92, 124, 148, 0.09),
    0 5px 10px rgba(124, 200, 244, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -10px 18px rgba(14, 27, 44, 0.01);
  animation: account-summary-chip-pulse 4.8s ease-in-out infinite;
}

/* On mobile, replace expensive box-shadow/border-color pulse (forces full repaint every frame)
   with a GPU-composited opacity fade that doesn't cause scroll jank */
@media (max-width: 700px) {
  .account-summary-chip {
    animation: account-summary-chip-pulse-mobile 4.8s ease-in-out infinite;
    will-change: opacity;
  }
}
@keyframes account-summary-chip-pulse-mobile {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.85;
  }
}

.account-summary-chip::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0) 32%);
  pointer-events: none;
}

.account-summary-chip::after {
  content: "";
  position: absolute;
  inset: auto 12px 12px 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(124, 200, 244, 0.14), rgba(201, 226, 101, 0.14));
  filter: blur(10px);
  opacity: 0.6;
  pointer-events: none;
}

@keyframes account-summary-chip-pulse {
  0%, 100% {
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow:
      0 16px 32px rgba(92, 124, 148, 0.09),
      0 5px 10px rgba(124, 200, 244, 0.04),
      0 0 0 0 rgba(201, 226, 101, 0),
      inset 0 1px 0 rgba(255, 255, 255, 0.94),
      inset 0 -10px 18px rgba(14, 27, 44, 0.01);
  }
  50% {
    border-color: rgba(201, 226, 101, 0.42);
    box-shadow:
      0 16px 32px rgba(92, 124, 148, 0.09),
      0 5px 10px rgba(124, 200, 244, 0.04),
      0 0 0 8px rgba(201, 226, 101, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.96),
      inset 0 -10px 18px rgba(14, 27, 44, 0.01);
  }
}

.account-summary-chip strong,
.account-summary-chip span {
  display: block;
}

.account-summary-chip strong {
  color: var(--navy);
  margin-bottom: 6px;
}

.account-summary-chip span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.dashboard-workspace-switcher {
  position: relative;
  z-index: 1;
  margin-top: 12px;
}

.dashboard-workspace-switcher label {
  display: grid;
  gap: 6px;
  margin: 0;
}

.dashboard-workspace-switcher label > span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dashboard-workspace-switcher select {
  width: 100%;
  min-height: 42px;
  border-radius: 16px;
  border: 1px solid rgba(124, 200, 244, 0.32);
  background: rgba(255, 255, 255, 0.92);
  color: var(--navy);
  font-weight: 800;
  padding: 0 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 10px 18px rgba(64, 80, 96, 0.06);
}

.dashboard-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.dashboard-analytics-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.dashboard-analytics-summary-grid-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.dashboard-analytics-grid-full {
  grid-template-columns: 1fr;
}

.dashboard-metric-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(124, 200, 244, 0.12), transparent 34%),
    radial-gradient(circle at bottom left, rgba(201, 226, 101, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.95));
  box-shadow:
    0 14px 28px rgba(92, 124, 148, 0.08),
    0 4px 10px rgba(124, 200, 244, 0.035),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -10px 18px rgba(14, 27, 44, 0.01);
  padding: 26px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dashboard-metric-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 36%);
  pointer-events: none;
}

.dashboard-metric-card::after {
  content: "";
  position: absolute;
  inset: auto 14px 12px 14px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(124, 200, 244, 0.08), rgba(201, 226, 101, 0.08));
  filter: blur(10px);
  opacity: 0.65;
  pointer-events: none;
}

.dashboard-metric-card h2,
.dashboard-metric-card p {
  margin: 0;
}

.dashboard-metric-card h2 {
  position: relative;
  z-index: 1;
  font-size: clamp(2.15rem, 3vw, 2.9rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
  font-weight: 800;
  color: var(--navy-deep);
  font-variant-numeric: tabular-nums;
}

.dashboard-metric-card .eyebrow,
.dashboard-metric-card p {
  position: relative;
  z-index: 1;
}

.dashboard-metric-card p {
  font-size: 0.94rem;
  line-height: 1.48;
  color: var(--muted);
  max-width: 24ch;
}

.dashboard-link-card {
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 253, 0.96));
  box-shadow:
    0 14px 28px rgba(92, 124, 148, 0.08),
    0 4px 10px rgba(124, 200, 244, 0.035),
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -10px 16px rgba(14, 27, 44, 0.01);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.dashboard-link-card:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 200, 244, 0.35);
  box-shadow:
    0 18px 32px rgba(92, 124, 148, 0.09),
    0 6px 12px rgba(124, 200, 244, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -10px 16px rgba(14, 27, 44, 0.01);
}

.dashboard-link-card-coming-soon {
  cursor: default;
  border-style: dashed;
  border-color: rgba(160, 180, 200, 0.32);
  background:
    radial-gradient(circle at top right, rgba(213, 221, 148, 0.16), transparent 30%),
    radial-gradient(circle at bottom left, rgba(124, 200, 244, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(246, 250, 254, 0.95));
  box-shadow:
    0 14px 24px rgba(92, 124, 148, 0.07),
    0 5px 10px rgba(124, 200, 244, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -10px 16px rgba(14, 27, 44, 0.01);
}

.dashboard-link-card-coming-soon:hover {
  transform: none;
  border-color: rgba(160, 180, 200, 0.32);
  box-shadow:
    0 16px 28px rgba(64, 80, 96, 0.09),
    0 6px 12px rgba(124, 200, 244, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -10px 16px rgba(14, 27, 44, 0.01);
}

.dashboard-link-card-coming-soon .eyebrow {
  color: var(--navy-soft);
}

.dashboard-link-card-coming-soon h2 {
  color: var(--navy-deep);
}

.dashboard-link-card h2,
.dashboard-link-card p {
  margin: 0;
}

.reports-filter-panel {
  gap: 20px;
}

.reports-filter-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(280px, 0.82fr);
  gap: 20px;
  align-items: start;
}

.reports-filter-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 24px;
  border-radius: 28px;
  border: 1px solid rgba(143, 166, 186, 0.16);
  background:
    radial-gradient(circle at top left, rgba(124, 200, 244, 0.1), transparent 36%),
    radial-gradient(circle at bottom right, rgba(213, 221, 148, 0.1), transparent 32%),
    rgba(248, 251, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 18px 36px rgba(64, 80, 96, 0.06);
}

.reports-filter-form::before {
  content: "";
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(143, 166, 186, 0.18), transparent);
  margin: -2px 0 2px;
}

.reports-filter-copy {
  display: grid;
  gap: 4px;
}

.reports-filter-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.reports-range-switch,
.analytics-range-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.reports-range-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid rgba(143, 166, 186, 0.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(244, 249, 253, 0.94));
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(64, 80, 96, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.reports-range-chip:hover,
.reports-range-chip:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(124, 200, 244, 0.34);
}

.reports-range-chip.is-active {
  border-color: rgba(163, 205, 98, 0.55);
  background: linear-gradient(
    135deg,
    rgba(210, 239, 104, 0.22) 0%,
    rgba(255, 255, 255, 0.98) 45%,
    rgba(98, 184, 246, 0.18) 100%
  );
  box-shadow: 0 12px 22px rgba(64, 80, 96, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.reports-range-chip.is-loading {
  position: relative;
  color: rgba(32, 52, 79, 0.72);
  pointer-events: none;
  transform: translateY(-1px);
}

.reports-range-chip.is-loading::after {
  content: "";
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border-radius: 50%;
  border: 2px solid rgba(124, 200, 244, 0.35);
  border-top-color: rgba(124, 200, 244, 0.95);
  animation: reports-chip-spin 0.7s linear infinite;
  flex: 0 0 auto;
}

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

.reports-date-field {
  min-width: min(100%, 420px);
  gap: 8px;
}

.reports-date-field span {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
}

.reports-date-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.reports-date-range input {
  min-width: 180px;
}

.reports-filter-actions {
  align-items: center;
}

.reports-filter-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: stretch;
  min-height: 100%;
}

.reports-filter-side .currency-display-picker {
  margin-top: 0;
  justify-content: stretch;
}

.reports-filter-side .currency-display-picker-label,
.reports-filter-side .currency-display-picker-select {
  width: 100%;
  min-width: 0;
}

.reports-filter-side-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 22px;
  border-radius: 26px;
  border: 1px solid rgba(143, 166, 186, 0.16);
  background:
    radial-gradient(circle at top right, rgba(124, 200, 244, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 253, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 14px 28px rgba(64, 80, 96, 0.06);
}

.reports-filter-side-card .eyebrow {
  margin-bottom: -2px;
}

.reports-filter-side-intro {
  display: grid;
  gap: 4px;
}

.reports-filter-side-intro strong,
.reports-filter-side-static strong {
  color: var(--navy-deep);
  font-size: 1rem;
  line-height: 1.3;
}

.reports-filter-side-intro p,
.reports-filter-side-static span,
.reports-filter-side-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.reports-filter-side-static {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 20px;
  background: rgba(124, 200, 244, 0.08);
  border: 1px solid rgba(124, 200, 244, 0.12);
}

.reports-filter-side-static span {
  color: var(--muted);
}

.reports-accordion {
  display: grid;
  gap: 18px;
}

.reports-details {
  padding: 0;
  overflow: hidden;
}

.reports-details > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  cursor: pointer;
  border-bottom: 1px solid rgba(214, 225, 236, 0.7);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(247, 250, 253, 0.92));
}

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

.reports-details-summary div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reports-details-summary strong {
  color: var(--navy-deep);
  font-size: 1.1rem;
  letter-spacing: -0.03em;
}

.reports-summary-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(124, 200, 244, 0.14);
  border: 1px solid rgba(124, 200, 244, 0.18);
  color: var(--navy);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.currency-display-picker {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.currency-display-picker-label {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
}

.currency-display-picker-select {
  min-width: 220px;
  height: 44px;
  padding: 0 14px;
  border-radius: 18px;
  border: 1px solid rgba(214, 225, 236, 0.95);
  background: rgba(255, 255, 255, 0.98);
  color: var(--navy-deep);
  font: inherit;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(64, 80, 96, 0.06);
}

.reports-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  padding: 18px 20px 20px;
}

.reports-stat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(214, 225, 236, 0.9);
  background:
    radial-gradient(circle at top right, rgba(124, 200, 244, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.96));
  box-shadow:
    0 12px 24px rgba(64, 80, 96, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -10px 14px rgba(14, 27, 44, 0.01);
}

.reports-stat-card span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.reports-stat-card strong {
  color: var(--navy-deep);
  font-size: clamp(1.35rem, 2.2vw, 2.05rem);
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.reports-stat-card small {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.report-stat-card-success {
  background:
    radial-gradient(circle at top right, rgba(107, 214, 156, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.96));
}

.report-stat-card-warm {
  background:
    radial-gradient(circle at top right, rgba(255, 188, 101, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.96));
}

.report-stat-card-muted {
  background:
    radial-gradient(circle at top right, rgba(160, 180, 200, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.96));
}

.reports-summary-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 20px 16px;
}

.reports-summary-card {
  min-height: 100%;
}

.reports-summary-card h2 {
  margin: 0;
  color: var(--navy-deep);
  font-size: clamp(1.9rem, 2.8vw, 2.7rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

.reports-summary-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.reports-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 20px 20px;
}

.reports-status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(244, 249, 253, 0.92);
  border: 1px solid rgba(214, 225, 236, 0.92);
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 700;
}

.reports-client-list {
  display: grid;
  gap: 12px;
  padding: 18px 20px 20px;
}

.reports-client-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(214, 225, 236, 0.9);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 24px rgba(64, 80, 96, 0.06);
}

.reports-client-row strong {
  display: block;
  color: var(--navy-deep);
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.reports-client-row span {
  color: var(--muted);
  font-size: 0.84rem;
}

.reports-client-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px 18px;
  color: var(--muted);
}

.reports-client-metrics span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.reports-client-metrics strong {
  color: var(--navy);
}

.analytics-highlight-card h2 {
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.analytics-alert-card {
  gap: 12px;
  border-style: solid;
  min-height: 100%;
}

.analytics-alert-card h3 {
  margin: 0;
  color: var(--navy-deep);
  font-size: 1.05rem;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.analytics-alert-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.analytics-alert-card--critical {
  border-color: rgba(220, 76, 76, 0.22);
  background:
    radial-gradient(circle at top right, rgba(242, 115, 115, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 245, 245, 0.96));
}

.analytics-alert-card--warning {
  border-color: rgba(255, 176, 66, 0.26);
  background:
    radial-gradient(circle at top right, rgba(255, 204, 122, 0.2), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 250, 243, 0.96));
}

.analytics-alert-card--info {
  border-color: rgba(124, 200, 244, 0.2);
  background:
    radial-gradient(circle at top right, rgba(124, 200, 244, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 254, 0.96));
}

/* ── Analytics V2 Hero ──────────────────────────────────── */

.analytics-hub-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 24px 40px;
  overflow-y: auto;
}

body.analytics-fullscreen-page .analytics-hub-main {
  padding-right: 36px;
  scrollbar-gutter: stable;
}

.analytics-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 80% 30%, rgba(124, 200, 244, 0.28), transparent 55%),
    radial-gradient(ellipse at 10% 80%, rgba(213, 221, 148, 0.32), transparent 50%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(236, 246, 255, 0.96) 50%, rgba(240, 248, 228, 0.95) 100%);
  border: 1px solid rgba(143, 166, 186, 0.18);
  box-shadow:
    0 20px 48px rgba(92, 124, 148, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  padding: 32px 36px 28px;
  border-radius: 26px;
  flex-shrink: 0;
}

.analytics-hero::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 260px;
  height: 100%;
  background: linear-gradient(135deg, transparent, rgba(124, 200, 244, 0.1) 50%, rgba(213, 221, 148, 0.14));
  pointer-events: none;
  border-radius: 0 26px 26px 0;
}

.analytics-hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 36px;
  right: 36px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124, 200, 244, 0.25), rgba(213, 221, 148, 0.2), transparent);
}

.analytics-hero-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.analytics-hero-eyebrow {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy-soft);
  opacity: 0.7;
  margin-bottom: 6px;
}

.analytics-hero-title {
  margin: 0 0 6px;
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--navy-deep);
}

.analytics-hero-sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.analytics-hero-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding: 14px 20px;
  border-radius: 16px;
  border: 1px solid rgba(143, 166, 186, 0.2);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.analytics-hero-badge strong {
  color: var(--navy-deep);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.analytics-hero-badge span {
  color: var(--muted);
  font-size: 0.8rem;
}

/* ── Analytics Filter Bar ──────────────────────────────── */

.analytics-filter-bar {
  flex-shrink: 0;
}

.analytics-filter-bar-form {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid rgba(143, 166, 186, 0.18);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(64, 80, 96, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  flex-wrap: wrap;
}

.analytics-filter-chips-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.analytics-chip {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(143, 166, 186, 0.2);
  background: rgba(248, 251, 255, 0.8);
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.analytics-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(124, 200, 244, 0.35);
}

.analytics-chip.is-active {
  border-color: rgba(163, 205, 98, 0.6);
  background: linear-gradient(135deg, rgba(213, 221, 148, 0.25), rgba(124, 200, 244, 0.15));
  color: var(--navy-deep);
}

.analytics-filter-date-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  border-left: 1px solid rgba(143, 166, 186, 0.2);
}

.analytics-date-input {
  height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(143, 166, 186, 0.22);
  background: rgba(248, 251, 255, 0.9);
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 600;
  min-width: 130px;
}

.analytics-date-sep {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.analytics-apply-btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 10px;
  border: none;
  background: var(--navy-deep);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms ease, transform 140ms ease;
  white-space: nowrap;
}

.analytics-apply-btn:hover {
  background: var(--navy);
  transform: translateY(-1px);
}

.analytics-reset-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(143, 166, 186, 0.22);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  transition: border-color 140ms ease, color 140ms ease;
  white-space: nowrap;
}

.analytics-reset-btn:hover {
  border-color: rgba(143, 166, 186, 0.4);
  color: var(--navy);
}

.analytics-filter-right {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  border-left: 1px solid rgba(143, 166, 186, 0.2);
  flex-shrink: 0;
}

.analytics-currency-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(143, 166, 186, 0.2);
  background: rgba(248, 251, 255, 0.8);
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.analytics-currency-badge span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.analytics-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(143, 166, 186, 0.22);
  background: rgba(248, 251, 255, 0.9);
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.analytics-icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(124, 200, 244, 0.35);
  background: rgba(255, 255, 255, 0.98);
}

.analytics-icon-btn--accent {
  background: var(--navy-deep);
  color: #fff;
  border-color: transparent;
}

.analytics-icon-btn--accent:hover {
  background: var(--navy);
  border-color: transparent;
}

/* ── Analytics Body / Tabs ─────────────────────────────── */

.analytics-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.analytics-flash-wrap {
  margin-bottom: 4px;
}

/* ── Analytics Tablist V2 ──────────────────────────────── */

.analytics-tablist-v2 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 7px;
  border: 1px solid rgba(143, 166, 186, 0.16);
  border-radius: 18px;
  background: rgba(248, 251, 255, 0.9);
  box-shadow: 0 6px 20px rgba(64, 80, 96, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.analytics-tablist-v2 label {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  border-radius: 13px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  white-space: nowrap;
}

.analytics-tablist-v2 label svg {
  display: block;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 160ms ease;
}

.analytics-tablist-v2 label:hover {
  color: var(--navy);
  background: rgba(255, 255, 255, 0.7);
}

.analytics-tablist-v2 label:hover svg {
  opacity: 1;
}

/* ── Analytics KPI Cards ───────────────────────────────── */

.analytics-kpi-grid {
  display: grid;
  gap: 14px;
}

.analytics-kpi-grid--hero {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.analytics-kpi-grid--secondary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.analytics-kpi-card {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.analytics-kpi-card:hover {
  transform: translateY(-2px);
}

.analytics-kpi-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 50%);
  pointer-events: none;
}

.analytics-kpi-card--blue {
  background:
    radial-gradient(circle at top right, rgba(124, 200, 244, 0.18), transparent 55%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(240, 248, 255, 0.95));
  box-shadow: 0 12px 28px rgba(92, 124, 148, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.analytics-kpi-card--lime {
  background:
    radial-gradient(circle at top right, rgba(213, 221, 148, 0.22), transparent 55%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 240, 0.95));
  box-shadow: 0 12px 28px rgba(92, 124, 148, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.analytics-kpi-card--green {
  background:
    radial-gradient(circle at top right, rgba(134, 218, 157, 0.2), transparent 55%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(242, 252, 246, 0.95));
  box-shadow: 0 12px 28px rgba(92, 124, 148, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.analytics-kpi-card--navy {
  background:
    radial-gradient(circle at top right, rgba(47, 95, 122, 0.1), transparent 55%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(240, 245, 252, 0.95));
  box-shadow: 0 12px 28px rgba(92, 124, 148, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.analytics-kpi-card--amber {
  background:
    radial-gradient(circle at top right, rgba(241, 178, 80, 0.18), transparent 55%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(255, 251, 240, 0.95));
  box-shadow: 0 12px 28px rgba(92, 124, 148, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.analytics-kpi-card--red {
  background:
    radial-gradient(circle at top right, rgba(220, 76, 76, 0.14), transparent 55%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(255, 244, 244, 0.95));
  box-shadow: 0 12px 28px rgba(92, 124, 148, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.analytics-kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(143, 166, 186, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy-soft);
  margin-bottom: 4px;
  flex-shrink: 0;
}

.analytics-kpi-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.analytics-kpi-value {
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  color: var(--navy-deep);
  font-variant-numeric: tabular-nums;
  margin: 2px 0;
}

.analytics-kpi-trend {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.analytics-kpi-trend--up {
  color: #3a9e62;
}

.analytics-kpi-trend--down {
  color: #c0483e;
}

.analytics-kpi-sub {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ── Analytics Overview Layout ─────────────────────────── */

.analytics-overview-charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.analytics-overview-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
  gap: 16px;
  align-items: start;
}

.analytics-overview-insights {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.analytics-overview-alerts {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* sidebar sub-nav item */
.hub-nav-link--sub {
  padding-left: 28px;
  position: relative;
}

.hub-nav-link--sub::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(124, 200, 244, 0.5);
}

/* ── Legacy (kept for other pages that still use it) ────── */

.analytics-action-row {
  flex-wrap: wrap;
}

.analytics-tab-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

.analytics-tablist {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 14px 28px rgba(64, 80, 96, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.analytics-tablist label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 16px;
  border: 1px solid rgba(143, 166, 186, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.96));
  color: var(--navy);
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.analytics-tablist label:hover {
  transform: translateY(-1px);
  border-color: rgba(124, 200, 244, 0.3);
}

.analytics-tab-shell {
  display: none;
}

#analytics-tab-overview:checked ~ .analytics-tablist label[for="analytics-tab-overview"],
#analytics-tab-revenue:checked ~ .analytics-tablist label[for="analytics-tab-revenue"],
#analytics-tab-expenses:checked ~ .analytics-tablist label[for="analytics-tab-expenses"],
#analytics-tab-ops:checked ~ .analytics-tablist label[for="analytics-tab-ops"] {
  border-color: rgba(163, 205, 98, 0.55);
  background: linear-gradient(135deg, rgba(213, 221, 148, 0.2), rgba(124, 200, 244, 0.18));
  box-shadow: 0 12px 24px rgba(64, 80, 96, 0.1);
}

#analytics-tab-overview:checked ~ .analytics-tablist-v2 label[for="analytics-tab-overview"],
#analytics-tab-revenue:checked ~ .analytics-tablist-v2 label[for="analytics-tab-revenue"],
#analytics-tab-expenses:checked ~ .analytics-tablist-v2 label[for="analytics-tab-expenses"],
#analytics-tab-ops:checked ~ .analytics-tablist-v2 label[for="analytics-tab-ops"] {
  border-color: rgba(163, 205, 98, 0.55);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(213, 221, 148, 0.15) 60%, rgba(124, 200, 244, 0.12));
  color: var(--navy-deep);
  box-shadow: 0 6px 16px rgba(64, 80, 96, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

#analytics-tab-overview:checked ~ .analytics-tablist-v2 label[for="analytics-tab-overview"] svg,
#analytics-tab-revenue:checked ~ .analytics-tablist-v2 label[for="analytics-tab-revenue"] svg,
#analytics-tab-expenses:checked ~ .analytics-tablist-v2 label[for="analytics-tab-expenses"] svg,
#analytics-tab-ops:checked ~ .analytics-tablist-v2 label[for="analytics-tab-ops"] svg {
  opacity: 1;
}

#analytics-tab-overview:checked ~ .analytics-tab-shell-overview,
#analytics-tab-revenue:checked ~ .analytics-tab-shell-revenue,
#analytics-tab-expenses:checked ~ .analytics-tab-shell-expenses,
#analytics-tab-ops:checked ~ .analytics-tab-shell-ops {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.expense-analytics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.expense-analytics-card,
.accounting-expense-panel {
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(201, 226, 101, 0.1), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 244, 0.94));
  box-shadow:
    0 14px 30px rgba(64, 80, 96, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  padding: 18px;
}

.expense-analytics-card h4,
.accounting-expense-panel h2 {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: -0.03em;
}

.expense-analytics-card .analytics-panel-header {
  margin-bottom: 10px;
}

.expense-analytics-list {
  display: grid;
  gap: 12px;
}

.expense-analytics-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
  gap: 12px;
  align-items: center;
}

.expense-analytics-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.expense-analytics-copy strong,
.expense-analytics-metrics strong {
  color: var(--navy);
}

.expense-analytics-copy span {
  color: var(--muted);
  font-size: 0.88rem;
}

.expense-analytics-metrics {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.expense-month-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 12px;
  align-items: end;
}

.expense-month-bar {
  display: grid;
  gap: 8px;
  align-content: end;
  min-height: 200px;
}

.expense-month-bar span,
.expense-month-bar strong {
  display: block;
}

.expense-month-bar span {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.expense-month-bar strong {
  color: var(--navy);
  font-size: 0.95rem;
}

.expense-month-bar i,
.accounting-expense-bar i {
  display: block;
  width: 100%;
  min-height: 18px;
  border-radius: 999px 999px 18px 18px;
  background:
    linear-gradient(180deg, rgba(124, 200, 244, 0.78), rgba(79, 188, 132, 0.82)),
    linear-gradient(180deg, rgba(124, 200, 244, 0.24), rgba(255, 255, 255, 0));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  align-self: end;
  height: var(--expense-bar-height, 32%);
}

.accounting-expense-trend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 12px;
  align-items: end;
}

.accounting-expense-bar {
  display: grid;
  gap: 8px;
  align-content: end;
  min-height: 170px;
}

.accounting-expense-bar span,
.accounting-expense-bar strong {
  display: block;
}

.accounting-expense-bar span {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.accounting-expense-bar strong {
  color: var(--navy);
  font-size: 0.9rem;
}

.accounting-expense-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.accounting-expense-breakdown-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(201, 226, 101, 0.22);
  background: rgba(255, 255, 255, 0.8);
}

.accounting-expense-breakdown-card strong {
  color: var(--navy);
  font-size: 1.06rem;
}

.accounting-expense-breakdown-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.analytics-panel {
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(124, 200, 244, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 254, 0.94));
  box-shadow:
    0 18px 36px rgba(64, 80, 96, 0.1),
    0 8px 16px rgba(124, 200, 244, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -10px 18px rgba(14, 27, 44, 0.018);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.analytics-panel-wide {
  grid-column: 1 / -1;
}

.analytics-panel-chart {
  min-height: 420px;
}

.analytics-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.analytics-panel-header h3,
.analytics-chart-summary strong,
.analytics-chart-summary span {
  margin: 0;
}

.analytics-panel-header h3 {
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.analytics-panel-chart .analytics-range-switch {
  margin: 6px 0 4px;
}

.analytics-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.analytics-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend-dot-billed {
  background: var(--accent);
}

.legend-dot-collected {
  background: var(--lime);
}

.analytics-chart-summary {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 8px 14px;
  align-items: baseline;
}

.analytics-chart-summary strong {
  color: var(--navy);
  font-size: 1.35rem;
  line-height: 1;
}

.analytics-chart-summary span {
  color: var(--muted);
  font-size: 0.88rem;
}

.analytics-chart {
  width: 100%;
  height: auto;
  overflow: visible;
}

.analytics-chart-frame {
  fill: rgba(255, 255, 255, 0.7);
  stroke: rgba(255, 255, 255, 0.88);
  stroke-width: 1;
  filter: url(#analytics-chart-shadow);
}

.analytics-gridline {
  stroke: rgba(23, 52, 84, 0.1);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}

.analytics-axis-label {
  fill: #7a8aa1;
  font-size: 11px;
  font-family: inherit;
}

.analytics-line {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.analytics-line-billed {
  stroke: url(#analytics-billed-stroke);
}

.analytics-line-billed-shadow {
  stroke: rgba(70, 125, 196, 0.18);
  stroke-width: 8;
}

.analytics-line-collected {
  stroke: url(#analytics-collected-stroke);
}

.analytics-line-collected-shadow {
  stroke: rgba(133, 177, 92, 0.16);
  stroke-width: 8;
}

.analytics-line-collected-empty {
  stroke-dasharray: 10 10;
  opacity: 0.42;
}

.analytics-line-shadow {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: blur(1px);
}

.analytics-line-highlight {
  stroke: rgba(255, 255, 255, 0.65);
  stroke-width: 2;
  opacity: 0.5;
  filter: url(#analytics-chart-glow);
  pointer-events: none;
}

.analytics-area {
  opacity: 0.85;
}

.analytics-area-billed {
  fill: url(#analytics-billed-fill);
}

.analytics-area-collected {
  fill: url(#analytics-collected-fill);
}

.analytics-point {
  stroke-width: 2;
  stroke: rgba(255, 255, 255, 0.95);
  filter: url(#analytics-chart-shadow);
}

.analytics-point-billed {
  fill: url(#analytics-billed-stroke);
}

.analytics-point-collected {
  fill: url(#analytics-collected-stroke);
}

.analytics-chart-note {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.status-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.status-breakdown-row {
  display: grid;
  gap: 8px;
}

.status-breakdown-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-breakdown-copy strong,
.status-breakdown-copy span {
  margin: 0;
}

.status-breakdown-copy span {
  color: var(--muted);
  font-size: 0.88rem;
}

.status-breakdown-bar {
  height: 12px;
  border-radius: 999px;
  background: rgba(23, 52, 84, 0.08);
  overflow: hidden;
}

.status-breakdown-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.status-breakdown-fill-draft {
  background: linear-gradient(135deg, #ffd971 0%, #ffb347 100%);
}

.status-breakdown-fill-pending {
  background: linear-gradient(135deg, #d8e1eb 0%, #9bafc4 100%);
}

.status-breakdown-fill-sent {
  background: linear-gradient(135deg, #6dc1f6 0%, #4ea3f0 100%);
}

.status-breakdown-fill-paid {
  background: linear-gradient(135deg, #c9e265 0%, #72c76d 100%);
}

.status-breakdown-fill-overdue {
  background: linear-gradient(135deg, #ffb0aa 0%, #ee665d 100%);
}

.status-breakdown-fill-cancelled {
  background: linear-gradient(135deg, #d7d2d1 0%, #aaa09d 100%);
}

.analytics-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.analytics-table-row {
  display: grid;
  grid-template-columns: 1.6fr 0.7fr 1fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(247, 248, 250, 0.8);
  border: 1px solid rgba(23, 52, 84, 0.08);
}

.analytics-table-head {
  background: transparent;
  border: none;
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
}

.analytics-table-row-recent {
  grid-template-columns: 0.9fr 1.4fr 0.9fr 0.9fr 1fr 1fr;
}

.analytics-row-link {
  color: inherit;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.analytics-row-link:hover {
  transform: translateY(-2px);
  border-color: rgba(109, 193, 246, 0.26);
  box-shadow: 0 12px 24px rgba(23, 52, 84, 0.08);
}

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

.onboarding-grid {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.builder-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: start;
}

.invoice-page {
  grid-template-columns: 300px 1fr;
}

.invoice-page-download {
  grid-template-columns: 1fr;
  max-width: calc(210mm + 24px);
  margin: 0 auto;
  gap: 18px;
  min-height: 100vh;
  background: #ffffff !important;
}

.invoice-callout {
  width: 100%;
  max-width: none;
  margin: 0 0 18px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-radius: 22px;
  border: 1px solid rgba(184, 93, 93, 0.18);
  background:
    radial-gradient(circle at top right, rgba(184, 93, 93, 0.12), transparent 24%),
    radial-gradient(circle at bottom left, rgba(109, 193, 246, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(255, 250, 250, 0.98), rgba(255, 241, 241, 0.95));
  box-shadow: 0 14px 26px rgba(64, 80, 96, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.invoice-callout-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.invoice-callout .eyebrow {
  color: var(--error);
}

.invoice-callout strong {
  font-size: 1rem;
}

.invoice-callout p {
  margin: 0;
  color: var(--muted);
}

.invoice-callout .primary-button {
  flex-shrink: 0;
  white-space: nowrap;
}

.invoice-payment-cta {
  width: 100%;
  max-width: none;
  margin: 18px 0 0;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-radius: 22px;
  border: 1px solid rgba(109, 193, 246, 0.22);
  background:
    radial-gradient(circle at top right, rgba(109, 193, 246, 0.14), transparent 28%),
    radial-gradient(circle at bottom left, rgba(201, 226, 101, 0.18), transparent 24%),
    linear-gradient(180deg, rgba(247, 252, 255, 0.98), rgba(237, 245, 253, 0.98));
  box-shadow: 0 14px 26px rgba(64, 80, 96, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.invoice-payment-cta-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.invoice-payment-cta-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.invoice-payment-cta h2 {
  margin: 0;
  font-size: 1.05rem;
}

.invoice-payment-cta p {
  margin: 0;
  color: var(--muted);
}

.invoice-payment-cta-button {
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 132px;
  justify-content: center;
}

.invoice-payment-cta-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.invoice-payment-cta-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 156px;
  padding: 10px 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(109, 193, 246, 0.18);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 10px 20px rgba(64, 80, 96, 0.05);
  overflow: hidden;
  flex: 0 0 auto;
}

.invoice-payment-cta-qr-image {
  display: block;
  width: 120px;
  height: 120px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(64, 80, 96, 0.08);
}

.invoice-payment-cta-qr span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.invoice-payment-cta-closed {
  justify-content: space-between;
  align-items: center;
}

.invoice-payment-cta-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0f3555;
  background: rgba(201, 226, 101, 0.28);
  border: 1px solid rgba(109, 193, 246, 0.22);
}

.invoice-sheet-download {
  overflow: visible;
  height: auto;
  box-shadow:
    0 0 0 1px rgba(23, 52, 84, 0.18),
    0 24px 48px rgba(64, 80, 96, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -10px 22px rgba(14, 27, 44, 0.02);
}

.invoice-sheet-download .invoice-payment-cta {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 182px;
  align-items: center;
  gap: 18px;
  padding: 18px 18px 18px 20px;
  break-inside: avoid;
  page-break-inside: avoid;
  background: #f8fcff;
  box-shadow: none;
  border-color: rgba(109, 193, 246, 0.18);
}

.invoice-sheet-download .invoice-payment-cta-actions {
  width: 182px;
  gap: 10px;
  margin-left: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  justify-self: end;
}

.invoice-sheet-download .invoice-payment-cta-qr {
  width: 100%;
  padding: 8px 8px 10px;
  border-radius: 16px;
  box-sizing: border-box;
}

.invoice-sheet-download .invoice-payment-cta-qr-image {
  width: 112px;
  height: 112px;
}

.invoice-sheet-download .invoice-payment-cta-button {
  align-self: center;
  margin-left: 0;
  min-width: 136px;
  min-height: 40px;
  padding: 10px 18px;
  line-height: 1;
  box-shadow: none;
  background: linear-gradient(135deg, rgba(223, 231, 159, 0.96) 0%, rgba(124, 200, 244, 0.96) 100%);
  border-color: rgba(108, 175, 221, 0.16);
  transform: none;
}

.invoice-sheet-download .invoice-payment-cta-closed {
  align-items: center;
}

@media (max-width: 720px) {
  .invoice-payment-cta {
    align-items: stretch;
    flex-direction: column;
  }

  .invoice-payment-cta-actions {
    width: 100%;
    margin-left: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
  }

  .invoice-payment-cta-qr {
    width: 100%;
  }

  .invoice-payment-cta-button {
    width: 100%;
  }
}

@media print {
  .invoice-sheet-download .invoice-payment-cta {
    grid-template-columns: minmax(0, 1fr) 178px !important;
    gap: 16px !important;
    padding: 16px 16px 16px 18px !important;
  }

  .invoice-sheet-download .invoice-payment-cta-actions {
    width: 178px !important;
  }

  .invoice-sheet-download .invoice-payment-cta-qr {
    padding: 7px 7px 9px !important;
  }

  .invoice-sheet-download .invoice-payment-cta-qr-image {
    width: 108px !important;
    height: 108px !important;
  }

  .invoice-sheet-download .invoice-payment-cta-button {
    min-width: 128px !important;
  }
}

.invoice-page-download::before,
.invoice-page-download::after {
  content: none !important;
  display: none !important;
}

body:has(.invoice-page-download) {
  background: #ffffff !important;
}

body:has(.invoice-page-download)::before,
body:has(.invoice-page-download)::after {
  content: none !important;
  display: none !important;
}

.invoice-download-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  row-gap: 10px;
}

.invoice-download-actions .ghost-button,
.invoice-download-actions .primary-button {
  min-height: 44px;
  padding: 10px 18px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.invoice-download-target {
  width: min(210mm, calc(100% - 2px));
  margin: 0 auto;
}

.hero-card,
.panel,
.invoice-sheet {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius);
  box-shadow:
    0 24px 48px rgba(64, 80, 96, 0.12),
    0 8px 22px rgba(124, 200, 244, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -10px 22px rgba(14, 27, 44, 0.02);
}

.hero-card,
.panel {
  padding: 26px;
}

.auth-hero,
.auth-panel {
  position: relative;
  overflow: hidden;
}

.auth-hero {
  min-height: 620px;
  color: white;
  border: none;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.18), transparent 18%),
    radial-gradient(circle at 78% 18%, rgba(201, 226, 101, 0.24), transparent 16%),
    radial-gradient(circle at 70% 68%, rgba(124, 200, 244, 0.24), transparent 18%),
    linear-gradient(140deg, #d8e08f 0%, #7cc8f4 34%, #356c8d 64%, #203a52 84%, #102030 100%);
}

.auth-panel {
  background:
    radial-gradient(circle at top right, rgba(124, 200, 244, 0.08), transparent 24%),
    radial-gradient(circle at top left, rgba(201, 226, 101, 0.1), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.96));
  backdrop-filter: blur(20px) saturate(125%);
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow: 0 28px 80px rgba(64, 80, 96, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.hero-sheen {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 22%),
    linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08) 0%,
    transparent 42%,
    rgba(255, 255, 255, 0.05) 100%
  );
  pointer-events: none;
}

.auth-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 100%;
  min-height: 100%;
  padding: 12px 8px 8px;
}

.auth-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  min-height: 100%;
}

.auth-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: flex-start;
  min-width: 0;
  min-height: 100%;
}

.auth-hero-eyebrow {
  color: rgba(255, 255, 255, 0.68);
}

.auth-hero-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-hero-brand-icon {
  width: 66px;
  height: 66px;
  flex-shrink: 0;
  border-radius: 22px;
  box-shadow: 0 18px 32px rgba(64, 80, 96, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.auth-hero-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-hero-brand-copy h1 {
  margin: 0;
  font-size: clamp(2.4rem, 3.4vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  color: white;
  max-width: 11ch;
  text-wrap: balance;
}

.builder-stage {
  padding: 24px 24px 28px;
}

.hero-card h1,
.panel h1,
.panel h2,
.panel h3,
.sample-title {
  margin: 0 0 8px;
  letter-spacing: -0.04em;
}

.sample-title {
  font-size: 2.9rem;
  font-weight: 400;
  color: #213346;
  margin: 18px 0 20px;
}

.auth-hero-title {
  font-size: clamp(1.7rem, 2.45vw, 3.1rem);
  line-height: 0.96;
  max-width: 100%;
  white-space: nowrap;
  text-wrap: nowrap;
}

.auth-kicker {
  margin: 0;
  font-size: clamp(1.05rem, 1.35vw, 1.2rem);
  line-height: 1.38;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.94);
}

.auth-lead {
  display: grid;
  gap: 3px;
  font-size: 0.96rem;
  line-height: 1.45;
  color: rgba(240, 244, 250, 0.84);
  max-width: 60ch;
  text-wrap: balance;
}

.auth-lead-row {
  display: block;
}

.auth-hero-swap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 15px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(
      135deg,
      rgba(124, 200, 244, 0.16),
      rgba(255, 255, 255, 0.1) 38%,
      rgba(201, 226, 101, 0.12)
    ),
    rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 18px 34px rgba(14, 27, 44, 0.16),
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    inset 0 -18px 26px rgba(14, 27, 44, 0.06);
  overflow: hidden;
  isolation: isolate;
  animation: auth-hero-chip-breathe 4.6s ease-in-out infinite;
}

.auth-hero-swap::before {
  content: "";
  position: absolute;
  inset: -30% auto auto -12%;
  width: 140px;
  height: 140px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.26), transparent 68%);
  animation: auth-rotator-float 9s ease-in-out infinite;
  pointer-events: none;
  filter: blur(2px);
}

.auth-hero-swap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.14) 18%,
    transparent 36%
  );
  transform: translateX(-120%);
  animation: auth-rotator-sweep 4.8s ease-in-out infinite;
  pointer-events: none;
}

.auth-hero-swap-text {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -0.02em;
  min-height: 1.3em;
  white-space: nowrap;
  text-shadow: 0 8px 20px rgba(14, 27, 44, 0.24);
}

.auth-hero-swap-text-value {
  display: inline-block;
  min-height: 1.3em;
}

.auth-hero-swap-cursor {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(213, 221, 148, 0.95));
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
  animation: auth-hero-cursor-blink 1s steps(1) infinite;
}

.auth-hero-swap.is-transitioning .auth-hero-swap-cursor {
  opacity: 0.8;
}

.auth-hero-swap.is-transitioning::after {
  opacity: 1;
  animation-duration: 2.4s;
}

.auth-hero-swap.is-entering::before {
  animation-duration: 5.5s;
}

.auth-hero-preview {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 4px;
  padding: 20px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.2), transparent 24%),
    linear-gradient(180deg, rgba(13, 27, 44, 0.24), rgba(13, 27, 44, 0.14));
  box-shadow:
    0 32px 64px rgba(14, 27, 44, 0.24),
    0 10px 18px rgba(124, 200, 244, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -16px 32px rgba(14, 27, 44, 0.08);
  backdrop-filter: blur(12px) saturate(118%);
}

@media (hover: hover) and (pointer: fine) {
  .auth-hero-copy :is(.eyebrow, h1, .auth-kicker, .auth-lead-row),
  .auth-hero-preview
    :is(
      .auth-hero-preview-head strong,
      .auth-hero-preview-stat strong,
      .auth-hero-preview-stat span,
      .auth-hero-preview-footer strong,
      .auth-hero-preview-footer span
    ) {
    display: inline-block;
    transform-origin: center center;
    transition: transform 180ms ease, filter 180ms ease, text-shadow 180ms ease;
    will-change: transform;
  }

  .auth-hero-copy :is(.eyebrow, h1, .auth-kicker, .auth-lead-row):hover,
  .auth-hero-copy :is(.eyebrow, h1, .auth-kicker, .auth-lead-row):focus-visible,
  .auth-hero-preview
    :is(
      .auth-hero-preview-head strong,
      .auth-hero-preview-stat strong,
      .auth-hero-preview-stat span,
      .auth-hero-preview-footer strong,
      .auth-hero-preview-footer span
    ):hover,
  .auth-hero-preview
    :is(
      .auth-hero-preview-head strong,
      .auth-hero-preview-stat strong,
      .auth-hero-preview-stat span,
      .auth-hero-preview-footer strong,
      .auth-hero-preview-footer span
    ):focus-visible {
    transform: scale(1.03);
    filter: brightness(1.05);
    text-shadow: 0 0 16px rgba(255, 255, 255, 0.18);
  }
}

.auth-hero-carousel {
  gap: 12px;
}

.auth-hero-preview-track {
  position: relative;
  min-height: 285px;
}

.auth-hero-preview-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  opacity: 0;
  transform: translateY(12px) scale(0.985);
  transition: opacity 440ms ease, transform 440ms cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
  will-change: opacity, transform;
}

.auth-hero-preview-slide.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  animation: auth-carousel-rise 640ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.auth-hero-preview-grid-template .auth-hero-preview-stat strong {
  font-size: 0.88rem;
}

.auth-hero-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.auth-hero-preview-label {
  color: rgba(255, 255, 255, 0.7);
}

.auth-hero-preview-head strong {
  color: white;
  font-size: 1.15rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-align: right;
}

.auth-hero-preview-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.auth-hero-preview-pills span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  padding-top: 1px;
  box-shadow:
    0 10px 18px rgba(14, 27, 44, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -8px 14px rgba(14, 27, 44, 0.04);
}

.auth-hero-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.auth-hero-preview-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 16px 28px rgba(14, 27, 44, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -12px 20px rgba(14, 27, 44, 0.05);
}

.auth-hero-preview-dots {
  opacity: 0.9;
}

.auth-hero-preview-stat strong {
  color: white;
  font-size: 0.92rem;
}

.auth-hero-preview-stat span {
  color: rgba(240, 244, 250, 0.8);
  font-size: 0.8rem;
  line-height: 1.4;
}

.auth-hero-preview-footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-hero-preview-footer strong {
  color: white;
  font-size: 0.9rem;
}

.auth-hero-preview-footer span {
  color: rgba(240, 244, 250, 0.78);
  font-size: 0.82rem;
  line-height: 1.45;
}

.auth-hero-preview-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-top: 2px;
}

.auth-hero-preview-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, width 180ms ease, box-shadow 180ms ease;
}

.auth-hero-preview-dot.is-active {
  width: 28px;
  background: linear-gradient(135deg, rgba(213, 221, 148, 0.95), rgba(124, 200, 244, 0.95));
  box-shadow: 0 10px 18px rgba(14, 27, 44, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.auth-hero-preview-dot:hover,
.auth-hero-preview-dot:focus-visible {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.5);
}

@keyframes auth-rotator-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.55;
  }

  50% {
    transform: translate3d(18px, 10px, 0) scale(1.08);
    opacity: 0.9;
  }
}

@keyframes auth-rotator-sweep {
  0%,
  55% {
    transform: translateX(-120%);
  }

  75% {
    transform: translateX(120%);
  }

  100% {
    transform: translateX(120%);
  }
}

@keyframes auth-hero-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.72;
  }

  50% {
    transform: scale(1.14);
    opacity: 1;
  }
}

@keyframes auth-hero-cursor-blink {
  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0.15;
  }
}

@keyframes auth-hero-chip-breathe {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-1px);
  }
}

@keyframes auth-carousel-rise {
  0% {
    opacity: 0.1;
    transform: translateY(16px) scale(0.98);
    filter: blur(8px);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.stack,
.stack-sm,
.stack-lg {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
}

.stack-lg > * {
  min-width: 0;
}

.stack {
  gap: 14px;
}

.stack-sm {
  gap: 10px;
}

.invoice-email-form {
  gap: 12px;
}

.invoice-email-form label {
  gap: 4px;
}

.invoice-email-sender-row {
  min-width: 0;
}

.invoice-email-form select,
.invoice-email-form input,
.invoice-email-form textarea {
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 0.95rem;
}

.invoice-email-form select {
  min-height: 46px;
}

.invoice-email-form .helper-text {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
}

.invoice-email-form button.primary-button {
  width: 100%;
}

.stack-lg {
  gap: 18px;
}

.feature-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.feature-list-premium {
  margin-top: 4px;
  padding-left: 20px;
  color: rgba(240, 244, 250, 0.78);
  font-size: 0.86rem;
}

.divider,
.sample-divider {
  height: 1px;
  background: var(--line);
}

.divider-labeled {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.divider-labeled::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: var(--line);
}

.divider-labeled span {
  position: relative;
  z-index: 1;
  padding: 0 14px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.divider-soft {
  opacity: 0.75;
}

.sample-divider {
  margin-top: 22px;
  background: #708090;
  height: 4px;
}

.ghost-button,
.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 46px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 11px 20px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
  transform: translateZ(0);
  backface-visibility: hidden;
  box-shadow:
    0 12px 22px rgba(64, 80, 96, 0.12),
    0 4px 0 rgba(255, 255, 255, 0.42) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -8px 14px rgba(14, 27, 44, 0.02);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    filter 160ms ease;
}

.primary-button {
  background: linear-gradient(135deg, rgba(223, 231, 159, 0.98) 0%, rgba(124, 200, 244, 0.98) 100%);
  color: var(--navy-deep);
  border-color: rgba(108, 175, 221, 0.2);
}

.secondary-button {
  background: linear-gradient(135deg, rgba(32, 58, 82, 0.98) 0%, rgba(47, 95, 122, 0.98) 100%);
  color: white;
  border-color: rgba(32, 58, 82, 0.22);
}

.button-disabled,
.secondary-button:disabled,
.primary-button:disabled,
.ghost-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  filter: saturate(0.3);
}

.ghost-button {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(243, 247, 251, 0.97));
  border-color: rgba(143, 166, 186, 0.34);
  color: var(--navy);
  box-shadow:
    0 12px 20px rgba(64, 80, 96, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.84) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -10px 16px rgba(14, 27, 44, 0.018);
}

.ghost-button:hover,
.ghost-button:focus-visible,
.primary-button:hover,
.primary-button:focus-visible,
.secondary-button:hover,
.secondary-button:focus-visible,
.danger-button:hover,
.danger-button:focus-visible {
  transform: translateY(-1px);
  filter: saturate(1.04);
}

.ghost-button:active,
.primary-button:active,
.secondary-button:active,
.danger-button:active {
  transform: translateY(1px) scale(0.985);
  box-shadow: 0 6px 12px rgba(64, 80, 96, 0.08), inset 0 6px 12px rgba(14, 27, 44, 0.1);
}

.danger-button {
  background: linear-gradient(135deg, #d97f7f, var(--danger));
  color: white;
}

.helper-text {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
}

.auth-switch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 253, 0.92));
  box-shadow: 0 16px 30px rgba(64, 80, 96, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.auth-switch-button {
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(245, 249, 253, 0.98), rgba(230, 238, 246, 0.98));
  border-color: rgba(143, 166, 186, 0.48);
  color: var(--navy);
  box-shadow: 0 14px 26px rgba(64, 80, 96, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.auth-switch-button:hover,
.auth-switch-button:focus-visible {
  border-color: rgba(124, 200, 244, 0.54);
  background: linear-gradient(180deg, rgba(248, 251, 254, 0.98), rgba(233, 241, 248, 0.98));
}

.auth-intro {
  gap: 8px;
}

.auth-panel h2 {
  font-size: 1.75rem;
  margin-bottom: 0;
  line-height: 1.05;
}

.auth-heading-inline {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-heading-badge {
  color: var(--navy-soft);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  transform: translateY(-1px);
}

.auth-panel-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-panel-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(213, 221, 148, 0.22), rgba(124, 200, 244, 0.18));
  color: var(--navy);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-section {
  gap: 10px;
}

.auth-password-label {
  gap: 8px;
}

.auth-password-field {
  position: relative;
}

.auth-password-field input {
  padding-right: 54px;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(143, 166, 186, 0.26);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 246, 250, 0.98));
  color: var(--navy);
  box-shadow: 0 8px 16px rgba(64, 80, 96, 0.08);
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
  border-color: rgba(124, 200, 244, 0.6);
  background: linear-gradient(180deg, rgba(250, 252, 255, 0.99), rgba(235, 242, 248, 0.99));
}

.auth-password-toggle:active {
  transform: translateY(-50%) scale(0.98);
}

.auth-password-toggle-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
}

.auth-password-toggle-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-password-hint {
  max-width: 44rem;
}

.auth-inline-actions {
  display: flex;
  justify-content: flex-end;
}

.helper-link {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--navy-soft);
}

.two-factor-setup-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 253, 0.92));
  box-shadow: 0 14px 30px rgba(64, 80, 96, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.two-factor-qr {
  width: 140px;
  height: 140px;
  object-fit: contain;
  border-radius: 14px;
  background: white;
  padding: 8px;
  border: 1px solid var(--line);
}

.two-factor-secret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f4f8fc;
  border: 1px solid var(--line);
  color: var(--navy);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  word-break: break-word;
}

.oauth-google-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  width: 100%;
  min-height: 52px;
  border-radius: 999px;
  padding: 12px 18px;
  background: linear-gradient(135deg, #dfe79f 0%, #7cc8f4 100%);
  color: var(--navy-deep);
  font-weight: 800;
  border: 1px solid rgba(108, 175, 221, 0.24);
  box-shadow:
    0 20px 36px rgba(64, 80, 96, 0.16),
    0 6px 0 rgba(255, 255, 255, 0.48) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -10px 18px rgba(14, 27, 44, 0.04);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease,
    border-color 160ms ease;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.oauth-google-button span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transform: none;
}

.oauth-google-button:hover,
.oauth-google-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(108, 175, 221, 0.4);
  box-shadow:
    0 24px 42px rgba(64, 80, 96, 0.18),
    0 6px 0 rgba(255, 255, 255, 0.5) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -10px 18px rgba(14, 27, 44, 0.045);
}

.oauth-google-button:active {
  transform: translateY(1px) scale(0.985);
  box-shadow: 0 10px 18px rgba(64, 80, 96, 0.1), inset 0 6px 12px rgba(14, 27, 44, 0.08);
}

.oauth-google-button-disabled {
  background: linear-gradient(135deg, #e6ebf1 0%, #cfd8e3 100%);
  color: #6d7b8f;
  box-shadow: 0 10px 22px rgba(112, 129, 151, 0.14);
  filter: saturate(0.2);
  cursor: not-allowed;
}

.oauth-google-button-disabled:hover,
.oauth-google-button-disabled:focus-visible {
  background: linear-gradient(135deg, #e6ebf1 0%, #cfd8e3 100%);
  color: #6d7b8f;
  transform: none;
}

.oauth-google-button-disabled .google-glyph {
  opacity: 0.58;
}

.google-glyph {
  display: block;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  object-fit: contain;
}

.auth-create-button {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-soft) 100%);
  color: white;
  box-shadow:
    0 20px 36px rgba(64, 80, 96, 0.16),
    0 5px 0 rgba(255, 255, 255, 0.22) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -10px 18px rgba(14, 27, 44, 0.08);
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
}

label span {
  font-size: 0.88rem;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(143, 166, 186, 0.34);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 253, 0.98));
  padding: 12px 14px;
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(64, 80, 96, 0.04), 0 8px 18px rgba(64, 80, 96, 0.08);
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease,
    background-color 120ms ease,
    transform 120ms ease;
}

input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.74;
  background: linear-gradient(180deg, rgba(244, 247, 250, 0.98), rgba(236, 242, 248, 0.98));
  color: rgba(98, 115, 134, 0.92);
  box-shadow: inset 0 1px 2px rgba(64, 80, 96, 0.03), 0 6px 14px rgba(64, 80, 96, 0.05);
}

.auth-panel .flash {
  padding: 12px 14px;
}

@media (max-width: 1120px) {
  .auth-hero-layout {
    grid-template-columns: 1fr;
  }
}

.otp-input {
  letter-spacing: 0.24em;
  font-size: 1.05rem;
  text-transform: uppercase;
}

@media (max-height: 860px) and (min-width: 981px) {
  .topbar {
    margin-bottom: 18px;
  }

  .auth-grid-premium {
    gap: 20px;
  }

  .hero-card,
  .panel {
    padding: 22px;
  }

  .auth-hero {
    min-height: 560px;
  }

  .auth-hero-content {
    gap: 12px;
  }

  .auth-hero .auth-hero-title {
    font-size: clamp(2.1rem, 3.1vw, 3.25rem);
    max-width: 12ch;
  }

  .auth-kicker {
    font-size: 1.05rem;
  }

  .auth-lead {
    font-size: 0.9rem;
    line-height: 1.4;
    max-width: 54ch;
  }

  .auth-hero-preview-grid {
    gap: 8px;
  }

  .auth-hero-preview-track {
    min-height: 314px;
  }

  .auth-hero-preview-slide {
    gap: 12px;
  }

  .auth-hero-preview-footer {
    gap: 3px;
    padding-top: 2px;
  }

  .auth-hero-preview-footer strong {
    font-size: 0.85rem;
  }

  .auth-hero-preview-footer span {
    font-size: 0.76rem;
    line-height: 1.3;
    text-wrap: balance;
  }

  .feature-list-premium {
    display: none;
  }

  .auth-panel h2 {
    font-size: 1.6rem;
  }

  .auth-heading-badge {
    font-size: 0.62rem;
  }

  .oauth-google-button,
  .primary-button {
    min-height: 48px;
  }
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(124, 200, 244, 0.78);
  box-shadow:
    0 0 0 4px rgba(124, 200, 244, 0.16),
    inset 0 1px 3px rgba(64, 80, 96, 0.03),
    0 10px 22px rgba(64, 80, 96, 0.1);
  background: #ffffff;
}

.auth-panel label span {
  color: var(--navy);
}

.auth-panel input,
.auth-panel select,
.auth-panel textarea {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
  border-color: rgba(143, 166, 186, 0.42);
}

textarea {
  resize: vertical;
}

.flash,
.code-block,
.empty-state {
  border-radius: 14px;
  padding: 14px 16px;
}

.flash {
  background: var(--accent-soft);
  color: var(--navy);
  transition:
    opacity 240ms ease,
    transform 240ms ease,
    max-height 240ms ease,
    margin 240ms ease,
    padding 240ms ease;
  max-height: 120px;
  overflow: hidden;
}

.flash-error {
  background: var(--error-soft);
  color: var(--error);
}

.flash-success {
  background: var(--accent-soft);
  color: var(--navy);
}

.flash.is-dismissing {
  opacity: 0;
  transform: translateY(-8px) scale(0.99);
  max-height: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.toast-stack {
  position: fixed;
  top: 74px;
  right: 22px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(360px, calc(100vw - 28px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 16px 14px;
  border-radius: 18px;
  border: 1px solid rgba(143, 166, 186, 0.22);
  box-shadow: 0 18px 38px rgba(32, 58, 82, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px) saturate(118%);
  -webkit-backdrop-filter: blur(12px) saturate(118%);
  animation: toast-enter 180ms ease-out;
}

.toast-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.toast-copy strong {
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toast-copy p {
  margin: 0;
  line-height: 1.45;
}

.toast-close {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0;
  margin-top: -2px;
  opacity: 0.72;
}

.toast-close:hover,
.toast-close:focus-visible {
  opacity: 1;
}

.toast-success {
  background: linear-gradient(180deg, rgba(241, 250, 245, 0.98), rgba(228, 245, 234, 0.98));
  color: #1f5f46;
}

.toast-error {
  background: linear-gradient(180deg, rgba(255, 248, 242, 0.99), rgba(255, 232, 223, 0.98));
  color: #9f4f3d;
  border-color: rgba(217, 127, 127, 0.28);
}

.toast-info {
  background: linear-gradient(180deg, rgba(240, 245, 255, 0.99), rgba(224, 234, 255, 0.98));
  color: #1e3a7a;
  border-color: rgba(120, 150, 220, 0.28);
}

.toast.is-dismissing {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 220ms ease, transform 220ms ease;
}

.pwa-install-banner {
  position: fixed;
  left: 22px;
  right: 22px;
  bottom: 22px;
  z-index: 1300;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: min(640px, calc(100vw - 44px));
  margin: 0 auto;
  padding: 14px;
  border: 1px solid rgba(143, 166, 186, 0.28);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.96));
  box-shadow: 0 24px 56px rgba(32, 58, 82, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px) saturate(118%);
  -webkit-backdrop-filter: blur(14px) saturate(118%);
  animation: pwa-install-enter 220ms ease-out;
}

.pwa-install-banner.is-dismissing {
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 220ms ease, transform 220ms ease;
}

.pwa-install-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(64, 80, 96, 0.12);
  overflow: hidden;
}

.pwa-install-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pwa-install-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.pwa-install-copy strong {
  color: var(--navy-deep);
  font-size: 0.98rem;
}

.pwa-install-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.pwa-install-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pwa-install-actions .primary-button,
.pwa-install-actions .ghost-button {
  min-height: 40px;
  padding: 9px 15px;
  white-space: nowrap;
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pwa-install-enter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 980px) {
  .toast-stack {
    top: 74px;
    right: 16px;
    width: min(340px, calc(100vw - 32px));
  }

  .toast {
    padding: 15px;
  }
}

@media (max-width: 720px) {
  .toast-stack {
    left: 16px;
    right: 16px;
    top: 74px;
    width: auto;
  }

  .toast {
    gap: 12px;
    padding: 14px 14px 13px;
    border-radius: 16px;
  }

  .toast-copy strong {
    font-size: 0.8rem;
  }

  .toast-copy p {
    font-size: 0.92rem;
  }

  .pwa-install-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
    grid-template-columns: auto minmax(0, 1fr);
    width: auto;
    padding: 12px;
    border-radius: 18px;
  }

  .pwa-install-actions {
    grid-column: 1 / -1;
    width: 100%;
  }

  .pwa-install-actions .primary-button,
  .pwa-install-actions .ghost-button {
    flex: 1;
  }

  .analytics-hub-main {
    padding: 18px 16px 32px;
    gap: 14px;
    overflow-x: hidden;
  }

  .analytics-hero {
    padding: 22px 18px 20px;
    border-radius: 22px;
  }

  .analytics-hero::after {
    left: 18px;
    right: 18px;
  }

  .analytics-hero-title {
    font-size: clamp(1.35rem, 5vw, 1.8rem);
  }

  .analytics-hero-badge {
    width: 100%;
    border-radius: 14px;
  }

  .analytics-filter-bar-form {
    padding: 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    border-radius: 22px;
    background:
      radial-gradient(circle at top right, rgba(124, 200, 244, 0.16), transparent 32%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 248, 253, 0.96));
    box-shadow:
      0 14px 30px rgba(64, 80, 96, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.92);
  }

  .analytics-filter-chips-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .analytics-chip {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    font-size: 0.77rem;
    justify-content: center;
    border-radius: 12px;
  }

  .analytics-filter-date-row,
  .analytics-filter-right {
    gap: 8px;
    flex-direction: column;
    border-left: none;
    padding-left: 0;
    border-top: 1px solid rgba(143, 166, 186, 0.15);
    padding-top: 8px;
  }

  .analytics-date-sep {
    display: none;
  }

  .analytics-date-input,
  .analytics-apply-btn,
  .analytics-reset-btn,
  .analytics-currency-badge,
  .analytics-icon-btn {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .analytics-date-input {
    height: 40px;
    padding: 0 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    min-width: 0;
  }

  .analytics-apply-btn,
  .analytics-reset-btn {
    height: 40px;
    border-radius: 12px;
    justify-content: center;
  }

  .analytics-tablist-v2 {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 6px;
  }

  .analytics-tablist-v2 label {
    min-height: 38px;
    font-size: 0.8rem;
  }

  .analytics-kpi-grid--hero,
  .analytics-kpi-grid--secondary,
  .dashboard-analytics-grid,
  .dashboard-analytics-grid-full {
    grid-template-columns: 1fr;
  }

  .analytics-panel {
    padding: 18px;
    border-radius: 20px;
    gap: 14px;
  }

  .analytics-chart-summary {
    grid-template-columns: 1fr;
    row-gap: 4px;
  }

  .analytics-chart-summary strong,
  .analytics-chart-summary span {
    line-height: 1.2;
  }

  .analytics-date-sep {
    display: none;
  }

  .expense-analytics-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .expense-analytics-metrics {
    justify-items: start;
  }

  .analytics-table-row,
  .analytics-table-row-recent {
    padding: 12px 14px;
  }
}

.code-block {
  background: var(--navy);
  color: white;
  white-space: pre-wrap;
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 0.9rem;
}

.empty-state {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 249, 253, 0.92));
  color: var(--muted);
}

.api-card {
  min-width: 260px;
  padding: 18px;
  border: 1px solid #cbead9;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(21, 166, 106, 0.08), rgba(255, 255, 255, 1));
}

.builder-sidebar {
  position: sticky;
  top: 24px;
}

.invoice-list-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 15px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-muted);
}

.invoice-list-meta {
  text-align: right;
}

.status {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.status-draft {
  background: #fff1cf;
  color: #8d6400;
}

@media (max-width: 1120px) {
  .builder-shell,
  .invoice-page {
    grid-template-columns: 1fr;
  }

  .dashboard-analytics-summary-grid-compact {
    grid-template-columns: 1fr;
  }

  .dashboard-usage-grid {
    grid-template-columns: 1fr;
  }

  .hub-quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-analytics-grid-full {
    grid-template-columns: 1fr;
  }

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

  .settings-security-grid {
    grid-template-columns: 1fr;
  }

  .settings-shell {
    grid-template-columns: 1fr;
  }

  .settings-rail {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .settings-side {
    position: static;
  }

  .auth-hero .auth-hero-title {
    max-width: none;
    font-size: clamp(1.95rem, 3.4vw, 3.15rem);
    white-space: nowrap;
  }
}

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

  .auth-hero {
    min-height: auto;
  }

  .auth-hero-layout {
    grid-template-columns: 1fr;
  }

  .auth-hero-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-hero-preview-head {
    flex-direction: column;
  }

  .auth-hero-preview-head strong {
    text-align: left;
  }

  .auth-hero .auth-hero-title {
    max-width: none;
    font-size: clamp(1.85rem, 3.05vw, 2.8rem);
    white-space: nowrap;
  }

  .auth-kicker {
    font-size: 1.05rem;
  }

  .auth-hero-preview-track {
    min-height: 302px;
  }

  .auth-hero-preview-footer span {
    font-size: 0.75rem;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: calc(18px + env(safe-area-inset-top, 0px)) 18px 18px;
  }

  body.is-native-mobile-app .topbar {
    padding-top: calc(36px + env(safe-area-inset-top, 0px));
    min-height: calc(100px + env(safe-area-inset-top, 0px));
  }

  body.is-native-mobile-app .topbar-right {
    transform: translateY(2px);
  }

  body.hub-page .topbar {
    position: sticky;
    top: 0;
    z-index: 120;
    margin: -18px -18px 18px;
    padding: calc(16px + env(safe-area-inset-top)) 18px 16px;
    border-bottom: 1px solid transparent;
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
    /* Only transition background/border — never backdrop-filter (causes scroll jank on mobile) */
    transition: background 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
  }

  body.hub-page.is-page-scrolled .topbar {
    border-bottom-color: rgba(185, 201, 219, 0.36);
    /* Solid opaque background instead of blur — no GPU repaint cost while scrolling */
    background: linear-gradient(135deg, #eef9ff, #f7fcf2);
    backdrop-filter: none;
    box-shadow: 0 18px 34px rgba(64, 80, 96, 0.1), inset 0 -1px 0 rgba(255, 255, 255, 0.54);
  }

  body.hub-page.crm-fullscreen-page .topbar {
    position: static;
    margin: 0 0 4px;
    padding: 0;
    border-bottom: 0;
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
  }

  body.hub-page.analytics-fullscreen-page .topbar {
    position: fixed;
    top: 8px;
    left: 8px;
    right: 24px;
    z-index: 240;
    margin: 0;
    padding: 12px 18px;
    border: 1px solid rgba(185, 201, 219, 0.32);
    border-radius: 24px;
    background:
      radial-gradient(circle at 12% 20%, rgba(124, 200, 244, 0.22), transparent 32%),
      linear-gradient(135deg, rgba(238, 249, 255, 0.96), rgba(247, 252, 242, 0.94));
    box-shadow: 0 18px 34px rgba(64, 80, 96, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.68);
  }

  body.hub-page.analytics-fullscreen-page .topbar .brand-logo-image {
    width: 58px;
    height: 58px;
  }

  body.hub-page.is-native-mobile-app .topbar {
    padding-top: calc(40px + env(safe-area-inset-top, 0px));
    min-height: calc(104px + env(safe-area-inset-top, 0px));
  }

  body.hub-page.is-native-mobile-app .topbar-right {
    transform: translateY(4px);
  }

  body.invoice.is-native-mobile-app .topbar {
    padding-top: calc(52px + env(safe-area-inset-top, 0px));
    min-height: calc(120px + env(safe-area-inset-top, 0px));
  }

  body.invoice.is-native-mobile-app .topbar-right {
    transform: translateY(3px);
  }

  body.chat-page.is-native-mobile-app .topbar {
    min-height: calc(68px + env(safe-area-inset-top, 0px) + 12px);
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
  }

  body.chat-page.is-native-mobile-app .shell {
    padding-top: calc(env(safe-area-inset-top, 0px) + 2px);
  }

  .app-nav {
    width: 100%;
    gap: 10px;
    padding: 8px;
  }

  .settings-rail {
    padding: 16px;
  }

  .settings-page .hub-sidebar,
  .hub-sidebar-crm,
  .hub-sidebar-accounting {
    display: none;
  }

  .settings-mobile-nav .eyebrow {
    margin-bottom: 2px;
  }

  .settings-mobile-nav-header h2 {
    margin: 0;
    line-height: 1;
  }

  .settings-rail {
    padding: 18px;
  }

  .settings-rail .eyebrow,
  .settings-rail > p {
    display: none;
  }

  .settings-rail h2 {
    margin-bottom: 10px;
  }

  .settings-tab-rail {
    min-height: 60px;
    padding: 10px 12px;
  }

  .app-nav-link {
    flex: 1 1 calc(50% - 10px);
  }

  .topbar,
  .split-row,
  .builder-header,
  .invoice-topline {
    flex-direction: column;
    align-items: stretch;
  }

  .account-summary-chip {
    max-width: none;
  }

  .brand-logo-image {
    width: 62px;
    height: 62px;
  }

  .brand-title {
    font-size: 1.12rem;
  }

  .brand-subtitle {
    font-size: 0.84rem;
  }

  .hero-card,
  .panel {
    padding: 22px;
  }

  .auth-switch-card {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-hero {
    min-height: auto;
    padding: 18px;
  }

  .auth-hero-content {
    padding: 0;
    gap: 10px;
  }

  .auth-hero-copy {
    gap: 12px;
  }

  .auth-panel h2 {
    font-size: 1.7rem;
  }

  .auth-hero-layout {
    gap: 12px;
  }

  .auth-hero .auth-hero-title {
    font-size: clamp(2rem, 9vw, 2.8rem);
    line-height: 1;
    max-width: 11ch;
    white-space: normal;
  }

  .auth-kicker {
    font-size: 1rem;
  }

  .auth-lead {
    font-size: 0.92rem;
    line-height: 1.45;
    max-width: 50ch;
  }

  .auth-hero-swap {
    padding: 12px 14px;
    border-radius: 16px;
  }

  .auth-hero-swap-text {
    font-size: 0.95rem;
    white-space: normal;
  }

  .auth-hero-preview {
    display: none;
  }

  .auth-hero-preview {
    padding: 16px;
  }

  .auth-hero-preview-grid {
    gap: 8px;
  }
}

.status-sent {
  background: #dceafe;
  color: #1e4f9a;
}

.status-paid {
  background: #dbf6e8;
  color: #166b44;
}

.status-not_paid,
.status-sent {
  background: #dceafe;
  color: #1e4f9a;
}

.status-partially_paid {
  background: #fff2cc;
  color: #8c6500;
}

.status-pending,
.status-draft {
  background: #eef2f6;
  color: #5f6f84;
}

.status-overdue {
  background: #ffe0df;
  color: #b03d36;
}

.status-cancelled {
  background: #f0e8e7;
  color: #7d6460;
}

.builder-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.builder-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.builder-gallery-stage {
  gap: 20px;
}

.invoice-manager-stage {
  gap: 18px;
}

.invoice-manager-toolbar {
  align-items: flex-start;
}

.invoice-manager-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: end;
}

.invoice-manager-search {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.invoice-manager-search input {
  min-height: 48px;
}

.invoice-manager-view-switch {
  display: inline-flex;
  gap: 8px;
  padding: 8px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(244, 249, 253, 0.94));
  box-shadow:
    0 18px 36px rgba(64, 80, 96, 0.1),
    0 6px 12px rgba(124, 200, 244, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -10px 16px rgba(14, 27, 44, 0.014);
}

.invoice-manager-view-button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 253, 0.96));
  color: var(--navy);
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    0 12px 22px rgba(64, 80, 96, 0.09),
    0 4px 0 rgba(255, 255, 255, 0.48) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -10px 16px rgba(14, 27, 44, 0.016);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.invoice-manager-view-button:hover {
  transform: translateY(-1px);
  border-color: rgba(124, 200, 244, 0.28);
}

.invoice-manager-view-button.is-active {
  border-color: rgba(124, 200, 244, 0.36);
  background: linear-gradient(135deg, rgba(213, 221, 148, 0.2), rgba(124, 200, 244, 0.22));
}

.invoice-manager-summary {
  justify-self: end;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.invoice-manager-results {
  position: relative;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.invoice-manager-view {
  display: block;
}

.invoice-manager-grid {
  align-items: stretch;
}

.invoice-manager-list-shell {
  display: grid;
  gap: 14px;
}

.invoice-manager-list-row,
.client-manager-list-row {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(124, 200, 244, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.95));
  box-shadow:
    0 18px 34px rgba(64, 80, 96, 0.1),
    0 6px 12px rgba(124, 200, 244, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -10px 18px rgba(14, 27, 44, 0.012);
}

.invoice-manager-list-link {
  display: block;
  padding: 18px 20px 16px;
  color: inherit;
  text-decoration: none;
}

.invoice-manager-list-link:hover {
  color: inherit;
}

.invoice-manager-list-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.invoice-manager-list-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.invoice-manager-list-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.invoice-manager-list-title-row strong {
  font-size: 1.18rem;
}

.invoice-manager-list-currency {
  font-size: 1.18rem;
  color: var(--navy-deep);
  font-variant-numeric: tabular-nums;
}

.invoice-manager-list-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  color: var(--muted);
}

.invoice-manager-list-actions {
  justify-content: flex-start;
}

.client-manager-list-shell {
  display: grid;
  gap: 14px;
}

.client-manager-list-row {
  padding: 18px 20px 16px;
}

.client-manager-list-main {
  display: grid;
  gap: 14px;
}

.client-manager-list-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.client-manager-list-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.client-manager-list-currency {
  font-size: 1.05rem;
  color: var(--navy-deep);
  font-variant-numeric: tabular-nums;
}

.client-manager-list-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.client-manager-list-actions {
  justify-content: flex-start;
}

.invoice-manager-view .invoice-gallery-grid {
  margin-bottom: 2px;
}

.invoice-manager-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-top: 4px;
}

.invoice-manager-pagination-button {
  min-width: 40px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 253, 0.96));
  color: var(--navy);
  font-weight: 800;
  box-shadow:
    0 12px 22px rgba(64, 80, 96, 0.08),
    0 4px 0 rgba(255, 255, 255, 0.46) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -10px 16px rgba(14, 27, 44, 0.012);
  cursor: pointer;
}

.invoice-manager-pagination-button.is-active {
  border-color: rgba(124, 200, 244, 0.36);
  background: linear-gradient(135deg, rgba(213, 221, 148, 0.2), rgba(124, 200, 244, 0.22));
}

.invoice-manager-pagination-button:disabled {
  opacity: 0.55;
  cursor: default;
}

.invoice-manager-empty-message {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.invoice-manager-pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  color: var(--muted);
  font-weight: 700;
}

.invoice-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.invoice-gallery-card {
  position: relative;
  overflow: visible;
  z-index: 0;
}

.invoice-manager-list-row {
  position: relative;
  z-index: 0;
}

.invoice-gallery-card:has(.invoice-actions-toggle[aria-expanded="true"]),
.invoice-manager-list-row:has(.invoice-actions-toggle[aria-expanded="true"]),
.invoice-gallery-card.invoice-actions-active,
.invoice-manager-list-row.invoice-actions-active {
  z-index: 500;
}

.invoice-gallery-card-link {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 60px 18px 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
  box-shadow: 0 12px 28px rgba(23, 52, 84, 0.06);
  color: inherit;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.invoice-gallery-card-link:hover {
  transform: translateY(-2px);
  border-color: rgba(109, 193, 246, 0.35);
  box-shadow: 0 18px 34px rgba(23, 52, 84, 0.1);
}

.invoice-gallery-card-link h3,
.invoice-gallery-card-link p {
  margin: 0;
}

.invoice-gallery-card-link h3 {
  font-size: 1.15rem;
}

.invoice-gallery-card-link p {
  color: var(--muted);
}

.invoice-gallery-top,
.invoice-gallery-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.invoice-gallery-meta {
  color: var(--muted);
  font-size: 0.84rem;
}

.invoice-gallery-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.invoice-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 20;
}

.invoice-actions-toggle {
  border: 1px solid rgba(23, 52, 84, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: #24405d;
  border-radius: 999px;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(23, 52, 84, 0.08);
}

.invoice-actions-toggle:hover {
  border-color: rgba(109, 193, 246, 0.42);
  background: #ffffff;
}

.invoice-actions-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 170px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(23, 52, 84, 0.1);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 36px rgba(23, 52, 84, 0.14);
}

.invoice-actions-menu.is-open-up {
  top: auto;
  bottom: calc(100% + 8px);
}

.invoice-actions-anchor {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

.invoice-actions-menu.is-hidden {
  display: none;
}

.invoice-actions-menu a,
.invoice-actions-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  color: #24405d;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.invoice-actions-menu a:hover,
.invoice-actions-menu button:hover {
  background: rgba(109, 193, 246, 0.1);
}

.invoice-actions-menu button.danger {
  color: #b42318;
}

.invoice-actions-menu button.danger:hover {
  background: rgba(217, 45, 32, 0.08);
}

.gallery-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.client-dashboard-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.client-dashboard-grid.client-dashboard-grid-collapsed {
  grid-template-columns: 1fr;
}

.client-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.client-form-panel {
  max-width: 100%;
}

.client-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 24px;
  align-items: start;
}

.client-gallery-card,
.panel-muted {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: 0 12px 28px rgba(23, 52, 84, 0.06);
}

.client-gallery-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

.client-gallery-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.client-invoice-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 700;
}

.client-card-address {
  min-height: 52px;
  color: var(--muted);
  line-height: 1.5;
  white-space: pre-line;
}

.client-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.client-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.client-advanced-details {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8fb 100%);
  padding: 14px 16px;
}

.client-advanced-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--navy);
}

.client-advanced-body {
  margin-top: 14px;
}

.client-detail-shell {
  gap: 18px;
}

.client-detail-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.client-detail-identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.client-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, #06b488 0%, #0aa4a5 100%);
  color: white;
  font-size: 2rem;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(8, 170, 149, 0.24);
}

.client-detail-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.client-detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.client-detail-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.client-detail-list {
  display: grid;
  gap: 14px;
}

.client-detail-list div {
  display: grid;
  gap: 4px;
}

.client-detail-list strong {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.client-detail-address {
  margin: 0;
  color: var(--ink);
  line-height: 1.6;
  white-space: pre-line;
}

.client-invoice-list {
  display: grid;
  gap: 12px;
}

.client-invoice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.client-invoice-row:hover {
  transform: translateY(-1px);
  border-color: rgba(109, 193, 246, 0.35);
  box-shadow: 0 10px 22px rgba(23, 52, 84, 0.08);
}

.client-invoice-row-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.client-card-actions form {
  margin: 0;
}

.client-card-actions .danger-button {
  color: var(--danger);
  border-color: rgba(196, 61, 61, 0.22);
  background: rgba(255, 250, 250, 0.92);
}

@media (max-width: 980px) {
  .invoice-manager-controls {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .reports-filter-layout {
    grid-template-columns: 1fr;
  }

  .reports-summary-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reports-filter-form {
    gap: 14px;
  }

  .invoice-manager-summary {
    justify-self: start;
  }

  .invoice-manager-view-switch {
    width: max-content;
  }

  .invoice-manager-list-heading,
  .client-manager-list-heading {
    grid-template-columns: 1fr;
  }

  .currency-display-picker {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .invoice-manager-results {
    max-height: none;
    overflow: visible;
  }

  .reports-details > summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .reports-summary-columns {
    grid-template-columns: 1fr;
  }

  .reports-filter-form {
    padding: 16px;
  }

  .reports-client-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .reports-client-metrics {
    justify-content: flex-start;
  }

  .invoice-manager-list-row,
  .client-manager-list-row {
    padding: 16px;
  }

  .currency-display-picker {
    width: 100%;
  }

  .currency-display-picker-label,
  .currency-display-picker-select {
    width: 100%;
    min-width: 0;
  }

  .invoice-manager-view-button {
    min-height: 38px;
    padding: 0 14px;
  }
}

.panel-muted {
  padding: 18px;
}

.panel-muted h3 {
  margin: 0 0 6px;
}

.split-row-compact {
  align-items: end;
}

.danger-zone {
  border-color: rgba(196, 61, 61, 0.22);
  background: linear-gradient(180deg, #fffafa 0%, #fff3f3 100%);
}

.danger-zone p {
  color: var(--muted);
}

.danger-zone .danger-button {
  width: 100%;
}

.split-row-dashboard {
  align-items: center;
}

body.hub-page .split-row-dashboard {
  align-items: flex-start;
}

.is-hidden {
  display: none;
}

.logo-dropzone {
  width: 180px;
  min-height: 144px;
  border: 1px dashed rgba(109, 193, 246, 0.38);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(235, 247, 255, 0.76));
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  font-weight: 600;
  cursor: pointer;
}

.logo-dropzone-preview {
  min-height: 92px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  font-weight: 700;
  text-align: center;
  padding: 12px;
}

.logo-dropzone-caption {
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

.uploaded-logo-preview {
  max-width: 100%;
  max-height: 72px;
  object-fit: contain;
}

.custom-payment-terms {
  margin-top: 10px;
}

.builder-title-block {
  margin-left: auto;
  text-align: right;
  max-width: 300px;
}

.builder-title-block h2 {
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--navy);
}

.builder-title-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.invoice-editor-top {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
  gap: 22px;
  align-items: start;
}

.invoice-editor-brand,
.invoice-editor-meta {
  gap: 14px;
}

.invoice-editor-title {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 4px;
}

.invoice-document-label-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min(100%, 220px);
}

.invoice-document-label-field span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: var(--muted);
}

.invoice-document-label-field input {
  border: none;
  border-bottom: 2px solid rgba(23, 52, 84, 0.18);
  border-radius: 0;
  padding: 0 0 10px;
  background: transparent;
  box-shadow: none;
  font-size: clamp(2.1rem, 3.4vw, 3.3rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
  color: var(--navy);
  font-weight: 400;
  text-transform: uppercase;
}

.invoice-document-label-field input:focus {
  border-color: rgba(23, 52, 84, 0.44);
  box-shadow: none;
  background: transparent;
}

.invoice-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}

.editor-grid,
.editor-bottom-grid {
  display: grid;
  gap: 16px;
}

.invoice-client-profile-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
}

.invoice-client-profile-field-wide {
  grid-column: 1 / -1;
}

.invoice-client-profile-field .helper-text {
  margin: -1px 2px 0;
}

.invoice-client-profile-field input[type="search"] {
  appearance: none;
}

.invoice-client-profile-picker {
  position: relative;
}

.client-profile-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 20px;
  border: 1px solid rgba(143, 166, 186, 0.24);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(64, 80, 96, 0.16);
  max-height: 280px;
  overflow: auto;
}

.client-profile-suggestions.is-hidden {
  display: none;
}

.client-profile-suggestion {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(244, 249, 253, 0.96), rgba(255, 255, 255, 0.98));
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.client-profile-suggestion:hover,
.client-profile-suggestion:focus-visible {
  border-color: rgba(124, 200, 244, 0.34);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(243, 249, 253, 0.98));
  outline: none;
}

.client-profile-suggestion strong {
  color: var(--navy);
  font-size: 0.92rem;
}

.client-profile-suggestion span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.editor-grid-top {
  grid-template-columns: 1.3fr 0.7fr;
}

.editor-grid-secondary {
  grid-template-columns: 1fr 1fr;
}

.compact-customer-grid {
  gap: 12px 14px;
}

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

.items-section {
  gap: 12px;
}

.items-header {
  display: grid;
  grid-template-columns: 1.9fr 0.55fr 0.55fr 0.55fr;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--navy);
  color: white;
  font-weight: 800;
}

.line-item-row {
  display: grid;
  grid-template-columns: 1.9fr 0.55fr 0.55fr 0.55fr auto;
  gap: 14px;
  align-items: end;
}

.line-item-row textarea[data-field="description"] {
  min-height: 108px;
}

.line-item-total {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 10px;
  font-weight: 700;
  color: var(--muted);
}

.add-item-button {
  align-self: flex-start;
  color: var(--accent-dark);
}

.editor-bottom-grid {
  grid-template-columns: minmax(0, 0.88fr) minmax(520px, 1.12fr);
  column-gap: 16px;
  align-items: start;
}

.invoice-copy-stack {
  width: 100%;
  max-width: none;
}

.summary-panel {
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 24px;
  padding: 18px 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 253, 0.95));
  box-shadow:
    0 22px 42px rgba(64, 80, 96, 0.12),
    0 8px 16px rgba(124, 200, 244, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -10px 18px rgba(14, 27, 44, 0.018);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-fields-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 14px;
}

.summary-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-field span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: var(--muted);
}

.summary-field-wide {
  grid-column: 1 / -1;
}

.summary-field-tax {
  grid-column: 1;
}

.summary-field-advanced-toggle {
  grid-column: 2;
}

.summary-field-wide.summary-field-advanced-toggle {
  grid-column: 1 / -1;
}

.summary-field-amount {
  grid-column: 3;
}

.summary-toggle-row {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
}

.summary-toggle-row span {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}

.summary-field-amount {
  width: 100%;
  align-self: end;
}

.summary-field-amount input {
  width: 100%;
}

.summary-advanced-toggle {
  width: 38px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(238, 231, 223, 0.94), rgba(248, 244, 239, 0.96));
  display: flex;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
  flex: 0 0 auto;
  box-shadow: 0 8px 14px rgba(64, 80, 96, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.summary-advanced-toggle::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #9caebf;
  margin-left: 3px;
  box-shadow: 0 5px 10px rgba(64, 80, 96, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  transition: margin-left 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.summary-advanced-toggle[aria-pressed="true"]::after {
  background: linear-gradient(180deg, #2f5f7a 0%, #203a52 100%);
  margin-left: 19px;
  box-shadow: 0 6px 12px rgba(32, 58, 82, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.summary-advanced-toggle:hover {
  border-color: rgba(124, 200, 244, 0.22);
  box-shadow: 0 10px 18px rgba(64, 80, 96, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.summary-advanced-toggle:disabled,
.summary-advanced-toggle[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.52;
  border-color: rgba(148, 163, 184, 0.28);
  background: linear-gradient(180deg, rgba(226, 232, 240, 0.9), rgba(241, 245, 249, 0.92));
  box-shadow: none;
}

.summary-advanced-toggle:disabled::after,
.summary-advanced-toggle[aria-disabled="true"]::after {
  background: #94a3b8;
  box-shadow: none;
}

.summary-advanced-toggle[aria-pressed="true"] {
  border-color: rgba(124, 200, 244, 0.38);
  background: linear-gradient(135deg, rgba(213, 221, 148, 0.95), rgba(124, 200, 244, 0.95));
  box-shadow: 0 8px 16px rgba(64, 80, 96, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.summary-field-amount[hidden],
#summary-balance-row[hidden] {
  display: none !important;
}

.summary-totals {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.summary-totals p {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.summary-totals strong {
  color: var(--navy);
}

.ai-copilot-panel {
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 28px;
  padding: 20px;
  background:
    radial-gradient(circle at top right, rgba(124, 200, 244, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.95));
  box-shadow: 0 18px 38px rgba(64, 80, 96, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-copilot-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ai-copilot-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.ai-copilot-header h3 {
  margin: 4px 0 8px;
}

.ai-copilot-header p {
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.55;
}

.ai-copilot-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(213, 221, 148, 0.24), rgba(124, 200, 244, 0.18));
  color: var(--navy);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.ai-copilot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.copilot-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(143, 166, 186, 0.32);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(238, 244, 250, 0.96));
  color: var(--navy);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 22px rgba(64, 80, 96, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.copilot-chip:hover,
.copilot-chip:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(124, 200, 244, 0.42);
  box-shadow: 0 16px 26px rgba(64, 80, 96, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.ai-copilot-prompt {
  gap: 8px;
}

.ai-copilot-prompt span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: var(--muted);
}

.ai-copilot-prompt textarea {
  min-height: 92px;
}

.ai-copilot-result {
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(143, 166, 186, 0.24);
  background: linear-gradient(180deg, rgba(248, 251, 254, 0.98), rgba(240, 246, 252, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 20px rgba(64, 80, 96, 0.06);
  display: grid;
  gap: 6px;
}

.ai-copilot-result strong {
  color: var(--navy);
}

.ai-copilot-result p,
.ai-copilot-result ul {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.ai-copilot-result ul {
  padding-left: 18px;
}

.ai-copilot-result code {
  color: var(--navy);
  font-weight: 700;
}

.ai-copilot-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-copilot-launch-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(124, 200, 244, 0.36);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(213, 221, 148, 0.38), rgba(124, 200, 244, 0.4));
  color: var(--navy-deep);
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(64, 80, 96, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    filter 160ms ease;
}

.ai-copilot-launch-button:hover,
.ai-copilot-launch-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(124, 200, 244, 0.54);
  box-shadow: 0 18px 32px rgba(64, 80, 96, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.ai-copilot-launch-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

.ai-copilot-close {
  min-height: 32px;
  padding: 0 14px;
}

.ai-copilot-modal {
  position: fixed;
  inset: 0;
  z-index: 55;
  padding: 16px;
  overflow: auto;
}

.ai-copilot-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 27, 44, 0.42);
  backdrop-filter: blur(8px) saturate(118%);
}

.ai-copilot-modal-card {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  margin: min(8vh, 72px) auto 0;
}

.invoice-form-compact {
  gap: 16px;
}

.invoice-template-heading {
  margin: 4px 0 0;
  font-size: 0.96rem;
  color: var(--muted);
}

.invoice-template-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.invoice-template-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px 17px;
  min-height: 118px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.98), transparent 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 249, 253, 0.95));
  cursor: pointer;
  box-shadow:
    0 10px 20px rgba(64, 80, 96, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.72) inset,
    inset 0 -10px 22px rgba(14, 27, 44, 0.018);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
  overflow: hidden;
}

.invoice-template-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(145deg, rgba(109, 193, 246, 0.12), transparent 38%),
    linear-gradient(330deg, rgba(201, 226, 101, 0.09), transparent 36%);
  opacity: 0.8;
  pointer-events: none;
}

.invoice-template-card:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 200, 244, 0.32);
  box-shadow:
    0 16px 28px rgba(64, 80, 96, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.84) inset,
    inset 0 -10px 18px rgba(14, 27, 44, 0.02);
}

.invoice-template-card.is-selected {
  border-color: rgba(109, 193, 246, 0.52);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.99), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(243, 249, 253, 0.96));
  box-shadow:
    0 18px 30px rgba(64, 80, 96, 0.1),
    0 0 0 1px rgba(109, 193, 246, 0.14) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -12px 20px rgba(14, 27, 44, 0.02);
}

.invoice-template-card.is-selected::before {
  opacity: 1;
}

.invoice-template-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.invoice-template-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.invoice-template-card-top-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.invoice-template-card-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.invoice-template-card-indicator {
  width: 17px;
  height: 17px;
  border-radius: 999px;
  border: 1.5px solid rgba(32, 58, 82, 0.2);
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.88)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 248, 252, 0.9));
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.92), 0 1px 0 rgba(255, 255, 255, 0.8);
}

.invoice-template-card.is-selected .invoice-template-card-indicator {
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, rgba(213, 221, 148, 0.98), rgba(124, 200, 244, 0.86));
  border-color: rgba(201, 226, 101, 0.92);
  box-shadow: 0 0 0 5px rgba(213, 221, 148, 0.14), inset 0 0 0 3px rgba(255, 255, 255, 0.14);
  animation: template-indicator-pulse 1.8s ease-in-out infinite;
}

.invoice-template-card-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(124, 200, 244, 0.14);
  color: var(--navy);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.invoice-template-card strong {
  font-size: 1rem;
  color: var(--navy-deep);
  line-height: 1.15;
}

.invoice-template-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
  font-size: 0.87rem;
}

.invoice-template-card-premium {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.96), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(244, 249, 253, 0.92));
  border-color: rgba(160, 172, 183, 0.26);
  box-shadow:
    0 18px 36px rgba(64, 80, 96, 0.12),
    0 8px 16px rgba(124, 200, 244, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -12px 18px rgba(14, 27, 44, 0.018);
}

@keyframes template-indicator-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 5px rgba(213, 221, 148, 0.14), inset 0 0 0 3px rgba(255, 255, 255, 0.14);
  }

  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 9px rgba(213, 221, 148, 0), inset 0 0 0 3px rgba(255, 255, 255, 0.16);
  }
}

.invoice-template-card-premium:hover {
  box-shadow:
    0 22px 42px rgba(64, 80, 96, 0.14),
    0 10px 18px rgba(124, 200, 244, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -12px 20px rgba(14, 27, 44, 0.02);
}

.invoice-template-card-premium.is-selected {
  box-shadow:
    0 24px 46px rgba(64, 80, 96, 0.15),
    0 10px 18px rgba(124, 200, 244, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -12px 20px rgba(14, 27, 44, 0.022);
  border-color: rgba(109, 193, 246, 0.34);
}

.invoice-template-card-locked {
  cursor: default;
  opacity: 0.66;
  filter: saturate(0.45) grayscale(0.18);
}

.invoice-template-card-locked:hover {
  transform: none;
  border-color: rgba(23, 52, 84, 0.18);
  box-shadow: none;
}

.invoice-template-card-premium-locked .invoice-template-card-indicator {
  opacity: 0.7;
}

.invoice-template-card-preview-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(143, 166, 186, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(238, 244, 250, 0.95));
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 8px 14px rgba(64, 80, 96, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.invoice-template-card-preview-button:hover,
.invoice-template-card-preview-button:focus-visible {
  border-color: rgba(124, 200, 244, 0.38);
  transform: translateY(-1px);
  outline: none;
}

.invoice-template-card-preview-icon {
  font-size: 0.78rem;
  line-height: 1;
}

.invoice-template-card-badge-premium {
  background: linear-gradient(135deg, rgba(213, 221, 148, 0.34), rgba(124, 200, 244, 0.18));
  color: #37411b;
}

.invoice-template-card-lock {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.invoice-template-card-note {
  margin-top: 2px;
  font-size: 0.79rem;
  color: #54687f;
  letter-spacing: 0.01em;
}

.invoice-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 6px;
}

.compact-textarea {
  min-height: 74px;
}

.compact-textarea-tight {
  min-height: 48px;
}

.invoice-copy-stack {
  gap: 16px;
}

.invoice-copy-stack label {
  gap: 6px;
}

.business-address-textarea {
  min-height: 108px;
}

.currency-picker-shell {
  display: flex;
  align-items: center;
}

.currency-picker {
  width: 100%;
  text-transform: uppercase;
}

.invoice-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: auto;
  padding: 16px;
}

.invoice-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 27, 44, 0.42);
  backdrop-filter: blur(4px);
}

.invoice-preview-dialog {
  position: relative;
  z-index: 1;
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: 0 auto;
  overflow: auto;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.96));
}

.app-dialog-modal {
  position: fixed;
  inset: 0;
  z-index: 2200;
}

.app-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 22, 37, 0.4);
  backdrop-filter: blur(10px) saturate(120%);
}

.app-dialog-card {
  position: relative;
  z-index: 1;
  width: min(460px, calc(100vw - 32px));
  margin: min(18vh, 120px) auto 0;
  padding: 26px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  background:
    radial-gradient(circle at top right, rgba(124, 200, 244, 0.18), transparent 26%),
    radial-gradient(circle at top left, rgba(201, 226, 101, 0.14), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.96));
  box-shadow: 0 34px 80px rgba(64, 80, 96, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

/* On phones, vertically center dialogs so a destructive action (e.g. Void) lands
   in the middle of the screen — users notice it and are less likely to tap it by
   mistake than if it sat at the very bottom under a resting thumb. */
@media (max-width: 640px) {
  .app-dialog-modal:not(.is-hidden) {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 16px;
  }

  .app-dialog-card {
    margin: 0 auto;
    width: calc(100vw - 24px);
    max-height: 85vh;
    overflow-y: auto;
  }
}

.invoice-payment-gateway-card {
  width: min(720px, calc(100vw - 32px));
  padding: 30px;
}

.invoice-payment-gateway-card .app-dialog-message {
  max-width: 56ch;
}

.gateway-option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.gateway-option {
  appearance: none;
  border: 1px solid rgba(93, 121, 160, 0.18);
  background:
    radial-gradient(circle at top right, rgba(124, 200, 244, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 253, 0.98));
  border-radius: 22px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  min-height: 118px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 10px 24px rgba(64, 80, 96, 0.08);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.gateway-option strong {
  font-size: 1rem;
  letter-spacing: -0.03em;
  color: var(--navy-deep);
}

.gateway-option span {
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--muted);
  max-width: 20ch;
}

.gateway-option:hover,
.gateway-option:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(93, 121, 160, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 16px 32px rgba(64, 80, 96, 0.12);
}

.gateway-option.is-active {
  border-color: rgba(124, 200, 244, 0.58);
  background:
    radial-gradient(circle at top right, rgba(201, 226, 101, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(239, 246, 252, 0.98));
  box-shadow:
    0 18px 34px rgba(64, 80, 96, 0.14),
    0 0 0 1px rgba(124, 200, 244, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.gateway-option.is-active strong {
  color: var(--navy);
}

.gateway-option-both {
  background:
    radial-gradient(circle at top right, rgba(124, 200, 244, 0.14), transparent 30%),
    radial-gradient(circle at bottom left, rgba(201, 226, 101, 0.15), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 253, 0.98));
}

.invoice-payment-gateway-card .app-dialog-actions {
  margin-top: 18px;
}

@media (max-width: 820px) {
  .invoice-payment-gateway-card {
    width: min(100vw - 20px, 620px);
    padding: 24px 20px;
  }

  .gateway-option-grid {
    grid-template-columns: 1fr;
  }

  .gateway-option {
    min-height: 96px;
  }
}

.app-dialog-header,
.app-dialog-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-dialog-header h3,
.app-dialog-message {
  margin: 0;
}

.app-dialog-header h3 {
  font-size: 1.6rem;
  letter-spacing: -0.04em;
  color: var(--navy-deep);
}

.app-dialog-message {
  color: var(--muted);
  line-height: 1.65;
  margin-top: 10px;
  white-space: pre-line;
}

.app-dialog-input-wrap {
  margin-top: 18px;
  font-weight: 700;
}

.app-dialog-input-wrap.is-hidden {
  display: none;
}

.app-dialog-input-wrap input {
  margin-top: 4px;
}

.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

.invoice-preview-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.invoice-sheet {
  padding: 32px 34px 40px;
}

.sample-sheet {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.96));
}

.invoice-company {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sample-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: contain;
  object-position: center;
  border: 1px solid var(--line);
  display: block;
  image-rendering: auto;
}

.placeholder-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  background: var(--navy);
  color: white;
}

.invoice-number-block {
  text-align: right;
}

.invoice-number-block strong {
  display: block;
  font-size: 1.15rem;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #1f2937;
}

.invoice-number-block p {
  margin: 6px 0 0;
  color: #111111;
  font-size: 0.9rem;
  font-weight: 700;
}

.sample-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 26px;
}

.sample-meta strong,
.invoice-company strong {
  display: block;
  margin-bottom: 2px;
}

.sample-meta p {
  margin: 2px 0;
}

.sample-meta-single {
  grid-template-columns: minmax(0, 220px);
  margin-bottom: 22px;
}

.invoice-billto-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.invoice-meta-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
  justify-self: end;
}

.invoice-meta-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  text-align: right;
}

.invoice-address-block {
  color: #2a2a2a;
  line-height: 1.35;
  white-space: pre-line;
  font-size: 0.86rem;
}

.invoice-company .invoice-address-block {
  max-width: 240px;
  font-size: 0.82rem;
}

.invoice-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.84rem;
  line-height: 1.1;
  align-self: flex-start;
  white-space: nowrap;
}

.invoice-meta-row .invoice-status-chip {
  align-self: flex-end;
}

.invoice-status-chip-paid {
  background: rgba(6, 180, 136, 0.12);
  color: #067f62;
}

.invoice-status-chip-pending,
.invoice-status-chip-draft {
  background: rgba(109, 193, 246, 0.14);
  color: #25537e;
}

.invoice-status-chip-overdue,
.invoice-status-chip-cancelled,
.invoice-status-chip-not_paid {
  background: rgba(198, 61, 71, 0.12);
  color: #a12c3d;
}

.invoice-status-chip-partially_paid,
.invoice-status-chip-sent {
  background: rgba(201, 226, 101, 0.2);
  color: #526211;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
}

.classic-template-table,
.rapid-template-table {
  table-layout: fixed;
}

.sample-table thead th {
  background: #eef2f6;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #111111;
  letter-spacing: 0.04em;
}

.invoice-table th,
.invoice-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.invoice-value-fit {
  display: inline-block;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: 0;
  transform-origin: right center;
  font-size: calc(1em * var(--invoice-fit-scale, 1));
}

.sample-table th:nth-child(2),
.sample-table th:nth-child(3),
.sample-table th:nth-child(4),
.sample-table td:nth-child(2),
.sample-table td:nth-child(3),
.sample-table td:nth-child(4) {
  text-align: right;
}

.classic-template-table th:nth-child(2),
.classic-template-table td:nth-child(2),
.classic-template-table th:nth-child(3),
.classic-template-table td:nth-child(3),
.classic-template-table th:nth-child(4),
.classic-template-table td:nth-child(4) {
  padding-left: 6px;
  padding-right: 6px;
}

.invoice-item-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.invoice-item-copy strong {
  display: block;
  font-size: 0.98rem;
  color: #202938;
}

.invoice-item-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: #2f2f2f;
  white-space: pre-line;
  font-size: 0.86rem;
  line-height: 1.35;
}

.sample-totals {
  margin-left: auto;
  margin-top: 18px;
  max-width: 380px;
}

.sample-totals-basic {
  max-width: 100%;
  margin-top: 14px;
  border-top: none;
}

.sample-totals p {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 10px 0;
}

.sample-totals-basic p {
  max-width: 300px;
  margin-left: auto;
  padding: 7px 0;
  font-size: 0.92rem;
  color: #111111;
}

.sample-totals .grand-total span,
.sample-totals .grand-total strong {
  white-space: nowrap;
}

.sample-totals-basic p.grand-total {
  max-width: none;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 3px solid #5f6975;
  font-size: 1rem;
}

.grand-total,
.balance-due {
  border-top: 2px solid #4a5565;
  font-weight: 800;
}

.invoice-notes {
  margin-top: 26px;
}

.sample-notes {
  display: grid;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.invoice-generated-footer {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #1f1f1f;
  font-size: 0.78rem;
}

.invoice-generated-footer p {
  margin: 0;
}

.invoice-generated-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: #111111;
}

.invoice-generated-footer-brand img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  border-radius: 0;
  display: block;
  image-rendering: auto;
  filter: drop-shadow(0 2px 4px rgba(17, 17, 17, 0.12));
}

.invoice-sheet-download .executive-template-party-card,
.invoice-sheet-download .studio-template-party-card,
.invoice-sheet-download .rapid-template-party-card,
.invoice-sheet-download .executive-template-table,
.invoice-sheet-download .studio-template-table,
.invoice-sheet-download .rapid-template-table,
.invoice-sheet-download .executive-template-totals,
.invoice-sheet-download .studio-template-totals,
.invoice-sheet-download .invoice-generated-footer-brand img {
  box-shadow: none !important;
}

.invoice-sheet-download .executive-template-party-card::before,
.invoice-sheet-download .studio-template-party-card::before {
  display: none !important;
}

.invoice-sheet-download .rapid-template-party-card {
  background:
    linear-gradient(135deg, rgba(109, 193, 246, 0.11), rgba(201, 226, 101, 0.1)),
    #ffffff !important;
  border-color: rgba(109, 193, 246, 0.2) !important;
}

.invoice-sheet-download .executive-template-party-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 244, 0.98)),
    #ffffff !important;
  border-color: rgba(201, 226, 101, 0.24) !important;
}

.invoice-sheet-download .studio-template-party-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 251, 255, 0.98)),
    #ffffff !important;
  border-color: rgba(109, 193, 246, 0.2) !important;
}

.invoice-sheet-download .rapid-template-table {
  background: linear-gradient(180deg, rgba(109, 193, 246, 0.05), rgba(201, 226, 101, 0.04))
    !important;
  border-color: rgba(109, 193, 246, 0.16) !important;
}

.invoice-sheet-download .executive-template-table {
  background: linear-gradient(180deg, rgba(201, 226, 101, 0.07), rgba(255, 255, 255, 0.98))
    !important;
  border-color: rgba(201, 226, 101, 0.2) !important;
}

.invoice-sheet-download .studio-template-table {
  background: linear-gradient(180deg, rgba(109, 193, 246, 0.06), rgba(255, 255, 255, 0.98))
    !important;
  border-color: rgba(109, 193, 246, 0.18) !important;
}

.invoice-sheet-download .rapid-template-totals {
  background: linear-gradient(180deg, rgba(109, 193, 246, 0.06), rgba(201, 226, 101, 0.05))
    !important;
  border-color: rgba(109, 193, 246, 0.16) !important;
}

.invoice-sheet-download .executive-template-totals {
  background: linear-gradient(180deg, rgba(201, 226, 101, 0.12), rgba(201, 226, 101, 0.05))
    !important;
  border-color: rgba(201, 226, 101, 0.24) !important;
}

.invoice-sheet-download .studio-template-totals {
  background: linear-gradient(180deg, rgba(109, 193, 246, 0.08), rgba(109, 193, 246, 0.03))
    !important;
  border-color: rgba(109, 193, 246, 0.22) !important;
}

.invoice-template-rapid {
  background: linear-gradient(180deg, #ffffff, #fcfefe);
}

.invoice-template-executive {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 252, 248, 0.98)),
    #ffffff;
  border: 1px solid rgba(201, 226, 101, 0.18);
}

.invoice-template-studio {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 251, 255, 0.98)),
    #ffffff;
  border: 1px solid rgba(109, 193, 246, 0.16);
}

.rapid-template-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(95, 114, 135, 0.14);
}

.rapid-template-header-copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rapid-template-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.9rem);
  color: #111111;
  letter-spacing: -0.05em;
  font-weight: 700;
}

.executive-template-header,
.studio-template-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  padding-bottom: 16px;
}

.executive-template-header {
  border-bottom: 2px solid rgba(201, 226, 101, 0.34);
}

.studio-template-header {
  border-bottom: 1px solid rgba(109, 193, 246, 0.22);
}

.executive-template-title,
.studio-template-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -0.05em;
  font-weight: 700;
}

.executive-template-title {
  color: #161616;
}

.studio-template-title {
  color: #111111;
}

.executive-template-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
  align-items: start;
  margin-bottom: 24px;
}

.executive-template-heading {
  display: grid;
  gap: 8px;
}

.executive-template-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 8px 10px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(247, 250, 239, 0.92));
  border: 1px solid rgba(201, 226, 101, 0.18);
  box-shadow: 0 10px 18px rgba(64, 80, 96, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.executive-template-brand-mark,
.executive-template-brand-fallback {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex-shrink: 0;
}

.executive-template-brand-mark {
  object-fit: contain;
  background: #ffffff;
  border: 1px solid rgba(201, 226, 101, 0.18);
}

.executive-template-brand-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.executive-template-brand-name {
  color: #556270;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.executive-template-kicker,
.studio-template-kicker {
  display: inline-flex;
  align-self: flex-start;
  justify-self: start;
  width: fit-content;
  max-width: max-content;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.executive-template-kicker {
  background: rgba(201, 226, 101, 0.18);
  color: #4b5d16;
}

.studio-template-kicker {
  background: rgba(109, 193, 246, 0.16);
  color: #1b547d;
}

.executive-template-subtitle {
  margin: 0;
  color: #5a5a5a;
  font-size: 1rem;
}

.executive-template-meta-card,
.studio-template-meta-card {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 18px;
}

.executive-template-meta-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 239, 0.96));
  border: 1px solid rgba(201, 226, 101, 0.22);
}

.studio-template-meta-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(109, 193, 246, 0.18);
}

.executive-template-meta-card p,
.studio-template-meta-card p {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.executive-template-meta-card span,
.studio-template-meta-card span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.executive-template-meta-card strong,
.studio-template-meta-card strong {
  color: #161616;
  font-size: 1rem;
}

.studio-template-title-block {
  display: grid;
  gap: 8px;
}

.studio-template-frame {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.studio-template-sidebar {
  display: grid;
  gap: 16px;
}

.studio-template-party-stack {
  display: grid;
  gap: 14px;
}

.rapid-template-meta-lines {
  display: grid;
  gap: 8px;
}

.rapid-template-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  padding: 10px 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 253, 0.92));
  border: 1px solid rgba(143, 166, 186, 0.18);
  box-shadow: 0 12px 24px rgba(64, 80, 96, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.rapid-template-brand-mark {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 10px;
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid rgba(143, 166, 186, 0.18);
}

.rapid-template-brand-copy {
  display: flex;
  flex-direction: column;
}

.rapid-template-brand-name {
  color: #6c7a89;
  font-size: 1rem;
  font-weight: 700;
}

.rapid-template-meta-lines p {
  margin: 0;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: #3b3b3b;
  font-weight: 600;
}

.rapid-template-meta-lines span {
  min-width: 104px;
  color: #666666;
}

.rapid-template-meta-lines strong {
  color: #202938;
}

.rapid-template-logo,
.rapid-template-logo-fallback {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(201, 226, 101, 0.45);
  box-shadow: 0 8px 18px rgba(17, 17, 17, 0.08);
  flex-shrink: 0;
}

.rapid-template-party-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.executive-template-party-grid,
.studio-template-party-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.rapid-template-party-card {
  min-height: 148px;
  padding: 18px 20px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(109, 193, 246, 0.08), rgba(201, 226, 101, 0.08)),
    #ffffff;
  border: 1px solid rgba(109, 193, 246, 0.22);
  box-shadow:
    0 14px 28px rgba(64, 80, 96, 0.08),
    0 6px 12px rgba(124, 200, 244, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -10px 18px rgba(14, 27, 44, 0.012);
}

.executive-template-party-card,
.studio-template-party-card {
  min-height: 148px;
  padding: 18px 20px;
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 14px 28px rgba(64, 80, 96, 0.08),
    0 6px 12px rgba(124, 200, 244, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -10px 18px rgba(14, 27, 44, 0.014);
}

.executive-template-party-card::before,
.studio-template-party-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0) 28%);
  pointer-events: none;
}

.executive-template-party-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 244, 0.94));
  border: 1px solid rgba(201, 226, 101, 0.2);
}

.studio-template-party-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 254, 0.96));
  border: 1px solid rgba(109, 193, 246, 0.18);
}

.rapid-template-party-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 800;
  color: #111111;
}

.rapid-template-party-card strong {
  color: #1c2433;
}

.rapid-template-party-card p {
  margin: 2px 0 0;
}

.rapid-template-party-extra {
  color: #555555;
  font-size: 0.84rem;
}

.rapid-template-table {
  margin-top: 8px;
  border: 1px solid rgba(109, 193, 246, 0.12);
}

.rapid-template-table thead th {
  background: rgba(109, 193, 246, 0.18);
  color: #111111;
  font-size: 0.84rem;
  letter-spacing: 0.02em;
  text-transform: none;
  border-right: 1px solid rgba(255, 255, 255, 0.5);
}

.rapid-template-table thead th:last-child {
  border-right: none;
}

.rapid-template-table thead th:nth-child(1),
.rapid-template-table thead th:nth-child(4) {
  box-shadow: inset 3px 0 0 rgba(201, 226, 101, 0.45);
}

.rapid-template-table thead th:nth-child(1),
.rapid-template-table td:nth-child(1) {
  text-align: left !important;
}

.rapid-template-table thead th:nth-child(2),
.rapid-template-table td:nth-child(2) {
  text-align: center !important;
}

.rapid-template-table thead th:nth-child(3),
.rapid-template-table td:nth-child(3) {
  text-align: right !important;
}

.rapid-template-table thead th:nth-child(4),
.rapid-template-table td:nth-child(4) {
  text-align: right !important;
}

.rapid-template-table th:nth-child(3),
.rapid-template-table td:nth-child(3),
.rapid-template-table th:nth-child(4),
.rapid-template-table td:nth-child(4) {
  padding-left: 6px;
  padding-right: 6px;
}

.rapid-template-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.98);
}

.rapid-template-table tbody tr:nth-child(even) {
  background: rgba(248, 251, 253, 0.96);
}

.executive-template-table,
.studio-template-table {
  margin-top: 8px;
  border: 1px solid rgba(95, 114, 135, 0.12);
  box-shadow: 0 14px 28px rgba(64, 80, 96, 0.08), 0 8px 16px rgba(124, 200, 244, 0.04);
}

.executive-template-table thead th,
.studio-template-table thead th {
  color: #111111;
  font-size: 0.84rem;
  letter-spacing: 0.02em;
  text-transform: none;
  border-right: 1px solid rgba(255, 255, 255, 0.45);
}

.executive-template-table thead th {
  background: #eff5dd;
}

.studio-template-table thead th {
  background: #edf6fd;
}

.executive-template-table thead th:last-child,
.studio-template-table thead th:last-child {
  border-right: none;
}

.executive-template-table thead th:nth-child(1),
.executive-template-table td:nth-child(1),
.studio-template-table thead th:nth-child(1),
.studio-template-table td:nth-child(1) {
  text-align: left !important;
}

.executive-template-table thead th:nth-child(2),
.executive-template-table td:nth-child(2),
.studio-template-table thead th:nth-child(2),
.studio-template-table td:nth-child(2) {
  text-align: center !important;
}

.executive-template-table thead th:nth-child(3),
.executive-template-table td:nth-child(3),
.executive-template-table thead th:nth-child(4),
.executive-template-table td:nth-child(4),
.studio-template-table thead th:nth-child(3),
.studio-template-table td:nth-child(3),
.studio-template-table thead th:nth-child(4),
.studio-template-table td:nth-child(4) {
  text-align: right !important;
}

.executive-template-table th:nth-child(3),
.executive-template-table td:nth-child(3),
.executive-template-table th:nth-child(4),
.executive-template-table td:nth-child(4),
.studio-template-table th:nth-child(3),
.studio-template-table td:nth-child(3),
.studio-template-table th:nth-child(4),
.studio-template-table td:nth-child(4) {
  padding-left: 6px;
  padding-right: 6px;
}

.executive-template-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.98);
}

.executive-template-table tbody tr:nth-child(even) {
  background: rgba(249, 251, 244, 0.92);
}

.studio-template-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.98);
}

.studio-template-table tbody tr:nth-child(even) {
  background: rgba(247, 250, 254, 0.92);
}

.studio-template-main {
  display: grid;
  gap: 18px;
}

.rapid-template-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 22px;
  align-items: end;
  margin-top: 18px;
}

.executive-template-bottom,
.studio-template-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 22px;
  align-items: end;
  margin-top: 18px;
}

.executive-template-bottom {
  margin-top: 22px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
}

.studio-template-bottom {
  margin-top: 0;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
}

.rapid-template-bottom-copy {
  display: grid;
  gap: 12px;
}

.rapid-template-bottom-copy > div > p {
  margin: 6px 0 0;
  color: #4a4a4a;
}

.invoice-total-in-words {
  margin: 0;
  color: #314155;
  font-size: 0.82rem;
  line-height: 1.5;
  font-weight: 700;
}

.invoice-total-in-words span {
  color: #6c7a89;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  font-weight: 800;
}

.rapid-template-status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #334155;
  font-weight: 600;
}

.rapid-template-totals {
  padding: 12px 14px 0;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(109, 193, 246, 0.04), rgba(201, 226, 101, 0.04));
  border: 1px solid rgba(109, 193, 246, 0.12);
}

.executive-template-totals,
.studio-template-totals {
  padding: 12px 14px 0;
  border-radius: 14px;
}

.executive-template-totals {
  width: 100%;
  max-width: 360px;
  background: linear-gradient(180deg, rgba(201, 226, 101, 0.08), rgba(201, 226, 101, 0.03));
  border: 1px solid rgba(201, 226, 101, 0.22);
  border-radius: 20px;
  padding: 14px 16px 4px;
}

.studio-template-totals {
  background: linear-gradient(180deg, rgba(109, 193, 246, 0.06), rgba(109, 193, 246, 0.02));
  border: 1px solid rgba(109, 193, 246, 0.18);
  border-radius: 20px;
  width: 100%;
  max-width: 360px;
  justify-self: end;
  padding: 14px 16px 4px;
}

.executive-template-totals p,
.studio-template-totals p {
  gap: 12px;
}

.studio-template-totals p {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(88px, auto);
  align-items: center;
  gap: 10px;
}

.studio-template-totals span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.studio-template-totals p:not(.grand-total) span {
  white-space: nowrap;
}

.studio-template-totals strong {
  justify-self: end;
  white-space: nowrap;
}

.executive-template-totals .grand-total,
.studio-template-totals .grand-total {
  font-size: 0.94rem;
}

.studio-template-totals .grand-total {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.studio-template-totals .grand-total span {
  white-space: normal;
  line-height: 1.05;
}

.studio-template-totals .grand-total strong {
  white-space: nowrap;
  line-height: 1;
}

.rapid-template-totals .grand-total {
  border-top-color: var(--accent-dark);
}

.rapid-template-totals .grand-total strong,
.rapid-template-totals .grand-total span {
  color: var(--navy);
}

.executive-template-totals .grand-total {
  border-top-color: rgba(126, 152, 42, 0.65);
}

.executive-template-totals .grand-total strong,
.executive-template-totals .grand-total span {
  color: #2b3412;
}

.studio-template-totals .grand-total {
  border-top-color: rgba(79, 176, 242, 0.65);
}

.studio-template-totals .grand-total strong,
.studio-template-totals .grand-total span {
  color: #173454;
}

.settings-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  font-weight: 600;
}

.auth-consent-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(109, 193, 246, 0.2);
  background:
    radial-gradient(circle at top left, rgba(201, 226, 101, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 253, 0.94));
  box-shadow: 0 10px 22px rgba(64, 80, 96, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.84);
  cursor: pointer;
}

.auth-consent-card:hover {
  border-color: rgba(109, 193, 246, 0.34);
}

.auth-consent-check {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--navy);
}

.auth-consent-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--navy);
  line-height: 1.45;
}

.auth-consent-copy strong {
  font-size: 0.98rem;
}

.auth-consent-copy .helper-text {
  font-size: 0.88rem;
}

.settings-checkbox-row-disabled {
  opacity: 0.7;
}

.invoice-activity-log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.invoice-activity-log-entry {
  padding: 14px 15px;
  border: 1px solid rgba(143, 166, 186, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.invoice-activity-log-entry-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.invoice-activity-log-entry-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.invoice-activity-log-entry-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.invoice-activity-log-entry-tags strong {
  font-size: 0.98rem;
  color: var(--navy-deep);
}

.invoice-activity-log-invoice-ref {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.invoice-activity-log-time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: right;
  letter-spacing: 0.02em;
}

.invoice-activity-log-badge {
  font-size: 0.72rem;
  padding: 4px 9px;
}

.invoice-activity-log-badge-stripe {
  background: rgba(99, 91, 254, 0.12);
  color: #4b45c8;
}

.invoice-activity-log-badge-razorpay {
  background: rgba(201, 226, 101, 0.2);
  color: #5f6d25;
}

.invoice-activity-log-badge-system {
  background: rgba(124, 200, 244, 0.16);
  color: #2c6d8e;
}

.invoice-activity-log-details-grid {
  margin: 12px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px 14px;
}

.logs-tab-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.logs-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(143, 166, 186, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(244, 249, 253, 0.94));
  color: var(--navy);
  font-size: 0.94rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 12px 20px rgba(64, 80, 96, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.96);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.logs-tab:hover,
.logs-tab:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(124, 200, 244, 0.3);
}

.logs-tab.is-active {
  border-color: rgba(124, 200, 244, 0.38);
  background: linear-gradient(135deg, rgba(213, 221, 148, 0.18), rgba(124, 200, 244, 0.22));
}

.logs-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  border-top: 1px solid rgba(143, 166, 186, 0.12);
}

.logs-pagination-summary {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.logs-pagination-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.logs-pagination-pages {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.logs-pagination-nav,
.logs-pagination-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(143, 166, 186, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 253, 0.95));
  color: var(--navy);
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 10px 18px rgba(64, 80, 96, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.96);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.logs-pagination-nav:hover,
.logs-pagination-nav:focus-visible,
.logs-pagination-page:hover,
.logs-pagination-page:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(124, 200, 244, 0.32);
}

.logs-pagination-page.is-active {
  border-color: rgba(124, 200, 244, 0.4);
  background: linear-gradient(135deg, rgba(213, 221, 148, 0.18), rgba(124, 200, 244, 0.22));
}

.logs-pagination-nav.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.invoice-activity-log-detail {
  margin: 0;
  min-width: 0;
}

.invoice-activity-log-detail dt {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.invoice-activity-log-detail dd {
  margin: 0;
  color: var(--navy-deep);
  font-size: 0.84rem;
  line-height: 1.35;
  word-break: break-word;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-left: auto;
  min-width: 0;
}

.topbar-right .topbar-actions {
  flex-wrap: nowrap;
}

.topbar-actions form {
  margin: 0;
}

.topbar-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.topbar-action-button {
  min-width: 0;
}

.topbar-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar-action-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.notification-center {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.notification-bell {
  position: relative;
  justify-content: center;
  width: 52px;
  min-width: 52px;
  padding-inline: 0;
  overflow: visible;
}

.notification-bell-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notification-bell svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.notification-badge {
  display: none;
}

.notification-indicator-dot {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #a3e635, #65a30d);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 4px rgba(163, 230, 53, 0.25), 0 6px 14px rgba(101, 163, 13, 0.3);
  pointer-events: none;
  z-index: 2;
  will-change: transform, opacity, box-shadow;
}

.notification-center[data-has-unread="true"] .notification-indicator-dot {
  background: linear-gradient(180deg, #ef4444, #dc2626);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.22), 0 6px 14px rgba(220, 38, 38, 0.28);
  animation: pulse-dot 1.6s ease-in-out infinite;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 1500;
  width: min(480px, calc(100vw - 16px));
  display: grid;
  gap: 14px;
  padding: 18px;
}

body.chat-page .notification-center,
body.hub-page .notification-center {
  z-index: 1300;
}

body.chat-page .notification-panel,
body.hub-page.crm-fullscreen-page .notification-panel {
  position: fixed;
  top: 70px;
  right: 16px;
  z-index: 1400;
  background: rgba(255, 255, 255, 0.99);
  backdrop-filter: blur(18px) saturate(135%);
  box-shadow: 0 24px 60px rgba(64, 80, 96, 0.16), 0 8px 20px rgba(124, 200, 244, 0.08);
}

.notification-panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.notification-panel-header strong,
.notification-list-header h2 {
  display: block;
  font-size: 1rem;
  line-height: 1.2;
}

.notification-panel-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notification-panel-link {
  white-space: nowrap;
}

.notification-panel-body,
.notification-page-list {
  display: grid;
  gap: 10px;
  max-height: min(68vh, 560px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  scroll-behavior: smooth;
}

/* Thin, styled scrollbar so the panel looks polished when it scrolls */
.notification-panel-body::-webkit-scrollbar {
  width: 4px;
}
.notification-panel-body::-webkit-scrollbar-track {
  background: transparent;
}
.notification-panel-body::-webkit-scrollbar-thumb {
  background: rgba(124, 200, 244, 0.35);
  border-radius: 999px;
}
.notification-panel-body::-webkit-scrollbar-thumb:hover {
  background: rgba(124, 200, 244, 0.6);
}

.notification-page-list {
  max-height: none;
}

body.notes-page .sticky-note-center {
  display: none;
}

html.sticky-note-launcher-disabled .sticky-note-center {
  display: none !important;
}

body.notes-page .hub-shell {
  grid-template-columns: 1fr;
}

body.notes-page .hub-sidebar-notes {
  display: none !important;
}

body.notes-page .hub-main {
  width: 100%;
}

.notification-panel-footer,
.notification-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.notification-panel-status,
.notification-page-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.notification-page-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.notification-back-button {
  min-height: 40px;
  padding-inline: 14px;
}

.notification-list-header {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.notification-list-header p {
  margin: 0;
  color: var(--muted);
}

.notification-item {
  border: 1px solid rgba(143, 166, 186, 0.18);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 253, 0.95));
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(64, 80, 96, 0.06);
}

.notification-item.is-unread {
  border-color: rgba(124, 200, 244, 0.35);
  box-shadow: 0 12px 28px rgba(124, 200, 244, 0.12);
}

.notification-item-link {
  width: 100%;
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.notification-item-link:hover {
  background: rgba(124, 200, 244, 0.08);
}

.notification-item-main,
.notification-item-meta {
  display: grid;
  gap: 6px;
}

.notification-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notification-item-head strong {
  color: var(--navy-deep);
}

.notification-item-main p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

/* In the compact panel show up to 3 lines of body text — enough to read the
   full message for most notifications while keeping the list scannable.
   Full text (no clamp) is always shown on the dedicated notifications page. */
.notification-panel-body .notification-item-main p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-item-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.notification-unread-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(124, 200, 244, 0.15);
  color: var(--navy);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.notification-empty-state {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px dashed rgba(143, 166, 186, 0.24);
  border-radius: 18px;
  background: rgba(245, 249, 253, 0.7);
}

.notification-empty-state strong {
  color: var(--navy-deep);
}

.notification-empty-state p {
  margin: 0;
  color: var(--muted);
}

.notifications-page {
  display: grid;
  gap: 18px;
}

/* ── Sticky notes overlay ─────────────────────────────────────────────────── */
.sticky-note-center {
  --sticky-note-fab-x: calc(100vw - 92px);
  --sticky-note-fab-y: calc(100vh - 92px);
  position: fixed;
  left: var(--sticky-note-fab-x);
  top: var(--sticky-note-fab-y);
  z-index: 1750;
  display: grid;
  justify-items: end;
  gap: 10px;
  touch-action: none;
  user-select: none;
}

.sticky-note-center.is-dragging {
  cursor: grabbing;
}

.sticky-note-launcher {
  /* Strip the ghost-button pill — icon floats free */
  position: relative;
  justify-content: center;
  width: auto !important;
  min-width: unset !important;
  min-height: unset !important;
  padding: 4px !important;
  overflow: visible;
  cursor: grab;
  touch-action: none;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.sticky-note-center.is-dragging .sticky-note-launcher {
  cursor: grabbing;
}

.sticky-note-launcher-copy {
  display: grid;
  justify-items: center;
  gap: 5px;
  pointer-events: none;
}

.sticky-note-launcher-label {
  /* Typewriter animation */
  display: block;
  white-space: nowrap;
  overflow: hidden;
  color: var(--navy);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  /* clip from right to reveal char by char, then pause, then hide */
  clip-path: inset(0 100% 0 0);
  animation: sticky-note-typewrite 5s steps(12, end) infinite;
}

.sticky-note-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: sticky-note-launcher-icon-bob 2.8s ease-in-out infinite alternate;
  filter: drop-shadow(0 6px 14px rgba(64, 80, 96, 0.22));
}

.sticky-note-launcher-icon-image {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  pointer-events: none;
}

.sticky-note-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: linear-gradient(180deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
  position: absolute;
  top: -4px;
  right: -4px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22), 0 4px 10px rgba(217, 119, 6, 0.28);
}

@keyframes sticky-note-launcher-icon-bob {
  from {
    transform: translateY(0) rotate(-2deg);
  }
  to {
    transform: translateY(-3px) rotate(2deg);
  }
}

/* Typewriter: reveal "Sticky notes" one char at a time, hold, then disappear */
@keyframes sticky-note-typewrite {
  /* Phase 1: type out (0–40%) */
  0%   { clip-path: inset(0 100% 0 0); }
  40%  { clip-path: inset(0 0% 0 0); }
  /* Phase 2: hold fully visible (40–70%) */
  70%  { clip-path: inset(0 0% 0 0); opacity: 1; }
  /* Phase 3: fade out (70–85%) */
  85%  { clip-path: inset(0 0% 0 0); opacity: 0; }
  /* Phase 4: reset invisible, ready for next loop */
  86%  { clip-path: inset(0 100% 0 0); opacity: 0; }
  100% { clip-path: inset(0 100% 0 0); opacity: 0; }
}

/* ─── Sticky note panel ─────────────────────────────────────────────────── */
.sticky-note-panel {
  position: fixed;
  /* Position and size are driven by updateStickyNotePanelLayout() via CSS vars.
     Fallbacks apply before JS runs or if the fn hasn't been called yet. */
  left: var(--sticky-note-panel-left, 8px);
  top: var(--sticky-note-panel-top, 68px);
  z-index: 1500;
  width: var(--sticky-note-panel-width, min(clamp(380px, 34vw, 580px), calc(100vw - 16px)));
  max-height: var(--sticky-note-panel-max-height, calc(100dvh - 80px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
}

.sticky-note-center .sticky-note-panel {
  /* Brand gradient — lime-green to sky-blue, low opacity */
  background: linear-gradient(135deg, rgba(213, 221, 148, 0.28) 0%, rgba(124, 200, 244, 0.22) 100%),
              rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 20px 56px rgba(74, 120, 160, 0.12), 0 4px 16px rgba(74, 120, 160, 0.07);
  border: 1px solid rgba(124, 200, 244, 0.22);
}

/* Panel header — always visible, never scrolls */
.sticky-note-panel-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px 11px;
  border-bottom: 1px solid rgba(124, 200, 244, 0.18);
  background: linear-gradient(135deg, rgba(213, 221, 148, 0.32) 0%, rgba(124, 200, 244, 0.26) 100%);
}

.sticky-note-panel-title {
  display: grid;
  gap: 1px;
}

.sticky-note-panel-header strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.2;
}

.sticky-note-panel-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.sticky-note-panel-link {
  white-space: nowrap;
  font-size: 0.8rem;
  padding: 5px 10px;
  min-height: 28px;
}

.sticky-note-panel-close {
  min-height: 28px;
  padding: 0 10px;
  font-size: 1rem;
  line-height: 1;
}

/* Mobile-only tab bar — hidden on desktop */
.sticky-note-panel-tabs {
  display: none;
}

/* Panel scroll area — form + notes list scroll together */
.sticky-note-panel-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.28) transparent;
}

/* Quick compose form */
.sticky-note-quick-form {
  display: grid;
  gap: 10px;
}

.sticky-note-kind-toggle {
  display: flex;
  background: rgba(143, 166, 186, 0.13);
  border-radius: 10px;
  padding: 3px;
  width: fit-content;
}

.sticky-note-kind-btn {
  padding: 5px 14px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
  white-space: nowrap;
}

.sticky-note-kind-btn.is-active {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 1px 4px rgba(64, 80, 96, 0.14);
}

.sticky-note-kind-btn:hover:not(.is-active) {
  color: var(--navy);
}

/* Textarea inside compose form */
/* Optional title input — sits above textarea, lightweight underline style */
.sticky-note-title-input {
  display: block;
  width: 100%;
  padding: 6px 2px 7px;
  border: none;
  border-bottom: 1.5px solid rgba(143, 166, 186, 0.28);
  background: transparent;
  color: var(--navy-deep);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.4;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 140ms ease;
}

.sticky-note-title-input::placeholder {
  font-weight: 400;
  color: rgba(100, 116, 139, 0.55);
}

.sticky-note-title-input:focus {
  outline: none;
  border-bottom-color: rgba(88, 180, 235, 0.6);
}

/* Page compose form — slightly larger title */
.sticky-note-title-input--page {
  font-size: 1rem;
  padding: 6px 2px 8px;
  margin-bottom: 4px;
}

.sticky-note-textarea {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(143, 166, 186, 0.26);
  background: rgba(245, 249, 253, 0.6);
  color: var(--navy-deep);
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.sticky-note-textarea:focus {
  outline: none;
  border-color: rgba(88, 180, 235, 0.5);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 3px rgba(124, 200, 244, 0.16);
}

/* Checklist textarea — hidden unless form kind=checklist */
.sticky-note-quick-form:not([data-sticky-note-kind="checklist"]) .sticky-note-checklist-field,
.sticky-note-editor-form:not([data-sticky-note-kind="checklist"]) [data-sticky-note-editor-checklist-wrap] {
  display: none !important;
}

/* Note body textarea — hidden when form kind=checklist */
.sticky-note-quick-form[data-sticky-note-kind="checklist"] [data-sticky-note-body],
.sticky-note-quick-form[data-sticky-note-kind="checklist"] [data-sticky-note-body-field] {
  display: none !important;
}

/* Compose footer row */
.sticky-note-compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.sticky-note-compose-right {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.sticky-note-submit-btn {
  min-height: 34px;
  padding: 0 14px;
  font-size: 0.85rem;
}

/* Color swatches */
.sticky-note-color-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.sticky-note-color-swatch {
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  flex-shrink: 0;
  transition: transform 120ms ease, outline-offset 80ms ease;
}

.sticky-note-color-swatch:hover { transform: scale(1.15); }

.sticky-note-color-swatch[data-sticky-note-color="sun"],
.sticky-note-color-swatch[data-sticky-note-editor-color="sun"] { background: #F59E0B; }
.sticky-note-color-swatch[data-sticky-note-color="sky"],
.sticky-note-color-swatch[data-sticky-note-editor-color="sky"] { background: #38BDF8; }
.sticky-note-color-swatch[data-sticky-note-color="mint"],
.sticky-note-color-swatch[data-sticky-note-editor-color="mint"] { background: #22C55E; }
.sticky-note-color-swatch[data-sticky-note-color="rose"],
.sticky-note-color-swatch[data-sticky-note-editor-color="rose"] { background: #F472B6; }
.sticky-note-color-swatch[data-sticky-note-color="lavender"],
.sticky-note-color-swatch[data-sticky-note-editor-color="lavender"] { background: #A78BFA; }
.sticky-note-color-swatch[data-sticky-note-color="slate"],
.sticky-note-color-swatch[data-sticky-note-editor-color="slate"] { background: #94A3B8; }

.sticky-note-color-swatch.is-selected {
  outline: 2.5px solid var(--navy);
  outline-offset: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

/* Pin toggle */
.sticky-note-pin-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1.5px solid rgba(143, 166, 186, 0.28);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
  white-space: nowrap;
  user-select: none;
}

.sticky-note-pin-toggle:has(input:checked) {
  border-color: rgba(88, 180, 235, 0.5);
  background: rgba(124, 200, 244, 0.12);
  color: var(--navy);
}

.sticky-note-pin-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.sticky-note-pin-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  min-height: 40px;
  min-width: 94px;
  padding: 0 16px 0 12px;
  border-radius: 999px;
  border: 1.5px solid rgba(143, 166, 186, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 252, 0.94));
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
  user-select: none;
  box-shadow: 0 8px 18px rgba(64, 80, 96, 0.08);
  cursor: pointer;
  transition:
    transform 120ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease;
}

.sticky-note-pin-toggle-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(88, 180, 235, 0.46);
  box-shadow: 0 12px 22px rgba(64, 80, 96, 0.12);
}

.sticky-note-pin-toggle-btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(64, 80, 96, 0.08);
}

.sticky-note-pin-toggle-btn.is-active {
  border-color: rgba(245, 158, 11, 0.45);
  background:
    linear-gradient(180deg, rgba(255, 250, 232, 0.98), rgba(255, 240, 198, 0.9));
  color: #8a4b00;
  box-shadow: 0 10px 22px rgba(245, 158, 11, 0.16);
}

.sticky-note-pin-toggle-btn.is-active:hover {
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 14px 24px rgba(245, 158, 11, 0.18);
}

.sticky-note-pin-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(124, 200, 244, 0.12);
  border: 1px solid rgba(124, 200, 244, 0.18);
  flex-shrink: 0;
}

.sticky-note-pin-toggle-btn.is-active .sticky-note-pin-icon-badge {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.22);
}

.sticky-note-pin-toggle-btn .sticky-note-pin-label {
  line-height: 1;
}

/* Editor form legacy compat */
.sticky-note-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

/* ── Editor modal footer ─────────────────────────────────────────────────── */
.sticky-note-editor-footer {
  display: grid;
  gap: 14px;
  padding-top: 6px;
  border-top: 1px solid rgba(143, 166, 186, 0.14);
}

/* Toggle pills row — "Mark done" + "Pin" side by side */
.sticky-note-editor-toggles {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* "Mark done" gets a green accent when checked */
.sticky-note-done-toggle:has(input:checked) {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.08);
  color: #166534;
}

/* Action row — secondary (Archive/Delete) left, Save right */
.sticky-note-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.sticky-note-editor-secondary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Delete — red ghost style (less alarming than filled) */
.sticky-note-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1.5px solid rgba(239, 68, 68, 0.35);
  background: transparent;
  color: #dc2626;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms, border-color 150ms;
}
.sticky-note-delete-btn:hover {
  background: rgba(239, 68, 68, 0.07);
  border-color: rgba(239, 68, 68, 0.55);
}

/* Save note — compact, not full-width */
.sticky-note-save-btn {
  flex-shrink: 0;
}

.sticky-note-field {
  display: grid;
  gap: 6px;
}

.sticky-note-field span {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Notes list inside panel */
.sticky-note-panel-body {
  display: grid;
  gap: 12px;
}

.sticky-note-panel-summary span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sticky-note-panel-summary strong {
  color: var(--navy-deep);
  font-size: 1.3rem;
  line-height: 1;
}

.sticky-note-panel-summary p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.84rem;
}

/* Page body (full notes page — keeps its own scroll) */
.sticky-note-page-body {
  display: grid;
  gap: 14px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.sticky-note-section {
  display: grid;
  gap: 10px;
}

.sticky-note-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sticky-note-grid {
  display: grid;
  gap: 10px;
  /* single column inside the panel; full-page view may override below */
  grid-template-columns: 1fr;
}

.sticky-note-page-body .sticky-note-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.sticky-note-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 18px 18px 16px;
  border-radius: 22px;
  border: 1px solid rgba(143, 166, 186, 0.2);
  box-shadow: 0 10px 24px rgba(64, 80, 96, 0.08);
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
  animation: sticky-note-pop 240ms ease both;
}

.sticky-note-card--sun {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(255, 248, 215, 0.98), rgba(255, 252, 238, 0.96));
  border-color: rgba(245, 158, 11, 0.24);
}

.sticky-note-card--sky {
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(236, 250, 255, 0.98), rgba(247, 252, 255, 0.96));
  border-color: rgba(56, 189, 248, 0.22);
}

.sticky-note-card--mint {
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(236, 251, 242, 0.98), rgba(248, 255, 251, 0.96));
  border-color: rgba(34, 197, 94, 0.22);
}

.sticky-note-card--rose {
  background:
    radial-gradient(circle at top right, rgba(244, 114, 182, 0.15), transparent 32%),
    linear-gradient(180deg, rgba(255, 241, 248, 0.98), rgba(255, 250, 253, 0.96));
  border-color: rgba(244, 114, 182, 0.22);
}

.sticky-note-card--lavender {
  background:
    radial-gradient(circle at top right, rgba(167, 139, 250, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(246, 242, 255, 0.98), rgba(251, 250, 255, 0.96));
  border-color: rgba(167, 139, 250, 0.22);
}

.sticky-note-card--slate {
  background:
    radial-gradient(circle at top right, rgba(100, 116, 139, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(246, 248, 251, 0.98), rgba(251, 252, 253, 0.96));
  border-color: rgba(100, 116, 139, 0.22);
}

.sticky-note-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(64, 80, 96, 0.12);
}

.sticky-note-card:focus-within {
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14), 0 16px 32px rgba(64, 80, 96, 0.12);
}

.sticky-note-card-header,
.sticky-note-card-footer,
.sticky-note-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sticky-note-card-title-wrap {
  display: grid;
  gap: 6px;
}

.sticky-note-card-title-wrap strong {
  color: var(--navy-deep);
  font-size: 1rem;
  line-height: 1.2;
  word-break: break-word;
}

.sticky-note-state-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--navy);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sticky-note-card-actions {
  flex-wrap: wrap;
}

.sticky-note-card-actions-bottom {
  padding-top: 4px;
}

.sticky-note-icon-button,
.sticky-note-action-button {
  min-height: 32px;
  padding: 0 10px;
}

/* ── Pin icon button ──────────────────────────────────────────────────────── */
.sticky-note-pin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: rgba(100, 116, 139, 0.55);
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease;
  flex-shrink: 0;
}
.sticky-note-pin-btn:hover {
  color: var(--navy);
  background: rgba(143, 166, 186, 0.14);
}
.sticky-note-pin-btn.is-pinned {
  color: #f59e0b; /* amber — visible against all note backgrounds */
}
.sticky-note-pin-btn.is-pinned:hover {
  color: #d97706;
  background: rgba(245, 158, 11, 0.1);
}

.sticky-note-pin-icon-image {
  display: block;
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

.sticky-note-pin-toggle .sticky-note-pin-icon-image {
  width: 15px;
  height: 15px;
}

.sticky-note-pin-toggle-btn .sticky-note-pin-icon-image {
  width: 15px;
  height: 15px;
}

.sticky-note-card-body {
  margin: 0;
  color: var(--navy-deep);
  line-height: 1.55;
  white-space: pre-line;
}

.sticky-note-card-body.is-struck,
.sticky-note-checklist-item.is-done span {
  text-decoration: line-through;
  opacity: 0.72;
}

.sticky-note-checklist {
  display: grid;
  gap: 8px;
}

.sticky-note-checklist-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 9px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.54);
}

.sticky-note-checklist-item input {
  margin-top: 3px;
}

.sticky-note-checklist-item span {
  color: var(--navy-deep);
  line-height: 1.4;
  word-break: break-word;
}

.sticky-note-checklist-more {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: italic;
}

.sticky-note-extra-item {
  display: none;
}

.sticky-note-checklist.is-expanded .sticky-note-extra-item {
  display: grid;
}

.sticky-note-checklist-toggle {
  all: unset;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--navy-deep);
  opacity: 0.55;
  padding: 4px 2px;
  border-radius: 6px;
  transition: opacity 0.15s;
}

.sticky-note-checklist-toggle:hover,
.sticky-note-checklist-toggle:focus-visible {
  opacity: 1;
}

.sticky-note-card-footer {
  color: var(--muted);
  font-size: 0.78rem;
}

.sticky-note-card-color {
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.sticky-note-card.is-completed {
  opacity: 0.92;
}

.sticky-note-card.is-archived {
  opacity: 0.72;
}

.sticky-note-card.is-completing {
  animation: sticky-note-tear-away 320ms ease forwards;
  pointer-events: none;
}

.sticky-note-archive-group {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px dashed rgba(143, 166, 186, 0.24);
  background: rgba(245, 249, 253, 0.66);
}

.sticky-note-archive-group summary {
  cursor: pointer;
  color: var(--navy);
  font-weight: 800;
}

.sticky-note-archive-group summary::marker {
  color: var(--accent-dark);
}

.sticky-note-panel-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.sticky-note-page {
  display: grid;
  gap: 18px;
}

.sticky-note-page-board {
  padding: 24px;
  display: grid;
  gap: 18px;
}

.sticky-note-page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto;
  gap: 16px;
  align-items: start;
}

.sticky-note-page-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(2.1rem, 4.5vw, 3.8rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  color: var(--navy-deep);
}

.sticky-note-page-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.sticky-note-page-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 10px;
}

.sticky-note-page-stats div {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(143, 166, 186, 0.18);
  text-align: center;
}

.sticky-note-page-stats strong {
  font-size: 1.3rem;
  color: var(--navy-deep);
}

.sticky-note-page-stats span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Page toolbar (list/gallery toggle) ──────────────────────────────────── */
.sticky-note-page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sticky-note-view-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 11px;
  background: rgba(143, 166, 186, 0.1);
  border: 1px solid rgba(143, 166, 186, 0.2);
}

.sticky-note-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.sticky-note-view-btn:hover {
  color: var(--navy);
}

.sticky-note-view-btn.is-active {
  background: white;
  color: var(--navy);
  box-shadow: 0 1px 4px rgba(64, 80, 96, 0.13);
}

/* ── Gallery view overrides ──────────────────────────────────────────────── */
[data-sticky-note-page-body][data-sticky-note-view="gallery"] .sticky-note-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

[data-sticky-note-page-body][data-sticky-note-view="gallery"] .sticky-note-card {
  padding: 14px 14px 12px;
  min-height: 150px;
  cursor: pointer;
  gap: 6px;
}

/* Hide action buttons in gallery — click card body to edit */
[data-sticky-note-page-body][data-sticky-note-view="gallery"] .sticky-note-card-actions,
[data-sticky-note-page-body][data-sticky-note-view="gallery"] .sticky-note-card-footer,
[data-sticky-note-page-body][data-sticky-note-view="gallery"] .sticky-note-card-actions-bottom {
  display: none;
}

/* Compact title */
[data-sticky-note-page-body][data-sticky-note-view="gallery"] .sticky-note-card-title-wrap strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
}

/* Clamp body preview */
[data-sticky-note-page-body][data-sticky-note-view="gallery"] .sticky-note-card-body {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: normal;
}

/* Clamp checklist preview */
[data-sticky-note-page-body][data-sticky-note-view="gallery"] .sticky-note-checklist {
  overflow: hidden;
  max-height: 112px;
}

[data-sticky-note-page-body][data-sticky-note-view="gallery"] .sticky-note-checklist-more {
  font-size: 0.75rem;
}

[data-sticky-note-page-body][data-sticky-note-view="gallery"] .sticky-note-checklist-item {
  padding: 5px 8px;
  gap: 7px;
}

/* Hover highlight for whole card in gallery */
[data-sticky-note-page-body][data-sticky-note-view="gallery"] .sticky-note-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px rgba(64, 80, 96, 0.13);
}

.sticky-note-page-compose {
  padding: 18px;
}

.sticky-note-compose-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sticky-note-launcher-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 5px 10px 5px 6px;
  border: 1px solid rgba(143, 166, 186, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.sticky-note-launcher-toggle:hover {
  color: var(--ink);
  border-color: rgba(124, 200, 244, 0.34);
}

.sticky-note-editor-modal {
  position: fixed;
  inset: 0;
  z-index: 1800;
  display: grid;
  align-items: end;
  justify-items: center;
}

.sticky-note-editor-modal.is-hidden[hidden] {
  display: none !important;
}

.sticky-note-editor-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 32, 48, 0.46);
}

.sticky-note-editor-card {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 16px));
  margin-bottom: 12px;
  padding: 20px 22px 22px;
  max-height: min(92vh, 820px);
  overflow-y: auto;
  display: grid;
  gap: 0;
}

/* Compact topbar: eyebrow label + close button */
.sticky-note-editor-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.sticky-note-editor-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid rgba(143, 166, 186, 0.25);
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 140ms, color 140ms;
}
.sticky-note-editor-close-btn:hover {
  background: rgba(143, 166, 186, 0.12);
  color: var(--navy);
}

.sticky-note-editor-form {
  display: grid;
  gap: 14px;
}

/* Large minimal title input — no box, just an underline */
.sticky-note-editor-title-input {
  width: 100%;
  border: none;
  border-bottom: 1.5px solid rgba(143, 166, 186, 0.22);
  padding: 2px 0 10px;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--navy-deep);
  background: transparent;
  transition: border-color 150ms;
}
.sticky-note-editor-title-input:focus {
  outline: none;
  border-bottom-color: rgba(56, 189, 248, 0.55);
}
.sticky-note-editor-title-input::placeholder {
  color: rgba(100, 116, 139, 0.5);
  font-weight: 500;
}

/* Subtle body textarea */
.sticky-note-editor-body-input {
  width: 100%;
  min-height: 150px;
  border: 1.5px solid rgba(143, 166, 186, 0.2);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--navy-deep);
  background: rgba(248, 250, 253, 0.7);
  resize: vertical;
  transition: border-color 150ms, background 150ms;
}
.sticky-note-editor-body-input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.4);
  background: white;
}
.sticky-note-editor-body-input::placeholder {
  color: rgba(100, 116, 139, 0.45);
}

/* Toolbar: colors left, toggles right */
.sticky-note-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 0 2px;
  border-top: 1px solid rgba(143, 166, 186, 0.12);
  border-bottom: 1px solid rgba(143, 166, 186, 0.12);
}

.sticky-note-undo-banner {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 1900;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(143, 166, 186, 0.18);
  box-shadow: 0 18px 40px rgba(64, 80, 96, 0.16);
  backdrop-filter: blur(18px);
}

.sticky-note-undo-banner span {
  color: var(--navy);
  font-weight: 700;
}

@keyframes sticky-note-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes sticky-note-tear-away {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }
  45% {
    opacity: 0.92;
    transform: translateY(-4px) rotate(1deg) scale(1.01);
  }
  100% {
    opacity: 0;
    transform: translateY(18px) rotate(-4deg) scale(0.94);
  }
}

/* ── Panel 2-column notes grid on wide desktops ──────────────────────────── */
@media (min-width: 1440px) {
  /* Panel is ~403px+ here — two columns of ~185px fit nicely */
  .sticky-note-panel-body .sticky-note-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  /* Slightly compact cards in 2-col panel to keep them scannable */
  .sticky-note-panel-body .sticky-note-card {
    padding: 13px 14px 11px;
    gap: 8px;
  }

  .sticky-note-panel-body .sticky-note-card-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }
}

/* ── Sticky note responsive ──────────────────────────────────────────────── */
@media (max-width: 920px) {
  .sticky-note-page-hero { grid-template-columns: 1fr; }
  .sticky-note-editor-card { width: min(calc(100vw - 12px), 560px); margin-bottom: 6px; }
}

@media (max-width: 720px) {
  /* Panel expands to near-full-width, stays at top of viewport */
  .sticky-note-center {
    --sticky-note-fab-x: calc(100vw - 76px);
    --sticky-note-fab-y: calc(100vh - 108px);
  }

  .sticky-note-panel {
    /* Full-width on mobile — JS vars handle top/height/placement */
    left: var(--sticky-note-panel-left, 12px) !important;
    top: var(--sticky-note-panel-top, 56px) !important;
    width: calc(100vw - var(--sticky-note-panel-left, 12px) * 2) !important;
    max-height: var(--sticky-note-panel-max-height, calc(100dvh * 0.82)) !important;
    right: auto !important;
    border-radius: 20px;
  }

  .sticky-note-color-swatch {
    width: 28px;
    height: 28px;
    min-height: 28px;
  }

  .sticky-note-page-board { padding: 18px; }
  .sticky-note-page-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .sticky-note-undo-banner {
    width: calc(100vw - 16px);
    justify-content: space-between;
  }

  /* ── Mobile panel list view — collapsed rows ────────────────────────────── */
  /* Cards in the list pane start collapsed: show only header row, hide body/footer */
  .sticky-note-panel.is-compact [data-sticky-note-pane="list"] .sticky-note-card.is-list-collapsed {
    gap: 0;
    padding: 12px 14px;
    border-radius: 14px;
    cursor: pointer;
  }
  .sticky-note-panel.is-compact [data-sticky-note-pane="list"] .sticky-note-card.is-list-collapsed .sticky-note-card-body,
  .sticky-note-panel.is-compact [data-sticky-note-pane="list"] .sticky-note-card.is-list-collapsed .sticky-note-card-footer,
  .sticky-note-panel.is-compact [data-sticky-note-pane="list"] .sticky-note-card.is-list-collapsed .sticky-note-checklist,
  .sticky-note-panel.is-compact [data-sticky-note-pane="list"] .sticky-note-card.is-list-collapsed .sticky-note-card-actions-bottom {
    display: none;
  }
  /* Expanded card shows full content */
  .sticky-note-panel.is-compact [data-sticky-note-pane="list"] .sticky-note-card:not(.is-list-collapsed) {
    animation: sticky-note-pop 200ms ease both;
  }
  /* Section gap tighter in list mode */
  .sticky-note-panel.is-compact [data-sticky-note-pane="list"] .sticky-note-grid {
    gap: 6px;
  }

  /* ── Mobile tab bar ─────────────────────────────────────────────────────── */
  .sticky-note-panel-tabs {
    display: flex;
    flex: 0 0 auto;
    border-bottom: 1px solid rgba(124, 200, 244, 0.2);
  }

  .sticky-note-panel-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 8px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--slate, #64748b);
    cursor: pointer;
    transition: color 160ms ease, border-color 160ms ease;
  }

  .sticky-note-panel-tab.is-active {
    color: var(--navy, #1e3a5f);
    border-bottom-color: #7cc8f4;
  }

  .sticky-note-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    line-height: 1;
  }

  /* Pane visibility — controlled by data-active-tab on the panel */
  [data-sticky-note-panel][data-active-tab="list"] [data-sticky-note-pane="compose"] {
    display: none;
  }

  [data-sticky-note-panel][data-active-tab="compose"] [data-sticky-note-pane="list"] {
    display: none;
  }
}

/* ── Notification clear animation ───────────────────────────────────────── */
@keyframes notification-item-out {
  0%   { opacity: 1; transform: translateY(0) scale(1);    max-height: 200px; margin-bottom: 0; }
  60%  { opacity: 0; transform: translateY(6px) scale(0.97); }
  100% { opacity: 0; transform: translateY(6px) scale(0.97); max-height: 0;   margin-bottom: -10px; }
}

.notification-item.is-clearing {
  animation: notification-item-out 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
  overflow: hidden;
}

.notifications-hero {
  padding: 24px;
}

.admin-notification-card textarea {
  min-height: 120px;
  resize: vertical;
}

.admin-dashboard-shell {
  gap: 1.25rem;
}

.admin-dashboard-header {
  align-items: flex-start;
}

.admin-dashboard-title {
  min-width: 0;
}

.admin-dashboard-title p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  line-height: 1.5;
  max-width: 62ch;
}

.admin-dashboard-header-actions {
  align-items: flex-start;
}

.admin-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(143, 166, 186, 0.09);
  border: 1px solid rgba(143, 166, 186, 0.16);
  width: fit-content;
}

.admin-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.admin-tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
}

.admin-tab.is-active {
  color: var(--navy);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.95));
  box-shadow:
    0 10px 18px rgba(64, 80, 96, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.admin-overview-stack,
.admin-accounts-stack {
  display: grid;
  gap: 1.25rem;
}

.admin-stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.admin-stat-card {
  min-height: 132px;
}

.admin-notification-form {
  gap: 1rem;
}

.admin-notification-actions {
  justify-content: flex-end;
}

.admin-accounts-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-accounts-toolbar h2 {
  margin-bottom: 0.15rem;
}

.admin-search-form {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  min-width: min(100%, 460px);
}

.admin-search-input {
  min-height: 44px;
}

.admin-search-button {
  min-height: 44px;
  padding-inline: 1rem;
}

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: rgba(143, 166, 186, 0.08);
  border: 1px solid rgba(143, 166, 186, 0.14);
}

.admin-pagination-summary {
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 600;
}

.admin-pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-pagination-nav,
.admin-pagination-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  min-width: 36px;
  padding: 0 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(143, 166, 186, 0.18);
  background: rgba(255, 255, 255, 0.92);
  color: var(--navy);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.admin-pagination-page.is-active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.admin-pagination-nav.is-disabled {
  opacity: 0.5;
}

.admin-pagination-pages {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.admin-user-list {
  gap: 0.9rem;
  padding-block: 1.15rem;
}

.admin-impersonation-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #6d28d9;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 1.25rem;
  font-size: 0.84rem;
  font-weight: 500;
  box-shadow: 0 2px 12px rgba(109, 40, 217, 0.4);
}

.admin-impersonation-banner-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-impersonation-banner-icon {
  display: flex;
  align-items: center;
  opacity: 0.85;
}

.admin-impersonation-banner-sub {
  opacity: 0.75;
  font-size: 0.78rem;
}

.admin-impersonation-stop-btn {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms;
}

.admin-impersonation-stop-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

body:has(.admin-impersonation-banner) {
  padding-top: 38px;
}

.admin-user-card {
  display: grid;
  gap: 1rem;
  padding: 1.2rem 1.25rem;
  border-radius: 18px;
  border: 1px solid rgba(143, 166, 186, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 253, 0.96));
  box-shadow:
    0 8px 18px rgba(64, 80, 96, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.admin-user-main {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  min-width: 0;
}

.admin-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(124, 200, 244, 0.12);
  border: 1px solid rgba(124, 200, 244, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  font-weight: 800;
  flex-shrink: 0;
}

.admin-user-copy {
  min-width: 0;
  flex: 1;
}

.admin-user-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.admin-user-name {
  font-size: 1rem;
  line-height: 1.2;
}

.admin-user-chip {
  font-size: 0.68rem !important;
  white-space: nowrap;
}

.admin-user-email {
  margin: 0;
  font-size: 0.88rem;
  color: var(--navy-deep);
  word-break: break-word;
}

.admin-user-meta,
.admin-user-id {
  margin: 0.2rem 0 0;
  font-size: 0.77rem;
  color: var(--muted);
  line-height: 1.45;
}

.admin-user-id {
  margin-top: 0.4rem;
  color: var(--color-text-tertiary);
}

.admin-user-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.admin-user-action-form {
  margin: 0;
  display: flex;
}

.admin-user-action-btn {
  width: 100%;
  min-height: 40px;
  justify-content: center;
  text-align: center;
  padding-inline: 0.75rem;
}

/* Admin card buttons — use app standard button classes, just compact the sizing */
.admin-user-actions .primary-button,
.admin-user-actions .ghost-button,
.admin-user-actions .danger-button,
.admin-user-plan-form .primary-button,
.admin-user-plan-form .secondary-button,
.admin-user-plan-form .ghost-button {
  min-height: 40px;
  padding: 9px 18px;
  font-size: 0.84rem;
  white-space: nowrap;
  width: 100%;
  justify-content: center;
  text-align: center;
}

.admin-user-id-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.admin-copy-id-btn {
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.1rem 0.2rem;
  border-radius: 4px;
  color: var(--color-text-secondary);
  opacity: 0.6;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.admin-copy-id-btn:hover {
  opacity: 1;
}

/* Plan filter */
.admin-plan-filter {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}
.admin-plan-filter-btn {
  position: relative;
  min-width: 3.6rem;
  padding: 0.36rem 0.85rem;
  border-radius: 99px;
  border: 1px solid rgba(198, 213, 229, 0.9);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  color: var(--color-text-secondary);
  text-decoration: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(242, 247, 251, 0.72)),
    rgba(246, 250, 252, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -5px 10px rgba(45, 85, 112, 0.05),
    0 8px 18px rgba(39, 78, 108, 0.08);
  transform: translateY(0);
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, color 140ms ease;
}
.admin-plan-filter-btn:hover {
  color: var(--navy-deep, #102030);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -5px 10px rgba(45, 85, 112, 0.07),
    0 10px 20px rgba(39, 78, 108, 0.1);
}
.admin-plan-filter-btn.is-active {
  color: var(--navy-deep, #102030);
  border-color: rgba(108, 175, 221, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.1)),
    linear-gradient(135deg, rgba(223, 231, 159, 0.98) 0%, rgba(124, 200, 244, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -6px 11px rgba(42, 97, 124, 0.1),
    0 8px 18px rgba(78, 142, 174, 0.16);
}
.admin-plan-filter-btn.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.36rem;
  width: 1.55rem;
  height: 0.18rem;
  border-radius: 99px;
  background: linear-gradient(135deg, rgba(223, 231, 159, 0.98), rgba(124, 200, 244, 0.98));
  box-shadow: 0 2px 7px rgba(78, 142, 174, 0.32);
  transform: translateX(-50%);
}
.admin-plan-filter-btn:focus-visible {
  outline: 3px solid rgba(95, 167, 199, 0.34);
  outline-offset: 4px;
}
.admin-user-card.is-hidden,
.admin-empty-state.is-hidden {
  display: none;
}

/* Audit log */
.audit-log-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}
.audit-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.audit-log-table th {
  text-align: left;
  padding: 0.6rem 0.85rem;
  background: var(--color-surface-raised, var(--color-surface));
  border-bottom: 1px solid var(--color-border);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
  font-weight: 700;
}
.audit-log-row td {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.audit-log-row:last-child td {
  border-bottom: none;
}
.audit-log-time {
  white-space: nowrap;
  color: var(--color-text-secondary);
}
.audit-log-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 99px;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}
.audit-log-badge--admin {
  background: color-mix(in srgb, #6d28d9 15%, transparent);
  color: #6d28d9;
}
.audit-log-badge--user {
  background: color-mix(in srgb, var(--accent, #7cc8f4) 20%, transparent);
  color: var(--accent-dark, #2a8fc4);
}
.audit-log-badge--workspace {
  background: color-mix(in srgb, var(--lime-dark, #c4d063) 25%, transparent);
  color: #636b10;
}

.admin-user-plan {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 0.85rem;
  align-items: center;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(143, 166, 186, 0.14);
}

.admin-user-plan-labels {
  min-width: 0;
}

.admin-user-plan-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.admin-user-plan-hint {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.admin-user-plan-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
}

.admin-user-plan-form.is-disabled {
  opacity: 0.62;
}

.admin-user-plan-select,
.admin-search-input {
  min-height: 42px;
}

.admin-user-plan-save {
  min-height: 42px;
  padding-inline: 0.95rem;
}

.admin-empty-state {
  padding: 1rem 1.1rem;
}

@media (max-width: 1200px) and (min-width: 761px) {
  .settings-integrations-grid.admin-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .settings-integrations-grid.admin-stat-grid {
    grid-template-columns: 1fr;
  }

  .admin-user-plan {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .admin-dashboard-header,
  .admin-accounts-toolbar {
    align-items: stretch;
  }

  .admin-dashboard-header-actions {
    justify-content: flex-start;
  }

  .admin-tabs {
    width: 100%;
  }

  .admin-tab {
    flex: 1 1 0;
  }

  .admin-search-form {
    grid-template-columns: 1fr;
    min-width: 0;
    width: 100%;
  }

  .admin-pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-pagination-controls {
    justify-content: space-between;
    width: 100%;
  }

  .admin-pagination-pages {
    justify-content: center;
    width: 100%;
  }

  .admin-pagination--bottom {
    display: none;
  }

  .admin-user-main {
    flex-direction: column;
  }

  .admin-user-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-user-plan-form {
    grid-template-columns: 1fr;
  }

  .admin-user-plan {
    gap: 0.7rem;
  }

  .admin-user-plan-label {
    font-size: 0.7rem;
  }

  .admin-user-plan-hint {
    margin-top: 0.15rem;
    font-size: 0.78rem;
  }

  .admin-user-plan-select,
  .admin-search-input {
    min-height: 40px;
  }

  .admin-user-plan-save,
  .admin-search-button {
    min-height: 40px;
  }

  .admin-user-actions .admin-user-action-form:last-child {
    grid-column: 1 / -1;
  }
}

.hub-menu {
  position: relative;
}

.hub-menu summary {
  list-style: none;
}

.hub-menu summary::-webkit-details-marker {
  display: none;
}

.hub-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(185, 201, 219, 0.9);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.96));
  box-shadow:
    0 8px 18px rgba(92, 124, 148, 0.06),
    0 2px 5px rgba(124, 200, 244, 0.035),
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -12px 16px rgba(14, 27, 44, 0.01);
  color: var(--navy);
  cursor: pointer;
  user-select: none;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.hub-menu-trigger:hover,
.hub-menu-trigger:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(124, 200, 244, 0.3);
  box-shadow:
    0 12px 22px rgba(92, 124, 148, 0.08),
    0 4px 10px rgba(124, 200, 244, 0.045),
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -12px 18px rgba(14, 27, 44, 0.01);
}

.hub-menu-icon {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  width: 18px;
}

.hub-menu-icon span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: var(--navy-deep);
}

.hub-menu-label {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.hub-menu-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  min-width: 230px;
  display: grid;
  gap: 8px;
  padding: 14px;
}

.hub-menu-popover a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--navy-deep);
  text-decoration: none;
  font-weight: 700;
  transition: background-color 180ms ease, transform 180ms ease;
}

.hub-menu-popover a:hover,
.hub-menu-popover a:focus-visible {
  background: rgba(124, 200, 244, 0.12);
  transform: translateX(2px);
}

.stack-xl {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.landing-hero,
.landing-grid,
.legal-layout {
  display: grid;
  gap: 20px;
}

.landing-hero {
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  align-items: start;
  column-gap: 24px;
  padding: 28px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  background:
    radial-gradient(circle at top right, rgba(124, 200, 244, 0.2), transparent 30%),
    radial-gradient(circle at bottom left, rgba(201, 226, 101, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.96));
  box-shadow: 0 28px 70px rgba(64, 80, 96, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.landing-hero-copy,
.landing-hero-card,
.landing-card,
.legal-hero,
.legal-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.landing-hero h1,
.legal-hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 4.6vw, 4.15rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  color: var(--navy-deep);
}

.landing-hero-copy {
  max-width: 640px;
}

.landing-hero-card {
  align-self: start;
  margin-top: 8px;
}

.landing-hero h2,
.landing-card h2,
.legal-section h2 {
  margin: 0;
  letter-spacing: -0.04em;
  color: var(--navy);
}

.landing-hero-card h2 {
  font-size: clamp(1.55rem, 2vw, 2.1rem);
  line-height: 1.14;
}

.landing-hero-card .feature-list {
  line-height: 1.6;
}

.landing-brand-note {
  margin: 6px 0 0;
  align-self: flex-end;
  max-width: 18rem;
  text-align: right;
  color: var(--navy-soft);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.landing-lead,
.landing-card p,
.legal-hero p,
.legal-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.landing-actions,
.landing-link-row,
.site-footer,
.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.landing-actions {
  margin-top: 10px;
}

.landing-actions > * {
  min-width: 0;
}

.landing-actions .ghost-button,
.landing-actions .primary-button {
  justify-content: center;
  text-align: center;
}

.landing-link-row a,
.site-footer a {
  color: var(--navy);
  font-weight: 700;
}

.site-footer-branding {
  color: var(--navy-soft);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.landing-hero-card,
.landing-card,
.legal-hero,
.legal-section {
  padding: 24px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 253, 0.94));
  box-shadow: 0 18px 42px rgba(64, 80, 96, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.landing-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.landing-apps {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.landing-apps-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 720px;
}

.landing-apps-header h2 {
  margin: 0;
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  color: var(--navy-deep);
}

.landing-apps-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.landing-apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.landing-app-card {
  gap: 10px;
}

.legal-layout {
  max-width: 900px;
  margin: 0 auto;
}

.site-footer {
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(244, 249, 253, 0.92));
  color: var(--muted);
  box-shadow: 0 16px 34px rgba(64, 80, 96, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

/* ============================================================
   Hub preview (public product tour) — premium brand landing
   ============================================================ */

body.hub-preview-page {
  background:
    radial-gradient(1000px 640px at 88% -8%, rgba(124, 200, 244, 0.16), transparent 60%),
    radial-gradient(820px 560px at -6% 32%, rgba(213, 221, 148, 0.14), transparent 56%),
    radial-gradient(720px 480px at 54% 112%, rgba(241, 207, 140, 0.14), transparent 58%),
    linear-gradient(135deg, rgba(250, 252, 255, 0.98) 0%, rgba(238, 247, 246, 0.96) 45%, rgba(250, 248, 242, 0.96) 100%);
  /* clip avoids the scroll-container trap that "hidden" causes */
  overflow-x: clip;
}

body.hub-preview-page .shell {
  max-width: 1480px;
}

body.hub-preview-page .topbar {
  margin-bottom: 18px;
}

.hp-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;
}

.hub-preview {
  display: grid;
  gap: clamp(48px, 6vw, 84px);
  padding-bottom: clamp(28px, 4vw, 48px);
}

/* ---------- Scroll reveal (only when JS enables .hp-anim) ---------- */

.hub-preview.hp-anim [data-hp-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--d, 0ms);
  will-change: opacity, transform;
}

.hub-preview.hp-anim [data-hp-reveal].hp-in {
  opacity: 1;
  transform: none;
}

/* Directional reveal variants */
.hub-preview.hp-anim [data-hp-reveal="left"] {
  transform: translateX(-44px);
}

.hub-preview.hp-anim [data-hp-reveal="right"] {
  transform: translateX(44px);
}

.hub-preview.hp-anim [data-hp-reveal="zoom"] {
  transform: translateY(20px) scale(0.94);
}

/* Reduced motion: reveals still fire, but as pure cross-fades */
.hub-preview.hp-anim.hp-reduced [data-hp-reveal],
.hub-preview.hp-anim.hp-reduced .hp-flow-steps[data-hp-reveal] .hp-flow-step {
  transform: none !important;
  transition-duration: 500ms;
}

/* Scroll storytelling: sections tilt up out of the page as you reach them */
.hub-preview.hp-anim:not(.hp-reduced) [data-hp-story] {
  opacity: calc(0.35 + var(--sp, 1) * 0.65);
  transform:
    perspective(1200px)
    translateY(calc((1 - var(--sp, 1)) * 44px))
    rotateX(calc((1 - var(--sp, 1)) * 6deg))
    scale(calc(0.96 + var(--sp, 1) * 0.04));
  transform-origin: 50% 0%;
  will-change: transform, opacity;
}

/* WebGL gradient backdrop */
.hp-shader-canvas {
  position: absolute;
  inset: 0;
  z-index: -2;
  display: block;
  width: 100%;
  height: 100%;
}

.hp-shader-on .hp-aurora,
.hp-shader-on .hp-final-glow {
  display: none;
}

/* Ambient drifting gradient orbs behind the whole page */
.hp-ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.hp-ambient span {
  position: absolute;
  width: 540px;
  height: 540px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
}

.hp-ambient span:nth-child(1) {
  top: -14%;
  left: -10%;
  background: radial-gradient(circle at 45% 45%, rgba(124, 200, 244, 0.34), transparent 66%);
}

.hp-ambient span:nth-child(2) {
  top: 32%;
  right: -14%;
  background: radial-gradient(circle at 50% 50%, rgba(213, 221, 148, 0.3), transparent 66%);
}

.hp-ambient span:nth-child(3) {
  bottom: -18%;
  left: 26%;
  background: radial-gradient(circle at 50% 50%, rgba(241, 207, 140, 0.28), transparent 66%);
}

/* Staggered child cascades once the parent reveals */
.hub-preview.hp-anim .hp-stack[data-hp-reveal] span {
  opacity: 0;
  transition:
    opacity 620ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 260ms ease;
}

.hub-preview.hp-anim .hp-stack[data-hp-reveal] span:nth-child(2) { transition-delay: 130ms, 0ms, 0ms; }
.hub-preview.hp-anim .hp-stack[data-hp-reveal] span:nth-child(3) { transition-delay: 260ms, 0ms, 0ms; }
.hub-preview.hp-anim .hp-stack[data-hp-reveal] span:nth-child(4) { transition-delay: 390ms, 0ms, 0ms; }

.hub-preview.hp-anim .hp-stack.hp-in span {
  opacity: 1;
}

.hub-preview.hp-anim .hp-flow-steps[data-hp-reveal] .hp-flow-step {
  opacity: 0;
  transform: translateX(-18px);
  transition:
    opacity 600ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 600ms cubic-bezier(0.22, 1, 0.36, 1),
    background 220ms ease,
    border-color 220ms ease;
}

.hub-preview.hp-anim .hp-flow-steps[data-hp-reveal] .hp-flow-step:nth-child(2) { transition-delay: 140ms, 140ms, 0ms, 0ms; }
.hub-preview.hp-anim .hp-flow-steps[data-hp-reveal] .hp-flow-step:nth-child(3) { transition-delay: 280ms, 280ms, 0ms, 0ms; }

.hub-preview.hp-anim .hp-flow-steps.hp-in .hp-flow-step {
  opacity: 1;
  transform: none;
}

/* Scroll-linked depth parallax (offset driven by JS) */
[data-hp-parallax] {
  transform: translate3d(0, var(--hp-parallax-y, 0px), 0);
  will-change: transform;
}

/* Scroll progress: a gradient frame drawn around the viewport */
.hp-progressbar {
  position: fixed;
  inset: 0;
  z-index: 240;
  pointer-events: none;
}

.hp-progress-edge {
  position: absolute;
  box-shadow: 0 0 10px rgba(88, 180, 235, 0.35);
}

.hp-progress-top {
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, #c4d063, #7cc8f4 55%, #f1cf8c);
}

.hp-progress-right {
  top: 0;
  right: 0;
  bottom: 0;
  width: 4px;
  transform: scaleY(0);
  transform-origin: top;
  background: linear-gradient(180deg, #f1cf8c, #7cc8f4);
}

.hp-progress-bottom {
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  transform: scaleX(0);
  transform-origin: right;
  background: linear-gradient(270deg, #7cc8f4, #c4d063);
}

.hp-progress-left {
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  transform: scaleY(0);
  transform-origin: bottom;
  background: linear-gradient(0deg, #c4d063, #7cc8f4);
}

/* Scroll hint (shown only when motion is allowed) */
.hp-scroll-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  margin-inline: auto;
  width: fit-content;
  display: none;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: opacity 400ms ease;
  pointer-events: none;
}

.hp-scroll-hint.is-hidden {
  opacity: 0;
}

.hp-scroll-hint span {
  position: relative;
  width: 21px;
  height: 32px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
}

.hp-scroll-hint span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 6px;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 999px;
  background: linear-gradient(180deg, #dfe79f, #7cc8f4);
}

/* ---------- Shared bits ---------- */

.hp-eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 9px;
  min-height: 32px;
  padding: 7px 13px;
  border: 1px solid rgba(24, 64, 81, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #174057;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hp-hero .hp-eyebrow,
.hp-flow .hp-eyebrow,
.hp-demo .hp-eyebrow,
.hp-final .hp-eyebrow {
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
}

.hp-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime-dark);
  box-shadow: 0 0 0 0 rgba(196, 208, 99, 0.6);
}

.hp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hp-cta-primary,
.hp-cta-ghost {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  padding: 14px 26px;
  border-radius: 16px;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

.hp-cta-primary {
  background: linear-gradient(135deg, #dfe79f 0%, #7cc8f4 100%);
  color: var(--navy-deep);
  border: 1px solid rgba(108, 175, 221, 0.24);
  box-shadow:
    0 14px 30px rgba(88, 180, 235, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.hp-cta-primary::after {
  content: "";
  position: absolute;
  inset: -40% auto;
  left: -70%;
  width: 45%;
  transform: skewX(-22deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  pointer-events: none;
}

.hp-cta-primary svg {
  transition: transform 180ms ease;
}

.hp-cta-primary:hover,
.hp-cta-primary:focus-visible {
  transform: translateY(-2px);
  box-shadow:
    0 20px 40px rgba(88, 180, 235, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.hp-cta-primary:hover svg {
  transform: translateX(3px);
}

.hp-cta-ghost {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.hp-cta-ghost:hover,
.hp-cta-ghost:focus-visible {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.44);
}

.hp-cta-watch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 8px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 800;
  font-size: 0.98rem;
  text-decoration: none;
  transition: color 180ms ease;
}

.hp-cta-watch i {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), background 220ms ease;
}

.hp-cta-watch i svg {
  margin-left: 2px;
}

.hp-cta-watch:hover,
.hp-cta-watch:focus-visible {
  color: #fff;
}

.hp-cta-watch:hover i,
.hp-cta-watch:focus-visible i {
  transform: scale(1.12);
  background: rgba(88, 180, 235, 0.45);
}

.hp-section-head {
  display: grid;
  gap: 14px;
  max-width: 840px;
}

.hp-section-head h2,
.hp-split h2,
.hp-final h2 {
  margin: 0;
  color: var(--navy-deep);
  font-size: clamp(1.9rem, 3.6vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.hp-section-head p,
.hp-split p,
.hp-final p {
  margin: 0;
  color: #526678;
  font-size: 1.04rem;
  line-height: 1.72;
}

/* Gradient headline text — navy sweep on light, ice sweep on navy */
.hp-section-head h2,
.hp-split h2,
.hp-final h2 {
  background: linear-gradient(115deg, #102030 35%, #2f5f7a 78%, #4a90c2 105%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hp-flow .hp-section-head h2,
.hp-demo .hp-section-head h2,
.hp-final h2 {
  color: #fff;
  background: linear-gradient(110deg, #ffffff 40%, #cfe9fb 80%, #f4ddb0 110%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hp-flow .hp-section-head p,
.hp-demo .hp-section-head p,
.hp-final p {
  color: rgba(255, 255, 255, 0.76);
}

/* ---------- Hero ---------- */

.hp-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(380px, 0.98fr);
  align-items: center;
  gap: clamp(28px, 4vw, 56px);
  min-height: min(640px, calc(100svh - 170px));
  padding: clamp(24px, 3.4vw, 52px);
  border-radius: 34px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(900px 480px at 90% -12%, rgba(124, 200, 244, 0.3), transparent 60%),
    radial-gradient(720px 440px at -8% 110%, rgba(241, 207, 140, 0.24), transparent 58%),
    linear-gradient(130deg, #0f2233 0%, #1c3850 52%, #2f5f7a 100%);
  box-shadow: 0 34px 80px rgba(12, 28, 42, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hp-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.hp-aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
}

.hp-aurora-a {
  top: -18%;
  left: 2%;
  width: 480px;
  height: 380px;
  background: radial-gradient(circle at 40% 40%, rgba(124, 200, 244, 0.5), transparent 68%);
}

.hp-aurora-b {
  top: 4%;
  right: -8%;
  width: 560px;
  height: 430px;
  background: radial-gradient(circle at 55% 45%, rgba(213, 221, 148, 0.36), transparent 66%);
}

.hp-aurora-c {
  bottom: -26%;
  left: 32%;
  width: 520px;
  height: 400px;
  background: radial-gradient(circle at 50% 50%, rgba(241, 207, 140, 0.34), transparent 64%);
}

.hp-hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse 78% 62% at 50% 42%, rgba(0, 0, 0, 0.9), transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 78% 62% at 50% 42%, rgba(0, 0, 0, 0.9), transparent 78%);
}

.hp-hero-copy {
  display: grid;
  gap: 22px;
  max-width: 640px;
}

.hp-headline {
  margin: 0;
  color: #fff;
  font-size: clamp(2.5rem, 4.9vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.hp-headline > span {
  display: block;
}

.hp-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: clamp(1.04rem, 1.6vw, 1.24rem);
  line-height: 1.7;
  max-width: 560px;
}

/* Rotating word */
.hp-swap {
  display: inline-flex;
  overflow: hidden;
  height: 1.08em;
  vertical-align: bottom;
}

.hp-swap-track {
  display: flex;
  flex-direction: column;
}

.hp-swap-track span {
  display: block;
  height: 1.08em;
  line-height: 1.08;
  background: linear-gradient(100deg, #f1cf8c 0%, #7cc8f4 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hp-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hp-proof span {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.88rem;
  font-weight: 700;
}

.hp-proof strong {
  color: #fff;
  font-size: 1.02rem;
  font-weight: 900;
}

.hp-ph a {
  display: inline-block;
  border-radius: 12px;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms ease;
  box-shadow: 0 14px 34px rgba(6, 18, 30, 0.35);
}

.hp-ph a:hover,
.hp-ph a:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 20px 44px rgba(6, 18, 30, 0.45);
}

.hp-ph img {
  display: block;
  width: 250px;
  height: 54px;
  max-width: 100%;
  border-radius: 12px;
}

.hp-hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
}

.hp-hero-links a {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.26);
  transition: color 160ms ease, border-color 160ms ease;
}

.hp-hero-links a:hover,
.hp-hero-links a:focus-visible {
  color: #fff;
  border-color: var(--gold);
}

/* Hero product mock */
.hp-visual {
  position: relative;
  justify-self: center;
  width: min(100%, 480px);
}

.hp-visual-ring {
  position: absolute;
  inset: -14% -10%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 45%, rgba(124, 200, 244, 0.22), transparent 62%);
  filter: blur(12px);
}

.hp-window {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(16, 36, 56, 0.95), rgba(10, 24, 40, 0.97));
  box-shadow:
    0 40px 90px rgba(6, 18, 30, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
  transform: perspective(1100px) rotateX(0deg) rotateY(0deg);
  will-change: transform;
}

.hp-window-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
}

.hp-window-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.hp-window-bar span:nth-child(1) { background: rgba(232, 111, 82, 0.78); }
.hp-window-bar span:nth-child(2) { background: rgba(241, 207, 140, 0.85); }
.hp-window-bar span:nth-child(3) { background: rgba(196, 208, 99, 0.85); }

.hp-window-bar em {
  margin-left: auto;
  font-style: normal;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(233, 243, 250, 0.5);
}

.hp-window-body {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.hp-metric {
  display: grid;
  gap: 4px;
}

.hp-metric-label {
  color: rgba(233, 243, 250, 0.6);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hp-metric strong {
  color: #fff;
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  font-weight: 950;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.hp-metric-trend {
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(213, 221, 148, 0.18);
  color: #dbe3a4;
  font-size: 0.76rem;
  font-weight: 800;
}

.hp-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 110px;
  padding: 4px 2px 0;
}

.hp-bars span {
  flex: 1 1 0;
  height: var(--h, 40%);
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, rgba(124, 200, 244, 0.85), rgba(88, 180, 235, 0.36));
  transform-origin: bottom;
}

.hp-bars .hp-bar-hot {
  background: linear-gradient(180deg, #f1cf8c, rgba(241, 207, 140, 0.42));
  box-shadow: 0 0 24px rgba(241, 207, 140, 0.4);
}

.hp-rows {
  display: grid;
  gap: 8px;
}

.hp-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.86rem;
}

.hp-row-id {
  color: rgba(233, 243, 250, 0.52);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.hp-row-name {
  color: rgba(240, 247, 252, 0.94);
  font-weight: 700;
}

.hp-pill {
  margin-left: auto;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hp-pill-paid {
  background: rgba(213, 221, 148, 0.2);
  color: #dbe3a4;
}

.hp-pill-sent {
  background: rgba(124, 200, 244, 0.18);
  color: #9dd5f7;
}

.hp-pill-draft {
  background: rgba(233, 243, 250, 0.1);
  color: rgba(233, 243, 250, 0.62);
}

.hp-float {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 15px 11px 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 15px;
  background: rgba(14, 32, 50, 0.94);
  box-shadow: 0 22px 48px rgba(6, 18, 30, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hp-float strong {
  display: block;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
}

.hp-float em {
  display: block;
  color: rgba(233, 243, 250, 0.58);
  font-size: 0.74rem;
  font-style: normal;
}

.hp-float-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-weight: 950;
  font-size: 1rem;
}

.hp-float-icon-pay {
  background: rgba(213, 221, 148, 0.2);
  color: #dbe3a4;
}

.hp-float-icon-client {
  background: rgba(124, 200, 244, 0.2);
  color: #9dd5f7;
}

.hp-float-icon-report {
  background: rgba(241, 207, 140, 0.2);
  color: #f1cf8c;
  font-size: 0.72rem;
}

.hp-float-a {
  top: -22px;
  right: -10px;
}

.hp-float-b {
  bottom: 74px;
  left: -38px;
}

.hp-float-c {
  bottom: -18px;
  right: 22px;
}

/* ---------- Marquee ---------- */

.hp-marquee {
  overflow: hidden;
  padding: 6px 0;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.hp-marquee-track {
  display: flex;
  width: max-content;
}

.hp-marquee-group {
  display: flex;
  gap: 12px;
  padding-right: 12px;
}

.hp-marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid rgba(30, 70, 88, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: #17384a;
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 10px 22px rgba(39, 72, 86, 0.08);
}

.hp-marquee-item i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c4d063, #58b4eb);
}

/* ---------- Stats ---------- */

.hp-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.hp-stat {
  position: relative;
  display: grid;
  gap: 8px;
  padding: clamp(20px, 2.6vw, 30px);
  border: 1px solid rgba(26, 67, 82, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 42px rgba(37, 72, 91, 0.08);
  text-align: center;
  overflow: hidden;
}

.hp-stat::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, #c4d063, #7cc8f4, #f1cf8c);
  opacity: 0.85;
}

.hp-stat strong {
  color: var(--navy-deep);
  font-size: clamp(2.3rem, 4vw, 3.4rem);
  font-weight: 950;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, #16324a 30%, #58b4eb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hp-stat > span {
  color: #627386;
  font-size: 0.9rem;
  font-weight: 700;
}

/* ---------- Feature grid ---------- */

.hp-section {
  display: grid;
  gap: clamp(24px, 3vw, 40px);
}

.hp-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.hp-feature {
  position: relative;
  display: grid;
  gap: 14px;
  min-height: 250px;
  padding: 24px;
  border: 1px solid rgba(26, 67, 82, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 42px rgba(37, 72, 91, 0.08);
  overflow: hidden;
  isolation: isolate;
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), border-color 240ms ease, box-shadow 240ms ease;
}

.hp-feature:hover,
.hp-feature:focus-within {
  transform: translateY(-5px);
  border-color: rgba(88, 180, 235, 0.4);
  box-shadow: 0 26px 58px rgba(37, 72, 91, 0.16);
}

.hp-feature-glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(124, 200, 244, 0.2), transparent 70%);
  transition: opacity 260ms ease;
  pointer-events: none;
}

.hp-feature:hover .hp-feature-glow {
  opacity: 1;
}

.hp-feature::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, #c4d063, #7cc8f4, #f1cf8c);
  opacity: 0;
  transition: opacity 260ms ease;
}

.hp-feature:hover::after,
.hp-feature:focus-within::after {
  opacity: 1;
}

.hp-feature-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.hp-feature-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(26, 67, 82, 0.12);
  background: rgba(244, 249, 253, 0.9);
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hp-feature:hover .hp-feature-icon {
  transform: scale(1.08) rotate(-4deg);
}

.hp-feature-icon img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.hp-feature-label {
  color: #4a6172;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hp-feature h3 {
  margin: 0;
  color: #122d40;
  font-size: 1.4rem;
  line-height: 1.14;
  letter-spacing: -0.01em;
}

.hp-feature p {
  margin: 0;
  color: #536779;
  line-height: 1.64;
  font-size: 0.96rem;
}

.hp-feature strong {
  align-self: end;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 850;
}

.hp-feature-teal strong { background: rgba(44, 170, 164, 0.14); color: #0f6966; }
.hp-feature-green strong { background: rgba(112, 168, 76, 0.16); color: #486f22; }
.hp-feature-gold strong { background: rgba(226, 166, 58, 0.18); color: #8a5d0d; }
.hp-feature-coral strong { background: rgba(232, 111, 82, 0.14); color: #98452d; }
.hp-feature-blue strong { background: rgba(78, 133, 205, 0.15); color: #2c5d98; }
.hp-feature-ink strong { background: rgba(25, 44, 64, 0.1); color: #1a3045; }

/* ---------- App showcase carousel ---------- */

.hp-showcase {
  display: grid;
  gap: clamp(20px, 3vw, 32px);
}

.hp-showcase-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hp-showcase-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid rgba(26, 67, 82, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: #17384a;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 850;
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.hp-showcase-pill img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.hp-showcase-pill:hover {
  transform: translateY(-2px);
}

.hp-showcase-pill.is-active {
  border-color: rgba(88, 180, 235, 0.55);
  background: linear-gradient(135deg, rgba(223, 231, 159, 0.35), rgba(124, 200, 244, 0.35)), rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(88, 180, 235, 0.22);
}

.hp-showcase-track {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 6px 4px 18px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.hp-showcase-track::-webkit-scrollbar {
  display: none;
}

.hp-showcase-slide {
  flex: 0 0 min(620px, 86%);
  display: grid;
  gap: 16px;
  scroll-snap-align: center;
}

.hp-showcase-caption {
  display: grid;
  gap: 5px;
  padding: 0 6px;
}

.hp-showcase-caption h3 {
  margin: 0;
  color: #122d40;
  font-size: 1.25rem;
}

.hp-showcase-caption p {
  margin: 0;
  color: #536779;
  line-height: 1.6;
}

/* Shared mock frame for showcase previews */
.hp-shot {
  display: grid;
  gap: 16px;
  min-height: 250px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  background:
    radial-gradient(420px 220px at 82% 0%, rgba(124, 200, 244, 0.12), transparent 62%),
    linear-gradient(180deg, rgba(18, 39, 59, 0.96), rgba(11, 25, 42, 0.97));
  box-shadow: 0 26px 56px rgba(9, 26, 42, 0.35);
  align-content: start;
}

.hp-shot-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hp-shot-bar strong {
  color: #fff;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

/* CRM board mock */
.hp-crm-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.hp-crm-col {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
}

.hp-crm-col em {
  color: rgba(233, 243, 250, 0.55);
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hp-crm-card {
  display: grid;
  gap: 2px;
  padding: 10px 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
}

.hp-crm-card small {
  color: rgba(233, 243, 250, 0.55);
  font-weight: 700;
}

.hp-crm-won {
  border-color: rgba(213, 221, 148, 0.4);
  background: rgba(213, 221, 148, 0.12);
}

.hp-crm-won small {
  color: #dbe3a4;
}

/* Rapid Books mock */
.hp-books-rows {
  display: grid;
  gap: 12px;
}

.hp-books-rows > span {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.hp-books-rows em {
  color: rgba(233, 243, 250, 0.6);
  font-style: normal;
  font-size: 0.82rem;
  font-weight: 800;
}

.hp-books-rows strong {
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.hp-books-bar {
  display: block;
  width: var(--w, 50%);
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(124, 200, 244, 0.9), rgba(88, 180, 235, 0.5));
}

.hp-books-bar-exp {
  background: linear-gradient(90deg, rgba(241, 207, 140, 0.9), rgba(241, 207, 140, 0.4));
}

.hp-books-net {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(213, 221, 148, 0.12);
  border: 1px solid rgba(213, 221, 148, 0.28);
  display: flex !important;
  justify-content: space-between;
}

.hp-books-net em {
  color: #dbe3a4;
}

.hp-books-net strong {
  font-size: 1.15rem;
}

/* Hub Chat mock */
.hp-chat {
  display: grid;
  gap: 10px;
}

.hp-chat-msg {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 92%;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px 15px 15px 5px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(240, 247, 252, 0.94);
  font-size: 0.88rem;
  font-weight: 600;
}

.hp-chat-msg i,
.hp-chat-typing i {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: linear-gradient(135deg, #dfe79f, #7cc8f4);
  color: #0b1c2c;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 950;
}

.hp-chat-me {
  justify-self: end;
  border-radius: 15px 15px 5px 15px;
  background: rgba(124, 200, 244, 0.16);
  border-color: rgba(124, 200, 244, 0.3);
}

.hp-chat-typing {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 15px 15px 15px 5px;
  background: rgba(255, 255, 255, 0.045);
}

.hp-chat-typing em {
  display: inline-flex;
  gap: 4px;
}

.hp-chat-typing b {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(233, 243, 250, 0.55);
}

/* Rapid Notes mock */
.hp-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 6px;
}

.hp-note {
  flex: 1 1 140px;
  min-height: 110px;
  padding: 14px;
  border-radius: 4px 18px 14px 14px;
  color: #2b3a17;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.45;
  box-shadow: 0 14px 26px rgba(6, 18, 30, 0.35);
  transform: rotate(-2deg);
}

.hp-note-lime {
  background: linear-gradient(180deg, #e6edaf, #d5dd94);
}

.hp-note-gold {
  background: linear-gradient(180deg, #f7dfae, #f1cf8c);
  color: #5c430f;
  transform: rotate(1.6deg);
}

.hp-note-sky {
  background: linear-gradient(180deg, #b8e0f8, #9ad2f3);
  color: #123a55;
  transform: rotate(-1deg);
}

/* ---------- Workflow (interactive) ---------- */

.hp-flow {
  display: grid;
  gap: clamp(24px, 3vw, 40px);
  padding: clamp(24px, 4vw, 52px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  background:
    radial-gradient(700px 340px at 84% 8%, rgba(241, 207, 140, 0.14), transparent 62%),
    radial-gradient(560px 300px at 6% 96%, rgba(124, 200, 244, 0.12), transparent 60%),
    linear-gradient(135deg, #0f2436 0%, #1d3f57 100%);
  box-shadow: 0 28px 68px rgba(10, 30, 43, 0.2);
}

.hp-flow-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(20px, 3vw, 44px);
  align-items: stretch;
}

.hp-flow-steps {
  display: grid;
  gap: 10px;
  align-content: start;
}

.hp-flow-step {
  position: relative;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 18px 22px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
  overflow: hidden;
  transition: background 220ms ease, border-color 220ms ease;
}

.hp-flow-step:hover {
  background: rgba(255, 255, 255, 0.06);
}

.hp-flow-step.is-active {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
}

.hp-flow-num {
  color: rgba(244, 199, 109, 0.6);
  font-size: 0.92rem;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  transition: color 220ms ease;
  padding-top: 2px;
}

.hp-flow-step.is-active .hp-flow-num {
  color: #f4c76d;
}

.hp-flow-step-body {
  display: grid;
  gap: 6px;
}

.hp-flow-step-body strong {
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.14rem;
  font-weight: 850;
  transition: color 220ms ease;
}

.hp-flow-step.is-active .hp-flow-step-body strong {
  color: #fff;
}

.hp-flow-step-body small {
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.9rem;
  line-height: 1.58;
}

.hp-flow-progress {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 10px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  opacity: 0;
  transition: opacity 220ms ease;
}

.hp-flow-step.is-active .hp-flow-progress {
  opacity: 1;
}

.hp-flow-progress::after {
  content: "";
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f1cf8c, #7cc8f4);
}

.hp-flow-auto .hp-flow-step.is-active .hp-flow-progress::after {
  width: 0;
  animation: hp-progress 5.2s linear forwards;
}

.hp-flow-stage {
  position: relative;
  display: grid;
  min-height: 300px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background:
    radial-gradient(420px 260px at 76% 14%, rgba(124, 200, 244, 0.12), transparent 64%),
    rgba(8, 22, 36, 0.55);
  overflow: hidden;
}

.hp-scene {
  grid-area: 1 / 1;
  display: grid;
  place-items: center;
  padding: clamp(18px, 2.6vw, 34px);
}

.hp-scene-card {
  display: grid;
  gap: 18px;
  width: min(100%, 400px);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(20, 42, 62, 0.94), rgba(12, 28, 46, 0.96));
  box-shadow: 0 26px 60px rgba(6, 18, 30, 0.45);
}

.hp-scene-contact {
  display: flex;
  align-items: center;
  gap: 13px;
}

.hp-scene-contact > div {
  display: grid;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.hp-scene-contact em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hp-scene-contact strong {
  color: #fff;
  font-size: 1.05rem;
}

.hp-scene-contact em {
  color: rgba(233, 243, 250, 0.58);
  font-size: 0.82rem;
  font-style: normal;
}

.hp-avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: linear-gradient(135deg, #dfe79f, #7cc8f4);
  color: var(--navy-deep);
  font-weight: 950;
  font-size: 0.95rem;
}

.hp-scene-meta {
  display: grid;
  gap: 9px;
}

.hp-scene-meta span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(233, 243, 250, 0.58);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hp-scene-meta strong {
  color: #fff;
  font-size: 0.94rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 800;
}

.hp-scene-invoice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hp-scene-invoice-head strong {
  color: #fff;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.hp-scene-lines {
  display: grid;
  gap: 8px;
}

.hp-scene-lines span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
  font-size: 0.9rem;
}

.hp-scene-lines em {
  color: rgba(233, 243, 250, 0.7);
  font-style: normal;
}

.hp-scene-lines strong {
  color: rgba(240, 247, 252, 0.94);
  font-variant-numeric: tabular-nums;
}

.hp-scene-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(241, 207, 140, 0.14);
}

.hp-scene-total em {
  color: #f1cf8c;
  font-style: normal;
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hp-scene-total strong {
  color: #fff;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}

.hp-scene-track {
  display: flex;
  gap: 8px;
}

.hp-scene-track span {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(233, 243, 250, 0.62);
  font-size: 0.84rem;
  font-weight: 800;
}

.hp-scene-track span.is-done {
  border-color: rgba(213, 221, 148, 0.32);
  color: #eef2d3;
}

.hp-scene-track span.is-final {
  background: rgba(213, 221, 148, 0.16);
  color: #dbe3a4;
}

.hp-scene-track i {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(213, 221, 148, 0.24);
  color: #dbe3a4;
  font-size: 0.62rem;
  font-style: normal;
}

/* ---------- Video showcase ---------- */

.hp-video {
  display: grid;
  gap: clamp(20px, 3vw, 32px);
}

.hp-video-frame {
  position: relative;
  isolation: isolate;
  border-radius: 28px;
}

.hp-video-glow {
  position: absolute;
  inset: -4px;
  z-index: -1;
  border-radius: 32px;
  background: linear-gradient(120deg, rgba(196, 208, 99, 0.55), rgba(124, 200, 244, 0.6), rgba(241, 207, 140, 0.55));
  filter: blur(16px);
  opacity: 0.5;
}

.hp-video-poster {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 28px;
  overflow: hidden;
  background: #0b1a2b;
  box-shadow: 0 40px 90px rgba(9, 26, 42, 0.4);
  cursor: pointer;
}

.hp-video-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hp-video-poster:hover img,
.hp-video-poster:focus-visible img {
  transform: scale(1.035);
}

.hp-video-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 60% at 50% 50%, rgba(6, 16, 28, 0.12), transparent 70%),
    linear-gradient(180deg, rgba(6, 16, 28, 0.12), transparent 30%, transparent 62%, rgba(6, 16, 28, 0.62));
}

.hp-video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin: -44px 0 0 -44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(10, 24, 40, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  box-shadow: 0 22px 50px rgba(6, 16, 28, 0.5);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), background 260ms ease;
}

.hp-video-play svg {
  margin-left: 4px;
}

.hp-video-poster:hover .hp-video-play,
.hp-video-poster:focus-visible .hp-video-play {
  transform: scale(1.1);
  background: rgba(88, 180, 235, 0.45);
}

.hp-video-hint {
  position: absolute;
  left: 18px;
  bottom: 16px;
  padding: 9px 15px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(10, 24, 40, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hp-video-iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 28px;
  background: #0b1a2b;
  box-shadow: 0 40px 90px rgba(9, 26, 42, 0.4);
}

/* ---------- Split / stack ---------- */

.hp-split {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid rgba(26, 67, 82, 0.1);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.66);
}

.hp-split > div:first-child {
  display: grid;
  gap: 14px;
}

.hp-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  perspective: 1000px;
}

.hp-stack span {
  display: block;
  padding: 18px 22px;
  border: 1px solid rgba(21, 65, 82, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: #17384a;
  font-weight: 800;
  box-shadow: 0 16px 34px rgba(36, 72, 91, 0.1);
  transform: rotateX(6deg) rotateY(-7deg);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), border-color 260ms ease;
}

.hp-stack span:nth-child(2) { transform: translateX(24px) rotateX(6deg) rotateY(-7deg); }
.hp-stack span:nth-child(3) { transform: translateX(48px) rotateX(6deg) rotateY(-7deg); }
.hp-stack span:nth-child(4) { transform: translateX(72px) rotateX(6deg) rotateY(-7deg); }

.hp-stack:hover span {
  transform: rotateX(0deg) rotateY(0deg);
  border-color: rgba(88, 180, 235, 0.4);
}

.hp-stack:hover span:nth-child(2) { transform: translateX(24px); }
.hp-stack:hover span:nth-child(3) { transform: translateX(48px); }
.hp-stack:hover span:nth-child(4) { transform: translateX(72px); }

/* ---------- Final CTA ---------- */

.hp-final {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: clamp(40px, 6vw, 76px) clamp(22px, 4vw, 56px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 32px;
  background:
    radial-gradient(720px 400px at 50% -20%, rgba(124, 200, 244, 0.2), transparent 62%),
    linear-gradient(150deg, #0f2233 0%, #1c3850 60%, #2b5470 100%);
  box-shadow: 0 30px 72px rgba(12, 28, 42, 0.24);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

.hp-final-glow {
  position: absolute;
  inset: -60%;
  z-index: -1;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(124, 200, 244, 0.2) 80deg,
    rgba(241, 207, 140, 0.18) 160deg,
    transparent 240deg,
    rgba(213, 221, 148, 0.16) 320deg,
    transparent 360deg
  );
  filter: blur(50px);
}

.hp-final img {
  width: 84px;
  height: 84px;
}

.hp-final p {
  max-width: 460px;
}

.hp-final .hp-actions {
  justify-content: center;
  margin-top: 8px;
}

.hp-final-powered {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------- Footer ---------- */

.hp-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 18px 24px;
  border: 1px solid rgba(26, 67, 82, 0.1);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  color: #627386;
  font-size: 0.92rem;
}

.hp-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.hp-footer-brand img {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  flex: 0 0 auto;
}

.hp-footer-brand a {
  color: var(--navy);
  font-weight: 850;
  text-decoration: none;
  padding-bottom: 1px;
  border-bottom: 1px solid rgba(88, 180, 235, 0.45);
  transition: color 160ms ease, border-color 160ms ease;
}

.hp-footer-brand a:hover,
.hp-footer-brand a:focus-visible {
  color: var(--accent-dark);
  border-color: currentColor;
}

.hp-footer-ph {
  display: inline-block;
  border-radius: 10px;
  transition: transform 200ms ease;
}

.hp-footer-ph:hover,
.hp-footer-ph:focus-visible {
  transform: translateY(-2px);
}

.hp-footer-ph img {
  display: block;
  width: 208px;
  height: 45px;
  max-width: 100%;
  border-radius: 10px;
}

.hp-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
}

.hp-footer-links a {
  color: var(--navy);
  font-weight: 800;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 160ms ease, border-color 160ms ease;
}

.hp-footer-links a:hover,
.hp-footer-links a:focus-visible {
  color: var(--accent-dark);
  border-color: currentColor;
}

/* ---------- Interactive invoice demo ---------- */

.hp-demo {
  display: grid;
  gap: clamp(24px, 3vw, 40px);
  padding: clamp(24px, 4vw, 52px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  background:
    radial-gradient(640px 320px at 12% 0%, rgba(124, 200, 244, 0.14), transparent 60%),
    radial-gradient(560px 300px at 94% 100%, rgba(241, 207, 140, 0.12), transparent 60%),
    linear-gradient(135deg, #10273a 0%, #1d3f57 100%);
  box-shadow: 0 28px 68px rgba(10, 30, 43, 0.2);
}

.hp-demo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 44px);
  align-items: start;
}

.hp-demo-form {
  display: grid;
  gap: 16px;
}

.hp-demo-field {
  display: grid;
  gap: 8px;
}

.hp-demo-field > span {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hp-demo-field output {
  color: #f1cf8c;
  font-size: 0.96rem;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.hp-demo-field input[type="text"],
.hp-demo-field select {
  min-height: 50px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-weight: 700;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.hp-demo-field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1.5 7 7.5 13 1.5' fill='none' stroke='%237cc8f4' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}

.hp-demo-field input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.hp-demo-field input[type="text"]:focus-visible,
.hp-demo-field select:focus-visible {
  outline: none;
  border-color: rgba(124, 200, 244, 0.6);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(124, 200, 244, 0.22);
}

.hp-demo-field select option {
  color: #16324a;
  background: #fff;
}

.hp-demo-field input[type="range"] {
  width: 100%;
  height: 6px;
  margin: 10px 0 4px;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(213, 221, 148, 0.9), rgba(124, 200, 244, 0.9));
  cursor: pointer;
}

.hp-demo-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #7cc8f4;
  box-shadow: 0 6px 16px rgba(6, 18, 30, 0.4);
  cursor: pointer;
  transition: transform 160ms ease;
}

.hp-demo-field input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.12);
}

.hp-demo-field input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #7cc8f4;
  cursor: pointer;
}

.hp-demo-note {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.92rem;
  line-height: 1.6;
}

.hp-demo-form .hp-cta-primary {
  justify-self: start;
}

.hp-demo-doc {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(20, 42, 62, 0.94), rgba(12, 28, 46, 0.96));
  box-shadow: 0 26px 60px rgba(6, 18, 30, 0.45);
  transition: box-shadow 300ms ease, border-color 300ms ease;
}

.hp-demo-doc.is-updated {
  border-color: rgba(124, 200, 244, 0.5);
  box-shadow:
    0 26px 60px rgba(6, 18, 30, 0.45),
    0 0 0 3px rgba(124, 200, 244, 0.18);
}

.hp-demo-doc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.hp-demo-doc-head strong {
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.hp-demo-doc-to {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.hp-demo-doc-to em {
  color: rgba(233, 243, 250, 0.55);
  font-style: normal;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hp-demo-doc-to strong {
  color: #fff;
  font-size: 1.08rem;
  overflow-wrap: anywhere;
}

/* ---------- FAQ ---------- */

.hp-faq {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
}

.hp-faq .hp-section-head {
  position: sticky;
  top: 90px;
}

.hp-faq-more {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: var(--navy);
  font-weight: 850;
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 2px solid rgba(88, 180, 235, 0.45);
  transition: color 160ms ease, border-color 160ms ease, gap 160ms ease;
}

.hp-faq-more:hover,
.hp-faq-more:focus-visible {
  color: var(--accent-dark);
  border-color: currentColor;
  gap: 10px;
}

.hp-faq-list {
  display: grid;
  gap: 12px;
}

.hp-faq-item {
  border: 1px solid rgba(26, 67, 82, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 34px rgba(37, 72, 91, 0.07);
  overflow: hidden;
  transition: border-color 220ms ease, box-shadow 220ms ease;
}

.hp-faq-item.is-open {
  border-color: rgba(88, 180, 235, 0.4);
}

.hp-faq-q {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #122d40;
  font: inherit;
  font-size: 1.06rem;
  font-weight: 850;
  text-align: left;
}

.hp-faq-q i {
  position: relative;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(26, 67, 82, 0.16);
  border-radius: 10px;
  background: rgba(244, 249, 253, 0.9);
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), background 220ms ease;
}

.hp-faq-q i::before,
.hp-faq-q i::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 2px;
  margin: -1px 0 0 -6px;
  border-radius: 2px;
  background: #2f5f7a;
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hp-faq-q i::after {
  transform: rotate(90deg);
}

.hp-faq-item.is-open .hp-faq-q i {
  transform: rotate(180deg);
  background: rgba(124, 200, 244, 0.18);
}

.hp-faq-item.is-open .hp-faq-q i::after {
  transform: rotate(0deg);
}

.hp-faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hp-faq-a-inner {
  padding: 0 20px 20px;
  color: #526678;
  line-height: 1.7;
}

/* ---------- Sticky sign-up bar ---------- */

.hp-sticky-cta {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 230;
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: min(92vw, 640px);
  padding: 12px 12px 12px 22px;
  border: 1px solid rgba(26, 67, 82, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 24px 60px rgba(24, 48, 68, 0.24);
  transform: translate(-50%, calc(100% + 26px));
  opacity: 0;
  transition: transform 480ms cubic-bezier(0.22, 1, 0.36, 1), opacity 420ms ease;
  pointer-events: none;
}

.hp-sticky-cta.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

.hp-sticky-copy {
  color: #526678;
  font-size: 0.94rem;
  line-height: 1.4;
}

.hp-sticky-copy strong {
  color: var(--navy-deep);
  font-weight: 900;
}

.hp-sticky-cta .hp-cta-primary {
  min-height: 46px;
  padding: 12px 20px;
  white-space: nowrap;
}

.hp-sticky-close {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(26, 67, 82, 0.14);
  border-radius: 50%;
  background: rgba(244, 249, 253, 0.9);
  color: #2f5f7a;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}

.hp-sticky-close:hover {
  background: #fff;
  transform: scale(1.06);
}

/* ---------- Motion (opt-in via prefers-reduced-motion) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hp-hero-item {
    animation: hp-rise 800ms cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: var(--d, 0ms);
  }

  .hp-pulse-dot {
    animation: hp-pulse 2.2s ease-out infinite;
  }

  .hp-aurora-a { animation: hp-drift-a 16s ease-in-out infinite alternate; }
  .hp-aurora-b { animation: hp-drift-b 19s ease-in-out infinite alternate; }
  .hp-aurora-c { animation: hp-drift-c 22s ease-in-out infinite alternate; }

  .hp-swap-track {
    animation: hp-swap-cycle 9s cubic-bezier(0.65, 0, 0.35, 1) infinite;
  }

  .hp-cta-primary::after {
    animation: hp-sheen 4.2s ease-in-out infinite;
  }

  .hp-bars span {
    animation: hp-bar-grow 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--bd, 0ms) + 500ms);
  }

  .hp-float {
    animation:
      hp-rise 800ms cubic-bezier(0.22, 1, 0.36, 1) both,
      hp-bob 5.6s ease-in-out 1.4s infinite alternate;
  }

  .hp-float-a { animation-delay: 900ms, 1.4s; }
  .hp-float-b { animation-delay: 1200ms, 2.2s; }
  .hp-float-c { animation-delay: 1500ms, 3s; }

  .hp-marquee-track {
    animation: hp-marquee 34s linear infinite;
  }

  .hp-marquee:hover .hp-marquee-track {
    animation-play-state: paused;
  }

  .hp-scene.is-active .hp-scene-card {
    animation: hp-scene-in 480ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .hp-final-glow {
    animation: hp-spin 14s linear infinite;
  }

  .hp-scroll-hint {
    display: inline-flex;
    animation: hp-rise 800ms cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: 1000ms;
  }

  .hp-scroll-hint span::after {
    animation: hp-scroll-dot 1.9s ease-in-out infinite;
  }

  .hp-ambient span:nth-child(1) {
    animation: hp-drift-a 26s ease-in-out infinite alternate;
  }

  .hp-ambient span:nth-child(2) {
    animation: hp-drift-b 32s ease-in-out infinite alternate;
  }

  .hp-ambient span:nth-child(3) {
    animation: hp-drift-c 38s ease-in-out infinite alternate;
  }

  .hp-chat-typing b {
    animation: hp-typing 1.3s ease-in-out infinite;
  }

  .hp-chat-typing b:nth-child(2) {
    animation-delay: 0.18s;
  }

  .hp-chat-typing b:nth-child(3) {
    animation-delay: 0.36s;
  }

  .hp-crm-won {
    animation: hp-won-glow 3.2s ease-in-out infinite;
  }

  .hp-video-play::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    border: 1px solid rgba(124, 200, 244, 0.7);
    animation: hp-play-pulse 2.4s ease-out infinite;
  }

  .hp-video-glow {
    animation: hp-glow-breathe 6s ease-in-out infinite;
  }
}

@keyframes hp-play-pulse {
  0% {
    transform: scale(1);
    opacity: 0.9;
  }
  70%, 100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

@keyframes hp-glow-breathe {
  0%, 100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.65;
  }
}

@keyframes hp-typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

@keyframes hp-won-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(213, 221, 148, 0);
  }
  50% {
    box-shadow: 0 0 18px 2px rgba(213, 221, 148, 0.25);
  }
}

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

@keyframes hp-pulse {
  0% { box-shadow: 0 0 0 0 rgba(196, 208, 99, 0.6); }
  70% { box-shadow: 0 0 0 9px rgba(196, 208, 99, 0); }
  100% { box-shadow: 0 0 0 0 rgba(196, 208, 99, 0); }
}

@keyframes hp-drift-a {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(70px, 40px) scale(1.15); }
}

@keyframes hp-drift-b {
  from { transform: translate(0, 0) scale(1.1); }
  to { transform: translate(-80px, 30px) scale(0.95); }
}

@keyframes hp-drift-c {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(50px, -46px) scale(1.18); }
}

@keyframes hp-swap-cycle {
  0%, 16% { transform: translateY(0); }
  25%, 41% { transform: translateY(-1.08em); }
  50%, 66% { transform: translateY(-2.16em); }
  75%, 91% { transform: translateY(-3.24em); }
  100% { transform: translateY(-4.32em); }
}

@keyframes hp-sheen {
  0%, 55% { left: -70%; }
  100% { left: 170%; }
}

@keyframes hp-bar-grow {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

@keyframes hp-bob {
  from { transform: translateY(0); }
  to { transform: translateY(-12px); }
}

@keyframes hp-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes hp-progress {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes hp-scene-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes hp-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes hp-scroll-dot {
  0% { transform: translateY(0); opacity: 1; }
  65% { transform: translateY(11px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

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

@media (max-width: 1080px) {
  .hp-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 56px;
    padding-bottom: 78px;
  }

  .hp-hero-copy {
    max-width: 700px;
  }

  .hp-visual {
    width: min(100%, 500px);
  }

  .hp-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hp-flow-grid {
    grid-template-columns: 1fr;
  }

  .hp-flow-stage {
    min-height: 0;
  }

  .hp-demo-grid {
    grid-template-columns: 1fr;
  }

  .hp-faq {
    grid-template-columns: 1fr;
  }

  .hp-faq .hp-section-head {
    position: static;
  }

  .hp-showcase-slide {
    flex-basis: min(560px, 88%);
  }

  .hp-split {
    grid-template-columns: 1fr;
  }

  .hp-stack span,
  .hp-stack span:nth-child(2),
  .hp-stack span:nth-child(3),
  .hp-stack span:nth-child(4),
  .hp-stack:hover span,
  .hp-stack:hover span:nth-child(2),
  .hp-stack:hover span:nth-child(3),
  .hp-stack:hover span:nth-child(4) {
    transform: none;
  }
}

@media (max-width: 720px) {
  body.hub-preview-page .shell {
    padding-inline: 14px;
  }

  .hub-preview {
    gap: 44px;
  }

  .hp-hero {
    gap: 48px;
    padding: 22px 18px 74px;
    border-radius: 26px;
  }

  .hp-headline {
    font-size: clamp(2.3rem, 10.5vw, 3rem);
  }

  .hp-actions {
    width: 100%;
  }

  .hp-actions .hp-cta-primary,
  .hp-actions .hp-cta-ghost {
    flex: 1 1 150px;
  }

  .hp-proof span {
    flex: 1 1 100px;
    justify-content: center;
  }

  .hp-float-a {
    top: -20px;
    right: -6px;
  }

  .hp-float-b {
    left: -8px;
    bottom: 60px;
  }

  .hp-float-c {
    display: none;
  }

  .hp-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .hp-feature-grid {
    grid-template-columns: 1fr;
  }

  .hp-feature {
    min-height: 0;
  }

  .hp-flow {
    padding: 22px 16px;
    border-radius: 24px;
  }

  .hp-demo {
    padding: 22px 16px;
    border-radius: 24px;
  }

  .hp-demo-form .hp-cta-primary {
    justify-self: stretch;
  }

  .hp-faq-q {
    padding: 15px 16px;
    font-size: 0.99rem;
  }

  .hp-faq-a-inner {
    padding: 0 16px 16px;
  }

  .hp-sticky-copy {
    display: none;
  }

  .hp-sticky-cta {
    gap: 10px;
    padding: 10px;
  }

  .hp-flow-step {
    padding: 15px 14px 20px;
  }

  .hp-scene {
    padding: 16px 12px;
  }

  .hp-scene-card {
    padding: 16px;
  }

  .hp-split {
    padding: 22px 18px;
    border-radius: 24px;
  }

  .hp-final {
    border-radius: 26px;
  }

  .hp-video-poster,
  .hp-video-iframe,
  .hp-video-frame {
    border-radius: 18px;
  }

  .hp-video-play {
    width: 64px;
    height: 64px;
    margin: -32px 0 0 -32px;
  }

  .hp-video-hint {
    left: 10px;
    bottom: 10px;
    font-size: 0.7rem;
    padding: 7px 11px;
  }

  .hp-footer {
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }

  .hp-footer-links {
    justify-content: center;
  }
}

@media (max-width: 460px) {
  .hp-hero {
    padding: 18px 14px 72px;
  }

  .hp-headline {
    font-size: clamp(2rem, 11vw, 2.6rem);
  }

  .hp-window-body {
    gap: 14px;
    padding: 14px;
  }

  .hp-bars {
    height: 88px;
  }

  .hp-metric strong {
    font-size: 1.8rem;
  }

  .hp-float-b {
    display: none;
  }

  .hp-marquee-item {
    padding: 10px 15px;
    font-size: 0.82rem;
  }

  .hp-stat {
    padding: 16px 12px;
  }

  .hp-stat strong {
    font-size: 2rem;
  }

  .hp-scene-meta span {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .hp-scene-track {
    flex-direction: column;
  }

  .hp-demo-doc {
    padding: 16px;
  }

  .hp-showcase-slide {
    flex-basis: 92%;
  }

  .hp-crm-board {
    grid-template-columns: repeat(3, minmax(96px, 1fr));
    overflow-x: auto;
    scrollbar-width: none;
  }

  .hp-shot {
    min-height: 0;
    padding: 14px;
  }

  .hp-showcase-pill {
    font-size: 0.84rem;
    padding: 9px 14px;
  }

  .hp-demo-field input[type="text"],
  .hp-demo-field select {
    min-height: 46px;
  }

  .hp-final {
    padding: 32px 16px;
  }
}

@media (max-width: 1200px) {
  body.hub-page {
    overflow-x: clip; /* clip avoids the scroll-container trap that "hidden" causes */
  }

  body.hub-page.docs-page .hub-shell {
    grid-template-columns: 1fr;
  }

  body.hub-page.docs-page .hub-sidebar {
    display: none;
  }

  body.hub-page.docs-page .hub-main {
    padding-right: 0;
  }

  body.hub-page.docs-page .docs-body {
    grid-template-columns: 1fr;
  }

  /* TOC becomes a horizontal scroll strip above the content. */
  body.hub-page.docs-page .docs-toc {
    position: static;
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    padding: 10px;
    scrollbar-width: none;
  }

  body.hub-page.docs-page .docs-toc::-webkit-scrollbar {
    display: none;
  }

  body.hub-page.docs-page .docs-toc-title,
  body.hub-page.docs-page .docs-toc-group-label {
    display: none;
  }

  body.hub-page.docs-page .docs-toc-link {
    flex: 0 0 auto;
    white-space: nowrap;
    border: 1px solid var(--line);
  }

  body.hub-page .shell {
    height: auto;
    /* Use svh (small viewport height) not vh/dvh: vh = large viewport (toolbar hidden),
       which forces phantom scroll space on short pages. When the mobile toolbar then
       collapses, the content suddenly fits and the page snaps back to the top.
       svh sizes the shell to the toolbar-visible viewport so no phantom space is created. */
    min-height: 100vh; /* fallback for browsers without svh */
    min-height: 100svh;
    padding-top: 8px;
    padding-bottom: calc(44px + env(safe-area-inset-bottom, 0px));
  }

  body.hub-page.analytics-fullscreen-page {
    height: 100dvh;
    overflow: hidden;
  }

  body.hub-page.analytics-fullscreen-page .shell {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    padding-top: 120px;
    padding-bottom: 4px;
  }

  body.hub-page.crm-fullscreen-page .shell {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .hub-shell {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }

  .hub-sidebar {
    position: static;
    max-height: none;
  }

  .hub-sidebar:not(.hub-sidebar-home) {
    display: none;
  }

  .hub-main {
    overflow: visible;
    padding-right: 0;
  }

  body.hub-page.crm-fullscreen-page .hub-main {
    overflow: hidden;
  }

  body.hub-page.analytics-fullscreen-page .hub-main,
  body.hub-page.analytics-fullscreen-page .analytics-hub-main {
    min-height: 0;
    overflow-y: auto;
    padding-right: 36px;
    scrollbar-gutter: stable;
  }

  /* Home launcher: when the sidebar can't sit beside the content, the launcher
     menu is the primary view. The workspace overview is reached via the Home
     card's "See Overview" action, not shown inline on top. */
  /* On small screens the launcher becomes a full-width panel.
     Restore the sidebar's card appearance (panel bg/shadow) and don't stretch
     to fill the column height — that's what created the dead space below. */
  .hub-sidebar-home {
    position: relative;
    align-self: start;
    overflow: visible;
    padding: 20px 16px 32px;
  }

  /* Show the brand logo in the launcher; right-pad so the toggle never overlaps. */
  .hub-sidebar-home .brand-link-hub {
    display: inline-flex;
    margin-bottom: 2px;
    padding-right: 52px;
  }

  .hub-sidebar-home .hub-sidebar-tagline {
    display: none;
  }

  .hub-sidebar-home .hub-sidebar-footer {
    display: block;
  }

  .hub-sidebar-home .hub-nav .hub-nav-home-card {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .hub-sidebar-home .hub-nav .hub-nav-home-card .hub-nav-home-link {
    flex: 1;
    min-width: 0;
  }

  .hub-sidebar-home .hub-nav-overview-btn {
    display: inline-flex;
    align-items: center;
    margin-top: 0;
    flex-shrink: 0;
  }

  .hub-nav-mobile-head {
    display: contents;
  }

  .hub-nav-mobile-heading {
    display: none;
  }

  /* Pin toggle to top-right of the panel, inside the restored padding. */
  .hub-sidebar-home .hub-nav-view-toggle {
    position: absolute;
    top: 20px;
    right: 16px;
  }

  .hub-sidebar-home .hub-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
  }

  .hub-sidebar-home .hub-nav.is-list-view {
    grid-template-columns: 1fr;
  }

  body.hub-page .hub-main-home {
    display: none;
  }


  .builder-shell,
  .invoice-page,
  .auth-grid,
  .landing-hero,
  .landing-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-analytics-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .client-detail-grid,
  .client-detail-metrics {
    grid-template-columns: 1fr;
  }

  .client-form-layout,
  .client-form-grid {
    grid-template-columns: 1fr;
  }

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

  .builder-sidebar {
    position: static;
  }

  .landing-hero-card {
    margin-top: 0;
  }

  .settings-shell {
    grid-template-columns: 1fr;
  }

  .settings-rail {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .settings-grid,
  .settings-integrations-grid:not(.admin-stat-grid),
  .settings-security-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid,
  .settings-integrations-grid,
  .settings-security-grid {
    gap: 14px;
  }

  .settings-card {
    padding: 16px;
  }
}

@media (max-width: 520px) {
  body.accounting-landing-page .shell {
    width: 100%;
    max-width: 100%;
    padding-left: 14px;
    padding-right: 14px;
    /* overflow-x: clip instead of hidden — avoids creating a new scroll container
       which breaks iOS momentum scrolling and causes sticky topbar jank */
    overflow-x: clip;
  }

  body.accounting-landing-page .topbar {
    width: calc(100% + 28px);
    max-width: none;
    margin-left: -14px;
    margin-right: -14px;
    padding-left: 14px;
    padding-right: 14px;
    /* Never set overflow on a position:sticky element — creates a new scroll
       container which causes scroll jank and breaks the sticky behaviour */
  }

  body.accounting-landing-page .dashboard-v2,
  body.accounting-landing-page .hub-shell,
  body.accounting-landing-page .hub-main,
  body.accounting-landing-page .panel,
  body.accounting-landing-page .hub-app-card,
  body.accounting-landing-page .account-summary-chip {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  body.accounting-landing-page .split-row-dashboard {
    min-width: 0;
  }

  body.accounting-landing-page .split-row-dashboard > * {
    min-width: 0;
  }

  body.accounting-landing-page .topbar-actions {
    min-width: 0;
    max-width: 100%;
  }

  body.accounting-landing-page .topbar-actions a,
  body.accounting-landing-page .topbar-actions span,
  body.accounting-landing-page .topbar-actions button {
    max-width: 100%;
  }
}

@media (max-width: 860px) {
  .topbar,
  .split-row,
  .builder-toolbar,
  .builder-header,
  .invoice-topline,
  .site-footer,
  .client-detail-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .editor-grid-top,
  .invoice-editor-top,
  .invoice-meta-grid,
  .editor-grid-secondary,
  .editor-bottom-grid,
  .sample-meta,
  .analytics-chart-summary,
  .invoice-template-selector,
  .executive-template-hero,
  .studio-template-frame,
  .rapid-template-party-grid,
  .executive-template-party-grid,
  .studio-template-party-grid,
  .rapid-template-bottom,
  .executive-template-bottom,
  .studio-template-bottom {
    grid-template-columns: 1fr;
  }

  .invoice-editor-title {
    justify-content: flex-start;
  }

  .invoice-meta-stack,
  .invoice-meta-row {
    align-items: flex-start;
    justify-self: stretch;
    text-align: left;
  }

  .invoice-meta-row .invoice-status-chip {
    align-self: flex-start;
  }

  .analytics-panel-header,
  .status-breakdown-copy {
    flex-direction: column;
    align-items: flex-start;
  }

  .analytics-hero-inner,
  .analytics-filter-bar-form {
    align-items: stretch;
  }

  .analytics-hero-badge {
    align-items: flex-start;
  }

  .analytics-tablist {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-tablist-v2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-overview-charts-grid,
  .analytics-overview-bottom-grid,
  .expense-analytics-grid {
    grid-template-columns: 1fr;
  }

  .analytics-filter-bar-form {
    gap: 10px;
  }

  .analytics-filter-chips-row,
  .analytics-filter-date-row,
  .analytics-filter-right {
    width: 100%;
    padding-left: 0;
    border-left: 0;
  }

  .analytics-filter-date-row,
  .analytics-filter-right {
    flex-wrap: wrap;
  }

  .analytics-date-input {
    min-width: 0;
    flex: 1 1 150px;
  }

  .analytics-apply-btn,
  .analytics-reset-btn,
  .analytics-icon-btn {
    flex: 1 1 120px;
    justify-content: center;
  }

  body.analytics-fullscreen-page .analytics-filter-bar-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 10px;
  }

  body.analytics-fullscreen-page .analytics-filter-chips-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.analytics-fullscreen-page .analytics-filter-date-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 8px;
  }

  body.analytics-fullscreen-page .analytics-date-sep {
    display: none;
  }

  body.analytics-fullscreen-page .analytics-date-input,
  body.analytics-fullscreen-page .analytics-apply-btn,
  body.analytics-fullscreen-page .analytics-reset-btn {
    width: 100%;
    height: 36px;
    flex: none;
  }

  body.analytics-fullscreen-page .analytics-filter-right {
    display: grid;
    grid-template-columns: minmax(120px, max-content) minmax(160px, 1fr);
    align-items: center;
    gap: 8px;
  }

  body.analytics-fullscreen-page .analytics-icon-btn {
    height: 36px;
    flex: none;
  }

  .expense-analytics-grid,
  .accounting-expense-breakdown {
    grid-template-columns: 1fr;
  }

  .invoice-generated-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .rapid-template-header,
  .executive-template-header,
  .studio-template-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .studio-template-sidebar,
  .studio-template-main {
    gap: 14px;
  }

  .analytics-table-row,
  .analytics-table-row-recent {
    grid-template-columns: 1fr;
  }

  .analytics-chart-summary {
    gap: 6px 12px;
  }

  .items-header {
    display: none;
  }

  .line-item-row {
    grid-template-columns: 1fr;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    background: var(--panel-muted);
  }

  .line-item-total {
    justify-content: flex-start;
    padding: 0;
  }

  body.hub-page.docs-page .landing-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  body.hub-page.docs-page .landing-link-row {
    gap: 8px;
  }

  body.hub-page.docs-page .landing-link-row .reports-range-chip {
    width: 100%;
  }

  body.hub-page.docs-page .grid-two {
    grid-template-columns: 1fr;
  }

  body.hub-page.docs-page .landing-actions {
    gap: 10px;
  }

  body.hub-page.docs-page .landing-actions .ghost-button,
  body.hub-page.docs-page .landing-actions .primary-button {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .shell {
    padding: 16px;
  }

  .hero-card,
  .panel,
  .invoice-sheet {
    padding: 20px;
  }

  .landing-hero {
    padding: 20px;
  }

  .builder-title-block h2,
  .sample-title {
    font-size: 2.2rem;
  }

  .invoice-document-label-field input {
    font-size: 2.4rem;
  }

  .invoice-meta-details {
    grid-template-columns: 1fr;
  }

  .summary-fields-grid {
    grid-template-columns: 1fr;
  }

  .summary-field-wide {
    grid-column: auto;
  }

  .summary-field-tax,
  .summary-field-advanced-toggle,
  .summary-field-amount {
    grid-column: auto;
  }

  .dashboard-metrics-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-usage-chip-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-mini-kpis {
    grid-template-columns: 1fr;
  }

  .hub-quick-actions {
    grid-template-columns: 1fr;
  }

  .auth-consent-card {
    padding: 14px 15px;
  }

  .integrations-modal {
    align-items: flex-start;
    padding: 10px 0 22px;
  }

  .integrations-modal-card {
    z-index: 1;
    width: min(calc(100vw - 12px), 760px);
    max-width: calc(100vw - 12px);
    height: auto;
    max-height: none;
    overflow: visible;
    margin: 0 auto;
    padding: calc(14px + env(safe-area-inset-top)) 14px calc(26px + env(safe-area-inset-bottom));
    border-radius: 26px;
  }

  .integrations-modal-header {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .integrations-modal-grid {
    grid-template-columns: 1fr;
  }

  .integrations-modal-grid.integrations-three-up {
    grid-template-columns: 1fr;
  }

  .team-invite-tabs {
    gap: 14px;
  }

  .team-tablist {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 14px 34px rgba(64, 80, 96, 0.08);
  }

  .team-tablist label {
    display: grid;
    min-height: 40px;
    place-items: center;
    padding: 8px 6px;
    border-radius: 13px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-align: center;
    cursor: pointer;
  }

  #team-tab-invite:checked ~ .team-tablist label[for="team-tab-invite"],
  #team-tab-members:checked ~ .team-tablist label[for="team-tab-members"],
  #team-tab-invites:checked ~ .team-tablist label[for="team-tab-invites"] {
    background: var(--ink);
    color: #fff;
    box-shadow: 0 10px 24px rgba(24, 48, 68, 0.16);
  }

  .team-invite-tabs .team-tab-panel {
    display: none;
  }

  #team-tab-invite:checked ~ .team-tab-panel-invite,
  #team-tab-members:checked ~ .team-tab-panel-members,
  #team-tab-invites:checked ~ .team-tab-panel-invites {
    display: flex;
  }

  .hub-nav-link {
    padding: 12px 14px;
  }

  .hub-app-card,
  .hub-recent-item {
    padding: 18px;
  }

  .integrations-modal-card {
    max-height: none;
    scroll-padding-bottom: 0;
  }

  .integrations-modal-grid.integrations-three-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .integrations-modal-grid.integrations-three-up > :last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .settings-mobile-nav {
    padding: 18px;
  }

  .settings-page .hub-sidebar {
    display: none;
  }

  .integrations-modal-card {
    width: min(calc(100vw - 10px), 760px);
    max-width: calc(100vw - 10px);
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
  }

  .integrations-modal-card::before,
  .integrations-modal-card::after {
    opacity: 0;
    animation: none;
    display: none;
  }

  .integrations-modal-backdrop {
    backdrop-filter: blur(3px) saturate(88%);
  }

  .integrations-modal-grid.integrations-three-up {
    grid-template-columns: 1fr;
  }

  .integrations-modal-grid.integrations-three-up > :last-child {
    grid-column: auto;
  }
}

@media (min-width: 1201px) {
  .hub-shell {
    flex: 1;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .hub-main,
  .settings-page-content {
    height: auto;
    overflow: visible;
    padding-right: 8px;
    padding-bottom: 44px;
    scrollbar-gutter: stable;
    scroll-padding-bottom: 44px;
    scrollbar-width: thin;
    scrollbar-color: rgba(96, 118, 144, 0.48) rgba(255, 255, 255, 0.35);
  }

  body.hub-page.crm-fullscreen-page .hub-main {
    height: 100%;
    overflow: hidden;
    padding-right: 0;
    padding-bottom: 0;
  }

  .hub-main::-webkit-scrollbar,
  .settings-page-content::-webkit-scrollbar {
    width: 12px;
  }

  .hub-main::-webkit-scrollbar-track,
  .settings-page-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.28);
    border-radius: 999px;
  }

  .hub-main::-webkit-scrollbar-thumb,
  .settings-page-content::-webkit-scrollbar-thumb {
    border-radius: 999px;
    border: 3px solid rgba(255, 255, 255, 0.36);
    background: linear-gradient(180deg, rgba(124, 200, 244, 0.7), rgba(95, 164, 222, 0.72));
  }
}

@media (max-width: 1200px) {
  .settings-tabs-rail {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

@page {
  size: A4 portrait;
  margin: 12mm;
}

@media print {
  html,
  body,
  body * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body {
    background: white !important;
  }

  .shell {
    padding: 0 !important;
    max-width: none;
  }

  .shell-document {
    padding: 0 !important;
    background: white !important;
  }

  .topbar,
  .invoice-page-sidebar,
  .invoice-download-actions,
  .no-print,
  .page-loader,
  .app-dialog-modal {
    display: none !important;
  }

  .invoice-page {
    display: block;
  }

  .rapid-template-header,
  .executive-template-header,
  .studio-template-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
  }

  .executive-template-hero {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 280px !important;
    gap: 22px !important;
    align-items: start !important;
  }

  .studio-template-frame {
    display: grid !important;
    grid-template-columns: 250px minmax(0, 1fr) !important;
    gap: 18px !important;
  }

  .rapid-template-party-grid,
  .executive-template-party-grid,
  .studio-template-party-grid,
  .rapid-template-bottom,
  .executive-template-bottom,
  .studio-template-bottom {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }

  .rapid-template-logo,
  .rapid-template-logo-fallback {
    margin-left: auto !important;
    flex: 0 0 auto !important;
  }

  .invoice-sheet-download .executive-template-party-card,
  .invoice-sheet-download .studio-template-party-card,
  .invoice-sheet-download .executive-template-table,
  .invoice-sheet-download .studio-template-table,
  .invoice-sheet-download .executive-template-totals,
  .invoice-sheet-download .studio-template-totals,
  .invoice-sheet-download .invoice-generated-footer-brand img {
    box-shadow: none !important;
  }

  .invoice-sheet-download .executive-template-party-card,
  .invoice-sheet-download .studio-template-party-card,
  .invoice-sheet-download .executive-template-table,
  .invoice-sheet-download .studio-template-table,
  .invoice-sheet-download .executive-template-totals,
  .invoice-sheet-download .studio-template-totals {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 244, 0.98)),
      #ffffff !important;
  }

  .invoice-sheet-download .rapid-template-party-card {
    background:
      linear-gradient(135deg, rgba(109, 193, 246, 0.11), rgba(201, 226, 101, 0.1)),
      #ffffff !important;
  }

  .invoice-sheet-download .rapid-template-table {
    background: linear-gradient(180deg, rgba(109, 193, 246, 0.05), rgba(201, 226, 101, 0.04))
      !important;
  }

  .invoice-sheet-download .rapid-template-totals {
    background: linear-gradient(180deg, rgba(109, 193, 246, 0.06), rgba(201, 226, 101, 0.05))
      !important;
  }

  .invoice-sheet-download .executive-template-party-card {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 244, 0.98)),
      #ffffff !important;
  }

  .invoice-sheet-download .executive-template-table {
    background: linear-gradient(180deg, rgba(201, 226, 101, 0.07), rgba(255, 255, 255, 0.98))
      !important;
  }

  .invoice-sheet-download .executive-template-totals {
    background: linear-gradient(180deg, rgba(201, 226, 101, 0.12), rgba(201, 226, 101, 0.05))
      !important;
  }

  .invoice-sheet-download .studio-template-party-card {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 251, 255, 0.98)),
      #ffffff !important;
  }

  .invoice-sheet-download .studio-template-table {
    background: linear-gradient(180deg, rgba(109, 193, 246, 0.06), rgba(255, 255, 255, 0.98))
      !important;
  }

  .invoice-sheet-download .studio-template-main {
    gap: 28px !important;
  }

  .invoice-sheet-download .studio-template-bottom {
    margin-top: 28px !important;
    gap: 28px !important;
  }

  .invoice-sheet-download .studio-template-totals {
    background: linear-gradient(180deg, rgba(109, 193, 246, 0.08), rgba(109, 193, 246, 0.03))
      !important;
  }

  .invoice-sheet-download .executive-template-party-card::before,
  .invoice-sheet-download .studio-template-party-card::before {
    display: none !important;
  }

  .invoice-topline {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 16px !important;
  }

  .invoice-company {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  .sample-meta {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 24px !important;
    align-items: start !important;
  }

  .invoice-meta-stack,
  .invoice-meta-row,
  .invoice-number-block {
    align-items: flex-end !important;
    justify-self: end !important;
    text-align: right !important;
  }

  .invoice-meta-row .invoice-status-chip {
    align-self: flex-end !important;
  }

  .invoice-table {
    break-inside: auto;
    page-break-inside: auto;
  }

  .invoice-table thead {
    display: table-header-group;
  }

  .invoice-table tbody {
    display: table-row-group;
  }

  .invoice-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .invoice-download-target {
    width: 100%;
    margin: 0;
  }

  .invoice-sheet {
    max-width: none;
    overflow: visible !important;
    box-shadow: none !important;
    border: 1px solid rgba(143, 166, 186, 0.28) !important;
    border-radius: var(--radius) !important;
    padding: 26px !important;
    background: var(--panel) !important;
    width: calc(100% - 2px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .invoice-generated-footer {
    margin-top: 22px !important;
    padding-top: 12px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 12px !important;
    font-size: 0.8rem !important;
  }

  .invoice-generated-footer p {
    white-space: nowrap !important;
  }

  .invoice-generated-footer-brand {
    justify-self: end !important;
  }

  .invoice-generated-footer-brand img {
    width: 26px !important;
    height: 26px !important;
    image-rendering: auto !important;
    filter: none !important;
  }

  img.rapid-template-logo,
  img.sample-logo {
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  .invoice-company .sample-logo {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  img.rapid-template-logo {
    width: 60px !important;
    height: 60px !important;
    object-fit: contain !important;
    border-radius: 0 !important;
  }
}

@media (max-width: 720px) {
  body.hub-page.is-page-scrolled .topbar {
    /* Stay sticky on scroll — do NOT switch to position:fixed.
       Fixed removes the topbar from document flow, shrinking the page height by
       ~77px. On short pages (e.g. the accounting Dashboard tab) the content then
       fits the viewport, so the browser clamps scroll back to 0. That removes the
       is-page-scrolled class, the topbar returns to flow, the page grows again, and
       the loop repeats — the "scrolls but always jumps to top" bug.
       The base mobile topbar is already sticky + full-bleed via negative margins,
       so keeping it sticky preserves the look without collapsing page height. */
    position: sticky;
    top: 0;
  }

  body.hub-page .topbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 72px;
    overflow: visible;
    container-type: inline-size;
    container-name: hub-topbar;
  }

  body.hub-page .brand-link {
    flex: 1 1 auto;
    min-width: 0;
    text-decoration: none;
  }

  body.hub-page .brand-lockup {
    gap: 10px;
    min-width: 0;
  }

  body.hub-page .brand-logo-image {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  body.hub-page .brand-copy {
    min-width: 0;
    gap: 0;
  }

  body.hub-page .brand-title-row {
    display: block;
    min-width: 0;
  }

  body.hub-page .brand-title {
    display: block;
    overflow: hidden;
    color: var(--ink);
    font-size: 1.05rem;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.hub-page .brand-badge,
  body.hub-page .brand-subtitle {
    display: none;
  }

  body.hub-page .topbar-actions {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
  }

  body.hub-page .topbar-actions a,
  body.hub-page .topbar-actions button {
    width: auto;
    min-height: 40px;
    padding: 9px 12px;
    white-space: nowrap;
  }

  body.hub-page .topbar-action {
    min-width: 40px;
    padding: 0 10px;
  }

  body.hub-page .topbar-right {
    gap: 8px;
  }

  body.hub-page .topbar-action-label {
    display: none;
  }

  body.hub-page .notification-bell {
    width: 44px;
    min-width: 44px;
    min-height: 40px;
  }

  body.hub-page .notification-center {
    position: relative;
    z-index: 9999;
    overflow: visible;
  }

  body.hub-page .notification-panel {
    position: fixed;
    top: 64px;
    right: 8px;
    width: min(420px, calc(100vw - 16px));
    max-height: calc(100dvh - 84px);
  }

  body.hub-page .notification-indicator-dot {
    top: 0;
    right: 0;
    width: 12px;
    height: 12px;
  }

body.hub-page.is-native-mobile-app .topbar {
  padding-top: calc(44px + env(safe-area-inset-top, 0px));
  min-height: calc(112px + env(safe-area-inset-top, 0px));
}

  body.hub-page.is-native-mobile-app .topbar-right {
    transform: translateY(4px);
  }

body.hub-page.is-native-mobile-app .notification-panel {
  top: calc(112px + env(safe-area-inset-top, 0px));
  max-height: calc(100dvh - 132px - env(safe-area-inset-top, 0px));
}

body.invoice.is-native-mobile-app .topbar {
  padding-top: calc(78px + env(safe-area-inset-top, 0px));
  min-height: calc(160px + env(safe-area-inset-top, 0px));
}

body.invoice.is-native-mobile-app .topbar-right {
  transform: none;
}

body.invoice.is-native-mobile-app .shell {
  padding-top: calc(24px + env(safe-area-inset-top, 0px));
}

body.invoice.is-native-mobile-app .invoice-page {
  padding-top: 44px;
}

body.invoice.is-native-mobile-app .invoice-page-sidebar {
  margin-top: 20px;
  padding-top: 16px;
}

body.invoice.is-native-mobile-app .invoice-page-sidebar .ghost-button,
body.invoice.is-native-mobile-app .invoice-page-sidebar .primary-button,
body.invoice.is-native-mobile-app .invoice-page-sidebar .danger-button {
  width: 100%;
  min-height: 44px;
  justify-content: center;
}

body.invoice.is-native-mobile-app .invoice-page-sidebar .ghost-button + .ghost-button,
body.invoice.is-native-mobile-app .invoice-page-sidebar .primary-button + .ghost-button,
body.invoice.is-native-mobile-app .invoice-page-sidebar .ghost-button + .primary-button {
  margin-top: 10px;
}

body.invoice.is-native-mobile-app .invoice-page-sidebar h2,
body.invoice.is-native-mobile-app .invoice-page-sidebar p {
  word-break: break-word;
}

.hub-sidebar .brand-logo-image {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  }

  .hub-sidebar .brand-title {
    font-size: 1.06rem;
  }

  .hub-sidebar-tagline {
    display: block;
  }
}

@container hub-topbar (min-width: 470px) {
  body.hub-page .topbar-action-label {
    display: inline-flex;
  }

  body.hub-page .topbar-action {
    min-width: auto;
    padding: 9px 12px;
  }
}

/* ── Hub sidebar chat badge ─────────────────────────────────────────────────── */
.hub-nav-chat-label {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hub-nav-chat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--error);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
}

/* ── Chat page — full-height shell override ─────────────────────────────────── */
body.chat-page .shell {
  max-width: 100%;
  padding: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.chat-page .topbar {
  padding: 0 28px;
  margin: 0;
  position: relative;
  z-index: 1200;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
  overflow: visible;
}
body.chat-page .toast-stack {
  position: fixed;
}
.chat-app-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  background: var(--bg);
}
.chat-app {
  display: contents;
}
/* Mobile-only controls — hidden on desktop/tablet */
.chat-mobile-menu-btn,
.chat-sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  transition: color 0.12s, background 0.12s;
}
.chat-mobile-menu-btn:hover,
.chat-sidebar-close-btn:hover {
  color: var(--ink);
  background: var(--panel-muted);
}
.chat-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 32, 48, 0.42);
  z-index: 35;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.chat-drawer-backdrop[hidden] {
  display: none;
}
.chat-drawer-backdrop.is-visible {
  opacity: 1;
}

/* ── Chat Sidebar ───────────────────────────────────────────────────────────── */
.chat-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  color: var(--ink);
  height: 100%;
  overflow: hidden;
  border-right: 1px solid var(--line);
}
.chat-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.chat-sidebar-workspace {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-sidebar-workspace::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-dark);
  flex-shrink: 0;
}
.chat-sidebar-workspace[data-presence-status="online"]::before {
  background: #a6df42;
  box-shadow: 0 0 0 4px rgba(166, 223, 66, 0.16);
}
.chat-sidebar-workspace[data-presence-status="away"]::before {
  background: #f4b942;
  box-shadow: 0 0 0 4px rgba(244, 185, 66, 0.14);
}
.chat-sidebar-workspace[data-presence-status="offline"]::before {
  background: rgba(183, 200, 214, 0.62);
  box-shadow: 0 0 0 4px rgba(183, 200, 214, 0.08);
}
.chat-sidebar-presence-label {
  display: none;
}
.chat-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.chat-sidebar-section {
  margin-bottom: 8px;
}
.chat-sidebar-section-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 8px 2px 14px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.4);
  cursor: default;
  user-select: none;
}
.chat-sidebar-section-hd:hover {
  color: rgba(255,255,255,0.65);
}
.chat-sidebar-add-btn {
  width: 18px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.4);
  padding: 0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: color 0.15s;
}
.chat-sidebar-add-btn:hover {
  color: #ffffff;
}
.chat-sidebar-add-btn:focus-visible {
  outline: 2px solid rgba(124, 200, 244, 0.9);
  outline-offset: 2px;
}
/* Sidebar item wrappers — channel and DM rows */
.chat-ch-item-wrap,
.chat-dm-item-wrap {
  display: flex;
  align-items: center;
  position: relative;
}
.chat-ch-item-wrap.is-active,
.chat-dm-item-wrap.is-active {
  background: var(--accent-soft);
  border-right: 2px solid var(--accent-dark);
}
.chat-ch-item-wrap:hover .chat-sidebar-item-actions,
.chat-dm-item-wrap:hover .chat-sidebar-item-actions {
  opacity: 1;
}
.chat-ch-item-wrap.is-active .chat-sidebar-item-actions,
.chat-dm-item-wrap.is-active .chat-sidebar-item-actions {
  opacity: 1;
}
.chat-sidebar-item-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 6px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.12s;
}
.chat-sidebar-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  width: 24px;
  height: 24px;
  border-radius: 5px;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
  flex-shrink: 0;
}
.chat-sidebar-icon-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.15);
}
/* Sidebar popover */
.chat-sidebar-popover-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1490;
}
.chat-sidebar-popover {
  position: fixed;
  z-index: 1500;
  background: var(--panel, #fff);
  border: 1px solid var(--line, rgba(0,0,0,0.1));
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.16);
  min-width: 200px;
  padding: 6px 0;
  overflow: hidden;
}
.chat-sidebar-popover-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 10px 16px;
  font-size: 0.88rem;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.1s;
}
.chat-sidebar-popover-item:hover {
  background: var(--panel-muted);
}
.chat-sidebar-popover-item.is-danger {
  color: var(--danger, #e53e3e);
}
.chat-sidebar-popover-divider {
  height: 1px;
  background: var(--line, rgba(0,0,0,0.08));
  margin: 4px 0;
}
/* Channel member management modal */
.chat-channel-members-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2100;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-channel-members-modal {
  background: var(--panel, #fff);
  border-radius: 14px;
  width: min(480px, 92vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.22);
}
.chat-channel-members-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  font-weight: 700;
  font-size: 1rem;
  border-bottom: 1px solid var(--line);
}
.chat-channel-members-modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--muted);
  padding: 0 4px;
  line-height: 1;
}
.chat-channel-members-modal-body {
  overflow-y: auto;
  padding: 12px 0;
  flex: 1;
}
.chat-channel-members-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 8px 20px 4px;
}
.chat-channel-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 20px;
  gap: 10px;
}
.chat-channel-member-name {
  flex: 1;
  font-size: 0.9rem;
}
.chat-channel-member-remove {
  background: rgba(229,62,62,0.1);
  border: none;
  color: #c53030;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s;
}
.chat-channel-member-remove:hover { background: rgba(229,62,62,0.2); }
.chat-channel-member-remove.is-loading,
.chat-channel-member-add.is-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}
.chat-channel-member-remove.is-loading::before,
.chat-channel-member-add.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.75s linear infinite;
}
.chat-channel-member-remove.is-loading::before {
  color: #c53030;
}
.chat-channel-member-add {
  background: rgba(60,181,74,0.1);
  border: none;
  color: #2a7d34;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s;
}
.chat-channel-member-add:hover { background: rgba(60,181,74,0.2); }
.chat-channel-member-add.is-loading::before {
  color: #2a7d34;
}
.tx-sheet-item-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 1px;
}
.chat-ch-item,
.chat-dm-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 6px 5px 14px;
  font-size: 0.87rem;
  color: var(--muted);
  text-decoration: none;
  border-radius: 0;
  transition: background 0.1s, color 0.1s;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}
.chat-ch-item:hover,
.chat-dm-item:hover {
  background: var(--accent-soft);
  color: var(--ink);
}
.chat-ch-item-wrap.is-active .chat-ch-item,
.chat-dm-item-wrap.is-active .chat-dm-item {
  color: var(--navy);
  font-weight: 700;
}
.chat-ch-item.is-active,
.chat-dm-item.is-active {
  background: var(--accent-soft);
  color: var(--navy);
  font-weight: 700;
  border-right: 2px solid var(--accent-dark);
}
.chat-ch-icon {
  font-size: 0.82rem;
  color: var(--muted);
  flex-shrink: 0;
  width: 14px;
  text-align: center;
}
.chat-ch-item.is-active .chat-ch-icon {
  color: var(--accent-dark);
}
.chat-ch-name,
.chat-dm-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-ch-badge {
  background: var(--error);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  border-radius: 8px;
  padding: 1px 5px;
  min-width: 16px;
  text-align: center;
  flex-shrink: 0;
}
.chat-dm-avi {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-dm-avi-wrap,
.chat-member-avi-wrap {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}
.chat-presence-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border: 2px solid #14324a;
  border-radius: 999px;
  background: rgba(183, 200, 214, 0.78);
}
[data-presence-status="online"] .chat-presence-dot,
.chat-presence-dot[data-presence-status="online"] {
  background: #a6df42;
}
[data-presence-status="away"] .chat-presence-dot,
.chat-presence-dot[data-presence-status="away"] {
  background: #f4b942;
}
[data-presence-status="offline"] .chat-presence-dot,
.chat-presence-dot[data-presence-status="offline"] {
  background: rgba(183, 200, 214, 0.78);
}
.chat-ch-divider {
  height: 1px;
  background: var(--line);
  margin: 6px 14px;
}

/* ── Chat Main ──────────────────────────────────────────────────────────────── */
.chat-main {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}
.chat-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  background: var(--panel);
}
.chat-main-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-main-header-icon {
  font-size: 1rem;
  color: var(--muted);
}
.chat-main-header-icon--voice {
  color: var(--navy);
}
.chat-main-header-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}
.chat-main-header-desc {
  font-size: 0.78rem;
  color: var(--muted);
  padding-left: 4px;
  border-left: 1px solid var(--line-strong);
  margin-left: 4px;
}
.chat-main-header-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.chat-members-toggle-btn {
  font-size: 0.82rem;
  gap: 5px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
}

.chat-call-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(183, 227, 92, 0.18);
  color: var(--navy);
  font-size: 0.74rem;
  font-weight: 850;
  white-space: nowrap;
}

.chat-call-busy-pill {
  background: rgba(248, 219, 219, 0.9);
  color: var(--error);
  box-shadow: 0 8px 18px rgba(183, 93, 93, 0.08);
}

.chat-call-btn,
.chat-call-hangup-btn {
  min-height: 42px;
  gap: 6px;
  padding: 0 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.chat-call-btn {
  color: #18364f;
  border-color: rgba(147, 185, 220, 0.42);
  background: linear-gradient(135deg, #dbe9a7 0%, #c5ebb8 32%, #8fd5ff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 12px 24px rgba(88, 145, 188, 0.18);
}

.chat-call-btn:hover,
.chat-call-btn:focus-visible {
  transform: translateY(-1px);
  filter: saturate(1.04) brightness(1.01);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 16px 28px rgba(88, 145, 188, 0.22);
}

.chat-call-overlay {
  position: fixed;
  top: 70px;
  right: 16px;
  z-index: 1400;
  width: min(460px, calc(100vw - 32px));
  pointer-events: none;
}

.chat-call-overlay[hidden] {
  display: none !important;
}

.chat-call-backdrop {
  display: none;
}

.chat-call-overlay[data-call-mode="incoming"] .chat-call-sheet {
  animation: chat-call-sheet-ring 1.8s ease-in-out infinite;
}

.chat-call-overlay[data-call-mode="incoming"] .chat-call-sheet-avatar,
.chat-call-dock[data-call-mode="incoming"] .chat-call-dock-avatar,
.chat-call-btn[data-call-state="incoming"]::before {
  animation: chat-call-avatar-bob 1.2s ease-in-out infinite;
  transform-origin: 50% 60%;
}

.chat-call-overlay[data-call-mode="incoming"] .chat-call-sheet-status,
.chat-call-dock[data-call-mode="incoming"] {
  animation: chat-call-badge-pulse 1.6s ease-in-out infinite;
}

.chat-call-shell {
  position: relative;
  width: 100%;
  pointer-events: none;
}

.chat-call-sheet {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  grid-template-areas:
    "header header"
    "copy copy"
    "actions actions";
  gap: 12px 16px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.99);
  color: var(--ink);
  border: 1px solid rgba(143, 166, 186, 0.2);
  backdrop-filter: blur(18px) saturate(135%);
  box-shadow: 0 24px 60px rgba(64, 80, 96, 0.16), 0 8px 20px rgba(124, 200, 244, 0.08);
  pointer-events: auto;
}

.chat-call-sheet-header {
  grid-area: header;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.chat-call-sheet-avatar {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 900;
  background: linear-gradient(135deg, #18364f, #244a67);
  box-shadow: 0 12px 22px rgba(24, 54, 79, 0.16);
}

.chat-call-minimize-btn {
  border: 1px solid rgba(143, 166, 186, 0.32);
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(34, 58, 80, 0.05);
}

.chat-call-minimize-btn:hover,
.chat-call-minimize-btn:focus-visible {
  color: var(--ink);
  background: #fff;
  border-color: rgba(143, 166, 186, 0.45);
}

.chat-call-sheet-copy {
  grid-area: copy;
  display: grid;
  gap: 4px;
  align-content: start;
}

.chat-call-sheet-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #728195;
  font-weight: 850;
}

.chat-call-sheet-title {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.chat-call-sheet-body {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.chat-call-sheet-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  width: fit-content;
  padding: 0 10px;
  margin-top: 4px;
  border-radius: 999px;
  background: rgba(183, 227, 92, 0.14);
  color: var(--navy);
  font-size: 0.74rem;
  font-weight: 850;
}

.chat-call-peer-mute-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 4px 10px;
  margin-top: 6px;
  border-radius: 999px;
  background: rgba(255, 180, 0, 0.12);
  border: 1px solid rgba(255, 180, 0, 0.28);
  color: #7a4f00;
  font-size: 0.74rem;
  font-weight: 700;
}

.chat-call-sheet-actions {
  grid-area: actions;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 4px;
}

.chat-call-action-stack {
  display: none;
  justify-items: center;
  gap: 6px;
}

.chat-call-action-label {
  font-size: 0.7rem;
  line-height: 1;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #627386;
}

.chat-call-primary-btn,
.chat-call-mute-btn {
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid rgba(147, 185, 220, 0.42);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.98rem;
  font-weight: 850;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
  color: #18364f;
  background: linear-gradient(135deg, #dbe9a7 0%, #c5ebb8 32%, #8fd5ff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 12px 24px rgba(88, 145, 188, 0.18);
}

.chat-call-icon {
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}

.chat-call-icon--inline {
  width: 18px;
  height: 18px;
}

.chat-call-icon--button {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.chat-call-icon--bubble {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.chat-call-primary-btn:hover,
.chat-call-primary-btn:focus-visible,
.chat-call-mute-btn:hover,
.chat-call-mute-btn:focus-visible {
  transform: translateY(-1px);
  filter: saturate(1.04) brightness(1.01);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 16px 28px rgba(88, 145, 188, 0.22);
}

/* Icon-only circular accept / reject / hangup buttons */
.chat-call-accept-btn,
.chat-call-reject-btn,
.chat-call-hangup-btn {
  width: 64px;
  height: 64px;
  min-height: unset;
  padding: 0;
  border-radius: 50%;
  border: none;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

button[data-call-hangup] {
  width: 64px;
  height: 64px;
  min-height: unset;
  padding: 0;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: transparent;
}

button[data-call-hangup] .chat-call-icon--button {
  width: 100%;
  height: 100%;
}

.chat-call-accept-btn {
  background: #3cb54a;
  color: #fff;
  box-shadow: 0 8px 22px rgba(60, 181, 74, 0.45);
}

.chat-call-reject-btn,
.chat-call-hangup-btn {
  background: #f04e5a;
  color: #fff;
  box-shadow: 0 8px 22px rgba(240, 78, 90, 0.45);
}

.chat-call-accept-btn:hover,
.chat-call-accept-btn:focus-visible {
  transform: scale(1.06);
  filter: brightness(1.05);
  box-shadow: 0 10px 28px rgba(60, 181, 74, 0.55);
}

.chat-call-overlay[data-call-mode="incoming"] .chat-call-accept-btn,
.chat-call-dock[data-call-mode="incoming"] .chat-call-dock-action-primary {
  animation: chat-call-answer-pulse 1.35s ease-in-out infinite;
}

.chat-call-overlay[data-call-mode="incoming"] .chat-call-reject-btn {
  animation: chat-call-decline-pulse 1.65s ease-in-out infinite;
}

.chat-call-overlay[data-call-mode="incoming"] .chat-call-action-label {
  animation: chat-call-label-fade 1.8s ease-in-out infinite;
}

.chat-call-overlay[data-call-mode="incoming"] .chat-call-action-stack {
  display: grid;
}

.chat-call-reject-btn:hover,
.chat-call-reject-btn:focus-visible,
.chat-call-hangup-btn:hover,
.chat-call-hangup-btn:focus-visible {
  transform: scale(1.06);
  filter: brightness(1.05);
  box-shadow: 0 10px 28px rgba(240, 78, 90, 0.55);
}

/* Primary/mute ::before icon (kept for those text buttons) */
.chat-call-btn::before,
.chat-call-primary-btn::before {
  content: none;
  display: none;
}

@keyframes chat-call-answer-pulse {
  0%,
  100% {
    box-shadow: 0 8px 22px rgba(60, 181, 74, 0.45), 0 0 0 0 rgba(60, 181, 74, 0.22);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 10px 28px rgba(60, 181, 74, 0.58), 0 0 0 14px rgba(60, 181, 74, 0);
    transform: scale(1.05);
  }
}

@keyframes chat-call-decline-pulse {
  0%,
  100% {
    box-shadow: 0 8px 22px rgba(240, 78, 90, 0.45), 0 0 0 0 rgba(240, 78, 90, 0.16);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 10px 28px rgba(240, 78, 90, 0.58), 0 0 0 12px rgba(240, 78, 90, 0);
    transform: scale(1.04);
  }
}

@keyframes chat-call-label-fade {
  0%,
  100% {
    opacity: 0.82;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-1px);
  }
}

/* Floating call bubble — replaces the old wide dock card */
.chat-call-dock {
  position: fixed;
  bottom: 28px;
  right: 22px;
  z-index: 1450;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.chat-call-dock[hidden] {
  display: none !important;
}

.chat-call-dock > * {
  pointer-events: auto;
}

.chat-call-dock-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Main bubble — the central phone icon circle */
.chat-call-dock-bubble-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #3cb54a;
  border: none;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 28px rgba(60, 181, 74, 0.5);
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.chat-call-dock-bubble-btn:hover,
.chat-call-dock-bubble-btn:focus-visible {
  transform: scale(1.06);
  box-shadow: 0 10px 32px rgba(60, 181, 74, 0.62);
}

/* Pulse ring for incoming / outgoing */
.chat-call-dock[data-call-mode="incoming"] .chat-call-dock-bubble-btn,
.chat-call-dock[data-call-mode="outgoing"] .chat-call-dock-bubble-btn {
  animation: dock-bubble-ring 1.4s ease-in-out infinite;
}

/* Slower, gentle pulse for active call in dock */
.chat-call-dock[data-call-mode="active"] .chat-call-dock-bubble-btn {
  animation: dock-bubble-active 3s ease-in-out infinite;
}

@keyframes dock-bubble-active {
  0%, 100% { box-shadow: 0 8px 28px rgba(60,181,74,0.5), 0 0 0 0 rgba(60,181,74,0.25); }
  50%       { box-shadow: 0 8px 28px rgba(60,181,74,0.5), 0 0 0 12px rgba(60,181,74,0); }
}

/* Small action buttons around the bubble */
.chat-call-dock-action {
  width: 52px;
  height: 52px;
  min-height: unset;
  padding: 0;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
  flex-shrink: 0;
}

.chat-call-dock-action:hover,
.chat-call-dock-action:focus-visible {
  transform: scale(1.08);
}

.chat-call-dock-action-primary {
  background: #3cb54a;
  color: #fff;
  box-shadow: 0 6px 18px rgba(60, 181, 74, 0.45);
}

.chat-call-dock-action-primary:hover,
.chat-call-dock-action-primary:focus-visible {
  filter: brightness(1.06);
  box-shadow: 0 8px 22px rgba(60, 181, 74, 0.55);
}

.chat-call-dock-action-danger {
  background: #f04e5a;
  color: #fff;
  box-shadow: 0 6px 18px rgba(240, 78, 90, 0.45);
}

.chat-call-dock-action-danger:hover,
.chat-call-dock-action-danger:focus-visible {
  filter: brightness(1.06);
  box-shadow: 0 8px 22px rgba(240, 78, 90, 0.55);
}

/* Small label showing who the call is with */
.chat-call-dock-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  background: rgba(10, 20, 30, 0.62);
  padding: 4px 11px;
  border-radius: 999px;
  max-width: 200px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  backdrop-filter: blur(10px);
  pointer-events: none;
  letter-spacing: 0.01em;
}

.chat-call-dock-label:empty {
  display: none;
}

/* Live green dot before the label in active-call dock */
.chat-call-dock[data-call-mode="active"] .chat-call-dock-label::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6ef07a;
  margin-right: 6px;
  vertical-align: middle;
  animation: dock-live-dot 1.8s ease-in-out infinite;
}

@keyframes dock-live-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes dock-bubble-ring {
  0%, 100% {
    box-shadow: 0 8px 28px rgba(60, 181, 74, 0.5), 0 0 0 0 rgba(60, 181, 74, 0.38);
  }
  55% {
    box-shadow: 0 8px 28px rgba(60, 181, 74, 0.5), 0 0 0 16px rgba(60, 181, 74, 0);
  }
}

@media (max-width: 560px) {
  .chat-call-overlay {
    top: 72px;
    right: 12px;
    width: calc(100vw - 24px);
  }

  .chat-call-sheet {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "copy"
      "actions";
    padding: 20px;
  }

  .chat-call-sheet-header {
    width: 100%;
  }

  .chat-call-sheet-avatar {
    width: 54px;
    height: 54px;
  }

  .chat-call-sheet-actions {
    justify-content: center;
    gap: 16px;
  }

  .chat-call-dock {
    bottom: 20px;
    right: 16px;
  }
}

@keyframes chat-call-sheet-ring {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 24px 60px rgba(64, 80, 96, 0.16), 0 8px 20px rgba(124, 200, 244, 0.08);
  }
  35% {
    transform: translateY(-2px) scale(1.008);
    box-shadow: 0 28px 68px rgba(64, 80, 96, 0.2), 0 0 0 8px rgba(143, 213, 255, 0.1);
  }
  70% {
    transform: translateY(0) scale(0.998);
    box-shadow: 0 24px 60px rgba(64, 80, 96, 0.16), 0 0 0 16px rgba(183, 227, 92, 0.06);
  }
}

@keyframes chat-call-avatar-bob {
  0%, 100% {
    transform: rotate(0deg) translateY(0);
  }
  20% {
    transform: rotate(-10deg) translateY(-1px);
  }
  50% {
    transform: rotate(8deg) translateY(0);
  }
  80% {
    transform: rotate(-6deg) translateY(-1px);
  }
}

@keyframes chat-call-badge-pulse {
  0%, 100% {
    box-shadow: 0 18px 40px rgba(16, 32, 48, 0.18);
    filter: saturate(1);
  }
  50% {
    box-shadow: 0 22px 48px rgba(16, 32, 48, 0.2), 0 0 0 8px rgba(143, 213, 255, 0.12);
    filter: saturate(1.05);
  }
}

.chat-delete-channel-btn {
  min-height: 38px;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 999px;
  color: #9f2f3b;
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(204, 74, 88, 0.2);
  box-shadow: 0 8px 18px rgba(34, 58, 80, 0.05);
}

.chat-delete-channel-btn:hover,
.chat-delete-channel-btn:focus-visible {
  color: #ffffff;
  background: linear-gradient(135deg, #9f2f3b, #c24c5a);
  border-color: rgba(159, 47, 59, 0.42);
}

/* ── Messages ───────────────────────────────────────────────────────────────── */
.chat-messages-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
/* ── Upgrade modal ───────────────────────────────────────────────────────── */
.upgrade-modal-dialog {
  border: none;
  border-radius: var(--radius-lg, 12px);
  padding: 0;
  max-width: 420px;
  width: calc(100% - 2rem);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  background: var(--color-surface, #fff);
}
.upgrade-modal-dialog::backdrop {
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
}
.upgrade-modal-inner {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  position: relative;
}
.upgrade-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm, 4px);
}
.upgrade-modal-close:hover { background: var(--color-hover); }
.upgrade-modal-icon { font-size: 2.5rem; line-height: 1; }
.upgrade-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}
.upgrade-modal-body {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.5;
}
.upgrade-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.5rem;
}
.upgrade-modal-cta {
  width: 100%;
  text-align: center;
  text-decoration: none;
}
.upgrade-modal-cancel { width: 100%; }

.chat-retention-banner {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  background: var(--color-surface-raised, #f5f5f5);
  border-bottom: 1px solid var(--color-border);
  padding: 6px 16px;
  text-align: center;
}
.chat-retention-upgrade {
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: none;
}
.chat-retention-upgrade:hover {
  text-decoration: underline;
}

.chat-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 8px;
  color: var(--muted);
  padding: 40px 20px;
  text-align: center;
}
.chat-empty-icon {
  font-size: 3rem;
  opacity: 0.25;
  line-height: 1;
}
.chat-empty-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
}
.chat-empty-body {
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 300px;
}
.chat-msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  position: relative;
  transition: background 0.1s;
}
.chat-msg.is-own {
  margin-left: auto;
  flex-direction: row-reverse;
  text-align: right;
}
.chat-msg.is-own .chat-msg-meta {
  justify-content: flex-end;
}
.chat-msg.is-own .chat-msg-body {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.chat-msg.is-own .chat-msg-bubble-row {
  flex-direction: row-reverse;
}
.chat-msg:hover {
  background: none;
}
.chat-msg:hover .chat-msg-actions {
  opacity: 1;
  pointer-events: auto;
}
.chat-msg.is-pending {
  opacity: 0.72;
}
.chat-msg-left {
  flex-shrink: 0;
  padding-top: 2px;
}
.chat-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.chat-msg-avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 8px 18px rgba(29, 58, 84, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.chat-msg-body {
  flex: 1;
  min-width: 0;
}
.chat-msg-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}
.chat-msg-author {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
}
.chat-msg-time {
  font-size: 0.73rem;
  color: var(--muted);
}
.chat-msg-edited {
  font-size: 0.73rem;
  color: var(--muted);
  font-style: italic;
}
.chat-msg-status {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.chat-msg-status--delivered {
  color: #6b7280;
}
.chat-msg-status--read {
  color: #2f7dd1;
}
.chat-msg-text {
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
  background: #ffffff;
  border-radius: 4px 14px 14px 14px;
  padding: 8px 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.07);
  width: fit-content;
  max-width: 100%;
  transition: filter 0.1s;
}
.chat-msg.is-own .chat-msg-text {
  background: #d9e87a;
  border-radius: 14px 4px 14px 14px;
  color: #2a3a08;
}
.chat-msg:hover .chat-msg-text {
  filter: brightness(0.96);
}
.chat-msg-caption {
  margin-top: 6px;
  font-size: 0.83rem;
  line-height: 1.35;
  color: #506074;
  background: none;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
}
.chat-msg-text-empty {
  min-height: 0;
  background: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  width: 0;
  height: 0;
  overflow: hidden;
}
.chat-msg-attachments {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}
.chat-msg.is-own .chat-msg-attachments {
  justify-items: end;
}
.chat-attachment-card {
  border: 1px solid rgba(140, 165, 188, 0.28);
  border-radius: 16px;
  background: rgba(248, 251, 255, 0.96);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.chat-msg.is-own .chat-attachment-card {
  width: min(100%, 520px);
}
.chat-attachment-card.is-draft {
  background: rgba(241, 247, 255, 0.92);
  border-style: dashed;
}
.chat-attachment-image-link {
  display: block;
}
.chat-attachment-image {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
}
.chat-attachment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}
.chat-attachment-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.chat-attachment-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-attachment-kind {
  font-size: 0.76rem;
  color: var(--muted);
}
.chat-attachment-download,
.chat-attachment-remove {
  border: none;
  background: var(--accent-soft);
  color: var(--navy);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.chat-attachment-download-disabled {
  background: rgba(140, 165, 188, 0.16);
  color: var(--muted);
}
.chat-attachment-remove {
  background: rgba(255, 102, 102, 0.14);
  color: #a32828;
}
.chat-attachment-file-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  background: var(--doc-color, #64748b);
  background-image: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 60%);
  color: #fff;
}
.chat-attachment-file-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  opacity: 0.92;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.18));
}
.chat-attachment-file-ext {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  opacity: 0.96;
  text-shadow: 0 1px 3px rgba(0,0,0,0.22);
}
.chat-url-image-card {
  max-width: 380px;
}
img[data-url-preview] {
  max-height: 320px;
  object-fit: contain;
  background: #f0f4f8;
}
img[data-url-preview].is-broken {
  display: none;
}
.chat-msg-text.is-editing {
  display: none;
}
.chat-mention {
  color: var(--navy-soft);
  background: rgba(47, 95, 122, 0.1);
  border-radius: 3px;
  padding: 0 3px;
  font-weight: 600;
}
.chat-msg-bubble-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.chat-msg-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.chat-msg.is-own .chat-msg-content {
  align-items: flex-end;
}
.chat-msg-actions {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
  align-self: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
/* Reaction quick picker */
.chat-reaction-picker {
  position: fixed;
  z-index: 2000;
  display: flex;
  gap: 4px;
  padding: 6px 8px;
  background: var(--panel, #fff);
  border: 1px solid var(--line, rgba(0,0,0,0.1));
  border-radius: 999px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.14);
}
.chat-reaction-picker-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  padding: 4px;
  border-radius: 50%;
  transition: transform 0.12s, background 0.12s;
}
.chat-reaction-picker-btn:hover {
  background: rgba(0,0,0,0.06);
  transform: scale(1.3);
}
/* Reaction pills on messages */
.chat-msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}
.chat-reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0,0,0,0.05);
  border: 1.5px solid transparent;
  border-radius: 999px;
  padding: 2px 8px 2px 5px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  line-height: 1.4;
}
.chat-reaction-pill span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
}
.chat-reaction-pill:hover {
  background: rgba(0,0,0,0.09);
}
.chat-reaction-pill.is-own {
  background: rgba(60, 181, 74, 0.12);
  border-color: rgba(60, 181, 74, 0.45);
}
.chat-reaction-pill.is-own span {
  color: #2a8a37;
}
/* Who-reacted popover */
.chat-who-reacted {
  position: fixed;
  z-index: 3000;
  background: var(--panel, #fff);
  border: 1px solid var(--line, rgba(0,0,0,0.1));
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.15);
  min-width: 200px;
  max-width: 280px;
  overflow: hidden;
}
.chat-who-reacted.is-loading {
  min-width: 180px;
}
.chat-who-reacted-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  font-size: 0.84rem;
  color: var(--muted);
}
.chat-who-reacted-spinner {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(124, 143, 191, 0.28);
  border-top-color: var(--navy-soft, #4f6ea8);
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
.chat-who-reacted-tabs {
  display: flex;
  border-bottom: 1px solid var(--line, rgba(0,0,0,0.08));
  padding: 0 8px;
  gap: 2px;
  background: var(--panel-muted, #f7f7f7);
}
.chat-who-reacted-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 0.82rem;
  padding: 8px 10px 6px;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.12s;
}
.chat-who-reacted-tab.is-active {
  color: var(--ink);
  border-bottom-color: var(--lime-dark, #c4d063);
  font-weight: 600;
}
.chat-who-reacted-list {
  padding: 6px 0;
  max-height: 200px;
  overflow-y: auto;
}
.chat-who-reacted-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
}
.chat-who-reacted-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.chat-who-reacted-name {
  font-size: 0.88rem;
  color: var(--ink);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-who-reacted-remove {
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  background: none;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.chat-who-reacted-remove:hover {
  background: rgba(220, 38, 38, 0.07);
  border-color: rgba(220, 38, 38, 0.35);
  color: #dc2626;
}
.chat-msg-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color 0.12s, background 0.12s;
}
.chat-msg-action-btn:hover {
  color: var(--ink);
  background: var(--panel-muted);
}
.chat-msg-action-delete:hover {
  color: var(--danger);
}
.chat-msg-edit-input {
  width: 100%;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 6px 10px;
  background: var(--panel);
  resize: none;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}
.chat-msg-edit-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  font-size: 0.78rem;
}
.chat-msg-edit-actions button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 2px 6px;
  border-radius: 4px;
}
.chat-msg-edit-actions button:hover { color: var(--ink); }
.chat-msg-edit-actions .save-edit { color: var(--navy-soft); font-weight: 600; }
.chat-typing-bar {
  padding: 5px 20px 7px;
  font-size: 0.78rem;
  color: var(--muted);
  min-height: 22px;
  flex-shrink: 0;
}

.chat-typing-bar:not([hidden]) {
  color: var(--navy);
  font-weight: 750;
}

.chat-typing-bar:not([hidden])::after {
  content: "";
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: chat-typing-dots 1.2s steps(4, end) infinite;
}

@keyframes chat-typing-dots {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75%,
  100% {
    content: "...";
  }
}

/* ── Composer ───────────────────────────────────────────────────────────────── */
.chat-composer {
  padding: 10px 16px 14px;
  flex-shrink: 0;
  position: relative;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.chat-composer-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.chat-composer-icons {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  padding-bottom: 4px;
}
.chat-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.chat-icon-btn:hover {
  background: var(--accent-soft);
  color: var(--navy);
}
.chat-premium-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4eb77, #67c6ff);
  border: 1.5px solid var(--panel);
  pointer-events: none;
}
.chat-composer-input-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-input {
  width: 100%;
  border: 1.5px solid var(--line-strong);
  border-radius: 22px;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--bg);
  resize: none;
  outline: none;
  line-height: 1.5;
  min-height: 44px;
  max-height: 60vh;
  overflow-y: auto;
  transition: border-color 0.15s, box-shadow 0.15s;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.18) transparent;
  box-sizing: border-box;
}
.chat-input::-webkit-scrollbar {
  width: 4px;
}
.chat-input::-webkit-scrollbar-track {
  background: transparent;
  margin: 10px 0;
}
.chat-input::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.18);
  border-radius: 10px;
}
.chat-input:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.chat-input::placeholder { color: var(--muted); }
.chat-premium-chip {
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #d4eb77, #67c6ff);
  color: #173454;
  font-weight: 800;
}
.chat-attach-menu {
  position: absolute;
  left: 8px;
  bottom: calc(100% + 8px);
  width: 290px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(140, 165, 188, 0.32);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 56px rgba(24, 54, 79, 0.18);
  display: grid;
  gap: 8px;
  z-index: 25;
}
.chat-emoji-picker {
  position: absolute;
  left: 8px;
  bottom: calc(100% + 8px);
  width: 320px;
  max-height: 340px;
  overflow-y: auto;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(140, 165, 188, 0.32);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 56px rgba(24, 54, 79, 0.18);
  z-index: 25;
  scrollbar-width: thin;
}
.chat-emoji-category-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 6px 2px 4px;
}
.chat-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  margin-bottom: 6px;
}
.chat-emoji-btn {
  border: none;
  background: none;
  font-size: 1.4rem;
  line-height: 1;
  padding: 5px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: background 0.1s;
}
.chat-emoji-btn:hover {
  background: var(--accent-soft);
}
.chat-attach-menu button {
  border: 1px solid rgba(140, 165, 188, 0.22);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(240, 247, 252, 0.96));
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  display: grid;
  gap: 2px;
}
.chat-attach-menu button strong {
  font-size: 0.88rem;
}
.chat-attach-menu button span {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.35;
}
.chat-attach-menu button:hover {
  border-color: rgba(47, 95, 122, 0.42);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(240, 248, 255, 0.98));
}
.chat-attachment-draft-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chat-send-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
}
.chat-send-btn:hover { background: var(--navy-soft); }
.chat-send-btn:active { transform: scale(0.95); }
.chat-mention-dropdown {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 84px;
  right: 60px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 100;
  max-height: 200px;
  overflow-y: auto;
}
.chat-mention-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--ink);
  transition: background 0.1s;
}
.chat-mention-option:hover,
.chat-mention-option.is-focused {
  background: var(--accent-soft);
}
.chat-mention-avi {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Members Panel ──────────────────────────────────────────────────────────── */
.chat-members-panel {
  width: 220px;
  border-left: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-members-panel[hidden] {
  display: none !important;
}
.chat-members-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--ink);
  flex-shrink: 0;
}
.chat-members-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 3px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color 0.12s;
}
.chat-members-close-btn:hover { color: var(--ink); }
.chat-members-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  scrollbar-width: thin;
}
.chat-member-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  transition: background 0.1s;
}
.chat-member-item:hover {
  background: var(--panel-muted);
}
.chat-member-avi {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-member-info {
  flex: 1;
  min-width: 0;
}
.chat-member-name {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-member-role {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: capitalize;
}
.chat-dm-start-btn {
  font-size: 0.72rem;
  padding: 3px 8px;
  opacity: 0;
  transition: opacity 0.15s;
}
.chat-member-item:hover .chat-dm-start-btn { opacity: 1; }

/* ── Load older messages ────────────────────────────────────────────────────── */
.chat-load-older-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: none;
  border: none;
  font-size: 0.78rem;
  color: var(--muted);
  padding: 8px;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.12s, background 0.12s;
}
.chat-load-older-btn:hover { color: var(--ink); background: var(--panel-muted); }

/* ── Create channel modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(2px);
}
.modal-card {
  width: 100%;
  max-width: 440px;
  padding: 28px;
}
.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.chat-channel-member-picker {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(140, 165, 188, 0.24);
  border-radius: 18px;
  background: rgba(247, 251, 255, 0.78);
}

.chat-channel-member-picker[hidden] {
  display: none !important;
}

.chat-channel-member-picker-head {
  display: grid;
  gap: 2px;
}

.chat-channel-member-picker-head span {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 850;
}

.chat-channel-member-picker-head small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
}

.chat-channel-member-options {
  display: grid;
  gap: 7px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.chat-channel-member-option {
  display: grid;
  grid-template-columns: auto 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid rgba(140, 165, 188, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.chat-channel-member-option:has(input:checked) {
  border-color: rgba(47, 95, 122, 0.32);
  background: linear-gradient(135deg, rgba(124, 200, 244, 0.18), rgba(183, 227, 92, 0.13));
}

.chat-channel-member-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--navy);
}

.chat-channel-member-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 850;
}

.chat-channel-member-copy {
  display: grid;
  min-width: 0;
}

.chat-channel-member-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-channel-member-role {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: capitalize;
}

.chat-create-channel-actions {
  margin-top: 12px;
}

/* Tablet: narrower sidebar, members panel becomes a right-side drawer */
@media (max-width: 860px) {
  .chat-app-wrap {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .chat-members-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 240px;
    z-index: 40;
    box-shadow: -6px 0 24px rgba(16, 32, 48, 0.16);
  }
}

/* Mobile: channel sidebar collapses into a slide-in drawer */
@media (max-width: 600px) {
  .chat-app-wrap {
    grid-template-columns: minmax(0, 1fr);
  }
  .chat-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 82%;
    max-width: 300px;
    z-index: 45;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 6px 0 28px rgba(16, 32, 48, 0.22);
    border-right: 1px solid var(--line-strong);
  }
  .chat-sidebar.is-open {
    transform: translateX(0);
  }
  .chat-mobile-menu-btn {
    display: inline-flex;
  }
  .chat-sidebar-close-btn {
    display: inline-flex;
  }
  .chat-main-header {
    padding: 10px 14px;
  }
  .chat-main-header-desc {
    display: none;
  }
  .chat-messages {
    padding: 14px 14px 8px;
  }
  .chat-composer {
    padding: 10px 14px 14px;
  }
  .chat-members-panel {
    width: 84%;
    max-width: 320px;
  }
  /* Members button: icon only on mobile to save space */
  .chat-members-toggle-btn {
    font-size: 0;
    gap: 0;
    padding: 8px;
  }
  .chat-members-toggle-btn svg {
    margin: 0;
  }
}

/* ── Chat polish pass: AppDone-style workspace messenger ───────────────────── */
.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;
}

body.chat-page {
  --chat-voice-vh: 100svh;
  background:
    radial-gradient(circle at 18% 4%, rgba(124, 200, 244, 0.22), transparent 30%),
    radial-gradient(circle at 96% 0%, rgba(201, 226, 101, 0.2), transparent 28%),
    linear-gradient(180deg, #f7fbff 0%, #eef5fb 100%);
}

body.chat-page .topbar {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.92), rgba(245, 251, 255, 0.86)),
    rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px) saturate(135%);
  box-shadow: 0 8px 26px rgba(21, 44, 64, 0.07);
}

.chat-app-wrap {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(239, 247, 253, 0.92)),
    var(--bg);
}

.chat-sidebar {
  background:
    linear-gradient(180deg, rgba(21, 48, 70, 0.98), rgba(18, 38, 58, 0.98)),
    var(--navy);
  color: #eaf6ff;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-sidebar-header {
  padding: 18px 16px 14px;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.chat-sidebar-workspace {
  color: #ffffff;
  font-size: 0.94rem;
}

.chat-sidebar-workspace::before {
  width: 10px;
  height: 10px;
}

.chat-sidebar-workspace[data-presence-status="online"]::before {
  background: #a6df42;
  box-shadow: 0 0 0 4px rgba(166, 223, 66, 0.16);
}

.chat-sidebar-workspace[data-presence-status="away"]::before {
  background: #f4b942;
  box-shadow: 0 0 0 4px rgba(244, 185, 66, 0.14);
}

.chat-sidebar-workspace[data-presence-status="offline"]::before {
  background: rgba(183, 200, 214, 0.62);
  box-shadow: 0 0 0 4px rgba(183, 200, 214, 0.08);
}

.chat-sidebar-section-hd {
  color: rgba(234, 246, 255, 0.58);
  min-height: 34px;
  padding-right: 12px;
}

.chat-sidebar-add-btn,
.chat-mobile-menu-btn,
.chat-sidebar-close-btn {
  min-width: 32px;
  min-height: 32px;
}

.chat-sidebar-add-btn,
.chat-sidebar-close-btn {
  color: rgba(234, 246, 255, 0.72);
}

.chat-sidebar-add-btn:hover,
.chat-sidebar-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.chat-sidebar .chat-sidebar-add-btn {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(234, 246, 255, 0.86);
}

.chat-sidebar .chat-sidebar-add-btn:hover,
.chat-sidebar .chat-sidebar-add-btn:focus-visible {
  background: linear-gradient(135deg, rgba(124, 200, 244, 0.24), rgba(183, 227, 92, 0.16));
  border-color: rgba(124, 200, 244, 0.44);
  color: #ffffff;
}

.chat-ch-item,
.chat-dm-item {
  margin: 1px 10px;
  padding: 9px 10px;
  border-radius: 12px;
  color: rgba(234, 246, 255, 0.72);
}

.chat-ch-item:hover,
.chat-dm-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.chat-ch-item.is-active,
.chat-dm-item.is-active,
.chat-ch-item-wrap.is-active .chat-ch-item,
.chat-dm-item-wrap.is-active .chat-dm-item {
  background:
    linear-gradient(135deg, rgba(183, 227, 92, 0.2), rgba(124, 200, 244, 0.16)),
    rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-right: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.11);
}
.chat-ch-item-wrap.is-active,
.chat-dm-item-wrap.is-active {
  background: none;
  border-right: 0;
}

.chat-ch-icon,
.chat-ch-item.is-active .chat-ch-icon {
  color: currentColor;
}

.chat-ch-divider {
  background: rgba(255, 255, 255, 0.1);
}

.chat-main {
  background:
    radial-gradient(circle at 20% 12%, rgba(124, 200, 244, 0.14), transparent 36%),
    linear-gradient(180deg, rgba(247, 251, 255, 0.92), rgba(238, 246, 252, 0.96));
}

.chat-main-header {
  min-height: 74px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px) saturate(135%);
  box-shadow: 0 10px 28px rgba(26, 52, 73, 0.05);
}

/* Voice channels are call-only: the stage fills the whole area, Discord-style,
   and the message list / composer are hidden. */
.chat-main--voice .chat-messages-wrap,
.chat-main--voice .chat-typing-bar,
.chat-main--voice .chat-composer {
  display: none;
}

.chat-main--voice .chat-voice-stage {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin-bottom: 14px;
}

.chat-main--voice .chat-voice-stage-root {
  flex: 1;
  min-height: 420px;
  /* meet-root flex column already applied via class — no extra needed */
}

/* Idle auto-leave warning shown when someone is alone in a voice channel */
.vc-idle-warning {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 1500;
  width: min(420px, calc(100vw - 32px));
  display: grid;
  gap: 8px;
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.99);
  color: var(--ink);
  border: 1px solid rgba(143, 166, 186, 0.24);
  box-shadow: 0 24px 60px rgba(64, 80, 96, 0.2);
}

.vc-idle-warning[hidden] {
  display: none !important;
}

.vc-idle-warning strong {
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.vc-idle-warning p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.vc-idle-warning [data-vc-idle-countdown] {
  color: var(--ink);
  font-weight: 850;
}

.vc-idle-warning button {
  justify-self: end;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 850;
  color: #18364f;
  background: linear-gradient(135deg, #dbe9a7 0%, #c5ebb8 32%, #8fd5ff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 12px 24px rgba(88, 145, 188, 0.18);
}

.vc-idle-warning button:hover,
.vc-idle-warning button:focus-visible {
  transform: translateY(-1px);
  filter: saturate(1.04) brightness(1.01);
}

/* Voice channel stage: immersive dark room matching the guest meeting page,
   with a slim glass toolbar for invite actions. */
.chat-voice-stage {
  display: flex;
  flex-direction: column;
  margin: 14px clamp(12px, 2.4vw, 28px) 0;
  border: 1px solid rgba(16, 32, 48, 0.45);
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% -6%, rgba(124, 200, 244, 0.14), transparent 38%),
    radial-gradient(circle at 90% 112%, rgba(213, 221, 148, 0.09), transparent 42%),
    #0c1118;
  box-shadow: 0 22px 48px rgba(24, 48, 68, 0.22);
}

.chat-voice-stage-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(10, 16, 24, 0.78);
  border-bottom: 1px solid rgba(124, 200, 244, 0.1);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
}

.chat-voice-stage-bar-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.chat-voice-stage-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c4d063;
  box-shadow: 0 0 10px rgba(196, 208, 99, 0.85);
  flex-shrink: 0;
  animation: chat-voice-live-pulse 2.2s ease-in-out infinite;
}

@keyframes chat-voice-live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.82); }
}

.chat-voice-stage-bar-titles {
  display: grid;
  min-width: 0;
}

.chat-voice-stage-bar-titles strong {
  color: #f2f7fc;
  font-size: 0.94rem;
  font-weight: 850;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-voice-stage-bar-titles span {
  color: rgba(196, 214, 230, 0.62);
  font-size: 0.72rem;
  white-space: nowrap;
}

.chat-voice-stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.chat-voice-stage-action {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(124, 200, 244, 0.24);
  background: rgba(124, 200, 244, 0.1);
  color: #cfe7f8;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
  white-space: nowrap;
}

.chat-voice-stage-action:hover,
.chat-voice-stage-action:focus-visible {
  background: rgba(124, 200, 244, 0.18);
  border-color: rgba(124, 200, 244, 0.42);
  transform: translateY(-1px);
}

.chat-voice-stage-action:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

.chat-voice-stage-action--accent {
  border-color: rgba(213, 221, 148, 0.34);
  background: rgba(213, 221, 148, 0.13);
  color: #e9efcf;
}

.chat-voice-stage-action--accent:hover,
.chat-voice-stage-action--accent:focus-visible {
  background: rgba(213, 221, 148, 0.22);
  border-color: rgba(213, 221, 148, 0.5);
}

.chat-voice-stage-root {
  min-height: 440px;
  overflow: hidden;
  background: #0b0e15;
}

.chat-external-meetings-page,
.public-meeting-page {
  width: min(1360px, calc(100vw - 24px));
  margin: 28px auto;
}

.chat-external-meetings-page {
  display: grid;
  gap: 16px;
  max-width: min(1120px, calc(100vw - 32px));
}

.chat-external-meetings-hero,
.chat-external-meeting-create,
.chat-external-meetings-list {
  border-radius: 22px;
}

.chat-external-meetings-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
}

.chat-external-meetings-hero-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-external-meetings-hero > .ghost-button {
  justify-self: end;
  align-self: start;
}

.chat-external-meetings-hero h1,
.public-meeting-card h1,
.public-meeting-room-header h1 {
  margin: 6px 0;
  letter-spacing: 0;
}

.chat-external-meeting-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  align-items: end;
}

.chat-external-meeting-form .primary-button {
  min-width: 0;
}

.chat-external-meetings-list {
  display: grid;
  gap: 12px;
}

.chat-external-meetings-list-head h2 {
  margin: 4px 0 0;
}

.chat-sidebar-meetings {
  margin-top: 10px;
}

.chat-sidebar-meetings-link {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1px 10px;
  padding: 9px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: rgba(234, 246, 255, 0.72);
  border: none;
  background: transparent;
  transition: background 120ms ease, color 120ms ease;
}

.chat-sidebar-meetings-badge {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(124, 200, 244, 0.2);
  color: rgba(234, 246, 255, 0.9);
  font-size: 0.9rem;
  font-weight: 900;
}

.chat-sidebar-meetings-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.chat-sidebar-meetings-copy strong {
  font-size: 0.88rem;
  letter-spacing: -0.01em;
}

.chat-sidebar-meetings-copy small {
  color: rgba(234, 246, 255, 0.44);
  font-size: 0.75rem;
  line-height: 1.25;
}

.chat-sidebar-meetings-link:hover,
.chat-sidebar-meetings-link:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.chat-sidebar-meetings-link.is-active {
  background:
    linear-gradient(135deg, rgba(183, 227, 92, 0.2), rgba(124, 200, 244, 0.16)),
    rgba(255, 255, 255, 0.08);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.11);
}

.chat-meeting-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid rgba(140, 165, 188, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
}

.chat-meeting-row h3 {
  margin: 5px 0 3px;
  font-size: 1.02rem;
}

.chat-meeting-row > div:first-child {
  flex: 1 1 260px;
  min-width: 0;
}

.chat-meeting-row-actions {
  flex: 0 1 280px;
}

.chat-meeting-row p {
  margin: 0 0 8px;
  color: var(--muted);
}

.chat-meeting-row code {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #22445f;
}

.chat-meeting-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-meeting-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  color: #23445a;
  background: #e9f6d0;
}

.chat-meeting-status--ended,
.chat-meeting-status--expired {
  color: #6f4d16;
  background: #fff0c9;
}

.public-meeting-shell {
  background:
    radial-gradient(circle at 10% 8%, rgba(145, 213, 255, 0.2), transparent 32%),
    linear-gradient(180deg, #f8fbff 0%, #eef6fb 100%);
}

.public-meeting-card {
  width: min(560px, 100%);
  margin: 9vh auto 0;
  display: grid;
  gap: 14px;
  border-radius: 22px;
}

.public-meeting-form {
  display: grid;
  gap: 14px;
}

/* Immersive guest meeting room: full-viewport dark stage with a slim glass bar.
   The page is fixed to the viewport so the 100ms controls are always reachable
   on mobile, with safe-area padding for notched phones. */
body.public-meeting-room-immersive {
  background: #0c1118;
}

.public-meeting-room-immersive .topbar {
  display: none;
}

.public-meeting-room-page {
  position: fixed;
  /* top/left/right pin to viewport edges; height (not bottom) controls the lower edge
     so that 100svh can exclude iOS Chrome's bottom toolbar from the calculation. */
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  height: 100vh;   /* legacy fallback */
  height: 100dvh;  /* dynamic viewport — shrinks when iOS browser chrome collapses */
  height: 100svh;  /* small viewport — always excludes browser chrome; fixes iOS Chrome toolbar overlap */
  width: 100vw;
  margin: 0;
  background:
    radial-gradient(circle at 14% -4%, rgba(124, 200, 244, 0.16), transparent 38%),
    radial-gradient(circle at 88% 110%, rgba(213, 221, 148, 0.1), transparent 42%),
    #0c1118;
}

.public-meeting-room-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 10px clamp(14px, 3vw, 26px);
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: rgba(10, 16, 24, 0.78);
  border-bottom: 1px solid rgba(124, 200, 244, 0.12);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  overflow: hidden;
  max-height: 120px;
  transition: max-height 300ms ease, padding 300ms ease, min-height 300ms ease, opacity 200ms ease;
}

.public-meeting-room-bar--hidden {
  /* !important overrides the @media (max-width:480px) rule that sets min-height:46px */
  max-height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: none !important;
  opacity: 0;
  pointer-events: none;
}

.public-meeting-room-lockup {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.public-meeting-room-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex-shrink: 0;
}

.public-meeting-room-titles {
  display: grid;
  min-width: 0;
}

.public-meeting-room-titles strong {
  color: #f2f7fc;
  font-size: 0.98rem;
  font-weight: 850;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.public-meeting-room-titles span {
  color: rgba(196, 214, 230, 0.66);
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.public-meeting-room-guest-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 44vw;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(213, 221, 148, 0.12);
  border: 1px solid rgba(213, 221, 148, 0.28);
  color: #e9efcf;
  font-size: 0.8rem;
  font-weight: 750;
  flex-shrink: 0;
}

.public-meeting-room-guest-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.public-meeting-room-guest-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c4d063;
  box-shadow: 0 0 10px rgba(196, 208, 99, 0.8);
  flex-shrink: 0;
}

.public-meeting-room-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 0;
}

.public-meeting-room-leave {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid rgba(207, 103, 103, 0.32);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(248, 207, 199, 0.98) 0%, rgba(240, 162, 158, 0.98) 52%, rgba(223, 122, 122, 0.98) 100%);
  color: #5d1d26;
  font-size: 0.86rem;
  font-weight: 850;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 12px 22px rgba(207, 103, 103, 0.32);
  transition: transform 150ms ease, filter 150ms ease, box-shadow 150ms ease;
  flex-shrink: 0;
}

.public-meeting-room-leave[hidden] {
  display: none !important;
}

.public-meeting-room-leave:hover,
.public-meeting-room-leave:focus-visible {
  transform: translateY(-1px);
  filter: saturate(1.05) brightness(1.02);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 16px 28px rgba(207, 103, 103, 0.4);
}

.public-meeting-room-leave:active {
  transform: translateY(0);
}

@media (max-width: 480px) {
  .public-meeting-room-guest-chip {
    max-width: 32vw;
  }

  .public-meeting-room-leave span {
    display: none;
  }

  .public-meeting-room-leave {
    width: 40px;
    min-height: 40px;
    padding: 0;
    justify-content: center;
  }

  /* Compact header on mobile to reclaim vertical space for the 100ms Prebuilt */
  .public-meeting-room-bar {
    min-height: 46px;
    padding: 6px 14px;
    padding-top: calc(6px + env(safe-area-inset-top, 0px));
  }

  .public-meeting-room-logo {
    width: 28px;
    height: 28px;
  }

  /* Hide workspace subtitle — saves another row of height */
  .public-meeting-room-titles span {
    display: none;
  }
}

.public-meeting-room-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: clamp(0px, 1.2vw, 14px);
  padding-bottom: calc(clamp(0px, 1.2vw, 14px) + env(safe-area-inset-bottom, 0px));
}

.public-meeting-root {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  border-radius: clamp(0px, 1.6vw, 20px);
  background: #0b0e15;
}

/* On smaller screens the 100ms Prebuilt pre-join layout is taller than the
   available viewport. The stage is scrollable in general; on mobile we also
   remove outer padding and pin the root height so the Join button stays reachable
   and the prebuilt does not collapse to zero height. */
@media (max-width: 600px) {
  .public-meeting-room-stage {
    align-items: flex-start;
    padding: 0 0 calc(18px + env(safe-area-inset-bottom, 0px));
  }

  .public-meeting-root {
    flex: none;
    width: 100%;
    height: calc(100dvh - 46px - env(safe-area-inset-top, 0px));
    min-height: 600px;
    overflow: hidden;
    border-radius: 0;
  }
}

/* ── Custom guest-meeting conference UI (built on @100mslive/react-sdk) ──────
   Replaces the all-in-one HMSPrebuilt for guest meetings so we fully control the
   on-screen controls. Our own bottom control bar respects the safe-area inset so
   the Leave button always sits above the mobile system navigation bar. */
.meet-root {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 0%, rgba(124, 200, 244, 0.08), transparent 42%),
    radial-gradient(circle at 82% 100%, rgba(183, 227, 92, 0.06), transparent 46%),
    #0a0d13;
}

/* Tiles fill the whole stage — no scrolling, FaceTime-style. */
.meet-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
  padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: minmax(0, 1fr);
  overflow: hidden;
}
.meet-grid[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.meet-grid[data-count="3"],
.meet-grid[data-count="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.meet-grid[data-count="5"],
.meet-grid[data-count="6"],
.meet-grid[data-count="7"],
.meet-grid[data-count="8"],
.meet-grid[data-count="9"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.meet-tile {
  position: relative;
  min-height: 0;
  min-width: 0;
  border-radius: 20px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(155deg, #1b2230 0%, #10141d 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
}
.meet-tile.is-video { background: #000; }
/* Active speaker glow (inset so it isn't clipped by overflow). */
.meet-tile.is-active { box-shadow: inset 0 0 0 2.5px #b7e35c, 0 0 26px rgba(183, 227, 92, 0.22); }
.meet-video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.meet-tile.is-local .meet-video { transform: scaleX(-1); }
.meet-avatar {
  width: clamp(58px, 14vw, 104px);
  height: clamp(58px, 14vw, 104px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: clamp(1.2rem, 4.5vw, 2rem);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.05), 0 8px 22px rgba(0, 0, 0, 0.35);
}
.meet-tile-bar {
  position: absolute;
  left: 12px;
  bottom: 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 24px);
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(8, 12, 18, 0.58);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
}
.meet-tile.is-compact .meet-tile-bar { font-size: 0.72rem; padding: 3px 9px; left: 8px; bottom: 8px; }
.meet-tile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meet-tile-mute { display: inline-flex; color: #ff8b8b; }
.meet-tile-mute svg { display: block; }

/* Screen-share presentation layout */
.meet-present {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 12px;
  padding: 14px;
  padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
}
.meet-screen {
  flex: 1;
  min-width: 0;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.meet-screen-video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.meet-filmstrip {
  flex: 0 0 210px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  min-height: 0;
}
.meet-filmstrip .meet-tile { flex: 0 0 auto; aspect-ratio: 16 / 10; }

/* Conference wrapper (stage + optional chat side panel) */
.meet-conf {
  flex: 1;
  min-height: 0;
  display: flex;
}
.meet-conf-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  position: relative;
  display: flex;
}

/* Pre-join lobby */
.meet-lobby {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 5vw, 56px);
  padding: clamp(16px, 4vw, 40px);
  flex-wrap: wrap;
}
.meet-lobby-preview {
  position: relative;
  width: min(560px, 92vw);
  aspect-ratio: 16 / 10;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(155deg, #1b2230, #10141d);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  display: grid;
  place-items: center;
}
.meet-lobby-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.meet-lobby-avatar-wrap { display: grid; place-items: center; }
.meet-lobby-toggles {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
}
.meet-lobby-side {
  display: grid;
  justify-items: flex-start;
  gap: 8px;
  max-width: 320px;
}
.meet-lobby-title { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; color: #f2f7fc; margin: 0; }
.meet-lobby-name { margin: 0; color: rgba(196, 214, 230, 0.85); font-weight: 600; }
.meet-lobby-join {
  margin-top: 10px;
  padding: 13px 34px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #8fd0f4, #b7e35c);
  color: #0b2030;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 120ms ease, filter 150ms ease;
}
.meet-lobby-join:hover { transform: translateY(-2px); filter: brightness(1.04); }
.meet-lobby-join:disabled { opacity: 0.7; cursor: default; transform: none; }
.meet-lobby-hint { margin: 2px 0 0; font-size: 0.82rem; color: rgba(196, 214, 230, 0.6); }

/* In-call chat */
.meet-chat {
  flex: 0 0 340px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(15, 19, 26, 0.96);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}
.meet-chat-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  color: #f2f7fc;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.meet-chat-head strong { font-size: 0.98rem; }
.meet-chat-close {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #cdd9e6;
  cursor: pointer;
}
.meet-chat-close:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.meet-chat-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
}
.meet-chat-empty { margin: auto; color: rgba(196, 214, 230, 0.55); font-size: 0.86rem; text-align: center; }
.meet-chat-msg { display: flex; flex-direction: column; gap: 3px; max-width: 90%; align-self: flex-start; }
.meet-chat-msg.is-me { align-self: flex-end; align-items: flex-end; }
.meet-chat-from { font-size: 0.72rem; font-weight: 700; color: #8fd0f4; }
.meet-chat-msg.is-me .meet-chat-from { color: #b7e35c; }
.meet-chat-text {
  background: rgba(255, 255, 255, 0.07);
  color: #e8f1f9;
  padding: 8px 12px;
  border-radius: 14px;
  border-top-left-radius: 4px;
  font-size: 0.88rem;
  line-height: 1.45;
  word-break: break-word;
}
.meet-chat-msg.is-me .meet-chat-text {
  background: linear-gradient(135deg, rgba(143, 208, 244, 0.22), rgba(183, 227, 92, 0.18));
  border-top-left-radius: 14px;
  border-top-right-radius: 4px;
}
.meet-chat-form {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.meet-chat-input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #f2f7fc;
  font-size: 0.9rem;
  outline: none;
}
.meet-chat-input::placeholder { color: rgba(196, 214, 230, 0.5); }
.meet-chat-input:focus { border-color: rgba(143, 208, 244, 0.5); background: rgba(255, 255, 255, 0.09); }
.meet-chat-send {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #8fd0f4, #b7e35c);
  color: #0b2030;
  cursor: pointer;
}
.meet-chat-send:hover { filter: brightness(1.05); }

/* Panel error fallback (keeps the call alive if a side panel crashes) */
.meet-panel-error {
  flex: 0 0 340px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  background: rgba(15, 19, 26, 0.96);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  color: #e8f1f9;
}
.meet-panel-error p { margin: 0; color: rgba(196, 214, 230, 0.78); font-size: 0.85rem; line-height: 1.5; }
@media (max-width: 600px) {
  .meet-panel-error { position: absolute; inset: 0; z-index: 12; flex: 1 1 auto; border-left: none; }
}

/* Participants panel */
.meet-people-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
}
.meet-person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 12px;
}
.meet-person:hover { background: rgba(255, 255, 255, 0.05); }
.meet-person-avi {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
}
.meet-person-name {
  flex: 1;
  min-width: 0;
  color: #e8f1f9;
  font-size: 0.9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.meet-person-hand { flex: 0 0 auto; font-size: 1rem; }
.meet-person-ic { flex: 0 0 auto; display: inline-grid; place-items: center; color: rgba(196, 214, 230, 0.85); }
.meet-person-ic svg { width: 17px; height: 17px; display: block; }
.meet-person-ic.is-off { color: #ff6b6b; }

/* Raised-hand badge on a tile */
.meet-tile-hand {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  border-radius: 12px;
  background: rgba(8, 12, 18, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: meet-hand-wave 1.2s ease-in-out infinite;
}
@keyframes meet-hand-wave {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(10deg); }
}

/* Reactions popover (raise hand + emoji) */
.meet-react-wrap { position: relative; display: inline-flex; }
.meet-react-pop {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(24, 29, 38, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  z-index: 20;
}
.meet-react-hand {
  padding: 9px 14px;
  border-radius: 10px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #e8f1f9;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}
.meet-react-hand:hover { background: rgba(255, 255, 255, 0.16); }
.meet-react-hand.is-on { background: rgba(183, 227, 92, 0.2); color: #cdf08a; }
.meet-react-emojis { display: flex; gap: 4px; }
.meet-react-emoji {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}
.meet-react-emoji:hover { background: rgba(255, 255, 255, 0.1); transform: scale(1.2); }
.meet-ic-emoji { font-size: 1.2rem; line-height: 1; }

/* Floating reaction animation over the stage */
.meet-reactions { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 8; }
.meet-reaction {
  position: absolute;
  bottom: 8%;
  font-size: 2.2rem;
  animation: meet-float-up 3.6s ease-out forwards;
}
@keyframes meet-float-up {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  12% { opacity: 1; transform: translateY(-18px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-62vh) scale(1); }
}

/* Lobby device pickers */
.meet-device-row { display: grid; gap: 10px; width: 100%; margin: 6px 0 4px; }
.meet-devices-panel { }
.meet-device-row--panel { padding: 16px; margin: 0; }
.meet-device { display: grid; gap: 4px; text-align: left; }
.meet-device-label { font-size: 0.74rem; font-weight: 700; color: rgba(196, 214, 230, 0.7); text-transform: uppercase; letter-spacing: 0.04em; }
.meet-device-select {
  width: 100%;
  padding: 10px 34px 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #1a2235 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a0b4c8' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  background-size: 12px;
  color: #f2f7fc;
  font-size: 0.88rem;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.meet-device-select:focus { border-color: rgba(143, 208, 244, 0.5); outline: none; }
.meet-device-select option { background: #1a2235; color: #f2f7fc; }

/* Floating frosted control pill */
.meet-controls {
  position: absolute;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 999px;
  background: rgba(18, 23, 31, 0.64);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
  z-index: 10;
}
.meet-ctrl {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: background 150ms ease, transform 120ms ease;
}
.meet-ctrl:hover { background: rgba(255, 255, 255, 0.22); transform: translateY(-2px); }
.meet-ctrl:active { transform: translateY(0) scale(0.95); }
.meet-ctrl.is-off { background: #ff4d4f; }
.meet-ctrl.is-off:hover { background: #ff5f61; }
.meet-ctrl.is-active { background: #3b82f6; }
.meet-ctrl.is-active:hover { background: #4f8ff7; }
.meet-ctrl--ghost { background: rgba(255, 255, 255, 0.08); }
.meet-ctrl { position: relative; }
.meet-ctrl-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff3b30;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(18, 23, 31, 0.9);
}
.meet-ctrl-badge--soft { background: rgba(143, 208, 244, 0.9); color: #07263a; }
.meet-ctrl .meet-ic svg { display: block; }
.meet-ctrl--leave {
  width: auto;
  border-radius: 25px;
  padding: 0 20px;
  gap: 8px;
  background: #ff3b30;
  font-weight: 750;
  font-size: 0.9rem;
}
.meet-ctrl--leave:hover { background: #ff4d43; transform: translateY(-2px); }
.meet-ctrl-label { padding-right: 3px; }

.meet-status {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px;
}
.meet-status-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  color: #e8f1f9;
  max-width: 360px;
}
.meet-status-card strong { font-size: 1.05rem; }
.meet-status-card p { margin: 0; color: rgba(196, 214, 230, 0.78); line-height: 1.5; }
.meet-rejoin,
.meet-idle-card button {
  margin-top: 4px;
  padding: 10px 22px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #8fd0f4, #b7e35c);
  color: #0b2030;
  font-weight: 800;
  cursor: pointer;
}
.meet-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #8fd0f4;
  animation: meet-spin 0.8s linear infinite;
}
@keyframes meet-spin { to { transform: rotate(360deg); } }

.meet-idle {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(6, 10, 16, 0.72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 11;
  padding: 24px;
}
.meet-idle-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  max-width: 340px;
  padding: 22px;
  border-radius: 18px;
  background: #131922;
  border: 1px solid rgba(124, 200, 244, 0.16);
  color: #e8f1f9;
}
.meet-idle-card p { margin: 0; color: rgba(196, 214, 230, 0.8); line-height: 1.5; }

@media (max-width: 600px) {
  .meet-grid { gap: 8px; padding: 8px; padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  .meet-grid[data-count="2"] { grid-template-columns: minmax(0, 1fr); }
  .meet-grid[data-count="3"],
  .meet-grid[data-count="4"],
  .meet-grid[data-count="5"],
  .meet-grid[data-count="6"],
  .meet-grid[data-count="7"],
  .meet-grid[data-count="8"],
  .meet-grid[data-count="9"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meet-present { flex-direction: column; padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  .meet-filmstrip { flex: 0 0 92px; flex-direction: row; overflow-x: auto; overflow-y: hidden; }
  .meet-filmstrip .meet-tile { flex: 0 0 140px; height: 100%; aspect-ratio: auto; }
  /* Smaller buttons so 7 icons fit on any phone width without wrapping. */
  .meet-ctrl { width: 42px; height: 42px; }
  .meet-controls { gap: 7px; padding: 7px 10px; max-width: calc(100vw - 16px); }
  /* Icon-only Leave on mobile so the pill never crowds/wraps. */
  .meet-ctrl--leave { width: 42px; padding: 0; border-radius: 50%; }
  .meet-ctrl--leave .meet-ctrl-label { display: none; }
  /* Hide fullscreen on mobile — keep the control set compact. */
  .meet-ctrl--fs { display: none; }

  /* Chat becomes a full-screen overlay above the controls. */
  .meet-chat {
    position: absolute;
    inset: 0;
    z-index: 12;
    flex: 1 1 auto;
    border-left: none;
  }

  /* Lobby stacks vertically on phones.
     Device pickers are hidden — users use the in-call Settings button instead.
     Everything must fit within the viewport with no scrolling needed. */
  .meet-lobby { flex-direction: column; gap: 12px; justify-content: center; align-items: center; padding: 16px; }
  .meet-lobby-preview { width: 100%; max-width: 380px; aspect-ratio: 4 / 3; max-height: 40vh; }
  .meet-lobby .meet-device-row { display: none; }
  .meet-lobby-side { justify-items: center; text-align: center; max-width: 100%; gap: 6px; }
  .meet-lobby-title { font-size: 1.4rem; }
  .meet-lobby-join { padding: 12px 28px; margin-top: 4px; }
}

.chat-main-header-left {
  min-width: 0;
}

.chat-room-lockup {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.chat-main-header-icon,
.chat-main-header-avatar {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(183, 227, 92, 0.28), rgba(124, 200, 244, 0.2)),
    #f8fcff;
  color: var(--navy);
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(92, 124, 148, 0.1);
}

.chat-main-header-avatar {
  object-fit: cover;
}

.chat-room-title-stack {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.chat-main-header-name {
  font-size: 1rem;
  letter-spacing: -0.035em;
}

.chat-main-header-desc {
  padding-left: 0;
  margin-left: 0;
  border-left: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-room-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(183, 227, 92, 0.18);
  color: var(--navy);
  font-size: 0.74rem;
  font-weight: 850;
  white-space: nowrap;
}

.chat-members-toggle-btn {
  min-height: 38px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(34, 58, 80, 0.06);
}

.chat-messages {
  padding: 22px clamp(16px, 3vw, 34px) 14px;
  gap: 6px;
}

.chat-msg {
  max-width: 820px;
  padding: 9px 10px;
  border-radius: 16px;
}

.chat-msg:hover {
  background: none;
}

.chat-msg-avatar {
  width: 36px;
  height: 36px;
  box-shadow: 0 6px 16px rgba(29, 58, 84, 0.12);
}

.chat-msg-author {
  font-size: 0.92rem;
  letter-spacing: -0.02em;
}

.chat-msg-time,
.chat-msg-edited,
.chat-msg-status {
  font-size: 0.74rem;
}

.chat-msg-text {
  font-size: 0.94rem;
  line-height: 1.48;
  border-radius: 4px 16px 16px 16px;
  padding: 9px 14px;
}
.chat-msg.is-own .chat-msg-text {
  border-radius: 16px 4px 16px 16px;
}

.chat-mention {
  display: inline;
  color: #1d536d;
  background: linear-gradient(135deg, rgba(124, 200, 244, 0.2), rgba(183, 227, 92, 0.18));
  border-radius: 8px;
  padding: 1px 5px;
  font-weight: 850;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.chat-empty-state {
  max-width: 420px;
  min-height: 0;
  flex: 0 1 auto;
  align-self: center;
  margin: auto;
  gap: 12px;
  padding: 34px 30px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 18px 44px rgba(39, 68, 94, 0.08);
}

.chat-empty-icon {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(183, 227, 92, 0.24), rgba(124, 200, 244, 0.2));
  color: var(--navy);
  opacity: 1;
}

.chat-empty-hint {
  max-width: 280px;
  color: var(--navy);
  font-size: 0.86rem;
  font-weight: 750;
}

.chat-composer {
  padding: 12px clamp(16px, 3vw, 34px) calc(14px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px) saturate(135%);
  box-shadow: 0 -10px 28px rgba(26, 52, 73, 0.05);
}

.chat-attach-menu {
  width: min(320px, 80vw);
}

.chat-emoji-picker {
  width: min(320px, 80vw);
}

.chat-input {
  min-height: 48px;
  border-radius: 24px;
  border-color: rgba(140, 165, 188, 0.38);
  background: rgba(247, 251, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.chat-input:focus {
  border-color: rgba(47, 95, 122, 0.62);
  box-shadow:
    0 0 0 4px rgba(124, 200, 244, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.chat-send-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #18364f, #244a67);
  box-shadow: 0 14px 24px rgba(24, 54, 79, 0.22);
}

.chat-attachment-card {
  border-radius: 18px;
}

.chat-attachment-image {
  max-height: 320px;
}

.chat-send-btn:hover {
  background: linear-gradient(135deg, #214761, #2c5f7b);
}

.chat-mention-dropdown {
  left: calc(clamp(16px, 3vw, 34px) + 80px);
  right: calc(clamp(16px, 3vw, 34px) + 58px);
  border-radius: 16px;
  border-color: rgba(140, 165, 188, 0.38);
}

.chat-members-panel {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px) saturate(135%);
}

.chat-member-item {
  margin: 2px 8px;
  border-radius: 14px;
}

.chat-dm-start-btn {
  opacity: 1;
}

@media (max-width: 600px) {
  body.chat-page .shell {
    height: 100svh;
    width: 100%;
    overflow-x: hidden;
  }

  body.chat-page .topbar {
    min-height: 58px;
    width: 100%;
    max-width: 100%;
    margin: 0 !important;
    padding: 0 8px;
    gap: 6px;
    overflow: visible;
    border-bottom-color: rgba(140, 165, 188, 0.24);
    z-index: 40;
  }

  body.chat-page .brand-link {
    flex: 1 1 118px;
    max-width: 142px;
    min-width: 0;
  }

  body.chat-page .brand-lockup {
    gap: 7px;
  }

  body.chat-page .brand-logo-image {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  body.chat-page .brand-title {
    font-size: 0.98rem;
    max-width: 96px;
  }

  body.chat-page .topbar-right {
    flex: 0 0 auto;
    gap: 5px;
    min-width: 0;
    overflow: visible;
  }

  body.chat-page .topbar-actions {
    gap: 5px;
    overflow: visible;
  }

  body.chat-page .topbar-action {
    width: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 14px;
  }

  body.chat-page .topbar-action-icon svg {
    width: 15px;
    height: 15px;
  }

  body.chat-page .notification-bell {
    width: 34px;
    min-width: 34px;
    min-height: 34px;
    border-radius: 14px;
  }

  body.chat-page .notification-center {
    position: relative;
    z-index: 9999;
    overflow: visible;
  }

  body.chat-page .notification-panel {
    top: 64px;
    right: 8px;
    width: min(420px, calc(100vw - 16px));
  }

  body.chat-page .notification-bell svg {
    width: 17px;
    height: 17px;
  }

  body.chat-page .notification-indicator-dot {
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    border-width: 2px;
  }

  .chat-main-header {
    min-height: 50px;
    padding: 7px 9px;
    gap: 6px;
  }

  .chat-voice-stage {
    margin: 8px 6px 0;
    border-radius: 18px;
  }

  .chat-voice-stage-bar {
    flex-wrap: wrap;
    padding: 8px 10px;
    gap: 8px;
  }

  .chat-voice-stage-bar-titles span {
    display: none;
  }

  .chat-voice-stage-actions {
    justify-content: flex-start;
    gap: 6px;
  }

  .chat-voice-stage-action {
    min-height: 34px;
    padding: 0 11px;
    font-size: 0.74rem;
  }

  .chat-voice-stage-root {
    min-height: 360px;
  }

  .chat-room-lockup {
    gap: 7px;
  }

  .chat-main-header-icon,
  .chat-main-header-avatar {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    font-size: 0.86rem;
  }

  .chat-main-header-name {
    max-width: 44vw;
    font-size: 0.96rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .chat-main-header-desc {
    display: none;
  }

  .chat-room-pill {
    display: none;
  }

  .chat-mobile-menu-btn {
    width: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    color: var(--navy);
    background: rgba(255, 255, 255, 0.64);
    border: 1px solid rgba(140, 165, 188, 0.22);
    border-radius: 13px;
  }

  .chat-members-toggle-btn {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 13px;
    box-shadow: none;
  }

  .chat-members-toggle-btn span {
    display: none;
  }

  .chat-call-pill {
    display: none;
  }

  .chat-call-btn span,
  .chat-call-hangup-btn span {
    display: none;
  }

  .chat-delete-channel-btn {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 13px;
    box-shadow: none;
  }

  .chat-delete-channel-btn span {
    display: none;
  }

  .chat-messages {
    padding: 14px 11px 10px;
  }

  .chat-empty-state {
    width: min(100%, 236px);
    gap: 10px;
    padding: 24px 20px;
    border-radius: 24px;
  }

  .chat-empty-icon {
    width: 54px;
    height: 54px;
    border-radius: 20px;
    font-size: 2.25rem;
  }

  .chat-msg {
    gap: 9px;
    padding: 8px 6px;
  }

  .chat-msg-avatar {
    width: 34px;
    height: 34px;
  }

  .chat-msg-text {
    font-size: 0.93rem;
  }

  .chat-composer {
    padding: 8px 8px calc(10px + env(safe-area-inset-bottom));
  }

  .chat-composer-row {
    gap: 6px;
  }

  .chat-composer-icons {
    gap: 0;
  }

  .chat-icon-btn {
    width: 34px;
    height: 34px;
  }

  .chat-attach-menu {
    width: min(300px, calc(100vw - 20px));
    left: 4px;
  }

  .chat-emoji-picker {
    width: min(300px, calc(100vw - 20px));
    left: 4px;
  }

  .chat-input {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 0.88rem;
  }

  .chat-send-btn {
    width: 42px;
    height: 42px;
  }

  .chat-attachment-row {
    padding: 9px 10px;
  }

  .chat-attachment-image {
    max-height: 220px;
  }
}

@media (max-width: 600px) {
  .chat-main--voice .chat-voice-stage {
    margin: 6px 4px 0;
    gap: 6px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .chat-main--voice .chat-voice-stage-bar {
    padding: 8px 10px;
  }

  .chat-main--voice .chat-voice-stage-actions {
    display: none;
  }

  .chat-main--voice .chat-voice-stage-root {
    min-height: max(360px, calc(var(--chat-voice-vh, 100svh) - 196px));
  }
}

@media (max-width: 300px) {
  body.chat-page .brand-link {
    flex-basis: 40px;
    max-width: 40px;
  }

  body.chat-page .brand-copy {
    display: none;
  }

  body.chat-page .topbar-right,
  body.chat-page .topbar-actions {
    gap: 4px;
  }

  body.chat-page .topbar-action,
  body.chat-page .notification-bell {
    width: 33px;
    min-width: 33px;
    min-height: 33px;
  }

  .chat-main-header-name {
    max-width: 48vw;
  }
}

/* ─── In-call navigation warning (bottom sheet) ──────────────────────────── */

.call-nav-warning {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.call-nav-warning-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 20, 35, 0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.call-nav-warning-sheet {
  position: relative;
  background: #fff;
  border-radius: 22px 22px 0 0;
  padding: 28px 24px max(36px, env(safe-area-inset-bottom, 36px));
  width: 100%;
  max-width: 480px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 -8px 40px rgba(10, 20, 35, 0.18);
  animation: call-nav-sheet-in 220ms cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes call-nav-sheet-in {
  from { transform: translateY(100%); opacity: 0.6; }
  to   { transform: translateY(0);    opacity: 1; }
}

.call-nav-warning-icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 4px;
}

.call-nav-warning-title {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink, #0f1c2e);
}

.call-nav-warning-body {
  font-size: 0.88rem;
  color: var(--muted, #6b7a8d);
  line-height: 1.5;
  margin: 2px 0 8px;
}

.call-nav-warning-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
}

.call-nav-warning-btn-danger {
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  border: none;
  background: #f04e5a;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: filter 140ms ease, transform 100ms ease;
}

.call-nav-warning-btn-danger:hover,
.call-nav-warning-btn-danger:focus-visible {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.call-nav-warning-btn-ghost {
  width: 100%;
  padding: 13px 20px;
  border-radius: 12px;
  border: 1.5px solid rgba(143, 166, 186, 0.32);
  background: transparent;
  color: var(--ink, #0f1c2e);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms ease;
}

.call-nav-warning-btn-ghost:hover,
.call-nav-warning-btn-ghost:focus-visible {
  background: rgba(143, 166, 186, 0.10);
}

/* Slightly different look on larger screens — centred card instead of bottom sheet */
@media (min-width: 560px) {
  .call-nav-warning {
    align-items: center;
    padding: 24px;
  }
  .call-nav-warning-sheet {
    border-radius: 20px;
    padding: 36px 32px;
    max-width: 400px;
  }
}

/* ── Chat call-event pills (WhatsApp-style) ─────────────────────────────── */

.chat-call-event {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 14px;
  margin: 8px auto;
  width: fit-content;
  max-width: 90%;
  background: var(--surface-2, #f0f0f0);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--text-2, #555);
  line-height: 1.4;
  user-select: none;
}

.dark .chat-call-event,
[data-theme="dark"] .chat-call-event {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-2, #aaa);
}

.chat-call-event-icon {
  font-size: 0.85rem;
  flex-shrink: 0;
}

.chat-call-event-label {
  font-weight: 500;
  white-space: nowrap;
}

.chat-call-event-time {
  opacity: 0.65;
  font-size: 0.72rem;
  white-space: nowrap;
}

/* Missed / declined tint */
.chat-call-event--missed .chat-call-event-label,
.chat-call-event--declined .chat-call-event-label {
  color: #d9534f;
}

.dark .chat-call-event--missed .chat-call-event-label,
[data-theme="dark"] .chat-call-event--missed .chat-call-event-label,
.dark .chat-call-event--declined .chat-call-event-label,
[data-theme="dark"] .chat-call-event--declined .chat-call-event-label {
  color: #ff6b6b;
}

/* Completed call — slightly greener icon */
.chat-call-event--ended .chat-call-event-icon {
  filter: hue-rotate(100deg) saturate(1.2);
}

/* Notes page should read like a standalone module, not the hub launcher shell. */
body.notes-page .hub-sidebar-notes {
  display: none !important;
}

body.notes-page .sticky-note-center {
  display: none !important;
}

body.notes-page .hub-shell {
  grid-template-columns: 1fr !important;
}

body.notes-page .hub-main {
  width: 100% !important;
}

/* ── 100ms meeting room shell ─────────────────────────────────────────────── */
.chat-meeting-page {
  display: grid;
  gap: 18px;
  padding: 18px;
  min-height: calc(100vh - 72px);
  min-height: var(--chat-meeting-vh, calc(100vh - 72px));
  background:
    radial-gradient(circle at top left, rgba(134, 206, 255, 0.22), transparent 34%),
    radial-gradient(circle at top right, rgba(214, 235, 170, 0.22), transparent 30%),
    linear-gradient(180deg, #f6fbff 0%, #f3f7f3 100%);
}

.chat-meeting-hero,
.chat-meeting-stage {
  border-radius: 28px;
}

.chat-meeting-stage {
  overflow: hidden;
}

.chat-meeting-hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px;
  overflow: visible;
}

.chat-meeting-hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.chat-meeting-hero-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.chat-meeting-hero-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #d4eaff, #e6f5e6);
  color: #3a7fd5;
  flex-shrink: 0;
}

.chat-meeting-hero-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 4px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-meeting-hero-sub {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}


.chat-meeting-stage {
  display: grid;
  min-height: min(82vh, 860px);
  padding: 0;
}

.chat-meeting-root {
  min-height: 720px;
  height: 100%;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(143, 166, 186, 0.2);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 20px 44px rgba(55, 74, 90, 0.12);
}

.chat-meeting-error {
  display: grid;
  gap: 10px;
  padding: 20px;
  color: var(--ink);
}

/* Readable error/fallback text on the dark voice and meeting stages */
.chat-voice-stage-root .chat-meeting-error,
.public-meeting-root .chat-meeting-error {
  color: #e8f1f9;
}

.chat-voice-stage-root .chat-meeting-error strong,
.public-meeting-root .chat-meeting-error strong {
  color: #f2f7fc;
}

.chat-voice-stage-root .chat-meeting-error p,
.public-meeting-root .chat-meeting-error p {
  color: rgba(196, 214, 230, 0.75);
}

.chat-meeting-error strong {
  font-size: 1rem;
}

.chat-meeting-error p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.chat-voice-retry-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  padding: 9px 20px;
  border-radius: 999px;
  border: 1px solid rgba(124, 200, 244, 0.3);
  background: rgba(124, 200, 244, 0.12);
  color: #cfe7f8;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease;
}

.chat-voice-retry-btn:hover {
  background: rgba(124, 200, 244, 0.22);
}

@media (max-width: 720px) {
  .chat-meeting-page {
    padding: 10px;
    gap: 10px;
  }

  .chat-meeting-root {
    min-height: 0;
  }

  .chat-meeting-stage {
    min-height: 0;
  }

  .chat-external-meetings-page,
  .public-meeting-page {
    width: min(100vw - 16px, 1120px);
    margin: 12px auto;
  }

  .chat-external-meetings-hero {
    grid-template-columns: 1fr;
  }

  .chat-external-meetings-hero .ghost-button {
    width: 100%;
    justify-content: center;
    justify-self: stretch;
  }

  .chat-external-meeting-form {
    grid-template-columns: 1fr;
  }

  .chat-external-meeting-form .primary-button {
    width: 100%;
  }

  .chat-meeting-hero {
    padding: 14px 16px;
    gap: 12px;
  }

  .chat-meeting-hero-left {
    gap: 12px;
  }

  .chat-meeting-hero-icon {
    width: 40px;
    height: 40px;
  }

  .chat-meeting-hero-title {
    font-size: 1.08rem;
    margin-top: 2px;
  }

  .chat-meeting-hero-sub {
    font-size: 0.8rem;
  }

  .chat-meeting-hero-actions {
    gap: 8px;
  }

  .chat-meeting-hero-actions .ghost-button {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.82rem;
  }

  .chat-meeting-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .chat-meeting-row > div:first-child {
    flex: 0 0 auto;
  }

  .chat-meeting-row code {
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
  }

  .chat-meeting-row-actions {
    flex: 0 0 auto;
    justify-content: flex-start;
  }

  .chat-meeting-row-actions .ghost-button,
  .chat-meeting-row-actions form,
  .chat-meeting-row-actions form .ghost-button {
    width: 100%;
  }

  .chat-meeting-row-actions form {
    display: block;
  }
}

@media (max-width: 520px) {
  .chat-external-meetings-page,
  .public-meeting-page {
    width: calc(100vw - 12px);
    margin: 8px auto;
  }

  .chat-external-meetings-hero,
  .chat-external-meeting-create,
  .chat-external-meetings-list {
    border-radius: 18px;
  }

  .chat-external-meetings-hero h1,
  .public-meeting-card h1,
  .public-meeting-room-header h1 {
    font-size: clamp(1.6rem, 6vw, 2.15rem);
  }

  .chat-meeting-row {
    padding: 12px;
    border-radius: 16px;
  }

  .chat-meeting-row h3 {
    font-size: 0.98rem;
  }

  .chat-meeting-row-actions {
    gap: 8px;
  }

  .chat-meeting-row-actions .ghost-button,
  .chat-meeting-row-actions form .ghost-button {
    min-height: 40px;
  }
}

@media (max-width: 600px) {
  .chat-meeting-page {
    padding: 8px;
    gap: 8px;
  }

  .chat-meeting-hero-actions .ghost-button[data-send-vc-invite] {
    display: none;
  }

  .chat-meeting-hero-actions .ghost-button[data-copy-invite-link] {
    display: none;
  }

  .chat-meeting-stage {
    border-radius: 22px;
  }

  .chat-meeting-root {
    border-radius: 22px;
  }

  .chat-meeting-root,
  .chat-main--voice .chat-voice-stage-root {
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .chat-meeting-page {
    padding: 6px;
    gap: 6px;
  }

  .chat-meeting-hero {
    padding: 12px 12px 10px;
  }

  .chat-meeting-hero .eyebrow {
    font-size: 0.68rem;
  }
}

/* 100ms Prebuilt icon centering fix — the Prebuilt renders buttons whose
   internal icon spans/svgs are not always flex-centered. Since the Prebuilt
   renders in the same DOM we can override it here. */
.chat-voice-stage-root button,
.public-meeting-root button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.chat-voice-stage-root button > span,
.chat-voice-stage-root button > svg,
.public-meeting-root button > span,
.public-meeting-root button > svg {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* 100ms composer inputs can render with awkward internal padding on small
   screens. Keep the placeholder/text aligned and readable inside the room only.
   This stays scoped to the meeting embed so the rest of the app is unaffected. */
.public-meeting-root input,
.public-meeting-root textarea {
  box-sizing: border-box;
  font: inherit;
  line-height: 1.35;
  -webkit-appearance: none;
  appearance: none;
}

@media (max-width: 900px) {
  .public-meeting-root input,
  .public-meeting-root textarea {
    min-height: 44px;
    padding: 12px 14px !important;
  }

  .public-meeting-root input::placeholder,
  .public-meeting-root textarea::placeholder {
    color: rgba(176, 184, 196, 0.88);
    opacity: 1;
  }

  .public-meeting-root .chat-composer {
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  }

  .public-meeting-root .chat-composer-row {
    gap: 6px;
    align-items: center;
  }

  .public-meeting-root .chat-composer-icons {
    padding-bottom: 0;
  }

  .public-meeting-root .chat-composer-input-wrap {
    gap: 4px;
  }

  .public-meeting-root .chat-input {
    min-height: 48px;
    padding: 12px 14px;
    font-size: 0.92rem;
  }
}

/* Workspace switcher — desktop only (hidden on mobile via media query) */
.ws-switcher {
  position: relative;
  display: none; /* shown only on desktop below */
}

@media (min-width: 768px) {
  .ws-switcher {
    display: block;
  }
}

.ws-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(140, 170, 200, 0.28);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
  white-space: nowrap;
  max-width: 180px;
}

.ws-switcher-btn:hover {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(124, 200, 244, 0.5);
  box-shadow: 0 2px 10px rgba(124, 200, 244, 0.15);
}

.ws-switcher-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c4d063;
  box-shadow: 0 0 6px rgba(196, 208, 99, 0.7);
  flex-shrink: 0;
}

.ws-switcher-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.ws-switcher-chevron {
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 180ms ease;
}

.ws-switcher-btn[aria-expanded="true"] .ws-switcher-chevron {
  transform: rotate(180deg);
}

.ws-switcher-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  max-width: 260px;
  background: #ffffff;
  border: 1px solid rgba(140, 170, 200, 0.22);
  border-radius: 16px;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.04),
    0 12px 28px rgba(78, 119, 155, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  padding: 6px;
  z-index: 200;
}

.ws-switcher-form {
  margin: 0;
}

.ws-switcher-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 100ms ease;
}

.ws-switcher-item:hover {
  background: rgba(124, 200, 244, 0.1);
}

.ws-switcher-item--active {
  background: rgba(196, 208, 99, 0.1);
  color: var(--navy);
}

.ws-switcher-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(140, 170, 200, 0.4);
  flex-shrink: 0;
}

.ws-switcher-item-dot--active {
  background: #c4d063;
  box-shadow: 0 0 6px rgba(196, 208, 99, 0.6);
}

.ws-switcher-check {
  margin-left: auto;
  color: #7a9e2e;
  flex-shrink: 0;
}

/* ─── Pricing page v2 ──────────────────────────────────────────────────────── */

.p2-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 3rem 1.5rem 6rem;
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

/* Hero */
.p2-hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.p2-headline {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0.2rem 0 0;
}

.p2-subhead {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
  max-width: 38ch;
}

/* Billing toggle */
.p2-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.p2-toggle-label {
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: opacity 0.2s, font-weight 0.2s;
}

.p2-save-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.18rem 0.55rem;
  border-radius: 99px;
  background: color-mix(in srgb, var(--color-accent, #7a9e2e) 18%, transparent);
  color: var(--color-accent, #7a9e2e);
  border: 1px solid color-mix(in srgb, var(--color-accent, #7a9e2e) 30%, transparent);
}

/* Toggle switch */
.p2-switch {
  display: inline-flex;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.p2-switch-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.p2-switch-track {
  display: block;
  width: 46px;
  height: 26px;
  border-radius: 99px;
  background: var(--color-border);
  transition: background 0.22s ease;
  position: relative;
}

.p2-switch-input:checked + .p2-switch-track {
  background: var(--lime-dark, #c4d063);
}

.p2-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  transition: transform 0.22s ease;
}

.p2-switch-input:checked + .p2-switch-track .p2-switch-thumb {
  transform: translateX(20px);
}

/* Manage bar */
.p2-manage-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.8rem 1.25rem;
  font-size: 0.88rem;
  text-align: center;
}

/* Plan grid */
.p2-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 900px) {
  .p2-grid {
    grid-template-columns: 1fr;
    max-width: 460px;
    margin-inline: auto;
  }
}

/* Plan cards */
.p2-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: 18px;
  padding: 1.75rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s;
}

.p2-card--pro {
  border-color: var(--color-accent, #7a9e2e);
  background: color-mix(in srgb, var(--color-accent, #7a9e2e) 3%, var(--color-surface));
  box-shadow:
    0 0 0 1px var(--color-accent, #7a9e2e),
    0 8px 32px rgba(122, 158, 46, 0.12),
    0 2px 8px rgba(0,0,0,0.06);
  margin-top: -0.5rem;
  padding-top: 2.25rem;
}

.p2-card--active {
  opacity: 0.75;
}

/* Badges */
.p2-badge {
  position: absolute;
  top: -0.72rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.22rem 0.75rem;
  border-radius: 99px;
  white-space: nowrap;
}

.p2-badge--popular {
  background: var(--color-accent, #7a9e2e);
  color: #fff;
}

.p2-badge--current {
  background: var(--color-surface-raised);
  border: 1.5px solid var(--color-border);
  color: var(--color-text-secondary);
}

/* Card header */
.p2-card-head {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.p2-plan-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

.p2-plan-sub {
  font-size: 0.81rem;
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.5;
}

.p2-price-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.05rem;
  margin-top: 0.6rem;
}

.p2-price-dollar {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.7;
  align-self: flex-start;
  margin-top: 0.4rem;
}

.p2-price-num {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  transition: opacity 0.15s;
}

.p2-price-per {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-left: 0.15rem;
}

.p2-price-note {
  font-size: 0.76rem;
  color: var(--color-text-secondary);
  margin: 0.15rem 0 0;
  min-height: 1.1em;
  transition: opacity 0.15s;
}

.p2-trial-note {
  font-size: 0.74rem;
  font-weight: 600;
  color: #16a34a;
  margin: 0.4rem 0 0;
  letter-spacing: 0.01em;
}

/* CTA */
.p2-cta-btn,
.p2-card form button,
.p2-card form a {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  justify-content: center;
}

.p2-current-pill {
  display: block;
  text-align: center;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  padding: 0.45rem 0;
  font-weight: 500;
}

/* Divider */
.p2-divider {
  height: 1px;
  background: var(--color-border);
  margin: 0.1rem 0;
}

/* Feature groups */
.p2-fg {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.p2-fg-label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.p2-fi-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.p2-fi {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.83rem;
  line-height: 1.45;
  color: var(--color-text);
}

.p2-fi--off {
  color: var(--color-text-secondary);
  opacity: 0.5;
}

/* SVG check / cross icons */
.p2-chk {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  margin-top: 0.1rem;
  color: var(--color-accent, #7a9e2e);
}

.p2-cross {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  margin-top: 0.1rem;
  color: var(--color-text-secondary);
}

/* Inline pills on feature rows */
.p2-pill {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.1rem 0.42rem;
  border-radius: 5px;
  vertical-align: middle;
  white-space: nowrap;
}

.p2-pill--neutral {
  background: var(--color-surface-raised);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.p2-pill--muted {
  background: var(--color-surface-raised);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.p2-pill--green {
  background: color-mix(in srgb, var(--color-accent, #7a9e2e) 14%, transparent);
  color: var(--color-accent, #7a9e2e);
  border: 1px solid color-mix(in srgb, var(--color-accent, #7a9e2e) 28%, transparent);
}

.p2-pill--blue {
  background: color-mix(in srgb, #5b8af5 14%, transparent);
  color: #5b8af5;
  border: 1px solid color-mix(in srgb, #5b8af5 28%, transparent);
}

.p2-pill--purple {
  background: color-mix(in srgb, #8b5cf6 14%, transparent);
  color: #8b5cf6;
  border: 1px solid color-mix(in srgb, #8b5cf6 28%, transparent);
}

/* FAQ */
.p2-faq {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding-top: 0.5rem;
}

.p2-faq-h {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.p2-faq-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 860px) {
  .p2-faq-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .p2-faq-grid {
    grid-template-columns: 1fr;
  }
}

.p2-faq-item {
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.p2-faq-item h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

.p2-faq-item p {
  font-size: 0.83rem;
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.55;
}

/* ─── Settings billing plan cards ──────────────────────────────────────────── */

.billing-alert {
  background: color-mix(in srgb, var(--color-warning, #e8a000) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-warning, #e8a000) 35%, transparent);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  color: var(--color-text);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.billing-hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.billing-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.billing-hero-action {
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

.settings-billing-plans {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-billing-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.settings-billing-plans-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.settings-billing-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  align-items: start;
}

@media (max-width: 860px) {
  .billing-hero-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .billing-hero-action,
  .billing-hero-action .ghost-button {
    width: 100%;
  }

  .settings-billing-cards {
    grid-template-columns: 1fr;
  }
}

.settings-plan-card {
  background: var(--color-surface-raised, var(--color-surface));
  border: 1.5px solid var(--color-border);
  border-radius: 16px;
  padding: 1.5rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.settings-plan-card--free {
  border-color: var(--color-border);
  background: color-mix(in srgb, var(--color-text-secondary) 4%, var(--color-surface));
}

.settings-plan-card--free::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-border);
  border-radius: 14px 14px 0 0;
}

.settings-plan-admin-note {
  display: block;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  text-align: center;
  padding: 0.3rem 0;
  opacity: 0.8;
}

.settings-plan-card--highlighted {
  border-color: var(--accent, #7cc8f4);
  background: color-mix(in srgb, var(--accent, #7cc8f4) 6%, var(--color-surface));
  box-shadow: 0 6px 24px color-mix(in srgb, var(--accent, #7cc8f4) 22%, transparent),
              0 1px 4px rgba(0,0,0,0.06);
  padding-top: 2rem;
}

.settings-plan-card--highlighted::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent, #7cc8f4);
  border-radius: 14px 14px 0 0;
}

.settings-plan-card--business {
  border-color: var(--navy, #203a52);
  background: color-mix(in srgb, var(--navy, #203a52) 4%, var(--color-surface));
  box-shadow: 0 4px 16px color-mix(in srgb, var(--navy, #203a52) 10%, transparent),
              0 1px 4px rgba(0,0,0,0.05);
}

.settings-plan-card--business::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--navy, #203a52);
  border-radius: 14px 14px 0 0;
}

.settings-plan-card--current {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px color-mix(in srgb, #16a34a 14%, transparent),
              0 6px 20px color-mix(in srgb, #16a34a 10%, transparent);
  background: color-mix(in srgb, #16a34a 4%, var(--color-surface));
}

.settings-plan-card--trial {
  border-color: color-mix(in srgb, #16a34a 40%, transparent);
}

.settings-plan-badge {
  position: absolute;
  top: -0.7rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.28rem 0.85rem;
  border-radius: 99px;
  white-space: nowrap;
}

.settings-plan-badge--popular {
  background: var(--lime-dark, #c4d063);
  color: var(--navy-deep, #102030);
  box-shadow: 0 2px 8px rgba(196, 208, 99, 0.5);
}

.settings-plan-badge--business {
  background: var(--navy, #203a52);
  color: #fff;
  box-shadow: 0 2px 8px rgba(32, 58, 82, 0.35);
}

.settings-plan-badge--current {
  background: #16a34a;
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.35);
}

.settings-plan-badge--trial {
  background: linear-gradient(135deg, var(--lime, #d5dd94) 0%, var(--accent, #7cc8f4) 100%);
  color: var(--navy-deep, #102030);
  box-shadow: 0 2px 8px rgba(124, 200, 244, 0.35);
}

.billing-trial-banner {
  background: color-mix(in srgb, #16a34a 10%, transparent);
  border: 1px solid color-mix(in srgb, #16a34a 30%, transparent);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  color: var(--color-text);
}

.settings-plan-header {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.settings-plan-name {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: var(--color-text-secondary);
  text-transform: uppercase;
}

.settings-plan-name--pro {
  color: var(--accent-dark, #58b4eb);
}

.settings-plan-name--business {
  color: var(--navy, #203a52);
}

.settings-plan-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  margin-top: 0.2rem;
}

.settings-plan-price {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--color-text);
}

.settings-plan-period {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--color-text-secondary);
}

.settings-plan-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  flex: 1;
}

.settings-plan-features li {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  padding-left: 1.1rem;
  position: relative;
  line-height: 1.45;
}

.settings-plan-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--lime-dark, #c4d063);
  font-size: 0.78rem;
  font-weight: 700;
}

.settings-plan-card--business .settings-plan-features li::before {
  color: var(--lime-dark, #c4d063);
}

.settings-plan-cta {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.settings-plan-cta-wrap {
  width: 100%;
}

.settings-plan-feature--note {
  color: var(--color-text-tertiary, var(--muted)) !important;
  font-style: italic;
}

.settings-plan-feature--note::before {
  content: "→" !important;
  color: var(--color-text-tertiary, var(--muted)) !important;
  font-weight: 400 !important;
}

.settings-plan-cta--pro {
  background: linear-gradient(135deg, var(--lime, #d5dd94) 0%, var(--accent, #7cc8f4) 100%) !important;
  color: var(--navy-deep, #102030) !important;
  border-color: rgba(108, 175, 221, 0.2) !important;
  box-shadow: 0 8px 24px rgba(124, 200, 244, 0.28),
              0 4px 0 rgba(255,255,255,0.42) inset !important;
}

.settings-plan-current-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: #16a34a;
  text-align: center;
  padding: 0.4rem 0;
}

.settings-credits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.settings-credit-bundle {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.settings-credit-bundle-mins {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
}

.settings-credit-bundle-price {
  font-size: 1rem;
  color: var(--color-text-secondary);
}

.settings-credits-balance {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

/* Settings billing yearly toggle */
.settings-billing-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.settings-billing-toggle-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: opacity 0.15s, font-weight 0.15s;
}

.settings-billing-save-badge {
  background: color-mix(in srgb, #16a34a 15%, transparent);
  color: #15803d;
  border-radius: 99px;
  padding: 0.1em 0.5em;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-left: 0.2rem;
}

.settings-billing-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  cursor: pointer;
}

.settings-billing-switch-input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.settings-billing-switch-track {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 99px;
  transition: background 0.25s;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.12);
}

.settings-billing-switch-input:checked + .settings-billing-switch-track {
  background: linear-gradient(135deg, var(--lime, #d5dd94) 0%, var(--accent, #7cc8f4) 100%);
  box-shadow:
    inset 0 1px 3px rgba(0,0,0,0.08),
    0 0 0 1px rgba(108, 175, 221, 0.25);
}

.settings-billing-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 1px 4px rgba(0,0,0,0.22),
    0 0 0 1px rgba(0,0,0,0.06);
}

.settings-billing-switch-input:checked ~ .settings-billing-switch-track .settings-billing-switch-thumb {
  transform: translateX(18px);
}

.settings-plan-billing-note {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-top: 0.1rem;
}

/* Usage meters */
.settings-usage-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 0.25rem;
}

.settings-usage-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.settings-usage-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
}

.settings-usage-numbers {
  font-weight: 700;
  font-size: 0.88rem;
}

.settings-usage-numbers--caution {
  color: #d97706;
}

.settings-usage-numbers--warn {
  color: #dc2626;
}

.settings-usage-of {
  font-weight: 400;
  color: var(--color-text-secondary);
  font-size: 0.82rem;
}

.settings-usage-bar-track {
  height: 8px;
  background: var(--color-surface-raised, #f1f5f9);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.settings-usage-bar-fill {
  height: 100%;
  background: var(--color-accent, #7a9e2e);
  border-radius: 99px;
  transition: width 0.4s ease;
  min-width: 2px;
}

.settings-usage-bar-fill--caution {
  background: #d97706;
}

.settings-usage-bar-fill--warn {
  background: #dc2626;
}

.settings-usage-warning {
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.settings-usage-warning--caution {
  color: #d97706;
}

.settings-usage-warning--warn {
  color: #dc2626;
}

.settings-usage-warning a {
  color: inherit;
  text-decoration: underline;
}

body.support-page {
  background:
    radial-gradient(circle at top left, rgba(124, 200, 244, 0.18), transparent 34%),
    radial-gradient(circle at 85% 12%, rgba(213, 221, 148, 0.18), transparent 28%),
    linear-gradient(180deg, #f6fbff 0%, #eef5fb 100%);
}

body.support-page .shell {
  min-height: 100vh;
}

.support-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 32px;
}

.support-page.stack-xl {
  gap: 16px;
}

.support-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(220px, 0.55fr);
  gap: 18px;
  align-items: center;
  overflow: hidden;
  padding: 20px 24px;
}

.support-hero h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  line-height: 1.2;
}

.support-hero p {
  margin: 0;
}

.support-hero-pills,
.support-chat-head-actions,
.support-quick-prompts,
.admin-support-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.support-avatar-shell {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.support-avatar {
  position: relative;
  width: 152px;
  height: 152px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.32) 42%, rgba(124, 200, 244, 0.2) 74%, rgba(88, 180, 235, 0.08) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(143, 166, 186, 0.2),
    0 22px 48px rgba(64, 80, 96, 0.16);
  overflow: hidden;
}

/* Slow rotating gradient sheen behind the icon for a smooth, "alive" glow. */
.support-avatar::before {
  content: "";
  position: absolute;
  inset: -25%;
  z-index: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(124, 200, 244, 0) 0deg,
    rgba(124, 200, 244, 0.28) 90deg,
    rgba(213, 221, 148, 0.26) 200deg,
    rgba(124, 200, 244, 0) 320deg
  );
  animation: support-avatar-spin 9s linear infinite;
}

.support-avatar--app {
  display: grid;
  place-items: center;
}

/* Expanding sonar/wave rings that ripple out from the centre. */
.support-avatar-orb {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid rgba(124, 200, 244, 0.5);
  background: radial-gradient(circle, rgba(124, 200, 244, 0.16), transparent 70%);
  transform: scale(0.4);
  opacity: 0;
  animation: support-sonar 4.4s ease-out infinite;
}

.support-avatar-orb-2 {
  inset: 0;
  animation-delay: 2.2s;
}

.support-avatar-app-icon {
  position: relative;
  z-index: 2;
  width: 68px;
  height: 68px;
  padding: 4px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 14px 22px rgba(64, 80, 96, 0.18));
}

.support-avatar-app-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.support-avatar-face {
  position: absolute;
  inset: 42px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 251, 255, 0.88));
  display: grid;
  place-items: center;
  gap: 18px;
  box-shadow: inset 0 0 0 1px rgba(143, 166, 186, 0.18);
}

.support-avatar-eye {
  position: absolute;
  top: 68px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--navy);
}

.support-avatar-eye:first-child {
  left: 56px;
}

.support-avatar-eye:nth-child(2) {
  right: 56px;
}

.support-avatar-mouth {
  position: absolute;
  bottom: 52px;
  width: 30px;
  height: 10px;
  border-radius: 0 0 999px 999px;
  border-bottom: 4px solid var(--navy);
  opacity: 0.9;
}

.support-avatar.is-speaking .support-avatar-mouth {
  animation: support-mouth 0.6s ease-in-out infinite;
}

.support-avatar.is-thinking .support-avatar-face {
  transform: translateY(0);
  animation: support-thinking 1.8s ease-in-out infinite;
}

.support-avatar.is-listening .support-avatar-orb {
  animation-duration: 2.8s;
}

.support-avatar-caption {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.support-layout {
  align-items: start;
}

.support-tab-shell {
  display: grid;
  gap: 14px;
}

.support-tab-panels {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: 16px;
  align-items: start;
}

.support-report-card,
.support-report-history {
  padding: 20px;
}

.support-report-list-shell {
  padding: 16px;
}

.support-tab-switcher {
  display: none;
  gap: 10px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(143, 166, 186, 0.12);
  box-shadow: 0 10px 24px rgba(64, 80, 96, 0.06);
}

.support-tab-btn {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  font: inherit;
  cursor: pointer;
  padding: 0 14px;
  white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.support-tab-btn.is-active {
  color: var(--navy);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.96));
  border-color: rgba(143, 166, 186, 0.16);
  box-shadow: 0 8px 16px rgba(64, 80, 96, 0.07);
}

.support-tab-panel {
  display: grid;
}

.support-tab-panel[data-support-panel="report"] {
  align-self: start;
}

.support-chat-card,
.support-report-card {
  min-width: 0;
}

.support-chat-card {
  display: grid;
  gap: 16px;
}
.support-quick-prompts--compact {
  gap: 8px;
}

.support-chat-log {
  display: grid;
  gap: 12px;
  max-height: 420px;
  overflow: auto;
  padding-right: 2px;
  padding-bottom: 2px;
}

.support-message {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
}

.support-message--assistant {
  background: var(--panel-muted);
}

.support-message--user {
  background: rgba(124, 200, 244, 0.12);
  border-color: rgba(124, 200, 244, 0.3);
  margin-left: auto;
}

.support-message-role {
  display: block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.support-message p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.55;
}

.support-prompt-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--navy);
  font-weight: 700;
}

.support-composer {
  display: grid;
  gap: 12px;
}

.support-composer-shell {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px 48px;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 999px;
  border: 1px solid rgba(143, 166, 186, 0.16);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(64, 80, 96, 0.06);
}

.support-composer-field {
  min-width: 0;
}

.support-composer-input {
  min-height: 46px;
  max-height: 96px;
  resize: none;
  border: none;
  background: transparent;
  padding-inline: 0;
  box-shadow: none;
}

.support-composer-input:focus {
  box-shadow: none;
}

.support-composer-icon-btn,
.support-composer-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(143, 166, 186, 0.18);
  background: rgba(249, 252, 255, 0.96);
  color: var(--navy);
  display: grid;
  place-items: center;
  font-weight: 700;
}

.support-composer-icon-btn.is-active {
  background: rgba(124, 200, 244, 0.14);
  border-color: rgba(124, 200, 244, 0.42);
}

.support-composer-send {
  background: linear-gradient(135deg, rgba(213, 221, 148, 0.95), rgba(124, 200, 244, 0.95));
  border-color: rgba(124, 200, 244, 0.2);
  font-size: 1.02rem;
}

.support-composer-send:hover,
.support-composer-icon-btn:hover,
.support-voice-btn:hover {
  transform: translateY(-1px);
}

.support-voice-btn,
.support-composer-icon-btn,
.support-composer-send,
.support-prompt-chip,
.ghost-button[data-support-voice-toggle],
.ghost-button[data-support-voice-mode] {
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.support-report-form {
  display: grid;
  gap: 14px;
}

.support-report-form label {
  display: grid;
  gap: 6px;
}

.support-report-form textarea,
.support-report-form input,
.support-report-form select {
  width: 100%;
}

.support-upload-field {
  display: grid;
  gap: 6px;
}

.support-upload-field input[type="file"] {
  padding: 12px 14px;
}

.support-report-history {
  display: grid;
  gap: 12px;
}

.support-plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 13px;
  border-radius: 999px;
  border: 1px solid rgba(143, 166, 186, 0.22);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 18px rgba(64, 80, 96, 0.06);
}

.support-plan-badge-label {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.support-plan-badge-value {
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #fff;
}

.support-plan-badge[data-plan="free"] .support-plan-badge-value {
  background: linear-gradient(135deg, #8aa0b3, #6b8398);
}

.support-plan-badge[data-plan="pro"] {
  border-color: rgba(56, 132, 204, 0.32);
  background: rgba(124, 200, 244, 0.12);
}

.support-plan-badge[data-plan="pro"] .support-plan-badge-value {
  background: linear-gradient(135deg, #4ea3e8, #2b6cb0);
}

.support-plan-badge[data-plan="business"] {
  border-color: rgba(199, 158, 58, 0.4);
  background: rgba(224, 188, 96, 0.16);
}

.support-plan-badge[data-plan="business"] .support-plan-badge-value {
  background: linear-gradient(135deg, #e0b44a, #b8821f);
}

.support-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid transparent;
}

.support-status-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.support-status-badge[data-status="open"] {
  color: #1f8a4c;
  background: rgba(34, 170, 96, 0.14);
  border-color: rgba(34, 170, 96, 0.28);
}

.support-status-badge[data-status="closed"] {
  color: #5b6b7a;
  background: rgba(91, 107, 122, 0.12);
  border-color: rgba(91, 107, 122, 0.22);
}

.support-category-badge {
  display: inline-flex;
  align-items: center;
  align-self: start;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  border: 1px solid transparent;
}

.support-category-badge[data-category="bug"] {
  color: #c0392b;
  background: rgba(214, 69, 51, 0.12);
  border-color: rgba(214, 69, 51, 0.26);
}

.support-category-badge[data-category="billing"] {
  color: #b9791a;
  background: rgba(224, 158, 38, 0.16);
  border-color: rgba(224, 158, 38, 0.3);
}

.support-category-badge[data-category="how-to"] {
  color: #2b6cb0;
  background: rgba(56, 132, 204, 0.13);
  border-color: rgba(56, 132, 204, 0.28);
}

.support-category-badge[data-category="feedback"] {
  color: #4d7c1f;
  background: rgba(124, 168, 38, 0.16);
  border-color: rgba(124, 168, 38, 0.32);
}

.support-category-badge[data-category="account"] {
  color: #7d4fb0;
  background: rgba(138, 92, 198, 0.14);
  border-color: rgba(138, 92, 198, 0.28);
}

.support-category-badge[data-category="other"] {
  color: #4f6479;
  background: rgba(120, 140, 160, 0.14);
  border-color: rgba(120, 140, 160, 0.28);
}

.support-report-inbox-shell {
  display: grid;
  gap: 16px;
  width: 100%;
  justify-self: stretch;
}

.support-report-list-shell,
.support-report-detail-view {
  min-width: 0;
  width: 100%;
  justify-self: stretch;
}

.support-report-list-shell {
  display: grid;
  gap: 14px;
  width: 100%;
}

.support-report-list-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.support-report-list-item-wrap {
  display: grid;
  gap: 10px;
  width: 100%;
}

.support-report-list[data-support-ticket-list] {
  gap: 10px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
}

.support-report-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.support-report-pagination .ghost-button {
  min-width: 88px;
}

.support-report-detail-view[hidden],
.support-report-list-shell[hidden] {
  display: none !important;
}

body.support-modal-open {
  overflow: hidden;
}

.support-report-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
}

.support-report-modal[hidden] {
  display: none;
}

.support-report-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(16, 32, 48, 0.42);
  backdrop-filter: blur(4px);
}

.support-report-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 249, 253, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow: 0 36px 90px rgba(16, 32, 48, 0.32);
  padding: 18px;
  animation: support-modal-pop 160ms ease;
}

@keyframes support-modal-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.support-report-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(143, 166, 186, 0.2);
  background: rgba(255, 255, 255, 0.92);
  color: var(--navy);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 2;
  transition: transform 140ms ease, background 140ms ease;
}

.support-report-modal-close:hover {
  transform: translateY(-1px);
  background: rgba(244, 249, 253, 0.98);
}

.support-report-modal-body .support-report-thread {
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 0;
}

.support-user-report-detail {
  min-height: calc(100% - 0px);
}

.support-user-reply-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(143, 166, 186, 0.16);
  background: rgba(255, 255, 255, 0.88);
}

.support-attachment-list {
  display: grid;
  gap: 10px;
}

.support-attachment-card {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(143, 166, 186, 0.16);
  background: rgba(255, 255, 255, 0.92);
}

.support-attachment-image-link {
  display: block;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(143, 166, 186, 0.16);
}

.support-attachment-image {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
}

.support-attachment-file-preview {
  --doc-color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 86px;
  border-radius: 14px;
  color: var(--doc-color);
  background: color-mix(in srgb, var(--doc-color) 10%, white);
}

.support-attachment-file-icon {
  width: 34px;
  height: 34px;
}

.support-attachment-file-ext {
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.support-attachment-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.support-attachment-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.support-attachment-name {
  font-size: 0.92rem;
  line-height: 1.35;
}

.support-attachment-kind {
  font-size: 0.76rem;
  color: var(--muted);
}

.support-attachment-download {
  flex-shrink: 0;
  padding: 0.4rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(124, 200, 244, 0.24);
  background: rgba(124, 200, 244, 0.14);
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.support-attachment-download-disabled {
  opacity: 0.7;
}

.support-user-message-section {
  display: grid;
  gap: 10px;
}

.support-report-history-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

.support-report-history-head > .stack-xs {
  flex: 1;
  min-width: 0;
}

.support-report-history-head > .pill {
  flex-shrink: 0;
}

.support-report-history-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  width: 100%;
}

.support-report-chip-strip {
  display: none;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
  grid-column: 1 / -1;
}

.support-report-chip {
  flex: 0 0 auto;
  min-width: 176px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(143, 166, 186, 0.16);
  background: rgba(255, 255, 255, 0.94);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(64, 80, 96, 0.04);
}

.support-report-chip.is-active {
  border-color: rgba(124, 200, 244, 0.48);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 248, 253, 0.96));
  box-shadow: 0 10px 20px rgba(64, 80, 96, 0.08);
}

.support-report-chip-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.support-report-chip-copy strong {
  font-size: 0.9rem;
  line-height: 1.2;
}

.support-report-chip-copy span {
  font-size: 0.76rem;
  color: var(--muted);
}

.support-report-chip-open {
  flex-shrink: 0;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(124, 200, 244, 0.12);
  border: 1px solid rgba(124, 200, 244, 0.18);
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 800;
}

.support-report-chip-actions {
  flex-shrink: 0;
  display: grid;
  justify-items: end;
  gap: 6px;
}

.support-report-chip-reply {
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(213, 221, 148, 0.22);
  border: 1px solid rgba(213, 221, 148, 0.34);
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.support-report-list {
  display: grid;
  gap: 10px;
}

.support-user-report-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(143, 166, 186, 0.16);
  background: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  color: inherit;
  width: 100%;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.support-user-report-item.is-active {
  border-color: rgba(124, 200, 244, 0.5);
  box-shadow: 0 12px 24px rgba(64, 80, 96, 0.08);
}

.support-user-report-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.support-user-report-preview,
.support-user-report-latest {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.support-user-report-latest {
  color: var(--navy);
}

.support-user-report-reply-pill,
.admin-support-reply-pill {
  color: #0f4d75;
  border-color: rgba(124, 200, 244, 0.3);
  background: rgba(124, 200, 244, 0.14);
}

.support-report-thread {
  min-height: 100%;
  display: grid;
  gap: 14px;
}

.support-report-thread-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.support-report-modal-body .support-report-thread-head {
  padding-right: 44px;
}

.support-reply-notice {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  border: 1px solid rgba(124, 200, 244, 0.22);
  background: linear-gradient(180deg, rgba(124, 200, 244, 0.12), rgba(255, 255, 255, 0.94));
}

.support-reply-notice-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.support-reply-notice-copy strong {
  color: var(--navy);
  font-size: 0.96rem;
}

.support-reply-notice-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.admin-support-reply-list {
  display: grid;
  gap: 10px;
}

.admin-support-reply {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(143, 166, 186, 0.16);
}

.admin-support-reply--admin {
  background: rgba(124, 200, 244, 0.09);
  border-color: rgba(124, 200, 244, 0.22);
}

.admin-support-reply-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.admin-support-reply-head strong {
  color: var(--navy);
}

.admin-support-reply p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-wrap;
}

.admin-support-reply-time {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.admin-support-reply-form {
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(143, 166, 186, 0.16);
  background: rgba(255, 255, 255, 0.88);
}

.admin-support-inbox {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(0, 1.55fr);
  gap: 16px;
  align-items: start;
}

.admin-support-sidebar,
.admin-support-detail-pane {
  min-width: 0;
}

.admin-support-sidebar {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 20px;
}

.admin-support-sidebar-head {
  display: grid;
  gap: 8px;
}

.admin-support-toolbar {
  display: grid;
  gap: 12px;
}

.admin-support-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-support-filters a.pill {
  text-decoration: none;
}

/* Status / Category filter groups */
.admin-support-filter-group {
  display: grid;
  gap: 6px;
}

.admin-support-filter-label {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Segmented control for status */
.admin-support-segment {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(143, 166, 186, 0.16);
  box-shadow: inset 0 1px 2px rgba(64, 80, 96, 0.04);
}

.admin-support-seg {
  flex: 1;
  text-align: center;
  text-decoration: none;
  padding: 7px 16px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--muted);
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.admin-support-seg:hover {
  color: var(--navy);
}

.admin-support-seg.is-active {
  color: var(--navy);
  background: #fff;
  box-shadow: 0 4px 10px rgba(64, 80, 96, 0.08);
}

/* Category chips */
.admin-support-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.admin-support-chip {
  text-decoration: none;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid rgba(143, 166, 186, 0.22);
  background: rgba(255, 255, 255, 0.86);
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.admin-support-chip:hover {
  color: var(--navy);
  border-color: rgba(124, 200, 244, 0.4);
}

.admin-support-chip.is-active {
  color: var(--navy);
  border-color: rgba(124, 200, 244, 0.5);
  background: linear-gradient(135deg, rgba(124, 200, 244, 0.16), rgba(213, 221, 148, 0.18));
  box-shadow: 0 6px 14px rgba(64, 80, 96, 0.06);
}

/* Stat tiles */
.admin-support-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 14px;
  border: 1px solid rgba(143, 166, 186, 0.18);
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.admin-support-stat strong {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
}

.admin-support-stat[data-tone="open"] {
  border-color: rgba(34, 170, 96, 0.28);
  background: rgba(34, 170, 96, 0.1);
}

.admin-support-stat[data-tone="open"] strong {
  color: #1f8a4c;
}

.admin-support-stat[data-tone="closed"] strong {
  color: #5b6b7a;
}

.admin-support-thread-list {
  display: grid;
  gap: 10px;
  max-height: 72vh;
  overflow: auto;
  padding-right: 2px;
}

.admin-support-report-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(143, 166, 186, 0.16);
  background: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 6px 14px rgba(64, 80, 96, 0.04);
}

.admin-support-report-item:hover {
  border-color: rgba(124, 200, 244, 0.36);
  box-shadow: 0 10px 22px rgba(64, 80, 96, 0.08);
}

.admin-support-report-item.is-active {
  border-color: rgba(124, 200, 244, 0.5);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 248, 253, 0.96));
  box-shadow:
    0 12px 26px rgba(64, 80, 96, 0.08),
    inset 0 0 0 1px rgba(124, 200, 244, 0.18);
}

.admin-support-report-avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(124, 200, 244, 0.2), rgba(255, 255, 255, 0.96));
  border: 1px solid rgba(124, 200, 244, 0.2);
  color: var(--navy);
  font-weight: 800;
  flex-shrink: 0;
}

.admin-support-report-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.admin-support-report-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.admin-support-report-row strong {
  font-size: 0.96rem;
  line-height: 1.2;
}

.admin-support-report-time {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.admin-support-report-subtitle,
.admin-support-report-preview {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.admin-support-report-preview {
  color: var(--navy);
  opacity: 0.82;
}

.admin-support-report-meta,
.admin-support-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-support-detail-pane {
  min-height: 76vh;
  display: grid;
}

.admin-support-detail-shell {
  display: grid;
  gap: 14px;
}

.admin-support-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-support-detail-head h2 {
  margin: 0;
}

.admin-support-detail-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-support-ticket {
  display: grid;
  gap: 14px;
}

.admin-support-ticket h3 {
  margin: 0;
}

.admin-support-ticket-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.admin-support-ticket-copy {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.admin-support-ticket-preview {
  margin: 0;
  color: var(--navy);
  line-height: 1.55;
}

.admin-support-ticket-chip--link {
  text-decoration: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color 140ms ease, background 140ms ease;
}

.admin-support-ticket-chip--link:hover {
  border-color: rgba(124, 200, 244, 0.4);
  background: rgba(124, 200, 244, 0.08);
}

.support-plan-badge--sm {
  padding: 3px 4px 3px 10px;
  gap: 6px;
}

.support-plan-badge--sm .support-plan-badge-value {
  padding: 2px 9px;
  font-size: 0.72rem;
}

.admin-support-ticket-actions {
  display: grid;
  justify-items: end;
}

.admin-support-ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-support-ticket-chip {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(143, 166, 186, 0.16);
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-size: 0.84rem;
}

.admin-support-ticket-chip strong {
  color: var(--navy);
}

.admin-support-transcript {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.admin-support-transcript summary {
  cursor: pointer;
  font-weight: 700;
}

.admin-support-transcript pre {
  margin: 10px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--muted);
}

.admin-support-empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1.25rem;
}

/* Only the admin "No report selected" placeholder fills the detail pane. */
.admin-support-detail-pane > .admin-support-empty-state {
  min-height: 58vh;
  padding: 2rem;
}

.admin-support-empty-illustration {
  width: 124px;
  height: 94px;
  position: relative;
  margin-bottom: 0.75rem;
}

.admin-support-empty-bubble {
  position: absolute;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(124, 200, 244, 0.28), rgba(255, 255, 255, 0.96));
  border: 1px solid rgba(124, 200, 244, 0.22);
  box-shadow: 0 10px 20px rgba(64, 80, 96, 0.08);
}

.admin-support-empty-bubble--one {
  width: 62px;
  height: 42px;
  left: 8px;
  top: 18px;
}

.admin-support-empty-bubble--two {
  width: 72px;
  height: 48px;
  right: 4px;
  top: 0;
  background: linear-gradient(180deg, rgba(213, 221, 148, 0.32), rgba(255, 255, 255, 0.96));
  transform: rotate(8deg);
}

.pill.is-active,
.admin-support-filters .pill.is-active {
  color: var(--navy);
  border-color: rgba(124, 200, 244, 0.34);
  background: linear-gradient(135deg, rgba(124, 200, 244, 0.14), rgba(213, 221, 148, 0.16));
  box-shadow: 0 8px 18px rgba(64, 80, 96, 0.06);
}

.mono {
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 0.92em;
}

@keyframes support-orbreathe {
  0%, 100% { transform: scale(0.98); opacity: 0.78; }
  50% { transform: scale(1.03); opacity: 1; }
}

@keyframes support-sonar {
  0% { transform: scale(0.4); opacity: 0; }
  15% { opacity: 0.7; }
  70% { opacity: 0.18; }
  100% { transform: scale(2.6); opacity: 0; }
}

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

@media (prefers-reduced-motion: reduce) {
  .support-avatar::before,
  .support-avatar-orb {
    animation: none;
  }
}

@keyframes support-mouth {
  0%, 100% { transform: scaleY(0.8); }
  50% { transform: scaleY(1.25); }
}

@keyframes support-thinking {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@media (max-width: 860px) {
  body.support-page .shell {
    min-height: auto;
  }

  .support-page {
    width: min(100% - 24px, 1180px);
    padding-top: 18px;
    padding-bottom: 24px;
  }

  .support-page.stack-xl {
    gap: 18px;
  }

  .support-hero,
  .grid-two.support-layout {
    grid-template-columns: 1fr;
  }

  .support-tab-switcher {
    display: flex;
    align-items: stretch;
  }

  .support-tab-panels {
    display: block;
  }

  .support-tab-panel {
    display: none;
  }

  .support-tab-panel.is-active {
    display: grid;
  }

  .support-report-inbox-shell {
    gap: 14px;
  }

  .support-voice-stage,
  .support-composer-shell {
    grid-template-columns: 1fr;
    border-radius: 24px;
  }

  .support-voice-actions {
    grid-template-columns: repeat(2, auto);
    justify-content: start;
  }

  .admin-support-inbox {
    grid-template-columns: 1fr;
  }

  .admin-support-sidebar {
    position: static;
  }

  .admin-support-thread-list,
  .admin-support-detail-pane,
  .admin-support-empty-state {
    max-height: none;
    min-height: unset;
  }

  .support-report-history-grid,
  .admin-support-inbox {
    grid-template-columns: 1fr;
  }

  .support-report-thread {
    border-width: 1px;
    box-shadow: 0 16px 34px rgba(64, 80, 96, 0.08);
  }

  .support-reply-notice {
    flex-direction: column;
  }

  .support-avatar {
    width: 156px;
    height: 156px;
  }

  .support-avatar-app-icon {
    width: 64px;
    height: 64px;
  }

  .admin-support-ticket-head {
    flex-direction: column;
  }

  .admin-support-ticket-actions {
    justify-items: start;
  }
}

@media (max-width: 640px) {
  body.analytics-fullscreen-page .analytics-hub-main {
    padding: 12px 12px 20px;
    gap: 12px;
  }

  body.analytics-fullscreen-page .analytics-hero {
    padding: 18px 16px 14px;
    border-radius: 22px;
  }

  body.analytics-fullscreen-page .analytics-hero-inner {
    gap: 12px;
  }

  body.analytics-fullscreen-page .analytics-hero-title {
    font-size: clamp(1.22rem, 5.1vw, 1.55rem);
    line-height: 1.05;
  }

  body.analytics-fullscreen-page .analytics-hero-sub {
    max-width: 28ch;
    line-height: 1.45;
  }

  body.analytics-fullscreen-page .analytics-hero-badge {
    width: 100%;
    padding: 12px 14px;
    align-items: flex-start;
    border-radius: 14px;
  }

  body.analytics-fullscreen-page .analytics-filter-bar-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
    gap: 10px;
    border-radius: 24px;
    background:
      radial-gradient(circle at top right, rgba(124, 200, 244, 0.16), transparent 32%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 249, 253, 0.97));
    box-shadow:
      0 16px 34px rgba(64, 80, 96, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.94);
  }

  body.analytics-fullscreen-page .analytics-filter-bar-form > * {
    min-width: 0;
  }

  body.analytics-fullscreen-page .analytics-filter-chips-row {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  body.analytics-fullscreen-page .analytics-filter-chips-row::-webkit-scrollbar {
    display: none;
  }

  body.analytics-fullscreen-page .analytics-chip {
    flex: 0 0 auto;
    width: auto;
    height: 36px;
    padding: 0 14px;
    border-radius: 14px;
    font-size: 0.78rem;
  }

  body.analytics-fullscreen-page .analytics-filter-date-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-left: 0;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.66);
    border: 1px solid rgba(143, 166, 186, 0.18);
  }

  body.analytics-fullscreen-page .analytics-date-input {
    width: 100%;
    min-width: 0;
    height: 42px;
    border-radius: 12px;
    font-size: 0.84rem;
  }

  body.analytics-fullscreen-page .analytics-date-sep {
    display: none;
  }

  body.analytics-fullscreen-page .analytics-apply-btn,
  body.analytics-fullscreen-page .analytics-reset-btn {
    grid-column: 1 / -1;
    width: 100%;
    height: 42px;
    border-radius: 14px;
  }

  body.analytics-fullscreen-page .analytics-filter-right {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding-left: 0;
    border-left: 0;
  }

  body.analytics-fullscreen-page .analytics-currency-badge,
  body.analytics-fullscreen-page .analytics-icon-btn:not(.analytics-icon-btn--accent) {
    display: none;
  }

  body.analytics-fullscreen-page .analytics-icon-btn--accent {
    width: 100%;
    height: 42px;
    border-radius: 14px;
    justify-content: center;
  }

  body.analytics-fullscreen-page .analytics-body {
    gap: 12px;
  }
}
