/* Meja Kuliah design system — always light. Quiet grey sidebar, white canvas, black accent.
   Firm look: crisp hairlines and small corners.
   Scale: type 12/13/14/16/20/26 · space 4/8/12/16/20/24/32 · radius 4/6/8/10. */
:root {
  --bg: #ffffff;
  --side: #f9f9f9;
  --subtle: #f7f7f8;
  --sunk: #f2f2f3;
  --hover: #ececee;
  --line: #e1e1e5;
  --line-strong: #c9c9cf;
  --ink: #0d0d0d;
  --ink-2: #3c3c43;
  --muted: #6e6e73;
  --faint: #a1a1a6;
  --accent: #0d0d0d;
  --on-accent: #ffffff;
  --ok: #17784a;
  --ok-bg: #e8f5ee;
  --warn: #9a5a06;
  --warn-bg: #fdf3e1;
  --bad: #c0362c;
  --bad-bg: #fdecea;
  --info: #2f5bd3;
  --info-bg: #ecf1fd;
  --gold: #c9a961;
  --mark: #fff7d9;
  --mark-line: #e5c44c;
  --edited: #eaf7f0;
  --edited-line: #4fa77d;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 10px;
  /* Buttons, chips and toggles: squared off, not pills. */
  --r-pill: 6px;
  --shadow-sm: 0 1px 2px rgba(16, 16, 20, 0.05);
  --shadow-md: 0 1px 2px rgba(16, 16, 20, 0.04), 0 6px 20px rgba(16, 16, 20, 0.06);
  --shadow-lg: 0 12px 48px rgba(16, 16, 20, 0.16);
  --f-body: 'Roboto', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-doc: 'Gelasio', Georgia, 'Times New Roman', serif;
  --f-mono: 'Roboto Mono', ui-monospace, Menlo, monospace;
  --side-w: 268px;
  --top-h: 56px;
  color-scheme: light;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body,
#root {
  height: 100%;
  margin: 0;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-weight: 500;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
::selection {
  background: #dfe6fb;
}
.ico {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mono {
  font-family: var(--f-mono);
  font-size: 0.9em;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12.5px;
  color: var(--muted);
}
.spacer {
  flex: 1;
}
.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.stack {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.boot {
  display: grid;
  place-items: center;
  height: 100%;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* ---------------- buttons ---------------- */
.btn {
  --h: 36px;
  height: var(--h);
  padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  text-decoration: none;
  transition:
    background 0.15s,
    border-color 0.15s,
    opacity 0.15s;
  flex: none;
}
.btn:hover:not(:disabled) {
  background: var(--subtle);
}
.btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover:not(:disabled) {
  background: #2b2b2e;
}
.btn-ghost {
  border-color: transparent;
  background: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--sunk);
}
.btn-danger {
  color: var(--bad);
}
.btn-danger-solid {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}
.btn-danger-solid:hover:not(:disabled) {
  background: #a42c23;
}
.btn-sm {
  --h: 32px;
  padding: 0 12px;
  font-size: 13px;
  gap: 6px;
}
.btn-icon {
  width: var(--h);
  padding: 0;
}
.btn-block {
  width: 100%;
}

/* ---------------- form controls ---------------- */
.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.field > label,
.label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}
.hint {
  font-size: 12.5px;
  color: var(--muted);
}
.input,
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background-color: var(--bg);
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(13, 13, 13, 0.06);
}
textarea {
  resize: vertical;
  line-height: 1.55;
}
select.input,
.field select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--sunk);
  border-radius: var(--r-pill);
  flex: none;
}
.seg button {
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-pill);
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.seg button[aria-pressed='true'] {
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chips.scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
  mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
}
.chips.scroll::-webkit-scrollbar {
  display: none;
}
.chip {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--ink-2);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex: none;
}
.chip:hover:not(:disabled) {
  background: var(--subtle);
}
.chip:disabled {
  opacity: 0.45;
}
.chip[aria-pressed='true'] {
  border-color: var(--ink);
  background: var(--subtle);
  color: var(--ink);
  font-weight: 500;
}
.chip[aria-pressed='false'] .ico {
  display: none;
}

/* ---------------- badges & tiles ---------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  background: var(--sunk);
  color: var(--muted);
  flex: none;
}
.badge .ico {
  width: 12px;
  height: 12px;
}
.badge-ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.badge-warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.badge-bad {
  background: var(--bad-bg);
  color: var(--bad);
}
.badge-info {
  background: var(--info-bg);
  color: var(--info);
}
.code {
  font-family: var(--f-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  background: var(--sunk);
  border-radius: var(--r-sm);
  padding: 2px 7px;
  white-space: nowrap;
}
.tile {
  --c: #3c3c43;
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  flex: none;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 10%, white);
}
.tile .ico {
  width: 18px;
  height: 18px;
}
.tile-lg {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
}
.tile-lg .ico {
  width: 21px;
  height: 21px;
}
.t-pdf {
  --c: #c0362c;
}
.t-pptx,
.t-ppt {
  --c: #c2570c;
}
.t-img {
  --c: #7c3aed;
}
.t-docx,
.t-task {
  --c: #2f5bd3;
}
.t-forum {
  --c: #9a5a06;
}
.t-other {
  --c: #3c3c43;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
  flex: none;
}
.dot-ok {
  background: var(--ok);
}
.dot-warn {
  background: #e19a2c;
}
.dot-bad {
  background: var(--bad);
}

/* ---------------- shell ---------------- */
.app {
  height: 100%;
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  transition: grid-template-columns 0.22s ease;
}
.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.top .side-show,
.top .brand-top {
  display: none;
}
@media (min-width: 861px) {
  .app.side-hidden {
    grid-template-columns: 0 minmax(0, 1fr);
  }
  .app.side-hidden .side {
    visibility: hidden;
    overflow: hidden;
  }
  .app.side-hidden .top .side-show {
    display: inline-flex;
    margin-left: -10px;
  }
  .app.side-hidden .top .brand-top {
    display: flex;
    flex: none;
    padding: 0 6px 0 0;
  }
  .app.side-hidden .ws.mem-open .ws-mem {
    left: 0;
  }
}
.side {
  background: var(--side);
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid #f0f0f2;
}
.side-top {
  padding: 14px 12px 8px;
  display: grid;
  gap: 10px;
}
.side-scroll {
  flex: 1;
  overflow: auto;
  padding: 4px 12px 12px;
  display: grid;
  gap: 18px;
  align-content: start;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
  text-decoration: none;
  color: var(--ink);
}
/* Wordmark: a bold sans "Meja" beside an italic serif "Kuliah". */
.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
  line-height: 1;
}
.wm-a {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.035em;
}
.wm-b {
  font-family: 'Gelasio', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: #4b4b55;
  position: relative;
}
.wm-b::after {
  content: '';
  position: absolute;
  right: -7px;
  bottom: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4f46e5;
}
.brand-top .wm-a {
  font-size: 16px;
}
.brand-top .wm-b {
  font-size: 17px;
}
.nav {
  display: grid;
  gap: 1px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--r-md);
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}
.nav a:hover {
  background: var(--hover);
}
.nav a[aria-current='page'] {
  background: var(--hover);
  font-weight: 500;
}
.nav a .ico {
  color: var(--ink-2);
}
.nav .sub {
  height: 32px;
  padding-left: 12px;
  font-size: 13px;
  color: var(--ink-2);
  gap: 10px;
}
.nav .sub .dot {
  background: var(--c, var(--faint));
}
.nav-head {
  display: flex;
  align-items: center;
  height: 28px;
  padding: 0 4px 0 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.nav-sem {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  margin-top: 6px;
  padding: 5px 8px 5px 2px;
  border: 0;
  background: none;
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  text-align: left;
  cursor: pointer;
}
.nav-sem:hover {
  background: var(--hover);
  color: var(--ink);
}
.nav-sem .ico {
  flex: none;
  width: 14px;
  height: 14px;
  margin: 0 3px 0 5px;
  color: var(--muted);
  transition: transform 0.15s;
}
.nav-sem.open .ico {
  transform: rotate(90deg);
}
.nav-sem .truncate {
  flex: 1;
}
.nav-count {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--faint);
}
.nav-sem-body {
  display: grid;
  gap: 1px;
  padding-left: 10px;
}
.side-foot {
  padding: 10px 12px 12px;
  border-top: 1px solid #efeff1;
  position: relative;
}
.me {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: var(--r-md);
  background: none;
  text-align: left;
}
.me:hover {
  background: var(--hover);
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1f1f22, #57575c);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 500;
  font-size: 12.5px;
  flex: none;
}
.me-txt {
  min-width: 0;
  line-height: 1.3;
  flex: 1;
}
.me-txt b {
  display: block;
  font-weight: 500;
  font-size: 13.5px;
}
.me-txt span {
  font-size: 12px;
  color: var(--muted);
}
main {
  overflow: auto;
  min-width: 0;
  min-height: 0;
  position: relative;
}
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--top-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
}
main.scrolled .top,
.top.bordered {
  border-bottom-color: var(--line);
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  flex: 1;
  font-size: 13.5px;
}
.crumbs a,
.crumbs span.here {
  padding: 4px 6px;
  border-radius: var(--r-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.crumbs a {
  color: var(--muted);
  text-decoration: none;
  flex: 0 1 auto;
}
.crumbs a:hover {
  color: var(--ink);
  background: var(--sunk);
}
.crumbs .here {
  color: var(--ink);
  font-weight: 500;
}
.crumbs .sep {
  color: var(--faint);
  width: 14px;
  height: 14px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.menu-btn {
  display: none;
}
.page {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding: 28px 32px 72px;
  display: grid;
  gap: 28px;
  align-content: start;
}

/* page header */
.page-head {
  display: flex;
  align-items: flex-end;
  gap: 16px 24px;
  flex-wrap: wrap;
}
.ph-main {
  flex: 1 1 260px;
  min-width: 0;
  display: grid;
  gap: 6px;
}
.ph-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}
.ph-main h1 {
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.022em;
}
.ph-sub {
  color: var(--muted);
  font-size: 14px;
}
.ph-sub a {
  color: var(--ink-2);
}
.ph-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
}
.section-head h2 {
  font-size: 17px;
}
.count {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--sunk);
  border-radius: var(--r-sm);
  padding: 1px 8px;
}

