/* Sapreme's own surfaces around the SDK chat. Colours come from the SDK theme tokens, so the login
   page and status bar follow the selected theme and light/dark mode. */

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
}

/* Chat above, status bar below; the SDK root fills the remaining height instead of the viewport. */
.sapreme-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

.sapreme-shell__chat {
  flex: 1;
  min-height: 0;
}

.sapreme-shell__chat .sm-root {
  height: 100%;
}

/* Chat is refused until the tenant has an AI provider: a calm empty state in its place. */
.sapreme-ai-missing {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.sapreme-ai-missing__card {
  width: min(28rem, 100%);
}

.sapreme-secret-textarea textarea,
textarea.sapreme-secret-textarea {
  min-height: 9rem;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.75rem;
}

.sapreme-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  padding: 4px 16px;
  border-top: 1px solid var(--border);
  background: var(--sidebar, var(--background));
  color: var(--muted-foreground);
  font-size: 11px;
  line-height: 16px;
}

.sapreme-status__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.sapreme-status__item--right {
  margin-left: auto;
}

.sapreme-status__health--healthy { color: #16a34a; }
.sapreme-status__health--degraded { color: #dc2626; }

/* Login and error pages. */
.sapreme-center {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 16px;
  box-sizing: border-box;
}

.sapreme-card {
  width: 100%;
  max-width: 400px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--card-foreground);
  box-sizing: border-box;
}

.sapreme-card__header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.sapreme-card__mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-foreground);
}

.sapreme-card__title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
}

.sapreme-card__text {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 13px;
}

.sapreme-form {
  display: grid;
  gap: 14px;
}

.sapreme-field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}

.sapreme-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--input, var(--border));
  border-radius: 8px;
  background: var(--background);
  color: var(--foreground);
  font: inherit;
  font-weight: 400;
  box-sizing: border-box;
}

.sapreme-input:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
}

.sapreme-field__error {
  color: #dc2626;
  font-size: 12px;
  font-weight: 400;
}

.sapreme-alert {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgb(220 38 38 / 0.4);
  border-radius: 8px;
  background: rgb(220 38 38 / 0.08);
  font-size: 13px;
}

.sapreme-button {
  display: inline-flex;
  justify-content: center;
  margin-top: 4px;
  padding: 9px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-foreground);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.sapreme-button:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* ── Account pages (sign-in, password, MFA, device approval): a centred Blueprint card ───────── */

.sapreme-auth {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2rem 1rem;
  box-sizing: border-box;
}

.sapreme-auth__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
}

.sapreme-auth__mark {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: calc(var(--radius, 0.5rem) - 2px);
  background: var(--primary);
  color: var(--primary-foreground);
}

.sapreme-auth__card {
  width: 100%;
  max-width: 26rem;
}

