/* Client reply popover (templates/_client_response.html) and the ad follow-up sections. */
.resp-pop { position: relative; display: inline-block; }
.resp-pop > summary { list-style: none; cursor: pointer; }
.resp-pop > summary::-webkit-details-marker { display: none; }
.resp-pop .resp-form {
  position: absolute; z-index: 40; top: calc(100% + 6px); inset-inline-end: 0;
  width: min(300px, 86vw); display: grid; gap: 10px; padding: 14px;
  background: var(--navy-lighter); border: 1px solid var(--primary); border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .45); text-align: start;
}
.resp-pop-inline { display: block; }
.resp-pop-inline .resp-form { position: static; width: 100%; max-width: 420px; margin-top: 10px; box-shadow: none; }
.resp-title { font-weight: 800; color: var(--heading); font-size: 14px; }
.resp-field { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); }
.resp-field textarea, .resp-field input {
  width: 100%; font: inherit; font-size: 13.5px; color: var(--text);
  background: rgba(255, 255, 255, .04); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
}
.resp-field textarea:focus-visible, .resp-field input:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.resp-req { color: var(--amber); font-size: 11.5px; }
.resp-opt { color: var(--muted); font-size: 11.5px; }
.publish-month { font-weight: 800; color: var(--sky); margin: 18px 0 8px; font-size: 13.5px; }
.publish-count { display: inline-block; min-width: 22px; padding: 0 8px; border-radius: 999px; background: rgba(0, 174, 239, .15); color: var(--primary); font-size: 12px; text-align: center; margin-inline-start: 8px; }
/* Cards clip their content (overflow:hidden); let an open reply form escape the card. */
.post-card:has(.resp-pop[open]), .card:has(.resp-pop[open]) { overflow: visible; position: relative; z-index: 30; }
@media (max-width: 600px) {
  .resp-pop:not(.resp-pop-inline)[open] .resp-form {
    position: fixed; inset-inline: 10px; bottom: 10px; top: auto; width: auto; max-height: 80vh; overflow-y: auto; z-index: 1000;
  }
}
/* Change request (yellow) vs full rejection (red) in the reply popover. */
.resp-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.resp-choice label { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-size: 13px; color: var(--text); }
.resp-choice small { color: var(--muted); font-size: 11px; }
.resp-choice input { position: absolute; opacity: 0; pointer-events: none; }
.resp-choice label:has(input:checked).resp-opt-changes { border-color: var(--amber); background: rgba(245, 158, 11, .12); }
.resp-choice label:has(input:checked).resp-opt-declined { border-color: var(--danger); background: rgba(248, 113, 113, .12); }
.resp-choice label:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 1px; }

/* ---- Content groups (app/planning/groups.py): production board, returned cards, archive ---- */
.post-card.rev-changes { box-shadow: inset -4px 0 0 var(--amber); border-color: rgba(245, 158, 11, .45); }
.post-card.rev-declined { box-shadow: inset -4px 0 0 var(--danger); border-color: rgba(248, 113, 113, .5); }
.rev-tag-changes { background: rgba(245, 158, 11, .15) !important; color: var(--amber) !important; }
.rev-tag-declined { background: rgba(248, 113, 113, .15) !important; color: var(--danger) !important; }
.rev-note { font-size: 13px; color: var(--text); background: rgba(255, 255, 255, .04); border-radius: 8px; padding: 6px 9px; margin-top: 6px; overflow-wrap: anywhere; }
.board-section { padding: 16px 18px; }
.board-section .collapsible-head { width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: 0; color: inherit; font: inherit; padding: 0; text-align: start; }
.board-section .collapsible-head .hint { margin-inline-start: auto; }
.board-section-title { font-weight: 800; font-size: 16px; color: var(--heading); }
.board-section .collapsible-body { margin-top: 14px; }
.board-group { border-top: 1px solid var(--border); padding: 14px 0 6px; }
.board-group:first-child { border-top: 0; padding-top: 0; }
.board-group-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.board-progress { display: flex; align-items: center; gap: 8px; }
.board-progress-bar { display: inline-block; width: 110px; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.board-progress-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary-dark), var(--primary)); border-radius: inherit; }
.board-alert { background: rgba(245, 158, 11, .1); border: 1px solid rgba(245, 158, 11, .35); color: var(--text); border-radius: 10px; padding: 9px 12px; font-size: 13.5px; margin-bottom: 10px; }
.board-hint, .board-delivered { margin: 0 0 10px; }
.group-line { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13.5px; color: var(--muted); margin: 0 0 12px; }
.group-line strong { color: var(--text); }
.card-color-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; }
.post-card[data-card-color] { border-top: 3px solid var(--card-color, transparent); }
.returned-group { margin-bottom: 16px; }
.returned-group-title { font-weight: 800; color: var(--heading); margin: 0 0 10px; font-size: 14.5px; }
.group-archive table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.group-archive th, .group-archive td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: start; }
.group-archive th { color: var(--muted); font-weight: 700; font-size: 12.5px; }
.group-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; margin-inline-end: 4px; background: rgba(255, 255, 255, .06); color: var(--muted); }
.group-chip.is-changes { background: rgba(245, 158, 11, .15); color: var(--amber); }
.group-chip.is-declined { background: rgba(248, 113, 113, .15); color: var(--danger); }
.group-chip.is-final { background: rgba(0, 174, 239, .15); color: var(--primary); }

