:root {
  --q-primary: #1976d2;
  --q-secondary: #26a69a;
  --q-positive: #21ba45;
  --q-negative: #ff4c5d;
  --page-bg: #eceff1;
  --sticky-bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f5f5f5;
  --text-main: #212121;
  --text-muted: #757575;
  --line: #bdbdbd;
  --input-fill: #0000001a;
  --header-height: 100px;
  --sticky-offset: 16px;
  --actions-bar-height: 57px;
}


* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Roboto, -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-size: 14px;
  color: var(--text-main);
  background: var(--page-bg);
}

.mpn-header-outer {
  position: sticky;
  z-index: 1000;
  top: 0;
  background: #001529;
  box-shadow: 0 1px 3px #0003, 0 1px 1px #00000024, 0 2px 1px -1px #0000001f;
}

.mpn-header-inner {
  height: 100px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.mpn-logo {
  display: flex;
  align-items: center;
}

.mpn-logo-img {
  height: 70px;
  width: auto;
}

.container {
  max-width: 860px;
  margin: 16px auto;
  padding: 0 16px 24px;
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  align-items: start;
}

.form-panel {
  position: sticky;
  top: calc(var(--header-height) + var(--sticky-offset));
  height: calc(100vh - var(--header-height) - 32px - var(--actions-bar-height));
  max-height: calc(100vh - var(--header-height) - 32px - var(--actions-bar-height));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel {
  background: var(--surface);
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 1px 3px #0003, 0 1px 1px #00000024, 0 2px 1px -1px #0000001f;
  padding: 16px;
}

.login-shell {
  max-width: 560px;
  margin: 40px auto;
  padding: 0 16px;
}

.login-panel {
  padding: 20px;
}

.login-form {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.login-hint {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.login-oidc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  padding: 8px 20px;
  min-height: 36px;
  border-radius: 4px;
  background: var(--q-primary);
  color: #fff;
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
}

.login-oidc-btn:hover {
  background: var(--q-secondary);
}


.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-weight: 500;
}

h1 {
  font-size: 1.5rem;
  line-height: 2rem;
}

h2 {
  font-size: 1.25rem;
  line-height: 2rem;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--text-muted);
}

.wizard-meta {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.step-progress {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #d9dee2;
}

.step-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--q-primary);
  transition: width 180ms ease;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.stepper-item {
  min-width: 0;
}

.stepper-step {
  width: 100%;
  min-height: 64px;
  padding: 8px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid #d5dde2;
  background: #fff;
  color: var(--text-main);
  text-align: left;
  letter-spacing: 0;
}

.stepper-step:not([aria-disabled='true']):hover {
  background: #e3f2fd;
}

.stepper-step[aria-disabled='true'] {
  cursor: default;
}

.stepper-step.current[aria-disabled='true']:hover {
  background: #e3f2fd;
}

.stepper-step.upcoming:hover {
  background: #f0f4f8;
}

.stepper-marker {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 2px solid #b0bec5;
  border-radius: 50%;
  background: #fff;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.stepper-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.stepper-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  color: var(--text-main);
  font-size: 12px;
  line-height: 1.25;
}

.stepper-step.completed {
  border-color: #90caf9;
  background: #f4faff;
  cursor: pointer;
}

.stepper-step.completed .stepper-marker {
  border-color: var(--q-primary);
  background: var(--q-primary);
  color: #fff;
}

.stepper-step.current {
  border-color: var(--q-primary);
  background: #e3f2fd;
  box-shadow: inset 0 0 0 1px var(--q-primary);
}

.stepper-step.current .stepper-marker {
  border-color: var(--q-primary);
  background: #fff;
  color: var(--q-primary);
}

.stepper-step.upcoming {
  background: #fafafa;
  color: var(--text-muted);
}

form {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

#contract-form {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

fieldset {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 12px;
  background: #fff;
  display: grid;
  gap: 10px;
}

.step-panel {
  display: none;
}

.step-panel.active {
  flex: 1;
  min-height: 0;
  display: grid;
  align-content: start;
  overflow-y: auto;
}

legend {
  color: #9e9e9e;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 6px;
}

label,
.label-head {
  display: grid;
  gap: 4px;
  color: var(--text-main);
  font-size: 13px;
}

.label-head {
  margin-top: 4px;
  color: #9e9e9e;
  font-weight: 400;
}

.step-info {
  margin: 0;
  padding: 10px;
  background: var(--surface-soft);
  border-left: 4px solid var(--q-secondary);
  color: var(--text-main);
}

.clause-static {
  margin: 0;
  padding: 10px 12px;
  background: #f5f9fc;
  border: 1px solid #d5dde2;
  border-left: 3px solid var(--q-secondary);
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-main);
}

.clause-disclosure {
  border: 1px solid #d5dde2;
  border-radius: 4px;
  background: #fff;
}

.clause-disclosure summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
  list-style: none;
}