/* ---------------- menus ---------------- */
.menu-wrap {
  position: relative;
}
.menu-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 210px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 1px;
  animation: pop 0.12s ease-out;
}
.menu-pop.up {
  top: auto;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  text-align: left;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.menu-item:hover {
  background: var(--sunk);
}
.menu-item .ico {
  color: var(--ink-2);
}
.menu-item.danger,
.menu-item.danger .ico {
  color: var(--bad);
}
.menu-sep {
  height: 1px;
  background: var(--line);
  margin: 4px 2px;
}

/* ---------------- panels, lists, cards ---------------- */
.panel {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}
.panel-flush {
  padding: 6px;
  gap: 0;
}
.panel-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
}
.panel-head h2 {
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-foot {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.list {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  margin-inline: -10px;
  border-radius: var(--r-md);
  text-decoration: none;
  color: inherit;
  min-width: 0;
  position: relative;
}
.panel-flush .list-row {
  margin: 0;
}
a.list-row:hover,
.list-row.hoverable:hover {
  background: var(--subtle);
}
.lr-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}
.lr-title {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lr-meta {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.lr-meta > span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.lr-actions {
  display: flex;
  gap: 2px;
  flex: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.list-row:hover .lr-actions,
.list-row:focus-within .lr-actions {
  opacity: 1;
}
@media (hover: none) {
  .lr-actions {
    opacity: 1;
  }
}
.empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 20px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.empty .ico {
  width: 22px;
  height: 22px;
  color: var(--faint);
}
.empty-page {
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-xl);
  padding: 40px 24px;
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}
.empty-page h2 {
  font-size: 18px;
}
.empty-page p {
  max-width: 440px;
  color: var(--muted);
}
.drop {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: none;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.drop .ico {
  width: 18px;
  height: 18px;
}
.drop b {
  color: var(--ink);
  font-weight: 500;
}
.drop:hover,
.drop.over {
  border-color: var(--ink-2);
  background: var(--subtle);
}
.callout {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 14px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--subtle);
  border: 1px solid var(--line);
  text-decoration: none;
}
.callout .grow {
  flex: 1 1 220px;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.callout b {
  font-weight: 500;
  display: block;
}
.callout-warn {
  background: var(--warn-bg);
  border-color: #f4e2bf;
}
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.card {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg);
  text-decoration: none;
  color: inherit;
  text-align: left;
  min-width: 0;
  transition:
    border-color 0.15s,
    box-shadow 0.2s;
}
a.card:hover,
button.card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}
.card h3 {
  font-size: 15.5px;
  line-height: 1.35;
}
.card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
}
.card-new {
  border-style: dashed;
  border-color: var(--line-strong);
  background: none;
  place-content: center;
  justify-items: center;
  color: var(--muted);
  font-size: 14px;
  min-height: 150px;
  gap: 8px;
}
.card-new:hover {
  color: var(--ink);
  background: var(--subtle);
  box-shadow: none !important;
}
.stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
}
.stats span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.stats .ico {
  width: 14px;
  height: 14px;
}
.progress-dots {
  display: flex;
  gap: 4px;
}
.progress-dots i {
  flex: 1;
  max-width: 22px;
  height: 4px;
  border-radius: 2px;
  background: var(--hover);
}
.progress-dots i.on {
  background: var(--c, var(--ink));
}
.bar {
  height: 4px;
  border-radius: 2px;
  background: var(--hover);
  overflow: hidden;
  width: 100%;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--ink);
  border-radius: 2px;
}
.session-card .sc-title {
  font-size: 16px;
  font-weight: 500;
}
.session-card .sc-lines {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--faint);
}
.session-card .sc-lines span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.session-card .sc-lines .ico {
  width: 14px;
  height: 14px;
}
.session-card .sc-lines .on {
  color: var(--ink-2);
}
.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px;
  margin: -2px;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tabs a {
  height: 32px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--muted);
  font-size: 13.5px;
  white-space: nowrap;
  flex: none;
}
.tabs a:hover {
  background: var(--sunk);
  color: var(--ink);
}
.tabs a.active,
.tabs a[aria-current='page'] {
  background: var(--ink);
  color: #fff;
  font-weight: 500;
}
.tabs .dot {
  width: 5px;
  height: 5px;
  background: currentColor;
  opacity: 0.55;
}
.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 16px;
  align-items: start;
}

