:root {
  color-scheme: light;
  --ink: #191919;
  --muted: #6b6b6b;
  --line: #e6e6e6;
  --paper: #f6f1e8;
  --panel: #ffffff;
  --soft: #f7f1e7;
  --forest: #1f513c;
  --leaf: #5f8f57;
  --teal: #0d7377;
  --gold: #b98524;
  --rose: #a94d5b;
  --sky: #447c96;
  --clay: #bf6b4a;
  --lilac: #7c6aa9;
  --cream: #fffaf0;
  --shadow: 0 18px 50px rgba(48, 40, 30, 0.12);
  --shadow-soft: 0 10px 26px rgba(48, 40, 30, 0.09);
  --shadow-raised: 0 18px 36px rgba(48, 40, 30, 0.13), 0 2px 8px rgba(48, 40, 30, 0.08);
  --shadow-floating: 0 26px 70px rgba(40, 51, 44, 0.18), 0 8px 20px rgba(40, 51, 44, 0.1);
  --surface-line: rgba(111, 89, 60, 0.16);
  --reading-font: Georgia, "Times New Roman", "Apple SD Gothic Neo", "Noto Serif KR", serif;
  --ui-font: Inter, Arial, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.38) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.32) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, #f3ebdc 0%, #f8f6ef 34%, #eef5f1 100%);
  background-size: 56px 56px, 56px 56px, auto;
  color: var(--ink);
  font-family: var(--ui-font);
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(25, 25, 25, 0.72);
  outline-offset: 2px;
}

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

.home-screen {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  color: #fffaf0;
  isolation: isolate;
}

.home-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(7, 27, 26, 0.78) 0%, rgba(7, 27, 26, 0.5) 44%, rgba(7, 27, 26, 0.14) 100%),
    radial-gradient(circle at 80% 18%, rgba(255, 242, 196, 0.22), transparent 32%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(12, 38, 34, 0.44));
}

.home-canvas {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  display: block;
}

.home-nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0;
}

.home-nav .brand-mark {
  background: rgba(255, 250, 240, 0.92);
  border-color: rgba(255, 250, 240, 0.32);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
}

.home-nav-action,
.home-primary,
.home-secondary {
  border-radius: 999px;
  font-weight: 900;
  letter-spacing: 0;
}

.home-nav-action {
  min-height: 40px;
  border: 1px solid rgba(255, 250, 240, 0.34);
  background: rgba(255, 250, 240, 0.12);
  color: #fffaf0;
  padding: 0 16px;
  backdrop-filter: blur(12px);
}

.home-hero {
  position: relative;
  z-index: 2;
  width: min(720px, calc(100% - 48px));
  margin: 11vh auto 0;
  transform: translateX(-20%);
}

.home-hero h2 {
  margin: 0;
  max-width: 680px;
  font-family: var(--reading-font);
  font-size: clamp(40px, 5.3vw, 64px);
  line-height: 1.12;
  font-weight: 500;
  text-wrap: balance;
}

.home-hero p:not(.eyebrow) {
  max-width: 620px;
  margin: 24px 0 0;
  color: rgba(255, 250, 240, 0.82);
  font-size: 18px;
  line-height: 1.72;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.home-primary,
.home-secondary {
  min-height: 50px;
  padding: 0 22px;
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.22);
}

.home-primary {
  border: 0;
  background: #fffaf0;
  color: #173f38;
}

.home-secondary {
  border: 1px solid rgba(255, 250, 240, 0.36);
  background: rgba(255, 250, 240, 0.12);
  color: #fffaf0;
  backdrop-filter: blur(14px);
}

.home-nav-action:hover,
.home-primary:hover,
.home-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 28px 58px rgba(0, 0, 0, 0.28);
}

.home-preview {
  position: absolute;
  right: max(32px, calc((100vw - 1180px) / 2));
  bottom: 44px;
  z-index: 2;
  width: min(430px, calc(100% - 48px));
  min-height: 360px;
}

.preview-card {
  position: absolute;
  width: 300px;
  border: 1px solid rgba(255, 250, 240, 0.24);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.15);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
  padding: 18px;
}

