:root {
  --navy: #111827;
  --navy-deep: #0b1220;
  --blue: #4f46e5;
  --blue-dark: #4338ca;
  --sky: #eef2ff;
  --sky-soft: #f1f5f9;
  --mint: #ecfdf5;
  --peach: #fffbeb;
  --lavender: #f5f3ff;
  --yellow: #fefce8;
  --ink: #0b1220;
  --muted: #64748b;
  --line: #e2e8f0;
  --dashed: #cbd5e1;
  --page: #f8fafc;
  --surface: #ffffff;
  --white: #ffffff;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --red: #ef4444;
  --red-soft: #fee2e2;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 4px 6px rgba(15, 23, 42, 0.05), 0 10px 15px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 12%, rgba(79, 70, 229, 0.06), transparent 24rem),
    linear-gradient(180deg, #ffffff 0%, var(--page) 100%);
  color: var(--ink);
  font: 16px/1.6 Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
a {
  touch-action: manipulation;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px max(5vw, 24px);
  background: rgba(11, 18, 32, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 7px 22px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--white);
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
}

.brand span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
  font-size: 12px;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.topbar nav a {
  color: rgba(226, 232, 240, 0.85);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.topbar nav a:hover {
  color: var(--white);
}

.back-to-site {
  padding-left: 20px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(226, 232, 240, 0.7) !important;
}

.back-to-site:hover {
  color: var(--white) !important;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 68px max(7vw, 28px);
  background:
    radial-gradient(circle at 82% 20%, rgba(79, 70, 229, 0.35), transparent 22rem),
    radial-gradient(circle at 16% 90%, rgba(20, 184, 166, 0.25), transparent 20rem),
    linear-gradient(125deg, #0b1220, #1e1b4b);
  color: var(--white);
  text-align: center;
}

.hero::after {
  position: absolute;
  right: -80px;
  bottom: -130px;
  width: 320px;
  height: 320px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  content: "";
}

.hero h1 {
  position: relative;
  z-index: 1;
  margin: 7px 0 14px;
  font-size: clamp(38px, 6vw, 66px);
  line-height: 1.08;
  letter-spacing: -2px;
}

.hero > p:not(.eyebrow) {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  color: #e2e8f0;
  font-size: 18px;
}

.eyebrow {
  margin: 0;
  color: #5eead4;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 3px;
}

.hero-badges {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.hero-badges span {
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
  font-size: 13px;
}

.notice {
  max-width: 1180px;
  margin: 26px auto -8px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 11px;
  background: var(--sky-soft);
  box-shadow: 0 5px 15px rgba(15, 23, 42, 0.05);
}

.lab-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 62px 22px 0;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 23px;
}

.section-heading > span {
  display: grid;
  min-width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: var(--white);
  box-shadow: 0 7px 18px rgba(79, 70, 229, 0.25);
  font-weight: 800;
}

.section-heading h2 {
  margin: 0;
  color: var(--navy-deep);
  font-size: 28px;
  letter-spacing: -0.4px;
}

.section-heading p {
  margin: 3px 0;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 21px;
}

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

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

.card {
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease,
    transform 0.2s ease;
}

.card:hover {
  border-color: rgba(79, 70, 229, 0.3);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.grid.two > .card:nth-child(2n),
.grid.three > .card:nth-child(3n + 2) {
  background: var(--sky-soft);
}

.grid.three > .card:nth-child(3n) {
  background: var(--mint);
}

#locator-mastery {
  background: linear-gradient(135deg, var(--page), var(--white));
}

#forms .extra-controls .card:first-child {
  background: var(--sky-soft);
}

#forms .extra-controls .card:last-child {
  background: var(--lavender);
}

#waits .extra-controls .card:first-child {
  background: var(--yellow);
}

#waits .extra-controls .card:last-child {
  background: var(--sky-soft);
}

.card h3 {
  margin: 0 0 17px;
  color: var(--navy-deep);
  font-size: 19px;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 17px;
}

.card-title-row h3 {
  margin-bottom: 0;
}

.card hr {
  margin: 25px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

label,
legend {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

label:not(.inline) {
  display: block;
  margin: 14px 0 6px;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select,
textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease,
    background 0.18s ease;
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

input:disabled {
  background: var(--sky-soft);
  color: var(--muted);
  cursor: not-allowed;
}

input[readonly] {
  background: var(--sky-soft);
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--blue);
}

fieldset {
  margin: 17px 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(241, 245, 249, 0.6);
}

.inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: 19px;
  font-weight: 500;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 15px;
}

.btn,
.small-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
  transition: filter 0.18s ease, transform 0.18s ease,
    box-shadow 0.18s ease;
}

