:root {
  color-scheme: light;
  --ink: #101820;
  --muted: #5c6770;
  --line: #d8dee3;
  --surface: #ffffff;
  --surface-alt: #f3f6f7;
  --cyan: #007f91;
  --cyan-dark: #006273;
  --green: #16835a;
  --green-soft: #e6f5ee;
  --amber: #b66a00;
  --amber-soft: #fff3dc;
  --red: #ba2d35;
  --red-soft: #fdebed;
  --focus: #00a5bd;
  --shadow: 0 12px 34px rgba(16, 24, 32, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--surface-alt);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--surface-alt);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(0, 165, 189, 0.28);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #101820;
}

.auth-panel {
  width: min(100%, 430px);
  padding: 32px;
  border: 1px solid #2a3943;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.brand-lockup,
.dialog-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  font-size: 28px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.2;
}

h3 {
  margin: 0;
  font-size: 16px;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--cyan-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-form,
#password-form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
}

input,
textarea {
  padding: 10px 12px;
}

select {
  padding: 8px 34px 8px 12px;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.primary-button {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--cyan);
  border-radius: 6px;
  color: #fff;
  background: var(--cyan);
  font-weight: 800;
}

.primary-button:hover {
  border-color: var(--cyan-dark);
  background: var(--cyan-dark);
}

.primary-button:disabled {
  cursor: not-allowed;
  border-color: #a9b5bb;
  background: #a9b5bb;
}

.secondary-button,
.danger-button {
  min-height: 42px;
  padding: 0 15px;
  border-radius: 6px;
  font-weight: 800;
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
}

.danger-button {
  border: 1px solid #edb3b7;
  color: var(--red);
  background: var(--red-soft);
}

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-rows: 64px minmax(0, 1fr);
  grid-template-areas:
    "topbar topbar"
    "sidebar main";
}

.topbar {
  grid-area: topbar;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid #26343d;
  color: #fff;
  background: var(--ink);
}

.brand-button {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  color: #fff;
  background: transparent;
  font-size: 17px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cert-label {
  max-width: 210px;
  overflow: hidden;
  color: #d8e4e8;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: inherit;
  background: transparent;
  font-size: 20px;
}

.topbar .icon-button {
  border-color: #3d4c55;
  color: #fff;
}

.sidebar {
  grid-area: sidebar;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 12px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.sidebar nav {
  display: grid;
  gap: 5px;
}

.nav-button {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 750;
}

.nav-button.active {
  border-color: #b8dce2;
  color: var(--cyan-dark);
  background: #e7f5f7;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px 0;
  border-top: 1px solid var(--line);
}

.sidebar-user small {
  display: block;
  max-width: 130px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
}

.user-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-alt);
}

.main-content {
  grid-area: main;
  min-width: 0;
  padding: 28px clamp(18px, 4vw, 48px) 56px;
}