.clause-disclosure summary::-webkit-details-marker {
  display: none;
}

.clause-disclosure summary::before {
  content: "›";
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: var(--q-primary);
  font-size: 18px;
  line-height: 1;
  transition: transform 160ms ease;
}

.clause-disclosure summary:hover {
  background: #f5f9fc;
}

.clause-disclosure summary:focus-visible {
  outline: 2px solid var(--q-primary);
  outline-offset: -2px;
}

.clause-disclosure[open] {
  border-color: #90caf9;
}

.clause-disclosure[open] summary {
  background: #e3f2fd;
}

.clause-disclosure[open] summary::before {
  transform: rotate(90deg);
}

.clause-content {
  padding: 10px;
  border-top: 1px solid #d5dde2;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-main);
}

.option-switch-group {
  display: grid;
  gap: 8px;
}

.option-switch {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
  align-items: start;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 8px;
  background: #fff;
}

.option-switch input[type='radio'] {
  margin-top: 2px;
}

.option-switch:has(input[type='radio']:checked) {
  border-color: var(--q-primary);
  background: #e3f2fd;
}

.inline-options {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: start;
}

.inline-options .label-head {
  grid-column: 1 / -1;
}

.hidden-field {
  display: none;
}

.dependent-group {
  display: grid;
  gap: 8px;
}

.dependent-group.hidden-field {
  display: none;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.multi-date {
  display: grid;
  gap: 8px;
}

.multi-date-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e3f2fd;
  color: #1976d2;
  font-size: 12px;
}

.pill-remove {
  border: 0;
  background: transparent;
  color: #1976d2;
  padding: 0;
  min-height: 0;
  line-height: 1;
  cursor: pointer;
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.pill-remove svg {
  width: 12px;
  height: 12px;
}

.pill-remove:hover:not(:disabled) {
  background: #bbdefb;
}

.inline-2,
.inline-3 {
  display: grid;
  gap: 10px;
}

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

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

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

input,
textarea,
select {
  color: var(--text-main);
  border: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.7);
  border-radius: 4px 4px 0 0;
  background: var(--input-fill);
  padding: 9px 10px 8px;
}

input[type='radio'],
input[type='checkbox'] {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  width: auto;
  height: auto;
}

input:focus,
textarea:focus,
select:focus {
  outline: 0;
  border-bottom: 2px solid var(--q-primary);
  padding-bottom: 7px;
}

input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
  border-bottom-color: var(--q-negative);
}

.input-currency-group {
  display: flex;
  align-items: stretch;
}

.input-currency-group input {
  flex: 1;
  min-width: 0;
  border-radius: 4px 0 0 0;
}

.input-currency-group:focus-within .currency-badge {
  border-bottom: 2px solid var(--q-primary);
}

.input-currency-group:has(input:invalid:not(:placeholder-shown)) .currency-badge {
  border-bottom-color: var(--q-negative);
}

.currency-badge {
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.7);
  border-radius: 0 4px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  user-select: none;
}

.field-hint {
  font-size: 11px;
  color: var(--text-muted);
}

