:root {
  --ink: #18201d;
  --muted: #65716c;
  --paper: #f5f3ed;
  --panel: #fffdf7;
  --line: #d9ddd7;
  --green: #1e5f4b;
  --green-2: #dcebe3;
  --orange: #ef8d4d;
  --red: #a64236;
  --shadow: 0 20px 60px rgba(31, 49, 42, .10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background:
  radial-gradient(circle at 85% 5%, rgba(239,141,77,.18), transparent 26rem),
  radial-gradient(circle at 10% 30%, rgba(30,95,75,.10), transparent 28rem),
  var(--paper);
}
button, input, textarea, select { font: inherit; }
button {
  border: 0; border-radius: 999px; padding: .8rem 1.15rem; cursor: pointer;
  color: white; background: var(--green); font-weight: 700;
}
button:hover { filter: brightness(.94); }
button.secondary { background: var(--green-2); color: var(--green); }
button.ghost { background: transparent; color: var(--green); padding-inline: 0; }
button:disabled { opacity: .55; cursor: wait; }
input, textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: .8rem; padding: .75rem;
  background: white; color: var(--ink);
}
textarea { resize: vertical; }
label { display: grid; gap: .4rem; font-weight: 650; font-size: .92rem; }
label.check { display: flex; align-items: center; }
label.check input { width: auto; }
form { display: grid; gap: 1rem; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-family: Georgia, serif; font-size: clamp(1.4rem, 3vw, 2.2rem); }
h2 { font-family: Georgia, serif; font-size: clamp(2rem, 5vw, 4rem); line-height: 1; max-width: 13ch; }
h3 { font-family: Georgia, serif; font-size: 1.4rem; }
.topbar, footer {
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  padding: 1.4rem clamp(1rem, 5vw, 5rem); border-bottom: 1px solid rgba(24,32,29,.12);
}
.topbar { background: rgba(245,243,237,.75); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 10; }
.eyebrow, .kicker { font-size: .72rem; letter-spacing: .15em; font-weight: 850; color: var(--green); margin-bottom: .55rem; }
.userbar { display: flex; gap: 1rem; align-items: center; }
main { width: min(1200px, calc(100% - 2rem)); margin: 0 auto; padding: 3rem 0 6rem; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.notice { position: fixed; right: 1rem; top: 6.5rem; max-width: 30rem; z-index: 20; border-radius: 1rem; padding: 1rem 1.2rem; background: var(--ink); color: white; box-shadow: var(--shadow); }
.notice.error { background: var(--red); }
.auth-card {
  min-height: 65vh; display: grid; grid-template-columns: 1.3fr .7fr; gap: clamp(2rem, 8vw, 8rem);
  align-items: center; background: rgba(255,253,247,.72); border: 1px solid rgba(255,255,255,.8);
  padding: clamp(2rem, 6vw, 5rem); border-radius: 2rem; box-shadow: var(--shadow);
}
.hero { display: flex; justify-content: space-between; gap: 2rem; align-items: end; margin-bottom: 2.5rem; }
.hero h2 { margin-bottom: 1rem; }
.layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(18rem, .5fr); gap: 2rem; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 1.35rem; border-radius: 1.2rem; box-shadow: 0 10px 30px rgba(31,49,42,.05); margin-bottom: 1rem; }
.panel.warning { border-color: var(--orange); background: #fff8ef; }
.task-list { display: grid; gap: 1rem; }
.task {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.2rem;
  padding: 1.3rem; background: var(--panel); border: 1px solid var(--line); border-radius: 1.2rem;
}
.task-index { width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center; background: var(--green-2); color: var(--green); font-weight: 850; }
.task h3 { margin-bottom: .3rem; }
.task-actions { display: grid; gap: .55rem; min-width: 9rem; }
.meta { display: flex; flex-wrap: wrap; gap: .5rem 1rem; color: var(--muted); font-size: .86rem; }
.tag { background: #ece9df; border-radius: 999px; padding: .25rem .55rem; }
.session-shell { width: min(850px, 100%); margin: 2rem auto; }
.stage { display: inline-block; background: var(--green-2); color: var(--green); padding: .35rem .7rem; border-radius: 999px; font-weight: 750; }
.chat { display: grid; gap: 1rem; min-height: 12rem; margin: 2rem 0; }
.bubble { max-width: 85%; padding: 1rem 1.15rem; border-radius: 1.2rem; white-space: pre-wrap; line-height: 1.55; }
.bubble.student { margin-left: auto; background: var(--green); color: white; border-bottom-right-radius: .3rem; }
.bubble.tutor { background: white; border: 1px solid var(--line); border-bottom-left-radius: .3rem; }
.action-row { display: flex; flex-wrap: wrap; gap: .7rem; }
.parent-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.parent-grid .panel:last-child { grid-column: 1 / -1; }
.approval { border-top: 1px solid var(--line); padding: 1rem 0; }
.approval-actions { display: flex; gap: .5rem; }
.status-row { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: .65rem 0; }
.ok { color: var(--green); font-weight: 750; }
.bad { color: var(--red); font-weight: 750; }
code { display: block; overflow-wrap: anywhere; padding: .8rem; background: #eee9dc; border-radius: .6rem; margin-bottom: 1rem; }
footer { border-top: 1px solid rgba(24,32,29,.12); border-bottom: 0; color: var(--muted); font-size: .8rem; }
dialog {
  width: min(92vw, 30rem); border: 0; border-radius: 1.25rem; padding: 0;
  box-shadow: 0 24px 80px rgba(22,34,31,.25);
}
dialog::backdrop { background: rgba(18,30,27,.52); backdrop-filter: blur(4px); }
.dialog-form { display: grid; gap: 1rem; padding: 2rem; }

@media (max-width: 800px) {
  .auth-card, .layout, .parent-grid { grid-template-columns: 1fr; }
  .parent-grid .panel:last-child { grid-column: auto; }
  .hero { align-items: start; flex-direction: column; }
  .task { grid-template-columns: auto 1fr; }
  .task-actions { grid-column: 1 / -1; }
  footer { flex-direction: column; align-items: flex-start; }
}
