:root {
  --navy-950: #071426;
  --navy-900: #0b1f3a;
  --navy-850: #102a4b;
  --navy-800: #14365d;
  --blue-700: #1d5dba;
  --blue-600: #2672d7;
  --blue-500: #3989eb;
  --blue-100: #e7f1ff;
  --blue-50: #f3f8ff;
  --ink-900: #102036;
  --ink-700: #3c4f68;
  --ink-600: #52647b;
  --ink-500: #718197;
  --line: #d9e3ee;
  --line-strong: #c7d5e5;
  --surface: #ffffff;
  --surface-muted: #f7f9fc;
  --page: #edf3f8;
  --success: #087f5b;
  --success-soft: #e5f6ef;
  --warning: #a35b00;
  --warning-soft: #fff3dc;
  --danger: #bf3447;
  --danger-soft: #ffedf0;
  --shadow-sm: 0 1px 2px rgba(7, 20, 38, 0.05), 0 8px 24px rgba(7, 20, 38, 0.05);
  --shadow-lg: 0 24px 64px rgba(6, 24, 45, 0.16);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --focus: 0 0 0 3px rgba(57, 137, 235, 0.28);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  color: var(--ink-900);
  background: var(--page);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% -8%, rgba(57, 137, 235, 0.13), transparent 28rem),
    linear-gradient(180deg, #f5f8fb 0, var(--page) 32rem);
  color: var(--ink-900);
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

button {
  border: 0;
}

a {
  color: inherit;
}

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

h1,
h2,
h3 {
  color: var(--ink-900);
  line-height: 1.14;
  letter-spacing: -0.025em;
}

h1 {
  margin-bottom: 0.65rem;
  font-size: clamp(2rem, 4vw, 3.35rem);
}

h2 {
  margin-bottom: 0.5rem;
  font-size: 1.35rem;
}

h3 {
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

p {
  color: var(--ink-600);
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88em;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1000;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  background: var(--surface);
  color: var(--navy-900);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--blue-600);
  outline-offset: 3px;
}

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

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem clamp(1rem, 4vw, 3.75rem);
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(199, 213, 229, 0.78);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  border-radius: 10px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--blue-500), var(--navy-800));
  color: #fff;
  box-shadow: 0 10px 24px rgba(29, 93, 186, 0.25);
  font-size: 1.16rem;
  font-weight: 850;
  letter-spacing: -0.08em;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  color: var(--navy-900);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-caption {
  margin-top: 0.14rem;
  color: var(--ink-500);
  font-size: 0.72rem;
  font-weight: 600;
}

.topbar-actions,
.button-row,
.overview-card-topline,
.copy-line,
.inline-form {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 0.7rem;
}

.main-content {
  display: flex;
  width: 100%;
  flex: 1;
  flex-direction: column;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem clamp(1rem, 4vw, 3.75rem);
  border-top: 1px solid var(--line);
  color: var(--ink-500);
  font-size: 0.78rem;
}

.footer p {
  margin: 0;
  color: inherit;
}

.eyebrow,
.card-kicker,
.overview-label,
.copy-label,
.step-label {
  margin-bottom: 0.45rem;
  color: var(--blue-700);
  font-size: 0.71rem;
  font-weight: 800;
  letter-spacing: 0.095em;
  text-transform: uppercase;
}

.eyebrow-light {
  color: #8ec4ff;
}

.panel {
  border: 1px solid rgba(199, 213, 229, 0.8);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-sm);
}

.state-view {
  width: 100%;
  flex: 1;
}

.state-view-centered {
  display: grid;
  min-height: 520px;
  place-items: center;
  padding: 2rem 1rem;
}

