:root {
  color-scheme: dark;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at top, #1b1b1b 0%, #0b0b0b 55%, #060606 100%);
  color: #f4f4f4;
  overflow: hidden;
}

.page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 24px 12px;
  box-sizing: border-box;
}

.page-header {
  text-align: center;
}

.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-header-row h1,
.page-header-row p {
  text-align: left;
}

.page-header h1 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-header p {
  margin: 0;
  color: #9fb9c3;
  font-size: 0.95rem;
}

.header-signout {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(16, 16, 16, 0.8);
  color: #f4f4f4;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease;
}

.header-signout:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.32);
}

.chart-shell {
  flex: 1;
  min-height: 0;
  background: rgba(12, 12, 12, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4);
}

.chart {
  width: 100%;
  height: 100%;
  margin: 0 auto;
  background-color: rgb(33, 33, 33);
  color: #fff;
  border-radius: 12px;
}

.footer {
  padding: 0 6px 6px;
  font-size: 0.85rem;
  color: #9fb9c3;
}

.footer-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
}

.access-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(168, 240, 184, 0.12);
  border: 1px solid rgba(168, 240, 184, 0.4);
  color: #c9f7d1;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 6, 6, 0.92);
  backdrop-filter: blur(6px);
  z-index: 20;
}

.auth-card {
  width: min(420px, 90vw);
  background: rgba(12, 12, 12, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.auth-card h2 {
  margin: 0 0 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 1.1rem;
}

.auth-card p {
  margin: 0 0 16px;
  color: #9fb9c3;
  font-size: 0.95rem;
}

.auth-detail {
  margin: 0 0 16px;
  color: #ffb6a0;
  font-size: 0.9rem;
}

.auth-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(148, 196, 255, 0.1);
  border: 1px solid rgba(148, 196, 255, 0.35);
  color: #b8d7ff;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  background: #f4f4f4;
  color: #111;
}

.auth-link {
  background: transparent;
  border: 0;
  color: #9fb9c3;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: underline;
}

.auth-message {
  min-height: 1.2em;
  color: #ffb6a0;
  font-size: 0.9rem;
}

.is-hidden {
  display: none !important;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(24, 24, 24, 0.95);
  color: #ffb6a0;
  border: 1px solid rgba(255, 182, 160, 0.35);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  max-width: 90vw;
  z-index: 10;
  opacity: 0;
  transition: opacity 220ms ease, transform 220ms ease;
}

.toast.success {
  color: #c9f7d1;
  border-color: rgba(168, 240, 184, 0.4);
  background: rgba(16, 32, 20, 0.95);
}

.toast.show {
  display: flex;
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast button {
  background: transparent;
  border: 0;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

@media (max-width: 720px) {
  .page-header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-signout {
    align-self: flex-start;
  }
}
