@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/SpaceGrotesk-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/SpaceGrotesk-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/SpaceGrotesk-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --rs-orange: #ff4506;
  --rs-orange-dark: #cc3605;
  --rs-blue: #2961d0;
  --rs-yellow: #f5c142;
  --rs-green: #507c20;
  --ink: #121212;
  --ink-soft: #585654;
  --ink-muted: #77736f;
  --paper: #f8f5f1;
  --surface: #ffffff;
  --surface-soft: #efeae2;
  --line: #cbc8c2;
  --line-strong: #888682;
  --danger: #a63214;
  --danger-soft: #fff0ee;
  --warning: #705300;
  --warning-soft: #fff4cc;
  --success: #3f6915;
  --success-soft: #edf5e6;
  --radius: 14px;
  --font-sans: "Space Grotesk", "M PLUS 1p", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
}

* {
  scrollbar-color: var(--line-strong) var(--paper);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--paper);
}

::-webkit-scrollbar-thumb {
  border: 3px solid var(--paper);
  border-radius: 999px;
  background: var(--line-strong);
}

::selection {
  background: var(--rs-orange);
  color: var(--ink);
}

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

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

button {
  font: inherit;
}

a {
  color: var(--ink);
  font-weight: 700;
  text-decoration-color: var(--rs-orange);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--rs-orange-dark);
}

.shell {
  width: min(100%, 1440px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 64px) 72px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  border-bottom: 1px solid var(--line);
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  font-size: 1.08rem;
  letter-spacing: -0.035em;
  text-decoration: none;
}

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

.brand img {
  width: 41px;
  height: auto;
}

.brand b {
  color: var(--rs-orange);
  font-weight: 700;
}

.account-actions,
.dashboard-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.identity {
  max-width: 250px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 10px 15px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
  line-height: 1.1;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

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

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

.button:disabled {
  cursor: progress;
  opacity: 0.62;
}

.button.primary {
  min-width: 202px;
  background: var(--rs-orange);
  border-color: var(--rs-orange);
}

.button.primary:hover:not(:disabled) {
  background: var(--rs-orange-dark);
  border-color: var(--rs-orange-dark);
  color: var(--surface);
}

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

.button.secondary:hover:not(:disabled) {
  background: var(--surface-soft);
  border-color: var(--line-strong);
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.82fr);
  align-items: center;
  min-height: calc(100vh - 160px);
  gap: clamp(44px, 10vw, 160px);
  padding: clamp(64px, 11vh, 132px) 0;
}

.login-copy {
  max-width: 640px;
}

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

h1,
h2,
h3,
h4 {
  color: var(--ink);
  letter-spacing: -0.04em;
}

h1 {
  max-width: 11ch;
  margin-bottom: 22px;
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 0.92;
}

h2 {
  margin-bottom: 12px;
  font-size: 1.5rem;
  line-height: 1.05;
}

p {
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.58;
}

.login-copy > p {
  max-width: 55ch;
  margin-bottom: 30px;
  font-size: 1.1rem;
}

.scope-list {
  display: grid;
  gap: 10px;
  max-width: 410px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 500;
}

.scope-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.scope-list li::before {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  background: var(--rs-orange);
  content: "";
}

.sign-in-card {
  padding: clamp(28px, 4vw, 42px);
  background: var(--ink);
  color: var(--surface);
  border-radius: var(--radius);
}

.sign-in-card h2 {
  color: var(--surface);
}

.sign-in-card p {
  color: #d5d0c9;
}

.sign-in-card code {
  color: var(--surface);
  font-family: inherit;
  font-weight: 700;
}

.sign-in-card .button {
  width: 100%;
  margin-top: 18px;
}

.error-message {
  min-height: 1.5em;
  margin: 16px 0 0;
  color: #ffd0c5 !important;
}

#dashboard {
  padding-top: clamp(52px, 8vw, 96px);
}

.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 30px;
}

.dashboard-heading h1 {
  max-width: none;
  margin-bottom: 12px;
  font-size: clamp(2.35rem, 5vw, 4.4rem);
  line-height: 0.95;
}

