.request-list {
  display: grid;
  gap: 1.85rem;
  margin: 1.85rem 0 0;
  padding: 0;
  list-style: none;
}

.document-summary-list {
  display: grid;
  gap: 0.32rem;
  min-width: 12rem;
  margin: 0;
}

.document-summary-list div {
  display: grid;
  grid-template-columns: 6.2rem minmax(0, 1fr);
  gap: 0.5rem;
}

.document-summary-list dt {
  color: var(--muted);
  font-size: 0.78rem;
}

.document-summary-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.request-builder,
.request-review {
  display: grid;
  gap: 0.82rem;
}

.request-card,
.request-group-card {
  display: grid;
  gap: 0.62rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.82rem;
  background: rgba(255, 255, 255, 0.9);
}

.request-card h3,
.request-group-card h3 {
  margin: 0;
}

.request-item-list {
  display: grid;
  gap: 0.42rem;
  padding: 0;
  margin: 0;
}

.request-item-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.56rem 0.64rem;
  background: var(--white);
}

article.request-item-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.request-item-card-excluded {
  opacity: 0.68;
}

.request-item-copy {
  display: grid;
  gap: 0.16rem;
}

.request-state-pill {
  width: max-content;
  background: var(--neutral-bg);
  color: var(--neutral-ink);
}

.request-workbench {
  display: grid;
  gap: 0.82rem;
}

.request-workbench-section {
  display: grid;
  gap: 0.82rem;
}

.request-builder + .table-panel {
  margin-top: 0.82rem;
}

.request-counterparty-card {
  --request-sticky-header-height: 3.2rem;
  display: grid;
  gap: 0.62rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0 0.82rem 0.82rem;
  background: var(--white);
}

.request-card-header {
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 4;
  box-sizing: border-box;
  min-height: var(--request-sticky-header-height);
  margin: 0 -0.82rem;
  padding: 10px 0.82rem;
  border-radius: 18px 18px 0 0;
  background: var(--white);
}

.request-card-header h3 {
  margin: 0;
  overflow-wrap: anywhere;
}

.request-contact-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.38rem;
  margin: 0;
  font-size: 0.82rem;
}

.request-contact-pill {
  display: inline-grid;
  align-items: center;
  min-height: 1.9rem;
  max-width: 20rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0;
  background: rgba(255, 255, 255, 0.94);
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-contact-pill.editable-cell {
  grid-template-columns: minmax(8rem, 1fr) 2.08rem;
  gap: 0;
}

.request-contact-pill input {
  min-height: 1.45rem;
  min-width: 7rem;
  outline: none;
  border: 0;
  border-radius: 0;
  padding: 0.2rem 0.58rem 0.2rem 0.72rem;
  background: transparent;
  font-size: 0.86rem;
}

.request-contact-pill input:focus,
.request-contact-pill input:focus-visible {
  outline: 0;
  box-shadow: none;
}

.request-contact-pill:focus-within {
  border-color: rgba(13, 170, 145, 0.48);
  box-shadow: 0 0 0 2px rgba(13, 170, 145, 0.14);
}

.request-contact-send {
  align-self: stretch;
  min-width: 2.08rem;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  padding: 0 0.46rem;
  background: transparent;
  font-size: 0.82rem;
  line-height: 1;
}

.request-contact-send:disabled {
  background: rgba(231, 236, 242, 0.65);
}

.request-contact-pill.save-error {
  border-color: var(--danger);
}

.request-contact-pill-email {
  border-color: rgba(100, 116, 139, 0.28);
  color: var(--navy);
}

.request-contact-pill-whatsapp {
  border-color: rgba(13, 170, 145, 0.32);
  color: var(--teal-dark);
}

.request-contact-pill.request-contact-pill-invalid {
  border-color: var(--danger);
}

.request-context-group {
  display: grid;
  gap: 0.36rem;
}

.request-context-group h3,
.request-context-group h4,
.request-upload-group h2 {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.request-card-actions,
.request-drafts,
.channel-actions,
.channel-action-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.48rem;
}

.request-drafts {
  margin-top: 0.08rem;
}

.channel-action {
  white-space: nowrap;
}

.request-channel-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 0.48rem;
  padding-top: 0.64rem;
  border-top: 1px solid var(--line);
}

.channel-label {
  color: var(--muted);
  font-weight: 700;
}

.segmented-channel-actions {
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
}

.segmented-channel-actions .channel-action {
  border: 0;
  border-radius: 0;
  padding: 0.58rem 0.86rem;
}

.segmented-channel-actions .channel-action + .channel-action {
  border-left: 1px solid var(--line);
}

.channel-action-email {
  color: var(--navy);
}

.channel-action-email:hover {
  background: rgba(100, 116, 139, 0.10);
}

.channel-action-whatsapp {
  color: var(--teal-dark);
}

.channel-action-whatsapp:hover {
  background: rgba(13, 170, 145, 0.10);
}

.request-items-table {
  width: 100%;
  border: 1px solid var(--line);
  border-collapse: separate;
  border-radius: 18px;
  border-spacing: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(13, 170, 145, 0.08)) right / 2rem 100% no-repeat,
    var(--white);
  table-layout: fixed;
}

