/* 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 colour scale (teal).

     Taken from the Fleent design (docs/_design/Fleent-MVP.dc.html): #0F766E is the brand, #0B5A54
     its pressed state, #DCF0EC the tint behind a brand-coloured chip, #0D2A28 the near-black teal
     the installation screen and the sign-in panel sit on. The rest of the ramp is interpolated to
     fill the scale the components already ask for.

     BRD-004: the theme is semantic tokens, and a customer's white-label colours are applied by
     redefining these rather than by touching components.
  */
  --brand-50:  #f4fbf9;
  --brand-100: #dcf0ec;
  --brand-200: #cfe7e2;
  --brand-300: #9fd3ca;
  --brand-400: #6fbfb6;
  --brand-500: #2f9287;
  --brand-600: #0f766e;
  --brand-700: #0b5a54;
  --brand-800: #0d4741;
  --brand-900: #0d2a28;
  --brand-950: #071a19;

  /* Ink darks */
  --ink-950: #07100f;
  --ink-900: #0d2a28;

  /* Legacy RGB triples kept for backward compat */
  --brand-primary-rgb: 15 118 110;
  --brand-primary-hover-rgb: 11 90 84;
  --brand-primary-active-rgb: 13 71 65;
  --brand-accent-rgb: 111 191 182;
  --brand-ink-rgb: 13 42 40;

  /*
     Fonts. One family for the interface and one for anything that has to line up in a column —
     identifiers, plate numbers, timestamps, version strings. There is no third display face: the
     design sets headings in the same family at a heavier weight (UX-010).
  */
  --font-sans: 'IBM Plex Sans', system-ui, sans-serif;
  --font-display: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  /* Semantic surface tokens — light mode */
  --bg:             #eef0f2;
  --surface:        #ffffff;
  --surface-2:      #fafbfb;
  --surface-3:      #f1f3f4;
  --text:           #101820;
  --text-muted:     #667180;
  --text-faint:     #98a2ae;
  --border:         #e3e6e9;
  --border-subtle:  #edf0f2;
  --input-bg:       #ffffff;
  --input-border:   #e1e5e8;
  --ring:           rgba(15, 118, 110, 0.16);

  /* Auth background: the deep teal the design puts behind the sign-in panel. */
  --auth-bg: linear-gradient(160deg, #0b3b37 0%, #0f766e 62%, #127f72 100%);

  color-scheme: light;

  /*
     Status tokens. Darker than the usual web palette on purpose: these are read as small text on
     light chips in dense tables, and UX-009 forbids colour from being the only carrier of state,
     so they have to survive being read rather than merely glanced at.
  */
  --success:        #157f4a;
  --success-bg:     #e8f6ee;
  --success-text:   #0f6b43;
  --warning:        #b45309;
  --warning-bg:     #fdf3e7;
  --warning-text:   #92400e;
  --danger:         #b42318;
  --danger-bg:      #fdecea;
  --danger-text:    #912018;
  --info:           #0f766e;
  --info-bg:        #f4fbf9;
  --info-text:      #0b5a54;
}

.dark {
  /*
     Semantic surface tokens — dark mode.

     Built on the design's deepest teal rather than on neutral black: a dark theme that drops the
     brand hue entirely stops looking like the same product with the lights off.
  */
  --bg:             #071413;
  --surface:        rgba(255,255,255,0.055);
  --surface-2:      rgba(255,255,255,0.09);
  --surface-3:      rgba(255,255,255,0.14);
  --text:           rgba(255,255,255,0.92);
  --text-muted:     rgba(255,255,255,0.62);
  --text-faint:     rgba(255,255,255,0.38);
  --border:         rgba(255,255,255,0.11);
  --border-subtle:  rgba(255,255,255,0.06);
  --input-bg:       rgba(255,255,255,0.06);
  --input-border:   rgba(255,255,255,0.15);
  --ring:           rgba(111, 191, 182, 0.28);

  /* The two lightest brand steps are only ever used as backgrounds (row hover, active nav item,
     secondary button hover). Left at their light values they turn the element near-white on a dark
     page, so here they become translucent tints of the brand hue. */
  --brand-50:       rgba(111,191,182,0.10);
  --brand-100:      rgba(111,191,182,0.18);

  /* Status tokens — dark. Light text on a translucent tint; the hues match the light theme. */
  --success-bg:     rgba(21,127,74,0.20);
  --success-text:   #7fd3a6;
  --warning-bg:     rgba(180,83,9,0.20);
  --warning-text:   #f0b269;
  --danger-bg:      rgba(180,35,24,0.20);
  --danger-text:    #f0a29b;
  --info-bg:        rgba(15,118,110,0.20);
  --info-text:      #6fbfb6;

  /* Auth background — dark */
  --auth-bg: radial-gradient(ellipse 90% 50% at 50% 0%, rgba(15,118,110,0.30) 0%, transparent 70%), #071413;

  color-scheme: dark;
}

