:root {
  --background: #f8f9ff;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-low: rgba(239, 244, 255, 0.92);
  --surface-lowest: #ffffff;
  --surface-high: #dce9ff;
  --surface-highest: #d5e3fc;
  --surface-variant: #d5e3fc;
  --surface-ink: #edf3ff;
  --text: #0d1c2e;
  --text-muted: #536075;
  --text-soft: #6f7d93;
  --primary: #0058bc;
  --primary-strong: #0070eb;
  --primary-soft: #d8e2ff;
  --secondary: #405e96;
  --accent: #c64f00;
  --success: #1c8f63;
  --warning: #c8781b;
  --danger: #ba1a1a;
  --danger-soft: #ffdad6;
  --shadow-color: rgba(13, 28, 46, 0.08);
  --shadow-soft: 0 24px 60px -28px rgba(13, 28, 46, 0.18);
  --shadow-card: 0 20px 48px -32px rgba(13, 28, 46, 0.14);
  --ghost-border: rgba(193, 198, 215, 0.2);
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(0, 88, 188, 0.14), transparent 34%),
    radial-gradient(circle at bottom right, rgba(0, 112, 235, 0.12), transparent 30%),
    linear-gradient(180deg, #f7f9ff 0%, #eef3ff 100%);
}

body::before,
body::after {
  position: fixed;
  inset: auto;
  z-index: -1;
  width: 36rem;
  height: 36rem;
  border-radius: 999px;
  content: "";
  filter: blur(110px);
  pointer-events: none;
}

body::before {
  top: -12rem;
  left: -12rem;
  background: rgba(140, 186, 255, 0.32);
}

