/* ── Reset & base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-primary: #EF413C;
  --color-primary-dark: #990100;
  --color-danger: #990100;
  --color-success: #EF413C;
  --color-warning: #858585;
  --color-text: #3C3C3C;
  --color-text-muted: #858585;
  --color-bg: #DDDDDD;
  --color-surface: #FFFFFF;
  --color-border: #858585;
  --navbar-bg: #DDDDDD;
  --navbar-text: #3C3C3C;
  --body-bg-image: url('/img/background-clouds.png');
  --radius: 6px;
  --shadow: 0 1px 4px rgba(0,0,0,.1);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body[data-theme="dark"] {
  --color-primary: #EF413C;
  --color-primary-dark: #990100;
  --color-danger: #990100;
  --color-success: #EF413C;
  --color-warning: #858585;
  --color-text: #DDDDDD;
  --color-text-muted: #858585;
  --color-bg: #000000;
  --color-surface: #3C3C3C;
  --color-border: #858585;
  --navbar-bg: #000000;
  --navbar-text: #DDDDDD;
  --body-bg-image: url('/img/background-stars.png');
  --shadow: 0 4px 16px rgba(0,0,0,.35);
}

body {
  font-family: var(--font);
  background-color: var(--color-bg);
  background-image: var(--body-bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--color-text);
  line-height: 1.5;
}

/* ── Dev overlay ──────────────────────────────────────────────────────── */
body.dev-overlay {
  outline: 3px solid var(--color-danger);
  outline-offset: -3px;
}
body.dev-overlay::before {
  content: '[DEV]';
  position: fixed;
  top: 0; right: 0;
  background: var(--color-danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  z-index: 9999;
  pointer-events: none;
}

/* ── Navbar ───────────────────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--navbar-bg);
  color: var(--navbar-text);
  padding: .5rem 1.5rem;
  min-height: 52px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--color-border);
}
.navbar__brand {
  display: inline-flex;
  align-items: center;
  color: var(--navbar-text);
  text-decoration: none;
  margin-right: auto;
}

.navbar__brand-logo {
  display: block;
  height: 32px;
  width: auto;
}
.navbar__links {
  list-style: none;
  display: flex;
  gap: .25rem;
}
.navbar__links a {
  color: var(--navbar-text);
  text-decoration: none;
  padding: .4rem .75rem;
  border-radius: var(--radius);
  font-size: .9rem;
  transition: background .15s;
}
.navbar__links a:hover { background: rgba(0,0,0,.08); color: var(--navbar-text); }

.navbar__context {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.navbar__context-item {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .75rem;
  color: var(--navbar-text);
}

.navbar__select {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: 4px;
  font-size: .8rem;
  padding: .25rem .35rem;
  min-width: 140px;
}

.navbar__select option {
  color: var(--color-text);
  background: var(--color-surface);
}

.navbar__theme-toggle {
  min-width: 0;
  width: 36px;
  height: 32px;
  padding: 0;
  justify-content: center;
  border: none;
}

.navbar__theme-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.navbar__select:disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* ── Layout ───────────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }

/* ── Cards ────────────────────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.card__title { font-size: 1rem; font-weight: 600; margin-bottom: .5rem; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px,1fr));
  gap: 1rem;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1rem;
  border: none;
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: opacity .15s;
}
.btn:hover { opacity: .85; }
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--muted { background: #d1d5db; color: #374151; }
.btn--danger { background: var(--color-danger); color: #fff; }
.btn--outline { background: transparent; border: 1px solid var(--color-border); color: var(--color-text); }
.btn--sm { padding: .3rem .65rem; font-size: .8rem; }
.navbar__theme-toggle.btn--outline { border: none; }
.btn:disabled,
.btn[disabled] {
  background: #d1d5db;
  color: #6b7280;
  border-color: #cbd5e1;
  cursor: not-allowed;
  opacity: 1;
}

.hm-disabled-delete-wrap {
  position: relative;
  display: inline-flex;
}

.hm-disabled-delete-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  border-radius: 6px;
  padding: .45rem .6rem;
  font-size: .75rem;
  line-height: 1.35;
  min-width: 220px;
  max-width: 320px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .12s ease;
  z-index: 25;
}

.hm-disabled-delete-wrap:hover .hm-disabled-delete-tooltip,
.hm-disabled-delete-wrap:focus-within .hm-disabled-delete-tooltip,
.hm-disabled-delete-wrap:focus .hm-disabled-delete-tooltip {
  opacity: 1;
  visibility: visible;
}

.q-state-trigger {
  width: 100%;
  justify-content: center;
  font-weight: 700;
  min-height: 38px;
}

.q-state-trigger--inline {
  width: 190px;
  height: 32px;
  min-height: 32px;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.q-question-trigger--clickable {
  cursor: pointer;
  transition: box-shadow .15s ease, border-color .15s ease;
}

.q-question-trigger--clickable:hover {
  border-color: #8aa1c7;
  box-shadow: 0 0 0 2px rgba(43, 78, 128, 0.12);
}

.q-question-trigger--clickable:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.q-occ-date--active {
  color: rgba(255, 255, 255, 0.92);
}

.q-occ-date--inactive {
  color: #1f2937;
}

/* ── Forms ────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 500; margin-bottom: .3rem; }
.form-control {
  width: 100%;
  padding: .45rem .65rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: .9rem;
  background: #fff;
}
.form-control:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; }

/* ── Tables ───────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .55rem .75rem; text-align: left; border-bottom: 1px solid var(--color-border); }
th { background: var(--color-bg); font-weight: 600; }
tbody tr:nth-child(odd) td { background: #ffffff; }
tbody tr:nth-child(even) td { background: #f3f4f6; }
tr:last-child td { border-bottom: none; }

body[data-theme="dark"] #report-result table tbody td {
  color: #111827;
}

body[data-theme="dark"] #report-result table tbody .text-muted {
  color: #4b5563;
}

body[data-theme="dark"] #admin-panel table tbody td {
  color: #3C3C3C;
}

body[data-theme="dark"] #admin-panel table tbody td.text-muted {
  color: #858585;
}

body[data-theme="dark"] #gq-admin-panel table tbody td {
  color: #3C3C3C;
}

body[data-theme="dark"] #gq-admin-panel table tbody td.text-muted {
  color: #858585;
}

.admin-click-row { cursor: pointer; }
.admin-click-row:hover td { background: #f8fafc; }

.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.admin-modal {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: #ffffff;
  border: 5px solid #3C3C3C;
  border-radius: 12px;
  box-shadow: 0 14px 42px rgba(2, 8, 23, 0.35);
}

.admin-modal__header,
.admin-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
}

.admin-modal__header {
  justify-content: space-between;
}

.admin-modal__body {
  padding: 12px 14px;
}

.admin-modal__footer {
  border-bottom: none;
  border-top: 1px solid var(--color-border);
}

.admin-modal__msg {
  padding: 0 14px 12px;
}

.gq-admin-heatmap-states-table,
.gq-admin-heatmap-states-table table,
.gq-admin-heatmap-states-table thead,
.gq-admin-heatmap-states-table tbody,
.gq-admin-heatmap-states-table th,
.gq-admin-heatmap-states-table tr {
  background: #fff !important;
}

.gq-admin-heatmap-states-table tbody tr:nth-child(odd) td {
  background: #ffffff !important;
}

.gq-admin-heatmap-states-table tbody tr:nth-child(even) td {
  background: #f3f4f6 !important;
}

body[data-theme="dark"] .gq-admin-heatmap-states-table th,
body[data-theme="dark"] .gq-admin-heatmap-states-table td {
  color: #3C3C3C !important;
}

th.col-sort-order,
td.col-sort-order {
  width: 4.25rem;
  white-space: nowrap;
  text-align: center;
  padding-left: .35rem;
  padding-right: .35rem;
}

/* ── State badges ─────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 30px;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}

.state-name-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 12rem;
  text-align: center;
}

/* ── Alerts ───────────────────────────────────────────────────────────── */
.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .9rem; }
.alert--error { background: #ffeaea; border: 1px solid var(--color-danger); color: var(--color-danger); }
.alert--info  { background: #e8f0fe; border: 1px solid var(--color-primary); color: var(--color-primary-dark); }

/* ── Page title ───────────────────────────────────────────────────────── */
.page-header { margin-bottom: 1.5rem; display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.page-header h1 { font-size: 1.4rem; }

/* ── Tabs ─────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--color-border); margin-bottom: 1.25rem; }
.tab {
  padding: .5rem 1rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: .9rem;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.tab.active { color: var(--color-primary); border-color: var(--color-primary); font-weight: 600; }

/* ── Utility ──────────────────────────────────────────────────────────── */
.text-muted { color: var(--color-text-muted); }
.flex { display: flex; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.w-full { width: 100%; }

@media (max-width: 920px) {
  .navbar__brand { margin-right: 0; }
  .navbar__brand-logo { height: 28px; }
  .navbar__links { width: 100%; order: 2; }
  .navbar__context {
    width: 100%;
    order: 3;
    margin-left: 0;
  }
  .navbar__select { min-width: 120px; }
}

/* ── Heatmap board ────────────────────────────────────────────────────── */
.heatmap-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}

.heatmap-picker__title {
  font-weight: 700;
  margin-bottom: .5rem;
}

.heatmap-picker__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.heatmap-board {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.heatmap-vendor-card {
  background: #f5f6f8;
  border: 1px solid #cfd4dc;
  border-radius: 10px;
  padding: .85rem;
}

.heatmap-vendor-title {
  font-size: 1.05rem;
  margin-bottom: .65rem;
}

.heatmap-cluster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: .9rem;
}

.heatmap-cluster-card {
  background: #eceef2;
  border: 1px solid #cfd4dc;
  border-radius: 8px;
  padding: .75rem;
}

.heatmap-cluster-title {
  font-size: 1rem;
  margin-bottom: .55rem;
}

.heatmap-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: .6rem;
}

.heatmap-tile-wrap {
  position: relative;
}

.heatmap-tile {
  width: 100%;
  min-height: 64px;
  border: none;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: .6rem .65rem;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
  transition: transform .08s ease, box-shadow .1s ease;
}

.heatmap-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,.25);
}

