:root {
  color-scheme: light;
  --ink: #16201d;
  --muted: #68746f;
  --soft: #eef5f0;
  --line: #dde8e2;
  --paper: #f5f7f3;
  --panel: #ffffff;
  --sage: #3f7468;
  --sage-dark: #17322d;
  --mint: #dbeee6;
  --coral: #dc6a5c;
  --gold: #b98b32;
  --blue: #507fa4;
  --lavender: #ece8f8;
  --shadow: 0 18px 50px rgba(23, 32, 29, 0.1);
  --shadow-soft: 0 8px 22px rgba(23, 32, 29, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 10%, rgba(219, 238, 230, 0.9), transparent 30%),
    linear-gradient(135deg, #f7f8f3 0%, #eef4f0 46%, #f8f4ec 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

h1,
h2,
h3,
p {
  margin: 0;
}

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

.hidden {
  display: none !important;
}

.welcome-screen {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 28px;
}

.welcome-card {
  width: min(560px, 100%);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(240, 248, 244, 0.9));
  box-shadow: var(--shadow);
}

.hero-brand {
  margin-bottom: 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e5ece8;
}

.hero-brand .brand-mark {
  background: var(--sage-dark);
}

.hero-brand h1 {
  font-size: 44px;
  letter-spacing: 0;
}

.hero-brand p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 16px;
}

.welcome-card label {
  margin-bottom: 18px;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100vh;
  overflow: auto;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(23, 50, 45, 0.98), rgba(34, 70, 62, 0.96)),
    var(--sage-dark);
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  color: white;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 24px;
  font-weight: 850;
}

h1 {
  font-size: 23px;
  line-height: 1.05;
}

.brand p,
.status,
.substatus,
.eyebrow,
.panel-label {
  color: var(--muted);
}

.sidebar .brand p,
.sidebar label,
.sidebar .status {
  color: rgba(255, 255, 255, 0.72);
}

label {
  display: grid;
  gap: 7px;
  color: #33423e;
  font-size: 13px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(120, 144, 136, 0.35);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  outline: none;
}

.sidebar input,
.sidebar select,
.sidebar textarea {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.sidebar textarea::placeholder,
.sidebar input::placeholder {
  color: rgba(255, 255, 255, 0.44);
}

.sidebar select option {
  color: var(--ink);
}

input,
select {
  height: 41px;
  padding: 0 12px;
}

textarea {
  min-height: 108px;
  resize: vertical;
  padding: 12px;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(71, 111, 100, 0.15);
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 800;
}

.primary {
  background: linear-gradient(135deg, #101917, #355f55);
  color: white;
  box-shadow: 0 10px 20px rgba(16, 25, 23, 0.18);
}

.secondary {
  border: 1px solid rgba(63, 116, 104, 0.2);
  background: var(--mint);
  color: var(--sage-dark);
}

.status {
  min-height: 42px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 13px;
  line-height: 1.35;
}

.workspace {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 24px 26px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(245, 250, 247, 0.9));
  box-shadow: var(--shadow);
}

.topbar .eyebrow {
  color: var(--sage);
}

.topbar h2 {
  margin-top: 4px;
  font-size: 34px;
  line-height: 1.08;
}

.topbar-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 420px;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 20px;
  align-items: start;
}

.main-column {
  min-width: 0;
}

.feedback-rail {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 14px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.tab {
  min-height: 40px;
  background: transparent;
  color: var(--muted);
}

.tab.active {
  background: #ffffff;
  color: var(--sage-dark);
  box-shadow: 0 8px 18px rgba(23, 32, 29, 0.09);
}

.tab:hover {
  color: var(--sage-dark);
  background: rgba(255, 255, 255, 0.72);
}

.view {
  display: none;
  padding-top: 20px;
}

.view.active {
  display: block;
  animation: fadeIn 160ms ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-head {
  padding: 4px 2px 0;
}

.view h2 {
  margin-top: 4px;
  font-size: 28px;
  line-height: 1.12;
}

.eyebrow,
.panel-label {
  color: var(--sage);
}

.badge {
  border: 1px solid rgba(185, 139, 50, 0.18);
  border-radius: 999px;
  background: #fff6df;
  color: #75551c;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.substatus {
  border: 1px solid rgba(63, 116, 104, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 800;
}

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

.question-card,
.panel,
.block-card {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.question-card::before,
.block-card::before,
.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--sage), var(--gold), var(--coral));
}

.question-card {
  padding: 20px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.question-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.question-card h3 {
  min-height: 62px;
  font-size: 18px;
  line-height: 1.25;
  white-space: pre-line;
}

.question-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--sage);
  font-size: 12px;
  font-weight: 900;
}