/* ---------------- answers, sources, memory ---------------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}
.aside-sticky {
  position: sticky;
  top: calc(var(--top-h) + 12px);
}
.prose {
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
}
.prose.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 8;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.question {
  font-size: 14.5px;
  color: var(--ink-2);
}
.answer-edit {
  display: block;
  width: 100%;
  min-height: 240px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--subtle);
  font-size: 15px;
  line-height: 1.75;
  outline: none;
  resize: vertical;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.answer-edit:focus {
  background: var(--bg);
  border-color: var(--line-strong);
}
.divider {
  height: 1px;
  background: var(--line);
}
.sources {
  display: grid;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.sources-title {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.sources ul {
  margin: 0;
  padding: 0 0 0 16px;
  display: grid;
  gap: 4px;
}
.progress {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}
.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--ink);
  animation: spin 0.8s linear infinite;
  flex: none;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.mem-list {
  display: grid;
  gap: 8px;
}
.mem {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  display: grid;
  gap: 4px;
  font-size: 13px;
}
.mem-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
}
.mem b {
  font-weight: 500;
}
.mem p {
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}

/* ---------------- task workspace ---------------- */
.ws {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr) 360px;
  height: calc(100% - var(--top-h));
}
.ws > section {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}
.ws-mem {
  background: var(--side);
  border-right: 1px solid var(--line);
  padding: 18px 16px;
  display: grid;
  gap: 12px;
  align-content: start;
}
.ws-mem-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ws-mem-head h2 {
  font-size: 14px;
}
.ws-canvas {
  background: var(--sunk);
  padding: 18px 24px 40px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 14px;
}
.doc-bar {
  width: min(780px, 100%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
}
.doc-bar .grow {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 6px;
}
.doc-bar .bar {
  max-width: 240px;
}
.legend {
  width: min(780px, 100%);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  padding: 0 4px;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}
.lg-id {
  background: var(--info-bg);
  border: 1px solid #cdd9f7;
}
.lg-fill {
  background: var(--mark);
  border-left: 3px solid var(--mark-line);
}
.lg-empty {
  border: 1.5px dashed #c9c2a8;
}
.lg-edit {
  background: var(--edited);
  border-left: 3px solid var(--edited-line);
}
.paper {
  width: min(780px, 100%);
  background: #fff;
  color: #1b1b1b;
  font-family: var(--f-doc);
  font-size: 14.5px;
  line-height: 1.65;
  padding: 56px 64px;
  border-radius: 3px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 10px 30px rgba(0, 0, 0, 0.07);
  min-width: 0;
}
.paper h1 {
  font-family: var(--f-doc);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  text-transform: uppercase;
}
.paper .sub {
  text-align: center;
  font-size: 13.5px;
  color: #555;
  margin: 4px 0 26px;
}
.paper h2 {
  font-family: var(--f-doc);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  margin: 26px 0 8px;
}
.paper .ctx {
  margin: 0 0 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.paper .ctx-label {
  font-family: var(--f-body);
  font-size: 12.5px;
  color: #6e6e73;
  margin: 10px 0 4px;
}
.idgrid {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 6px 14px;
  align-items: start;
  margin: 6px 0 10px;
}
.idgrid > div {
  padding-top: 4px;
  color: #444;
}
.slot-wrap {
  position: relative;
  margin: 2px 0 14px;
}
.idgrid .slot-wrap {
  margin: 0;
}
.idgrid > .id-val {
  color: var(--ink);
}
.idgrid > .id-missing a {
  color: var(--warn);
  text-decoration: underline;
}
.slot {
  display: block;
  width: 100%;
  min-height: 3.4em;
  padding: 8px 11px;
  border: 1.5px dashed #cdc6ac;
  border-radius: 4px;
  background: transparent;
  color: #1b1b1b;
  font-family: var(--f-doc);
  font-size: 14.5px;
  line-height: 1.6;
  resize: none;
  outline: none;
  overflow: hidden;
  transition:
    background 0.15s,
    box-shadow 0.15s;
}
.slot::placeholder {
  color: #918a76;
  font-style: italic;
}
.slot:hover {
  background: #fcfbf6;
}
.slot:focus {
  box-shadow: 0 0 0 3px rgba(27, 27, 27, 0.08);
}
.slot.filled {
  border: 0;
  border-left: 3px solid var(--mark-line);
  border-radius: 2px;
  background: var(--mark);
}
.slot.dirty {
  border: 0;
  border-left: 3px solid var(--edited-line);
  border-radius: 2px;
  background: var(--edited);
}
.slot.ident {
  min-height: 0;
  padding: 3px 9px;
  border: 1px solid #d5dff8;
  border-radius: 4px;
  background: var(--info-bg);
  color: #1d3a8a;
}
.slot.ident.dirty {
  border: 1px solid #bfe3cf;
  border-left: 3px solid var(--edited-line);
  background: var(--edited);
  color: #1b1b1b;
}
.gen {
  position: absolute;
  top: -12px;
  right: 8px;
  z-index: 2;
  height: 26px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transition: opacity 0.15s;
}
.gen .ico {
  width: 13px;
  height: 13px;
}
.slot-wrap:hover .gen,
.slot-wrap:focus-within .gen,
.gen:focus-visible {
  opacity: 1;
}
@media (hover: none) {
  .gen {
    opacity: 1;
  }
}
.save-bar {
  position: sticky;
  bottom: 16px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 6px 16px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
}
.save-bar .btn {
  background: #fff;
  color: var(--ink);
  border-color: #fff;
}
.save-bar .btn:hover:not(:disabled) {
  background: #ececee;
}
.ws-chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--line);
  background: var(--bg);
}
.ws-chat-head {
  padding: 16px 18px 8px;
  display: grid;
  gap: 2px;
}
.ws-chat-head h2 {
  font-size: 15px;
}
.ws-compose {
  padding: 8px 14px 14px;
  display: grid;
  gap: 10px;
}

