/* ==========================================================================
   องค์การบริหารส่วนจังหวัดลพบุรี — ระบบรับฟังความคิดเห็นต่อร่างข้อบัญญัติฯ
   Theme: Royal Navy (#0A2472 / #133494) + Warm Gold (#D97706 / #F59E0B)
   ========================================================================== */

:root {
  --navy-950: #061547;
  --navy-900: #0a2472;
  --navy-700: #133494;
  --navy-600: #1e40af;
  --navy-100: #e0e7ff;
  --navy-50: #eef2ff;

  --gold-600: #b45309;
  --gold-500: #d97706;
  --gold-400: #f59e0b;
  --gold-100: #fef3c7;
  --gold-50: #fffbeb;

  --emerald-600: #059669;
  --emerald-100: #d1fae5;
  --emerald-50: #ecfdf5;

  --amber-600: #d97706;
  --amber-100: #fef3c7;
  --amber-50: #fffbeb;

  --rose-600: #e11d48;
  --rose-100: #ffe4e6;
  --rose-50: #fff1f2;

  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;

  --bg-page: #f4f6fa;
  --surface: #ffffff;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 3px rgba(10, 36, 114, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px rgba(10, 36, 114, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(10, 36, 114, 0.14);

  --font-heading: 'Prompt', 'Sarabun', sans-serif;
  --font-body: 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--slate-900);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  margin: 0;
  line-height: 1.35;
}

p {
  margin: 0 0 0.75rem 0;
}

a {
  color: var(--navy-700);
  text-decoration: none;
}

/* ---------- Top Header & Navigation ---------- */
.site-header {
  background: linear-gradient(135deg, var(--navy-950) 0%, var(--navy-900) 55%, var(--navy-700) 100%);
  color: #ffffff;
  position: relative;
  overflow: hidden;
  border-bottom: 4px solid var(--gold-400);
}

.site-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 20%, rgba(245, 158, 11, 0.16), transparent 55%);
  pointer-events: none;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 1rem;
  position: relative;
  z-index: 1;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  width: 68px;
  height: 68px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 50%;
  padding: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.brand-text .org-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #ffffff;
}

.brand-text .org-en {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.78);
  letter-spacing: 0.03em;
}

.brand-text .doc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fde68a;
  font-size: 0.78rem;
  font-weight: 600;
}

.nav-tabs {
  display: flex;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.3rem;
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

.nav-tab {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.nav-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}

.nav-tab.active {
  background: #ffffff;
  color: var(--navy-900);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.hero-title-block {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-title-block h1 {
  font-size: 1.65rem;
  font-weight: 700;
  color: #ffffff;
}

.hero-title-block p {
  margin: 0.35rem 0 0;
  font-size: 0.98rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 820px;
}

/* ---------- Main Container & Banners ---------- */
.page-container {
  max-width: 980px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3.5rem;
}

.page-container--wide {
  max-width: 1120px;
}

.setup-banner {
  background: var(--gold-50);
  border: 1px solid #fcd34d;
  border-left: 5px solid var(--gold-500);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.15rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.93rem;
  color: #78350f;
}

.setup-banner strong {
  color: #451a03;
}

.setup-banner-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.hidden {
  display: none !important;
}

/* ---------- Progress Bar (Sticky on Form) ---------- */
.progress-bar-card {
  position: sticky;
  top: 0.65rem;
  z-index: 30;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.15rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-md);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy-900);
  margin-bottom: 0.45rem;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--slate-200);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--navy-700), var(--gold-400));
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* ---------- Form Cards & Section Headers ---------- */
.form-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--slate-200);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.section-header {
  background: linear-gradient(90deg, var(--navy-900) 0%, var(--navy-700) 100%);
  color: #ffffff;
  padding: 0.95rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 3px solid var(--gold-400);
}

.section-header h2 {
  font-size: 1.12rem;
  font-weight: 600;
}

.section-tag {
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.16);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
}

.card-body {
  padding: 1.5rem 1.4rem;
}

