/* ============================================================
   Admin surface alignment
   Neutral admin chrome, compact controls, flat panels and
   text-link table actions, consistent with the reference admin UI.
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-deep: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --surface-3: #f3f4f6;
  --ink: #18212b;
  --ink-soft: #343434;
  --muted: #737373;
  --muted-2: #8a8a8a;
  --line: #e8e8e8;
  --line-strong: #dedede;
  --brand: #292929;
  --brand-strong: #434343;
  --brand-soft: #f3f4f6;
  --brand-tint: #f8f8f8;
  --plum: #525252;
  --plum-soft: #f3f4f6;
  --danger: #b64c4c;
  --danger-strong: #a33f3f;
  --danger-soft: #fdf2f2;
  --success: #398054;
  --success-soft: #f0f7f2;
  --warning: #8a5a00;
  --warning-soft: #fdf3e3;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --shadow-xs: 0 1px 2px rgba(24, 33, 43, 0.04);
  --shadow-sm: 0 1px 2px rgba(24, 33, 43, 0.04), 0 8px 24px rgba(24, 33, 43, 0.05);
  --shadow-md: 0 16px 64px rgba(18, 19, 22, 0.12);
  --font-sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC",
    sans-serif;
  --font-display: var(--font-sans);
}

body {
  background: #ffffff;
  color: #343434;
  font-size: 14px;
}

.sidebar {
  background: #151d27;
  border-right: 1px solid #26313d;
  box-shadow: none;
  padding: 24px 16px 16px;
}

.sidebar__head {
  padding: 0 8px 22px;
}

.brand {
  gap: 9px;
}

.brand__text strong {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.brand--sidebar {
  color: #f3f5f8;
}

.nav__label {
  padding: 18px 10px 6px;
  color: #748094;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.nav__item {
  min-height: 38px;
  padding: 0 10px;
  border-radius: 7px;
  color: #cfd5de;
  font-size: 13px;
  font-weight: 400;
}

.nav__item:hover {
  color: #ffffff;
  background: #202a36;
}

.nav__item.is-active {
  color: var(--blue-pale);
  background: rgba(37, 99, 235, 0.16);
  box-shadow: none;
  font-weight: 600;
}

.nav__item.is-active::before {
  display: none;
}

.nav__item .icon {
  opacity: 0.82;
}

.sidebar__foot {
  border-top-color: #26313d;
}

.account-card {
  padding: 10px 8px 0;
}

.account-card__meta strong {
  color: #dfe5ec;
  font-weight: 500;
}

.account-card__meta a {
  color: #8f9bad;
}

.account-card__meta a:hover {
  color: #ffffff;
}

.avatar {
  border-radius: 7px;
}

.app-frame {
  background: #f8f8f8;
}

.topbar {
  height: 64px;
  padding: 0 32px;
  border-bottom: 1px solid #e8e8e8;
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.breadcrumbs {
  color: #8a8a8a;
  font-size: 12.5px;
}

.breadcrumbs strong {
  color: #45454b;
  font-weight: 500;
}

.page {
  max-width: 1600px;
  padding: 24px 32px 56px;
}

.page-heading {
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
}

.page-heading h1 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.card {
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--shadow-xs);
}

.card__head {
  padding: 20px 20px 0;
}

.card__head h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
}

.card__head p {
  color: #737373;
  font-size: 12.5px;
}

.form-card {
  padding: 22px;
}

.section-heading {
  margin-bottom: 20px;
}

.section-heading__index {
  width: 22px;
  height: 22px;
  border-color: #e8e8e8;
  background: #fafafa;
  color: #8a8a8a;
  font-family: var(--font-sans);
  font-size: 10px;
}

.section-heading h2 {
  font-size: 15px;
  font-weight: 600;
}

.section-heading p {
  color: #737373;
  font-size: 12px;
}

.page-actions {
  gap: 8px;
}

.button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #dedede;
  border-radius: 7px;
  background: #ffffff;
  color: #343434;
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
}

.button:hover {
  background: #f5f5f5;
  border-color: #cecece;
}

.button--primary {
  border-color: #292929;
  background: #292929;
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.button--primary:hover {
  border-color: #434343;
  background: #434343;
}

.button--secondary {
  border-color: #dedede;
  background: #ffffff;
  color: #343434;
}

.button--secondary:hover {
  border-color: #cecece;
  background: #f5f5f5;
}

.button--ghost {
  border-color: transparent;
  background: transparent;
  color: #525252;
}

.button--ghost:hover {
  border-color: transparent;
  background: #f0f0f0;
  color: #292929;
}

.button--danger {
  border-color: #b64c4c;
  background: #b64c4c;
  color: #ffffff;
}

.button--danger:hover {
  border-color: #a33f3f;
  background: #a33f3f;
}

.icon-button {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  color: #525252;
}

.icon-button:hover {
  background: #f0f0f0;
  color: #292929;
}

.icon-button--danger {
  color: #b64c4c;
}

.icon-button--danger:hover {
  background: #fdf2f2;
  color: #a33f3f;
}

.table-link {
  border: 0;
  padding: 0;
  background: none;
  color: var(--blue);
  font: inherit;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

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

.data-table {
  min-width: 760px;
  font-size: 13px;
}

.data-table th {
  padding: 16px 16px 10px;
  vertical-align: bottom;
  border-top: 1px solid #e8e8e8;
  border-bottom: 1px solid #e8e8e8;
  background: #fafafa;
  color: #737373;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.data-table td {
  padding: 12px 16px;
  border-bottom-color: #ededed;
  color: #343434;
  font-size: 13px;
}

.data-table tbody tr:hover {
  background: #fcfcfc;
}

.entity-cell strong {
  color: #222;
  font-size: 13px;
  font-weight: 400;
}

.entity-cell small {
  color: #8a8a8a;
  font-size: 11px;
}

.entity-cell:hover strong {
  color: var(--blue);
}

.tag,
.tag--soft {
  min-height: 22px;
  border: 0;
  border-radius: 5px;
  background: #f3f4f6;
  color: #525252;
  font-size: 11.5px;
  font-weight: 400;
}

.tag--soft {
  background: transparent;
  color: #737373;
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.tag-count {
  min-height: 24px;
  background: #f3f4f6;
  color: #737373;
  font-size: 11px;
  font-weight: 500;
}

.badge {
  min-height: 22px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 500;
}

.badge--published {
  color: #398054;
  background: #f0f7f2;
}

.badge--draft {
  color: #8a5a00;
  background: #fdf3e3;
}

.badge--muted {
  color: #737373;
  background: #f3f4f6;
}

.pagination {
  padding: 14px 18px;
  border-top-color: #ededed;
}

.pagination__summary {
  color: #737373;
  font-weight: 400;
}

.pagination__btn {
  border-radius: 5px;
  color: #525252;
  font-family: var(--font-sans);
  font-size: 12px;
}

.pagination__btn:hover {
  background: #f5f5f5;
}

.pagination__btn.is-current {
  border-color: #dedede;
  background: #ffffff;
  font-weight: 500;
}

.filter-card {
  padding: 12px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: none;
}

.search-field {
  height: 38px;
  border-color: #dedede;
  border-radius: 7px;
  background: #ffffff;
}

.search-field:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-field .icon {
  color: #8a8a8a;
}

.select-field select {
  height: 38px;
  border-color: #dedede;
  border-radius: 7px;
  color: #343434;
  font-size: 13px;
}

.select-field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input {
  min-height: 40px;
  border-color: #dedede;
  border-radius: 7px;
  background: #ffffff;
  color: #343434;
  font-size: 14px;
}

.input:hover {
  border-color: #cecece;
}

.input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input--sm {
  min-height: 34px;
  font-size: 13px;
}

.field {
  gap: 6px;
}

.field__label {
  color: #525252;
  font-size: 12px;
  font-weight: 400;
}

.field__hint {
  color: #8a8a8a;
  font-size: 11px;
}

.input:disabled {
  background: #fafafa;
  color: #737373;
}

.field--error .input,
.field--error .select-control select {
  border-color: #d69a9a;
  background: #fdf8f8;
}

.checkbox__text {
  color: #525252;
  font-size: 12px;
  font-weight: 400;
}

.switch-line {
  border-color: #e8e8e8;
  background: #fafafa;
}

.switch input:checked + .switch__track {
  background: #292929;
}

.stats-grid {
  gap: 12px;
}

.stat-card {
  padding: 18px;
  border-color: #e8e8e8;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--shadow-xs);
}

.stat-card:hover {
  transform: none;
  border-color: #d6d6da;
  box-shadow: var(--shadow-xs);
}

.stat-card__label {
  color: #737373;
  font-size: 12px;
  font-weight: 400;
}

.stat-card__value {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.inline-note {
  border-top-color: #ededed;
  color: #737373;
}

.meta-list > div {
  border-bottom-color: #ededed;
}

.empty-state {
  border-radius: 8px;
  background: #fafafa;
  color: #737373;
}

.empty-state__icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 0;
  background: #ffffff;
  color: #737373;
}

.empty-state h3 {
  font-size: 14px;
  font-weight: 500;
}

.empty-state p {
  color: #737373;
  font-size: 12.5px;
}

.lineup-row,

.lineup-row:hover,

.field-config-list {
  border-top-color: #ededed;
}

.field-config-row {
  background: #ffffff;
  border-bottom-color: #ededed;
}

.field-config-row:hover {
  background: #fafafa;
}

.sort-config {
  border-color: #e8e8e8;
  background: #fafafa;
}

.option-row {
  border-top-color: #ededed;
}

.code-block {
  border-color: #1b2027;
  background: #14171c;
}

.code-block__head {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.api-meta {
  border-color: #e8e8e8;
  background: #fafafa;
}

.param-table {
  border-color: #e8e8e8;
}

.param-table th {
  background: #fafafa;
  color: #737373;
  font-weight: 500;
}

.param-table td {
  border-bottom-color: #ededed;
}

.param-table code {
  background: #f3f4f6;
  border-color: #e8e8e8;
  color: #525252;
}

.method-tag {
  background: #f0f7f2;
  color: #398054;
}

.modal {
  width: min(40rem, calc(100vw - 48px));
  max-height: calc(100dvh - 48px);
  padding: 24px;
  border: 1px solid #dedede;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 16px 64px rgba(18, 19, 22, 0.2), var(--shadow-sm);
  overflow-y: auto;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.53);
  backdrop-filter: none;
}

.modal__panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.modal__head {
  align-items: center;
  margin-bottom: 18px;
}

.modal__head h2 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.modal__head .icon-button {
  margin-right: -6px;
}

.modal__panel > p {
  margin-top: 0;
  color: #737373;
  font-size: 13px;
}

.picker-results {
  border-color: #e8e8e8;
  border-radius: 8px;
}

.picker-result + .picker-result {
  border-top-color: #ededed;
}

.picker-hint {
  color: #737373;
}

.form-alert {
  border-radius: 8px;
}

.form-alert--error {
  border-color: #f4dede;
  background: #fdf2f2;
}

.error-panel {
  border-color: #e8e8e8;
  border-radius: 12px;
}

.error-panel h1 {
  font-family: var(--font-sans);
  font-weight: 500;
}

@media (max-width: 900px) {
  .topbar {
    padding: 0 20px;
  }

  .page {
    padding: 20px 20px 44px;
  }
}

@media (max-width: 520px) {
  .page {
    padding: 18px 14px 40px;
  }

  .topbar {
    padding: 0 14px;
  }

}

/* Reference-admin refinements */
.section-heading {
  gap: 0;
}