.micro-prompts {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #edf2ef;
}

.micro-prompts input {
  min-height: 44px;
  height: auto;
  background: #fbfcfa;
}

.block-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.block-card,
.panel {
  padding: 20px;
}

.chip {
  max-width: 100%;
  border: 1px solid rgba(63, 116, 104, 0.14);
  border-radius: 8px;
  padding: 9px 11px;
  background: linear-gradient(180deg, #fbfdfb, #f1f7f4);
  color: #263631;
  font-size: 13px;
  line-height: 1.25;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

#mockAnswer {
  min-height: 290px;
  background: #fbfcfa;
}

.compact-panel {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.rubric-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #edf2ef;
  border-radius: 8px;
  background: #fbfcfa;
}

.score span {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  background: #e8eeeb;
}

.score span.filled {
  background: linear-gradient(135deg, var(--coral), #ef9a6c);
}

.prompt-list {
  margin: 13px 0 0;
  padding-left: 0;
  list-style: none;
  color: #2e3d39;
}

.prompt-list li {
  margin-bottom: 9px;
  padding: 10px 11px;
  border: 1px solid #edf2ef;
  border-radius: 8px;
  background: #fbfcfa;
  line-height: 1.35;
}

.mindmap {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  min-height: 520px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  background:
    linear-gradient(#e8f0ec 1px, transparent 1px),
    linear-gradient(90deg, #e8f0ec 1px, transparent 1px),
    rgba(255, 255, 255, 0.92);
  background-size: 34px 34px;
  box-shadow: var(--shadow-soft);
}
  color: white;
}

.view {
  display: none;
  padding-top: 18px;
}

.view.active {
  display: block;
}

.view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.head-actions button {
  min-height: 36px;
}

.substatus {
  font-size: 13px;
  font-weight: 750;
}

.eyebrow,
.panel-label {
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}

.view h2 {
  margin-top: 4px;
  font-size: 25px;
  line-height: 1.12;
}

.badge {
  border-radius: 999px;
  background: #f3ead6;
  color: #745316;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

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

.question-card,
.panel,
.block-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.question-card {
  padding: 17px;
}

.question-card h3 {
  min-height: 58px;
  font-size: 17px;
  line-height: 1.26;
  white-space: pre-line;
}

.question-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.micro-prompts {
  display: grid;
  gap: 10px;
  margin-top: 15px;
}

.micro-prompts label,
.chip,
.rubric-note,
.map-node p {
  white-space: pre-line;
}

.micro-prompts input {
  min-height: 42px;
  height: auto;
}

.block-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.block-card,
.panel {
  padding: 17px;
}

.block-card h3,
.panel h3 {
  margin-bottom: 14px;
  font-size: 18px;
  line-height: 1.25;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #f7faf8;
  color: #263631;
  font-size: 13px;
  line-height: 1.25;
}

.mock-layout {
  display: block;
}

#mockAnswer {
  min-height: 270px;
}

.button-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.compact-panel {
  box-shadow: var(--shadow);
}

.rubric {
  display: grid;
  gap: 12px;
  margin-top: 13px;
}

.rubric-item {
  display: grid;
  gap: 7px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf2ef;
}

.rubric-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.score {
  display: flex;
  gap: 3px;
  margin-top: 6px;
}

.score span {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: #e8eeeb;
}

.score span.filled {
  background: var(--coral);
}

.rubric-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.prompt-list {
  margin: 13px 0 0;
  padding-left: 18px;
  color: #2e3d39;
}

.prompt-list li {
  margin-bottom: 8px;
  line-height: 1.35;
}

.mindmap {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  min-height: 520px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(#edf4f1 1px, transparent 1px),
    linear-gradient(90deg, #edf4f1 1px, transparent 1px),
    white;
  background-size: 34px 34px;
  box-shadow: var(--shadow);
}

.map-center,
.map-node {
  border-radius: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  background: white;
}

.map-center {
  grid-column: 2;
  align-self: center;
  background: var(--ink);
  color: white;
  text-align: center;
}

.map-node {
  min-height: 116px;
}

.map-node strong {
  display: block;
  margin-bottom: 8px;
}

.map-node p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.map-node:nth-child(2n) {
  border-top: 5px solid var(--blue);
}

.map-node:nth-child(2n + 1) {
  border-top: 5px solid var(--gold);
}

@media (max-width: 1180px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .feedback-rail {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .question-list,
  .block-grid,
  .mindmap,
  .feedback-rail {
    grid-template-columns: 1fr;
  }

  .map-center {
    grid-column: auto;
    order: -1;
  }
}

@media (max-width: 620px) {
  .sidebar,
  .workspace {
    padding: 18px;
  }

  .topbar,
  .view-head {
    flex-direction: column;
  }

  .topbar h2,
  .view h2 {
    font-size: 23px;
  }

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

  .head-actions,
  .topbar-meta {
    justify-content: flex-start;
  }
}

/* Final visual polish layer */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.overview-card {
  position: relative;
  overflow: hidden;
  min-height: 118px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 247, 243, 0.84));
  box-shadow: var(--shadow-soft);
}

.overview-card::after {
  content: "";
  position: absolute;
  right: -26px;
  bottom: -34px;
  width: 116px;
  height: 116px;
  border: 1px solid rgba(63, 116, 104, 0.18);
  border-radius: 999px;
}

.overview-card span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 26px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: var(--sage-dark);
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.overview-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: 16px;
}

.overview-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.tabs {
  padding: 8px;
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-soft);
}

.tab {
  min-height: 42px;
  border-radius: 8px;
}

.tab.active {
  background: #fff;
  color: var(--sage-dark);
  box-shadow: 0 9px 18px rgba(23, 32, 29, 0.09);
}

.question-card,
.panel,
.block-card,
.mindmap {
  border-color: rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.93);
  box-shadow: var(--shadow-soft);
}

.question-card,
.block-card,
.panel {
  position: relative;
  overflow: hidden;
}

.question-card::before,
.block-card::before,
.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--sage), var(--gold), var(--coral));
}