/* ---------------- chat ---------------- */
.msgs {
  flex: 1;
  overflow: auto;
  padding: 8px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 140px;
}
.msg {
  max-width: 100%;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.msg-ai {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.msg-ai .mark {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  color: var(--ink);
}
.msg-ai .mark .ico {
  width: 13px;
  height: 13px;
}
.msg-ai .body {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding-top: 2px;
  white-space: pre-wrap;
}
.msg-ai .body .sources,
.msg-ai .body .msg-tools {
  white-space: normal;
}
/* Chat answers: the AI's Markdown as formatted text. */
.msg-ai .body .md {
  white-space: normal;
}
.md > :first-child {
  margin-top: 0;
}
.md > :last-child {
  margin-bottom: 0;
}
.md p {
  margin: 0 0 12px;
}
.md h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 18px 0 6px;
}
.md ol,
.md ul {
  margin: 0 0 12px;
  padding-left: 22px;
}
.md li {
  margin: 0 0 4px;
}
.md li::marker {
  color: var(--muted);
}
.md strong {
  font-weight: 600;
}
.md a {
  color: var(--info);
}
.md code {
  font-family: var(--f-mono);
  font-size: 12.5px;
  background: var(--sunk);
  border-radius: var(--r-sm);
  padding: 1px 5px;
}
.md-code {
  margin: 0 0 12px;
  padding: 12px 14px;
  background: var(--subtle);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow-x: auto;
  white-space: pre;
}
.md-code code {
  background: none;
  padding: 0;
  font-size: 12.5px;
  line-height: 1.55;
}
.md table {
  width: 100%;
  border-collapse: collapse;
  margin: 2px 0 12px;
  font-size: 13.5px;
  display: block;
  overflow-x: auto;
}
.md th,
.md td {
  border: 1px solid var(--line);
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}
.md th {
  background: var(--subtle);
  font-weight: 600;
}

/* Practice quiz */
.msg-quiz .body {
  white-space: normal;
}
.quiz {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg);
  overflow: hidden;
}
.quiz-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--subtle);
}
.quiz-eyebrow {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.quiz-head h3 {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}
.quiz-score {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 2px;
  padding: 6px 12px;
  border-radius: var(--r-md);
  border: 1px solid currentColor;
}
.quiz-score b {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}
.quiz-score span {
  font-size: 12px;
}
.quiz-score.is-good {
  color: var(--ok);
  background: var(--ok-bg);
}
.quiz-score.is-mid {
  color: var(--warn);
  background: var(--warn-bg);
}
.quiz-score.is-low {
  color: var(--bad);
  background: var(--bad-bg);
}
.quiz-q {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.quiz-q-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.quiz-num {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 600;
}
.quiz-kind {
  font-size: 12px;
  color: var(--muted);
}
.quiz-question {
  margin: 0 0 12px;
  font-weight: 500;
  white-space: pre-wrap;
}
.quiz-opts {
  display: grid;
  gap: 8px;
}
.quiz-opt {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
  transition:
    border-color 0.12s,
    background 0.12s;
}
.quiz-opt:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--subtle);
}
.quiz-opt:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
.quiz-opt:disabled {
  cursor: default;
}
.quiz-letter {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.quiz-opt.is-picked {
  border-color: var(--ink);
  background: var(--subtle);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.quiz-opt.is-picked .quiz-letter {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-accent);
}
.quiz-opt.is-right {
  border-color: var(--ok);
  background: var(--ok-bg);
}
.quiz-opt.is-right .quiz-letter {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.quiz-opt.is-wrong {
  border-color: var(--bad);
  background: var(--bad-bg);
}
.quiz-opt.is-wrong .quiz-letter {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}
.quiz-opt .quiz-mark {
  width: 16px;
  height: 16px;
}
.quiz-opt.is-right .quiz-mark {
  color: var(--ok);
}
.quiz-opt.is-wrong .quiz-mark {
  color: var(--bad);
}
.quiz-text {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  font: inherit;
  font-size: 14px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--ink);
}
.quiz-text:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}
.quiz-text[readonly] {
  background: var(--subtle);
}
.quiz-review {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  border-left: 3px solid currentColor;
  font-size: 13.5px;
}
.quiz-review p {
  margin: 6px 0 0;
  color: var(--ink-2);
}
.quiz-review p.muted {
  color: var(--muted);
}
.quiz-review.quiz-ok {
  color: var(--ok);
  background: var(--ok-bg);
}
.quiz-review.quiz-warn {
  color: var(--warn);
  background: var(--warn-bg);
}
.quiz-review.quiz-bad {
  color: var(--bad);
  background: var(--bad-bg);
}
.quiz-verdict {
  display: flex;
  align-items: center;
  gap: 6px;
}
.quiz-verdict .ico {
  width: 15px;
  height: 15px;
}
.quiz-points {
  margin-left: auto;
  font-weight: 600;
}
.quiz-review details {
  margin-top: 8px;
  color: var(--ink-2);
}
.quiz-review summary {
  cursor: pointer;
  font-weight: 500;
}
.quiz-review details .md {
  margin-top: 6px;
}
.quiz-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  font-size: 13px;
}
.quiz-actions {
  display: flex;
  gap: 8px;
}
.quiz > .sources {
  padding: 0 18px 14px;
}
@media (max-width: 640px) {
  /* The quiz uses the full width on a phone. */
  .msg-quiz {
    grid-template-columns: minmax(0, 1fr);
  }
  .msg-quiz .mark {
    display: none;
  }
  .quiz-head,
  .quiz-q,
  .quiz-foot {
    padding-left: 14px;
    padding-right: 14px;
  }
  .quiz > .sources {
    padding: 0 14px 12px;
  }
}

.msg-me {
  align-self: flex-end;
  max-width: 82%;
  padding: 9px 15px;
  border-radius: var(--r-lg);
  background: var(--sunk);
  white-space: pre-wrap;
}
.msg-err .body {
  color: var(--bad);
}
.msg-tools {
  display: flex;
  gap: 2px;
  margin-left: -8px;
}
.msg-actions {
  display: flex;
  gap: 6px;
  white-space: normal;
}
.msg .stop-btn {
  justify-self: start;
}
.act-row-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}
.act-row-wrap > .act-row {
  flex: 1;
  min-width: 0;
}
.act-row-wrap > .act-stop-btn {
  flex: none;
  margin-right: 6px;
}
.act-stop {
  color: var(--muted);
  display: inline-flex;
}
.chat-page {
  height: calc(100% - var(--top-h));
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}
.chat-scroll {
  overflow: auto;
  padding: 12px 16px;
}
.chat-col {
  width: min(760px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 12px 0 28px;
}
.chat-col .msg {
  font-size: 15px;
  line-height: 1.75;
}
.chat-foot {
  padding: 4px 16px 16px;
  display: grid;
  justify-items: center;
  gap: 8px;
}
.chat-empty {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
  padding: 10vh 0 0;
}
.chat-empty h1 {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.chat-empty .chips {
  justify-content: center;
  max-width: 620px;
}
.composer {
  width: min(760px, 100%);
  display: grid;
  gap: 4px;
  padding: 10px 10px 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--bg);
  box-shadow: var(--shadow-md);
  transition: border-color 0.15s;
}
.composer:focus-within {
  border-color: #b9b9be;
}
.composer textarea {
  width: 100%;
  min-height: 26px;
  max-height: 220px;
  padding: 6px 0;
  border: 0;
  outline: none;
  resize: none;
  background: none;
  font-size: 15px;
  line-height: 1.5;
}
.composer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.composer-row > .seg {
  flex: none;
}
.stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 40px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  justify-self: start;
  background: var(--bg);
}
.stepper span {
  min-width: 112px;
  padding: 0 6px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-2);
}
.stepper b {
  font-weight: 500;
  color: var(--ink);
}
.stepper button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--sunk);
  display: grid;
  place-items: center;
  color: var(--ink);
}
.stepper button:hover {
  background: var(--hover);
}
.stepper-sm {
  height: 34px;
}
.stepper-sm span {
  min-width: 96px;
  font-size: 13px;
}
.stepper-sm button {
  width: 26px;
  height: 26px;
}
.picker-wrap {
  position: relative;
  min-width: 0;
}
.ctx-btn {
  height: 32px;
  max-width: 240px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  transition: background 0.15s;
}
.ctx-btn:hover,
.ctx-btn[aria-expanded='true'] {
  background: var(--subtle);
}
.ctx-btn .ico {
  width: 15px;
  height: 15px;
}
.ctx-btn .chev-down {
  transform: rotate(90deg);
  color: var(--muted);
  width: 14px;
  height: 14px;
}
.picker {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 30;
  width: min(340px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: pop 0.12s ease-out;
  text-align: left;
}
.picker.up {
  top: auto;
  bottom: calc(100% + 8px);
}
.picker-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.picker-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  font-size: 14px;
  color: var(--ink);
}
.picker-scroll {
  max-height: min(360px, 50vh);
  overflow: auto;
  padding: 6px;
  display: grid;
  gap: 2px;
}
.picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-md);
  background: none;
  font-size: 14px;
  text-align: left;
  color: var(--ink);
}
.picker-item:hover,
.picker-item[aria-selected='true'] {
  background: var(--sunk);
}
.picker-item .ico {
  color: var(--ink-2);
}
.picker-label {
  padding: 10px 10px 4px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.picker-group {
  padding: 6px 10px 8px;
  display: grid;
  gap: 8px;
  border-radius: var(--r-md);
}
.picker-group + .picker-group {
  border-top: 1px solid var(--line);
  border-radius: 0;
}
.picker-course {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  min-width: 0;
}
.picker-sessions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.picker-sessions button {
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--bg);
  font-size: 12.5px;
  color: var(--ink-2);
}
.picker-sessions button:hover {
  background: var(--subtle);
}
.picker-sessions button[aria-selected='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.send {
  width: 36px;
  height: 36px;
  margin-left: auto;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
  transition: background 0.15s;
}
.send:disabled {
  background: #d4d4d8;
  cursor: default;
}
.send .ico {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}
.ws-compose .composer {
  width: 100%;
  border-radius: var(--r-lg);
  padding: 8px 8px 8px 14px;
  box-shadow: var(--shadow-sm);
}
.ws-compose .composer textarea {
  font-size: 14px;
  min-height: 44px;
}

