:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --line: #d9e0ea;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #b91c1c;
  --success: #166534;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: var(--bg); color: var(--text); }
.container { max-width: 1180px; margin: 28px auto; padding: 0 16px 40px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.compact { padding: 12px 16px; }
.topnav { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.topnav a { text-decoration: none; color: var(--text); padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); }
.topnav a.active { background: #eff6ff; color: var(--primary-dark); border-color: #bfdbfe; font-weight: 700; }
.nav-info { margin-left: auto; color: var(--muted); }
.page-header h1 { margin-bottom: 8px; }
.subtitle { color: var(--muted); margin-top: 0; }
.section-head { margin-bottom: 12px; }
.section-head h2, .section-head p { margin: 0 0 6px; }
.section-head.between { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.grid { display: grid; gap: 16px; }
.two-col { grid-template-columns: 1fr 1fr; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
input, select, button { width: 100%; font: inherit; }
input, select { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; }
.actions, .inline-actions { display: flex; gap: 12px; margin-top: 16px; }
button { border: none; border-radius: 8px; padding: 12px 16px; cursor: pointer; background: var(--primary); color: white; font-weight: 700; }
button:hover { background: var(--primary-dark); }
button.secondary { background: #e5e7eb; color: #111827; }
button.danger { background: #dc2626; }
button.small-btn { width: auto; padding: 8px 10px; font-size: 13px; }
button:disabled { cursor: not-allowed; opacity: 0.6; }
.hidden { display: none; }
.status { min-height: 24px; margin-top: 10px; font-weight: 600; }
.status.error { color: var(--danger); }
.status.success { color: var(--success); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; min-width: 760px; width: 100%; }
th, td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
th { background: #eff6ff; }
.small { font-size: 12px; color: var(--muted); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #e5e7eb; }
@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; }
  .section-head.between, .topnav, .actions, .inline-actions { flex-direction: column; }
  .toolbar-right { justify-content: stretch; }
  .auto-btn { width: 100%; }
  .nav-info { margin-left: 0; }
}

textarea { width: 100%; font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; resize: vertical; }
.align-start { align-items: start; }
.wrap { flex-wrap: wrap; }
.soft-card { background: #fbfdff; }
.result-group h3 { margin: 0 0 4px; }


.toolbar-right { display: flex; justify-content: flex-end; margin: 6px 0 12px; }
.auto-btn { width: auto; }
.text-danger { color: var(--danger); }
#resultsTable td .badge, #resultsTable td button { white-space: nowrap; }

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 8px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-weight: 700;
}

.password-wrap {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.password-wrap input {
  flex: 1;
}

.password-wrap .reveal-btn {
  width: auto;
  white-space: nowrap;
}

.terms-box {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  padding: 16px;
}

.terms-box h3 {
  margin-top: 0;
}

.terms-box ol {
  margin: 0 0 16px 20px;
  padding: 0;
}

.terms-box li {
  margin-bottom: 10px;
  line-height: 1.5;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.checkbox-row input[type="checkbox"] {
  width: auto;
  margin-top: 3px;
}

.check-card {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fbfdff;
}

.check-card p {
  margin: 0 0 8px;
}

.session-status-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

.session-status-card.ready {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.session-status-card.not-ready {
  background: #fff7ed;
  border-color: #fed7aa;
}

.session-status-card p {
  margin: 0 0 8px;
}

.session-inline-info {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.badge-success {
  background: #dcfce7;
  color: #166534;
}
