:root {
  --bg-top: #f8fbff;
  --bg-mid: #eef4ff;
  --bg-bottom: #ece8ff;
  --panel: rgba(255, 255, 255, 0.48);
  --panel-strong: rgba(255, 255, 255, 0.68);
  --panel-rich: rgba(255, 255, 255, 0.82);
  --panel-soft: rgba(255, 255, 255, 0.34);
  --ink: #1f2937;
  --muted: #667085;
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(148, 163, 184, 0.28);
  --accent: #6366f1;
  --accent-deep: #4f46e5;
  --accent-soft: rgba(99, 102, 241, 0.12);
  --success: #047857;
  --warning: #b45309;
  --danger: #be123c;
  --shadow-xl: 0 40px 100px rgba(99, 102, 241, 0.14);
  --shadow-lg: 0 28px 64px rgba(99, 102, 241, 0.10);
  --shadow-md: 0 18px 34px rgba(99, 102, 241, 0.08);
  --shadow-sm: 0 10px 20px rgba(99, 102, 241, 0.04);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  background:
    radial-gradient(circle at 10% 12%, rgba(255, 255, 255, 0.98), transparent 20%),
    radial-gradient(circle at 88% 10%, rgba(224, 242, 254, 0.88), transparent 16%),
    radial-gradient(circle at 78% 72%, rgba(216, 180, 254, 0.24), transparent 18%),
    radial-gradient(circle at 30% 86%, rgba(219, 234, 254, 0.70), transparent 22%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 46%, var(--bg-bottom) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 28%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 100% 100%, 34px 34px, 34px 34px;
  opacity: 0.34;
}

.page-orb {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(30px);
}

.orb-one {
  top: 28px;
  left: -46px;
  width: 360px;
  height: 360px;
  background: rgba(191, 219, 254, 0.46);
}

.orb-two {
  top: 126px;
  right: -72px;
  width: 380px;
  height: 380px;
  background: rgba(196, 181, 253, 0.34);
}

.orb-three {
  bottom: -10px;
  left: 34%;
  width: 320px;
  height: 320px;
  background: rgba(255, 255, 255, 0.34);
}

.orb-four {
  top: 42%;
  left: 58%;
  width: 220px;
  height: 220px;
  background: rgba(224, 231, 255, 0.34);
}

#app,
.view,
.hero,
.layout {
  position: relative;
  z-index: 1;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero,
.layout {
  min-height: 100vh;
}

.page-frame {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
}

.hero-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(380px, 0.76fr);
  gap: 3.5rem;
  align-items: center;
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 4.75rem 0 3.75rem;
}

.hero-copy-panel {
  position: relative;
  max-width: 760px;
  padding: 2.35rem 0.5rem 2.35rem 0;
}

.hero-copy-panel::before {
  content: "";
  position: absolute;
  inset: -30px -24px -24px -28px;
  border-radius: 40px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: var(--shadow-sm);
  z-index: -1;
}

.eyebrow,
.sidebar-kicker {
  margin: 0 0 0.65rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.17em;
  font-size: 0.74rem;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 1rem;
  font-size: clamp(3.3rem, 5.8vw, 5.7rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
}

h2 {
  margin-bottom: 0.3rem;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
}

h3 {
  margin-bottom: 0.45rem;
  font-size: 1rem;
}

.lede,
.topbar-subcopy,
.section-copy {
  color: var(--muted);
  line-height: 1.72;
}

.lede {
  max-width: 45rem;
  font-size: 1.14rem;
}

.topbar-subcopy,
.section-copy {
  margin-bottom: 0;
  font-size: 0.97rem;
}

.panel {
  position: relative;
  overflow: hidden;
  padding: 1.8rem;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.42)),
    rgba(255, 255, 255, 0.26);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(36px) saturate(120%);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 44%);
  pointer-events: none;
}

.login-card {
  padding: 2.15rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 247, 255, 0.78)),
    rgba(255, 255, 255, 0.32);
  box-shadow: var(--shadow-xl);
}

label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

input,
select,
textarea,
button {
  width: 100%;
  margin-top: 0.38rem;
  border-radius: 18px;
  padding: 0.92rem 1rem;
  font: inherit;
}

input,
select,
textarea {
  color: var(--ink);
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.34);
  box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.10);
}

textarea {
  resize: vertical;
}

button {
  cursor: pointer;
  color: #fffaf7;
  border: none;
  background: linear-gradient(135deg, #0f172a 0%, #111827 100%);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease, background 160ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.22);
}

button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button.secondary,
button.ghost,
.small-button,
.filter-pill,
.choice-card,
.kb-card {
  color: var(--ink);
}

button.secondary,
button.ghost,
.small-button {
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

button.secondary {
  color: #ffffff;
  border-color: rgba(167, 139, 250, 0.22);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.94), rgba(99, 102, 241, 0.94));
  box-shadow: 0 14px 30px rgba(139, 92, 246, 0.18);
}

