﻿:root {
  color-scheme: light;

  /* Brazilian-inspired palette: education green, warm gold, calm teal */
  --ink: #152528;
  --muted: #56666d;
  --line: #d2e0e4;
  --paper: #ffffff;
  --canvas: #f4f8f7;
  --nav: #0f4c4c;
  --accent: #0d7377;
  --accent-2: #1d6fa5;
  --gold: #d4a017;
  --danger: #c0392b;
  --success: #2a9d8f;
  --warning: #e9c46a;
  --soft: #e8f4f3;
  --warm: #fff8e7;

  --shadow-sm: 0 2px 8px rgba(21, 37, 40, 0.06);
  --shadow: 0 12px 32px rgba(21, 37, 40, 0.10);
  --shadow-lg: 0 22px 56px rgba(21, 37, 40, 0.14);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button,
a {
  cursor: pointer;
}

img {
  max-width: 100%;
  height: auto;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px) saturate(1.2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), var(--success));
  color: white;
  font-weight: 900;
  font-size: 20px;
  box-shadow: var(--shadow-sm);
}

.brand strong {
  display: block;
  font-size: 16px;
  line-height: 1.2;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--nav);
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* Top navigation */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}

.top-nav a,
.nav-cta {
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--nav);
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
  transition: background 160ms ease, color 160ms ease;
}

.top-nav a:hover {
  background: var(--soft);
  color: var(--accent);
}

.top-nav a.is-active {
  background: var(--soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(13, 115, 119, 0.15);
}

.nav-cta {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(13, 115, 119, 0.25);
}

.nav-cta:hover {
  background: var(--nav);
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.locale-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.locale-switch select {
  width: auto;
  min-height: 36px;
  border: 1px solid #c5d5d8;
  border-radius: var(--radius-sm);
  background: white;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 800;
}

.auth-actions span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-actions button,
.auth-form-actions button,
.prompt-actions button {
  border: 1px solid #c5d5d8;
  border-radius: var(--radius-sm);
  background: #ffffff;
  padding: 8px 14px;
  font-weight: 800;
  font-size: 13px;
  color: var(--nav);
  transition: background 160ms ease, border-color 160ms ease, transform 80ms ease;
}

.auth-actions button:hover,
.auth-form-actions button:hover,
.prompt-actions button:hover {
  background: #f6fbfa;
  border-color: #9db8bd;
  transform: translateY(-1px);
}

/* ===== Main ===== */
main {
  display: grid;
  gap: 28px;
  padding: 28px 24px 40px;
  max-width: 1320px;
  margin: 0 auto;
}

/* ===== Hero ===== */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 24px;
  align-items: stretch;
}

.hero-copy {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(42, 157, 143, 0.10), transparent 50%),
    linear-gradient(160deg, #ffffff, #f8fcfb);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--shadow);
}

.hero-copy .eyebrow {
  margin: 0 0 10px;
}

.hero-copy h1 {
  max-width: 800px;
  margin: 0 0 14px;
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.3px;
}

.hero-copy .lead {
  max-width: 720px;
  color: #3a4f56;
  font-size: 17px;
  line-height: 1.6;
  margin: 0 0 22px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.primary-link,
.secondary-link {
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  text-decoration: none;
  font-weight: 900;
  font-size: 15px;
  transition: transform 120ms ease, box-shadow 160ms ease;
}

.primary-link:hover,
.secondary-link:hover {
  transform: translateY(-1px);
}

.primary-link {
  background: linear-gradient(135deg, var(--accent), var(--success));
  color: white;
  box-shadow: 0 4px 14px rgba(13, 115, 119, 0.30);
}

.secondary-link {
  border: 1px solid var(--line);
  background: white;
  color: var(--nav);
  box-shadow: var(--shadow-sm);
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trust-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fcfb;
  color: var(--muted);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

/* Hero preview */
.hero-visual {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
  padding: 24px;
  box-shadow: var(--shadow);
}

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.preview-toolbar strong {
  color: var(--accent-2);
  font-weight: 900;
}

.preview-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fcfb;
  padding: 20px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.02);
}

.preview-card h2 {
  font-size: 18px;
  margin: 0 0 10px;
}

.preview-card ul {
  margin: 8px 0 0 18px;
  padding: 0;
  color: #3a4f56;
  font-size: 14px;
}

.preview-card li {
  margin: 6px 0;
}

/* ===== Steps ===== */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.step-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.step-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--success));
  color: white;
  font-weight: 900;
  font-size: 18px;
  margin-bottom: 14px;
  box-shadow: 0 4px 10px rgba(13, 115, 119, 0.22);
}