/* ---------------- home ---------------- */
.hero {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  padding: 28px 0 4px;
}
.hero h1 {
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.025em;
}
.hero p {
  color: var(--muted);
}
.hero .composer {
  margin-top: 14px;
  text-align: left;
}

/* ---------------- profile ---------------- */
.profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 20px;
  align-items: start;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}
.form-grid .wide {
  grid-column: 1 / -1;
}
.ktm {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: var(--r-lg);
  background: linear-gradient(140deg, #141416 0%, #2b2b2f 58%, #18181b 100%);
  color: #f4f4f5;
  font-size: 12.5px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
}
.ktm::after {
  content: '';
  position: absolute;
  right: -48px;
  top: -48px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  border: 1px solid rgba(201, 169, 97, 0.28);
}
.ktm-top {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b8b8bd;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ktm-top .ico {
  color: var(--gold);
}
.ktm .nm {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.ktm .nim {
  font-family: var(--f-mono);
  font-size: 17px;
  letter-spacing: 0.14em;
  color: var(--gold);
  margin-top: 2px;
}
.ktm dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  margin: 0;
}
.ktm dt {
  color: #9d9da3;
}
.ktm dd {
  margin: 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* ---------------- auth ---------------- */
.auth {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background: radial-gradient(900px 480px at 50% -10%, #f1f1f3 0%, transparent 70%), var(--bg);
}
.auth-card {
  width: min(420px, 100%);
  display: grid;
  gap: 18px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg);
  box-shadow: var(--shadow-md);
}
.auth-card h1 {
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.auth-card .btn {
  --h: 42px;
}
.auth-foot {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.auth-foot button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.error-box {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--bad-bg);
  color: var(--bad);
  font-size: 13px;
}
.error-box .ico {
  margin-top: 2px;
  flex: none;
}
.error-box.is-ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.auth-link {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.auth-link:hover {
  color: var(--ink);
}
.copy-row {
  display: flex;
  gap: 8px;
}
.copy-row input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  font: inherit;
  font-family: var(--f-mono);
  font-size: 12px;
  background: var(--subtle);
  color: var(--ink);
}

/* ---------------- modal, toast, skeleton ---------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(10, 10, 12, 0.35);
  animation: fade 0.15s ease-out;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.dialog {
  width: min(520px, 100%);
  max-height: calc(100% - 32px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: var(--r-xl);
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  animation: rise 0.16s ease-out;
}
@keyframes rise {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}
.dialog.wide {
  width: min(680px, 100%);
}
.dialog-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px 6px 24px;
}
.dialog-head h2 {
  font-size: 18px;
  flex: 1;
}
.dialog-body {
  overflow: auto;
  padding: 8px 24px 16px;
  display: grid;
  gap: 16px;
  align-content: start;
}
.dialog-body > p {
  color: var(--muted);
}
.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 24px 20px;
}
.scrim {
  display: none;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 32px);
  padding: 11px 18px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  animation: rise 0.18s ease-out;
}
.toast.bad {
  background: var(--bad);
}
.skel {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--sunk) 0%, #f9f9fa 50%, var(--sunk) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ---------------- responsive ---------------- */
@media (max-width: 1280px) {
  .ws {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
  .ws-mem {
    display: none;
  }
  .ws.mem-open .ws-mem {
    display: grid;
    position: fixed;
    top: var(--top-h);
    bottom: 0;
    left: var(--side-w);
    width: 300px;
    z-index: 20;
    overflow: auto;
    box-shadow: var(--shadow-lg);
  }
}
@media (min-width: 1281px) {
  .mem-toggle {
    display: none;
  }
}
@media (max-width: 1100px) {
  .split {
    grid-template-columns: 1fr;
  }
  .aside-sticky {
    position: static;
  }
  .profile {
    grid-template-columns: 1fr;
  }
  .profile .ktm-col {
    order: -1;
  }
}
@media (max-width: 1024px) {
  .ws {
    grid-template-columns: 1fr;
    height: auto;
  }
  .ws > section {
    overflow: visible;
  }
  .ws-chat {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .ws-chat .msgs {
    max-height: 420px;
  }
}
@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }
  .side {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(300px, 86vw);
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    border-right: 0;
  }
  .app.nav-open .side {
    transform: none;
    box-shadow: var(--shadow-lg);
  }
  .app.nav-open .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(10, 10, 12, 0.3);
    animation: fade 0.15s;
  }
  .menu-btn {
    display: inline-flex;
  }
  .top {
    padding: 0 10px 0 6px;
    gap: 6px;
  }
  .crumbs > a:not(:nth-last-child(3)),
  .crumbs > .sep:not(:nth-last-child(2)) {
    display: none;
  }
  .top-actions .btn:not(.btn-primary):not(.btn-icon) {
    width: var(--h);
    padding: 0;
    font-size: 0;
    gap: 0;
  }
  .page {
    padding: 18px 16px 56px;
    gap: 22px;
  }
  .ph-main h1 {
    font-size: 22px;
  }
  .hero {
    padding-top: 12px;
  }
  .hero h1 {
    font-size: 24px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .paper {
    padding: 28px 20px;
  }
  .ws-canvas {
    padding: 12px 10px 24px;
  }
  .idgrid {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .idgrid > div {
    padding-top: 8px;
    font-size: 13px;
  }
  .ws.mem-open .ws-mem {
    left: 0;
    width: 100%;
  }
  .ctx-btn {
    max-width: 170px;
  }
  .dialog-head {
    padding: 16px 12px 4px 18px;
  }
  .dialog-body {
    padding: 8px 18px 14px;
  }
  .dialog-foot {
    padding: 12px 18px 18px;
  }
  .auth-card {
    padding: 26px 22px;
  }
  .grid-cards {
    grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  }
  .msg-me {
    max-width: 90%;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------------- schedule ---------------- */
.date-tile {
  width: 44px;
  height: 46px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg);
  display: grid;
  place-items: center;
  align-content: center;
  line-height: 1.05;
  flex: none;
}
.date-tile b {
  font-size: 17px;
  font-weight: 500;
}
.date-tile span {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.kind-dot {
  width: 18px;
  height: 18px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, white);
  flex: none;
}
.kind-dot .ico {
  width: 11px;
  height: 11px;
}
.lr-title.is-done {
  color: var(--muted);
  text-decoration: line-through;
}
.row-menu {
  flex: none;
}
.row-menu .btn-icon {
  --h: 32px;
}
/* Cards with their own menu: the whole card is a link, the menu sits above it. */
.card.has-menu {
  position: relative;
}
.card .stretched::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.card .card-menu {
  position: relative;
  z-index: 2;
  margin: -6px -8px -6px 0;
}
.card .card-menu .btn-icon {
  --h: 30px;
}
.ut-status {
  display: grid;
  gap: 4px;
}
.kv {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 6px 14px;
  font-size: 13.5px;
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.preview-box {
  max-height: 46vh;
  overflow: auto;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--subtle);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}
@media (max-width: 860px) {
  .kv {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .kv dd {
    margin-bottom: 8px;
  }
}
.card a.stretched {
  color: inherit;
  text-decoration: none;
}
.card a.stretched:focus-visible {
  outline: none;
}
.card.has-menu:focus-within {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}
.session-card.has-menu:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

/* ---------------- global activity ---------------- */
.act-slot {
  position: relative;
  flex: none;
}
.act-slot:empty {
  display: none;
}
.act-btn {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--bg);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}
.act-btn:hover,
.act-btn[aria-expanded='true'] {
  background: var(--subtle);
}
.act-btn.busy {
  border-color: #c9c9ce;
}
.act-btn .spinner {
  width: 14px;
  height: 14px;
}
.act-ok,
.act-bad {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
}
.act-ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.act-bad {
  background: var(--bad-bg);
  color: var(--bad);
}
.act-ok .ico,
.act-bad .ico {
  width: 12px;
  height: 12px;
  stroke-width: 2.2;
}
.act-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  width: min(380px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.act-pop.fresh {
  animation: pop 0.12s ease-out;
}
.act-head {
  display: flex;
  align-items: center;
  padding: 12px 10px 8px 16px;
  font-size: 14px;
}
.act-head b {
  font-weight: 500;
}
.act-list {
  max-height: min(420px, 60vh);
  overflow: auto;
  padding: 0 6px 6px;
  display: grid;
  gap: 2px;
}
.act-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--r-md);
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
a.act-row:hover {
  background: var(--sunk);
}
.act-row .lr-body {
  gap: 4px;
}
.act-row .bar {
  margin-top: 2px;
}
.act-foot {
  padding: 10px 16px 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 860px) {
  .act-btn {
    padding: 0 10px;
  }
  .act-label {
    display: none;
  }
  .act-pop {
    position: fixed;
    left: 12px;
    right: 12px;
    top: calc(var(--top-h) + 4px);
    width: auto;
  }
}

/* Rich answer editor */
.doc-edit {
  min-height: 8em;
  margin: 2px -12px 14px;
  padding: 6px 12px;
  border-radius: 4px;
  outline: none;
  overflow-wrap: anywhere;
  transition:
    background 0.15s,
    box-shadow 0.15s;
}
.doc-edit:hover {
  background: #fcfbf6;
}
.doc-edit:focus {
  background: #fff;
  box-shadow: 0 0 0 1.5px var(--line-strong);
}
.doc-edit:empty::before {
  content: attr(data-placeholder);
  color: #918a76;
  font-style: italic;
}
.doc-edit p {
  margin: 0 0 10px;
}
.doc-edit h3 {
  font-family: var(--f-doc);
  font-size: 14.5px;
  font-weight: 700;
  margin: 20px 0 6px;
}
.doc-edit h3:first-child {
  margin-top: 4px;
}
.doc-edit ol,
.doc-edit ul {
  margin: 0 0 10px;
  padding-left: 26px;
}
.doc-edit li {
  margin: 0 0 4px;
}
.doc-edit table {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0 12px;
  font-size: 13.5px;
}
.doc-edit th,
.doc-edit td {
  border: 1px solid #bfbfbf;
  padding: 5px 8px;
  text-align: left;
  vertical-align: top;
}
.doc-edit th {
  background: #f2f2f2;
  font-weight: 600;
}
::highlight(mk-comment) {
  background-color: #fde68a;
}
::highlight(mk-comment-active) {
  background-color: #fbbf24;
}
.slot-wrap.has-cmt::after {
  content: '';
  position: absolute;
  top: 6px;
  right: -14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
}
.doc-bar .hist {
  display: inline-flex;
  gap: 2px;
}
.save-state {
  color: var(--muted);
  white-space: nowrap;
}

/* Floating tools over a text selection */
.sel-tools {
  position: fixed;
  z-index: 40;
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: var(--r-md);
  background: var(--ink);
  box-shadow: var(--shadow-lg);
}
.sel-tools[hidden] {
  display: none;
}
.sel-tools button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: #fff;
  font: 500 13px var(--f-body);
  cursor: pointer;
}
.sel-tools button:hover {
  background: rgba(255, 255, 255, 0.14);
}
.sel-tools .ico {
  width: 15px;
  height: 15px;
}

/* Comments */
.cmts:empty {
  display: none;
}
.cmts {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}
.cmt-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
}
.cmt-list {
  display: grid;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}
.cmt {
  position: relative;
  display: grid;
  gap: 3px;
  padding: 8px 34px 8px 11px;
  border: 1px solid #f3e3a6;
  border-left: 3px solid #f59e0b;
  border-radius: var(--r-sm);
  background: #fffbeb;
  font-size: 13px;
  cursor: pointer;
}
.cmt:hover {
  background: #fef3c7;
}
.cmt-q {
  color: #6b5b2a;
  font-style: italic;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.cmt-n {
  color: var(--ink);
}
.cmt-lost {
  opacity: 0.6;
}
.cmt-del {
  position: absolute;
  top: 4px;
  right: 4px;
}
.cmt-tip {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--muted);
}
.cmt-tip .ico {
  flex: none;
  width: 15px;
  height: 15px;
  margin-top: 1px;
}
.cmt-quote {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-left: 3px solid #f59e0b;
  background: #fffbeb;
  border-radius: 4px;
  font-size: 13.5px;
  white-space: pre-wrap;
}

.doc-edit a {
  color: #1d4ed8;
  text-decoration: underline;
}
.update-bar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 60;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 8px 8px 8px 16px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
}
.update-bar .ico {
  width: 16px;
  height: 16px;
}
.update-bar .btn {
  background: #fff;
  color: var(--ink);
  border-color: #fff;
}

/* Task rows: the title link covers the row; the action buttons sit above it. */
.task-row a.stretched {
  color: inherit;
  text-decoration: none;
}
.task-row a.stretched::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.task-row .lr-actions {
  position: relative;
  z-index: 1;
}
.btn.btn-done {
  background: var(--ok-bg);
  border-color: transparent;
  color: var(--ok);
}

/* Practical task: report and program tabs above the canvas. */
.canvas-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.canvas-tabs .ico {
  width: 15px;
  height: 15px;
}
.ws-report {
  display: contents;
}
.ws-report[hidden] {
  display: none;
}
.practice {
  width: min(860px, 100%);
  display: grid;
  gap: 14px;
  min-width: 0;
}
.pr-empty {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px 24px;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 10px;
}
.pr-empty p {
  max-width: 520px;
  color: var(--muted);
  margin: 0;
}
.pr-ask {
  width: min(560px, 100%);
  display: grid;
  gap: 10px;
  justify-items: end;
}
.pr-ask textarea {
  width: 100%;
  resize: vertical;
}
.pr-head,
.pr-sec {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  min-width: 0;
}
.pr-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.pr-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
}
.pr-head p {
  margin: 0 0 10px;
  color: var(--ink-2);
}
.pr-actions {
  display: flex;
  gap: 4px;
  flex: none;
}
.pr-sec h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 15px;
}
.pr-sec h3 .ico {
  width: 17px;
  height: 17px;
  color: var(--muted);
}
.pr-sec ol,
.pr-sec ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}
.pr-sec .pr-ask {
  width: 100%;
}
.pr-files {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}
.pr-files button {
  border: 0;
  background: none;
  padding: 8px 12px;
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.pr-files button[aria-selected='true'] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.pr-code {
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--r-md) var(--r-md);
  overflow: hidden;
}
.pr-code-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px 6px 12px;
  background: var(--subtle);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.pr-code-bar .small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.practice pre {
  margin: 0;
  font-family: var(--f-mono);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre;
  overflow: auto;
}
.pr-code pre {
  padding: 14px 16px;
  max-height: 560px;
  background: var(--bg);
}
.pr-steps {
  gap: 12px !important;
}
.pr-steps p {
  margin: 2px 0 0;
  color: var(--ink-2);
}
.pr-cmd {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  background: var(--sunk);
  border-radius: var(--r-sm);
  padding: 4px 4px 4px 12px;
  min-width: 0;
}
.pr-cmd code {
  flex: 1;
  font-family: var(--f-mono);
  font-size: 12.5px;
  overflow-x: auto;
  white-space: nowrap;
}
.pr-scen,
.pr-video {
  display: grid;
  gap: 10px;
}
.pr-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: grid;
  gap: 8px;
  min-width: 0;
}
.pr-card p {
  margin: 0;
}
.pr-io {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 10px;
}
.pr-io pre,
.pr-term {
  background: var(--subtle);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  margin-top: 4px !important;
}
.pr-term {
  max-height: 480px;
}
.pr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.pr-table th,
.pr-table td {
  text-align: left;
  vertical-align: top;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.pr-table th {
  color: var(--muted);
  font-weight: 500;
}
@media (max-width: 640px) {
  .pr-head {
    flex-direction: column;
  }
  .pr-io {
    grid-template-columns: 1fr;
  }
  .pr-head,
  .pr-sec {
    padding: 14px;
  }
}
.slot.slot-code {
  font-family: var(--f-mono);
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre;
  overflow-x: auto;
}

/* A failed job shows its full reason instead of a cut-off line. */
.act-err {
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--bad);
  white-space: normal;
  overflow-wrap: anywhere;
}
.callout-bad {
  background: var(--bad-bg);
  border-color: #f5c9c4;
}
.practice > .callout {
  width: 100%;
}
.pr-run h2 {
  margin: 0;
  font-size: 17px;
}
.pr-stages {
  list-style: none;
  margin: 4px 0;
  padding: 0;
  display: grid;
  gap: 10px;
  text-align: left;
  min-width: min(360px, 100%);
}
.pr-stages li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}
.pr-stages li.now {
  color: var(--ink);
  font-weight: 500;
}
.pr-stages li.done {
  color: var(--ink-2);
}
.pr-stages li.done .ico {
  width: 16px;
  height: 16px;
  color: var(--ok);
}
.pr-stages .pr-dot {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
}
.pr-stages .pr-dot::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
}
.pr-stages .pr-clock {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

/* Steps to copy the e-learning security key for SSO O365 accounts. */
#utmode {
  margin: 4px 0 14px;
}
.ut-steps {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
  color: var(--ink-2);
}
.ut-steps a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ut-steps .ico {
  width: 13px;
  height: 13px;
}

