/* Fonts are self-hosted via fonts.css (linked before this file in each layout) */
/* Design tokens */
:root {
  /* Layout */
  --sidebar-width: 14rem;
  --sidebar-width-collapsed: 3.5rem;
  --topbar-height: 3.5rem;

  /* Brand color scale (indigo) */
  --brand-50:  #eef2ff;
  --brand-100: #e0e7ff;
  --brand-200: #c7d2fe;
  --brand-300: #a5b4fc;
  --brand-400: #818cf8;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --brand-800: #3730a3;
  --brand-900: #312e81;
  --brand-950: #1e1b4b;

  /* Ink darks */
  --ink-950: #07061a;
  --ink-900: #0e0c27;

  /* Legacy RGB triples kept for backward compat */
  --brand-primary-rgb: 99 102 241;
  --brand-primary-hover-rgb: 129 140 248;
  --brand-primary-active-rgb: 79 70 229;
  --brand-accent-rgb: 129 140 248;
  --brand-ink-rgb: 30 27 75;

  /* Fonts */
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Semantic surface tokens — light mode */
  --bg:             #f9fafb;
  --surface:        #ffffff;
  --surface-2:      #f3f4f6;
  --surface-3:      #e5e7eb;
  --text:           #111827;
  --text-muted:     #4b5563;
  --text-faint:     #9ca3af;
  --border:         #e5e7eb;
  --border-subtle:  #f3f4f6;
  --input-bg:       #ffffff;
  --input-border:   #e5e7eb;
  --ring:           rgba(99, 102, 241, 0.15);

  /* Auth background */
  --auth-bg: linear-gradient(145deg, #eeeeff 0%, #f9fafb 45%, #f4f3ff 100%);

  color-scheme: light;

  /* Status tokens */
  --success:        #10b981;
  --success-bg:     #ecfdf5;
  --success-text:   #065f46;
  --warning:        #f59e0b;
  --warning-bg:     #fffbeb;
  --warning-text:   #92400e;
  --danger:         #ef4444;
  --danger-bg:      #fef2f2;
  --danger-text:    #991b1b;
  --info:           #0ea5e9;
  --info-bg:        #f0f9ff;
  --info-text:      #0c4a6e;
}

.dark {
  /* Semantic surface tokens — dark mode */
  --bg:             #09080f;
  --surface:        rgba(255,255,255,0.08);
  --surface-2:      rgba(255,255,255,0.12);
  --surface-3:      rgba(255,255,255,0.17);
  --text:           rgba(255,255,255,0.92);
  --text-muted:     rgba(255,255,255,0.60);
  --text-faint:     rgba(255,255,255,0.35);
  --border:         rgba(255,255,255,0.10);
  --border-subtle:  rgba(255,255,255,0.06);
  --input-bg:       rgba(255,255,255,0.06);
  --input-border:   rgba(255,255,255,0.14);
  --ring:           rgba(99, 102, 241, 0.25);

  /* Status tokens — dark */
  --success-bg:     rgba(16,185,129,0.12);
  --success-text:   #6ee7b7;
  --warning-bg:     rgba(245,158,11,0.12);
  --warning-text:   #fcd34d;
  --danger-bg:      rgba(239,68,68,0.12);
  --danger-text:    #fca5a5;
  --info-bg:        rgba(14,165,233,0.12);
  --info-text:      #7dd3fc;

  /* Auth background — dark */
  --auth-bg: radial-gradient(ellipse 90% 50% at 50% 0%, rgba(99,102,241,0.18) 0%, transparent 70%), #09080f;

  color-scheme: dark;
}

/* Dark mode component overrides */
.dark .btn-primary {
  background-color: var(--brand-400);
  box-shadow: 0 0 0 1px rgba(129,140,248,0.20), 0 2px 8px rgba(99,102,241,0.30);
  color: #fff !important;
}
.dark .btn-primary:hover {
  background-color: var(--brand-300);
  box-shadow: 0 0 0 1px rgba(165,180,252,0.30), 0 2px 12px rgba(99,102,241,0.40);
}
.dark .btn-primary:active {
  background-color: var(--brand-500);
  box-shadow: none;
}

/* Native select option popup — dark mode */
.dark .form-select option,
.dark select option {
  background-color: #1a1828;
  color: rgba(255,255,255,0.92);
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
body{
  background-color: var(--bg);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text);
}
body:is(.dark *){
  background-color: var(--bg);
  color: var(--text);
}
.font-display { font-family: var(--font-display); }
.font-mono, code, pre { font-family: var(--font-mono); }
body {
  line-height: 1.5;
  margin: 0;
  overflow-x: hidden;
}
a{
  color: var(--brand-600);
  text-decoration-line: none;
  transition: color 0.15s;
}
a:hover{
  color: var(--brand-500);
}
a:is(.dark *){
  color: var(--brand-400);
}
a:hover:is(.dark *){
  color: var(--brand-300);
}
button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}
/* Standard focus ring for keyboard navigation */
:focus-visible{
  outline: 2px solid var(--brand-400);
  outline-offset: 2px;
}
/* Icon sizing helpers */
.icon-xs  { width: 0.75rem;  height: 0.75rem;  flex-shrink: 0; }
.icon-sm  { width: 1rem;     height: 1rem;     flex-shrink: 0; }
.icon-md  { width: 1.25rem;  height: 1.25rem;  flex-shrink: 0; }
.icon-lg  { width: 1.5rem;   height: 1.5rem;   flex-shrink: 0; }
.icon-xl  { width: 2rem;     height: 2rem;     flex-shrink: 0; }
.icon-2xl { width: 3rem;     height: 3rem;     flex-shrink: 0; }
/* Primitives */
/* Vertical stacks */
.stack-v    { display: flex; flex-direction: column; gap: 1rem; }
.stack-v-xs { display: flex; flex-direction: column; gap: 0.25rem; }
.stack-v-sm { display: flex; flex-direction: column; gap: 0.5rem; }
.stack-v-lg { display: flex; flex-direction: column; gap: 1.5rem; }
/* Horizontal stacks */
.stack-h    { display: flex; flex-direction: row; align-items: center; gap: 0.5rem; }
.stack-h-sm { display: flex; flex-direction: row; align-items: center; gap: 0.25rem; }
.stack-h-lg { display: flex; flex-direction: row; align-items: center; gap: 1rem; }
/* Space-between row */
.stack-h-between { display: flex; flex-direction: row; align-items: center; justify-content: space-between; }
/* Wrapping inline cluster */
.cluster { display: flex; flex-wrap: wrap; gap: 0.5rem; }
/* Flex spacer — pushes siblings to opposite ends */
.spacer { flex: 1; }
.grid-2col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 1rem; }
.grid-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1rem; }
.grid-4col { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1rem; margin-bottom: 1rem; }
/* No bottom margin when grid is the last element in its container */
.grid-2col:last-child,
.grid-3col:last-child,
.grid-4col:last-child,
.grid-auto:last-child { margin-bottom: 0; }
/* Responsive: collapse to single column on narrow screens */
@media (max-width: 640px) {
  .grid-2col,
  .grid-3col,
  .grid-4col { grid-template-columns: 1fr; }
}
.container-page   { max-width: 80rem;  margin: 0 auto; width: 100%; }
.container-narrow { max-width: 42rem;  margin: 0 auto; width: 100%; }
.container-xs     { max-width: 28rem;  margin: 0 auto; width: 100%; }
/* Components */
.btn-primary{
  display: inline-flex;
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  align-items: center;
  gap: 0.375rem;
  border-radius: 0.75rem;
  border: 1px solid transparent;
  background-color: var(--brand-500);
  padding: 0.4375rem 0.875rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  transition-property: color, background-color, border-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.btn-primary:hover{ background-color: var(--brand-400); }
.btn-primary:active{ background-color: var(--brand-600); }

.btn-secondary{
  display: inline-flex;
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  align-items: center;
  gap: 0.375rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background-color: var(--surface);
  padding: 0.4375rem 0.875rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: var(--text);
  transition-property: color, background-color, border-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.btn-secondary:hover{
  background-color: var(--surface-2);
  color: var(--text);
}
.btn-secondary:active{ background-color: var(--surface-3); }

.btn-ghost{
  display: inline-flex;
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  align-items: center;
  gap: 0.375rem;
  border-radius: 0.75rem;
  border: 1px solid transparent;
  padding: 0.4375rem 0.875rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: var(--text);
  transition-property: color, background-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.btn-ghost:hover{
  background-color: var(--surface-2);
  color: var(--text);
}
.btn-ghost:active{ background-color: var(--surface-3); }

.btn-danger{
  display: inline-flex;
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  align-items: center;
  gap: 0.375rem;
  border-radius: 0.75rem;
  border: 1px solid transparent;
  background-color: var(--danger);
  padding: 0.4375rem 0.875rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  transition-property: color, background-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.btn-danger:hover{ background-color: #dc2626; }
.btn-danger:active{ background-color: #b91c1c; }

.btn-success{
  display: inline-flex;
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  align-items: center;
  gap: 0.375rem;
  border-radius: 0.75rem;
  border: 1px solid transparent;
  background-color: var(--success);
  padding: 0.4375rem 0.875rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  transition-property: color, background-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.btn-success:hover{ background-color: #059669; }
.btn-success:active{ background-color: #047857; }

/* Icon-only button — square, no text */
.btn-icon{
  display: inline-flex;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  padding: 0.375rem;
  color: var(--text-faint);
  transition-property: color, background-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.btn-icon:hover{
  background-color: var(--surface-2);
  color: var(--text-muted);
}
/* Modifiers */
.btn-full{
  width: 100%;
  justify-content: center;
}
.btn-sm{
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  font-size: 0.75rem;
  line-height: 1rem;
}
.btn-ghost-danger{
  color: var(--danger);
}
.btn-ghost-danger:hover{
  color: var(--danger-text);
  background-color: var(--danger-bg);
}
.btn-lg{
  padding-left: 1rem;
  padding-right: 1rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5rem;
}
/* SSO / OAuth button */
.btn-sso{
  display: flex;
  width: 100%;
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.375rem;
  border-width: 1px;
  --tw-border-opacity: 1;
  border-color: var(--border);
  background-color: var(--surface);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: var(--text-muted);
  transition-property: color, background-color, border-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.btn-sso:hover{
  background-color: var(--surface-2);
}
.badge-success{
  display: inline-flex;
  align-items: center;
  border-radius: 0.25rem;
  background-color: var(--success-bg);
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: var(--success-text);
}
.badge-danger{
  display: inline-flex;
  align-items: center;
  border-radius: 0.25rem;
  background-color: var(--danger-bg);
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: var(--danger-text);
}
.badge-warning{
  display: inline-flex;
  align-items: center;
  border-radius: 0.25rem;
  background-color: var(--warning-bg);
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: var(--warning-text);
}
.badge-info{
  display: inline-flex;
  align-items: center;
  border-radius: 0.25rem;
  background-color: var(--info-bg);
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: var(--info-text);
}
.badge-neutral{
  display: inline-flex;
  align-items: center;
  border-radius: 0.25rem;
  background-color: var(--surface-2);
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: var(--text-muted);
}
.card{
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background-color: var(--surface);
  overflow: hidden;
}
/* table-container nested inside a card inherits the card's border/radius */
.card .table-container{
  border: none;
  border-radius: 0;
  background-color: transparent;
}
.card-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1rem;
}
.card-title{
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: var(--text);
}
.card-body{
  padding: 1rem;
}
.card-footer{
  border-bottom-right-radius: 1rem;
  border-bottom-left-radius: 1rem;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--surface-2);
  padding: 0.75rem 1rem;
}
/* Stat card — dashboard KPI */
/* Row of stat cards that wraps to as many columns as fit (report pages with 3–6 KPIs) */
.stats-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.stats-grid:last-child{ margin-bottom: 0; }
.stat-card{
  border-radius: 1rem;
  border: 1px solid var(--border);
  background-color: var(--surface);
  padding: 1rem;
}
.stat-card-label{
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: var(--text-faint);
}
.stat-card-value{
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
  color: var(--text);
}
.stat-card-value-success{ color: var(--success-text); }
.stat-card-value-danger{ color: var(--danger-text); }
.stat-card-value-muted{ color: var(--text-faint); }
.stat-card-change-neutral{
  margin-top: 0.25rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--text-faint);
}
.stat-card-change-up{
  margin-top: 0.25rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--success-text);
}
.stat-card-change-down{
  margin-top: 0.25rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--danger-text);
}
.form-group{
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.form-group:last-child {
  margin-bottom: 0;
}
.form-label{
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: var(--text-muted);
}
.form-label-required::after {
  content: ' *';
  color: var(--danger);
}
.form-input{
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid var(--input-border);
  background-color: var(--input-bg);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text);
  transition-property: color, background-color, border-color, box-shadow;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
  outline: none;
}
.form-input::-moz-placeholder{ color: var(--text-faint); }
.form-input::placeholder{ color: var(--text-faint); }
.form-input:focus{
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px var(--ring);
}
.form-input-error{
  border-color: var(--danger);
}
.form-input-error:focus{
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.15);
}
.form-select{
  width: 100%;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  border-radius: 0.75rem;
  border: 1px solid var(--input-border);
  background-color: var(--input-bg);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text);
  transition-property: color, background-color, border-color, box-shadow;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
  outline: none;
}
.form-select:focus{
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px var(--ring);
}
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1.25rem;
  padding-right: 2rem;
}
.form-select-sm{
  width: auto;
  padding-left: 0.5rem;
  padding-right: 1.75rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.form-input-sm{
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.form-label-inline{
  font-size: 0.875rem;
  color: var(--text-faint);
  white-space: nowrap;
}
.form-textarea{
  width: 100%;
  resize: vertical;
  border-radius: 0.75rem;
  border: 1px solid var(--input-border);
  background-color: var(--input-bg);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text);
  transition-property: color, background-color, border-color, box-shadow;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
  outline: none;
}
.form-textarea::-moz-placeholder{ color: var(--text-faint); }
.form-textarea::placeholder{ color: var(--text-faint); }
.form-textarea:focus{
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px var(--ring);
}
.form-textarea {
  min-height: 5rem;
}
.notification-template-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.notification-template-editor-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  /* Keeps the field panel next to the editor rather than at the far edge of a wide screen. */
  max-width: 80rem;
}
.notification-template-editor-main {
  flex: 1;
  min-width: 0;
}
.notification-template-html-textarea {
  min-height: 32rem;
  white-space: pre;
  overflow: auto;
}
.notification-template-placeholder-panel {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 1rem;
}
.notification-template-placeholder-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}
.notification-template-placeholder-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}
.notification-template-placeholder-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.placeholder-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  border-radius: 0.75rem;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--input-border);
  cursor: pointer;
  transition: background 0.15s;
}
.placeholder-chip-token {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.6875rem;
  color: var(--text-muted);
}
.placeholder-chip:hover {
  background: var(--surface-3);
}
@media (max-width: 900px) {
  .notification-template-editor-layout {
    flex-direction: column;
  }
  .notification-template-placeholder-panel {
    width: 100%;
    position: static;
  }
}
.form-error{
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--danger-text);
}
.form-help{
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--text-faint);
}
/* Visually grouped form section */
.form-section{
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  padding: 1rem;
  background-color: var(--surface);
}
.form-section-title{
  margin-bottom: 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: var(--text-muted);
}
/* Checkbox / Radio — .checkbox/.radio applied to the <label> wrapper */
.checkbox-group{
  margin-top: 0.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  -moz-column-gap: 1rem;
       column-gap: 1rem;
  row-gap: 0.5rem;
}
.checkbox,
.radio{
  display: inline-flex;
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
}
.checkbox input[type="checkbox"],
.radio input[type="radio"]{
  height: 1rem;
  width: 1rem;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 0.25rem;
  accent-color: var(--brand-600);
}
/* Multi-language content tabs */
.form-tabs{
  margin-bottom: 1rem;
  display: flex;
  gap: 0px;
  border-bottom: 1px solid var(--border);
}
.form-tab{
  margin-bottom: -1px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: var(--text-faint);
}
.form-tab:hover{
  color: var(--text-muted);
}
.form-tab-active{
  border-color: var(--brand-500);
  color: var(--brand-600);
}
.dark .form-tab-active{
  border-color: var(--brand-400);
  color: var(--brand-400);
}
.form-tab-panel{
  padding-top: 1rem;
}
/* Toggle switch */
.toggle-wrapper{
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.toggle{
  position: relative;
  display: inline-flex;
  height: 1.25rem;
  width: 2.25rem;
  cursor: pointer;
  border-radius: 9999px;
  background-color: var(--surface-3);
  transition-property: background-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.toggle-on{
  background-color: var(--brand-500);
}
.toggle-knob{
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  height: 1rem;
  width: 1rem;
  border-radius: 9999px;
  background-color: #ffffff;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.15);
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.toggle-on .toggle-knob {
  transform: translateX(1rem);
}
.toggle-label{
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
}
.table-container{
  /* Scroll sideways on narrow screens instead of cutting columns off. */
  overflow-x: auto;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background-color: var(--surface);
}
.table{
  width: 100%;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border-collapse: collapse;
}
.table-header{
  background-color: var(--surface-2);
}
.table-th{
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  padding: 0.375rem 0.875rem;
  text-align: left;
  font-size: 0.6875rem;
  line-height: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}
.table-th-action{
  width: auto;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  padding: 0.375rem 0.875rem;
  text-align: right;
  font-size: 0.6875rem;
  line-height: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}
.table-row{
  transition-property: background-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.table-row:hover{
  background-color: var(--surface-2);
}
.table-row:nth-child(even){
  background-color: var(--surface-2);
}
.table-row:nth-child(even):hover{
  background-color: var(--surface-3);
}
.table-td{
  white-space: nowrap;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  line-height: 1.25rem;
  color: var(--text-muted);
}
.table-td-muted{
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  line-height: 1.25rem;
  color: var(--text-faint);
}
.table-td-wrap{
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  line-height: 1.25rem;
  color: var(--text-muted);
  white-space: normal;
}
.table-td-action{
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.375rem 0.875rem;
  text-align: right;
  white-space: nowrap;
  width: 1%;
}
.table-actions{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}
/* Pagination */
.pagination{
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}
.pagination-info{
  white-space: nowrap;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-faint);
}
.pagination-spacer{
  flex: 1 1 0%;
}
.pagination-btn{
  display: inline-flex;
  height: 2rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  padding: 0 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
  transition-property: color, background-color, border-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.pagination-btn:hover{
  background-color: var(--surface-2);
  color: var(--text);
}
.pagination-btn[disabled],
.pagination-btn-disabled{
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.4;
}
.pagination-btn-active{
  border-color: var(--brand-500);
  background-color: var(--brand-500);
  color: #ffffff;
}
.pagination-btn-active:hover{
  background-color: var(--brand-400);
  border-color: var(--brand-400);
}
.pagination-ellipsis{
  white-space: nowrap;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-faint);
}
/* Filter/search bar */
.filter-bar{
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.filter-bar-spacer{
  flex: 1 1 0%;
}
.filter-form{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 0%;
}
.filter-form .form-input{
  width: auto;
  min-width: 7rem;
}
.filter-form input[type="date"]{
  width: 8.5rem;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal{
  width: 100%;
  border-radius: 0.75rem;
  /* Dark --surface is translucent; laid over the opaque page colour so the page does not show through */
  background-color: var(--bg);
  background-image: linear-gradient(var(--surface), var(--surface));
  border: 1px solid var(--border);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  max-width: 28rem;
}
/* Shared confirmation dialog (confirm-dialog.js): above any other modal it may be opened from */
.modal-backdrop-top {
  z-index: 60;
  padding: 1rem;
}
.confirm-dialog-message{
  font-size: 0.875rem;
  line-height: 1.5rem;
  color: var(--text-muted);
}
.modal-md { max-width: 32rem; }
.modal-lg { max-width: 42rem; }
.modal-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
}
.modal-title{
  font-size: 0.875rem;
  line-height: 1.5rem;
  font-weight: 600;
  color: var(--text);
}
.modal-body{
  padding: 1rem 1.5rem;
}
.modal-footer{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  padding: 1rem 1.5rem;
}
.modal-close{
  cursor: pointer;
  border-radius: 0.375rem;
  padding: 0.25rem;
  color: var(--text-faint);
  transition-property: color, background-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.modal-close:hover{
  background-color: var(--surface-2);
  color: var(--text-muted);
}
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 60;
  pointer-events: none;
}
.toast{
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border-radius: 0.5rem;
  padding-left: 1rem;
  padding-right: 1rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
  min-width: 17rem;
  max-width: 22rem;
  pointer-events: auto;
}
.toast-success{
  border: 1px solid rgba(16,185,129,0.25);
  background-color: var(--success-bg);
  color: var(--success-text);
}
.toast-error{
  border: 1px solid rgba(239,68,68,0.25);
  background-color: var(--danger-bg);
  color: var(--danger-text);
}
.toast-warning{
  border: 1px solid rgba(245,158,11,0.25);
  background-color: var(--warning-bg);
  color: var(--warning-text);
}
.toast-info{
  border: 1px solid rgba(14,165,233,0.25);
  background-color: var(--info-bg);
  color: var(--info-text);
}
.toast-icon{
  margin-top: 0.125rem;
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
}
.toast-body{
  flex: 1 1 0%;
}
.toast-title{
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
}
.toast-message{
  margin-top: 0.125rem;
  font-size: 0.75rem;
  line-height: 1rem;
  opacity: 0.8;
}
.toast-dismiss{
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 0.25rem;
  padding: 0.125rem;
  opacity: 0.5;
}
.toast-dismiss:hover{
  opacity: 1;
}
.page-header{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.page-header-left{
  display: flex;
  min-width: 0px;
  flex-direction: column;
  gap: 0.25rem;
}
.page-title{
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}
.page-subtitle{
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
}
.page-actions{
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.5rem;
}
/* Site context banner */
.site-context{
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.125rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand-500);
  border-radius: 0.5rem;
  background-color: var(--surface);
}
.site-context-icon{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background-color: var(--brand-50);
  color: var(--brand-600);
  flex-shrink: 0;
}
.site-context-icon svg{
  width: 1.25rem;
  height: 1.25rem;
}
.site-context-body{
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
  flex: 1;
}
.site-context-label{
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}
.site-context-name{
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.site-context-domain{
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}
.site-context-switcher{
  flex-shrink: 0;
  margin-left: auto;
}
/* Breadcrumb */
.breadcrumb{
  margin-bottom: 0.125rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-faint);
}
.breadcrumb-item{
  cursor: pointer;
  transition: color 0.15s;
}
.breadcrumb-item:hover{
  color: var(--text-muted);
}
.breadcrumb-item-active{
  cursor: default;
  font-weight: 500;
  color: var(--text-muted);
}
.breadcrumb-sep{
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  color: var(--border);
}
/* Section header (inside a page, not the page title) */
.section-header{
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.section-title{
  font-size: 0.875rem;
  line-height: 1.5rem;
  font-weight: 600;
  color: var(--text);
}
.empty-state{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 3rem;
  padding-bottom: 3rem;
  text-align: center;
}
.empty-state-icon{
  margin-bottom: 1rem;
  color: var(--text-faint);
}
.empty-state-title{
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: var(--text-muted);
}
.empty-state-description{
  margin-bottom: 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-faint);
  max-width: 20rem;
}
/* Inline empty state — inside a table body cell */
.empty-state-inline{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 2rem;
  padding-bottom: 2rem;
  text-align: center;
}
.empty-state-inline .empty-state-icon{
  margin-bottom: 0.5rem;
}
.alert{
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border: 1px solid;
}
.alert-info{
  border-color: rgba(14,165,233,0.25);
  background-color: var(--info-bg);
  color: var(--info-text);
}
.alert-warning{
  border-color: rgba(245,158,11,0.25);
  background-color: var(--warning-bg);
  color: var(--warning-text);
}
.alert-danger{
  border-color: rgba(239,68,68,0.25);
  background-color: var(--danger-bg);
  color: var(--danger-text);
}
.alert-error{
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border: 1px solid rgba(239,68,68,0.25);
  background-color: var(--danger-bg);
  color: var(--danger-text);
}
.validation-summary-valid{
  display: none;
}
.system-banner{
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
}
.system-banner-icon{
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}
.system-banner-link{
  margin-left: auto;
  text-decoration: underline;
  white-space: nowrap;
}
.system-banner-warning{
  background-color: var(--warning-bg);
  color: var(--warning-text);
  border-bottom: 1px solid rgba(245,158,11,0.25);
}
.system-banner-warning .system-banner-link{
  color: var(--warning-text);
}
.alert-success{
  border-color: rgba(16,185,129,0.25);
  background-color: var(--success-bg);
  color: var(--success-text);
}
.alert-icon{
  margin-top: 0.125rem;
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
}
.alert-body{
  flex: 1 1 0%;
}
.alert-title{
  margin-bottom: 0.125rem;
  font-weight: 500;
}
.alert-list{
  margin: 0.25rem 0 0.5rem;
  padding-left: 1.25rem;
  list-style: disc;
}
.alert-list li + li{
  margin-top: 0.25rem;
}
.alert-message{
  font-size: 0.75rem;
  line-height: 1rem;
  opacity: 0.9;
}
/* Dismissible */
.alert-dismiss{
  margin-left: auto;
  flex-shrink: 0;
  cursor: pointer;
  padding-left: 0.5rem;
  opacity: 0.5;
}
.alert-dismiss:hover{
  opacity: 1;
}
.dropdown{
  position: relative;
  display: inline-block;
}
.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background-color: var(--surface);
  padding: 0.25rem 0;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  min-width: 10rem;
  z-index: 20;
}
.dropdown-item{
  display: flex;
  cursor: pointer;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
  transition-property: color, background-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.dropdown-item:hover{
  background-color: var(--surface-2);
  color: var(--text);
}
.dropdown-item-danger{
  display: flex;
  cursor: pointer;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--danger);
  transition-property: color, background-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.dropdown-item-danger:hover{
  background-color: var(--danger-bg);
}
.dropdown-divider{
  margin: 0.25rem 0;
  border-top: 1px solid var(--border-subtle);
}
.dropdown-label{
  padding: 0.25rem 1rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: var(--text-faint);
}
.sidebar {
  display: flex;
  flex-direction: column;
  background-color: var(--surface);
  border-right: 1px solid var(--border);
  width: var(--sidebar-width);
  transition: width 0.2s ease;
  overflow: hidden;
  flex-shrink: 0;
}
.sidebar-collapsed {
  width: var(--sidebar-width-collapsed);
}
.sidebar-collapsed .sidebar-item > span,
.sidebar-collapsed .sidebar-section-title,
.sidebar-collapsed .sidebar-logo-text {
  display: none;
}
.sidebar-collapsed .sidebar-item {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}
.sidebar-collapsed .sidebar-section {
  padding-top: 0.5rem;
  padding-bottom: 0.25rem;
}
.sidebar-logo{
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
}
.sidebar-logo {
  height: var(--topbar-height);
}
.sidebar-logo-text{
  white-space: nowrap;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 700;
  color: var(--brand-700);
}
.dark .sidebar-logo-text{
  color: var(--brand-300);
}
.sidebar-nav{
  flex: 1 1 0%;
  overflow-y: auto;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.sidebar-section{
  padding-top: 0.75rem;
  padding-bottom: 0.25rem;
}
.sidebar-section-title{
  margin-bottom: 0.25rem;
  white-space: nowrap;
  padding: 0 1rem;
  font-size: 0.6875rem;
  line-height: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}
.sidebar-item{
  margin: 0 0.5rem;
  display: flex;
  cursor: pointer;
  align-items: center;
  gap: 0.625rem;
  border-radius: 0.625rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  white-space: nowrap;
  color: var(--text-muted);
  transition-property: color, background-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.sidebar-item:hover{
  background-color: var(--surface-2);
  color: var(--text);
}
.sidebar-item-active{
  background-color: var(--brand-50);
  font-weight: 600;
  color: var(--brand-700);
}
.dark .sidebar-item-active{
  background-color: rgba(99,102,241,0.15);
  color: var(--brand-300);
}
.sidebar-item-active:hover{
  background-color: var(--brand-50);
  color: var(--brand-700);
}
.dark .sidebar-item-active:hover{
  background-color: rgba(99,102,241,0.2);
  color: var(--brand-300);
}
.sidebar-item-icon{
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
  color: var(--text-faint);
}
.sidebar-item-active .sidebar-item-icon{
  color: var(--brand-600);
}
.dark .sidebar-item-active .sidebar-item-icon{
  color: var(--brand-400);
}
.sidebar-item-text{
  flex: 1 1 0%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-footer{
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding: 0.5rem;
}
.sidebar-version {
  flex-shrink: 0;
  padding: 0.5rem 1rem 0.75rem;
  font-size: 0.6875rem;
  color: var(--text-muted);
  opacity: 0.6;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-collapsed .sidebar-version {
  opacity: 0;
}
/* Collapse toggle button */
.sidebar-toggle{
  margin: 0 0.5rem;
  display: flex;
  width: 100%;
  cursor: pointer;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.625rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-faint);
  transition-property: color, background-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.sidebar-toggle:hover{
  background-color: var(--surface-2);
  color: var(--text-muted);
}
.topbar{
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background-color: var(--surface);
  padding: 0 1rem;
}
.topbar {
  height: var(--topbar-height);
  flex-shrink: 0;
  grid-column: 1 / -1;
}
.topbar-logo{
  margin-right: 1rem;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.5rem;
}
.topbar-logo-img{
  height: 2rem;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}
.topbar-logo-stack{
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1;
}
.topbar-logo-text{
  white-space: nowrap;
  font-size: 0.875rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.topbar-logo-org{
  white-space: nowrap;
  font-size: 0.6875rem;
  line-height: 1.2;
  font-weight: 500;
  color: var(--text-faint);
}
/* Cookie consent proportion bar */
.cookie-bar{
  display: flex;
  height: 0.625rem;
  width: 100%;
  overflow: hidden;
  border-radius: 9999px;
  background-color: var(--surface-3);
}
.cookie-bar-fill{
  height: 100%;
  transition: width 0.3s ease;
}
.cookie-bar-fill-accept{ background-color: var(--success); }
.cookie-bar-fill-custom{ background-color: var(--info); }
.cookie-bar-fill-reject{ background-color: var(--danger); }
.cookie-bar-label{
  display: flex;
  gap: 1rem;
  margin-bottom: 0.375rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
}
.cookie-bar-segment-label{ display: flex; align-items: center; gap: 0.25rem; }
.cookie-bar-accept{ color: var(--success-text); }
.cookie-bar-custom{ color: var(--info-text); }
.cookie-bar-reject{ color: var(--danger-text); }
.topbar-divider{
  width: 1px;
  height: 1.25rem;
  margin: 0 0.5rem;
  flex-shrink: 0;
  background-color: var(--border);
}
.topbar-context{
  display: flex;
  align-items: center;
  gap: 0px;
}
.topbar-context-item{
  display: flex;
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  flex-direction: column;
  align-items: flex-start;
  border-radius: 0.25rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.topbar-context-item:hover{
  background-color: var(--surface-2);
}
.topbar-context-item {
  min-width: 0;
}
.topbar-context-label{
  margin-bottom: 0.125rem;
  font-size: 0.75rem;
  line-height: 1;
  color: var(--text-faint);
}
.topbar-context-value{
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  white-space: nowrap;
  font-size: 0.875rem;
  line-height: 1.25;
  font-weight: 500;
  color: var(--text);
}
.topbar-context-chevron{
  color: var(--text-faint);
}
.topbar-spacer{
  flex: 1 1 0%;
}
/* Sidebar collapse / hamburger — always visible */
.topbar-menu-btn{
  margin-right: 0.5rem;
  display: flex;
  height: 2rem;
  width: 2rem;
  flex-shrink: 0;
  cursor: pointer;
  color: var(--text-faint);
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  transition-property: color, background-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.topbar-menu-btn:hover{
  background-color: var(--surface-2);
}
/* Dark/light mode toggle */
.topbar-theme-btn{
  display: flex;
  height: 2rem;
  width: 2rem;
  flex-shrink: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  color: var(--text-faint);
  transition-property: color, background-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.topbar-theme-btn:hover{
  background-color: var(--surface-2);
}
/* Icon swap: moon shown in light mode, sun shown in dark mode */
.theme-icon-sun  { display: none; }
.dark .theme-icon-sun  { display: block; }
.theme-icon-moon { display: block; }
.dark .theme-icon-moon { display: none; }
.topbar-actions{
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.topbar-user{
  display: flex;
  cursor: pointer;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.25rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.topbar-user:hover{
  background-color: var(--surface-2);
}
.topbar-user-avatar{
  display: flex;
  height: 1.75rem;
  width: 1.75rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background-color: var(--brand-100);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  color: var(--brand-700);
}
.dark .topbar-user-avatar{
  background-color: rgba(99,102,241,0.2);
  color: var(--brand-300);
}
.topbar-user-name{
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: var(--text-muted);
}
/* Context switcher dropdown */
.context-dropdown {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background-color: var(--surface);
  padding: 0.25rem 0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  min-width: 14rem;
  z-index: 20;
}
/* ── Setup Wizard ───────────────────────────────────────────────────────── */
.wizard-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem 1.5rem 4rem;
  background-color: var(--bg);
}
.wizard-header{
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.wizard-logo-icon{
  display: flex;
  height: 2rem;
  width: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  background-color: var(--brand-500);
  color: #ffffff;
}
.wizard-logo-text{
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 700;
  color: var(--brand-950);
}
.dark .wizard-logo-text{
  color: var(--brand-300);
}
.wizard-card{
  width: 100%;
  border-radius: 0.75rem;
  background-color: var(--surface);
  border: 1px solid var(--border);
}
.wizard-card {
  max-width: 40rem;
}
.wizard-steps{
  display: flex;
  align-items: center;
  gap: 0px;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  padding-top: 1.5rem;
  padding-bottom: 0px;
}
.wizard-step{
  display: flex;
  flex: 1 1 0%;
  flex-direction: column;
  align-items: center;
  position: relative;
}
/* Connector line between steps */
.wizard-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 1rem;
  left: calc(50% + 1rem);
  right: calc(-50% + 1rem);
  height: 2px;
  background-color: var(--border);
}
.wizard-step.is-done:not(:last-child)::after{
  background-color: var(--brand-400);
}
.wizard-step-circle{
  position: relative;
  z-index: 10;
  display: flex;
  height: 2rem;
  width: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 2px solid var(--border);
  background-color: var(--surface);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  color: var(--text-faint);
}
.wizard-step.is-active .wizard-step-circle{
  border-color: var(--brand-500);
  background-color: var(--brand-500);
  color: #ffffff;
}
.dark .wizard-step.is-active .wizard-step-circle{
  border-color: var(--brand-400);
  background-color: var(--brand-400);
}
.wizard-step.is-done .wizard-step-circle{
  border-color: var(--brand-400);
  background-color: var(--brand-400);
  color: #ffffff;
}
.wizard-step-label{
  margin-top: 0.25rem;
  white-space: nowrap;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--text-faint);
}
.wizard-step.is-active .wizard-step-label{
  font-weight: 500;
  color: var(--brand-500);
}
.dark .wizard-step.is-active .wizard-step-label{
  color: var(--brand-400);
}
.wizard-step.is-done .wizard-step-label{
  color: var(--brand-400);
}
.vault-wizard-ready .vault-wizard-step:not(.is-active){
  display: none;
}
.vault-wizard-ready [data-vault-wizard-nav].is-done{
  cursor: pointer;
}
.vault-source-form [hidden]{
  display: none;
}
.vault-summary{
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 0.5rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.vault-summary dt{
  font-weight: 500;
  color: var(--text-faint);
}
.vault-summary dd{
  margin: 0;
  color: var(--text);
}
.vault-summary-list{
  margin: 0;
  padding: 0;
  list-style: none;
}
.wizard-body{
  padding: 1.5rem;
}
.wizard-section-title{
  margin-bottom: 1rem;
  font-size: 0.875rem;
  line-height: 1.5rem;
  font-weight: 600;
  color: var(--text);
}
.wizard-footer{
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
}
/* ── Code blocks & one-time-display values ─────────────────────────────── */
.code-block{
  overflow-x: auto;
  border-radius: 0.375rem;
  border: 1px solid #374151;
  background-color: #111827;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: pre;
  color: #4ade80;
}
/* Inline code inside prose */
.code-inline{
  border-radius: 0.25rem;
  background-color: var(--surface-2);
  padding: 0.125rem 0.375rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--text-muted);
}
/* ── Cookie category management ────────────────────────────────────── */
.cat-regulation-list{
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.cat-regulation-tag{
  display: inline-flex;
  align-items: center;
  border-radius: 0.25rem;
  padding: 0.0625rem 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background-color: var(--info-bg);
  color: var(--info-text);
  border: 1px solid rgba(14,165,233,0.2);
}
.cat-flag-list{
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
/* Banner version category cards */
.cat-version-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 768px){
  .cat-version-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1280px){
  .cat-version-grid{ grid-template-columns: repeat(3, 1fr); }
}
.cat-version-card{
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-radius: 0.5rem;
  border: 2px solid var(--border);
  background-color: var(--surface);
  padding: 1rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cat-version-card:has(.cat-version-checkbox:checked){
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px var(--ring);
}
.cat-version-card-required{
  border-color: var(--border);
  background-color: var(--surface-2);
}
.cat-version-card-top{
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.cat-version-checkbox{
  margin-top: 0.125rem;
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
  border: 1px solid var(--input-border);
  cursor: pointer;
  accent-color: var(--brand-500);
}
.cat-version-info{ flex: 1; min-width: 0; }
.cat-version-name{
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.cat-version-desc{
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-faint);
  line-height: 1.4;
}
.cat-version-meta{
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding-top: 0.625rem;
  border-top: 1px solid var(--border-subtle);
}
.cat-version-meta-row{
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
}
.cat-version-meta-label{
  flex-shrink: 0;
  width: 5rem;
  color: var(--text-faint);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.cat-version-meta-value{
  color: var(--text-muted);
}
.cat-version-purpose{
  border-top: 1px dashed var(--border);
  padding-top: 0.5rem;
}
.cat-version-purpose-toggle{
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--brand-500);
  cursor: pointer;
  list-style: none;
}
.cat-version-purpose-toggle::-webkit-details-marker{ display: none; }
.cat-version-purpose-text{
  margin-top: 0.375rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-faint);
}
/* Category edit page */
.cat-edit-layout{
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.cat-edit-actions{ justify-content: flex-end; }
.cat-lang-section{
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.5rem;
}
.cat-lang-section:last-child{ border-bottom: none; }
.cat-lang-summary{
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.cat-lang-summary::-webkit-details-marker{ display: none; }
.cat-lang-code{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 1.25rem;
  border-radius: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  background-color: var(--info-bg);
  color: var(--info-text);
}
.cat-lang-label{
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}
.cat-lang-body{
  padding: 0.5rem 0 0.75rem 2.625rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.form-card-title{
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  padding: 1rem 1.5rem 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
  margin-bottom: 0;
}

/* ── Webhook new-endpoint page layout ──────────────────────────────── */
.webhook-page-layout{
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (min-width: 1024px) {
  .webhook-page-layout{
    grid-template-columns: minmax(0,1fr) minmax(0,1.35fr);
  }
}
.webhook-form-col{ height: fit-content; }
.webhook-ref-col{ height: fit-content; }

/* Developer reference panel */
.dev-panel{
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background-color: var(--surface);
  overflow: hidden;
}
.dev-panel-header{
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.25rem;
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
  background-color: var(--surface-2);
}
.dev-section{
  border-bottom: 1px solid var(--border-subtle);
}
.dev-section:last-child{ border-bottom: none; }
.dev-section-summary{
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.dev-section-summary::-webkit-details-marker{ display: none; }
.dev-section-summary::before{
  content: "▶";
  font-size: 0.6rem;
  color: var(--text-faint);
  transition: transform 0.15s;
}
details[open] > .dev-section-summary::before{ transform: rotate(90deg); }
.dev-section-body{
  padding: 0 1.25rem 1rem;
  font-size: 0.8125rem;
}
.dev-text{
  line-height: 1.6;
  color: var(--text-muted);
}
.dev-text-muted{
  color: var(--text-faint);
}
.dev-list{
  margin-top: 0.5rem;
  padding-left: 1.25rem;
  list-style-type: decimal;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.dev-section-body .code-block{
  font-size: 0.75rem;
  line-height: 1.5;
  margin-top: 0.5rem;
}
.dev-event-row{
  margin-top: 1rem;
}
.dev-event-row:first-child{ margin-top: 0.25rem; }
.dev-event-header{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
}
.dev-event-desc{
  font-size: 0.75rem;
  color: var(--text-faint);
}
.badge-event{
  display: inline-flex;
  align-items: center;
  border-radius: 0.25rem;
  padding: 0.125rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  background-color: var(--info-bg);
  color: var(--info-text);
}
.badge-event-planned{
  background-color: var(--surface-2);
  color: var(--text-faint);
}
/* Retry timeline */
.dev-retry-timeline{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.75rem;
}
.dev-retry-step{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
}
.dev-retry-n{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
  background-color: var(--info-bg);
  color: var(--info-text);
}
.dev-retry-dead .dev-retry-n{
  background-color: var(--danger-bg);
  color: var(--danger-text);
}
.dev-retry-label{
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--text-faint);
  white-space: nowrap;
}
.dev-retry-dead .dev-retry-label{ color: var(--danger-text); }
.dev-retry-arrow{
  font-size: 0.75rem;
  color: var(--text-faint);
  padding-bottom: 0.875rem;
}

/* Recovery codes grid */
.recovery-codes{
  border-radius: 0.375rem;
  border: 1px solid #374151;
  background-color: #111827;
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1.5rem;
}
.recovery-code-item{
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.25rem;
  letter-spacing: 0.05em;
  color: #4ade80;
}
/* Copy-to-clipboard wrapper */
.copy-block{
  position: relative;
}
.copy-block-inner{
  overflow-x: auto;
  white-space: nowrap;
  border-radius: 0.375rem;
  border: 1px solid var(--border);
  background-color: var(--surface-2);
  padding: 0.625rem 5rem 0.625rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--text-muted);
}
.copy-block-btn{
  position: absolute;
  top: 0.375rem;
  right: 0.375rem;
  display: inline-flex;
  cursor: pointer;
  align-items: center;
  gap: 0.25rem;
  border-radius: 0.25rem;
  border: 1px solid var(--border);
  background-color: var(--surface);
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--text-muted);
  transition-property: color, background-color, border-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.copy-block-btn:hover{
  background-color: var(--surface-2);
}
/* API key masked display */
.api-key-display{
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.api-key-prefix{
  border-radius: 0.25rem;
  background-color: var(--surface-2);
  padding: 0.25rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
}
.api-key-mask{
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.25rem;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}
/* ── Key-value rows (read-only detail view) ────────────────────────────── */
.kv-list{
  display: flex;
  flex-direction: column;
}
.kv-list > :not([hidden]) ~ :not([hidden]){
  border-top: 1px solid var(--border-subtle);
}
.kv-row{
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding-top: 0.625rem;
  padding-bottom: 0.625rem;
}
.kv-label{
  width: 10rem;
  flex-shrink: 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-faint);
}
.kv-value{
  flex: 1 1 0%;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text);
}
.kv-value-muted{
  flex: 1 1 0%;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
}
.kv-hint {
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-left: 0.5rem;
}
/* Inline key-value pair (horizontal, tighter) */
.kv-inline{
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.kv-inline-label{
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--text-faint);
}
.kv-inline-value{
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: var(--text-muted);
}
/* Detail card with key-value list inside */
.detail-card{
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background-color: var(--surface);
}
.detail-card-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
}
.detail-card-title{
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: var(--text);
}
.detail-card-body{
  padding: 1rem;
}
.detail-card-mt{
  margin-top: 1.5rem;
}
.form-inline{
  display: inline;
}
/* Stat strip (used on company/brand/website detail) */
.detail-stats{
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.detail-stat{
  display: flex;
  flex-direction: column;
}
.detail-stat-label{
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--text-faint);
}
.detail-stat-value{
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 600;
  color: var(--text);
}
/* Resource list — used inside detail cards for linked sub-resources */
.resource-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.resource-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.875rem;
  color: var(--text);
}
.resource-list-item:last-child {
  border-bottom: none;
}
.resource-list-item a {
  color: var(--brand-600);
  text-decoration: none;
}
.dark .resource-list-item a {
  color: var(--brand-400);
}
.resource-list-item a:hover {
  text-decoration: underline;
}
.resource-list-meta {
  font-size: 0.75rem;
  color: var(--text-faint);
  white-space: nowrap;
}
/* Form layout — cards, actions, hints */
.form-card {
  background-color: var(--surface);
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  padding: 1.5rem;
}
/* A plain form stops at a readable width; on 2K/4K screens a full-width form stretched every
   input across the page. Editors, permission grids and two-column layouts opt out. */
.form-card,
.card-form {
  max-width: 56rem;
}
.form-card-wide {
  max-width: none;
}
/* Role permissions: plain-language text with the claim code underneath */
.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 0.75rem 1.25rem;
}
.permission-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
}
.permission-option input {
  margin-top: 0.2rem;
}
.permission-option-body,
.permission-list-item {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.permission-text {
  color: var(--text);
  line-height: 1.3;
}
.permission-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  color: var(--text-faint);
}
.permission-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.permission-list-item {
  padding: 0.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.form-body {
  display: flex;
  flex-direction: column;
}
.form-row {
  display: flex;
  gap: 1rem;
}
.form-row > .form-group {
  flex: 1;
}
@media (max-width: 640px) {
  .form-row {
    flex-direction: column;
  }
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.form-hint {
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--text-faint);
  margin-top: 0.25rem;
}
.form-check {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.form-checkbox {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  accent-color: var(--brand-600);
  cursor: pointer;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 0.25rem;
}
.form-check-label {
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.required {
  color: var(--danger);
}
/* Layouts */
.auth-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--auth-bg);
  padding: 1.5rem;
}
.auth-card{
  position: relative;
  width: 100%;
  border-radius: 1rem;
  background-color: var(--surface);
  border: 1px solid var(--border);
  padding: 2rem 2.25rem;
  max-width: 26rem;
}
.auth-logo{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}
.brand-logo{
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.brand-logo-image{
  display: block;
  width: auto;
  object-fit: contain;
}
.brand-logo-light{
  display: block;
}
.brand-logo-dark{
  display: none;
}
html.dark .brand-logo-light{
  display: none;
}
html.dark .brand-logo-dark{
  display: block;
}
.brand-logo-auth .brand-logo-image{
  height: 2.25rem;
  max-width: 11rem;
}
.brand-logo-topbar .brand-logo-image{
  height: 2rem;
  max-width: 8.5rem;
}
.brand-logo-wizard .brand-logo-image{
  height: 2rem;
  max-width: 10rem;
}
.brand-logo-legal .brand-logo-image{
  height: 1.75rem;
  max-width: 8rem;
}
.auth-logo-icon{
  display: flex;
  height: 2rem;
  width: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  background-color: var(--brand-500);
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 700;
  color: #ffffff;
}
.auth-logo-img{
  height: 2.25rem;
  width: auto;
  max-width: 11rem;
  object-fit: contain;
}
.auth-logo-text{
  font-size: 0.8125rem;
  line-height: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.auth-title{
  margin-bottom: 1.5rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
.auth-subtitle{
  margin-top: -1rem;
  margin-bottom: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
}
.auth-divider{
  position: relative;
  margin-top: 1rem;
  margin-bottom: 1rem;
  text-align: center;
}
.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}
.auth-divider-text{
  position: relative;
  background-color: var(--surface);
  padding: 0 0.75rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--text-faint);
}
.auth-link{
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--brand-600);
  transition: color 0.15s;
}
.auth-link:hover{ color: var(--brand-500); }
.dark .auth-link{ color: var(--brand-400); }
.dark .auth-link:hover{ color: var(--brand-300); }
.auth-footer{
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-faint);
}
.auth-error-banner{
  margin-bottom: 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(239,68,68,0.25);
  background-color: var(--danger-bg);
  color: var(--danger-text);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}
/* Quill editor dark mode */
.ql-toolbar.ql-snow:is(.dark *) {
  background-color: var(--surface-2);
  border-color: var(--input-border) !important;
}
.ql-container.ql-snow:is(.dark *) {
  background-color: var(--surface);
  border-color: var(--input-border) !important;
  color: var(--text);
}
.ql-editor:is(.dark *) {
  background-color: var(--surface);
  color: var(--text);
}
.ql-editor:is(.dark *)::before {
  color: var(--text-faint);
}
.ql-snow:is(.dark *) .ql-stroke {
  stroke: var(--text-faint);
}
.ql-snow:is(.dark *) .ql-fill,
.ql-snow:is(.dark *) .ql-stroke.ql-fill {
  fill: var(--text-faint);
}
.ql-snow:is(.dark *) .ql-picker-label {
  color: var(--text-muted);
}
.ql-snow:is(.dark *) .ql-picker-options {
  background-color: var(--surface-2);
  border-color: var(--input-border);
  color: var(--text-muted);
}
.ql-snow.ql-toolbar:is(.dark *) button:hover,
.ql-snow:is(.dark *) .ql-toolbar button:hover {
  color: var(--text);
}
.ql-snow.ql-toolbar:is(.dark *) button:hover .ql-stroke,
.ql-snow:is(.dark *) .ql-toolbar button:hover .ql-stroke {
  stroke: var(--text);
}
.admin-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg);
}
.admin-main {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.admin-sidebar-wrapper {
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.admin-sidebar-wrapper .sidebar {
  flex: 1;
  height: 100%;
}
.admin-content-wrapper {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: var(--bg);
}
.admin-page {
  padding: 1rem 1.5rem;
  /* On 2K/4K screens pages stop growing instead of spreading tables and side panels to the far edge. */
  max-width: 112rem;
}
/* ── Mobile responsive ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .admin-layout {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .admin-main {
    flex-direction: column;
    overflow: visible;
  }

  /* Sidebar hidden by default on mobile; toggled via .sidebar-open on body */
  .admin-sidebar-wrapper {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: none;
    background: rgba(0, 0, 0, 0.4);
  }

  .admin-sidebar-wrapper.is-open {
    display: block;
  }

  .admin-sidebar-wrapper .sidebar {
    width: var(--sidebar-width);
    height: 100%;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
  }

  .admin-content-wrapper {
    overflow: visible;
  }

  .admin-page {
    padding: 1rem;
  }

  /* Topbar: show hamburger button on mobile */
  .topbar-menu-btn {
    display: flex;
  }

  /* Context switcher wraps gracefully */
  .topbar-context {
    overflow: hidden;
  }

  .topbar-context-item {
    min-width: 0;
    max-width: 7rem;
  }

  .topbar-context-value {
    overflow: hidden;
    max-width: 100%;
  }

  .topbar-context-value span {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
@media (max-width: 480px) {
  .topbar-user-name,
  .topbar-logo-org {
    display: none;
  }
}
.admin-page > * + *,
.admin-page .form-card form > * + *,
.admin-page .form-body > * + * {
  margin-top: 1.25rem;
}
/* Tab nav (horizontal tabs, e.g., consent process detail sub-pages) */
.tab-nav{
  margin-bottom: 1rem;
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.tab-nav-item{
  margin-bottom: -1px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: var(--text-faint);
  transition-property: color, border-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.tab-nav-item:hover{
  border-color: var(--border);
  color: var(--text-muted);
}
.tab-nav-item-active{
  border-color: var(--brand-500);
  color: var(--brand-600);
}
.dark .tab-nav-item-active{
  border-color: var(--brand-400);
  color: var(--brand-400);
}
.portal-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
}
.portal-header{
  border-bottom: 1px solid var(--border);
  background-color: var(--surface);
  padding: 0.875rem 1rem;
  flex-shrink: 0;
}
.portal-header-inner{
  max-width: 40rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
}
.portal-logo{
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.portal-logo-icon{
  display: flex;
  height: 1.75rem;
  width: 1.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  background-color: var(--brand-500);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 700;
  color: #ffffff;
}
.portal-logo-text{
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 700;
  color: var(--brand-700);
}
.dark .portal-logo-text{
  color: var(--brand-300);
}
.portal-content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
}
.portal-card{
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background-color: var(--surface);
  box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
  max-width: 40rem;
}
.portal-card-header{
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.5rem 1.5rem 1rem;
}
.portal-card-title{
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.5rem;
  font-weight: 600;
  color: var(--text);
}
.portal-card-meta{
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--text-faint);
}
.portal-card-body{
  padding: 1rem 1.5rem;
}
.portal-consent-text{
  font-size: 0.875rem;
  line-height: 1.625;
  color: var(--text-muted);
  overflow-wrap: break-word;
  word-break: break-word;
}
.portal-consent-text p{
  margin-bottom: 0.75rem;
}
.portal-consent-text h2{
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: var(--text);
}
.portal-actions{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  padding: 1rem 1.5rem;
}
.portal-footer{
  padding: 1rem;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--text-faint);
}
/* Confirmation / outcome pages */
.portal-outcome{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 3rem;
  padding-bottom: 3rem;
  text-align: center;
}
.portal-outcome-icon{
  margin-bottom: 1rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.portal-outcome-icon svg { width: 1.5rem; height: 1.5rem; }
.portal-outcome-success { background-color: var(--success-bg); color: var(--success-text); }
.portal-outcome-neutral  { background-color: var(--surface-2); color: var(--text-faint); }
.portal-outcome-warning  { background-color: var(--warning-bg); color: var(--warning-text); }
.portal-outcome-danger   { background-color: var(--danger-bg); color: var(--danger-text); }
.portal-outcome-title{
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5rem;
  font-weight: 600;
  color: var(--text);
}
.portal-outcome-message{
  max-width: 20rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
}
@media (max-width: 640px) {
  .portal-actions{
    flex-direction: column-reverse;
  }

  .portal-actions .btn-primary,
  .portal-actions .btn-secondary,
  .portal-actions .btn-success,
  .portal-actions .btn-danger{
    width: 100%;
    justify-content: center;
  }
}
/* ── Legal public pages ─────────────────────────────────────────────────── */
.legal-page-body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
}
.legal-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
/* Header */
.legal-header {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
}
.legal-header-inner {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
}
.legal-logo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  cursor: default;
}
.legal-logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.375rem;
  background-color: var(--brand-500);
  color: #ffffff;
  flex-shrink: 0;
}
.legal-logo-img {
  height: 1.75rem;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}
.legal-logo-name {
  letter-spacing: -0.02em;
}
/* Main content */
.legal-main {
  flex: 1;
  padding: 2.5rem 0 4rem;
}
.legal-container {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}
/* Article heading */
.legal-heading {
  font-size: 1.75rem;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  margin: 0 0 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
/* Prose — styles all Quill-generated HTML */
.legal-prose {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--text-muted);
  width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
}
.legal-prose h1 {
  font-size: 1.375rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.legal-prose h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 1.75rem 0 0.5rem;
  color: var(--text);
}
.legal-prose h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 1.25rem 0 0.375rem;
  color: var(--text-muted);
}
.legal-prose p {
  margin: 0 0 1rem;
}
.legal-prose ul,
.legal-prose ol {
  margin: 0 0 1rem 1.5rem;
  padding: 0;
}
.legal-prose ul { list-style-type: disc; }
.legal-prose ol { list-style-type: decimal; }
.legal-prose li {
  margin-bottom: 0.25rem;
}
.legal-prose a {
  color: var(--brand-600);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.dark .legal-prose a { color: var(--brand-400); }
.legal-prose a:hover { color: var(--brand-500); }
.legal-prose strong { font-weight: 600; color: var(--text); }
.legal-prose em { font-style: italic; }
.legal-prose blockquote {
  margin: 1.25rem 0;
  padding: 0.75rem 1.25rem;
  border-left: 3px solid var(--border);
  color: var(--text-faint);
  font-style: italic;
}
/* Footer */
.legal-footer {
  border-top: 1px solid var(--border);
  padding: 0.75rem 0;
}
.legal-footer-inner {
  display: flex;
  align-items: center;
}
.legal-footer-text {
  font-size: 0.6875rem;
  color: var(--text-faint);
  letter-spacing: 0.01em;
}
.legal-footer-link {
  color: var(--text-faint);
  text-decoration: none;
}
.legal-footer-link:hover { color: var(--text-muted); }
/* ─── Tailwind layers ─────────────────────────────────────────────────────── */
*, ::before, ::after{
  --tw-border-spacing-x: 0;
  --tw-border-spacing-y: 0;
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-pan-x:  ;
  --tw-pan-y:  ;
  --tw-pinch-zoom:  ;
  --tw-scroll-snap-strictness: proximity;
  --tw-gradient-from-position:  ;
  --tw-gradient-via-position:  ;
  --tw-gradient-to-position:  ;
  --tw-ordinal:  ;
  --tw-slashed-zero:  ;
  --tw-numeric-figure:  ;
  --tw-numeric-spacing:  ;
  --tw-numeric-fraction:  ;
  --tw-ring-inset:  ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: rgb(59 130 246 / 0.5);
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
  --tw-blur:  ;
  --tw-brightness:  ;
  --tw-contrast:  ;
  --tw-grayscale:  ;
  --tw-hue-rotate:  ;
  --tw-invert:  ;
  --tw-saturate:  ;
  --tw-sepia:  ;
  --tw-drop-shadow:  ;
  --tw-backdrop-blur:  ;
  --tw-backdrop-brightness:  ;
  --tw-backdrop-contrast:  ;
  --tw-backdrop-grayscale:  ;
  --tw-backdrop-hue-rotate:  ;
  --tw-backdrop-invert:  ;
  --tw-backdrop-opacity:  ;
  --tw-backdrop-saturate:  ;
  --tw-backdrop-sepia:  ;
  --tw-contain-size:  ;
  --tw-contain-layout:  ;
  --tw-contain-paint:  ;
  --tw-contain-style:  ;
}
::backdrop{
  --tw-border-spacing-x: 0;
  --tw-border-spacing-y: 0;
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-pan-x:  ;
  --tw-pan-y:  ;
  --tw-pinch-zoom:  ;
  --tw-scroll-snap-strictness: proximity;
  --tw-gradient-from-position:  ;
  --tw-gradient-via-position:  ;
  --tw-gradient-to-position:  ;
  --tw-ordinal:  ;
  --tw-slashed-zero:  ;
  --tw-numeric-figure:  ;
  --tw-numeric-spacing:  ;
  --tw-numeric-fraction:  ;
  --tw-ring-inset:  ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: rgb(59 130 246 / 0.5);
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
  --tw-blur:  ;
  --tw-brightness:  ;
  --tw-contrast:  ;
  --tw-grayscale:  ;
  --tw-hue-rotate:  ;
  --tw-invert:  ;
  --tw-saturate:  ;
  --tw-sepia:  ;
  --tw-drop-shadow:  ;
  --tw-backdrop-blur:  ;
  --tw-backdrop-brightness:  ;
  --tw-backdrop-contrast:  ;
  --tw-backdrop-grayscale:  ;
  --tw-backdrop-hue-rotate:  ;
  --tw-backdrop-invert:  ;
  --tw-backdrop-opacity:  ;
  --tw-backdrop-saturate:  ;
  --tw-backdrop-sepia:  ;
  --tw-contain-size:  ;
  --tw-contain-layout:  ;
  --tw-contain-paint:  ;
  --tw-contain-style:  ;
}
/* ! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com */
/*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
*/
*,
::before,
::after {
  box-sizing: border-box; /* 1 */
  border-width: 0; /* 2 */
  border-style: solid; /* 2 */
  border-color: #e5e7eb; /* 2 */
}
::before,
::after {
  --tw-content: '';
}
/*
1. Use a consistent sensible line-height in all browsers.
2. Prevent adjustments of font size after orientation changes in iOS.
3. Use a more readable tab size.
4. Use the user's configured `sans` font-family by default.
5. Use the user's configured `sans` font-feature-settings by default.
6. Use the user's configured `sans` font-variation-settings by default.
7. Disable tap highlights on iOS
*/
html,
:host {
  line-height: 1.5; /* 1 */
  -webkit-text-size-adjust: 100%; /* 2 */
  -moz-tab-size: 4; /* 3 */
  -o-tab-size: 4;
     tab-size: 4; /* 3 */
  font-family: var(--font-sans); /* 4 */
  font-feature-settings: normal; /* 5 */
  font-variation-settings: normal; /* 6 */
  -webkit-tap-highlight-color: transparent; /* 7 */
}
/*
1. Remove the margin in all browsers.
2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.
*/
body {
  margin: 0; /* 1 */
  line-height: inherit; /* 2 */
}
/*
1. Add the correct height in Firefox.
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
3. Ensure horizontal rules are visible by default.
*/
hr {
  height: 0; /* 1 */
  color: inherit; /* 2 */
  border-top-width: 1px; /* 3 */
}
/*
Add the correct text decoration in Chrome, Edge, and Safari.
*/
abbr:where([title]) {
  -webkit-text-decoration: underline dotted;
          text-decoration: underline dotted;
}
/*
Remove the default font size and weight for headings.
*/
h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}
/*
Reset links to optimize for opt-in styling instead of opt-out.
*/
a {
  color: inherit;
  text-decoration: inherit;
}
/*
Add the correct font weight in Edge and Safari.
*/
b,
strong {
  font-weight: bolder;
}
/*
1. Use the user's configured `mono` font-family by default.
2. Use the user's configured `mono` font-feature-settings by default.
3. Use the user's configured `mono` font-variation-settings by default.
4. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */
  font-feature-settings: normal; /* 2 */
  font-variation-settings: normal; /* 3 */
  font-size: 1em; /* 4 */
}
/*
Add the correct font size in all browsers.
*/
small {
  font-size: 80%;
}
/*
Prevent `sub` and `sup` elements from affecting the line height in all browsers.
*/
sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
sub {
  bottom: -0.25em;
}
sup {
  top: -0.5em;
}
/*
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
3. Remove gaps between table borders by default.
*/
table {
  text-indent: 0; /* 1 */
  border-color: inherit; /* 2 */
  border-collapse: collapse; /* 3 */
}
/*
1. Change the font styles in all browsers.
2. Remove the margin in Firefox and Safari.
3. Remove default padding in all browsers.
*/
button,
input,
optgroup,
select,
textarea {
  font-family: inherit; /* 1 */
  font-feature-settings: inherit; /* 1 */
  font-variation-settings: inherit; /* 1 */
  font-size: 100%; /* 1 */
  font-weight: inherit; /* 1 */
  line-height: inherit; /* 1 */
  letter-spacing: inherit; /* 1 */
  color: inherit; /* 1 */
  margin: 0; /* 2 */
  padding: 0; /* 3 */
}
/*
Remove the inheritance of text transform in Edge and Firefox.
*/
button,
select {
  text-transform: none;
}
/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Remove default button styles.
*/
button,
input:where([type='button']),
input:where([type='reset']),
input:where([type='submit']) {
  -webkit-appearance: button; /* 1 */
  background-color: transparent; /* 2 */
  background-image: none; /* 2 */
}
/*
Use the modern Firefox focus style for all focusable elements.
*/
:-moz-focusring {
  outline: auto;
}
/*
Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
*/
:-moz-ui-invalid {
  box-shadow: none;
}
/*
Add the correct vertical alignment in Chrome and Firefox.
*/
progress {
  vertical-align: baseline;
}
/*
Correct the cursor style of increment and decrement buttons in Safari.
*/
::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
  height: auto;
}
/*
1. Correct the odd appearance in Chrome and Safari.
2. Correct the outline style in Safari.
*/
[type='search'] {
  -webkit-appearance: textfield; /* 1 */
  outline-offset: -2px; /* 2 */
}
/*
Remove the inner padding in Chrome and Safari on macOS.
*/
::-webkit-search-decoration {
  -webkit-appearance: none;
}
/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
  -webkit-appearance: button; /* 1 */
  font: inherit; /* 2 */
}
/*
Add the correct display in Chrome and Safari.
*/
summary {
  display: list-item;
}
/*
Removes the default spacing and border for appropriate elements.
*/
blockquote,
dl,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
figure,
p,
pre {
  margin: 0;
}
fieldset {
  margin: 0;
  padding: 0;
}
legend {
  padding: 0;
}
ol,
ul,
menu {
  list-style: none;
  margin: 0;
  padding: 0;
}
/*
Reset default styling for dialogs.
*/
dialog {
  padding: 0;
}
/*
Prevent resizing textareas horizontally by default.
*/
textarea {
  resize: vertical;
}
/*
1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
2. Set the default placeholder color to the user's configured gray 400 color.
*/
input::-moz-placeholder, textarea::-moz-placeholder {
  opacity: 1;
  color: var(--text-faint);
}
input::placeholder,
textarea::placeholder {
  opacity: 1;
  color: var(--text-faint);
}
/*
Set the default cursor for buttons.
*/
button,
[role="button"] {
  cursor: pointer;
}
/*
Make sure disabled buttons don't get the pointer cursor.
*/
:disabled {
  cursor: default;
}
/*
1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
   This can trigger a poorly considered lint error in some tools but is included by design.
*/
img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block; /* 1 */
  vertical-align: middle; /* 2 */
}
/*
Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
*/
img,
video {
  max-width: 100%;
  height: auto;
}
/* Make elements with the HTML hidden attribute stay hidden by default */
[hidden]:where(:not([hidden="until-found"])) {
  display: none;
}
.table{
  display: table;
}
.table-row{
  display: table-row;
}
.grid{
  display: grid;
}
.text-brand-600{
  color: var(--brand-600);
}
.text-gray-300{
  color: var(--text-faint);
}
.text-gray-400{
  color: var(--text-faint);
}
.text-green-500{
  color: var(--success);
}
.outline{
  outline-style: solid;
}
.filter{
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}

/* ── Country Picker ─────────────────────────────────────────────────── */
.country-picker {
  position: relative;
}
.country-picker-list {
  position: absolute;
  z-index: 50;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  max-height: 14rem;
  overflow-y: auto;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  border-radius: 0.375rem;
  border: 1px solid var(--border);
  background-color: var(--surface);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}
.country-picker-list li {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--text);
}
.country-picker-list li:hover,
.country-picker-list li:focus {
  background-color: var(--brand-50);
  color: var(--brand-600);
  outline: none;
}
.dark .country-picker-list li:hover,
.dark .country-picker-list li:focus {
  background-color: rgba(99,102,241,0.15);
  color: var(--brand-300);
}

/* ── Password Strength ──────────────────────────────────────────────── */
.pw-seg {
  flex: 1; height: 4px; border-radius: 9999px;
  background: var(--border); transition: background .25s;
}
.pw-seg.s-weak   { background: var(--danger); }
.pw-seg.s-fair   { background: #f97316; }
.pw-seg.s-good   { background: var(--warning); }
.pw-seg.s-strong { background: var(--success); }
.pw-pill {
  font-size: .7rem; font-weight: 500; padding: .18rem .5rem;
  border-radius: 9999px; border: 1px solid var(--border);
  color: var(--text-faint); background: transparent; transition: color, background-color, border-color .15s;
}
.pw-pill.ok { background: var(--success-bg); border-color: rgba(16,185,129,0.35); color: var(--success-text); }
.pw-match {
  display: none; align-items: center; gap: .3rem;
  margin-top: .375rem; font-size: .75rem; font-weight: 500;
}

/* ── Consent Vault ─────────────────────────────────────────────────────── */

/* Source form: one repeating row per permission (code | label | content URL | remove) */
.vault-permission-row {
  display: grid;
  gap: 0.5rem;
  align-items: start;
  grid-template-columns: 12rem minmax(0, 1fr) minmax(0, 1fr) auto;
}
.vault-permission-head {
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: var(--text-muted);
}
/* Code column: monospace; read-only once the source has records */
.vault-permission-row > input:first-child {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
}
.vault-permission-row > input[readonly] {
  background-color: var(--surface-2);
  color: var(--text-muted);
  cursor: not-allowed;
}
@media (max-width: 768px) {
  .vault-permission-row { grid-template-columns: minmax(0, 1fr); }
  .vault-permission-head { display: none; }
}

/* Source form: subject key row (key name | required toggle) */
.vault-key-row,
.vault-state-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
}
.vault-key-row:last-child,
.vault-state-row:last-child { border-bottom: 0; }

/* Records erase modal: wide enough for the record table; the record picker scrolls inside it */
.modal-xl { max-width: 64rem; }

.vault-erase-picker {
  max-height: 20rem;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
}
.table-th-check,
.table-td-check { width: 2.5rem; }

/* Consent text as recorded: long texts scroll inside the card */
.vault-consent-text {
  max-height: 16rem;
  overflow-y: auto;
  white-space: pre-line;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text);
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 0.75rem;
}

/* Permission summary chips in lists */
.vault-permission-chips { display: flex; flex-wrap: wrap; gap: 0.25rem; }

/* Secondary line inside a table cell */
.vault-cell-meta {
  display: block;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--text-muted);
}

/* Record detail: per-permission current state */
.vault-state-label { font-size: 0.875rem; line-height: 1.25rem; color: var(--text); }
.vault-state-code {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Record detail: timeline */
.vault-timeline {
  position: relative;
  margin-left: 0.5rem;
  border-left: 1px solid var(--border);
}
.vault-timeline-item { position: relative; padding-left: 1.25rem; padding-bottom: 1rem; }
.vault-timeline-item:last-child { padding-bottom: 0; }
.vault-timeline-dot {
  position: absolute;
  top: 0.25rem;
  left: -0.4rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 9999px;
  background-color: var(--brand-600);
  box-shadow: 0 0 0 4px var(--bg);
}
.vault-timeline-dot-danger { background-color: var(--danger); }
.vault-timeline-dot-muted { background-color: var(--text-faint); }
.vault-timeline-title { font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; color: var(--text); }
.vault-timeline-meta { font-size: 0.75rem; line-height: 1rem; color: var(--text-muted); }

/* Source form: consent text editor (Quill) and key rows */
.html-editor {
  min-height: 240px;
  background: var(--surface);
  border-radius: 0 0 0.375rem 0.375rem;
}
.vault-source-form .ql-toolbar {
  border-radius: 0.375rem 0.375rem 0 0;
  border-color: var(--input-border) !important;
}
.vault-source-form .ql-container {
  border-color: var(--input-border) !important;
  font-size: 0.875rem;
}
.vault-key-row > .form-input { flex: 1; max-width: 24rem; }

/* Text, link, language and version the person was shown, under a permission row on the record page */
.vault-permission-detail { padding: 0 0 0.5rem; }
.vault-permission-meta {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--text-faint);
  overflow-wrap: anywhere;
}
.vault-field-table .table-td-wrap { white-space: normal; }
/* Same column widths in every field table so the "Required" columns line up. */
.vault-field-table { table-layout: fixed; width: 100%; }
.vault-field-col-name { width: 12rem; }
.vault-field-col-required { width: 10rem; }
/* Each request part (permissions, keys) is its own block under the sample request. */
.vault-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.vault-field-group-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.375rem;
  font-weight: 600;
  color: var(--text);
}
.vault-field-group-notes {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
/* ── Cookie Discovery ──────────────────────────────────────────────────── */
/* New website: Manual / Automatic choice cards */
.cd-choice-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.cd-choice {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 0.5rem;
  border: 2px solid var(--border);
  background-color: var(--surface);
  cursor: pointer;
}
.cd-choice-active {
  border-color: var(--brand-600);
  background-color: var(--brand-50);
}
.dark .cd-choice-active {
  border-color: var(--brand-500);
  background-color: var(--surface);
}
.cd-choice input { margin-top: 0.25rem; }
.cd-choice-title {
  display: block;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: var(--text);
}
.cd-choice-desc {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
}
/* Wizard inside the admin page (reuses .wizard-steps / .wizard-body / .wizard-footer) */
.cd-wizard {
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background-color: var(--surface);
}
.cd-wizard .wizard-footer .btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
/* Step 1: numbered how-to */
.cd-howto {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.cd-howto-step {
  display: grid;
  gap: 1rem;
  align-items: start;
  grid-template-columns: 2rem minmax(0, 1fr);
}
.cd-howto-num {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background-color: var(--brand-600);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cd-howto-title {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: var(--text);
}
.cd-howto-text {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
}
/* Step 2: pasted scan text */
.cd-paste-input {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1rem;
  word-break: break-all;
}
/* Step 3: scan summary and scanned pages */
.cd-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 1rem;
  row-gap: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
}
.cd-details summary {
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: var(--brand-600);
}
.dark .cd-details summary { color: var(--brand-400); }
/* What an address group means for visitors, above the address tables. */
.cd-load-legend {
  margin: 0 0 0.5rem;
  padding-left: 1.125rem;
  list-style: disc;
  font-size: 0.8125rem;
  line-height: 1.25rem;
  color: var(--text-muted);
}
/* "+ Add cookie" / "+ New group" / "+ Add address": button-styled toggles; an open one takes the full row for its form. */
.cd-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem;
}
.cd-actions > .cd-action-toggle[open] { flex-basis: 100%; order: 1; }
.cd-action-toggle > summary { list-style: none; display: inline-flex; width: fit-content; }
.cd-action-toggle > summary::-webkit-details-marker { display: none; }
.cd-action-toggle[open] > summary { background-color: var(--surface-3); }
.cd-page-list {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--text-muted);
}
/* Cookie group cards */
.cd-group {
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background-color: var(--surface);
}
.cd-group[hidden] { display: none; }
.cd-group-unclassified { border-color: var(--warning); }
.cd-group-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}
.cd-group-name {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: var(--text);
}
.cd-group-count {
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--text-muted);
}
.cd-group-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
/* Tables inside group cards scroll horizontally on narrow screens */
.cd-table-scroll { overflow-x: auto; }
.cd-table-scroll .table { min-width: 52rem; }
/* Same column widths in every group card so the cards line up */
.cd-group .table { table-layout: fixed; }
.cd-group .cd-col-name { width: 15rem; }
.cd-group .cd-col-group { width: 15rem; }
.cd-group .table-th-action { width: 5.5rem; }
.cd-cookie-name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--text);
}
.cd-cookie-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
}
.cd-select-sm {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  font-size: 0.75rem;
  line-height: 1rem;
  width: 100%;
  min-width: 0;
}
.cd-group-header .cd-select-sm { width: auto; min-width: 12rem; }
/* Inline "new group" form */
.cd-new-group {
  display: grid;
  gap: 0.75rem;
  align-items: end;
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px dashed var(--border);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}
.cd-new-group .form-group { margin-bottom: 0; }
/* Toolbar above lists */
.cd-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
@media (max-width: 768px) {
  .cd-choice-grid { grid-template-columns: minmax(0, 1fr); }
  .cd-new-group { grid-template-columns: minmax(0, 1fr); }
}/* Website "Cookies" page */
.cd-add-cookie { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.cd-rename > summary { list-style: none; cursor: pointer; }
.cd-rename > summary::-webkit-details-marker { display: none; }
.cd-rename[open] > summary { display: none; }