@import "lucent-brand.css";

html,
body {
  min-height: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  color: var(--ink);
  background:
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(27, 75, 138, 0.05), transparent 55%),
    var(--parchment);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

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

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

button {
  cursor: pointer;
}

.web-shell__header {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--navy);
  color: var(--on-dark);
  border-bottom: 1px solid rgba(240, 237, 232, 0.12);
}

.web-shell__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.web-shell__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--on-dark);
  color: var(--navy);
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-size: 18px;
  font-style: italic;
}

.web-shell__button,
.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--fog);
  border-radius: var(--r-sm);
  padding: 0 16px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}

.web-shell__button {
  background: var(--on-dark);
  color: var(--navy);
  border-color: transparent;
}

.btn.primary {
  background: var(--cobalt);
  color: var(--paper);
  border-color: var(--cobalt);
}

.btn.secondary {
  background: var(--paper);
  color: var(--ink);
}

.panel {
  background: var(--paper);
  border: 1px solid var(--fog);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-card);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--cobalt);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: var(--r-pill);
  background: var(--cobalt);
}

.display-title {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(44px, 7vw, 86px);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.web-home {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 64px 0;
}

.web-home__hero {
  padding: clamp(28px, 5vw, 56px);
}

.web-home__lead {
  max-width: 760px;
  margin-top: 20px;
  color: var(--slate);
  font-size: 17px;
  line-height: 1.7;
}

.web-home code {
  color: var(--navy);
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.web-home__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

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

.web-home__card {
  padding: 24px;
}

.web-home__card h2 {
  margin: 8px 0 10px;
  font-size: 18px;
}

.web-home__card p {
  color: var(--slate);
  line-height: 1.6;
}

.web-home__kicker {
  color: var(--cobalt);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.app-shell {
  min-height: 100dvh;
}

.app-shell__header {
  height: 56px;
  padding: 0 24px;
  background: var(--navy);
  color: var(--on-dark);
  border-bottom: 1px solid rgba(240, 237, 232, 0.12);
}

.app-shell__header-row {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}

.app-shell__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.app-shell__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--on-dark);
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 18px;
  font-style: italic;
  border-radius: var(--r-sm);
  line-height: 1;
  flex-shrink: 0;
}

.app-shell__wordmark {
  color: var(--on-dark);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.app-shell__nav {
  display: flex;
  border: 1px solid rgba(240, 237, 232, 0.22);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.app-shell__nav-btn {
  padding: 8px 16px;
  border-right: 1px solid rgba(240, 237, 232, 0.22);
  color: var(--on-dark);
  font-size: 13px;
  font-weight: 500;
}

.app-shell__nav-btn:last-child {
  border-right: none;
}

.app-shell__nav-btn:hover {
  background: rgba(240, 237, 232, 0.08);
}

.app-shell__account {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.main-content {
  min-height: calc(100dvh - 56px);
  background: var(--parchment);
  position: relative;
  isolation: isolate;
}

.main-content::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(27, 75, 138, 0.04), transparent 55%),
    linear-gradient(rgba(29, 53, 87, 0.04) 1px, transparent 1px);
  background-size: auto, 100% 80px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent 85%);
}

.wizard-content {
  position: relative;
  z-index: 1;
  width: min(1040px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.web-app-page__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.web-app-page h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 300;
  letter-spacing: -0.03em;
}

.web-app-page p {
  color: var(--slate);
  line-height: 1.6;
}

.web-app-page__panel {
  padding: 24px;
}

.web-app-page__panel h2 {
  margin-bottom: 8px;
  font-size: 18px;
}

.deal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 0;
  width: calc(100vw - 48px);
  max-width: 1480px;
  margin: -48px auto -64px;
  min-height: calc(100dvh - 56px);
}

.deal-main {
  min-width: 0;
}

.deal-assistant-rail {
  border-left: 1px solid var(--fog);
  background: var(--paper);
}

.assistant-panel {
  height: calc(100dvh - 56px);
  display: flex;
  flex-direction: column;
}

.assistant-panel__header {
  padding: 16px;
  border-bottom: 1px solid var(--rule-2);
}

.assistant-panel__header-left {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.assistant-panel__chat {
  flex: 1;
  overflow: auto;
}

.assistant-panel__msg-body {
  white-space: pre-wrap;
}

.message-error {
  color: var(--error);
}

.deal-intake__hero,
.deal-intake__category {
  margin-bottom: 16px;
  padding: 28px;
}

.deal-intake__category {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.deal-intake__card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
}

.deal-intake__card h2,
.supporting-docs-web h2 {
  margin: 0;
  font-size: 18px;
}

.deal-history-web__toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.deal-history-web__toolbar input {
  flex: 1;
}

.deal-history-web__empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 24px 0;
}

.deal-history-web__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deal-history-web__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--fog);
  border-radius: var(--r-sm);
  background: var(--paper);
}

