:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #f0f2f5;
  --surface: #ffffff;
  --surface-muted: #e8ecf2;
  --surface-elevated: #ffffff;
  --text: #141a26;
  --text-muted: #4d596d;
  --border: #d0d7e2;
  --primary: #1f5fbf;
  --primary-hover: #184f9f;
  --secondary: #e8ecf2;
  --secondary-hover: #dce2eb;
  --outline: #1f5fbf;
  --outline-hover: #184f9f;
  --danger: #b42318;
  --danger-muted: #9a3412;
  --danger-bg: #fef3f2;
  --danger-border: #f0baa8;
  --accent-emergency: #b42318;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 12px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 8px 28px rgba(16, 24, 40, 0.1);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--primary) 35%, transparent);
  --radius: 10px;
  --radius-lg: 14px;
  --max-width: 1200px;
  --max-width-wide: 1320px;
  --font-sans: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.35rem;
  --text-2xl: 1.75rem;
  --text-3xl: clamp(2rem, 4vw, 2.75rem);
  --leading-tight: 1.25;
  --space-section: 3.5rem;
  --card-padding: 1.5rem;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121820;
  --surface: #1a2230;
  --surface-muted: #1f2836;
  --surface-elevated: #222c3c;
  --text: #edf2f7;
  --text-muted: #a8b3c5;
  --border: #2e3a4d;
  --primary: #5b9cf5;
  --primary-hover: #7ab0f7;
  --secondary: #243041;
  --secondary-hover: #2c3a4d;
  --outline: #7ab0f7;
  --outline-hover: #9ec5ff;
  --danger: #f97066;
  --danger-muted: #fca5a5;
  --danger-bg: #2d1818;
  --danger-border: #7a3f28;
  --accent-emergency: #f97066;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.35);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--primary) 40%, transparent);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  line-height: 1.25;
}

p {
  margin: 0 0 1rem;
}

.mb-0 {
  margin-bottom: 0;
}

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

.container.narrow {
  max-width: 720px;
}

.form-section {
  border: 0;
  margin: 0 0 1.5rem;
  padding: 0;
}

.form-section legend {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
  padding: 0;
}

textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  resize: vertical;
}

textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.checkbox-group {
  margin-top: 0.25rem;
}

.checkbox-label {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  font-weight: 400;
  line-height: 1.45;
}

.checkbox-label input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.request-number {
  font-size: 1.1rem;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  padding: 0.75rem 0.65rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  font-weight: 600;
  color: var(--text-muted);
}

.data-table a {
  font-weight: 600;
}

.filter-bar {
  margin-bottom: 1rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  align-items: end;
}

.filter-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.detail-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.detail-list dt {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
  text-transform: capitalize;
}

.detail-list dd {
  margin: 0;
}

.detail-list-plain {
  margin: 0;
  padding-left: 1.15rem;
}

.status-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--secondary);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
}

