:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-muted: #f1f4f6;
  --ink: #172026;
  --muted: #62717b; 
  --line: #d8e0e5;
  --burgundy: #160382;
  --burgundy-dark: #160382;
  --green: #1d7151;
  --gold: #b8872d;
  --teal: #19778a;
  --danger: #b3261e;
  --shadow: 0 14px 34px rgba(23, 32, 38, 0.06);
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

.page-intro {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at center, #fff 0%, #f7f8fa 68%);
  pointer-events: none;
  animation: page-intro-exit 2s ease-in-out both;
}

.page-intro-mark {
  position: relative;
  display: grid;
  width: min(90vw, 520px);
  height: 100px;
  place-items: center;
}

.page-intro-wordmark {
  color: var(--burgundy);
  font-size: clamp(2.7rem, 9vw, 4.25rem);
  font-weight: 850;
  letter-spacing: -0.075em;
  line-height: 1;
  white-space: nowrap;
  transform-origin: center;
  animation: page-intro-wordmark 2s cubic-bezier(.65, 0, .25, 1) both;
}

.page-intro-logo {
  position: absolute;
  width: 72px;
  height: 72px;
  opacity: 0;
  transform: scale(.58) rotate(-8deg);
  animation: page-intro-logo 2s cubic-bezier(.2, .8, .2, 1) both;
}

.brand-mark-image {
  display: block;
  object-fit: contain;
}

@keyframes page-intro-wordmark {
  0%, 56% { opacity: 1; transform: scaleX(1); }
  76% { opacity: 0; transform: scaleX(.12); }
  100% { opacity: 0; transform: scaleX(.08); }
}