/*
   Dark mode component overrides.

   The brand teal is dark enough that a button painted with it on a dark background loses its edge,
   so the primary button steps up the ramp rather than keeping --brand-600.
*/
.dark .btn-primary {
  background-color: var(--brand-500);
  box-shadow: 0 0 0 1px rgba(111,191,182,0.22), 0 2px 8px rgba(15,118,110,0.32);
  color: #fff !important;
}
.dark .btn-primary:hover {
  background-color: var(--brand-400);
  box-shadow: 0 0 0 1px rgba(159,211,202,0.30), 0 2px 12px rgba(15,118,110,0.42);
  color: #07100f !important;
}
.dark .btn-primary:active {
  background-color: var(--brand-600);
  box-shadow: none;
}

/* Native select option popup — dark mode */
.dark .form-select option,
.dark select option {
  background-color: #0d2a28;
  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 */
.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-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;
}
.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 {
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  border-radius: 9999px;
  background: var(--surface-2);
  border: 1px solid var(--input-border);
  cursor: pointer;
  transition: background 0.15s;
}
.placeholder-chip:hover,
.placeholder-chip.is-copied {
  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{
  overflow: hidden;
  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]{
  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;
  background-color: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  max-width: 28rem;
}
.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(15,118,110,0.25);
  background-color: var(--info-bg);
  color: var(--info-text);
}
.alert-warning{
  border-color: rgba(180,83,9,0.25);
  background-color: var(--warning-bg);
  color: var(--warning-text);
}
.alert-danger{
  border-color: rgba(180,35,24,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(21,127,74,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-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(15,118,110,0.22);
  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(15,118,110,0.28);
  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(15,118,110,0.28);
  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);
}
.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;
}
.form-body {
  display: flex;
  flex-direction: column;
}
.form-row {
  display: flex;
  gap: 1rem;
}
.form-row > .form-group {
  flex: 1;
}
.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;
}
/* ── 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 {
    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(15,118,110,0.22);
  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;
}



/* ==========================================================================================
   Installation wizard

   The shape the Fleent design gives it: one white card floating on the deep teal, a header with
   the product mark and the build, a step track, and the step's own content below. Built from the
   shared tokens, so a theme change reaches it without a second palette to keep in step.
   ========================================================================================== */

.setup-body {
    background: var(--auth-bg);
    min-height: 100vh;
}

.setup-shell {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 3rem 1.5rem;
}

.setup-card {
    width: 100%;
    max-width: 56rem;
    background: var(--surface);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(7, 16, 15, .34);
}

/* ---- header ---------------------------------------------------------------------------- */

.setup-card-head {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-subtle);
}

.setup-mark {
    width: 2rem;
    height: 2rem;
    border-radius: .5625rem;
    background: var(--brand-600);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex: none;
}

.setup-head-text {
    flex: 1;
    min-width: 0;
}

.setup-head-title {
    font-weight: 600;
    font-size: 1.1875rem;
    letter-spacing: -.3px;
    color: var(--text);
}

.setup-head-sub {
    font-size: .8125rem;
    color: var(--text-muted);
    margin-top: .125rem;
}

