[hidden] {
  display: none !important;
}

:root {
  --bg: #f3f4fb;
  --bg-deep: #eef1fb;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --panel-soft: #f7f8ff;
  --panel-tint: #f3f1ff;
  --panel-ink: #171d33;
  --border: rgba(90, 102, 149, 0.14);
  --border-strong: rgba(86, 69, 184, 0.18);
  --text: #1d2540;
  --muted: #667089;
  --primary: #6c58cf;
  --primary-strong: #5542b8;
  --primary-soft: #eee9ff;
  --accent: #1b8e96;
  --gold: #cb8f39;
  --success: #19815f;
  --danger: #c43d59;
  --shadow-lg: 0 28px 60px rgba(22, 31, 69, 0.14);
  --shadow-md: 0 18px 38px rgba(22, 31, 69, 0.1);
  --shadow-sm: 0 10px 24px rgba(22, 31, 69, 0.08);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius: 20px;
  --radius-md: 16px;
  --radius-sm: 13px;
  --ease: 180ms cubic-bezier(.2, .7, .25, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(108, 88, 207, 0.18), transparent 26%),
    radial-gradient(circle at 88% 12%, rgba(27, 142, 150, 0.1), transparent 22%),
    radial-gradient(circle at 85% 90%, rgba(203, 143, 57, 0.08), transparent 20%),
    linear-gradient(180deg, #fcfcff 0%, var(--bg) 45%, var(--bg-deep) 100%);
}

body {
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.32)),
    linear-gradient(90deg, rgba(86, 69, 184, 0.015) 1px, transparent 1px),
    linear-gradient(rgba(86, 69, 184, 0.012) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.45), transparent 78%);
  opacity: .45;
}

::selection {
  background: rgba(108, 88, 207, 0.18);
}

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

button {
  cursor: pointer;
}

a {
  color: var(--primary);
}

img {
  max-width: 100%;
  display: block;
}

.app-shell {
  display: grid;
  grid-template-columns: 336px minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
  align-items: stretch;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  align-self: stretch;
  box-sizing: border-box;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 26px 22px 30px;
  border-right: 1px solid rgba(108, 88, 207, 0.08);
  background: linear-gradient(180deg, rgba(250,251,255,.98), rgba(245,247,252,.96));
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.main-stage {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 28px 34px 48px;
}

.brand-card,
.sidebar-section,
.hero-card,
.composer-card,
.progress-card,
.fetch-help-card,
.workspace-empty,
.meta-card,
.result-card,
.status-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
}

.brand-card::before,
.sidebar-section::before,
.composer-card::before,
.meta-card::before,
.result-card::before,
.progress-card::before,
.fetch-help-card::before,
.workspace-empty::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border-top: 1px solid rgba(255,255,255,.65);
  pointer-events: none;
}

.brand-card {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 16px;
  padding: 18px;
  margin-bottom: 16px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.97), rgba(247,248,255,.9)),
    linear-gradient(180deg, rgba(108, 88, 207, 0.1), transparent 55%);
  overflow: hidden;
}

.brand-card::after {
  content: "";
  position: absolute;
  inset: auto -70px -70px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108, 88, 207, 0.12), transparent 62%);
}

.sidebar .brand-card,
.sidebar .sidebar-section {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.recent-entry,
.project-list-entry,
.assignment-sidebar-item {
  content-visibility: auto;
  contain-intrinsic-size: 120px;
}

.brand-mark {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(108, 88, 207, 0.18), rgba(108, 88, 207, 0.04));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

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

.brand-card h1,
.topbar h2,
.hero-card h3,
.composer-header h3,
.workspace-empty h3,
.result-card h3,
.meta-card h3,
.tool-placeholder-card h3 {
  margin: 0;
}

.brand-copy,
.sidebar-copy,
.field-help,
.progress-detail,
.workspace-empty p,
.hero-copy-text,
.composer-copy,
.composer-side-copy,
.tool-placeholder-card p,
.hero-spotlight p,
.empty-feature-card p {
  color: var(--muted);
  line-height: 1.68;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 11px;
  font-weight: 800;
}

.hero-eyebrow {
  color: rgba(255,255,255,.78);
}

.sidebar-section {
  padding: 16px;
  margin-bottom: 16px;
}

.sidebar-head,
.result-head,
.progress-head,
.meta-head,
.topbar,
.composer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sidebar-head--tight {
  align-items: flex-start;
}

.sidebar-head h2 {
  margin: 0;
  font-size: 15px;
}

.sidebar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(108, 88, 207, 0.1);
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.sidebar-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.sidebar-stat {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(108, 88, 207, 0.12);
  background: linear-gradient(180deg, rgba(108, 88, 207, 0.06), rgba(108, 88, 207, 0.02));
}

.sidebar-stat--accent {
  border-color: rgba(27, 142, 150, 0.14);
  background: linear-gradient(180deg, rgba(27, 142, 150, 0.08), rgba(27, 142, 150, 0.03));
}

.sidebar-stat-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.sidebar-stat strong {
  font-size: 22px;
  line-height: 1.1;
}

.ghost-btn,
.secondary-btn,
.primary-btn,
.project-tool-btn,
.tool-btn,
.source-tab,
.pill-btn {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.72);
  color: var(--text);
  padding: 11px 14px;
  transition:
    transform var(--ease),
    border-color var(--ease),
    background var(--ease),
    color var(--ease),
    box-shadow var(--ease),
    opacity var(--ease);
}

.ghost-btn:hover,
.secondary-btn:hover,
.primary-btn:hover,
.project-tool-btn:hover,
.tool-btn:hover,
.source-tab:hover,
.pill-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(108, 88, 207, 0.34);
  box-shadow: 0 10px 20px rgba(22, 31, 69, 0.08);
}

.primary-btn {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  box-shadow: 0 14px 30px rgba(84, 66, 184, 0.25);
}

.primary-btn:hover {
  box-shadow: 0 18px 34px rgba(84, 66, 184, 0.28);
}

.secondary-btn {
  background: linear-gradient(180deg, rgba(247,248,255,.9), rgba(241,243,251,.92));
}

.large-btn {
  min-width: 220px;
  justify-content: center;
  font-weight: 800;
}

.ghost-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.ghost-link:hover {
  text-decoration: underline;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(108, 88, 207, 0.08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(255,255,255,.35);
}

.status-pill.good {
  background: rgba(25, 129, 95, 0.12);
  color: var(--success);
}

.status-pill.warn {
  background: rgba(203, 143, 57, 0.12);
  color: #9b6b1f;
}

.status-pill.bad {
  background: rgba(196, 61, 89, 0.12);
  color: var(--danger);
}

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

.recent-entry {
  position: relative;
}

.recent-item {
  position: relative;
  width: 100%;
  border: 1px solid rgba(108, 88, 207, 0.1);
  background: linear-gradient(180deg, rgba(247,248,255,.96), rgba(243,244,252,.92));
  border-radius: 18px;
  padding: 14px 52px 14px 15px;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.recent-item::after {
  content: "↗";
  position: absolute;
  top: 14px;
  right: 42px;
  color: rgba(108, 88, 207, 0.45);
  font-weight: 700;
}

.recent-item.active {
  border-color: rgba(108, 88, 207, 0.38);
  background: linear-gradient(145deg, rgba(108, 88, 207, 0.16), rgba(108, 88, 207, 0.05));
  box-shadow: 0 18px 30px rgba(84, 66, 184, 0.12);
}

.recent-delete-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(159, 36, 65, 0.14);
  background: rgba(255,255,255,0.92);
  color: #9f2441;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(20, 33, 61, 0.08);
}

.recent-delete-btn:hover {
  background: rgba(159, 36, 65, 0.08);
  border-color: rgba(159, 36, 65, 0.26);
}

.recent-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.recent-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 7px;
  font-weight: 800;
  line-height: 1.42;
}

.recent-subtitle {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.recent-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.recent-meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.6);
  border: 1px solid rgba(108, 88, 207, 0.08);
}

.empty-recent {
  color: var(--muted);
  line-height: 1.6;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: -10px -12px 20px;
  padding: 14px 12px 18px;
  backdrop-filter: blur(12px);
}

.topbar::after {
  content: "";
  position: absolute;
  inset: auto 12px 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(108,88,207,0), rgba(108,88,207,.18), rgba(108,88,207,0));
}

.topbar h2 {
  font-size: clamp(28px, 2.8vw, 38px);
  line-height: 1.08;
  max-width: 820px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .9fr);
  gap: 18px;
  padding: 26px;
  margin-bottom: 22px;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,.18), transparent 32%),
    linear-gradient(135deg, rgba(24, 30, 58, 0.98), rgba(86, 69, 184, 0.96));
  border-color: rgba(255,255,255,.12);
  color: #fff;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(28, 33, 78, 0.26);
}

.hero-card::before {
  border-top-color: rgba(255,255,255,.2);
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -120px -120px auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.12), transparent 62%);
}

.hero-copy-block {
  position: relative;
  z-index: 1;
}

.hero-card h3 {
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1.06;
  max-width: 11ch;
}

.hero-copy-text {
  margin: 16px 0 18px;
  max-width: 62ch;
  color: rgba(255,255,255,.82);
}

.hero-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.9);
  font-weight: 700;
  font-size: 13px;
}

.hero-rail {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
}

.hero-spotlight,
.hero-mini-card {
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.hero-spotlight {
  padding: 18px 18px 16px;
}

.hero-spotlight-label {
  display: block;
  margin-bottom: 10px;
  color: rgba(255,255,255,.68);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 800;
}

.hero-spotlight strong,
.hero-mini-card strong {
  display: block;
  color: #fff;
  line-height: 1.38;
}

.hero-spotlight p {
  margin: 10px 0 0;
  color: rgba(255,255,255,.74);
}

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

.hero-mini-card {
  padding: 16px;
}

.hero-mini-card span {
  display: block;
  margin-bottom: 8px;
  color: rgba(255,255,255,.66);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.hero-mini-card--accent {
  background: linear-gradient(180deg, rgba(203, 143, 57, 0.22), rgba(203, 143, 57, 0.08));
}

.composer-card,
.progress-card,
.workspace-empty,
.workspace {
  margin-bottom: 22px;
}

.composer-card,
.progress-card,
.workspace-empty,
.workspace,
.meta-card,
.result-card {
  overflow: hidden;
  overflow: clip;
}

.composer-card {
  padding: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(248,249,255,.95));
}

.composer-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .72fr);
  gap: 18px;
  padding: 22px;
}

.composer-main,
.composer-aside {
  display: grid;
  gap: 18px;
}

.composer-header h3 {
  font-size: 26px;
  line-height: 1.15;
}

.composer-copy {
  margin: 10px 0 0;
  max-width: 62ch;
}

.composer-stepper {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.composer-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(108, 88, 207, 0.12);
  background: rgba(108, 88, 207, 0.06);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 800;
}

.source-tabs {
  display: inline-flex;
  width: fit-content;
  gap: 8px;
  padding: 6px;
  background: linear-gradient(180deg, rgba(243,244,252,.96), rgba(238,241,250,.96));
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.source-tab.active,
.pill-btn.active,
.tool-btn.active,
.project-tool-btn.active {
  background: linear-gradient(135deg, rgba(108, 88, 207, 0.16), rgba(108, 88, 207, 0.05));
  border-color: rgba(108, 88, 207, 0.3);
  color: var(--primary-strong);
}

.source-panel {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(108, 88, 207, 0.1);
  background: linear-gradient(180deg, rgba(248,249,255,.96), rgba(255,255,255,.98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}

.source-panel[hidden] {
  display: none !important;
}

.field-label {
  display: block;
  font-weight: 800;
  margin-bottom: 8px;
}

.field-label.small {
  font-size: 13px;
  margin-bottom: 6px;
}

.field-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.field-row--url .text-input {
  flex: 1;
}

.compact-row {
  align-items: flex-end;
  margin-top: 14px;
}

.field-group {
  flex: 1;
}

.text-input,
.select-input {
  width: 100%;
  border: 1px solid rgba(90, 102, 149, 0.16);
  background: rgba(255,255,255,.95);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 16px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
  transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}

.text-input::placeholder {
  color: #8a93ab;
}

.text-input:focus,
.select-input:focus {
  border-color: rgba(108, 88, 207, 0.38);
  box-shadow: 0 0 0 5px rgba(108, 88, 207, 0.08), inset 0 1px 0 rgba(255,255,255,.85);
}

.small-select {
  padding: 11px 12px;
}

.dropzone {
  display: grid;
  gap: 10px;
  padding: 24px;
  border: 1.5px dashed rgba(108, 88, 207, 0.34);
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(108,88,207,.08), transparent 40%),
    linear-gradient(145deg, rgba(108,88,207,.06), rgba(255,255,255,.92));
  transition: border-color var(--ease), transform var(--ease), box-shadow var(--ease), background var(--ease);
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(84, 66, 184, 0.12);
}

.dropzone-title {
  font-size: 16px;
  font-weight: 800;
}

.dropzone-copy {
  color: var(--muted);
  line-height: 1.66;
}

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

.option-card {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(108, 88, 207, 0.1);
  background: linear-gradient(180deg, rgba(246,247,255,.96), rgba(255,255,255,.98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}

.option-card:focus-within {
  border-color: rgba(108, 88, 207, 0.22);
  box-shadow: 0 0 0 4px rgba(108, 88, 207, 0.06), inset 0 1px 0 rgba(255,255,255,.82);
}

.toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 56px;
  height: 32px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d8dce9;
  transition: .2s ease;
}

.switch-slider::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 18px rgba(29,37,64,.16);
  transition: .2s ease;
}

.switch input:checked + .switch-slider {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.switch input:checked + .switch-slider::before {
  transform: translateX(24px);
}

.composer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.composer-aside {
  align-content: start;
}

.composer-side-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(108, 88, 207, 0.12);
  background: linear-gradient(180deg, rgba(245,246,255,.98), rgba(255,255,255,.98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.74);
}

.composer-side-card--soft {
  background: linear-gradient(180deg, rgba(22, 30, 60, 0.97), rgba(42, 49, 93, 0.96));
  border-color: rgba(255,255,255,.08);
  color: #fff;
}

.composer-side-card--soft .eyebrow,
.composer-side-card--soft .meta-label,
.composer-side-card--soft .composer-benefits li {
  color: rgba(255,255,255,.8);
}

.composer-side-card--soft::before {
  border-top-color: rgba(255,255,255,.14);
}

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

.composer-side-grid strong {
  display: block;
  line-height: 1.42;
}

.composer-benefits {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.composer-benefits li {
  position: relative;
  padding-left: 18px;
  line-height: 1.6;
}

.composer-benefits li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: .82;
}

.progress-card {
  padding: 22px;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,.14), transparent 28%),
    linear-gradient(135deg, rgba(24, 30, 58, 0.98), rgba(86, 69, 184, 0.95));
  border-color: rgba(255,255,255,.1);
  color: #fff;
  box-shadow: 0 28px 60px rgba(28,33,78,.22);
}

.progress-card .eyebrow,
.progress-detail {
  color: rgba(255,255,255,.75);
}

.progress-bar-track {
  height: 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  overflow: hidden;
  margin-top: 16px;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, #fff, #cfd6ff);
  transition: width .28s ease;
}

.progress-percent {
  font-weight: 900;
  color: #fff;
}

.fetch-help-card {
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,.12), transparent 24%),
    linear-gradient(180deg, rgba(255,248,238,.96), rgba(255,255,255,.98));
  border-color: rgba(216, 136, 40, 0.18);
  box-shadow: 0 22px 50px rgba(45, 38, 14, 0.1);
}