.step-card h3 {
  font-size: 18px;
  margin: 0 0 8px;
}

.step-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

/* ===== Section headings ===== */
.section-heading,
.workspace-header,
.editor-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.section-heading h2,
.workspace-header h2 {
  font-size: 26px;
  line-height: 1.2;
}

/* ===== Tool strip ===== */
.tool-strip {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
  padding: 28px 24px;
  box-shadow: var(--shadow);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.tool-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: #fbfdfe;
  padding: 18px 16px;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.tool-card:hover,
.tool-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(13, 115, 119, 0.12);
  transform: translateY(-2px);
}

.tool-card.is-active {
  border-left-color: var(--gold);
  background: linear-gradient(180deg, #fff, #f8fcfb);
}

.tool-card .tool-icon {
  width: 32px;
  height: 32px;
  color: var(--accent);
  margin-bottom: 6px;
}

.tool-card strong {
  display: block;
  font-size: 15px;
}

.tool-card .tool-signal {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.tool-card .tool-desc {
  display: block;
  color: #4a5e66;
  font-size: 13px;
  line-height: 1.5;
  margin-top: 2px;
}

.tool-action {
  display: block;
  margin-top: 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  font-style: normal;
}

/* ===== Workspace ===== */
.workspace-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
  padding: 28px 24px;
  box-shadow: var(--shadow);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.workspace-shell.is-compact .workspace-grid {
  grid-template-columns: minmax(300px, 720px);
  justify-content: center;
}

.input-panel {
  grid-row: auto;
}

.editor-panel {
  min-width: 0;
}

.editor-panel[hidden] {
  display: none !important;
}

/* Legacy quality-panel (keep for compatibility) */
.quality-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.quality-panel[hidden] {
  display: none !important;
}

/* Workspace header */
.workspace-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.status-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.status-row span,
.quality-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbfb;
  color: var(--muted);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
}

/* Input panel */
.input-panel label {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  color: #2a3d44;
  font-size: 13px;
  font-weight: 800;
}

.input-panel input,
.input-panel select,
.input-panel textarea {
  width: 100%;
  border: 1px solid #c5d5d8;
  border-radius: var(--radius-sm);
  background: white;
  color: var(--ink);
  padding: 10px 12px;
  font-size: 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease, outline 160ms ease;
}

.input-panel input:focus,
.input-panel select:focus,
.input-panel textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 115, 119, 0.12);
}

.input-panel textarea {
  resize: vertical;
  min-height: 80px;
}

.lgpd-note {
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-sm);
  background: var(--warm);
  color: #6b4b0a;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 14px;
}

.prompt-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}

.prompt-actions button {
  min-height: 40px;
  border-radius: var(--radius-sm);
  color: #1f343d;
  font-weight: 800;
  font-size: 13px;
}

.generation-progress {
  position: relative;
  border: 2px solid #0d7377;
  border-left-width: 8px;
  border-radius: var(--radius);
  background: #eefafa;
  padding: 16px;
  margin: 14px 0 0;
  box-shadow: 0 12px 28px rgba(13, 115, 119, 0.18);
}

.generation-progress[hidden] {
  display: none !important;
}

.generation-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #12363d;
  font-size: 14px;
  line-height: 1.3;
  margin-bottom: 12px;
}

.generation-progress-top strong {
  min-width: 0;
  font-size: 15px;
  font-weight: 900;
}

.generation-progress-top span {
  border-radius: 999px;
  background: white;
  border: 1px solid #99cacc;
  color: var(--accent);
  padding: 5px 10px;
  font-weight: 900;
  white-space: nowrap;
}

.generation-progress-track {
  width: 100%;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #c9e4e7;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.16);
}

.generation-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.28) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.28) 50%, rgba(255, 255, 255, 0.28) 75%, transparent 75%, transparent),
    linear-gradient(90deg, #0d7377, #d99f16);
  background-size: 28px 28px, 100% 100%;
  transition: width 260ms ease;
  animation: progress-stripes 900ms linear infinite;
}

@keyframes progress-stripes {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 28px 0, 0 0;
  }
}