.setup-build {
    font-family: var(--font-mono);
    font-size: .75rem;
    font-weight: 500;
    color: var(--brand-700);
    background: var(--brand-100);
    padding: .3125rem .5625rem;
    border-radius: .375rem;
    flex: none;
}

/* ---- step track ------------------------------------------------------------------------ */

.setup-track {
    display: flex;
    align-items: center;
    gap: .375rem;
    padding: .875rem 2rem;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: auto;
}

.setup-track-item {
    display: inline-flex;
    align-items: center;
    gap: .4375rem;
    padding: .3125rem .5rem;
    border-radius: .5rem;
    font-size: .75rem;
    color: var(--text-faint);
    white-space: nowrap;
    flex: none;
}

.setup-track-dot {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: .6875rem;
    font-weight: 600;
    background: var(--surface-3);
    color: var(--text-muted);
}

.setup-track-item.is-done {
    color: var(--text-muted);
}

.setup-track-item.is-done .setup-track-dot {
    background: var(--success);
    color: #fff;
}

.setup-track-item.is-current {
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(16, 24, 32, .06);
}

.setup-track-item.is-current .setup-track-dot {
    background: var(--brand-600);
    color: #fff;
}

/* Only the current step keeps its label once the track runs out of room. */
@media (max-width: 52rem) {
    .setup-track-label {
        display: none;
    }

    .setup-track-item.is-current .setup-track-label {
        display: inline;
    }
}

/* ---- body ------------------------------------------------------------------------------- */

.setup-card-body {
    padding: 1.75rem 2rem 2rem;
}

.setup-eyebrow {
    font-family: var(--font-mono);
    font-size: .6875rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin: 0 0 .5rem;
}

.setup-title {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -.3px;
    color: var(--text);
    margin: 0 0 .25rem;
}

.setup-subtitle {
    color: var(--text-muted);
    font-size: .875rem;
    margin: 0 0 1.5rem;
}

.setup-note {
    color: var(--text-muted);
    font-size: .8125rem;
    margin: .875rem 0;
}

.setup-section {
    padding: 1.125rem 0;
    border-top: 1px solid var(--border-subtle);
}

.setup-section:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.setup-section-title {
    font-size: .9375rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 .5rem;
}

/*
    A form that follows a list of what has already been entered — the branch step's "Add branch"
    below the branches added so far. The rule and the air are what stop its heading reading as the
    last row of the table above it. Only after a table: with nothing added yet there is nothing to
    divide it from.
*/
.table-container + .setup-subform {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-subtle);
}

/* Two fields side by side, stacking rather than shrinking on a narrow window. */
/*
    Side-by-side form fields that fall to one column when there is no room. Named without the setup
    prefix because the wizard is no longer the only place it is used: the branch and branding forms
    are shared between a wizard step and an Administration page, and a rule called setup-* inside a
    card on /branches would be a lie about where it belongs.
*/
.field-row,
.setup-field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 0 1rem;
}

/*
    The card's bottom rail. The negative bottom margin is what makes it sit flush with the card
    edge, and it is also a trap: anything placed after it is pulled up over the buttons and
    silently swallows their clicks. The stacking context keeps the rail on top when that happens,
    so a stray paragraph makes the layout look wrong rather than making Continue stop working.
    Put closing notes above the rail, not after it.
*/
.setup-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin: 1.75rem -2rem -2rem;
    padding: 1.125rem 2rem;
    border-top: 1px solid var(--border-subtle);
    background: var(--surface-2);
    position: relative;
    z-index: 1;
}

/* ---- system check table ------------------------------------------------------------------ */

.setup-checks .setup-check-name {
    font-weight: 600;
    white-space: nowrap;
}

.setup-checks .setup-check-detail {
    color: var(--text-muted);
    font-size: .8125rem;
}

/* ---- summary review list ------------------------------------------------------------------
   The design's step rows: numbered disc, title over detail, state chip on the right.
   ------------------------------------------------------------------------------------------ */

.setup-review {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .625rem;
}

.setup-review-row {
    display: flex;
    align-items: center;
    gap: .875rem;
    padding: .8125rem .9375rem;
    border: 1px solid var(--border);
    border-radius: .625rem;
    background: var(--surface);
}