.section-heading__index {
  display: none;
}

.badge__dot {
  display: none;
}

.badge {
  padding: 0 8px;
}

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

  .page-heading h1 {
    text-align: left;
  }
}

.multi-option-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 4px 0;
}

.multi-option {
  min-height: 28px;
}

.multi-option .checkbox__text {
  font-size: 12.5px;
}

.empty-state > .button {
  margin-top: 14px;
}

.breadcrumbs a {
  color: #8a8a8a;
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--blue);
}

.breadcrumbs [aria-current="page"] {
  color: #45454b;
  font-weight: 500;
}

.founder-custom-fields {
  margin-top: 18px;
}

.field-config-row--fixed {
  background: #fafafa;
}

.field-config-row--fixed .checkbox input {
  cursor: default;
}

.fixed-field-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 28px;
  flex: 0 0 auto;
  color: #8a8a8a;
}

.field-config-row--fixed .tag {
  margin-left: auto;
}

/* Single-column page layouts (API docs remain two-column) */
.form-layout,
.detail-layout,
.editor-layout {
  grid-template-columns: minmax(0, 1fr);
}

.modal .search-field,
.search-field--lg {
  height: 46px;
}

.modal .search-field input {
  font-size: 14px;
  padding-left: 38px;
}

.modal .search-field .icon {
  left: 12px;
}