.request-counterparty-card .request-items-table {
  border-right: 0;
  border-left: 0;
  border-radius: 0;
}

.request-counterparty-card .request-items-table tbody tr:last-child td {
  border-bottom: 0;
}

.request-items-table th,
.request-items-table td {
  padding: 0.52rem 0.58rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.request-counterparty-card .request-items-table th {
  position: sticky;
  top: var(--request-sticky-header-height);
  z-index: 3;
  background: #f8fafc;
}

.request-items-table td textarea {
  min-height: 4.2rem;
}

.request-items-table-suggestions col:nth-child(1) {
  width: 3.2rem;
}

.request-items-table-suggestions col:nth-child(2),
.request-items-table-open col:nth-child(1) {
  width: 7.8rem;
}

.request-items-table-suggestions col:nth-child(3),
.request-items-table-open col:nth-child(2) {
  width: 6.4rem;
}

.request-items-table-suggestions col:nth-child(4),
.request-items-table-open col:nth-child(3) {
  width: auto;
}

.request-items-table-suggestions col:nth-child(5),
.request-items-table-open col:nth-child(4) {
  width: 9.4rem;
}

.request-items-table-suggestions col:nth-child(6),
.request-items-table-open col:nth-child(5) {
  width: 10rem;
}

.request-items-table-suggestions tr {
  position: relative;
}

.request-requested-at-cell {
  overflow: visible;
  white-space: nowrap;
}

.request-requested-at-content {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.request-row-dismiss-vat {
  flex: 0 0 auto;
}

.request-items-table-suggestions tr:hover .request-row-dismiss-vat,
.request-row-dismiss-vat:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

.request-row-dismiss-vat:hover {
  background: transparent;
}

.request-row-dismiss-vat.save-error {
  opacity: 1;
  outline: 2px solid rgba(204, 61, 61, 0.24);
}

.docreq-undo-toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  max-width: min(26rem, calc(100vw - 2rem));
  padding: 0.72rem 0.86rem;
  border: 1px solid rgba(21, 46, 43, 0.18);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1rem 2.5rem rgba(21, 46, 43, 0.16);
  font-size: 0.9rem;
}

.docreq-undo-toast-button {
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  padding: 0.34rem 0.72rem;
  font: inherit;
  font-weight: 700;
}

.docreq-undo-toast-button:hover,
.docreq-undo-toast-button:focus-visible {
  background: var(--accent);
}

.docreq-undo-toast.save-error {
  border-color: rgba(204, 61, 61, 0.38);
}

.request-issue-detail {
  margin-left: 0.22rem;
}

.request-description-cell,
.public-request-item-context span:last-child {
  overflow-wrap: anywhere;
}

.request-description-input {
  width: 100%;
  min-width: 0;
  height: 70px;
  min-height: 70px;
  overflow-y: hidden;
  resize: vertical;
}

.request-row-merged-description-warning .request-description-input {
  background: rgba(184, 121, 35, 0.14);
  border-color: rgba(184, 121, 35, 0.52);
}

.request-item-context {
  display: grid;
  grid-template-columns: 7rem 9rem 6rem minmax(12rem, 1fr);
  gap: 0.55rem;
  align-items: start;
  color: var(--ink);
  font-size: 0.9rem;
}

.public-request-item-context {
  grid-template-columns: minmax(0, 1fr) max-content max-content;
  gap: 0.75rem;
  padding: 0.35rem 0;
}

.public-request-date,
.public-request-amount {
  white-space: nowrap;
}

.public-upload-item {
  display: grid;
  gap: 1rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}

.public-upload-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.public-upload-item form {
  display: flex;
  flex-wrap: wrap;
  column-gap: calc(0.65rem + 10px);
  row-gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.45rem;
}

.request-reason {
  display: block;
  color: var(--warning-ink);
  font-size: 0.78rem;
  font-weight: 800;
}

.draft-preview-block {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
}

.draft-preview-block h2 {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.message-preview {
  margin: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.85rem;
  background: var(--white);
  color: var(--ink);
  white-space: pre-wrap;
}

.copyable-url {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.draft-action-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.document-add-form,
.document-add-fieldset {
  display: grid;
  gap: 0.45rem;
}

.document-add-form strong {
  color: var(--warning-ink);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.document-add-fieldset {
  grid-template-columns: 1fr;
}

.document-add-fieldset-wide {
  grid-template-columns: 1fr;
}

.warning-text {
  color: var(--danger);
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .workspace-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-nav-main,
  .workspace-nav-bottom {
    display: contents;
  }

  .workspace-header,
  .upload-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-header-side {
    justify-items: stretch;
  }

  .workspace-period-control {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .workspace-filter-form,
  .workspace-action-bar-split {
    flex-wrap: wrap;
    grid-template-columns: 1fr;
  }

  .user-chip {
    min-width: 0;
    text-align: left;
  }

  .logout-link {
    justify-self: start;
  }

  .summary-cards {
    grid-template-columns: 1fr;
  }

  .settings-panel,
  .settings-section-grid,
  .declarations-breakdown dl {
    grid-template-columns: 1fr;
    max-width: none;
  }
}