.heatmap-tile-label {
  font-weight: 700;
  line-height: 1.2;
  font-size: .9rem;
}

.heatmap-tile-plan {
  position: absolute;
  right: .45rem;
  bottom: .35rem;
  font-size: .62rem;
  font-weight: 700;
  padding: .1rem .4rem;
  border-radius: 4px;
  background: #4b1cb9;
  color: #fff;
}

.heatmap-editor {
  background: #fff;
  border: 1px solid #d7dce4;
  border-radius: 8px;
  padding: .6rem;
  margin-top: .45rem;
}

/* ── Heatmap popup ───────────────────────────────────────────────────── */
.heatmap-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 24, .72);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.heatmap-modal {
  width: min(980px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: #f4f5f7;
  border: 5px solid #3C3C3C;
  border-radius: 10px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, .35);
}

.heatmap-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #d2d7df;
}

.heatmap-modal__close {
  font-size: 1.9rem;
  line-height: 1;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #666;
}

.heatmap-modal__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  padding: 1rem 1.25rem 1.25rem;
}

.heatmap-modal__left {
  border-right: 1px solid #d2d7df;
  padding-right: 1rem;
}

.heatmap-modal__right {
  padding-left: .25rem;
}

.heatmap-state-buttons {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

#questionary-state-modal .heatmap-modal__left {
  display: flex;
  align-items: center;
}