/* Modal picker search sizing */
.search-field--lg {
  flex: 1 1 auto;
  min-height: 46px;
}

.modal .search-field {
  flex: 0 0 46px;
  min-height: 46px;
}

/* Prevent page-level horizontal scrolling; tables scroll internally */
html,
body {
  overflow-x: hidden;
}

@supports (overflow: clip) {
  html,
  body {
    overflow-x: clip;
  }
}

/* Toasts should not cover page actions */

@media (max-width: 760px) {

  .param-table {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    table-layout: fixed;
  }

  .param-table th,
  .param-table td {
    padding-right: 10px;
    padding-left: 10px;
    overflow-wrap: anywhere;
  }

  .param-table code {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

.picker-results {
  max-height: 312px;
  scrollbar-width: thin;
}

@media (max-width: 760px) {
  .picker-results {
    max-height: 240px;
  }
}

.table-card .data-table th {
  border-top: 0;
}

/* Field create/edit modal */
.field-modal {
  width: min(900px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
}

.field-modal__panel {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 28px);
  padding: 0;
}

.field-modal__panel .modal__head {
  flex: 0 0 auto;
  margin: 0;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.field-modal__body {
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px 24px;
}

.field-modal__body .detail-layout {
  margin: 0;
}

.badge,
.tag-count {
  border-radius: 6px;
}

.field-modal__panel .modal__head {
  padding: 16px 24px;
}

.field-modal__body .card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.field-modal__body .detail-layout {
  gap: 20px;
}

.field-modal__body .detail-layout__main .card + .card {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.field-modal__body

.data-table .col-actions {
  padding-right: 24px;
}

.field-table .col-identifier {
  width: 190px;
}

.field-identifier {
  color: #737373;
  font-size: 11.5px;
  overflow-wrap: anywhere;
}

/* Collapsible admin sidebar */
.sidebar-mode-toggle {
  flex: 0 0 auto;
  color: rgba(231, 238, 232, 0.55);
}

.sidebar-mode-toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.sidebar-mode-toggle__collapse,
.sidebar-mode-toggle__expand {
  display: inline-flex;
}

.sidebar-mode-toggle__expand {
  display: none;
}

@media (min-width: 901px) {
  .sidebar {
    transition: width 0.22s var(--ease);
  }

  .app-frame {
    transition: margin-left 0.22s var(--ease);
  }

  html.sidebar-compact .sidebar {
    width: 72px;
    padding-right: 10px;
    padding-left: 10px;
  }

  html.sidebar-compact .app-frame {
    margin-left: 72px;
  }

  html.sidebar-compact .sidebar__head {
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
  }

  html.sidebar-compact .brand {
    display: none;
  }

  html.sidebar-compact .nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0;
  }

  html.sidebar-compact .nav__label {
    display: none;
  }

  html.sidebar-compact .nav__item {
    justify-content: center;
    width: 44px;
    min-height: 44px;
    padding: 0;
    margin: 0 auto;
  }

  html.sidebar-compact .nav__item span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  html.sidebar-compact .nav__item.is-active::before {
    top: 12px;
    bottom: 12px;
  }

  html.sidebar-compact .sidebar-mode-toggle__collapse {
    display: none;
  }

  html.sidebar-compact .sidebar-mode-toggle__expand {
    display: inline-flex;
  }

  html.sidebar-compact .sidebar__foot {
    padding-top: 12px;
  }

  html.sidebar-compact .account-card {
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    padding: 10px 0 0;
  }

  html.sidebar-compact .account-card__meta {
    display: none;
  }

  html.sidebar-compact .account-card form {
    margin-left: 0;
  }
}

@media (max-width: 900px) {
  .sidebar-mode-toggle {
    display: none;
  }
}

.page-heading h1 {
  font-size: 22px;
}

.page-heading h1 {
  font-size: 20px;
  font-weight: 600;
}

.table-note {
  color: #8a8a8a;
  font-size: 11px;
  white-space: nowrap;
}

.table-link--danger {
  color: #b42318;
}

.table-link--danger:hover {
  color: #8f1d13;
}

.required-mark {
  display: inline-block;
  margin-left: 2px;
  color: #d92d20;
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  vertical-align: middle;
}

.modal__panel {
  padding: 20px;
}

.field-modal {
  padding: 0;
  overflow: hidden;
}

.field-modal__panel {
  padding: 0;
  overflow: hidden;
}

.field-modal__panel .modal__head {
  position: relative;
  border-bottom: 0;
  padding: 14px 20px;
}

.field-modal__panel .modal__head::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 0;
  border-bottom: 1px dashed var(--line);
  background: transparent;
}

.field-modal__body {
  padding: 18px 20px;
  flex: 1 1 auto;
}

.field-modal__footer {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px dashed var(--line);
  background: var(--surface);
}

.field-modal__body .detail-layout__main .card + .card {
  border-top-style: dashed;
}

.modal__head h2 {
  font-size: 16px;
  font-weight: 600;
}

.confirm-dialog__content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 2px 0;
}

.confirm-dialog__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #fef3f2;
  color: #b42318;
}