.status-new { background: #e8f1fd; border-color: #b8d4f5; color: #184f9f; }
.status-under_review { background: #fff6e6; border-color: #f0d49a; color: #8a5a00; }
.status-need_more_info { background: #fdeee8; border-color: #f0baa8; color: #9a3412; }
.status-accepted { background: #e7f8ef; border-color: #a8dfc0; color: #166534; }
.status-rejected { background: #fdecec; border-color: #f0a8a8; color: #991b1b; }
.status-archived { background: var(--secondary); color: var(--text-muted); }

.ticket-status-new { background: #e8f1fd; border-color: #b8d4f5; color: #184f9f; }
.ticket-status-quoted { background: #f0e8fd; border-color: #c9b8f5; color: #4f189f; }
.ticket-status-awaiting_payment { background: #fff6e6; border-color: #f0d49a; color: #8a5a00; }
.ticket-status-scheduled { background: #e8f8fd; border-color: #a8d8f0; color: #0c5460; }
.ticket-status-in_progress { background: #e7f8ef; border-color: #a8dfc0; color: #166534; }
.ticket-status-waiting_on_customer { background: #fdeee8; border-color: #f0baa8; color: #9a3412; }
.ticket-status-completed { background: #e7f8ef; border-color: #6bc48a; color: #14532d; }
.ticket-status-cancelled { background: #fdecec; border-color: #f0a8a8; color: #991b1b; }
.ticket-status-archived { background: var(--secondary); color: var(--text-muted); }

.priority-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--secondary);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
}

.priority-normal { background: var(--secondary); color: var(--text-muted); }
.priority-medium { background: #fff6e6; border-color: #f0d49a; color: #8a5a00; }
.priority-high { background: #fdeee8; border-color: #f0baa8; color: #9a3412; }
.priority-critical { background: #fdecec; border-color: #f0a8a8; color: #991b1b; }

[data-theme="dark"] {
  .status-new { background: #1a2a40; border-color: #2f4f78; color: #9ec5ff; }
  .status-under_review { background: #3a2e14; border-color: #6b5418; color: #f5d186; }
  .status-need_more_info { background: #3a2218; border-color: #7a3f28; color: #f5b49a; }
  .status-accepted { background: #143024; border-color: #25603f; color: #9ae6b4; }
  .status-rejected { background: #3a1818; border-color: #7a2828; color: #fca5a5; }
  .ticket-status-new { background: #1a2a40; border-color: #2f4f78; color: #9ec5ff; }
  .ticket-status-quoted { background: #2a1a40; border-color: #4f2f78; color: #c9a8ff; }
  .ticket-status-awaiting_payment { background: #3a2e14; border-color: #6b5418; color: #f5d186; }
  .ticket-status-scheduled { background: #143038; border-color: #256878; color: #9ae6f5; }
  .ticket-status-in_progress { background: #143024; border-color: #25603f; color: #9ae6b4; }
  .ticket-status-waiting_on_customer { background: #3a2218; border-color: #7a3f28; color: #f5b49a; }
  .ticket-status-completed { background: #0f2a1a; border-color: #1d6b3a; color: #86efac; }
  .ticket-status-cancelled { background: #3a1818; border-color: #7a2828; color: #fca5a5; }
  .priority-medium { background: #3a2e14; border-color: #6b5418; color: #f5d186; }
  .priority-high { background: #3a2218; border-color: #7a3f28; color: #f5b49a; }
  .priority-critical { background: #3a1818; border-color: #7a2828; color: #fca5a5; }
  .quote-status-sent { background: #1a2a40; border-color: #2f4f78; color: #9ec5ff; }
  .quote-status-accepted { background: #143024; border-color: #25603f; color: #9ae6b4; }
  .quote-status-declined { background: #3a1818; border-color: #7a2828; color: #fca5a5; }
  .quote-status-expired { background: #3a2e14; border-color: #6b5418; color: #f5d186; }
  .quote-status-paid { background: #0f2a1a; border-color: #1d6b3a; color: #86efac; }
  .payment-status-pending { background: #3a2e14; border-color: #6b5418; color: #f5d186; }
  .payment-status-paid { background: #143024; border-color: #25603f; color: #9ae6b4; }
  .payment-status-manual_paid { background: #0f2a1a; border-color: #1d6b3a; color: #86efac; }
  .payment-status-failed { background: #3a1818; border-color: #7a2828; color: #fca5a5; }
  .appointment-status-proposed { background: #e8f1fd; border-color: #b8d4f5; color: #184f9f; }
  .appointment-status-confirmed { background: #e7f8ef; border-color: #a8dfc0; color: #166534; }
  .appointment-status-reschedule_requested { background: #fff6e6; border-color: #f0d49a; color: #8a5a00; }
  .appointment-status-completed { background: #e7f8ef; border-color: #6bc48a; color: #14532d; }
  .appointment-status-cancelled { background: #fdecec; border-color: #f0a8a8; color: #991b1b; }
  .appointment-status-archived { background: var(--secondary); color: var(--text-muted); }
  .device-status-active { background: #e7f8ef; border-color: #a8dfc0; color: #166534; }
  .device-status-inactive { background: var(--secondary); color: var(--text-muted); }
  .device-status-retired { background: #fff6e6; border-color: #f0d49a; color: #8a5a00; }
  .device-status-lost { background: #fdecec; border-color: #f0a8a8; color: #991b1b; }
  .device-status-disposed { background: var(--secondary); color: var(--text-muted); }
  .repair-status-requested { background: #1a2a40; border-color: #2f4f78; color: #9ec5ff; }
  .repair-status-awaiting_dropoff { background: #3a2e14; border-color: #6b5418; color: #f5d186; }
  .repair-status-checked_in { background: #143024; border-color: #25603f; color: #9ae6b4; }
  .repair-status-diagnosing { background: #1a2a40; border-color: #2f4f78; color: #9ec5ff; }
  .repair-status-awaiting_approval { background: #3a2e14; border-color: #6b5418; color: #f5d186; }
  .repair-status-approved { background: #0f2a1a; border-color: #1d6b3a; color: #86efac; }
  .repair-status-repairing { background: #1a2a40; border-color: #2f4f78; color: #9ec5ff; }
  .repair-status-ready_for_pickup { background: #143024; border-color: #25603f; color: #9ae6b4; }
  .repair-status-completed { background: #0f2a1a; border-color: #1d6b3a; color: #86efac; }
  .repair-status-cancelled { background: #3a1818; border-color: #7a2828; color: #fca5a5; }
  .repair-status-archived { background: var(--secondary); color: var(--text-muted); }
  .consultation-status-requested { background: #1a2a40; border-color: #2f4f78; color: #9ec5ff; }
  .consultation-status-scheduled { background: #3a2e14; border-color: #6b5418; color: #f5d186; }
  .consultation-status-in_progress { background: #1a2a40; border-color: #2f4f78; color: #9ec5ff; }
  .consultation-status-report_pending { background: #3a2e14; border-color: #6b5418; color: #f5d186; }
  .consultation-status-completed { background: #143024; border-color: #25603f; color: #9ae6b4; }
  .consultation-status-cancelled { background: #3a1818; border-color: #7a2828; color: #fca5a5; }
  .consultation-status-archived { background: var(--secondary); color: var(--text-muted); }
  .emergency-severity-critical { background: #3a1818; border-color: #7a2828; color: #fca5a5; }
  .emergency-severity-high { background: #3a2e14; border-color: #6b5418; color: #f5d186; }
  .emergency-severity-medium { background: #1a2a40; border-color: #2f4f78; color: #9ec5ff; }
  .emergency-severity-low { background: var(--secondary); color: var(--text-muted); }
  .emergency-status-new { background: #3a1818; border-color: #7a2828; color: #fca5a5; }
  .emergency-status-acknowledged { background: #3a2e14; border-color: #6b5418; color: #f5d186; }
  .emergency-status-investigating { background: #1a2a40; border-color: #2f4f78; color: #9ec5ff; }
  .emergency-status-waiting_on_customer { background: #3a2e14; border-color: #6b5418; color: #f5d186; }
  .emergency-status-resolved { background: #143024; border-color: #25603f; color: #9ae6b4; }
  .emergency-status-closed { background: var(--secondary); color: var(--text-muted); }
  .stat-card-emergency { background: linear-gradient(180deg, #3a1818 0%, var(--surface) 100%); border-color: #7a2828; }
}

.status-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.timeline-item {
  padding-left: 1rem;
  border-left: 3px solid var(--border);
}

.timeline-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1rem;
}

.timeline-note {
  margin: 0.35rem 0 0;
  white-space: pre-wrap;
}

.action-grid {
  display: grid;
  gap: 1rem;
}

.action-form-wide {
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.notes-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.note-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.quote-items-table input.input-block {
  width: 100%;
}

.quote-items-table input.input-narrow {
  width: 6rem;
}

.quote-totals {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.quote-totals p {
  margin: 0.25rem 0;
}

.quote-status-draft { background: var(--secondary); color: var(--text-muted); }
.quote-status-sent { background: #e8f1fd; border-color: #b8d4f5; color: #184f9f; }
.quote-status-accepted { background: #e7f8ef; border-color: #a8dfc0; color: #166534; }
.quote-status-declined { background: #fdecec; border-color: #f0a8a8; color: #991b1b; }
.quote-status-expired { background: #fff6e6; border-color: #f0d49a; color: #8a5a00; }
.quote-status-cancelled { background: var(--secondary); color: var(--text-muted); }
.quote-status-paid { background: #e7f8ef; border-color: #6bc48a; color: #14532d; }

.payment-status-pending { background: #fff6e6; border-color: #f0d49a; color: #8a5a00; }
.payment-status-paid { background: #e7f8ef; border-color: #a8dfc0; color: #166534; }
.payment-status-manual_paid { background: #e7f8ef; border-color: #6bc48a; color: #14532d; }
.payment-status-failed { background: #fdecec; border-color: #f0a8a8; color: #991b1b; }
.payment-status-cancelled { background: var(--secondary); color: var(--text-muted); }

.appointment-status-proposed { background: #e8f1fd; border-color: #b8d4f5; color: #184f9f; }
.appointment-status-confirmed { background: #e7f8ef; border-color: #a8dfc0; color: #166534; }
.appointment-status-reschedule_requested { background: #fff6e6; border-color: #f0d49a; color: #8a5a00; }
.appointment-status-completed { background: #e7f8ef; border-color: #6bc48a; color: #14532d; }
.appointment-status-cancelled { background: #fdecec; border-color: #f0a8a8; color: #991b1b; }
.appointment-status-archived { background: var(--secondary); color: var(--text-muted); }

.device-status-active { background: #e7f8ef; border-color: #a8dfc0; color: #166534; }
.device-status-inactive { background: var(--secondary); color: var(--text-muted); }
.device-status-retired { background: #fff6e6; border-color: #f0d49a; color: #8a5a00; }
.device-status-lost { background: #fdecec; border-color: #f0a8a8; color: #991b1b; }
.device-status-disposed { background: var(--secondary); color: var(--text-muted); }

.repair-status-requested { background: #e8f1fd; border-color: #b8d4f5; color: #184f9f; }
.repair-status-awaiting_dropoff { background: #fff6e6; border-color: #f0d49a; color: #8a5a00; }
.repair-status-checked_in { background: #e7f8ef; border-color: #a8dfc0; color: #166534; }
.repair-status-diagnosing { background: #e8f1fd; border-color: #b8d4f5; color: #184f9f; }
.repair-status-awaiting_approval { background: #fff6e6; border-color: #f0d49a; color: #8a5a00; }
.repair-status-approved { background: #e7f8ef; border-color: #6bc48a; color: #14532d; }
.repair-status-repairing { background: #e8f1fd; border-color: #2f4f78; color: #184f9f; }
.repair-status-ready_for_pickup { background: #e7f8ef; border-color: #a8dfc0; color: #166534; }
.repair-status-completed { background: #143024; border-color: #25603f; color: #9ae6b4; }
.repair-status-cancelled { background: #fdecec; border-color: #f0a8a8; color: #991b1b; }
.repair-status-archived { background: var(--secondary); color: var(--text-muted); }

.consultation-status-requested { background: #e8f1fd; border-color: #b8d4f5; color: #184f9f; }
.consultation-status-scheduled { background: #fff6e6; border-color: #f0d49a; color: #8a5a00; }
.consultation-status-in_progress { background: #e8f1fd; border-color: #2f4f78; color: #184f9f; }
.consultation-status-report_pending { background: #fff6e6; border-color: #f0d49a; color: #8a5a00; }
.consultation-status-completed { background: #e7f8ef; border-color: #6bc48a; color: #14532d; }
.consultation-status-cancelled { background: #fdecec; border-color: #f0a8a8; color: #991b1b; }
.consultation-status-archived { background: var(--secondary); color: var(--text-muted); }

.pre-wrap { white-space: pre-wrap; }

.emergency-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card-emergency {
  border-color: #f0a8a8;
  background: linear-gradient(180deg, #fff5f5 0%, #fff 100%);
}

.stat-card-emergency-critical {
  border-color: #dc2626;
  background: linear-gradient(180deg, #fdecec 0%, #fff 100%);
}

.stat-card-emergency .stat-value {
  color: #991b1b;
}

.emergency-queue-card {
  border-color: #f0a8a8;
}

.emergency-row-critical {
  background: #fff5f5;
}

.emergency-summary-card {
  border-left: 4px solid #dc2626;
}

.emergency-detail-header h1 {
  color: #991b1b;
}

.btn-emergency {
  border-color: #dc2626;
  color: #991b1b;
}

.nav-emergency {
  color: #dc2626;
  font-weight: 600;
}

.emergency-severity-critical { background: #fdecec; border-color: #f0a8a8; color: #991b1b; }
.emergency-severity-high { background: #fff6e6; border-color: #f0d49a; color: #8a5a00; }
.emergency-severity-medium { background: #e8f1fd; border-color: #b8d4f5; color: #184f9f; }
.emergency-severity-low { background: var(--secondary); color: var(--text-muted); }

.emergency-status-new { background: #fdecec; border-color: #f0a8a8; color: #991b1b; }
.emergency-status-acknowledged { background: #fff6e6; border-color: #f0d49a; color: #8a5a00; }
.emergency-status-investigating { background: #e8f1fd; border-color: #b8d4f5; color: #184f9f; }
.emergency-status-waiting_on_customer { background: #fff6e6; border-color: #f0d49a; color: #8a5a00; }
.emergency-status-resolved { background: #e7f8ef; border-color: #6bc48a; color: #14532d; }
.emergency-status-closed { background: var(--secondary); color: var(--text-muted); }

.photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.repair-photo-thumb {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.accessory-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.accessory-row input[type="text"] {
  flex: 1;
  min-width: 120px;
}

.btn-danger-text {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
}

.btn-danger-text:hover {
  background: var(--danger-bg);
}

.attachment-list {
  margin: 0;
  padding-left: 1.15rem;
}

.attachment-list li {
  margin-bottom: 0.45rem;
}

.stat-link {
  font-size: 0.95rem;
  font-weight: 600;
}

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

.admin-header .nav-links a {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}

.admin-header .nav-links a:hover {
  color: var(--primary);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.brand {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.brand:hover {
  text-decoration: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 1.1rem;
  height: 2px;
  margin-inline: auto;
  background: var(--text);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem 1rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text);
  font-weight: 500;
  padding: 0.35rem 0.15rem;
  border-bottom: 2px solid transparent;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--primary);
  border-bottom-color: var(--primary);
  text-decoration: none;
}

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

.nav-user {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.logout-form {
  margin: 0;
}

.main-content {
  padding: 0 0 3rem;
}

.admin-main {
  padding-top: 1.5rem;
}

.hero {
  padding: 4rem 0 2.5rem;
}

.hero-home {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--primary) 8%, var(--bg)) 0%,
    var(--bg) 100%
  );
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 5vw, 3rem);
}

.tagline {
  margin: 0 0 1rem;
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  color: var(--text-muted);
  max-width: 42rem;
}

.hero-description {
  margin: 0 0 1.75rem;
  max-width: 42rem;
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.page-hero {
  padding: 2.75rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.page-hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-hero p {
  margin: 0;
  color: var(--text-muted);
  max-width: 42rem;
}

.section {
  padding: 2.5rem 0;
}

.section-muted {
  background: var(--surface-muted);
}

.section-note {
  padding-bottom: 3rem;
}

.section-header {
  margin-bottom: 2rem;
}

.section-header h2 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.5rem, 2.8vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: var(--leading-tight);
  color: var(--text);
}

.section-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-lg);
  max-width: 42rem;
}

.page-section {
  padding: 1rem 0 2rem;
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  margin: 0 0 0.35rem;
}

.page-header p {
  margin: 0;
  color: var(--text-muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--card-padding);
  box-shadow: var(--shadow);
}

.card h1,
.card h2,
.card h3 {
  margin-top: 0;
}

.card-grid {
  display: grid;
  gap: 1.25rem;
}

.card-grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.service-card h3 {
  margin-bottom: 0.5rem;
}

.service-card p:last-of-type {
  margin-bottom: 0.75rem;
}

.service-detail h2 {
  margin-bottom: 0.35rem;
}

.service-detail > p {
  color: var(--text-muted);
}

.service-note {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  border-radius: 0 8px 8px 0;
}

.content-stack {
  display: grid;
  gap: 1.25rem;
}

.feature-list {
  margin: 0 0 1.5rem;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.5rem;
}

.detail-list {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.45rem;
}

.callout {
  margin: 0;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--primary);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1.05rem;
}

.notice-card {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.notice-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.cta-banner h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
}

.cta-banner p {
  margin: 0;
  color: var(--text-muted);
}

.hours-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.hours-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.hours-list li:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.pricing-disclaimer {
  margin: 1rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.legal-nav ul,
.footer-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.text-link {
  font-weight: 600;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.7rem 1.1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  text-decoration: none;
}

.btn-secondary {
  background: var(--secondary);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--secondary-hover);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--outline);
  border-color: var(--outline);
}

.btn-outline:hover {
  background: color-mix(in srgb, var(--outline) 10%, transparent);
  text-decoration: none;
}

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

.btn-block {
  width: 100%;
}

.auth-card {
  max-width: 100%;
}

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

.auth-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

.form-group {
  display: grid;
  gap: 0.35rem;
}

label {
  font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="email"],
select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

input:focus,
select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.alert {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
}

.alert-success {
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 1.25rem;
  font-size: 0.95rem;
}

.error-list {
  margin: 0;
  padding-left: 1.15rem;
}

.label-note {
  font-weight: 400;
  color: var(--text-muted);
}

.stat-note {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

.profile-readonly {
  display: grid;
  gap: 0.85rem;
  margin: 0 0 1.25rem;
  padding: 0 0 1.25rem;
  border-bottom: 1px solid var(--border);
}

.profile-readonly dt {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.profile-readonly dd {
  margin: 0;
  font-weight: 500;
}

.client-main {
  padding-top: 1.5rem;
}

.client-header .brand {
  font-size: 0.98rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 2.5rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
}

.footer-name {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.footer-tagline,
.footer-area {
  margin: 0 0 0.75rem;
}

.footer-heading {
  margin: 0 0 0.75rem;
  font-weight: 700;
  color: var(--text);
}

.footer-links li {
  margin-bottom: 0.45rem;
}

.footer-links a {
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  padding: 1rem 0 1.5rem;
  border-top: 1px solid var(--border);
}

.footer-bottom p {
  margin: 0;
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }

  .site-nav.is-open {
    display: flex;
  }

  .header-inner {
    position: relative;
    flex-wrap: wrap;
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-links a {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-actions .btn {
    width: 100%;
  }

  .site-header.nav-open .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .site-header.nav-open .nav-toggle-bar:nth-child(2) {
    opacity: 0;
  }

  .site-header.nav-open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

@media (max-width: 640px) {
  .hero {
    padding-top: 2.5rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn,
  .cta-banner .btn {
    width: 100%;
  }

  .cta-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* Knowledge base */
.kb-meta {
  font-size: 0.875rem;
  color: var(--color-muted, #64748b);
  margin-bottom: 0.35rem;
}

.kb-subheading {
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.kb-content {
  white-space: pre-wrap;
  line-height: 1.65;
}

.kb-search-form {
  margin-bottom: 0;
}

.input-with-button {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.input-with-button input {
  flex: 1 1 16rem;
  min-width: 0;
}

.filter-bar {
  margin-bottom: 1.5rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.filter-row .form-group {
  flex: 1 1 12rem;
  margin-bottom: 0;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item h2 {
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
}

.faq-edit-form {
  margin: 1rem;
  border: none;
  box-shadow: none;
  background: var(--color-surface-muted, #f8fafc);
}

.kb-editor {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9375rem;
}

.badge-muted {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--color-surface-muted, #f1f5f9);
  color: var(--color-muted, #64748b);
}

.badge-success {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
}

.badge-error {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
}

.testimonial-card footer {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--color-muted, #64748b);
}

.testimonial-disclaimer {
  margin-top: 0.25rem;
}

.error-page {
  padding-top: 3rem;
  padding-bottom: 4rem;
}

.error-card {
  text-align: center;
  padding: 2.5rem 2rem;
}

.error-code {
  font-size: 3rem;
  font-weight: 700;
  color: var(--color-muted, #64748b);
  margin: 0 0 0.5rem;
}

.launch-score-card {
  text-align: center;
}

.launch-score-value {
  font-size: 3rem;
  font-weight: 700;
  margin: 0.5rem 0;
  color: #2563eb;
}

.launch-ready-badge {
  color: #166534;
  font-weight: 600;
}

.footer-contact {
  margin: 0.25rem 0 0;
  font-size: 0.9375rem;
}

.footer-contact a {
  color: inherit;
}

/* ——— TASK 019: layout, theme toggle, admin shell, polish ——— */

.container-wide {
  width: min(100% - 2rem, var(--max-width-wide));
}

h1 {
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
}

.page-header h1 {
  font-size: var(--text-2xl);
}

.section-header h2 {
  font-size: var(--text-xl);
}

.card-title {
  margin: 0 0 0.5rem;
  font-size: var(--text-lg);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}

.theme-toggle-icon-dark {
  display: none;
}

[data-theme="dark"] .theme-toggle-icon-light {
  display: none;
}

[data-theme="dark"] .theme-toggle-icon-dark {
  display: inline;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Public header layout — visual polish in sheybklyn-theme.css */
.site-header-public {
  background: transparent;
}

.header-public {
  position: relative;
  padding: 0;
}

.header-public-inner {
  width: 100%;
}

.header-public-nav-toggle {
  display: none;
}

.site-nav-public {
  min-width: 0;
}

.header-public-actions > .theme-toggle {
  flex-shrink: 0;
}

.nav-actions-public {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.btn-lg {
  padding: 0.85rem 1.35rem;
  font-size: var(--text-base);
}

.btn-muted {
  background: var(--surface-muted);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-muted:hover {
  background: var(--secondary-hover);
  text-decoration: none;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-danger:hover {
  background: color-mix(in srgb, var(--danger) 88%, #000);
  text-decoration: none;
}

.btn-outline-emergency {
  background: transparent;
  color: var(--accent-emergency);
  border-color: color-mix(in srgb, var(--accent-emergency) 55%, var(--border));
}

.btn-outline-emergency:hover {
  background: var(--danger-bg);
  border-color: var(--accent-emergency);
  text-decoration: none;
}

.cta-banner-primary {
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}

.hero-home {
  padding: clamp(2.5rem, 5vw, 3.75rem) 0 clamp(3rem, 6vw, 5rem);
}

.hero-home-grid {
  display: grid;
  grid-template-columns: 1fr minmax(200px, 300px);
  align-items: center;
  gap: 2.5rem 3.5rem;
}

.hero-home-content {
  min-width: 0;
}

.hero-home h1 {
  font-size: var(--text-3xl);
  max-width: 20ch;
}

.hero-home-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  align-self: center;
}

.hero-mark {
  width: 100%;
  max-width: 300px;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px color-mix(in srgb, var(--text) 12%, transparent));
}

[data-theme="dark"] .hero-mark {
  filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.45));
}

.section {
  padding: var(--space-section) 0;
}

.section-how-it-works {
  background: var(--surface);
  border-block: 1px solid var(--border);
}

.steps-list {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}

.steps-list-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.25rem;
  align-items: start;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
}

.steps-list-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  color: var(--primary);
  font-weight: 700;
  font-size: var(--text-sm);
}

.steps-list-title {
  margin: 0 0 0.25rem;
  font-size: var(--text-lg);
}

.steps-list-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.trust-card-title {
  margin: 0 0 0.5rem;
  font-size: var(--text-lg);
}

.trust-card p:last-child {
  margin-bottom: 0;
  color: var(--text-muted);
}

.service-card {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.service-card:hover {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  box-shadow: var(--shadow-lg);
}

.site-footer {
  padding: 3.5rem 0 0;
  margin-top: 2rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.footer-grid {
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 2.5rem 2rem;
  padding-bottom: 2.75rem;
}

/* Admin shell */
.admin-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.admin-sidebar-brand {
  padding: 1.25rem 1.15rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.admin-sidebar-brand a {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.admin-sidebar-brand a:hover {
  color: var(--primary);
}

.admin-sidebar-label {
  display: block;
  margin-top: 0.2rem;
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.admin-sidebar-nav {
  flex: 1;
  padding: 0.75rem 0.65rem 1rem;
  overflow-y: auto;
}

.admin-nav-group-title {
  margin: 1rem 0 0.35rem;
  padding: 0 0.5rem;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.admin-nav-group-title:first-child {
  margin-top: 0;
}

.admin-nav-link {
  display: block;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
}

.admin-nav-link:hover {
  background: var(--secondary);
  color: var(--primary);
  text-decoration: none;
}

.admin-nav-link.is-active {
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  color: var(--primary);
  font-weight: 600;
}

.admin-nav-link-emergency {
  color: var(--accent-emergency);
}

.admin-nav-link-emergency.is-active {
  background: var(--danger-bg);
  color: var(--accent-emergency);
}

.admin-sidebar-footer {
  padding: 1rem 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

.admin-sidebar-footer .nav-user {
  display: block;
  margin-bottom: 0.65rem;
  font-size: var(--text-xs);
}

.admin-shell-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.admin-topbar-title {
  margin: 0;
  flex: 1;
  font-size: var(--text-lg);
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-topbar-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.admin-sidebar-toggle {
  display: none;
}

.admin-sidebar-backdrop {
  display: none;
}

.layout-admin .admin-main {
  padding: 1.5rem 1.5rem 3rem;
}

.layout-admin .page-section .container,
.layout-admin .page-section .container-wide {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-inline: 0;
}

.dashboard-group {
  margin-bottom: 2rem;
}

.dashboard-group-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.dashboard-group-header h2 {
  margin: 0;
  font-size: var(--text-lg);
}

.dashboard-group-title {
  margin: 0 0 1rem;
  font-size: var(--text-lg);
}

.dashboard-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
}

.dashboard-group-emergency {
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--accent-emergency) 35%, var(--border));
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--danger-bg) 50%, var(--surface));
}

.stat-grid-compact {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.85rem;
}

.stat-card-link {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stat-card-link:hover {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

.stat-value-sm {
  font-size: 1.35rem;
}

.dashboard-alert-card {
  margin-top: 0.5rem;
}

[data-theme="dark"] .stat-card-emergency {
  background: linear-gradient(180deg, #2d1818 0%, var(--surface) 100%);
}

[data-theme="dark"] .stat-card-emergency-critical {
  background: linear-gradient(180deg, #3a1818 0%, var(--surface) 100%);
}

.header-inner-client {
  flex-wrap: nowrap;
}

.site-nav-client .nav-links {
  gap: 0.15rem 1rem;
}

.nav-user-compact {
  font-size: var(--text-sm);
}

.client-dashboard .client-cta {
  margin-bottom: 2rem;
}

.empty-state {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

@media (max-width: 1100px) {
  .nav-links-public {
    gap: 0.35rem 1rem;
  }

  .hero-home-grid {
    grid-template-columns: 1fr minmax(180px, 260px);
    gap: 1.5rem 2rem;
  }

  .hero-mark {
    max-width: 260px;
  }
}

@media (max-width: 1024px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 200;
    width: min(280px, 88vw);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-lg);
  }

  .admin-shell.admin-sidebar-open .admin-sidebar {
    transform: translateX(0);
  }

  .admin-sidebar-toggle {
    display: flex;
  }

  .admin-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(0, 0, 0, 0.45);
  }

  .admin-sidebar-backdrop[hidden] {
    display: none;
  }
}

@media (max-width: 900px) {
  .header-brand-row {
    display: flex;
    justify-content: space-between;
  }

  .header-public-logo-link {
    flex: 1;
    min-width: 0;
    justify-content: flex-start;
  }

  .header-brand-utilities {
    flex-shrink: 0;
  }

  .header-public-nav-toggle {
    display: flex;
  }

  .header-nav-panel {
    display: none;
  }

  .header-nav-panel.is-open {
    display: flex;
    flex-direction: column;
  }

  .nav-links-public {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0;
  }

  .nav-links-public a {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
  }

  .site-header-public .header-public-actions,
  .site-header-public .nav-actions-public {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
  }

  .site-header-public .nav-actions-public .btn {
    width: auto;
  }
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ——— TASK 019C: homepage & branding polish ——— */

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

.cta-group .btn {
  min-height: 2.75rem;
}

.card-heading {
  margin: 0 0 0.65rem;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--text);
}

.card-heading a {
  color: inherit;
  text-decoration: none;
}

.card-heading a:hover {
  color: var(--primary);
  text-decoration: none;
}

.content-card p:last-child {
  margin-bottom: 0;
}

.content-card .text-link {
  display: inline-block;
  margin-top: 0.35rem;
}

.card-grid {
  gap: 1.5rem;
}

.kb-subheading {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--text);
}

.hero-home h1 {
  font-size: clamp(2.1rem, 4.5vw, 2.85rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.85rem;
}

.hero-home .tagline {
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  margin-bottom: 1.15rem;
}

.hero-home .hero-description {
  margin-bottom: 1.85rem;
  font-size: 1.0625rem;
  line-height: 1.65;
}

.hero-service-area,
.service-area-card {
  margin-top: 1.75rem;
  max-width: 22rem;
  padding: 1.15rem 1.35rem;
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 18%, var(--border));
}

.service-area-card-label {
  margin: 0 0 0.5rem;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.service-area-card-list {
  margin: 0 0 0.65rem;
  padding-left: 1.15rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}

.service-area-card-list li {
  margin-bottom: 0.25rem;
}

.service-area-card-note {
  margin: 0 0 0.5rem;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.service-area-card-link {
  font-size: var(--text-sm);
}

.footer-brand-primary {
  padding-right: 1.5rem;
}

.footer-brand-name {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: var(--leading-tight);
}

.footer-brand-tagline {
  margin: 0 0 1.15rem;
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 22rem;
}

.footer-area-summary {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 22rem;
}

.footer-contact {
  margin: 0 0 0.35rem;
}

.footer-links {
  padding-top: 0.15rem;
}

.footer-links li {
  margin-bottom: 0.55rem;
}

.footer-bottom {
  padding: 1.25rem 0 1.75rem;
}

.cta-banner .cta-group {
  flex-shrink: 0;
}

.layout-public {
  overflow-x: hidden;
}

@media (max-width: 1024px) {
  .hero-home {
    padding: 2.75rem 0 3.5rem;
  }

  .hero-home-grid {
    grid-template-columns: 1fr minmax(180px, 260px);
    gap: 2rem;
  }

  .hero-mark {
    max-width: 260px;
  }
}

@media (max-width: 900px) {
  .hero-home {
    padding: 2.25rem 0 2.75rem;
  }

  .hero-home-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .hero-home-content {
    order: 1;
  }

  .hero-home-visual {
    order: 2;
    margin-top: 0.25rem;
  }

  .hero-service-area,
  .service-area-card {
    max-width: none;
  }

  .cta-group .btn-lg {
    width: 100%;
  }

  .footer-brand-primary {
    padding-right: 0;
  }
}

@media (max-width: 640px) {
  .section-header {
    margin-bottom: 1.5rem;
  }

  .hero-home {
    padding: 2rem 0 2.5rem;
  }

  .hero-mark {
    max-width: 200px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-brand-primary {
    grid-column: 1 / -1;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
  }
}
