/* Lebyy Practice Lab — standalone styles (keep stable; students rely on structure) */
:root {
  --lab-bg: #f7f4ef;
  --lab-ink: #1c2a33;
  --lab-muted: #5a6b75;
  --lab-surface: #ffffff;
  --lab-line: #d9e0e6;
  --lab-teal: #0f766e;
  --lab-teal-2: #115e59;
  --lab-amber: #b45309;
  --lab-danger: #b91c1c;
  --lab-ok: #047857;
  --lab-radius: 10px;
  --lab-font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --lab-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--lab-font);
  color: var(--lab-ink);
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(15, 118, 110, 0.08), transparent 60%),
    radial-gradient(700px 380px at -5% 0%, rgba(180, 83, 9, 0.06), transparent 55%),
    var(--lab-bg);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--lab-teal); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--lab-teal);
  outline-offset: 2px;
}

.lab-shell { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.lab-top {
  background: #102a32;
  color: #e8f2f4;
  border-bottom: 3px solid var(--lab-teal);
}
.lab-top-inner {
  width: min(1100px, 100% - 2rem);
  margin: 0 auto;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.65rem 0;
}
.lab-brand-group {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}
.lab-brand-mark {
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  line-height: 1;
}
.lab-brand-mark:hover { color: #5eead4; }
.lab-brand-chip {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: #102a32;
  background: #5eead4;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  line-height: 1;
}
.lab-brand-chip:hover { filter: brightness(1.06); }
/* legacy single-link brand (kept for safety) */
.lab-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
}
.lab-brand span { color: #5eead4; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.lab-nav { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.lab-nav a {
  color: #d5e6ea;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
}
.lab-nav a:hover,
.lab-nav a.is-active { background: rgba(94, 234, 212, 0.14); color: #fff; }
.lab-exit {
  font-size: 0.82rem;
  font-family: inherit;
  color: #9fb4bb;
  text-decoration: none;
  background: transparent;
  border: 0;
  padding: 0.35rem 0.15rem;
  cursor: pointer;
  line-height: 1.2;
}
.lab-exit:hover { color: #fff; }

.lab-main {
  width: min(1100px, 100% - 2rem);
  margin: 1.75rem auto 3rem;
  flex: 1;
}
.lab-page-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
}
.lab-lead { color: var(--lab-muted); margin: 0 0 1.35rem; max-width: 62ch; }

.lab-card {
  background: var(--lab-surface);
  border: 1px solid var(--lab-line);
  border-radius: var(--lab-radius);
  padding: 1.25rem 1.35rem;
  box-shadow: 0 1px 0 rgba(28, 42, 51, 0.04);
}
.lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.lab-module {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--lab-surface);
  border: 1px solid var(--lab-line);
  border-radius: var(--lab-radius);
  padding: 1.15rem 1.2rem;
  transition: border-color 0.15s, transform 0.15s;
}
.lab-module:hover {
  border-color: var(--lab-teal);
  transform: translateY(-2px);
}
.lab-module h2 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.lab-module p { margin: 0; color: var(--lab-muted); font-size: 0.9rem; }
.lab-module .lab-tag {
  display: inline-block;
  margin-bottom: 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--lab-teal-2);
  background: rgba(15, 118, 110, 0.1);
  padding: 0.18rem 0.45rem;
  border-radius: 4px;
}