body::after {
  right: -12rem;
  bottom: -12rem;
  background: rgba(211, 229, 255, 0.34);
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

.material-symbols-outlined {
  font-variation-settings:
    "FILL" 0,
    "wght" 500,
    "GRAD" 0,
    "opsz" 24;
  font-size: 1.15rem;
  line-height: 1;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
  border-right: 1px solid var(--ghost-border);
  background: linear-gradient(180deg, rgba(239, 244, 255, 0.96), rgba(232, 240, 255, 0.88));
  backdrop-filter: blur(24px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.95rem;
}

.brand-badge {
  display: inline-flex;
  width: 3rem;
  height: 3rem;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(0, 88, 188, 0.12), rgba(0, 112, 235, 0.24));
  color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(0, 88, 188, 0.08);
}

.brand-name {
  margin: 0;
  font-family: "Manrope", "PingFang SC", sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-note {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.sidebar-cta {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 16px 36px -22px rgba(0, 88, 188, 0.6);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-cta:hover,
.button:hover,
.link-button:hover {
  transform: translateY(-1px);
}

.nav {
  display: grid;
  gap: 0.45rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  color: var(--text-muted);
  font-weight: 600;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  transform: translateX(2px);
}

.nav-link.is-active {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  box-shadow: 0 16px 34px -24px rgba(0, 88, 188, 0.72);
}

.nav-link .material-symbols-outlined {
  opacity: 0.88;
}

.sidebar-footer {
  margin-top: auto;
  padding: 1rem;
  border: 1px solid var(--ghost-border);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow-card);
}

.user-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.user-avatar {
  display: inline-flex;
  width: 2.6rem;
  height: 2.6rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.95rem;
  background: linear-gradient(135deg, rgba(0, 88, 188, 0.14), rgba(0, 112, 235, 0.26));
  color: var(--primary);
  font-family: "Manrope", sans-serif;
  font-weight: 800;
}

.user-copy strong {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.98rem;
}

.user-copy span {
  color: var(--text-soft);
  font-size: 0.86rem;
}

.app-main {
  min-width: 0;
  padding: 2rem 2rem 3rem;
}

.content-shell {
  display: grid;
  gap: 1.5rem;
  width: min(100%, 1320px);
}

.auth-body {
  overflow: hidden;
}

.auth-main {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 2rem;
}

.auth-shell {
  width: min(100%, 440px);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-header > div {
  max-width: 48rem;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 0.65rem;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
h5,
h6,
.font-headline {
  margin: 0;
  font-family: "Manrope", "PingFang SC", sans-serif;
  letter-spacing: -0.03em;
}

.page-title,
.page-header h1 {
  font-size: clamp(2rem, 2vw + 1.5rem, 3.25rem);
  font-weight: 800;
  line-height: 1.04;
}

.page-copy,
.page-header p,
.section-copy {
  margin: 0.7rem 0 0;
  color: var(--text-muted);
  line-height: 1.72;
}

.page-actions,
.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.hero-banner {
  display: grid;
  gap: 1.35rem;
  grid-template-columns: minmax(0, 1.5fr) minmax(18rem, 0.95fr);
}

.hero-panel {
  padding: 2rem;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(233, 241, 255, 0.72)),
    linear-gradient(135deg, rgba(0, 88, 188, 0.04), rgba(0, 112, 235, 0.08));
  box-shadow: var(--shadow-soft);
}

.hero-actions,
.action-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  margin-top: 1.5rem;
}

.action-card {
  display: grid;
  gap: 0.55rem;
  min-height: 8.7rem;
  padding: 1.1rem 1.05rem;
  border: 1px solid var(--ghost-border);
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.action-card:hover,
.panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 28px 60px -36px rgba(13, 28, 46, 0.22);
}

.action-card .material-symbols-outlined,
.section-icon .material-symbols-outlined {
  display: inline-flex;
  width: 2.6rem;
  height: 2.6rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.9rem;
  background: rgba(0, 88, 188, 0.1);
  color: var(--primary);
}

.action-card strong {
  font-size: 1rem;
}

.action-card span:last-child,
.micro-copy,
small,
.muted {
  color: var(--text-soft);
  line-height: 1.6;
}

.stat-grid {
  display: grid;
  gap: 0.95rem;
}

.stat-card {
  padding: 1.35rem;
  border-radius: 1.3rem;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-card);
}

.stat-card strong {
  display: block;
  margin-top: 0.35rem;
  font-size: clamp(2rem, 2.4vw, 2.5rem);
  font-family: "Manrope", sans-serif;
  line-height: 1;
}

.stat-label {
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 600;
}

.grid {
  display: grid;
  gap: 1.35rem;
}

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

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

.grid-sidebar {
  grid-template-columns: minmax(0, 1.55fr) minmax(18rem, 0.95fr);
}

.stack {
  display: grid;
  gap: 1rem;
}

.panel {
  padding: 1.5rem;
  border: 1px solid var(--ghost-border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(249, 252, 255, 0.8));
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.panel-muted {
  background: rgba(239, 244, 255, 0.86);
}

.nested-panel {
  padding: 1.25rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 800;
}

.section-subtitle {
  margin-top: 0.35rem;
  color: var(--text-soft);
  font-size: 0.93rem;
}

.pills,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.badge,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.badge {
  background: rgba(0, 88, 188, 0.08);
  color: var(--primary);
}

.badge-reference {
  background: rgba(0, 88, 188, 0.1);
  color: var(--primary);
}

.badge-improve {
  background: rgba(198, 79, 0, 0.12);
  color: var(--accent);
}

.badge-created {
  background: rgba(64, 94, 150, 0.12);
  color: var(--secondary);
}

.badge-package-uploaded {
  background: rgba(0, 88, 188, 0.1);
  color: var(--primary);
}

.badge-prompt-generated {
  background: rgba(0, 112, 235, 0.12);
  color: var(--primary-strong);
}

.badge-result-filled {
  background: rgba(28, 143, 99, 0.12);
  color: var(--success);
}

.badge-report-ready {
  background: rgba(28, 143, 99, 0.16);
  color: var(--success);
}

.badge-danger {
  background: rgba(186, 26, 26, 0.12);
  color: var(--danger);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.info-list {
  display: grid;
  gap: 0.9rem;
  margin: 0;
}

.info-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  background: rgba(239, 244, 255, 0.72);
}

.info-item dt {
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 600;
}

.info-item dd {
  margin: 0;
  text-align: right;
  font-weight: 700;
}

.simple-list {
  display: grid;
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.simple-list li {
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  background: rgba(239, 244, 255, 0.72);
  line-height: 1.65;
}

.task-card-list {
  display: grid;
  gap: 1rem;
}

.task-card {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--ghost-border);
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-card);
}

.task-card-header,
.row-spread {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.task-card h3,
.task-card h2 {
  font-size: 1.18rem;
  font-weight: 800;
}

.task-card p {
  margin: 0;
}

.task-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.summary-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

.summary-card {
  padding: 1.1rem;
  border-radius: 1.1rem;
  background: rgba(239, 244, 255, 0.82);
}

.summary-card strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.65rem;
  font-family: "Manrope", sans-serif;
}

.pipeline {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
}

.pipeline-step {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.65rem;
  text-align: center;
}

.pipeline-step::after {
  position: absolute;
  top: 1.2rem;
  left: calc(50% + 1.45rem);
  width: calc(100% - 2.9rem);
  border-top: 2px dashed rgba(113, 119, 134, 0.26);
  content: "";
}

.pipeline-step:last-child::after {
  display: none;
}

.step-dot {
  display: inline-flex;
  width: 2.4rem;
  height: 2.4rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.95rem;
  background: rgba(216, 226, 255, 0.72);
  color: var(--text-soft);
  font-weight: 800;
}

.pipeline-step.is-complete .step-dot,
.pipeline-step.is-active .step-dot {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
}

.pipeline-step.is-active .step-dot {
  box-shadow: 0 0 0 10px rgba(0, 88, 188, 0.08);
}

.pipeline-step strong {
  font-size: 0.92rem;
}

.pipeline-step span:last-child {
  color: var(--text-soft);
  font-size: 0.8rem;
}

.upload-panel,
.code-panel,
.preview-frame,
.history-card,
.knowledge-card,
.setting-card {
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.72);
}

.preview-frame {
  overflow: hidden;
}

.preview-image,
.segment-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 1rem;
  background: rgba(216, 226, 255, 0.6);
}