.btn {
  min-height: 41px;
  margin: 14px 7px 0 0;
  padding: 9px 15px;
}

.small-btn {
  padding: 7px 11px;
  background: var(--sky-soft);
  color: var(--blue-dark);
}

.btn:hover,
.small-btn:hover {
  filter: brightness(0.97);
  transform: translateY(-1px);
}

.btn:focus-visible,
.small-btn:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.35);
  outline-offset: 2px;
}

.primary {
  background: var(--blue);
  color: var(--white);
  box-shadow: none;
}

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

.ghost {
  border: 1px solid var(--line);
  background: var(--sky-soft);
  color: var(--ink);
}

.success {
  background: var(--green);
  color: var(--white);
}

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

.result {
  min-height: 24px;
  margin: 13px 0 0;
  color: #15803d;
  font-weight: 700;
}

.hint {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 13px;
}

code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--sky-soft);
  color: var(--blue-dark);
}

.hidden {
  display: none !important;
}

.links {
  display: flex;
  gap: 20px;
  margin: 15px 0;
}

.links a {
  color: var(--blue);
  font-weight: 650;
}

#course-list {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  list-style: none;
}

.course-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.course-item:last-child {
  border-bottom: 0;
}

.course-item.active {
  border-left: 4px solid var(--blue);
  background: var(--sky);
}

.dom-family {
  padding: 15px;
  border: 1px dashed var(--dashed);
  border-radius: 10px;
  background: var(--sky-soft);
}

.parent-node {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.target-child {
  color: var(--blue-dark);
  font-weight: 800;
}

.button-row {
  display: flex;
  gap: 8px;
}

.button-row.wrap {
  flex-wrap: wrap;
}

.loader {
  width: 28px;
  height: 28px;
  margin: 18px 0;
  border: 3px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.progress {
  height: 12px;
  margin: 18px 0 8px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--sky-soft);
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #14b8a6);
  transition: width 0.2s;
}

.search-card,
.locator-mastery,
.extra-controls {
  margin-top: 21px;
}

.suggestions {
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: var(--white);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  list-style: none;
}

.suggestions:empty {
  display: none;
}

.suggestions li {
  padding: 10px 13px;
  cursor: pointer;
}

.suggestions li:hover {
  background: var(--sky);
}

.employee-directory {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.employee-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 5px 15px rgba(15, 23, 42, 0.06);
}

.employee-card:nth-child(2) {
  background: var(--sky-soft);
}

.employee-card:nth-child(3) {
  background: var(--mint);
}

.employee-header,
.employee-details,
.employee-actions,
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.employee-header h4 {
  margin: 0;
  color: var(--navy-deep);
}

.employee-details {
  margin: 14px 0;
  color: var(--muted);
  font-size: 13px;
}

.employee-actions {
  justify-content: flex-start;
}

.employee-action {
  padding: 7px 11px;
  border: 1px solid #c7d2fe;
  border-radius: 7px;
  background: var(--sky);
  color: var(--blue-dark);
  cursor: pointer;
}

.delete-action {
  border-color: #fecaca;
  background: var(--red-soft);
  color: var(--red);
}

.custom-dropdown {
  position: relative;
}

.custom-options {
  position: absolute;
  z-index: 10;
  width: 100%;
  max-height: 190px;
  margin: 3px 0 0;
  padding: 6px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  box-shadow: var(--shadow-hover);
  list-style: none;
}

.custom-options li {
  padding: 10px;
  border-radius: 7px;
  cursor: pointer;
}

.custom-options li:hover,
.custom-options li[aria-selected="true"] {
  background: var(--sky);
}

.date-picker {
  margin-top: 9px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.85);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-top: 11px;
}

.calendar-grid button,
.calendar-grid span {
  min-height: 35px;
  border: 0;
  border-radius: 7px;
  text-align: center;
}

.calendar-grid button {
  background: var(--sky-soft);
  color: var(--ink);
  cursor: pointer;
}

.calendar-grid button:hover {
  background: var(--sky);
  color: var(--blue-dark);
}

.calendar-grid .day-label {
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.table-toolbar {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}

.table-toolbar label {
  margin: 0;
}

.table-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
}

th,
td {
  padding: 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  background: var(--sky-soft);
  color: var(--ink);
  font-size: 13px;
}

th button {
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 800;
  cursor: pointer;
}

