:root {
  --ink: #17211f;
  --muted: #61706d;
  --line: #d7e0dd;
  --soft: #f4f8f6;
  --panel: #ffffff;
  --panel-2: #edf5f2;
  --accent: #0f8f72;
  --accent-dark: #096550;
  --accent-soft: #dff4ee;
  --gold: #f3b23d;
  --blue: #4777d8;
  --rose: #c65374;
  --shadow: 0 18px 42px rgba(33, 52, 48, 0.12);
  --radius: 8px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: #f7faf9;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 278px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  min-height: 48px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border-radius: var(--radius);
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong {
  display: block;
  line-height: 1.1;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.nav-item span:first-child {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: currentColor;
}

.nav-item:hover,
.nav-item.active {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: #bde8dd;
}

.plan-card {
  margin-top: auto;
  padding: 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.plan-card strong {
  display: block;
  margin-top: 3px;
}

.plan-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.main {
  min-width: 0;
  padding: 22px 28px 42px;
}

.topbar {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: 0;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 420px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  width: min(360px, 100%);
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
}

.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.view-root {
  display: grid;
  gap: 18px;
}

.eyebrow {
  margin: 0;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.grid.two {
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
}

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

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

.panel,
.tool-card,
.metric-card,
.room-card,
.history-card,
.collection-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(23, 33, 31, 0.03);
}

.panel {
  padding: 18px;
}

.panel-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel-header h2,
.panel-header h3,
.section-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

.panel-header p,
.muted {
  color: var(--muted);
}

.panel-header p {
  margin: 4px 0 0;
}

.hero-panel {
  min-height: 280px;
  padding: 24px;
  overflow: hidden;
  position: relative;
  display: grid;
  align-content: space-between;
  color: #fff;
  background:
    linear-gradient(110deg, rgba(10, 93, 76, 0.95), rgba(21, 36, 47, 0.85)),
    url("https://images.unsplash.com/photo-1522202176988-66273c2fd55f?auto=format&fit=crop&w=1600&q=80")
      center/cover;
  border: 0;
  box-shadow: var(--shadow);
}

.hero-panel p,
.hero-panel .eyebrow {
  color: rgba(255, 255, 255, 0.86);
}

.hero-panel h2 {
  max-width: 780px;
  margin: 12px 0 10px;
  font-size: clamp(32px, 6vw, 58px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-panel .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  border-color: #adc0bb;
}

.btn.primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.btn.primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  color: #962f45;
  border-color: #f0bac6;
  background: #fff7f9;
}

.btn.small {
  min-height: 30px;
  padding: 0 9px;
  font-size: 13px;
}

.hero-panel .btn.ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.38);
}

.metric-card {
  padding: 16px;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.tool-card {
  display: grid;
  gap: 12px;
  min-height: 174px;
  padding: 14px;
  text-align: left;
}

button.tool-card {
  cursor: pointer;
}

.tool-card:hover,
.tool-card.selected {
  border-color: #80cdbb;
  box-shadow: 0 10px 24px rgba(26, 114, 93, 0.11);
}

.tool-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

.tool-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.pill,
.category-chip,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 700;
}

.status-pill.warning {
  color: #8a5a00;
  background: #fff0c8;
}

.status-pill.blue {
  color: #174b9a;
  background: #e7efff;
}

.category-row,
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.category-chip,
.segmented button {
  border: 1px solid var(--line);
  background: #fff;
}

.category-chip.active,
.segmented button.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label,
.field span.label {
  font-size: 13px;
  font-weight: 750;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: 0;
}

.field textarea {
  min-height: 116px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 143, 114, 0.12);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 13px;
}

.output-pane {
  display: grid;
  grid-template-rows: auto minmax(320px, 1fr) auto;
  gap: 10px;
  min-height: 630px;
}

.output-editor {
  min-height: 430px;
  padding: 18px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  line-height: 1.55;
  white-space: pre-wrap;
}

.output-editor:empty::before {
  content: "Generated output will appear here. It stays editable so teachers can revise before sharing.";
  color: var(--muted);
}

.split-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.empty-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 22px;
  color: var(--muted);
  text-align: center;
  background: var(--soft);
  border: 1px dashed #b7c7c2;
  border-radius: var(--radius);
}

.list {
  display: grid;
  gap: 10px;
}

.history-card,
.room-card,
.collection-card {
  padding: 14px;
}

.history-card h3,
.room-card h3,
.collection-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.history-card p,
.room-card p,
.collection-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
}

