:root {
  --ink: #202a33;
  --muted: #667784;
  --line: #d8e7f0;
  --paper: #ffffff;
  --canvas: #f3f8fb;
  --brand: #176fae;
  --brand-2: #4db2ec;
  --accent: #73c7e3;
  --soft: #eaf5fc;
  --danger: #a83f45;
  --shadow: 0 18px 55px rgba(23, 111, 174, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Practical CGA guide */
.cga-hero { margin-bottom: 16px; }
.cga-hero p { max-width: 720px; }
.cga-disclaimer { margin-bottom: 18px; padding: 16px 18px; border: 1px solid #bddcf1; border-radius: 14px; background: #eef8ff; color: var(--ink); }
.cga-disclaimer strong { color: var(--brand); }
.cga-disclaimer p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.cga-search { margin-bottom: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.cga-search > label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.cga-search > div { display: flex; gap: 9px; }
.cga-search input { min-width: 0; flex: 1; }
.cga-results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 2px; color: var(--muted); font-size: 12px; }
.cga-results-head strong { color: var(--ink); }
.cga-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(285px, 1fr)); gap: 14px; }
.cga-card { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 14px; align-items: start; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.cga-monogram { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; background: var(--soft); color: var(--brand); font-size: 20px; font-weight: 900; }
.cga-card-body { min-width: 0; }
.cga-card h2 { margin: 1px 0 6px; font-size: 18px; }
.cga-card p { min-height: 42px; margin: 0 0 8px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.cga-card small { display: block; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.cga-card > .button { grid-column: 1 / -1; width: 100%; }
.cga-inline-link { display: inline-flex; align-items: center; border-radius: 6px; padding: 5px 7px; background: var(--soft); color: var(--brand); font-size: 11px; font-weight: 850; text-decoration: none; }
.cga-property-link { display: inline-flex; margin-top: 7px; color: var(--brand); font-size: 11px; font-weight: 850; text-decoration: none; }
.cga-empty { padding: 36px 22px; text-align: center; }
.cga-company-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.cga-company-hero .button { flex: 0 0 auto; }
.cga-company-card { display: grid; grid-template-columns: 56px minmax(220px, 1fr) minmax(300px, .8fr); gap: 18px; align-items: center; margin-bottom: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.cga-company-card .cga-monogram { width: 56px; height: 56px; font-size: 24px; }
.cga-company-card h2 { margin: 3px 0 6px; font-size: 20px; }
.cga-company-card p { margin: 0; color: var(--muted); font-size: 13px; }
.cga-company-card dl { display: grid; gap: 8px; margin: 0; }
.cga-company-card dl div { display: grid; grid-template-columns: 80px 1fr; gap: 8px; }
.cga-company-card dt { color: var(--muted); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.cga-company-card dd { margin: 0; font-size: 13px; font-weight: 750; }
.cga-company-card a, .cga-results-head a { color: var(--brand); text-decoration: none; }
.cga-filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 0 0 10px; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
.cga-filter-bar label { display: grid; gap: 6px; min-width: 150px; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.cga-filter-bar select { min-width: 150px; }
.cga-period-shortcuts { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 16px; }
.cga-period-shortcuts a { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--muted); font-size: 11px; font-weight: 850; text-decoration: none; }
.cga-period-shortcuts a:hover, .cga-period-shortcuts a.active { border-color: var(--brand); background: var(--brand); color: #fff; }
.cga-edition-list { display: grid; gap: 14px; }
.cga-product-card { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); }
.cga-product-card > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 18px; border-bottom: 1px solid var(--line); background: var(--soft); }
.cga-product-card h2 { margin: 3px 0 0; font-size: 18px; }
.cga-editions { display: grid; }
.cga-edition-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; border-top: 1px solid var(--line); }
.cga-edition-row:first-child { border-top: 0; }
.cga-document-line { display: flex; flex: 1; align-items: center; gap: 9px; min-width: 0; }
.cga-date-badge, .cga-type-badge { flex: 0 0 auto; padding: 6px 9px; border-radius: 8px; font-size: 11px; font-weight: 900; }
.cga-date-badge { background: var(--brand); color: #fff; }
.cga-type-badge { background: #e8f5fd; color: var(--brand); }
.cga-document-copy { display: grid; gap: 3px; min-width: 0; }
.cga-document-copy strong { color: var(--ink); font-size: 13px; }
.cga-document-copy small { color: var(--muted); font-size: 11px; }

@media (max-width: 680px) {
  .cga-search > div { flex-direction: column; }
  .cga-search .button { width: 100%; }
  .cga-results-head { align-items: flex-start; flex-direction: column; }
  .cga-grid { grid-template-columns: 1fr; }
  .cga-company-hero { align-items: stretch; flex-direction: column; }
  .cga-company-hero .button { width: 100%; }
  .cga-company-card { grid-template-columns: 48px 1fr; }
  .cga-company-card dl { grid-column: 1 / -1; }
  .cga-edition-row { align-items: stretch; flex-direction: column; }
  .cga-document-line { align-items: flex-start; flex-wrap: wrap; }
  .cga-document-copy { flex-basis: 100%; }
  .cga-edition-row .button { width: 100%; }
  .cga-filter-bar > * { width: 100%; }
  .cga-filter-bar select { width: 100%; }
}

/* En-tête compact de l'explorateur et commandes regroupées. */
.file-browser > .browser-heading {
  min-height: 42px;
  margin-bottom: 12px;
  align-items: center;
}
.browser-heading > div { min-width: 0; }
.browser-heading .browser-title-actions { gap: 8px; }
.browser-heading .browser-title-actions h2 {
  min-width: 0;
  margin-right: 4px;
  line-height: 1.15;
}
.compact-browser-action { min-height: 36px; white-space: nowrap; }
.compact-browser-action.is-active { border-color: var(--brand-2); background: var(--soft); color: var(--brand); }
.current-folder-actions { flex: none; }
.current-folder-actions > summary.icon-button { width: 38px; height: 36px; }
.document-clipboard-banner {
  margin: 0 0 12px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #b9d8ea;
  border-radius: 12px;
  background: #edf7fc;
  color: var(--brand);
  font-size: 13px;
}
.document-clipboard-banner > span { margin-right: auto; overflow-wrap: anywhere; }
.browser-command-modal { width: min(720px, calc(100vw - 30px)); }
.browser-command-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.browser-command-card {
  min-width: 0;
  min-height: 132px;
  padding: 17px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  align-items: center;
  gap: 3px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.browser-command-card:hover { border-color: var(--brand-2); background: var(--soft); }
.browser-command-icon {
  width: 42px;
  height: 42px;
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--soft);
  color: var(--brand);
  font-size: 21px;
  font-weight: 900;
}
.browser-command-card strong { align-self: end; font-size: 15px; }
.browser-command-card small { align-self: start; color: var(--muted); line-height: 1.35; }
.browser-filters-modal { width: min(760px, calc(100vw - 30px)); }
.browser-filter-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.browser-filter-fields > label { min-width: 0; display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
.browser-filter-fields input,
.browser-filter-fields select { width: 100%; min-width: 0; }
.browser-filter-wide { grid-column: 1 / -1; }
.browser-view-choice,
.browser-filter-period { margin: 0; padding: 0; border: 0; }
.browser-view-choice { grid-column: 1 / -1; }
.browser-view-choice legend,
.browser-filter-period legend { margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 800; }
.browser-view-choice .document-mode-switch { width: 100%; }
.browser-view-choice .document-mode-switch button { flex: 1; min-height: 38px; font-size: 12px; }
.browser-filter-period { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #f8fbfd; }
.browser-filter-period .document-date-fields { margin: 0; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.browser-filters-modal .modal-actions { margin-top: 20px; }
.shared-folder-browser { margin-top: 12px; }
.shared-folder-local-back { margin-bottom: 10px; }
.shared-folder-browser .folder-breadcrumbs { margin-bottom: 10px; }
.compact-folder-visual { width: 36px; height: 30px; margin: 0; font-size: 17px; }

@media (max-width: 680px) {
  .section.file-browser { margin-top: 14px; }
  .file-browser > .browser-heading { margin-bottom: 10px; }
  .browser-heading { align-items: flex-start; }
  .browser-heading > div { width: 100%; }
  .browser-heading .browser-title-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
  }
  .browser-heading .browser-title-actions h2 {
    grid-column: 1 / -1;
    font-size: clamp(19px, 6vw, 24px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .browser-heading .shared-folder-status,
  .browser-heading .mandate-system-status { display: none; }
  .browser-heading > .tag { display: none; }
  .compact-browser-action { min-height: 34px; padding: 6px 9px; font-size: 11px; }
  .compact-browser-action:first-of-type { grid-column: 1; }
  .compact-browser-action:nth-of-type(2) { grid-column: 2; }
  .current-folder-actions { grid-column: 3; }
  .browser-command-grid,
  .browser-filter-fields { grid-template-columns: 1fr; }
  .browser-filter-wide,
  .browser-view-choice { grid-column: auto; }
  .browser-command-card { min-height: 104px; }
  .browser-filter-period .document-date-fields { grid-template-columns: 1fr; }
  .browser-filter-period .document-date-fields > span { display: none; }
  .browser-filters-modal .modal-card,
  .browser-command-modal .modal-card { padding: 18px; }
  .document-clipboard-banner { align-items: stretch; flex-wrap: wrap; }
  .document-clipboard-banner > span { width: 100%; }
  .shared-folder-local-back { display: none; }
  .compact-folder-visual { display: none; }
}

/* Dossier système Mandat : visuellement distinct et immuable. */
.folder-card.is-system-mandate-folder {
  border-color: #b9c9dd;
  background: linear-gradient(135deg, #f7faff 0%, #edf4fb 100%);
}
.folder-visual.is-locked {
  color: #315f88;
  background: #dfeaf6;
}
.folder-visual.is-locked::before { background: #cbdced; }
.folder-lock-icon { font-size: 16px; line-height: 1; filter: grayscale(.15); }
.mandate-system-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid #b9c9dd;
  border-radius: 999px;
  color: #315f88;
  background: #edf4fb;
  font-size: 12px;
  font-weight: 800;
}

/* Console humaine du mandat en ligne */
.mandate-console-form { display: block; }
.mandate-console-heading { align-items: center; }
.mandate-console-heading .button { flex: 0 0 auto; }
.mandate-console-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr); gap: 24px; align-items: start; }
.mandate-console-main, .mandate-console-side { display: grid; gap: 24px; }
.mandate-console-side { position: sticky; top: 22px; }
.mandate-console-card { margin: 0; background: rgba(255,255,255,.96); }
.mandate-console-card textarea { min-height: 112px; resize: vertical; line-height: 1.5; }
.mandate-company-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 4px 16px; }
.mandate-version-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mandate-signature-preview { height: 116px; margin: 12px 0 18px; border: 1px solid var(--line); border-radius: 13px; background: #f8fbfd; display: grid; place-items: center; overflow: hidden; }
.mandate-signature-preview img { width: 100%; height: 100%; padding: 12px; object-fit: contain; }
.mandate-check { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 10px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; font-size: 13px; font-weight: 750; }
.mandate-check input { margin-top: 2px; accent-color: var(--brand); }
.mandate-submission-list { max-height: 520px; overflow: auto; padding-right: 4px; }
.mandate-submission-list article { display: grid; gap: 4px; padding: 14px 0; border-top: 1px solid var(--line); }
.mandate-submission-list article:first-child { border-top: 0; }
.mandate-submission-list article > span, .mandate-submission-list article > small { color: var(--muted); font-size: 12px; }
.mandate-submission-list article > div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.mandate-submission-list article a { padding: 6px 8px; border-radius: 7px; background: var(--soft); color: var(--brand); font-size: 11px; font-weight: 800; text-decoration: none; }
.mandate-console-save { width: 100%; justify-content: center; }

@media (max-width: 980px) {
  .mandate-console-grid { grid-template-columns: 1fr; }
  .mandate-console-side { position: static; }
}

@media (max-width: 620px) {
  .mandate-console-heading { align-items: stretch; }
  .mandate-console-heading .button { width: 100%; justify-content: center; }
  .mandate-company-fields, .mandate-version-fields { grid-template-columns: 1fr; }
  .mandate-console-card { padding: 18px 15px; }
}

/* Calendrier des échéances client */
.calendar-hero { align-items: flex-end; justify-content: space-between; }
.calendar-summary-card { min-width: 190px; padding: 18px 22px; display: grid; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.78); box-shadow: 0 12px 30px rgba(19,73,112,.08); }
.calendar-summary-card strong { color: var(--brand); font-size: 34px; line-height: 1; }
.calendar-summary-card span { margin-top: 7px; color: var(--muted); font-size: 13px; font-weight: 750; }
.deadline-calendar-filters { margin-bottom: 18px; padding: 16px; display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)) auto; align-items: end; gap: 12px; }
.deadline-calendar-filters label { display: grid; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.deadline-calendar-filters select { width: 100%; }
.calendar-page-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(300px, .8fr); align-items: start; gap: 20px; }
.deadline-calendar, .calendar-upcoming-panel, .calendar-subscription-panel { padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: white; }
.calendar-toolbar { min-height: 88px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.calendar-toolbar h2, .calendar-side-column h2 { margin: 4px 0 0; }
.calendar-navigation { display: flex; align-items: center; gap: 7px; }
.button.compact { min-width: 40px; padding: 9px 12px; }
.calendar-scroll { overflow-x: auto; }
.calendar-weekdays, .calendar-month-grid { min-width: 595px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { border-bottom: 1px solid var(--line); background: #f4f9fc; }
.calendar-weekdays span { padding: 10px 8px; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.calendar-day { min-height: 124px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: white; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day > time { width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 999px; color: #355269; font-size: 12px; font-weight: 850; }
.calendar-day.outside-month { background: #f8fafb; }
.calendar-day.outside-month > time { color: #a9bac6; }
.calendar-day.today > time { background: var(--brand); color: white; }
.calendar-event-chip { margin-top: 5px; padding: 7px 8px; display: block; overflow: hidden; border-left: 3px solid var(--brand); border-radius: 7px; background: #eaf5fc; color: #123b59; text-decoration: none; }
.calendar-event-chip:hover { background: #d9eefb; }
.calendar-event-chip strong, .calendar-event-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event-chip strong { font-size: 11px; }
.calendar-event-chip small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.calendar-empty { margin: 0; padding: 13px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.calendar-side-column { display: grid; gap: 20px; }
.calendar-upcoming-panel, .calendar-subscription-panel { padding: 20px; }
.calendar-upcoming-list { margin: 16px -20px -20px; }
.calendar-upcoming-item { padding: 13px 18px; display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; align-items: center; gap: 10px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.calendar-upcoming-item:hover { background: #f4f9fc; }
.calendar-upcoming-item time { color: var(--brand); font-size: 11px; font-weight: 900; }
.calendar-upcoming-item span, .calendar-upcoming-item strong, .calendar-upcoming-item small { min-width: 0; display: block; }
.calendar-upcoming-item strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.calendar-upcoming-item small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.calendar-subscription-panel > p { color: var(--muted); font-size: 13px; line-height: 1.55; }
.calendar-subscription-panel label { display: block; margin: 16px 0 6px; font-size: 11px; font-weight: 900; }
.calendar-subscription-copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.calendar-subscription-copy input { min-width: 0; font-size: 11px; }
.calendar-copy-status { min-height: 20px; margin: 5px 0 0 !important; color: #138469 !important; font-weight: 800; }
.email-outbox-layout { display: grid; grid-template-columns: minmax(300px, .85fr) minmax(0, 1.4fr); gap: 18px; align-items: start; }
.email-log-row { text-decoration: none; color: inherit; }
.email-log-row.active, .email-log-row:hover { background: #edf7ff; }
.email-status-preview { color: #855b00; background: #fff3cf; }
.email-status-sent { color: #08745d; background: #dcf7ef; }
.email-status-failed { color: #a5222b; background: #ffe5e8; }
.email-log-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 18px 0; padding: 1px; background: var(--line); border-radius: 14px; overflow: hidden; }
.email-log-meta div { padding: 13px; background: #fff; }
.email-log-meta dt { color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.email-log-meta dd { margin: 5px 0 0; overflow-wrap: anywhere; }
.email-body-preview { max-height: 430px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #f8fbfd; font: inherit; font-size: 13px; }
.email-detail-empty { min-height: 180px; display: grid; place-items: center; text-align: center; }
.invitation-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.invitation-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, auto)); width: fit-content; max-width: 100%; }
.invitation-tabs a { display: grid; place-items: center; text-align: center; }
.invitation-preparation-panel { max-width: 980px; }
.invitation-route-picker { margin-bottom: 18px; padding: 22px; }
.invitation-route-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.invitation-route-fields label { display: grid; gap: 7px; color: var(--ink); font-size: 13px; font-weight: 800; }
.invitation-route-fields select { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #cbd8df; border-radius: 11px; background: white; color: var(--ink); }
.invitation-route-result { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: #eef7fd; color: var(--brand); font-size: 13px; font-weight: 800; }
.invitation-account-state { margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f4f8fb; color: var(--muted); font-size: 12px; line-height: 1.45; }
.invitation-account-state.is-warning { border-color: #e9c982; background: #fff8e8; color: #76530a; }
.invitation-account-state.is-success { border-color: #a9dcc0; background: #effaf4; color: #17623a; }
.invitation-account-state.is-error { border-color: #efb0b0; background: #fff1f1; color: #9b2929; }
.invitation-matrix { display: grid; grid-template-columns: 112px repeat(2, minmax(0, 1fr)); gap: 10px; align-items: stretch; }
.matrix-corner, .matrix-column-head, .matrix-row-head { border: 1px solid var(--line); background: #f4f9fc; color: var(--muted); }
.matrix-corner { padding: 12px; display: grid; align-content: space-between; gap: 18px; border-radius: 14px 14px 8px 14px; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.matrix-corner strong { color: var(--brand); }
.matrix-column-head { min-height: 72px; padding: 12px; display: grid; place-content: center; gap: 3px; text-align: center; border-radius: 12px; }
.matrix-column-head span, .matrix-row-head span { font-size: 11px; }
.matrix-column-head strong, .matrix-row-head strong { color: var(--brand); font-size: 18px; }
.matrix-row-head { padding: 10px; display: grid; place-content: center; gap: 4px; text-align: center; border-radius: 12px; }
.invitation-matrix-card { position: relative; min-width: 0; margin: 0; padding: 20px; transition: border-color .18s, box-shadow .18s, transform .18s, opacity .18s; }
.invitation-matrix-card:not(.is-route-match).has-route-selection { opacity: .58; }
.invitation-matrix-card.is-route-match { border: 2px solid var(--brand-2); box-shadow: 0 13px 34px rgba(26, 126, 188, .17); transform: translateY(-2px); }
.route-match-badge { position: absolute; top: 12px; right: 12px; padding: 5px 8px; display: none; border-radius: 999px; background: var(--brand-2); color: white; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.invitation-matrix-card.is-route-match .route-match-badge { display: inline-flex; }
.invitation-matrix-card h2 { margin: 5px 0 8px; padding-right: 95px; font-size: 20px; }
.invitation-matrix-card .fields { grid-template-columns: 1fr; }
.invitation-matrix-card .button { width: fit-content; }
.invitation-route-summary { margin: 14px 0 17px; border: 1px solid #cfe1eb; border-radius: 12px; background: #f7fbfd; }
.invitation-route-summary summary { padding: 11px 13px; cursor: pointer; color: var(--blue); font-size: 12px; font-weight: 900; }
.invitation-route-summary[open] summary { border-bottom: 1px solid #dbe9f0; }
.invitation-route-summary ol { margin: 0; padding: 12px 14px 14px 36px; display: grid; gap: 10px; }
.invitation-route-summary li { padding-left: 3px; color: var(--text); }
.invitation-route-summary li strong, .invitation-route-summary li span { display: block; }
.invitation-route-summary li strong { margin-bottom: 2px; font-size: 11px; }
.invitation-route-summary li span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.invitation-row-link { text-decoration: none; color: inherit; }
.invitation-open-hint { display: block; margin-top: 5px; color: var(--blue); font-size: 11px; font-weight: 800; }
.invitation-link-copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 18px 0; }
.invitation-link-copy input { min-width: 0; }
.invitation-share-result { display: grid; gap: 9px; margin-top: 6px; padding: 13px; border: 1px solid #a8d8c2; border-radius: 12px; background: #edf9f3; }
.invitation-share-result[hidden] { display: none; }
.invitation-share-result > strong { color: #17653c; }
.invitation-share-link { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.invitation-share-link .button { width: 100%; min-width: 0; }
.invitation-share-link input { grid-column: 1 / -1; width: 100%; min-width: 0; }
.invitation-share-result p { min-height: 18px; margin: 0; color: #17653c; font-size: 12px; font-weight: 800; }
.invitation-share-result p.is-error { color: #a12e36; }
.invitation-email-preview { border-bottom: 1px solid var(--line); }
.invitation-email-preview summary { cursor: pointer; list-style: none; }
.invitation-email-preview summary::-webkit-details-marker { display: none; }
.invitation-email-preview .email-body-preview { margin: 10px; }
.calendar-download-link { width: 100%; justify-content: center; }
.calendar-help { margin: 16px 0; padding: 12px 14px; border-radius: 10px; background: #f4f9fc; font-size: 12px; }
.calendar-help summary { color: var(--brand); font-weight: 850; cursor: pointer; }
.calendar-help p { margin: 9px 0 0; color: var(--muted); line-height: 1.5; }
.danger-link { color: #a63648; font-size: 11px; }

@media (max-width: 1100px) {
  .calendar-page-grid { grid-template-columns: 1fr; }
  .calendar-side-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .deadline-calendar-filters { grid-template-columns: 1fr; }
  .deadline-calendar-filters .button { width: 100%; justify-content: center; }
  .calendar-hero { align-items: stretch; }
  .calendar-summary-card { width: 100%; min-width: 0; }
  .calendar-toolbar { align-items: flex-start; flex-direction: column; }
  .calendar-navigation { width: 100%; display: grid; grid-template-columns: auto 1fr auto; }
  .calendar-navigation .button { justify-content: center; }
  .calendar-weekdays, .calendar-month-grid { min-width: 595px; }
  .calendar-day { min-height: 112px; }
  .calendar-side-column { grid-template-columns: 1fr; }
  .calendar-subscription-copy { grid-template-columns: 1fr; }
  .email-outbox-layout { grid-template-columns: 1fr; }
  .email-log-meta { grid-template-columns: 1fr; }
  .invitation-link-copy { grid-template-columns: 1fr; }
  .invitation-link-copy .button { width: 100%; }
  .calendar-subscription-copy .button { width: 100%; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); min-height: 100vh; overflow-x: hidden; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
.shell { --sidebar-top: #2787c3; --sidebar-middle: var(--brand); --sidebar-bottom: #125f96; display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.shell.role-broker { --sidebar-top: #192b3d; --sidebar-middle: #0e1e2d; --sidebar-bottom: #08131e; }
.shell.role-company_admin { --sidebar-top: #8b3fd0; --sidebar-middle: #6725aa; --sidebar-bottom: #3e176d; }
.shell.role-developer {
  --brand: #b42332;
  --brand-2: #df4b58;
  --accent: #ef7b84;
  --soft: #fff0f1;
  --sidebar-top: #d63a46;
  --sidebar-middle: #a7192a;
  --sidebar-bottom: #650b18;
  --shadow: 0 18px 55px rgba(140, 17, 32, .14);
}
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: linear-gradient(180deg, var(--sidebar-top) 0%, var(--sidebar-middle) 52%, var(--sidebar-bottom) 100%); color: white; padding: 30px 22px; display: flex; flex-direction: column; gap: 32px; transition: background .2s ease; }
.brand { width: 100%; max-width: 205px; padding: 12px 14px 10px; display: block; border-radius: 13px; background: white; box-shadow: 0 8px 24px rgba(13, 74, 115, .16); text-decoration: none; }
.brand img { display: block; width: 100%; height: auto; }
.brand small { display: block; margin-top: 5px; color: var(--brand); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .18em; }
.brand-app-version {
  display: block;
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid rgba(167, 25, 42, .16);
  color: var(--danger);
  font-size: 9px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: .045em;
  text-align: center;
  white-space: nowrap;
}
.nav { display: grid; gap: 7px; }
.workspace-switcher { display: grid; gap: 7px; margin-bottom: 8px; padding: 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 12px; background: rgba(255,255,255,.08); }
.workspace-switcher > span { font-size: 10px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; color: rgba(255,255,255,.78); }
.workspace-switcher-actions { display: grid; gap: 5px; }
.workspace-switcher-actions form { margin: 0; }
.workspace-switcher-actions button { width: 100%; min-height: 38px; padding: 7px 8px 7px 9px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: rgba(255,255,255,.08); color: white; text-align: left; cursor: pointer; }
.workspace-switcher-actions button:hover { background: rgba(255,255,255,.17); }
.workspace-switcher-actions button.active { background: white; color: var(--sidebar-middle); cursor: pointer; opacity: .95; }
.workspace-alert-badge { min-width: 21px; height: 21px; padding: 0 6px; flex: none; display: inline-grid; place-items: center; border: 2px solid rgba(255,255,255,.92); border-radius: 999px; background: #e1263d; color: white; font-size: 10px; font-weight: 900; line-height: 1; box-shadow: 0 3px 10px rgba(90,0,18,.28); }
.workspace-switcher-actions button.active .workspace-alert-badge { border-color: white; }
.capability-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }
.capability-card { display: grid; gap: 14px; }
.capability-person { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.capability-person > div { display: grid; gap: 3px; min-width: 0; }
.capability-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.capability-checks label { display: flex; align-items: flex-start; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.55); font-size: 13px; font-weight: 750; }
.capability-checks input { width: auto; margin-top: 2px; }
.capability-warning { margin-top: 10px; }
@media (max-width: 600px) { .capability-checks { grid-template-columns: 1fr; } }
.mobile-nav-toggle { display: none; }
.mobile-nav-unread-badge { display: none; }
.nav a { color: #e6f4fd; text-decoration: none; border-radius: 10px; padding: 11px 12px; }
.nav-with-badge { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nav-unread-badge { min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; background: #e1263d; color: white; font-size: 10px; line-height: 1; box-shadow: 0 3px 10px rgba(90,0,18,.22); }
.nav-unread-badge[hidden] { display: none; }
.nav a:hover, .nav a.active { background: rgba(255,255,255,.16); color: white; }
.document-signature-action{border-color:#c5480d!important;background:linear-gradient(135deg,#f36b21,#d8430d)!important;color:#fff!important;box-shadow:0 8px 20px rgba(199,66,13,.24)!important}.document-signature-action:hover{filter:brightness(.96)}.document-signature-progress{border-color:#9c6b04!important;background:#fff0b7!important;color:#604200!important}.document-signature-complete{border-color:#238358!important;background:#e8f8f0!important;color:#17633f!important}.signature-request-security{grid-column:1/-1;display:flex;align-items:flex-start;gap:10px;padding:12px 14px;border-radius:12px;background:#eef7ff;color:#1a4e78;font-size:13px;font-weight:700}.signature-request-security input{margin-top:2px}
.nav-section-label { margin: 12px 12px 2px; color: rgba(255,255,255,.68); font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.nav a.nav-subitem { margin-left: 8px; padding: 9px 12px; border-left: 2px solid rgba(255,255,255,.18); border-radius: 0 9px 9px 0; font-size: 13px; }
.nav-menu-group { margin: 0; }
.nav-menu-group summary { position: relative; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-radius: 10px; color: white; font-weight: 700; cursor: pointer; list-style: none; }
.nav-menu-group summary::-webkit-details-marker { display: none; }
.nav-menu-group summary::after { content: '›'; font-size: 20px; line-height: 1; transform: rotate(0); transition: transform .16s ease; }
.nav-menu-group[open] summary::after { transform: rotate(90deg); }
.nav-menu-group summary:hover, .nav-menu-group summary.active { background: rgba(255,255,255,.12); }
.nav-menu-subitems { display: grid; gap: 3px; padding: 4px 0 5px; }
.nav-menu-subitems .nav-subitem { color: rgba(255,255,255,.82); }
.sidebar-footer { margin-top: auto; color: #e6f4fd; font-size: 13px; }
.sidebar-footer strong { color: white; display: block; }
.sidebar-account { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 11px; cursor: pointer; list-style: none; }
.sidebar-account::-webkit-details-marker { display: none; }
.sidebar-account:hover, .account-menu[open] .sidebar-account { background: rgba(255,255,255,.13); }
.sidebar-account img, .account-initials { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none; }
.account-initials { display: grid; place-items: center; background: rgba(255,255,255,.14); color: white; font-weight: 850; text-transform: uppercase; }
.sidebar-account > div { min-width: 0; flex: 1; }
.account-menu { position: relative; }
.account-menu-chevron { margin-left: auto; color: rgba(255,255,255,.75); transition: transform .16s ease; }
.account-menu[open] .account-menu-chevron { transform: rotate(180deg); }
.account-menu-panel { position: absolute; z-index: 45; left: 0; right: 0; bottom: calc(100% + 8px); padding: 7px; display: grid; gap: 3px; border: 1px solid rgba(255,255,255,.18); border-radius: 11px; background: #fff; color: var(--ink); box-shadow: 0 18px 45px rgba(5,31,48,.28); }
.account-menu-panel a, .account-menu-panel button { width: 100%; min-height: 38px; padding: 9px 10px; display: flex; align-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-decoration: none; text-align: left; cursor: pointer; font-weight: 750; }
.account-menu-panel a:hover, .account-menu-panel button:hover { background: var(--soft); color: var(--brand); }
.account-menu-panel form { margin: 0; }
.account-menu-panel form:last-child { padding-top: 3px; border-top: 1px solid var(--line); }
.account-menu-panel form:last-child button { color: var(--danger); }
.link-button { border: 0; background: none; color: inherit; padding: 0; cursor: pointer; text-decoration: underline; }
.main { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; z-index: 35; top: 0; min-height: 58px; padding: 10px 34px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); box-shadow: 0 5px 18px rgba(25,72,101,.06); }
.eyebrow { color: var(--brand-2); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.topbar strong { display: block; margin-top: 3px; }
.topbar-navigation { min-width: 0; flex: 1; display: flex; align-items: center; gap: 12px; }
.topbar-back-button {
  min-width: 76px;
  min-height: 36px;
  padding: 6px 11px 6px 8px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--brand);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
}
.topbar-back-button span { font-size: 21px; font-weight: 950; line-height: .7; }
.topbar-back-button:hover { border-color: rgba(23,111,174,.35); background: var(--soft); transform: translateX(-1px); }
.topbar-back-button:focus-visible { outline: 3px solid rgba(46,167,235,.28); outline-offset: 2px; }
.topbar-location { min-width: 0; flex: 1; display: grid; gap: 2px; }
.topbar-location > .eyebrow { font-size: 9px; }
.topbar-breadcrumbs { min-width: 0; display: flex; align-items: center; gap: 3px 7px; flex-wrap: wrap; white-space: normal; overflow: visible; font-size: 13px; }
.topbar-breadcrumbs a { color: var(--brand); text-decoration: none; font-weight: 750; }
.topbar-breadcrumbs span { color: #8ba0ad; }
.topbar-breadcrumbs strong { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.content { width: 100%; flex: 1 0 auto; padding: 36px; max-width: 1440px; margin: 0 auto; }
.topbar-contact { display: inline-flex; align-items: baseline; gap: 5px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.topbar-contact strong { margin: 0; color: var(--brand); font-size: 12px; }
.topbar-contact small { color: var(--brand); font-size: 12px; font-weight: 800; }
.topbar-client-context { flex: none; display: grid; align-items: initial; gap: 2px; text-align: right; }
.topbar-context-line { display: grid; grid-template-columns: auto minmax(0, auto); align-items: baseline; justify-content: end; gap: 5px; line-height: 1.2; }
.topbar-context-line > span { color: var(--muted); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(30px, 4vw, 46px); letter-spacing: -.045em; line-height: 1.04; }
h2 { font-size: 22px; letter-spacing: -.025em; }
h3 { font-size: 16px; }
.lead { color: var(--muted); max-width: 720px; font-size: 17px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 28px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: var(--brand); color: white; border: 0; border-radius: 10px; padding: 11px 16px; text-decoration: none; cursor: pointer; font-weight: 700; }
.button:hover { background: var(--brand-2); }
.button.secondary { color: var(--brand); background: var(--soft); }
.button.ghost { color: var(--brand); background: white; border: 1px solid var(--line); }
.button.danger { color: white; background: var(--danger); }
.button.danger:hover { background: #852f34; }
.button:disabled { opacity: .55; cursor: not-allowed; }
.button.small { padding: 8px 11px; font-size: 13px; }
.grid { display: grid; gap: 18px; }
.grid.cards { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 17px; padding: 22px; box-shadow: 0 1px 0 rgba(24,40,32,.02); }
.card.interactive { text-decoration: none; transition: transform .16s, box-shadow .16s; }
.card.interactive:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.metric { color: var(--muted); font-size: 13px; }
.metric strong { color: var(--ink); display: block; font-size: 30px; margin-top: 7px; }
.client-home-hero { align-items: center; }
.client-home-identity { display: flex; align-items: center; gap: 12px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.client-home-identity img, .client-home-identity > span { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; }
.client-home-identity > span { display: grid; place-items: center; background: var(--soft); color: var(--brand); font-weight: 900; }
.client-home-identity strong, .client-home-identity small { display: block; }
.client-home-identity small { color: var(--muted); margin-top: 3px; }
.client-home-summary-trigger {
  position: relative;
  color: inherit;
  font: inherit;
  text-align: left;
  appearance: none;
  cursor: pointer;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.client-home-summary-trigger:hover,
.client-home-summary-trigger:focus-visible {
  border-color: var(--brand-2);
  box-shadow: 0 10px 24px rgba(31,112,164,.13);
  outline: none;
  transform: translateY(-2px);
}
.summary-card-chevron {
  width: 24px !important;
  height: 24px !important;
  margin-left: auto;
  display: grid !important;
  place-items: center;
  border-radius: 50%;
  background: var(--soft) !important;
  color: var(--brand) !important;
  font-size: 22px;
  font-weight: 850;
  line-height: 1;
}
.home-service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.service-tile { min-height: 285px; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: white; color: inherit; text-decoration: none; display: flex; flex-direction: column; position: relative; overflow: hidden; transition: transform .16s, box-shadow .16s, border-color .16s; }
a.service-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #afd6ee; }
.service-tile::after { content: ""; position: absolute; width: 150px; height: 150px; right: -65px; top: -65px; border-radius: 50%; background: var(--soft); opacity: .65; }
.service-icon { width: 48px; height: 48px; margin-bottom: 24px; border-radius: 14px; display: grid; place-items: center; background: var(--soft); color: var(--brand); font-size: 23px; font-weight: 900; position: relative; z-index: 1; }
.service-tile h2 { margin: 5px 0 8px; font-size: 27px; }
.service-tile p { color: var(--muted); line-height: 1.55; }
.service-status { margin-top: auto; color: var(--brand); font-size: 13px; }
.service-arrow { margin-top: 17px; color: var(--brand-2); font-weight: 850; }
.discussions-tile .service-icon { background: #e9f5fc; }
.documents-tile .service-icon { background: #dcedf8; color: var(--brand); }
.account-tile .service-icon { background: #e5edf6; color: #315a88; }
.settings-tile .service-icon { background: #edf4fb; color: #3566a8; }
.tag, .reference { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; background: var(--soft); color: var(--brand-2); font-size: 12px; font-weight: 800; }
.reference { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; background: #e7f2f9; color: #2c6f98; }
.meta { color: var(--muted); font-size: 13px; }
.section { margin-top: 30px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.browser-title-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.browser-title-actions h2 { margin-right: 2px; }
.document-mode-switch {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 3px;
  border: 1px solid #c6dbe8;
  border-radius: 10px;
  background: #fff;
}
.document-mode-switch button {
  min-height: 30px;
  padding: 6px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.document-mode-switch button[aria-pressed="true"] {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 7px rgba(16, 91, 133, .2);
}
.document-mode-switch button:disabled {
  background: #edf1f3;
  color: #9aa6ad;
  box-shadow: none;
  cursor: not-allowed;
  opacity: .72;
}
.document-mode-switch button:focus-visible {
  outline: 3px solid rgba(34, 139, 205, .28);
  outline-offset: 2px;
}
.document-chronology {
  position: relative;
  min-height: 420px;
  padding: 54px 0 28px;
}
.document-chronology[hidden] { display: none !important; }
.document-chronology::before {
  content: "";
  position: absolute;
  top: 35px;
  bottom: 18px;
  left: 50%;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(#8f6eb1 0 31%, #30a363 44% 58%, #a6adb3 72% 100%);
  transform: translateX(-50%);
}
.chronology-arrowhead {
  position: absolute;
  top: 2px;
  left: 50%;
  color: #8462a7;
  font-size: 38px;
  font-weight: 950;
  line-height: 1;
  transform: translateX(-50%);
}
.chronology-folder-note {
  width: fit-content;
  max-width: calc(100% - 40px);
  margin: 0 auto 24px;
  padding: 8px 12px;
  position: relative;
  z-index: 2;
  border: 1px solid #d5e2ea;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}
.chronology-zone { position: relative; padding: 12px 0 26px; }
.chronology-zone[hidden], .chronology-group[hidden] { display: none !important; }
.chronology-zone-heading {
  width: 142px;
  min-height: 42px;
  margin: 0 auto 16px;
  padding: 7px 10px;
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 13px;
  background: #fff;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .06em;
  text-align: center;
  text-transform: uppercase;
}
.zone-future .chronology-zone-heading { color: #71558e; }
.zone-current .chronology-zone-heading { color: #197743; box-shadow: 0 0 0 7px rgba(48,163,99,.1); }
.zone-archive .chronology-zone-heading { color: #667078; }
.chronology-zone-heading strong { font-size: 10px; letter-spacing: 0; text-transform: none; }
.chronology-group {
  min-height: 170px;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr);
  align-items: center;
}
.chronology-side {
  min-width: 0;
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.chronology-side-left { justify-content: flex-end; }
.chronology-side-right { justify-content: flex-start; }
.chronology-side-left:not(:empty)::after,
.chronology-side-right:not(:empty)::before {
  content: "";
  position: absolute;
  top: 50%;
  width: 48px;
  height: 2px;
  background: #8ca5b6;
}
.chronology-side-left:not(:empty)::after { right: -48px; }
.chronology-side-right:not(:empty)::before { left: -48px; }
.chronology-branch-card {
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  position: relative;
  display: flex;
  flex: none;
}
.chronology-side.has-branches {
  flex-wrap: nowrap;
  flex-direction: column;
  gap: 14px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.chronology-side-left.has-branches { align-items: flex-end; padding-right: 100px; }
.chronology-side-right.has-branches { align-items: flex-start; padding-left: 100px; }
.chronology-side-left.has-branches::after,
.chronology-side-right.has-branches::before { width: 120px; }
.chronology-side.has-branches .chronology-branch-card > .chronology-card:not(.chronology-proposal-card) { width: 174px; }
.chronology-side-left.has-branches .chronology-branch-card::after,
.chronology-side-right.has-branches .chronology-branch-card::before {
  content: "";
  position: absolute;
  top: 50%;
  width: 28px;
  height: 2px;
  background: #8ca5b6;
  transform: translateY(-50%);
}
.chronology-side-left.has-branches .chronology-branch-card::after { right: -28px; }
.chronology-side-right.has-branches .chronology-branch-card::before { left: -28px; }
.chronology-side-left.has-branches .chronology-branch-card::before,
.chronology-side-right.has-branches .chronology-branch-card::after {
  content: "";
  position: absolute;
  top: -7px;
  bottom: -7px;
  width: 2px;
  background: #8ca5b6;
}
.chronology-side-left.has-branches .chronology-branch-card::before { right: -29px; }
.chronology-side-right.has-branches .chronology-branch-card::after { left: -29px; }
.chronology-side.has-branches .chronology-branch-card:first-child::before,
.chronology-side.has-branches .chronology-branch-card:first-child::after { top: 50%; }
.chronology-side.has-branches .chronology-branch-card:last-child::before,
.chronology-side.has-branches .chronology-branch-card:last-child::after { bottom: 50%; }
.chronology-point {
  grid-column: 2;
  width: 17px;
  height: 17px;
  position: relative;
  z-index: 4;
  justify-self: center;
}
.chronology-point > span {
  display: block;
  width: 17px;
  height: 17px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 2px #7f9bad;
}
.zone-future .chronology-point > span { background: #8b69ad; box-shadow: 0 0 0 2px #b7a6ca; }
.zone-current .chronology-point > span { background: #30a363; box-shadow: 0 0 0 2px #73bd92; }
.zone-archive .chronology-point > span { background: #8a9298; box-shadow: 0 0 0 2px #c9cfd4; }
.chronology-point-dates {
  min-width: max-content;
  position: absolute;
  left: 50%;
  z-index: 6;
  display: grid;
  justify-items: center;
  gap: 2px;
  transform: translateX(-50%);
}
.chronology-expiration-dates { bottom: calc(100% + 7px); }
.chronology-effective-dates { top: calc(100% + 7px); }
.chronology-point-dates time {
  padding: 3px 6px;
  border-radius: 7px;
  background: #fff;
  color: #5e7382;
  box-shadow: 0 1px 4px rgba(31,70,94,.08);
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}
.chronology-card {
  width: min(174px, 100%);
  min-height: 150px;
  border: 2px solid #b8cbd7;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 7px 18px rgba(31,70,94,.08);
  overflow: hidden;
}
.chronology-card[hidden] { display: none !important; }
.chronology-card > a {
  min-height: 146px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: inherit;
  text-decoration: none;
}
.chronology-card strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 14px;
  line-height: 1.22;
}
.chronology-card small { color: var(--muted); font-size: 11px; }
.chronology-card time { margin-top: auto; color: #5d7280; font-size: 10px; font-weight: 750; }
.chronology-card-topline { min-height: 24px; display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.chronology-card .document-state-badge { margin: 0; padding: 4px 7px; }
.chronology-card.state-current { border-color: #30a363; }
.chronology-card.state-future { border-color: #b7a6ca; background: #f7f3fa; }
.chronology-card.is-archived { border-color: #c9cfd4; background: #eef0f2; color: #737c83; filter: saturate(.45); }
.chronology-selected-badge { padding: 4px 6px; border-radius: 999px; background: #dff4e7; color: #197743; font-size: 9px; font-weight: 900; white-space: nowrap; }
.chronology-card.is-selected { box-shadow: 0 0 0 3px rgba(48,163,99,.14), 0 7px 18px rgba(31,70,94,.08); }
.chronology-proposal-card {
  width: min(510px, 100%);
  min-height: 0;
  padding: 13px;
  overflow: visible;
}
.chronology-proposal-head > a {
  display: grid;
  gap: 7px;
  color: inherit;
  text-decoration: none;
}
.chronology-proposal-head .chronology-card-topline small {
  color: #71558e;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}
.chronology-proposal-head strong {
  display: block;
  overflow: visible;
  font-size: 15px;
  -webkit-line-clamp: initial;
}
.chronology-proposal-options {
  margin-top: 11px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.chronology-proposal-options .proposal-candidate-card {
  min-height: 122px;
  padding: 10px;
  align-content: start;
  gap: 5px;
}
.chronology-proposal-options .proposal-candidate-card strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 12px;
  line-height: 1.2;
}
.chronology-proposal-options .proposal-candidate-card small,
.chronology-proposal-options .proposal-candidate-card time { font-size: 9px; }
.chronology-proposal-options .proposal-candidate-status { padding: 3px 6px; font-size: 8px; }
.list { display: grid; gap: 10px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 17px; background: white; border: 1px solid var(--line); border-radius: 12px; }
.row-main { min-width: 0; }
.row-main strong { display: block; overflow: hidden; text-overflow: ellipsis; }
.row-actions { display: flex; flex-wrap: wrap; gap: 7px; flex: none; }
.empty { padding: 32px; text-align: center; color: var(--muted); border: 1px dashed #bdc9c3; border-radius: 14px; }
.messages { display: grid; gap: 8px; margin-bottom: 18px; }
.flash { padding: 12px 15px; background: var(--soft); border-left: 4px solid var(--brand-2); border-radius: 8px; }
.flash.error { background: #fae9e9; border-color: var(--danger); }
.access-denied-card { max-width: 760px; margin: clamp(32px, 8vh, 90px) auto; }
.access-denied-card h1 { margin: 8px 0 14px; }
.access-denied-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
form.fields, .fields { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 750; }
input, select, textarea { width: 100%; border: 1px solid #cfd9d4; border-radius: 10px; padding: 11px 12px; background: white; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(77,178,236,.18); border-color: var(--brand-2); }
.errorlist { color: var(--danger); font-size: 13px; margin: 0; padding-left: 18px; }
.form-card details > summary, details.form-card > summary { cursor: pointer; font-weight: 800; list-style: none; }
details.form-card[open] > summary { margin-bottom: 18px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 26px 0 20px; }
.tabs a { padding: 10px 13px; text-decoration: none; font-weight: 700; color: var(--muted); white-space: nowrap; }
.tabs a:hover { color: var(--brand); border-bottom: 2px solid var(--brand); }
.company-tabs { margin: 0 0 24px; padding: 6px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.8); box-shadow: 0 8px 30px rgba(39,64,84,.05); }
.company-tabs.has-archives { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.company-tabs a { min-width: 0; padding: 12px 14px; display: grid; gap: 3px; border-radius: 11px; color: var(--muted); text-decoration: none; }
.company-tabs a span { color: var(--ink); font-weight: 850; }
.company-tabs a small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-tabs a:hover { background: var(--soft); }
.company-tabs a.active { background: var(--sidebar-middle); color: rgba(255,255,255,.78); }
.company-tabs a.active span { color: white; }
.company-metrics .card { min-height: 150px; }
.company-metrics .card > span:last-child { margin-top: auto; color: var(--brand); font-size: 12px; font-weight: 800; }
.company-section-head { margin: 0 0 16px; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.company-section-head h2 { margin: 3px 0 7px; font-size: 28px; }
.quick-create { position: relative; flex: none; }
.quick-create > summary { list-style: none; }
.quick-create > summary::-webkit-details-marker { display: none; }
.quick-create-panel { position: absolute; z-index: 25; top: calc(100% + 9px); right: 0; width: min(440px, calc(100vw - 36px)); max-height: min(680px, 75vh); overflow-y: auto; box-shadow: 0 22px 55px rgba(20,43,61,.2); }
.company-checkbox-field label { display: flex; align-items: center; gap: 10px; min-height: 32px; cursor: pointer; }
.company-checkbox-field label input[type="checkbox"] { width: 18px; height: 18px; margin: 0; padding: 0; flex: 0 0 18px; }
.company-toolbar { margin-bottom: 18px; padding: 15px; display: grid; grid-template-columns: minmax(260px, 1fr) minmax(170px, 230px) auto auto; gap: 10px; align-items: end; border: 1px solid var(--line); border-radius: 15px; background: white; }
.company-toolbar label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.company-toolbar p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; }
.company-client-list { gap: 12px; }
.client-assignment-row { align-items: stretch; }
.client-assignment-row .row-main { min-width: 220px; display: grid; align-content: center; gap: 4px; }
.client-assignment-actions { width: min(670px, 65%); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.inline-assignment-form { min-width: 0; padding: 11px; display: grid; grid-template-columns: 1fr auto; gap: 7px; align-items: end; border: 1px solid var(--line); border-radius: 11px; background: var(--canvas); }
.inline-assignment-form label { grid-column: 1 / -1; color: var(--muted); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.company-access-row { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; }
.access-permissions { display: flex; flex-wrap: wrap; gap: 8px; }
.company-settings-grid .card { min-height: 210px; display: flex; flex-direction: column; align-items: flex-start; }
.company-settings-grid .card h3 { margin: 18px 0 6px; }
.company-settings-grid .card .button { margin-top: auto; }
.archived-client-row { background: #eef1f3; border-color: #c9d0d5; color: #66717a; }
.archived-client-row .row-main strong { color: #59646d; }
.archived-client-row .meta { color: #7c878f; }
.archive-permanent-delete-note { margin-top: 18px; padding: 14px 16px; border: 1px solid #d6dadd; border-radius: 12px; background: #f4f5f6; color: #657079; }
.portfolio-pagination a[aria-disabled="true"] { pointer-events: none; opacity: .45; }

@media (max-width: 960px) {
  .company-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .company-toolbar { grid-template-columns: minmax(0, 1fr) minmax(160px, 210px) auto; }
  .company-toolbar .company-search { grid-column: 1 / -1; }
  .client-assignment-row { display: grid; }
  .client-assignment-actions { width: 100%; }
}

@media (max-width: 680px) {
  .company-hero { margin-bottom: 16px; }
  .company-tabs { margin-left: -12px; margin-right: -12px; padding: 5px 12px; display: flex; overflow-x: auto; border-left: 0; border-right: 0; border-radius: 0; scroll-snap-type: x proximity; }
  .company-tabs a { min-width: 145px; scroll-snap-align: start; }
  .company-tabs a small { display: none; }
  .company-section-head { align-items: stretch; flex-direction: column; }
  .quick-create { width: 100%; }
  .quick-create > summary { width: 100%; }
  .quick-create-panel { position: static; width: 100%; margin-top: 8px; box-shadow: none; }
  .company-toolbar { grid-template-columns: 1fr 1fr; }
  .company-toolbar label { grid-column: 1 / -1; }
  .company-toolbar .button { width: 100%; }
  .client-assignment-actions { grid-template-columns: 1fr; }
  .inline-assignment-form { grid-template-columns: 1fr; }
  .inline-assignment-form label { grid-column: auto; }
  .company-access-row { grid-template-columns: 1fr; align-items: stretch; }
  .company-access-row form, .company-access-row .button { width: 100%; }
}

@media (max-width: 820px) {
  .document-chronology { padding-left: 6px; }
  .document-chronology::before { left: 25px; transform: none; }
  .chronology-arrowhead { left: 27px; transform: translateX(-50%); }
  .chronology-folder-note { margin-left: 50px; }
  .chronology-zone-heading { margin-left: 48px; }
  .chronology-group { min-height: 0; margin-bottom: 22px; grid-template-columns: 50px minmax(0, 1fr); align-items: start; }
  .chronology-point { grid-column: 1; grid-row: 1 / 3; margin-top: 24px; }
  .chronology-side-left,
  .chronology-side-right { grid-column: 2; justify-content: flex-start; }
  .chronology-side-left:not(:empty)::after,
  .chronology-side-right:not(:empty)::before { left: -25px; right: auto; width: 25px; }
  .chronology-side-left.has-branches,
  .chronology-side-right.has-branches { align-items: flex-start; padding-left: 28px; padding-right: 0; }
  .chronology-side-left.has-branches::after,
  .chronology-side-right.has-branches::before { width: 25px; }
  .chronology-side.has-branches .chronology-branch-card > .chronology-card:not(.chronology-proposal-card) { width: min(210px, 100%); }
  .chronology-side-left.has-branches .chronology-branch-card::before {
    left: -28px;
    right: auto;
    top: 50%;
    bottom: auto;
    width: 28px;
    height: 2px;
    transform: translateY(-50%);
  }
  .chronology-side-left.has-branches .chronology-branch-card::after {
    top: -7px;
    bottom: -7px;
    left: -29px;
    right: auto;
    width: 2px;
    height: auto;
    transform: none;
  }
  .chronology-side-left.has-branches .chronology-branch-card:first-child::after { top: 50%; }
  .chronology-side-left.has-branches .chronology-branch-card:last-child::after { bottom: 50%; }
  .chronology-side:empty { display: none; }
  .chronology-card { width: min(210px, 100%); }
}
.policy { border-left: 4px solid var(--accent); }
.document-icon { width: 42px; height: 48px; border-radius: 8px; background: var(--soft); color: var(--brand); display: grid; place-items: center; font-weight: 900; flex: none; }
.document-row { justify-content: flex-start; }
.document-row .row-main { flex: 1; }
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; }
.chat { min-height: 480px; display: flex; flex-direction: column; }
.bubbles { display: flex; flex-direction: column; gap: 12px; flex: 1; max-height: 590px; overflow-y: auto; padding: 5px; }
.bubble { position: relative; align-self: flex-start; max-width: min(76%, 560px); background: #eef2f0; border-radius: 4px 15px 15px 15px; padding: 11px 13px; }
.bubble:has(.chat-message-menu) { padding-right: 39px; }
.bubble.mine { align-self: flex-end; background: #dceee7; border-radius: 15px 4px 15px 15px; }
.bubble-head { font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.bubble p { white-space: pre-wrap; margin: 0; }
.chat-message-menu { position: absolute; top: 5px; right: 7px; z-index: 4; }
.chat-message-menu > summary { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); background: rgba(255,255,255,.68); cursor: pointer; list-style: none; font-weight: 900; }
.chat-message-menu > summary::-webkit-details-marker { display: none; }
.chat-message-menu-panel { position: absolute; z-index: 12; top: 31px; right: 0; width: min(285px, calc(100vw - 70px)); padding: 12px; display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); color: var(--ink); }
.chat-message-menu-panel label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 800; }
.chat-message-menu-panel textarea { font-size: 13px; }
.chat-message-menu-panel form:last-child, .chat-message-menu-panel form:last-child .button { width: 100%; }
.bubble-doc { display: block; margin-top: 9px; padding: 8px 10px; background: rgba(255,255,255,.65); border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 750; }
.composer { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 15px; display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.composer .document-select { grid-column: 1 / -1; }
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1.1fr) minmax(360px, .9fr); background: var(--brand); }
.login-story { padding: clamp(40px, 8vw, 100px); color: white; display: flex; flex-direction: column; justify-content: space-between; }
.login-story h1 { font-size: clamp(44px, 7vw, 82px); max-width: 780px; }
.login-story p { color: #e6f4fd; max-width: 620px; }
.login-story .brand { align-self: flex-start; }
.login-eyebrow { color: #d9effb; }
.login-panel { background: #f8faf9; padding: clamp(32px, 7vw, 92px); display: grid; place-items: center; }
.login-box { width: min(100%, 430px); }
.auth-secondary-link { margin: 16px 0 0; text-align: center; }
.auth-secondary-link a { color: var(--brand); font-weight: 800; }
.login-identifier-hint { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.auth-card { width: min(100%, 540px); padding: clamp(26px, 5vw, 48px); border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: var(--shadow); }
.auth-card h1 { margin: 8px 0 12px; }
.auth-card .button { width: 100%; }
.auth-mail-reminder { display: flex; gap: 6px; align-items: center; margin: 20px 0 4px; padding: 14px 16px; border: 2px solid #efb33e; border-radius: 10px; background: #fff8df; color: #6d4700; line-height: 1.4; }
.auth-mail-reminder strong { font-weight: 900; }
.auth-mail-reminder span { font-weight: 700; }
.required-field-marker { color: #b42318; font-size: 1.05em; font-weight: 900; }
.required-fields-legend { margin: 8px 0 14px; color: var(--muted); font-size: 13px; }
.required-fields-legend span { color: #b42318; font-weight: 900; }
.dashboard-actions { margin: -12px 0 24px; display: flex; flex-wrap: wrap; gap: 10px; }
.portfolio-toolbar { margin: 0 0 22px; padding: 16px; display: grid; grid-template-columns: minmax(240px, 1fr) minmax(180px, 240px) auto auto; gap: 10px; align-items: end; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.8); }
.portfolio-toolbar label { min-width: 0; display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.portfolio-toolbar input, .portfolio-toolbar select { width: 100%; min-width: 0; }
.portfolio-result-count { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; }
.portfolio-pagination { margin-top: 22px; display: flex; justify-content: center; align-items: center; gap: 12px; color: var(--muted); font-weight: 750; }
@media (max-width: 720px) {
  .portfolio-toolbar { grid-template-columns: 1fr 1fr; }
  .portfolio-search-field { grid-column: 1 / -1; }
  .portfolio-sort-field { grid-column: 1 / -1; }
  .portfolio-pagination { flex-wrap: wrap; }
}
.invitation-history { margin-top: 0; }
.invitation-row { gap: 10px; }
.button.compact { min-height: 34px; padding: 7px 11px; font-size: 12px; }
.button.ghost { border: 1px solid var(--line); background: white; color: var(--muted); }
.demo-note { margin-top: 22px; padding: 14px; background: var(--soft); border-radius: 10px; color: var(--muted); font-size: 13px; }
.permission { display: inline-flex; gap: 5px; color: var(--brand-2); font-size: 12px; }
.hero-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.browser-heading { align-items: end; }
.folder-breadcrumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -2px 0 16px; color: var(--muted); font-size: 13px; }
.folder-breadcrumbs a { color: var(--brand-2); font-weight: 750; text-decoration: none; }
.folder-breadcrumbs strong { color: var(--ink); }
.document-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) 220px auto; gap: 10px; margin-bottom: 16px; }
.search-field { position: relative; display: flex; align-items: center; }
.search-field span { position: absolute; left: 14px; color: var(--muted); font-size: 20px; }
.search-field input { padding-left: 42px; }
.view-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: white; }
.view-switch button { min-width: 44px; border: 0; background: white; color: var(--muted); cursor: pointer; font-size: 20px; }
.view-switch button[aria-pressed="true"] { background: var(--brand); color: white; }
.document-explorer { display: grid; gap: 14px; }
.document-explorer[hidden] { display: none !important; }
.document-explorer.grid-view { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); align-items: start; }
.document-explorer.document-grid-view { grid-template-columns: repeat(auto-fill, minmax(275px, 1fr)); align-items: stretch; gap: 16px; }
.document-grid-view > .folder-card,
.document-grid-view > .explorer-empty { grid-column: 1 / -1; }
.document-grid-view > .folder-card { padding: 8px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.document-grid-view > .folder-card .folder-card-link { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 11px; }
.document-grid-view > .folder-card .folder-visual { width: 38px; height: 29px; margin: 0; grid-column: 1; grid-row: 1; font-size: 18px; }
.document-grid-view > .folder-card .folder-visual::before { width: 20px; height: 6px; top: -4px; }
.document-grid-view > .folder-card .file-info { grid-column: 2; grid-row: 1; display: flex; align-items: center; gap: 14px; }
.document-grid-view > .folder-card .file-info .file-title-line { flex: none; }
.document-grid-view > .folder-card .file-info .file-title-line strong,
.document-grid-view > .folder-card .file-info .meta { white-space: nowrap; }
.document-grid-view > .folder-card .file-info .meta { margin: 0; overflow: hidden; text-overflow: ellipsis; }
.document-grid-view > .folder-card > .file-actions { margin: 0; }
.document-grid-view > .document-card,
.document-grid-view > .business-object-card:not(.proposal-mosaic-card) { display: flex; flex-direction: column; min-height: 260px; }
.document-grid-view > .document-card .file-actions,
.document-grid-view > .business-object-card:not(.proposal-mosaic-card) .file-actions { margin-top: auto; padding-top: 16px; }
.document-grid-view > .document-card .scope-manager { margin-top: 12px; }
.proposal-mosaic-card { min-width: 0; min-height: 260px; padding: 17px; display: flex; flex-direction: column; }
.proposal-mosaic-head { min-width: 0; }
.proposal-mosaic-identity { display: flex; align-items: flex-start; gap: 13px; min-width: 0; }
.proposal-mosaic-identity .file-visual { width: 45px; height: 53px; margin: 0; flex: 0 0 45px; }
.proposal-mosaic-head .file-info { min-width: 0; }
.proposal-mosaic-head .file-title-line { align-items: flex-start; flex-wrap: wrap; }
.proposal-mosaic-head .file-title-line strong { min-width: 0; overflow-wrap: anywhere; }
.proposal-mosaic-head .meta { margin-bottom: 0; }
.proposal-option-mosaic { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.proposal-candidate-card { min-width: 0; padding: 13px; display: grid; gap: 6px; border: 1px solid #cfc1dd; border-radius: 12px; background: #fff; color: var(--ink); text-decoration: none; transition: border-color .16s, box-shadow .16s, transform .16s; }
.proposal-candidate-card:hover { border-color: #8d71a8; box-shadow: 0 8px 18px rgba(95,77,114,.12); transform: translateY(-1px); }
.proposal-candidate-card.is-selected { border: 2px solid #30a363; box-shadow: 0 0 0 2px rgba(48,163,99,.12); }
.proposal-candidate-card.is-not-selected { opacity: .68; filter: saturate(.7); }
.proposal-candidate-card strong { overflow-wrap: anywhere; }
.proposal-candidate-card small,
.proposal-candidate-card time { color: var(--muted); font-size: 11px; }
.proposal-candidate-status { width: fit-content; padding: 4px 7px; border-radius: 999px; background: #e9e1f1; color: #71558e; font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .035em; }
.proposal-candidate-card.is-selected .proposal-candidate-status { background: #dff4e7; color: #197743; }
.proposal-mosaic-empty { padding: 11px 12px; border: 1px dashed #cfc1dd; border-radius: 11px; color: var(--muted); font-size: 13px; }
.proposal-mosaic-actions { margin-top: auto; padding-top: 14px; }
.document-explorer.timeline-row-view { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.document-lineage-row { min-width: 0; padding: 12px; border: 1px solid #d7e2ea; border-radius: 16px; background: #f7fafc; }
.document-lineage-row.is-standalone { padding: 0; border: 0; background: transparent; }
.document-lineage-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 10px; padding: 1px 4px; }
.document-lineage-head > div { display: grid; gap: 2px; }
.document-lineage-head strong { color: var(--ink); font-size: 15px; }
.document-lineage-head > span { color: var(--muted); font-size: 11px; font-weight: 800; white-space: nowrap; }
.document-lineage-track { display: flex; align-items: stretch; gap: 34px; min-width: 0; overflow-x: auto; padding: 4px 4px 10px; scrollbar-width: thin; }
.document-lineage-track .document-card { position: relative; flex: 0 0 min(285px, calc(100vw - 92px)); display: flex; flex-direction: column; min-height: 245px; }
.document-lineage-row.is-standalone .document-lineage-track { overflow: visible; padding: 0; }
.document-lineage-row.is-standalone .document-card { flex-basis: min(560px, 100%); min-height: 0; }
.document-lineage-row.is-linked .document-card:not(:first-child)::before { content: "←"; position: absolute; left: -28px; top: 50%; width: 22px; transform: translateY(-50%); color: #6e8fa8; font-size: 22px; font-weight: 900; text-align: center; }
.timeline-row-view > .folder-card,
.timeline-row-view > .business-object-card { width: 100%; }
.file-card { background: white; border: 1px solid var(--line); border-radius: 15px; padding: 17px; min-width: 0; position: relative; transition: box-shadow .16s, transform .16s; }
.file-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.folder-card { border-color: #cbded6; background: #fbfdfc; }
.folder-card-link { color: inherit; text-decoration: none; display: flex; flex: 1; min-width: 0; flex-direction: column; }
.folder-visual { width: 70px; height: 53px; border-radius: 8px 10px 10px 10px; background: #dcedf8; color: var(--brand); display: grid; place-items: center; font-size: 32px; margin-bottom: 32px; position: relative; }
.folder-visual::before { content: ""; position: absolute; width: 34px; height: 10px; top: -7px; left: 0; border-radius: 6px 6px 0 0; background: #b9def1; }
.folder-visual.is-shared { background: #e9e0f8; color: #7136a7; }
.folder-visual.is-shared::before { background: #d1b9ed; }
.folder-shortcut-card { border-style: dashed; }
.folder-visual.shortcut-visual { background: #fff4d8; color: #9a6500; }
.folder-visual.shortcut-visual::before { background: #f2d58c; }
.shared-folder-icon { width: 62%; height: 62%; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.is-shared-folder { border-color: #bda4dc; background: #fcfaff; }
.shared-folder-meta { color: #7136a7; }
.shared-folder-pill { padding: 4px 8px; border-radius: 999px; background: #eadff7; color: #7136a7; font-size: 10px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.shared-folder-status { min-height: 34px; padding: 7px 11px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid #cdb7e6; border-radius: 999px; background: #f3ecfb; color: #66309a; font-size: 11px; font-weight: 800; line-height: 1.25; }
.shared-folder-status .shared-folder-icon { width: 20px; height: 20px; flex: 0 0 20px; }
.shared-folder-status.prominent { margin: 10px 0 4px; border-radius: 11px; font-size: 13px; }
.shared-folder-separation-note { margin: 0; padding: .8rem .9rem; border: 1px solid #dfc8a0; border-radius: 12px; background: #fff8eb; color: #694b1f; font-size: .86rem; line-height: 1.45; }
.shared-folder-hero-title { margin-top: 8px; display: flex; align-items: center; gap: 14px; }
.shared-folder-hero-title h1 { margin: 0; }
.shared-folder-hero-title .folder-visual { width: 54px; height: 42px; margin: 0; flex: 0 0 54px; }
.shared-folder-hero-title .folder-visual::before { width: 27px; height: 8px; top: -5px; }
.shared-service-icon { color: #7136a7; }
.shared-service-icon .shared-folder-icon { width: 28px; height: 28px; }
.folder-file-count { color: var(--brand); }
.timeline-row-view > .folder-card { padding: 8px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.timeline-row-view > .folder-card .folder-card-link { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 11px; }
.timeline-row-view > .folder-card .folder-visual { width: 38px; height: 29px; margin: 0; grid-column: 1; grid-row: 1; font-size: 18px; }
.timeline-row-view > .folder-card .folder-visual::before { width: 20px; height: 6px; top: -4px; }
.timeline-row-view > .folder-card .file-info { grid-column: 2; grid-row: 1; display: flex; align-items: center; gap: 14px; }
.timeline-row-view > .folder-card .file-info .file-title-line { flex: none; }
.timeline-row-view > .folder-card .file-info .file-title-line strong,
.timeline-row-view > .folder-card .file-info .meta { white-space: nowrap; }
.timeline-row-view > .folder-card .file-info .meta { margin: 0; overflow: hidden; text-overflow: ellipsis; }
.timeline-row-view > .folder-card .item-contacts { position: static; grid-column: 3; grid-row: 1; max-width: none; display: flex; align-items: center; justify-content: flex-end; gap: 6px; text-align: right; white-space: nowrap; }
.timeline-row-view > .folder-card .item-contacts span,
.timeline-row-view > .folder-card .item-contacts strong,
.timeline-row-view > .folder-card .item-contacts small { display: inline; margin: 0; }
.timeline-row-view > .folder-card > .file-actions { margin: 0; }
.document-lineage-row.is-standalone .document-card { flex-basis: 100%; min-height: 0; padding: 13px 14px; display: grid; grid-template-columns: 58px minmax(0, 1fr) minmax(150px, auto); grid-template-rows: auto auto; align-items: center; gap: 5px 14px; }
.document-lineage-row.is-standalone .document-card .file-visual { grid-column: 1; grid-row: 1 / 3; width: 45px; height: 53px; margin: 0; }
.document-lineage-row.is-standalone .document-card .file-info { grid-column: 2; grid-row: 1 / 3; }
.document-lineage-row.is-standalone .document-card .item-contacts { position: static; grid-column: 3; grid-row: 1; max-width: none; text-align: right; }
.document-lineage-row.is-standalone .document-card .file-actions { grid-column: 3; grid-row: 2; justify-content: flex-end; margin: 0; }
.document-lineage-row.is-standalone .document-card .scope-manager { grid-column: 1 / -1; }
.timeline-row-view > .business-object-card { padding: 13px 14px; display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.timeline-row-view > .business-object-card .file-visual { width: 45px; height: 53px; margin: 0; }
.timeline-row-view > .business-object-card .file-actions { margin: 0; }
.grid-view .file-card { display: flex; flex-direction: column; min-height: 245px; }
.file-visual { width: 54px; height: 64px; border-radius: 9px; display: grid; place-items: center; color: white; font-size: 12px; font-weight: 900; letter-spacing: .06em; margin-bottom: 22px; position: relative; overflow: hidden; }
.file-visual::after { content: ""; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 15px 15px 0; border-color: transparent rgba(255,255,255,.45) transparent transparent; }
.file-visual.pdf { background: #b55256; }
.file-visual.image { background: var(--brand-2); }
.file-info { min-width: 0; flex: 1; }
.file-title-line { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.file-title-line strong { overflow-wrap: anywhere; }
.file-title-line .reference { flex: none; font-size: 10px; }
.file-properties { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.file-properties span { background: #f4f6f5; color: #52605a; border-radius: 6px; padding: 5px 7px; font-size: 11px; }
.file-actions { display: flex; gap: 7px; align-items: center; margin-top: 18px; }
.file-menu { position: relative; }
.file-menu summary { list-style: none; cursor: pointer; }
.file-menu summary::-webkit-details-marker { display: none; }
.file-menu-panel { position: absolute; z-index: 18; right: 0; bottom: calc(100% + 7px); width: min(310px, calc(100vw - 40px)); padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); display: grid; gap: 12px; }
.viewport-popover-positioned { box-sizing: border-box; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.file-menu-panel .move-document-form { position: static; width: 100%; padding: 0; border: 0; box-shadow: none; }
.file-menu-links { padding-top: 10px; display: grid; gap: 8px; border-top: 1px solid var(--line); }
.file-menu-links form, .file-menu-links .button { width: 100%; }
.file-actions > .file-menu { margin-left: auto; }
.document-actions-panel { width: min(290px, calc(100vw - 40px)); max-height: min(580px, calc(100dvh - 80px)); padding: 8px; gap: 2px; overflow-y: auto; overscroll-behavior: contain; }
.file-menu-title { padding: 7px 9px 9px; color: var(--muted); font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.file-menu-action { width: 100%; min-height: 38px; padding: 9px 10px; display: flex; align-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-size: 12px; font-weight: 750; line-height: 1.3; text-align: left; text-decoration: none; cursor: pointer; }
.file-menu-action:hover, .file-menu-action:focus-visible { background: var(--soft); color: var(--brand); outline: none; }
.signature-menu-action { color: #a85a00; background: #fff6df; }
.file-menu-section { margin-top: 4px; padding-top: 4px; display: grid; gap: 2px; border-top: 1px solid var(--line); }
.file-menu-danger-section .danger-text { color: var(--danger); }
.file-menu-submenu > summary { list-style: none; }
.file-menu-submenu > summary::-webkit-details-marker { display: none; }
.file-menu-submenu[open] { padding-bottom: 6px; }
.file-menu-submenu[open] > summary { color: var(--brand); background: var(--soft); }
.file-menu-submenu .move-document-form, .file-menu-submenu > form { margin: 5px 6px 2px; width: auto; padding: 10px; display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 9px; background: #f8faf9; box-shadow: none; }
.file-menu-submenu .fields { display: grid; }
.document-page-action-menu .file-menu-panel { top: calc(100% + 7px); bottom: auto; max-height: min(560px, calc(100dvh - 310px)); }
.document-page-action-menu > summary { width: 42px; height: 42px; background: white; }
.folder-management-menu .file-menu-panel label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 750; }
.folder-management-menu .file-menu-panel form { display: grid; gap: 8px; }
.move-document-form { position: absolute; z-index: 8; right: 0; bottom: calc(100% + 7px); width: min(300px, calc(100vw - 56px)); padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); display: grid; gap: 8px; }
.move-document-form label { color: var(--muted); font-size: 12px; font-weight: 750; }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; display: grid; place-items: center; text-decoration: none; color: var(--brand); font-weight: 900; }
.list-view { grid-template-columns: 1fr; }
.list-view .file-card { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.list-view .file-visual { width: 42px; height: 49px; margin: 0; }
.list-view .file-actions { margin: 0; }
.list-view .folder-card { grid-template-columns: minmax(0, 1fr) auto; }
.list-view .folder-card-link { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; align-items: center; }
.list-view .folder-visual { width: 44px; height: 34px; margin: 0; font-size: 20px; }
.list-view .folder-visual::before { width: 22px; height: 7px; top: -5px; }
.list-view .folder-card .file-actions { grid-column: 2; }
.explorer-empty { grid-column: 1 / -1; }
.modal { width: min(720px, calc(100vw - 30px)); max-height: calc(100dvh - 30px); border: 0; border-radius: 18px; padding: 0; box-shadow: 0 26px 90px rgba(10,28,21,.28); }
.modal::backdrop { background: rgba(14,32,25,.55); backdrop-filter: blur(3px); }
.modal-card { padding: 25px; overflow-y: auto; max-height: calc(100dvh - 30px); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.modal-head h2 { margin-top: 5px; font-size: 29px; }
.modal-close { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: white; color: var(--ink); font-size: 25px; line-height: 1; cursor: pointer; }
.modal-action-context { margin: 14px 0 12px; padding: 11px 13px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; border: 1px solid rgba(23,111,174,.2); border-radius: 12px; background: #edf6fc; }
.modal-action-context span, .modal-action-context small, .modal-action-context strong { display: block; min-width: 0; }
.modal-action-context small { margin-bottom: 2px; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.modal-action-context strong { color: var(--ink); font-size: 13px; overflow-wrap: anywhere; }
.document-form { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 20px; }
.document-form .full { grid-column: 1 / -1; }
.field small { color: var(--muted); }
.policy-properties[hidden] { display: none; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 8px; }
.document-delete-zone {
  margin-top: 28px;
  padding: 16px;
  border: 1px solid #f0c7c7;
  border-radius: 14px;
  background: #fff7f7;
}
.document-delete-zone strong { color: var(--danger); }
.document-delete-zone .button { margin-top: 8px; }
.account-hero { align-items: center; }
.account-summary { display: flex; align-items: center; gap: 13px; padding: 12px 15px; background: white; border: 1px solid var(--line); border-radius: 15px; min-width: min(100%, 310px); }
.account-summary img, .account-avatar-placeholder { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; }
.account-avatar-placeholder { display: grid; place-items: center; background: var(--soft); color: var(--brand); font-size: 20px; font-weight: 900; text-transform: uppercase; }
.account-summary strong, .account-summary span { display: block; }
.account-summary span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .85fr); gap: 22px; align-items: start; }
.settings-card { margin-top: 0; padding: 24px; background: white; border: 1px solid var(--line); border-radius: 17px; }
.settings-tabs { margin: 0 0 16px; padding: 5px; display: inline-flex; gap: 4px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.settings-tabs a { padding: 10px 16px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 800; }
.settings-tabs a.active { background: var(--brand); color: white; }
.tabbed-settings { display: block; }
.tabbed-settings > .settings-card { max-width: 920px; }
.account-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.account-form .full, .password-form .full { grid-column: 1 / -1; }
.notification-channel-card { display: grid; gap: 14px; margin-top: 18px; padding: 20px; border: 1px solid #b8dff4; border-radius: 16px; background: #f2faff; }
.notification-channel-card h3, .notification-email-settings h3 { margin: 0 0 6px; }
.notification-channel-card p, .notification-email-settings p { margin: 0; }
.notification-channel-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.notification-channel-actions [hidden], .webpush-permission-help[hidden] { display: none !important; }
.webpush-status { padding: 11px 13px; border-radius: 11px; background: #e8f4fb; color: #24475d; font-weight: 700; }
.webpush-status[data-kind="success"] { background: #e9f8ef; color: #176237; }
.webpush-status[data-kind="error"] { background: #fff0f0; color: #9d2f37; }
.webpush-permission-help { padding: 14px 16px; border: 1px solid #efc3c3; border-radius: 12px; background: #fff7f7; color: #5d3035; }
.webpush-permission-help strong { display: block; margin-bottom: 7px; }
.webpush-permission-help ol { margin: 0; padding-left: 20px; }
.webpush-permission-help li + li { margin-top: 5px; }
.notification-email-settings { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.notification-email-settings form { margin-top: 14px; }
.profile-photo-field input { padding: 8px; }
.checkbox-line { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.checkbox-line input { width: auto; }
.client-share-options > div { display: grid; gap: 8px; }
.client-share-options > div > div { min-width: 0; }
.client-share-options label { width: 100%; min-height: 44px; padding: 10px 12px; display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--ink); font-size: 14px; font-weight: 750; line-height: 1.25; cursor: pointer; }
.client-share-options label:hover { border-color: rgba(23,111,174,.42); background: var(--soft); }
.client-share-options label:has(input[type="checkbox"]:checked) { border-color: var(--brand); background: rgba(23,111,174,.08); }
.client-share-options input[type="checkbox"] { width: 18px; min-width: 18px; height: 18px; margin: 0; padding: 0; flex: 0 0 18px; accent-color: var(--brand); }
.form-actions { display: flex; justify-content: flex-end; padding-top: 5px; }
.password-form small, .password-form small ul { color: var(--muted); font-size: 11px; }
.password-form small ul { margin: 4px 0 0; padding-left: 18px; }
.chat-fab { position: fixed; right: 24px; bottom: 24px; z-index: 40; border: 0; border-radius: 999px; background: var(--brand); color: white; box-shadow: 0 14px 40px rgba(23,111,174,.3); padding: 13px 18px; display: flex; align-items: center; gap: 8px; font-weight: 800; cursor: pointer; }
.chat-fab:hover { background: var(--brand-2); transform: translateY(-1px); }
.chat-fab-icon { width: 21px; height: 21px; display: grid; place-items: center; }
.chat-fab-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.chat-unread-badge { position: absolute; top: -8px; right: -7px; min-width: 24px; height: 24px; padding: 0 6px; display: grid; place-items: center; border: 3px solid var(--canvas); border-radius: 999px; background: #df2638; color: white; font-size: 11px; line-height: 1; box-shadow: 0 4px 12px rgba(150,20,35,.28); }
.chat-unread-badge[hidden] { display: none; }
.chat-toast { position: fixed; right: 24px; bottom: 84px; z-index: 48; width: min(330px, calc(100vw - 30px)); padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--brand-2); border-radius: 12px; background: white; box-shadow: var(--shadow); cursor: pointer; animation: chat-toast-in .18s ease-out; }
.chat-toast[hidden] { display: none; }
.chat-toast strong, .chat-toast span { display: block; }
.chat-toast span { margin-top: 3px; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes chat-toast-in { from { opacity: 0; transform: translateY(8px); } }
.chat-backdrop { position: fixed; inset: 0; z-index: 49; border: 0; background: rgba(14,32,25,.3); backdrop-filter: blur(2px); }
.chat-drawer { position: fixed; z-index: 50; top: 12px; right: 12px; bottom: 12px; width: min(440px, calc(100vw - 24px)); height: auto; background: #f7f9f8; border: 1px solid rgba(17,75,108,.18); border-radius: 18px; box-shadow: -14px 0 34px rgba(15,35,27,.18), 0 18px 48px rgba(15,35,27,.16); overflow: hidden; transform: translateX(calc(105% + 24px)); transition: transform .22s ease; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.chat-drawer.has-subject-bar { grid-template-rows: auto auto minmax(0, 1fr) auto; }
.chat-drawer.has-subject-bar.has-group-creator { grid-template-rows: auto auto auto minmax(0, 1fr) auto; }
.chat-drawer.open { transform: translateX(0); }
.chat-head { padding: 20px 21px 15px; background: white; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; }
.chat-head h2 { margin: 4px 0 0; }
.chat-head-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.chat-client-name { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.chat-client-switch { display: grid; gap: 4px; margin-top: 10px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.chat-client-switch select { padding: 6px 28px 6px 8px; font-size: 12px; text-transform: none; letter-spacing: 0; }
.chat-subject-bar { position: relative; z-index: 8; padding: 11px 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; align-items: center; border-bottom: 1px solid var(--line); box-shadow: 0 9px 15px -11px rgba(15,35,27,.72); }
.chat-subject-current span, .chat-subject-current strong { display: block; }
.chat-subject-current span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.chat-subject-current strong { margin-top: 2px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subject-close { width: 30px; height: 30px; border: 1px solid rgba(23,111,174,.16); border-radius: 50%; background: rgba(255,255,255,.72); color: var(--brand); cursor: pointer; font-size: 19px; }
.subject-close[hidden], .chat-switch-subject[hidden] { display: none; }
.chat-switch-subject { grid-column: 1 / -1; padding: 8px 10px; display: flex; gap: 5px; align-items: baseline; border: 1px solid rgba(23,111,174,.15); border-radius: 9px; background: rgba(255,255,255,.72); color: var(--brand); cursor: pointer; text-align: left; }
.chat-switch-subject span { color: var(--muted); font-size: 11px; }
.chat-switch-subject strong { font-size: 12px; }
.chat-drawer .bubbles { padding: 0; gap: 0; max-height: none; overflow-y: auto; }
.chat-message-assignment-toolbar { position: sticky; top: 0; z-index: 24; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); box-shadow: 0 5px 14px rgba(13,74,115,.08); }
.chat-message-assignment-toolbar[hidden] { display: none; }
.chat-message-assignment-toolbar > strong { flex: none; color: var(--brand); font-size: 12px; }
.chat-message-assignment-actions { min-width: 0; display: flex; align-items: end; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.chat-message-subject-picker { min-width: 150px; display: grid; gap: 2px; color: var(--muted); font-size: 10px; font-weight: 800; }
.chat-message-subject-picker select { min-width: 0; width: 100%; padding: 7px 8px; }
.chat-message-selector { float: right; margin: -2px -3px 5px 9px; display: grid; place-items: center; cursor: pointer; }
.chat-message-selector input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.chat-message-selector span { display: none; }
.chat-reply-last-client { margin-top: 10px; padding: 9px 10px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--soft); color: var(--ink); font-size: 12px; font-weight: 800; cursor: pointer; }
.chat-reply-last-client[hidden] { display: none; }
.chat-reply-last-client input { width: 17px; height: 17px; margin: 0; accent-color: var(--brand); }
.chat-subject-segment { width: 100%; border: 0; border-radius: 0; overflow: visible; }
.chat-subject-divider { width: 100%; min-height: 43px; padding: 8px 20px; display: grid; gap: 4px; color: var(--muted); border-top: 1px solid rgba(23,111,174,.16); border-bottom: 1px solid rgba(23,111,174,.11); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.system-notification-segment { padding: 0 14px; background: #fff8f8; border-top: 2px solid #db2f43; border-bottom: 2px solid #db2f43; }
.system-notification-divider { min-height: 34px; display: flex; align-items: center; justify-content: center; color: #b3182f; font-size: 10px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.system-notification-divider span { padding: 0 10px; background: #fff8f8; }
.system-notification-bubble { width: 100%; max-width: none; margin: 0 0 4px; border: 1px solid rgba(197,31,58,.25); background: #fff; box-shadow: 0 8px 22px rgba(146,20,40,.08); }
.system-notification-bubble .bubble-head { color: #b3182f; }
.system-notification-segment.is-resolved { background: #f2fbf5; border-color: #23985a; }
.system-notification-segment.is-resolved .system-notification-divider { color: #237647; }
.system-notification-segment.is-resolved .system-notification-divider span { background: #f2fbf5; }
.system-notification-bubble.is-resolved { border-color: rgba(35,152,90,.42); background: #fbfffc; box-shadow: 0 8px 22px rgba(35,118,71,.08); }
.system-notification-bubble.is-resolved .bubble-head { color: #237647; }
.system-notification-segment.resolution-cancelled,
.system-notification-segment.resolution-expired { background: #f5f6f7; border-color: #87939d; }
.system-notification-segment.resolution-cancelled .system-notification-divider,
.system-notification-segment.resolution-expired .system-notification-divider { color: #5e6b75; }
.system-notification-segment.resolution-cancelled .system-notification-divider span,
.system-notification-segment.resolution-expired .system-notification-divider span { background: #f5f6f7; }
.system-notification-bubble.resolution-cancelled,
.system-notification-bubble.resolution-expired { border-color: #cbd2d8; background: #f8f9fa; box-shadow: none; }
.system-notification-action { width: 100%; margin-top: 10px; text-align: center; }
.chat-message-action { display: inline-flex; width: auto; margin-top: 10px; }
.bubble .chat-email-copy-note { margin-top: 8px; color: var(--muted); font-size: 11px; font-style: italic; }
.action-email-copy-option,.signature-email-copy-option{display:flex!important;align-items:flex-start!important;grid-template-columns:none!important;gap:9px;margin:10px 0;color:var(--muted);font-size:12px;line-height:1.4;cursor:pointer}.action-email-copy-option[hidden]{display:none!important}.action-email-copy-option input,.signature-email-copy-option input{flex:0 0 auto;width:17px!important;height:17px!important;margin:1px 0 0}.action-email-copy-option.compact{margin:0;font-size:11px;white-space:nowrap}.invitation-resend-form{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.notification-acknowledgement { display: flex; justify-content: flex-end; margin-top: 10px; }
.notification-acknowledged { margin: 10px 0 0; color: #237647; font-size: 12px; font-weight: 800; text-align: right; }
.select-search-input { width: 100%; min-height: 42px; margin: 0 0 7px; padding: 9px 12px; border: 1px solid #cbdbe4; border-radius: 10px; background: #fff; color: #102131; font: inherit; }
.select-search-input:focus { border-color: #1683bd; outline: 3px solid rgba(22,131,189,.13); }
.notification-avatar { background: #fce8eb !important; color: #bf2038 !important; }
.notification-conversation-banner { padding: 11px 16px; border-block: 1px solid rgba(197,31,58,.2); background: #fff2f4; color: #b3182f; font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.notification-conversation-readonly { padding: 14px 18px; border-top: 1px solid var(--line); background: #f7f8f9; color: var(--muted); font-size: 12px; text-align: center; }
.chat-subject-path-row { min-width: 0; padding-left: calc(var(--subject-depth, 0) * 15px); display: flex; gap: 7px; align-items: center; }
.chat-subject-path-row::before { content: ""; height: 1px; min-width: 12px; flex: 1; background: currentColor; opacity: .35; }
.chat-subject-path-row span { flex: none; }
.chat-subject-path-row a, .chat-subject-path-row strong { min-width: 0; max-width: 62%; color: var(--brand); overflow: hidden; text-overflow: ellipsis; text-transform: none; white-space: nowrap; letter-spacing: 0; }
.chat-segment-messages { padding: 13px 20px 17px; display: flex; flex-direction: column; gap: 9px; }
.chat-segment-messages:empty { display: none; }
.chat-drawer .bubble { max-width: 87%; box-shadow: 0 1px 0 rgba(0,0,0,.03); }
.subject-tone-0 { background: #f8faf9; }
.subject-tone-1 { background: #edf4fb; }
.subject-tone-2 { background: #edf7f2; }
.subject-tone-3 { background: #fbf5e9; }
.subject-tone-4 { background: #f4f0fa; }
.subject-tone-5 { background: #faeff1; }
.chat-subject-segment.subject-tone-1 .bubble { background: #e1edf8; }
.chat-subject-segment.subject-tone-2 .bubble { background: #dff0e7; }
.chat-subject-segment.subject-tone-3 .bubble { background: #f5ead3; }
.chat-subject-segment.subject-tone-4 .bubble { background: #eae2f5; }
.chat-subject-segment.subject-tone-5 .bubble { background: #f4dfe3; }
.chat-subject-segment .bubble.mine { filter: saturate(1.08) brightness(.98); }
.chat-simple-mode #chatMessages { padding: 13px 20px 17px; gap: 9px; }
.chat-simple-mode .chat-subject-segment,
.chat-simple-mode .chat-subject-segment .chat-segment-messages { display: contents; }
.chat-simple-mode .chat-subject-divider,
.chat-simple-mode .system-notification-divider { display: none; }
.chat-simple-mode .chat-subject-segment .bubble { margin: 0; border: 0; background: #eef2f0; box-shadow: 0 1px 0 rgba(0,0,0,.03); filter: none; }
.chat-simple-mode .chat-subject-segment .bubble.mine { background: #dceee7; filter: none; }
.chat-simple-mode .notification-acknowledged { color: var(--muted); }
.bubble-doc { display: flex; align-items: center; gap: 9px; }
.bubble-doc span:nth-child(2) { flex: 1; min-width: 0; }
.bubble-doc strong, .bubble-doc small { display: block; }
.bubble-doc small { color: var(--muted); font-weight: 500; margin-top: 2px; }
.drawer-composer { background: white; border-top: 1px solid var(--line); padding: 13px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: end; position: relative; }
.chat-form-error { grid-column: 1 / -1; padding: 8px 10px; border-radius: 8px; background: #fae9e9; color: var(--danger); font-size: 12px; }
.chat-form-error[hidden] { display: none; }
.drawer-composer textarea { min-height: 47px; max-height: 130px; resize: vertical; }
.attachment-menu { position: relative; }
.attachment-menu summary { list-style: none; width: 44px; height: 44px; border-radius: 50%; background: var(--soft); color: var(--brand); display: grid; place-items: center; cursor: pointer; font-size: 24px; font-weight: 400; }
.attachment-menu summary::-webkit-details-marker { display: none; }
.attachment-popover { position: absolute; z-index: 35; left: 0; bottom: 54px; width: min(360px, calc(100vw - 30px)); padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: var(--shadow); }
.attachment-popover-head { margin: -3px 0 12px; padding-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.attachment-popover-head strong { font-size: 13px; }
.attachment-popover-close { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border: 1px solid rgba(183,44,55,.25); border-radius: 50%; background: #fff2f2; color: #b72c37; font-size: 20px; line-height: 1; cursor: pointer; }
.attachment-popover-close:hover { background: #b72c37; color: white; }
.hierarchy-panel { min-width: 0; }
.hierarchy-breadcrumb { margin: 4px 0 9px; padding: 8px 10px; border-radius: 8px; background: var(--soft); color: var(--brand); font-size: 12px; font-weight: 750; overflow-wrap: anywhere; }
.hierarchy-levels { display: grid; gap: 8px; }
.hierarchy-level { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px; align-items: center; }
.hierarchy-level label { margin: 0; color: var(--muted); font-size: 11px; font-weight: 750; }
.hierarchy-level select { min-width: 0; width: 100%; }
.attachment-kind-field { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.attachment-kind-field select, .attachment-panel select { width: 100%; min-width: 0; }
.attachment-panel[hidden] { display: none; }
.chat-upload-field { margin-top: 0; }
.chat-upload-field small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.chat-drop-zone { min-height: 112px; padding: 16px; display: grid; place-items: center; align-content: center; gap: 5px; border: 1px dashed #8dc4df; border-radius: 11px; background: var(--soft); color: var(--brand); text-align: center; cursor: pointer; transition: border-color .16s, background .16s; }
.chat-drop-zone.drag-over { border-color: var(--brand); background: #dff1fb; }
.chat-drop-zone span { color: var(--muted); font-size: 12px; }
.chat-drop-zone input[type="file"] { width: 100%; margin-top: 8px; font-size: 12px; }
.attachment-coming-soon { min-height: 88px; padding: 14px; display: grid; align-content: center; gap: 5px; border-radius: 10px; background: #f3f5f6; color: var(--muted); }
.attachment-coming-soon small { line-height: 1.35; }
.chat-import-status { min-height: 44px; padding: 9px 12px; display: flex; align-items: center; border: 1px dashed rgba(23,111,174,.24); border-radius: 10px; background: var(--soft); color: var(--brand); font-size: 12px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-import-status[hidden] { display: none; }
.send-button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--brand); color: white; cursor: pointer; }
.send-button:disabled { cursor: not-allowed; opacity: .45; }
.discussion-workspace { width: min(100%, 1080px); margin: 0 auto; }
.discussion-page-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 22px; }
.discussion-page-head h1 { margin-top: 6px; }
.discussion-page-head .lead { margin-bottom: 0; }
.discussion-client-picker { width: min(290px, 100%); display: grid; gap: 6px; flex: none; }
.discussion-client-picker span, .discussion-filter-field > span, .discussion-filters > label > span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.discussion-filters { display: grid; grid-template-columns: minmax(190px, 1.5fr) minmax(135px, .8fr) minmax(135px, .8fr) minmax(190px, 1.2fr) auto; gap: 10px; align-items: end; padding: 15px; border: 1px solid var(--line); border-radius: 14px 14px 0 0; background: white; }
.discussion-filters.contacts-disabled { grid-template-columns: minmax(220px, 1.5fr) minmax(145px, .8fr) minmax(145px, .8fr) auto; }
.discussion-filters label { display: grid; gap: 6px; }
.discussion-filter-field { position: relative; min-width: 0; display: grid; gap: 6px; }
.multi-filter { position: relative; }
.multi-filter > summary { min-height: 41px; padding: 9px 10px; display: flex; justify-content: space-between; gap: 10px; align-items: center; border: 1px solid #cfd9d4; border-radius: 10px; background: white; cursor: pointer; list-style: none; }
.multi-filter > summary::-webkit-details-marker { display: none; }
.multi-filter > summary span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-filter > summary b { color: var(--muted); font-size: 14px; }
.multi-filter[open] > summary { border-color: var(--brand-2); outline: 3px solid rgba(77,178,236,.18); }
.multi-filter-popover { position: absolute; z-index: 20; top: calc(100% + 7px); left: 0; width: max(100%, 250px); max-height: 260px; padding: 8px; overflow-y: auto; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: var(--shadow); }
.multi-filter-popover label { padding: 8px 9px; display: flex; grid-template-columns: none; gap: 9px; align-items: center; border-radius: 8px; cursor: pointer; }
.multi-filter-popover label:hover { background: var(--soft); }
.multi-filter-popover input { width: 17px; height: 17px; margin: 0; padding: 0; flex: none; accent-color: var(--brand-2); }
.multi-filter-popover label span { min-width: 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 650; }
.multi-filter-popover .tree-filter-option { padding-left: calc(9px + var(--tree-depth, 0) * 17px); }
.tree-filter-option span { display: grid; gap: 1px; }
.tree-filter-option span small { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.discussion-filters input, .discussion-filters select { padding: 9px 10px; }
.discussion-result-bar { min-height: 42px; padding: 10px 15px; display: flex; justify-content: space-between; gap: 15px; align-items: center; border: solid var(--line); border-width: 0 1px 1px; background: #f8faf9; color: var(--muted); font-size: 12px; }
.discussion-result-bar strong { color: var(--brand); }
.chat-drawer.chat-page-panel { position: relative; z-index: 1; top: auto; right: auto; bottom: auto; left: auto; width: 100%; height: 720px; min-height: 620px; max-height: calc(100dvh - 150px); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 18px 18px; box-shadow: var(--shadow); transform: none; transition: none; overflow: visible; }
.chat-page-panel .chat-head { border-radius: 0; }
.chat-page-panel .bubbles { min-height: 0; }
.chat-page-panel .bubble { max-width: min(76%, 640px); }
.discussion-chat-head { align-items: center; }
.realtime-indicator { display: inline-flex; gap: 7px; align-items: center; padding: 6px 9px; border-radius: 999px; background: var(--soft); color: var(--brand-2); font-size: 11px; font-weight: 800; }
.realtime-indicator i { width: 7px; height: 7px; border-radius: 50%; background: #2c9a72; box-shadow: 0 0 0 4px rgba(44,154,114,.13); }
.discussion-no-results { position: absolute; z-index: 3; left: 50%; top: 52%; transform: translate(-50%, -50%); width: min(360px, calc(100% - 30px)); padding: 18px; border: 1px dashed #bdc9c3; border-radius: 12px; background: rgba(255,255,255,.94); color: var(--muted); text-align: center; box-shadow: var(--shadow); }
.discussion-no-results[hidden] { display: none; }
.chat-disabled { margin: 14px; padding: 14px; border-radius: 10px; background: #f1e8e8; color: #7b3a3e; }
body.chat-open { overflow: hidden; }
.document-banner { background: white; border: 1px solid var(--line); border-radius: 18px 18px 0 0; padding: 24px; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.document-identity { min-width: 0; }
.page-back-button { position: fixed; left: 274px; top: 94px; z-index: 40; width: fit-content; min-height: 38px; margin: 0; padding: 8px 13px 8px 10px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid rgba(20, 76, 112, .13); border-radius: 999px; background: rgba(255, 255, 255, .28); color: var(--brand); box-shadow: 0 6px 18px rgba(17, 55, 78, .06); backdrop-filter: none; -webkit-backdrop-filter: none; font-size: 12px; font-weight: 800; line-height: 1.2; text-decoration: none; text-shadow: 0 1px 2px rgba(255, 255, 255, .75); transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease; }
.page-back-button::before { content: "‹"; font-size: 20px; font-weight: 900; line-height: .8; }
.page-back-button:hover { transform: translateX(-2px); border-color: rgba(20, 76, 112, .24); background: rgba(255, 255, 255, .68); box-shadow: 0 8px 22px rgba(17, 55, 78, .08); }
.page-back-button:focus-visible { outline: 3px solid rgba(46, 167, 235, .28); outline-offset: 2px; }
.content .page-back-button[hidden] { display: none !important; }
.page-back-button + .eyebrow { display: block; }
.hero-actions .page-back-button { margin: 0; }
.document-title-wrap { display: flex; gap: 16px; align-items: center; }
.document-title-wrap h1 { font-size: clamp(28px, 4vw, 42px); margin: 4px 0 9px; overflow-wrap: anywhere; }
.file-visual.large { width: 64px; height: 76px; margin: 0; flex: none; }
.file-visual.docx { background: #3566a8; }
.document-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.document-properties { background: #f8faf9; border: solid var(--line); border-width: 0 1px 1px; border-radius: 0 0 18px 18px; padding: 16px 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 15px; }
.document-properties > div { min-width: 0; }
.document-properties span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.document-properties strong { display: block; margin-top: 4px; font-size: 13px; overflow-wrap: anywhere; }
.technical-value { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 500; font-size: 11px !important; }
.viewer-shell { margin-top: 20px; border: 1px solid var(--line); border-radius: 17px; background: #dfe4e1; overflow: hidden; }
.viewer-toolbar { min-height: 66px; padding: 12px 16px; background: white; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.viewer-toolbar strong { display: block; margin-top: 3px; font-size: 13px; }
.pdf-controls { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.pdf-controls button, .viewer-toolbar > .icon-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--brand); cursor: pointer; display: grid; place-items: center; }
.pdf-controls span { min-width: 48px; text-align: center; font-size: 12px; }
.secure-viewer { min-height: 620px; max-height: calc(100dvh - 150px); overflow: auto; display: grid; place-items: start center; padding: 28px; position: relative; }
.secure-viewer:fullscreen { max-height: none; height: 100vh; background: #dfe4e1; }
.secure-viewer canvas { display: block; background: white; box-shadow: 0 12px 36px rgba(20,35,29,.18); max-width: none; }
.viewer-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); background: #edf0ee; z-index: 2; }
.viewer-loading[hidden] { display: none; }
.viewer-loading.error { color: var(--danger); padding: 30px; text-align: center; }
.pdf-native-fallback { width: 100%; display: grid; gap: 12px; }
.pdf-native-fallback-message { padding: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.pdf-native-fallback-message strong { width: 100%; }
.pdf-native-fallback-message span { flex: 1 1 280px; color: var(--muted); font-size: 13px; }
.pdf-native-fallback iframe { width: 100%; min-height: 70vh; border: 1px solid var(--line); border-radius: 12px; background: white; }
.image-viewer img { display: block; max-width: none; height: auto; margin: auto; box-shadow: 0 12px 36px rgba(20,35,29,.18); transform-origin: center center; transition: width .14s ease, transform .14s ease; }
.docx-container { width: 100%; min-width: 0; }
.docx-container .docx-wrapper { background: transparent !important; padding: 0 !important; }
.docx-container .docx-wrapper > section.docx { margin: 0 auto 20px !important; box-shadow: 0 12px 36px rgba(20,35,29,.18); }
.document-footer-meta { display: flex; justify-content: space-between; gap: 18px; color: var(--muted); font-size: 11px; padding: 12px 3px; }
.document-footer-meta code { overflow-wrap: anywhere; }
.document-footer-meta a { color: var(--brand-2); font-weight: 700; }
.compact-modal { width: min(520px, calc(100vw - 30px)); }
.danger-text { color: var(--danger); }
.primary-contact-banner { min-width: 260px; max-width: 330px; padding: 15px 17px; border: 1px solid #b9dced; border-radius: 15px; background: linear-gradient(135deg, #fff, #eaf5fc); }
.primary-contact-banner strong, .primary-contact-banner small { display: block; }
.primary-contact-banner strong { margin-top: 5px; font-size: 16px; }
.primary-contact-banner small { margin-top: 4px; color: var(--muted); line-height: 1.35; }
.primary-contact-banner.client-home-summary-trigger { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; }
.primary-contact-banner.client-home-summary-trigger > .eyebrow,
.primary-contact-banner.client-home-summary-trigger > strong,
.primary-contact-banner.client-home-summary-trigger > small { grid-column: 1; }
.primary-contact-banner.client-home-summary-trigger > .summary-card-chevron { grid-column: 2; grid-row: 1 / 4; }
.profile-summary-modal { width: min(780px, calc(100vw - 30px)); }
.profile-summary-identity { margin: 22px 0 18px; padding: 16px; display: flex; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(135deg, #fff, #f2f8fc); }
.profile-summary-identity > img,
.profile-summary-identity > span { width: 62px; height: 62px; flex: none; display: grid; place-items: center; border-radius: 50%; object-fit: cover; background: var(--soft); color: var(--brand); font-size: 16px; font-weight: 900; }
.profile-summary-identity strong,
.profile-summary-identity small { display: block; }
.profile-summary-identity strong { font-size: 19px; }
.profile-summary-identity small { margin-top: 4px; color: var(--muted); }
.contact-summary-identity { background: linear-gradient(135deg, #fff, #eaf5fc); }
.profile-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--line); }
.profile-summary-grid > div { min-width: 0; padding: 13px 15px; display: grid; align-content: start; gap: 5px; background: #fff; }
.profile-summary-grid > div.wide { grid-column: 1 / -1; }
.profile-summary-grid span { color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.profile-summary-grid strong { overflow-wrap: anywhere; font-size: 14px; line-height: 1.35; }
.profile-summary-grid small { color: var(--muted); line-height: 1.4; }
.client-access-audit { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.client-access-audit-head { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.client-access-audit-head h3 { margin: 3px 0 0; font-size: 19px; }
.client-access-audit-grid .client-access-email { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; text-transform: none; letter-spacing: normal; }
.client-access-audit-grid .client-access-email + .client-access-email { margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--line); }
.client-access-audit-grid .client-access-email strong { font-size: 13px; }
.client-access-audit-grid .client-access-email small { flex: none; }
.item-contacts { position: absolute; top: 15px; right: 15px; max-width: calc(100% - 105px); text-align: right; z-index: 2; }
.item-contacts span, .item-contacts strong, .item-contacts small { display: block; }
.item-contacts span { color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.item-contacts strong { margin-top: 3px; color: var(--brand); font-size: 12px; overflow-wrap: anywhere; }
.item-contacts small { margin-top: 2px; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.scope-manager { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.scope-manager > summary { cursor: pointer; color: var(--brand); font-size: 12px; font-weight: 800; }
.scope-manager[open] > summary { margin-bottom: 10px; }
.scope-access-row { display: flex; justify-content: space-between; gap: 8px; margin: 6px 0; padding: 7px 8px; border-radius: 7px; background: var(--soft); font-size: 11px; }
.scope-access-row form { flex: none; }
.scope-access-row button { border: 0; background: none; color: var(--danger); cursor: pointer; font-weight: 750; }
.scope-form { display: grid; gap: 8px; margin-top: 10px; }
.scope-form label { color: var(--muted); font-size: 11px; font-weight: 750; }
.scope-form select { margin-top: 4px; padding: 8px; }
.scope-form .check { display: flex; align-items: center; gap: 7px; }
.scope-form .check input { width: auto; }
.client-assignment-row { align-items: flex-start; }
.inline-assignment-form { min-width: min(100%, 280px); display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.inline-assignment-form label { grid-column: 1 / -1; color: var(--muted); font-size: 11px; font-weight: 800; }
.inline-assignment-form select { padding: 8px; }
.text-link { display: inline-block; margin-top: 7px; color: var(--brand); font-size: 12px; font-weight: 750; text-decoration: none; }
.document-contact-bar { padding: 14px 24px; display: flex; justify-content: space-between; gap: 20px; border: solid var(--line); border-width: 0 1px 1px; background: #eef7fc; }
.document-contact-bar strong, .document-contact-bar span { display: block; }
.document-contact-bar strong { margin-top: 3px; font-size: 13px; }
.primary-contact-card { display: flex; align-items: center; gap: 18px; padding: 23px; border: 1px solid #b9dced; border-radius: 18px; background: linear-gradient(135deg, #fff 45%, #e6f4fc); }
.primary-contact-card h2 { margin: 4px 0 6px; }
.primary-contact-card p { margin: 0; color: var(--muted); }
.contact-avatar { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--brand); color: white; font-size: 20px; font-weight: 900; text-transform: uppercase; }
.contact-avatar.small { width: 46px; height: 46px; font-size: 14px; }
.contacts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 15px; }
.contact-card { padding: 19px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.contact-card header { display: flex; align-items: center; gap: 12px; }
.contact-card h3 { margin: 0 0 5px; }
.contact-scopes { display: grid; gap: 7px; margin-top: 16px; }
.scope-line { padding: 10px 11px; border-radius: 9px; background: var(--soft); }
.scope-line strong, .scope-line span { display: block; }
.scope-line strong { font-size: 12px; }
.scope-line span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.chat-conversation-switch { display: grid; gap: 4px; margin-top: 9px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.chat-conversation-switch select { padding: 7px 9px; font-size: 12px; text-transform: none; letter-spacing: 0; }
.chat-client-picker-drawer { grid-template-rows: auto minmax(0, 1fr); }
.chat-client-picker-empty { display: grid; align-content: start; gap: 28px; padding: 22px; overflow-y: auto; background: linear-gradient(180deg, #f7fbfd 0%, #fff 100%); }
.chat-client-picker-field { margin: 0; }
.chat-client-picker-field select { width: 100%; min-height: 46px; background: white; }
.chat-client-picker-placeholder { min-height: 260px; display: grid; place-items: center; align-content: center; gap: 10px; padding: 30px; border: 1px dashed rgba(24, 126, 184, .32); border-radius: 18px; color: var(--muted); text-align: center; background: rgba(255, 255, 255, .72); }
.chat-client-picker-placeholder strong { color: var(--ink); font-size: 18px; }
.chat-client-picker-placeholder p { max-width: 310px; margin: 0; line-height: 1.5; }
.chat-client-picker-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; color: var(--brand); background: var(--brand-soft); }
.chat-client-picker-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chat-group-creator { padding: 10px 16px; border-bottom: 1px solid var(--line); background: #f8fbfd; }
.chat-group-creator > summary, .scope-group-builder > summary { cursor: pointer; color: var(--brand); font-size: 12px; font-weight: 850; }
.chat-group-creator form { display: grid; gap: 9px; margin-top: 10px; }
.chat-group-creator fieldset, .new-group-card fieldset, .scope-group-builder fieldset { margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; }
.chat-group-creator fieldset ul, .new-group-card fieldset ul { margin: 4px 0 0; padding: 0; display: grid; gap: 5px; list-style: none; }
.chat-group-creator fieldset label, .new-group-card fieldset label { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.chat-group-creator input[type="checkbox"], .new-group-card input[type="checkbox"] { width: auto; }
.new-group-card { position: relative; }
.new-group-card > summary { list-style: none; }
.new-group-card > form { position: absolute; z-index: 12; top: calc(100% + 8px); right: 0; width: min(340px, calc(100vw - 36px)); padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: var(--shadow); }
.whatsapp-layout { display: grid; grid-template-columns: 310px minmax(0, 1fr); grid-template-areas: "filters filters" "conversations discussion"; gap: 0; border: 1px solid var(--line); border-radius: 18px; background: white; overflow: hidden; box-shadow: var(--shadow); }
.conversation-list { grid-area: conversations; min-height: 680px; max-height: 76dvh; overflow-y: auto; border-right: 1px solid var(--line); background: #f8fbfd; }
.conversation-list > header { min-height: 66px; padding: 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: white; }
.conversation-list > header span { min-width: 27px; height: 27px; display: grid; place-items: center; border-radius: 999px; background: var(--soft); color: var(--brand); font-size: 11px; font-weight: 850; }
.conversation-list-item { min-height: 78px; padding: 13px 14px; display: grid; grid-template-columns: 45px minmax(0, 1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.conversation-list-item:hover, .conversation-list-item.active { background: #eaf5fc; }
.conversation-avatar { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: white; font-size: 13px; font-weight: 900; text-transform: uppercase; }
.conversation-list-copy { min-width: 0; }
.conversation-list-copy strong, .conversation-list-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-list-copy strong { font-size: 13px; }
.conversation-list-copy small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.conversation-unread { min-width: 22px; height: 22px; padding: 0 5px; display: grid; place-items: center; border-radius: 999px; background: #df2638; color: white; font-size: 10px; }
.discussion-main-column { grid-area: discussion; min-width: 0; background: var(--canvas); container-type: inline-size; }
.mobile-chat-toolbar { display: none; }
.whatsapp-layout .discussion-filters { grid-area: filters; margin: 0; border-width: 0 0 1px; border-radius: 0; grid-template-columns: minmax(180px, 1fr) minmax(125px, .65fr) minmax(125px, .65fr) auto; }
.whatsapp-layout .discussion-filters.simple-chat-filters { grid-template-columns: minmax(125px, .65fr) minmax(125px, .65fr) auto; }
.whatsapp-layout .discussion-filters > label,
.whatsapp-layout .discussion-filters .discussion-filter-field,
.whatsapp-layout .discussion-filters input,
.whatsapp-layout .discussion-filters select { min-width: 0; }
@container (max-width: 620px) {
  .whatsapp-layout .discussion-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .whatsapp-layout .discussion-filters .discussion-filter-field,
  .whatsapp-layout .discussion-filters .button { grid-column: 1 / -1; width: 100%; }
}
@container (max-width: 420px) {
  .whatsapp-layout .discussion-filters { grid-template-columns: minmax(0, 1fr); }
  .whatsapp-layout .discussion-filters > label,
  .whatsapp-layout .discussion-filters .discussion-filter-field,
  .whatsapp-layout .discussion-filters .button { grid-column: 1; width: 100%; }
}

/* Shared legal centre, footer and essential-cookie information */
.legal-footer { margin-top: auto; padding: 18px 26px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); background: rgba(255,255,255,.82); color: var(--muted); font-size: 11px; }
.legal-footer > div { display: flex; flex-wrap: wrap; gap: 5px; }
.legal-footer nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
.legal-footer a, .legal-footer-link { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 750; text-decoration: none; cursor: pointer; }
.legal-footer a:hover, .legal-footer-link:hover { color: var(--brand); }
.cookie-banner { position: fixed; z-index: 120; left: 18px; right: 18px; bottom: 18px; max-width: 1040px; margin: auto; padding: 19px 21px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border: 1px solid #b9d9ed; border-radius: 17px; background: rgba(255,255,255,.97); box-shadow: 0 22px 70px rgba(16,48,74,.25); opacity: 0; transform: translateY(16px); transition: opacity .18s, transform .18s; backdrop-filter: blur(16px); }
.cookie-banner[hidden] { display: none; }
.cookie-banner.is-visible { opacity: 1; transform: none; }
.cookie-banner-copy { max-width: 700px; }
.cookie-banner h2 { margin: 3px 0 5px; font-size: 19px; }
.cookie-banner p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.cookie-banner-actions { display: flex; align-items: center; gap: 9px; flex: none; }
.cookie-primary-action, .cookie-secondary-action { min-height: 40px; padding: 10px 14px; border-radius: 10px; font-weight: 850; text-decoration: none; cursor: pointer; }
.cookie-primary-action { border: 1px solid var(--brand); background: var(--brand); color: white; }
.cookie-secondary-action { border: 1px solid var(--line); background: white; color: var(--brand); }
.public-legal-shell { min-height: calc(100vh - 72px); padding: 44px 18px 74px; background: var(--canvas); }
.legal-page { width: min(1050px, 100%); margin: auto; }
.legal-page-head { padding: 30px 34px; border: 1px solid var(--line); border-radius: 18px 18px 0 0; background: linear-gradient(135deg,#fff,#eef8ff); }
.legal-page-head h1 { margin: 7px 0 8px; font-size: clamp(30px,5vw,48px); line-height: 1.06; }
.legal-page-head p { max-width: 720px; margin: 0; color: var(--muted); line-height: 1.55; }
.legal-version-line { margin-top: 13px; color: var(--brand); font-size: 11px; font-weight: 850; }
.legal-tabs { display: flex; gap: 4px; padding: 10px; overflow-x: auto; border: solid var(--line); border-width: 0 1px 1px; background: white; }
.legal-tabs a { padding: 10px 13px; border-radius: 9px; color: var(--muted); font-size: 12px; font-weight: 850; text-decoration: none; white-space: nowrap; }
.legal-tabs a.active { background: var(--soft); color: var(--brand); }
.legal-document { padding: 36px 40px 48px; border: solid var(--line); border-width: 0 1px 1px; border-radius: 0 0 18px 18px; background: white; }
.legal-document > h2 { margin: 5px 0 25px; font-size: clamp(27px,4vw,38px); }
.legal-document section { padding: 22px 0; border-top: 1px solid var(--line); }
.legal-document section:first-of-type { border-top: 0; }
.legal-document h3 { margin: 0 0 8px; font-size: 17px; }
.legal-document p, .legal-document li { color: #485965; line-height: 1.68; }
.legal-document a { color: var(--brand); font-weight: 750; }
.legal-document .terms-update-panel { margin: 0 0 22px; padding: 20px; border: 1px solid #9bcdea; border-radius: 14px; background: #eef8ff; }
.legal-document .terms-update-panel h3 { color: var(--brand); }
.legal-document .terms-update-panel p { margin: 0; }
.terms-update-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.terms-update-actions form { margin: 0; }
.legal-document .terms-update-objected { border-color: #e5c378; background: #fff8e7; }
.legal-document .terms-update-objected h3 { color: #8a5a00; }
.legal-table { display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.legal-table > div { display: grid; grid-template-columns: minmax(180px,.75fr) minmax(0,1.5fr); border-top: 1px solid var(--line); }
.legal-table > div:first-child { border-top: 0; }
.legal-table strong, .legal-table span { padding: 12px 14px; font-size: 12px; line-height: 1.5; }
.legal-table strong { background: var(--canvas); }
.legal-table small { display: block; margin-top: 3px; color: var(--muted); }
@media(max-width:700px){.legal-footer{align-items:flex-start;flex-direction:column;padding:16px 18px}.legal-footer nav{justify-content:flex-start}.cookie-banner{left:10px;right:10px;bottom:10px;align-items:stretch;flex-direction:column;gap:14px;background:#fff;max-height:calc(100vh - 20px);overflow:auto}.cookie-banner-actions{display:grid;grid-template-columns:1fr 1fr}.cookie-primary-action,.cookie-secondary-action{text-align:center}.public-legal-shell{padding:18px 10px 50px}.legal-page-head{padding:24px 20px}.legal-tabs{display:grid;grid-template-columns:1fr 1fr;overflow:visible}.legal-tabs a{text-align:center}.legal-tabs a:last-child{grid-column:1/-1}.legal-document{padding:27px 20px 36px}.legal-table>div{grid-template-columns:1fr}.legal-table span{border-top:1px dashed var(--line)}}
.whatsapp-layout .discussion-result-bar { min-height: 66px; margin: 0; border-radius: 0; }
.whatsapp-layout .chat-page-panel { border: 0; border-radius: 0; box-shadow: none; }
.default-conversation-form { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.scope-group-builder { margin-top: 10px; }
.scope-group-builder[open] > summary { margin-bottom: 9px; }
.document-workflows { margin: 16px 0; padding: 17px 19px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid #cfe4ef; border-radius: 15px; background: linear-gradient(135deg, #fff, #eef8fd); }
.document-workflows strong { display: block; margin-top: 3px; }
.document-workflow-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.document-related-objects { margin: 16px 0; padding: 17px 19px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.related-object-links { margin-top: 10px; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 9px; }
.related-object-links a { padding: 12px 14px; display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 11px; background: var(--canvas); text-decoration: none; }
.related-object-links small { color: var(--muted); }
.claim-list { display: grid; gap: 10px; }
.claim-card { min-width: 0; padding: 16px 18px; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto 24px; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 15px; background: white; color: inherit; text-decoration: none; transition: transform .16s, box-shadow .16s; }
.claim-card > .document-state-badge { margin: 0; }
.claim-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.claim-card-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 13px; background: #fff0e8; color: #d45b28; font-size: 22px; }
.claim-card-main { min-width: 0; display: grid; gap: 4px; }
.claim-card-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.claim-card-main small { color: var(--muted); overflow-wrap: anywhere; }
.claim-status { width: fit-content; padding: 6px 9px; border-radius: 999px; background: var(--soft); color: var(--brand); font-size: 11px; font-weight: 850; white-space: nowrap; }
.claim-status.status-information_required { background: #fff2d8; color: #9a6510; }
.claim-status.status-completed { background: #e7f7ef; color: #20784e; }
.claim-status.status-draft { background: #eef1f3; color: var(--muted); }
.claim-empty { min-height: 220px; display: grid; place-content: center; gap: 6px; text-align: center; }
.claim-banner { margin-bottom: 16px; padding: 24px; display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; border: 1px solid var(--line); border-radius: 17px; background: white; }
.claim-banner h1 { margin: 7px 0 9px; }
.claim-banner-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 9px; }
.claim-metadata { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: solid var(--line); border-width: 1px 1px 0; border-radius: 15px 15px 0 0; overflow: hidden; }
.claim-metadata > div { min-width: 0; padding: 15px 17px; display: grid; gap: 5px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: white; }
.claim-metadata > div > span, .claim-linked-document > span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.claim-linked-document { grid-column: span 2; }
.claim-metadata.proposal-metadata { grid-template-columns: .9fr 1.2fr .8fr 1fr 1.45fr; }
.claim-metadata.proposal-metadata .claim-linked-document { grid-column: auto; }
.claim-linked-document a { display: grid; gap: 3px; color: var(--brand); text-decoration: none; }
.claim-linked-document small { color: var(--muted); }
.claim-status-editor { margin: 16px 0; display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.claim-status-editor h2 { margin: 5px 0 0; }
.inline-status-form { display: flex; align-items: center; gap: 8px; }
.inline-status-form select { min-height: 42px; padding: 9px 12px; border: 1px solid #cfd9d4; border-radius: 10px; background: white; }
.claim-content-shell { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: white; }
.claim-content-shell > header { padding: 17px 19px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.claim-content-shell h2 { margin: 4px 0 0; }
.claim-content-count { color: var(--muted); font-size: 12px; }
.claim-content-placeholder { min-height: 260px; display: grid; place-content: center; gap: 6px; text-align: center; }
.claim-content-placeholder span { max-width: 560px; color: var(--muted); }
.business-object-link { border-color: #f1cfbd; background: #fff8f3; }
.business-object-card { border-color: #d8cbe8; }

.document-request-card { border-color: #89b9df; background: linear-gradient(145deg, #ffffff, #f2f9ff); }
.document-request-visual { background: #e3f2ff; color: #0872b9; }
.document-request-instructions { margin: 10px 0 0; color: var(--muted); white-space: pre-line; }
.document-request-format { margin: 8px 0 0; color: #0872b9; font-weight: 800; font-size: .84rem; }
.document-request-page { display: grid; gap: 22px; }
.document-request-hero { max-width: 790px; }
.document-request-hero h1 { margin: 4px 0 8px; }
.document-request-hero p { margin: 0; color: var(--muted); font-size: 1.05rem; }
.document-request-layout { display: grid; grid-template-columns: minmax(250px, .7fr) minmax(420px, 1.3fr); gap: 20px; align-items: start; }
.document-request-summary, .document-request-upload-card { margin: 0; }
.document-request-summary-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: #e3f2ff; color: #0872b9; font-size: 1.8rem; font-weight: 900; }
.document-request-summary h2, .document-request-upload-card h2 { margin: 12px 0; }
.document-request-summary dl { display: grid; gap: 0; margin: 0; }
.document-request-summary dl > div { display: grid; grid-template-columns: 1fr 1.2fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.document-request-summary dt { color: var(--muted); font-weight: 800; font-size: .78rem; text-transform: uppercase; }
.document-request-summary dd { margin: 0; font-weight: 750; }
.document-request-message { margin-top: 18px; padding: 14px; border-radius: 14px; background: #f0f7fc; }
.document-request-message p { margin: 6px 0 0; }

@media (max-width: 760px) {
  .document-request-layout { grid-template-columns: 1fr; }
  .document-request-summary dl > div { grid-template-columns: 1fr; gap: 3px; }
}
.business-object-visual { background: #f1ebf8; color: #654290; }
.proposal-choice-shell { margin: 16px 0; padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid #cfdce8; border-radius: 16px; background: #f5f9fd; }
.proposal-choice-shell.has-selection { border: 2px solid #42a875; background: linear-gradient(135deg, #e8f8ef, #f7fff9); box-shadow: 0 12px 32px rgba(33,133,86,.16); }
.proposal-choice-shell.has-selection .eyebrow { color: #1f7a4d; }
.proposal-choice-shell h2 { margin: 5px 0; }
.proposal-choice-shell p { margin: 0 0 5px; color: var(--muted); }
.proposal-choice-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.proposal-option-grid { padding: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.proposal-option-card { min-width: 0; padding: 16px; position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfd; }
.proposal-option-card.selected { border: 2px solid #42a875; background: #eefaf3; box-shadow: 0 8px 22px rgba(33,133,86,.11); }
.proposal-option-number { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--brand); color: white; font-size: 17px; font-weight: 850; }
.proposal-option-copy { min-width: 0; }
.proposal-option-copy h3 { margin: 3px 0 5px; overflow-wrap: anywhere; }
.proposal-option-copy p, .proposal-option-copy small { color: var(--muted); }
.proposal-selected-badge { grid-column: 1 / -1; width: fit-content; padding: 6px 9px; border-radius: 999px; background: #d9f3e4; color: #1f7a4d; font-size: 11px; font-weight: 850; }
.proposal-option-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.proposal-option-actions form { margin: 0; }
.proposal-add-card { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.proposal-add-card h2 { margin: 4px 0; }
.proposal-add-form { display: flex; align-items: center; gap: 9px; }
.proposal-add-form input[type="file"] { max-width: 310px; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; overflow: visible; padding: 18px; gap: 18px; }
  .nav { grid-template-columns: repeat(3, auto); overflow-x: auto; }
  .sidebar-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 0; }
  .topbar, .content { padding: 22px; }
  .page-back-button { left: 22px; top: 188px; }
  .grid.two, .chat-layout, .login-page { grid-template-columns: 1fr; }
  .login-story { min-height: 42vh; padding: 38px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .document-toolbar { grid-template-columns: 1fr 190px auto; }
  .document-banner { align-items: flex-start; flex-direction: column; }
  .document-actions { justify-content: flex-start; }
  .secure-viewer { min-height: 520px; }
  .settings-grid { grid-template-columns: 1fr; }
  .home-service-grid { grid-template-columns: 1fr 1fr; }
  .document-workflows, .claim-banner, .claim-status-editor { align-items: stretch; flex-direction: column; }
  .document-workflow-actions, .claim-banner-actions { justify-content: flex-start; }
  .claim-metadata { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .claim-metadata.proposal-metadata { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .claim-metadata.proposal-metadata .claim-linked-document { grid-column: span 2; }
  .proposal-choice-shell, .proposal-add-card { align-items: stretch; flex-direction: column; }
  .proposal-choice-actions { justify-content: flex-start; }
  .discussion-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .discussion-filters.contacts-disabled { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .discussion-filters .button { width: 100%; }
  .whatsapp-layout { grid-template-columns: 1fr; grid-template-areas: "filters" "conversations" "discussion"; }
  .conversation-list { min-height: 0; max-height: 260px; border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 768px) {
  .invitation-tabs { width: 100%; display: grid; grid-template-columns: 1fr; }
  .invitation-tabs a { text-align: center; }
  .invitation-route-fields { grid-template-columns: 1fr; }
  .invitation-matrix { grid-template-columns: 1fr; }
  .matrix-corner, .matrix-column-head, .matrix-row-head { display: none; }
  .invitation-matrix-card { padding: 18px; }
  .invitation-matrix-card::before { content: attr(data-route-label); display: block; margin-bottom: 12px; color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
  .invitation-matrix-card h2 { padding-right: 0; }
  .route-match-badge { position: static; width: fit-content; margin-bottom: 10px; }
  .invitation-matrix-card .button, .invitation-matrix-card .invitation-actions { width: 100%; }
  .invitation-share-link { grid-template-columns: 1fr 1fr; }
  .invitation-share-link input { grid-column: 1 / -1; }
  .sidebar { position: sticky; top: 0; z-index: 45; min-height: 68px; height: auto; max-height: 100vh; overflow-y: auto; padding: 10px 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; }
  .sidebar .brand { width: fit-content; min-width: 0; display: flex; align-items: center; gap: 9px; }
  .sidebar .brand img { width: 126px; max-height: 48px; object-fit: contain; }
  .sidebar .brand small { display: none; }
  .sidebar .brand:has(.brand-app-version) { display: grid; gap: 3px; }
  .sidebar .brand .brand-app-version { margin-top: 0; padding-top: 3px; font-size: 8px; }
  .mobile-nav-toggle { position: relative; width: 46px; height: 42px; padding: 9px 10px; display: grid; align-content: center; gap: 5px; border: 1px solid rgba(255,255,255,.24); border-radius: 10px; background: rgba(255,255,255,.12); cursor: pointer; }
  .mobile-nav-unread-badge { position: absolute; top: -8px; right: -8px; min-width: 23px; height: 23px; padding: 0 6px; display: inline-grid; place-items: center; border: 2px solid white; border-radius: 999px; background: #e1263d; color: white; font-size: 10px; font-weight: 900; line-height: 1; box-shadow: 0 4px 12px rgba(90,0,18,.3); }
  .mobile-nav-unread-badge[hidden] { display: none; }
  .mobile-nav-toggle span { width: 100%; height: 2px; display: block; border-radius: 999px; background: white; transition: transform .18s, opacity .18s; }
  .mobile-nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .mobile-nav-toggle.open span:nth-child(2) { opacity: 0; }
  .mobile-nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .sidebar .nav { grid-column: 1 / -1; display: none; grid-template-columns: 1fr; gap: 5px; overflow: visible; padding: 6px 0 4px; border-top: 1px solid rgba(255,255,255,.16); }
  .sidebar .nav.mobile-open { display: grid; }
  .sidebar .nav a { padding: 11px 12px; }
  .sidebar .sidebar-footer { display: none; grid-column: 1 / -1; margin: 0; padding: 12px; border-top: 1px solid rgba(255,255,255,.16); }
  .sidebar .nav.mobile-open + .sidebar-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .sidebar .sidebar-footer form { margin-top: 0 !important; }
  .sidebar .sidebar-footer .link-button { padding: 9px 11px; border-radius: 9px; background: rgba(255,255,255,.14); text-decoration: none; font-weight: 800; }
  .content { padding: 18px; }
  .page-back-button { left: 12px; top: 80px; max-width: calc(100vw - 76px); min-height: 34px; padding: 6px 10px 6px 8px; gap: 3px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
  .page-back-button::before { font-size: 17px; }
  .topbar { top: 68px; min-height: 54px; padding: 9px 18px; }
  .topbar-navigation { gap: 8px; }
  .topbar-back-button { min-width: 38px; width: 38px; height: 36px; padding: 0; }
  .topbar-back-button b { display: none; }
  .topbar .tag { display: none; }
  .topbar-client-context { gap: 1px; font-size: 10px; }
  .topbar-client-context strong { max-width: 118px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; }
  .row { align-items: flex-start; flex-wrap: wrap; }
  .bubble { max-width: 90%; }
  .discussion-page-head { align-items: stretch; flex-direction: column; margin-bottom: 12px; }
  .discussion-page-head.mobile-chat-active { display: none; }
  .discussion-page-head .lead { display: none; }
  .discussion-client-picker { width: 100%; }
  .discussion-filters { grid-template-columns: 1fr 1fr; padding: 12px; }
  .discussion-filters .discussion-filter-field, .discussion-filters .button { grid-column: 1 / -1; }
  .multi-filter-popover { width: 100%; }
  .discussion-result-bar { align-items: flex-start; flex-direction: column; gap: 3px; }
  .chat-drawer.chat-page-panel { height: calc(100dvh - 175px); min-height: 520px; max-height: none; }
  .chat-page-panel .bubble { max-width: 90%; }
  .modal-action-context { grid-template-columns: 1fr; }
  .composer { grid-template-columns: 1fr; }
  .document-hero .hero-actions, .document-hero .hero-actions .button { width: 100%; }
  .document-toolbar { grid-template-columns: 1fr auto; }
  .document-toolbar .search-field { grid-column: 1 / -1; }
  .document-toolbar select { min-width: 0; }
  .document-explorer.grid-view { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .grid-view .file-card { min-height: 230px; padding: 13px; }
  .grid-view .file-title-line { display: block; }
  .grid-view .file-title-line .reference { margin-top: 6px; }
  .grid-view .file-properties { display: none; }
  .list-view .file-card { grid-template-columns: 48px minmax(0, 1fr); }
  .list-view .file-actions { grid-column: 1 / -1; }
  .list-view .folder-card { grid-template-columns: 1fr; }
  .list-view .folder-card-link { grid-template-columns: 48px minmax(0, 1fr); gap: 14px; }
  .list-view .folder-card .file-actions { grid-column: 1; }
  .timeline-row-view > .folder-card { grid-template-columns: 1fr auto; gap: 9px; }
  .timeline-row-view > .folder-card .folder-card-link { grid-template-columns: 48px minmax(0, 1fr); gap: 11px; }
  .timeline-row-view > .folder-card .file-info { flex-wrap: wrap; gap: 2px 8px; }
  .timeline-row-view > .folder-card .file-info .meta { white-space: normal; }
  .timeline-row-view > .folder-card .item-contacts { display: none; }
  .document-lineage-row.is-standalone .document-card { grid-template-columns: 48px minmax(0, 1fr); grid-template-rows: auto auto; }
  .document-lineage-row.is-standalone .document-card .file-info { grid-column: 2; grid-row: 1; }
  .document-lineage-row.is-standalone .document-card .item-contacts { display: none; }
  .document-lineage-row.is-standalone .document-card .file-actions { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; margin-top: 6px; }
  .timeline-row-view > .business-object-card { grid-template-columns: 48px minmax(0, 1fr); }
  .timeline-row-view > .business-object-card .file-actions { grid-column: 1 / -1; }
  .move-document-form { position: fixed; left: 16px; right: 16px; bottom: 16px; width: auto; }
  .document-form { grid-template-columns: 1fr; }
  .document-form .full { grid-column: auto; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .button { width: 100%; }
  .chat-fab { right: 15px; bottom: 15px; }
  .chat-fab > span:nth-child(2) { display: none; }
  .chat-fab { width: 52px; height: 52px; padding: 0; justify-content: center; }
  .chat-toast { right: 15px; bottom: 78px; }
  .chat-drawer { inset: 0; width: 100vw; height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
  .chat-message-assignment-toolbar { position: static; align-items: stretch; flex-direction: column; }
  .chat-message-assignment-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .chat-message-subject-picker { grid-column: 1 / -1; }
  .chat-message-assignment-actions .button { width: 100%; }
  .document-banner { padding: 18px; }
  .document-title-wrap { align-items: flex-start; }
  .file-visual.large { width: 48px; height: 58px; }
  .document-actions, .document-actions .button { width: 100%; }
  .document-properties { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 15px 18px; }
  .viewer-toolbar { align-items: flex-start; flex-direction: column; }
  .pdf-controls { justify-content: flex-start; }
  .secure-viewer { min-height: 430px; padding: 12px; max-height: calc(100dvh - 210px); }
  .document-footer-meta { flex-direction: column; }
  .account-summary { width: 100%; }
  .account-form { grid-template-columns: 1fr; }
  .account-form .full { grid-column: auto; }
  .form-actions .button { width: 100%; }
  .client-home-identity { width: 100%; }
  .primary-contact-banner { width: 100%; max-width: none; }
  .item-contacts { max-width: calc(100% - 82px); top: 12px; right: 12px; }
  .item-contacts small { font-size: 8px; line-height: 1.2; }
  .document-contact-bar { padding: 13px 18px; flex-direction: column; gap: 8px; }
  .inline-assignment-form { width: 100%; }
  .home-service-grid { grid-template-columns: 1fr; }
  .document-workflow-actions, .document-workflow-actions .button, .claim-banner-actions, .claim-banner-actions .button { width: 100%; }
  .claim-card { grid-template-columns: 42px minmax(0, 1fr); gap: 11px; }
  .claim-card-icon { width: 42px; height: 42px; }
  .claim-card .document-state-badge,
  .claim-card .claim-status { grid-column: 2; }
  .claim-card-arrow { display: none; }
  .claim-metadata { grid-template-columns: 1fr; }
  .claim-linked-document { grid-column: auto; }
  .inline-status-form { align-items: stretch; flex-direction: column; }
  .inline-status-form .button { width: 100%; }
  .proposal-option-grid { grid-template-columns: 1fr; padding: 12px; }
  .proposal-choice-actions, .proposal-choice-actions .button, .proposal-choice-actions form { width: 100%; }
  .proposal-add-form { align-items: stretch; flex-direction: column; }
  .proposal-add-form input[type="file"], .proposal-add-form .button { width: 100%; max-width: none; }
  .service-tile { min-height: 245px; }
  .whatsapp-layout { display: block; border-radius: 13px; }
  .conversation-list { display: block; min-height: 62dvh; max-height: none; overflow: visible; border: 0; }
  .conversation-list > header { min-width: 0; }
  .conversation-list-item { min-width: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .discussion-main-column { display: none; }
  .whatsapp-layout.mobile-chat-open .conversation-list { display: none; }
  .whatsapp-layout.mobile-chat-open .discussion-main-column { display: block; }
  .mobile-chat-toolbar { min-height: 48px; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: white; }
  .mobile-chat-toolbar a, .mobile-chat-toolbar button { border: 0; background: none; color: var(--brand); font-size: 13px; font-weight: 850; text-decoration: none; cursor: pointer; }
  .whatsapp-layout .discussion-filters { display: none; grid-template-columns: 1fr; gap: 11px; padding: 14px; border-radius: 0; }
  .whatsapp-layout .discussion-filters > label, .whatsapp-layout .discussion-filters .discussion-filter-field, .whatsapp-layout .discussion-filters .button { grid-column: 1; width: 100%; min-width: 0; }
  .whatsapp-layout .discussion-filters input:not([type="checkbox"]), .whatsapp-layout .discussion-filters select { width: 100%; min-width: 0; }
  .whatsapp-layout .multi-filter-popover input[type="checkbox"] { width: 17px; min-width: 17px; height: 17px; flex: 0 0 17px; }
  .whatsapp-layout .discussion-filters.mobile-open { display: grid; }
  .whatsapp-layout .discussion-result-bar { min-height: 36px; padding: 7px 12px; }
  .discussion-chat-head { padding: 14px 16px 12px; }
  .discussion-chat-head h2 { font-size: 22px; }
}

.download-icon {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.18rem;
}

.native-share-status {
  min-height: 1.35rem;
  margin: -.5rem 0 1rem;
  text-align: right;
}

.claim-stat-grid {
  margin: 1.25rem 0;
  align-items: stretch;
}

.claim-stat-grid .card h2 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  margin: .5rem 0 0;
}

/* Document lifecycle integration. */
.document-toolbar.lifecycle-toolbar {
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 220px) minmax(170px, 210px) auto;
}
.document-date-filter { position: relative; }
.document-date-filter > summary {
  min-height: 46px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
  white-space: nowrap;
}
.document-date-filter > summary::-webkit-details-marker { display: none; }
.document-date-filter > summary::after { content: "⌄"; margin-left: auto; color: var(--muted); }
.document-date-filter[open] > summary,
.document-date-filter.is-active > summary { border-color: var(--brand-2); background: var(--soft); color: var(--brand); }
.document-date-filter-panel {
  width: min(430px, calc(100vw - 34px));
  padding: 16px;
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 35;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(31,70,94,.18);
}
.document-date-fields { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; }
.document-date-fields label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 850; }
.document-date-fields input { width: 100%; min-width: 0; }
.document-date-fields > span { padding-bottom: 13px; color: var(--muted); }
.document-date-filter-panel p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.document-date-actions { display: flex; justify-content: flex-end; gap: 8px; }

.file-card.document-card.is-archived,
.file-card.business-object-card.is-archived,
.claim-card.is-archived {
  background: #eef0f2;
  border-color: #c9cfd4;
  color: #737c83;
  filter: saturate(.45);
}

.file-card.document-card.state-current,
.file-card.business-object-card.state-current,
.claim-card.state-current {
  border-color: #30a363;
  background: #fff;
  box-shadow: inset 0 0 0 1px #30a363;
}

.file-card.document-card.state-future,
.file-card.business-object-card.state-future,
.claim-card.state-future {
  border-color: #b7a6ca;
  background: #f5f1f9;
}

.document-explorer .file-card[hidden] { display: none !important; }

.file-card.document-card.is-archived:hover,
.file-card.business-object-card.is-archived:hover,
.claim-card.is-archived:hover {
  transform: none;
  box-shadow: 0 8px 20px #26374612;
}

.file-card.document-card.is-archived .file-visual,
.file-card.document-card.is-archived .file-properties span,
.file-card.business-object-card.is-archived .file-visual,
.file-card.business-object-card.is-archived .file-properties span,
.claim-card.is-archived .claim-card-icon {
  opacity: .72;
}

.document-state-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  margin-bottom: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e8f2fa;
  color: #176ba9;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.file-title-line .document-state-badge { margin-bottom: 0; }

.document-state-badge.state-archive {
  background: #d9dde0;
  color: #58636b;
}

.document-state-badge.state-current {
  background: #dff4e7;
  color: #197743;
}

.document-state-badge.state-future {
  background: #e9e1f1;
  color: #71558e;
}
.document-state-badge.state-signed { background:#dff6e9; color:#0c713e; border:1px solid #8bd0aa; }

.role-client .reference { display: none !important; }

/* Couleurs temporelles communes aux listes et aux vues de chronologie. */
.document-family-tree .timeline-direction.future {
  background: #e9e1f1 !important;
  color: #71558e !important;
}
.document-family-tree .timeline-document.state-current .timeline-node-card {
  border: 2px solid #30a363 !important;
  background: #fff !important;
  box-shadow: 0 12px 28px #30a36324 !important;
}
.document-family-tree .timeline-document.state-current .timeline-dot {
  background: #269158 !important;
  box-shadow: 0 0 0 3px #a9dfbf !important;
}
.document-family-tree .timeline-document.state-future .timeline-node-card,
.document-family-tree .timeline-proposal-event .proposal-family {
  border-color: #b7a6ca !important;
  background: #f5f1f9 !important;
  color: #5f4d72 !important;
}
.document-family-tree .timeline-document.state-future .timeline-dot,
.document-family-tree .timeline-dot.proposal {
  background: #8366a0 !important;
  box-shadow: 0 0 0 2px #cdbddd !important;
}

.document-state-badge.state-proposal {
  background: #fff0c9;
  color: #815b12;
}

.document-archive-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
  padding: 13px 16px;
  border: 1px solid #c6ccd1;
  border-radius: 12px;
  background: #eceff1;
  color: #59636a;
}

.timeline-integrated-head .page-back-button { margin-bottom: 16px; }
.timeline-focused .timeline-node-card,
.proposal-branch.timeline-focused { outline: 3px solid #8e4bc3; outline-offset: 4px; }
.timeline-viewed-label {
  display: inline-flex;
  margin-top: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #efe4f8;
  color: #6f2d98;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

@media (max-width: 980px) {
  .document-toolbar.lifecycle-toolbar { grid-template-columns: 1fr 1fr auto; }
  .document-toolbar.lifecycle-toolbar .search-field { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .document-toolbar.lifecycle-toolbar { grid-template-columns: 1fr auto; }
  .document-toolbar.lifecycle-toolbar select { grid-column: 1 / -1; }
  .document-date-filter-panel { right: 0; }
  .document-date-fields { grid-template-columns: 1fr; }
  .document-date-fields > span { display: none; }
  .document-archive-banner { align-items: flex-start; flex-direction: column; }
  .chronology-proposal-options { grid-template-columns: 1fr; }
  .chronology-proposal-card { width: min(310px, 100%); }
  .profile-summary-grid { grid-template-columns: 1fr; }
  .profile-summary-grid > div.wide { grid-column: auto; }
}

/* Ergonomie téléphone : bandeau lisible, menus tactiles et zones sûres. */
@media (max-width: 768px) {
  .topbar {
    min-height: 72px;
    padding: 7px 14px 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-content: center;
    align-items: start;
    gap: 8px;
  }
  .topbar-navigation { width: 100%; min-width: 0; grid-column: 1; align-items: flex-start; gap: 5px; }
  .topbar:not(:has(> .topbar-contact)) .topbar-navigation { grid-column: 1 / -1; }
  .topbar-location { min-width: 0; }
  .topbar-location > .eyebrow { display: none; }
  .topbar-breadcrumbs {
    min-width: 0;
    max-width: 100%;
    display: grid;
    align-items: start;
    gap: 1px;
    overflow: hidden;
    padding: 1px 0 2px;
    scrollbar-width: none;
    white-space: normal;
  }
  .topbar-breadcrumbs::-webkit-scrollbar { display: none; }
  .topbar-breadcrumbs > span { display: none; }
  .topbar-breadcrumbs > a,
  .topbar-breadcrumbs > strong {
    width: 100%;
    min-width: 0;
    display: block;
    overflow: visible;
    overflow-wrap: anywhere;
    font-size: 10px;
    line-height: 1.25;
    text-overflow: clip;
    white-space: normal;
  }
  .topbar-breadcrumbs > :nth-child(3) { padding-left: 7px; }
  .topbar-breadcrumbs > :nth-child(5) { padding-left: 14px; }
  .topbar-breadcrumbs > :nth-child(7) { padding-left: 21px; }
  .topbar-breadcrumbs > :nth-child(9) { padding-left: 28px; }
  .topbar-breadcrumbs > :nth-child(11) { padding-left: 35px; }
  .topbar-breadcrumbs > :nth-child(13) { padding-left: 42px; }
  .topbar-contact {
    width: 100%;
    min-width: 0;
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end;
    gap: 4px;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.2;
  }
  .topbar-contact > span,
  .topbar-contact strong,
  .topbar-contact small {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar-client-context {
    width: 100%;
    align-items: flex-end;
    flex-direction: column;
    gap: 1px;
    padding-top: 2px;
  }
  .topbar-context-line { max-width: 100%; display: flex; gap: 4px; }

  body.mobile-file-menu-open { overflow: hidden; }
  body.mobile-file-menu-open::after {
    content: "";
    position: fixed;
    z-index: 70;
    inset: 0;
    background: rgba(9, 31, 46, .34);
  }
  details.file-menu[open] { position: relative; z-index: 72; }
  .file-card.document-card.is-archived:has(details.file-menu[open]),
  .file-card.business-object-card.is-archived:has(details.file-menu[open]),
  .claim-card.is-archived:has(details.file-menu[open]) {
    opacity: 1;
    filter: none;
  }
  details.file-menu[open] > .file-menu-panel,
  .document-page-action-menu[open] > .file-menu-panel {
    position: fixed;
    z-index: 73;
    top: auto;
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    width: auto;
    max-height: min(72dvh, 620px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 16px;
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(5, 31, 48, .34);
  }
  details.file-menu[open] > .file-menu-panel .button,
  details.file-menu[open] > .file-menu-panel button,
  details.file-menu[open] > .file-menu-panel a {
    min-height: 44px;
  }

  .content { padding-bottom: 88px; }
  .viewer-toolbar > div:first-child { width: 100%; min-width: 0; }
  .viewer-toolbar strong {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .portfolio-toolbar { grid-template-columns: 1fr 1fr; }
  .portfolio-toolbar label { grid-column: 1 / -1; }
  .portfolio-toolbar .button { width: 100%; justify-content: center; }
}

.document-card { position: relative; }
.document-bulk-checkbox {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 10px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #bed5e3;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  opacity: .72;
}
.document-bulk-checkbox:hover,
.document-bulk-checkbox:has(input:checked) { opacity: 1; border-color: #157db5; }
.document-bulk-checkbox input { width: 16px; height: 16px; margin: 0; accent-color: #157db5; }
.file-card.folder-card:has(> .document-bulk-checkbox) { padding-left: 52px; }
.document-card.is-bulk-selected { box-shadow: 0 0 0 3px rgba(21, 125, 181, .2); }
.document-bulk-toolbar {
  position: sticky;
  z-index: 18;
  top: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 16px;
  padding: 12px;
  border: 1px solid #91bfd8;
  border-radius: 12px;
  background: #f6fbfe;
  box-shadow: 0 8px 22px rgba(16, 71, 100, .1);
}
.document-bulk-toolbar[hidden] { display: none; }
.document-bulk-select-all { display: inline-flex; align-items: center; gap: 7px; }
.document-bulk-toolbar select { min-width: 180px; }
.document-bulk-toolbar [data-bulk-destination] select { min-width: 220px; }
.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; }
@media (max-width: 720px) {
  .document-bulk-toolbar { top: 106px; flex-wrap: wrap; }
  .document-bulk-toolbar select,
  .document-bulk-toolbar [data-bulk-destination],
  .document-bulk-toolbar [data-bulk-destination] select { width: 100%; }
}

/* Fenêtre de configuration unifiée : fichiers, dossiers, chat et droits. */
body.config-modal-open { overflow: hidden; }
.config-popover-modal {
  width: min(620px, calc(100vw - 32px));
  max-width: none;
  max-height: min(760px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  background: transparent;
  box-shadow: 0 30px 90px rgba(5, 31, 48, .34);
}
.config-popover-modal::backdrop {
  background: rgba(8, 27, 40, .54);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.config-popover-card {
  display: flex;
  width: 100%;
  max-height: min(760px, calc(100dvh - 32px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(190, 213, 227, .9);
  border-radius: 20px;
  background: #fff;
}
.config-popover-head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #f7fbfe;
}
.config-popover-head h2 {
  margin: 0;
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.15;
}
.config-popover-close {
  display: grid;
  width: 40px;
  height: 40px;
  flex: none;
  padding: 0;
  place-items: center;
  border: 1px solid #efb7b7;
  border-radius: 50%;
  background: #fff4f4;
  color: #b4232d;
  cursor: pointer;
  font-size: 27px;
  line-height: 1;
}
.config-popover-close:hover { background: #ffe6e6; border-color: #d86269; }
.config-popover-body {
  min-height: 0;
  padding: 20px;
  overflow-x: hidden;
  overflow-y: auto;
}
.config-popover-body > .file-menu-panel,
.config-popover-body > .quick-create-panel,
.config-popover-body > .chat-message-menu-panel,
.config-popover-body > .scope-manager-config-panel {
  position: static !important;
  inset: auto !important;
  display: grid !important;
  width: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  visibility: visible !important;
}
.config-popover-body > .scope-manager-config-panel { gap: 14px; }
.config-popover-body .file-menu-title { display: none; }
.config-popover-body .file-menu-action,
.config-popover-body .button,
.config-popover-body button,
.config-popover-body select,
.config-popover-body input,
.config-popover-body textarea { max-width: 100%; }
.config-popover-body .file-menu-submenu > form,
.config-popover-body .scope-group-builder > form { padding-top: 12px; }

@media (max-width: 680px) {
  .config-popover-modal {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 16px;
  }
  .config-popover-card { max-height: calc(100dvh - 16px); border-radius: 16px; }
  .config-popover-head { padding: 14px 15px; }
  .config-popover-body { padding: 15px; }
}

/* Les cartes-dossiers restent lisibles à côté des actions tactiles. */
@media (max-width: 600px) {
  .document-grid-view > .folder-card {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    padding-top: 9px;
    padding-right: 8px;
    padding-bottom: 9px;
  }
  .document-grid-view > .folder-card .folder-card-link {
    min-width: 0;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 7px;
  }
  .document-grid-view > .folder-card .folder-visual {
    width: 32px;
    height: 27px;
  }
  .document-grid-view > .folder-card .file-info {
    min-width: 0;
    display: block;
    overflow: hidden;
  }
  .document-grid-view > .folder-card .file-info .file-title-line {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
  .document-grid-view > .folder-card .file-info .file-title-line strong {
    width: 100%;
    min-width: 0;
    display: -webkit-box;
    overflow: hidden;
    overflow-wrap: anywhere;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
  .document-grid-view > .folder-card .file-info .meta {
    max-width: 100%;
    margin-top: 3px;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .document-grid-view > .folder-card > .file-actions {
    min-width: max-content;
    flex: none;
    gap: 4px;
  }
  .document-grid-view > .folder-card > .file-actions .button.small {
    min-height: 36px;
    padding-inline: 9px;
  }
}