/* ---------- Inputs & Fields ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem;
}

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

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

.form-grid .form-group {
  margin-bottom: 0;
}

.col-span-2 {
  grid-column: span 2;
}

.field-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--slate-900);
  margin-bottom: 0.45rem;
}

.required-mark {
  color: var(--rose-600);
  margin-left: 0.2rem;
}

.field-hint {
  font-size: 0.85rem;
  color: var(--slate-500);
  margin-bottom: 0.5rem;
}

.text-input,
.textarea-input,
.search-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--slate-900);
  background: var(--slate-50);
  border: 1.5px solid var(--slate-300);
  border-radius: var(--radius-sm);
  padding: 0.68rem 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.text-input:focus,
.textarea-input:focus,
.search-input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--navy-700);
  box-shadow: 0 0 0 3px rgba(19, 52, 148, 0.14);
}

.textarea-input {
  min-height: 92px;
  resize: vertical;
}

.has-error .text-input,
.has-error .textarea-input {
  border-color: var(--rose-600);
  background: var(--rose-50);
}

.error-msg {
  display: none;
  color: var(--rose-600);
  font-size: 0.86rem;
  font-weight: 600;
  margin-top: 0.35rem;
}

.has-error .error-msg {
  display: block;
}

/* ---------- Option Cards (Checkboxes & Radios) ---------- */
.options-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.options-list--two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.option-card {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.72rem 0.95rem;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: var(--slate-50);
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.option-card:hover {
  border-color: var(--navy-700);
  background: #ffffff;
}

.option-card input {
  margin-top: 0.28rem;
  width: 18px;
  height: 18px;
  accent-color: var(--navy-700);
  flex-shrink: 0;
  cursor: pointer;
}

.option-card:has(input:checked),
.option-card.is-checked {
  background: var(--navy-50);
  border-color: var(--navy-700);
  box-shadow: 0 0 0 1px var(--navy-700);
}

.option-card span {
  font-size: 0.98rem;
  color: var(--slate-900);
}

.other-input-wrap {
  margin-top: 0.65rem;
  padding-left: 1.75rem;
}

/* ---------- Part 2: Opinion Matrix ---------- */
.matrix-intro {
  font-size: 0.95rem;
  color: var(--slate-600);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.matrix-table {
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.matrix-head {
  display: grid;
  grid-template-columns: minmax(280px, 1.9fr) repeat(4, minmax(92px, 1fr));
  background: var(--slate-100);
  border-bottom: 2px solid var(--slate-200);
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy-900);
}

.matrix-head > div {
  padding: 0.85rem 0.65rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.matrix-head > div:first-child {
  justify-content: flex-start;
  text-align: left;
  padding-left: 1rem;
}

.matrix-row {
  display: grid;
  grid-template-columns: minmax(280px, 1.9fr) repeat(4, minmax(92px, 1fr));
  border-bottom: 1px solid var(--slate-200);
  transition: background-color 0.15s ease;
}

.matrix-row:last-child {
  border-bottom: none;
}

.matrix-row:nth-child(even) {
  background: #fafbfd;
}

.matrix-row.has-error {
  background: var(--rose-50);
  outline: 1.5px solid var(--rose-600);
  outline-offset: -1.5px;
}

.matrix-issue {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.matrix-issue-title {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--navy-900);
  margin-bottom: 0.25rem;
}

.matrix-issue-desc {
  font-size: 0.92rem;
  color: var(--slate-700);
  line-height: 1.55;
}

.matrix-options {
  display: contents;
}

.matrix-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.4rem;
  border-left: 1px solid var(--slate-200);
  cursor: pointer;
  transition: background-color 0.15s ease;
  position: relative;
}

.matrix-choice:hover {
  background: var(--navy-50);
}

.matrix-choice input[type='radio'] {
  width: 20px;
  height: 20px;
  accent-color: var(--navy-700);
  cursor: pointer;
  margin: 0;
}

.matrix-choice .choice-mobile-label {
  display: none;
}

.matrix-choice.choice-agree:has(input:checked),
.matrix-choice.choice-agree.is-checked {
  background: var(--emerald-50);
}
.matrix-choice.choice-agree input {
  accent-color: var(--emerald-600);
}

.matrix-choice.choice-partial:has(input:checked),
.matrix-choice.choice-partial.is-checked {
  background: var(--amber-50);
}
.matrix-choice.choice-partial input {
  accent-color: var(--amber-600);
}

.matrix-choice.choice-disagree:has(input:checked),
.matrix-choice.choice-disagree.is-checked {
  background: var(--rose-50);
}
.matrix-choice.choice-disagree input {
  accent-color: var(--rose-600);
}

.matrix-choice.choice-neutral:has(input:checked),
.matrix-choice.choice-neutral.is-checked {
  background: var(--slate-100);
}
.matrix-choice.choice-neutral input {
  accent-color: var(--slate-600);
}

.matrix-row-error {
  grid-column: 1 / -1;
  padding: 0 1rem 0.75rem;
  margin-top: -0.25rem;
}

/* ---------- Part 3: Dynamic Contextual Hint ---------- */
.conditional-highlight {
  background: var(--amber-50);
  border: 1px solid #fcd34d;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  margin-bottom: 0.65rem;
  font-size: 0.9rem;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ---------- Signature & Confidentiality ---------- */
.signature-box {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 1.2rem;
}

.signature-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.signature-preview {
  background: #ffffff;
  border: 1px dashed var(--slate-300);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.96rem;
}

.signature-preview strong {
  color: var(--navy-900);
}

.privacy-note {
  background: var(--navy-50);
  border-left: 4px solid var(--navy-700);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
  color: var(--navy-900);
  margin-top: 1.25rem;
}

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.68rem 1.35rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all 0.18s ease;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(10, 36, 114, 0.25);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(10, 36, 114, 0.32);
}

.btn-gold {
  background: var(--gold-500);
  color: #ffffff;
}

.btn-gold:hover:not(:disabled) {
  background: var(--gold-600);
}

.btn-outline {
  background: #ffffff;
  color: var(--navy-900);
  border: 1.5px solid var(--slate-300);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--navy-700);
  background: var(--navy-50);
}

.btn-sm {
  font-size: 0.84rem;
  padding: 0.42rem 0.85rem;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.btn-submit-lg {
  padding: 0.9rem 2rem;
  font-size: 1.05rem;
}

/* ---------- Spinner & Modal ---------- */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.spinner--dark {
  border-color: rgba(10, 36, 114, 0.2);
  border-top-color: var(--navy-700);
  width: 28px;
  height: 28px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 21, 71, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  max-width: 480px;
  width: 100%;
  padding: 2rem 1.75rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border-top: 5px solid var(--emerald-600);
}

.modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--emerald-50);
  color: var(--emerald-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.modal-ref {
  display: inline-block;
  margin: 0.75rem 0 1.25rem;
  padding: 0.45rem 1rem;
  background: var(--slate-100);
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--navy-900);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Summary Dashboard ---------- */
.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.status-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.badge-live {
  background: var(--emerald-50);
  color: var(--emerald-600);
  border: 1px solid #a7f3d0;
}

.badge-local {
  background: var(--amber-50);
  color: #b45309;
  border: 1px solid #fcd34d;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.toolbar-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--navy-700);
}

.kpi-card--gold {
  border-top-color: var(--gold-500);
}

.kpi-card--emerald {
  border-top-color: var(--emerald-600);
}

.kpi-card--slate {
  border-top-color: var(--slate-600);
}

.kpi-label {
  font-size: 0.86rem;
  color: var(--slate-600);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--navy-900);
  line-height: 1.25;
}

.kpi-value--sm {
  font-size: 1.08rem;
}

.kpi-sub {
  font-size: 0.82rem;
  color: var(--slate-500);
  margin-top: 0.25rem;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
}

.chart-card--wide {
  grid-column: span 2;
}

.chart-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.chart-card-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy-900);
}