.fetch-help-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.fetch-help-message {
  margin: 10px 0 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-strong);
}

.fetch-help-detail {
  margin: 12px 0 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.fetch-help-list {
  margin: 16px 0 0;
  padding-left: 1.2rem;
  color: var(--ink-soft);
  line-height: 1.65;
}

.fetch-help-list li + li {
  margin-top: 8px;
}

.fetch-help-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.fetch-help-card[hidden] {
  display: none !important;
}

.workspace-empty {
  padding: 26px;
  background:
    radial-gradient(circle at top right, rgba(108,88,207,.08), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,249,255,.95));
}

.empty-state-head {
  max-width: 64ch;
}

.empty-state-head p {
  margin: 10px 0 0;
}

.empty-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.empty-feature-card {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(108, 88, 207, 0.12);
  background: linear-gradient(180deg, rgba(246,247,255,.96), rgba(255,255,255,.98));
}

.empty-feature-card h4 {
  margin: 0 0 8px;
  font-size: 18px;
}

.empty-feature-step {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  font-weight: 900;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(330px, .78fr);
  gap: 18px;
  align-items: start;
}

.workspace-main,
.workspace-side {
  display: grid;
  gap: 18px;
  align-content: start;
}

.tool-output-section {
  display: grid;
  gap: 18px;
  margin-top: 0;
}

.meta-card,
.result-card {
  padding: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(248,249,255,.95));
}

.meta-card {
  overflow: hidden;
}

.meta-card::after,
.result-card::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, rgba(108,88,207,.78), rgba(27,142,150,.55), rgba(203,143,57,.55));
  opacity: .9;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.meta-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

#source-publisher {
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.6;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.metric-pill {
  position: relative;
  padding: 16px 16px 16px 52px;
  border-radius: 18px;
  border: 1px solid rgba(108, 88, 207, 0.11);
  background: linear-gradient(180deg, rgba(108,88,207,.06), rgba(108,88,207,.02));
}

.metric-pill::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(108,88,207,.36), rgba(108,88,207,.14));
}

.metric-pill--accent {
  border-color: rgba(25,129,95,.16);
  background: linear-gradient(180deg, rgba(25,129,95,.1), rgba(25,129,95,.03));
}

.metric-pill--accent::before {
  background: linear-gradient(135deg, rgba(25,129,95,.34), rgba(25,129,95,.12));
}

.metric-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.metric-pill strong {
  font-size: 22px;
  line-height: 1.15;
}

.rw-chip,
.summary-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(108, 88, 207, 0.1);
  color: var(--primary-strong);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 800;
}

.result-subcopy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.58;
}

.result-card--why {
  background: linear-gradient(180deg, rgba(20, 120, 167, 0.06), rgba(20, 120, 167, 0.02), rgba(255,255,255,.92));
}

.result-card--takeaways {
  background: linear-gradient(180deg, rgba(203, 143, 57, 0.09), rgba(203, 143, 57, 0.02), rgba(255,255,255,.92));
}

.result-card--terms {
  background: linear-gradient(180deg, rgba(108, 88, 207, 0.08), rgba(108, 88, 207, 0.02), rgba(255,255,255,.92));
}

.result-card--insights {
  background: linear-gradient(180deg, rgba(27, 142, 150, 0.07), rgba(108, 88, 207, 0.03), rgba(255,255,255,.94));
}

.summary-output,
.tool-result-content {
  min-height: 80px;
}

.summary-output {
  display: grid;
  gap: 16px;
}

.summary-output > * {
  margin: 0;
}

.toolbox-card {
  position: sticky;
  top: 88px;
  z-index: 6;
  isolation: isolate;
  background: linear-gradient(180deg, rgba(252, 253, 255, 0.995), rgba(246, 248, 255, 0.985));
  box-shadow: 0 20px 42px -30px rgba(29, 37, 64, 0.32);
}

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

.tool-btn,
.project-tool-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  min-height: 52px;
  background: linear-gradient(180deg, rgba(247,248,255,.96), rgba(241,243,251,.92));
  font-weight: 800;
}

.tool-btn::before,
.project-tool-btn::before {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(108, 88, 207, 0.12);
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 900;
  flex-shrink: 0;
}

.tool-btn[data-tool="flashcards"]::before,
.project-tool-btn[data-tool="flashcards"]::before { content: "◫"; }
.tool-btn[data-tool="questions"]::before,
.project-tool-btn[data-tool="questions"]::before { content: "?"; }
.tool-btn[data-tool="quiz"]::before,
.project-tool-btn[data-tool="quiz"]::before { content: "✓"; }
.tool-btn[data-tool="outline"]::before,
.project-tool-btn[data-tool="outline"]::before { content: "≡"; }
.tool-btn[data-tool="analysis"]::before,
.project-tool-btn[data-tool="analysis"]::before { content: "◎"; }
.tool-btn[data-tool="citation"]::before,
.project-tool-btn[data-tool="citation"]::before { content: "❞"; }

.tool-config-form {
  display: grid;
  gap: 14px;
}

.tool-config-group {
  display: grid;
  gap: 12px;
}

.tool-config-group[hidden] {
  display: none !important;
}

.tool-config-grid {
  display: grid;
  gap: 12px;
}

.tool-config-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tool-config-grid--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tool-config-grid--analysis {
  grid-template-columns: minmax(0, 1.6fr) minmax(180px, .85fr);
  align-items: start;
}

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

.tool-setting {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.tool-setting > span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}

.tool-result-head {
  align-items: flex-start;
}

.tool-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-result-card,
#tool-result-card {
  scroll-margin-top: 120px;
}

.tool-result-card.is-loading {
  border-style: solid;
  border-color: rgba(108, 88, 207, 0.16);
}

.tool-result-card.is-emphasized {
  animation: rwToolFocusGlow 1.15s ease;
}

@keyframes rwToolFocusGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(108, 88, 207, 0.18);
    transform: translateY(0);
  }
  35% {
    box-shadow: 0 18px 46px -26px rgba(108, 88, 207, 0.42);
    transform: translateY(-2px);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(108, 88, 207, 0);
    transform: translateY(0);
  }
}

.rw-tool-loading-shell {
  display: grid;
  gap: 14px;
}

.rw-tool-loading-copy {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.68;
}

.rw-tool-progress-box {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(108, 88, 207, 0.14);
  background: linear-gradient(180deg, rgba(255,255,255,.84), rgba(247,248,255,.78));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.74);
}

.rw-tool-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rw-tool-progress-label {
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.rw-tool-progress-percent {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.rw-tool-progress-track {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(108, 88, 207, 0.12);
}

.rw-tool-progress-bar {
  position: relative;
  display: block;
  height: 100%;
  width: 16%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 340ms var(--ease);
}

.rw-tool-progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.44), rgba(255,255,255,0));
  transform: translateX(-100%);
  animation: rwToolProgressSheen 1.35s linear infinite;
}

.rw-tool-progress-caption {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.62;
}

@keyframes rwToolProgressSheen {
  100% { transform: translateX(100%); }
}

.rw-tool-loading-list {
  display: grid;
  gap: 10px;
}

.rw-tool-loading-line {
  display: block;
  height: 12px;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(108, 88, 207, 0.08), rgba(108, 88, 207, 0.18), rgba(108, 88, 207, 0.08));
  background-size: 220% 100%;
  animation: rwToolLoadingPulse 1.3s linear infinite;
}

.rw-tool-loading-line.is-short {
  width: 48%;
}

.rw-tool-loading-line.is-long {
  width: 82%;
}

@keyframes rwToolLoadingPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -20% 0; }
}

.tool-placeholder-card {
  display: none !important;
}

#pdf-file-meta {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.62;
}

.rw-summary-flow,
.rw-summary-stack,
.rw-outline-block,
.rw-accordion-list,
.rw-quiz-shell {
  display: grid;
  gap: 14px;
}

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

.rw-insight-cluster {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.rw-summary-section,
.rw-section-card,
.rw-insight-panel,
.rw-term-card,
.rw-outline-line,
.rw-accordion-card,
.rw-answer-box,
.rw-citation-block,
.rw-analysis-block,
.rw-plain-output {
  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(108, 88, 207, 0.1);
  background: linear-gradient(180deg, rgba(108,88,207,.055), rgba(108,88,207,.018), rgba(255,255,255,.88));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}

.rw-section-card {
  padding: 18px 18px 18px 19px;
}

.rw-summary-section::before,
.rw-section-card::before,
.rw-insight-panel::before,
.rw-term-card::before,
.rw-outline-line::before,
.rw-accordion-card::before,
.rw-answer-box::before,
.rw-citation-block::before,
.rw-analysis-block::before,
.rw-plain-output::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 18px 0 0 18px;
  background: linear-gradient(180deg, rgba(108,88,207,.78), rgba(27,142,150,.48));
}

.rw-summary-section:nth-child(2n)::before,
.rw-section-card:nth-child(2n)::before {
  background: linear-gradient(180deg, rgba(27,142,150,.72), rgba(108,88,207,.42));
}

.rw-summary-section:nth-child(3n)::before,
.rw-section-card:nth-child(3n)::before {
  background: linear-gradient(180deg, rgba(203,143,57,.78), rgba(108,88,207,.38));
}


.rw-section-card--evidence {
  background: linear-gradient(180deg, rgba(27,142,150,.10), rgba(27,142,150,.03), rgba(255,255,255,.92));
}

.rw-section-card--implication {
  background: linear-gradient(180deg, rgba(108,88,207,.09), rgba(108,88,207,.03), rgba(255,255,255,.92));
}

.rw-section-card--nuance {
  background: linear-gradient(180deg, rgba(203,143,57,.10), rgba(203,143,57,.03), rgba(255,255,255,.92));
}

.rw-section-title {
  margin: 0 0 12px;
  font-size: 19px;
  line-height: 1.26;
}

.rw-section-kicker {
  margin: 0 0 10px;
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .11em;
}

.summary-output p,
.tool-result-content p,
.rw-summary-flow p,
.rw-answer-box p,
.rw-term-card p,
.rw-analysis-block p,
.rw-insight-panel p,
.rw-outline-line p,
.rw-plain-output,
.rw-citation-block,
.rw-analysis-block {
  line-height: 1.74;
  color: var(--text);
}

.rw-section-card ul,
.rw-option-list,
.rw-list-clean,
.rw-takeaways-list,
.rw-step-list,
.rw-quiz-shell,
.rw-outline-block {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.rw-list-clean li,
.rw-option-list li,
.rw-takeaways-list li,
.rw-step-item,
.rw-outline-line,
.rw-accordion-body li {
  position: relative;
  padding-left: 18px;
  line-height: 1.65;
}

.rw-list-clean li::before,
.rw-option-list li::before,
.rw-step-item::before,
.rw-accordion-body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .72em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.rw-list-clean,
.rw-option-list,
.rw-step-list {
  display: grid;
  gap: 10px;
}

.rw-bullet-summary .rw-list-clean li {
  padding-left: 20px;
}

.rw-insight-panel {
  padding: 18px;
}

.rw-insight-panel--important {
  background: linear-gradient(180deg, rgba(20,120,167,.08), rgba(20,120,167,.02), rgba(255,255,255,.9));
}

.rw-insight-panel--bigger {
  background: linear-gradient(180deg, rgba(108,88,207,.08), rgba(108,88,207,.02), rgba(255,255,255,.9));
}

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

.rw-takeaway-item {
  padding: 15px 16px 15px 40px;
  border-radius: 18px;
  border: 1px solid rgba(203, 143, 57, 0.18);
  background: linear-gradient(180deg, rgba(255, 220, 170, 0.36), rgba(255, 240, 214, 0.24));
  font-weight: 700;
}

.rw-takeaway-item::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #e3b55f);
  box-shadow: 0 0 0 4px rgba(203,143,57,.12);
}

.rw-terms-grid,
.rw-flashcards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.rw-term-card {
  padding: 16px;
}

.rw-term-card h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

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

.rw-accordion-card {
  overflow: hidden;
  background: linear-gradient(180deg, rgba(108,88,207,.04), rgba(255,255,255,.95));
}

.rw-accordion-card summary {
  list-style: none;
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
}

.rw-accordion-card summary::-webkit-details-marker {
  display: none;
}

.rw-accordion-body {
  padding: 0 16px 16px;
}

.rw-answer-box {
  margin-top: 16px;
  padding: 14px 14px 14px 18px;
  background: linear-gradient(180deg, rgba(108,88,207,.08), rgba(108,88,207,.03));
}

.rw-answer-subpoint {
  color: var(--muted);
}

.rw-flashcard {
  position: relative;
  min-height: 200px;
  border: none;
  border-radius: 20px;
  background: transparent;
  perspective: 1200px;
  padding: 0;
}

.rw-flashcard-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  border-radius: 20px;
  backface-visibility: hidden;
  border: 1px solid rgba(108, 88, 207, 0.14);
  box-shadow: var(--shadow-sm);
  transition: transform .45s ease;
}

.rw-flashcard-front {
  background: linear-gradient(180deg, rgba(108,88,207,.14), rgba(108,88,207,.04), rgba(255,255,255,.94));
}

.rw-flashcard-back {
  background: linear-gradient(180deg, rgba(28, 36, 68, 0.06), rgba(255,255,255,.96));
  transform: rotateY(180deg);
}

.rw-flashcard.is-flipped .rw-flashcard-front {
  transform: rotateY(180deg);
}

.rw-flashcard.is-flipped .rw-flashcard-back {
  transform: rotateY(360deg);
}

.rw-flashcard-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--primary);
}

.rw-outline-line {
  padding: 12px 14px 12px 20px;
}

.rw-outline-level-1 {
  margin-left: 16px;
}

.rw-outline-level-2 {
  margin-left: 32px;
}

.rw-outline-title {
  font-weight: 800;
  background: linear-gradient(180deg, rgba(108,88,207,.12), rgba(108,88,207,.05));
}

.rw-step-item {
  padding: 14px 16px 14px 20px;
  border-radius: 16px;
  border: 1px solid rgba(108, 88, 207, 0.08);
  background: linear-gradient(180deg, rgba(108,88,207,.05), rgba(255,255,255,.95));
}

.rw-step-item::before {
  top: 20px;
}

.rw-step-label {
  font-weight: 800;
  color: var(--primary-strong);
}

.rw-citation-block,
.rw-analysis-block,
.rw-plain-output {
  padding: 16px 16px 16px 20px;
  white-space: pre-wrap;
}

.rw-quiz-shell {
  display: grid;
  gap: 12px;
}