.deal-history-web__main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.deal-history-web__main span {
  color: var(--slate);
  font-size: 13px;
}

.deal-history-web__actions,
.export-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.web-metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.web-metrics-strip > div {
  padding: 12px;
  border: 1px solid var(--fog);
  background: var(--paper);
  border-radius: var(--r-sm);
}

.web-metrics-strip span {
  display: block;
  color: var(--slate);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.web-metrics-strip strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field input,
.field select,
.field textarea,
.deal-intake textarea,
.deal-intake select,
.deal-history-web__toolbar input,
.settings-web__grid input,
.settings-web__grid select {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--fog);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink);
}

.field textarea,
.deal-intake textarea {
  min-height: 110px;
}

.field-wrapper {
  min-width: 0;
}

.field-wrapper__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.field-wrapper__actions {
  display: flex;
  gap: 6px;
}

.field-label-editable,
.export-panel__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--slate);
  text-transform: uppercase;
}

.req {
  color: var(--cobalt);
}

.supporting-docs-web {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: none;
}

.memo-web__grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
}

.memo-web__pipeline ol {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 18px;
}

.memo-web__pipeline li {
  color: var(--slate);
}

.memo-web__pipeline li span {
  display: block;
  font-size: 12px;
}

.memo-web__section {
  padding: 16px 0;
  border-top: 1px solid var(--rule-2);
}

.memo-web__section h3 {
  margin-bottom: 8px;
  text-transform: capitalize;
}

.memo-web__qa {
  margin-top: 16px;
}

.memo-web__qa pre,
.memo-live-draft__text {
  overflow: auto;
  white-space: pre-wrap;
}

.export-panel__group {
  margin-bottom: 18px;
}

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

.export-panel__choice {
  padding: 14px;
  border: 1px solid var(--fog);
  border-radius: var(--r-sm);
}

.export-panel__choice--active {
  border-color: var(--cobalt);
  background: var(--accent-soft);
}

.settings-web__grid {
  display: grid;
  gap: 16px;
}

@media (max-width: 860px) {
  .web-home__grid {
    grid-template-columns: 1fr;
  }

  .app-shell__header {
    height: auto;
    padding: 12px 16px;
  }

  .app-shell__header-row,
  .web-app-page__header {
    flex-direction: column;
  }

  .app-shell__account {
    margin-left: 0;
  }
}

@media (prefers-color-scheme: dark) {
  html {
    color-scheme: light;
  }
}

/* ────────────────────────────────────────────────────────────────────────────
 * v2 layer — entry page, memo sheet, QA review slip, pipeline, ledger rows
 * ──────────────────────────────────────────────────────────────────────────── */

:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 2px;
}

::selection {
  background: rgba(27, 75, 138, 0.18);
}

/* Entry (signed-out) page */

.entry {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.entry__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 64px;
  border-bottom: 1px solid var(--rule-2);
}