.small-button {
  width: auto;
  margin-top: 0;
  padding: 0.58rem 0.88rem;
}

.error {
  color: var(--danger);
  min-height: 1.2rem;
}

.helper-text {
  min-height: 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.helper-box {
  padding: 1rem 1.1rem;
  border-radius: 20px;
  border: 1px dashed rgba(148, 163, 184, 0.34);
  background: rgba(255, 255, 255, 0.44);
}

.interpretation-panel {
  display: grid;
  gap: 0.95rem;
}

.interpretation-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.interpretation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.interpretation-field {
  display: grid;
  gap: 0.45rem;
}

.interpretation-field label {
  margin-bottom: 0;
}

.interpretation-lock {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.interpretation-lock input {
  width: auto;
  margin: 0;
  padding: 0;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip-row .count-pill {
  background: rgba(15, 23, 42, 0.06);
  color: var(--muted);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) auto;
  align-items: start;
  gap: 1.1rem 1.5rem;
  padding-top: 1.6rem;
  padding-bottom: 0.9rem;
}

.topbar-copy {
  max-width: 620px;
}

.dashboard-view .topbar h1 {
  margin-bottom: 0.55rem;
  font-size: clamp(2.8rem, 4.6vw, 4.7rem);
  line-height: 0.94;
  max-width: 8ch;
}

.top-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.user-chip-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
}

.user-chip-wrap > .user-chip-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.user-chip-wrap > .ghost {
  width: auto;
  margin-top: 0;
  padding: 0.72rem 1rem;
  white-space: nowrap;
}

.user-chip,
.context-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.72rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(148, 163, 184, 0.16);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.7rem;
  padding-bottom: 2.3rem;
}

.sidebar,
.main-column,
.stack {
  display: grid;
  gap: 1.25rem;
}

.sidebar {
  position: relative;
  align-content: start;
}

.sidebar-rail::before {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 38px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.22);
  pointer-events: none;
  z-index: -1;
}

.main-column {
  align-content: start;
  gap: 1.15rem;
}

.main-column-full {
  grid-column: 1 / -1;
}

.ask-line-panel {
  padding: 1.3rem 1.45rem 1.4rem;
  background:
    radial-gradient(circle at top right, rgba(191, 219, 254, 0.28), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(241, 245, 255, 0.78));
  box-shadow: var(--shadow-xl);
}

.ask-line-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.ask-line-head h2 {
  margin-bottom: 0;
  font-size: 1.18rem;
}

.intent-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.chat-line-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.6rem 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 247, 255, 0.78));
  box-shadow: var(--shadow-md);
}

.chat-line-label {
  color: var(--muted);
  font-size: 0.95rem;
  white-space: nowrap;
}

.chat-line-shell textarea {
  min-height: 40px;
  max-height: 40px;
  margin-top: 0;
  padding: 0.4rem 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  resize: none;
  overflow: hidden;
}

.chat-line-shell textarea:focus {
  box-shadow: none;
}

.chat-line-button {
  width: auto;
  min-width: 78px;
  margin-top: 0;
  padding: 0.72rem 1rem;
  border-radius: 999px;
}

.tailor-row {
  display: grid;
  gap: 0.35rem;
  max-width: 280px;
}

.tailor-row span {
  color: var(--muted);
  font-size: 0.9rem;
}

.hidden-workflow-panel {
  display: none;
}

.hidden-workflow-panel.is-open {
  display: block;
}

.dashboard-utility-cache {
  display: none;
}

.ask-line-form {
  gap: 0.8rem;
}

.ask-line-form > .section-head {
  margin-bottom: 0;
}

.workflow-hero-panel {
  padding: 1.9rem 2rem;
  background:
    radial-gradient(circle at top right, rgba(191, 219, 254, 0.42), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.90), rgba(241, 245, 255, 0.78));
  box-shadow: var(--shadow-xl);
}

.workflow-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.9fr);
  gap: 1.6rem;
  align-items: stretch;
}

.workflow-hero-copy,
.workflow-hero-prompt {
  display: grid;
  gap: 1rem;
}

.workflow-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.workflow-action-button {
  min-height: 82px;
  text-align: left;
  padding: 1rem 1.05rem;
  border-radius: 22px;
}