.confirm-dialog__content p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.field-table .row-actions {
  gap: 10px;
}

.field-table .col-actions {
  width: 208px;
}

.page-save-bar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.secret-field {
  position: relative;
  display: flex;
  align-items: center;
}

.secret-field .input {
  padding-right: 76px;
}

.secret-field__actions {
  position: absolute;
  right: 5px;
  display: flex;
  gap: 1px;
}

.icon-button.icon-button--xs {
  width: 24px;
  height: 24px;
}

.field-table tbody td {
  height: 50px;
}

.toast-stack {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100vw - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(18, 19, 22, 0.14);
  pointer-events: auto;
  animation: toast-in 0.24s var(--ease) both;
}

.toast.is-leaving {
  animation: toast-out 0.18s ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(-6px); }
}

.toast__icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--muted);
}

.toast--success .toast__icon { color: var(--success); }
.toast--error .toast__icon { color: var(--danger); }
.toast--warning .toast__icon { color: var(--warning); }

.toast__message {
  flex: 1;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.toast__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted-2);
}

.toast__close:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.settings-form .form-footer {
  margin: 24px -22px 0;
  padding: 18px 22px 0;
  border-top: 1px dashed var(--line);
}

@media (max-width: 640px) {
  .settings-form .form-footer {
    margin-right: -20px;
    margin-left: -20px;
    padding-right: 20px;
    padding-left: 20px;
  }
}