.entry__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.entry__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--navy);
  color: var(--on-dark);
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-size: 19px;
  font-style: italic;
}

.entry__wordmark {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.entry__main {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 64px;
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 64px 32px 40px;
}
/* Keep the footer pinned to the bottom now that the hero is natural height. */
.entry__footer { margin-top: auto; }

.entry__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.6rem, 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 18px 0 20px;
}

.entry__lead {
  color: var(--slate);
  font-size: 1.05rem;
  line-height: 1.65;
  max-width: 46ch;
  margin-bottom: 28px;
}

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

.entry__specimen {
  display: flex;
  justify-content: center;
}

.entry__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-top: 1px solid var(--rule-2);
  color: var(--muted);
  font-size: 0.85rem;
}

.entry__footer a {
  color: var(--cobalt);
}

/* Memo sheet — the memo rendered as a committee document on paper */

.memo-sheet {
  background: var(--paper);
  border: 1px solid var(--fog);
  border-top: 3px solid var(--navy);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  padding: 40px 44px 48px;
  min-height: 420px;
}

.memo-sheet__letterhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--ink);
}

.memo-sheet__doctype {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-style: italic;
  letter-spacing: 0.01em;
}

.memo-sheet__version {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.memo-sheet__section {
  margin-bottom: 26px;
}

.memo-sheet__section h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.35rem;
  margin-bottom: 10px;
}

.memo-sheet__section-num {
  display: inline-block;
  min-width: 1.6em;
  color: var(--cobalt);
}

.memo-sheet__section p,
.memo-sheet__live p {
  line-height: 1.7;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 0.95rem;
}

.memo-sheet__live {
  position: relative;
}

.memo-sheet__caret {
  display: inline-block;
  width: 9px;
  height: 1.1em;
  vertical-align: text-bottom;
  background: var(--cobalt);
  animation: memo-caret 1s steps(2) infinite;
}

@keyframes memo-caret {
  50% { opacity: 0; }
}

.memo-sheet__empty {
  padding: 48px 0;
  text-align: center;
}