.chat-log {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 460px;
  max-height: 62vh;
  overflow: auto;
  padding: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.message {
  max-width: 82%;
  padding: 11px 12px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  line-height: 1.45;
}

.message.user {
  justify-self: end;
  color: #fff;
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.chat-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 10px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  background: #fff;
}

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

th {
  color: var(--muted);
  background: var(--soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tr:last-child td {
  border-bottom: 0;
}

.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.integration {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #dce5e2;
}

.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.toggle.on {
  background: var(--accent);
}

.toggle.on::after {
  left: 23px;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: grid;
  gap: 8px;
}

.toast {
  max-width: 340px;
  padding: 12px 14px;
  color: #fff;
  background: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1120px) {
  .grid.two,
  .chat-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }

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

  .plan-card {
    margin-top: 0;
  }

  .main {
    padding: 18px 14px 34px;
  }

  .topbar {
    display: grid;
  }

  .topbar-actions {
    min-width: 0;
    width: 100%;
    flex-wrap: wrap;
  }

  .search-box {
    width: 100%;
  }

  .grid.three,
  .grid.four,
  .form-grid,
  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    min-height: 390px;
  }

  .message {
    max-width: 100%;
  }
}

/* Launch-grade visual pass */
:root {
  --ink: #14211f;
  --muted: #657471;
  --line: #dce6e2;
  --soft: #f5f8f7;
  --panel: #ffffff;
  --panel-2: #eef5f2;
  --accent: #0a8f70;
  --accent-dark: #08624e;
  --accent-soft: #e2f5ef;
  --gold: #e8a72f;
  --blue: #416fd0;
  --rose: #bd4b6a;
  --shadow: 0 22px 60px rgba(17, 34, 31, 0.12);
}

body {
  background:
    linear-gradient(180deg, rgba(232, 244, 240, 0.9), rgba(247, 250, 249, 0.5) 300px),
    #f7faf9;
}

.sidebar {
  color: rgba(255, 255, 255, 0.88);
  background:
    linear-gradient(180deg, #10211f 0%, #142b2c 54%, #18313d 100%);
  border-right: 0;
  box-shadow: 18px 0 42px rgba(14, 32, 30, 0.12);
}

.brand,
.brand small,
.sidebar .eyebrow,
.plan-card p {
  color: inherit;
}

.brand-mark {
  color: #11211f;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.brand strong {
  color: #ffffff;
  font-size: 18px;
}

.brand small,
.plan-card p {
  color: rgba(255, 255, 255, 0.66);
}

.nav-list {
  gap: 8px;
}

.nav-item {
  color: rgba(255, 255, 255, 0.72);
  border-color: transparent;
  min-height: 44px;
}

.nav-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  font-weight: 800;
}

.nav-item:hover,
.nav-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

.nav-item.active .nav-icon {
  color: #0f241f;
  background: #ffffff;
}

.plan-card {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: none;
}

.plan-card .eyebrow {
  color: #a7f0df;
}

.full-width {
  width: 100%;
  margin-top: 12px;
}

.main {
  padding: 26px 32px 48px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  margin: -26px -32px 22px;
  padding: 22px 32px 18px;
  background: rgba(247, 250, 249, 0.86);
  border-bottom: 1px solid rgba(215, 224, 221, 0.72);
  backdrop-filter: blur(14px);
}

.topbar-actions {
  justify-content: flex-end;
  min-width: min(720px, 58vw);
}

.search-box,
.role-select {
  min-height: 44px;
  background: rgba(255, 255, 255, 0.92);
  border-color: #cfdbd7;
  box-shadow: 0 8px 24px rgba(16, 33, 31, 0.05);
}

.search-box span,
.role-select span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.role-select {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.role-select select {
  min-height: 32px;
  border: 0;
  color: var(--ink);
  background: transparent;
  outline: 0;
}

.panel,
.tool-card,
.metric-card,
.room-card,
.history-card,
.collection-card {
  border-color: #dce6e2;
  box-shadow: 0 10px 30px rgba(25, 45, 41, 0.06);
}

.panel {
  padding: 20px;
}

.hero-panel {
  min-height: 330px;
  isolation: isolate;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto 20px 20px auto;
  width: 230px;
  height: 118px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05)),
    rgba(255, 255, 255, 0.08);
  z-index: -1;
}

.metric-card {
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), var(--blue));
}

.tool-card {
  position: relative;
  overflow: hidden;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.tool-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--blue), var(--gold));
}

.tool-card:hover,
.tool-card.selected {
  transform: translateY(-2px);
}

.tool-card.selected {
  outline: 3px solid rgba(10, 143, 112, 0.16);
}

.pill,
.category-chip,
.status-pill {
  border: 1px solid rgba(10, 143, 112, 0.12);
}

.btn {
  font-weight: 760;
  box-shadow: 0 1px 0 rgba(18, 33, 31, 0.04);
}

.btn.primary {
  background: linear-gradient(180deg, #10a17f, var(--accent-dark));
  box-shadow: 0 10px 22px rgba(10, 143, 112, 0.22);
}

.btn.primary:hover {
  background: linear-gradient(180deg, #0f9678, #064f40);
}

.output-editor {
  background:
    linear-gradient(180deg, #ffffff, #fbfdfc);
  box-shadow: inset 0 1px 0 rgba(20, 33, 31, 0.04);
}

.chat-log {
  background:
    linear-gradient(180deg, rgba(238, 245, 242, 0.9), rgba(255, 255, 255, 0.7));
}

.message {
  box-shadow: 0 8px 18px rgba(21, 43, 39, 0.06);
}

.integration {
  box-shadow: 0 8px 20px rgba(21, 43, 39, 0.05);
}

.launch-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.launch-step {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.launch-step strong {
  display: block;
  margin-bottom: 4px;
}

.workspace-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border: 1px solid #cfe1dc;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #ffffff, #eef7f4);
}

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

@media (max-width: 1120px) {
  .launch-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar-actions {
    min-width: 0;
  }
}

@media (max-width: 820px) {
  .main {
    padding: 18px 14px 34px;
  }

  .topbar {
    position: static;
    margin: 0 0 18px;
    padding: 0 0 16px;
    background: transparent;
    backdrop-filter: none;
  }

  .launch-strip {
    grid-template-columns: 1fr;
  }

  .role-select {
    width: 100%;
    justify-content: space-between;
  }
}
