/* murid-murid.com AI Lab — Murid Murid BOLD tokens (murid-murid.com/brand). Light theme only. */
:root {
  --brand: #4F46E5; --brand-dark: #3730A3; --brand-rim: #818CF8; --brand-light: #EEF2FF;
  --amber: #F59E0B; --amber-dark: #B45309; --amber-tint: #FEF3C7; --amber-ink: #3D1F02;
  --red: #EF4444; --red-dark: #B91C1C; --red-tint: #FEF2F2;
  --ink: #0F172A; --ink-2: #475569; --ink-3: #94A3B8;
  --surface: #F8FAFC; --card: #FFFFFF; --border: #E2E8F0;
  --r-xl: 38px; --r-md: 20px; --r-lg: 28px;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--surface); color: var(--ink); font: 500 16px/1.5 'Plus Jakarta Sans', system-ui, sans-serif; min-height: 100vh; }
h1, h2, h3 { text-wrap: balance; margin: 0; letter-spacing: -0.02em; }
p { text-wrap: pretty; }
svg.lucide { width: 1.15em; height: 1.15em; stroke-width: 2.25; vertical-align: -0.2em; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; }
.wordmark { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.03em; color: var(--ink); text-decoration: none; }
.wordmark small { font-weight: 700; color: var(--brand); margin-left: 6px; font-size: .8em; }

/* 3D press buttons (.d3 from the brand kit) */
.d3 { box-shadow: 0 var(--dep, 5px) 0 var(--d), inset 0 0 0 var(--rimw, 3px) var(--rim); transition: transform .1s ease, box-shadow .1s ease; }
.d3:active:not(:disabled) { transform: translateY(calc(var(--dep, 5px) - 1px)); box-shadow: 0 1px 0 var(--d), inset 0 0 0 var(--rimw, 3px) var(--rim); }
.btn { --d: var(--brand-dark); --rim: var(--brand-rim); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--r-md); background: var(--brand); color: #fff; font: 800 1rem/1 inherit; font-family: inherit;
  padding: 16px 22px; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { --d: #CBD5E1; --rim: #fff; background: #fff; color: var(--ink); }
.btn.amber { --d: var(--amber-dark); --rim: #FCD34D; background: var(--amber); color: var(--amber-ink); }
.btn.small { padding: 10px 14px; font-size: .9rem; border-radius: 14px; --dep: 3px; }
.btn.block { width: 100%; }

.card { background: var(--card); border: 2px solid var(--border); border-radius: var(--r-lg); padding: 28px; }
label { display: block; font-weight: 700; font-size: .95rem; margin: 16px 0 6px; }
input[type=text], input[type=email], input[type=password], textarea {
  width: 100%; font: 600 1.1rem/1.3 inherit; font-family: inherit; color: var(--ink); background: #fff;
  border: 2px solid var(--border); border-radius: 16px; padding: 14px 16px; outline: none; }
input:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-light); }
.pin { font-family: var(--mono); letter-spacing: .6em; font-size: 1.6rem !important; text-align: center; }
.msg { margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; font-weight: 700; display: none; }
.msg.show { display: flex; gap: 8px; align-items: flex-start; }
.msg.error { background: var(--red-tint); color: var(--red-dark); }
.msg.warn { background: var(--amber-tint); color: var(--amber-ink); }
.muted { color: var(--ink-2); }
.link { background: none; border: 0; color: var(--brand); font: 700 .95rem inherit; font-family: inherit; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }

/* Screen 1: sign in. One saturated block + a large cropped Mumu. */
.signin { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; max-width: 1180px; margin: 0 auto; padding: 8px 24px 48px; align-items: stretch; }
.hero { position: relative; overflow: hidden; background: var(--brand); color: #fff; border-radius: var(--r-xl); padding: 48px; min-height: 560px; }
.hero h1 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; max-width: 12ch; line-height: 1.05; }
.hero p { font-size: 1.15rem; max-width: 22ch; opacity: .92; }
.hero img { position: absolute; right: -36px; bottom: -90px; width: min(50%, 300px); }
.hero h1, .hero p { position: relative; z-index: 1; }
.signin .card { align-self: center; }
.signin h2 { font-size: 1.75rem; font-weight: 800; }