.memo-sheet__empty p:first-child {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.memo-sheet__empty .muted {
  max-width: 44ch;
  margin: 0 auto;
  line-height: 1.6;
}

/* Specimen variant on the entry page */

.memo-sheet--specimen {
  width: min(360px, 100%);
  padding: 26px 28px 28px;
  min-height: 0;
  transform: rotate(-0.6deg);
}

.memo-sheet--specimen .memo-sheet__doctype {
  font-size: 1.05rem;
}

.memo-sheet__specimen-name {
  font-weight: 600;
  margin-bottom: 2px;
}

.memo-sheet__specimen-sub {
  color: var(--slate);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.memo-sheet__figures {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 16px;
  margin-bottom: 18px;
}

.memo-sheet__figures div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px dotted var(--fog);
  padding-bottom: 4px;
}

.memo-sheet__figures dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.memo-sheet__figures dd {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.memo-sheet__specimen-lines {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.memo-sheet__specimen-lines span {
  display: block;
  height: 7px;
  background: var(--smoke);
  border-radius: 2px;
}

/* Pipeline rail — a true sequence, so the numbering carries meaning */

.pipeline {
  list-style: none;
  display: grid;
  gap: 2px;
  margin-bottom: 20px;
}

.pipeline__step {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-left: 2px solid var(--fog);
  background: transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.pipeline__step--active {
  border-left-color: var(--cobalt);
  background: var(--accent-soft);
}

.pipeline__step--done {
  border-left-color: var(--emerald);
}

.pipeline__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: none;
  margin-top: 1px;
  border: 1px solid var(--fog);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--slate);
  background: var(--paper);
}

.pipeline__step--active .pipeline__num {
  border-color: var(--cobalt);
  color: var(--cobalt);
}

.pipeline__step--done .pipeline__num {
  border-color: var(--emerald);
  color: var(--emerald);
}

.pipeline__body {
  display: grid;
  gap: 2px;
}

.pipeline__body strong {
  font-size: 0.9rem;
}

.pipeline__body span {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

/* QA review slip */

.qa-slip {
  background: var(--paper);
  border: 1px solid var(--fog);
  border-radius: var(--r-md);
  padding: 16px;
}

.qa-slip__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.qa-slip__count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.qa-slip__verdict {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  line-height: 1.4;
}

.qa-slip__verdict--pass {
  background: var(--success-soft);
  color: var(--emerald);
}

.qa-slip__verdict--blocked {
  background: var(--error-soft);
  color: var(--error);
}

.qa-slip__seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: none;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 0.8rem;
}

.qa-slip__list {
  list-style: none;
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.qa-slip__item {
  display: grid;
  gap: 3px;
  padding: 8px 10px 8px 12px;
  border-left: 2px solid var(--fog);
  font-size: 0.82rem;
  line-height: 1.5;
}

.qa-slip__item--error {
  border-left-color: var(--error);
}

.qa-slip__item--warning {
  border-left-color: var(--amber);
}

.qa-slip__item-code {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.qa-slip__item-section {
  color: var(--slate);
  font-style: normal;
}

/* Memo page grid override */

.memo-web__grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.memo-web__rail {
  position: sticky;
  top: 24px;
}

/* Deals ledger rows */

.deal-history-web__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 16px;
}

.deal-history-web__date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--fog);
  background: var(--smoke);
  color: var(--slate);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.status-chip--memo-generated {
  border-color: rgba(26, 122, 74, 0.3);
  background: var(--success-soft);
  color: var(--emerald);
}

/* App nav active state */

.app-shell__nav-btn--active {
  background: rgba(240, 237, 232, 0.14);
  color: var(--on-dark);
}

/* Export layout */

.export-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.export-versions__list {
  list-style: none;
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.export-versions__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--fog);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.export-versions__row:hover {
  border-color: var(--accent-line);
}

.export-versions__row--active {
  border-color: var(--cobalt);
  background: var(--accent-soft);
}

.export-versions__row input {
  accent-color: var(--cobalt);
}

.export-versions__num {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  min-width: 2.4em;
}

.export-versions__meta {
  flex: 1;
  font-size: 0.85rem;
  color: var(--slate);
}

.export-versions__qa {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 960px) {
  .entry__main {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 32px;
  }

  .entry__specimen {
    justify-content: flex-start;
  }

  .memo-web__grid {
    grid-template-columns: 1fr;
  }

  .memo-web__rail {
    position: static;
  }

  .memo-sheet {
    padding: 26px 22px 32px;
  }

  .export-layout {
    grid-template-columns: 1fr;
  }

  .deal-history-web__row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
  }

  .deal-history-web__date {
    display: none;
  }
}

/* QA slip tiers + acknowledge-to-export (mirrors desktop UnifiedQAPanel) */

.qa-slip__tier-label {
  margin-top: 14px;
  margin-bottom: 6px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate);
  font-weight: 600;
}

.qa-slip__ack {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--slate);
  cursor: pointer;
}

.qa-slip__ack input {
  accent-color: var(--emerald);
}

.qa-slip__item--advisory {
  border-left-color: var(--cobalt);
}

.qa-slip__advisories {
  margin-top: 14px;
}

.qa-slip__advisories summary {
  font-size: 0.78rem;
  color: var(--slate);
  cursor: pointer;
}

.qa-slip__advisories .qa-slip__list {
  margin-top: 8px;
}

/* ── Document intake: checklist, dropzone, extraction cards ── */

.docs-panel { display: grid; gap: 20px; }
.docs-panel__intro h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; margin: 4px 0 4px; }

