/* Minimal and Functional Styles for PAVE Casebook Form */

:root {
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bg-color: #f7f9fa;
  --container-bg: #ffffff;
  --border-color: #d1d5db;
  --text-color: #1f2937;
  --text-muted: #6b7280;
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --tag-bg: #e0e7ff;
  --tag-text: #3730a3;
  --tag-new-bg: #fef3c7;
  --tag-new-text: #92400e;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.5;
  margin: 0;
  padding: 1.5rem 1rem;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  background-color: var(--container-bg);
  padding: 2rem 2.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

header {
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 1rem;
}

h1 {
  font-size: 1.6rem;
  margin: 0 0 0.5rem 0;
}

.subtitle {
  color: var(--text-muted);
  margin: 0;
}

fieldset {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  background-color: #fafbfc;
}

legend {
  font-weight: 600;
  font-size: 1.1rem;
  padding: 0 0.5rem;
  color: var(--text-color);
}

.section-desc {
  margin-top: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .col {
  flex: 1;
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

small {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: #ffffff;
  color: var(--text-color);
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--primary-color);
  border-color: transparent;
}

.checkbox-group,
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.checkbox-group.multi-col {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem 1rem;
}

.checkbox-group.multi-col-goals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.5rem 1rem;
}

.checkbox-group.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem 1rem;
}

.checkbox-group label,
.radio-group label {
  font-weight: normal;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.92rem;
  line-height: 1.35;
}

.checkbox-group input[type="checkbox"],
.radio-group input[type="radio"] {
  flex-shrink: 0;
  margin-top: 0.18rem;
}

/* Organisation Picker Component */
.org-picker {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.5rem;
}

.selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.85rem;
  gap: 0.35rem;
}

.tag-new {
  background: var(--tag-new-bg);
  color: var(--tag-new-text);
}

.tag button {
  background: none;
  border: none;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.picker-search-box {
  position: relative;
}

.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  margin-top: 2px;
}

.dropdown-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.9rem;
}

.dropdown-item:hover {
  background-color: #f3f4f6;
}

.dropdown-item.add-new {
  background-color: #fffbeb;
  color: #b45309;
}

.dropdown-item.add-new:hover {
  background-color: #fef3c7;
}

/* Repeater Lists */
.repeater-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.repeater-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.85rem;
}

.clickable-card {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.clickable-card:hover {
  border-color: #3b82f6;
  background-color: #f8fafc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.clickable-card:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.badge-edit {
  font-size: 0.72rem;
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.clickable-card:hover .badge-edit {
  background-color: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-remove {
  background: none;
  border: none;
  color: #dc2626;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

.btn-remove:hover {
  background-color: #fee2e2;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border-radius: 4px;
  cursor: pointer;
}

.btn-secondary:hover {
  background-color: #f3f4f6;
}

.form-actions {
  margin-top: 1.5rem;
}

.hidden {
  display: none !important;
}

/* Dialogs */
dialog {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 550px;
  width: 90vw;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* Specific wide & concise layout for Participant Modal */
#participantModal {
  max-width: 960px;
  width: 94vw;
  max-height: 92vh;
  overflow-y: auto;
  padding: 1.5rem 2rem;
}

#participantModal h3 {
  margin-top: 0;
  margin-bottom: 0.85rem;
  font-size: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

#participantModal .form-group {
  margin-bottom: 0.8rem;
}

#participantModal .form-row {
  margin-bottom: 0.8rem;
}

#participantModal .form-row .form-group {
  margin-bottom: 0;
}

#participantModal .checkbox-group.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem 1rem;
}

#participantModal .dialog-actions {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  position: sticky;
  bottom: 0;
  background-color: var(--container-bg);
  z-index: 5;
}

/* Status message */
.status-msg {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 4px;
  background-color: #f3f4f6;
}

.status-msg.success {
  background-color: #ecfdf5;
  border: 1px solid #10b981;
  color: #065f46;
}

