/* Tender discussion: a persistent desktop dock and a modal mobile panel. */
:root { --comments-panel-width: 390px; }

/* Use one viewport anchor for the navigation, workspace and discussion dock. */
body > .product-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
}
body > .product-header + .workspace {
  padding-top: var(--product-header-height, 56px);
}

.comments-toggle { white-space: nowrap; }
.comments-toggle[aria-expanded="true"] {
  border-color: #cbd4ff;
  background: var(--blue-light, #eef1ff);
  color: var(--blue, #3d5af1);
}
.comments-toggle-count,
.comments-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 6px;
  background: #f0f2f6;
  color: #657185;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.comments-toggle[aria-expanded="true"] .comments-toggle-count {
  background: #dfe5ff;
  color: #354fd8;
}

.comments-panel {
  --comments-panel-top: var(--product-header-height, 56px);
  position: fixed;
  z-index: 80;
  top: var(--comments-panel-top);
  right: 0;
  bottom: auto;
  height: calc(100vh - var(--comments-panel-top));
  height: calc(100dvh - var(--comments-panel-top));
  display: flex;
  flex-direction: column;
  width: var(--comments-panel-width);
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-left: 1px solid var(--border, #e6eaf0);
  background: #fff;
  color: var(--text, #344256);
  box-shadow: -6px 0 24px #172b4d05;
}
.comments-panel[hidden],
.comments-backdrop[hidden],
#comments-backdrop[hidden] { display: none !important; }

/* One scroll area keeps all content reachable when the viewport is short. */
.comments-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #d6dce6 transparent;
}

.comments-header {
  position: relative;
  flex: 0 0 auto;
  padding: 24px 24px 20px;
  border-bottom: 1px solid var(--border, #e6eaf0);
}
.comments-heading-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 30px;
  padding-right: 38px;
}
.comments-heading-row h2 {
  margin: 0;
  color: var(--ink, #192634);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -.35px;
  line-height: 1.4;
}
.comments-close {
  position: absolute;
  top: 22px;
  right: 18px;
}
.comments-tender-title {
  margin: 18px 0 5px;
  color: #2d394b;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.comments-tender-buyer {
  margin: 0;
  color: #798497;
  font-size: 12px;
  line-height: 1.5;
}

.comments-composer {
  flex: 0 0 auto;
  margin: 0;
  padding: 22px 24px 21px;
  border-bottom: 1px solid var(--border, #e6eaf0);
}
.comments-composer textarea {
  display: block;
  width: 100%;
  min-height: 102px;
  max-height: 180px;
  margin: 0;
  padding: 12px 13px;
  resize: vertical;
  border: 1px solid #dce1e9;
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--ink, #192634);
  font: inherit;
  font-size: 13px;
  line-height: 1.65;
}
.comments-composer textarea::placeholder { color: #98a1af; opacity: 1; }
.comments-composer textarea:focus {
  border-color: #9caaf9;
  box-shadow: 0 0 0 3px #3d5af112;
}
.comments-composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.comments-local-note {
  min-width: 0;
  max-width: 190px;
  color: #8390a1;
  font-size: 11px;
  line-height: 1.5;
}
.comments-composer-footer .btn { flex: 0 0 auto; min-height: 34px; }
.comments-composer-footer .btn.primary { border-color: #087f63; background: #087f63; color: #fff; }
.comments-composer-footer .btn.primary:hover:not(:disabled) { border-color: #06664f; background: #06664f; }
.comments-composer-footer .btn:disabled { opacity: .45; cursor: not-allowed; }

.comments-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  gap: 12px;
  padding: 19px 24px 13px;
}
.comments-list-toolbar h3 {
  margin: 0;
  color: #49566a;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}
#comments-open-count {
  color: #8993a3;
  font-size: 11px;
  line-height: 1.5;
  text-align: right;
}
.comments-list {
  min-width: 0;
}
.comment-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 12px;
  row-gap: 13px;
  margin: 0 24px;
  padding: 19px 0 20px;
  border-bottom: 1px solid #edf0f4;
}
.comment-item:last-child { border-bottom: 0; }
.comment-author-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
}
.comment-author-row .avatar { flex: 0 0 auto; width: 32px; height: 32px; font-size: 10px; }
.comment-author-meta { display: flex; flex-direction: column; min-width: 0; gap: 3px; }
.comment-author-meta strong {
  color: #087f63;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.comment-author-meta time {
  color: #8c96a5;
  font-size: 10px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
.comment-status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  grid-column: 2;
  grid-row: 1;
  min-height: 32px;
  cursor: pointer;
  user-select: none;
}
.comment-status input {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin: 0;
  border-radius: 3px;
  accent-color: var(--green, #15825c);
  cursor: pointer;
}
.comment-status input:focus-visible {
  outline: 2px solid var(--blue, #3d5af1);
  outline-offset: 3px;
}
.comment-status-text { color: #8691a0; font-size: 10px; font-weight: 500; line-height: 1.4; }
.comment-status input:checked + .comment-status-text { color: #258261; }
.comment-body {
  grid-column: 1 / -1;
  margin: 0;
  color: #566278;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.comments-panel-foot {
  flex: 0 0 auto;
  margin: 0;
  padding: 14px 24px max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border, #e6eaf0);
  background: #fbfcfe;
  color: #8b96a6;
  font-size: 11px;
  line-height: 1.55;
}
.comments-empty {
  padding: 38px 28px;
  color: #8b96a6;
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}
.comments-empty svg { width: 28px; height: 28px; margin-bottom: 10px; color: #a8b2c2; }
.comments-empty h3 { margin: 0 0 5px; color: #5a677b; font-size: 14px; font-weight: 600; }
.comments-empty p { margin: 0; }
.comments-backdrop,
#comments-backdrop {
  position: fixed;
  z-index: 75;
  inset: 0;
  border: 0;
  padding: 0;
  background: #1c2b433b;
}

@media (min-width: 1280px) {
  body.comments-open .workspace { padding-right: var(--comments-panel-width); }
  .comments-backdrop,
  #comments-backdrop { display: none !important; }
}

/* The dock reduces available content width; keep its neighboring cards legible. */
@media (min-width: 1280px) and (max-width: 1550px) {
  body.comments-open .main-content { padding-inline: 24px; }
  body.comments-open .workspace > .topbar { padding-inline: 24px; }
  body.comments-open .overview-grid,
  body.comments-open .submission-grid { grid-template-columns: minmax(0, 1fr); }
  body.comments-open .overview-grid > .right-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 18px;
  }
  body.comments-open .workflow { gap: 12px; }
  body.comments-open .workflow-step,
  body.comments-open .workflow-step:last-child { flex: 1; gap: 7px; }
  body.comments-open .step-copy small,
  body.comments-open .step-line { display: none; }
  body.comments-open .hero-heading { align-items: flex-start; }
  body.comments-open .hero-heading h1 { font-size: 28px; }
  body.comments-open .hero-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 0; }
  body.comments-open .hero-meta .meta-item:nth-child(odd) { padding-left: 0; border-left: 0; }
  body.comments-open .hero-meta .meta-item:nth-child(even) { padding-left: 20px; }
  body.comments-open .hero-meta .meta-item strong { white-space: normal; }
  body.comments-open .reference-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.comments-open .document-row { flex-wrap: wrap; }
  body.comments-open .document-actions { margin-left: 45px; }
}

@media (max-width: 1279px) {
  body.comments-modal { overflow: hidden; }
  .comments-panel {
    width: min(420px, 100%);
    box-shadow: -12px 0 50px #172b4d1a;
  }
}
@media (max-width: 760px) {
  .comments-panel { --comments-panel-top: 0px; }
  .comments-backdrop,
  #comments-backdrop { inset: 0; }
}
@media (max-width: 480px) {
  .comments-header { padding: 19px 20px 16px; }
  .comments-close { top: 16px; right: 14px; }
  .comments-tender-title { margin-top: 13px; }
  .comments-composer { padding: 17px 20px; }
  .comments-composer textarea { min-height: 88px; max-height: 140px; font-size: 16px; }
  .comments-list-toolbar { padding: 15px 20px 9px; }
  .comment-item { margin-inline: 20px; }
  .comments-panel-foot { padding-inline: 20px; }
  .comments-local-note { font-size: 10px; }
  .comments-toggle { gap: 5px; padding-inline: 9px; }
}
@media (max-height: 650px) {
  .comments-tender-title { margin-top: 10px; }
  .comments-header { padding-top: 14px; padding-bottom: 12px; }
  .comments-close { top: 12px; }
  .comments-composer { padding-top: 13px; padding-bottom: 13px; }
  .comments-composer textarea { min-height: 68px; max-height: 96px; }
  .comments-list-toolbar { padding-top: 12px; padding-bottom: 6px; }
  .comments-panel-foot { padding-top: 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .comments-panel,
  .comments-backdrop,
  #comments-backdrop,
  .comments-toggle { animation: none; transition: none; }
}