.docs-checklist { display: grid; gap: 6px; }
.docs-checklist__item {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--fog); border-radius: var(--r-sm); background: var(--paper);
}
.docs-checklist__item--done { border-color: rgba(26,122,74,.35); background: var(--success-soft); }
.docs-checklist__check { color: var(--muted); font-size: .9rem; }
.docs-checklist__item--done .docs-checklist__check { color: var(--emerald); }
.docs-checklist__body { display: grid; gap: 1px; }
.docs-checklist__body strong { font-size: .9rem; }
.docs-checklist__body span { font-size: .8rem; color: var(--muted); }
.docs-checklist__tag {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; padding: 3px 9px;
  border-radius: var(--r-pill); border: 1px solid var(--fog); color: var(--slate); white-space: nowrap;
}
.docs-checklist__tag--required { border-color: rgba(193,125,17,.4); color: var(--amber); background: var(--warn-soft); }

.docs-drop {
  display: grid; justify-items: center; gap: 8px; text-align: center;
  padding: 28px; border: 1.5px dashed var(--fog); border-radius: var(--r-md);
  background: var(--paper); transition: border-color .2s var(--ease), background .2s var(--ease);
}
.docs-drop--active { border-color: var(--cobalt); background: var(--accent-soft); }
.docs-drop p { color: var(--slate); font-size: .9rem; }
.docs-drop__hint { font-size: .78rem; }

.docs-results { display: grid; gap: 14px; }
.docs-card { border: 1px solid var(--fog); border-radius: var(--r-md); background: var(--paper); box-shadow: var(--shadow-card); padding: 16px 18px; }
.docs-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.docs-card__head strong { display: block; font-size: .95rem; }
.docs-card__type { font-size: .8rem; color: var(--slate); }
.docs-card__confidence { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; padding: 3px 10px; border-radius: var(--r-pill); white-space: nowrap; }
.docs-card__confidence--high { background: var(--success-soft); color: var(--emerald); }
.docs-card__confidence--low { background: var(--warn-soft); color: var(--amber); }