.chart-card-header span {
  font-size: 0.84rem;
  color: var(--slate-500);
}

.chart-wrap {
  position: relative;
  height: 300px;
}

.chart-wrap--tall {
  height: 340px;
}

/* ---------- Breakdown Table ---------- */
.table-scroll {
  overflow-x: auto;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.summary-table th,
.summary-table td {
  padding: 0.8rem 0.75rem;
  border-bottom: 1px solid var(--slate-200);
  text-align: center;
}

.summary-table th {
  background: var(--slate-100);
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--navy-900);
  white-space: nowrap;
}

.summary-table th:first-child,
.summary-table td:first-child {
  text-align: left;
  min-width: 240px;
}

.pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
}

.pill-agree {
  background: var(--emerald-50);
  color: var(--emerald-600);
}

.pill-partial {
  background: var(--amber-50);
  color: var(--amber-600);
}

.pill-disagree {
  background: var(--rose-50);
  color: var(--rose-600);
}

.pill-neutral {
  background: var(--slate-100);
  color: var(--slate-600);
}

/* ---------- Suggestions & Comments ---------- */
.tabs-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.tabs-bar {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.tab-btn {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  border: 1.5px solid var(--slate-200);
  background: var(--slate-50);
  color: var(--slate-700);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.tab-btn.active {
  background: var(--navy-900);
  border-color: var(--navy-900);
  color: #ffffff;
}

.tab-count {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(15, 23, 42, 0.08);
}

.tab-btn.active .tab-count {
  background: rgba(255, 255, 255, 0.22);
}

.search-wrap {
  min-width: 240px;
  flex: 0 1 300px;
}

.comments-list {
  display: grid;
  gap: 0.85rem;
}

.comment-card {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-left: 4px solid var(--navy-700);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.1rem;
}

.comment-text {
  font-size: 0.98rem;
  color: var(--slate-900);
  white-space: pre-wrap;
  margin-bottom: 0.5rem;
}

.comment-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--slate-500);
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--slate-500);
}