.rw-chip {
  background: rgba(27, 142, 150, 0.1);
  color: #0e7382;
}

button:disabled {
  cursor: not-allowed;
  opacity: .58;
  transform: none !important;
  box-shadow: none !important;
}

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 10px;
  z-index: 1000;
}

.toast {
  min-width: 250px;
  max-width: 380px;
  padding: 14px 16px;
  border-radius: 16px;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 18px 34px rgba(22, 31, 69, 0.18);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-info,
.toast-success {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.toast-warn {
  background: linear-gradient(135deg, #c28b00, #9d7100);
}

.toast-bad {
  background: linear-gradient(135deg, #d43c58, #a81f3b);
}

body[data-workspace-state="ready"] .workspace-main > *,
body[data-workspace-state="ready"] .workspace-side > *,
body[data-workspace-state="ready"] .meta-card,
body[data-workspace-state="ready"] .result-card {
  animation: riseIn .46s both;
}

body[data-workspace-state="ready"] .workspace-main > *:nth-child(2) { animation-delay: .03s; }
body[data-workspace-state="ready"] .workspace-main > *:nth-child(3) { animation-delay: .06s; }
body[data-workspace-state="ready"] .workspace-main > *:nth-child(4) { animation-delay: .09s; }
body[data-workspace-state="ready"] .workspace-side > *:nth-child(1) { animation-delay: .04s; }
body[data-workspace-state="ready"] .workspace-side > *:nth-child(2) { animation-delay: .08s; }
body[data-workspace-state="ready"] .workspace-side > *:nth-child(3) { animation-delay: .12s; }

body[data-run-state="busy"] #generate-summary-btn {
  background-size: 220% 220%;
  animation: shimmerPulse 1.8s linear infinite;
}

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

@keyframes shimmerPulse {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1320px) {
  .hero-card,
  .composer-shell,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

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

  .toolbox-card,
  .tool-placeholder-card {
    position: static;
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(108, 88, 207, 0.08);
  }

  .topbar {
    position: static;
    margin: 0 0 20px;
    padding: 0;
  }

  .topbar::after {
    display: none;
  }
}

@media (max-width: 900px) {
  .main-stage {
    padding: 20px;
  }

  .sidebar {
    padding: 18px;
  }

  .options-grid,
  .empty-feature-grid,
  .metrics-strip,
  .rw-summary-duo,
  .rw-insight-grid,
  .hero-mini-grid,
  .composer-side-grid,
  .sidebar-stat-grid {
    grid-template-columns: 1fr;
  }

  .toolbox-card .tool-button-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .field-row,
  .topbar,
  .result-head,
  .meta-head,
  .progress-head,
  .sidebar-head,
  .composer-header,
  .composer-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .source-tabs {
    width: 100%;
  }

  .source-tab {
    flex: 1;
  }

  .hero-card,
  .composer-shell,
  .meta-card,
  .result-card,
  .progress-card,
  .workspace-empty {
    padding-left: 18px;
    padding-right: 18px;
  }

  .hero-card,
  .composer-shell {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .large-btn {
    min-width: 0;
    width: 100%;
  }

  .metric-pill {
    padding-left: 16px;
  }

  .metric-pill::before {
    display: none;
  }

  .rw-terms-grid,
  .rw-flashcards-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== v8 application polish overrides ===== */
html {
  scroll-behavior: smooth;
}

:root {
  --shadow-lg: 0 22px 52px rgba(22, 31, 69, 0.11);
  --shadow-md: 0 14px 32px rgba(22, 31, 69, 0.09);
  --shadow-sm: 0 8px 20px rgba(22, 31, 69, 0.07);
}

html,
body {
  background:
    radial-gradient(circle at 12% 10%, rgba(108, 88, 207, 0.10), transparent 28%),
    radial-gradient(circle at 88% 10%, rgba(27, 142, 150, 0.06), transparent 24%),
    linear-gradient(180deg, #f8f9fd 0%, #f2f5fb 58%, #eef2fa 100%);
}

body::before {
  opacity: .22;
  background-size: auto, 48px 48px, 48px 48px;
}

.app-shell {
  grid-template-columns: 320px minmax(0, 1fr);
}

.sidebar {
  padding: 22px 18px 26px;
  background: linear-gradient(180deg, rgba(255,255,255,.84), rgba(249,250,255,.74));
}

.main-stage {
  padding: 22px 28px 42px;
}

.brand-card {
  gap: 14px;
  padding: 16px;
}

.brand-mark {
  width: 62px;
  height: 62px;
  border-radius: 18px;
}

.brand-mark img {
  width: 38px;
  height: 38px;
}

.brand-card h1 {
  font-size: 27px;
  line-height: 1.08;
}

.brand-copy,
.sidebar-copy {
  font-size: 14px;
  line-height: 1.62;
}

.sidebar-section {
  padding: 15px;
}

.sidebar-head h2 {
  font-size: 16px;
}

.sidebar-badge {
  letter-spacing: .08em;
}

.sidebar-stat {
  padding: 14px;
}

.recent-item {
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(247,248,255,.92));
}

.recent-item.active {
  box-shadow: 0 14px 28px rgba(84, 66, 184, 0.12);
}

.topbar {
  position: sticky;
  top: 10px;
  z-index: 24;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto auto;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  padding: 10px 14px;
  border: 1px solid rgba(108, 88, 207, 0.16);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(108, 88, 207, 0.12), rgba(27, 142, 150, 0.07) 34%, rgba(255,255,255,.9) 76%),
    rgba(255,255,255,.82);
  box-shadow: 0 16px 32px rgba(22, 31, 69, 0.09), inset 0 1px 0 rgba(255,255,255,.5);
  backdrop-filter: blur(18px);
  overflow: hidden;
  isolation: isolate;
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 14%, rgba(108,88,207,.12), transparent 28%),
    radial-gradient(circle at 88% 14%, rgba(27,142,150,.09), transparent 24%);
  pointer-events: none;
  z-index: -1;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: auto 14px 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(108,88,207,0), rgba(108,88,207,.22), rgba(27,142,150,.18), rgba(108,88,207,0));
}

.topbar-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.topbar-title-block {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar-eyebrow {
  margin: 0;
}

.topbar h2 {
  font-size: 21px;
  line-height: 1.1;
  max-width: none;
}

.topbar-context {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.topbar-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid rgba(108, 88, 207, 0.14);
  background: linear-gradient(180deg, rgba(248,249,255,.96), rgba(242,244,252,.96));
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .01em;
  text-decoration: none;
  transition:
    transform var(--ease),
    border-color var(--ease),
    background var(--ease),
    color var(--ease),
    opacity var(--ease),
    box-shadow var(--ease);
}

.topbar-nav-link:hover {
  transform: translateY(-1px);
  color: var(--primary-strong);
  border-color: rgba(108, 88, 207, 0.26);
  box-shadow: 0 10px 18px rgba(22, 31, 69, 0.06);
}

.topbar-nav-link.active {
  background: linear-gradient(135deg, rgba(108, 88, 207, 0.16), rgba(108, 88, 207, 0.06));
  border-color: rgba(108, 88, 207, 0.3);
  color: var(--primary-strong);
}

.topbar-nav-link.is-disabled {
  opacity: .46;
  pointer-events: none;
  box-shadow: none;
}

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

.topbar .secondary-btn,
.topbar .primary-btn {
  min-height: 40px;
  padding: 9px 13px;
  border-radius: 12px;
  box-shadow: none;
}

#composer-card,
#source-meta-card,
#summary-section,
#why-card,
#takeaways-card,
#keyterms-card,
#toolbox-card {
  scroll-margin-top: 96px;
}

.composer-card,
.progress-card,
.workspace-empty,
.workspace,
.meta-card,
.result-card {
  border-radius: 24px;
}

.composer-card {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,255,.96));
}

.composer-shell {
  gap: 16px;
  padding: 18px;
}

.composer-header h3 {
  font-size: 24px;
}

.composer-copy {
  max-width: 58ch;
}

.composer-side-card {
  border-radius: 20px;
  padding: 16px;
}

.composer-side-card--soft {
  background: linear-gradient(180deg, rgba(28, 34, 66, 0.97), rgba(48, 55, 96, 0.96));
}

.option-card,
.source-panel,
.dropzone {
  border-radius: 20px;
}

.workspace-empty {
  background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(249,250,255,.95));
}

.empty-state-head h3 {
  font-size: 28px;
  line-height: 1.14;
}

.empty-state-head p {
  max-width: 68ch;
}

.meta-card,
.result-card {
  padding: 18px;
}

.result-head,
.meta-head {
  margin-bottom: 16px;
}

.result-card h3,
.meta-card h3,
.tool-placeholder-card h3 {
  font-size: 24px;
  line-height: 1.14;
}

.result-subcopy {
  max-width: 68ch;
}

.toolbox-card {
  top: 82px;
  z-index: 6;
  isolation: isolate;
  background: linear-gradient(180deg, rgba(252, 253, 255, 0.995), rgba(246, 248, 255, 0.985));
  box-shadow: 0 20px 42px -30px rgba(29, 37, 64, 0.32);
}

.tool-result-card,
.tool-placeholder-card {
  position: relative;
  z-index: 1;
}

.toolbox-card .tool-button-grid {
  gap: 9px;
}

.tool-btn {
  min-height: 50px;
  border-radius: 16px;
}

.tool-placeholder-card {
  gap: 10px;
}

.summary-output,
.tool-result-content {
  min-height: 72px;
}

.rw-takeaways-list {
  display: grid;
  gap: 12px;
}

.rw-takeaways-list li {
  list-style: none;
}

.rw-takeaways-list .rw-takeaway-item {
  position: relative;
  display: block;
  padding: 16px 18px 16px 56px;
  border-radius: 18px;
  border: 1px solid rgba(203, 143, 57, 0.2);
  background: linear-gradient(180deg, rgba(255, 220, 170, 0.30), rgba(255, 244, 223, 0.2));
  font-weight: 700;
  line-height: 1.58;
}

.rw-takeaways-list .rw-takeaway-item::before {
  left: 20px;
  width: 10px;
  height: 10px;
  box-shadow: 0 0 0 5px rgba(203,143,57,.10);
}

body[data-workspace-state="ready"] .workspace {
  animation-duration: 380ms;
}