.workflow-action-button.primary {
  background: linear-gradient(135deg, #0f172a 0%, #111827 100%);
}

.workflow-action-button.secondary {
  color: #ffffff;
  border-color: rgba(167, 139, 250, 0.22);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.94), rgba(99, 102, 241, 0.94));
  box-shadow: 0 14px 30px rgba(139, 92, 246, 0.18);
}

.workflow-hero-prompt-card {
  height: 100%;
  padding: 1.2rem 1.25rem;
  border-radius: 26px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(244, 247, 255, 0.74));
  box-shadow: var(--shadow-md);
}

.prompt-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.9rem;
}

.prompt-chip {
  width: auto;
  margin-top: 0;
  padding: 0.72rem 1rem;
  border-radius: 999px;
  color: var(--ink);
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
  font-size: 0.9rem;
  line-height: 1.4;
}

.prompt-chip:hover {
  transform: translateY(-1px);
}

.sidebar-panel {
  padding: 1.45rem;
}

.sidebar-panel-prominent {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(238, 242, 255, 0.72)),
    rgba(255, 255, 255, 0.34);
  box-shadow: var(--shadow-xl);
}

.section-panel {
  padding: 1.8rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.2rem;
  margin-bottom: 1.25rem;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
  margin-bottom: 1.2rem;
}

.intent-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-card {
  position: relative;
  overflow: hidden;
  min-height: 156px;
  text-align: left;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(243, 244, 255, 0.74));
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.choice-card::before {
  content: "";
  position: absolute;
  right: -20px;
  top: -18px;
  width: 118px;
  height: 118px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
  pointer-events: none;
}

.choice-card.selected {
  border-color: rgba(15, 23, 42, 0.14);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.92));
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.choice-card.selected .choice-title,
.choice-card.selected .choice-copy {
  color: #ffffff;
}

.choice-title {
  display: block;
  margin-bottom: 0.46rem;
  font-size: 1.02rem;
  font-weight: 700;
}

.choice-copy {
  display: block;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.94rem;
}

.upload-shell {
  margin-top: 0.3rem;
}

.dropzone {
  min-height: 176px;
  display: grid;
  align-content: center;
  gap: 0.45rem;
  padding: 1.7rem;
  border-radius: 28px;
  border: 1px dashed rgba(148, 163, 184, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(239, 246, 255, 0.66));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
  text-align: center;
  cursor: pointer;
}

.dropzone.selected {
  border-color: rgba(99, 102, 241, 0.52);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(224, 231, 255, 0.76));
}

.dropzone.compact-dropzone {
  min-height: 120px;
  padding: 1.1rem;
}

.dropzone.disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.actions {
  display: flex;
  gap: 0.9rem;
}

.actions > * {
  flex: 1;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
}

.kb-card,
.task-card,
.file-card,
.doc-review-card,
.request-result-card,
.warning-summary-card {
  border-radius: 26px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(244, 247, 255, 0.70));
  box-shadow: var(--shadow-md);
}

.kb-card,
.task-card {
  position: relative;
  padding: 1.15rem;
  text-align: left;
  backdrop-filter: blur(22px);
}

.kb-card-shell {
  display: grid;
  gap: 0.55rem;
}

.kb-card-select {
  width: 100%;
}

.kb-card-actions {
  display: flex;
  justify-content: flex-end;
}

.kb-delete-button {
  width: auto;
  padding: 0.56rem 0.9rem;
  color: var(--danger);
}

.kb-card::before,
.task-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 44%);
  pointer-events: none;
}

.kb-card.selected,
.task-card.selected {
  outline: 2px solid rgba(99, 102, 241, 0.16);
  box-shadow: var(--shadow-lg);
}

.kb-card:hover,
.task-card:hover {
  transform: translateY(-1px);
}

.kb-meta,
.task-meta,
.doc-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.kb-meta-wrap {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.kb-counts-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.doc-count-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.05);
  color: var(--muted);
}

.doc-count-pill.complete {
  background: rgba(36, 102, 77, 0.1);
  color: var(--success);
}

.doc-count-pill.partial {
  background: rgba(154, 104, 24, 0.1);
  color: var(--warning);
}

.doc-count-pill.failed {
  background: rgba(171, 63, 63, 0.1);
  color: var(--danger);
}

.task-preview,
.kb-preview {
  margin-top: 0.56rem;
  line-height: 1.52;
}

.status-pill,
.risk-pill,
.type-pill,
.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.34rem 0.76rem;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
  background: rgba(15, 23, 42, 0.08);
}

.status-pill.ready,
.risk-pill.low {
  background: rgba(36, 102, 77, 0.10);
  color: var(--success);
}

.status-pill.needs_review,
.status-pill.review_needed,
.status-pill.partial,
.risk-pill.medium,
.count-pill {
  background: rgba(154, 104, 24, 0.10);
  color: var(--warning);
}

