/* Review-first field comments. Disclosure is native: collapsing the composer
   leaves its text and selected-item checkbox intact, without a page render. */
html .my-day-comments .my-day-comment-composer {
  flex: 0 0 auto;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--my-day-line, var(--line));
  border-radius: 10px;
  color: var(--my-day-ink, var(--text));
  background: var(--my-day-card-subtle, var(--surface-solid));
}
html .my-day-comment-composer > summary {
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--my-day-card-subtle, var(--surface-solid));
  font: 600 12px/1.4 var(--font-ui);
  cursor: pointer;
  list-style: none;
}
html .my-day-comment-composer > summary::-webkit-details-marker { display: none; }
html .my-day-comment-composer > summary > span { flex: 1; min-width: 0; }
html .my-day-comment-composer > summary small { color: var(--my-day-muted, var(--muted)); font-size: 11px; font-weight: 500; }
html .my-day-comment-composer > summary svg { width: 16px; height: 16px; flex-shrink: 0; }
html .my-day-comment-composer[open] > summary svg { transform: rotate(180deg); }
html .my-day-comment-composer:not([open]) .when-open,
html .my-day-comment-composer[open] .when-closed { display: none; }
html .my-day-comment-composer > summary:focus-visible { outline: 2px solid var(--blue); outline-offset: -3px; }
html .my-day-comment-composer > .my-day-comment-form { border: 0; margin: 0; border-radius: 0 0 10px 10px; }
html .my-day-comment-composer .my-day-comment-form label:first-child > span { font-size: 11px; font-weight: 600; }
html .my-day-comment-composer .my-day-change-recorder small {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  font-weight: 450;
  font-size: 11px;
  line-height: 1.45;
}

/* Let the log use the recovered space; bound an expanded form independently
   so review actions and the collapse control stay reachable on short screens. */
html .my-day-designer-comments-panel:has(.my-day-comment-composer) {
  height: min(78dvh, 720px);
  max-height: calc(100dvh - 100px);
  display: flex;
  flex-direction: column;
}
html .my-day-designer-comments-panel > header { flex: 0 0 auto; }
html .my-day-designer-comments-panel .my-day-comments:has(.my-day-comment-composer),
html .my-day-review-overlay .my-day-comments.is-overlay:has(.my-day-comment-composer) {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
html :is(.my-day-designer-comments-panel, .my-day-review-overlay) .my-day-comments:has(.my-day-comment-composer) > .my-day-comment-list {
  flex: 1 1 72px;
  min-height: 72px;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
}
html :is(.my-day-designer-comments-panel, .my-day-review-overlay) .my-day-comment-composer[open] {
  flex-shrink: 0;
  max-height: min(48dvh, 420px);
  overflow-y: auto;
  scrollbar-gutter: stable;
}
html .my-day-comments .my-day-proposal-decision {
  padding: 10px;
  border: 1px solid var(--my-day-line, var(--line));
  border-radius: 9px;
  background: var(--my-day-card-solid, var(--surface-solid));
}
html .my-day-comments .my-day-comment-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 6px 10px;
}
html .my-day-comment-meta > time { grid-column: 2; grid-row: 1; text-align: right; }
html .my-day-comment-meta > .my-day-comment-proposal-status {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: start;
  flex: none;
  height: auto;
  min-height: 26px;
  margin: 0;
  gap: 10px;
}
html .my-day-comment-proposal-status :is(strong, span) { font-size: 10px; font-weight: 600; }
html .my-day-proposal-delta > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
html .my-day-proposal-decision .my-day-comment-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin: 0;
}
html .my-day-proposal-decision .my-day-comment-action {
  min-height: 40px;
  height: auto;
  min-width: 0;
  padding: 8px;
  white-space: normal;
  font: 600 12px/1.4 var(--font-ui);
}
html .my-day-proposal-decision button:disabled { opacity: .55; cursor: not-allowed; }
html .my-day-proposal-decision > p {
  margin: 8px 0 0;
  color: var(--my-day-muted, var(--muted));
  font: 450 11px/1.45 var(--font-ui);
}
@media (max-width: 700px), (max-height: 500px) {
  html :is(.my-day-designer-comments-panel, .my-day-review-overlay) .my-day-comment-composer[open] { max-height: 42dvh; }
  html .my-day-proposal-decision .my-day-comment-action { min-height: 44px; }
  html .my-day-comment-composer > summary { flex-wrap: wrap; }
}