.preview-card span {
  display: block;
  margin-bottom: 9px;
  color: rgba(255, 250, 240, 0.62);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.preview-card strong {
  display: block;
  font-family: var(--reading-font);
  font-size: 24px;
  line-height: 1.18;
  font-weight: 500;
}

.preview-card p {
  margin: 12px 0 0;
  color: rgba(255, 250, 240, 0.72);
  line-height: 1.5;
  font-size: 14px;
}

.preview-profile {
  top: 0;
  right: 28px;
}

.preview-question {
  top: 132px;
  left: 0;
  background: rgba(232, 250, 242, 0.17);
}

.preview-record {
  right: 0;
  bottom: 0;
  background: rgba(255, 235, 190, 0.18);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 251, 244, 0.9);
  color: var(--ink);
  border-bottom: 1px solid rgba(111, 89, 60, 0.16);
  padding: 14px 32px;
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(0, 1fr) minmax(220px, 330px);
  gap: 24px;
  align-items: center;
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 34px rgba(48, 40, 30, 0.1);
}

.brand-block {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: #fffaf0;
  color: transparent;
  box-shadow: 0 10px 20px rgba(13, 115, 119, 0.22);
}

.brand-mark picture,
.brand-mark img {
  width: 104%;
  height: 104%;
  display: block;
}

.brand-mark img {
  object-fit: contain;
  object-position: 50% 44%;
  border-radius: 50%;
}

.brand-block h1,
.topbar h2,
.section-heading h3 {
  margin: 0;
  line-height: 1.15;
}

.brand-block h1 {
  font-family: var(--reading-font);
  font-size: 26px;
  font-weight: 500;
}

.eyebrow {
  margin: 0 0 6px;
  color: inherit;
  opacity: 0.56;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.nav-item {
  width: auto;
  min-height: 36px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: center;
  padding: 8px 10px;
  white-space: nowrap;
  border-radius: 999px;
  font-size: 14px;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease, color 160ms ease;
}

.nav-item.active,
.nav-item:hover {
  border-color: rgba(31, 81, 60, 0.18);
  background: #edf6ef;
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(31, 81, 60, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.65);
  transform: translateY(-1px);
}

.discernment {
  border-left: 3px solid rgba(185, 133, 36, 0.5);
  padding: 8px 0 8px 18px;
  background: rgba(255, 250, 240, 0.68);
  border-radius: 0 8px 8px 0;
}

.discernment p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.discernment strong {
  display: block;
  font-family: var(--reading-font);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

.workspace {
  min-width: 0;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.topbar,
.section-heading,
.student-strip,
.profile-summary,
.growth-map {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  padding: 24px;
  border: 1px solid var(--surface-line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 252, 246, 0.96), rgba(243, 250, 246, 0.82));
  box-shadow: var(--shadow-raised);
  position: relative;
  overflow: hidden;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: auto 22px 0;
  height: 5px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, var(--forest), var(--gold), var(--sky));
  opacity: 0.8;
}

.topbar h2 {
  font-family: var(--reading-font);
  font-size: 42px;
  font-weight: 500;
  letter-spacing: 0;
}

.operator-access {
  display: grid;
  grid-template-columns: auto minmax(140px, 180px) 64px;
  gap: 8px;
  align-items: center;
}

.operator-access label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.operator-access input,
.operator-access button {
  min-height: 38px;
  border: 1px solid rgba(111, 89, 60, 0.18);
  border-radius: 999px;
}

.operator-access input {
  padding: 0 14px;
}

.operator-access button {
  background: var(--forest);
  border-color: var(--forest);
  color: #ffffff;
  font-size: 13px;
}

.access-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(420px, 1fr);
  gap: 14px 18px;
  align-items: center;
  border: 1px solid rgba(68, 124, 150, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, #fef8ec 0%, #eef8f6 100%);
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-raised);
  position: relative;
  overflow: hidden;
}

.access-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: linear-gradient(180deg, var(--gold), var(--teal));
}

.access-panel > * {
  position: relative;
}

.access-panel h3 {
  margin: 0;
  font-family: var(--reading-font);
  font-size: 26px;
  font-weight: 500;
}

.access-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(150px, 1fr) 108px;
  gap: 8px;
}

.access-form select,
.access-form input,
.access-form button {
  min-height: 42px;
  border: 1px solid rgba(68, 124, 150, 0.22);
  border-radius: 999px;
}

.access-form select,
.access-form input {
  background: #ffffff;
  padding: 0 14px;
}

.access-form button {
  border: 0;
  background: var(--teal);
  color: #ffffff;
  font-weight: 800;
}