button {
  border: 0;
  border-radius: 4px;
  padding: 8px 16px;
  min-height: 36px;
  cursor: pointer;
  background: var(--q-primary);
  color: #fff;
  font-weight: 500;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button[hidden] {
  display: none;
}

button svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

button:hover:not(:disabled) {
  background: #1565c0;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.secondary-btn {
  background: #eceff1;
  border: 1px solid #cfd8dc;
  color: var(--text-main);
}

.secondary-btn:hover:not(:disabled) {
  background: #d9dee2;
}

.secondary-btn:disabled {
  background: #f4f6f7;
  color: #8a8a8a;
}

.btn-danger {
  background: #fdecea;
  border-color: #f5c6c2;
  color: #c0392b;
}

.btn-danger:hover:not(:disabled) {
  background: #fad7d4;
}

.tertiary-btn {
  background: #fff;
  border: 1px dashed #b0bec5;
  color: var(--text-muted);
}

.tertiary-btn:hover:not(:disabled) {
  background: #f5f5f5;
  color: var(--text-main);
}

.tertiary-btn:disabled {
  background: #fafafa;
  color: #9e9e9e;
}

.mpn-header-inner .logout-btn {
  background: transparent;
  border: 1px solid #ffffff66;
  color: #fff;
}

.mpn-header-inner .header-btn {
  background: transparent;
  border: 1px solid #ffffff66;
  color: #fff;
}

.mpn-header-inner .header-btn:hover:not(:disabled) {
  background: #ffffff1a;
}

.wizard-nav {
  display: flex;
  gap: 10px;
  align-items: center;
}

.wizard-nav button {
  min-width: 120px;
}

.status-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 4px 28px 4px 10px;
  border-radius: 999px;
  border: 1.5px solid currentColor;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: opacity 0.15s;
}
.status-select[data-value="draft"]     { color: #616161; background-color: #f5f5f5; border-color: #bdbdbd; }
.status-select[data-value="in_review"] { color: #1565c0; background-color: #e3f2fd; border-color: #90caf9; }
.status-select[data-value="finalized"] { color: #2e7d32; background-color: #e8f5e9; border-color: #a5d6a7; }

.contract-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.contract-status-badge--draft     { color: #616161; background: #f5f5f5; }
.contract-status-badge--in_review { color: #1565c0; background: #e3f2fd; }
.contract-status-badge--finalized { color: #2e7d32; background: #e8f5e9; }

pre {
  margin: 0;
  white-space: pre-wrap;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: #fff;
  padding: 12px;
  min-height: 0;
  overflow: auto;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  line-height: 1.65;
}

.error {
  margin: 0;
  min-height: 20px;
  color: var(--q-negative);
}

.form-status {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 4px;
  border: 1px solid #bbdefb;
  border-left: 4px solid var(--q-secondary);
  background: #e3f2fd;
  color: #0d47a1;
}

.form-status[hidden] {
  display: none;
}

.form-status.status-error {
  border-color: #ffcdd2;
  border-left-color: var(--q-negative);
  background: #ffebee;
  color: #b71c1c;
}

.form-status.status-success {
  border-color: #c8e6c9;
  border-left-color: var(--q-positive);
  background: #e8f5e9;
  color: #1b5e20;
}

.form-status.status-info {
  border-color: #bbdefb;
  border-left-color: var(--q-secondary);
  background: #e3f2fd;
  color: #0d47a1;
}

.app-footer {
  margin-top: 20px;
  background: #001529;
  box-shadow: 0 -1px 3px #0003;
}

.app-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 16px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.footer-brand {
  flex-shrink: 0;
}

.footer-logo-img {
  height: 40px;
  width: auto;
}

.footer-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-copy,
.footer-address {
  margin: 0;
  color: #9e9e9e;
  font-size: 12px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  flex-shrink: 0;
}

.footer-links a {
  color: #9e9e9e;
  text-decoration: none;
  font-size: 12px;
}

.footer-links a:hover {
  color: #fff;
  text-decoration: none;
}

/* ─── Header link-as-button ──────────────────────────────── */

a.header-btn {
  border-radius: 4px;
  padding: 8px 16px;
  min-height: 36px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  line-height: 1;
}

a.header-btn svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

/* ─── Contracts page ─────────────────────────────────────── */

.contracts-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 16px 80px;
}

.contracts-shell-hero {
  margin-bottom: 32px;
}

.contracts-shell-title {
  margin: 6px 0 0;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

/* ─── Start page ─────────────────────────────────────────── */

.start-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 64px 16px 80px;
}

.start-hero {
  text-align: center;
  margin-bottom: 56px;
}

.start-title {
  margin: 6px 0 12px;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.start-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
}

.contract-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.contract-type-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 36px 32px 32px;
  text-decoration: none;
  color: var(--text-main);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

a.contract-type-card:hover {
  border-color: var(--q-primary);
  box-shadow: 0 8px 32px rgba(25, 118, 210, 0.13);
  transform: translateY(-3px);
}

a.contract-type-card:hover .contract-type-arrow {
  color: var(--q-primary);
  transform: translateX(3px);
}

.contract-type-card--soon {
  background: var(--surface-soft);
  opacity: 0.65;
  cursor: not-allowed;
}

.contract-type-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #455a64;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 99px;
}

.contract-type-icon {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: #e3f2fd;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--q-primary);
  flex-shrink: 0;
}

.contract-type-icon svg {
  width: 28px;
  height: 28px;
  stroke-width: 1.75;
}

.contract-type-card--soon .contract-type-icon {
  background: #eceff1;
  color: var(--text-muted);
}

.contract-type-body {
  flex: 1;
}

.contract-type-body h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.contract-type-body p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.65;
}

.contract-type-arrow {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--text-muted);
  transition: color 0.15s ease, transform 0.15s ease;
}

.contract-type-arrow svg {
  width: 20px;
  height: 20px;
}

/* ─────────────────────────────────────────────────────────── */

@media (max-width: 760px) {
  .preview-actions {
    gap: 8px;
  }

  .preview-action-buttons {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  :root {
    --header-height: 72px;
    --sticky-offset: 12px;
  }

  .mpn-header-inner {
    height: 72px;
  }

  .mpn-logo-main {
    font-size: 42px;
  }

  .mpn-logo-sub {
    font-size: 16px;
    max-width: 130px;
  }

  .logout-btn {
    padding: 6px 10px;
    min-height: 30px;
  }

  .container {
    margin: 12px auto;
    padding: 0 10px 16px;
    gap: 10px;
  }

  .panel {
    padding: 12px;
  }

  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .wizard-nav {
    flex-wrap: wrap;
  }

  .wizard-nav button {
    flex: 1 1 120px;
    min-width: 0;
  }

  .stepper {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .stepper-item {
    flex: 0 0 178px;
    scroll-snap-align: start;
  }

  .stepper-step {
    min-height: 60px;
  }

  .inline-2,
  .inline-3 {
    grid-template-columns: 1fr;
  }

  .form-panel {
    position: static;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  #contract-form {
    flex: unset;
    min-height: unset;
    display: grid;
  }

  .step-panel.active {
    flex: unset;
    min-height: unset;
    overflow-y: visible;
  }

  .app-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .footer-links {
    flex-direction: column;
    gap: 6px;
  }
}

.contract-actions-bar {
  position: sticky;
  bottom: 0;
  z-index: 900;
  background: var(--surface);
  border-top: 1px solid #e0e0e0;
  box-shadow: 0 -4px 12px #00000012;
}

.preview-actions {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.preview-action-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  flex: 1;
  justify-content: flex-end;
}

.action-stack {
  display: grid;
  gap: 3px;
}

.action-state {
  min-height: 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}

@media (max-width: 760px) {
  .contract-type-grid {
    grid-template-columns: 1fr;
  }

  .start-title {
    font-size: 1.5rem;
  }
}

/* ─── Start page partner section ─────────────────────────── */

.partner-section {
  margin-top: 48px;
}

.partner-section-title {
  margin: 0 0 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.contract-type-card--partner .contract-type-icon {
  background: #e8f5e9;
  color: #2e7d32;
}

a.contract-type-card--partner:hover {
  border-color: #4caf50;
  box-shadow: 0 8px 32px rgba(76, 175, 80, 0.12);
}

a.contract-type-card--partner:hover .contract-type-arrow {
  color: #4caf50;
}

/* ─── Promo request page ──────────────────────────────────── */

.promo-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 16px 80px;
}

.promo-hero {
  text-align: center;
  margin-bottom: 40px;
}

.promo-title {
  margin: 6px 0 12px;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.promo-subtitle {
  margin: 0 auto;
  max-width: 560px;
  color: var(--text-muted);
  font-size: 1rem;
}

#promo-form {
  margin-top: 0;
  gap: 16px;
}

.promo-section {
  display: grid;
  gap: 12px;
}

.promo-section-title {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.promo-form-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.promo-success-panel {
  text-align: center;
  padding: 48px 32px;
}

.promo-success-icon {
  margin: 0 auto 16px;
  color: var(--q-positive);
}

.promo-success-icon svg {
  width: 56px;
  height: 56px;
}

.promo-success-panel h2 {
  margin: 0 0 12px;
}

.promo-success-panel p {
  margin: 0 0 8px;
  color: var(--text-muted);
}

.promo-success-ref {
  margin-top: 24px !important;
  font-size: 12px;
  word-break: break-all;
}

.promo-success-link {
  color: var(--q-primary);
  text-decoration: underline;
  font-family: monospace;
}

@media (max-width: 600px) {
  .promo-title {
    font-size: 1.5rem;
  }
}

.info-hint {
  margin: 0;
  max-width: 320px;
  padding: 10px 12px;
  border: 1px solid #90caf9;
  border-radius: 6px;
  background: #e3f2fd;
  color: #0d47a1;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: inset 0 0 0 1px #ffffff66;
  justify-self: stretch;
}

/* ── Annotation toolbars ────────────────────────────── */
.annotation-toolbar {
  display: none;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}

body.shared-mode .annotation-toolbar {
  display: flex;
}

.annot-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 2px 7px;
  background: transparent;
  border: 1px solid #b0bec5;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
  border-radius: 3px;
  letter-spacing: 0;
}

.annot-btn svg {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

.annot-btn:hover:not(:disabled) {
  background: #f0f4f8;
  border-color: var(--q-primary);
  color: var(--q-primary);
}

.annot-btn[data-type='proposal']:hover:not(:disabled) {
  border-color: #f57c00;
  color: #f57c00;
}

.annot-btn[data-type='confirmation']:hover:not(:disabled) {
  border-color: #388e3c;
  color: #388e3c;
}

.annot-btn.annot-has-entries {
  border-color: var(--q-primary);
  color: var(--q-primary);
}

.annot-btn.annot-has-entries[data-type='proposal'] {
  border-color: #f57c00;
  color: #f57c00;
}

.annot-btn.annot-has-entries[data-type='confirmation'] {
  border-color: #388e3c;
  color: #388e3c;
}

.annot-count {
  font-size: 10px;
  font-weight: 600;
  background: currentColor;
  color: #fff;
  border-radius: 999px;
  padding: 0 4px;
  line-height: 14px;
  min-width: 14px;
  text-align: center;
}

/* ── Annotation dialog content ──────────────────────── */
.annot-list {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 4px;
}

.annot-item {
  padding: 8px 10px;
  border-left: 3px solid var(--q-secondary);
  background: var(--surface-soft);
  border-radius: 0 4px 4px 0;
}

.annot-item[data-type='proposal'] {
  border-left-color: #f57c00;
}

.annot-item[data-type='confirmation'] {
  border-left-color: #388e3c;
}

.annot-item-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.annot-item-type-tag {
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: inherit;
}

.annot-item-author {
  font-weight: 500;
  color: var(--text-main);
}

.annot-item-body {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-main);
  white-space: pre-wrap;
}

.annot-resolve-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  padding: 2px 8px;
  border: 1px solid #a5d6a7;
  border-radius: 999px;
  background: #f1f8f1;
  color: #2e7d32;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.annot-resolve-btn:hover {
  background: #c8e6c9;
  border-color: #66bb6a;
}
.annot-resolve-btn svg {
  width: 11px;
  height: 11px;
}

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

.contracts-page-list .contract-field-value {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  word-break: break-word;
}

.contract-entry {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 12px;
  cursor: pointer;
  display: grid;
  gap: 10px;
}

.contract-entry:hover {
  border-color: #90caf9;
  background: #fafeff;
}

.contract-entry:focus-visible {
  outline: 2px solid var(--q-primary);
  outline-offset: 2px;
}

.contract-entry-fields {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px 12px;
}

.contract-field {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.contract-field-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.contract-field-value {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contract-entry-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid #f0f0f0;
  padding-top: 8px;
}

.contract-entry-date {
  font-size: 12px;
  color: var(--text-muted);
}

.contract-entry-actions {
  display: flex;
  gap: 8px;
}

.no-contracts {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 24px 0;
}

@media (max-width: 760px) {
  .contract-entry-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.share-action {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.share-link-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.share-link-wrap input {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  background: #f5f5f5;
  color: var(--text-muted);
  cursor: text;
}

.comments-panel {
  grid-column: 1 / -1;
}

.comments-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.comments-count {
  color: var(--text-muted);
  font-size: 13px;
}

.comments-list {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.no-comments {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.comment {
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: #fafafa;
}

.comment-meta {
  display: flex;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.comment-author {
  font-weight: 600;
  color: var(--text-main);
}

.comment-body {
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  color: var(--text-main);
}

.comment-form {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid #e0e0e0;
}

.comment-form-actions {
  display: flex;
  justify-content: flex-end;
}

.app-modal {
  border: 0;
  padding: 0;
  width: min(100% - 24px, 520px);
  border-radius: 10px;
  box-shadow: 0 24px 80px #0000004d;
}

.app-modal::backdrop {
  background: #00152999;
}

.app-modal-card {
  margin: 0;
  padding: 20px;
  display: grid;
  gap: 16px;
}

.app-modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.app-modal-header h2 {
  line-height: 1.4;
}

.modal-copy {
  margin: 0;
  color: var(--text-muted);
}

.modal-close-btn {
  min-height: 0;
  padding: 6px 10px;
  background: transparent;
  color: var(--text-muted);
}

.modal-close-btn:hover:not(:disabled) {
  background: #eceff1;
  color: var(--text-main);
}

.app-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ─── Admin panels (forms reusing .app-modal-card outside a <dialog>) ── */

.admin-panel-card {
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 2px 8px #0000000d;
  margin-bottom: 32px;
}

/* ─── Toast notifications ─────────────────────────────── */

.toast-container {
  position: fixed;
  bottom: calc(var(--actions-bar-height) + 20px);
  right: 20px;
  z-index: 1100;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  max-width: 300px;
  padding: 9px 13px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
  animation: toast-in 180ms ease forwards;
}

.toast--success {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  color: #1b5e20;
}

.toast--error {
  background: #ffebee;
  border: 1px solid #ffcdd2;
  color: #b71c1c;
  cursor: pointer;
  user-select: none;
}

.toast--leaving {
  animation: toast-out 180ms ease forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* ─── Session expiry banner ───────────────────────────── */

.session-expiry-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
  background: #fff8e1;
  border-bottom: 1px solid #ffe082;
  color: #7a5b00;
  font-size: 13px;
  text-align: center;
}

.session-expiry-banner button {
  border: 1px solid #ffe082;
  background: transparent;
  color: inherit;
  border-radius: 4px;
  padding: 2px 10px;
  cursor: pointer;
  font-size: 12px;
}

/* ─── Impersonation ("view as") banner ───────────────────
   Sticky rather than fixed: unlike the dismissible, one-off session-expiry
   banner above, this stays up for the whole support session, so it needs to
   occupy real layout space (no overlapping the page header) while still
   remaining visible when the page scrolls. */

.impersonation-banner {
  position: sticky;
  top: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
  background: #e65100;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.impersonation-banner button {
  border: 1px solid #fff;
  background: transparent;
  color: #fff;
  border-radius: 4px;
  padding: 2px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0)    scale(1);    }
  to   { opacity: 0; transform: translateY(10px) scale(0.97); }
}

/* ─── Support page ────────────────────────────────────── */

.support-section {
  max-width: 720px;
  margin-bottom: 24px;
}

.support-section h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.support-steps {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
}

.support-steps li {
  line-height: 1.5;
}

.support-note {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ─── Version conflict banner ─────────────────────────────
   Sticky like the impersonation banner (stays up until acted on, not a
   timed toast), but red-toned to signal a real problem rather than an
   informational state. */

.version-conflict-banner {
  position: sticky;
  top: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
  background: #b71c1c;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.version-conflict-banner button {
  border: 1px solid #fff;
  background: transparent;
  color: #fff;
  border-radius: 4px;
  padding: 2px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}

/* ─── History panel ────────────────────────────────────── */

.history-list {
  display: grid;
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
}

.history-entry {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.history-entry:hover {
  background: #eceff1;
}

.history-entry-status {
  font-weight: 600;
  font-size: 13px;
}

.history-entry-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.history-empty {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
}

/* ─── History view mode ───────────────────────────────────
   Reading a past checkpoint reuses the live editor form (disabled) instead
   of a separate rendered-text view — see the design spec §7. The save/PDF/
   status/comment surfaces make no sense against a frozen past snapshot, so
   they're hidden outright rather than individually disabled. */

.viewing-history .contract-actions-bar,
.viewing-history .status-select,
.viewing-history #comments-section,
.viewing-history .annotation-toolbar {
  display: none;
}

.history-view-banner {
  position: sticky;
  top: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
  background: #1565c0;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.history-view-banner button {
  border: 1px solid #fff;
  background: transparent;
  color: #fff;
  border-radius: 4px;
  padding: 2px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}