.docs-fields { list-style: none; display: grid; gap: 2px; }
.docs-field {
  display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 14px;
  padding: 11px 12px; border-top: 1px solid var(--rule-2);
}
.docs-field:first-child { border-top: none; }
.docs-field__main { display: grid; gap: 2px; }
.docs-field__label { font-size: .82rem; color: var(--slate); }
.docs-field__derived { color: var(--cobalt); font-style: normal; font-size: .72rem; }
.docs-field__value { font-family: var(--font-mono); font-size: .95rem; }
.docs-field__source { font-size: .76rem; color: var(--muted); font-style: italic; }
.docs-field__conflict { font-size: .74rem; color: var(--amber); }
.docs-field__action { display: flex; align-items: center; gap: 10px; }
.docs-field__conf { font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.docs-field__conf--high { color: var(--emerald); }
.docs-field__conf--low { color: var(--amber); }
.docs-field__applied { font-size: .78rem; color: var(--emerald); white-space: nowrap; }

@media (max-width: 760px) {
  .docs-checklist__item { grid-template-columns: auto minmax(0,1fr); }
  .docs-checklist__tag { grid-column: 2; justify-self: start; }
  .docs-field { grid-template-columns: 1fr; }
  .docs-field__action { justify-content: flex-start; }
}

/* ── Sensitivity / stress-test panel ── */

.deal-sensitivity { margin-top: 16px; }
.deal-sensitivity > summary {
  cursor: pointer; font-family: var(--font-display); font-size: 1.15rem; padding: 10px 0;
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.deal-sensitivity > summary::before { content: "▸"; color: var(--cobalt); transition: transform .2s var(--ease); }
.deal-sensitivity[open] > summary::before { transform: rotate(90deg); }
.deal-sensitivity__body { margin-top: 8px; }

.sens-panel { display: grid; gap: 16px; }
.sens-panel__head { display: flex; align-items: flex-end; justify-content: space-between; }
.sens-panel__head h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.3rem; margin-top: 2px; }

.sens-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.sens-preset {
  padding: 6px 12px; border: 1px solid var(--fog); border-radius: var(--r-pill);
  background: var(--paper); font-size: .8rem; color: var(--slate);
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.sens-preset:hover { border-color: var(--cobalt); color: var(--cobalt); }

.sens-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.sens-tile {
  display: grid; gap: 3px; padding: 12px 14px; background: var(--paper);
  border: 1px solid var(--fog); border-top: 3px solid var(--fog); border-radius: var(--r-sm);
}
.sens-tile__label { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sens-tile__value { font-family: var(--font-mono); font-size: 1.35rem; }
.sens-tile__status { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.sens-tile__drift { font-size: .72rem; }

.sens-chart { border: 1px solid var(--fog); border-radius: var(--r-sm); background: var(--paper); padding: 12px 8px 4px; }

.sens-sliders { display: grid; gap: 14px; }
.sens-slider { display: grid; gap: 6px; }
.sens-slider__row { display: flex; justify-content: space-between; font-size: .85rem; }
.sens-slider__val { font-family: var(--font-mono); color: var(--cobalt); }
.sens-slider input[type="range"] { width: 100%; accent-color: var(--cobalt); }

.sens-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sens-actions .muted { font-size: .8rem; }

@media (max-width: 760px) {
  .sens-tiles { grid-template-columns: repeat(2, 1fr); }
}

/* Document intake — "drop everything, we sort it" reframe */
.docs-drop--hero { padding: 40px 28px; border-width: 2px; }
.docs-drop__lead { font-family: var(--font-display); font-size: 1.25rem; color: var(--ink); }
.docs-coverage {
  padding: 12px 16px; background: var(--accent-soft); border: 1px solid var(--accent-line);
  border-radius: var(--r-sm); font-size: .9rem; color: var(--ink);
}
.docs-coverage strong { font-family: var(--font-mono); }
.docs-card__head-right { display: flex; align-items: center; gap: 10px; }
.docs-coverage-map { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding-top: 4px; }
.docs-coverage-col__label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.docs-coverage-col ul { list-style: none; display: grid; gap: 6px; }
.docs-coverage-row { display: grid; grid-template-columns: auto 1fr; gap: 8px; font-size: .85rem; align-items: baseline; }
.docs-coverage-row span:first-child { color: var(--muted); }
.docs-coverage-row--found span:first-child { color: var(--emerald); }
.docs-coverage-row__feeds { color: var(--muted); font-style: normal; font-size: .78rem; }
@media (max-width: 760px) { .docs-coverage-map { grid-template-columns: 1fr; } }

/* ── Describe deal (paste → fill_form) + FormFillCard ── */
.describe-deal__open {
  width: 100%; text-align: left; display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; margin-bottom: 16px; border: 1px dashed var(--accent-line);
  border-radius: var(--r-md); background: var(--accent-soft); color: var(--cobalt);
  font-size: .95rem; transition: border-color .2s var(--ease), background .2s var(--ease);
}
.describe-deal__open:hover { border-color: var(--cobalt); }
.describe-deal__spark { font-size: 1.1rem; }
.describe-deal { margin-bottom: 16px; display: grid; gap: 12px; }
.describe-deal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.describe-deal__close { font-size: 1.4rem; line-height: 1; color: var(--muted); background: none; padding: 0 4px; }
.describe-deal__input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--fog); border-radius: var(--r-sm);
  background: var(--paper); font: inherit; font-size: .95rem; resize: vertical; line-height: 1.5;
}
.describe-deal__actions { display: flex; gap: 10px; }

.fillcard { margin-top: 4px; border: 1px solid var(--fog); border-radius: var(--r-md); background: var(--paper); padding: 16px 18px; display: grid; gap: 14px; }
.fillcard__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fillcard__summary { font-size: .9rem; color: var(--ink); margin-top: 2px; line-height: 1.5; }
.fillcard__industry { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--slate); border: 1px solid var(--fog); border-radius: var(--r-pill); padding: 3px 10px; white-space: nowrap; }
.fillcard__step { display: grid; gap: 6px; }
.fillcard__step-label { display: flex; align-items: center; gap: 8px; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.fillcard__step-num { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border: 1px solid var(--fog); border-radius: 50%; font-family: var(--font-mono); font-size: .7rem; color: var(--slate); }
.fillcard__fields { list-style: none; display: grid; gap: 2px; }
.fillcard__field { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--rule-2); }
.fillcard__field:first-child { border-top: none; }
.fillcard__check input { accent-color: var(--cobalt); }
.fillcard__field-body { display: grid; gap: 2px; }
.fillcard__field-label { font-size: .82rem; color: var(--slate); }
.fillcard__field-value { font-family: var(--font-mono); font-size: .95rem; }
.fillcard__field-why { font-size: .76rem; color: var(--muted); }
.fillcard__conf { display: inline-flex; align-items: center; gap: 5px; font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.fillcard__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.fillcard__conf--high .fillcard__dot { background: var(--emerald); }
.fillcard__conf--medium .fillcard__dot { background: var(--amber); }
.fillcard__conf--low .fillcard__dot { background: var(--error); }
.fillcard__missing { font-size: .8rem; color: var(--slate); }
.fillcard__actions { display: flex; gap: 10px; }
.fillcard__done { color: var(--emerald); font-size: .9rem; }

.docs-card__meta { color: var(--muted); }
.docs-card__warning { font-size: .8rem; color: var(--amber); }

.qa-slip__tier-label--blocking { color: var(--error); }
.qa-slip__tier-label--warning { color: var(--amber); }
.qa-slip__tier-label--advisory { color: var(--cobalt); }

/* ── ✦ Draft narrative field + card ── */
.draft-field { display: grid; gap: 8px; }
.draft-field__area { position: relative; }
.draft-field__spark {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px;
  border: 1px solid var(--accent-line); border-radius: var(--r-sm);
  background: var(--paper); color: var(--cobalt); font-size: .95rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.draft-field__spark:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--cobalt); }
.draft-field__spark:disabled { opacity: .6; cursor: default; }
.draft-field__error { font-size: .8rem; color: var(--error); }
.draft-card { border: 1px solid var(--accent-line); border-radius: var(--r-md); background: var(--accent-soft); padding: 12px 14px; display: grid; gap: 8px; }
.draft-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.draft-card__target { font-size: .75rem; color: var(--slate); }
.draft-card__text { font-size: .92rem; line-height: 1.6; color: var(--ink); white-space: pre-wrap; }
.draft-card__notes { font-size: .78rem; color: var(--slate); font-style: italic; }
.draft-card__actions { display: flex; gap: 8px; }

/* ── Memo style learning card ── */
.settings-stack { display: grid; gap: 16px; }
.style-card { display: grid; gap: 14px; }
.style-card__head h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; margin: 4px 0; }
.style-card__profile { display: grid; gap: 10px; border: 1px solid var(--fog); border-radius: var(--r-sm); padding: 14px; background: var(--paper); }
.style-card__profile-head { display: flex; align-items: center; justify-content: space-between; }
.style-card__badge { font-size: .75rem; color: var(--emerald); background: var(--success-soft); border-radius: var(--r-pill); padding: 3px 10px; }
.style-card__summary { font-size: .95rem; line-height: 1.5; }
.style-card__details summary { font-size: .82rem; color: var(--cobalt); cursor: pointer; }
.style-card__block { white-space: pre-wrap; font-family: var(--font-mono); font-size: .78rem; line-height: 1.5; color: var(--slate); background: var(--smoke); border-radius: var(--r-sm); padding: 10px 12px; margin-top: 8px; }
.style-card__actions { display: flex; gap: 8px; }