@media (max-width: 1380px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

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

@media (max-width: 1180px) {
  .topbar {
    position: sticky;
    margin: 0 0 18px;
    padding: 12px 14px;
  }

  .topbar::after {
    display: block;
  }
}

@media (max-width: 900px) {
  .main-stage {
    padding: 18px;
  }

  .topbar-context {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

@media (max-width: 780px) {
  .topbar {
    position: static;
  }

  #composer-card,
  #source-meta-card,
  #summary-section,
  #why-card,
  #takeaways-card,
  #keyterms-card,
  #toolbox-card {
    scroll-margin-top: 24px;
  }
}

/* ===== Toolbox refinement pass ===== */
.tool-setting--wide {
  grid-column: 1 / -1;
  flex: 1 1 100%;
}

.small-textarea {
  min-height: 88px;
  resize: vertical;
}

.tool-result-card[data-tool-kind="flashcards"] {
  background: linear-gradient(180deg, rgba(108,88,207,.08), rgba(255,255,255,.96));
}

.tool-result-card[data-tool-kind="questions"],
.tool-result-card[data-tool-kind="quiz"] {
  background: linear-gradient(180deg, rgba(27,142,150,.075), rgba(255,255,255,.96));
}

.tool-result-card[data-tool-kind="outline"] {
  background: linear-gradient(180deg, rgba(203,143,57,.075), rgba(255,255,255,.96));
}

.tool-result-card[data-tool-kind="analysis"] {
  background: linear-gradient(180deg, rgba(29,37,64,.06), rgba(255,255,255,.97));
}

.tool-result-card[data-tool-kind="citation"] {
  background: linear-gradient(180deg, rgba(108,88,207,.05), rgba(255,255,255,.98));
}

.rw-study-shell,
.rw-outline-shell,
.rw-analysis-shell,
.rw-citation-shell {
  display: grid;
  gap: 14px;
}

.rw-question-shell {
  display: grid;
  gap: 14px;
}

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

.rw-question-card {
  display: grid;
  gap: 14px;
  padding: 18px 18px 18px 19px;
  border-radius: 20px;
  border: 1px solid rgba(108, 88, 207, 0.11);
  background: linear-gradient(180deg, rgba(108,88,207,.07), rgba(255,255,255,.96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.rw-question-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.rw-question-number {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(108, 88, 207, 0.15), rgba(108, 88, 207, 0.08));
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.rw-question-kicker {
  margin: 1px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rw-question-prompt {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
}

.rw-question-answer-wrap {
  display: grid;
  gap: 10px;
  padding: 14px 16px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,.74);
  border: 1px solid rgba(108, 88, 207, 0.08);
}

.rw-question-label {
  margin: 0;
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.rw-question-answer {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.72;
}

.rw-question-notes {
  display: grid;
  gap: 8px;
}

.rw-question-points {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rw-question-points li {
  position: relative;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.rw-question-points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(108, 88, 207, 0.42);
}

.rw-tool-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.rw-chip--soft {
  background: rgba(108, 88, 207, 0.08);
  color: var(--primary-strong);
}

.rw-mini-heading {
  margin: 6px 0 -2px;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.rw-answer-line {
  display: none;
}

.rw-study-shell.answers-visible .rw-answer-line {
  display: block;
}

.rw-study-shell.answers-visible .rw-option-correct {
  border-color: rgba(25,129,95,.22);
  background: linear-gradient(180deg, rgba(25,129,95,.14), rgba(25,129,95,.05));
}

.rw-study-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.rw-study-progress {
  margin-left: auto;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.rw-study-shell--flashcards .rw-flashcard-stage {
  position: relative;
  min-height: 270px;
}

.rw-study-shell--flashcards .rw-flashcard-panel {
  height: 270px;
}

.rw-study-shell--flashcards .rw-flashcard-display {
  position: relative;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  perspective: 1200px;
}

.rw-study-shell--flashcards .rw-flashcard-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 22px;
  backface-visibility: hidden;
  border-radius: 20px;
  border: 1px solid rgba(108, 88, 207, 0.14);
  box-shadow: var(--shadow-sm);
  transition: transform var(--ease), box-shadow var(--ease);
  text-align: left;
}

.rw-study-shell--flashcards .rw-flashcard-front {
  background: linear-gradient(180deg, rgba(108,88,207,.15), rgba(108,88,207,.04), rgba(255,255,255,.96));
}

.rw-study-shell--flashcards .rw-flashcard-back {
  background: linear-gradient(180deg, rgba(29,37,64,.08), rgba(255,255,255,.96));
  transform: rotateY(180deg);
}

.rw-study-shell--flashcards .rw-flashcard-panel.is-flipped .rw-flashcard-front {
  transform: rotateY(180deg);
}

.rw-study-shell--flashcards .rw-flashcard-panel.is-flipped .rw-flashcard-back {
  transform: rotateY(360deg);
}

.rw-study-shell--flashcards .rw-flashcard-badge {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.56);
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.rw-study-shell--flashcards .rw-flashcard-front strong,
.rw-study-shell--flashcards .rw-flashcard-back span:last-child {
  font-size: 18px;
  line-height: 1.6;
}

.rw-flashcard-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rw-flashcard-chip {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(108, 88, 207, 0.12);
  background: rgba(255,255,255,.74);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.rw-flashcard-chip.is-active {
  border-color: rgba(108, 88, 207, 0.34);
  background: rgba(108, 88, 207, 0.12);
  color: var(--primary-strong);
}

.rw-accordion-card summary {
  align-items: flex-start;
}

.rw-accordion-card summary span:last-child {
  line-height: 1.58;
}

.rw-option-list {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.rw-option-list li {
  padding: 11px 12px 11px 16px;
  border-radius: 14px;
  border: 1px solid rgba(108, 88, 207, 0.1);
  background: rgba(255,255,255,.7);
}

.rw-option-list li::before {
  top: 1.05em;
}

.rw-outline-points {
  display: grid;
  gap: 10px;
}

.rw-outline-points p {
  margin: 0;
}

.rw-outline-list {
  display: grid;
  gap: 0.78rem;
}

.rw-outline-row {
  line-height: 1.6;
}

.rw-outline-line--quote strong,
.rw-outline-row--quote strong {
  color: rgba(89, 50, 161, 0.94);
}

.rw-outline-quote {
  font-style: italic;
  color: rgba(45, 52, 74, 0.94);
}

.rw-outline-bibliography {
  display: grid;
  gap: 0.78rem;
}

.rw-section-card--title {
  background: linear-gradient(180deg, rgba(108,88,207,.09), rgba(255,255,255,.96));
}

.rw-section-card--compact {
  padding: 16px 16px 16px 19px;
}

.rw-section-card--analysis {
  background: linear-gradient(180deg, rgba(29,37,64,.05), rgba(255,255,255,.97));
}

.rw-citation-block--hanging {
  padding: 18px 18px 18px 24px;
  background: linear-gradient(180deg, rgba(108,88,207,.07), rgba(255,255,255,.98));
}

.rw-citation-text {
  margin: 0;
  padding-left: 18px;
  text-indent: -18px;
  line-height: 1.78;
}

.rw-citation-text em {
  font-style: italic;
}

.rw-citation-text a {
  color: var(--primary-strong);
  text-decoration: none;
}

.rw-citation-text a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .rw-study-shell--flashcards .rw-flashcard-stage,
  .rw-study-shell--flashcards .rw-flashcard-panel {
    min-height: 230px;
    height: 230px;
  }

  .rw-question-head {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 640px) {
  .rw-question-card {
    padding: 16px;
  }

  .rw-question-number {
    width: 40px;
    height: 40px;
  }

  .rw-question-answer-wrap {
    padding: 13px 14px 14px;
  }
}

.tool-config-panel {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 16px 16px 17px;
  border-radius: 20px;
  border: 1px solid rgba(108, 88, 207, 0.16);
  background: linear-gradient(180deg, rgba(252, 252, 255, 0.96), rgba(244, 246, 255, 0.93));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82);
}

.tool-config-panel[hidden] {
  display: none !important;
}

.tool-config-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.tool-config-copy {
  display: grid;
  gap: 6px;
}

.tool-config-copy h4 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.tool-config-copy p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
  font-size: 13px;
  max-width: 52ch;
}

.tool-config-close-btn {
  min-height: 38px;
  padding-inline: 14px;
  border-radius: 12px;
  flex: 0 0 auto;
}

.tool-config-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.tool-config-actions .secondary-btn {
  min-height: 42px;
  padding-inline: 16px;
}

.tool-config-panel[data-tool="quiz"] {
  border-color: rgba(108, 88, 207, 0.18);
}

.tool-config-panel[data-tool="outline"] {
  border-color: rgba(203, 143, 57, 0.18);
}

.tool-config-panel[data-tool="analysis"] {
  border-color: rgba(29, 37, 64, 0.14);
}

.tool-config-panel[data-tool="citation"] {
  border-color: rgba(27, 142, 150, 0.16);
}

.rw-study-shell--quiz {
  display: grid;
  gap: 18px;
}

.rw-quiz-groups {
  display: grid;
  gap: 18px;
}

.rw-quiz-group {
  display: grid;
  gap: 12px;
}

.rw-quiz-group .rw-section-kicker {
  margin-bottom: 0;
}

.rw-quiz-question {
  position: relative;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(108, 88, 207, 0.12);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(246,247,255,.92));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82);
}

.rw-quiz-question::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 18px 0 0 18px;
  background: linear-gradient(180deg, rgba(108,88,207,.76), rgba(27,142,150,.44));
}

.rw-quiz-question-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.rw-quiz-question-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.58;
  color: var(--text);
  font-weight: 700;
}

.rw-quiz-options {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.rw-quiz-option {
  appearance: none;
  width: 100%;
  border: 1px solid rgba(108, 88, 207, 0.12);
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(248,249,255,.98), rgba(241,243,251,.94));
  text-align: left;
  padding: 13px 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), border-color 180ms var(--ease), background 180ms var(--ease);
}

.rw-quiz-option:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(108, 88, 207, 0.24);
  box-shadow: 0 16px 28px -24px rgba(37, 50, 83, 0.34);
}

.rw-quiz-option:disabled {
  cursor: default;
  opacity: 1;
}

.rw-quiz-option-label {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 10px;
  background: rgba(108, 88, 207, 0.12);
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  flex-shrink: 0;
}

.rw-quiz-option-copy {
  display: block;
  line-height: 1.56;
  color: var(--text);
  font-weight: 600;
}

.rw-quiz-option.is-correct {
  border-color: rgba(27, 142, 150, 0.28);
  background: linear-gradient(180deg, rgba(232, 249, 246, 0.98), rgba(242, 252, 249, 0.94));
}

.rw-quiz-option.is-correct .rw-quiz-option-label {
  background: rgba(27, 142, 150, 0.18);
  color: #0d6d73;
}

.rw-quiz-option.is-wrong {
  border-color: rgba(191, 73, 73, 0.28);
  background: linear-gradient(180deg, rgba(255, 241, 241, 0.98), rgba(255, 247, 247, 0.94));
}

.rw-quiz-option.is-wrong .rw-quiz-option-label {
  background: rgba(191, 73, 73, 0.16);
  color: #a33d3d;
}

.rw-quiz-feedback,
.rw-quiz-reveal-panel {
  margin-top: 14px;
  padding: 14px 15px;
  border-radius: 14px;
  border: 1px solid rgba(108, 88, 207, 0.1);
  background: linear-gradient(180deg, rgba(108,88,207,.05), rgba(255,255,255,.9));
}

.rw-quiz-feedback p,
.rw-quiz-reveal-panel p {
  margin: 0;
  line-height: 1.66;
}

.rw-quiz-feedback p + p,
.rw-quiz-reveal-panel p + p {
  margin-top: 10px;
}

.rw-quiz-answer-line {
  color: var(--muted);
}

.rw-quiz-question--reveal {
  padding: 0;
  overflow: hidden;
}

.rw-quiz-question--reveal summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
}

.rw-quiz-question--reveal summary::-webkit-details-marker {
  display: none;
}

.rw-quiz-reveal-copy {
  display: grid;
  gap: 6px;
  flex: 1;
}

.rw-quiz-reveal-hint {
  margin-left: auto;
  padding-left: 10px;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  white-space: nowrap;
}

.rw-quiz-question--reveal[open] .rw-quiz-reveal-hint {
  color: var(--accent-strong);
}

.rw-quiz-shell .rw-tool-inline-actions {
  align-items: center;
}

.rw-quiz-shell .rw-tool-inline-actions .ghost-btn {
  min-height: 38px;
  padding-inline: 14px;
}

@media (max-width: 900px) {
  .tool-config-grid--three,
  .tool-config-grid--four,
  .tool-config-grid--analysis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-setting--wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .tool-config-top {
    flex-direction: column;
    align-items: stretch;
  }

  .tool-config-grid--three,
  .tool-config-grid--four,
  .tool-config-grid--analysis,
  .tool-config-grid--single {
    grid-template-columns: minmax(0, 1fr);
  }

  .tool-config-actions {
    justify-content: stretch;
  }

  .tool-config-actions > button,
  .tool-config-close-btn {
    flex: 1 1 100%;
  }

  .rw-quiz-question-head,
  .rw-quiz-question--reveal summary {
    gap: 10px;
  }

  .rw-quiz-reveal-hint {
    white-space: normal;
    text-align: right;
  }
}


@media (max-width: 1180px) {
  .rw-insight-cluster {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .rw-insight-cluster {
    grid-template-columns: minmax(0, 1fr);
  }
}

.summary-head-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.project-sidebar-section {
  margin-top: 0.5rem;
}

.project-list {
  display: grid;
  gap: 0.8rem;
}

.project-list-entry {
  position: relative;
}

.project-item {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 0.45rem;
  padding: 0.95rem 3.1rem 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(67, 93, 164, 0.14);
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(247,249,255,0.94));
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.06);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.project-item:hover,
.project-item.active {
  transform: translateY(-1px);
  border-color: rgba(66, 104, 210, 0.32);
  box-shadow: 0 16px 32px rgba(35, 58, 120, 0.12);
  background: linear-gradient(180deg, rgba(246, 249, 255, 0.98), rgba(236, 242, 255, 0.98));
}

.project-delete-btn {
  position: absolute;
  top: 11px;
  right: 11px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(159, 36, 65, 0.14);
  background: rgba(255,255,255,0.94);
  color: #9f2441;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(20, 33, 61, 0.08);
}

.project-delete-btn:hover {
  background: rgba(159, 36, 65, 0.08);
  border-color: rgba(159, 36, 65, 0.26);
}

.project-item-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink-strong, #14213d);
}

.project-item-copy {
  color: var(--ink-soft, #58627a);
  font-size: 0.9rem;
  line-height: 1.45;
}

.project-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.empty-projects,
.empty-project-summaries,
.project-chat-empty {
  margin: 0;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  background: rgba(247, 249, 255, 0.86);
  border: 1px dashed rgba(93, 109, 157, 0.24);
  color: var(--ink-soft, #58627a);
  line-height: 1.6;
}

.project-workspace {
  display: grid;
  gap: 1.2rem;
}

.project-overview-card {
  position: relative;
  overflow: hidden;
}

.project-overview-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, rgba(80, 101, 214, 0.92), rgba(104, 140, 255, 0.55), rgba(112, 186, 255, 0.3));
}

.project-overview-head {
  align-items: flex-start;
  gap: 1rem;
}

.project-overview-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.project-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.project-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: 1.25rem;
  align-items: start;
}

.project-main,
.project-chat-side {
  min-width: 0;
  display: grid;
  gap: 1.2rem;
  align-content: start;
}

.project-toolbox-card {
  position: sticky;
  top: 92px;
  z-index: 3;
}

.project-summary-list {
  display: grid;
  gap: 1rem;
}

.project-summary-item {
  border: 1px solid rgba(63, 89, 163, 0.14);
  border-radius: 20px;
  padding: 1rem 1.05rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,250,255,0.94));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85), 0 14px 28px rgba(20, 33, 61, 0.05);
  display: grid;
  gap: 0.8rem;
}

.project-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.project-summary-head h4 {
  margin: 0.12rem 0 0;
  font-size: 1.02rem;
  color: var(--ink-strong, #14213d);
}

.project-summary-kicker {
  margin: 0;
  color: rgba(66, 87, 154, 0.84);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

.project-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.project-summary-copy {
  margin: 0;
  color: var(--ink-soft, #58627a);
  line-height: 1.6;
}

.project-summary-meta,
.project-summary-submeta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  color: rgba(73, 82, 109, 0.88);
}

.project-summary-submeta {
  font-size: 0.86rem;
  font-weight: 600;
}

.danger-ghost-btn {
  color: #9f2441;
  border-color: rgba(159, 36, 65, 0.18);
}

.danger-ghost-btn:hover {
  background: rgba(159, 36, 65, 0.07);
  border-color: rgba(159, 36, 65, 0.28);
}

.project-chat-card {
  min-height: 620px;
  display: grid;
  grid-template-rows: auto auto minmax(260px, 1fr) auto;
  gap: 0.95rem;
}

.project-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.project-chat-suggestion {
  border-radius: 999px;
  border: 1px solid rgba(74, 103, 191, 0.18);
  background: rgba(247, 249, 255, 0.9);
  color: #2a3c74;
  padding: 0.52rem 0.82rem;
  font-size: 0.85rem;
  font-weight: 600;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.project-chat-suggestion:hover {
  border-color: rgba(74, 103, 191, 0.34);
  background: rgba(236, 242, 255, 0.98);
  transform: translateY(-1px);
}

.project-chat-log {
  min-height: 280px;
  max-height: 68vh;
  overflow: auto;
  display: grid;
  gap: 0.85rem;
  padding: 0.25rem 0.1rem 0.1rem;
}

.project-chat-message {
  display: grid;
  gap: 0.45rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(67, 93, 164, 0.12);
  background: rgba(248, 250, 255, 0.92);
}

.project-chat-message--user {
  background: linear-gradient(180deg, rgba(244, 247, 255, 0.98), rgba(231, 239, 255, 0.98));
  border-color: rgba(77, 105, 199, 0.2);
}

.project-chat-message--assistant {
  background: rgba(255, 255, 255, 0.97);
}

.project-chat-message.is-pending {
  border-style: dashed;
}

.project-chat-message-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(66, 87, 154, 0.82);
}

.project-chat-message-body {
  color: #29344f;
  line-height: 1.62;
}

.project-chat-message-body p,
.project-chat-message-body ul,
.project-chat-message-body ol,
.project-chat-message-body h4,
.project-chat-message-body pre {
  margin: 0;
}

.project-chat-message-body p + p,
.project-chat-message-body p + ul,
.project-chat-message-body p + ol,
.project-chat-message-body ul + p,
.project-chat-message-body ol + p,
.project-chat-message-body h4 + p,
.project-chat-message-body h4 + ul,
.project-chat-message-body h4 + ol,
.project-chat-message-body ul + h4,
.project-chat-message-body ol + h4 {
  margin-top: 0.55rem;
}

.project-chat-message-body ul,
.project-chat-message-body ol {
  padding-left: 1.35rem;
  display: grid;
  gap: 0.45rem;
}

.project-chat-message-body li {
  padding-left: 0.1rem;
}

.project-chat-heading,
.project-chat-message-body h4 {
  font-size: 0.97rem;
  line-height: 1.35;
  font-weight: 800;
  color: #182545;
  text-decoration-line: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.17em;
  text-decoration-color: rgba(86, 69, 184, 0.35);
}

.project-chat-message-body strong {
  color: #14213d;
  font-weight: 800;
}

.project-chat-message-body em {
  color: #3a4668;
}

.project-chat-message-body code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88em;
  padding: 0.08rem 0.32rem;
  border-radius: 999px;
  background: rgba(86, 69, 184, 0.09);
  color: #3c2f8f;
}

.project-chat-message-body a {
  color: var(--primary-strong);
  text-decoration: underline;
  text-decoration-color: rgba(85, 66, 184, 0.28);
}

.project-chat-form {
  display: grid;
  gap: 0.7rem;
}

.project-chat-input {
  min-height: 108px;
  resize: vertical;
}

.project-chat-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.summary-chat-card {
  min-height: 540px;
}

.summary-chat-log {
  min-height: 220px;
}

.launch-choice-modal-card {
  width: min(100%, 760px);
}

.launch-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.launch-choice-card {
  appearance: none;
  border: 1px solid rgba(74, 103, 191, 0.16);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(248, 250, 255, 0.98), rgba(255, 255, 255, 0.98));
  color: inherit;
  padding: 1.15rem;
  display: grid;
  gap: 0.55rem;
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.launch-choice-card strong {
  font-size: 1.02rem;
  color: #182545;
}

.launch-choice-card span:last-child {
  color: var(--muted);
  line-height: 1.6;
}

.launch-choice-card:hover,
.launch-choice-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(74, 103, 191, 0.32);
  box-shadow: 0 16px 34px rgba(32, 48, 88, 0.12);
  background: linear-gradient(180deg, rgba(241, 246, 255, 0.98), rgba(255, 255, 255, 0.98));
}