/* Screen 10: add students + login cards */
.page { max-width: 1180px; margin: 0 auto; padding: 8px 24px 48px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.band { background: var(--brand); color: #fff; border-radius: var(--r-xl); padding: 28px 32px; margin-bottom: 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.band h1 { font-size: 2rem; font-weight: 800; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 700; margin: 14px 0; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
td.mono, .mono { font-family: var(--mono); }
.tag { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: .8rem; font-weight: 800; }
.tag.locked { background: var(--red-tint); color: var(--red-dark); }
.tag.ok { background: var(--brand-light); color: var(--brand-dark); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 16px; }
.login-card { border: 2px dashed var(--brand-rim); border-radius: var(--r-md); padding: 16px 18px; background: #fff; break-inside: avoid; }
.login-card .who { font-weight: 800; font-size: 1.1rem; }
.login-card dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 10px 0 0; }
.login-card dt { color: var(--ink-2); font-weight: 700; }
.login-card dd { margin: 0; font-family: var(--mono); font-weight: 700; font-size: 1.15rem; }
.login-card .where { margin-top: 8px; font-size: .8rem; color: var(--ink-2); }
.hidden { display: none !important; }

@media (max-width: 860px) {
  .signin, .grid2 { grid-template-columns: 1fr; }
  .hero { min-height: 280px; padding: 32px; }
  .hero img { width: 46%; bottom: -50px; }
  .topbar, .signin, .page { padding-left: 16px; padding-right: 16px; }
}
@media print {
  body { background: #fff; }
  .topbar, .page > :not(.print-root) { display: none !important; }
  .print-root { display: block !important; }
  .print-root .no-print { display: none !important; }
  .cards { grid-template-columns: repeat(3, 1fr); }
}

/* Screen 2: home */
.credits { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.credits .big { font-size: 4.5rem; font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.tile { background: #fff; border: 2px solid var(--border); border-radius: var(--r-md); padding: 18px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink); cursor: pointer; font: inherit; text-align: left; }
.tile:hover { border-color: var(--brand-rim); }
.tile h3 { font-size: 1.1rem; }
.tile.new { background: var(--brand-light); border-style: dashed; border-color: var(--brand-rim); }
.tag.vis { background: var(--surface); color: var(--ink-2); border: 1px solid var(--border); }
.tag.paused { background: var(--amber-tint); color: var(--amber-ink); }
.section-title { display: flex; justify-content: space-between; align-items: center; margin: 28px 0 12px; gap: 12px; flex-wrap: wrap; }

/* Screens 3–8: editor */
.editor { display: grid; grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); gap: 20px; padding: 0 24px 24px; height: calc(100vh - 72px); min-height: 560px; }
.chat { display: flex; flex-direction: column; background: #fff; border: 2px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.bubble { padding: 10px 14px; border-radius: 16px; max-width: 92%; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.me { align-self: flex-end; background: var(--brand); color: #fff; }
.bubble.mumu { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); }
.bubble.blocked { align-self: stretch; background: var(--amber-tint); color: var(--amber-ink); font-weight: 700; }
.bubble.typing { color: var(--ink-3); font-style: italic; }
.card-msg { align-self: stretch; background: #fff; border: 2px solid var(--brand-rim); border-radius: 18px; padding: 12px 14px; display: grid; gap: 8px; }
.card-msg.question { border-color: var(--border); background: var(--surface); }
.card-msg p { margin: 0; }
.plan-head { display: flex; gap: 8px; align-items: center; }
.plan-head svg { width: 18px; height: 18px; color: var(--brand); }
.plan-head .tag { margin-left: auto; }
.plan-steps { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: .92rem; }
.plan-files { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.plan-files li { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--border); border-radius: 10px; padding: 3px 8px; font-size: .82rem; }
.plan-files code { font: 700 .8rem var(--mono); }
.plan-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.composer { border-top: 2px solid var(--border); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.composer textarea { min-height: 72px; resize: vertical; font-size: 1rem; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 2px solid var(--border); background: #fff; border-radius: 999px; padding: 6px 12px; font: 700 .9rem inherit; font-family: inherit; cursor: pointer; color: var(--ink); display: inline-flex; gap: 6px; align-items: center; }
.chip:hover { border-color: var(--brand-rim); color: var(--brand-dark); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.steps li { display: flex; gap: 10px; align-items: center; color: var(--ink-3); font-weight: 700; }
.steps li.now { color: var(--brand); }
.steps li.done { color: var(--ink); }
.stage { display: flex; flex-direction: column; background: #fff; border: 2px solid var(--border); border-radius: var(--r-lg); overflow: hidden; min-width: 0; }
.stage-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 2px solid var(--border); flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; }
.tabs button { border: 0; background: none; font: 800 .95rem inherit; font-family: inherit; padding: 8px 12px; border-radius: 12px; cursor: pointer; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.tabs button[aria-selected=true] { background: var(--brand-light); color: var(--brand-dark); }
.pane { flex: 1; min-height: 0; position: relative; }
.pane iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.code { margin: 0; height: 100%; overflow: auto; background: #0F172A; color: #E2E8F0; font: 500 13px/1.55 var(--mono); padding: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
textarea.code { width: 100%; border: 0; border-radius: 0; resize: none; outline: none; }
.empty { height: 100%; display: grid; place-items: center; text-align: center; color: var(--ink-2); padding: 24px; }
.badge-ok { display: inline-flex; gap: 6px; align-items: center; background: #DCFCE7; color: #166534; font-weight: 800; font-size: .85rem; padding: 6px 10px; border-radius: 999px; }
.actions { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 4px; max-height: 160px; overflow-y: auto; font-size: .9rem; }
.actions li { display: flex; gap: 8px; align-items: center; color: var(--ink-2); font-weight: 700; }
.actions li code { font-family: var(--mono); font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.actions li.refused { color: var(--amber-ink); }
.actions li svg, .file-bar svg, .files svg { width: 16px; height: 16px; flex: none; }
.file-bar { display: flex; gap: 8px; align-items: center; padding: 8px 14px; background: #1E293B; color: #E2E8F0; font: 700 13px/1.4 var(--mono); }
.code-pane:not(.hidden) { display: grid; grid-template-columns: 200px minmax(0, 1fr); }
.files { border-right: 2px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.files ul { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; display: grid; gap: 4px; align-content: start; }
.files button { width: 100%; display: flex; gap: 8px; align-items: center; border: 0; background: none; border-radius: 10px; padding: 7px 8px; font: 700 13px/1.3 var(--mono); color: var(--ink-2); cursor: pointer; text-align: left; overflow-wrap: anywhere; }
.files button:hover { background: var(--surface); color: var(--ink); }
.files button[aria-current=true] { background: var(--brand-light); color: var(--brand-dark); }
.files small { margin-left: auto; color: var(--ink-3); font-weight: 500; }
.new-file { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-top: 2px solid var(--border); }
.new-file input { min-width: 0; flex: 1; font: 500 13px var(--mono); border: 2px solid var(--border); border-radius: 10px; padding: 6px 8px; }
.code-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.code-main textarea { flex: 1; }
.code-foot { padding: 10px; border-top: 2px solid var(--border); display: flex; gap: 10px; align-items: center; }
@media (max-width: 860px) { .code-pane:not(.hidden) { grid-template-columns: 1fr; grid-template-rows: auto minmax(360px, 1fr); } .files { border-right: 0; border-bottom: 2px solid var(--border); } .files ul { max-height: 140px; } }
.history { list-style: none; margin: 0; padding: 12px; overflow: auto; height: 100%; display: grid; gap: 8px; align-content: start; }
.history li { display: flex; justify-content: space-between; align-items: center; border: 2px solid var(--border); border-radius: 14px; padding: 10px 12px; }
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: grid; place-items: center; padding: 16px; z-index: 10; }
.modal .card { width: min(520px, 100%); }
.choice { display: flex; gap: 12px; align-items: center; border: 2px solid var(--border); border-radius: 16px; padding: 14px; margin: 10px 0; cursor: pointer; font-weight: 700; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-light); }
.live-link { display: flex; gap: 8px; align-items: center; background: var(--surface); border: 2px solid var(--border); border-radius: 14px; padding: 10px 12px; font-family: var(--mono); overflow-wrap: anywhere; }
#qr svg { width: 180px; height: 180px; }
@media (max-width: 860px) {
  .editor { grid-template-columns: 1fr; height: auto; padding: 0 16px 16px; }
  .chat { max-height: 70vh; }
  .stage { min-height: 70vh; }
}

/* Screens 9–11: teacher console */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border: 2px solid var(--border); border-radius: var(--r-md); padding: 16px 18px; }
.stat .n { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.stat .l { color: var(--ink-2); font-weight: 700; font-size: .9rem; }
.req { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border: 2px solid var(--amber); background: var(--amber-tint); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 10px; color: var(--amber-ink); }
.row-link { color: var(--ink); font-weight: 800; text-decoration: none; }
.row-link:hover { color: var(--brand); text-decoration: underline; }
.warn-count { font-family: var(--mono); font-weight: 700; }
.warn-count.high { color: var(--red-dark); }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline input[type=number] { width: 90px; font: 700 1rem inherit; font-family: inherit; border: 2px solid var(--border); border-radius: 12px; padding: 9px 10px; }
.chatlog { display: flex; flex-direction: column; gap: 8px; max-height: 480px; overflow-y: auto; padding: 4px; }
.chatlog .meta { font-size: .8rem; color: var(--ink-3); }
.pin-box { font-family: var(--mono); font-size: 1.6rem; font-weight: 700; letter-spacing: .3em; }
.table-wrap { overflow-x: auto; }
