:root {
  --ink: #070908;
  --ink-soft: #121614;
  --paper: #f1f3ef;
  --white: #fff;
  --lime: #d7ff00;
  --aqua: #00efb5;
  --teal: #007e75;
  --blue: #075cff;
  --muted: #626b67;
  --line: #cbd1cd;
  --danger: #a12720;
  --shell: min(1160px, calc(100% - 48px));
  --shadow: 0 24px 75px rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Arial, Helvetica, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.skip-link { position: fixed; z-index: 999; top: 10px; left: 10px; transform: translateY(-160%); padding: 10px 15px; background: var(--lime); font-weight: 900; }
.skip-link:focus { transform: none; }
.portal-shell { width: var(--shell); margin-inline: auto; }
.section-kicker { color: var(--teal); font-size: 9px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--aqua); font-size: 9px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow span { width: 28px; height: 2px; background: currentColor; }
.portal-header {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1160px) / 2));
  background: var(--ink);
  color: var(--white);
}
.portal-brand { display: flex; align-items: center; gap: 13px; }
.portal-brand img { width: 112px; filter: brightness(0) invert(1); }
.portal-brand span { padding-left: 13px; border-left: 1px solid #47504c; color: #aab2ae; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.header-link { color: #b8c0bc; font-size: 10px; font-weight: 800; }
.portal-hero { padding: 90px 0 78px; background: var(--ink); color: var(--white); }
.hero-grid { display: grid; grid-template-columns: 1fr .5fr; gap: 80px; align-items: end; }
.portal-hero h1 { margin: 15px 0 0; font-size: clamp(51px, 7vw, 83px); font-weight: 900; letter-spacing: -.07em; line-height: .93; }
.portal-hero h1 em { color: var(--lime); font-style: normal; }
.portal-hero p { margin: 0; color: #aab2ae; font-size: 13px; line-height: 1.75; }
.access-section { padding: 70px 0; }
.access-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr auto;
  gap: 18px;
  align-items: end;
  padding: 32px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.access-card h2 { margin: 6px 0 0; font-size: 28px; letter-spacing: -.04em; }
.access-card label, .auth-card label { display: grid; gap: 7px; }
.access-card label span, .auth-card label span, .field > span, .list-toolbar span {
  color: #525a56;
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.access-card input, .auth-card input, .field input, .field select, .field textarea, .list-toolbar select {
  width: 100%;
  min-height: 47px;
  padding: 0 12px;
  border: 1px solid #c7ceca;
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
}
.field textarea { min-height: 100px; padding-block: 12px; resize: vertical; }
.primary-action, .secondary-action {
  min-height: 45px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 12px 16px;
  border: 1px solid var(--ink);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
}
.primary-action { background: var(--ink); color: var(--white); }
.primary-action:disabled { cursor: not-allowed; opacity: .45; }
.secondary-action { background: var(--white); color: var(--ink); }
.secondary-action.danger { border-color: #b7605a; color: var(--danger); }
.form-message { min-height: 16px; margin: 8px 0 0; color: var(--danger); font-size: 9px; font-weight: 700; line-height: 1.5; }
.form-message.success { color: var(--teal); }
.access-card .form-message { grid-column: 2 / -1; margin: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #55a7ff; outline-offset: 2px; }

.journey-section { padding: 75px 0 110px; }
.journey-top, .card-heading, .view-heading, .detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
}
.journey-top { margin-bottom: 34px; }
.journey-top h2 { margin: 8px 0 0; font-size: 38px; letter-spacing: -.045em; }
.status-pill, .status-tag {
  display: inline-flex;
  padding: 8px 11px;
  background: #dff3ec;
  color: #075d4e;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.timeline { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0 0 26px; padding: 0; list-style: none; }
.timeline li { min-height: 110px; display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 20px 15px; border: 1px solid #c6cdc9; color: #7a827e; }
.timeline li + li { border-left: 0; }
.timeline b { font-size: 8px; }
.timeline strong, .timeline span { display: block; }
.timeline strong { font-size: 11px; }
.timeline span { margin-top: 5px; font-size: 8.5px; line-height: 1.4; }
.timeline li.is-active { background: var(--ink); color: var(--white); }
.timeline li.is-active b { color: var(--lime); }
.timeline li.is-complete { background: #e0f3ec; color: #0a5d4f; }
.overview-card, .proposal-card, .document-card, .panel-card {
  margin-top: 20px;
  padding: 31px;
  background: var(--white);
  box-shadow: 0 16px 55px rgba(0, 0, 0, .07);
}
.card-heading { margin-bottom: 24px; }
.card-heading h2, .card-heading h3 { margin: 6px 0 0; font-size: 27px; letter-spacing: -.035em; }
.data-grid, .detail-grid, .invoice-identifiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0;
  padding: 1px;
  background: #d9dedb;
}
.data-grid > div, .detail-grid > div, .invoice-identifiers > div { min-height: 78px; padding: 15px; background: #f5f7f4; }
.data-grid dt, .detail-grid dt, .invoice-identifiers dt { color: #6b736f; font-size: 7.5px; font-weight: 900; text-transform: uppercase; }
.data-grid dd, .detail-grid dd, .invoice-identifiers dd { margin: 7px 0 0; font-size: 11px; font-weight: 800; line-height: 1.45; }
.institution-line { margin-bottom: 18px; padding: 18px; border-left: 4px solid var(--teal); background: #edf2ef; }
.institution-line span, .institution-line strong, .institution-line small { display: block; }
.institution-line span { color: var(--muted); font-size: 8px; font-weight: 900; text-transform: uppercase; }
.institution-line strong { margin-top: 5px; font-size: 18px; }
.institution-line small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.proposal-notes, .additional-info { margin-top: 16px; padding: 16px; border: 1px solid #cdd3cf; }
.proposal-notes span, .additional-info span { color: var(--muted); font-size: 8px; font-weight: 900; text-transform: uppercase; }
.proposal-notes p, .additional-info p { margin: 7px 0 0; font-size: 10px; line-height: 1.65; }
.decision-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }

.contract-paper, .invoice-paper {
  max-width: 860px;
  margin: 0 auto;
  padding: 42px;
  border: 1px solid #bfc6c2;
  background: var(--white);
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
}
.paper-head { display: flex; align-items: center; justify-content: space-between; gap: 25px; padding-bottom: 17px; border-bottom: 2px solid #111; }
.paper-head img { width: 110px; }
.paper-head div { text-align: right; }
.paper-head strong, .paper-head span { display: block; }
.paper-head strong { font-size: 9px; text-transform: uppercase; }
.paper-head span { margin-top: 4px; font-size: 8px; }
.contract-paper > h4 { margin: 26px auto; max-width: 680px; font-size: 21px; line-height: 1.25; text-align: center; text-transform: uppercase; }
.contract-body section { margin-top: 20px; }
.contract-body h5 { margin: 0 0 6px; font-size: 9px; text-transform: uppercase; }
.contract-body p { margin: 0; font-size: 9px; line-height: 1.65; text-align: justify; }
.signature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 65px; }
.signature-grid div { text-align: center; }
.signature-grid span { display: block; border-top: 1px solid #111; }
.signature-grid b { display: block; margin-top: 5px; font-size: 7px; text-transform: uppercase; }
.invoice-head { display: grid; grid-template-columns: 1fr 120px; border: 2px solid #111; }
.invoice-head > div:first-child { padding: 16px; }
.invoice-head span, .invoice-head strong, .invoice-head small { display: block; }
.invoice-head span { font-size: 7px; text-transform: uppercase; }
.invoice-head strong { margin-top: 5px; font-size: 12px; }
.invoice-head small { margin-top: 4px; font-size: 8px; }
.invoice-model { display: grid; place-items: center; padding: 12px; border-left: 2px solid #111; text-align: center; }
.invoice-model b { font-size: 24px; }
.invoice-model span { font-size: 7px; }
.invoice-identifiers { grid-template-columns: repeat(4, 1fr); margin-top: 8px; }
.access-key-block { margin-top: 8px; padding: 14px; border: 1px solid #111; text-align: center; }
.access-key-block span, .access-key-block strong { display: block; }
.access-key-block span { font-size: 7px; text-transform: uppercase; }
.access-key-block strong { margin-top: 7px; font-size: 10px; letter-spacing: .05em; overflow-wrap: anywhere; }
.invoice-paper > .data-grid { margin-top: 8px; }

.auth-screen { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; background: var(--white); }
.auth-visual { position: relative; min-height: 100vh; overflow: hidden; background: var(--ink); color: var(--white); }
.auth-visual > img, .auth-shade { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.auth-shade { background: linear-gradient(0deg, rgba(0,0,0,.9), rgba(0,0,0,.15)); }
.auth-brand { position: absolute; z-index: 2; top: 34px; left: 42px; display: flex; align-items: center; gap: 13px; }
.auth-brand img { width: 122px; filter: brightness(0) invert(1); }
.auth-brand span { padding-left: 13px; border-left: 1px solid rgba(255,255,255,.4); color: #bdc5c1; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.auth-copy { position: absolute; z-index: 2; left: 42px; right: 42px; bottom: 55px; }
.auth-copy > span { color: var(--aqua); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.auth-copy h1 { margin: 15px 0 0; font-size: clamp(48px, 6vw, 78px); line-height: .94; letter-spacing: -.07em; }
.auth-copy h1 em { color: var(--lime); font-style: normal; }
.auth-panel { display: grid; place-items: center; padding: 45px; overflow-y: auto; }
.auth-card { width: min(440px, 100%); display: grid; gap: 18px; }
.auth-card h2 { margin: 0; font-size: 38px; letter-spacing: -.05em; }
.auth-card > p { margin: -7px 0 3px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.auth-card .primary-action { width: 100%; margin-top: 4px; }
.setup-card { width: min(560px, 100%); gap: 14px; padding-block: 24px; }
.setup-card fieldset { display: grid; gap: 13px; margin: 0; padding: 17px; border: 1px solid var(--line); }
.setup-card legend { padding: 0 8px; color: var(--teal); font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.quiet-link { color: var(--muted); font-size: 9px; font-weight: 800; }

.seller-app { min-height: 100vh; padding-top: 68px; padding-left: 245px; }
.seller-header {
  position: fixed;
  z-index: 40;
  inset: 0 0 auto 0;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 25px;
  background: var(--ink);
  color: var(--white);
}
.seller-identity { display: flex; align-items: center; gap: 18px; }
.seller-identity span { font-size: 10px; font-weight: 800; }
.seller-identity button { border: 0; border-bottom: 1px solid #78817d; background: transparent; color: #aeb6b2; font-size: 9px; cursor: pointer; }
.seller-sidebar {
  position: fixed;
  z-index: 30;
  top: 68px;
  bottom: 0;
  left: 0;
  width: 245px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px 20px;
  background: #0d100f;
  color: var(--white);
}
.seller-sidebar nav { display: grid; gap: 5px; }
.nav-item {
  min-height: 49px;
  display: grid;
  grid-template-columns: 27px 1fr;
  align-items: center;
  padding: 0 13px;
  border: 0;
  background: transparent;
  color: #89918d;
  font-size: 10px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.nav-item span { color: #555d59; font-size: 8px; }
.nav-item.is-active { background: var(--white); color: var(--ink); }
.nav-item.is-active span { color: var(--teal); }
.seller-sidebar > a { padding: 13px; border-top: 1px solid #303532; color: #929a96; font-size: 9px; }
.seller-main { padding: 42px; }
.seller-view { max-width: 1450px; margin-inline: auto; }
.view-heading { margin-bottom: 30px; }
.view-heading h1 { margin: 7px 0 0; font-size: 45px; letter-spacing: -.055em; }
.metric-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.metric-grid article { min-height: 130px; padding: 20px; background: var(--white); box-shadow: 0 12px 35px rgba(0,0,0,.05); }
.metric-grid span { color: var(--muted); font-size: 8px; font-weight: 900; text-transform: uppercase; }
.metric-grid strong { display: block; margin-top: 22px; font-size: 38px; letter-spacing: -.06em; }
.panel-card { margin-top: 24px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 10px; }
th, td { padding: 14px 11px; border-bottom: 1px solid #d4d9d6; text-align: left; }
th { color: #67706b; font-size: 8px; text-transform: uppercase; }
.row-action { padding: 7px 0; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: var(--teal); font-size: 8px; font-weight: 900; cursor: pointer; }
.empty-cell { padding: 35px; color: var(--muted); text-align: center; }
.split-workspace { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
.quote-list-card, .quote-detail-card { margin-top: 0; padding: 0; overflow: hidden; }
.list-toolbar { padding: 17px; border-bottom: 1px solid #d1d7d3; }
.list-toolbar label { display: grid; gap: 6px; }
.quote-list { max-height: calc(100vh - 260px); overflow-y: auto; }
.quote-item { width: 100%; display: grid; gap: 4px; padding: 17px; border: 0; border-bottom: 1px solid #d7dcd9; background: var(--white); text-align: left; cursor: pointer; }
.quote-item:hover, .quote-item.is-active { background: #edf2ef; }
.quote-item > span { color: var(--teal); font-size: 7.5px; font-weight: 900; }
.quote-item strong { font-size: 12px; }
.quote-item small { color: var(--muted); font-size: 8.5px; }
.quote-item i { margin-top: 5px; color: #636b67; font-size: 7.5px; font-style: normal; font-weight: 900; text-transform: uppercase; }
.quote-detail-card { min-height: 500px; padding: 27px; }
.empty-state { min-height: 240px; display: grid; place-content: center; justify-items: center; padding: 25px; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--ink); font-size: 18px; }
.empty-state p { max-width: 310px; font-size: 10px; line-height: 1.6; }
.detail-heading { padding-bottom: 22px; border-bottom: 1px solid #d5dad7; }
.detail-heading h2 { margin: 6px 0 0; font-size: 30px; letter-spacing: -.045em; }
.detail-block { margin-top: 24px; }
.block-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.block-title span { color: var(--teal); font-size: 8px; font-weight: 900; text-transform: uppercase; }
.block-title strong { font-size: 11px; }
.detail-grid { grid-template-columns: repeat(2, 1fr); }
.workflow-block { padding-top: 24px; border-top: 2px solid var(--ink); }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.field { min-width: 0; display: grid; gap: 7px; align-content: start; }
.span-2 { grid-column: span 2; }
.form-footer, .workflow-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 23px; }
.form-footer .form-message, .workflow-actions .form-message { flex: 1 1 220px; margin: 0 auto 0 0; }
.locked-select { margin-bottom: 14px; }
.locked-select select, .workflow-form select:disabled { background: #edf1ee; color: #555e59; }
.flow-note { display: inline-flex; padding: 11px 13px; background: #eef2ef; color: #4f5753; font-size: 9px; font-weight: 800; }
.flow-note.accepted { background: #dff3ec; color: #075d4e; }
.flow-note.rejected { background: #f8e5e3; color: #8d2a23; }
.break-all { overflow-wrap: anywhere; }
.institution-list { display: grid; gap: 8px; }
.institution-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px; border: 1px solid #d0d6d2; }
.institution-card > div { display: flex; align-items: center; gap: 13px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #aeb5b1; }
.status-dot.active { background: var(--aqua); box-shadow: 0 0 0 5px rgba(0,239,181,.12); }
.institution-card strong, .institution-card small { display: block; }
.institution-card strong { font-size: 13px; }
.institution-card small { margin-top: 4px; color: var(--muted); font-size: 8.5px; }
.structured-form { max-width: 950px; }
.form-dialog { width: min(900px, calc(100% - 30px)); max-height: calc(100vh - 40px); overflow-y: auto; padding: 30px; border: 0; border-radius: 0; box-shadow: 0 30px 100px rgba(0,0,0,.4); }
.compact-dialog { width: min(650px, calc(100% - 30px)); }
.form-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-dialog::backdrop { background: rgba(0,0,0,.72); }
.dialog-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.dialog-heading h2 { margin: 6px 0 0; font-size: 32px; letter-spacing: -.045em; }
.dialog-close { border: 0; background: transparent; font-size: 31px; cursor: pointer; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .split-workspace { grid-template-columns: 280px minmax(0,1fr); }
  .form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 900px) {
  :root { --shell: min(100% - 34px, 720px); }
  .hero-grid { grid-template-columns: 1fr; gap: 25px; }
  .access-card { grid-template-columns: 1fr 1fr; }
  .access-card > div { grid-column: span 2; }
  .access-card .form-message { grid-column: 1 / -1; }
  .timeline { grid-template-columns: 1fr; }
  .timeline li + li { border-top: 0; border-left: 1px solid #c6cdc9; }
  .data-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-screen { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .seller-app { padding-left: 0; padding-bottom: 74px; }
  .seller-sidebar { top: auto; right: 0; width: auto; height: 70px; padding: 8px; }
  .seller-sidebar nav { grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); }
  .seller-sidebar > a { display: none; }
  .nav-item { min-height: 54px; grid-template-columns: 1fr; justify-items: center; font-size: 8px; }
  .nav-item span { display: none; }
  .seller-main { padding: 28px 18px; }
  .split-workspace { grid-template-columns: 1fr; }
  .quote-list { max-height: 330px; }
}

@media (max-width: 600px) {
  :root { --shell: calc(100% - 26px); }
  .portal-header { height: 64px; padding-inline: 13px; }
  .portal-brand img { width: 98px; }
  .portal-brand span { display: none; }
  .portal-hero { padding: 65px 0 55px; }
  .portal-hero h1 { font-size: 43px; }
  .access-card { grid-template-columns: 1fr; padding: 23px 17px; }
  .access-card > div { grid-column: auto; }
  .journey-top, .card-heading, .view-heading, .detail-heading { align-items: flex-start; flex-direction: column; }
  .overview-card, .proposal-card, .document-card, .panel-card { padding: 21px 15px; }
  .data-grid, .detail-grid, .invoice-identifiers { grid-template-columns: 1fr; }
  .decision-actions { align-items: stretch; flex-direction: column-reverse; }
  .decision-actions button { width: 100%; }
  .contract-paper, .invoice-paper { padding: 22px 16px; }
  .signature-grid { grid-template-columns: 1fr; }
  .invoice-head { grid-template-columns: 1fr 85px; }
  .auth-panel { padding: 30px 20px; }
  .seller-header { padding-inline: 14px; }
  .seller-identity span { display: none; }
  .seller-main { padding: 25px 13px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-grid article { min-height: 105px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .form-footer, .workflow-actions { align-items: stretch; flex-direction: column; }
  .form-footer .primary-action, .workflow-actions .primary-action, .workflow-actions .secondary-action { width: 100%; }
  .form-dialog { padding: 22px 15px; }
  .institution-card { align-items: flex-start; flex-direction: column; }
}

@media print {
  @page { size: A4 portrait; margin: 10mm; }
  body * { visibility: hidden !important; }
  body.print-contract #contract-paper, body.print-contract #contract-paper *,
  body.print-invoice #invoice-paper, body.print-invoice #invoice-paper * { visibility: visible !important; }
  body.print-contract #contract-paper, body.print-invoice #invoice-paper {
    position: absolute;
    top: 0;
    left: 0;
    width: 190mm;
    min-height: 277mm;
    margin: 0;
    padding: 10mm;
    border: 0;
  }
}