#questionary-state-modal .heatmap-state-buttons {
  width: 100%;
}

#questionary-state-modal .questionary-state-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 88px;
  border: 1px solid #9ca3af;
  border-radius: 8px;
  background: rgba(255, 255, 255, .9);
  color: #1f2937;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

#questionary-state-modal .questionary-state-nav--prev {
  left: max(10px, calc(50% - 560px));
}

#questionary-state-modal .questionary-state-nav--next {
  right: max(10px, calc(50% - 560px));
}

#questionary-state-modal .heatmap-modal {
  position: relative;
  z-index: 1;
}

#questionary-state-modal .questionary-state-nav:disabled {
  opacity: .35;
  cursor: not-allowed;
}

body[data-theme="dark"] #questionary-state-modal .questionary-state-nav {
  background: rgba(17, 24, 39, .9);
  color: #e5e7eb;
  border-color: #6b7280;
}

.heatmap-state-btn {
  position: relative;
  border: none;
  border-radius: 6px;
  padding: .65rem .8rem;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.heatmap-state-btn.selected {
  outline: 3px solid #9ba7b8;
  outline-offset: 1px;
}

.heatmap-state-btn__tooltip {
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-50%);
  min-width: 220px;
  max-width: 320px;
  padding: .45rem .55rem;
  border-radius: 8px;
  background: inherit;
  color: inherit;
  border: 1px solid #000;
  font-size: .78rem;
  line-height: 1.35;
  font-weight: 500;
  text-align: left;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity .12s ease;
  z-index: 3;
}