.segment-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.segment-card {
  display: grid;
  gap: 0.85rem;
  padding: 1.05rem;
  border-radius: 1.05rem;
  background: rgba(239, 244, 255, 0.72);
}

.segment-card h3 {
  font-size: 1rem;
}

.code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.code-block {
  overflow-x: auto;
  margin: 0;
  padding: 1.2rem 1.1rem;
  border-radius: 1.1rem;
  background: #131925;
  color: #eef3ff;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.92rem;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.code-block.is-soft {
  background: rgba(239, 244, 255, 0.9);
  color: var(--text);
  font-family: "Inter", sans-serif;
}

.inline-form {
  display: inline;
}

.form,
.form-inline,
.form-grid {
  display: grid;
  gap: 1rem;
}

.form-inline {
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  align-items: end;
}

.form-inline .grow {
  grid-column: span 2;
}

label,
.field {
  display: grid;
  gap: 0.55rem;
}

label > span,
.field-label {
  font-size: 0.88rem;
  font-weight: 700;
}

.field-help {
  color: var(--text-soft);
  font-size: 0.84rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.95rem 1rem;
  border: 1px solid var(--ghost-border);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(0, 88, 188, 0.42);
  box-shadow: 0 0 0 5px rgba(0, 88, 188, 0.08);
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

.button,
button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.2rem;
  border: none;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 16px 34px -24px rgba(0, 88, 188, 0.64);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.button-secondary,
.link-button {
  border: 1px solid var(--ghost-border);
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
  box-shadow: none;
}

.button-ghost {
  border: 1px dashed rgba(0, 88, 188, 0.22);
  background: rgba(239, 244, 255, 0.72);
  color: var(--primary);
  box-shadow: none;
}

.button-danger {
  background: linear-gradient(135deg, #a31717, #cc2f2f);
  box-shadow: 0 16px 34px -24px rgba(186, 26, 26, 0.58);
}

.alert {
  padding: 1rem 1.05rem;
  border-radius: 1rem;
  margin-bottom: 1rem;
}

.alert-error {
  background: rgba(255, 218, 214, 0.9);
  color: #8d1f18;
}

.callout {
  padding: 1rem 1.05rem;
  border-radius: 1rem;
  background: rgba(239, 244, 255, 0.8);
  line-height: 1.7;
}

.callout strong {
  display: block;
  margin-bottom: 0.55rem;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 1rem;
  background: rgba(239, 244, 255, 0.62);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 1rem 1.05rem;
  text-align: left;
  vertical-align: top;
}

thead th {
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tbody tr + tr td {
  border-top: 1px solid rgba(193, 198, 215, 0.18);
}

.history-list {
  display: grid;
  gap: 0.85rem;
}

.history-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(239, 244, 255, 0.72);
}

.history-item strong {
  display: block;
  margin-bottom: 0.2rem;
}

.history-item p {
  margin: 0;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 0.75rem;
  min-height: 12rem;
  text-align: center;
}

.empty-state .material-symbols-outlined {
  display: inline-flex;
  width: 3.2rem;
  height: 3.2rem;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: rgba(0, 88, 188, 0.08);
  color: var(--primary);
  font-size: 1.5rem;
}

.report-section {
  display: grid;
  gap: 0.8rem;
}

.report-section p {
  margin: 0;
  line-height: 1.75;
}

.knowledge-grid,
.settings-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}

.knowledge-card {
  display: grid;
  gap: 0.9rem;
  padding: 1.25rem;
  border: 1px solid var(--ghost-border);
  border-radius: 1.2rem;
  box-shadow: var(--shadow-card);
}

.knowledge-card p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.7;
}