.access-message {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.access-panel.is-compact {
  grid-template-columns: minmax(220px, 0.55fr) minmax(420px, 1fr);
}

.student-strip {
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(111, 89, 60, 0.14);
}

.student-pill {
  min-width: 176px;
  border: 1px solid rgba(111, 89, 60, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  padding: 10px 15px;
  text-align: left;
  display: grid;
  gap: 2px;
  box-shadow: 0 6px 14px rgba(48, 40, 30, 0.06);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.student-pill:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.student-pill.active {
  border-color: rgba(31, 81, 60, 0.28);
  box-shadow: 0 10px 24px rgba(31, 81, 60, 0.16);
  background: linear-gradient(135deg, var(--forest), var(--teal));
  color: #ffffff;
}

.student-pill.active small {
  color: rgba(255, 255, 255, 0.72);
}

.student-pill span {
  font-weight: 800;
}

.student-pill small {
  color: var(--muted);
}

.empty-dashboard {
  min-height: 360px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  border: 1px solid rgba(111, 89, 60, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(31, 81, 60, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 250, 240, 0.78));
  box-shadow: var(--shadow-raised);
  text-align: center;
  padding: 42px 24px;
}

.empty-dashboard h3 {
  margin: 0;
  font-family: var(--reading-font);
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 500;
}

.empty-dashboard p:not(.eyebrow) {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.08fr) minmax(340px, 0.92fr);
  gap: 32px;
  align-items: start;
  perspective: 1200px;
}

.dashboard-grid.is-locked {
  display: none;
}

.panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 247, 239, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-top: 1px solid rgba(255, 255, 255, 0.9);
  padding: 26px 22px 30px;
  box-shadow: var(--shadow-raised);
  border-radius: 8px;
  backdrop-filter: blur(8px);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94), inset 0 -1px 0 rgba(70, 56, 35, 0.07);
}

.panel > * {
  position: relative;
}

.student-profile {
  transform: translateY(-4px);
  border-color: rgba(31, 81, 60, 0.2);
  background:
    linear-gradient(135deg, rgba(31, 81, 60, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 250, 246, 0.92));
  box-shadow: var(--shadow-floating);
}

.student-profile::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(90deg, var(--forest), var(--teal), var(--gold));
}

.llm-channel,
.record-composer,
.lesson-panel,
.philosophy-panel {
  grid-column: 1 / -1;
}

.safety-panel,
.source-panel,
.resource-panel {
  grid-column: span 1;
}

.section-heading {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(111, 89, 60, 0.12);
}

.section-heading.compact {
  margin-bottom: 16px;
}

