.tl-app {
  --tl-ink: #18211c;
  --tl-muted: #5c6a61;
  --tl-line: #d8e0da;
  --tl-surface: #ffffff;
  --tl-band: #f4f7f1;
  --tl-accent: #0f7b63;
  --tl-accent-strong: #095241;
  --tl-warn: #a75b12;
  --tl-good: #1e7a39;
  --tl-shadow: 0 14px 38px rgba(24, 33, 28, 0.12);
  color: var(--tl-ink);
  background: #fbfcfa;
  min-height: 100vh;
  padding: clamp(18px, 3vw, 36px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tl-app * {
  box-sizing: border-box;
}

.tl-shell-head,
.tl-section-head,
.tl-head-actions,
.tl-status-band,
.tl-tabs,
.tl-form,
.tl-grid,
.tl-attendance {
  display: flex;
  gap: 16px;
}

.tl-shell-head {
  align-items: flex-end;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto 22px;
}

.tl-kicker {
  color: var(--tl-accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.tl-shell-head h1,
.tl-section-head h2,
.tl-card h3 {
  margin: 0;
  letter-spacing: 0;
}

.tl-shell-head h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

.tl-lede,
.tl-section-head p,
.tl-card p {
  color: var(--tl-muted);
}

.tl-lede {
  max-width: 720px;
  margin: 12px 0 0;
  font-size: 1rem;
}

.tl-head-actions {
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tl-segmented {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  border: 1px solid var(--tl-line);
  border-radius: 8px;
  background: var(--tl-surface);
  overflow: hidden;
}

.tl-segmented button,
.tl-tabs button,
.tl-form button,
.tl-quiet,
.tl-mini {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.tl-segmented button,
.tl-tabs button {
  min-height: 40px;
  padding: 9px 13px;
  background: transparent;
  color: var(--tl-muted);
}

.tl-segmented button[aria-pressed="true"],
.tl-tabs button[aria-selected="true"] {
  background: var(--tl-accent);
  color: #fff;
}

.tl-quiet,
.tl-mini {
  border: 1px solid var(--tl-line);
  border-radius: 8px;
  background: var(--tl-surface);
  color: var(--tl-ink);
  min-height: 40px;
  padding: 9px 13px;
}

.tl-status-band,
.tl-tabs,
.tl-panels {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

.tl-status-band {
  align-items: stretch;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.tl-status-band article,
.tl-card,
.tl-table-wrap,
.tl-panel {
  border: 1px solid var(--tl-line);
  border-radius: 8px;
  background: var(--tl-surface);
}

.tl-status-band article {
  padding: 14px;
}

.tl-status-band span,
.tl-form span,
.tl-meta,
.tl-pill {
  color: var(--tl-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tl-status-band strong {
  display: block;
  margin: 4px 0;
}

.tl-status-band small {
  color: var(--tl-muted);
  display: block;
  line-height: 1.35;
}

.tl-tabs {
  border-bottom: 1px solid var(--tl-line);
  flex-wrap: wrap;
  margin-bottom: 0;
}

.tl-tabs button {
  border-radius: 8px 8px 0 0;
}

.tl-panel {
  display: none;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  padding: clamp(16px, 3vw, 28px);
  min-height: 480px;
  box-shadow: var(--tl-shadow);
}

.tl-panel.is-active {
  display: block;
}

.tl-section-head {
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.tl-section-head p {
  margin: 6px 0 0;
}

.tl-grid {
  align-items: start;
  display: grid;
}

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

.tl-stack {
  display: grid;
  gap: 12px;
}

.tl-card {
  padding: 16px;
}

.tl-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.tl-form {
  align-items: end;
  background: var(--tl-band);
  border: 1px solid var(--tl-line);
  border-radius: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 14px;
}

.tl-form-wide {
  align-items: stretch;
}

.tl-form label {
  display: grid;
  flex: 1 1 190px;
  gap: 6px;
}

.tl-form input,
.tl-form select,
.tl-form textarea,
.tl-quiz textarea,
.tl-score {
  border: 1px solid var(--tl-line);
  border-radius: 8px;
  color: var(--tl-ink);
  font: inherit;
  min-height: 42px;
  padding: 9px 11px;
  width: 100%;
}

.tl-form select[multiple] {
  min-height: 108px;
}

.tl-form button,
.tl-quiz button {
  align-self: end;
  background: var(--tl-accent);
  border-radius: 8px;
  color: #fff;
  min-height: 42px;
  padding: 10px 14px;
}

.tl-table-wrap {
  overflow-x: auto;
}

.tl-app table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

.tl-app th,
.tl-app td {
  border-bottom: 1px solid var(--tl-line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.tl-app th {
  color: var(--tl-muted);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tl-pill {
  align-items: center;
  border: 1px solid var(--tl-line);
  border-radius: 999px;
  display: inline-flex;
  min-height: 28px;
  padding: 4px 9px;
}

.tl-pill.good {
  border-color: rgba(30, 122, 57, 0.35);
  color: var(--tl-good);
}

.tl-pill.warn {
  border-color: rgba(167, 91, 18, 0.35);
  color: var(--tl-warn);
}

.tl-attendance {
  flex-wrap: wrap;
}

.tl-attendance button {
  min-width: 88px;
}

.tl-attendance button[data-present="true"] {
  border-color: rgba(30, 122, 57, 0.45);
  color: var(--tl-good);
}

.tl-attendance button[data-present="false"] {
  border-color: rgba(167, 91, 18, 0.45);
  color: var(--tl-warn);
}

.tl-quiz {
  display: grid;
  gap: 14px;
}

.tl-quiz fieldset {
  border: 1px solid var(--tl-line);
  border-radius: 8px;
  margin: 0;
  padding: 12px;
}

.tl-quiz legend {
  font-weight: 700;
  padding: 0 5px;
}

.tl-quiz label {
  display: block;
  margin-top: 8px;
}

.tl-review {
  border-top: 1px solid var(--tl-line);
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
}

.tl-json {
  background: #16211d;
  border-radius: 8px;
  color: #eaf4ee;
  font-size: 0.88rem;
  overflow-x: auto;
  padding: 16px;
  white-space: pre;
}

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

@media (max-width: 860px) {
  .tl-shell-head {
    align-items: stretch;
    display: grid;
  }

  .tl-head-actions {
    justify-content: flex-start;
  }

  .tl-status-band,
  .tl-grid-2 {
    grid-template-columns: 1fr;
  }

  .tl-panel {
    min-height: 0;
  }
}