.sapreme-auth__title {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.sapreme-auth__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sapreme-auth__submit {
  width: 100%;
}

.sapreme-auth__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.sapreme-auth__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sapreme-auth__hint {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.sapreme-auth__aside {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem 0.75rem;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}

.sapreme-auth .sapreme-input {
  height: 2.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: calc(var(--radius, 0.5rem) - 2px);
  font-size: 0.875rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}

.sapreme-auth select.sapreme-input {
  padding-inline-end: 2rem;
}

.sapreme-input[aria-invalid="true"],
.sapreme-input.invalid {
  border-color: var(--destructive, #dc2626);
}

.sapreme-input--code {
  font-family: var(--font-mono, ui-monospace, monospace);
  letter-spacing: 0.2em;
  text-align: center;
}

.sapreme-field__error {
  color: var(--destructive, #dc2626);
}

.sapreme-optional {
  color: var(--muted-foreground);
  font-weight: 400;
}

.sapreme-link {
  color: var(--foreground);
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.sapreme-link:hover {
  color: var(--primary);
}

.sapreme-signout {
  display: inline;
  margin: 0;
}

.sapreme-device-code {
  padding: 0.875rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius, 0.5rem);
  background: var(--muted);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-align: center;
}

.sapreme-qr {
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  padding: 0.75rem;
  border-radius: var(--radius, 0.5rem);
  background: #fff; /* QR codes need a light quiet zone in dark mode too. */
}

.sapreme-switch-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

.sapreme-details {
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.sapreme-details > summary {
  cursor: pointer;
  color: var(--muted-foreground);
}

.sapreme-details[open] > summary {
  margin-bottom: 0.5rem;
}

.sapreme-key {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: calc(var(--radius, 0.5rem) - 2px);
  background: var(--muted);
  font-family: var(--font-mono, ui-monospace, monospace);
  letter-spacing: 0.05em;
  overflow-wrap: anywhere;
  user-select: all;
}

.sapreme-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.375rem 1rem;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem 0.75rem 2rem;
  border-radius: var(--radius, 0.5rem);
  background: var(--muted);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.875rem;
  user-select: all;
}

.sapreme-status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}

@media (max-width: 400px) {
  .sapreme-codes { grid-template-columns: 1fr; }
  .sapreme-device-code { font-size: 1.375rem; letter-spacing: 0.15em; }
}

/* Settings and administration shell. It mirrors the chat's shell (the SDK's sm-sidebar and
   sm-header): a 264 px sidebar on the --sidebar surface with the same brand block, and a 56 px
   top bar on the page background. The page fills the viewport; the content scrolls. */

.sapreme-settings {
  display: grid;
  grid-template-columns: 16.5rem minmax(0, 1fr);
  grid-template-rows: 3.5rem minmax(0, 1fr);
  grid-template-areas:
    "brand bar"
    "nav main";
  height: 100vh;
  height: 100dvh;
  background: var(--background);
  color: var(--foreground);
}

.sapreme-settings__brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  padding: 0 0.5rem 0 0.75rem;
  border-right: 1px solid var(--sidebar-border, var(--border));
  border-bottom: 1px solid var(--sidebar-border, var(--border));
  background: var(--sidebar, var(--background));
  color: var(--sidebar-foreground, var(--foreground));
  text-decoration: none;
}

.sapreme-settings__brand:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -2px;
}

/* Same mark as the chat sidebar: neutral, not the brand colour. */
.sapreme-settings__brand-mark {
  display: inline-grid;
  flex-shrink: 0;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  background: var(--foreground);
  color: var(--background);
}

.sapreme-settings__brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.sapreme-settings__brand-title {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sapreme-settings__brand-subtitle {
  overflow: hidden;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sapreme-settings__bar {
  grid-area: bar;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  min-width: 0;
  padding: 0 0.85rem;
  border-bottom: 1px solid var(--border);
  background: var(--background);
}

/* Buttons never wrap their label (shadcn's whitespace-nowrap), e.g. "New user" on a phone. */
.sapreme-settings button,
.sapreme-settings__bar > a {
  white-space: nowrap;
}

.sapreme-show-sm {
  display: none;
}

@media (max-width: 480px) {
  .sapreme-hide-sm {
    display: none;
  }

  .sapreme-show-sm {
    display: inline;
  }
}

.sapreme-settings__who {
  min-width: 0;
  max-width: 16rem;
  margin-right: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.sapreme-settings__nav {
  grid-area: nav;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  padding: 0.75rem 0.5rem;
  overflow-y: auto;
  border-right: 1px solid var(--sidebar-border, var(--border));
  background: var(--sidebar, var(--background));
  color: var(--sidebar-foreground, var(--foreground));
}

.sapreme-settings__nav ul {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sapreme-settings__group-title {
  margin: 0 0 0.25rem;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.sapreme-settings__link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: calc(var(--radius, 0.5rem) - 2px);
  font-size: 0.875rem;
  color: var(--sidebar-foreground, var(--foreground));
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease;
}

.sapreme-settings__link:hover {
  background: var(--sidebar-accent, var(--muted));
  color: var(--sidebar-accent-foreground, var(--foreground));
}

.sapreme-settings__link.active {
  background: var(--sidebar-accent, var(--muted));
  color: var(--sidebar-accent-foreground, var(--foreground));
  font-weight: 500;
}

.sapreme-settings__link:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -2px;
}

.sapreme-settings__main {
  grid-area: main;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
}

.sapreme-settings__page {
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
  box-sizing: border-box;
}

.sapreme-settings__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.sapreme-settings__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.sapreme-settings__description {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.sapreme-settings__actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.5rem;
}

/* Card titles at the shadcn/ui (v4) size: Blueprint's BbCardTitle is text-2xl, which reads as a
   second page title next to the chat's compact type. */
.sapreme-settings__main [class~="bb:text-2xl"] {
  font-size: 1rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.sapreme-settings__stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sapreme-settings__notice {
  margin-bottom: 1.5rem;
}

/* Label/value list (account profile). */
.sapreme-props {
  display: grid;
  margin: 0;
}

.sapreme-props > div {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
}

.sapreme-props > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.sapreme-props dt {
  color: var(--muted-foreground);
}

.sapreme-props dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Setting rows: icon, title and hint, action. */
.sapreme-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sapreme-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 0;
  border-top: 1px solid var(--border);
}

.sapreme-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.sapreme-row__icon,
.sapreme-cell-main__icon {
  display: inline-grid;
  flex-shrink: 0;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: calc(var(--radius, 0.5rem) - 2px);
  background: var(--muted);
  color: var(--muted-foreground);
}

.sapreme-row__text,
.sapreme-connector__text {
  flex: 1;
  min-width: 0;
}

.sapreme-row__title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
}

.sapreme-row__hint {
  margin: 0.125rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

/* Connector status. */
.sapreme-connector {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.sapreme-connector__dot {
  flex-shrink: 0;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 999px;
  color: var(--muted-foreground);
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in oklab, currentColor 15%, transparent);
}

.sapreme-connector__dot.is-ready {
  color: #16a34a;
}

.sapreme-connector__dot.is-partial {
  color: #d97706;
}

/* Numbered setup steps. */
.sapreme-steps {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: sapreme-step;
}

.sapreme-steps > li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.375rem;
  padding-left: 2.5rem;
  counter-increment: sapreme-step;
}

.sapreme-steps > li::before {
  content: counter(sapreme-step);
  position: absolute;
  left: 0;
  top: -0.125rem;
  display: grid;
  place-items: center;
  width: 1.625rem;
  height: 1.625rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-foreground);
}

.sapreme-steps .sapreme-row__hint {
  margin: 0;
}

/* Tables (islands). */
.sapreme-table {
  font-size: 0.875rem;
  min-width: 0;
}

/* Blueprint wraps the <table> in a bordered box: scroll inside it instead of overflowing the card. */
.sapreme-table div:has(> table) {
  overflow-x: auto;
}

/* Fixed layout: the sized columns keep their widths and the main (unsized) column takes the
   rest, ellipsing long names. Below the minimum width the wrapper above scrolls instead. */
.sapreme-table table {
  table-layout: fixed;
  min-width: 36rem;
}

.sapreme-table--wide table {
  min-width: 50rem;
}

.sapreme-table th,
.sapreme-table td {
  white-space: nowrap;
}

.sapreme-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Row action menus: one line per item, like shadcn's min-w-[8rem] menus with longer labels. */
.sapreme-menu {
  min-width: 13rem;
}

.sapreme-menu [role="menuitem"] {
  white-space: nowrap;
}

.sapreme-cell-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.sapreme-cell-main.is-muted {
  opacity: 0.6;
}

.sapreme-cell-main__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sapreme-cell-main__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.sapreme-cell-main__hint,
.sapreme-cell-muted {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

/* A title that truncates next to a badge that must stay visible (e.g. "You"). */
.sapreme-cell-main__title-row {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 0;
}

.sapreme-cell-main__title-row > .sapreme-cell-main__title {
  min-width: 0;
}

.sapreme-cell-main__title-row > :not(.sapreme-cell-main__title) {
  flex-shrink: 0;
}

.sapreme-cell-main__hint {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sapreme-cell-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.25rem;
}

.sapreme-danger-text {
  color: var(--destructive);
}

/* A filter select beside the table's toolbar buttons (platform Users: tenant filter). */
.sapreme-toolbar-select {
  min-width: 11rem;
  max-width: 16rem;
}

.sapreme-skeleton-rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sapreme-alert-action {
  margin-top: 0.75rem;
}

/* Narrow screens: the brand and the bar share the top row, the navigation becomes a scrolling
   tab row under it, and the page scrolls as a whole. */
@media (max-width: 768px) {
  .sapreme-settings {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: 3.5rem auto 1fr;
    grid-template-areas:
      "brand bar"
      "nav nav"
      "main main";
    height: auto;
    min-height: 100dvh;
  }

  .sapreme-settings__brand {
    border-right: 0;
    background: var(--background);
  }

  .sapreme-settings__brand-copy {
    display: none;
  }

  .sapreme-settings__bar {
    padding: 0 0.75rem 0 0;
  }

  .sapreme-settings__nav {
    flex-direction: row;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    overflow-x: auto;
    overflow-y: visible;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    background: var(--background);
    scrollbar-width: none;
  }

  .sapreme-settings__nav ul {
    flex-direction: row;
  }

  .sapreme-settings__group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }

  .sapreme-settings__group + .sapreme-settings__group {
    padding-left: 0.75rem;
    border-left: 1px solid var(--border);
  }

  .sapreme-settings__group-title,
  .sapreme-settings__who {
    display: none;
  }

  .sapreme-settings__main {
    overflow: visible;
  }

  .sapreme-settings__page {
    padding: 1.25rem 1rem 3rem;
  }

  .sapreme-settings__head {
    flex-direction: column;
  }

  .sapreme-props > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.125rem;
  }
}

/* Administration tables and dialogs */

.sapreme-avatar {
  display: inline-grid;
  flex-shrink: 0;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--muted);
  color: var(--foreground);
  font-size: 0.75rem;
  font-weight: 600;
}