.tool-options {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0 0 16px;
  padding: 16px;
  background: #f8fcfb;
}

.tool-options legend {
  color: #24404a;
  font-size: 13px;
  font-weight: 900;
  padding: 0 8px;
}

.compact-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.primary-button,
.export-bar button,
.artifact-tab,
.school-form button,
.resource-card button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-weight: 900;
  font-size: 13px;
  transition: transform 100ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.primary-button:hover,
.export-bar button:hover,
.artifact-tab:hover,
.school-form button:hover,
.resource-card button:hover {
  transform: translateY(-1px);
}

.primary-button {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), var(--success));
  color: white;
  box-shadow: 0 4px 14px rgba(13, 115, 119, 0.28);
  font-size: 15px;
}

.primary-button:hover {
  box-shadow: 0 6px 18px rgba(13, 115, 119, 0.34);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
  box-shadow: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none !important;
  box-shadow: none !important;
}

.notice {
  margin-top: 14px;
  border: 1px solid #f2c46d;
  border-radius: var(--radius-sm);
  background: #fff7e8;
  color: #734a08;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
}

/* ===== Editor ===== */
.editor-topbar {
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.export-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.export-bar button,
.artifact-tab,
.resource-card button {
  border-color: #c5d5d8;
  background: #eef5f6;
  color: var(--nav);
  font-size: 13px;
}

.export-bar button:hover,
.artifact-tab:hover,
.resource-card button:hover {
  background: #e4f0f2;
  border-color: #9db8bd;
}

.artifact-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.editor-insert-toolbar {
  position: sticky;
  top: 72px;
  z-index: 10;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid #b9d3d6;
  border-radius: var(--radius-sm);
  background: rgba(248, 251, 251, 0.96);
  backdrop-filter: blur(8px);
  padding: 10px;
  margin: 0 0 12px;
  box-shadow: 0 8px 20px rgba(25, 58, 68, 0.08);
}

.editor-insert-toolbar span {
  color: #48636b;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.editor-insert-toolbar button {
  min-height: 36px;
  border: 1px solid #c5d5d8;
  border-radius: var(--radius-sm);
  background: white;
  color: #173c44;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 900;
}

.editor-insert-toolbar button:last-of-type {
  border-color: #0d7377;
  background: #eefafa;
  color: #0d7377;
}

.artifact-tab.is-active {
  background: var(--nav);
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(15, 76, 76, 0.25);
}

.edit-lock {
  margin: 0 0 14px;
  border: 1px solid #f2c46d;
  border-radius: var(--radius-sm);
  background: #fff7e8;
  color: #734a08;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.artifact-output {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfe;
  padding: 16px;
  min-height: 360px;
}

.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fcfb;
  padding: 28px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
}

.empty-state strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  margin-bottom: 6px;
}

.empty-state span {
  display: block;
  margin-top: 6px;
}

/* Document editor */
.document-editor {
  border: 1px solid #c5d5d8;
  border-radius: var(--radius);
  background: #eef5f6;
  overflow: hidden;
}

.editor-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #c5d5d8;
  background: #f8fcfc;
  padding: 10px 14px;
}

.editor-toolbar span {
  color: var(--muted);
  font-size: 12px;
}

.editable-document {
  min-height: 520px;
  border: 0;
  background: #ffffff;
  padding: 24px;
  line-height: 1.65;
}

.editable-document[contenteditable="true"] {
  cursor: text;
}

.editable-document[contenteditable="true"]:focus {
  outline: none;
  box-shadow: inset 0 0 0 3px rgba(13, 115, 119, 0.10);
}

.inline-image {
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #f8fcfb;
}

.inline-image-gallery {
  margin: 22px 0;
  border: 1px solid #b9d3d6;
  border-radius: var(--radius);
  background: #f8fcfb;
  padding: 14px;
}

.inline-image-gallery h4 {
  margin: 0 0 12px;
  color: #173c44;
}

.inline-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.inline-image-grid .inline-image {
  margin: 0;
}

.inline-image img {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  cursor: zoom-in;
}

.inline-image figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.inline-image figcaption small {
  flex: 1 1 100%;
  color: #60747b;
  line-height: 1.4;
}