@keyframes page-intro-logo {
  0%, 52% { opacity: 0; transform: scale(.58) rotate(-8deg); }
  64% { opacity: 1; transform: scale(.96) rotate(2deg); }
  78%, 100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes page-intro-exit {
  0%, 80% { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .page-intro { display: none; }
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-card {
  display: grid;
  gap: 14px;
  width: min(440px, 100%);
  padding: 24px;
}

.auth-card h1,
.auth-card p {
  margin: 0;
}

.auth-card form {
  display: grid;
  gap: 12px;
}

.auth-page {
  min-height: 100vh;
  background: #f7f7fb;
}

.auth-layout { display: grid; min-height: 100vh; grid-template-columns: minmax(360px, .92fr) 1.08fr; }
.auth-welcome { position: relative; display: flex; min-height: 100vh; overflow: hidden; flex-direction: column; justify-content: space-between; padding: clamp(30px, 5vw, 68px); color: #fff; background: linear-gradient(145deg, #13036e 0%, #28118d 52%, #4838b2 100%); }
.auth-brand { position: relative; z-index: 1; display: inline-flex; width: fit-content; align-items: center; gap: 12px; color: #fff; font-size: 1.1rem; font-weight: 800; letter-spacing: -.02em; text-decoration: none; }
.auth-brand .brand-mark { width: 43px; height: 43px; border: 1px solid rgba(255,255,255,.28); border-radius: 13px; background: rgba(255,255,255,.14); }
.welcome-copy { position: relative; z-index: 1; max-width: 490px; margin: auto 0; padding: 58px 0; }
.auth-kicker, .auth-eyebrow { margin-bottom: 16px; font-size: .72rem; font-weight: 800; letter-spacing: .16em; }
.auth-kicker { color: #c4baff; }
.welcome-copy h1 { margin: 0 0 20px; font-size: clamp(2.6rem, 5vw, 4.5rem); line-height: 1.02; letter-spacing: -.055em; }
.welcome-copy > p:last-child { max-width: 390px; color: rgba(255,255,255,.77); font-size: 1.04rem; line-height: 1.7; }
.welcome-note { position: relative; z-index: 1; display: flex; align-items: center; gap: 15px; color: rgba(255,255,255,.76); }
.welcome-note p { line-height: 1.55; }
.welcome-note strong { color: #fff; font-weight: 650; }
.note-mark { color: #c4baff; font-family: Georgia, serif; font-size: 3rem; line-height: 1; }
.note-rule { width: 40px; height: 1px; margin-left: auto; background: rgba(255,255,255,.35); }
.auth-orbit { position: absolute; width: 420px; height: 420px; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; pointer-events: none; }
.auth-orbit-one { right: -220px; top: 15%; }
.auth-orbit-two { right: -280px; top: 22%; width: 540px; height: 540px; }
.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 44px 28px 24px; }
.auth-form-side .auth-card { width: min(420px, 100%); padding: 0; gap: 0; border: 0; background: transparent; box-shadow: none; }
.auth-eyebrow { margin: 0 0 10px; color: var(--burgundy); }
.auth-form-side h2 { margin: 0; color: #202333; font-size: clamp(1.9rem, 3vw, 2.35rem); letter-spacing: -.045em; }
.auth-description { margin: 9px 0 30px; color: #74798a; }
.auth-form-side form { display: grid; gap: 10px; }
.auth-form-side form label { margin-top: 7px; color: #363a49; font-size: .87rem; font-weight: 700; }
.auth-label-hint { display: inline; margin-left: 5px; color: #9296a4; font-size: .76rem; font-weight: 500; }
.auth-form-side input { min-height: 49px; padding: 0 14px; border-color: #dfe1e9; border-radius: 10px; background: #fff; transition: border-color .18s, box-shadow .18s; }
.auth-form-side input::placeholder { color: #a4a8b4; }
.auth-form-side input:focus { border-color: #6e5bd0; outline: 0; box-shadow: 0 0 0 3px rgba(87, 65, 190, .12); }
.auth-submit { display: flex; min-height: 50px; align-items: center; justify-content: space-between; margin-top: 12px; padding: 0 17px; border: 0; border-radius: 10px; color: #fff; background: linear-gradient(100deg, #211080, #3e2aab); font-weight: 750; box-shadow: 0 8px 18px rgba(38, 20, 128, .18); transition: transform .18s, box-shadow .18s, opacity .18s; }
.auth-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 11px 22px rgba(38, 20, 128, .24); }
.auth-submit:disabled { cursor: wait; opacity: .72; }
.auth-status { margin: 8px 0 0; padding: 11px 12px; border: 1px solid; border-radius: 9px; font-size: .88rem; line-height: 1.5; }
.auth-status.is-error { border-color: #f0c6c3; color: #9d2923; background: #fff4f3; }
.auth-status.is-success { border-color: #b8dfc8; color: #246342; background: #f0faf4; }
.auth-signup { margin: 24px 0 0; color: #75798a; text-align: center; font-size: .9rem; }
.auth-signup a { color: var(--burgundy); font-weight: 750; text-decoration: none; }
.auth-signup a:hover { text-decoration: underline; }
.auth-secure { margin: 38px 0 0; color: #979baa; text-align: center; font-size: .78rem; }
.auth-secure span { margin-right: 6px; color: #37a475; font-size: .62rem; }
.auth-footer { position: absolute; bottom: 22px; color: #969baa; font-size: .78rem; }
.auth-footer span { padding: 0 4px; color: var(--burgundy); }
.signup-form-side { padding-top: 38px; padding-bottom: 38px; }
.signup-form-side .auth-description { margin-bottom: 19px; }
.signup-form-side form { gap: 7px; }
.signup-form-side form label { margin-top: 4px; }
.signup-form-side .auth-secure { margin-top: 22px; }

@media (max-width: 760px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-welcome { min-height: auto; padding: 22px 25px 18px; }
  .welcome-copy { margin: 34px 0 10px; padding: 0; }
  .welcome-copy h1 { font-size: clamp(2rem, 9vw, 3rem); }
  .welcome-copy > p:last-child { display: none; }
  .welcome-note { display: none; }
  .auth-orbit-one { right: -290px; top: -260px; }
  .auth-orbit-two { right: -340px; top: -280px; }
  .auth-form-side { align-items: flex-start; padding: 36px 24px 70px; }
  .auth-footer { bottom: 20px; }
}

.profile-page {
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 0%, rgba(22, 3, 130, 0.08), transparent 42%), #f6f7fb;
}

.profile-shell { width: min(680px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 24px; }
.profile-back { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 20px; color: #4c5364; text-decoration: none; font-weight: 650; }
.profile-back:hover { color: var(--burgundy); }
.profile-card { overflow: hidden; border: 1px solid rgba(216, 224, 229, .9); border-radius: 22px; background: var(--surface); box-shadow: 0 24px 70px rgba(28, 33, 65, .1); }
.profile-cover { display: flex; align-items: flex-end; height: 126px; padding: 0 36px; background: linear-gradient(120deg, #160382, #3825a4 58%, #7866d2); }
.profile-cover .brand-mark { width: 66px; height: 66px; margin-bottom: -23px; border: 5px solid white; border-radius: 19px; background: #fff; color: var(--burgundy); box-shadow: 0 8px 22px rgba(16, 9, 58, .15); }
.profile-content { padding: 42px 38px 30px; }
.profile-content .eyebrow { margin: 0 0 9px; color: var(--burgundy); font-size: .72rem; font-weight: 800; letter-spacing: .14em; }
.profile-content h1 { margin-bottom: 9px; font-size: clamp(1.7rem, 5vw, 2.15rem); }
.profile-intro { max-width: 470px; color: var(--muted); line-height: 1.6; }
.profile-identity { display: flex; align-items: center; gap: 15px; margin: 27px 0 23px; }
.profile-avatar { display: grid; width: 56px; height: 56px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: #eeecfb; color: var(--burgundy); font-size: 1.05rem; font-weight: 800; }
.profile-identity strong, .profile-identity span { display: block; }
.profile-identity strong { font-size: 1.08rem; }
.profile-identity span { margin-top: 4px; color: var(--muted); font-size: .86rem; }
.profile-details { display: grid; gap: 10px; }
.profile-detail { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 14px 16px; border: 1px solid #e8eaf0; border-radius: 13px; background: #fbfbfd; }
.detail-icon { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border-radius: 12px; background: #f0effb; color: var(--burgundy); font-size: 1.1rem; }
.profile-detail div span, .profile-detail div strong { display: block; }
.detail-label { margin-bottom: 4px; color: var(--muted); font-size: .78rem; }
.profile-detail strong { overflow-wrap: anywhere; font-size: .95rem; }
.profile-status { min-height: 20px; margin: 12px 0 0; color: var(--danger); font-size: .88rem; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 7px; }
.profile-actions .button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; text-decoration: none; }
.profile-actions .button-secondary { flex: 1 1 230px; }
.profile-actions .button-danger { flex: 0 0 auto; }
.profile-actions .button-danger:hover:not(:disabled) { background: #941b16; }
.profile-footnote { margin-top: 22px; color: #87919a; text-align: center; font-size: .78rem; }
.profile-brand { margin-top: 19px; color: #77808a; text-align: center; font-size: .82rem; }
.profile-brand span { padding: 0 4px; color: var(--burgundy); }

@media (max-width: 520px) {
  .profile-shell { width: min(100% - 22px, 680px); padding-top: 20px; }
  .profile-cover { height: 102px; padding-inline: 22px; }
  .profile-content { padding: 38px 22px 23px; }
  .profile-actions { flex-direction: column; }
  .profile-actions .button { width: 100%; }
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding: 20px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(240px, 420px) auto;
  gap: 16px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto 16px;
  padding: 2px 0 4px;
}

.brand-block {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

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

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

h1 {
  font-size: clamp(1.35rem, 1.8vw, 1.9rem);
  line-height: 1.05;
}

.brand-block p,
.eyebrow,
.save-state,
.search-box span,
label span,
.empty-state span,
.note-card small,
.recorder-meter p {
  color: var(--muted);
  font-size: 0.82rem;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 24px rgba(23, 32, 38, 0.04);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.topbar-actions,
.record-controls,
.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.button,
.ghost-button,
.icon-button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 700;
}

a.button {
  text-decoration: none;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button-primary {
  color: #fff;
  background: var(--burgundy);
  border-color: var(--burgundy);
}

.button-primary:hover:not(:disabled) {
  background: var(--burgundy-dark);
}

.button-secondary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.button-secondary:hover:not(:disabled),
.ghost-button:hover {
  border-color: #b8c7d0;
  background: var(--surface-muted);
}

.button-danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.button-link {
  color: var(--danger);
  background: transparent;
}

.ghost-button {
  color: var(--ink);
  background: transparent;
}

.icon-button {
  display: grid;
  width: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
  font-size: 1.15rem;
}

.icon-button:hover {
  background: #2b3740;
}

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

.workspace {
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  align-items: start;
}

.sidebar,
.editor-column,
.support-stack {
  display: grid;
  gap: 14px;
}

.panel {
  min-width: 0;
  border: 1px solid rgba(216, 224, 229, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.notebook-panel,
.editor-panel,
.organizer-panel,
.insight-panel,
.learning-profile-panel {
  padding: 16px;
}

.support-stack .organizer-panel,
.support-stack .insight-panel,
.support-stack .learning-profile-panel {
  padding: 0;
  overflow: hidden;
}

.panel-heading,
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel h2,
.status-row h2 {
  font-size: 1.05rem;
}

.eyebrow {
  margin-bottom: 2px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.save-state,
.count-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--green);
  background: rgba(29, 113, 81, 0.1);
  font-weight: 800;
}

.course-list,
.note-list {
  display: grid;
  gap: 8px;
}

.note-list[hidden] {
  display: none;
}

.note-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.notes-toggle {
  min-height: 32px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 700;
}

.notes-toggle:hover {
  border-color: #b8c7d0;
  background: var(--surface-muted);
}

.notes-toggle[hidden] {
  display: none;
}

.sidebar-hint {
  align-self: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.class-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.class-form input {
  min-width: 0;
}

.course-button,
.note-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: left;
}

.course-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px;
  border: 1px solid transparent;
  border-radius: 10px;
}

.course-row.active {
  border-color: rgba(142, 35, 65, 0.2);
  background: rgba(142, 35, 65, 0.05);
}

.course-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 0 10px;
}

.course-button {
  flex: 1;
  min-width: 0;
}

.course-button.active {
  border-color: rgba(142, 35, 65, 0.4);
  background: rgba(142, 35, 65, 0.08);
}

.course-delete-button {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 1.2rem;
  line-height: 1;
}

.course-delete-button:hover {
  color: var(--danger);
  background: rgba(201, 88, 44, 0.1);
}

.course-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
}

.course-label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.course-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-card {
  display: grid;
  gap: 5px;
  padding: 12px;
}

.note-card.active {
  border-color: rgba(25, 119, 138, 0.48);
  background: rgba(25, 119, 138, 0.08);
}

.note-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-card small {
  display: block;
}

.primary-fields,
.metadata-grid {
  display: grid;
  gap: 12px;
}

.primary-fields {
  grid-template-columns: minmax(220px, 1.35fr) minmax(240px, 1fr);
  align-items: end;
}

.note-metadata {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.note-metadata > summary {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  cursor: pointer;
  list-style: none;
}

.note-metadata > summary::-webkit-details-marker {
  display: none;
}

.note-metadata > summary::after {
  content: "+";
  color: var(--muted);
  font-size: 1.2rem;
  font-weight: 800;
}

.note-metadata[open] > summary::after {
  content: "−";
}

.note-metadata > summary strong {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-metadata-fields {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
}

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

label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

label span {
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

input,
select {
  min-height: 42px;
  padding: 0 11px;
}

textarea {
  resize: vertical;
  padding: 11px;
  line-height: 1.48;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(25, 119, 138, 0.18);
  border-color: var(--teal);
}

.inline-details {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.inline-details summary,
.panel-summary {
  list-style: none;
  cursor: pointer;
}

.inline-details summary::-webkit-details-marker,
.panel-summary::-webkit-details-marker {
  display: none;
}

.inline-details summary {
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 800;
}

.inline-details[open] {
  background: #fff;
}

.inline-details[open] .metadata-grid {
  padding: 0 12px 12px;
}

.span-two {
  grid-column: span 2;
}

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

.mode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mode-header h3 {
  font-size: 1rem;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.segment-button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.segment-button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 4px 14px rgba(23, 32, 38, 0.08);
}

.segment-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.learning-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-muted);
}

.learning-panel p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.learning-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(74px, 1fr));
  gap: 8px;
  min-width: min(100%, 260px);
}

.learning-metrics span {
  display: grid;
  gap: 2px;
  min-height: 54px;
  align-content: center;
  padding: 8px;
  border: 1px solid rgba(216, 224, 229, 0.9);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.learning-metrics small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.recorder-surface {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid rgba(184, 199, 208, 0.74);
  border-radius: 8px;
  background: var(--surface-muted);
}

.recorder-meter {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.record-dot {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #9aa7af;
  box-shadow: 0 0 0 5px rgba(154, 167, 175, 0.15);
}

.record-dot.live {
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(179, 38, 30, 0.16);
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  50% {
    transform: scale(1.18);
  }
}

.transcript-field {
  margin-top: 4px;
}

.professor-field {
  margin: -2px 0 14px;
}

.professor-field textarea {
  min-height: 118px;
  background: #fbfcfd;
}

.transcript-field textarea {
  min-height: 320px;
}

.audio-review {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: -6px 0 16px;
}

.audio-review audio {
  width: 100%;
  min-width: 0;
}

.editor-actions {
  margin-top: 14px;
}

.irac-grid {
  display: grid;
  gap: 12px;
  padding: 0 16px 16px;
}

.personal-outline-field {
  margin: 0 16px 14px;
}

.personal-outline-field textarea {
  min-height: 150px;
}

.insight-panel {
  display: grid;
  gap: 0;
}

.panel-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.panel-summary strong {
  display: block;
  font-size: 1.02rem;
}

.panel-summary .eyebrow {
  display: block;
  margin-bottom: 2px;
}

.insight-block {
  margin: 0 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.insight-block:last-child {
  padding-bottom: 16px;
}

.insight-block h3 {
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.compact-list {
  display: grid;
  gap: 8px;
  min-height: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.compact-list li {
  border-left: 3px solid var(--gold);
  padding: 8px 10px;
  border-radius: 0 8px 8px 0;
  background: #fbfaf7;
  color: #31404a;
  font-size: 0.9rem;
}

.compact-list li.empty {
  border-left-color: var(--line);
  color: var(--muted);
  background: var(--surface-muted);
}

.profile-signals {
  padding: 0 16px 16px;
}

.empty-state {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px dashed #b8c7d0;
  border-radius: 8px;
  text-align: center;
}

.organized-note-result {
  margin: 14px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.organized-note-result .panel-heading {
  margin-bottom: 10px;
}

.organized-note-result h3 {
  font-size: 1rem;
}

.organized-note-content {
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.organized-note-content h2,
.organized-note-content h3 {
  margin: 16px 0 8px;
}

.organized-note-content h2:first-child,
.organized-note-content h3:first-child {
  margin-top: 0;
}

.organized-note-content p,
.organized-note-content ul,
.organized-note-content blockquote {
  margin: 8px 0;
}

.organized-note-content blockquote {
  padding: 8px 12px;
  border-left: 3px solid var(--green);
  color: var(--muted);
  background: #fff;
}

.organized-note-content ul {
  padding-left: 22px;
}

.compact-empty {
  padding: 12px;
  text-align: left;
}

.tutorial-dialog {
  width: min(560px, calc(100% - 32px));
  max-width: 560px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(23, 32, 38, 0.24);
}

.add-class-dialog {
  width: min(520px, calc(100% - 32px));
  max-width: 520px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  color: var(--ink);
  background: transparent;
  overflow: visible;
}

.add-class-dialog::backdrop {
  background: rgba(23, 32, 38, 0.48);
  backdrop-filter: blur(3px);
}

.add-class-dialog .new-class-form {
  margin: 0;
}

.tutorial-dialog::backdrop {
  background: rgba(23, 32, 38, 0.48);
  backdrop-filter: blur(3px);
}

.tutorial-card {
  display: grid;
  gap: 16px;
  padding: clamp(22px, 5vw, 32px);
}

.tutorial-step-label {
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 800;
}

.tutorial-card h2 {
  font-size: clamp(1.35rem, 3vw, 1.7rem);
}

.tutorial-card > p:not(.tutorial-step-label) {
  color: var(--muted);
  line-height: 1.6;
}

.tutorial-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.tutorial-progress span {
  display: block;
  width: 25%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 180ms ease;
}

.tutorial-actions,
.tutorial-actions > div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.tutorial-actions {
  justify-content: space-between;
  margin-top: 4px;
}

.tutorial-actions > div {
  justify-content: flex-end;
}

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

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

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

@media (max-width: 720px) {
  .app-shell {
    padding: 12px;
  }

  .topbar {
    gap: 12px;
  }

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

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

  .primary-fields,
  .metadata-grid {
    grid-template-columns: 1fr;
  }

  .span-two {
    grid-column: auto;
  }

  .mode-header,
  .learning-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented-control {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .learning-metrics {
    min-width: 0;
  }

  .recorder-surface {
    align-items: stretch;
    flex-direction: column;
  }

  .record-controls,
  .editor-actions,
  .topbar-actions,
  .audio-review {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .button,
  .ghost-button {
    flex: 1 1 auto;
  }

  .class-form {
    align-items: stretch;
  }

  .panel-summary {
    align-items: flex-start;
    flex-direction: column;
  }
}