.section-heading h3 {
  font-family: var(--reading-font);
  font-size: 28px;
  font-weight: 500;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e9f5e7;
  color: var(--forest);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.status-chip.safe {
  background: #e5f4f6;
  color: var(--teal);
}

.profile-summary {
  align-items: stretch;
  gap: 0;
  margin-bottom: 22px;
  flex-wrap: wrap;
  border: 1px solid rgba(111, 89, 60, 0.12);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.profile-summary > div {
  flex: 1 1 150px;
  min-width: 140px;
  border: 0;
  border-right: 1px solid rgba(111, 89, 60, 0.12);
  padding: 15px 16px;
  background: #fffdf8;
  min-height: 92px;
  display: grid;
  align-content: center;
}

.profile-summary > div:nth-child(2) {
  background: #f1f8f5;
}

.profile-summary > div:nth-child(3) {
  background: #fff7ea;
}

.profile-summary > div:last-child {
  border-right: 0;
}

.label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.profile-summary strong,
.axis-card strong {
  display: block;
  line-height: 1.3;
  font-size: 16px;
}

.keyword-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.keyword {
  border: 1px solid rgba(95, 143, 87, 0.26);
  border-radius: 999px;
  background: #f3f9ef;
  color: var(--forest);
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 5px 12px rgba(95, 143, 87, 0.08);
}

.source-banner {
  display: grid;
  gap: 4px;
  border: 0;
  border-left: 4px solid var(--teal);
  background: #eef8f7;
  color: #15505a;
  padding: 12px 14px;
  margin-bottom: 22px;
  border-radius: 8px;
  box-shadow: 0 10px 20px rgba(13, 115, 119, 0.08);
}

.source-banner strong {
  font-size: 14px;
}

.source-banner span {
  color: #4f6f79;
  font-size: 13px;
  line-height: 1.45;
}

.growth-map {
  gap: 14px;
  align-items: stretch;
}

.axis-card {
  flex: 1;
  min-width: 0;
  background: #fffaf0;
  border: 1px solid rgba(185, 133, 36, 0.18);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
  transform: translateY(0);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.axis-card:nth-child(2) {
  background: #f1f8fb;
  border-color: rgba(68, 124, 150, 0.18);
  box-shadow: var(--shadow-soft);
}

.axis-card:hover,
.insight-row > div:hover,
.summary-item:hover,
.record-item:hover,
.pillar-grid button:hover,
.safety-grid > div:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-raised);
}

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

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

.insight-row > div {
  border: 1px solid rgba(169, 77, 91, 0.15);
  border-radius: 8px;
  background: #fff5f6;
  padding: 14px;
  box-shadow: 0 8px 16px rgba(169, 77, 91, 0.07);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.insight-row > div:nth-child(2) {
  border-color: rgba(124, 106, 169, 0.16);
  background: #f6f3fb;
}

.is-muted {
  opacity: 0.38;
}

.is-hidden {
  display: none !important;
}

.llm-channel {
  min-height: 510px;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(135deg, rgba(13, 115, 119, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 248, 247, 0.92));
}

.chat-window {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 346px;
  max-height: 386px;
  overflow: auto;
  padding: 16px;
  background: #f3f8f7;
  border: 1px solid rgba(13, 115, 119, 0.18);
  border-radius: 8px;
  box-shadow: inset 0 2px 12px rgba(13, 115, 119, 0.08);
}

.message {
  max-width: 88%;
  padding: 12px 14px;
  line-height: 1.58;
  font-size: 14px;
  border-radius: 8px;
  position: relative;
}

.message.coach {
  background: #ffffff;
  border: 1px solid rgba(13, 115, 119, 0.14);
  box-shadow: 0 8px 18px rgba(13, 115, 119, 0.07);
}

.message.student {
  justify-self: end;
  background: var(--forest);
  color: #ffffff;
  border: 1px solid var(--forest);
  box-shadow: 0 8px 18px rgba(31, 81, 60, 0.14);
}

.chat-compose {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 76px;
  gap: 8px;
  margin-top: 12px;
}

.chat-compose input,
.deepdive-compose input {
  min-width: 0;
  height: 42px;
  border: 1px solid rgba(111, 89, 60, 0.18);
  border-radius: 999px;
  padding: 0 16px;
}

.chat-compose button,
.deepdive-compose button {
  border: 0;
  border-radius: 999px;
  background: var(--forest);
  color: #ffffff;
  font-weight: 800;
}

.chat-compose button:disabled,
.deepdive-compose button:disabled,
.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.chat-compose input:disabled,
.deepdive-compose input:disabled,
textarea:disabled,
select:disabled {
  background: #f4f6f4;
  color: var(--muted);
}

.api-status {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.lesson-panel,
.formation-panel,
.philosophy-panel,
.record-composer,
.safety-panel,
.resource-panel {
  min-height: 280px;
}

.formation-panel {
  background:
    linear-gradient(135deg, rgba(185, 133, 36, 0.12), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 250, 240, 0.9));
}

.resource-panel {
  background:
    linear-gradient(135deg, rgba(124, 106, 169, 0.12), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 248, 255, 0.9));
}

.record-composer {
  background:
    linear-gradient(135deg, rgba(95, 143, 87, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 240, 0.92));
}

.lesson-panel {
  background:
    linear-gradient(135deg, rgba(68, 124, 150, 0.13), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 251, 0.92));
}

.philosophy-panel {
  background:
    linear-gradient(135deg, rgba(124, 106, 169, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 248, 255, 0.92));
}

.matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.provider-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(68, 124, 150, 0.26);
  border-radius: 999px;
  background: #ffffff;
  color: #164f62;
  padding: 0 11px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 900;
}

.deepdive-chat-heading {
  align-items: center;
}

.deepdive-system-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  border-bottom: 1px solid rgba(68, 124, 150, 0.18);
  padding: 0 0 12px;
  margin-bottom: 12px;
}

.deepdive-system-note strong {
  color: #164f62;
  font-size: 13px;
}

.deepdive-system-note p {
  margin: 0;
  color: #4f6f79;
  line-height: 1.45;
  font-size: 13px;
}

.deepdive-chat-window {
  min-height: 420px;
  max-height: 560px;
  overflow: auto;
  border: 1px solid rgba(68, 124, 150, 0.18);
  border-radius: 8px;
  background: #fbfdfe;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.deepdive-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
  margin-top: 10px;
}

.attachment-chip {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 8px;
  max-width: min(100%, 320px);
  border: 1px solid rgba(68, 124, 150, 0.2);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px 9px;
}

.attachment-chip span,
.attachment-chip small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-chip span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.attachment-chip small {
  color: var(--muted);
  font-size: 11px;
}

