@font-face {
  font-family: "InterVariable";
  src: url("/portal/assets/InterVariable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #17201f;
  --ink-soft: #53605e;
  --ink-faint: #64716f;
  --line: rgba(23, 32, 31, 0.12);
  --line-strong: rgba(23, 32, 31, 0.2);
  --canvas: #ffffff;
  --well: #f4f7f6;
  --brand: #09675e;
  --brand-hover: #07574f;
  --brand-soft: #e7f4f1;
  --brand-line: #b9dcd6;
  --danger: #a43c36;
  --danger-hover: #8f302b;
  --danger-soft: #fff0ee;
  --danger-line: #efc2bd;
  --focus: #08756a;
  --radius: 0.875rem;
  --radius-small: 0.625rem;
  --shadow-dialog: 0 24px 70px rgba(23, 32, 31, 0.18), 0 2px 8px rgba(23, 32, 31, 0.08);
  font-family: "InterVariable", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11", "ss01", "ss03";
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 20rem;
  min-height: 100%;
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-size: 1rem;
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.app-shell {
  isolation: isolate;
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.header-inner,
.main-content,
.site-footer {
  width: min(100%, 76rem);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.header-inner {
  display: flex;
  min-height: 4.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.625rem;
  color: var(--ink);
  font-weight: 650;
  letter-spacing: -0.015em;
  text-decoration: none;
}

.brand:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 0.25rem;
}

.brand-mark {
  display: inline-grid;
  width: 1.875rem;
  height: 1.875rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 0.5rem;
  color: #ffffff;
  background: var(--brand);
  font-size: 0.875rem;
  font-weight: 750;
}

.header-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.environment-badge,
.scope-badge,
.status-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  color: #185c56;
  background: var(--brand-soft);
  font-size: 0.8125rem;
  font-weight: 650;
  line-height: 1;
}

.environment-badge {
  margin: 0;
  padding: 0.4375rem 0.625rem;
  white-space: nowrap;
}

.main-content {
  flex: 1;
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

.site-footer {
  padding-top: 1.25rem;
  padding-bottom: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.875rem;
}

.site-footer p {
  margin: 0;
}

h1,
h2,
h3,
p,
dl,
dd,
pre {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--ink);
  font-weight: 650;
  text-wrap: balance;
}

h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(2rem, 5vw, 3.75rem);
  letter-spacing: -0.045em;
  line-height: 1.04;
}

h2 {
  margin-bottom: 0.5rem;
  font-size: 1.375rem;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

h3 {
  margin-bottom: 0.25rem;
  font-size: 1rem;
  line-height: 1.35;
}

p {
  margin-bottom: 0;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.eyebrow {
  margin-bottom: 0.75rem;
  color: var(--brand);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.035em;
}

.lead {
  max-width: 57ch;
  font-size: 1.125rem;
  line-height: 1.65;
}

.button {
  display: inline-flex;
  min-height: 2.5rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  border: 1px solid transparent;
  border-radius: 0.625rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
}

.button:hover:not(:disabled) {
  cursor: pointer;
}

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

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button-primary {
  border-color: var(--brand);
  color: #ffffff;
  background: var(--brand);
}

.button-primary:hover:not(:disabled) {
  border-color: var(--brand-hover);
  background: var(--brand-hover);
}

.button-secondary {
  border-color: var(--line-strong);
  color: var(--ink);
  background: #ffffff;
}

.button-secondary:hover:not(:disabled) {
  border-color: rgba(23, 32, 31, 0.32);
  background: var(--well);
}

.button-ghost {
  border-color: transparent;
  color: var(--ink-soft);
  background: transparent;
}

.button-ghost:hover:not(:disabled) {
  color: var(--ink);
  background: var(--well);
}

.button-danger {
  border-color: var(--danger);
  color: #ffffff;
  background: var(--danger);
}

.button-danger:hover:not(:disabled) {
  border-color: var(--danger-hover);
  background: var(--danger-hover);
}

.button-compact {
  min-height: 2rem;
  padding: 0.3125rem 0.625rem;
}

.button-large {
  min-height: 3rem;
  width: 100%;
  padding: 0.75rem 1rem;
}

.button-full {
  width: 100%;
}

.notice {
  margin-bottom: 1.5rem;
  padding: 0.875rem 1rem;
  border: 1px solid;
  border-radius: var(--radius-small);
}

.notice p {
  color: inherit;
}

.notice-error {
  border-color: var(--danger-line);
  color: #7c2d28;
  background: var(--danger-soft);
}

.notice:focus {
  outline: 2px solid var(--danger);
  outline-offset: 2px;
}

.loading-view {
  display: flex;
  min-height: 52vh;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.loading-view h1 {
  margin-bottom: 0.25rem;
  font-size: 1.5rem;
  letter-spacing: -0.025em;
}

.spinner {
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 auto;
  border: 2px solid var(--brand-line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.service-error-view {
  display: grid;
  min-height: 52vh;
  max-width: 42rem;
  align-content: center;
  justify-items: start;
  gap: 1rem;
}

.service-error-view h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 3rem);
}

.service-error-view .eyebrow,
.service-error-view p {
  margin-bottom: 0;
}

.login-layout {
  display: grid;
  min-height: calc(100dvh - 13rem);
  align-items: center;
  gap: 3rem;
}

.login-copy {
  min-width: 0;
}

.trust-list {
  display: grid;
  margin-bottom: 0;
  padding-top: 2rem;
  gap: 1.125rem;
}

.trust-list div {
  padding-left: 1rem;
  border-left: 2px solid var(--brand-line);
}

.trust-list dt,
.key-meta dt,
.account-strip dt {
  color: var(--ink);
  font-weight: 650;
}

.trust-list dd,
.key-meta dd,
.account-strip dd {
  margin-left: 0;
  color: var(--ink-soft);
}

.login-panel {
  display: grid;
  width: 100%;
  max-width: 26rem;
  justify-self: start;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(23, 32, 31, 0.08);
  gap: 1.5rem;
}

.login-panel form,
.key-form,
.secret-content {
  display: grid;
  gap: 1.25rem;
}

.fine-print,
.field-help,
.field-error,
.inline-status,
.secondary-value,
.count-label {
  font-size: 0.875rem;
  line-height: 1.5;
}

.fine-print {
  color: var(--ink-faint);
}

.inline-status {
  color: var(--ink-soft);
}

.field {
  display: grid;
  gap: 0.375rem;
}

.field label,
.copy-label,
.access-fieldset legend {
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 650;
}

.label-optional {
  color: var(--ink-faint);
  font-weight: 450;
}

.field input {
  width: 100%;
  min-height: 2.875rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.5rem;
  color: var(--ink);
  background: #ffffff;
  font-size: 1rem;
}

.field input::placeholder {
  color: #687472;
}

.field input:hover {
  border-color: rgba(23, 32, 31, 0.34);
}

.field input:focus {
  border-color: var(--focus);
  outline: 2px solid var(--focus);
  outline-offset: -1px;
}

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

.field-help {
  color: var(--ink-faint);
}

.field-error {
  color: var(--danger);
}

.dashboard {
  container-name: dashboard;
  container-type: inline-size;
}

.dashboard-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
}

.dashboard-heading h1 {
  max-width: 22ch;
  font-size: clamp(2rem, 5vw, 3rem);
}

.account-strip {
  margin-top: 2rem;
  padding-block: 1.25rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.account-strip dl {
  display: grid;
  margin-bottom: 0;
  gap: 1.25rem;
}

.account-strip dl > div {
  min-width: 0;
}

.account-strip dt,
.key-meta dt {
  font-size: 0.8125rem;
}

.account-strip dd {
  overflow-wrap: anywhere;
}

.account-strip .secondary-value {
  color: var(--ink-faint);
}

.dashboard-grid {
  display: grid;
  align-items: start;
  margin-top: 2.5rem;
  gap: 2.5rem;
}

.dashboard-main {
  display: grid;
  min-width: 0;
  gap: 2.5rem;
}

.connection-panel {
  display: grid;
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  gap: 1.5rem;
}

.section-block {
  min-width: 0;
}

.section-block + .section-block {
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}

.section-heading,
.secret-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.section-heading > div,
.secret-heading > div {
  min-width: 0;
}

.count-label {
  white-space: nowrap;
}

.empty-state {
  margin-top: 1.25rem;
  padding: 1.25rem;
  border-radius: var(--radius-small);
  background: var(--well);
}

.keys-list {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.key-item {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  padding-block: 1.25rem;
  border-top: 1px solid var(--line);
  gap: 1rem;
}

.key-item:last-child {
  padding-bottom: 0;
}

.key-summary {
  min-width: 0;
  flex: 1;
}

.key-title-row {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.key-name {
  min-width: 0;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.scope-badge,
.status-badge {
  padding: 0.3125rem 0.5rem;
  font-size: 0.75rem;
}

.status-badge {
  border-color: var(--line);
  color: var(--ink-soft);
  background: var(--well);
}

.key-meta {
  display: flex;
  flex-wrap: wrap;
  margin: 0.625rem 0 0;
  gap: 0.5rem 1.5rem;
}

.key-meta > div {
  display: flex;
  min-width: 0;
  gap: 0.4rem;
}

.key-meta dd {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
}

.key-form {
  max-width: 40rem;
  margin-top: 1.5rem;
}

.access-fieldset {
  display: grid;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  gap: 0.625rem;
}

.access-fieldset legend {
  margin-bottom: 0.5rem;
  padding: 0;
}

.radio-option {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  padding: 0.875rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  cursor: pointer;
  gap: 0.75rem;
}

.radio-option:hover {
  border-color: var(--brand-line);
  background: #fbfdfc;
}

.radio-option:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.radio-option input {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
  margin: 0.125rem 0 0;
  accent-color: var(--brand);
}

.radio-option input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.radio-option > span {
  display: grid;
  min-width: 0;
  gap: 0.125rem;
}

.radio-option strong {
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 650;
}

.radio-option span span {
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.form-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.secret-panel {
  padding: 1.25rem;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius);
  background: #f5fbf9;
}

.secret-content {
  padding-top: 1.5rem;
}

.copy-field {
  display: grid;
  min-width: 0;
  gap: 0.5rem;
}

.copy-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.code-value {
  display: block;
  max-width: 100%;
  margin: 0;
  padding: 0.75rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  color: #24312f;
  background: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.code-value:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.code-block {
  max-height: 18rem;
  overflow: auto;
}

.security-note {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.confirm-dialog {
  width: min(calc(100% - 2rem), 28rem);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  color: var(--ink);
  background: #ffffff;
  box-shadow: var(--shadow-dialog);
}

.confirm-dialog::backdrop {
  background: rgba(23, 32, 31, 0.45);
}

.confirm-dialog form {
  display: grid;
  padding: 1.5rem;
  gap: 1.5rem;
}

.dialog-key-name {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  color: var(--ink);
  background: var(--well);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

@container dashboard (min-width: 42rem) {
  .dashboard-heading,
  .section-heading,
  .secret-heading {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }

  .account-strip dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-strip dl > div + div {
    padding-left: 1.5rem;
    border-left: 1px solid var(--line);
  }

  .key-item {
    flex-direction: row;
    align-items: center;
  }

  .form-actions {
    flex-direction: row;
    align-items: center;
  }
}

@container dashboard (min-width: 58rem) {
  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) 19rem;
    gap: 3rem;
  }

  .connection-panel {
    position: sticky;
    top: 1.5rem;
  }
}

@media (min-width: 48rem) {
  .header-inner,
  .main-content,
  .site-footer {
    padding-inline: 2rem;
  }

  .main-content {
    padding-top: 4rem;
    padding-bottom: 5rem;
  }

  .login-layout {
    grid-template-columns: minmax(0, 3fr) minmax(20rem, 2fr);
    gap: 4rem;
  }

  .login-panel {
    justify-self: end;
    padding: 2rem;
  }
}

@media (max-width: 39.999rem) {
  .header-inner {
    min-height: 4rem;
    flex-wrap: wrap;
    padding-block: 0.75rem;
  }

  .brand > span:last-child {
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }


  .dashboard-heading .button,
  .form-actions .button {
    width: 100%;
  }

  .copy-label-row {
    align-items: flex-start;
  }

  .button,
  .site-footer,
  .fine-print,
  .field-help,
  .field-error,
  .inline-status,
  .secondary-value,
  .count-label,
  .field label,
  .copy-label,
  .access-fieldset legend,
  .radio-option strong,
  .radio-option span span {
    font-size: 1rem;
  }

  .environment-badge,
  .scope-badge,
  .status-badge {
    font-size: 0.875rem;
  }
}

@media (pointer: coarse) {
  .button,
  .button-compact {
    min-height: 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
  }
}