.launch-choice-card--assignment {
  border-color: rgba(108, 88, 207, 0.2);
  background: linear-gradient(180deg, rgba(244, 240, 255, 0.96), rgba(255, 255, 255, 0.98));
}

.launch-choice-kicker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 0.38rem 0.58rem;
  border-radius: 999px;
  background: rgba(108, 88, 207, 0.1);
  color: var(--primary-strong);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}


.modal-shell[hidden],
.modal-panel[hidden] {
  display: none !important;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, 0.42);
  backdrop-filter: blur(9px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 640px);
  border-radius: 24px;
  padding: 1.25rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,249,255,0.98));
  border: 1px solid rgba(64, 88, 160, 0.14);
  box-shadow: 0 28px 70px rgba(16, 24, 40, 0.24);
  display: grid;
  gap: 1rem;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.modal-mode-row {
  display: flex;
  gap: 0.65rem;
}

.modal-panel {
  display: grid;
  gap: 0.7rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.generation-shell {
  z-index: 72;
  align-items: center;
}

.generation-backdrop {
  background: rgba(16, 24, 40, 0.34);
  backdrop-filter: blur(10px);
}

.generation-card {
  width: min(100%, 620px);
  gap: 1.1rem;
  padding: 1.3rem;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.24), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(244,247,255,0.98));
}

.generation-card[data-state="working"] {
  border-color: rgba(74, 103, 191, 0.18);
  box-shadow: 0 30px 70px rgba(20, 28, 46, 0.22);
}

.generation-card[data-state="success"] {
  border-color: rgba(42, 142, 97, 0.2);
}

.generation-card[data-state="error"],
.generation-card[data-state="cancelled"] {
  border-color: rgba(165, 74, 74, 0.18);
}

.generation-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.generation-context-pill {
  border-color: rgba(74, 103, 191, 0.18);
  background: rgba(247, 249, 255, 0.92);
}

.generation-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.72rem;
  border-radius: 999px;
  background: rgba(70, 94, 181, 0.1);
  color: #33437b;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.generation-live-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: generation-pulse 1.35s ease-in-out infinite;
}

.generation-live-pill[data-state="success"] {
  background: rgba(42, 142, 97, 0.12);
  color: #24794f;
}

.generation-live-pill[data-state="error"],
.generation-live-pill[data-state="cancelled"] {
  background: rgba(165, 74, 74, 0.12);
  color: #8c2f48;
}

.generation-head {
  display: grid;
  gap: 0.38rem;
}

.generation-copy {
  margin: 0;
}

.generation-stage-panel {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid rgba(74, 103, 191, 0.12);
  background: linear-gradient(180deg, rgba(248, 250, 255, 0.98), rgba(255, 255, 255, 0.98));
}

.generation-stage-kicker {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(66, 87, 154, 0.82);
}

.generation-stage-panel h4 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.35;
  color: #182545;
}

.generation-activity-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(82, 103, 186, 0.12);
  overflow: hidden;
}

.generation-activity-bar {
  position: absolute;
  inset: 0 auto 0 -24%;
  width: 34%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(86, 69, 184, 0.12), rgba(86, 69, 184, 0.7), rgba(74, 103, 191, 0.12));
  animation: generation-slide 1.45s ease-in-out infinite;
}

.generation-stage-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.generation-stage-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.48rem 0.72rem;
  border-radius: 999px;
  background: rgba(74, 103, 191, 0.08);
  color: rgba(42, 60, 116, 0.84);
  font-size: 0.81rem;
  font-weight: 700;
}

.generation-stage-chip.is-active {
  background: rgba(74, 103, 191, 0.16);
  color: #223165;
}

.generation-stage-chip.is-complete {
  background: rgba(42, 142, 97, 0.12);
  color: #24794f;
}

.generation-skeleton {
  display: grid;
  gap: 0.65rem;
}

.generation-skeleton-line {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(228, 233, 248, 0.82), rgba(242, 245, 255, 1), rgba(228, 233, 248, 0.82));
  background-size: 220% 100%;
  animation: generation-shimmer 1.45s linear infinite;
}

.generation-skeleton-line.is-long {
  width: 92%;
}

.generation-skeleton-line.is-short {
  width: 56%;
}

.generation-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.generation-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

body.has-generation-open {
  overflow: hidden;
}

@keyframes generation-slide {
  0% { transform: translateX(0); }
  100% { transform: translateX(340%); }
}

@keyframes generation-pulse {
  0%, 100% { opacity: 0.5; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.08); }
}

@keyframes generation-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -20% 0; }
}

body.has-modal-open {
  overflow: hidden;
}

.rw-project-bibliography {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.9rem;
}

.rw-project-bibliography li {
  padding-left: 0.15rem;
}

.rw-project-bibliography-title {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(66, 87, 154, 0.82);
  margin-bottom: 0.35rem;
}

body[data-app-view="project"] .main-stage {
  gap: 1rem;
}

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

  .project-toolbox-card {
    position: static;
  }

  .project-chat-card {
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .project-summary-head,
  .modal-head,
  .project-overview-head {
    flex-direction: column;
    align-items: stretch;
  }

  .project-summary-actions,
  .project-overview-actions,
  .project-chat-actions,
  .modal-actions {
    justify-content: flex-start;
  }

  .modal-card {
    padding: 1rem;
    border-radius: 20px;
  }
}

.export-modal-card {
  width: min(100%, 680px);
}

.export-format-panel {
  gap: 0.9rem;
}

.export-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.export-choice-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  border: 1px solid rgba(90, 76, 186, 0.16);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
  cursor: pointer;
}

.export-choice-card input {
  width: 18px;
  height: 18px;
  margin-top: 0.15rem;
  accent-color: var(--primary-strong);
}

.export-choice-body {
  display: grid;
  gap: 0.22rem;
}

.export-choice-body strong {
  font-size: 1rem;
  color: var(--text-strong);
}

.export-choice-body span {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.export-help-copy {
  margin: 0;
}

.export-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 0.85rem;
  align-items: flex-start;
}

.export-progress-track {
  margin-top: 0.1rem;
}

.export-progress-bar {
  transition: width 180ms ease;
}

@media (max-width: 720px) {
  .export-choice-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Polish pass overrides --- */
.sidebar-storage-note {
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(243,241,255,0.74));
}

.sidebar-storage-note p {
  font-size: 13px;
  line-height: 1.7;
}

.result-subcopy {
  max-width: 68ch;
}

.recent-entry + .recent-entry,
.project-list-entry + .project-list-entry {
  margin-top: 10px;
}

.tool-btn,
.project-tool-btn {
  align-items: flex-start;
  gap: 4px;
  min-height: 88px;
}

.tool-btn-label,
.project-tool-btn-label {
  display: block;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.tool-btn-copy,
.project-tool-btn-copy {
  display: block;
  color: var(--muted);
  font-size: 12.75px;
  line-height: 1.55;
}

.tool-placeholder-card[hidden],
.project-tool-placeholder-card[hidden] {
  display: none !important;
}

.tool-placeholder-card:not([hidden]),
.project-tool-placeholder-card:not([hidden]) {
  display: block !important;
  padding: 0;
  overflow: hidden;
}

.rw-next-step-card {
  display: grid;
  gap: 16px;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,248,255,0.96)),
    linear-gradient(135deg, rgba(108,88,207,0.06), rgba(27,142,150,0.04));
}

.rw-next-step-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.rw-next-step-kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-strong);
}

.rw-next-step-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rw-next-step-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.rw-next-step-copy,
.rw-next-step-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.rw-next-step-action {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(108, 88, 207, 0.12);
  border-radius: 18px;
  padding: 16px 16px 15px;
  background: rgba(255,255,255,0.88);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease), background var(--ease);
}

.rw-next-step-action:hover {
  transform: translateY(-1px);
  border-color: rgba(108, 88, 207, 0.24);
  box-shadow: 0 14px 28px rgba(22, 31, 69, 0.08);
  background: rgba(255,255,255,0.98);
}

.rw-next-step-action strong {
  display: block;
  margin-bottom: 6px;
  color: var(--panel-ink);
  font-size: 15px;
  letter-spacing: -0.01em;
}

.rw-next-step-action span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.rw-empty-panel {
  display: grid;
  gap: 12px;
  padding: 18px 18px 16px;
  border: 1px dashed rgba(108, 88, 207, 0.18);
  border-radius: 18px;
  background: rgba(247, 248, 255, 0.78);
}

.rw-empty-panel--compact {
  gap: 8px;
  padding: 14px 14px 13px;
}

.rw-empty-panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--panel-ink);
}

.rw-empty-panel-copy,
.rw-empty-panel-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 13.5px;
}

.rw-empty-panel-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  display: grid;
  gap: 6px;
}

.rw-empty-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.empty-recent,
.empty-projects,
.empty-project-summaries,
.project-chat-empty {
  color: inherit;
}

.project-item-copy {
  line-height: 1.6;
}

.project-summary-item {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,249,255,0.94));
}

.project-chat-message {
  box-shadow: 0 12px 28px rgba(22, 31, 69, 0.05);
}

@media (max-width: 900px) {
  .rw-next-step-grid {
    grid-template-columns: 1fr;
  }
}



/* ===== Workflow and layout refinement pass ===== */
.summary-project-context-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(60, 94, 164, 0.14);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(60, 94, 164, 0.08), rgba(20, 144, 156, 0.05) 48%, rgba(255, 255, 255, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.summary-project-context-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.summary-project-context-copy-block {
  display: grid;
  gap: 6px;
}

.summary-project-context-copy-block h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.16;
  color: var(--panel-ink);
}

.summary-project-context-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-self: center;
}

.summary-project-context-actions .ghost-btn,
.summary-project-context-actions .secondary-btn {
  min-height: 42px;
  white-space: nowrap;
}

.summary-project-context-meta {
  gap: 8px;
  flex-wrap: wrap;
}

.summary-save-panel {

  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(108, 88, 207, 0.14);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(108, 88, 207, 0.07), rgba(27, 142, 150, 0.04) 48%, rgba(255,255,255,0.96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
}

.summary-save-copy {
  display: grid;
  gap: 6px;
  align-content: start;
}

.summary-save-copy h4 {
  margin: 0;
  font-size: 19px;
  line-height: 1.18;
  color: var(--panel-ink);
}

.summary-save-copy p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.62;
}

.summary-save-controls {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
}

.summary-save-action-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
  gap: 10px;
  align-items: stretch;
}

.summary-save-action-row .primary-btn,
.summary-save-action-row .secondary-btn,
.summary-save-action-row .ghost-btn {
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: 12px;
  white-space: normal;
  text-align: center;
  line-height: 1.24;
}

.summary-save-action-row .select-input {
  grid-column: 1 / -1;
  min-width: 0;
  min-height: 44px;
}

.toolbox-card,
.project-toolbox-card {
  position: static;
  top: auto;
  box-shadow: 0 18px 36px -28px rgba(29, 37, 64, 0.28);
}

.toolbox-head,
.toolbox-head--compact {
  margin-bottom: 12px;
}

.toolbox-head h3,
.toolbox-head--compact h3 {
  font-size: 22px;
  line-height: 1.14;
}

.toolbox-head .result-subcopy,
.toolbox-head--compact .result-subcopy {
  max-width: 44ch;
  font-size: 12.5px;
  line-height: 1.52;
}

.toolbox-card .tool-button-grid,
.project-toolbox-card .tool-button-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tool-btn,
.project-tool-btn {
  align-items: flex-start;
  gap: 8px;
  min-height: 70px;
  padding: 11px 12px;
  border-radius: 16px;
}

.tool-btn::before,
.project-tool-btn::before {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-size: 12px;
}

.tool-btn-label,
.project-tool-btn-label {
  display: block;
  font-size: 13.25px;
  line-height: 1.28;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.tool-btn-copy,
.project-tool-btn-copy {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.6px;
  line-height: 1.42;
}

.tool-config-panel {
  margin-top: 12px;
  gap: 12px;
}

.tool-config-top {
  gap: 10px;
}

.tool-config-copy p,
.tool-config-copy h4 {
  margin: 0;
}

.tool-config-copy h4 {
  font-size: 18px;
  line-height: 1.22;
}

.tool-config-copy p:last-child {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.56;
}

#toolbox-card,
#project-toolbox-card,
#project-chat-card,
#project-summary-list-card,
#project-source-entry-card,
#project-overview-card {
  scroll-margin-top: 92px;
}

.project-grid {
  grid-template-columns: minmax(0, 1.08fr) minmax(290px, 0.84fr);
  gap: 1rem;
}

.project-main,
.project-chat-side {
  gap: 1rem;
}

.project-source-entry-card,
.project-summary-list-card,
.project-chat-card,
.project-toolbox-card {
  padding: 16px;
}

.project-source-entry-card .result-head,
.project-summary-list-card .result-head,
.project-chat-card .result-head,
.project-toolbox-card .result-head {
  margin-bottom: 12px;
}

.project-source-entry-card .result-head h3,
.project-summary-list-card .result-head h3,
.project-chat-card .result-head h3,
.project-toolbox-card .result-head h3 {
  font-size: 21px;
}

.project-source-entry-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.project-source-toggle-btn {
  flex-shrink: 0;
}

.project-source-collapsed-copy {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(247, 248, 255, 0.88);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.58;
}

.project-inline-source-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.project-inline-source-panel[hidden] {
  display: none !important;
}

.compact-source-tabs {
  gap: 8px;
}

.compact-source-tabs .source-tab {
  min-height: 38px;
  padding: 9px 12px;
  font-size: 12px;
}

.compact-source-panel {
  padding: 12px;
  border-radius: 16px;
}

.compact-source-panel .field-label {
  margin-bottom: 8px;
}

.compact-dropzone {
  padding: 18px 16px;
  gap: 6px;
  border-radius: 16px;
}