.inline-image button {
  border: 1px solid #f2b8b5;
  border-radius: var(--radius-sm);
  background: #fff1f0;
  color: var(--danger);
  padding: 6px 10px;
  font-weight: 800;
  font-size: 12px;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: rgba(8, 25, 30, 0.86);
  padding: 24px;
}

.image-lightbox-panel {
  position: relative;
  width: min(1040px, 94vw);
  max-height: 92vh;
  border-radius: var(--radius);
  background: #ffffff;
  padding: 18px 56px 54px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
}

.image-lightbox-panel img {
  display: block;
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #f7fbfb;
}

.image-lightbox-close,
.image-lightbox-nav {
  position: absolute;
  border: 0;
  border-radius: 999px;
  background: #0d7377;
  color: white;
  font-weight: 900;
  cursor: pointer;
}

.image-lightbox-close {
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  font-size: 24px;
}

.image-lightbox-nav {
  top: 50%;
  width: 42px;
  height: 42px;
  transform: translateY(-50%);
  font-size: 30px;
}

.image-lightbox-nav.is-prev {
  left: 10px;
}

.image-lightbox-nav.is-next {
  right: 10px;
}

.image-lightbox-caption {
  position: absolute;
  left: 56px;
  right: 56px;
  bottom: 16px;
  color: #334a52;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.artifact-output section + section {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

/* ===== BNCC / Quality / Resource lists ===== */
.editor-meta {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fcfb;
}

.editor-meta[hidden] {
  display: none !important;
}

.meta-bncc,
.meta-quality {
  min-width: 0;
}

.meta-bncc .eyebrow,
.meta-quality .eyebrow {
  font-size: 10px;
  margin-bottom: 5px;
  letter-spacing: 0.8px;
}

.meta-bncc .bncc-list,
.meta-quality .quality-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-bncc .bncc-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-2);
  background: white;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: none;
  flex: 1 1 220px;
  min-width: 0;
}

.meta-bncc .bncc-card strong {
  color: var(--accent-2);
  font-size: 12px;
  display: block;
  margin-bottom: 2px;
}

.meta-bncc .bncc-card p {
  margin: 0;
  color: #3a4f56;
  font-size: 12px;
}

.meta-bncc .bncc-card .muted {
  font-size: 11px;
  margin-top: 2px;
}

.meta-bncc .bncc-card label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  margin-bottom: 4px;
}

.meta-bncc .bncc-card input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.meta-quality .quality-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: white;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  box-shadow: none;
  flex: 1 1 180px;
  min-width: 0;
}

.meta-quality .quality-card.ok {
  border-left: 3px solid var(--success);
  background: #f0faf8;
}

.meta-quality .quality-card.warn {
  border-left: 3px solid var(--warning);
  background: #fff9e8;
}

.meta-quality .quality-card.fail {
  border-left: 3px solid var(--danger);
  background: #fdf2f0;
}

.meta-bncc .empty-state,
.meta-quality .empty-state {
  padding: 10px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  min-height: auto;
}

/* Legacy full-size cards (keep for other views) */
.bncc-list,
.quality-list,
.resource-list {
  display: grid;
  gap: 12px;
}

.bncc-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfe;
  padding: 16px;
  border-top: 4px solid var(--accent-2);
  box-shadow: var(--shadow-sm);
}

.bncc-card strong {
  color: var(--accent-2);
  font-weight: 900;
}

.bncc-card label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  cursor: pointer;
}

.bncc-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.quality-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfe;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.quality-card.ok {
  border-left: 4px solid var(--success);
  background: #f0faf8;
}

.quality-card.warn {
  border-left: 4px solid var(--warning);
  background: #fff9e8;
}

.quality-card.fail {
  border-left: 4px solid var(--danger);
  background: #fdf2f0;
}

.resource-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfe;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.resource-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.resource-card .resource-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ===== Auth ===== */
.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 24px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
  padding: 28px 24px;
  box-shadow: var(--shadow);
}

.auth-panel[hidden] {
  display: none !important;
}

.auth-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: #2a3d44;
  font-size: 13px;
  font-weight: 800;
}

.auth-form input {
  width: 100%;
  border: 1px solid #c5d5d8;
  border-radius: var(--radius-sm);
  background: white;
  color: var(--ink);
  padding: 10px 12px;
  font-size: 14px;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 115, 119, 0.12);
}

.auth-form-actions,
.auth-form p {
  grid-column: 1 / -1;
}

