:root {
  --zoom: 1;
  --brand: #58595b;
  --stepper-pending: #b7bcc4;
  --stepper-line-pending: #d4d8df;
  --attend-select-width: 44px;
  --attend-count-width: 64px;
  --attend-student-width: 320px;
  --attend-sticky-width: calc(var(--attend-select-width) + var(--attend-count-width) + var(--attend-student-width));
}

body {
  font-family: "Arial", sans-serif;
  font-weight: 400;
  color: #58595b;
}

body, button, input, select, textarea {
  font-family: "Arial", sans-serif;
  color: #58595b;
}
.hidden { display: none !important; }
.main-title {
  font-family: "Arial", sans-serif;
}
.main-title-button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.main-title-button:hover .main-title,
.main-title-button:focus-visible .main-title {
  text-decoration: underline;
}
.main-title-button:focus-visible {
  outline: 2px solid rgba(88, 89, 91, 0.35);
  outline-offset: 4px;
  border-radius: 10px;
}
.allocate-text-link {
  display: inline;
  margin: 0 3px;
  color: #58595b;
  font-weight: 600;
  text-decoration: underline;
}
.text-brand { color: var(--brand) !important; }
[class*="text-slate-"] { color: #58595b !important; }
body > div.review-layout {
  max-width: 1680px !important;
}
#step4 {
  max-width: 100% !important;
}

.dropzone { border: 2px dashed #94a3b8; border-radius: 12px; padding: 16px; background: #f8fafc; text-align: center; }
.card { background: white; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.input { border: 1px solid #cbd5e1; border-radius: 10px; padding: 8px 10px; width: 100%; background: white; }
.file-info {
  font-size: 0.8rem;
  color: #58595b;
}

#columnSelect {
  font-size: 1rem;
  font-weight: 400;
  color: var(--brand);
}
#columnSelect option {
  color: #11151b;
  font-weight: 400;
}
#uploadSummary,
#takeWeekGuidance {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--brand) !important;
}
.search-input-wrap {
  position: relative;
}
.search-input-wrap .input {
  padding-right: 2.5rem;
}
.input-clear-btn {
  position: absolute;
  top: 50%;
  right: 0.65rem;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  color: #58595b;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.search-input-wrap.has-value .input-clear-btn {
  opacity: 0.7;
  pointer-events: auto;
}
.btn,
.btn-primary {
  border-radius: 10px;
  padding: 8px 16px;
  font-weight: 400;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  background: #ffffff;
  color: var(--brand);
  border: 1px solid var(--brand);
}
.btn:hover,
.btn-primary:hover {
  background: var(--brand);
  color: #ffffff;
}