.markdown-body {
  color: var(--text);
  line-height: 1.82;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin: 1.6rem 0 0.75rem;
}

.markdown-body h1:first-child,
.markdown-body h2:first-child,
.markdown-body h3:first-child,
.markdown-body p:first-child {
  margin-top: 0;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote {
  margin: 0.95rem 0;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.25rem;
}

.markdown-body blockquote {
  padding: 0.9rem 1rem;
  border-left: 3px solid rgba(0, 88, 188, 0.24);
  border-radius: 0.75rem;
  background: rgba(239, 244, 255, 0.72);
}

.markdown-body code {
  padding: 0.18rem 0.42rem;
  border-radius: 0.45rem;
  background: rgba(0, 88, 188, 0.08);
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.92em;
}

.markdown-body pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: 1rem;
  background: #131925;
  color: #eef3ff;
}

.auth-panel {
  padding: 0;
  overflow: hidden;
}

.auth-card-top {
  display: grid;
  justify-items: center;
  gap: 0.9rem;
  padding: 2rem 2rem 1.5rem;
}

.auth-logo {
  display: inline-flex;
  width: 3.6rem;
  height: 3.6rem;
  align-items: center;
  justify-content: center;
  border-radius: 1.15rem;
  background: linear-gradient(135deg, rgba(0, 88, 188, 0.1), rgba(0, 112, 235, 0.22));
  color: var(--primary);
}

.auth-card-body {
  padding: 1.65rem 2rem 2rem;
  border-top: 1px solid var(--ghost-border);
}

.auth-card-footer {
  padding: 1rem 2rem 1.4rem;
  border-top: 1px solid var(--ghost-border);
  background: rgba(239, 244, 255, 0.62);
  color: var(--text-soft);
  text-align: center;
  font-size: 0.88rem;
}