tbody tr:nth-child(even) {
  background: var(--sky-soft);
}

tbody tr:hover {
  background: var(--sky);
}

.status {
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}

.status.active {
  background: var(--green-soft);
  color: #15803d;
}

.status.inactive {
  background: var(--sky-soft);
  color: var(--muted);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 19px;
}

.pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.notice-box {
  margin-top: 15px;
  padding: 16px;
  border: 1px solid #fde68a;
  border-radius: 10px;
  background: var(--peach);
  color: #92400e;
}

.overlay-area {
  position: relative;
  min-height: 74px;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 10px;
  background: rgba(241, 245, 249, 0.92);
}

.loading-overlay .loader {
  margin: 0;
}

.interaction-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 57px;
  margin-bottom: 11px;
  padding: 14px;
  border: 2px dashed var(--dashed);
  border-radius: 11px;
  background: var(--sky-soft);
}

.interaction-box:hover {
  border-color: var(--blue);
  background: var(--sky);
}

.drag-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.drag-area > div {
  display: grid;
  min-height: 112px;
  place-items: center;
  border-radius: 13px;
}

#drag-item {
  border: 1px solid #c7d2fe;
  background: var(--sky);
  color: var(--blue-dark);
  font-weight: 800;
  cursor: grab;
}

#drop-zone {
  border: 2px dashed var(--dashed);
  background: var(--sky-soft);
  color: var(--muted);
}

#drop-zone.over {
  border-color: var(--green);
  background: var(--mint);
}

iframe {
  width: 100%;
  height: 190px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
}

.practice-iframe {
  display: block;
  margin-top: 9px;
}

.compact-frame {
  height: 110px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(11, 18, 32, 0.7);
  backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  width: min(460px, 100%);
  padding: 29px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.35);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 28px;
  cursor: pointer;
}

.range-control {
  width: 100%;
  accent-color: var(--blue);
}

.tooltip-trigger {
  position: relative;
}

.tooltip {
  display: inline-block;
  margin: 8px;
  padding: 8px 11px;
  border-radius: 8px;
  background: var(--navy-deep);
  color: var(--white);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.25);
  font-size: 13px;
}

.scroll-target {
  max-width: 1180px;
  margin: 74px auto;
  padding: 50px 24px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 19px;
  background:
    radial-gradient(circle at 85% 25%, rgba(20, 184, 166, 0.28), transparent 16rem),
    linear-gradient(120deg, #0b1220, #312e81);
  color: var(--white);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.25);
  text-align: center;
}

footer {
  padding: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--navy-deep);
  color: rgba(226, 232, 240, 0.75);
  text-align: center;
}

footer p {
  margin: 4px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  max-width: 330px;
  padding: 13px 17px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  background: var(--navy-deep);
  color: var(--white);
  box-shadow: var(--shadow-hover);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 0.2s;
}

.toast.show {
  opacity: 1;
  transform: none;
}

@media (max-width: 850px) {
  .topbar nav {
    display: none;
  }

  .grid.two,
  .grid.three,
  .employee-directory {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 56px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .table-toolbar {
    grid-template-columns: 1fr;
  }

  .table-toolbar label {
    margin-bottom: -7px;
  }
}

@media (max-width: 500px) {
  .lab-section {
    padding-right: 14px;
    padding-left: 14px;
  }

  .card {
    padding: 19px;
  }

  .parent-node,
  .button-row {
    flex-wrap: wrap;
  }

  .drag-area {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    letter-spacing: -1px;
  }
}

/* ============================================================
   DYNAMIC COMPONENTS
   Every `.card` can be removed (leaving a placeholder that adds
   it back) and new ones can be created from the catalog in the
   "Dynamic Components" section. See script.js for the logic.
   ============================================================ */

.card {
  position: relative;
}

.component-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.component-remove:hover:not(:disabled) {
  border-color: #fecaca;
  background: var(--red-soft);
  color: var(--red);
}

.component-remove:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.35);
  outline-offset: 2px;
}

.component-remove:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.component-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 120px;
  border: 2px dashed var(--dashed);
  background: var(--sky-soft);
  color: var(--muted);
  text-align: center;
}

.component-placeholder p {
  margin: 0;
  font-size: 14px;
}

.dynamic-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 21px;
  padding: 20px 25px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dynamic-toolbar > div {
  min-width: 220px;
}

.dynamic-toolbar label {
  margin: 0 0 6px;
}

.dynamic-toolbar .btn {
  margin: 0;
}

.dynamic-toolbar .result {
  margin: 0 0 9px;
}