.status-pill.fix_needed,
.risk-pill.high {
  background: rgba(171, 63, 63, 0.10);
  color: var(--danger);
}

.status-pill.upload_pending,
.status-pill.processing,
.status-pill.running,
.status-pill.queued,
.status-pill.classified,
.status-pill.pending {
  background: rgba(99, 102, 241, 0.10);
  color: var(--accent-deep);
}

.upload-progress-summary {
  gap: 0.5rem;
}

.upload-progress-track {
  width: 100%;
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
  margin-top: 0.45rem;
}

.upload-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.8), rgba(79, 70, 229, 0.95));
  transition: width 180ms ease;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.62rem;
}

#deal-files-section,
#slide-library-section,
#ask-workflow-section {
  scroll-margin-top: 120px;
}

.filter-pill {
  width: auto;
  margin-top: 0;
  padding: 0.58rem 0.92rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
  font-size: 0.92rem;
}

.filter-pill.active {
  border-color: rgba(99, 102, 241, 0.18);
  background: rgba(99, 102, 241, 0.10);
}

.doc-review-card,
.request-result-card,
.warning-summary-card {
  padding: 1.2rem;
}

.doc-review-card {
  display: grid;
  gap: 0.95rem;
  backdrop-filter: blur(20px);
}

.doc-review-card .detail-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.93rem;
}

.doc-review-card .detail-label {
  min-width: 106px;
  color: var(--muted);
}

.warning-list,
.source-list {
  display: grid;
  gap: 0.6rem;
}

.warning-item {
  padding: 0.84rem 0.9rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(255, 255, 255, 0.58);
}

.warning-item.warning {
  border-color: rgba(154, 104, 24, 0.24);
}

.warning-item.error {
  border-color: rgba(171, 63, 63, 0.24);
}

.warning-summary-card {
  display: grid;
  gap: 0.82rem;
  backdrop-filter: blur(22px);
}

.warning-summary-card.empty-state,
.request-result-card.empty-state,
.inline-empty {
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.46);
}

.warning-summary-card.empty-state {
  min-height: 96px;
}

.request-result-card {
  min-height: 148px;
  display: grid;
  gap: 0.9rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(243, 244, 255, 0.80));
  box-shadow: var(--shadow-lg);
}

.request-result-live {
  box-shadow: var(--shadow-xl);
}

.task-progress-bar-track {
  width: 100%;
  height: 4px;
  background: var(--line, #e2e4ea);
  border-radius: 2px;
  overflow: hidden;
}
.task-progress-bar-fill {
  height: 100%;
  background: var(--accent, #4f46e5);
  border-radius: 2px;
  transition: width 0.6s ease;
}

.request-answer {
  white-space: pre-wrap;
  line-height: 1.76;
}

.details-block summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.details-block summary::-webkit-details-marker {
  display: none;
}

.details-block summary::after {
  content: "Show";
  float: right;
  color: var(--muted);
  font-weight: 500;
}

.details-block[open] summary::after {
  content: "Hide";
}

.follow-up-button {
  width: 100%;
  text-align: left;
}

.follow-up-grid,
.reasoning-list,
.pptx-review-grid {
  display: grid;
  gap: 0.85rem;
}

.follow-up-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.follow-up-card {
  min-height: 132px;
  display: grid;
  align-content: start;
  gap: 0.4rem;
  padding: 1rem 1.05rem;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(243, 244, 255, 0.72));
  box-shadow: var(--shadow-sm);
}

.reasoning-card,
.slide-review-card {
  display: grid;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(255, 255, 255, 0.64);
  box-shadow: var(--shadow-sm);
}

.reasoning-card p {
  margin: 0.22rem 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.slide-review-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.slide-review-field {
  margin-bottom: 0;
}

.slide-review-field textarea[readonly] {
  background: rgba(248, 250, 252, 0.92);
  color: var(--muted);
}

.compact-actions > * {
  flex: 0 0 auto;
}

.status-pill.accepted,
.status-pill.accept {
  background: rgba(36, 102, 77, 0.10);
  color: var(--success);
}

.status-pill.rejected,
.status-pill.reject {
  background: rgba(171, 63, 63, 0.10);
  color: var(--danger);
}

.status-pill.pending {
  background: rgba(99, 102, 241, 0.10);
  color: var(--accent-deep);
}

.result-block {
  display: grid;
  gap: 0.5rem;
}

.business-profile-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-field-card {
  margin: 0;
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.profile-field-card-wide {
  grid-column: 1 / -1;
}

.profile-field-title {
  display: inline-block;
  margin-bottom: 0.22rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.profile-field-card input,
.profile-field-card textarea,
.question-answer-card textarea {
  background: rgba(255, 255, 255, 0.84);
}

.question-answer-card {
  gap: 0.45rem;
}

.file-card,
.upload-file-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.05rem;
  backdrop-filter: blur(20px);
}

.upload-file-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(239, 246, 255, 0.72));
}

.interactive-template-area {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.compact-head {
  margin-bottom: 0.5rem;
}

.learning-group {
  display: grid;
  gap: 0.8rem;
}

.learning-card {
  display: grid;
  gap: 0.7rem;
}

.learning-review-shell {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
}

.learning-review-shell.open {
  display: block;
}

.learning-review-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.34);
  box-shadow: none;
}