.divider-space {
  height: 0.4rem;
}

@media (max-width: 1120px) {
  .hero-banner,
  .grid-sidebar,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

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

  .pipeline-step::after {
    display: none;
  }
}

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

  .sidebar {
    position: static;
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid var(--ghost-border);
  }

  .nav {
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  }

  .app-main {
    padding: 1.25rem 1rem 2rem;
  }

  .content-shell {
    width: 100%;
  }
}

@media (max-width: 720px) {
  body::before,
  body::after {
    width: 22rem;
    height: 22rem;
    filter: blur(80px);
  }

  .page-title,
  .page-header h1 {
    font-size: 2.15rem;
  }

  .hero-panel,
  .panel {
    padding: 1.1rem;
  }

  .form-inline .grow {
    grid-column: auto;
  }

  .table-wrap {
    margin-inline: -0.2rem;
  }

  th,
  td {
    padding: 0.85rem 0.8rem;
  }
}

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

.sidebar {
  gap: 1.2rem;
  padding: 2rem 1rem 1.35rem;
  border-right: none;
  background: #eff4ff;
  backdrop-filter: none;
}

.sidebar-header {
  display: grid;
  gap: 1.05rem;
}

.brand-lockup {
  padding: 0 0.55rem;
}

.brand-badge {
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 0.95rem;
}

.brand-name {
  font-size: 1.95rem;
  letter-spacing: -0.05em;
}

.brand-note {
  margin-top: 0.1rem;
  font-size: 0.84rem;
}

.sidebar-cta {
  min-height: 3rem;
  border-radius: 0.95rem;
  font-weight: 700;
  box-shadow: 0 12px 28px -18px rgba(0, 88, 188, 0.56);
}

.nav {
  gap: 0.25rem;
}

.nav-link {
  min-height: 3rem;
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
  font-weight: 700;
}

.nav-link.is-active {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: none;
  position: relative;
}

.nav-link.is-active::after {
  position: absolute;
  top: 0.7rem;
  right: 0;
  width: 3px;
  height: calc(100% - 1.4rem);
  border-radius: 999px;
  background: var(--primary);
  content: "";
}

.sidebar-footer {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0.45rem 0.55rem 0;
}

.user-avatar,
.mobile-avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(0, 88, 188, 0.18), rgba(0, 112, 235, 0.26));
}

.app-main {
  padding: 0;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
  padding: 0 2rem;
  background: rgba(248, 249, 255, 0.82);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(193, 198, 215, 0.16);
}

.topbar-leading,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topnav-links {
  display: flex;
  align-items: center;
  gap: 1.7rem;
  min-height: 4.25rem;
}

.topnav-link {
  display: inline-flex;
  align-items: center;
  min-height: 4.25rem;
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.topnav-link.is-active {
  color: var(--primary);
  box-shadow: inset 0 -2px 0 0 var(--primary);
}

.topbar-search {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 18rem;
}

.topbar-search .material-symbols-outlined {
  position: absolute;
  left: 0.9rem;
  color: var(--text-soft);
  font-size: 1rem;
}

.topbar-search input {
  padding: 0.8rem 0.9rem 0.8rem 2.8rem;
  border: none;
  border-radius: 0.9rem;
  background: rgba(239, 244, 255, 0.88);
}

.icon-button,
.mobile-menu-button,
.drawer-close {
  display: inline-flex;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.icon-button:hover,
.mobile-menu-button:hover,
.drawer-close:hover {
  background: rgba(229, 237, 255, 0.88);
}

.content-shell {
  width: min(100%, 1320px);
  gap: 1.75rem;
  padding: 1.5rem 2rem 6.25rem;
}

.hero-banner {
  gap: 1.1rem;
}

.hero-panel,
.panel {
  border-radius: 1.25rem;
}

.hero-panel {
  padding: 2.15rem;
  background:
    radial-gradient(circle at top right, rgba(216, 226, 255, 0.7), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 255, 0.9));
}

.panel {
  padding: 1.65rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 252, 255, 0.9));
  box-shadow: 0 18px 48px -34px rgba(13, 28, 46, 0.18);
}