/* E-learning status of a task, above its answer sheet. */
.ut-card {
  width: min(780px, 100%);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  display: grid;
  gap: 12px;
}
.ut-card.is-done {
  border-color: #cfe7da;
}
.ut-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.ut-row .grow {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.ut-row b {
  font-weight: 500;
}
.ut-grade {
  display: grid;
  justify-items: end;
  line-height: 1.2;
}
.ut-grade span {
  font-size: 12px;
  color: var(--muted);
}
.ut-grade b {
  font-size: 18px;
  font-weight: 600;
  color: var(--ok);
  white-space: nowrap;
}
.ut-feedback p {
  margin: 4px 0 0;
  white-space: pre-wrap;
}
.ut-feedback,
.ut-files {
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

/* Grades page: one card per course, like the e-learning grade report. */
.g-card .panel-head h2 {
  font-size: 16px;
}
.g-total {
  display: grid;
  justify-items: end;
  line-height: 1.2;
}
.g-total b {
  font-size: 22px;
  font-weight: 600;
}
.g-total small {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}
.g-scroll {
  overflow-x: auto;
}
.g-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.g-table th,
.g-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.g-table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 12.5px;
}
.g-table .g-val {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.g-table tr.g-cat td {
  background: var(--subtle);
  font-weight: 600;
}
@media (max-width: 640px) {
  .g-table .g-range {
    display: none;
  }
  .ut-row {
    flex-wrap: wrap;
  }
}

/* ---------------- grades dashboard ----------------
   Component colors are categorical slots 1–3 of the validated chart palette
   (blue, orange, aqua); the total uses ink. Text never wears these colors. */
:root {
  --c-hadir: #2a78d6;
  --c-diskusi: #eb6834;
  --c-tugas: #1baf7a;
  --c-total: #3c3c43;
}
.g-page .g-scope {
  margin-bottom: 4px;
}
.g-scope .chip[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.g-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.g-tile {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  display: grid;
  gap: 6px;
  min-width: 0;
}
.g-tile-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.g-tile-label i,
.viz-legend i,
.viz-tip-row i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.g-tile b {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
}
.g-tile b small {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}
.g-meter {
  height: 6px;
  border-radius: 2px;
  background: var(--sunk);
  overflow: hidden;
}
.g-meter span {
  display: block;
  height: 100%;
  border-radius: 0 4px 4px 0;
}
.viz-card .panel-head {
  flex-wrap: wrap;
  row-gap: 6px;
}
.viz-card > p.small {
  margin: -4px 0 10px;
}
.viz-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 13px;
  color: var(--ink-2);
}
.viz-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.viz-box {
  width: 100%;
  min-width: 0;
}
.viz-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  touch-action: pan-y;
}
.viz-svg:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
  border-radius: var(--r-sm);
}
.viz-grid {
  stroke: var(--line);
  stroke-width: 1;
}
.viz-tick {
  fill: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.viz-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.viz-dot {
  stroke: var(--bg);
  stroke-width: 2;
}
.viz-cross {
  stroke: var(--line-strong);
  stroke-width: 1;
}
.viz-tip {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 8px 10px;
  font-size: 13px;
  min-width: 150px;
  display: grid;
  gap: 4px;
}
.viz-tip-title {
  font-weight: 600;
  margin-bottom: 2px;
}
.viz-tip-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.viz-tip-row span {
  flex: 1;
  color: var(--ink-2);
}
.viz-tip-row b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
/* Composition: one stacked bar per course, 100 points wide, 2px surface gaps. */
.comp-list {
  display: grid;
  gap: 4px;
}
.comp-row {
  display: grid;
  gap: 6px;
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: var(--r-md);
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}
.comp-row:hover {
  background: var(--subtle);
}
.comp-row.dim {
  opacity: 0.45;
}
.comp-label {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
  font-size: 14px;
}
.comp-label .truncate {
  flex: 1;
  min-width: 0;
}
.comp-label b {
  font-weight: 600;
  white-space: nowrap;
}
.comp-label small {
  font-weight: 400;
  color: var(--muted);
}
.comp-bar {
  display: flex;
  gap: 2px;
  height: 16px;
  background: var(--sunk);
  border-radius: 0 4px 4px 0;
  overflow: hidden;
}
.comp-seg {
  height: 100%;
  min-width: 3px;
}
.comp-seg:last-child {
  border-radius: 0 4px 4px 0;
}
.g-insights {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.g-insights li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--ink-2);
}
.g-insights .ico {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--muted);
  flex: none;
}
.g-insights li.bad .ico {
  color: var(--bad);
}
details.g-card > summary {
  list-style: none;
  cursor: pointer;
}
details.g-card > summary::-webkit-details-marker {
  display: none;
}
.g-sum {
  font-weight: 600;
  white-space: nowrap;
}
.g-sum small {
  font-weight: 400;
  color: var(--muted);
}
.g-chev {
  transition: transform 0.15s;
}
details[open] > summary .g-chev {
  transform: rotate(90deg);
}
details.g-card:not([open]) > summary {
  margin-bottom: 0;
}
@media (max-width: 900px) {
  .g-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 420px) {
  .g-tile b {
    font-size: 22px;
  }
}
details.g-card:not([open]) {
  gap: 0;
}