.loading-card {
  display: flex;
  max-width: 420px;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.loading-card h1 {
  margin-top: 1.25rem;
  font-size: 1.55rem;
}

.spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.spinner-large {
  width: 48px;
  height: 48px;
  border-width: 4px;
  color: var(--blue-600);
}

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

.message-card {
  display: flex;
  width: min(100%, 620px);
  gap: 1.2rem;
  padding: clamp(1.5rem, 4vw, 2.4rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.message-card h1 {
  font-size: clamp(1.65rem, 4vw, 2.2rem);
}

.message-icon {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border-radius: 50%;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 1.2rem;
  font-weight: 900;
}

.auth-layout {
  display: grid;
  width: min(100% - 2rem, 1280px);
  min-height: 700px;
  flex: 1;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
  margin: clamp(1rem, 3vw, 2.25rem) auto;
  overflow: hidden;
  border: 1px solid rgba(199, 213, 229, 0.72);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.auth-intro {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4.6rem);
  background:
    radial-gradient(circle at 85% 12%, rgba(65, 156, 255, 0.34), transparent 17rem),
    radial-gradient(circle at 10% 92%, rgba(38, 114, 215, 0.22), transparent 22rem),
    linear-gradient(145deg, var(--navy-950), var(--navy-800));
}

.auth-intro::before,
.auth-intro::after {
  position: absolute;
  border: 1px solid rgba(142, 196, 255, 0.15);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.auth-intro::before {
  width: 380px;
  height: 380px;
  top: -210px;
  right: -130px;
}

.auth-intro::after {
  width: 270px;
  height: 270px;
  bottom: -150px;
  left: -110px;
}

.intro-content,
.intro-footnote {
  position: relative;
  z-index: 1;
}

.auth-intro h1 {
  max-width: 720px;
  margin-bottom: 1.25rem;
  color: #fff;
}

.intro-lead {
  max-width: 660px;
  color: #c9d9ec;
  font-size: 1.04rem;
  line-height: 1.7;
}

.trust-list {
  display: grid;
  gap: 1.25rem;
  margin: 2.6rem 0 0;
  padding: 0;
  list-style: none;
}

.trust-list li {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: start;
  gap: 0.9rem;
  color: #c9d9ec;
  font-size: 0.94rem;
}

.trust-list strong {
  color: #fff;
}

.trust-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(142, 196, 255, 0.3);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
  color: #8ec4ff;
  font-size: 0.68rem;
  font-weight: 800;
}

.intro-footnote {
  margin: 2.5rem 0 0;
  color: #89a2bd;
  font-size: 0.8rem;
}

.auth-panel-wrap {
  display: grid;
  min-width: 0;
  place-items: center;
  padding: clamp(1.5rem, 5vw, 4.75rem);
  background: var(--surface-muted);
}

.auth-panel {
  width: min(100%, 620px);
  padding: clamp(1.5rem, 4vw, 2.4rem);
  box-shadow: none;
}

.panel-heading {
  margin-bottom: 1.65rem;
}

.panel-heading h1,
.panel-heading h2 {
  margin-bottom: 0.65rem;
}

.panel-heading h1 {
  font-size: clamp(2rem, 5vw, 2.65rem);
}

.panel-heading p:last-child {
  margin-bottom: 0;
}

.form-stack {
  display: grid;
  gap: 1.1rem;
}

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

.field-row-connection {
  grid-template-columns: minmax(0, 1fr) minmax(210px, 0.32fr);
}

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

.field-group label,
.copy-label {
  display: inline-block;
  margin-bottom: 0.42rem;
  color: var(--ink-700);
  font-size: 0.82rem;
  font-weight: 750;
}

.field-group input,
.inline-form input {
  width: 100%;
  min-height: 46px;
  padding: 0.72rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-900);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.field-group input::placeholder,
.inline-form input::placeholder {
  color: #9aa8b9;
}

.field-group input:hover,
.inline-form input:hover {
  border-color: #aebfd2;
}

.field-group input:focus,
.inline-form input:focus {
  border-color: var(--blue-500);
  box-shadow: var(--focus);
  outline: 0;
}

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

.field-help {
  margin: 0.38rem 0 0;
  color: var(--ink-500);
  font-size: 0.75rem;
  line-height: 1.45;
}

.secret-field {
  position: relative;
}

.secret-field input {
  padding-right: 5.4rem;
}

.secret-toggle {
  position: absolute;
  top: 50%;
  right: 0.38rem;
  min-height: 34px;
  padding: 0.3rem 0.55rem;
  border-radius: 7px;
  background: transparent;
  color: var(--blue-700);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 750;
  transform: translateY(-50%);
}

.secret-toggle:hover {
  background: var(--blue-50);
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.66rem 1rem;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 780;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease,
    border-color 140ms ease, color 140ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

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

.button-primary {
  background: linear-gradient(180deg, var(--blue-600), #195dbb);
  color: #fff;
  box-shadow: 0 8px 18px rgba(29, 93, 186, 0.21);
}

.button-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #307fe0, #1854a7);
  box-shadow: 0 11px 22px rgba(29, 93, 186, 0.26);
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--navy-800);
}

.button-secondary:hover:not(:disabled),
.button-ghost:hover:not(:disabled) {
  border-color: #a9bdd3;
  background: var(--blue-50);
}

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

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

.button-danger-ghost {
  border-color: #f1c4cb;
  background: var(--danger-soft);
  color: #a62235;
}

.button-small {
  min-height: 36px;
  padding: 0.48rem 0.75rem;
  font-size: 0.74rem;
}

.button-wide {
  width: 100%;
}

.button.is-loading::before {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
  content: "";
}

.button-row {
  flex-wrap: wrap;
  gap: 0.7rem;
}

.button-row-end {
  justify-content: flex-end;
}

.form-message,
.connection-result,
.page-message {
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.5;
}

.form-message,
.connection-result {
  padding: 0.72rem 0.85rem;
}

.form-message-error,
.page-message-error {
  border: 1px solid #f3c6cd;
  background: var(--danger-soft);
  color: #96273a;
}

.connection-result {
  border: 1px solid #b9e7d7;
  background: var(--success-soft);
  color: #086c50;
}

.login-view {
  display: grid;
  width: min(100% - 2rem, 960px);
  min-height: 610px;
  grid-template-columns: minmax(280px, 0.8fr) minmax(400px, 1fr);
  align-items: center;
  margin: 2rem auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.login-aside {
  position: relative;
  display: grid;
  align-self: stretch;
  overflow: hidden;
  place-items: center;
  background:
    radial-gradient(circle at 28% 20%, rgba(74, 163, 255, 0.3), transparent 16rem),
    linear-gradient(150deg, var(--navy-950), var(--navy-800));
}

.login-monogram {
  position: relative;
  z-index: 2;
  display: grid;
  width: 118px;
  height: 118px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 36px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.23);
  font-size: 3.25rem;
  font-weight: 850;
  letter-spacing: -0.12em;
  backdrop-filter: blur(10px);
}

.login-orbit {
  position: absolute;
  border: 1px solid rgba(139, 197, 255, 0.16);
  border-radius: 50%;
}

.login-orbit-one {
  width: 320px;
  height: 320px;
}

.login-orbit-two {
  width: 470px;
  height: 470px;
}

.login-panel {
  width: min(100% - 3rem, 440px);
  justify-self: center;
  padding: 2rem;
  border: 0;
  box-shadow: none;
}

.badge {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.badge-neutral {
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--ink-600);
}

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

.badge-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.dashboard {
  width: min(100% - 2rem, 1240px);
  margin: 0 auto;
  padding: clamp(1.4rem, 4vw, 3rem) 0 4rem;
}

.dashboard-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.6rem;
}

.dashboard-heading h1 {
  margin-bottom: 0.5rem;
  font-size: clamp(2rem, 4vw, 2.85rem);
}

.dashboard-heading p:last-child {
  margin-bottom: 0;
}

.page-message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
}

.page-message p {
  margin: 0.2rem 0 0;
  color: inherit;
}

.overview-grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.overview-card {
  min-width: 0;
  padding: 1.15rem 1.2rem;
  border: 1px solid rgba(199, 213, 229, 0.82);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
}

.overview-card-primary {
  background:
    radial-gradient(circle at 100% 0, rgba(65, 156, 255, 0.22), transparent 9rem),
    linear-gradient(145deg, var(--navy-950), var(--navy-800));
  border-color: transparent;
}

.overview-card-primary h2,
.overview-card-primary .overview-label,
.overview-card-primary .overview-card-topline {
  color: #fff;
}

.overview-card-primary .overview-meta {
  color: #a9bfd6;
}

.overview-card-topline {
  gap: 0.45rem;
  margin-bottom: 1.3rem;
  color: var(--ink-600);
  font-size: 0.72rem;
  font-weight: 750;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #97a6b8;
  box-shadow: 0 0 0 4px rgba(151, 166, 184, 0.14);
}

.status-dot.is-connected {
  background: #4ddeae;
  box-shadow: 0 0 0 4px rgba(77, 222, 174, 0.15);
}

.status-dot.is-error {
  background: #ff7689;
  box-shadow: 0 0 0 4px rgba(255, 118, 137, 0.15);
}

.overview-card h2 {
  margin: 0 0 0.25rem;
  overflow: hidden;
  font-size: 1.35rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-meta {
  margin: 0;
  color: var(--ink-500);
  font-size: 0.75rem;
}

.copy-line-compact {
  min-height: 31px;
}

.copy-line-compact code {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--ink-900);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  padding: 0.25rem;
  border-radius: 6px;
  background: transparent;
  color: var(--blue-700);
  cursor: pointer;
  font-size: 0.65rem;
  font-weight: 800;
}

.icon-button:hover {
  background: var(--blue-50);
}

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

.dashboard-card {
  min-width: 0;
  padding: clamp(1.2rem, 3vw, 1.6rem);
}

.dashboard-card-wide {
  grid-column: 1 / -1;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.card-heading h2 {
  margin-bottom: 0.35rem;
}

.card-heading p:last-child {
  margin-bottom: 0;
  font-size: 0.82rem;
}

.card-heading-inline {
  align-items: center;
}

.card-kicker {
  margin-bottom: 0.34rem;
}

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

.timezone-field {
  min-width: 190px;
}

.projects-list,
.keys-list {
  display: grid;
  gap: 0.6rem;
}

.project-item,
.key-item {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.project-main,
.key-main {
  min-width: 0;
}

.project-name,
.key-name {
  display: block;
  overflow: hidden;
  color: var(--ink-900);
  font-size: 0.86rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-meta,
.key-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  margin-top: 0.2rem;
  color: var(--ink-500);
  font-size: 0.7rem;
}

.more-projects {
  margin: 0.25rem 0 0;
  color: var(--ink-500);
  font-size: 0.75rem;
  text-align: center;
}

.setup-steps {
  display: grid;
  gap: 0.85rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.setup-steps li {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: start;
  gap: 0.7rem;
  color: var(--ink-600);
  font-size: 0.83rem;
}

.setup-steps strong {
  color: var(--ink-900);
}

.step-number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  background: var(--blue-100);
  color: var(--blue-700);
  font-size: 0.7rem;
  font-weight: 850;
}

.copy-block {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.copy-block .copy-label {
  margin-bottom: 0.5rem;
}

.copy-line {
  min-width: 0;
  justify-content: space-between;
  gap: 0.7rem;
}

.copy-line code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--navy-800);
  font-weight: 700;
}

.security-note {
  margin: 0.9rem 0 0;
  padding-left: 0.8rem;
  border-left: 3px solid #f0b24e;
  color: var(--ink-500);
  font-size: 0.75rem;
}

.keys-heading {
  align-items: center;
}

.inline-form {
  min-width: min(100%, 390px);
  justify-content: flex-end;
  gap: 0.55rem;
}

.inline-form input {
  min-width: 0;
  flex: 1;
}

.key-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.55rem;
}

.empty-state {
  display: grid;
  min-height: 190px;
  place-items: center;
  align-content: center;
  padding: 1.4rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  text-align: center;
}

.empty-state h3 {
  margin-top: 0.65rem;
}

.empty-state p {
  max-width: 360px;
  margin-bottom: 0;
  font-size: 0.78rem;
}

.compact-empty-state {
  min-height: 150px;
}

.empty-state-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: var(--blue-100);
  color: var(--blue-700);
  font-size: 1.2rem;
  font-weight: 800;
}