.compact-dropzone .dropzone-title {
  font-size: 14px;
}

.compact-dropzone .dropzone-copy {
  font-size: 12px;
  line-height: 1.5;
}

.compact-row {
  gap: 10px;
  align-items: end;
}

.project-inline-source-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.project-option-card {
  min-height: 0;
  padding: 12px;
  border-radius: 16px;
}

.project-option-card .field-help {
  margin-top: 4px;
  font-size: 11.8px;
  line-height: 1.45;
}

.project-option-card .pill-row {
  gap: 6px;
}

.project-option-card .pill-btn {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 11.5px;
}

.project-inline-source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-inline-source-actions .primary-btn,
.project-inline-source-actions .ghost-btn {
  min-height: 42px;
}

.project-source-status-card,
.project-source-success {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(108, 88, 207, 0.14);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(247, 248, 255, 0.96), rgba(255,255,255,0.96));
}

.project-source-status-card[data-tone="success"] {
  border-color: rgba(35, 129, 95, 0.22);
  background: linear-gradient(180deg, rgba(225, 249, 239, 0.92), rgba(255,255,255,0.98));
}

.project-source-status-card[data-tone="warning"] {
  border-color: rgba(203, 143, 57, 0.26);
  background: linear-gradient(180deg, rgba(255, 247, 229, 0.98), rgba(255,255,255,0.98));
}

.project-source-status-card[data-tone="error"] {
  border-color: rgba(177, 48, 81, 0.22);
  background: linear-gradient(180deg, rgba(255, 241, 245, 0.98), rgba(255,255,255,0.98));
}

.project-source-status-meta,
.project-source-success-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.project-source-status-detail,
.project-source-success-copy {
  margin: 0;
  color: var(--muted);
  font-size: 12.4px;
  line-height: 1.56;
}

.compact-progress-track {
  height: 9px;
}

.project-summary-list {
  gap: 0.85rem;
}

.project-summary-item {
  gap: 0.7rem;
  padding: 0.9rem 0.95rem;
  border-radius: 18px;
}

.project-summary-head {
  gap: 0.8rem;
}

.project-summary-head h4 {
  font-size: 0.98rem;
  line-height: 1.3;
}

.project-summary-actions {
  gap: 0.45rem;
}

.project-summary-copy {
  font-size: 13px;
  line-height: 1.58;
}

.project-chat-card {
  min-height: 0;
  grid-template-rows: auto auto minmax(240px, 1fr) auto;
  gap: 0.85rem;
}

.project-chat-suggestions {
  gap: 0.45rem;
}

.project-chat-suggestion {
  padding: 0.46rem 0.74rem;
  font-size: 0.8rem;
}

.project-chat-log {
  min-height: 240px;
  max-height: 58vh;
  gap: 0.72rem;
}

.project-chat-message {
  gap: 0.35rem;
  padding: 0.82rem 0.9rem;
  border-radius: 16px;
}

.project-chat-input {
  min-height: 94px;
}

@media (min-width: 1500px) and (min-height: 900px) {
  .workspace-side .toolbox-card {
    position: sticky;
    top: 82px;
  }
}

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

  .project-chat-side {
    grid-template-columns: 1fr;
  }
}

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

  .workspace-side {
    gap: 14px;
  }
}

@media (max-width: 1480px) {
  .summary-save-panel {
    grid-template-columns: 1fr;
  }
}

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

  .project-inline-source-options {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 960px) {
  .summary-project-context-head,
  .summary-project-context-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .summary-save-action-row {
    grid-template-columns: 1fr;
  }

  .toolbox-card .tool-button-grid,
  .project-toolbox-card .tool-button-grid {
    grid-template-columns: 1fr;
  }

  .project-inline-source-options {
    grid-template-columns: 1fr;
  }

  .project-source-entry-head,
  .project-source-status-meta,
  .project-source-success-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-height: 860px) {
  .topbar {
    position: static;
  }

  .workspace-side .toolbox-card,
  .project-toolbox-card {
    position: static;
  }

  #toolbox-card,
  #project-toolbox-card,
  #project-chat-card,
  #project-summary-list-card,
  #project-source-entry-card,
  #project-overview-card,
  #assignment-overview-card,
  #assignment-intake-card,
  #assignment-final-card,
  #assignment-build-card,
  #assignment-status-card,
  #assignment-materials-card,
  #assignment-source-entry-card {
    scroll-margin-top: 26px;
  }
}


/* Assignments */

.workspace-mode-shell[hidden] {
  display: none !important;
}

body[data-workspace-mode="landing"] .sidebar-overview,
body[data-workspace-mode="landing"] .sidebar-start-card {
  display: none;
}

body[data-workspace-mode="landing"] #server-status-copy,
body[data-workspace-mode="landing"] .project-sidebar-section .sidebar-copy,
body[data-workspace-mode="landing"] .assignment-sidebar-section .sidebar-copy,
body[data-workspace-mode="landing"] .sidebar-storage-note .sidebar-copy {
  display: none;
}

body[data-workspace-mode="landing"] .workflow-hub-card {
  margin-top: 4px;
}

body[data-workspace-mode="landing"] .sidebar-section {
  padding: 14px;
}

.workflow-hub-card,
.assignment-workspace,
.project-assignment-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
}

.workflow-hub-card::before,
.assignment-workspace::before,
.project-assignment-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border-top: 1px solid rgba(255,255,255,.65);
  pointer-events: none;
}

.workflow-hub-card {
  margin: 0 0 24px;
  padding: 22px 24px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.98), rgba(245,247,255,.92)),
    linear-gradient(180deg, rgba(108, 88, 207, 0.08), transparent 62%);
}

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

.workflow-hub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.workflow-spotlight-card {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(108, 88, 207, 0.12);
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(247,248,255,.94));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.workflow-spotlight-card[role="button"] {
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.workflow-spotlight-card[role="button"]:hover,
.workflow-spotlight-card[role="button"]:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(108, 88, 207, 0.28);
  box-shadow: 0 16px 34px rgba(50, 58, 110, 0.12), inset 0 1px 0 rgba(255,255,255,.75);
  outline: none;
}

.workflow-spotlight-card--assignment {
  background:
    linear-gradient(145deg, rgba(108,88,207,.10), rgba(255,255,255,.96)),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(244,241,255,.94));
  border-color: rgba(108, 88, 207, 0.22);
}

.workflow-spotlight-card h4,
.assignment-output-section h4,
.assignment-material-item h4,
.assignment-relevant-material h5,
.assignment-working-section h5,
.project-assignment-item-title,
.assignment-list-empty-title {
  margin: 0 0 8px;
}

.workflow-spotlight-card p,
.project-assignment-item-copy,
.assignment-material-copy,
.assignment-output-empty,
.assignment-working-purpose,
.assignment-list-empty-copy,
.assignment-status-note span,
.assignment-material-origin,
.assignment-overview-copy,
.assignment-missing-item p {
  color: var(--muted);
  line-height: 1.62;
}

.assignment-sidebar-section .sidebar-copy {
  margin-bottom: 14px;
}

.assignment-list {
  display: grid;
  gap: 12px;
}

.assignment-sidebar-item {
  position: relative;
}

.assignment-sidebar-button {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(108, 88, 207, 0.12);
  background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(247,248,255,.93));
  color: var(--text);
  text-align: left;
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.assignment-sidebar-button:hover {
  transform: translateY(-1px);
  border-color: rgba(108, 88, 207, 0.28);
  box-shadow: 0 12px 22px rgba(22, 31, 69, 0.08);
}

.assignment-sidebar-button.active {
  border-color: rgba(108, 88, 207, 0.34);
  background: linear-gradient(135deg, rgba(108,88,207,.16), rgba(255,255,255,.96));
}

.assignment-sidebar-kicker {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--primary-strong);
}

.assignment-sidebar-title {
  font-weight: 700;
}

.assignment-sidebar-subtitle {
  font-size: 13px;
  color: var(--muted);
}

.assignment-sidebar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.assignment-list-empty {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(108, 88, 207, 0.18);
  background: linear-gradient(180deg, rgba(248,249,255,.96), rgba(243,245,252,.95));
}

.assignment-list-empty-btn {
  margin-top: 10px;
}

.project-assignment-card {
  padding: 18px;
  margin-bottom: 20px;
}

.project-assignment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.project-assignment-list {
  display: grid;
  gap: 12px;
}

.project-assignment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(108, 88, 207, 0.12);
  background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(246,248,255,.94));
}

.assignment-workspace {
  padding: 24px;
  margin-top: 0;
  background:
    linear-gradient(145deg, rgba(255,255,255,.98), rgba(246,248,255,.92)),
    linear-gradient(180deg, rgba(108, 88, 207, 0.08), transparent 62%);
}

.assignment-overview-card {
  margin-bottom: 20px;
}

.assignment-overview-actions,
.assignment-intake-actions,
.assignment-project-actions,
.assignment-material-actions,
.assignment-source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.assignment-meta-row {
  margin-top: 16px;
}

.assignment-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr);
  gap: 20px;
}

.assignment-main,
.assignment-side {
  display: grid;
  gap: 20px;
}

.assignment-intake-card,
.assignment-build-card,
.assignment-status-card,
.assignment-materials-card,
.assignment-source-entry-card {
  padding: 20px;
}

#assignment-overview-card,
#assignment-intake-card,
#assignment-final-card,
#assignment-build-card,
#assignment-status-card,
#assignment-materials-card,
#assignment-source-entry-card {
  scroll-margin-top: 92px;
}

.assignment-form-grid {
  display: grid;
  grid-template-columns: 1.1fr .75fr;
  gap: 16px;
  margin-bottom: 16px;
}

.assignment-start-guide {
  display: grid;
  gap: 14px;
  margin: 0 0 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(108, 88, 207, 0.16);
  background: linear-gradient(145deg, rgba(240, 236, 255, 0.72), rgba(255,255,255,0.98));
}

.assignment-start-guide-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.assignment-start-guide-head h4,
.assignment-guide-step h5 {
  margin: 0;
}

.assignment-start-guide-copy {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.62;
}

.assignment-start-guide-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.assignment-guide-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(108, 88, 207, 0.12);
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
}

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

.assignment-guide-step {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(108, 88, 207, 0.12);
  background: rgba(255,255,255,0.82);
  display: grid;
  gap: 6px;
}

.assignment-guide-step-number {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(108, 88, 207, 0.12);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 800;
}

.assignment-guide-step p,
.assignment-next-path-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.assignment-guide-step p strong,
.assignment-next-path-copy strong {
  color: var(--text);
}

.assignment-next-path {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(27, 142, 150, 0.18);
  background: linear-gradient(180deg, rgba(239, 251, 252, 0.95), rgba(255,255,255,0.98));
}

.assignment-start-guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.assignment-start-guide-actions .ghost-btn,
.assignment-start-guide-actions .secondary-btn,
.assignment-start-guide-actions .primary-btn {
  min-height: 40px;
}

.assignment-build-card {
  position: relative;
}

.assignment-build-card::after {
  content: "";
  position: absolute;
  inset: auto 18px 0 auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108, 88, 207, 0.08), transparent 66%);
  pointer-events: none;
}

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

.assignment-textarea {
  min-height: 136px;
  resize: vertical;
}

.assignment-textarea--lg {
  min-height: 220px;
}

.assignment-autosave-copy {
  margin: 14px 0 0;
}

.assignment-intake-next {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(74, 103, 191, 0.16);
  background: linear-gradient(180deg, rgba(247, 249, 255, 0.96), rgba(255, 255, 255, 0.98));
}

.assignment-intake-next-copy {
  display: grid;
  gap: 6px;
}

.assignment-intake-next-eyebrow {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(66, 87, 154, 0.82);
}

.assignment-intake-next-copy h4,
.assignment-intake-next-copy p {
  margin: 0;
}

.assignment-intake-next-copy p {
  color: var(--muted);
  line-height: 1.58;
}

.assignment-intake-next-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.assignment-status-head {
  align-items: flex-start;
}

.assignment-status-pill {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px solid rgba(108, 88, 207, 0.12);
  background: rgba(108, 88, 207, 0.08);
  color: var(--primary-strong);
}

.assignment-status-pill[data-tone="warning"] {
  background: rgba(203, 143, 57, 0.12);
  border-color: rgba(203, 143, 57, 0.24);
  color: #8b5a08;
}

.assignment-status-pill[data-tone="success"] {
  background: rgba(25, 129, 95, 0.12);
  border-color: rgba(25, 129, 95, 0.22);
  color: #0f6a4c;
}

.assignment-status-pill[data-tone="info"] {
  background: rgba(27, 142, 150, 0.11);
  border-color: rgba(27, 142, 150, 0.22);
  color: #0e7378;
}

.assignment-status-list {
  display: grid;
  gap: 12px;
  margin: 16px 0 18px;
}

.assignment-status-note {
  padding: 14px 15px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(108, 88, 207, 0.12);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,248,255,.94));
  display: grid;
  gap: 5px;
}

.assignment-status-note strong {
  font-size: 13px;
}

.assignment-status-note--warn {
  border-color: rgba(203, 143, 57, 0.18);
  background: linear-gradient(180deg, rgba(255,251,244,.96), rgba(255,247,234,.94));
}

.assignment-status-note--good {
  border-color: rgba(25, 129, 95, 0.18);
  background: linear-gradient(180deg, rgba(244,255,250,.96), rgba(235,249,243,.94));
}

.assignment-project-linker {
  padding-top: 6px;
  border-top: 1px solid rgba(108, 88, 207, 0.08);
}

.assignment-project-actions {
  margin-top: 10px;
}

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

.assignment-material-item,
.assignment-output-section,
.assignment-relevant-material,
.assignment-working-section {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(108, 88, 207, 0.12);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,248,255,.94));
}

.assignment-material-head,
.assignment-working-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.assignment-material-origin {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 0;
}

.assignment-output-shell {
  display: grid;
  gap: 16px;
}

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

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

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

.assignment-snapshot-grid article {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(108, 88, 207, 0.08);
  display: grid;
  gap: 5px;
}

.assignment-snapshot-grid strong {
  font-size: 13px;
  line-height: 1.45;
}

.assignment-output-section h4 {
  font-size: 18px;
}

.assignment-output-good {
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(244,255,250,.96), rgba(235,249,243,.94));
  border: 1px solid rgba(25, 129, 95, 0.18);
  color: #0f6a4c;
  line-height: 1.58;
}

.assignment-review-shell {
  gap: 18px;
}

.assignment-grade-hero {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  border-color: rgba(27, 142, 150, 0.18);
  background: linear-gradient(180deg, rgba(239,251,252,.95), rgba(255,255,255,.98));
}

.assignment-grade-score-wrap {
  display: grid;
  justify-items: start;
  gap: 10px;
}