.heatmap-state-btn:hover .heatmap-state-btn__tooltip,
.heatmap-state-btn:focus-visible .heatmap-state-btn__tooltip {
  opacity: 1;
  visibility: visible;
}

.heatmap-info-list {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin-bottom: 1rem;
}

.heatmap-info-label {
  font-size: .82rem;
  color: #666;
  font-weight: 700;
  letter-spacing: .01em;
}

.heatmap-info-value {
  font-size: 1.05rem;
  font-weight: 700;
}

.heatmap-info-description {
  background: #e8eaee;
  border-radius: 6px;
  padding: .75rem;
  color: #30343a;
  min-height: 100px;
}

textarea.heatmap-info-description {
  width: 100%;
  display: block;
  box-sizing: border-box;
  border: 0;
  resize: vertical;
}

.heatmap-info-description--plain {
  background: #f4f5f7;
  border: 1px solid #000;
}

textarea.heatmap-info-description--input {
  background: #fff;
  border: 1px solid #cfd4dc;
}

.heatmap-modal__message {
  margin-top: .75rem;
}

.q-heatmap-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: .45rem;
  margin-top: .4rem;
}

.q-heatmap-link {
  position: relative;
  border-radius: 8px;
  padding: .45rem .55rem;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
  cursor: help;
}

.q-heatmap-link__notice {
  font-size: .68rem;
  font-weight: 700;
  opacity: .9;
}

#questionary-state-modal .q-heatmap-link__notice--badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .08rem .42rem;
  font-size: .62rem;
  font-weight: 800;
  line-height: 1.1;
  border: 1px solid transparent;
  white-space: nowrap;
}

.q-heatmap-link__tooltip {
  position: absolute;
  right: 0;
  left: auto;
  bottom: calc(100% + 8px);
  width: min(340px, 78vw);
  background: #0f1a2b;
  color: #ecf2ff;
  border: 1px solid #294266;
  border-radius: 8px;
  padding: .55rem .65rem;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .35);
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .12s ease, transform .12s ease;
  pointer-events: none;
  max-height: min(42vh, 330px);
  overflow-y: auto;
}

body[data-theme="dark"] .heatmap-vendor-card {
  background: #f0f2f5;
  border-color: #bcc5d0;
  color: #3C3C3C;
}

body[data-theme="dark"] .heatmap-cluster-card {
  background: #e7ebf0;
  border-color: #bcc5d0;
  color: #3C3C3C;
}

