:root {
  color-scheme: light;
  --ink: #18201e;
  --muted: #68716d;
  --paper: #f2f3ee;
  --paper-deep: #e8eae3;
  --card: #fbfcf7;
  --line: #ccd1c7;
  --line-strong: #aab2a6;
  --accent: #c7f249;
  --accent-dark: #465d12;
  --danger: #b84d3a;
  --warning: #d68b2d;
  --shadow: rgba(24, 32, 30, 0.12);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  padding: 0 4vw;
}

.topbar,
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.topbar {
  min-height: 82px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.13em;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-decoration: none;
}

.wordmark-mark {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--ink);
  background: var(--accent);
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 15px;
  letter-spacing: 0;
}

.topbar-meta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.topbar-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(199, 242, 73, 0.28);
}

main {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.view {
  padding: clamp(56px, 8vw, 112px) 0 72px;
}

.intro-copy,
.auth-header {
  max-width: 760px;
}

.kicker,
.aside-label,
.card-topline,
.source-row,
.footer,
.metric-label,
.state-label,
.draft-note {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  line-height: 1.4;
  text-transform: uppercase;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0 0 26px;
  color: var(--muted);
}

.kicker span {
  display: inline-grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 9px;
  letter-spacing: 0;
}

h1 {
  max-width: 720px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 7.2vw, 96px);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.95;
}

h1 em {
  color: var(--accent-dark);
  font-style: normal;
}

.lede {
  max-width: 585px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 1.55vw, 18px);
  letter-spacing: -0.01em;
  line-height: 1.55;
}

.login-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.65fr);
  gap: clamp(28px, 7vw, 110px);
  align-items: start;
  margin-top: clamp(48px, 7vw, 88px);
}

.card {
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 12px 12px 0 var(--shadow);
}

.login-card {
  max-width: 540px;
  padding: clamp(24px, 4vw, 42px);
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 19px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
}

.status-banner {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  margin: 23px 0 28px;
  padding: 14px;
  border: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.45;
}

.status-banner strong,
.status-banner span span {
  display: block;
}

.status-banner strong {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 12px;
}

.status-banner span span {
  color: var(--muted);
}

.status-banner-neutral {
  background: #f1f3e9;
}

.status-banner-warning {
  border-color: #dfc79a;
  background: #fff8e7;
}

.status-icon {
  display: grid !important;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--accent-dark) !important;
  font-family: Georgia, serif;
  font-size: 13px;
  line-height: 1;
}

.field-row {
  margin-top: 19px;
}

.field-row label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.field-row input {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 13px 14px;
  background: #f0f2ec;
  color: var(--ink);
  font-size: 15px;
  outline: 0;
}

.field-row input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(199, 242, 73, 0.58);
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 15px;
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 11px 17px;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.02em;
  transition: transform 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.button:hover:not(:disabled) {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--ink);
}

.button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.button-primary {
  background: var(--ink);
  color: #f9fbf4;
}

.button-primary:hover:not(:disabled) {
  background: #29332f;
}

.button-secondary {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
}

.button-quiet {
  min-height: 38px;
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
}

.button-small {
  min-height: 35px;
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.button-arrow {
  color: var(--accent);
  font-size: 17px;
  line-height: 1;
}

#login-button {
  width: 100%;
  margin-top: 28px;
}