.filter-reset {
  width: 38px;
  padding: 0;
}

.search-field.is-active {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.search-field.is-active .icon {
  color: var(--blue-deep);
}

.select-field.is-active select {
  border-color: var(--blue);
  background: var(--surface);
  color: var(--blue);
}

.select-field.is-active select option {
  color: var(--ink-soft);
}

.select-field.is-active select option:checked {
  color: var(--blue);
}

.image-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}

.image-upload {
  display: flex;
  width: 100%;
  min-height: 110px;
  overflow: hidden;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.image-upload:hover,
.image-upload:focus-within {
  border-color: var(--brand);
  background: var(--brand-tint);
}

.image-upload__preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 110px;
  padding: 10px;
}

.image-upload__preview img {
  width: 100%;
  max-height: 120px;
  object-fit: contain;
}

.image-upload__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  text-align: center;
}

.image-upload__empty .icon {
  margin-bottom: 4px;
  color: var(--muted-2);
}

.image-upload__empty strong {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.image-upload__empty small {
  color: var(--muted-2);
  font-size: 11px;
}

.founder-token-picker {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
}

.founder-token-picker:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 72, 56, 0.08);
}

.founder-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.founder-token {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 5px 4px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 12px;
  white-space: nowrap;
}

.founder-token button:not(.founder-token__title-trigger) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: currentColor;
  cursor: pointer;
}