.question-card {
  padding: 20px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.question-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.question-meta {
  color: var(--sage);
  margin-bottom: 14px;
}

.question-card h3 {
  min-height: 62px;
  font-size: 18px;
}

.micro-prompts {
  padding-top: 14px;
  border-top: 1px solid #edf2ef;
}

.micro-prompts input,
#mockAnswer {
  background: #fbfcfa;
}

.block-card,
.panel {
  padding: 20px;
}

.chip {
  border-color: rgba(63, 116, 104, 0.14);
  background: linear-gradient(180deg, #fbfdfb, #f1f7f4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.compact-panel {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.rubric-item {
  padding: 12px;
  border: 1px solid #edf2ef;
  border-radius: 8px;
  background: #fbfcfa;
}

.score span {
  width: 15px;
  height: 15px;
  border-radius: 4px;
}

.score span.filled {
  background: linear-gradient(135deg, var(--coral), #ef9a6c);
}

.prompt-list {
  padding-left: 0;
  list-style: none;
}

.prompt-list li {
  padding: 10px 11px;
  border: 1px solid #edf2ef;
  border-radius: 8px;
  background: #fbfcfa;
}

.mindmap {
  background:
    linear-gradient(#e8f0ec 1px, transparent 1px),
    linear-gradient(90deg, #e8f0ec 1px, transparent 1px),
    rgba(255, 255, 255, 0.93);
  box-shadow: var(--shadow-soft);
}

@media (max-width: 980px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }
}
