:root {
  color-scheme: light;
  --bg: #eef2f5;
  --panel: #ffffff;
  --text: #172033;
  --muted: #657089;
  --line: #dce3ef;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --blue: #2563eb;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

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

.topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: #07101f;
  color: #fff;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-lockup img {
  width: 48px;
  height: 48px;
  border-radius: 7px;
  object-fit: cover;
  object-position: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.brand-lockup strong {
  display: block;
  font-size: 1.02rem;
}

.brand-lockup span,
.status-line {
  color: var(--muted);
  font-size: 0.9rem;
}

.brand-lockup span {
  color: #b9c7da;
}

main {
  width: min(1100px, calc(100% - 32px));
  margin: 24px auto 42px;
}

.login-panel,
.workspace {
  width: 100%;
}

.login-panel {
  min-height: calc(100svh - 150px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 28px;
  align-items: center;
}

.login-copy p,
.heading p {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.login-copy h1,
.heading h1,
.heading h2 {
  margin: 0;
  line-height: 1.15;
}

.login-copy h1 {
  max-width: 620px;
  font-size: clamp(2rem, 5vw, 4rem);
}

.login-copy span {
  display: block;
  max-width: 520px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.auth-form,
.panel,
.result,
.activity {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 18px 44px rgba(17, 27, 45, 0.1);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 22px;
  align-items: start;
}

.side-stack {
  display: grid;
  gap: 18px;
}

.heading {
  margin-bottom: 24px;
}

.heading.compact {
  margin-bottom: 14px;
}

.heading h1 {
  font-size: 2rem;
}

.heading h2 {
  font-size: 1.2rem;
}

form {
  display: grid;
  gap: 18px;
}

label,
fieldset {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 13px;
  color: var(--text);
  font-weight: 400;
  background: white;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  outline-offset: 1px;
  border-color: var(--accent);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

legend {
  padding: 0 6px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 400;
}

.choice input {
  width: auto;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: var(--accent-dark);
}

button:disabled {
  opacity: 0.65;
  cursor: wait;
}

button.secondary {
  background: var(--blue);
  box-shadow: none;
}

button.ghost {
  min-height: 34px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.session-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #d7e2ef;
}

.key {
  display: inline-block;
  max-width: 100%;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7fbff;
  font-family: Consolas, Monaco, monospace;
  font-size: 1.05rem;
  color: #075fc2;
  word-break: break-word;
}

.result h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.result p {
  color: var(--muted);
  line-height: 1.45;
}

.links {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.links a {
  color: var(--accent-dark);
  font-weight: 800;
}

.audit-list {
  display: grid;
  gap: 10px;
}

.audit-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
}

.audit-item span,
.audit-item small {
  color: var(--muted);
}

.audit-item small {
  font-size: 0.78rem;
}

.audit-item.muted {
  background: #f8fafc;
}

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

[hidden] {
  display: none !important;
}

@media (max-width: 860px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .session-pill {
    justify-content: space-between;
  }

  .login-panel,
  .workspace,
  .grid {
    grid-template-columns: 1fr;
  }

  .login-panel {
    min-height: 0;
    align-items: start;
  }
}