.micro-note {
  margin: 19px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.form-message {
  margin: 15px 0 0;
  color: var(--danger);
  font-size: 12px;
}

.login-aside {
  max-width: 330px;
  padding-top: 13px;
}

.aside-rule {
  width: 72px;
  height: 4px;
  margin-bottom: 23px;
  background: var(--accent);
}

.aside-label {
  margin: 0 0 15px;
  color: var(--muted);
}

.aside-copy {
  max-width: 295px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.mini-list {
  margin: 43px 0 0;
}

.mini-list > div {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

.mini-list dt {
  color: var(--accent-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
}

.mini-list dd {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.source-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px 25px;
  margin-top: clamp(46px, 8vw, 94px);
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.source-row a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.source-row a span {
  color: var(--accent-dark);
  font-size: 14px;
  text-decoration: none;
}

.auth-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  max-width: none;
}

.auth-header h1 {
  font-size: clamp(52px, 7vw, 88px);
}

.auth-actions {
  padding-bottom: 8px;
}

.session-state {
  display: grid;
  grid-template-columns: 33px 1fr auto;
  gap: 16px;
  align-items: center;
  margin-top: 54px;
  padding: 19px 21px;
  border: 1px solid var(--line);
  background: #f6f8ef;
}

.session-state-confirmed {
  border-color: #b1c878;
  background: #eef6d9;
}

.session-state-fallback {
  border-color: #dfc79a;
  background: #fff8e7;
}

.session-state-error {
  border-color: #d89c91;
  background: #fff0ed;
}

.state-mark {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--accent-dark);
}

.state-mark span {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.session-state-pending .state-mark span {
  animation: blink 1.1s ease-in-out infinite;
}

.session-state-fallback .state-mark,
.session-state-error .state-mark {
  color: var(--warning);
}

.state-label {
  margin: 0 0 3px;
  color: var(--muted);
}

.state-title {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.state-copy {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.loading-dots {
  display: inline-block;
  width: 18px;
  overflow: hidden;
  vertical-align: bottom;
  animation: dots 1.1s steps(3, end) infinite;
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 27px;
  margin-top: 27px;
}

.session-card,
.explainer-card,
.inspect-card,
.timeline-card {
  padding: clamp(23px, 3.3vw, 36px);
  box-shadow: none;
}

.badge {
  display: inline-block;
  padding: 5px 8px;
  border: 1px solid currentColor;
  font-size: 9px;
  line-height: 1;
}

.badge-pending {
  color: var(--warning);
}

.badge-active {
  background: var(--accent);
  color: var(--accent-dark);
}

.badge-fallback {
  color: var(--warning);
}

.session-id-block {
  padding: 29px 0 26px;
  border-bottom: 1px solid var(--line);
}

.metric-label {
  display: block;
  color: var(--muted);
}

.session-id-block code {
  display: block;
  margin-top: 10px;
  overflow: hidden;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.metric {
  min-height: 79px;
  padding: 19px 14px 13px 0;
  border-bottom: 1px solid var(--line);
}

.metric:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.metric:nth-child(even) {
  padding-left: 14px;
}

.metric strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

.button-stack {
  display: grid;
  gap: 9px;
  margin-top: 27px;
}

.button-stack .button {
  width: 100%;
}

.request-result {
  min-height: 20px;
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.request-result.success {
  color: var(--accent-dark);
}

.request-result.failure {
  color: var(--danger);
}

.explainer-copy {
  padding-top: 25px;
}

.explainer-copy p {
  margin: 0;
  padding: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.58;
}

.explainer-copy strong {
  color: var(--ink);
}

.explainer-copy .callout {
  margin-top: 4px;
  border-left: 3px solid var(--accent);
  padding: 12px 0 12px 16px;
  color: var(--ink);
  font-size: 12px;
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 27px;
  margin-top: 27px;
}

.inspect-list {
  display: grid;
  gap: 0;
  margin: 23px 0 0;
  padding: 0;
  list-style: none;
}

.inspect-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.inspect-list li span {
  color: var(--accent-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
}

.inspect-list p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.inspect-list strong {
  color: var(--ink);
}

.timeline {
  min-height: 263px;
  margin-top: 21px;
}

.timeline-empty {
  margin: 0;
  padding-top: 26px;
  color: var(--muted);
  font-size: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item::before {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-dark);
  content: "";
}

.timeline-item span {
  color: var(--ink);
  font-size: 12px;
}

.timeline-item time {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
}

.timeline-footnote {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.draft-note {
  margin: 35px 0 0;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.draft-note span {
  margin-right: 5px;
  color: var(--accent-dark);
  font-size: 15px;
  letter-spacing: 0;
}

.footer {
  min-height: 83px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

@keyframes blink {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

@keyframes dots {
  0% {
    width: 0;
  }
  33% {
    width: 6px;
  }
  66% {
    width: 12px;
  }
  100% {
    width: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 0 20px;
  }

  .topbar {
    min-height: 69px;
  }

  .topbar-meta {
    max-width: 145px;
    text-align: right;
  }

  .view {
    padding: 55px 0 58px;
  }

  h1 {
    font-size: clamp(45px, 14vw, 68px);
  }

  .login-grid,
  .auth-grid,
  .lower-grid {
    grid-template-columns: 1fr;
  }

  .login-card {
    max-width: none;
  }

  .login-aside {
    max-width: none;
  }

  .aside-copy {
    max-width: 420px;
  }

  .source-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .auth-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-actions {
    padding-bottom: 0;
  }

  .session-state {
    grid-template-columns: 33px 1fr;
  }

  .session-state .button {
    grid-column: 2;
    justify-self: start;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
    justify-content: center;
    padding: 20px 0;
  }
}

@media (max-width: 420px) {
  .topbar-meta {
    max-width: 90px;
    font-size: 8px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metric,
  .metric:nth-child(even) {
    border-right: 0;
    padding-left: 0;
  }
}
