
  #cortex-gate {
    position: fixed; inset: 0; z-index: 999999;
    background: #F5F1EB; color: #1F1E1D;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    display: flex; align-items: center; justify-content: center;
    letter-spacing: -0.005em;
  }
  #cortex-gate.ok { display: none; }
  .cortex-gate-card {
    width: min(92vw, 440px);
    background: #FFFFFF; border: 1px solid #D2CCC0; border-radius: 14px;
    padding: 38px 38px 30px; box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  }
  .cortex-gate-logo {
    display: flex; align-items: center; gap: 10px; margin-bottom: 22px;
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
    letter-spacing: 0.12em; text-transform: uppercase; color: #6B6762;
  }
  .cortex-gate-logo svg { width: 18px; height: 18px; }
  .cortex-gate-title {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 34px; line-height: 1.05; margin-bottom: 6px; color: #1F1E1D;
  }
  .cortex-gate-sub {
    font-size: 13px; color: #6B6762; line-height: 1.5; margin-bottom: 22px;
  }
  #cortex-gate-email,
  #cortex-gate-password {
    width: 100%; padding: 12px 14px; font-size: 15px;
    border: 1px solid #D2CCC0; border-radius: 8px;
    background: #FAF7F1; color: #1F1E1D; outline: none; margin-bottom: 10px;
    font-family: 'JetBrains Mono', monospace; letter-spacing: 0.02em;
    box-sizing: border-box;
  }
  #cortex-gate-password { margin-bottom: 0; padding-right: 42px; }
  #cortex-gate-email:focus,
  #cortex-gate-password:focus { border-color: #1F1E1D; background: #FFFFFF; }
  /* Password input + eye toggle */
  .cortex-gate-password-wrap {
    position: relative; margin-bottom: 14px;
  }
  .cortex-gate-eye {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 32px; height: 32px;
    background: transparent; border: none; padding: 0;
    color: #6B6762; cursor: pointer; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    transition: color 0.15s ease, background 0.15s ease;
  }
  .cortex-gate-eye:hover { color: #1F1E1D; background: rgba(31,30,29,0.06); }
  .cortex-gate-eye:focus { outline: none; color: #1F1E1D; }
  /* "Forgot? magic link" tertiary fallback below the primary sign-in button */
  .cortex-gate-fallback {
    margin-top: 12px; text-align: center;
    font-size: 12px; color: #6B6762;
  }
  .cortex-gate-fallback a {
    color: #1F1E1D; text-decoration: underline; text-underline-offset: 2px;
    cursor: pointer;
  }
  .cortex-gate-fallback a:hover { color: #B85C3E; }
  #cortex-gate-btn {
    width: 100%; padding: 11px 14px; font-size: 12px;
    font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    background: #1F1E1D; color: #F5F1EB; border: none; border-radius: 999px;
    cursor: pointer; transition: background 0.15s ease;
  }
  #cortex-gate-btn:hover:not(:disabled) { background: #000; }
  #cortex-gate-btn:disabled { opacity: 0.5; cursor: not-allowed; }
  /* OAuth buttons (Google + Microsoft) */
  .cortex-oauth-btn {
    width: 100%; padding: 11px 14px;
    background: #FFFFFF; color: #1F1E1D;
    border: 1px solid #D2CCC0; border-radius: 999px;
    font-size: 13px; font-weight: 500; font-family: 'Inter', system-ui, sans-serif;
    cursor: pointer; transition: all 0.15s ease;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-bottom: 8px;
  }
  .cortex-oauth-btn:hover { background: #F5F1EB; border-color: #1F1E1D; }
  .cortex-oauth-btn:disabled { opacity: 0.5; cursor: not-allowed; }
  .cortex-oauth-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
  /* Divider between OAuth and email */
  .cortex-oauth-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 14px 0 14px;
    font-size: 10px; font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.10em; text-transform: uppercase;
    color: #B0AAA0;
  }
  .cortex-oauth-divider::before,
  .cortex-oauth-divider::after {
    content: ''; flex: 1; height: 1px; background: #E5DFD2;
  }
  #cortex-gate-err {
    color: #B85C3E; font-size: 12px; margin-top: 10px; min-height: 16px;
    font-family: 'JetBrains Mono', monospace;
  }
  .cortex-gate-success { padding: 14px 0 4px; text-align: center; }
  .cortex-gate-success .checkmark {
    width: 48px; height: 48px; margin: 0 auto 14px;
    border-radius: 50%; background: rgba(135,158,107,0.15);
    color: #5A6E47; font-size: 24px; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
  }
  .cortex-gate-success .title {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 22px; line-height: 1.2; color: #1F1E1D; margin-bottom: 8px;
  }
  .cortex-gate-success .body {
    font-size: 13px; color: #6B6762; line-height: 1.6;
  }
  .cortex-gate-success .body b { color: #1F1E1D; word-break: break-all; }
  #cortex-gate-resend {
    margin-top: 14px; width: 100%; padding: 8px 10px;
    background: transparent; color: #6B6762; border: none;
    font-size: 11px; font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.06em; text-transform: uppercase;
    cursor: pointer; border-radius: 4px;
  }
  #cortex-gate-resend:hover { color: #1F1E1D; background: rgba(0,0,0,0.03); }
  #cortex-gate-loading {
    text-align: center; padding: 28px 0 8px;
    color: #6B6762; font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.10em; text-transform: uppercase;
  }