.panel-muted {
  background: rgba(239, 244, 255, 0.92);
}

.action-card,
.task-card,
.knowledge-card,
.history-item,
.summary-card,
.segment-card,
.info-item,
.simple-list li {
  border-radius: 1rem;
}

.action-card {
  min-height: 9rem;
}

.task-card {
  padding: 1.35rem;
}

.summary-grid {
  gap: 0.85rem;
}

.summary-card {
  padding: 1rem 1rem 1.1rem;
}

.summary-card strong {
  font-size: 1.55rem;
}

.pipeline {
  gap: 0.75rem;
}

.pipeline-step strong {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.step-dot {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
}

.code-block {
  border-radius: 1rem;
}

.empty-state {
  min-height: 16rem;
}

.empty-spotlight {
  display: grid;
  place-items: center;
  min-height: 32rem;
}

.empty-spotlight-card {
  width: min(100%, 22rem);
  padding: 2.2rem 2rem;
  border: 1px solid var(--ghost-border);
  border-radius: 2rem;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 16px 42px -28px rgba(13, 28, 46, 0.14);
  text-align: center;
}

.empty-spotlight-visual {
  position: relative;
  display: inline-flex;
  width: 8rem;
  height: 8rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.4rem;
  border-radius: 2rem;
  background: rgba(216, 226, 255, 0.36);
}

.empty-spotlight-visual .material-symbols-outlined {
  color: var(--primary);
  font-size: 3.3rem;
}

.floating-chip {
  position: absolute;
  display: inline-flex;
  width: 2.2rem;
  height: 2.2rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(193, 198, 215, 0.24);
  background: rgba(255, 255, 255, 0.95);
  color: var(--primary);
  box-shadow: 0 10px 24px -18px rgba(13, 28, 46, 0.3);
}

.floating-chip.is-top {
  top: -0.6rem;
  right: -0.6rem;
}

.floating-chip.is-bottom {
  bottom: -0.45rem;
  left: -0.8rem;
}

.workspace-grid {
  display: grid;
  gap: 1.35rem;
  grid-template-columns: minmax(0, 1.5fr) minmax(18rem, 0.82fr);
}

.featured-knowledge {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(16rem, 1fr) minmax(0, 1.2fr);
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}

.featured-knowledge-media {
  min-height: 16rem;
  background: linear-gradient(135deg, rgba(10, 18, 30, 0.98), rgba(40, 52, 74, 0.88));
}

.featured-knowledge-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-knowledge-body {
  display: grid;
  gap: 0.85rem;
  padding: 1.35rem 1.35rem 1.4rem 0;
}

.eyebrow-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-panel {
  position: sticky;
  top: 5.5rem;
  display: grid;
  gap: 1.4rem;
}

.filter-group {
  display: grid;
  gap: 0.7rem;
}

.filter-group h3 {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-list {
  display: grid;
  gap: 0.45rem;
}

.filter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.72rem 0.82rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.92rem;
  font-weight: 600;
}

.filter-item.is-active {
  color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(0, 88, 188, 0.12);
}

.filter-count {
  display: inline-flex;
  min-width: 2rem;
  align-items: center;
  justify-content: center;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  background: rgba(216, 226, 255, 0.6);
  color: var(--secondary);
  font-size: 0.76rem;
}

.toc-card {
  position: sticky;
  top: 5.5rem;
  display: grid;
  gap: 1rem;
}

.toc-list {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc-list li {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.mini-card {
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(239, 244, 255, 0.78);
}

.mini-card strong {
  display: block;
  margin-bottom: 0.25rem;
}

.settings-layout {
  display: grid;
  gap: 1.35rem;
  grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.85fr);
}

.settings-stack {
  display: grid;
  gap: 1.35rem;
}

.setting-card {
  display: grid;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.72);
}

.toggle-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(239, 244, 255, 0.78);
}