.attachment-chip button {
  grid-row: 1 / span 2;
  grid-column: 2;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: #eef7fb;
  color: #164f62;
  font-weight: 900;
}

.deepdive-compose {
  display: grid;
  grid-template-columns: auto 1fr 76px;
  gap: 8px;
  margin-top: 12px;
}

.attach-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid rgba(68, 124, 150, 0.22);
  border-radius: 8px;
  background: #ffffff;
  color: #164f62;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.attach-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.channel-actions,
.deepdive-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.channel-actions button,
.deepdive-actions button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 14px;
  font-weight: 800;
}

.provider-policy {
  border: 1px solid rgba(68, 124, 150, 0.2);
  background: #f4fbfd;
  padding: 14px;
  margin-top: 16px;
}

.provider-policy strong {
  display: block;
  color: #164f62;
  margin-top: 4px;
}

.provider-policy p {
  margin: 8px 0 0;
  color: #4f6f79;
  line-height: 1.5;
  font-size: 14px;
}

.matrix-cell {
  min-height: 84px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  align-content: center;
  gap: 5px;
}

.matrix-cell span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.matrix-cell strong {
  font-size: 20px;
}

.matrix-cell.up {
  background: #f1f8ee;
}

.matrix-cell.down {
  background: #fff6f2;
}

.field-block {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.field-block span {
  color: var(--ink);
  font-weight: 800;
  font-size: 14px;
}

textarea {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  border: 1px solid rgba(111, 89, 60, 0.18);
  border-radius: 8px;
  padding: 12px;
  line-height: 1.58;
}

select,
.record-form input,
.profile-update-form input[type="text"],
.resource-form input[type="text"],
.student-resource-form input[type="text"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(111, 89, 60, 0.18);
  border-radius: 8px;
  background: #ffffff;
  padding: 0 12px;
}

.primary-action {
  width: 100%;
  min-height: 44px;
  margin-top: 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--forest), var(--teal));
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 14px 26px rgba(31, 81, 60, 0.18);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.primary-action:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-raised);
}

.record-list {
  display: grid;
  gap: 12px;
  position: relative;
  padding-left: 16px;
}

.resource-list {
  display: grid;
  gap: 14px;
}

.resource-item {
  border: 1px solid rgba(124, 106, 169, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 10px 22px rgba(124, 106, 169, 0.08);
  padding: 16px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.resource-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-raised);
}

.resource-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.resource-meta span,
.resource-item small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.resource-meta a {
  color: var(--sky);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.resource-item strong {
  display: block;
  font-family: var(--reading-font);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.25;
}

.resource-item p {
  margin: 10px 0 0;
  color: #3f3f3f;
  font-family: var(--reading-font);
  font-size: 15px;
  line-height: 1.66;
}

.resource-item blockquote {
  margin: 12px 0 0;
  border-left: 3px solid var(--lilac);
  padding: 8px 0 8px 12px;
  color: #4b4068;
  background: #faf8ff;
  font-size: 14px;
  line-height: 1.56;
}

.resource-form {
  margin-top: 24px;
  border-top: 1px solid rgba(111, 89, 60, 0.14);
  padding-top: 22px;
}

.student-resource-form {
  margin-top: 18px;
  border-top: 1px solid rgba(111, 89, 60, 0.14);
  padding-top: 18px;
}

.student-resource-file {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.student-resource-file > span {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-list::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 3px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold), var(--teal));
  opacity: 0.46;
}

.summary-list {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
}