body[data-theme="dark"] .heatmap-vendor-title,
body[data-theme="dark"] .heatmap-cluster-title,
body[data-theme="dark"] .heatmap-vendor-card .text-muted,
body[data-theme="dark"] .heatmap-cluster-card .text-muted {
  color: #3C3C3C;
}

body[data-theme="dark"] .heatmap-modal {
  background: #1f2329;
  border-color: #3a424d;
  color: #e5e7eb;
}

body[data-theme="dark"] .heatmap-modal__header,
body[data-theme="dark"] .heatmap-modal__left {
  border-color: #3a424d;
}

body[data-theme="dark"] .heatmap-modal__close {
  color: #c7ced8;
}

body[data-theme="dark"] .heatmap-info-label {
  color: #b7c0cd;
}

body[data-theme="dark"] .heatmap-info-value {
  color: #f3f4f6;
}

body[data-theme="dark"] .heatmap-info-description {
  background: #2a3038;
  color: #e5e7eb;
}

body[data-theme="dark"] .heatmap-info-description--plain {
  background: #2a3038;
  border-color: #4b5563;
}

body[data-theme="dark"] textarea.heatmap-info-description--input {
  background: #111827;
  border-color: #4b5563;
  color: #e5e7eb;
}

body[data-theme="dark"] .q-heatmap-link {
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}

.q-heatmap-link:hover .q-heatmap-link__tooltip,
.q-heatmap-link:focus .q-heatmap-link__tooltip,
.q-heatmap-link:focus-within .q-heatmap-link__tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.q-heatmap-link__tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  font-size: .78rem;
  margin-bottom: .28rem;
}

.q-heatmap-link__tooltip-row span {
  color: inherit;
  opacity: .82;
  font-weight: 600;
}

.q-heatmap-link__tooltip-row strong {
  text-align: right;
}

.q-heatmap-link__tooltip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .34rem;
}

.q-heatmap-link__tooltip-head strong {
  font-size: .82rem;
  line-height: 1.2;
}

.q-heatmap-link__tooltip-notice {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .1rem .44rem;
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .01em;
  white-space: nowrap;
  background: #4b2ac9;
  color: #ffffff;
}

.q-heatmap-link__tooltip-text {
  font-size: .76rem;
  color: inherit;
  opacity: .92;
  margin-top: .35rem;
  font-weight: 500;
}

.q-heatmap-link__tooltip-text span {
  color: inherit;
  opacity: .82;
  font-weight: 700;
}

@media (max-width: 920px) {
  .heatmap-modal__content {
    grid-template-columns: 1fr;
  }
  .heatmap-modal__left {
    border-right: none;
    border-bottom: 1px solid #d2d7df;
    padding-right: 0;
    padding-bottom: 1rem;
  }
  .heatmap-modal__right {
    padding-left: 0;
  }
}

/* ── Questionary Presentation Mode ───────────────────────────────────── */
.q-present-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .75rem;
}