.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 1rem;
  color: var(--slate-600);
}

/* ---------- Staff Auth Gate ---------- */
.auth-gate-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 0 2.5rem;
}

.auth-gate-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--slate-200);
  border-top: 5px solid var(--navy-900);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 2rem 1.75rem;
  text-align: center;
}

.auth-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--navy-50);
  color: var(--navy-900);
  border: 2px solid var(--navy-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

.auth-gate-card h2 {
  font-size: 1.3rem;
  color: var(--navy-900);
  margin-bottom: 0.45rem;
}

.auth-gate-subtitle {
  font-size: 0.94rem;
  color: var(--slate-600);
  margin-bottom: 1.25rem;
}

.auth-form {
  text-align: left;
}

.auth-error {
  margin-top: 0.65rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--rose-50);
  border: 1px solid #fecdd3;
  color: var(--rose-600);
  font-size: 0.9rem;
  font-weight: 600;
}

.auth-local-hint {
  margin-top: 1.15rem;
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-sm);
  background: var(--gold-50);
  border: 1px solid #fde68a;
  color: #78350f;
  font-size: 0.88rem;
  text-align: left;
}

.auth-local-hint code {
  font-weight: 700;
  color: var(--navy-900);
  background: rgba(255, 255, 255, 0.8);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--slate-500);
  font-size: 0.86rem;
  border-top: 1px solid var(--slate-200);
  background: #ffffff;
}

/* ---------- Responsive Breakpoints ---------- */
@media (max-width: 900px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .chart-card--wide {
    grid-column: span 1;
  }
}

@media (max-width: 767px) {
  .form-grid,
  .options-list--two-col,
  .signature-meta-grid {
    grid-template-columns: 1fr;
  }
  .col-span-2 {
    grid-column: span 1;
  }
  .hero-title-block h1 {
    font-size: 1.35rem;
  }
  .brand-logo {
    width: 56px;
    height: 56px;
  }

  /* Responsive Part 2 Opinion Matrix -> Stacked Cards with 2x2 Grid */
  .matrix-head {
    display: none;
  }
  .matrix-table {
    border: none;
    display: grid;
    gap: 1rem;
  }
  .matrix-row {
    display: block;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    background: #ffffff !important;
    overflow: hidden;
  }
  .matrix-issue {
    border-bottom: 1px solid var(--slate-200);
    background: var(--slate-50);
  }
  .matrix-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    padding: 0.85rem;
  }
  .matrix-choice {
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius-sm);
    justify-content: flex-start;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    background: #ffffff;
  }
  .matrix-choice .choice-mobile-label {
    display: inline;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--slate-800);
  }
  .matrix-choice:has(input:checked),
  .matrix-choice.is-checked {
    border-color: currentColor;
  }
}

@media (max-width: 520px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .card-body {
    padding: 1.15rem 1rem;
  }
  .nav-tabs {
    width: 100%;
    justify-content: space-between;
  }
  .nav-tab {
    flex: 1;
    justify-content: center;
    font-size: 0.84rem;
    padding: 0.45rem 0.65rem;
  }
}

/* ---------- Draft Ordinance Callout Card ---------- */
.draft-doc-card {
  background: linear-gradient(135deg, #ffffff 0%, var(--gold-50) 100%);
  border: 1px solid #fcd34d;
  border-left: 5px solid var(--gold-500);
  border-radius: var(--radius-md);
  padding: 1.05rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.draft-doc-info {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex: 1 1 320px;
}

.draft-doc-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--gold-100);
  color: var(--gold-600);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.draft-doc-title {
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--navy-900);
  margin-bottom: 0.15rem;
}

.draft-doc-desc {
  font-size: 0.92rem;
  color: var(--slate-700);
  margin: 0;
}

.draft-doc-btn {
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}

.draft-doc-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(180, 83, 9, 0.3);
}

@media (max-width: 640px) {
  .draft-doc-btn {
    width: 100%;
  }
}

/* ---------- Print Styles ---------- */
@media print {
  body {
    background: #ffffff;
    color: #000000;
    font-size: 13px;
  }
  .site-header {
    background: #0a2472 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .nav-tabs,
  .toolbar-actions,
  .setup-banner,
  .draft-doc-btn,
  .search-wrap,
  .auth-gate-wrap,
  .no-print {
    display: none !important;
  }
  .page-container,
  .page-container--wide {
    max-width: 100%;
    padding: 0.5rem 0;
  }
  .chart-card,
  .kpi-card,
  .form-card {
    box-shadow: none;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .charts-grid {
    grid-template-columns: 1fr 1fr;
  }
}
