html,
body {
  height: 100%;
  margin: 0;
  background: var(--bg-base);
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

/* The original computes this width in JS:
   min(innerHeight * 16 / 9, innerWidth - 520). */
#loginMedia {
  flex: 0 0 auto;
  width: min(calc(100vh * 16 / 9), calc(100vw - 520px));
}

.login-column {
  max-width: 420px;
}

.login-column h1 {
  margin: 0;
}

.login-header {
  margin-bottom: 44px;
}

/* GitHub OAuth entry, styled after the supplied reference. */
.github-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2328;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.github-login-btn:hover {
  background: #f3f4f6;
  border-color: #1f2328;
  color: #1f2328;
}

.github-login-btn:active {
  transform: translateY(1px);
}

.github-login-btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.github-login-btn svg {
  flex: 0 0 auto;
}

.github-account {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--stroke-regular);
  border-radius: 12px;
  background: var(--bg-surface);
}

.github-avatar {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-light);
  object-fit: cover;
}

.github-account-info {
  flex: 1;
  min-width: 0;
}

.github-account-name {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.github-account-login {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 20px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.github-account-login:hover {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.github-logout {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--stroke-bold);
  border-radius: 9999px;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  line-height: 30px;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.github-logout:hover {
  background: var(--button-hover-bg);
}

.github-logout:disabled {
  cursor: default;
  opacity: 0.6;
}

.github-logout:focus-visible {
  outline: 2px solid rgba(250, 250, 250, 0.6);
  outline-offset: 2px;
}

@media (max-width: 599px) {
  body {
    overflow-y: auto;
  }

  #authShell {
    flex-direction: column;
    overflow-y: auto;
  }

  #loginMedia {
    display: none;
  }

  #loginPanel {
    padding: 32px 24px;
  }

  .login-column {
    max-width: 100%;
  }

  .login-header {
    margin-bottom: 32px;
  }
}

.demo-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 1100;
  max-width: min(560px, calc(100vw - 40px));
  padding: 9px 16px;
  border-radius: 9999px;
  background: var(--toast-bg, #fff);
  color: var(--toast-text, #0a0a0a);
  font-size: 13px;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.demo-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 599px) {
  .demo-toast {
    bottom: 20px;
  }
}

/* ------------------------------------------------------------------ dashboard */
html.dashboard-html,
html.dashboard-html body {
  height: auto;
  min-height: 100%;
  overflow-y: auto;
}

.dashboard-body {
  min-height: 100vh;
  padding: 32px 20px;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 140, 100, 0.12), transparent 36%),
    radial-gradient(circle at 82% 18%, rgba(120, 150, 255, 0.1), transparent 40%),
    var(--bg-base);
}

.dashboard-shell {
  width: min(760px, 100%);
  margin: 0 auto;
}

.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.dashboard-brand {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.dashboard-card {
  padding: 32px;
  border: 1px solid var(--stroke-regular);
  border-radius: 20px;
  background: rgba(20, 20, 20, 0.72);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.dashboard-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dashboard-avatar {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border: 1px solid var(--stroke-regular);
  border-radius: 50%;
  background: var(--bg-light);
  object-fit: cover;
}

.dashboard-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-size: 28px;
  font-weight: 600;
}

.dashboard-eyebrow {
  margin: 0 0 6px;
  color: var(--text-secondary);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.dashboard-title {
  margin: 0;
  color: var(--text-primary);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.25;
}

.dashboard-profile {
  display: inline-block;
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  text-decoration: none;
}

.dashboard-profile:hover {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dashboard-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--stroke-regular);
}

.dashboard-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.dashboard-section-heading h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
}

.dashboard-section-heading span {
  color: var(--text-secondary);
  font-size: 12px;
}

.dashboard-app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-app {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 116px;
  padding: 16px;
  border: 1px dashed var(--stroke-regular);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.dashboard-app-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-light);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}

.dashboard-app strong {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
}

.dashboard-app small {
  color: var(--text-secondary);
  font-size: 12px;
}

.dashboard-app-status {
  margin-top: auto;
  color: var(--text-secondary);
  font-size: 11px;
}

.dashboard-note {
  margin: 20px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}

.dashboard-status {
  min-height: 20px;
  margin: 12px 0 0;
  color: #ffb4b4;
  font-size: 13px;
  line-height: 20px;
  text-align: center;
}

@media (max-width: 720px) {
  .dashboard-body {
    padding: 20px 16px;
  }

  .dashboard-card {
    padding: 22px;
  }

  .dashboard-title {
    font-size: 24px;
  }

  .dashboard-app-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-user {
    align-items: flex-start;
  }
}