.q-present-canvas {
  position: relative;
  width: min(1920px, 96vw);
  aspect-ratio: 16 / 9;
  border-radius: 0;
  overflow: hidden;
  background-image: url('/assets/presentation-mode-dark.jpg');
  background-size: cover;
  background-position: center;
  border: 5px solid #3C3C3C;
  box-shadow: 0 16px 44px rgba(0, 0, 0, .55);
  padding: 2rem 2.2rem;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: .8rem;
  font-family: 'Aptos Display', 'Aptos', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

body[data-theme="dark"] .admin-modal,
body[data-theme="dark"] .heatmap-modal,
body[data-theme="dark"] .q-present-canvas {
  border-color: #DDDDDD;
}

.q-present-canvas:fullscreen,
.q-present-canvas:-webkit-full-screen {
  --q-img-w: min(100vw, calc(100vh * 16 / 9));
  --q-img-h: min(100vh, calc(100vw * 9 / 16));
  --q-img-inset-x: calc((100vw - var(--q-img-w)) / 2);
  --q-img-inset-y: calc((100vh - var(--q-img-h)) / 2);
  width: 100vw;
  height: 100vh;
  max-width: none;
  aspect-ratio: auto;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: #000;
  padding: calc(var(--q-img-inset-y) + 1.2rem) calc(var(--q-img-inset-x) + 2rem);
}

.q-present-canvas:fullscreen .q-present-controls,
.q-present-canvas:-webkit-full-screen .q-present-controls {
  top: calc(var(--q-img-inset-y) + 2.6rem);
  right: calc(var(--q-img-inset-x) + 2.6rem);
}

.q-present-canvas:fullscreen .q-present-nav--prev,
.q-present-canvas:-webkit-full-screen .q-present-nav--prev {
  left: calc(var(--q-img-inset-x) + .9rem);
}

.q-present-canvas:fullscreen .q-present-nav--next,
.q-present-canvas:-webkit-full-screen .q-present-nav--next {
  right: calc(var(--q-img-inset-x) + .9rem);
}

.q-present-canvas:fullscreen .q-present-head,
.q-present-canvas:-webkit-full-screen .q-present-head {
  padding-top: 1.0rem;
  padding-left: 1.0rem;
}

.q-present-canvas--dark {
  background-image: url('/assets/presentation-mode-dark.jpg');
}

.q-present-canvas--light {
  background-image: url('/assets/presentation-mode-light.jpg');
}

.q-present-controls {
  position: absolute;
  top: calc(1.2rem + 10px);
  right: calc(1.2rem + 10px);
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}

.q-present-theme-toggle {
  border: 1px solid rgba(255, 255, 255, .52);
  background: rgba(0, 0, 0, .35);
  color: #fff;
  padding: .35rem .7rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: .85rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1;
}

.q-present-theme-btn {
  width: 34px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.q-present-fullscreen-btn {
  width: 34px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.q-present-theme-btn,
.q-present-fullscreen-btn {
  background: transparent;
  border: none;
}

.q-present-theme-btn:hover,
.q-present-fullscreen-btn:hover {
  background: transparent;
}

.q-present-theme-icon {
  width: 16px;
  height: 16px;
  display: block;
}

.q-present-fullscreen-icon {
  width: 16px;
  height: 16px;
  display: block;
}

.q-present-close {
  position: static;
  border: 1px solid rgba(255, 255, 255, .52);
  background: rgba(0, 0, 0, .35);
  color: #fff;
  padding: .35rem .7rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: .85rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1;
}

.q-present-theme-toggle:hover,
.q-present-close:hover {
  background: rgba(0, 0, 0, .58);
}

.q-present-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: rgba(155, 155, 155, .75);
  color: #3d3d3d;
  width: 56px;
  height: 96px;
  cursor: pointer;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  clip-path: polygon(14% 50%, 100% 0, 100% 100%);
}

.q-present-nav:hover:not(:disabled) {
  background: rgba(185, 185, 185, .9);
}

.q-present-nav:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.q-present-nav--prev {
  left: .9rem;
}

.q-present-nav--next {
  right: .9rem;
  clip-path: polygon(0 0, 86% 50%, 0 100%);
}

.q-present-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding-right: 4.4rem;
}

.q-present-title,
.q-present-progress,
.q-present-capability,
.q-present-question,
.q-present-explanation {
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .7);
}

.q-present-canvas--light .q-present-title,
.q-present-canvas--light .q-present-progress,
.q-present-canvas--light .q-present-capability,
.q-present-canvas--light .q-present-question,
.q-present-canvas--light .q-present-explanation {
  color: #111;
  text-shadow: none;
}

.q-present-title {
  font-size: clamp(1rem, 1.5vw, 2rem);
  font-weight: 500;
}

.q-present-progress {
  font-size: clamp(1rem, 1.45vw, 1.8rem);
  font-weight: 500;
}