.tabs { display: flex; align-items: center; gap: 8px; }
.tab { background: #e2e8f0; border-radius: 9999px; padding: 6px 12px; font-weight: 600; }
.tab.active { background: #0073a8; color: #fff; }

/* Preview */
.preview-wrap { overflow:auto; max-height: 70vh; border: 1px solid #e2e8f0; border-radius: 10px; }
.preview-table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.preview-table th, .preview-table td { border: 1px solid #e2e8f0; padding: 6px 8px; font-size: 12px; background: white; }
.preview-table thead th { position: sticky; top: 0; z-index: 2; background: #f8fafc; }
.preview-table .col-letter { font-family: Arial, sans-serif; font-weight: 700; }
.preview-table .col-highlight { background: #e0f2fe !important; }

/* Student codes grid — zoom controls type scale (not container size) */
.codes-grid-wrap { width: 100%; }

.codes-grid {
  display: grid;
  width: 100%;
  /* Min card width scales with --zoom, never below 140px, wraps automatically */
  grid-template-columns: repeat(
    auto-fit,
    minmax(clamp(140px, calc(160px + 260px * (var(--zoom) - 1)), 440px), 1fr)
  );
  gap: clamp(6px, 12px * var(--zoom), 18px);
}

/* allow name truncation + avoid overflow fights */
.code-card { min-width: 0; }
.code-card .meta .truncate { min-width: 0; }




/* slightly tighter vertical rhythm in cards */
.code-card {
  padding: calc(5.5px * var(--zoom)) calc(7.5px * var(--zoom));
  gap: calc(3.5px * var(--zoom));
  background: var(--group-bg, #ffffff);
}

.code-card .sno,
.code-card .code {
  font-family: Arial, sans-serif;
  font-weight: 800;
  font-size: calc(19px * var(--zoom));
  letter-spacing: 0.6px;
  line-height: 1.3;
  text-transform: lowercase;
}


.code-card .meta { font-size: calc(9.5px * var(--zoom)); color: #58595b; display: flex; justify-content: space-between; gap: 6px; }

.code-card .meta.name-row { margin-top: calc(2px * var(--zoom)); }

#refreshStatus { display: none !important; }

.code-card.no-code { padding: calc(5px * var(--zoom)) calc(7px * var(--zoom)); gap: calc(2.5px * var(--zoom)); }
.code-card.no-code .sno { font-size: calc(19px * var(--zoom)); }
.code-card.no-code .meta { font-size: calc(9.5px * var(--zoom)); }
.no-passcode .codes-grid {
  grid-template-columns: repeat(
    auto-fit,
    minmax(clamp(120px, calc(140px + 220px * (var(--zoom) - 1)), 380px), 1fr)
  );
  gap: clamp(4px, 8px * var(--zoom), 12px);
}

.config-label span { color: var(--brand); }
.config-detail { color: var(--brand); line-height: 1.4; }
.config-label input[type="checkbox"] { accent-color: var(--brand); width: 16px; height: 16px; }
.config-intro {
  color: var(--brand);
  font-size: 1rem;
  font-weight: 500;
}

.zoom-group {
  background: transparent;
  border-radius: 0;
  padding: 0;
  align-items: flex-end !important;
}
.zoom-option {
  display: inline-flex;
  align-items: center;
  position: relative;
  cursor: pointer;
}
.zoom-option input {
  appearance: none;
  width: 0;
  height: 0;
  position: absolute;
  opacity: 0;
}
.zoom-option span {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  padding: 4px;
  font-weight: 400;
  color: var(--brand);
  transition: color .15s ease;
  min-width: 0;
}
.zoom-option input:checked + span {
  font-weight: 600;
  text-decoration: underline;
}
.zoom-option span:hover {
  color: #3d3e3f;
}
.zoom-option + .zoom-option {
  margin-left: 4px;
}
.zoom-icon {
  font-weight: 400;
  line-height: 1;
  text-transform: lowercase;
}
.zoom-icon-sm { font-size: 0.75rem; }
.zoom-icon-md { font-size: 1.2rem; }
.zoom-icon-lg { font-size: 1.8rem; }



/* Present = light lime background */
.code-card.present {
  background: #ecfccb;              /* lime-100 */
  border-color: #84cc16;            /* lime-500 (subtle edge) */
  box-shadow: 0 0 0 1px rgba(132, 204, 22, .25) inset; /* optional soft outline */
}
.code-card.overrideable {
  cursor: pointer;
}
.code-card.teacher-override,
.code-card.teacher-override.search-match {
  background: #d9f99d;
  border-color: #84cc16;
  box-shadow: 0 0 0 1px rgba(132, 204, 22, .45) inset;
}

/* Search highlight = yellow background (overrides present) */
.code-card.search-match {
  background: #fef08a;              /* yellow-200 */
  border-color: #eab308;            /* yellow-500 */
  box-shadow: 0 0 0 1px rgba(234, 179, 8, .35) inset;
}



/* --- Forked stepper --- */
.stepper-shell {
  position: relative;
  width: min(100%, 760px);
  height: 88px;
}
.stepper-shell.hidden {
  display: none;
}
.stepper-branches {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: block;
}
.stepper-connector {
  fill: none;
  stroke: var(--stepper-pending);
  stroke-width: 2.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke .15s ease;
  vector-effect: non-scaling-stroke;
  shape-rendering: geometricPrecision;
}
.stepper-shell[data-current-step="2"] .segment-upload-check,
.stepper-shell[data-current-step="3"] .segment-upload-check,
.stepper-shell[data-current-step="4"] .segment-upload-check,
.stepper-shell[data-current-step="3"] .segment-check-next,
.stepper-shell[data-current-step="4"] .segment-check-next,
.stepper-shell[data-download-stage="true"] .segment-next-download,
.stepper-shell[data-selected-path="download"] .segment-next-download {
  stroke: var(--brand);
}
.stepper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  list-style: none;
  padding: 0;
  margin: 0;
}
.stepper li {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 116px;
  height: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  z-index: 1;
  border-radius: 12px;
}
.stepper li[data-node="upload"] {
  left: 12%;
  top: 43.75%;
}
.stepper li[data-node="check"] {
  left: 36%;
  top: 43.75%;
}
.stepper li[data-node="take"] {
  left: 60%;
  top: 43.75%;
}
.stepper li[data-node="download"] {
  left: 84%;
  top: 43.75%;
}
.stepper li[data-node="review"] {
  left: 60%;
  top: 43.75%;
}
.stepper-shell[data-selected-path="take"] li[data-node="review"],
.stepper-shell[data-selected-path="download"] li[data-node="review"] {
  display: none;
}
.stepper-shell[data-selected-path="review"] li[data-node="check"],
.stepper-shell[data-selected-path="review"] li[data-node="take"],
.stepper-shell[data-selected-path="review"] li[data-node="download"],
.stepper-shell[data-selected-path="review"] .segment-check-next,
.stepper-shell[data-selected-path="review"] .segment-next-download {
  display: none;
}
.stepper-shell[data-selected-path="review"] li[data-node="review"] {
  left: 36%;
  top: 43.75%;
}
.stepper li.disabled { cursor: not-allowed; }
.stepper li .label {
  position: absolute;
  top: calc(50% + 20px);
  left: 50%;
  transform: translateX(-50%);
  max-width: 110px;
  text-align: center;
  font-weight: 600;
  color: var(--stepper-pending);
  line-height: 1.2;
  white-space: normal;
}
.stepper li .bubble {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 3px solid var(--stepper-pending);
  background: #ffffff;
  box-shadow: 0 0 0 1px #ffffff;
  color: var(--stepper-pending);
  font-weight: 800;
  line-height: 1;
}
.stepper li.active .label {
  color: #ef4444;
}
.stepper li.active .bubble {
  border-color: #ef4444;
  color: #ef4444;
}
.stepper li.done:not(.active) .label {
  color: var(--brand);
}
.stepper li.done:not(.active) .bubble {
  border-color: var(--brand);
  color: var(--brand);
}
.stepper li:focus-visible {
  outline: 2px solid rgba(88, 89, 91, 0.35);
  outline-offset: 2px;
}

/* inline number input used in step 3 sentence */
.input.inline-input { display:inline-block; width:auto; min-width:4.5rem; padding-top:4px; padding-bottom:4px; }

#getQrCodeContainer .config-detail input { border-color: #94a3b8; }

#countdownBanner { display: none; letter-spacing: .5px; }
#countdownBanner.is-visible { display: block; }
#countdownBanner.countdown-active { color: #ef4444; }
#endSessionBtn { min-width: 140px; }
#endSessionBtn.hidden { display: none; }


/* --- Fullscreen QR overlay during active timer --- */
.qr-overlay { position: fixed; inset: 0; background: #0b1b2b; color: #fff;
  display: flex; align-items: center; justify-content: center; z-index: 9999; }
.qr-overlay-inner { text-align: center; padding: 24px; }
.qr-overlay-count { font-weight: 800; font-size: 40px; letter-spacing: .5px; }
.qr-overlay .big-qr canvas, .qr-overlay .big-qr img { width: min(70vmin, 520px); height: auto; }

.slider-wrap { align-items: center; }
.session-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}
.session-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.session-center {
  min-width: 200px;
  justify-self: center;
}
.session-tools {
  justify-self: end;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.upload-path-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.upload-path-title {
  margin: 0;
}
.upload-path-summary {
  margin: 0;
}
.upload-path-summary-line {
  display: block;
}
.upload-path-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  justify-content: center;
}
.upload-path-actions .btn,
.upload-path-actions .btn-primary,
.review-toolbar-actions .btn,
.review-toolbar-actions .btn-primary {
  min-width: 170px;
}
.btn.is-selected,
.btn-primary.is-selected {
  background: #58595b;
  color: #ffffff;
}

.front-intro {
  margin-bottom: 18px;
  text-align: center;
  color: #58595b;
}
.front-intro p {
  margin: 0 0 10px;
  line-height: 1.5;
}
.front-intro p:last-child {
  margin-bottom: 0;
}
.inline-help-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 4px;
  border: 1px solid #94a3b8;
  border-radius: 9999px;
  background: #ffffff;
  color: #58595b;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
}
.inline-help-trigger:hover,
.inline-help-trigger[aria-expanded="true"] {
  background: #58595b;
  color: #ffffff;
  border-color: #58595b;
}
.inline-help-popovers {
  position: relative;
}
.inline-help-popover {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, calc(100vw - 40px));
  padding: 12px;
  border: 1px solid #d7dde6;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
  z-index: 20;
}
.inline-help-popover.open {
  opacity: 1;
  pointer-events: auto;
}
.inline-help-popover img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.review-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 210px) 1fr;
  align-items: end;
  gap: 16px 18px;
}
.review-week-picker {
  min-width: min(210px, 100%);
}
.review-control-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #58595b;
}
.review-current-week {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #f2cf66;
  border-radius: 10px;
  background: #fff6cf;
  color: #7a5a00;
  font-size: 0.92rem;
  line-height: 1.3;
  display: flex;
  align-items: center;
}
.review-download-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}
.download-upload-note {
  margin: 0;
  font-size: 0.95rem;
  color: #58595b;
}
.download-tip-wrap {
  display: inline-flex;
  position: relative;
  vertical-align: middle;
}
.end4-help-popover {
  top: 28px;
  width: min(640px, calc(100vw - 40px));
}
.review-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.review-overview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  align-content: flex-end;
  min-height: 42px;
  padding: 4px 0 10px;
}
.review-overview-actions.is-hidden {
  visibility: hidden;
  pointer-events: none;
}
.review-compact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 120px;
  padding: 6px 12px;
  font-size: 0.9rem;
}
.btn-short-label {
  display: inline-flex;
  align-items: center;
}
.btn-icon {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn-icon-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
}
.selection-count-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 18px;
  flex: 0 0 auto;
}
.selection-count-icon svg {
  width: 22px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.attend-table-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
  text-align: center;
}
.attend-table-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  width: 100%;
}
.attend-table-summary {
  margin: 0;
  font-size: 0.92rem;
  color: #58595b;
}
.attend-table-stats {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 0.84rem;
  color: #58595b;
}
.attend-table-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.review-chart-row {
  display: grid;
  grid-template-columns: var(--attend-sticky-width) max-content;
  gap: 0;
  align-items: end;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}
