:root {
  --ink: #1d2129;
  --muted: #4e5969;
  --line: #e5e6eb;
  --paper: #ffffff;
  --wash: #f2f3f5;
  --adccp: #0d4f7c;
  --navy: #0d4f7c;
}

html, body {
  background: #f2f3f5;
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.app-bar {
  display: none;
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  height: 58px;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  background: #0d4f7c;
  color: #fff;
}
html.is-authed .app-bar { display: flex; }
.app-brand { display: flex; flex-direction: column; line-height: 1.15; }
.app-brand strong { font-size: 16px; font-weight: 700; }
.app-brand small { margin-top: 2px; color: rgba(255, 255, 255, .78); font-size: 11px; }
.app-bar-actions { display: flex; align-items: center; gap: 8px; }
.session-pill, .app-bar-actions button {
  height: 30px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 13px;
}
.session-pill { display: inline-flex; align-items: center; padding: 0 10px; }
.app-bar-actions button { padding: 0 12px; cursor: pointer; }
.app-bar-actions button:hover { background: rgba(255, 255, 255, .12); }

html.is-authed .deck {
  top: calc(50% + 29px);
  width: min(100vw, calc((100vh - 74px) * 16 / 9));
  height: min(calc(100vh - 74px), calc(100vw * 9 / 16));
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
}
.slide::before { background: #0d4f7c; }
.deck-controls { background: #0d4f7c; }
.progress-track i { background: #9fd0ea; }
.button { border-radius: 12px; }
.button--primary {
  border-color: #0d4f7c;
  background: #0d4f7c;
  box-shadow: 0 2px 8px rgba(13, 79, 124, .22);
}
.button--ghost {
  border-color: #e5e6eb;
  background: #f7f8fa;
  color: #0d4f7c;
}
input, select {
  border-color: #e5e6eb;
  border-radius: 10px;
  background: #fafbfc;
}
.predictor-form, .predictor-results, .predictor-group, .endpoint-result, .figure-card, .endpoint-card, .metric-card, .delta-card {
  border-color: #e5e6eb;
  border-radius: 14px;
}
.tab.is-selected { background: #0d4f7c; }

.login-gate {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(165deg, #dbe8f5 0%, #f2f4f8 45%, #e8f2fa 100%);
}
html.is-authed .login-gate { display: none; }
.login-card {
  width: min(420px, calc(100vw - 32px));
  padding: 36px 32px 28px;
  border: 1px solid #e5e6eb;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .1);
  text-align: center;
}
.login-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: 12px;
  background: #0d4f7c;
  color: #fff;
}
.login-card h1, .login-card h2 {
  margin: 0 0 8px;
  color: #1d2129;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
}
.login-card p { margin: 0; color: #86909c; font-size: 13px; }
.login-en { margin-top: 4px !important; font-size: 12px !important; }
.login-card form { margin-top: 22px; text-align: left; }
.login-card label {
  display: block;
  margin-bottom: 14px;
  color: #1d2129;
  font-size: 14px;
  font-weight: 600;
}
.login-card input {
  height: 44px;
  margin-top: 8px;
  padding: 0 14px;
  border: 1px solid #e5e6eb;
  border-radius: 12px;
  background: #fafbfc;
  font-size: 14px;
  font-weight: 400;
}
.login-submit, .login-back {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .35em;
  cursor: pointer;
}
.login-submit {
  margin-top: 6px;
  background: #0d4f7c;
  color: #fff;
  box-shadow: 0 2px 10px rgba(13, 79, 124, .28);
}
.login-submit:disabled { opacity: .7; cursor: wait; }
.login-back {
  margin-top: 10px;
  border: 1px solid #e5e6eb;
  background: #f7f8fa;
  color: #4e5969;
  letter-spacing: .12em;
}
.login-secondary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.login-secondary button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  border: 1px solid #e5e6eb;
  border-radius: 12px;
  background: #f7f8fa;
  color: #0d4f7c;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.login-secondary button:hover, .login-back:hover { background: #eef3f8; }
.login-error, .login-ok { margin: 0 0 10px !important; font-size: 13px !important; text-align: center; }
.login-error { color: #cb3a31 !important; }
.login-ok { color: #0d4f7c !important; }
.login-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px;
  background: rgba(255, 255, 255, .72);
  color: #86909c;
  font-size: 12px;
  text-align: center;
}