.learning-review-drawer {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 1rem;
  width: min(540px, 100%);
  height: 100%;
  padding: 1.4rem;
  border-left: 1px solid rgba(255, 255, 255, 0.68);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(241, 245, 255, 0.82)),
    rgba(255, 255, 255, 0.52);
  box-shadow: -24px 0 60px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(36px) saturate(120%);
  overflow: hidden;
}

.learning-review-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.learning-review-content {
  overflow-y: auto;
  display: grid;
  gap: 1rem;
  padding-right: 0.2rem;
}

.learning-review-summary,
.learning-review-group,
.learning-review-empty {
  padding: 1rem;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(243, 244, 255, 0.72));
  box-shadow: var(--shadow-md);
}

.learning-review-summary {
  display: grid;
  gap: 0.8rem;
}

.learning-review-group {
  display: grid;
  gap: 0.9rem;
}

.learning-review-empty {
  color: var(--muted);
  text-align: center;
}

.learning-group-header,
.learning-card-header,
.learning-scope-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.learning-card-header {
  align-items: flex-start;
}

.learning-card-title {
  display: grid;
  gap: 0.2rem;
}

.learning-card-scope {
  width: auto;
  min-width: 132px;
  margin-top: 0;
}

.learning-card-actions {
  display: flex;
  gap: 0.75rem;
}

.learning-card-actions > * {
  flex: 1;
}

.learning-group-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.learning-edit-note {
  color: var(--warning);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.learning-review-inline {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.54);
}

.learning-edit-input,
.learning-edit-textarea,
.learning-edit-scope {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  padding: 0.75rem 0.9rem;
  font: inherit;
  color: var(--ink);
}

.learning-edit-textarea {
  min-height: 88px;
  resize: vertical;
}

.hidden-field,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden-field.visible {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  clip: auto;
  overflow: visible;
  white-space: normal;
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .review-grid {
    grid-template-columns: 1fr;
  }

  .workflow-hero-grid,
  .workflow-action-grid {
    grid-template-columns: 1fr;
  }

  .ask-line-head,
  .intent-pill-row {
    align-items: stretch;
  }

  .learning-review-drawer {
    width: 100%;
  }
}

@media (max-width: 980px) {
  .hero-shell,
  .choice-grid,
  .sidebar {
    grid-template-columns: 1fr;
  }

  .page-frame,
  .hero-shell {
    width: min(100% - 24px, 1440px);
  }

  .hero-shell {
    gap: 2rem;
    padding: 1.8rem 0 1.5rem;
  }

  .topbar,
  .section-head,
  .actions,
  .user-chip-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .top-action-row {
    width: 100%;
    justify-content: stretch;
  }

  .top-action-row .small-button {
    flex: 1 1 calc(50% - 0.4rem);
  }

  .ask-line-head {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-line-shell {
    grid-template-columns: 1fr;
    border-radius: 28px;
    padding: 1rem;
  }

  .chat-line-button {
    width: 100%;
  }

  .doc-review-card .detail-row,
  .kb-meta,
  .task-meta,
  .doc-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .business-profile-grid {
    grid-template-columns: 1fr;
  }

  .follow-up-grid,
  .slide-review-columns,
  .interpretation-grid {
    grid-template-columns: 1fr;
  }

  .learning-review-header,
  .learning-group-header,
  .learning-card-header,
  .learning-scope-row,
  .learning-card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .learning-card-scope {
    width: 100%;
  }

  .workflow-hero-panel {
    padding: 1.45rem;
  }
}

/* Folder grid for subpages */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.folder-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
  text-align: center;
}

.folder-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.folder-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.folder-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}

.folder-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.file-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

.file-row:last-child {
  border-bottom: none;
}

.file-name {
  font-weight: 500;
  color: var(--ink);
  font-size: 0.9rem;
}

.file-status {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: capitalize;
}

/* ── Requests page ────────────────────────────────────── */

.request-card {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.request-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--accent);
}