.session-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(135deg, #f9fbfd, #f1f6fb);
}

.session-card h2 {
  margin-bottom: 0.3rem;
}

.session-card p:last-child {
  margin-bottom: 0;
  font-size: 0.8rem;
}

.modal {
  width: min(100% - 2rem, 570px);
  max-height: calc(100vh - 2rem);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  box-shadow: var(--shadow-lg);
}

.modal::backdrop {
  background: rgba(3, 15, 30, 0.7);
  backdrop-filter: blur(5px);
}

.modal-card {
  padding: clamp(1.5rem, 5vw, 2.35rem);
  background: var(--surface);
}

.modal-card h2 {
  font-size: 1.75rem;
}

.modal-card > p:not(.eyebrow) {
  font-size: 0.88rem;
}

.modal-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  place-items: center;
  border-radius: 15px;
  background: var(--blue-100);
  color: var(--blue-700);
  font-size: 0.83rem;
  font-weight: 900;
}

.modal-icon-warning {
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 1.1rem;
}

.secret-output {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  margin: 1.25rem 0 0.55rem;
  padding: 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--navy-950);
}

.secret-output code {
  min-width: 0;
  align-self: center;
  overflow-wrap: anywhere;
  color: #dcecff;
  font-size: 0.82rem;
  user-select: all;
}