.auth-hint {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

/* ===== Views ===== */
.view-page,
.public-sections {
  display: grid;
  gap: 18px;
}

.view-page {
  grid-template-columns: minmax(0, 1fr);
}

.home-view[hidden],
.view-page[hidden] {
  display: none !important;
}

.public-sections {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
  padding: 28px 24px;
  box-shadow: var(--shadow);
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.panel:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* ===== School ===== */
.school-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.school-form label {
  display: grid;
  gap: 6px;
  color: #2a3d44;
  font-size: 13px;
  font-weight: 800;
}

.school-form input,
.school-form select {
  width: 100%;
  border: 1px solid #c5d5d8;
  border-radius: var(--radius-sm);
  background: white;
  color: var(--ink);
  padding: 10px 12px;
  font-size: 14px;
}

.school-form button {
  grid-column: 1 / -1;
  justify-self: start;
}

.school-admin-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fcfb;
  margin-bottom: 16px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.school-admin-panel[hidden] {
  display: none !important;
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--line);
  background: white;
  padding: 40px 24px 28px;
  margin-top: 8px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  max-width: 1320px;
  margin: 0 auto;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
  font-size: 16px;
  margin-bottom: 10px;
}

.footer-brand .brand-mark {
  width: 36px;
  height: 36px;
  font-size: 16px;
}

.footer-col p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 10px;
}

.footer-col h4 {
  font-size: 14px;
  margin: 0 0 10px;
  color: var(--nav);
}

.footer-col a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  padding: 4px 0;
  transition: color 120ms ease;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  max-width: 1320px;
  margin: 24px auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

/* ===== Typography ===== */
.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

h1, h2, h3, h4, p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 820px;
  margin: 0;
  font-size: 42px;
  line-height: 1.08;
  letter-spacing: -0.5px;
}

h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.18;
}

h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

p {
  margin: 0 0 10px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

/* ===== Tables ===== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--soft);
  font-weight: 800;
  font-size: 13px;
}

/* ===== Utility ===== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ===== Responsive ===== */
@media (max-width: 1180px) {
  .workspace-grid,
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    order: -1;
  }

  .input-panel {
    grid-row: auto;
  }

  .quality-panel {
    grid-template-columns: 1fr;
  }

  .editor-meta {
    grid-template-columns: 1fr;
  }

  .tool-grid,
  .public-sections,
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-panel,
  .auth-form {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .site-header {
    grid-template-columns: auto 1fr auto;
    padding: 10px 14px;
  }

  .mobile-menu-toggle {
    display: inline-flex;
  }

  .top-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    padding: 10px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    box-shadow: var(--shadow);
  }

  .top-nav.is-open {
    display: flex;
  }

  .top-nav a,
  .nav-cta {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    width: 100%;
  }

  .auth-actions span {
    display: none;
  }

  main {
    padding: 16px 14px 28px;
  }

  .hero-copy,
  .tool-strip,
  .workspace-shell,
  .auth-panel,
  .panel {
    padding: 22px 18px;
  }

  .hero-copy h1 {
    font-size: 30px;
  }

  .hero-copy {
    min-height: auto;
  }

  .tool-grid,
  .view-page,
  .compact-controls,
  .public-sections,
  .steps,
  .school-form,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .workspace-header,
  .editor-topbar {
    display: grid;
  }

  .export-bar {
    justify-content: stretch;
  }

  .export-bar button {
    flex: 1 1 auto;
  }

  .artifact-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .workspace-grid {
    gap: 14px;
  }

  .editor-meta {
    grid-template-columns: 1fr;
    padding: 8px;
    gap: 8px;
  }

  .meta-bncc .bncc-list,
  .meta-quality .quality-list {
    gap: 4px;
  }

  .auth-form {
    grid-template-columns: 1fr;
  }

  .school-form button {
    justify-self: stretch;
  }
}

@media print {
  .site-header,
  .hero,
  .tool-strip,
  .steps,
  .input-panel,
  .quality-panel,
  .editor-meta,
  .view-page,
  .public-sections,
  .export-bar,
  .artifact-tabs,
  .site-footer,
  .mobile-menu-toggle {
    display: none !important;
  }

  main,
  .workspace-shell,
  .editor-panel {
    display: block !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    max-width: none !important;
  }

  .editor-panel,
  .artifact-output {
    display: block !important;
  }

  .artifact-output {
    border: 0 !important;
  }
}