.assignment-grade-score {
  font-size: clamp(44px, 6vw, 64px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
  color: var(--primary-strong);
}

.assignment-grade-meta {
  display: grid;
  gap: 8px;
}

.assignment-grade-meta h4,
.assignment-grade-meta p {
  margin: 0;
}

.assignment-grade-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.assignment-missing-list {
  display: grid;
  gap: 12px;
}

.assignment-missing-item strong,
.assignment-inline-block h5,
.assignment-starter-draft h5,
.assignment-relevant-material h5 {
  display: block;
  margin-bottom: 6px;
}

.assignment-missing-action {
  color: var(--primary-strong);
  font-weight: 600;
}

.assignment-inline-block + .assignment-inline-block {
  margin-top: 14px;
}

.assignment-relevant-materials-grid {
  display: grid;
  gap: 12px;
}

.assignment-working-structure {
  display: grid;
  gap: 12px;
}

.assignment-working-section-head h5 {
  margin: 0;
}

.assignment-evidence-needs {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(108, 88, 207, 0.14);
}

.assignment-evidence-needs span {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.assignment-starter-draft {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(108, 88, 207, 0.14);
}

.assignment-starter-draft p {
  margin: 0 0 10px;
  line-height: 1.66;
}

.assignment-source-entry-head {
  margin-bottom: 16px;
}

.assignment-inline-source-options {
  margin: 14px 0 16px;
}

.assignment-source-success .project-source-success-actions {
  margin-top: 10px;
}

@media (max-width: 1360px) {
  .assignment-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .assignment-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .assignment-source-entry-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 960px) {
  .workflow-hub-grid,
  .assignment-output-grid,
  .assignment-output-grid--double,
  .assignment-form-grid,
  .assignment-form-grid--notes,
  .assignment-side,
  .assignment-snapshot-grid,
  .assignment-guide-step-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .workflow-hub-head,
  .assignment-material-head,
  .assignment-working-section-head,
  .assignment-overview-head,
  .assignment-start-guide-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .assignment-start-guide-badges {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .assignment-workspace {
    padding: 18px;
  }

  .assignment-intake-card,
  .assignment-build-card,
  .assignment-status-card,
  .assignment-materials-card,
  .assignment-source-entry-card,
  .project-assignment-card {
    padding: 16px;
  }

  .workflow-hub-card {
    padding: 18px;
  }

  .workflow-hub-actions,
  .assignment-overview-actions,
  .assignment-intake-actions,
  .project-assignment-actions,
  .assignment-project-actions,
  .assignment-material-actions,
  .assignment-start-guide-actions {
    width: 100%;
  }

  .workflow-hub-actions > *,
  .assignment-overview-actions > *,
  .assignment-intake-actions > *,
  .project-assignment-actions > *,
  .assignment-project-actions > *,
  .assignment-material-actions > *,
  .assignment-start-guide-actions > * {
    flex: 1 1 100%;
  }
}


.assignment-guide-step-grid--five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.assignment-output-actions {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(108, 88, 207, 0.12);
  background: linear-gradient(180deg, rgba(245, 244, 255, 0.98), rgba(255,255,255,0.98));
}

.assignment-output-actions-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.assignment-output-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.assignment-output-actions-row > * {
  min-height: 40px;
}

.assignment-final-card {
  position: relative;
}

.assignment-final-card::after {
  content: "";
  position: absolute;
  inset: auto auto 14px 18px;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(27, 142, 150, 0.08), transparent 68%);
  pointer-events: none;
}

.assignment-final-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 14px;
}

.assignment-final-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 8px;
}

.assignment-final-actions > * {
  min-height: 42px;
}

.assignment-final-empty {
  margin: 14px 0;
}

.assignment-final-editor {
  min-height: 520px;
  resize: vertical;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  line-height: 1.68;
}

.assignment-final-editor:disabled {
  background: rgba(245, 246, 252, 0.92);
  color: var(--muted);
}

.assignment-final-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.assignment-final-note,
.assignment-final-review {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(108, 88, 207, 0.12);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,248,255,.94));
}

.assignment-final-note p:last-child,
.assignment-final-review p:last-child {
  margin-bottom: 0;
}

.assignment-final-presentation-slot {
  display: grid;
  gap: 0;
}

.assignment-final-editor-shell {
  position: relative;
}

body[data-assignment-mode="presentation"] .assignment-presentation-settings {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 22px;
  border: 1px solid rgba(96, 109, 225, 0.14);
  background: radial-gradient(circle at top right, rgba(79, 70, 229, 0.12), transparent 34%), linear-gradient(180deg, rgba(249, 250, 255, 0.98), rgba(255, 255, 255, 0.98));
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.06);
}

body[data-assignment-mode="presentation"] .assignment-presentation-settings-grid > .field-group,
body[data-assignment-mode="presentation"] .assignment-presentation-custom-grid > .field-group {
  padding: 14px 15px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

body[data-assignment-mode="presentation"] #assignment-prompt-input,
body[data-assignment-mode="presentation"] #assignment-final-instructions-input {
  border-radius: 20px;
  border-color: rgba(99, 102, 241, 0.18);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.03);
}

body[data-assignment-mode="presentation"] .assignment-final-card {
  overflow: hidden;
}

body[data-assignment-mode="presentation"] .assignment-final-card::after {
  inset: auto auto -14px -8px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.12), transparent 68%);
}

.assignment-final-card--presentation .result-head {
  align-items: flex-start;
  gap: 18px;
}

.assignment-final-card--presentation .result-head h3 {
  font-size: clamp(1.45rem, 2vw, 1.82rem);
  letter-spacing: -0.03em;
}

.assignment-final-card--presentation .result-subcopy {
  max-width: 70ch;
}

body[data-assignment-mode="presentation"] .assignment-final-meta-row {
  margin-bottom: 18px;
}

body[data-assignment-mode="presentation"] .assignment-final-meta-row .summary-chip {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.12);
}

body[data-assignment-mode="presentation"] .assignment-presentation-preview {
  margin: 20px 0 0;
}

.assignment-final-notes--presentation {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 0;
}

.assignment-final-note--presentation {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body[data-assignment-mode="presentation"] .assignment-final-review {
  display: none !important;
}

body[data-assignment-mode="presentation"] .assignment-final-presentation-slot {
  margin: 18px 0 0;
}

body[data-assignment-mode="presentation"] .assignment-final-editor-shell {
  margin-top: 18px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid rgba(105, 83, 198, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 255, 0.96));
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.06);
}

body[data-assignment-mode="presentation"] .assignment-final-editor-shell::before {
  content: attr(data-section-title);
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #55637f;
}

body[data-assignment-mode="presentation"] .assignment-final-editor-shell::after {
  content: attr(data-section-note);
  display: block;
  margin-top: 10px;
  font-size: 0.92rem;
  color: #66758f;
}

body[data-assignment-mode="presentation"] .assignment-final-editor {
  min-height: 360px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
}

.presentation-details-shell {
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(105, 83, 198, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 249, 255, 0.96));
  box-shadow: 0 20px 52px rgba(15, 23, 42, 0.07);
}

.presentation-details-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.85fr);
  gap: 18px;
  padding: 22px 24px 20px;
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.16), transparent 30%), linear-gradient(180deg, rgba(244, 246, 255, 0.96), rgba(255, 255, 255, 0.94));
}

.presentation-details-title {
  margin: 0;
  font-size: clamp(1.22rem, 1.7vw, 1.48rem);
  letter-spacing: -0.03em;
  color: #172036;
}

.presentation-details-copy-wrap .eyebrow {
  margin-bottom: 8px;
}

.presentation-details-copy {
  margin: 10px 0 0;
  color: #55637f;
  line-height: 1.65;
  max-width: 62ch;
}

.presentation-details-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.presentation-details-chip-row .summary-chip {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(99, 102, 241, 0.12);
}

.presentation-details-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-self: stretch;
}

.presentation-details-stat-card {
  min-height: 92px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.presentation-details-stat-card strong {
  font-size: 1.45rem;
  color: #111827;
  line-height: 1;
}

.presentation-details-stat-card span {
  color: #5b6983;
  font-size: 0.9rem;
}

.presentation-details-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 20px 24px 24px;
}

.presentation-details-section {
  padding: 18px 18px 16px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.presentation-details-label {
  margin: 0 0 12px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #66758f;
}

.presentation-details-list {
  margin: 0;
  padding-left: 19px;
  color: #1f2937;
}

.presentation-details-list li {
  margin: 0 0 10px;
  line-height: 1.55;
}

.presentation-details-list li:last-child {
  margin-bottom: 0;
}

.presentation-details-source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.presentation-details-source-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.14);
  color: #23314d;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.presentation-details-muted {
  margin: 12px 0 0;
  color: #66758f;
  line-height: 1.58;
}

@media (max-width: 1200px) {
  .assignment-guide-step-grid--five {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .assignment-grade-score-wrap {
    justify-items: flex-start;
  }
}

@media (max-width: 960px) {
  .assignment-final-notes,
  .assignment-guide-step-grid--five {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .assignment-output-actions-row,
  .assignment-final-actions {
    width: 100%;
  }

  .assignment-output-actions-row > *,
  .assignment-final-actions > * {
    flex: 1 1 100%;
  }

  .assignment-final-editor {
    min-height: 420px;
  }
}

@media (max-width: 1200px) {
  .presentation-details-hero,
  .presentation-details-grid {
    grid-template-columns: 1fr;
  }

  .presentation-details-stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body[data-assignment-mode="presentation"] .assignment-final-editor-shell {
    padding: 16px;
  }

  .presentation-details-hero {
    padding: 18px;
  }

  .presentation-details-grid {
    padding: 18px;
  }

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


@media (max-width: 760px) {
  .generation-shell {
    padding: 1rem;
  }

  .generation-card {
    padding: 1.05rem;
    border-radius: 22px;
  }

  .generation-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .generation-actions .ghost-btn {
    width: 100%;
  }
}



/* ===== Sidebar search + overflow polish ===== */
.sidebar-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 12px;
}

.sidebar-search-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 42px;
}

.sidebar-search-clear {
  flex: 0 0 auto;
  min-height: 42px;
  white-space: nowrap;
}

.sidebar-section-toggle-wrap {
  margin-top: 10px;
}

.sidebar-section-toggle-btn {
  width: 100%;
  justify-content: center;
  min-height: 40px;
}

.sidebar-section-toggle {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.sidebar-search-empty {
  color: var(--muted);
  line-height: 1.55;
}

.topbar-actions #topbar-start-fresh-btn {
  min-height: 42px;
}

.assignment-sidebar-meta,
.project-item-meta,
.recent-meta {
  align-items: flex-start;
}

@media (max-width: 900px) {
  .sidebar-search-row {
    flex-wrap: wrap;
  }

  .sidebar-search-clear {
    width: 100%;
  }
}

.assignment-presentation-settings {
  margin: 14px 0 18px;
  padding: 18px;
  border: 1px solid rgba(105, 83, 198, 0.16);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(248, 246, 255, 0.96), rgba(255, 255, 255, 0.98));
}

.assignment-presentation-settings-head h4,
.assignment-presentation-head h4,
.assignment-slide-frame h5,
.assignment-presentation-empty-title {
  margin: 0;
  color: #181c37;
  font-size: 1.03rem;
}

.assignment-presentation-settings-grid,
.assignment-presentation-custom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.assignment-presentation-custom-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
}

.assignment-presentation-custom-grid {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(105, 83, 198, 0.14);
}

.color-input {
  width: 100%;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(105, 83, 198, 0.16);
  background: #fff;
  padding: 6px 8px;
}


.assignment-presentation-preview {
  margin: 16px 0 18px;
}

.assignment-presentation-empty {
  border: 1px dashed rgba(105, 83, 198, 0.28);
  border-radius: 18px;
  padding: 18px;
  background: rgba(248, 246, 255, 0.72);
}

.assignment-presentation-empty-title {
  font-weight: 800;
}

.assignment-presentation-empty-copy,
.assignment-presentation-copy {
  margin: 6px 0 0;
  color: #d9e0f0;
}

.assignment-presentation-shell {
  border: 1px solid rgba(65, 78, 114, 0.3);
  border-radius: 26px;
  padding: 20px;
  background: radial-gradient(circle at top right, rgba(79, 70, 229, 0.24), transparent 34%), linear-gradient(180deg, #0f172a 0%, #10192f 100%);
  box-shadow: 0 24px 60px rgba(7, 11, 24, 0.28);
  color: #eff4ff;
}

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

.assignment-presentation-head h4 {
  margin: 0;
  color: #f8fbff;
}

.assignment-presentation-export-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.assignment-presentation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.86fr);
  gap: 18px;
  align-items: start;
}

.assignment-slide-stage,
.assignment-slide-notes {
  border-radius: 22px;
  border: 1px solid rgba(125, 145, 189, 0.18);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  padding: 16px;
}

.assignment-slide-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.assignment-slide-nav-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.assignment-slide-canvas-wrap {
  padding: 14px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.assignment-slide-canvas {
  aspect-ratio: 16 / 9;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(247,250,255,0.96));
  box-shadow: 0 18px 40px rgba(5, 9, 20, 0.3);
}

.assignment-slide-filmstrip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.assignment-slide-thumb {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255,255,255,0.06);
  padding: 10px 12px;
  color: #dfe7f8;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.assignment-slide-thumb:hover,
.assignment-slide-thumb.is-active {
  transform: translateY(-1px);
  border-color: rgba(129, 140, 248, 0.48);
  background: rgba(99, 102, 241, 0.16);
}

.assignment-slide-thumb-index {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.12);
  font-size: 0.82rem;
  font-weight: 700;
  flex: 0 0 auto;
}

.assignment-slide-thumb-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.assignment-slide-thumb-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #f8fbff;
  line-height: 1.25;
}

.assignment-slide-thumb-meta {
  font-size: 0.76rem;
  color: #b8c7e3;
  text-transform: capitalize;
}

.assignment-slide-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 22px;
  padding: 30px;
  background: var(--rw-pres-bg, #ffffff);
  color: var(--rw-pres-ink, #111827);
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.06);
  overflow: hidden;
}

.assignment-slide-frame h5 {
  color: var(--rw-pres-title, #111827);
  margin: 0;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-size: 1.52rem;
}

.assignment-slide-frame ul {
  margin: 0;
  padding-left: 20px;
}

.assignment-slide-frame li {
  margin: 0 0 10px;
  line-height: 1.45;
}

.assignment-slide-frame-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.assignment-slide-subtitle {
  margin: 0;
  color: rgba(53, 63, 93, 0.8);
  font-size: 0.98rem;
}

.assignment-slide-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.assignment-slide-media {
  display: block;
  border-radius: 20px;
  overflow: hidden;
  min-height: 220px;
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.14), rgba(59, 130, 246, 0.18));
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.16);
}

.assignment-slide-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.assignment-slide-media--placeholder {
  position: relative;
  isolation: isolate;
  background: linear-gradient(145deg, color-mix(in srgb, var(--rw-pres-accent, #3b82f6) 22%, #fff), rgba(255,255,255,0.84));
}

.assignment-slide-media-orb {
  position: absolute;
  top: 18%;
  right: 14%;
  width: 140px;
  height: 140px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.78), rgba(59,130,246,0.26));
  filter: blur(1px);
}

.assignment-slide-media-grid {
  position: absolute;
  inset: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(255,255,255,0.52);
}

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

.assignment-slide-point-card {
  min-height: 96px;
  border-radius: 18px;
  padding: 16px 16px 14px;
  background: rgba(255,255,255,0.92);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.16), 0 10px 22px rgba(15, 23, 42, 0.06);
}