.attend-table-legend {
  display: none;
}
.attend-table-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.attend-chart-wrap {
  margin-bottom: 0;
  padding: 6px 0 2px;
  overflow-x: auto;
  max-width: 100%;
}
.attend-chart-table {
  width: max-content;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  margin: 0;
}
.attend-chart-table td {
  padding: 0 0 8px;
  vertical-align: bottom;
  border-right: 1px solid transparent;
  box-sizing: border-box;
}
.attend-chart-table td:first-child {
  border-left: 1px solid transparent;
}
.attend-chart-cell {
  text-align: center;
}
.attend-chart-column {
  appearance: none;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #58595b;
  cursor: pointer;
  padding: 0;
  width: 100%;
}
.attend-chart-track {
  width: 100%;
  max-width: 24px;
  height: 70px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.attend-chart-bar {
  width: 100%;
  min-height: 6px;
  border-radius: 8px 8px 4px 4px;
  background: #7c7f84;
  transition: transform .15s ease, background .15s ease;
}
.attend-chart-column:hover .attend-chart-bar {
  transform: translateY(-2px);
}
.attend-chart-column.is-current .attend-chart-bar {
  background: #f2c94c;
}
.attend-chart-column.is-null .attend-chart-bar {
  display: none;
}
.attend-chart-column.is-current .attend-chart-value {
  color: #7a5a00;
}
.attend-chart-value {
  font-size: 0.72rem;
  line-height: 1.2;
  min-height: 2.1em;
}
.attend-table-wrap {
  overflow: auto;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
}
.attend-table {
  width: max-content;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}
.attend-table th,
.attend-table td {
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  padding: 8px 6px;
  background: #ffffff;
  text-align: center;
  vertical-align: middle;
}
.attend-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #58595b;
  color: #ffffff;
  font-weight: 700;
}
.attend-sort-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  width: 100%;
  font: inherit;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.attend-sort-student {
  text-align: left;
  justify-content: flex-start;
}
.attend-table thead .attend-week-head.is-current,
.attend-table tbody .attend-status-cell.is-current {
  background: #fef3c7;
}
.attend-table thead .attend-week-head.is-break,
.attend-table tbody .attend-status-cell.is-break {
  background: #d7d7d7 !important;
  color: #58595b;
}
.attend-week-head {
  width: 52px;
  font-size: 0.84rem;
}
.attend-table tbody .attend-status-cell.is-current {
  box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.18);
}
.attend-table tbody .attend-status-cell.is-break {
  box-shadow: inset 0 0 0 1px rgba(88, 89, 91, 0.08);
}
.attend-table thead .attend-week-head.is-current {
  color: #58595b;
}
.attend-sticky-col {
  position: sticky;
  z-index: 2;
  background: #f8fafc !important;
}
.attend-table thead .attend-sticky-col {
  z-index: 4;
  background: #434446 !important;
  color: #ffffff;
}
.attend-select-cell {
  left: 0;
  min-width: var(--attend-select-width);
  width: var(--attend-select-width);
}
.attend-select-cell input {
  width: 16px;
  height: 16px;
  accent-color: #58595b;
}
.attend-count-cell {
  left: var(--attend-select-width);
  min-width: var(--attend-count-width);
  width: var(--attend-count-width);
  font-weight: 700;
}
.attend-student-cell {
  left: calc(var(--attend-select-width) + var(--attend-count-width));
  min-width: var(--attend-student-width);
  width: var(--attend-student-width);
  text-align: left !important;
}
.attend-student-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.attend-student-name {
  display: block;
  font-weight: 600;
  color: #2f3133;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attend-student-meta {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.82rem;
  color: #6b7280;
}
.attend-student-group {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  background: #eef2f7;
  color: #4b5563;
}
.attend-status-cell {
  min-width: 52px;
}
.attend-dot {
  display: inline-flex;
  width: 12px;
  height: 12px;
  border-radius: 9999px;
  background: #cbd5e1;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}
.attend-dot.present {
  background: #4dd21c;
}
.attend-dot.absent {
  background: #ff1f1f;
}
.attend-dot.pending {
  background: #b9bcc2;
}
.attend-dot-placeholder {
  display: inline-flex;
  width: 12px;
  height: 12px;
}
.attend-table-empty {
  padding: 20px;
  text-align: center;
  color: #6b7280;
}
.attend-table thead th:first-child,
.attend-table tbody td:first-child {
  border-left: 1px solid #e2e8f0;
}
.attend-table thead tr:first-child th {
  border-top: 1px solid #434446;
}
.email-modal-card {
  width: min(620px, 94vw);
  text-align: left;
}
.email-token-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}
.email-token-list span {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  background: #eef2f7;
  color: #4b5563;
  font-size: 0.82rem;
}
.email-template-input {
  min-height: 220px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92rem;
  resize: vertical;
}