.dashboard-heading p {
  max-width: 50ch;
  margin-bottom: 0;
}

.dashboard-actions {
  justify-content: flex-end;
  padding-bottom: 4px;
}

.updated {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.79rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 0 34px;
  padding: 0;
  overflow: hidden;
  background: var(--ink);
  border-radius: var(--radius);
  list-style: none;
}

.summary-item {
  display: grid;
  gap: 4px;
  min-height: 102px;
  align-content: center;
  padding: 22px 26px;
  color: #d5d0c9;
  border-right: 1px solid #3b3a38;
}

.summary-item:last-child {
  border-right: 0;
}

.summary-item strong {
  color: var(--surface);
  font-size: 1.72rem;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.summary-item span {
  font-size: 0.8rem;
}

.summary-item.healthy strong {
  color: #9fcf6a;
}

.summary-item.warning strong {
  color: #ffd462;
}

.summary-item.unknown strong {
  color: #d5d0c9;
}

.notice {
  margin: 0 0 24px;
  padding: 15px 18px;
  color: var(--warning);
  background: var(--warning-soft);
  border: 1px solid #ddc669;
  border-radius: 10px;
  line-height: 1.45;
}

.clients {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.client {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.client-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 94px;
  padding: 24px 26px 21px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}

.client-title h3 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.05;
}

.repo,
.environment-project {
  display: block;
  margin-top: 7px;
  overflow-wrap: anywhere;
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.environment {
  padding: 20px 26px 22px;
}

.environment + .environment {
  border-top: 1px solid var(--line);
}

.environment-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.environment-title h4 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.1;
  text-transform: capitalize;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 5px 8px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

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

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

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

.badge.unknown {
  color: var(--ink-soft);
  background: var(--surface-soft);
}

.details {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 8px 14px;
  margin: 21px 0 16px;
  font-size: 0.84rem;
  line-height: 1.35;
}

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

.details dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.deployment-link {
  display: inline-block;
  font-size: 0.84rem;
}

.function-list {
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.45;
}

.api-key-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.api-key-list li {
  padding: 5px 7px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border-radius: 5px;
  font-size: 0.74rem;
}

.api-key-list li.healthy {
  color: var(--success);
  background: var(--success-soft);
}

.api-key-list li.warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.api-key-list li.error {
  color: var(--danger);
  background: var(--danger-soft);
}

.client-notice {
  margin: 0;
  border-width: 1px 0 0;
  border-radius: 0;
}

.footnote {
  max-width: 74ch;
  margin: 28px 0 0;
  color: var(--ink-muted);
  font-size: 0.8rem;
}

@media (max-width: 900px) {
  .login-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .login-copy {
    max-width: 720px;
  }

  .sign-in-card {
    max-width: 520px;
  }

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

  .dashboard-actions {
    justify-content: flex-start;
  }

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

@media (max-width: 620px) {
  .shell {
    padding-right: 18px;
    padding-left: 18px;
  }

  .topbar {
    min-height: 72px;
  }

  .brand {
    gap: 10px;
    font-size: 1rem;
  }

  .brand img {
    width: 34px;
  }

  .identity {
    display: none;
  }

  .button {
    min-height: 40px;
    padding: 9px 12px;
  }

  .login-layout {
    gap: 40px;
    padding: 62px 0;
  }

  h1 {
    font-size: clamp(2.75rem, 16vw, 4.5rem);
  }

  .dashboard-heading h1 {
    font-size: clamp(2.5rem, 13vw, 3.6rem);
  }

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

  .summary-item {
    min-height: 88px;
    padding: 18px;
    border-bottom: 1px solid #3b3a38;
  }

  .summary-item:nth-child(2n) {
    border-right: 0;
  }

  .summary-item:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .dashboard-actions {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
  }

  .environment,
  .client-head {
    padding-right: 20px;
    padding-left: 20px;
  }

  .environment-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .details {
    grid-template-columns: 72px minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