.view-section {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.section-heading select {
  width: min(260px, 46vw);
}

.builder-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.builder-section {
  min-width: 0;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.builder-section:nth-child(odd) {
  padding-right: 28px;
}

.builder-section:nth-child(even) {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.step-label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
}

.step-label > span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.segmented-control {
  width: min(100%, 430px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.segmented-control button {
  min-height: 40px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.segmented-control button.active {
  color: #fff;
  background: var(--ink);
}

.field-note {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.selection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.selection-option {
  min-height: 54px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
}

.selection-option.selected {
  border-color: var(--cyan);
  background: #e7f5f7;
}

.selection-option:disabled,
.selection-option.unavailable {
  cursor: not-allowed;
  opacity: 0.48;
}

.selection-option .option-icon {
  font-size: 19px;
}

.selection-option .option-text {
  min-width: 0;
}

.selection-option strong,
.selection-option small {
  display: block;
}

.selection-option strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.selection-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.selection-option .check {
  color: var(--cyan-dark);
  font-weight: 900;
}

.topic-grid {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.quantity-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.quantity-button {
  width: 52px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 800;
}

.quantity-button.active {
  border-color: var(--cyan);
  color: var(--cyan-dark);
  background: #e7f5f7;
}

.quantity-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.number-field {
  width: 130px;
  margin-top: 12px;
}

.range-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  align-items: center;
  gap: 14px;
}

.range-field input {
  min-height: 34px;
  padding: 0;
  accent-color: var(--cyan);
}

.range-field output {
  color: var(--ink);
  font-weight: 800;
}

.builder-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 22px;
}

.selection-summary {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.builder-footer .primary-button {
  min-width: 150px;
}

.attempt-shell {
  display: grid;
  gap: 18px;
}

.attempt-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.attempt-selection {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: -7px;
}

.attempt-selection span {
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.attempt-mode,
.phase-badge,
.difficulty-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 800;
}

.attempt-mode {
  color: var(--cyan-dark);
  background: #e7f5f7;
}

.phase-badge {
  color: var(--green);
  background: var(--green-soft);
}

.difficulty-badge {
  color: var(--amber);
  background: var(--amber-soft);
}

.attempt-progress {
  min-width: 0;
}

.attempt-progress-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 800;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: #e1e7ea;
}

.progress-fill {
  height: 100%;
  background: var(--cyan);
}

.progress-native {
  width: 100%;
  height: 7px;
  display: block;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  background: #e1e7ea;
  appearance: none;
}

.progress-native::-webkit-progress-bar {
  border-radius: 4px;
  background: #e1e7ea;
}

.progress-native::-webkit-progress-value {
  border-radius: 4px;
  background: var(--cyan);
}

.progress-native::-moz-progress-bar {
  border-radius: 4px;
  background: var(--cyan);
}

.timer {
  min-width: 80px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  text-align: right;
}

.question-tool {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 7px 22px rgba(16, 24, 32, 0.06);
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 17px;
}

.question-id {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.question-text {
  margin-bottom: 18px;
  font-size: 18px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.question-image {
  width: 100%;
  max-height: 480px;
  display: block;
  margin: 0 0 20px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.topology-output,
.terminal-output {
  overflow: auto;
  margin: 0 0 18px;
  padding: 14px;
  border-radius: 6px;
  color: #d8f3dc;
  background: #0b1115;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre;
}

.answer-options {
  display: grid;
  gap: 9px;
}

.answer-option {
  min-height: 52px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
}

.answer-option:hover,
.answer-option.selected {
  border-color: var(--cyan);
  background: #eef9fa;
}

.answer-key {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: #fff;
  background: var(--ink);
  font-weight: 850;
}

.question-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
}

.drag-list {
  display: grid;
  gap: 10px;
}

.drag-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.drag-origin {
  line-height: 1.4;
}

.drag-origin strong {
  display: block;
  color: var(--cyan-dark);
  font-size: 12px;
}

.drag-arrow {
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

.lab-objectives {
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--muted);
}

.device-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.device-button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #3b4b54;
  border-radius: 5px;
  color: #cfe3e8;
  background: #18232a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.device-button.active {
  border-color: #36c2d5;
  color: #fff;
  background: #006273;
}

.terminal {
  padding: 14px;
  border-radius: 8px;
  background: #0b1115;
}

.terminal-output {
  min-height: 210px;
  max-height: 420px;
  margin-bottom: 10px;
  padding: 0;
  border: 0;
}

.terminal-command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.terminal-command input {
  border-color: #3b4b54;
  color: #e8f4f6;
  background: #141e24;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.terminal-status {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  color: #b9c9ce;
  font-size: 12px;
}

.feedback-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.feedback-panel.correct {
  border-color: #a8d9c2;
  background: var(--green-soft);
}

.feedback-panel.wrong {
  border-color: #edb3b7;
  background: var(--red-soft);
}

.feedback-title {
  margin-bottom: 12px;
  font-size: 20px;
}

.feedback-copy {
  line-height: 1.55;
  white-space: pre-wrap;
}

.answer-reveal {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(16, 24, 32, 0.14);
}

.answer-reveal h4 {
  margin: 0 0 5px;
  font-size: 13px;
}

.answer-reveal p {
  margin-bottom: 0;
}

.checkpoint-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #edb3b7;
}

.metadata-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.result-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.score-ring {
  width: 94px;
  height: 94px;
  display: grid;
  place-items: center;
  border: 8px solid var(--cyan);
  border-radius: 50%;
  background: var(--surface);
  font-size: 20px;
  font-weight: 900;
}

.review-list {
  display: grid;
  gap: 10px;
}

.review-item {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.review-item h4 {
  margin: 0 0 6px;
}

.review-item p {
  margin-bottom: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.progress-content {
  display: grid;
  gap: 28px;
}

.phase-notice {
  padding: 11px 13px;
  border-left: 3px solid var(--amber);
  color: var(--muted);
  background: var(--amber-soft);
  font-size: 13px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric strong,
.metric span {
  display: block;
}

.metric strong {
  margin-top: 8px;
  font-size: 24px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

.social-profile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 18px;
}

.social-profile h3,
.admin-detail-heading h3 {
  margin: 0 0 5px;
}

.social-profile p,
.admin-detail-heading p {
  margin: 0;
}

.social-tier {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 800;
}

.medal-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.medal-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  font-size: 12px;
  font-weight: 750;
}

.admin-ranking-list {
  display: grid;
  gap: 6px;
}

.admin-ranking-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 130px 68px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.admin-ranking-row:hover,
.admin-ranking-row:focus-visible {
  border-color: var(--cyan);
  background: var(--cyan-soft);
}

.admin-rank,
.admin-score {
  font-variant-numeric: tabular-nums;
}

.admin-rank {
  color: var(--muted);
  font-weight: 800;
}

.admin-user-name,
.admin-user-name small {
  display: block;
  min-width: 0;
}

.admin-user-name strong,
.admin-user-name small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-name small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.admin-tier {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.admin-score {
  text-align: right;
}

.social-admin-detail {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  scroll-margin-top: 18px;
}

.admin-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.admin-attempt-list {
  display: grid;
  gap: 4px;
}

.admin-attempt-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px 60px;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.admin-attempt-row span:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.report-section {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.report-section h3 {
  margin-bottom: 13px;
}

.bar-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(120px, 2fr) 56px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.bar-label {
  min-width: 0;
  overflow: hidden;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.history-table th,
.history-table td {
  padding: 11px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.history-table td:first-child {
  min-width: 260px;
}

.history-table td:first-child strong,
.history-selection {
  display: block;
}

.history-selection {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.status-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 50%;
}

.status-dot.completed {
  background: var(--green);
}

.status-dot.open {
  background: var(--amber);
}

.status-dot.abandoned {
  background: var(--red);
}

.mobile-nav {
  display: none;
}

dialog {
  width: min(92vw, 430px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(16, 24, 32, 0.72);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  max-width: min(390px, calc(100vw - 36px));
  padding: 12px 15px;
  border-radius: 6px;
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: 13px;
}

@media (max-width: 840px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 58px minmax(0, 1fr) 64px;
    grid-template-areas:
      "topbar"
      "main"
      "mobile";
  }

  .topbar {
    height: 58px;
    padding: 0 12px;
  }

  .sidebar {
    display: none;
  }

  .main-content {
    padding: 20px 14px 104px;
  }

  .mobile-nav {
    grid-area: mobile;
    position: sticky;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    background: var(--surface);
  }

  .mobile-nav .nav-button {
    min-height: 64px;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    border-radius: 0;
    font-size: 12px;
  }

  .builder-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .builder-section,
  .builder-section:nth-child(odd),
  .builder-section:nth-child(even) {
    padding: 19px 0;
    border-left: 0;
  }

  .builder-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .builder-footer .primary-button {
    width: 100%;
  }

  .attempt-header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .timer {
    grid-column: 1 / -1;
    text-align: left;
  }

  .question-tool {
    padding: 16px;
  }

  .question-text {
    font-size: 16px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-ranking-row {
    grid-template-columns: 40px minmax(0, 1fr) 58px;
  }

  .admin-tier {
    display: none;
  }

  .admin-attempt-row {
    grid-template-columns: minmax(0, 1fr) 76px 52px;
  }

  .bar-row {
    grid-template-columns: minmax(110px, 1fr) minmax(90px, 1.5fr) 48px;
    gap: 7px;
  }

  .history-table th:nth-child(2),
  .history-table td:nth-child(2) {
    display: none;
  }

  .history-table td:first-child {
    min-width: 0;
  }

  .history-table th,
  .history-table td {
    padding-right: 4px;
    padding-left: 4px;
  }
}

@media (max-width: 520px) {
  .auth-shell {
    padding: 0;
    background: var(--surface);
  }

  .auth-panel {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    border: 0;
    box-shadow: none;
  }

  .cert-label {
    display: none;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading select {
    width: 100%;
  }

  .selection-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .social-profile,
  .admin-detail-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .topic-grid {
    max-height: 320px;
  }

  .drag-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .drag-arrow {
    transform: rotate(90deg);
  }

  .metadata-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .terminal-command {
    grid-template-columns: minmax(0, 1fr);
  }

  .question-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .question-actions button {
    width: 100%;
  }
}