@media (max-width: 900px) {
  :root {
    --attend-select-width: 40px;
    --attend-count-width: 56px;
    --attend-student-width: 240px;
  }
  .stepper-shell {
    width: min(100%, 640px);
    height: 82px;
  }
  .stepper li {
    width: min(124px, 100%);
  }
  .stepper li .label {
    max-width: 92px;
    font-size: 0.9rem;
  }
  .session-top {
    grid-template-columns: 1fr;
  }
  .session-meta,
  .session-center,
  .session-tools {
    justify-self: center;
    justify-content: center;
  }
  .upload-path-intro,
  .review-toolbar {
    grid-template-columns: 1fr;
  }
  .review-toolbar-actions {
    width: 100%;
  }
  .review-download-row .btn,
  .review-download-row .btn-primary {
    width: 100%;
  }
  .upload-path-actions .btn,
  .upload-path-actions .btn-primary,
  .review-toolbar-actions .btn,
  .review-overview-actions .btn,
  .review-overview-actions .btn-primary,
  .review-toolbar-actions .btn-primary {
    width: 100%;
  }
  .review-overview-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .review-chart-row {
    grid-template-columns: 1fr;
    width: 100%;
  }
  .attend-table-header {
    flex-direction: column;
  }
  .attend-table-legend {
    justify-content: flex-start;
  }
  .attend-chart-track {
    max-width: 20px;
    height: 56px;
  }
  .attend-select-cell {
    min-width: 40px;
    width: 40px;
  }
  .attend-student-cell {
    left: 96px;
    min-width: 240px;
  }
  .attend-count-cell {
    left: 40px;
  }
}

