/* ===== Button group (toggle buttons) ===== */
.btn-group {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.btn-group button {
  padding: 7px 14px;
  border: none;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-group button:last-child { border-right: none; }
.btn-group button:hover { background: var(--bg-hover); color: var(--text-label); }
.btn-group button.active { background: var(--accent-dim); color: var(--text-bright); }

/* ===== Tooltip ===== */
.tooltip {
  position: fixed;
  pointer-events: none;
  background: var(--bg-input);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 0.75rem;
  line-height: 1.6;
  z-index: 100;
  display: none;
  min-width: 140px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.tooltip .hc-name { font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; color: var(--text-bright); margin-bottom: 4px; }
.tooltip .row { display: flex; justify-content: space-between; gap: 12px; }
.tooltip .label { color: var(--text-muted); }
.tooltip .val { font-family: var(--font-mono); font-weight: 600; }
.tip-raise { color: var(--color-raise); }
.tip-call  { color: var(--color-call); }
.tip-fold  { color: var(--color-fold); }
.tip-allin { color: var(--color-allin); }
.tip-abs   { color: var(--text-label); }

/* ===== Grid items (canvas wrapper) ===== */
.grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.grid-item .title {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-label);
  text-align: center;
  margin-bottom: 4px;
}
.grid-item canvas {
  display: block;
  width: 100%;
  height: auto;
}

/* ===== Asymmetry link button ===== */
.asym-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  color: var(--text-link);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
}
.asym-link:hover {
  border-color: var(--accent-dim);
  color: var(--text-link-hover);
  background: var(--bg-hover);
}

/* ===== Card ===== */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  width: 100%;
  min-width: 0;
  background: var(--bg-card);
}

/* ===== Table ===== */
.tableWrap {
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
table.diffTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-family: var(--font-mono);
  background: var(--bg-card);
  color: var(--text);
}
.diffTable thead th {
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  text-align: center;
  padding: 8px 10px;
  z-index: 1;
  color: var(--text-label);
  font-family: var(--font-body);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.06em;
}
.diffTable tbody td {
  border-bottom: 1px solid var(--border-light);
  padding: 7px 10px;
  text-align: center;
}
.diffTable tbody tr:hover { background: var(--bg-hover); }
.num {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ===== Auth — bar (homepage top) ===== */
.auth-bar {
  position: fixed;
  top: 0;
  right: 0;
  padding: var(--space-sm) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  z-index: 75;
}
.auth-bar-inline {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.auth-user {
  color: var(--text-label);
  font-size: 0.82rem;
  font-family: var(--font-body);
}
.auth-login-link {
  color: var(--text-link);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.auth-login-link:hover {
  border-color: var(--accent-dim);
  color: var(--text-link-hover);
  background: var(--bg-hover);
}
.auth-logout-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-family: var(--font-body);
  padding: 4px 12px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.auth-logout-btn:hover {
  border-color: var(--color-raise);
  color: var(--color-raise);
}

/* ===== Auth — login page ===== */
.auth-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-xl) var(--space-lg);
  min-height: 100vh;
}
.auth-back {
  align-self: flex-start;
  color: var(--text-link);
  text-decoration: none;
  font-size: 0.88rem;
  margin-bottom: var(--space-xl);
  transition: color 0.2s;
}
.auth-back:hover { color: var(--text-link-hover); }

.auth-container {
  width: 100%;
  max-width: 380px;
}
.auth-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-bright);
  text-align: center;
  margin-bottom: var(--space-lg);
  letter-spacing: -0.03em;
}
.auth-title span { color: var(--accent); }

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  flex: 1;
  padding: var(--space-sm) var(--space-xs);
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  text-align: center;
}
.auth-tab:hover { color: var(--text-label); }
.auth-tab.active {
  color: var(--text-heading);
  border-bottom-color: var(--accent);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.auth-form input {
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-heading);
  font-family: var(--font-body);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}
.auth-form input::placeholder { color: var(--text-muted); }
.auth-form input:focus { border-color: var(--accent-dim); }

.auth-submit {
  padding: 10px;
  background: var(--accent-dim);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-bright);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.auth-submit:hover { background: var(--accent); }
.auth-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}

.auth-oauth {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.auth-oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 9px var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-heading);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.auth-oauth-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-accent);
}

.auth-status {
  margin-top: var(--space-md);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  line-height: 1.5;
}
.auth-form-hidden { display: none; }
.auth-status.error {
  background: var(--accent-glow);
  color: var(--color-raise);
  border: 1px solid var(--border);
}
.auth-status.success {
  background: var(--accent-glow);
  color: var(--color-call);
  border: 1px solid var(--border);
}

/* ===== Access gate (insufficient tier) ===== */
.access-gate {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
  color: var(--text-muted);
  max-width: 400px;
  margin: var(--space-xl) auto;
}
.access-gate h2 {
  font-family: var(--font-display);
  color: var(--text-heading);
  margin-bottom: var(--space-md);
}