.copy-status {
  min-height: 1.4rem;
  margin-bottom: 1rem;
  color: var(--success);
  font-size: 0.74rem;
}

.modal-small {
  max-width: 470px;
}

.toast-region {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1000;
  display: grid;
  width: min(calc(100% - 2rem), 390px);
  gap: 0.6rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(199, 213, 229, 0.8);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-lg);
  color: var(--ink-700);
  font-size: 0.8rem;
  pointer-events: auto;
  animation: toast-in 180ms ease-out;
}

.toast::before {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  content: "✓";
  font-size: 0.7rem;
  font-weight: 900;
}

.toast.toast-error::before {
  background: var(--danger-soft);
  color: var(--danger);
  content: "!";
}

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

.noscript-message {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  z-index: 2000;
  padding: 1rem;
  border-radius: 10px;
  background: var(--danger);
  color: #fff;
  text-align: center;
}

.sr-copy-buffer {
  position: fixed;
  top: -200vh;
  left: -200vw;
  width: 1px;
  height: 1px;
  opacity: 0;
}

@media (max-width: 1040px) {
  .auth-layout {
    grid-template-columns: 0.75fr 1.25fr;
  }

  .auth-intro {
    padding: 2.4rem;
  }

  .trust-list {
    margin-top: 2rem;
  }

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

@media (max-width: 820px) {
  .topbar {
    min-height: 64px;
  }

  .brand-caption {
    display: none;
  }

  .auth-layout {
    display: block;
    min-height: 0;
  }

  .auth-intro {
    min-height: 390px;
  }

  .intro-footnote {
    display: none;
  }

  .auth-panel-wrap {
    padding: 1.25rem;
  }

  .login-view {
    grid-template-columns: 0.55fr 1fr;
  }

  .login-monogram {
    width: 88px;
    height: 88px;
    border-radius: 27px;
    font-size: 2.5rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-card-wide {
    grid-column: auto;
  }

  .keys-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .inline-form {
    width: 100%;
    min-width: 0;
    justify-content: stretch;
  }
}

@media (max-width: 640px) {
  body {
    background: var(--page);
  }

  .topbar {
    padding-inline: 0.85rem;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .brand-name {
    font-size: 0.92rem;
  }

  .topbar-actions .badge {
    display: none;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
    padding-inline: 1rem;
  }

  .auth-layout,
  .login-view {
    width: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .auth-intro {
    min-height: 0;
    padding: 2.4rem 1.25rem;
  }

  .auth-intro h1 {
    font-size: 2.25rem;
  }

  .trust-list {
    display: none;
  }

  .auth-panel-wrap {
    padding: 1rem;
  }

  .auth-panel,
  .login-panel {
    width: 100%;
    padding: 1.25rem;
  }

  .login-view {
    display: block;
    min-height: 0;
    padding: 2rem 0 3rem;
  }

  .login-aside {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.5rem;
    border-radius: 22px;
  }

  .login-monogram {
    width: auto;
    height: auto;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 2rem;
  }

  .login-orbit {
    display: none;
  }

  .field-row,
  .field-row-connection {
    grid-template-columns: 1fr;
  }

  .dashboard {
    width: min(100% - 1rem, 1240px);
    padding-top: 1.25rem;
  }

  .dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .overview-card {
    padding: 1rem;
  }

  .overview-card-topline {
    margin-bottom: 0.9rem;
  }

  .dashboard-card {
    padding: 1rem;
  }

  .card-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .button-row .button {
    width: 100%;
  }

  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .project-item,
  .key-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .key-actions {
    width: 100%;
    justify-content: space-between;
  }

  .copy-line {
    align-items: stretch;
    flex-direction: column;
  }

  .copy-line-compact {
    align-items: center;
    flex-direction: row;
  }

  .session-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .secret-output {
    grid-template-columns: 1fr;
  }

  .page-message {
    align-items: flex-start;
    flex-direction: column;
  }

  .modal {
    width: calc(100% - 1rem);
    max-height: calc(100vh - 1rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: #9aaabf;
    --line-strong: #71849c;
  }

  .button,
  .field-group input,
  .inline-form input {
    border-width: 2px;
  }
}