/* Sidebar: each course opens like a folder to show its sessions. */
.nav-course {
  display: flex;
  align-items: center;
  min-width: 0;
}
.nav-course .sub {
  flex: 1;
  padding-left: 4px;
}
.nav-toggle {
  flex: none;
  width: 24px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: var(--muted);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.nav-toggle:hover {
  background: var(--hover);
  color: var(--ink);
}
.nav-toggle .ico {
  width: 14px;
  height: 14px;
  transition: transform 0.15s;
}
.nav-course.open .nav-toggle .ico {
  transform: rotate(90deg);
}
.nav-sessions {
  display: grid;
  gap: 1px;
  margin: 0 0 4px 28px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}
.nav .nav-sessions a {
  height: 28px;
  font-size: 13px;
  color: var(--ink-2);
  padding: 0 8px;
  justify-content: space-between;
}
.nav-flag {
  font-size: 11px;
  font-weight: 500;
  color: var(--warn);
  background: var(--warn-bg);
  border-radius: var(--r-sm);
  padding: 0 5px;
  line-height: 18px;
}

/* ---------------- welcome: first steps for a new account ---------------- */
.welcome {
  max-width: 1080px;
}
.w-hero {
  display: grid;
  gap: 12px;
  padding: 12px 0 8px;
  max-width: 760px;
}
.w-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.w-eyebrow .ico {
  width: 15px;
  height: 15px;
}
.w-hero h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.w-hero > p {
  margin: 0;
  font-size: 16px;
  color: var(--ink-2);
}
.w-points {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.w-points li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--muted);
}
.w-points li .ico {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--ink);
}
.w-points b {
  display: block;
  color: var(--ink);
  font-weight: 500;
}
.w-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 8px;
}
.w-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  display: grid;
  gap: 16px;
  min-width: 0;
}
.w-card.w-primary {
  border: 1.5px solid var(--ink);
}
.w-card-head {
  display: grid;
  gap: 6px;
  justify-items: start;
}
.w-card-head h2 {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 600;
}
.w-card-head p {
  margin: 0;
  color: var(--ink-2);
}
.w-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.w-steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.w-steps .grow {
  display: grid;
  gap: 4px;
  min-width: 0;
  justify-items: start;
}
.w-steps b {
  font-weight: 500;
}
.w-steps li.done b {
  color: var(--muted);
  text-decoration: line-through;
}
.w-num {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
}
.w-steps li.done .w-num {
  background: var(--ok-bg);
  border-color: transparent;
  color: var(--ok);
}
.w-num .ico {
  width: 14px;
  height: 14px;
}
.w-connected {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.w-connected .ico {
  color: var(--ok);
  width: 16px;
  height: 16px;
}
#w-connect .pr-stages {
  min-width: 0;
  margin-top: 12px;
}
.w-done {
  display: grid;
  gap: 14px;
}
.w-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}
.w-facts div {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px;
  display: grid;
}
.w-facts b {
  font-size: 22px;
  font-weight: 600;
}
.w-facts span {
  font-size: 12.5px;
  color: var(--muted);
}
.w-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}
.w-foot p {
  flex: 1;
  margin: 0;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.w-foot p .ico {
  width: 14px;
  height: 14px;
  flex: none;
  margin-top: 3px;
}
@media (max-width: 900px) {
  .w-grid,
  .w-points {
    grid-template-columns: 1fr;
  }
  .w-hero h1 {
    font-size: 26px;
  }
  .w-foot {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Sidebar: recent conversations, like a chat app's history. */
.nav-history .sub {
  gap: 8px;
}
.nav-history .sub .ico {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--muted);
}

/* ---------------- admin ---------------- */
.adm-bad {
  color: var(--bad);
}
.adm-chart {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  height: 200px;
  padding-bottom: 22px;
}
.adm-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
  margin: -7px 0;
}
.adm-plot {
  position: relative;
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  align-items: end;
  gap: 2px;
}
.adm-plot > i {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line);
  pointer-events: none;
}
.adm-col {
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  outline: none;
  cursor: default;
}
.adm-col:hover,
.adm-col:focus-visible {
  background: var(--subtle);
}
.adm-bar {
  width: min(70%, 28px);
  background: var(--ink-2);
  border-radius: 4px 4px 0 0;
  position: relative;
  z-index: 1;
}
.adm-col:hover .adm-bar,
.adm-col:focus-visible .adm-bar {
  background: var(--ink);
}
.adm-x {
  position: absolute;
  bottom: -20px;
  font-size: 11.5px;
  color: var(--muted);
}
.adm-tip {
  position: absolute;
  top: 0;
  transform: translate(-50%, -100%);
  z-index: 3;
  padding: 6px 10px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-md);
  font-size: 12.5px;
  white-space: nowrap;
  pointer-events: none;
}
.adm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.adm-list {
  display: grid;
}
.adm-li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.adm-li:first-child {
  border-top: 0;
  padding-top: 0;
}
.adm-li .grow {
  display: grid;
  min-width: 0;
}
.adm-li .grow > * {
  overflow: hidden;
  text-overflow: ellipsis;
}
.adm-fail {
  align-items: flex-start;
}
.adm-err {
  color: var(--bad);
  white-space: normal;
}
.adm-search {
  width: min(280px, 100%);
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  font: inherit;
  font-size: 13.5px;
  background: var(--bg);
  color: var(--ink);
}
.adm-scroll {
  overflow-x: auto;
  margin: 0 -18px;
  padding: 0 18px;
}
.adm-table {
  min-width: 860px;
}
.adm-table td {
  vertical-align: middle;
}
.adm-who {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
}
.adm-who .avatar {
  flex: none;
}
.adm-who-txt {
  display: grid;
  min-width: 0;
}
.adm-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 3px;
}
.adm-act {
  width: 40px;
  text-align: right;
}
.adm-choices,
.adm-campus-list {
  display: grid;
  gap: 8px;
}
.adm-choices {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.adm-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  cursor: pointer;
  background: var(--bg);
}
.adm-choice:hover {
  border-color: var(--ink);
}
.adm-choice:has(input:checked) {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
  background: var(--subtle);
}
.adm-choice.is-fixed {
  cursor: default;
  opacity: 0.75;
}
.adm-choice input {
  margin-top: 3px;
  accent-color: var(--ink);
  flex: none;
}
.adm-choice > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.adm-warn {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  color: var(--warn);
  margin-top: 4px;
}
.adm-warn .ico {
  flex: none;
  margin-top: 2px;
}
.adm-test {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--subtle);
}
.adm-test.is-ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.adm-test.is-bad {
  background: var(--bad-bg);
  color: var(--bad);
}
.adm-test .ico {
  flex: none;
  margin-top: 2px;
}
.link-btn {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--bad);
  text-decoration: underline;
  cursor: pointer;
}
.panel-danger {
  border-color: #efc9c5;
}
.campus .seg {
  justify-self: start;
}
@media (max-width: 860px) {
  .adm-grid,
  .adm-choices {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 640px) {
  .adm-chart {
    height: 170px;
  }
  .adm-col:nth-of-type(odd) .adm-x {
    visibility: hidden;
  }
}
