/* Local team communication prototype */
.communication-dialog {
  width: min(1440px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
}
/* One fixed window; the list and the selected conversation scroll in parallel, with no nested history. */
.communication-dialog[open] {
  display: flex;
  flex-direction: column;
  height: min(820px, 90dvh);
  overflow: hidden;
}
.communication-tools {
  flex: none;
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 0 20px;
}
.communication-tools .field {
  min-width: 180px;
}
.communication-layout {
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 24px;
}
.communication-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: visible;
}
/* the list scrolls; the tiles keep the height of their text (on phones they shrank and covered each other) */
.communication-list > * {
  flex-shrink: 0;
}
.communication-thread {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 8px;
  white-space: normal;
  width: 100%;
}
.communication-thread[aria-current='true'] {
  border-color: currentColor;
}
.communication-thread small {
  font-weight: 400;
  opacity: 0.75;
}
.communication-detail {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 0 8px 16px;
}
.communication-messages {
  display: grid;
  gap: 14px;
  margin: 20px 0;
  overflow: visible;
}
.communication-message {
  padding: 18px;
  border: 1px solid #8884;
  border-radius: 14px;
  overflow-wrap: anywhere;
}
.communication-message > small {
  display: block;
  margin-top: 5px;
}
.communication-message p {
  max-width: 78ch;
  white-space: pre-wrap;
}
.communication-mention {
  font-weight: 600;
}
.communication-compose {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}
.communication-compose textarea {
  min-height: 100px;
  /* The reply field stands out in light green (owner 09.10). */
  background: var(--sage-soft);
  border-color: var(--sage-mid);
}
.communication-compose textarea:focus {
  border-color: var(--sage-ink);
}
@media (max-width: 700px) {
  .communication-dialog {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
  }
  /* „Zamknij” as an icon on phones, as in the other windows (also in the Makieta). */
  .communication-dialog > header .btn {
    font-size: 0;
    gap: 0;
    padding: 9px;
  }
  .communication-detail {
    padding: 0 0 16px;
  }
  .communication-tools .field {
    width: 100%;
  }
}
.communication-fab {
  position: fixed !important;
  right: 24px;
  bottom: 24px;
  z-index: 900;
  width: 56px;
  height: 56px;
  border: 1px solid #ffffff33;
  border-radius: 50% !important;
  background: #252525 !important;
  color: white !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px !important;
  box-shadow: 0 6px 24px #0003;
  cursor: pointer;
}
.communication-fab svg,
.conversation-icon svg,
.communication-dialog svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.conversation-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 8px !important;
}
.communication-dialog {
  box-sizing: border-box;
  padding: 24px;
  border: 1px solid #8884;
  border-radius: 18px;
  background: var(--surface, #fff);
  color: var(--text, #222);
  max-height: 90dvh;
  overflow: auto;
}
.communication-dialog > header {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
/* One look in every module (owner 10.10): the Makieta does not load shell.css, so the window brings its
   own sticky header with the line under it, the title, the texts and the Orso colours. */
:root {
  --sage-soft: #e3ebe5;
  --sage-mid: #a9bdb2;
  --sage-ink: #415c4f;
}
html[data-theme='dark'] {
  --sage-soft: #2c3a33;
  --sage-mid: #415c4f;
  --sage-ink: #d3e3d9;
}
.communication-dialog:has(> header) {
  padding-top: 0;
}
.communication-dialog > header {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 0 24px;
  padding: 28px 0 14px;
  background: var(--surface, #fff);
  box-shadow: 0 1px 0 var(--line, #e2e2e2);
}
.communication-dialog h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.communication-dialog .communication-empty {
  font-size: 16px;
  line-height: 1.65;
  color: var(--muted, #767676);
}
.communication-dialog .field {
  font-size: 13px;
  color: var(--muted, #767676);
}
.communication-dialog .communication-thread small {
  color: var(--text, #252525);
}
.communication-dialog h3 {
  margin: 0 0 10px;
  font-size: 16px;
}
.communication-dialog p:not([class]),
.communication-dialog p.muted,
.communication-dialog p.communication-event {
  font-size: 16px;
  line-height: 1.65;
}
.communication-dialog p:not([class]) {
  color: var(--text, #252525);
}
.communication-dialog p.muted {
  color: var(--muted, #767676);
}
.communication-dialog .muted {
  color: var(--muted, #767676);
}
.communication-dialog label.field {
  margin: 0;
}
.communication-dialog .orso-status {
  line-height: 1.65;
}
.communication-dialog .form-error {
  margin: 0;
  color: #bb5656;
  font-size: 13px;
  line-height: 1.65;
}
.communication-dialog .demo-note {
  margin: 24px 0;
  padding: 2px 0 2px 15px;
  border-left: 3px solid var(--line, #e2e2e2);
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted, #767676);
}
/* Secondary actions with a label (Orso's suggestions, „Wyślij”) are light green, as in the other modules. */
.communication-dialog
  :not(header, nav, [role='tablist'])
  > .btn:not(.primary):not(.danger):not(.dark-green):not([aria-pressed]):not(.communication-thread):not(.soft-blue):has(
    > span
  ) {
  background: var(--sage-soft);
  border-color: var(--sage-mid);
  color: var(--sage-ink);
}
.communication-dialog .field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.communication-dialog .form-grid {
  display: grid;
  gap: 16px;
}
.communication-dialog input:where(:not([type='checkbox'], [type='radio'])),
.communication-dialog textarea,
.communication-dialog select {
  box-sizing: border-box;
  width: 100%;
  padding: 12px;
  border: 1px solid #8885;
  border-radius: 8px;
  font: inherit;
  background: transparent;
  color: inherit;
}
.communication-dialog .btn {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid #8884;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
/* The Makieta does not load the shared buttons of the other modules (shell.css): their defaults here, with no
   weight of their own, so any other rule still wins (owner 19.10: Orso's "Analiza" and "Zapytaj" had their text at
   the left, the speaker and the tabs were lower than in the CRM). */
:where(.communication-dialog) :where(.btn) {
  justify-content: center;
  min-height: 43px;
}
.communication-dialog .communication-thread {
  display: flex;
  align-items: flex-start;
}
.communication-dialog .primary {
  background: #252525;
  color: #fff;
}
/* The reply field in light green (owner 09.10) — also inside the dialog. */
.communication-dialog .communication-compose textarea {
  background: var(--sage-soft);
  border-color: var(--sage-mid);
}
.communication-dialog .communication-compose textarea:focus {
  border-color: var(--sage-ink);
}
/* Orso and the conversations: the same padding on every tile (owner 09.10). */
.communication-dialog .communication-thread,
.communication-dialog .communication-thread.orso-thread {
  padding: 14px 16px !important;
}
/* "Oznacz jako załatwione": the dark green of orso.estate with white text, also before hovering (owner 09.10). */
.communication-dialog .btn.dark-green {
  background: #415c4f;
  border-color: #415c4f;
  color: #fff;
}
.communication-dialog .btn.dark-green:hover {
  background: #354b40;
  color: #fff;
}
[data-theme='dark'] .communication-dialog {
  background: #242424;
  color: #eee;
}
.crm-lead-wrap > .crm-row-actions {
  position: static;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
}
.crm-lead-wrap > .lead-card {
  padding: 18px;
  margin-bottom: 0;
}
.crm-lead-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.crm-lead-wrap .lead-card > * {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.crm-lead-wrap .lead-bottom {
  flex-wrap: wrap;
}
.crm-lead-wrap > .crm-row-actions > .btn {
  min-height: 44px;
  white-space: normal;
}
@media (max-width: 600px) {
  .communication-fab {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
  }
  .communication-dialog {
    padding: 16px;
  }
}
/* Brand mark and centered icon-only controls. */
.studio-identity .brand .studio-logo {
  display: block;
  width: 46px;
  height: 46px;
  object-fit: contain;
  box-sizing: border-box;
  padding: 8px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 11px;
}
[data-theme='dark'] .studio-identity .brand .studio-logo {
  background: #f4f4f4;
  border-color: #f4f4f4;
}
.communication-fab,
.conversation-icon {
  box-sizing: border-box;
  gap: 0 !important;
  line-height: 1;
  flex-shrink: 0;
}
.conversation-icon {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 8px !important;
}
.communication-fab > svg,
.conversation-icon > svg,
.delete-icon > svg {
  display: block;
  margin: 0 !important;
  flex-shrink: 0;
}
.delete-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  line-height: 1;
}
@media (max-width: 700px) {
  .studio-identity .brand .studio-logo {
    width: 38px;
    height: 38px;
    padding: 6px;
  }
}
.communication-fab > svg,
.conversation-icon > svg {
  transform: translate(1px, -1px);
}
.studio-identity .brand {
  min-width: 46px;
  min-height: 46px;
  overflow: visible;
}
.studio-identity .brand .studio-logo {
  visibility: visible;
  opacity: 1;
  flex: none;
  max-width: none;
}
/* The brand is filled artwork, unlike the outline UI icons. */
.studio-identity .brand svg.studio-logo,
.topbar .studio-identity .brand svg.studio-logo {
  width: 46px;
  height: 46px;
  padding: 8px;
  background: #fff !important;
  color: #111 !important;
  fill: #111 !important;
  stroke: none !important;
  border: 1px solid #ddd;
  border-radius: 11px;
  display: block;
}
.studio-identity .brand svg.studio-logo path {
  fill: #111 !important;
  stroke: none !important;
}
@media (max-width: 700px) {
  .studio-identity .brand svg.studio-logo,
  .topbar .studio-identity .brand svg.studio-logo {
    width: 38px;
    height: 38px;
    padding: 6px;
  }
}
.communication-fab .communication-count {
  position: absolute;
  right: -4px;
  top: -4px;
  min-width: 23px;
  height: 23px;
  padding: 3px 6px;
  border-radius: 20px;
  background: #c44949;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 17px;
  border: 2px solid #fff;
  box-sizing: content-box;
}
.communication-thread.has-unread {
  border-left: 3px solid #568caa;
  background: #568caa12;
}
.communication-thread.has-unread strong:before {
  content: '●';
  color: #568caa;
  margin-right: 8px;
  font-size: 10px;
}
.communication-detail details {
  margin: 12px 0;
}
.communication-detail details .field {
  margin: 12px 0;
}

/* The caption is shown only inside the phone bottom bar. */
.communication-fab .app-bar-label {
  display: none;
}
.app-bar .communication-fab .app-bar-label {
  display: inline;
}

/* Orso — AI assistant, pinned first in the conversations list. */
.orso-thread {
  /* Light green tile of Orso (owner 09.10). */
  background: var(--sage-soft) !important;
  border-color: var(--sage-mid) !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 12px !important;
  /* Orso's picture starts where the names of the other conversations start (owner 10.10). */
  justify-content: flex-start !important;
  text-align: left;
}
.orso-thread-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.orso-avatar {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
}
.orso-avatar img {
  display: block;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line, #ddd);
  border-radius: 12px;
  background: #fff;
}
.orso-badge {
  position: absolute;
  right: -6px;
  bottom: -5px;
  padding: 1px 5px;
  border: 2px solid var(--surface, #fff);
  border-radius: 8px;
  background: var(--accent, #252525);
  color: var(--on, #fff);
  font-size: 10px;
  font-weight: 750;
  line-height: 14px;
  letter-spacing: 0.04em;
}
.orso-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.orso-head h3 {
  margin: 0;
}
.orso-log {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: visible;
  padding: 2px;
}
.orso-message {
  max-width: min(92%, 78ch);
  padding: 14px 18px;
  border-radius: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.orso-message p,
.orso-message ul {
  margin: 0;
}
.orso-message p + p,
.orso-message p + ul,
.orso-message ul + p {
  margin-top: 6px;
}
.orso-message ul {
  padding-left: 18px;
}
.orso-user {
  align-self: flex-end;
  background: var(--accent, #252525);
  color: var(--on, #fff);
  border-bottom-right-radius: 4px;
}
/* "Archiwizuj" on a question (owner 11.10): a small icon at its corner; archived ones behind a link. */
.orso-user {
  position: relative;
  padding-right: 38px;
}
.communication-dialog .orso-user p {
  color: inherit;
}
.communication-dialog .btn.orso-archive {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  min-height: 0;
  padding: 0;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  opacity: 0.65;
}
.btn.orso-archive span:empty {
  display: none;
}
.communication-dialog .btn.orso-archive:hover,
.communication-dialog .btn.orso-archive:focus-visible {
  opacity: 1;
  background: #ffffff26;
}
.btn.orso-archive svg {
  width: 15px;
  height: 15px;
}
.orso-archived {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid #8883;
}
.orso-archived .orso-user {
  padding-right: 14px;
}
.btn.orso-archive-link {
  align-self: flex-start;
  margin-top: 8px;
  padding: 4px 2px;
  border: 0;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted, #666);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn.orso-archive-back {
  align-self: flex-start;
  margin-bottom: 10px;
}
.orso-orso {
  align-self: flex-start;
  background: var(--soft, #f0f0f0);
  border-bottom-left-radius: 4px;
}
.orso-credits {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted, #6b6b6b);
}
.orso-credits.is-low {
  color: #a35a00;
  font-weight: 600;
}
.orso-limit {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted, #6b6b6b);
}
.orso-error {
  align-self: flex-start;
  background: #c4494918;
  color: #a33c3c;
}
.orso-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 10px;
}
.orso-suggestions .btn {
  white-space: normal;
  text-align: left;
}
.orso-status {
  min-height: 1.4em;
  margin: 8px 0 4px;
  font-size: 13px;
  color: var(--muted, #767676);
}
/* Question box on the full width, the button below it (owner's request 03.10: more room to type). */
.orso-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
.orso-form textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  font: inherit;
  font-size: 16px;
}
.orso-form .btn {
  min-height: 46px;
  justify-self: end;
  min-width: 160px;
}
/* Characters of a long question (test 016, B6): shown near the limit of 4000, under the box on the right. */
.orso-form .orso-count {
  grid-column: 1 / -1;
  justify-self: end;
  margin-top: -4px;
  font-size: 12px;
  color: var(--muted, #767676);
}
/* "Szczegółowa analiza" (owner 12.10: the model by the kind of work) left of "Zapytaj"; on = pressed. */
.orso-form {
  grid-template-columns: minmax(0, 1fr) auto;
}
.orso-form textarea {
  grid-column: 1 / -1;
}
.orso-form .btn.orso-depth {
  grid-row: 2;
  grid-column: 1;
  justify-self: start;
  min-width: 0;
  font-weight: 500;
}
.orso-form .btn.orso-depth.is-on {
  border-color: currentColor;
  box-shadow: inset 0 0 0 1px currentColor;
  font-weight: 700;
}
.orso-form .btn.orso-depth.is-on::before {
  content: '✓';
  margin-right: 6px;
}
@media (max-width: 600px) {
  .orso-form {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .orso-form .btn,
  .orso-form .btn.orso-depth {
    justify-self: stretch;
    min-width: 0;
  }
  /* "Analiza" instead of "Szczegółowa analiza": one line next to "Zapytaj" (owner 13.10). */
  .orso-form .btn.orso-depth.has-short {
    white-space: nowrap;
  }
  .orso-form .btn.orso-depth.has-short > span:not(.btn-short) {
    display: none;
  }
  .orso-form .btn.orso-depth.has-short > .btn-short {
    display: inline;
  }
}
/* Voice (owner 14.10): the microphone left of "Szczegółowa analiza", "Czytaj na głos" at the right of the header. */
.orso-form.has-mic {
  grid-template-columns: auto minmax(0, 1fr) auto;
}
.orso-form.has-mic .btn.orso-mic {
  grid-row: 2;
  grid-column: 1;
  width: 46px;
  min-width: 46px;
  padding: 0;
  justify-content: center;
}
.orso-form .btn.orso-mic > span:empty {
  display: none;
}
.orso-form.has-mic .btn.orso-depth {
  grid-column: 2;
}
.orso-form.has-mic .btn.primary {
  grid-row: 2;
  grid-column: 3;
}
.orso-form .btn.orso-mic.is-on {
  border-color: #c62828;
  color: #c62828;
  animation: orso-mic-pulse 1.4s ease-in-out infinite;
}
@keyframes orso-mic-pulse {
  50% {
    box-shadow: 0 0 0 6px rgba(198, 40, 40, 0.18);
  }
}
@media (prefers-reduced-motion: reduce) {
  .orso-form .btn.orso-mic.is-on {
    animation: none;
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.25);
  }
}
.orso-head .btn.orso-aloud {
  margin-left: auto;
  flex: none;
  font-weight: 500;
}
/* Reading aloud on: dark green with a white speaker, like the active filters (owner 16.10). */
.orso-head .btn.orso-aloud.is-on {
  background: #415c4f;
  border-color: #415c4f;
  color: #fff;
  font-weight: 700;
}
@media (max-width: 600px) {
  .orso-form.has-mic {
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
  }
  .orso-form.has-mic .btn.orso-mic {
    justify-self: start;
    min-width: 46px;
  }
  /* On a phone only the speaker icon: the title and avatar keep their room. */
  .orso-head .btn.orso-aloud {
    width: 42px;
    min-width: 42px;
    padding: 0;
    justify-content: center;
  }
  .orso-head .btn.orso-aloud > span {
    display: none;
  }
}
/* On a phone: room under "Wróć" before Orso's name (owner 13.10). */
@media (max-width: 700px) {
  .communication-detail-top + .orso-head {
    margin-top: 18px;
  }
}
/* A change prepared by Orso: saved only after "Zatwierdź" (owner 12.10). */
.orso-action {
  align-self: flex-start;
  width: min(100%, 420px);
  max-width: 100%;
  border: 1px solid var(--line, #e4e4e4);
  border-left: 4px solid currentColor;
  background: transparent;
}
.orso-action-title {
  display: block;
  margin-bottom: 6px;
}
.orso-message ul.orso-action-lines {
  padding-left: 18px;
}
.orso-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.orso-action-buttons .btn {
  min-height: 40px;
}
.orso-message p.orso-action-state {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted, #767676);
}
.orso-message p.orso-action-state.is-done {
  color: #2f7d4f;
}
.orso-message p.orso-action-state.is-failed {
  color: #a33c3c;
}
.orso > .btn {
  margin-top: 10px;
  margin-right: 8px;
}
/* "Nowa rozmowa", "Co mogę zrobić?" and "Zarchiwizowane" in one row, never touching (owner 01.11, also a phone);
   "Nowa rozmowa" in the grey-blue of the brand (soft-blue), "Co mogę zrobić?" in sage — two kinds of action. */
.orso-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.orso-actions > .btn {
  width: auto;
  margin: 0;
}
.orso-actions > .btn.orso-archive-link {
  margin: 0;
}
/* The box of the question when focused: a thin ring close to the box, not a thick one reaching the button above
   (owner 01.11, phone). Still clearly visible (biblia B1: a clear :focus-visible). */
.orso-form textarea:focus,
.orso-form textarea:focus-visible {
  outline: 2px solid #8b9faf;
  outline-offset: 0;
}

/* „Dodaj materiały” (order 011 B4): the files for the next question above the box, the pictures counted. */
.orso-materials {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}
.orso-materials .btn.orso-attach {
  min-height: 40px;
  font-weight: 500;
}
.orso-images-count {
  color: var(--muted, #767676);
}
.orso-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}
.orso-message ul.orso-files {
  padding: 0;
  margin-top: 8px;
}
.orso-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 4px 4px 4px 4px;
  border: 1px solid var(--line, #e4e4e4);
  border-radius: 10px;
  font-size: 13px;
}
.orso-file img,
.orso-file-kind {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
}
.orso-file-kind {
  display: inline-grid;
  place-items: center;
  background: #2f7d4f;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.orso-file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}
.orso-file .btn.orso-file-drop {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  justify-content: center;
}
.orso-file .btn.orso-file-drop > span:empty {
  display: none;
}
.orso-user .orso-file {
  border-color: currentColor;
}
/* The draft of a new investment: one preview on the card (order 011 B4). */
.orso-action.has-preview {
  width: min(100%, 560px);
}
.orso-draft-why {
  color: var(--muted, #767676);
}
.orso-draft-part {
  margin-top: 12px;
}
.orso-draft-part h4 {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.orso-draft-units {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.orso-draft-units th,
.orso-draft-units td {
  padding: 4px 8px 4px 0;
  border-bottom: 1px solid var(--line, #e4e4e4);
  text-align: left;
  vertical-align: top;
}
.orso-draft-scroll {
  max-width: 100%;
  overflow-x: auto;
}
.orso-draft-units td:nth-child(n + 3) {
  white-space: nowrap;
}
.orso-draft-units th {
  font-weight: 600;
  color: var(--muted, #767676);
}
.orso-draft-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.orso-draft-figure {
  margin: 0;
  font-size: 12px;
}
.orso-draft-frame {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line, #e4e4e4);
}
.orso-draft-figure.is-main .orso-draft-frame {
  border: 2px solid #2f7d4f;
}
.orso-draft-frame img {
  display: block;
  width: 100%;
  height: auto;
}
.orso-draft-frame svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.orso-draft-frame polygon {
  fill: rgba(47, 125, 79, 0.28);
  stroke: #2f7d4f;
  stroke-width: 2px;
  vector-effect: non-scaling-stroke;
}
.orso-draft-figure figcaption {
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.orso-draft-note {
  margin-top: 12px;
  font-weight: 600;
}
[data-theme='dark'] .orso-file-kind,
[data-theme='dark'] .orso-draft-figure.is-main .orso-draft-frame {
  border-color: #7fc79b;
}
[data-theme='dark'] .orso-draft-frame polygon {
  fill: rgba(127, 199, 155, 0.3);
  stroke: #7fc79b;
}

/* Someone joined the conversation: a quiet line between messages. */
.communication-event {
  margin: 4px 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted, #767676);
}
.communication-join {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin: 8px 0 12px;
}
.communication-join .field,
.communication-join label {
  flex: 1 1 200px;
  margin: 0;
}
/* Buyers waiting for an answer (owner 10.10): their own group under Orso, warm accent. */
.communication-group {
  margin: 10px 2px 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.7;
}
.communication-thread.buyer-waiting.has-unread {
  border-left-color: #c47a2c;
  background: #c47a2c14;
}
.communication-thread.buyer-waiting.has-unread strong:before {
  color: #c47a2c;
}

/* ---- Rozmowy (owner 11.10) ---- */
/* The number in the chat bubble in the middle of its circle (desktop); orange when only answers are owed. */
.communication-fab .communication-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  line-height: 1;
}
.communication-fab .communication-count.is-waiting {
  background: #d9822b;
}
.communication-counters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-right: auto;
}
.communication-counter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid #8883;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}
.communication-counter::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.communication-counter.is-unread {
  color: #b23b3b;
}
.communication-counter.is-waiting {
  color: #b5651d;
}
.communication-counter.is-zero {
  color: inherit;
  opacity: 0.55;
}
.communication-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.communication-search {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #8885;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
}
.communication-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.communication-dialog .communication-tabs .btn {
  padding: 7px 11px;
  font-size: 13px;
}
.communication-dialog .communication-tabs .btn[aria-pressed='true'] {
  background: #415c4f;
  border-color: #415c4f;
  color: #fff;
}
/* Section titles as in the simple views: dark green, a small tilted square and a thin line. */
.communication-section {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 2px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sage-ink, #415c4f);
}
.communication-section::before {
  content: '';
  flex: none;
  width: 9px;
  height: 9px;
  background: #698c7e;
  transform: rotate(-8deg);
}
.communication-section::after {
  content: '';
  flex: 1;
  min-width: 16px;
  height: 1px;
  background: color-mix(in srgb, #698c7e 35%, transparent);
}
[data-theme='dark'] .communication-section {
  color: #a9c3b6;
}
.communication-none {
  margin: 2px;
  font-size: 13px;
}
/* A compact tile: initials, the name first, the time on the right, one line of the last message. */
.communication-dialog .communication-thread.communication-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  /* 3 px edge + 14 px: the initials start where Orso's avatar starts (1 px border + 16 px) */
  padding: 10px 12px 10px 14px !important;
  border-left: 3px solid transparent;
}
.communication-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e3ebe5;
  color: #415c4f;
  font-size: 13px;
  font-weight: 700;
}
.communication-row.is-buyer .communication-avatar {
  background: #f3e6d6;
  color: #8a5420;
}
.communication-row-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.communication-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.communication-row-top strong {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.communication-row-top time {
  flex: none;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.65;
}
.communication-dialog .communication-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
}
.communication-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.communication-state::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.communication-state.is-unread {
  color: #b23b3b;
}
.communication-state.is-waiting {
  color: #b5651d;
}
/* Unread: a red edge; read but not answered: orange — the tile itself stays calm. */
.communication-dialog .communication-thread.communication-row.has-unread {
  border-left-color: #c44949;
  background: #c4494909;
}
.communication-dialog .communication-thread.communication-row.has-unread strong {
  font-weight: 800;
}
.communication-dialog .communication-thread.communication-row.is-waiting {
  border-left-color: #d9822b;
  background: #d9822b0b;
}
.communication-row.has-unread strong:before {
  content: none;
}
/* "Załatwione" (owner 11.10): a small green icon button right of "Nowa rozmowa" opens their own view, so
   that 50 finished conversations do not swell the window. */
.communication-dialog .btn.communication-archive-link {
  width: 44px;
  height: 44px;
  padding: 0;
  justify-content: center;
  border-color: var(--sage-mid, #c9d8cd);
  background: var(--sage-soft, #e3ebe6);
  color: var(--sage-ink, #2f4a3c);
}
.communication-dialog .btn.communication-archive-link[aria-pressed='true'] {
  background: #415c4f;
  border-color: #415c4f;
  color: #fff;
}
.communication-dialog .btn.communication-archive-link span:empty {
  display: none;
}
.communication-dialog .btn.communication-archive-link svg {
  width: 20px;
  height: 20px;
}
.communication-dialog .btn.communication-archive-back {
  flex: none;
  align-self: flex-start;
  margin: 0 0 4px;
}
.communication-state.is-done {
  color: var(--muted, #777);
}
/* A conversation with a buyer: the developer's messages on the right in light green. */
.communication-message.is-mine {
  margin-left: 12%;
  background: var(--sage-soft, #eef3ef);
}
.communication-message.is-buyer {
  margin-right: 12%;
}
[data-theme='dark'] .communication-message.is-mine {
  background: #2f3a34;
}
.communication-context {
  margin-top: 4px;
}
.communication-delete {
  margin-left: 10px;
}
.communication-detail .buyer-reply-notify {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
/* A checkbox keeps its own size (owner 11.10: it was stretched by the field rule above). */
.communication-dialog input[type='checkbox'] {
  flex: none;
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
}
.communication-back {
  display: none !important;
}
@media (max-width: 900px) {
  .communication-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .communication-layout:has(.communication-empty) .communication-detail {
    display: none;
  }
  .communication-tools .communication-counters {
    width: 100%;
  }
  /* A conversation open: it takes the window, "Wszystkie rozmowy" goes back to the list. */
  .communication-layout.has-selection .communication-side {
    display: none;
  }
  .communication-back {
    display: inline-flex !important;
    margin-bottom: 12px;
  }
  .communication-detail-top {
    position: sticky;
    top: 0;
    z-index: 2;
    padding-bottom: 8px;
    background: var(--surface, #fff);
  }
  .communication-dialog:has(.communication-layout.has-selection) .communication-tools {
    display: none;
  }
  .communication-message.is-mine {
    margin-left: 6%;
  }
  .communication-message.is-buyer {
    margin-right: 6%;
  }
}
@media (max-width: 700px) {
  .communication-dialog .communication-tools {
    gap: 8px;
    margin: 14px 0;
  }
  .communication-counters {
    flex-wrap: nowrap;
    gap: 6px;
  }
  .communication-counter {
    padding: 6px 9px;
    font-size: 12px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .communication-dialog .communication-tools > .btn {
    flex: 1 1 0;
    justify-content: center;
    padding-inline: 10px;
  }
  /* An open conversation on the phone: no tools above it. */
  .communication-dialog:has(.communication-layout.has-selection) .communication-tools {
    display: none;
  }
}
/* "Załatw bez odpowiedzi" under "Wyślij odpowiedź", not glued to it (owner 11.10). */
.communication-detail > .btn.buyer-handled {
  margin-top: 12px;
}

/* ---- Rozmowy on the phone (owner 12.10) ---- */
.communication-counter .label-short,
.btn-short {
  display: none;
}
.communication-detail-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.communication-detail-top:empty {
  display: none;
}
.communication-dialog .btn.communication-add-person {
  display: none;
}
.communication-detail .communication-title {
  margin: 14px 0 2px;
}
.communication-detail .communication-about,
.communication-detail .communication-people {
  margin: 0 0 4px;
}
@media (max-width: 700px) {
  /* "Usuń rozmowę" goes to its own line under "Oznacz jako załatwione": no indent there. */
  .communication-delete {
    margin: 8px 0 0;
  }
  /* 1. The two counters fill the width equally, with the short words. */
  .communication-tools .communication-counters {
    display: grid;
    font-size: 12px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 10em), 1fr));
    width: 100%;
  }
  .communication-counter {
    justify-content: center;
    min-width: 0;
  }
  .communication-counter .label-long {
    display: none;
  }
  .communication-counter .label-short {
    display: inline;
  }
  /* 2. "Tylko do zrobienia", "Nowa rozmowa" and "Załatwione" (when there are any): equal icon buttons across
     the width. */
  .communication-dialog .communication-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
  }
  .communication-dialog .communication-tools > .field,
  .communication-dialog .communication-tools > label {
    flex: 1 1 100%;
  }
  .communication-dialog .communication-tools > .btn {
    flex: 1 1 0;
    min-width: 0;
  }
  .communication-dialog .communication-tools > .btn,
  .communication-dialog .btn.communication-archive-link {
    width: auto;
    height: 46px;
    min-height: 46px;
    padding: 0;
    justify-content: center;
    gap: 0;
  }
  .communication-dialog .communication-tools > .btn > span {
    display: none;
  }
  .communication-dialog .communication-tools > .btn svg {
    width: 22px;
    height: 22px;
  }
  .communication-dialog .btn.communication-todo[aria-pressed='true'] {
    background: #415c4f;
    border-color: #415c4f;
    color: #fff;
  }
  /* The list scrolls with its search and filters in .communication-side. */
  /* An open conversation: "Wróć" and "Kontekst" (and "+") in the first line, the names and details close
     under them. */
  .communication-detail-top {
    flex-wrap: wrap;
  }
  .communication-detail-top > .btn.communication-back,
  .communication-detail-top > .btn.communication-context {
    flex: 1 1 0;
    min-width: max-content;
    height: auto;
    min-height: 46px;
    margin: 0;
    padding-inline: 10px;
    justify-content: center;
  }
  .communication-detail-top > .btn.has-short > span:not(.btn-short) {
    display: none;
  }
  .communication-detail-top > .btn.has-short > .btn-short {
    display: inline;
  }
  .communication-dialog .btn.communication-add-person {
    display: inline-flex;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    padding: 0;
    justify-content: center;
    gap: 0;
  }
  /* the empty text next to the icon took the gap and pushed „+” to the left (owner 12.10) */
  .communication-dialog .btn.communication-add-person > span {
    display: none;
  }
  .communication-dialog .btn.communication-add-person[aria-pressed='true'] {
    background: #415c4f;
    border-color: #415c4f;
    color: #fff;
  }
  .communication-detail .communication-join:not(.is-open) {
    display: none;
  }
  .communication-detail .communication-title {
    margin-top: 12px;
  }
  /* Enter sends on a keyboard; a phone has the button. */
  .communication-compose small.muted {
    display: none;
  }
}

/* Orso's welcome (owner 22.10, modules/welcome.js): the start screen's first visit; options as calm rows. */
.orso-welcome {
  width: min(560px, calc(100vw - 32px));
}
.orso-welcome-body {
  display: grid;
  gap: 12px;
}
.orso-welcome-body p {
  margin: 0;
}
.orso-welcome-lead {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.orso-welcome-body h3 {
  margin: 6px 0 0;
}
.orso-welcome-options {
  display: grid;
  gap: 8px;
}
.orso-welcome-option {
  justify-content: flex-start;
  width: 100%;
  text-align: left;
}
.orso-welcome-note {
  font-size: 0.85em;
}
.orso-welcome-link {
  justify-self: start;
}
/* A phone's scroll bar lies over the content (owner 02.11): the scrolling panes reach 12 px into the window's padding
   and give it back as their own padding — the bar gets a gutter, the content keeps its width and place. */
@media (max-width: 700px) {
  .communication-side,
  .communication-detail {
    margin-inline-end: -12px;
    padding-inline-end: 12px;
  }
}