.assignment-slide-point-card p {
  margin: 8px 0 0;
  font-weight: 700;
  line-height: 1.4;
}

.assignment-slide-point-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--rw-pres-accent-soft, #dbeafe) 82%, #fff 18%);
  color: var(--rw-pres-accent, #3b82f6);
  font-size: 0.84rem;
  font-weight: 800;
}

.assignment-slide-frame--hero {
  display: flex;
  align-items: flex-end;
  background: linear-gradient(145deg, color-mix(in srgb, var(--rw-pres-accent, #3b82f6) 26%, #0f172a 74%), color-mix(in srgb, var(--rw-pres-accent, #3b82f6) 16%, #020617 84%));
  background-size: cover;
  background-position: center;
  color: #fff;
}

.assignment-slide-hero-panel {
  max-width: 64%;
  padding: 20px 22px;
  border-radius: 22px;
  background: rgba(2, 6, 23, 0.44);
  backdrop-filter: blur(14px);
}

.assignment-slide-frame--hero h5,
.assignment-slide-frame--hero .assignment-slide-subtitle,
.assignment-slide-frame--hero .eyebrow {
  color: #fff;
}

.assignment-slide-hero-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.assignment-slide-hero-pill {
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.12);
  color: #f8fbff;
  font-weight: 600;
}

.assignment-slide-frame--section {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(240px, 1fr);
  gap: 20px;
  align-items: stretch;
  background: linear-gradient(145deg, color-mix(in srgb, var(--rw-pres-accent, #3b82f6) 78%, #0f172a 22%), color-mix(in srgb, var(--rw-pres-accent, #3b82f6) 46%, var(--rw-pres-bg, #fff) 54%));
  color: #fff;
}

.assignment-slide-frame--section .assignment-slide-subtitle,
.assignment-slide-frame--section .assignment-slide-section-copy p,
.assignment-slide-frame--section .eyebrow,
.assignment-slide-frame--section h5 {
  color: #fff;
}

.assignment-slide-section-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.assignment-slide-frame--image-focus {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(280px, 1.08fr);
  gap: 18px;
  align-items: stretch;
}

.assignment-slide-text-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.assignment-slide-frame--comparison {
  background: linear-gradient(180deg, color-mix(in srgb, var(--rw-pres-bg, #fff) 82%, var(--rw-pres-accent-soft, #dbeafe) 18%), var(--rw-pres-bg, #fff));
}

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

.assignment-slide-compare-grid > section,
.assignment-slide-compare-grid > div {
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.16);
}

.assignment-slide-compare-grid h6 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--rw-pres-accent, #3b82f6);
}

.assignment-slide-frame--quote {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.9fr);
  gap: 20px;
  align-items: stretch;
  background: linear-gradient(135deg, rgba(255,255,255,0.98), color-mix(in srgb, var(--rw-pres-accent-soft, #dbeafe) 55%, #fff 45%));
}

.assignment-slide-quote-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.assignment-slide-quote-copy blockquote {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.42;
  font-weight: 700;
  color: var(--rw-pres-title, #111827);
  border-left: 4px solid var(--rw-pres-accent, #3b82f6);
  padding-left: 14px;
}

.assignment-slide-attribution {
  margin: 0;
  color: var(--rw-pres-accent, #3b82f6);
  font-weight: 700;
}

.assignment-slide-frame--conclusion {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.72fr);
  gap: 18px;
  align-items: stretch;
  background: linear-gradient(145deg, color-mix(in srgb, var(--rw-pres-accent-soft, #dbeafe) 46%, #fff 54%), var(--rw-pres-bg, #fff));
}

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

.assignment-slide-card {
  border-radius: 18px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.14), 0 10px 26px rgba(15, 23, 42, 0.05);
  min-height: 104px;
  display: flex;
  align-items: center;
}

.assignment-slide-card p {
  margin: 0;
  font-weight: 700;
  line-height: 1.42;
}

.assignment-slide-conclusion-foot {
  grid-column: 1 / span 2;
}

.assignment-slide-frame--works {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), color-mix(in srgb, var(--rw-pres-accent-soft, #dbeafe) 22%, #fff 78%));
}

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

.assignment-slide-reference-column {
  border-radius: 18px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
}

.assignment-slide-reference-column p {
  margin: 0 0 12px;
  line-height: 1.45;
  font-size: 0.9rem;
}

.assignment-slide-notes {
  color: #ecf3ff;
}

.assignment-slide-notes-body {
  color: #dce6fb;
  line-height: 1.65;
}

.assignment-slide-notes-body p {
  margin: 0 0 12px;
}

.assignment-slide-source-meta {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  color: #bfd0f3;
}

.assignment-slide-source-meta p {
  margin: 0;
}

.assignment-slide-empty {
  border-radius: 16px;
  padding: 16px;
  background: rgba(148, 163, 184, 0.08);
  color: #475569;
}

@media (max-width: 1240px) {
  .assignment-slide-frame--section,
  .assignment-slide-frame--image-focus,
  .assignment-slide-frame--quote,
  .assignment-slide-frame--conclusion,
  .assignment-slide-reference-columns {
    grid-template-columns: 1fr;
  }

  .assignment-slide-hero-panel {
    max-width: 72%;
  }
}

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

@media (max-width: 720px) {
  .assignment-presentation-custom-toggle-row,
  .assignment-presentation-head,
  .assignment-slide-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .assignment-presentation-export-row {
    justify-content: flex-start;
  }

  .assignment-slide-point-grid,
  .assignment-slide-card-grid,
  .assignment-slide-compare-grid,
  .assignment-slide-reference-columns,
  .assignment-slide-filmstrip {
    grid-template-columns: 1fr;
  }

  .assignment-slide-hero-panel {
    max-width: 100%;
  }
}

/* Responsive shell + PWA polish */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  overscroll-behavior-y: auto;
}

body[data-display-mode="standalone"] {
  overscroll-behavior-y: none;
}

button,
a,
input,
select,
textarea,
label,
summary,
[role="button"],
.topbar-nav-link,
.source-tab,
.pill-btn,
.recent-entry,
.project-list-entry,
.assignment-sidebar-item,
.sidebar-section-toggle-btn,
.workflow-spotlight-card {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.app-menu-btn,
.topbar-nav-link,
.source-tab,
.pill-btn,
.recent-entry,
.project-list-entry,
.assignment-sidebar-item,
.sidebar-section-toggle-btn,
.workflow-spotlight-card {
  min-height: 44px;
}

.app-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.sidebar-mobile-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-mobile-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--panel-ink);
}

.sidebar-scrim {
  position: fixed;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(17, 24, 39, 0.44);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease);
  z-index: 35;
}

.app-install-banner {
  position: fixed;
  left: max(20px, calc(var(--safe-left) + 16px));
  right: max(20px, calc(var(--safe-right) + 16px));
  bottom: max(20px, calc(var(--safe-bottom) + 16px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(108, 88, 207, 0.18);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 20px 50px rgba(17, 24, 39, 0.16);
  z-index: 45;
  backdrop-filter: blur(18px);
}

.app-install-copy {
  min-width: 0;
}

.app-install-copy strong {
  display: block;
  color: var(--panel-ink);
  margin-bottom: 4px;
}

.app-install-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

#app-install-help {
  margin-top: 8px;
  font-size: 0.92rem;
}

.app-install-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.app-install-actions > * {
  flex: 1 1 140px;
}

body[data-display-mode="standalone"] .app-install-banner {
  display: none !important;
}

.app-shell,
.main-stage,
.workspace-grid,
.assignment-layout,
.project-layout,
.workspace-mode-shell,
.project-mode-shell,
.assignment-mode-shell,
.workflow-hub-grid,
.result-grid,
.assignment-presentation-grid,
.project-overview-grid,
.project-chat-shell,
.composer-shell,
.composer-main,
.composer-sidebar,
.topbar-main,
.topbar-context,
.topbar-actions,
.topbar-nav,
.card,
.result-card,
.project-panel,
.assignment-panel,
.project-chat-log,
.summary-output,
.tool-result-content {
  min-width: 0;
}

body[data-display-mode="standalone"] .sidebar {
  padding-top: max(28px, calc(var(--safe-top) + 16px));
}

body[data-display-mode="standalone"] .main-stage {
  padding-top: max(18px, calc(var(--safe-top) + 12px));
  padding-bottom: max(28px, calc(var(--safe-bottom) + 20px));
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .sidebar-mobile-head {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(92vw, 380px);
    max-width: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: max(22px, calc(var(--safe-top) + 16px)) 20px max(28px, calc(var(--safe-bottom) + 18px));
    border-right: 1px solid rgba(86, 69, 184, 0.12);
    border-radius: 0 28px 28px 0;
    box-shadow: var(--shadow-lg);
    transform: translateX(-105%);
    transition: transform var(--ease);
    z-index: 40;
  }

  body[data-sidebar-open="true"] .sidebar {
    transform: translateX(0);
  }

  body[data-sidebar-open="true"] {
    overflow: hidden;
  }

  body[data-sidebar-open="true"] .sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  body[data-sidebar-open="true"] .main-stage {
    pointer-events: none;
  }

  .main-stage {
    padding-left: max(16px, calc(var(--safe-left) + 16px));
    padding-right: max(16px, calc(var(--safe-right) + 16px));
    padding-bottom: max(28px, calc(var(--safe-bottom) + 20px));
  }

  .app-menu-btn {
    display: inline-flex;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 14px;
  }

  .topbar-main {
    width: 100%;
  }

  .topbar-nav {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    padding-bottom: 2px;
  }

  .topbar-nav::-webkit-scrollbar {
    height: 6px;
  }

  .topbar-context {
    flex-wrap: wrap;
  }
}

@media (max-width: 900px) {
  .topbar,
  .topbar-main,
  .topbar-actions,
  .workflow-hub-head,
  .composer-header,
  .project-panel-head,
  .assignment-panel-head,
  .field-row,
  .field-row--url,
  .summary-save-row,
  .project-chat-form,
  .assignment-builder-actions,
  .assignment-review-actions,
  .assignment-completion-actions,
  .project-tool-actions,
  .tool-actions {
    align-items: stretch;
  }

  .topbar-actions,
  .workflow-hub-head,
  .composer-header,
  .project-panel-head,
  .assignment-panel-head,
  .field-row,
  .field-row--url,
  .summary-save-row,
  .project-chat-form,
  .assignment-builder-actions,
  .assignment-review-actions,
  .assignment-completion-actions,
  .project-tool-actions,
  .tool-actions {
    flex-direction: column;
  }

  .summary-save-row {
    grid-template-columns: 1fr;
  }

  .summary-chat-log,
  .project-chat-log {
    max-height: none;
  }

  .app-install-banner {
    left: max(14px, calc(var(--safe-left) + 10px));
    right: max(14px, calc(var(--safe-right) + 10px));
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 18px;
  }

  .topbar-title-block h2 {
    font-size: 1.35rem;
  }

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

  .result-grid,
  .workflow-hub-grid,
  .assignment-layout,
  .project-layout,
  .project-overview-grid,
  .project-chat-shell,
  .composer-shell,
  .project-summary-grid,
  .project-tool-grid,
  .assignment-setup-grid,
  .assignment-presentation-grid,
  .assignment-output-grid,
  .assignment-review-grid,
  .assignment-materials-grid,
  .assignment-strengthen-grid,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .summary-chat-input,
  .project-chat-input {
    min-height: 120px;
  }

  .brand-card {
    padding: 20px;
  }

  .brand-copy {
    font-size: 0.94rem;
  }

  .app-install-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .app-install-actions {
    width: 100%;
    flex-direction: column;
    justify-content: stretch;
  }

  .app-install-actions > * {
    flex: 0 0 auto;
  }
}

@media (max-width: 560px) {
  .main-stage {
    padding-left: max(12px, calc(var(--safe-left) + 10px));
    padding-right: max(12px, calc(var(--safe-right) + 10px));
  }

  .sidebar {
    width: min(94vw, 340px);
    border-radius: 0 24px 24px 0;
    padding-inline: 16px;
  }

  .topbar,
  .card,
  .result-card,
  .project-panel,
  .assignment-panel,
  .composer-main,
  .composer-sidebar,
  .workflow-hub-card,
  .sidebar-section,
  .sidebar-storage-note {
    border-radius: 18px;
  }

  .topbar,
  .card,
  .result-card,
  .project-panel,
  .assignment-panel,
  .composer-main,
  .composer-sidebar,
  .workflow-hub-card,
  .sidebar-section,
  .sidebar-storage-note,
  .app-install-banner {
    padding-left: 14px;
    padding-right: 14px;
  }
}


/* Summary topbar compact mobile pass */
.topbar h2,
.topbar-context {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .app-menu-btn {
    justify-self: start;
  }

  .topbar-main,
  .topbar-nav,
  .topbar-actions {
    width: 100%;
  }

  .topbar-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
    gap: 8px;
    justify-content: stretch;
    overflow: visible;
    padding-bottom: 0;
  }

  .topbar-nav-link {
    min-width: 0;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
  }

  .topbar-actions .ghost-btn,
  .topbar-actions .secondary-btn,
  .topbar-actions .primary-btn {
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 560px) {
  .topbar {
    gap: 10px;
  }

  .topbar-title-block {
    display: grid;
    gap: 4px;
    align-items: start;
  }

  .topbar h2 {
    font-size: 1.24rem;
    line-height: 1.14;
  }

  .topbar-context {
    font-size: 12.5px;
    line-height: 1.48;
  }

  .topbar-nav {
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 6px;
  }

  .topbar-nav-link {
    min-height: 36px;
    padding: 7px 8px;
    font-size: 11.5px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .topbar-actions .ghost-btn,
  .topbar-actions .secondary-btn,
  .topbar-actions .primary-btn {
    min-height: 42px;
    padding: 8px 8px;
    font-size: 11.5px;
  }

  .summary-project-context-actions,
  .summary-save-action-row,
  .fetch-help-actions,
  .project-chat-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    align-items: stretch;
  }

  .summary-save-action-row .select-input {
    grid-column: 1 / -1;
  }

  #summary-open-assignment-btn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .summary-save-action-row {
    grid-template-columns: 1fr;
  }

  .summary-save-action-row .select-input,
  #summary-open-assignment-btn {
    grid-column: auto;
  }

  .summary-save-action-row .primary-btn,
  .summary-save-action-row .secondary-btn,
  .summary-save-action-row .ghost-btn {
    white-space: normal;
  }

  .summary-project-context-actions .ghost-btn,
  .summary-project-context-actions .secondary-btn,
  .summary-save-action-row .primary-btn,
  .summary-save-action-row .secondary-btn,
  .summary-save-action-row .ghost-btn,
  .fetch-help-actions > *,
  .project-chat-actions > * {
    width: 100%;
    min-width: 0;
  }
}
