:root {
  --auth-background: linear-gradient(125deg, #101115 0%, #1d1b23 45%, #27222f 100%);
  color-scheme: dark;
  --bg: #101115;
  --surface: #1b1821;
  --surface-soft: #211d29;
  --surface-raised: #292332;
  --surface-hover: #322a3d;
  --input-bg: #15131a;
  --readonly-bg: #18151e;
  --text: #f0ede7;
  --text-secondary: #d2cbd7;
  --muted: #bbb2c5;
  --faint: #aaa0b5;
  --placeholder: #b3a7bf;
  --border: #4c4159;
  --border-subtle: #382e44;
  --control-border: #8e819d;
  --border-hover: #b4a4c7;
  --accent: #bea5e0;
  --action-bg: #8c5fbe;
  --action-hover: #8050ad;
  --action-foreground: #ffffff;
  --accent-soft: #30243f;
  --accent-border: #9d7abc;
  --accent-muted: #c7b1e3;
  --focus-border: #bea5e0;
  --focus-ring: #bea5e02a;
  --code-focus-ring: #bea5e050;
  --danger: #9d4561;
  --danger-hover: #b15570;
  --danger-foreground: #fff9f8;
  --danger-soft: #351f29;
  --danger-border: #8b4c66;
  --danger-text: #efb1c1;
  --success-soft: #202a35;
  --success-border: #51667e;
  --success-text: #c0d4e9;
  --code-text: #d6cfe0;
  --shadow: #00000026;
  --shadow-raised: #00000030;
  --radius: 6px;
  font-family: Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

:root[data-theme="light"] {
  --auth-background: linear-gradient(125deg, #f3f1ec 0%, #e9e6e1 45%, #dcd6e4 100%);
  color-scheme: light;
  --bg: #f3f1ec;
  --surface: #faf8f3;
  --surface-soft: #eeebe7;
  --surface-raised: #e5e0e7;
  --surface-hover: #ded7e4;
  --input-bg: #fdfcf8;
  --readonly-bg: #eae5eb;
  --text: #28232f;
  --text-secondary: #49404f;
  --muted: #5b5261;
  --faint: #655b6b;
  --placeholder: #6c5f75;
  --border: #b6aaba;
  --border-subtle: #cec5d1;
  --control-border: #7b6e87;
  --border-hover: #5d466e;
  --accent: #684195;
  --action-bg: #684195;
  --action-hover: #56337d;
  --action-foreground: #ffffff;
  --accent-soft: #e6dced;
  --accent-border: #84699f;
  --accent-muted: #73508e;
  --focus-border: #684195;
  --focus-ring: #68419524;
  --code-focus-ring: #68419548;
  --danger: #9b3554;
  --danger-hover: #7d2441;
  --danger-foreground: #fff8f5;
  --danger-soft: #f3e2e7;
  --danger-border: #bb8b9d;
  --danger-text: #842d49;
  --success-soft: #e5eaf0;
  --success-border: #a7b6c8;
  --success-text: #3c5872;
  --code-text: #4f405f;
  --shadow: #2517310a;
  --shadow-raised: #25173116;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

button,input,textarea {
  font: inherit;
}

button,a,input,textarea,summary {
  outline-offset: 3px;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

.sr-only,.skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  z-index: 20;
  top: 10px;
  left: 10px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--accent);
}

.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1600px;
  min-height: 84px;
  margin: auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  gap: 34px;
}

.brand {
  display: flex;
  align-items: center;
  min-block-size: 44px;
  gap: 12px;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 550;
  line-height: 1.25;
}

.brand-mark {
  display: block;
  flex-shrink: 0;
  width: 96px;
  height: 36px;
  object-fit: contain;
}

.primary-nav {
  align-self: flex-end;
  display: flex;
  align-items: stretch;
  height: 44px;
  min-width: 0;
  max-width: 100%;
  gap: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  flex: 1;
}

.nav-link {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  position: relative;
  min-inline-size: 44px;
  color: var(--muted);
  padding: 0 13px;
  font-weight: 550;
  font-size: 13px;
}

.nav-link:hover {
  color: var(--accent);
  background: var(--surface-hover);
}

.nav-link.active {
  color: var(--accent);
}

.nav-link.active:after {
  content: "";
  position: absolute;
  bottom: 2px;
  height: 3px;
  background: var(--accent);
  left: 13px;
  right: 13px;
  border-radius: 999px;
}

.nav-link-settings {
  margin-left: 12px;
}

.nav-link-settings:before {
  content: "";
  position: absolute;
  left: -9px;
  top: 50%;
  width: 1px;
  height: 16px;
  background: var(--border);
  transform: translateY(-50%);
}

.nav-link:focus-visible,.subnav-link:focus-visible {
  outline-offset: -3px;
}

.header-actions {
  --header-action-gap: 16px;
  display: flex;
  align-items: center;
  gap: var(--header-action-gap);
  margin-left: auto;
}

.language-switch {
  display: flex;
  background: var(--surface-raised);
  border-radius: 7px;
  padding: 3px;
  gap: 2px;
  font-size: 10px;
  font-weight: 700;
}

.language-switch a {
  display: inline-grid;
  min-inline-size: 44px;
  min-block-size: 44px;
  place-items: center;
  padding: 5px 7px;
  color: var(--muted);
  border-radius: 5px;
}

.language-switch a.selected {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 3px var(--shadow);
}

.account-menu {
  position: relative;
  flex-shrink: 0;
}

.account-trigger {
  max-width: 140px;
  min-width: 44px;
  min-height: 44px;
  padding: 11px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 550;
  line-height: 20px;
  list-style: none;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-trigger::-webkit-details-marker {
  display: none;
}

.account-trigger:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

.account-menu[open] .account-trigger {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.account-popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  right: 0;
  width: 200px;
  max-width: calc(100vw - 32px);
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 24px var(--shadow-raised);
}

.account-popover p {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 550;
  text-align: center;
}

.account-actions {
  display: flex;
  gap: 8px;
  margin: 0;
}

.account-actions .button {
  flex: 1;
  min-height: 44px;
  padding: 7px 12px;
  font-size: 12px;
}

.account-password-link {
  display: block;
  min-height: 44px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  text-align: center;
}

.account-password-link:hover,
.account-password-link:focus-visible {
  color: var(--accent);
}

.subnav-wrap {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.subnav {
  max-width: 1600px;
  padding: 0 40px;
  margin: auto;
  display: flex;
  gap: 28px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}

#settings-navigation .subnav {
  flex-wrap: wrap;
  gap: 0 clamp(12px, 3vw, 28px);
  overflow: visible;
}

.subnav-link {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-inline-size: 44px;
  min-block-size: 44px;
  padding: 10px 4px;
  font-size: 13px;
  position: relative;
  color: var(--muted);
}

.subnav-link.active {
  color: var(--accent);
  font-weight: 600;
}

.subnav-link.active:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}

.main {
  width: 100%;
  max-width: 1600px;
  padding: 38px 40px 64px;
  margin: 0 auto;
  flex: 1;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 27px;
  min-height: 72px;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: .13em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 7px;
}

h1,h2,p {
  margin-top: 0;
}

h1 {
  font-size: 27px;
  letter-spacing: -.7px;
  line-height: 1.25;
  font-weight: 670;
  margin-bottom: 8px;
}

h2 {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -.3px;
  margin-bottom: 10px;
}

.lede {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  margin-bottom: 0;
  max-width: 660px;
}

.count-pill {
  display: inline-flex;
  vertical-align: middle;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  padding: 2px 8px;
  margin-left: 6px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  font-weight: 600;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 44px;
  min-block-size: 44px;
  gap: 9px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  transition: background .12s,border-color .12s,color .12s;
}

.button-primary {
  background: var(--action-bg);
  color: var(--action-foreground);
  box-shadow: 0 2px 3px var(--shadow);
}

.button-primary:hover {
  background: var(--action-hover);
  border-color: var(--accent-border);
}

.button-secondary {
  background: var(--surface);
  border-color: var(--control-border);
  color: var(--text-secondary);
  box-shadow: 0 1px 2px var(--shadow);
}

.button-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}

.button-quiet {
  background: transparent;
  color: var(--muted);
  padding-left: 6px;
  padding-right: 6px;
}

.button-quiet:hover {
  color: var(--text);
  background: var(--surface-raised);
}

.button-small {
  padding: 7px 11px;
  font-size: 11px;
}

.button-danger {
  background: var(--danger);
  color: var(--danger-foreground);
}

.button-danger:hover {
  background: var(--danger-hover);
}

.button:disabled {
  border-color: var(--border);
  background: var(--surface-soft);
  color: var(--muted);
  box-shadow: none;
}



.panel {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 2px 5px var(--shadow);
}

.dashboard-heading {
  min-height: 0;
  margin-bottom: 24px;
}

.dashboard-heading h1 {
  margin-bottom: 0;
}

.dashboard-heading .lede {
  margin: 8px 0 0;
}

/* Panel activity and unread messages */
.header-unread:not([hidden]) {
  min-inline-size: 20px;
  margin-inline-start: 6px;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  text-align: center;
}

.header-actions:has(.header-events) {
  position: relative;
}

.header-events {
  flex-shrink: 0;
}

.header-events-trigger {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--muted);
  list-style: none;
  cursor: pointer;
}

.header-events-trigger::-webkit-details-marker {
  display: none;
}

.header-events-trigger::after {
  content: "";
  position: absolute;
  inset-inline-start: calc(100% + var(--header-action-gap) / 2);
  top: 50%;
  width: 1px;
  height: 16px;
  background: var(--border);
  transform: translateY(-50%);
  pointer-events: none;
}

.header-events-trigger:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
  color: var(--text);
}