.q-present-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  align-items: stretch;
  gap: 2rem;
  min-height: 0;
}

.q-present-main {
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-content: center;
  min-height: 0;
  padding: 1rem 3.7rem 1.2rem 3.9rem;
}

.q-present-capability {
  font-size: clamp(1.8rem, 2.6vw, 3.1rem);
  font-weight: 400;
  margin-bottom: 1rem;
  opacity: .96;
}

.q-present-question {
  font-size: clamp(2.2rem, 4vw, 5rem);
  line-height: 1.12;
  font-weight: 700;
  margin: 0;
  align-self: center;
  max-width: 24ch;
}

.q-present-explanation {
  font-size: clamp(1.05rem, 1.7vw, 2rem);
  line-height: 1.35;
  margin: 0;
  max-width: 70ch;
  opacity: .98;
}

.q-present-tech {
  align-self: end;
  margin-top: 1.1rem;
}

.q-present-tech-title {
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .7);
  font-size: clamp(.9rem, 1.2vw, 1.2rem);
  margin-bottom: .4rem;
  opacity: .95;
}

.q-present-tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.q-present-tech-link {
  position: relative;
  display: inline-flex;
  cursor: help;
}

.q-present-tech-link .q-heatmap-link__tooltip {
  left: 0;
  right: auto;
  width: min(680px, 90vw);
  max-height: min(68vh, 680px);
  padding: 1rem 1.1rem;
}

.q-present-tech-link .q-heatmap-link__tooltip-row {
  font-size: 1.06rem;
}

.q-present-tech-link .q-heatmap-link__tooltip-head strong {
  font-size: 1.16rem;
}

.q-present-tech-link .q-heatmap-link__tooltip-text {
  font-size: 1.02rem;
}

.q-present-tech-link:only-child .q-heatmap-link__tooltip {
  left: 0;
  right: auto;
}

.q-present-tech-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  padding: .28rem .65rem;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, .35);
  font-size: clamp(.95rem, 1.2vw, 1.35rem);
  line-height: 1.1;
  font-weight: 500;
}

.q-present-tech-link:hover .q-heatmap-link__tooltip,
.q-present-tech-link:focus .q-heatmap-link__tooltip,
.q-present-tech-link:focus-within .q-heatmap-link__tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.q-present-canvas--light .q-present-tech-title {
  color: #111;
  text-shadow: none;
}

.q-present-states {
  align-self: center;
  display: flex;
  flex-direction: column;
  padding-right: 4.4rem;
}

.q-present-states-list {
  display: flex;
  flex-direction: column;
  gap: .95rem;
}

.q-present-progress--states {
  align-self: center;
  text-align: center;
  margin-bottom: .1rem;
}

.q-present-state-item {
  min-width: 340px;
  min-height: 3.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .6rem .8rem;
  font-size: clamp(.92rem, 1.45vw, 1.55rem);
  font-weight: 500;
  letter-spacing: .01em;
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2);
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
}

.q-present-state-item.is-clickable {
  cursor: pointer;
}

.q-present-state-item.is-clickable:hover:not(:disabled) {
  transform: translateY(-1px);
}

.q-present-state-item:disabled {
  cursor: default;
}

.q-present-state-label {
  display: inline-block;
}

.q-present-state-check {
  position: absolute;
  right: .7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, .38);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .45);
}

.q-present-state-item.is-active {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .28), inset 0 0 0 1px rgba(0, 0, 0, .2);
}

@media (max-width: 1080px) {
  .q-present-overlay {
    padding: .45rem;
  }
  .q-present-canvas {
    width: 100vw;
  }
  .q-present-nav {
    width: 42px;
    height: 76px;
  }
  .q-present-body {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
  .q-present-main {
    padding: .5rem 2.9rem .7rem 3rem;
  }
  .q-present-states {
    padding: 0 3rem 0 3rem;
    gap: .6rem;
  }
}