.founder-token button:not(.founder-token__title-trigger):hover {
  background: rgba(0, 0, 0, 0.07);
}

.founder-picker__input {
  flex: 1 1 160px;
  min-width: 150px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  outline: 0;
}

.founder-suggestions {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 240px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.founder-suggestion {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.founder-suggestion:hover,
.founder-suggestion.is-active {
  background: var(--surface-2);
}

.founder-suggestion strong {
  font-size: 12px;
  font-weight: 600;
}

.founder-suggestion small {
  color: var(--muted);
  font-size: 10.5px;
}

.founder-suggestions__empty {
  padding: 10px 9px;
  color: var(--muted);
  font-size: 11.5px;
}

.founder-token__id,
.founder-suggestion__id {
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 400;
}

.founder-suggestion__id {
  margin-left: 5px;
}

.section-heading--with-action {
  align-items: center;
  justify-content: space-between;
}

.nav__item + .nav__item {
  margin-top: 3px;
}

.sidebar__head {
  padding-right: 0;
}

.filter-export {
  margin-left: auto;
}

.sort-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  white-space: nowrap;
}

.sort-link:hover {
  color: var(--brand);
}

.sort-link:hover .sort-arrow,
.sort-arrow.is-active {
  opacity: 1;
  color: var(--brand);
}

.sort-arrow {
  display: inline-flex;
  opacity: 0.28;
}

.table-link--danger {
  color: var(--danger);
}

.table-link--danger:hover {
  color: var(--danger-strong);
}

.table-link--warning {
  color: #b45309;
}

.table-link--warning:hover {
  color: #92400e;
}

.table-link--success {
  color: var(--success);
}

.table-link--success:hover {
  color: #24543e;
}

.data-table .col-actions .row-actions {
  gap: 10px;
}

.table-link.is-active {
  color: var(--muted);
}

.image-upload-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.image-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--danger);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.image-remove:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.image-upload-wrap.is-removing .image-upload__preview {
  opacity: 0.35;
}

.confirm-modal {
  width: min(600px, calc(100vw - 32px));
}

.founder-companies-modal {
  width: min(520px, calc(100vw - 32px));
}

.founder-company-more {
  display: inline-flex;
  align-items: center;
  height: 20px;
  margin-left: 5px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  line-height: 1;
  text-decoration: none;
}

.founder-company-more:hover {
  background: var(--blue-soft);
  color: var(--blue);
  text-decoration: none;
}

.founder-company-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.founder-company-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 13px;
}

.founder-company-item:hover {
  background: var(--surface-2);
}

.founder-company-item .icon {
  color: var(--muted-2);
}

.company-identity-layout {
  position: relative;
  display: block;
  grid-column: 1 / -1;
}

.company-identity-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-right: 216px;
}

.company-identity-main .input {
  height: 41px;
}

.company-identity-logo {
  position: absolute;
  inset: 0 0 0 auto;
  display: flex;
  flex-direction: column;
  width: 200px;
  height: auto;
}