.help-container {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  z-index: 50;
}
.help-link {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  background: #ffffff;
  color: var(--brand);
  font-size: 1rem;
  font-weight: 400;
  border: 1px solid #d7d9dd;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease, color .18s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.help-link:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}
.help-link:hover {
  background: #f2f2f3;
  transform: translateY(-1px);
}
.help-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(360px, 80vw);
  padding: 20px;
  background: #ffffff;
  color: #58595b;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  visibility: hidden;
  z-index: 40;
}
.help-container.open .help-popover {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}
.help-popover h3,
.help-popover h4 {
  font-weight: 600;
  margin: 18px 0 8px;
  color: var(--brand);
}
.help-popover h3:first-of-type {
  margin-top: 0;
}
.help-popover .help-heading {
  display: none;
}
.help-popover .help-heading::before {
  content: none;
}
.help-popover p {
  margin: 0 0 10px;
  font-size: 0.9rem;
  line-height: 1.5;
}
.help-popover a {
  color: inherit;
  text-decoration: underline;
}
.help-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.help-popover .help-label {
  font-weight: 600;
  margin-right: 6px;
}
.help-body p:last-child {
  margin-bottom: 0;
}
.help-footer {
  border-top: 1px solid #e2e8f0;
  margin-top: 8px !important;
  padding-top: 12px;
}
.help-footer a {
  font-weight: 600;
}
.help-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.help-step-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}
.help-close {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--brand);
  font-size: 1.35rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.help-close:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.restart-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 70;
}
.restart-modal.hidden {
  display: none !important;
}
.restart-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.restart-modal-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  width: min(360px, 90vw);
  box-shadow: 0 25px 65px rgba(15, 23, 42, 0.25);
  z-index: 1;
  text-align: center;
}
.restart-modal-card h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  color: var(--brand);
}
.restart-modal-card p {
  margin: 0 0 16px;
  font-size: 0.95rem;
}
.modal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.feedback-footer {
  margin-top: 48px;
  text-align: center;
  font-size: 0.85rem;
  color: #58595b;
}
.feedback-text {
  position: relative;
  display: inline-block;
  color: #58595b;
  cursor: pointer;
  text-decoration: none;
}
.feedback-text::after {
  content: attr(data-tooltip);
  white-space: pre;
  position: absolute;
  left: 50%;
  bottom: 130%;
  transform: translateX(-50%);
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.85);
  color: #f8fafc;
  border-radius: 8px;
  font-size: 0.75rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.feedback-text:hover::after {
  opacity: 1;
  transform: translate(-50%, -6px);
}