.status-msg.error {
  background-color: #fef2f2;
  border: 1px solid #ef4444;
  color: #991b1b;
}

/* Edit Mode Banner */
.edit-banner {
  background-color: #eff6ff;
  border: 1px solid #93c5fd;
  border-left: 4px solid #2563eb;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.edit-banner-content strong {
  display: block;
  font-size: 1.05rem;
  color: #1e3a8a;
  margin: 0.25rem 0;
}

.edit-banner-content p {
  margin: 0;
  font-size: 0.9rem;
  color: #3b82f6;
}

.badge {
  display: inline-block;
  background-color: #2563eb;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.btn-cancel-edit {
  font-size: 0.85rem;
  color: #4b5563;
  text-decoration: underline;
  white-space: nowrap;
}

.edit-banner.error-banner {
  background-color: #fef2f2;
  border-color: #fca5a5;
  border-left-color: #ef4444;
}

.edit-banner.error-banner .badge {
  background-color: #ef4444;
}

.edit-banner.error-banner strong {
  color: #991b1b;
}

.edit-banner.error-banner p {
  color: #b91c1c;
}

.btn-cancel-edit:hover {
  color: #111827;
}

@media (max-width: 600px) {
  .edit-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* -------------------------------------------------------------
 * Multi-Stage Tabs & Progress
 * ------------------------------------------------------------- */
.stage-nav-container {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.stage-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 0.4rem;
}

.stage-progress-percent {
  color: #16a34a;
}

.stage-progress-track {
  width: 100%;
  height: 6px;
  background-color: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 0.85rem;
}

.stage-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563eb, #10b981);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.form-tabs-nav {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.form-tabs-list {
  display: flex;
  gap: 0.35rem;
  align-items: stretch;
  width: 100%;
}

.stage-tab-btn {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.35rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background-color: #f9fafb;
  color: #4b5563;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  min-width: 0;
}

.stage-tab-btn:hover {
  background-color: #f3f4f6;
  border-color: #d1d5db;
  color: #111827;
}

.stage-tab-btn.is-active {
  background-color: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
  font-weight: 600;
  box-shadow: 0 0 0 1px #2563eb;
}

.stage-tab-btn.is-complete {
  background-color: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.stage-tab-btn.is-complete.is-active {
  background-color: #dcfce7;
  border-color: #16a34a;
  box-shadow: 0 0 0 1px #16a34a;
  color: #15803d;
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  background-color: #e5e7eb;
  color: #6b7280;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.stage-tab-btn.is-active .tab-badge {
  background-color: #2563eb;
  color: #ffffff;
}

.stage-tab-btn.is-complete .tab-badge {
  background-color: #16a34a;
  color: #ffffff;
}

.tab-tick {
  display: none;
}

.stage-tab-btn.is-complete .tab-num {
  display: none;
}

.stage-tab-btn.is-complete .tab-tick {
  display: inline-block;
  font-size: 0.8rem;
  line-height: 1;
}

.stage-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #f3f4f6;
}

.stage-actions .btn-prev-stage,
.stage-actions .btn-next-stage {
  min-width: 120px;
}

/* Submission Success Screen */
.submission-success-card {
  background: #ffffff;
  border: 1px solid #d1fae5;
  border-top: 5px solid #10b981;
  border-radius: 8px;
  padding: 2.25rem 2rem;
  margin: 1.5rem 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.submission-success-card h2 {
  color: #065f46;
  font-size: 1.6rem;
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.submission-success-card p {
  color: #374151;
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.edit-link-container {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 1.25rem;
  margin: 1.5rem 0;
}

.edit-link-container label {
  display: block;
  font-weight: 600;
  color: #166534;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.edit-link-box {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.edit-link-input {
  flex: 1;
  padding: 0.65rem 0.75rem;
  font-family: monospace;
  font-size: 0.88rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  color: #1e293b;
  word-break: break-all;
}

.btn-copy-link {
  background-color: #0f766e;
  color: #ffffff;
  padding: 0.65rem 1.1rem;
  border: none;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.btn-copy-link:hover {
  background-color: #115e59;
}

.btn-copy-link.copied {
  background-color: #15803d;
}

.success-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e5e7eb;
}

/* Responsive adjustments for modals and multi-col groups */
@media (max-width: 800px) {
  #participantModal {
    padding: 1.25rem;
    width: 95vw;
  }

  #participantModal .checkbox-group.three-col {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 580px) {
  .checkbox-group.multi-col,
  .checkbox-group.multi-col-goals,
  .checkbox-group.three-col,
  #participantModal .checkbox-group.three-col {
    grid-template-columns: 1fr;
  }

  #participantModal {
    padding: 1rem;
    width: 96vw;
  }

  #participantModal .form-row {
    flex-direction: column;
    gap: 0.8rem;
  }
}