.toggle-switch {
  position: relative;
  width: 2.9rem;
  height: 1.7rem;
  border-radius: 999px;
  background: rgba(0, 88, 188, 0.2);
}

.toggle-switch::after {
  position: absolute;
  top: 0.17rem;
  left: calc(100% - 1.45rem);
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(13, 28, 46, 0.14);
  content: "";
}

.meter-list {
  display: grid;
  gap: 0.9rem;
}

.meter-item {
  display: grid;
  gap: 0.4rem;
}

.meter-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.meter-track {
  overflow: hidden;
  height: 0.5rem;
  border-radius: 999px;
  background: rgba(216, 226, 255, 0.7);
}

.meter-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.secure-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.secure-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-muted);
}

.secure-list li::before {
  display: inline-flex;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--primary);
  content: "";
}

.history-panel {
  display: grid;
  gap: 1rem;
}

.prompt-preview {
  padding: 1.1rem 1.15rem;
  border-left: 4px solid var(--primary);
  border-radius: 0 1rem 1rem 0;
  background: rgba(245, 248, 255, 0.94);
}

.prompt-preview p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.75;
}

.upload-guidance {
  display: grid;
  gap: 0.9rem;
}

.upload-stage {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}

.upload-stage-dot {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(0, 88, 188, 0.12);
  color: var(--primary);
}

.upload-stage strong {
  display: block;
  margin-bottom: 0.2rem;
}

.mobile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 44;
  background: rgba(13, 28, 46, 0.22);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 45;
  display: none;
  width: min(82vw, 320px);
  height: 100vh;
  padding: 1.2rem 1rem 1.5rem;
  background: #eff4ff;
  box-shadow: 20px 0 48px -28px rgba(13, 28, 46, 0.3);
  transform: translateX(-100%);
  transition: transform 0.22s ease;
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.mobile-profile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.mobile-profile strong {
  display: block;
}

.mobile-profile p {
  margin: 0.2rem 0 0;
  color: var(--text-soft);
  font-size: 0.84rem;
}

.mobile-cta {
  margin-top: 1rem;
}

.drawer-nav {
  display: grid;
  gap: 0.4rem;
  margin-top: 1.3rem;
}

.drawer-logout {
  margin-top: auto;
  padding-top: 1rem;
}

.mobile-menu-button {
  display: none;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 38;
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 4rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(193, 198, 215, 0.18);
}

.bottom-nav-link {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  padding: 0.55rem 0.35rem 0.5rem;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 700;
}

.bottom-nav-link.is-active {
  color: var(--primary);
}

body.drawer-open .mobile-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.drawer-open .mobile-drawer {
  transform: translateX(0);
}

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

  .featured-knowledge {
    grid-template-columns: 1fr;
  }

  .featured-knowledge-body {
    padding: 0 1.35rem 1.35rem;
  }
}

@media (max-width: 980px) {
  .sidebar {
    display: none;
  }

  .app-main {
    width: 100%;
  }

  .app-topbar {
    padding: 0 1rem;
  }

  .topnav-links {
    display: none;
  }

  .topbar-search {
    min-width: auto;
    width: 10rem;
  }

  .topbar-search input {
    padding-right: 0.8rem;
  }

  .mobile-menu-button {
    display: inline-flex;
  }

  .mobile-drawer {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
  }

  .content-shell {
    width: 100%;
    padding: 1.15rem 1rem 6rem;
  }

  .bottom-nav {
    display: grid;
  }
}

@media (max-width: 720px) {
  .app-topbar {
    min-height: 4rem;
  }

  .topbar-search {
    display: none;
  }

  .topbar-actions {
    gap: 0.35rem;
  }

  .hero-panel,
  .panel {
    padding: 1.15rem;
  }

  .workspace-grid,
  .knowledge-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }
}