.setup-review-row.is-done {
    border-color: var(--brand-200);
    background: var(--brand-50);
}

.setup-review-num {
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 50%;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: .75rem;
    font-weight: 600;
    background: var(--surface-3);
    color: var(--text-muted);
}

.setup-review-row.is-done .setup-review-num {
    background: var(--success);
    color: #fff;
}

.setup-review-text {
    flex: 1;
    min-width: 0;
}

.setup-review-title {
    display: block;
    font-size: .84375rem;
    font-weight: 600;
    color: var(--text);
}

.setup-review-detail {
    display: block;
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: .125rem;
}

/*
    The branding upload list (BRD-002). Its own rules rather than the wizard's review list: the same
    partial renders inside the setup card on one page and inside the application shell on the other,
    so it can borrow the styling of neither.
*/
.brand-assets {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .625rem;
}

.brand-asset {
    display: flex;
    align-items: flex-start;
    gap: .875rem;
    padding: .8125rem .9375rem;
    border: 1px solid var(--border);
    border-radius: .625rem;
    background: var(--surface);
}

.brand-asset.is-set {
    border-color: var(--brand-200);
    background: var(--brand-50);
}

/* Fixed box, contained image: an uploaded mark is any proportion and must not reflow the row. */
.brand-asset-preview {
    width: 2.75rem;
    height: 2.75rem;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: .5rem;
    background: var(--surface-3);
    overflow: hidden;
}

.brand-asset-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.brand-asset-placeholder {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-muted);
}

.brand-asset-text {
    flex: 1;
    min-width: 0;
}

.brand-asset-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .84375rem;
    font-weight: 600;
    color: var(--text);
}

.brand-asset-hint {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: .125rem;
}

.brand-asset-file {
    margin-top: .5rem;
    font-size: .75rem;
    padding: .375rem .5rem;
}

.brand-asset .form-check {
    margin-top: .5rem;
}

@media (max-width: 40rem) {
    .setup-shell {
        padding: 0;
    }

    .setup-card {
        border-radius: 0;
        min-height: 100vh;
        box-shadow: none;
    }

    .setup-card-head,
    .setup-track,
    .setup-card-body {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .setup-actions {
        margin-left: -1.25rem;
        margin-right: -1.25rem;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}

/* ---- wizard-local corrections to the shared components ------------------------------------
   The alert classes are normally used with .alert, which carries the padding and the radius.
   In the wizard they stand alone as a full-width notice, so they need both here, plus the
   breathing room a block of prose needs before the first field.
   ------------------------------------------------------------------------------------------ */

.setup-card-body > .alert-info,
.setup-card-body > .alert-warning,
.setup-card-body > .alert-danger,
.setup-card-body > .alert-success,
.setup-card-body form > .alert-info,
.setup-card-body form > .alert-warning,
.setup-card-body form > .alert-danger {
    display: block;
    border: 1px solid currentColor;
    border-color: color-mix(in srgb, currentColor 22%, transparent);
    border-radius: .625rem;
    padding: .8125rem 1rem;
    font-size: .8125rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.setup-card-body .alert-warning p,
.setup-card-body .alert-danger p,
.setup-card-body .alert-info p {
    margin: 0 0 .375rem;
}

.setup-card-body .alert-warning p:last-child,
.setup-card-body .alert-info p:last-child {
    margin-bottom: 0;
}

.setup-card-body .alert-warning ul {
    margin: 0 0 .5rem;
    padding-left: 1.125rem;
}

.setup-card-body .alert-warning li {
    margin: .1875rem 0;
}

/* A checkbox row that carries an explanation: the hint belongs under the row, not beside it. */
.setup-card-body .form-check {
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.setup-card-body .form-check .form-hint {
    flex-basis: 100%;
    margin: .1875rem 0 0 1.625rem;
}

/* A disabled action with a note next to it - "Test connection", "Send test email". */
.setup-card-body .btn-secondary + .form-hint {
    display: inline-block;
    margin-left: .625rem;
    vertical-align: middle;
}