.sapreme-code {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.8125rem;
}

.sapreme-inline-status {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.sapreme-inline-status.is-on {
  color: #16a34a;
}

.sapreme-input--upper input,
input.sapreme-input--upper {
  text-transform: uppercase;
}

.sapreme-dialog {
  width: min(32rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
}

.sapreme-dialog--wide {
  width: min(40rem, calc(100vw - 2rem));
}

.sapreme-dialog__form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sapreme-dialog__fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

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

.sapreme-secret {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius, 0.5rem);
  background: var(--muted);
}

.sapreme-secret__value {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 1rem;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
  user-select: all;
}

/* Long values (invite links): smaller, no tracking. */
.sapreme-secret__value--wrap {
  font-size: 0.8125rem;
  letter-spacing: 0;
  line-height: 1.45;
}

/* Stacked cell lines (a tenant's admins). */
.sapreme-stack-xs {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sapreme-secret__copy {
  flex-shrink: 0;
  gap: 0.375rem;
  font-size: 0.8125rem;
}

.sapreme-secret__copy svg {
  width: 0.875rem;
  height: 0.875rem;
}

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

  .sapreme-form-grid:not(.sapreme-form-grid--4) {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Status bar: SapremeConnect connector (links to its settings page). */
.sapreme-status__link { color: inherit; text-decoration: none; border-radius: 4px; }
.sapreme-status__link:hover { text-decoration: underline; }
.sapreme-status__link:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.sapreme-status__connector--ready { color: #16a34a; }
.sapreme-status__connector--partial { color: #d97706; }

/* Composer: SAP system picker (pill, menu, logon button). */
.sapreme-sap-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
}

.sapreme-sap-picker__pill {
  gap: 6px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
}

.sapreme-sap-picker__pill:hover:not(:disabled) { color: var(--foreground); }

.sapreme-sap-picker__label {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sapreme-sap-picker__dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--muted-foreground);
  opacity: 0.6;
}

.sapreme-sap-picker__dot--loggedOn { background: #16a34a; opacity: 1; }
.sapreme-sap-picker__dot--logOnInTray { background: #d97706; opacity: 1; }
.sapreme-sap-picker__dot--none { background: transparent; box-shadow: inset 0 0 0 1px var(--muted-foreground); }

.sapreme-sap-picker__menu {
  width: 20rem;
  padding: 0;
}

.sapreme-sap-picker__item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sapreme-sap-picker__item-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.sapreme-sap-picker__item-label { font-weight: 500; }

.sapreme-sap-picker__item-name {
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sapreme-sap-picker__badge { flex: none; font-size: 10px; }

.sapreme-sap-picker__logon { height: 28px; padding: 0 4px; font-size: 12px; }

.sapreme-sap-picker__hint { color: var(--muted-foreground); white-space: nowrap; }

.sapreme-sap-picker__error { color: var(--destructive, #dc2626); }