.summary-item {
  border: 1px solid rgba(185, 133, 36, 0.18);
  border-radius: 8px;
  background: #fffaf0;
  padding: 16px;
  box-shadow: var(--shadow-soft);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.summary-item span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.summary-item strong {
  display: block;
  margin-bottom: 8px;
  font-family: var(--reading-font);
  font-size: 20px;
  font-weight: 500;
}

.summary-item p {
  margin: 0;
  color: #3f3f3f;
  font-family: var(--reading-font);
  font-size: 16px;
  line-height: 1.72;
}

.record-item {
  position: relative;
  border: 1px solid rgba(111, 89, 60, 0.12);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 18px rgba(48, 40, 30, 0.06);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.record-item::before {
  content: "";
  position: absolute;
  top: 22px;
  left: -20px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--gold);
  border: 2px solid #fffaf0;
  box-shadow: 0 0 0 3px rgba(185, 133, 36, 0.18);
}

.record-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.record-item strong {
  display: block;
  font-family: var(--reading-font);
  font-size: 20px;
  font-weight: 500;
}

.record-meta span {
  color: var(--muted);
  font-size: 12px;
}

.record-item p {
  margin: 0;
  color: #3f3f3f;
  line-height: 1.72;
  font-family: var(--reading-font);
  font-size: 16px;
}

.record-item.empty-record {
  background: rgba(255, 255, 255, 0.72);
}

.record-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.record-actions button {
  min-height: 30px;
  border: 1px solid rgba(111, 89, 60, 0.18);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
}

.record-actions button[data-record-action="delete"] {
  color: #9b2f21;
  border-color: #e3b9b1;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag-row span {
  border: 1px solid rgba(95, 143, 87, 0.24);
  border-radius: 999px;
  background: #f3f9ef;
  color: var(--forest);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

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

.pillar-grid button {
  min-height: 58px;
  border: 1px solid rgba(124, 106, 169, 0.16);
  border-radius: 8px;
  background: #faf8ff;
  color: var(--ink);
  text-align: left;
  padding: 12px;
  font-weight: 800;
  box-shadow: 0 8px 16px rgba(124, 106, 169, 0.06);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.pillar-grid button span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
}

.philosophy-copy {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.6;
}

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

.safety-grid > div,
.safety-principles {
  border: 1px solid rgba(169, 77, 91, 0.14);
  border-radius: 8px;
  background: #fff7f8;
  padding: 14px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.safety-grid ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  line-height: 1.65;
}

.safety-principles {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.safety-principles p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.profile-update-form {
  margin-top: 24px;
  border-top: 1px solid rgba(111, 89, 60, 0.14);
  padding-top: 22px;
}

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

.context-note-box {
  margin-top: 14px;
  border: 1px solid rgba(68, 124, 150, 0.16);
  border-radius: 8px;
  background: #f4f9fb;
  padding: 14px;
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.option-row label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

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

.source-item {
  border: 0;
  border-top: 1px solid rgba(111, 89, 60, 0.14);
  background: transparent;
  padding: 16px 0;
}

.source-item strong,
.source-item span {
  display: block;
}

.source-item span {
  margin-top: 4px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.source-item p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

.source-item.privacy {
  background: #fffaf0;
  border: 1px solid #ead8ac;
  border-radius: 8px;
  padding: 14px;
}

@media (max-width: 1120px) {
  .home-hero {
    transform: none;
    margin-top: 8vh;
  }

  .home-preview {
    position: relative;
    right: auto;
    bottom: auto;
    width: min(720px, calc(100% - 48px));
    min-height: 280px;
    margin: 34px auto 44px;
  }

  .app-shell,
  .app-header {
    grid-template-columns: 1fr;
  }

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

  .nav-item {
    width: 100%;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .home-nav {
    width: calc(100% - 36px);
    padding: 18px 0;
  }

  .home-nav-action {
    min-width: max-content;
  }

  .home-hero {
    width: calc(100% - 36px);
    margin-top: 6vh;
  }

  .home-hero h2 {
    font-size: clamp(30px, 8.8vw, 38px);
    line-height: 1.14;
  }

  .home-hero p:not(.eyebrow) {
    font-size: 16px;
  }

  .home-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .home-primary,
  .home-secondary {
    width: 100%;
  }

  .home-preview {
    width: calc(100% - 36px);
    min-height: 0;
    display: grid;
    gap: 12px;
    margin-top: 28px;
  }

  .preview-card {
    position: static;
    width: 100%;
  }

  .workspace,
  .app-header {
    padding: 18px;
  }

  .app-header {
    gap: 14px;
  }

  .brand-block {
    grid-template-columns: 40px 1fr;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .topbar,
  .operator-access,
  .access-panel,
  .access-form,
  .profile-summary,
  .profile-update-grid,
  .section-heading,
  .growth-map,
  .insight-row,
  .safety-grid {
    display: grid;
  }

  .matrix,
  .pillar-grid,
  .operator-access,
  .access-panel,
  .access-panel.is-compact,
  .access-form,
  .student-resource-file {
    grid-template-columns: 1fr;
  }

  .nav-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-item {
    width: auto;
    min-width: max-content;
    padding: 8px 14px;
  }

  .discernment {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 12px 0 0;
  }

  .section-heading {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .topbar h2 {
    font-size: 32px;
  }

  .chat-compose,
  .deepdive-compose {
    grid-template-columns: 1fr;
  }

  .chat-compose button,
  .deepdive-compose button {
    min-height: 42px;
  }
}