/* ---- Services: six main services, documents, client wizard ---- */
.cat-code { display: inline-block; font-size: 11px; font-weight: 800; color: var(--primary); background: rgba(0, 174, 239, .12); border-radius: 6px; padding: 0 6px; margin-inline-end: 4px; }
.doc-templates { margin-top: 14px; }
.doc-templates > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; padding: 4px 2px; }
.doc-templates-form { margin-top: 12px; display: grid; gap: 4px; }
.doc-templates-form textarea { width: 100%; font-family: inherit; line-height: 1.8; }
.doc-templates-form code { background: rgba(255, 255, 255, .06); padding: 0 5px; border-radius: 5px; }
.wizard-services { display: grid; gap: 10px; }
.wizard-cat { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
.wizard-cat > summary { cursor: pointer; font-weight: 800; color: var(--heading); display: flex; gap: 8px; align-items: center; }
.wizard-cat > summary .hint { font-weight: 400; margin-inline-start: auto; }
.wizard-cat-services { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; margin-top: 10px; }
.wizard-cat-services label { display: flex; gap: 8px; align-items: center; font-size: 14px; padding: 4px 0; }
.wizard-doc-note { font-size: 12.5px; color: var(--amber); margin-top: 6px; }
.docs-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.docs-table th, .docs-table td { padding: 10px; border-bottom: 1px solid var(--border); text-align: start; vertical-align: middle; }
.docs-table th { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.doc-status { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; }
.doc-status.is-missing { background: rgba(248, 113, 113, .14); color: var(--danger); }
.doc-status.is-sent { background: rgba(245, 158, 11, .15); color: var(--amber); }
.doc-status.is-received { background: rgba(0, 174, 239, .14); color: var(--primary); }
.doc-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.docs-alert { background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .4); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; color: var(--text); }
.docs-alert strong { color: var(--danger); }
.doc-print { background: #fff; color: #111; padding: 48px 56px; border-radius: 6px; max-width: 820px; margin: 0 auto; line-height: 2; white-space: pre-wrap; font-size: 15px; }
.doc-print h1 { font-size: 20px; text-align: center; margin: 0 0 24px; color: #111; white-space: normal; }
@media print { .doc-print { padding: 0; max-width: none; } }
.doc-status { white-space: nowrap; }
@media (max-width: 640px) {
  .docs-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .docs-table tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
  .docs-table td { border: 0; padding: 0; }
  .docs-table td:nth-child(1) { font-weight: 800; }
  .docs-table td:nth-child(2) { grid-column: 1; color: var(--muted); }
  .docs-table td:nth-child(3) { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .docs-table td:nth-child(4) { grid-column: 1 / -1; margin-top: 6px; }
}
.demo-banner { position: sticky; top: 0; z-index: 2000; background: var(--amber); color: #1a1200; text-align: center; font-weight: 800; font-size: 13.5px; padding: 6px 12px; }