.lab-hint {
  background: #fffbeb;
  border: 1px solid #f6e2b3;
  border-radius: var(--lab-radius);
  padding: 0.9rem 1rem;
  margin-bottom: 1.1rem;
  font-size: 0.92rem;
}
.lab-hint code {
  font-family: var(--lab-mono);
  font-size: 0.84em;
  background: rgba(28, 42, 51, 0.06);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
.lab-hint strong { color: var(--lab-ink); }

.lab-form { display: grid; gap: 0.85rem; max-width: 420px; }
.lab-field { display: grid; gap: 0.3rem; }
.lab-field label { font-size: 0.86rem; font-weight: 650; }
.lab-field input,
.lab-field select,
.lab-field textarea {
  width: 100%;
  border: 1px solid #c5d0d7;
  border-radius: 8px;
  padding: 0.62rem 0.75rem;
  font: inherit;
  background: #fff;
}
.lab-field textarea { min-height: 96px; resize: vertical; }
.lab-check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.lab-check-row { display: flex; flex-wrap: wrap; gap: 0.85rem 1.2rem; }

.lab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 42px;
  padding: 0.55rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.lab-btn-primary { background: var(--lab-teal); color: #fff; }
.lab-btn-primary:hover { background: var(--lab-teal-2); }
.lab-btn-secondary {
  background: #fff;
  color: var(--lab-ink);
  border-color: #c5d0d7;
}
.lab-btn-secondary:hover { border-color: var(--lab-teal); color: var(--lab-teal-2); }
.lab-btn-danger { background: var(--lab-danger); color: #fff; }
.lab-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 0.35rem; }

.lab-alert {
  display: none;
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.lab-alert.is-visible { display: block; }
.lab-alert-error { background: #fef2f2; color: var(--lab-danger); border: 1px solid #fecaca; }
.lab-alert-success { background: #ecfdf5; color: var(--lab-ok); border: 1px solid #a7f3d0; }
.lab-alert-info { background: #f0fdfa; color: var(--lab-teal-2); border: 1px solid #99f6e4; }

.lab-table-wrap { overflow-x: auto; }
table.lab-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.lab-table th,
.lab-table td {
  text-align: left;
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--lab-line);
}
.lab-table th {
  background: #f0f4f6;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  user-select: none;
}
.lab-table th:hover { background: #e5ecef; }
.lab-table tbody tr:hover { background: #fafbfc; }
.lab-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  align-items: center;
}
.lab-toolbar input {
  min-width: 200px;
  flex: 1;
  border: 1px solid #c5d0d7;
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font: inherit;
}

.lab-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #cce7e4;
  border-top-color: var(--lab-teal);
  border-radius: 50%;
  animation: labSpin 0.8s linear infinite;
}
@keyframes labSpin { to { transform: rotate(360deg); } }
.lab-hidden { display: none !important; }
.lab-status-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 40px;
  margin: 0.75rem 0;
}

.lab-toast-host {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  gap: 0.5rem;
  z-index: 50;
}
.lab-toast {
  background: #102a32;
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(16, 42, 50, 0.25);
}

.lab-cart-layout {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 1rem;
}
@media (max-width: 800px) {
  .lab-cart-layout { grid-template-columns: 1fr; }
}
.lab-product {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--lab-line);
}
.lab-product:last-child { border-bottom: 0; }
.lab-product h3 { margin: 0 0 0.2rem; font-size: 1rem; }
.lab-product p { margin: 0; color: var(--lab-muted); font-size: 0.86rem; }
.lab-total {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  font-size: 1.05rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--lab-line);
}
.lab-total-wrong {
  /* intentional soft-assert target for students */
  color: var(--lab-amber);
}

.lab-frame-box {
  border: 1px solid var(--lab-line);
  border-radius: var(--lab-radius);
  overflow: hidden;
  background: #fff;
  height: 220px;
}
.lab-frame-box iframe { width: 100%; height: 100%; border: 0; }

.lab-foot {
  width: min(1100px, 100% - 2rem);
  margin: 0 auto 1.5rem;
  color: var(--lab-muted);
  font-size: 0.8rem;
}

/* ── Lab site footer — same layout as lebyy.com ── */
.lab-site-footer {
  display: block !important;
  align-self: stretch !important;
  box-sizing: border-box;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 2.5rem 0 !important;
  background: #0d1f3a !important;
  border-top: 1px solid rgba(66, 198, 255, 0.1);
  flex-shrink: 0;
  font-family: Manrope, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: #90aad6;
}

.lab-site-footer .lab-footer-inner {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 2rem;
  box-sizing: border-box;
  width: min(100% - 2rem, 1160px) !important;
  max-width: 1160px !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

.lab-site-footer .footer-slim-brand {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start;
  gap: 0.85rem;
  flex: 0 0 auto;
}

.lab-site-footer .footer-logo-wrap {
  display: inline-flex !important;
  background: #fff !important;
  border-radius: 10px;
  padding: 4px 14px;
  margin: 0;
  text-decoration: none;
  line-height: 0;
}

.lab-site-footer .footer-logo {
  height: 60px !important;
  width: auto !important;
  max-width: 180px;
  object-fit: contain;
  display: block;
}

.lab-site-footer .footer-slim-socials {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.85rem;
}

.lab-site-footer a.social-link {
  width: 36px !important;
  height: 36px !important;
  border-radius: 10px;
  background: rgba(98, 136, 196, 0.12) !important;
  border: 1px solid rgba(98, 136, 196, 0.25) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #90aad6 !important;
  text-decoration: none !important;
  flex: 0 0 36px;
}

.lab-site-footer a.social-link:hover {
  background: rgba(83, 214, 255, 0.15) !important;
  border-color: rgba(83, 214, 255, 0.4) !important;
  color: #42c6ff !important;
}

.lab-site-footer .footer-slim-divider {
  width: 1px !important;
  height: 72px !important;
  min-height: 72px !important;
  align-self: center;
  background: rgba(66, 198, 255, 0.12) !important;
  flex: 0 0 1px !important;
}

.lab-site-footer .footer-slim-legal,
.lab-site-footer .footer-slim-contact {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center;
  gap: 0.55rem !important;
  flex: 0 1 auto;
  min-width: 0;
}

.lab-site-footer .footer-slim-legal > span,
.lab-site-footer .footer-slim-contact > span {
  display: block !important;
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #42c6ff !important;
  opacity: 0.65;
  margin: 0 !important;
}

.lab-site-footer .footer-slim-legal a,
.lab-site-footer .footer-slim-contact a {
  display: block !important;
  color: #90aad6 !important;
  font-size: 0.88rem !important;
  text-decoration: none !important;
  line-height: 1.5;
}

.lab-site-footer .footer-slim-legal a:hover,
.lab-site-footer .footer-slim-contact a:hover {
  color: #dbe7ff !important;
}

.lab-site-footer .footer-slim-copy {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  gap: 0.3rem;
  text-align: right !important;
  flex: 0 0 auto;
  margin-left: auto;
}

.lab-site-footer .footer-slim-copy span {
  display: block !important;
  font-size: 0.8rem !important;
  white-space: nowrap;
  color: #90aad6 !important;
}

.lab-site-footer .footer-slim-copy span:last-child {
  color: #ffbf57 !important;
}

@media (max-width: 900px) {
  .lab-site-footer .lab-footer-inner {
    flex-wrap: wrap !important;
    justify-content: center !important;
    text-align: center;
    row-gap: 1.75rem;
  }
  .lab-site-footer .footer-slim-brand,
  .lab-site-footer .footer-slim-legal,
  .lab-site-footer .footer-slim-contact {
    align-items: center !important;
    width: 100%;
  }
  .lab-site-footer .footer-slim-divider {
    width: 60px !important;
    height: 1px !important;
    min-height: 1px !important;
    flex-basis: 60px !important;
  }
  .lab-site-footer .footer-slim-copy {
    align-items: center !important;
    text-align: center !important;
    margin-left: 0;
    width: 100%;
  }
}

.lab-auth-wrap {
  max-width: 460px;
  margin: 0 auto;
}
.lab-auth-wrap .lab-card { padding: 1.5rem; }
.lab-badge-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.85rem; }
.lab-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--lab-teal-2);
}