.company-identity-logo .image-field {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.company-identity-logo .image-upload-wrap {
  flex: 1 1 auto;
}

.company-identity-logo .image-upload,
.company-identity-logo .image-upload__preview {
  height: 100%;
  min-height: 0;
}

.company-identity-logo .image-upload__preview {
  overflow: hidden;
}

.company-identity-logo .image-upload__preview img {
  width: auto;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
}

@media (max-width: 640px) {
  .company-identity-main {
    margin-right: 0;
  }

  .company-identity-logo {
    position: static;
    width: 100%;
    margin-top: 16px;
  }

  .company-identity-logo .image-field {
    min-height: 110px;
  }

  .company-identity-logo .image-upload,
  .company-identity-logo .image-upload__preview {
    min-height: 110px;
  }
}

.founder-token__link {
  color: inherit;
  text-decoration: none;
}

.founder-token__link:hover {
  text-decoration: underline;
}

.founder-company-item small {
  margin-left: 7px;
  color: var(--muted);
  font-size: 11px;
}

.company-cell {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-width: 0;
}

.company-cell__avatar {
  flex: 0 0 auto;
  line-height: 0;
}

.company-cell__body {
  min-width: 0;
}

.company-cell__name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.company-cell__name a {
  color: inherit;
  text-decoration: none;
}

.company-cell__name strong {
  overflow: hidden;
  max-width: 300px;
  color: #222;
  font-size: 13px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-cell__name a:hover strong {
  text-decoration: underline;
}

.company-cell__body > small {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 10px;
}

.company-cell__name .ranking-info {
  align-self: center;
  margin-top: 0;
}

.ranking-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  flex: 0 0 auto;
  align-self: flex-start;
  margin-top: 1px;
  padding: 0 6px;
  border: 0;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.ranking-info:hover,
.ranking-info[aria-expanded="true"] {
  background: var(--success-soft);
  color: var(--success);
  opacity: 0.82;
}

.ranking-bubble {
  position: fixed;
  z-index: 220;
  width: 240px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.ranking-bubble > strong {
  display: block;
  margin: 0 6px 6px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}

.ranking-bubble__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 6px;
  border-radius: 7px;
  color: var(--ink-soft);
  font-size: 12px;
}

.ranking-bubble__item:hover {
  background: var(--surface-2);
}

.ranking-bubble__item small {
  color: var(--muted-2);
  font-size: 10px;
  white-space: nowrap;
}

.founder-company-link {
  color: var(--ink-soft);
  text-decoration: none;
}

.founder-company-link:hover {
  color: var(--ink);
  text-decoration: underline;
}

.entity-cell strong.founder-name {
  color: #222;
  font-size: 13px;
  font-weight: 400;
}

.form-layout--single {
  grid-template-columns: minmax(0, 1fr);
}

.page-heading h1 .company-title-badge {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 8px;
  cursor: default;
}

.page-heading h1 .company-title-badge:hover {
  background: var(--success-soft);
  color: var(--success);
  opacity: 1;
}

.company-identity-logo .image-upload__preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.company-identity-logo .image-upload__preview img {
  position: absolute;
  inset: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  max-height: none;
  object-fit: contain;
}

.option-editor {
  gap: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.option-editor > .field__label {
  margin-bottom: 4px;
}

.option-editor .option-list {
  width: 100%;
  margin: 0;
  padding: 0;
}

.option-editor .option-row {
  gap: 7px;
  padding: 7px 0;
}

.option-editor .option-row .input {
  max-width: none;
}

.option-add-link {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 4px;
  margin-top: 9px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  cursor: pointer;
}

.option-add-link:hover {
  text-decoration: underline;
}

.option-row--new {
  border-top-style: dashed;
}

.editor-layout--single {
  grid-template-columns: minmax(0, 1fr);
}

.editor-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.editor-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.editor-tab:hover {
  color: var(--ink);
}

.editor-tab.is-active {
  border-bottom-color: var(--brand);
  color: var(--ink);
}

.editor-tab-panel {
  display: none;
}

.editor-tab-panel.is-active {
  display: block;
}

.sort-mode-switch {
  display: inline-flex;
  align-self: flex-start;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
}

.sort-mode-option {
  position: relative;
  display: inline-flex;
}

.sort-mode-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.sort-mode-option span {
  padding: 7px 13px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.sort-mode-option input:checked + span {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.sort-mode-option input:focus-visible + span {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.text-link {
  color: var(--blue);
  text-decoration: none;
}

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

.ranking-group-names {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-soft);
  font-size: 13px;
}

.group-options {
  gap: 8px;
}

.group-options .multi-option {
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
}

.group-options .multi-option:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-tint);
}

.group-modal,
.ranking-groups-modal {
  width: min(460px, calc(100vw - 28px));
}