.request-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.request-type-badge {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.badge-pptx_deck { background: rgba(99, 102, 241, 0.12); color: #4f46e5; }
.badge-credit_memo { background: rgba(4, 120, 87, 0.10); color: #047857; }
.badge-word_rfp { background: rgba(180, 83, 9, 0.10); color: #b45309; }
.badge-chat { background: rgba(31, 41, 55, 0.08); color: #1f2937; }

.request-status {
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: capitalize;
}

.status-completed .request-status { color: var(--success); }
.status-running .request-status { color: var(--accent); }
.status-failed .request-status { color: var(--danger); }
.status-pending .request-status { color: var(--muted); }

.card-check {
  color: var(--success, #16a34a);
  margin-left: 0.3rem;
  font-size: 0.82rem;
}

.request-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.request-subject {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ink);
}

.request-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.request-card-actions {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

.download-hint {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 500;
}

/* Request detail */

.request-detail-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.5rem 1rem;
  margin-bottom: 1.5rem;
}

.detail-row {
  display: contents;
}

.detail-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.detail-value {
  font-size: 0.9rem;
  color: var(--ink);
}

.detail-status-pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  text-transform: capitalize;
}
.detail-status-success { background: rgba(22, 163, 74, 0.1); color: #16a34a; }
.detail-status-accent { background: rgba(79, 70, 229, 0.1); color: #4f46e5; }
.detail-status-danger { background: rgba(220, 53, 69, 0.1); color: #dc3545; }
.detail-status-muted { background: rgba(107, 114, 128, 0.1); color: #6b7280; }

.detail-elapsed {
  font-size: 0.78rem;
  color: var(--muted);
  margin-left: 0.5rem;
}

.word-count {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: 0.5rem;
}

.request-body-section,
.request-output-section,
.request-output-text,
.request-error-section,
.request-followup-section {
  margin-top: 1.25rem;
}

.request-error-section {
  background: rgba(220, 53, 69, 0.06);
  border: 1px solid rgba(220, 53, 69, 0.25);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}
.request-error-section h3 {
  color: var(--danger, #dc3545);
  font-size: 0.88rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 0.5rem;
}
.request-error-section .error-message {
  font-size: 0.9rem;
  color: var(--ink);
  margin: 0 0 0.5rem;
  line-height: 1.5;
}
.request-error-section .error-phase {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 0.25rem;
}
.request-error-section .error-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
  font-style: italic;
}

/* Validation summary */
.request-validation-section {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin: 0.5rem 0;
}
.request-validation-section.validation-pass {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.request-validation-section.validation-warn {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}
.validation-icon {
  margin-right: 0.25rem;
}

/* Deck selection summary */
.request-selection-section {
  margin: 0.75rem 0;
}
.request-selection-section h3 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 0.35rem;
}
.selection-detail {
  font-size: 0.85rem;
  color: var(--ink);
  margin: 0 0 0.2rem;
}
.selection-detail.selection-warn {
  color: #92400e;
}

.request-body-section h3,
.request-output-section h3,
.request-output-text h3,
.request-followup-section h3 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 0.5rem;
}

.output-preview {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
}

.download-button {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s;
}

.download-button:hover {
  background: var(--accent-deep);
}

/* Follow-up suggestions */
.followup-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.followup-chip {
  font-size: 0.82rem;
  padding: 0.3rem 0.7rem;
  background: var(--accent-soft, rgba(79, 70, 229, 0.08));
  color: var(--accent-deep, #4338ca);
  border-radius: 999px;
  line-height: 1.3;
}

/* Regenerate */
.request-regenerate-section {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.regenerate-button {
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--accent, #4f46e5);
  border-radius: 8px;
  background: transparent;
  color: var(--accent, #4f46e5);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.regenerate-button:hover:not(:disabled) {
  background: var(--accent, #4f46e5);
  color: #fff;
}
.regenerate-button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}
.regenerate-status {
  font-size: 0.82rem;
  color: var(--muted);
}

.knowledge-panel-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.knowledge-rule-composer {
  border: 1px solid rgba(79, 70, 229, 0.18);
  background: rgba(255, 255, 255, 0.78);
}

.knowledge-rule-templates {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.knowledge-rule-template-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.knowledge-rule-template-button {
  white-space: normal;
  text-align: left;
}

.knowledge-rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 0.75rem;
}

.knowledge-rule-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.knowledge-rule-field span {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink);
}

.knowledge-rule-field-wide {
  grid-column: 1 / -1;
}

.knowledge-rule-field input,
.knowledge-rule-field textarea {
  width: 100%;
}

.knowledge-rule-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.knowledge-rule-preview {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 92%, var(--accent-soft, #eef2ff) 8%);
}

.knowledge-rule-preview-list {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-size: 0.92rem;
  color: var(--ink);
}

/* --- Delete task --- */
.request-delete-section {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.delete-button {
  padding: 0.4rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--danger, #c0392b);
  background: transparent;
  color: var(--danger, #c0392b);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.delete-button:hover {
  background: var(--danger, #c0392b);
  color: #fff;
}
.delete-confirm {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.delete-confirm-yes {
  padding: 0.3rem 0.75rem;
  border-radius: 5px;
  border: none;
  background: var(--danger, #c0392b);
  color: #fff;
  font-size: 0.82rem;
  cursor: pointer;
}
.delete-confirm-yes:hover { opacity: 0.85; }
.delete-confirm-yes:disabled { opacity: 0.5; cursor: default; }
.delete-confirm-no {
  padding: 0.3rem 0.75rem;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  cursor: pointer;
}
.delete-confirm-no:hover { color: var(--fg); }

/* --- Clear history button --- */
.danger-ghost {
  color: var(--muted);
}
.danger-ghost:hover {
  color: var(--danger, #c0392b);
}
.danger-ghost.danger-confirm {
  color: var(--danger, #c0392b);
  border-color: var(--danger, #c0392b);
}

@media (max-width: 900px) {
  .knowledge-rule-grid {
    grid-template-columns: 1fr;
  }
}

/* ── CRE Lease Override Drawer ──────────────────────────────────────────
   Slides in from the right edge when a banker clicks the pencil on a lease
   row. The backdrop dims the page; clicking it (or pressing Esc) closes. */
.lease-override-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 50, 0.45);
  z-index: 9000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.lease-override-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.lease-override-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(620px, 92vw);
  background: #FFFFFF;
  border-left: 1px solid #D7DEE9;
  box-shadow: -8px 0 24px rgba(20, 30, 50, 0.18);
  z-index: 9001;
  transform: translateX(100%);
  transition: transform 240ms cubic-bezier(0.2, 0.7, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.lease-override-drawer.open {
  transform: translateX(0);
}
.lease-override-head {
  padding: 1.1rem 1.3rem 0.8rem;
  border-bottom: 1px solid #ECEFF4;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}
.lease-override-head h2 {
  margin: 0.1rem 0 0;
  color: #1F2937;
  font-size: 1.2rem;
}
.lease-override-subtitle {
  margin: 0.2rem 0 0;
  color: #606A7A;
  font-size: 0.85rem;
}
.lease-override-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.3rem 1.2rem;
}
.lease-override-body .ov-section {
  margin-bottom: 1.4rem;
}
.lease-override-body .ov-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1F4E78;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.55rem;
  border-bottom: 1px solid #ECEFF4;
  padding-bottom: 0.3rem;
}

/* Amendment History — collapsible per-field trail from field_ledgers.
   Sits inside the lease override drawer. Each field's `<details>` opens
   to show a small table of source_doc / value / effective_date / conf. */
.lease-override-body .amd-history-fields {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.lease-override-body .amd-history-field {
  border: 1px solid #E4E9F0;
  border-radius: 0.3rem;
  background: #F8FAFC;
}
.lease-override-body .amd-history-field-summary {
  cursor: pointer;
  padding: 0.4rem 0.65rem;
  font-size: 0.85rem;
  color: #1F4E78;
  user-select: none;
}
.lease-override-body .amd-history-field-name {
  font-weight: 600;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 0.82rem;
}
.lease-override-body .amd-history-changed {
  margin-left: 0.4rem;
  font-size: 0.75rem;
  color: #6B7B92;
  font-weight: 500;
}
.lease-override-body .amd-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  padding: 0 0.3rem 0.4rem;
}
.lease-override-body .amd-history-table th {
  text-align: left;
  padding: 0.35rem 0.45rem;
  border-bottom: 1px solid #D0D7E2;
  color: #6B7B92;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.lease-override-body .amd-history-table td {
  padding: 0.32rem 0.45rem;
  border-bottom: 1px solid #ECEFF4;
  vertical-align: top;
}
.lease-override-body .amd-history-table tr:last-child td {
  border-bottom: none;
}
.lease-override-body .amd-history-source {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 0.72rem;
  color: #444;
  max-width: 200px;
  word-break: break-word;
}
.lease-override-body .amd-history-value {
  font-weight: 600;
  color: #1F4E78;
}
.lease-override-body .amd-history-date {
  color: #6B7B92;
  font-size: 0.78rem;
}
.lease-override-body .amd-history-conf {
  color: #6B7B92;
  font-size: 0.78rem;
  white-space: nowrap;
}
.lease-override-body .amd-history-row--retrofit td {
  background: #FCF7EE;
}
.lease-override-body .amd-history-row--retrofit .amd-history-conf {
  color: #8B6D3D;
  font-style: italic;
}
.lease-override-body .ov-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 0.9rem;
  margin-bottom: 0.55rem;
}
.lease-override-body .ov-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.lease-override-body .ov-field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #1F4E78;
}
.lease-override-body .ov-field input,
.lease-override-body .ov-field select,
.lease-override-body .ov-field textarea {
  padding: 0.4rem 0.55rem;
  border: 1px solid #D0D7E2;
  border-radius: 0.3rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: #202635;
  background: #FBFCFD;
}
.lease-override-body .ov-field input:focus,
.lease-override-body .ov-field select:focus,
.lease-override-body .ov-field textarea:focus {
  outline: 2px solid #1F4E78;
  outline-offset: -1px;
  background: #fff;
}
.lease-override-body .ov-hint {
  font-size: 0.72rem;
  color: #888;
}
.lease-override-body .ov-hint.ov-banker {
  color: #B8860B;
  font-weight: 600;
}
.lease-override-foot {
  border-top: 1px solid #ECEFF4;
  padding: 0.9rem 1.3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  background: #FBFCFD;
}
.lease-override-foot .actions {
  display: flex;
  gap: 0.5rem;
}
.lease-override-status {
  font-size: 0.82rem;
  color: #606060;
  min-height: 1.2em;
}
.lease-override-status.ok { color: #2D6A4F; }
.lease-override-status.err { color: #C0394D; }

/* Pencil edit icon on each lease row — sits next to the renewed/expired
   pill so banker can open the drawer without expanding the clauses panel. */
.lease-edit-icon {
  display: inline-block;
  margin-left: 0.4rem;
  color: #606A7A;
  cursor: pointer;
  font-size: 0.85rem;
  user-select: none;
  padding: 0.05rem 0.3rem;
  border-radius: 0.3rem;
}
.lease-edit-icon:hover {
  background: #EDF2F8;
  color: #1F4E78;
}

/* Pilot feedback inbox */
.pilot-feedback-button {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 9000;
  padding: 0.68rem 0.95rem;
  border: 1px solid rgba(31, 78, 120, 0.18);
  border-radius: 999px;
  color: #fff;
  background: #1F4E78;
  box-shadow: 0 12px 30px rgba(31, 78, 120, 0.24);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}
.pilot-feedback-button:hover {
  background: #173D60;
}
.pilot-feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 1rem;
  background: rgba(17, 24, 39, 0.26);
}
.pilot-feedback-card {
  width: min(520px, calc(100vw - 2rem));
  max-height: min(760px, calc(100vh - 2rem));
  overflow: auto;
  padding: 1.1rem;
  border: 1px solid rgba(215, 222, 233, 0.9);
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 24px 60px rgba(20, 30, 50, 0.28);
}
.pilot-feedback-head {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.pilot-feedback-head h2 {
  margin: 0.1rem 0 0;
  color: #1F2937;
  font-size: 1.15rem;
  letter-spacing: 0;
}
.pilot-feedback-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.pilot-feedback-form label {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  color: #1F4E78;
  font-size: 0.82rem;
  font-weight: 700;
}
.pilot-feedback-form textarea,
.pilot-feedback-form select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid #D0D7E2;
  border-radius: 0.35rem;
  color: #202635;
  background: #FBFCFD;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 400;
}
.pilot-feedback-form textarea:focus,
.pilot-feedback-form select:focus {
  outline: 2px solid #1F4E78;
  outline-offset: -1px;
  background: #fff;
}
.pilot-feedback-row {
  display: grid;
  grid-template-columns: 1fr 0.7fr;
  gap: 0.7rem;
}
.optional-label {
  color: #7B8794;
  font-weight: 400;
}
.pilot-feedback-context {
  padding: 0.55rem 0.65rem;
  border: 1px solid #E5EAF1;
  border-radius: 0.35rem;
  color: #5B6675;
  background: #F7F9FC;
  font-size: 0.78rem;
  line-height: 1.45;
}
.pilot-feedback-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-end;
}
.pilot-feedback-status {
  margin-right: auto;
  color: #606060;
  font-size: 0.82rem;
}
.pilot-feedback-status.ok {
  color: #2D6A4F;
}
.pilot-feedback-status.err {
  color: #C0394D;
}

@media (max-width: 640px) {
  .pilot-feedback-modal {
    align-items: stretch;
    justify-content: center;
  }
  .pilot-feedback-card {
    width: 100%;
  }
  .pilot-feedback-row {
    grid-template-columns: 1fr;
  }
}
