:root {
  color-scheme: light;
  --bg: #f3f5f2;
  --paper: #fff;
  --ink: #17241f;
  --muted: #54635b;
  --quiet: #6a796f;
  --line: #dce5dd;
  --navy: #111f1c;
  --navy-dark: #0e1a17;
  --green: #0d694a;
  --green-deep: #064b35;
  --mint: #e8f6ee;
  --lime: #c9ef81;
  --shadow: 0 1px 2px #17241f05, 0 4px 14px #17241f05;
  --sans: "Inter", "Noto Sans", "Segoe UI", "Arial", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-family: var(--sans);
  font-synthesis: none;
  background: var(--bg);
  color: var(--ink);
  text-rendering: optimizeLegibility;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
h1, h2, h3, p { margin: 0; }
input, textarea, select, button { font: inherit; }
a { color: var(--green-deep); text-decoration: none; }
button { cursor: pointer; }
button:disabled, input:disabled, textarea:disabled { cursor: not-allowed; opacity: .58; }
img { max-width: 100%; }
svg { flex-shrink: 0; }
:focus-visible { outline: 3px solid #168a60; outline-offset: 3px; }
::selection { color: var(--navy); background: var(--lime); }
[hidden] { display: none !important; }

.layout {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: 15.3rem minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-self: start;
  min-height: 100dvh;
  max-height: 100dvh;
  overflow: auto;
  padding: 1.6rem 1rem 1.1rem;
  color: #ecf5ee;
  background:
    radial-gradient(ellipse at 85% 100%, #1a3829 0, transparent 62%),
    linear-gradient(165deg, #162620, var(--navy-dark) 62%);
  border-right: 1px solid #243b30;
}

.brand {
  display: flex;
  gap: .75rem;
  align-items: center;
  min-width: 0;
  margin: 0 .45rem 2.45rem;
  color: inherit;
  text-align: left;
}

.brand-icon, .topic-icon, .step-icon {
  display: inline-grid;
  flex-shrink: 0;
  place-items: center;
}

.brand-icon {
  width: 2.55rem;
  height: 2.55rem;
  color: #173527;
  background: linear-gradient(145deg, #d6f7a4, #adf06b);
  border: 1px solid #d6f7a4;
  border-radius: .8rem;
  box-shadow: 0 0 25px #afef6321;
}

.brand-icon svg { width: 1.38rem; height: 1.38rem; }
.brand-text { display: grid; gap: .25rem; line-height: 1.08; min-width: 0; }
.brand-text strong, .brand-text b { font-size: 1.035rem; font-weight: 750; letter-spacing: -.025em; }
.brand-text span, .brand-text small { font-size: .73rem; font-weight: 500; color: #a9beb0; }
.side-label {
  margin: .15rem .75rem .56rem;
  color: #9ab0a4;
  font: 600 .68rem/1.5 var(--mono);
  letter-spacing: .075em;
  text-transform: uppercase;
}

.side-nav { display: grid; gap: .35rem; margin-bottom: 1.7rem; }
.side-link {
  display: flex;
  align-items: center;
  gap: .74rem;
  width: 100%;
  min-height: 2.9rem;
  padding: .62rem .73rem;
  color: #bfcdc4;
  background: transparent;
  border: 1px solid transparent;
  border-radius: .68rem;
  text-align: left;
  font-size: .92rem;
  font-weight: 580;
  line-height: 1.3;
  transition: background .2s, color .2s, border-color .2s;
}

.side-link svg { width: 1.13rem; height: 1.13rem; }
.side-link:hover:not(:disabled) { color: #fff; background: #eaffee0e; }
.side-link.active, .side-link[aria-current="page"] {
  color: #d7fbb3;
  background: #b6f67d17;
  border-color: #b6f67d2b;
}
.side-link.active svg, .side-link[aria-current="page"] svg { color: var(--lime); }
.side-link:focus-visible, .brand:focus-visible { outline-color: var(--lime); }

.side-note, .side-progress {
  display: grid;
  gap: .56rem;
  padding: .91rem;
  margin: .35rem .15rem;
  border: 1px solid #b1dbbd20;
  border-radius: .75rem;
  background: #dbffe708;
  color: #d3e2d7;
  font-size: .82rem;
  line-height: 1.5;
}
.side-note p, .side-progress p, .side-note small, .side-progress small { color: #adbbb1; font-size: .79rem; }
.side-note strong, .side-progress strong { font-weight: 680; }
.side-progress progress { display: block; width: 100%; height: .42rem; accent-color: var(--lime); }
.side-note svg, .side-progress svg { width: 1.05rem; height: 1.05rem; color: var(--lime); }
.sidebar > footer, .side-footer {
  margin-top: auto;
  padding: 1.08rem .7rem .15rem;
  color: #9ab0a4;
  font-size: .75rem;
  line-height: 1.5;
}

.workspace { min-width: 0; min-height: 100dvh; }
.topbar {
  position: relative;
  z-index: 4;
  min-height: 4.65rem;
  padding: .8rem clamp(1.05rem, 3.2vw, 3.15rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: #fcfdfb;
  border-bottom: 1px solid var(--line);
}

.crumbs, .top-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .61rem;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.35;
}
.crumbs strong, .crumbs b { color: var(--ink); font-weight: 690; }
.crumbs svg { width: .9rem; height: .9rem; color: #8a9b8f; }
.top-actions { justify-content: flex-end; flex-shrink: 0; color: var(--ink); }
.model-chip, .badge, .chip {
  display: inline-flex;
  gap: .42rem;
  justify-content: center;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: .32rem .68rem;
  border: 1px solid #d8e6db;
  background: #f2f7f3;
  color: #2b5542;
  font-size: .83rem;
  font-weight: 650;
  line-height: 1.36;
}

.model-chip { min-height: 2.1rem; color: var(--green-deep); background: #eef7ee; white-space: nowrap; }
button.model-chip:hover { background: #e1efdf; }
.model-chip svg, .badge svg, .chip svg { width: .95rem; height: .95rem; }
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  color: var(--green-deep);
  background: #e1ede4;
  border: 1px solid #d1e1d6;
  font-size: .81rem;
  font-weight: 780;
}
.avatar svg { width: 1.04rem; height: 1.04rem; }

.content {
  max-width: 84rem;
  margin: 0 auto;
  padding: clamp(1.3rem, 3.15vw, 2.75rem) clamp(1rem, 3.2vw, 3.15rem) 3.5rem;
  animation: rise-in .38s cubic-bezier(.2, .75, .36, 1) both;
}

.hero {
  position: relative;
  display: grid;
  min-height: 20.25rem;
  grid-template-columns: minmax(0, 1.38fr) minmax(0, 1fr);
  overflow: hidden;
  isolation: isolate;
  border-radius: 1.22rem;
  background: #132d22;
  color: #f5fff7;
  box-shadow: 0 12px 25px #152b1d16;
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.6rem, 4vw, 3.5rem) 0 clamp(1.6rem, 4vw, 3.25rem) clamp(1.55rem, 4.5vw, 3.35rem);
}

.eyebrow, .section-kicker {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: .45rem;
  margin-bottom: .78rem;
  color: var(--green);
  font: 670 .735rem/1.42 var(--mono);
  letter-spacing: .07em;
  text-transform: uppercase;
}
.eyebrow { color: #d4efad; }
.eyebrow svg, .section-kicker svg { width: .95rem; height: .95rem; }
.hero h1 {
  margin: 0 0 .9rem;
  max-width: 17ch;
  font-weight: 760;
  font-size: clamp(2.15rem, 4.1vw, 4.05rem);
  line-height: 1.02;
  letter-spacing: -.062em;
  text-wrap: balance;
}
.hero h1 span, .hero h1 em, .hero h1 strong { color: #cef397; font-style: normal; font-weight: inherit; }
.hero-copy > p {
  max-width: 45ch;
  color: #e2eee4;
  font-size: clamp(.97rem, 1.3vw, 1.12rem);
  line-height: 1.65;
  text-wrap: pretty;
}
.hero-tags { display: flex; flex-wrap: wrap; align-items: center; gap: .47rem; margin-top: 1.22rem; }
.hero-tags > * {
  display: inline-flex;
  gap: .42rem;
  align-items: center;
  width: fit-content;
  padding: .35rem .59rem;
  border: 1px solid #e8fde13f;
  border-radius: .42rem;
  color: #eef8e9;
  background: #f1ffe312;
  font-size: .81rem;
  font-weight: 600;
  line-height: 1.3;
}
.hero-tags svg { width: .87rem; height: .87rem; color: var(--lime); }

.hero-media {
  position: relative;
  min-height: 100%;
  display: grid;
  align-items: end;
  background:
    radial-gradient(ellipse at 75% 30%, #77ac6869 0, transparent 52%),
    repeating-linear-gradient(128deg, transparent 0 9px, #e1ffc90a 10px 11px),
    #102219;
  background-position: center;
  background-size: cover;
}
.hero-media img {
  position: absolute;
  height: 100%;
  width: 100%;
  inset: 0;
  object-fit: cover;
  object-position: center;
}
.hero-media::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, #132d22 0%, #132d2244 24%, transparent 58%),
    linear-gradient(0deg, #0d2119c7 0%, transparent 42%);
  pointer-events: none;
}
.hero-caption {
  position: relative;
  z-index: 1;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: 1.25rem clamp(1rem, 2.7vw, 1.9rem);
  color: #e7f2e7;
  font: 560 .72rem/1.4 var(--mono);
  letter-spacing: .045em;
}
.hero-caption svg { width: .87rem; height: .87rem; }

.entry-grid, .admin-grid, .chat-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 1.2rem;
  margin-top: 1.25rem;
  align-items: start;
}
.entry-grid { align-items: stretch; }
.panel {
  min-width: 0;
  padding: clamp(1.15rem, 2.35vw, 1.85rem);
  border: 1px solid var(--line);
  border-radius: 1.05rem;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.panel h2, .section-heading h2 {
  margin-bottom: .5rem;
  font-size: clamp(1.28rem, 2vw, 1.72rem);
  font-weight: 740;
  line-height: 1.19;
  letter-spacing: -.036em;
}
.panel > p, .section-heading p {
  color: var(--muted);
  line-height: 1.55;
}
.entry-panel form { margin-top: 1.25rem; }
.fields, .split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem 1rem;
}
.entry-panel .fields { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.field { display: grid; min-width: 0; gap: .38rem; align-content: start; }
.field > label, .field > span:first-child, .chat-form > label {
  color: var(--ink);
  font-size: .91rem;
  font-weight: 680;
  line-height: 1.4;
}

input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  display: block;
  width: 100%;
  min-height: 2.92rem;
  padding: .7rem .79rem;
  border: 1px solid #ccd9ce;
  border-radius: .61rem;
  outline: 0;
  background: #fcfdfa;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.35;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
input:hover, select:hover, textarea:hover { border-color: #a9beb0; }
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
  border-color: #148857;
  background: #fff;
  box-shadow: 0 0 0 3px #1488571f;
}
input::placeholder, textarea::placeholder { color: #6b7970; }
textarea { min-height: 7rem; resize: vertical; }
select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #426452 50%),
    linear-gradient(135deg, #426452 50%, transparent 50%);
  background-position:
    calc(100% - 1.15rem) 50%,
    calc(100% - .84rem) 50%;
  background-size: .32rem .32rem, .32rem .32rem;
  background-repeat: no-repeat;
  padding-right: 2rem;
}
.help, .muted, .subtle-note { color: var(--muted); line-height: 1.55; }
.help { font-size: .83rem; }
.form-actions, .chat-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .64rem .92rem;
}
.form-actions { margin-top: 1.13rem; }

.btn, button.primary, button.secondary, button.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .48rem;
  width: fit-content;
  min-height: 2.75rem;
  padding: .65rem .98rem;
  border: 1px solid transparent;
  border-radius: .65rem;
  font-weight: 700;
  font-size: .93rem;
  line-height: 1.3;
  text-align: center;
  transition: background .2s, border-color .2s, color .2s, box-shadow .2s, transform .2s;
}
.btn svg, .primary svg, .secondary svg, .ghost svg { width: 1.05rem; height: 1.05rem; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn.primary, button.primary { color: #fff; background: #106a4d; box-shadow: 0 3px 6px #18563823; }
.btn.primary:hover:not(:disabled), button.primary:hover:not(:disabled) { background: #0b573d; box-shadow: 0 5px 10px #18563833; }
.btn.secondary, button.secondary { color: var(--green-deep); background: #edf7ee; border-color: #cfe5d4; }
.btn.secondary:hover:not(:disabled), button.secondary:hover:not(:disabled) { background: #e0f1e4; border-color: #a7ccb5; }
.btn.ghost, button.ghost { color: var(--green-deep); background: transparent; border-color: #d8e3da; box-shadow: none; }
.btn.ghost:hover:not(:disabled), button.ghost:hover:not(:disabled) { background: #f1f7f0; border-color: #b5cbbb; }
.btn.small, button.small { min-height: 2.15rem; padding: .38rem .63rem; font-size: .83rem; border-radius: .49rem; }

.guide-panel { background: #fbfdf8; }
.guide-panel > h2 { margin-bottom: .85rem; }
.guide-row {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .65rem 0;
}
.guide-row + .guide-row { border-top: 1px solid #e3ebe2; }
.step-icon {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: .57rem;
  background: #eaf5e9;
  color: var(--green-deep);
  font-size: .87rem;
  font-weight: 730;
}
.step-icon svg { width: 1.05rem; height: 1.05rem; }
.guide-text { display: grid; min-width: 0; gap: .19rem; }
.guide-text strong, .guide-text b, .guide-text h3 { font-size: .94rem; font-weight: 720; line-height: 1.37; }
.guide-text > span, .guide-text > p { font-size: 1rem; color: var(--muted); line-height: 1.48; }
.subtle-note {
  display: flex;
  gap: .45rem;
  align-items: flex-start;
  margin-top: .65rem;
  padding: .67rem .69rem;
  border-radius: .57rem;
  background: #eff5ed;
  font-size: .83rem;
}
.subtle-note svg { width: .94rem; height: .94rem; margin-top: .16rem; color: var(--green); }

.section-heading {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.2rem;
  align-items: end;
  justify-content: space-between;
  margin-top: 2.15rem;
  margin-bottom: .93rem;
}
.section-heading h2 { margin-bottom: .16rem; }
.section-heading .section-kicker { margin-bottom: .42rem; }
.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .92rem;
}
.topic-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .56rem;
  align-items: flex-start;
  min-width: 0;
  min-height: 12.5rem;
  padding: 1.03rem 1.05rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: .87rem;
  background: var(--paper);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-align: left;
  transition: border .22s, box-shadow .22s, transform .22s;
}
.topic-card:hover, .topic-card:focus-within, .topic-card.selected {
  border-color: #91b6a0;
  box-shadow: 0 6px 20px #1f463614;
}
.topic-card:hover { transform: translateY(-2px); }
.topic-card:active { transform: translateY(0); }
.topic-card.selected, .topic-card[aria-pressed="true"] { background: #f1f9f0; }
.topic-icon {
  width: 2.45rem;
  height: 2.45rem;
  border-radius: .65rem;
  background: #e7f5ea;
  color: #15664b;
}
.topic-icon svg { width: 1.24rem; height: 1.24rem; }
.topic-tag {
  width: fit-content;
  display: inline-block;
  max-width: 100%;
  border-radius: 999px;
  padding: .23rem .55rem;
  background: #edf5ed;
  border: 1px solid #e0ebe0;
  color: #42604c;
  font-size: .74rem;
  font-weight: 630;
  line-height: 1.35;
}
.topic-card > .topic-tag { position: absolute; top: 1.15rem; right: 1rem; max-width: calc(100% - 4.3rem); }
.topic-card h3 {
  color: var(--ink);
  font-size: 1.085rem;
  line-height: 1.26;
  font-weight: 740;
  letter-spacing: -.026em;
}
.topic-card p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.49;
  text-wrap: pretty;
}
.topic-pick {
  color: var(--green-deep);
  margin-top: auto;
  font-size: .87rem;
  font-weight: 700;
}
.topic-pick:not(.btn) { border: 0; padding: .35rem 0 .03rem; background: transparent; }
.topic-pick:hover { text-decoration: underline; text-underline-offset: .21em; }

.page-head { margin: 0 0 1.18rem; }
.page-head h1 {
  max-width: 21ch;
  color: var(--ink);
  font-size: clamp(1.8rem, 3.6vw, 3.15rem);
  font-weight: 760;
  line-height: 1.08;
  letter-spacing: -.053em;
  text-wrap: balance;
}
.page-head p { max-width: 66ch; margin-top: .65rem; color: var(--muted); line-height: 1.58; }
.stack { display: grid; gap: .85rem; min-width: 0; }
.notice, .error, .success {
  padding: .7rem .85rem;
  border-radius: .63rem;
  border: 1px solid #dbebdb;
  color: #243f2b;
  background: #f0f7ef;
  font-size: .92rem;
  line-height: 1.5;
}
.error { color: #902c2a; background: #fdf2f0; border-color: #f1c9c4; }
.success { color: #12513a; background: #e8f7ed; border-color: #bdddc9; }
.empty { padding: 1.2rem .85rem; color: var(--muted); font-size: .93rem; line-height: 1.58; }

.chat-grid { grid-template-columns: minmax(0, 1.85fr) minmax(15rem, 1fr); }
.chat-panel { padding: 0; overflow: hidden; }
.chat-head {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .66rem;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 1.05rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.chat-head h2, .chat-head h3 { margin: 0; font-size: 1.12rem; font-weight: 750; letter-spacing: -.024em; }
.messages {
  display: flex;
  flex-direction: column;
  gap: .9rem;
  min-height: 19rem;
  max-height: max(22rem, 47vh);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 1.12rem 1.2rem 1.45rem;
  background: #f7faf6;
  scrollbar-color: #baccc0 transparent;
}
.message { display: flex; align-items: start; gap: .55rem; max-width: 93%; min-width: 0; }
.message.user { align-self: flex-end; flex-direction: row-reverse; }
.message.bot { align-self: flex-start; }
.message-body {
  padding: .77rem .88rem;
  border: 1px solid #dce7dc;
  border-radius: .77rem;
  background: #fff;
  box-shadow: 0 1px 3px #1b2c1f0a;
  font-size: 1rem;
  line-height: 1.62;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  min-width: 0;
}
.message.bot .message-body { border-top-left-radius: .19rem; }
.message.user .message-body { border-top-right-radius: .19rem; background: #e7f4e7; border-color: #d0e7d4; }
.message-body strong { color: var(--green-deep); }
.message .avatar { width: 1.8rem; height: 1.8rem; font-size: .72rem; }
.chat-form {
  display: grid;
  gap: .62rem;
  padding: 1rem 1.2rem 1.15rem;
  border-top: 1px solid var(--line);
  background: #fff;
}
.chat-form textarea { min-height: 6rem; }
.chat-actions { justify-content: space-between; }
.chat-actions .help { flex: 1 1 13rem; }

.checklist h2, .checklist h3 { margin-bottom: .66rem; }
.check-row {
  display: flex;
  gap: .63rem;
  align-items: center;
  min-height: 2.68rem;
  padding: .45rem .48rem;
  border: 1px solid transparent;
  border-radius: .53rem;
  color: var(--muted);
  font-size: .91rem;
  font-weight: 560;
  line-height: 1.35;
}
.check-row svg { width: 1rem; height: 1rem; }
.check-row.done { color: #176044; }
.check-row.current { border-color: #d8e8d8; background: #edf8ec; color: #174e37; font-weight: 730; }

.slide-preview {
  position: relative;
  display: grid;
  gap: 1rem;
  align-content: start;
  min-height: 20rem;
  padding: clamp(1.25rem, 3vw, 2.4rem);
  overflow: hidden;
  border: 1px solid #28513f;
  border-radius: 1rem;
  background:
    radial-gradient(ellipse at 100% 0, #30583b 0, transparent 46%),
    #112c21;
  color: #f4fff5;
  box-shadow: 0 12px 25px #17241f19;
}
.slide-preview h2, .slide-preview h3 {
  color: #f4fff5;
  font-weight: 740;
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  letter-spacing: -.04em;
  line-height: 1.15;
}
.slide-preview > p, .slide-preview .muted { color: #c0d8c6; }
.slide-preview .eyebrow, .slide-preview .section-kicker { color: var(--lime); }
.slide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .76rem; }
.slide-cell {
  display: grid;
  align-content: start;
  gap: .4rem;
  min-width: 0;
  padding: .77rem;
  border: 1px solid #e5ffe42e;
  border-radius: .55rem;
  background: #eefce710;
  overflow-wrap: anywhere;
  color: #f0f9f0;
  font-size: .92rem;
  line-height: 1.48;
}
.slide-cell h3, .slide-cell strong, .slide-cell b { color: var(--lime); font-size: .87rem; font-weight: 720; }

.admin-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
.table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.log-table { width: 100%; min-width: 35rem; border-collapse: collapse; text-align: left; }
.log-table th, .log-table td { padding: .65rem .55rem; border-bottom: 1px solid var(--line); font-size: .89rem; line-height: 1.4; }
.log-table th { color: #40594a; font-weight: 700; background: #f4f8f2; }
.log-table td { overflow-wrap: anywhere; }
.log-table tr:hover td { background: #f8faf7; }
.admin-grid .form-actions .btn { flex: none; }
.progress-track { height: .45rem; overflow: hidden; border-radius: 999px; background: #dbe8dd; }
.progress-track > * { display: block; height: 100%; border-radius: inherit; background: #209768; transition: width .3s ease; }
.spin, .spinner { animation: spin .8s linear infinite; }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(.35rem); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 70rem) {
  .layout { grid-template-columns: 13.3rem minmax(0, 1fr); }
  .sidebar { padding-inline: .75rem; }
  .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat-grid { grid-template-columns: minmax(0, 1.6fr) minmax(13rem, 1fr); }
  .admin-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 53rem) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    z-index: 5;
    min-height: auto;
    max-height: none;
    padding: .68rem .95rem;
    overflow: visible;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: .7rem;
    border-right: 0;
  }
  .brand { margin: 0; }
  .brand-icon { width: 2.1rem; height: 2.1rem; border-radius: .57rem; }
  .brand-icon svg { width: 1.14rem; height: 1.14rem; }
  .side-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .2rem; margin: 0; }
  .side-link { min-height: 2rem; width: auto; gap: .35rem; padding: .38rem .5rem; border-radius: .52rem; font-size: .81rem; }
  .side-link svg { width: .93rem; height: .93rem; }
  .side-label, .side-progress, .side-note, .side-footer, .sidebar > footer { display: none; }
  .topbar { min-height: 3.44rem; }
  .hero { min-height: 17.5rem; }
  .entry-grid { gap: .82rem; }
  .slide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 36.5rem) {
  .sidebar { position: relative; flex-wrap: wrap; gap: .55rem; padding-top: .72rem; padding-bottom: .58rem; }
  .side-nav { width: 100%; justify-content: flex-start; gap: .25rem .4rem; }
  .brand-text { display: flex; align-items: baseline; flex-wrap: wrap; gap: .4rem; }
  .brand-text small, .brand-text span { font-size: .72rem; }
  .crumbs { gap: .32rem; font-size: .8rem; }
  .top-actions { gap: .34rem; }
  .topbar .avatar { width: 1.78rem; height: 1.78rem; }
  .model-chip { padding: .27rem .43rem; min-height: 1.65rem; font-size: .72rem; }
  .content { padding-bottom: 2.1rem; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: clamp(2rem, 11vw, 3rem); }
  .hero-copy { padding: 1.35rem 1.25rem 1.04rem; }
  .hero-media { min-height: 7.8rem; }
  .hero-media::after { background: linear-gradient(180deg, #132d22 0%, transparent 50%), linear-gradient(0deg, #112c21ba 0%, transparent 45%); }
  .hero-caption { margin: .74rem .9rem; }
  .entry-grid, .chat-grid { grid-template-columns: minmax(0, 1fr); gap: .8rem; margin-top: .8rem; }
  .entry-panel .fields, .fields, .split { grid-template-columns: minmax(0, 1fr); }
  .topic-grid { grid-template-columns: minmax(0, 1fr); gap: .66rem; }
  .topic-card { min-height: 10.5rem; }
  .section-heading { margin-top: 1.55rem; }
  .messages { min-height: 14rem; max-height: 28rem; padding-inline: .82rem; }
  .chat-form, .chat-head { padding-inline: .86rem; }
  .message { max-width: 96%; }
  .slide-grid { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