.header-events[open] .header-events-trigger {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.header-events-popover {
  position: absolute;
  z-index: 40;
  inset-block-start: calc(100% + 8px);
  inset-inline-end: 0;
  width: min(320px, calc(100vw - 36px));
  max-height: min(70vh, 420px);
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 24px var(--shadow-raised);
}

.header-events-popover h2 {
  margin: 2px 4px 8px;
  font-size: 13px;
  font-weight: 650;
}

.header-events-empty {
  margin: 4px;
}

.header-events-empty,
.header-events-list time,
.header-event-project {
  color: var(--muted);
  font-size: 11px;
}

.header-events-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.header-events-list > li + li {
  border-top: 1px solid var(--border-subtle);
}

.header-events-list a {
  display: grid;
  min-block-size: 44px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 2px 8px;
  padding: 8px 4px;
  border-radius: var(--radius);
  color: var(--text);
}

.header-events-list a:hover {
  background: var(--surface-hover);
}

.header-events-list a:focus-visible {
  outline-offset: -2px;
}

.header-event-label {
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.header-event-project {
  grid-column: 1 / -1;
}

@media (max-width: 650px) {
  .header-unread:not([hidden]) {
    min-inline-size: 18px;
    margin-inline-start: 4px;
    padding: 1px 4px;
    font-size: 10px;
  }
}

@media (max-width: 500px) {
  .header-inner:has(.header-events) {
    padding-inline: 14px;
    column-gap: 8px;
  }

  .header-actions:has(.header-events) {
    --header-action-gap: 6px;
  }

  .header-actions:has(.header-events) .account-trigger {
    max-width: 60px;
    padding-inline: 8px;
  }
}

.dashboard-period {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.dashboard-period a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.dashboard-period a:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.dashboard-period a[aria-current="true"] {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
}

.dashboard-metrics,
.dashboard-details {
  display: grid;
  gap: 16px;
}

.dashboard-details {
  margin-top: 16px;
}

.dashboard-metric,
.dashboard-section {
  min-width: 0;
  padding: 20px 22px;
}

.dashboard-metric h2 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0;
}

.dashboard-metric h2:has(+ .dashboard-metric-caption) {
  margin-bottom: 2px;
}

.dashboard-metric-caption {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
}

.dashboard-metric-value {
  margin: 0;
  font-size: 30px;
  font-weight: 650;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.dashboard-section h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.dashboard-events {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dashboard-events > li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.dashboard-events a {
  min-width: 44px;
  min-height: 44px;
  line-height: 44px;
}

.dashboard-events > li:last-child {
  padding-bottom: 0;
}

.dashboard-events time {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: end;
}

.dashboard-empty {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 650px) {
  .dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .dashboard-metrics,
  .dashboard-details {
    gap: 12px;
  }

  .dashboard-details {
    margin-top: 12px;
  }

  .dashboard-metric,
  .dashboard-section {
    padding: 16px 18px;
  }
}

.table-panel {
  overflow: hidden;
}

.directory-heading {
  min-height: 0;
}

.directory-csv-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.directory-csv-import {
  position: relative;
}

.directory-csv-import > summary {
  cursor: pointer;
  list-style: none;
}

.directory-csv-import > summary::-webkit-details-marker {
  display: none;
}

.directory-csv-import > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  transform: translateY(-2px) rotate(45deg);
}

.directory-csv-import[open] > summary {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.directory-csv-import[open] > summary::after {
  transform: translateY(2px) rotate(225deg);
}

.directory-csv-import[open] > .directory-csv-panel {
  position: absolute;
  z-index: 10;
  inset-block-start: calc(100% + 8px);
  inset-inline-start: 0;
  width: min(320px, calc(100vw - 36px));
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  gap: 8px;
  box-shadow: 0 8px 24px var(--shadow-raised);
}

.directory-csv-panel > label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.directory-csv-panel .field-help {
  margin: 0;
  overflow-wrap: anywhere;
}

.directory-csv-actions :is(button, input):disabled,
.directory-csv-panel input[type=file]:disabled::file-selector-button {
  cursor: default;
}

.directory-csv-panel .button-primary:disabled {
  background: var(--action-bg);
  border-color: transparent;
}

.table-toolbar {
  min-height: 76px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.search-form {
  display: flex;
  align-items: center;
  position: relative;
  gap: 8px;
}

.table-toolbar .search-form input[type=search] {
  width: 285px;
  padding-left: 34px;
  min-height: 44px;
  font-size: 12px;
  background: var(--surface);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 6px;
  color: var(--faint);
  font-size: 20px;
  line-height: 1;
  pointer-events: none;
}

.table-size {
  color: var(--faint);
  font-size: 11px;
  white-space: nowrap;
}

.table-scroll {
  width: 100%;
  overflow: auto;
}

.table-scroll:has(> .directory-table):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.directory-table td:first-child {
  font-variant-numeric: tabular-nums;
}

table {
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
  font-size: 12px;
  min-width: 100%;
  width: 100%;
}

th {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 650;
  letter-spacing: .035em;
  color: var(--muted);
  padding: 13px 16px;
  background: var(--surface-soft);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th:first-child,td:first-child {
  padding-left: 22px;
}

th:last-child,td:last-child {
  padding-right: 22px;
}

th a {
  display: flex;
  align-items: center;
  gap: 9px;
}

th a:hover {
  color: var(--accent);
}

.sort-indicator {
  color: var(--faint);
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0;
}

.sort-indicator.selected {
  color: var(--accent);
}

td {
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px;
  color: var(--text-secondary);
  vertical-align: middle;
  height: 58px;
}

td:first-child {
  color: var(--text);
  font-weight: 550;
}

.cell-value {
  display: block;
  max-width: 270px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.actions-heading {
  text-align: right;
}

.row-actions {
  text-align: right;
  white-space: nowrap;
}

.table-link {
  display: inline-block;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 0;
}

.table-link:hover {
  text-decoration: underline;
}

.responsive-table {
  table-layout: fixed;
}

.responsive-table th {
  height: 44px;
  padding-block: 4px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.responsive-table td:not([colspan]) {
  height: 48px;
  padding-block: 2px;
  min-width: 0;
}

.catalog-table .actions-heading {
  width: 156px;
}

.catalog-table .row-actions {
  white-space: normal;
}

.catalog-table :is(th a, .row-actions a) {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
}

@media (max-width: 900px) {
  .responsive-table,
  .responsive-table :is(thead, tbody) {
    display: block;
  }

  .responsive-table thead tr {
    display: flex;
    flex-wrap: wrap;
  }

  .responsive-table th:not(:has(a)) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .responsive-table th:has(a) {
    display: block;
    height: auto;
    width: auto;
    padding: 0 10px;
    border: 0;
    background: var(--surface-soft);
  }

  .responsive-table tr:has(th a) {
    padding-inline: 6px;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border-subtle);
  }

  .responsive-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .responsive-table tbody tr:last-child {
    border-bottom: 0;
  }

  .responsive-table tbody tr > td:not([colspan]) {
    display: grid;
    align-content: start;
    justify-items: start;
    height: auto;
    padding: 0;
    border: 0;
    text-align: start;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .responsive-table td[data-column]::before {
    display: block;
    content: attr(data-column);
    content: attr(data-column) / "";
    color: var(--muted);
    font-size: 11px;
    font-weight: 550;
  }

  .responsive-table tbody td[colspan],
  .responsive-table tbody .row-actions,
  .responsive-table tbody .tls-actions {
    grid-column: 1 / -1;
  }

  .responsive-table tbody tr > td.row-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
  }

  .responsive-table tbody td.row-actions::before {
    margin-inline-end: auto;
  }

  .responsive-table .cell-value,
  .responsive-table .full-value-text {
    width: 100%;
    max-width: 100%;
  }
}

.muted-link {
  color: var(--faint);
  margin-left: 14px;
}

.bank-logo {
  max-width: 60px;
  max-height: 30px;
  object-fit: contain;
  display: block;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 550;
  background: var(--surface-raised);
  color: var(--faint);
  padding: 3px 8px;
  border-radius: 5px;
}

.status-badge.enabled {
  background: var(--success-soft);
  color: var(--success-text);
}

.status-badge span {
  font-size: 6px;
}

.chat-queue-heading,
.archive-heading,
.message-feed-heading {
  min-height: 0;
}

.chat-queue-heading h1,
.archive-heading h1,
.message-feed-heading h1 {
  margin-bottom: 0;
}

.page-heading.archive-heading,
.page-heading.message-feed-heading {
  align-items: end;
}

.archive-heading .lede,
.message-feed-heading .lede {
  margin: 6px 0 0;
}

.chat-queue-links,
.message-export-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.archive-action:disabled {
  cursor: default;
}

.archive-result {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.archive-result:not(:empty) {
  margin-bottom: 12px;
}

.chat-queue,
.message-feed {
  overflow: visible;
}

.chat-queue .table-toolbar,
.message-feed .table-toolbar {
  min-height: 0;
  padding-block: 14px;
}

.chat-filters,
.message-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.chat-filter-view,
.chat-filter-project {
  width: 158px;
  min-width: 0;
  max-width: 100%;
}

.message-filters {
  width: 100%;
}

.message-filters .search-form {
  flex: 1 1 124px;
  min-width: 0;
  max-width: 285px;
}

.message-filters .search-form input[type=search] {
  width: 100%;
  min-width: 0;
  min-height: 40px;
}

.message-filters .search-icon {
  top: 50%;
  transform: translateY(-50%);
}

.message-sender-select {
  width: 148px;
  max-width: 100%;
}

.message-sender-select :is(.pm-select-trigger, .pm-select-option),
.message-sender-select:not(.pm-select) select {
  padding-inline: 20px;
  text-align: center;
}

.chat-filters-enhanced .chat-filter-apply {
  display: none;
}

.chat-queue .table-scroll,
.message-feed .table-scroll {
  position: relative;
  border-radius: 0 0 var(--radius) var(--radius);
}

.chat-table th:nth-child(2) {
  width: 50%;
}

.chat-table td:nth-child(2) {
  white-space: normal;
  overflow-wrap: anywhere;
}

.chat-table :is(th, td):nth-child(4) {
  text-align: right;
}

.chat-table :is(td:first-child, .chat-unread-count) {
  font-variant-numeric: tabular-nums;
}

.chat-table tr:last-child td {
  border-bottom: 0;
}

.chat-table tr:has(.chat-row-link) {
  position: relative;
  /* Keep the link overlay anchored to this row in Safari. */
  transform: translateX(0);
}

.chat-row-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.chat-table tr:has(.chat-row-link:hover) > td {
  background: var(--surface-hover);
}

.chat-row-link:focus-visible {
  outline: none;
}

.chat-row-link:focus-visible::after {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.chat-unread-count {
  background: var(--accent-soft);
  color: var(--accent);
}

.chat-unread-count {
  display: inline-block;
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 650;
  text-align: center;
}

:is(.chat-table, .directory-table) .chat-empty-cell {
  padding-block: 30px;
  text-align: center;
  white-space: normal;
  color: var(--muted);
  font-weight: 400;
}

.chat-empty-cell strong {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.chat-empty-cell p {
  margin: 4px 0 0;
}

@media (max-width: 650px) {
  .chat-table {
    table-layout: fixed;
    white-space: normal;
  }

  .chat-table th:first-child {
    width: 26%;
  }

  .chat-table th:nth-child(2) {
    width: 24%;
  }

  .chat-table th:nth-child(3) {
    width: 24%;
  }

  .chat-table :is(th, td) {
    padding-inline: 8px;
  }

  .chat-table th {
    overflow-wrap: anywhere;
  }

  .chat-table :is(th, td):first-child {
    padding-left: 15px;
  }

  .chat-table :is(th, td):last-child {
    padding-right: 15px;
  }

  .page-heading.archive-heading > .archive-action {
    width: auto;
  }

}

.chat-queue-table {
  --chat-overdue-bg: color-mix(in srgb, var(--danger-soft), var(--surface) 32%);
  table-layout: fixed;
}

.chat-queue-table tbody td:not(.chat-empty-cell) {
  height: 48px;
  padding-block: 9px;
}

.chat-queue-table th:first-child {
  width: 110px;
}

.chat-queue-table th:nth-child(2) {
  width: auto;
}

.chat-queue-table th:nth-child(3) {
  width: 145px;
}

.chat-queue-table th:nth-child(4) {
  width: 124px;
}

.chat-queue-table th:nth-child(5) {
  width: 166px;
}

.chat-queue-table th:nth-child(6) {
  width: 110px;
}

.chat-queue-table th:last-child {
  width: 46px;
}

.chat-queue-table :is(th, td):nth-child(4) {
  text-align: start;
}

.chat-queue-table :is(th, td):nth-child(6),
.chat-queue-presence {
  text-align: center;
}

.chat-queue-table tr[data-overdue] > td {
  background: var(--chat-overdue-bg);
}

.chat-queue-table tr[data-overdue] > td:first-child {
  box-shadow: inset 2px 0 var(--danger-border);
}

.chat-queue-excerpt {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-queue-time,
.chat-queue-client,
.chat-no-unread,
.chat-queue-count {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.chat-queue-table :is(.chat-queue-client, .chat-queue-project) {
  white-space: normal;
  overflow-wrap: anywhere;
}

.chat-queue-wait {
  display: block;
  color: var(--danger-text);
  font-size: 11px;
  line-height: 1.3;
}

.chat-presence-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border: 1px solid var(--control-border);
  border-radius: 50%;
  vertical-align: middle;
}

.chat-presence-dot[data-online="true"] {
  border-color: var(--success-text);
  background: var(--success-text);
}

.chat-queue-footer:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--border-subtle);
}

@media (max-width: 900px) {
  .chat-filter-view,
  .chat-filter-project {
    flex: 1 1 128px;
  }

  .chat-queue-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .chat-queue-table,
  .chat-queue-table tbody {
    display: block;
  }

  .chat-queue-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 4px 12px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .chat-queue-table tbody tr:last-child {
    border-bottom: 0;
  }

  .chat-queue-table tr[data-overdue] {
    background: var(--chat-overdue-bg);
    box-shadow: inset 2px 0 var(--danger-border);
  }

  .chat-queue-table tr:has(.chat-row-link:hover) {
    background: var(--surface-hover);
  }

  .chat-queue-table tbody tr > td:not(.chat-empty-cell),
  .chat-queue-table tbody tr[data-overdue] > td:first-child {
    min-width: 0;
    height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .chat-queue-table tbody tr:has(.chat-row-link:hover) > td {
    background: transparent;
  }

  .chat-queue-id { grid-area: 1 / 1; }
  .chat-queue-unread { grid-area: 1 / 2; }
  .chat-queue-presence { grid-area: 1 / 3; }
  .chat-queue-last { grid-area: 2 / 1 / auto / -1; }
  .chat-queue-project { grid-area: 3 / 1; }
  .chat-queue-time { grid-area: 3 / 2 / auto / -1; align-self: center; }
  .chat-queue-client { grid-area: 4 / 1 / auto / -1; }

  .chat-queue-table .chat-empty-cell {
    grid-column: 1 / -1;
    height: auto;
    padding-block: 18px;
  }
}

.message-filters .search-form input[type=search] {
  min-height: 44px;
}

.message-project-select {
  width: 154px;
}

.message-period-select {
  width: 134px;
}

.message-filters .project-select {
  min-width: 0;
  max-width: 100%;
}

.message-table {
  table-layout: fixed;
}

.message-table th {
  height: 44px;
  padding-block: 0;
}

.message-table th:first-child {
  width: 148px;
}

.message-table th:nth-child(2) {
  width: 26%;
}

.message-table th:nth-child(3) {
  width: 116px;
}

.message-table :is(th, td):nth-child(4) {
  text-align: start;
}

.message-table td:not(.chat-empty-cell) {
  height: 48px;
  padding-block: 0;
  vertical-align: middle;
}

.message-chat-context {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.message-table .table-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-inline-size: 44px;
  min-block-size: 44px;
  padding: 0;
  font-size: inherit;
}

.message-project,
.message-excerpt {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-project {
  font-size: 11px;
}

.message-time-cell,
.message-project,
.message-sender {
  color: var(--muted);
}

@media (max-width: 900px) {
  .message-filters .project-select {
    flex: 1 1 132px;
  }

  .message-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .message-table,
  .message-table tbody {
    display: block;
  }

  .message-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, auto);
    gap: 3px 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .message-table tbody tr:last-child {
    border-bottom: 0;
  }

  .message-table tbody td:not(.chat-empty-cell) {
    min-width: 0;
    height: auto;
    padding: 0;
    border: 0;
  }

  .message-table .message-chat-cell {
    grid-area: 1 / 1 / span 2;
    align-self: center;
  }

  .message-table .message-time-cell {
    grid-area: 1 / 2;
    align-self: end;
    text-align: end;
  }

  .message-sender-cell {
    grid-area: 2 / 2;
    text-align: end;
  }

  .message-sender-cell::before {
    content: attr(data-cell-label) " · ";
    color: var(--faint);
    font-size: 11px;
  }

  .message-table .message-text-cell {
    grid-column: 1 / -1;
    padding-bottom: 4px;
  }

  .message-table .chat-empty-cell {
    grid-column: 1 / -1;
    height: auto;
    padding-block: 18px;
  }
}

@media (max-width: 550px) {
  .message-filters .search-form {
    flex-basis: 100%;
    max-width: none;
  }
}

.chat-detail-heading {
  min-height: 0;
  margin-bottom: 22px;
}

.chat-detail-heading h1 {
  margin: 0;
  overflow-wrap: anywhere;
}

.chat-detail-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.chat-detail-title .lede {
  flex-basis: 100%;
}

.chat-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 264px;
  align-items: start;
  gap: 16px;
}

.conversation-panel,
.chat-detail-sidebar {
  min-width: 0;
}

.conversation-panel {
  --conversation-padding: 20px;
}

.conversation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px var(--conversation-padding);
  border-bottom: 1px solid var(--border-subtle);
}

.conversation-header h2,
.chat-side-panel h2 {
  margin: 0;
  font-size: 15px;
}

.conversation-stream {
  min-height: 280px;
  max-height: clamp(280px, 56vh, 540px);
  padding: 20px var(--conversation-padding);
  overflow-y: auto;
  background: var(--input-bg);
}

.conversation-stream:has(> .chat-placeholder) {
  display: grid;
  place-items: center;
}

.conversation-stream .chat-placeholder {
  max-width: 42ch;
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.conversation-empty:not([hidden]) {
  display: grid;
  min-height: 180px;
  padding: 24px 16px;
  place-items: center;
  text-align: center;
}

.conversation-empty h2 {
  margin: 0;
}

.conversation-messages {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chat-message {
  justify-self: start;
  width: fit-content;
  max-width: min(88%, 58ch);
  padding: 9px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 3px 8px 8px;
  background: var(--surface-raised);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.chat-message[data-role="operator"] {
  justify-self: end;
  border-radius: 8px 3px 8px 8px;
  border-color: var(--border);
  background: var(--accent-soft);
}

.chat-message[data-role="system"] {
  justify-self: center;
  max-width: 100%;
  border-color: transparent;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.chat-message-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  margin: 0 0 3px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.chat-message-meta time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}

.chat-message[data-role="system"] .chat-message-meta {
  justify-content: center;
  color: var(--muted);
}

.chat-message-text {
  margin: 0;
  white-space: pre-wrap;
}

.chat-message-attachment {
  display: block;
  margin: 5px 0 0;
  color: var(--accent);
  font-size: 12px;
}

.chat-composer {
  display: grid;
  padding: 16px var(--conversation-padding);
  border-top: 1px solid var(--border-subtle);
}

.chat-composer textarea {
  display: block;
  min-height: 70px;
  resize: none;
  font-size: 13px;
}

.chat-composer textarea:disabled {
  background: var(--readonly-bg);
  border-color: var(--border);
}

.chat-composer textarea:disabled::placeholder {
  color: var(--faint);
}

.chat-composer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.chat-composer-actions .button-primary {
  margin-inline-start: auto;
}

.chat-composer-attachment {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  column-gap: 6px;
}

.chat-composer-attachment:has([data-chat-attachment-name]:not(:empty)) {
  margin-top: 8px;
}

.chat-detail-grid button:disabled {
  cursor: default;
}

.chat-detail-grid .button-primary:disabled {
  border-color: var(--border);
  background: var(--surface-raised);
  color: var(--muted);
  box-shadow: none;
}

.chat-detail-grid :is(.button-secondary, .button-quiet):disabled:hover {
  background: var(--surface);
  color: var(--muted);
}

.chat-side-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.chat-side-actions {
  display: grid;
  gap: 8px;
}

.chat-side-actions .button {
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .chat-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 650px) {
  .conversation-panel {
    --conversation-padding: 14px;
  }

  .conversation-stream {
    min-height: 220px;
  }
}

.chat-presence[hidden],
.conversation-nav button[hidden],
.conversation-typing[hidden],
.chat-attachment-preview[hidden] {
  display: none;
}

.chat-presence {
  font-size: 11px;
}

.chat-presence[data-online="true"] {
  color: var(--success-text);
  background: var(--success-soft);
}

.chat-presence[data-online]::before {
  content: "";
  width: 6px;
  height: 6px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.chat-presence[data-online="true"]::before {
  background: currentColor;
}

.conversation-header {
  flex-wrap: wrap;
}

.conversation-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-inline-start: auto;
}

.conversation-nav .button-small {
  min-height: 30px;
  padding-inline: 8px;
}

.conversation-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.conversation-divider::before,
.conversation-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.conversation-unread {
  color: var(--accent);
  font-weight: 650;
}

.conversation-unread::before,
.conversation-unread::after {
  background: var(--accent-border);
}

.conversation-unread:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

.conversation-typing {
  margin: 0;
  padding: 3px var(--conversation-padding) 9px;
  color: var(--muted);
  background: var(--input-bg);
  font-size: 12px;
}

.chat-message-receipt {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  text-align: end;
  font-size: 11px;
}

.chat-image-thumb {
  display: grid;
  gap: 5px;
  width: min(100%, 180px);
  padding: 4px;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input-bg);
  color: var(--accent);
  text-align: start;
  cursor: zoom-in;
}

.chat-image-thumb img {
  width: 100%;
  height: 92px;
  border-radius: 3px;
  object-fit: contain;
  background: var(--surface);
}

.chat-image-name {
  padding-inline: 4px;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.chat-image-dialog {
  max-width: min(92vw, 900px);
  max-height: 90vh;
  padding: 14px;
  color: var(--text);
}

.chat-image-dialog::backdrop {
  background: rgb(12 11 16 / 75%);
}

.chat-image-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.chat-image-dialog h2 {
  margin: 0;
  font-size: 15px;
}

.chat-image-dialog img {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 82px);
  margin: auto;
  object-fit: contain;
}

.chat-quick-reply {
  width: min(100%, 200px);
  margin-bottom: 10px;
}

.chat-quick-reply select {
  width: 100%;
  min-height: 36px;
  padding-inline: 9px;
  border: 1px solid var(--control-border);
  border-radius: 7px;
  background: var(--input-bg);
  color: var(--text);
}

.chat-character-count {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chat-attachment-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px;
  margin-block-start: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.chat-attachment-preview img {
  flex: none;
  border-radius: 3px;
  object-fit: cover;
}

.chat-attachment-preview .button-small {
  flex: none;
  padding-inline: 6px;
}

.chat-composer-error {
  margin: 6px 0 0;
  color: var(--danger-text);
  font-size: 12px;
}

.chat-action-result {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.chat-side-panel .chat-action-result:empty,
.chat-composer-error:empty {
  position: absolute;
}

.chat-detail-sidebar {
  display: grid;
  gap: 12px;
}

.chat-side-details {
  display: grid;
  gap: 8px;
  margin: 0;
  font-size: 12px;
}

.chat-side-details > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  align-items: start;
  gap: 8px;
}

.chat-side-details dt {
  color: var(--muted);
}

.chat-side-details dd {
  margin: 0;
  text-align: end;
  overflow-wrap: anywhere;
}

.chat-note {
  min-height: 66px;
  resize: none;
  font-size: 12px;
}

.chat-note-status {
  min-height: 1.4em;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.chat-note-status.is-error {
  color: var(--danger-text);
}

.chat-side-panel:has(.chat-note) .chat-side-actions {
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.chat-archive {
  overflow: visible;
}

.archive-toolbar,
.archive-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.chat-archive .archive-toolbar {
  justify-content: flex-start;
  min-height: 0;
  padding-block: 12px;
  gap: 8px 16px;
}

.archive-modes {
  padding: 3px;
}

.archive-modes a {
  min-height: 32px;
}

.archive-filter-project {
  width: 154px;
}

.archive-filter-period {
  width: 134px;
}

.chat-archive .table-scroll {
  border-radius: 0 0 var(--radius) var(--radius);
}

.archive-table {
  table-layout: fixed;
}

.archive-table :is(th, td).archive-select-cell {
  width: 62px;
  padding: 0 0 0 17px;
}

.archive-selection {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 34px;
  min-block-size: 34px;
}

.archive-selection input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  margin: 0;
}

.archive-selection input:not(:disabled) {
  cursor: pointer;
}

.archive-table th:nth-child(2) {
  width: 14%;
}

.archive-table :is(th, td):nth-child(3) {
  width: auto;
  text-align: start;
  overflow-wrap: anywhere;
  white-space: normal;
}

.archive-table th:last-child {
  width: 25%;
}

.archive-table :is(th, td):last-child {
  text-align: end;
  white-space: normal;
  font-variant-numeric: tabular-nums;
}

.archive-table tr.is-selected > td {
  background: var(--accent-soft);
}

.dashboard-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-metrics .dashboard-metric {
  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: space-between;
}

.dashboard-overview {
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  align-items: stretch;
}

.dashboard-chart-plot {
  display: flex;
  gap: 10px;
  padding-block-start: 6px;
}

.dashboard-chart-scale {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.dashboard-chart-bars {
  display: flex;
  align-items: stretch;
  flex: 1;
  gap: 3px;
  min-width: 0;
  block-size: 128px;
  padding: 0 1px;
  margin: 0;
  border-block: 1px solid var(--border-subtle);
  list-style: none;
}

.dashboard-chart-bars li {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex: 1 1 0;
  min-inline-size: 0;
}

.dashboard-chart-bar {
  inline-size: 100%;
  max-inline-size: 32px;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
}

.dashboard-chart-bars li:hover .dashboard-chart-bar {
  background: var(--text-secondary);
}

.dashboard-chart-ticks {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin: 6px 0 0 20px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.dashboard-project-table th,
.dashboard-project-table td {
  padding: 8px 10px;
}

.dashboard-project-table td {
  height: 34px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.dashboard-project-table :is(th, td):last-child:not(.chat-empty-cell) {
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.dashboard-project-table tr:last-child td {
  border-bottom: 0;
}

.dashboard-recent {
  margin-top: 16px;
}

.dashboard-recent a:hover {
  color: var(--accent);
  text-decoration: underline;
}

@media (max-width: 850px) {
  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .page-heading.archive-heading {
    align-items: flex-start;
  }

  .chat-archive .archive-toolbar {
    padding: 10px 12px;
  }

  .archive-filters {
    width: 100%;
  }

  .archive-filter-project {
    flex: 1;
    min-width: 0;
  }

  .archive-filter-period {
    width: 134px;
  }

  .archive-table :is(th, td).archive-select-cell {
    width: 40px;
    padding: 0 0 0 4px;
  }

  .archive-table th:nth-child(2) {
    width: 21%;
  }

  .archive-table th:last-child {
    width: 34%;
  }

  .dashboard-metrics .dashboard-metric {
    padding: 14px;
  }

  .dashboard-metrics .dashboard-metric-value {
    font-size: 24px;
  }

  .dashboard-overview {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-recent {
    margin-top: 12px;
  }
}

.table-footer {
  padding: 17px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--faint);
  font-size: 11px;
  border-top: 1px solid var(--border-subtle);
}

.table-footer strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 16px;
}

.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-state h2 {
  font-size: 17px;
}

.empty-state p {
  color: var(--muted);
  max-width: 440px;
  font-size: 13px;
  margin: 0 auto 22px;
  line-height: 1.75;
}

.empty-state-large {
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.empty-state-large p {
  max-width: 460px;
}

.empty-icon {
  width: 62px;
  height: 62px;
  border: 1px solid var(--accent-border);
  border-radius: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-muted);
  background: var(--accent-soft);
  font-size: 31px;
  font-weight: 400;
  margin: 0 auto 23px;
}

.empty-icon.small {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  font-size: 25px;
  margin-bottom: 15px;
}

.empty-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  min-width: 44px;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 14px;
  transform-origin: left center;
  transition: color 160ms ease,transform 160ms ease;
}

.back-link:hover,.back-link:focus-visible {
  color: var(--accent);
  transform: scale(1.08);
}

.editor-panel {
  max-width: 900px;
  padding: 30px;
}

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

.form-field {
  min-width: 0;
}

.form-field label,.logo-upload>label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

input:not([type=checkbox]):not([type=file]),textarea {
  border: 1px solid var(--control-border);
  border-radius: 7px;
  padding: 10px 12px;
  width: 100%;
  background: var(--input-bg);
  color: var(--text);
  transition: border-color .12s,box-shadow .12s;
}

input::placeholder,textarea::placeholder {
  color: var(--placeholder);
}

input:not([type=checkbox]):not([type=file]):focus,textarea:focus {
  border-color: var(--focus-border);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: 0;
}

textarea {
  resize: vertical;
  min-height: 96px;
}

.full-width {
  grid-column: 1/-1;
}

.field-help {
  font-size: 11px;
  line-height: 1.65;
  margin: 7px 0 0;
  color: var(--faint);
}

.page-heading.account-password-heading {
  min-height: 0;
  margin-bottom: 20px;
}

.account-password-heading h1 {
  margin-bottom: 0;
}

.account-password-card {
  max-width: 440px;
  padding: clamp(16px, 3vw, 24px);
}

.account-password-fields {
  display: grid;
  gap: 16px;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.account-password-fields input[aria-invalid="true"] {
  border-color: var(--danger-text);
}

.account-password-status {
  margin-top: 14px;
}

.account-password-card > .field-help:first-child {
  margin: 0 0 14px;
}

.account-password-card .notice {
  margin: 0 0 14px;
}

.account-password-card .notice[hidden] {
  display: none;
}

.account-password-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.account-password-actions .button {
  flex: 1 1 0;
  max-width: 120px;
}

.account-password-actions .button:disabled {
  cursor: default;
  border-color: var(--border);
  background: var(--surface-raised);
  box-shadow: none;
  color: var(--muted);
}

.page-heading.push-settings-heading {
  min-height: 0;
  margin-bottom: 20px;
}

.push-settings-heading h1 {
  margin-bottom: 0;
}

.push-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 760px;
}

.push-settings-panel {
  padding: clamp(16px, 3vw, 22px);
}

.push-settings-panel h2 {
  margin-bottom: 16px;
  font-size: 15px;
}

.push-subscription,
.push-service {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.push-subscription .button:disabled {
  cursor: default;
  border-color: var(--border);
  background: var(--surface-raised);
  box-shadow: none;
  color: var(--muted);
}

.push-service-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.push-service,
.push-services-empty {
  padding: 10px 0;
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.push-service:last-child {
  padding-bottom: 0;
}

.push-services-empty {
  margin: 0;
  padding-bottom: 0;
  color: var(--muted);
}

@media (max-width: 650px) {
  .push-settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.page-heading.telegram-settings-heading {
  min-height: 0;
  margin-bottom: 20px;
}

.telegram-settings-heading h1 {
  margin-bottom: 0;
}

.telegram-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  max-width: 820px;
}

.telegram-settings-panel {
  padding: clamp(16px, 3vw, 22px);
}

.telegram-settings-panel h2 {
  margin: 0;
  font-size: 15px;
}

.telegram-settings-panel > :is(h2, .telegram-panel-heading) {
  margin-bottom: 16px;
}

.telegram-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.telegram-settings-panel .telegram-bot-toggle {
  min-height: 44px;
  padding-block: 4px;
}

.telegram-fields,
.telegram-actions {
  display: grid;
  gap: 12px;
}

.telegram-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.telegram-actions .button {
  min-height: 44px;
  padding: 8px 10px;
  white-space: normal;
  text-align: center;
}

.telegram-actions .button:disabled {
  cursor: default;
  border-color: var(--border);
  background: var(--surface-raised);
  box-shadow: none;
  color: var(--muted);
}

.telegram-result {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.telegram-result h3 {
  margin: 0 0 6px;
  font-size: 13px;
}

.telegram-result-text {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

@media (max-width: 650px) {
  .telegram-settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.page-heading.session-settings-heading {
  min-height: 0;
  margin-bottom: 20px;
}

.session-settings-heading h1 {
  margin-bottom: 0;
}

.session-settings-panel {
  max-width: 590px;
  padding: clamp(16px, 3vw, 24px);
}

.session-settings-panel h2 {
  margin-bottom: 6px;
  font-size: 15px;
}

.session-settings-intro {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
}

.session-settings-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 24px;
}

.session-duration {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.session-duration input {
  max-width: 88px;
}

.session-duration input[readonly] {
  background-color: var(--readonly-bg);
}

.session-settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.session-settings-status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.session-settings-status.is-error {
  color: var(--danger-text);
}

.session-settings-actions .button:disabled {
  cursor: default;
  border-color: var(--border);
  background: var(--surface-raised);
  box-shadow: none;
  color: var(--muted);
}

@media (max-width: 480px) {
  .session-settings-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

.page-heading.bin-checker-heading {
  min-height: 0;
  margin-bottom: 20px;
}

.bin-checker-heading h1 {
  margin-bottom: 0;
}

.bin-checker-panel {
  max-width: 560px;
  padding: clamp(16px, 3vw, 24px);
}

.bin-checker-panel .project-select {
  max-width: 320px;
}

.bin-checker-description {
  min-height: 50px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.bin-checker-description p {
  margin: 0;
}

.bin-checker-description .table-link {
  display: block;
  width: fit-content;
  margin-top: 4px;
}

.bin-checker-panel [data-bin-method-description="brand"],
.bin-checker-panel:has(option[value="brand"]:checked) [data-bin-method-description="directory"] {
  display: none;
}

.bin-checker-panel:has(option[value="brand"]:checked) [data-bin-method-description="brand"] {
  display: block;
}

.bin-checker-panel .table-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.bin-checker-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.bin-checker-status {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.bin-checker-actions .button:disabled {
  cursor: default;
  border-color: var(--border);
  background: var(--surface-raised);
  box-shadow: none;
  color: var(--muted);
}

.page-heading.client-library-heading {
  min-height: 0;
  margin-bottom: 20px;
}

.client-library-heading h1 {
  margin-bottom: 0;
}

.client-library-panel {
  min-width: 0;
  padding: clamp(16px, 3vw, 24px);
}

.client-library-version {
  max-width: 220px;
}

.client-library-builds {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 24px;
  margin-top: 18px;
}

.client-library-build {
  min-width: 0;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.client-library-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.client-library-picker label {
  cursor: pointer;
}

.client-library-picker input:focus-visible + label {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.client-library-file {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.client-library-filename {
  overflow-wrap: anywhere;
}

.client-library-size {
  font-variant-numeric: tabular-nums;
}

.client-library-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.client-library-actions .field-help {
  margin: 0;
}

.client-library-panel .button:disabled {
  cursor: default;
  border-color: var(--border);
  background: var(--surface-raised);
  box-shadow: none;
  color: var(--muted);
}

.client-library-layout {
  display: grid;
  gap: 14px;
  max-width: 790px;
}

.client-library-panel-title {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
}

.client-library-panel h2 {
  margin: 0 0 12px;
  font-size: 15px;
}

.client-library-panel-title h2 {
  margin: 0;
}

.client-library-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 12px 0 0;
}

.client-library-summary dt,
.client-library-build-details dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.client-library-summary dd,
.client-library-build-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.client-library-summary dd {
  margin-top: 3px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.client-library-build h3 {
  margin: 0 0 10px;
  font: 600 14px ui-monospace, monospace;
}

.client-library-build-details {
  display: grid;
  gap: 4px;
  margin: 0 0 12px;
  font-size: 12px;
}

.client-library-build-details > div {
  display: grid;
  grid-template-columns: 59px minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
}

.client-library-build-details code {
  color: var(--code-text);
  font-size: 11px;
}

.client-library-empty,
.client-library-feedback {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.client-library-feedback:not(:empty) {
  margin-top: 6px;
}

.client-library-feedback.is-error {
  color: var(--danger-text);
}

.client-library-projects {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.client-library-projects .project-field-toggle {
  min-height: 44px;
  max-width: 100%;
  white-space: normal;
}

.client-library-upload-feedback {
  display: grid;
  flex: 1 1 158px;
  gap: 7px;
  min-width: 0;
}

.client-library-upload-feedback progress {
  width: min(100%, 220px);
  height: 8px;
  accent-color: var(--accent);
}

.client-library-actions .button[hidden],
.client-library-upload-feedback progress[hidden] {
  display: none;
}

@media (max-width: 550px) {
  .client-library-builds {
    grid-template-columns: minmax(0, 1fr);
  }
}

.page-heading.tls-heading {
  min-height: 0;
  margin-bottom: 20px;
}

.tls-heading h1 {
  margin-bottom: 0;
}

.tls-panel {
  max-width: 900px;
}

.tls-table {
  table-layout: fixed;
  white-space: normal;
  overflow-wrap: anywhere;
}

.tls-table :is(th, td) {
  padding: 10px 14px;
}

.tls-table th.tls-status {
  width: 19%;
}

.tls-table th.tls-expiry {
  width: 21%;
}

.tls-table th.tls-actions {
  width: 28%;
  text-align: right;
}

.tls-table tr:last-child td {
  border-bottom: 0;
}

.tls-table .tls-empty {
  padding-block: 22px;
  color: var(--muted);
  font-weight: 400;
  text-align: center;
}

.tls-table .tls-expiry {
  font-variant-numeric: tabular-nums;
}

.tls-table .status-badge {
  max-width: 100%;
}

.tls-table .status-badge.is-expiring {
  background: var(--accent-soft);
  color: var(--accent);
}

.tls-table [hidden] {
  display: none;
}

.tls-action-group,
.tls-confirmation {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.tls-action-group {
  justify-content: flex-end;
}

.tls-action-group .button {
  max-width: 100%;
  white-space: normal;
}

.tls-confirmation {
  gap: 8px;
  font-size: 12px;
}

.tls-feedback {
  margin: 0;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.tls-feedback:empty {
  padding: 0;
}

@media (max-width: 550px) {
  .tls-table :is(th, td) {
    padding-inline: 6px;
  }

  .tls-table th.tls-status {
    width: 23%;
  }

  .tls-table th.tls-expiry {
    width: 21%;
  }

  .tls-action-group .button {
    padding: 5px 7px;
  }
}

.page-heading.sync-heading {
  min-height: 0;
  margin-bottom: 20px;
}

.sync-heading h1 {
  margin-bottom: 0;
}

.sync-stack {
  display: grid;
  gap: 14px;
  max-width: 860px;
}

.sync-panel-heading {
  padding: 15px 18px;
}

.sync-panel-heading h2 {
  margin: 0;
  font-size: 15px;
}

.sync-table {
  table-layout: fixed;
  white-space: normal;
  overflow-wrap: anywhere;
}

.sync-table :is(th, td) {
  padding: 10px 14px;
}

.sync-table td {
  height: 46px;
}

.sync-table tr:last-child td {
  border-bottom: 0;
}

.sync-table .sync-empty {
  padding-block: 19px;
  color: var(--muted);
  font-weight: 400;
  text-align: center;
}

.sync-connections-table .sync-key {
  width: 112px;
}

.sync-connections-table td.sync-url {
  font-family: ui-monospace, monospace;
}

.sync-queue-table th:nth-child(2) {
  width: 20%;
}

.sync-queue-table th:nth-child(3) {
  width: 24%;
}

.sync-queue-table th:last-child {
  width: 27%;
}

.sync-queue-table :is(td:nth-child(2), td:last-child) {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 550px) {
  .sync-table :is(th, td) {
    padding-inline: 6px;
  }

  .sync-queue-table .status-badge {
    max-width: 100%;
    padding-inline: 5px;
  }
}

.page-heading.ip-lookup-heading {
  min-height: 0;
  margin-bottom: 20px;
}

.ip-lookup-heading h1 {
  margin-bottom: 0;
}

.ip-lookup {
  display: grid;
  gap: 14px;
  max-width: 720px;
}

.ip-lookup-form,
.ip-lookup-result {
  padding: clamp(14px, 2.5vw, 22px);
}

.ip-lookup-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.ip-lookup-controls input {
  font-family: ui-monospace, monospace;
}

.ip-lookup-controls input[aria-invalid="true"] {
  border-color: var(--danger-text);
}

.ip-lookup-error {
  color: var(--danger-text);
}

.ip-lookup-result-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.ip-lookup-result-heading h2 {
  font-size: 15px;
  margin-bottom: 0;
}

.ip-lookup-result-address {
  color: var(--accent);
  overflow-wrap: anywhere;
}

.ip-lookup-status {
  color: var(--muted);
  font-size: 12px;
  margin: 6px 0 0;
}

.ip-lookup-values {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.ip-lookup-values dt {
  color: var(--muted);
  font-size: 11px;
}

.ip-lookup-values dd {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

@media (max-width: 560px) {
  .ip-lookup-values {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.required {
  color: var(--danger-text);
  font-size: 11px;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 26px;
  margin-top: 30px;
  border-top: 1px solid var(--border);
}

.checkbox-panel {
  padding-top: 26px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 9px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-label input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  margin: 0;
}

.logo-upload {
  border-top: 1px solid var(--border);
  margin-top: 28px;
  padding-top: 25px;
}

:is(.logo-upload, .directory-csv-panel) input[type=file] {
  max-width: 100%;
  font-size: 12px;
  color: var(--muted);
}

:is(.logo-upload, .directory-csv-panel) input[type=file]::file-selector-button {
  border: 1px solid var(--control-border);
  padding: 8px 12px;
  margin-right: 12px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
}

.current-logo {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 15px 0 20px;
}

.logo-preview {
  max-width: 150px;
  max-height: 80px;
  object-fit: contain;
}

.detail-panel {
  max-width: 900px;
  overflow: hidden;
}

.record-detail-title {
  flex: 1 1 240px;
  min-width: 0;
}

.detail-panel .detail-list dd {
  overflow-wrap: anywhere;
}

.detail-list {
  margin: 0;
}

.detail-list>div {
  display: grid;
  grid-template-columns: 200px minmax(0,1fr);
  border-bottom: 1px solid var(--border-subtle);
  padding: 20px 28px;
  gap: 20px;
}

.detail-list>div:last-child {
  border-bottom: 0;
}

.detail-list dt {
  font-size: 12px;
  color: var(--muted);
}

.detail-list dd {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  word-break: break-word;
  white-space: pre-wrap;
}

.detail-logo {
  padding: 30px;
  border-bottom: 1px solid var(--border);
}

.notice {
  border: 1px solid;
  border-radius: 8px;
  padding: 13px 16px;
  font-size: 12px;
  display: flex;
  gap: 10px;
  line-height: 1.7;
  margin-bottom: 24px;
}

.notice-success {
  background: var(--success-soft);
  border-color: var(--success-border);
  color: var(--success-text);
}

.notice-error {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger-text);
}

.confirmation-panel {
  max-width: 510px;
  padding: 42px;
  text-align: center;
  margin: 50px auto;
}

.confirmation-panel h1 {
  font-size: 23px;
  margin-bottom: 15px;
}

.confirmation-panel .lede {
  margin-bottom: 26px;
}

.confirmation-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.record-name {
  background: var(--bg);
  padding: 12px 15px;
  margin: 18px 0;
  font-weight: 600;
  word-break: break-word;
  border-radius: 7px;
}

.danger-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--danger-soft);
  color: var(--danger-text);
  font-size: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 25px;
}

.error-status {
  display: block;
  color: var(--faint);
  font-weight: 750;
  font-size: 54px;
  letter-spacing: -3px;
  margin-bottom: 12px;
}

.public-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 40px;
}

.public-main>.notice {
  max-width: 460px;
  width: 100%;
}

.auth-page {
  background-color: var(--bg);
  background-image: var(--auth-background);
  background-repeat: no-repeat;
  background-size: cover;
}

.auth-page .header {
  border: 0;
  background: transparent;
}

.auth-page .header-inner {
  min-height: 80px;
  max-width: none;
  padding: 0 32px;
}

.auth-page .public-main {
  max-width: none;
  justify-content: center;
  padding: 40px 24px 100px;
}

.auth-layout {
  width: 100%;
  max-width: 320px;
}

.auth-card {
  width: 100%;
}

.auth-heading {
  margin-bottom: 18px;
  text-align: center;
}

.auth-heading h1 {
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -.4px;
  font-weight: 600;
  margin-bottom: 10px;
}

.auth-heading .lede {
  margin-inline: auto;
  font-size: 13px;
  line-height: 1.7;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Floating labels and a lifted input, inspired by Lucas Henrique's panel effects. */
.auth-input {
  position: relative;
  padding-top: 20px;
  isolation: isolate;
}

.auth-input::before {
  content: "";
  position: absolute;
  inset: 20px 0 0;
  border-radius: 4px;
  background: var(--accent);
}

.auth-card .auth-input input {
  position: relative;
  z-index: 1;
  height: 48px;
  padding: 12px;
  border-radius: 4px;
  border-color: var(--control-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 14px;
  cursor: text;
  transition: transform 160ms ease, border-color 160ms ease;
}

.auth-card .auth-input label {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 12px;
  margin: 0;
  font-size: 14px;
  line-height: 21px;
  font-weight: 500;
  color: var(--muted);
  transform: translateY(33px);
  transform-origin: top left;
  transition: transform 160ms ease, color 160ms ease;
  cursor: text;
}

.auth-card .auth-input input:is(:focus, :not(:placeholder-shown), :autofill) {
  border-color: var(--accent);
  box-shadow: none;
  transform: translate(-2px, -2px);
}

.auth-card .auth-input input:is(:focus, :not(:placeholder-shown), :autofill) + label {
  color: var(--accent);
  transform: translate(-12px, -2px) scale(.86);
}

.auth-card .auth-input input:is(:autofill, :-webkit-autofill) {
  box-shadow: 0 0 0 1000px var(--input-bg) inset;
}

.auth-card .auth-input input:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 5px;
}


.auth-field .field-help {
  margin-top: 4px;
  font-size: 12px;
  line-height: 16px;
  color: var(--faint);
}

.auth-card .auth-submit {
  align-self: center;
  width: fit-content;
  max-width: 100%;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 12px;
  padding: 11px 18px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 650;
  box-shadow: 0 1px 2px var(--shadow-raised);
}

.auth-card .auth-submit span[aria-hidden] {
  font-size: 16px;
  line-height: 1;
  transition: transform 160ms ease;
}

.auth-card .auth-submit:hover span[aria-hidden] {
  transform: translateX(2px);
}

.auth-card .auth-submit[aria-disabled="true"] {
  background: var(--surface-raised);
  border-color: var(--control-border);
  color: var(--muted);
  box-shadow: none;
}

.auth-card .auth-submit[aria-disabled="true"] span[aria-hidden] {
  transform: none;
}

.account-label {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 0;
  color: var(--muted);
  font-size: 12px;
}

.account-label strong {
  color: var(--text);
  font-weight: 500;
}

.auth-signout {
  margin-top: 12px;
  text-align: center;
}

.request-progress {
  height: 2px;
  position: fixed;
  z-index: 30;
  left: 0;
  top: 0;
  width: 0;
  opacity: 0;
  background: var(--accent);
  transition: width .25s,opacity .2s;
}

.is-loading .request-progress {
  width: 85%;
  opacity: 1;
}

.loading-text {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
  padding-top: 10px;
}

.htmx-indicator {
  opacity: 0;
}

.htmx-request .htmx-indicator,.htmx-request.htmx-indicator {
  opacity: 1;
}

@media(min-width:1400px) {
  .header-inner {
    gap: 48px;
  }
  .primary-nav {
    gap: 10px;
  }
}

@media(max-width:1300px) {
  .header-inner {
    padding: 0 24px;
    gap: 24px;
    row-gap: 0;
    flex-wrap: wrap;
    min-height: 76px;
  }
  .brand {
    margin: 18px 0;
  }
  .primary-nav {
    order: 3;
    flex-basis: 100%;
    flex-wrap: wrap;
    height: auto;
    border-top: 1px solid var(--border-subtle);
    gap: 0 12px;
    overflow: visible;
  }
  .nav-link {
    min-height: 44px;
    padding: 0 5px;
  }
  .nav-link.active:after {
    left: 5px;
    right: 5px;
  }
  .header-actions {
    --header-action-gap: 12px;
  }
  .main {
    padding: 30px 24px 50px;
  }
  .subnav {
    padding: 0 24px;
  }
}

@media(max-width:650px) {
  .project-editor-panel {
    padding: 20px 16px;
  }
  .header-inner {
    padding: 0 18px;
    column-gap: 12px;
  }
  .brand {
    font-size: 13px;
    gap: 9px;
  }
  .brand-mark {
    width: 64px;
    height: 25px;
  }
  .header-actions {
    --header-action-gap: 9px;
  }
  .primary-nav {
    column-gap: 8px;
  }
  .nav-link {
    min-height: 44px;
    font-size: 12px;
  }
  .nav-link-settings {
    margin-left: 0;
  }
  .nav-link-settings:before {
    display: none;
  }
  .main {
    padding: 26px 18px 42px;
  }
  .page-heading {
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
  }
  h1 {
    font-size: 24px;
  }
  .page-heading>.button {
    width: 100%;
  }
  .page-heading .lede {
    font-size: 12px;
  }
  .table-toolbar {
    padding: 15px;
  }
  .search-form {
    width: 100%;
    flex-wrap: wrap;
  }
  .table-toolbar .search-form input[type=search] {
    width: 100%;
    padding-right: 12px;
  }
  .search-form>.button {
    margin-top: 3px;
  }
  .table-size {
    display: none;
  }
  .table-footer {
    padding: 15px;
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }
  .pagination {
    gap: 12px;
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .form-grid {
    grid-template-columns: minmax(0,1fr);
    gap: 20px;
  }
  .editor-panel {
    padding: 22px 18px;
  }
  .form-actions {
    margin-top: 24px;
  }
  .form-actions .button {
    flex: 1;
  }
  .detail-list>div {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 16px 20px;
  }
  .empty-state-large {
    min-height: 360px;
  }
  .empty-state {
    padding: 42px 20px;
  }
  .public-main {
    padding-top: 30px;
  }
  .confirmation-panel {
    margin: 22px auto;
    padding: 30px 22px;
  }
  .confirmation-actions {
    flex-direction: column;
  }
  .subnav {
    padding: 0 18px;
  }
  #settings-navigation .subnav-link {
    padding-block: 10px;
    font-size: 12px;
  }
}

@media(max-width:480px) {
  .brand-name {
    display: none;
  }
  .account-trigger {
    max-width: 72px;
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    transition: none!important;
  }
}

select {
  font: inherit;
  width: 100%;
  border: 1px solid var(--control-border);
  border-radius: 7px;
  padding: 10px 12px;
  background: var(--input-bg);
  color: var(--text);
  min-height: 42px;
}

select:focus {
  border-color: var(--focus-border);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: 0;
}

.project-settings-section {
  margin: 20px 0 0;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid var(--border);
  min-width: 0;
}

.project-form #field-description {
  height: 44px;
  min-height: 44px;
  resize: none;
}

.project-form #field-name {
  min-height: 44px;
}

.project-code-hint {
  display: flex;
  gap: 8px;
  min-height: 18px;
  overflow-wrap: anywhere;
}

.project-code-hint:has(output:empty) {
  visibility: hidden;
}

.project-form .field-optional {
  margin-left: 8px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 400;
}

.project-heading {
  max-width: var(--project-main-width,900px);
  min-height: 0;
  margin-bottom: 20px;
}

.project-editor-panel {
  position: relative;
  width: min(100%,var(--project-main-width,900px));
  max-width: var(--project-main-width,900px);
  padding: 24px;
  overflow: visible;
  background-color: var(--project-panel-surface,var(--surface));
  transition: background-color 240ms ease;
}

.project-buttons-heading {
  padding: 15px 18px;
}

.project-buttons-heading h2 {
  margin: 0;
  font-size: 15px;
}

.project-buttons-table {
  table-layout: fixed;
  white-space: normal;
  overflow-wrap: anywhere;
}

.project-buttons-table :is(th, td) {
  padding: 9px 12px;
}

.project-buttons-table th:first-child {
  width: 26%;
}

.project-buttons-table td {
  height: 49px;
}

.project-buttons-table tr:last-child td {
  border-bottom: 0;
}

.project-buttons-table .project-buttons-empty {
  padding-block: 20px;
  color: var(--muted);
  font-weight: 400;
  text-align: center;
}

.project-button-key {
  color: var(--muted);
}

.project-buttons-table .project-button-enabled {
  width: 94px;
  text-align: center;
}

.project-buttons-table .project-field-toggle {
  display: inline-flex;
  min-width: 52px;
  min-height: 44px;
  padding: 4px 8px;
}

.project-buttons-table .project-button-order {
  width: 168px;
  text-align: center;
}

.project-button-order-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}

.project-button-move,
.project-button-handle {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
}

.project-button-handle {
  cursor: grab;
}

.project-button-move[aria-disabled="true"] {
  cursor: default;
  opacity: .4;
}

.project-button-move:not([aria-disabled="true"]):hover,
.project-button-handle:hover {
  background: var(--surface-hover);
  color: var(--accent);
}

.project-buttons-table .is-dragging {
  opacity: .45;
}

.project-buttons-table .is-drop-before > td {
  box-shadow: inset 0 2px var(--accent);
}

.project-buttons-table .is-drop-after > td {
  box-shadow: inset 0 -2px var(--accent);
}

@media (max-width: 560px) {
  .project-buttons-table :is(th, td) {
    padding-inline: 8px;
  }

  .project-buttons-table th:first-child {
    width: 22%;
  }

  .project-buttons-table .project-button-enabled {
    width: 74px;
  }

  .project-buttons-table th.project-button-enabled {
    padding-inline: 4px;
    white-space: nowrap;
  }

  .project-buttons-table .project-button-order {
    width: 102px;
  }
}

@media (max-width: 360px) {
  .project-buttons-table th:first-child {
    width: 18%;
  }

  .project-buttons-table .project-button-order {
    width: 76px;
  }

  .project-button-handle {
    display: none;
  }
}

.main:has(#project-active:not(:checked)) {
  --project-panel-surface: color-mix(in srgb,var(--surface) 22%,var(--bg) 78%);
}

:root[data-theme="light"] .main:has(#project-active:not(:checked)) {
  --project-panel-surface: var(--readonly-bg);
}

.project-heading-main {
  width: 100%;
  min-width: 0;
}

.project-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.project-heading h1 {
  min-width: 0;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.project-name-title {
  color: var(--accent);
}

.project-heading-controls {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 12px;
}

.project-feature-panel {
  max-width: var(--project-main-width, 900px);
  margin-top: 16px;
}

.project-integration,
.project-auto-reply {
  padding: 16px 18px;
}

.project-feature-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
}

.project-feature-heading h2 {
  margin: 0;
  font-size: 15px;
}

.project-integration-field {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.project-integration-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.project-integration-row > :is(code, pre) {
  margin: 0;
  min-height: 32px;
  padding: 7px 10px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--input-bg);
  color: var(--code-text);
  font-size: 12px;
}

.project-integration-row pre code {
  white-space: inherit;
}

.project-integration-field .field-help {
  margin: 0;
}

.project-integration-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 10px;
  margin-top: 7px;
}

.project-integration-footer .table-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.project-copy-status {
  margin: 6px 0 0;
}

.project-copy-status:empty {
  margin: 0;
}

.project-view-advanced {
  padding: 12px 18px;
}

.project-view-advanced summary {
  width: fit-content;
  min-height: 44px;
  padding-block: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.project-view-advanced .detail-list {
  margin-top: 8px;
}

.project-view-advanced .detail-list dd {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.project-buttons-table .project-button-actions {
  width: 152px;
  text-align: end;
}

.project-button-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 2px;
}

.project-button-row-actions .button {
  min-height: 44px;
  padding-inline: 6px;
  font-size: 12px;
}

.project-button-row-actions [data-project-button-delete]:hover {
  color: var(--danger-text);
}

.project-auto-reply {
  display: grid;
  gap: 12px;
}

.project-auto-reply .project-field-toggle {
  min-height: 44px;
}

.project-reply-trigger {
  max-width: 320px;
}

.project-auto-reply textarea {
  max-width: 580px;
  resize: vertical;
}

.project-auto-reply .field-help {
  margin: 0;
}

.project-inline-error {
  margin: 0;
  color: var(--danger-text);
  font-size: 12px;
}

.project-button-dialog {
  width: min(420px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  overflow: auto;
  padding: 18px;
  color: var(--text);
}

.project-button-dialog::backdrop {
  background: rgb(12 11 16 / 70%);
}

.project-button-dialog form {
  display: grid;
  gap: 14px;
}

.project-button-dialog h2 {
  margin: 0;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.project-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
  margin-top: 4px;
}

.project-button-dialog > .project-dialog-actions {
  margin-top: 16px;
}

.project-button-dialog [hidden] {
  display: none;
}

@media (max-width: 900px) {
  .project-integration,
  .project-auto-reply,
  .project-view-advanced,
  .project-buttons-heading {
    padding-inline: 12px;
  }

  .project-buttons-table .project-button-actions {
    width: 60px;
  }

  .project-buttons-table[role="table"],
  .project-buttons-table[role="table"] > tbody {
    display: block;
  }

  .project-buttons-table[role="table"] > thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .project-buttons-table [data-project-button-row] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 4px 8px;
    padding: 9px 12px;
    border-top: 1px solid var(--border-subtle);
  }

  .project-buttons-table [data-project-button-row] > td {
    width: auto;
    height: auto;
    padding: 0;
    border: 0;
  }

  .project-buttons-table [data-project-button-name] {
    text-align: end;
  }

  .project-buttons-table [data-project-button-row] > .project-button-actions {
    grid-column: 1 / -1;
  }

  .project-buttons-table [data-project-button-row] .project-button-order-actions {
    justify-content: end;
  }

  .project-buttons-table [data-project-button-row] > .project-button-enabled {
    text-align: start;
  }

  .project-buttons-table [data-project-button-row] .project-button-move {
    flex-basis: 44px;
  }

  .project-buttons-table[role="table"] .project-buttons-empty {
    display: block;
    height: auto;
  }
}

.project-status-control,.project-field-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  min-width: 70px;
  min-height: 44px;
  margin: 0;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color .2s,border-color .2s,box-shadow .2s;
}

.project-status-control input,.project-field-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.project-status-control:has(input:checked),.project-field-toggle:has(input:checked) {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 14px var(--focus-ring),inset 0 0 10px var(--focus-ring);
}

.project-status-control:has(input:focus-visible),.project-field-toggle:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.project-form .project-field-toggle {
  display: inline-flex;
  width: max-content;
  min-width: min(112px,100%);
  max-width: 100%;
  margin: 0;
  padding: 8px 12px;
  text-align: center;
  font-weight: 500;
}

.project-field-toggle:has(input:disabled) {
  cursor: default;
}

.project-connection-fields .project-field-toggle {
  width: 100%;
}

.project-form .section-help {
  text-align: center;
}

.project-form .form-actions {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0,124px) auto minmax(0,124px);
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: none;
  margin: 24px 0 0;
  padding-top: 24px;
  border-top: 0;
}

.project-form .form-actions:before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: min(100%,440px);
  height: 3px;
  border-radius: 50%;
  background: linear-gradient(90deg,transparent,var(--border) 18%,var(--accent-border) 50%,var(--border) 82%,transparent);
  transform: translateX(-50%);
}

.project-form .form-actions .button {
  min-width: 0;
  min-height: 44px;
  padding-inline: 12px;
}

.form-action-divider {
  color: var(--control-border);
  font-size: 14px;
}

.project-template-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,220px));
  justify-content: center;
  gap: 24px;
}

.project-select {
  position: relative;
}

.project-select select {
  appearance: none;
  min-height: 44px;
  padding: 9px 34px 9px 12px;
  font-size: 12px;
}

.project-select:after {
  content: "";
  position: absolute;
  top: calc(50% - 5px);
  right: 14px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  transform: rotate(45deg);
  pointer-events: none;
}

.project-settings-section legend {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -.1px;
  padding: 0 0 8px;
}

.project-settings-section .checkbox-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 500;
  margin: 0;
}

.project-advanced {
  margin-top: 20px;
  border-top: 1px solid var(--border);
}

.project-advanced > summary {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 12px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.project-advanced > summary::-webkit-details-marker {
  display: none;
}

.project-advanced > summary:after {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 3px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  transition: transform .22s ease;
}

.project-advanced[open] > summary:after {
  transform: rotate(225deg);
}

.project-advanced > summary:hover,.project-advanced[open] > summary {
  color: var(--accent);
}

.project-advanced-panel {
  width: 100%;
  max-width: 450px;
  margin: 12px auto 0;
  padding: 16px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: background-color 240ms ease;
}

.project-advanced-panel h2 {
  margin: 0 0 20px;
  text-align: center;
  font-size: 16px;
  font-weight: 650;
}

.project-connection-fields {
  display: grid;
  gap: 18px;
}

.project-connection-fields > .form-field + .form-field {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.project-advanced-panel .checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0;
  font-weight: 500;
  line-height: 1.5;
}

.project-advanced-panel .checkbox-label input {
  flex-shrink: 0;
  margin-top: 2px;
}

.project-field-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.project-field-label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.project-origin-list {
  display: grid;
  gap: 10px;
}

.project-origins-control {
  display: grid;
  grid-template-columns: minmax(0,1fr) 44px;
  align-items: start;
  gap: 8px;
}

.project-origin-row {
  position: relative;
}

.project-form .project-origin-row input {
  padding-right: 50px;
}

.project-form .project-origin-row:has([data-origin-remove][hidden]) input {
  padding-right: 12px;
}

.project-origin-add,.project-origin-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.project-origin-add:hover,.project-origin-remove:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.project-origin-add {
  border: 0;
}

@view-transition {
  navigation: auto;
}

::view-transition-group(root) {
  animation: none;
}

::view-transition-old(root) {
  animation: project-create-out 180ms ease-in both;
}

::view-transition-new(root) {
  animation: project-create-in 200ms ease-out both;
}

@keyframes project-create-out {
  from { opacity: 1; filter: blur(0); }
  to { opacity: 0; filter: blur(1px); }
}

@keyframes project-create-in {
  from { opacity: 0; filter: blur(1px); }
  to { opacity: 1; filter: blur(0); }
}

@media(prefers-reduced-motion:reduce) {
  @view-transition {
    navigation: none;
  }
}

.project-origin-remove {
  position: absolute;
  top: calc(50% - 22px);
  right: 4px;
  border: 0;
}

.project-origin-remove[hidden] {
  display: none;
}

.project-ttl > label {
  text-align: center;
}

.project-ttl-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.project-form .project-ttl-control input {
  width: 88px;
}

.project-advanced-trigger {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 0 8px 4px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.project-advanced-trigger:after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .22s ease;
}

.project-advanced-trigger[aria-expanded=true] {
  color: var(--accent);
}

.project-advanced-trigger[aria-expanded=true]:after {
  transform: rotate(135deg);
}

@media(min-width:1100px) {
  .main:has(> .project-editor-panel) {
    container-type: inline-size;
    --project-main-width: min(900px,calc(66.6667cqw - 16px));
  }
  .project-advanced-panel {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: -1px;
    bottom: -1px;
    left: calc(100% + 24px);
    width: 50%;
    max-width: none;
    height: auto;
    margin: 0;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--project-panel-surface,var(--surface));
    overflow: auto;
  }
  .project-advanced-panel > h2 {
    flex: none;
  }
  .project-connection-fields {
    flex: 1 0 auto;
    grid-auto-rows: max-content;
    align-content: space-between;
  }
  .project-advanced {
    margin: 0;
    border: 0;
  }
  .project-advanced > summary {
    display: none;
  }
  .project-advanced-trigger {
    display: inline-flex;
  }
}

@media(prefers-reduced-motion:reduce) {
  .project-advanced > summary:after,.project-advanced-trigger:after,.project-status-control,.project-field-toggle,.project-editor-panel,.project-advanced-panel,.back-link {
    transition: none;
  }
  .back-link:hover,.back-link:focus-visible {
    transform: none;
  }
}

.section-help {
  margin: 0 0 18px;
}

.required-fields-grid {
  display: grid;
  width: 100%;
  max-width: 640px;
  margin-inline: auto;
  grid-template-columns: repeat(3,minmax(0,1fr));
  justify-content: center;
  justify-items: center;
  gap: 20px 28px;
}

.required-fields-core {
  grid-template-columns: repeat(4,minmax(0,1fr));
  column-gap: 16px;
  margin-bottom: 24px;
}

.project-form .required-fields-core .project-field-toggle {
  width: 112px;
}

.heading-actions form {
  margin: 0;
}

.pay-editor-grid {
  display: grid;
  grid-template-columns: minmax(0,1.1fr) minmax(340px,.9fr);
  gap: 24px;
  align-items: start;
}

.code-panel,.preview-panel {
  min-width: 0;
  overflow: hidden;
}

.code-panel-heading {
  padding: 22px;
}

.code-panel-heading input[readonly] {
  background: var(--readonly-bg);
  color: var(--muted);
}

.code-tabs {
  display: flex;
  gap: 0;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}

.code-tabs button {
  position: relative;
  border: 0;
  background: none;
  padding: 13px 19px;
  color: var(--muted);
  font-size: 12px;
}

.code-tabs button[aria-selected=true] {
  color: var(--accent);
  font-weight: 650;
}

.code-tabs button[aria-selected=true]:after {
  content: "";
  position: absolute;
  height: 2px;
  bottom: -1px;
  left: 17px;
  right: 17px;
  background: var(--accent);
}

.pay-editor-form .code-input {
  font-family: ui-monospace,SFMono-Regular,Consolas,monospace;
  font-size: 12px;
  line-height: 1.7;
  tab-size: 2;
  min-height: 420px;
  border: 0;
  border-radius: 0;
  resize: vertical;
  white-space: pre;
  overflow: auto;
  padding: 22px;
  color: var(--code-text);
  background: var(--surface);
}

.pay-editor-form .code-input:focus {
  box-shadow: inset 0 0 0 2px var(--code-focus-ring);
}

.pay-editor-form .code-input[readonly] {
  background: var(--readonly-bg);
}

.code-contract {
  border-top: 1px solid var(--border);
  padding: 20px 22px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
}

.code-contract strong {
  color: var(--text-secondary);
  font-size: 12px;
}

.code-contract p {
  margin: 8px 0;
}

.code-contract code {
  display: block;
  font-family: ui-monospace,Consolas,monospace;
  color: var(--accent-muted);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-bottom: 1px solid var(--border);
}

.preview-heading h2 {
  font-size: 15px;
  margin: 0;
}

.preview-heading .field-help {
  margin-top: 4px;
}

.preview-frame-wrap {
  position: relative;
  min-height: 680px;
  background: var(--surface-soft);
}

.preview-frame-wrap iframe {
  display: block;
  width: 100%;
  height: 760px;
  border: 0;
  background: var(--surface-soft);
}

.preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  gap: 10px;
  padding: 30px;
  color: var(--faint);
  pointer-events: none;
  background: var(--surface-soft);
}

.preview-placeholder[hidden] {
  display: none;
}

.preview-placeholder>span {
  font-size: 38px;
  color: var(--faint);
  margin-bottom: 6px;
}

.preview-placeholder strong {
  font-size: 14px;
  font-weight: 550;
  color: var(--muted);
}

.preview-placeholder p {
  font-size: 12px;
  line-height: 1.7;
  max-width: 240px;
  margin: 0;
}

.preview-status {
  border-top: 1px solid var(--border);
  margin: 0;
  padding: 14px 22px;
  background: var(--surface);
  font-size: 10px;
}

.editor-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 24px;
  padding: 20px 0;
}

.editor-bottom-bar>.field-help {
  margin: 0;
  max-width: 500px;
}

.payment-outcome {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  background: var(--auth-background);
}

.payment-outcome-card {
  width: min(100%, 420px);
  padding: clamp(20px, 5vw, 32px);
  text-align: center;
  overflow-wrap: anywhere;
}

.payment-outcome-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0 auto 14px;
  border: 1px solid;
  border-radius: 50%;
  font-size: 19px;
  font-weight: 650;
}

.payment-outcome-error .payment-outcome-icon {
  border-color: var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger-text);
}

.payment-outcome-success .payment-outcome-icon {
  border-color: var(--success-border);
  background: var(--success-soft);
  color: var(--success-text);
}

.payment-outcome-card h1 {
  margin-bottom: 8px;
  font-size: clamp(19px, 4vw, 23px);
}

.payment-outcome-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

@media(max-width:1050px) {
  .pay-editor-grid {
    grid-template-columns: minmax(0,1fr);
  }
  .preview-frame-wrap {
    min-height: 600px;
  }
  .preview-frame-wrap iframe {
    height: 720px;
  }
  .pay-editor-form .code-input {
    min-height: 360px;
  }
}

@media(max-width:650px) {
  .project-heading-row {
    align-items: flex-start;
    gap: 12px;
  }
  .project-status-control {
    gap: 8px;
    padding: 8px;
  }
  .project-template-grid {
    grid-template-columns: minmax(0,260px);
    gap: 18px;
  }
  .required-fields-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 18px 16px;
  }
  .code-panel-heading,.preview-heading {
    padding: 18px;
  }
  .code-tabs {
    padding: 0 5px;
  }
  .code-tabs button {
    padding: 13px 17px;
  }
  .pay-editor-form .code-input {
    font-size: 11px;
    padding: 16px;
    min-height: 320px;
  }
  .preview-heading {
    align-items: flex-start;
    gap: 10px;
  }
  .preview-heading .button {
    padding: 7px 9px;
  }
  .preview-frame-wrap {
    min-height: 630px;
  }
  .preview-frame-wrap iframe {
    height: 760px;
  }
  .editor-bottom-bar {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }
  .editor-bottom-bar .heading-actions {
    justify-content: flex-end;
  }
  .editor-bottom-bar .heading-actions .button {
    flex: 1;
  }
  .code-contract {
    padding: 18px;
  }
  .page-heading .heading-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .project-settings-section {
    padding-top: 20px;
  }
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
}
.theme-toggle:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-hover);
}
.theme-toggle svg {
  display: block;
  width: 18px;
  height: 18px;
}
.theme-toggle .theme-icon-moon,
:root[data-theme="light"] .theme-toggle .theme-icon-sun {
  display: none;
}
:root[data-theme="light"] .theme-toggle .theme-icon-moon {
  display: block;
}
:where(a, button, input, textarea, select, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
input:is(:autofill, :-webkit-autofill) {
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 1000px var(--input-bg) inset;
  caret-color: var(--text);
}
::selection {
  background: var(--accent-soft);
  color: var(--text);
}

@media (max-width: 650px) {
  .auth-page .header-inner {
    min-height: 68px;
    padding: 0 20px;
  }
  .auth-page .public-main {
    padding: 32px 24px 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card .auth-input input:is(:focus, :not(:placeholder-shown), :autofill),
  .auth-card .auth-submit:hover span[aria-hidden] {
    transform: none;
  }
}

.list-state {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 14px;
  min-height: 150px;
  margin: 0;
  padding: 24px;
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
}

.list-state[hidden],
[data-fixture-preview]:not([data-preview-state="success"]) [data-preview-results] {
  display: none;
}

.list-state-label {
  margin: 0;
  font-weight: 600;
}

[data-preview-state="error"] .list-state-label {
  color: var(--danger-text);
}

.list-state .button {
  min-width: 44px;
  min-height: 44px;
}

[data-fixture-preview="library"] .list-state {
  max-width: 790px;
}

.list-skeleton {
  width: 100%;
}

.list-skeleton-tiles,
.list-skeleton-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 12px;
}

.list-skeleton-tiles {
  margin-bottom: 12px;
}

.list-skeleton-tile,
.list-skeleton-row {
  padding: 12px;
}

.list-skeleton-tile {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.list-skeleton-row {
  border-top: 1px solid var(--border-subtle);
}

.list-skeleton span {
  display: block;
  height: 10px;
  border-radius: var(--radius);
  background: var(--surface-raised);
}

.list-skeleton-tiles span + span {
  width: 48%;
  margin-top: 10px;
}

.list-skeleton-row span:nth-child(even) {
  width: 68%;
}

.client-library-filename[data-full-value] {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 768px) {
  [data-fixture-preview="dashboard"] .list-skeleton-tiles {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .list-skeleton-row > span:nth-child(n+4) {
    display: none;
  }
}

.full-value-text {
  display: block;
  min-inline-size: 0;
  max-inline-size: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.full-value-text:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.full-value-tooltip {
  position: fixed;
  z-index: 100;
  inset: auto;
  box-sizing: border-box;
  inline-size: max-content;
  min-inline-size: 0;
  max-inline-size: min(44ch, calc(100vw - 16px));
  max-block-size: calc(100dvh - 16px);
  margin: 0;
  overflow: auto;
  overflow-wrap: anywhere;
  padding: 8px 10px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: 0 4px 12px var(--shadow);
  font-size: 12px;
  white-space: normal;
}

.full-value-tooltip[hidden] {
  display: none;
}

input:not([type=checkbox], [type=radio], [type=hidden], .sr-only),
select:not([aria-hidden=true]) {
  min-height: 44px;
}

.chat-card-label,
.archive-select-all-label {
  display: none;
}

.chat-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-inline-size: 100%;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
  white-space: nowrap;
}

.chat-status-badge[data-kind="online"] {
  background: var(--success-soft);
  color: var(--success-text);
}

.chat-status-badge[data-kind="waiting"],
.chat-status-badge[data-kind="unread"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.chat-status-badge[data-kind="overdue"] {
  background: var(--danger-soft);
  color: var(--danger-text);
}

.chat-queue-id .chat-status-badge.full-value-text {
  display: block;
  inline-size: fit-content;
}

:is(.chat-queue-table, .archive-table):not([hidden]) th {
  height: 44px;
  padding-block: 7px;
}

.chat-queue-table tbody td:not(.chat-empty-cell),
.archive-table tbody td:not(.chat-empty-cell) {
  height: 48px;
  padding-block: 6px;
}

.chat-queue-table th:first-child {
  width: 156px;
}

.chat-queue-table th:nth-child(3) {
  width: 119px;
}

.chat-queue-table th:nth-child(4) {
  width: 122px;
}

.chat-queue-table th:nth-child(5) {
  width: 146px;
}

.chat-queue-table th:nth-child(6) {
  width: 101px;
}

.chat-queue-table th:last-child {
  width: 96px;
}

:is(.chat-queue-id, .archive-chat) .chat-row-link {
  padding-block: 0;
}

.chat-queue-table .chat-row-link::after,
.archive-table .chat-row-link::after {
  min-inline-size: 44px;
  min-block-size: 44px;
}

.chat-queue-table .chat-status-badge[data-kind="unread"] {
  justify-content: center;
  min-inline-size: 22px;
}

.chat-archive .archive-toolbar {
  padding-block: 14px;
  gap: 8px 12px;
}

.archive-filters {
  gap: 8px 12px;
}

.archive-modes a {
  min-block-size: 44px;
}

.archive-table :is(th, td).archive-select-cell {
  width: 62px;
  padding: 0 0 0 10px;
}

.archive-selection {
  inline-size: 44px;
  min-block-size: 44px;
  border-radius: var(--radius);
}

.archive-selection:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}

.archive-selection:has(input:not(:disabled)) {
  cursor: pointer;
}

.chat-detail-heading [data-chat-project] {
  min-inline-size: 0;
}

.chat-detail-title {
  min-inline-size: 0;
  max-inline-size: 100%;
}

.chat-detail-title .chat-presence {
  align-self: center;
}

.conversation-panel {
  display: flex;
  flex-direction: column;
  max-block-size: max(400px, calc(100dvh - 268px));
}

.conversation-header {
  flex: 0 0 auto;
  padding-block: 8px;
}

.conversation-stream {
  flex: 1 1 25rem;
  min-block-size: 7rem;
  max-block-size: none;
  overflow-y: auto;
  overscroll-behavior-block: contain;
}

.conversation-typing {
  flex: 0 0 auto;
}

.chat-composer {
  position: sticky;
  z-index: 1;
  inset-block-end: 0;
  flex: 0 0 auto;
  padding-block: 12px;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--surface);
}

.chat-composer textarea {
  min-block-size: 60px;
}

.conversation-nav .button-small,
.chat-detail-grid .button,
.chat-image-dialog .button,
.chat-quick-reply select,
.chat-quick-reply .pm-select-trigger {
  min-block-size: 44px;
  min-inline-size: 44px;
}

.chat-image-dialog {
  max-inline-size: min(900px, calc(100vw - 24px));
  max-block-size: calc(100dvh - 24px);
  overflow: auto;
  overscroll-behavior: contain;
}

.chat-image-dialog-header {
  position: sticky;
  inset-block-start: 0;
  flex-wrap: wrap;
  background: var(--surface);
}

.chat-image-dialog img {
  max-block-size: calc(100dvh - 145px);
}

@media (max-width: 900px) {
  .chat-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .chat-card-label {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
  }

  .chat-queue-table tbody tr > td:not(.chat-empty-cell) {
    padding: 0;
    height: auto;
  }

  .chat-queue-id,
  .chat-queue-unread,
  .chat-queue-presence {
    align-self: start;
  }

  .chat-queue-id .chat-row-link {
    padding-block-end: 2px;
  }

  .chat-queue-presence .chat-status-badge {
    justify-content: center;
  }

  .archive-table,
  .archive-table thead,
  .archive-table tbody {
    display: block;
  }

  .archive-table thead th:not(.archive-select-cell) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .archive-table thead :is(tr, th.archive-select-cell) {
    display: block;
    width: 100%;
  }

  .archive-table thead .archive-selection {
    inline-size: auto;
    gap: 8px;
    padding-inline: 8px;
    letter-spacing: normal;
    text-transform: none;
  }

  .archive-select-all-label {
    display: inline;
    overflow-wrap: anywhere;
  }

  .archive-table tbody tr {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 10px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .archive-table tbody tr:last-child {
    border-bottom: 0;
  }

  .archive-table tbody tr > td:not(.chat-empty-cell),
  .archive-table tbody tr > .archive-select-cell {
    min-width: 0;
    width: auto;
    height: auto;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .archive-table tbody tr:is(.is-selected, :has(.chat-row-link:hover)) > td {
    background: transparent;
  }

  .archive-table tbody tr.is-selected {
    background: var(--accent-soft);
  }

  .archive-table tbody tr:has(.chat-row-link:hover) {
    background: var(--surface-hover);
  }

  .archive-table tbody .archive-select-cell { grid-area: 1 / 1 / span 2; align-self: start; }
  .archive-chat { grid-area: 1 / 2; }
  .archive-project { grid-area: 2 / 2 / auto / -1; }
  .archive-time { grid-area: 1 / 3; }

  .archive-table .chat-empty-cell {
    grid-column: 1 / -1;
    height: auto;
    padding-block: 18px;
  }
}

@media (max-width: 650px) {
  .conversation-panel {
    max-block-size: max(400px, calc(100dvh - 266px));
  }
}