/* -------------------------------------------------------------
 * Outputs Stage: Messages (Actions, Recommendations, Quotes)
 * ------------------------------------------------------------- */
.messages-section {
  margin-top: 1.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.25rem;
  background-color: #fafbfc;
}

.messages-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #e5e7eb;
}

.messages-section-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #111827;
  display: block;
  margin-bottom: 0.25rem;
}

.messages-btn-toolbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-msg-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.btn-msg-icon {
  font-size: 1.1rem;
  line-height: 1;
  font-weight: bold;
}

.btn-add-issue {
  background-color: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.btn-add-issue:hover {
  background-color: #ede9fe;
  border-color: #8b5cf6;
}

.btn-add-action {
  background-color: #fffbeb;
  color: #b45309;
  border: 1px solid #fcd34d;
}

.btn-add-action:hover {
  background-color: #fef3c7;
  border-color: #f59e0b;
}

.btn-add-recommendation {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.btn-add-recommendation:hover {
  background-color: #d1fae5;
  border-color: #10b981;
}

.btn-add-quote {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.btn-add-quote:hover {
  background-color: #dbeafe;
  border-color: #3b82f6;
}

.messages-empty-state {
  text-align: center;
  padding: 2.25rem 1.5rem;
  background: #ffffff;
  border: 1px dashed #d1d5db;
  border-radius: 6px;
}

.messages-empty-state .empty-icon {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.messages-empty-state .empty-title {
  font-weight: 600;
  color: #374151;
  font-size: 1rem;
  margin: 0 0 0.4rem 0;
}

.messages-empty-state .empty-hint {
  font-size: 0.88rem;
  color: #6b7280;
  margin: 0 0 1.1rem 0;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

.messages-table-wrap {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  background-color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.messages-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.messages-table th {
  text-align: left;
  padding: 0.65rem 0.85rem;
  background-color: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
  color: #4b5563;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.messages-table td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

.messages-table tr:last-child td {
  border-bottom: none;
}

.messages-table tr:hover td {
  background-color: #fbfcfd;
}

.messages-table .col-type {
  width: 155px;
}

.messages-table .col-title {
  width: 190px;
}

.messages-table .col-actions {
  width: 45px;
  text-align: center;
}

.msg-type-select {
  width: 100%;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  outline: none;
  transition: all 0.15s ease;
}

.msg-type-select.type-issue {
  background-color: #ede9fe;
  color: #5b21b6;
  border-color: #c4b5fd;
}

.msg-type-select.type-action {
  background-color: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.msg-type-select.type-recommendation {
  background-color: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
}

.msg-type-select.type-quote {
  background-color: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
}

.msg-title-input {
  width: 100%;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.42rem 0.6rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #ffffff;
  color: #1f2937;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.msg-title-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
  outline: none;
}

.msg-text-input {
  width: 100%;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.45;
  padding: 0.45rem 0.65rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  resize: vertical;
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.msg-text-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
  outline: none;
}

.btn-remove-msg {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 1.35rem;
  line-height: 1;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-remove-msg:hover {
  color: #ef4444;
  background-color: #fee2e2;
}

.messages-table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background-color: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

.messages-counts-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
}

.count-pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-weight: 500;
  font-size: 0.75rem;
}

.pill-issue {
  background-color: #ede9fe;
  color: #5b21b6;
}

.pill-action {
  background-color: #fef3c7;
  color: #92400e;
}

.pill-rec {
  background-color: #d1fae5;
  color: #065f46;
}

.pill-quote {
  background-color: #dbeafe;
  color: #1e40af;
}

.count-total {
  font-weight: 600;
  color: #4b5563;
  margin-left: 0.25rem;
}

/* Paste Messages Modal */
#pasteMessagesModal {
  width: 90vw;
  max-width: 580px;
  padding: 1.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

#pasteMessagesModal .modal-instruction {
  font-size: 0.88rem;
  color: #4b5563;
  margin-top: 0;
  margin-bottom: 1.25rem;
}

#pasteMessagesModal textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.45;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  resize: vertical;
}

#pasteMessagesModal textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
  outline: none;
}

.paste-counter-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.35rem;
}

.paste-counter {
  font-size: 0.82rem;
  color: #6b7280;
  font-weight: 500;
}

@media (max-width: 640px) {
  .messages-header {
    flex-direction: column;
    align-items: stretch;
  }

  .messages-btn-toolbar {
    width: 100%;
  }

  .btn-msg-action {
    flex: 1;
    justify-content: center;
  }

  .messages-table .col-type {
    width: 120px;
  }

  .messages-table-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* -------------------------------------------------------------
 * Staff Auth Header Bar & Edit Banner Controls
 * ------------------------------------------------------------- */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.header-main {
  flex: 1 1 320px;
}

.staff-auth-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-staff-auth {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background-color: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-staff-auth:hover {
  background-color: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.staff-active-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.staff-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  display: inline-block;
}

.btn-staff-logout {
  background: none;
  border: none;
  color: #047857;
  font-size: 0.76rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0 0.15rem;
}

.btn-staff-logout:hover {
  color: #064e3b;
}

.edit-banner-badges {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.25rem;
}

.badge-staff {
  background-color: #059669;
  color: #ffffff;
}

.staff-workflow-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.65rem;
  background-color: #ffffff;
  border: 1px solid #bfdbfe;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
}

.staff-workflow-row label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e3a8a;
  white-space: nowrap;
}

.staff-workflow-select {
  width: auto;
  padding: 0.25rem 0.5rem;
  font-size: 0.84rem;
  font-weight: 600;
  border: 1px solid #93c5fd;
  border-radius: 4px;
  background-color: #f8fafc;
  color: #1e3a8a;
}

.edit-banner-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.btn-open-drawer {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background-color: #1e40af;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: background-color 0.15s ease;
}

.btn-open-drawer:hover {
  background-color: #1e3a8a;
}

.drawer-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 0.35rem;
  border-radius: 9999px;
  background-color: #dbeafe;
  color: #1e3a8a;
  font-size: 0.74rem;
  font-weight: 700;
}

/* -------------------------------------------------------------
 * Slide-Over Drawer (Comments & Revision History)
 * ------------------------------------------------------------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.35);
  z-index: 190;
  backdrop-filter: blur(1px);
}

.staff-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(460px, 92vw);
  height: 100vh;
  background-color: #ffffff;
  border-left: 1px solid var(--border-color);
  box-shadow: -8px 0 28px rgba(15, 23, 42, 0.18);
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.15rem 1.25rem 0.9rem;
  border-bottom: 1px solid #e5e7eb;
  background-color: #f8fafc;
}

.drawer-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #0f172a;
}

.drawer-subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: #64748b;
}

.btn-close-drawer {
  background: none;
  border: 1px solid transparent;
  color: #64748b;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
}

.btn-close-drawer:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.drawer-tabs {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
  background-color: #f8fafc;
  padding: 0 1.25rem;
  gap: 0.5rem;
}

.drawer-tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 0.5rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.86rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.drawer-tab-btn:hover {
  color: #1e293b;
}

.drawer-tab-btn.is-active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.drawer-tab-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 0.35rem;
  border-radius: 9999px;
  background-color: #e2e8f0;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 700;
}

.drawer-tab-btn.is-active .drawer-tab-pill {
  background-color: #dbeafe;
  color: #1d4ed8;
}

.drawer-permission-notice {
  margin: 0.75rem 1.25rem 0;
  padding: 0.65rem 0.85rem;
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  color: #92400e;
  font-size: 0.8rem;
  line-height: 1.4;
}

.drawer-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.drawer-comments-list,
.drawer-history-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.drawer-comment-card {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
}

.comment-card-meta,
.history-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.comment-author,
.history-author {
  font-size: 0.84rem;
  color: #1e293b;
}

.comment-date,
.history-date {
  font-size: 0.74rem;
  color: #64748b;
  white-space: nowrap;
}

.comment-card-body {
  font-size: 0.88rem;
  color: #334155;
  white-space: pre-wrap;
  word-break: break-word;
}

.drawer-comment-composer {
  padding: 0.9rem 1.25rem 1.15rem;
  border-top: 1px solid #e5e7eb;
  background-color: #f8fafc;
}

.drawer-comment-composer label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.35rem;
}

.drawer-comment-composer textarea {
  font-size: 0.88rem;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  resize: vertical;
}

.composer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.55rem;
}

.btn-sm {
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
}

.drawer-history-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #64748b;
  border-radius: 6px;
  padding: 0.7rem 0.85rem;
  font-size: 0.84rem;
}

.history-field-name {
  font-weight: 500;
  color: #334155;
  margin-bottom: 0.35rem;
}

.history-field-name code {
  background-color: #f1f5f9;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #0f172a;
}

.history-diff {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  background-color: #f8fafc;
  padding: 0.45rem 0.6rem;
  border-radius: 4px;
}

.diff-old {
  color: #991b1b;
  word-break: break-word;
}

.diff-new {
  color: #065f46;
  word-break: break-word;
}

.diff-label {
  font-weight: 600;
  margin-right: 0.25rem;
}

.history-desc {
  color: #475569;
  font-size: 0.83rem;
}

/* -------------------------------------------------------------
 * Initial About & Data Protection Landing Section
 * ------------------------------------------------------------- */
.about-landing-section {
  background-color: #fafbfc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.75rem 2rem;
}

.about-content-body {
  font-size: 0.96rem;
  color: #334155;
  line-height: 1.6;
}

.about-lead-question {
  font-size: 1.1rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 0.75rem 0;
}

.about-content-body h2 {
  font-size: 1.2rem;
  color: #0f172a;
  margin: 1.6rem 0 0.6rem 0;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #e2e8f0;
}

.about-content-body p {
  margin: 0 0 0.75rem 0;
}

.about-content-body ul {
  margin: 0 0 1rem 0;
  padding-left: 1.4rem;
}

.about-content-body li {
  margin-bottom: 0.35rem;
}

.about-content-body a {
  color: var(--primary-color);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.about-content-body a:hover {
  color: var(--primary-hover);
}

.about-disclosures-group {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.about-disclosure {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background-color: #ffffff;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.about-disclosure[open] {
  border-color: #93c5fd;
}

.about-disclosure summary {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: #1e3a8a;
  cursor: pointer;
  user-select: none;
}

.about-disclosure summary:hover {
  color: var(--primary-color);
  background-color: #f8fafc;
}

.about-disclosure::details-content {
  border-top: 1px solid #e2e8f0;
}

.about-disclosure-body {
  padding: 1rem 1.25rem;
  font-size: 0.94rem;
  color: #334155;
}

.about-disclosure-body p:last-child,
.about-disclosure-body ul:last-child {
  margin-bottom: 0;
}

.about-landing-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
}

.back-to-about-row {
  margin-bottom: 1rem;
}

.consent-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
}




