/* ==========================================================================
   HK Insurance Knowledge Base — Module Styles
   Apple glassmorphism design · Light / Dark theme via data-theme
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Module-scoped Custom Properties
   -------------------------------------------------------------------------- */

.hk-ins {
  /* Borders */
  --hk-border: rgba(0, 0, 0, 0.08);

  /* Card hover */
  --hk-card-hover: rgba(255, 255, 255, 0.68);

  /* Accent — IRR / value indicators */
  --hk-accent-green: #34c759;
  --hk-accent-yellow: #ff9f0a;
  --hk-accent-red: #ff3b30;

  /* Form input background */
  --hk-input-bg: rgba(255, 255, 255, 0.55);

  /* Spacing tokens */
  --hk-gap-xs: 6px;
  --hk-gap-sm: 12px;
  --hk-gap: 20px;
  --hk-gap-lg: 32px;
  --hk-gap-xl: 48px;

  /* Radius */
  --hk-radius: 16px;
  --hk-radius-sm: 10px;
  --hk-radius-pill: 999px;
}

/* Dark theme overrides ——————————————————————————————————————————————————— */

html.dark .hk-ins,
html[data-theme="dark"] .hk-ins {
  --hk-border: rgba(255, 255, 255, 0.10);
  --hk-card-hover: rgba(58, 58, 60, 0.62);
  --hk-accent-green: #30d158;
  --hk-accent-yellow: #ffd60a;
  --hk-accent-red: #ff453a;
  --hk-input-bg: rgba(55, 55, 57, 0.60);
}


/* --------------------------------------------------------------------------
   2. Layout — Module Container / Page Header / Content
   -------------------------------------------------------------------------- */

.hk-ins {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--hk-gap-lg) var(--hk-gap);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Page header ———————————————————————————————————————————————————————————— */

.hk-page-header {
  margin-bottom: var(--hk-gap-lg);
}

.hk-page-header__breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.hk-page-header__breadcrumb a {
  color: var(--brand-blue);
  text-decoration: none;
  transition: opacity 0.2s;
}

.hk-page-header__breadcrumb a:hover {
  opacity: 0.75;
}

.hk-page-header__breadcrumb-sep {
  color: var(--text-secondary);
  opacity: 0.5;
  user-select: none;
}

.hk-page-header__title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
  color: var(--text-color);
}

.hk-page-header__subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.5;
}

/* Main content ——————————————————————————————————————————————————————————— */

.hk-content {
  position: relative;
  min-height: 300px;
}


/* --------------------------------------------------------------------------
   3. Dashboard / Home — Stats Grid + Shortcuts
   -------------------------------------------------------------------------- */

.hk-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--hk-gap);
  margin-bottom: var(--hk-gap-xl);
}

.hk-stat-card {
  background: var(--card-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--hk-border);
  border-radius: var(--hk-radius);
  padding: var(--hk-gap);
  display: flex;
  align-items: flex-start;
  gap: var(--hk-gap-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease,
    background 0.25s ease;
}

.hk-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow);
  background: var(--hk-card-hover);
}

.hk-stat-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: rgba(0, 113, 227, 0.10);
  color: var(--brand-blue);
}

.hk-stat-card__body {
  flex: 1;
  min-width: 0;
}

.hk-stat-card__value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-color);
}

.hk-stat-card__label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Shortcuts ——————————————————————————————————————————————————————————————— */

.hk-shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--hk-gap);
}

.hk-shortcut-card {
  background: var(--card-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--hk-border);
  border-radius: var(--hk-radius);
  padding: var(--hk-gap) var(--hk-gap);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: flex-start;
  gap: var(--hk-gap-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease,
    background 0.25s ease;
}

.hk-shortcut-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow);
  background: var(--hk-card-hover);
}

.hk-shortcut-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  background: rgba(0, 113, 227, 0.10);
  color: var(--brand-blue);
}

.hk-shortcut-card__title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-color);
}

.hk-shortcut-card__desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
}


/* --------------------------------------------------------------------------
   4. Product List — Filters / Grid / Table / Sort / Pagination
   -------------------------------------------------------------------------- */

/* Filter bar —————————————————————————————————————————————————————————————— */

.hk-filter-bar {
  position: sticky;
  top: 60px; /* below nav */
  z-index: 20;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--hk-border);
  border-radius: var(--hk-radius);
  padding: var(--hk-gap-sm) var(--hk-gap);
  margin-bottom: var(--hk-gap);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--hk-gap-sm);
}

/* Filter chips ——————————————————————————————————————————————————————————— */

.hk-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hk-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--hk-radius-pill);
  border: 1px solid var(--hk-border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.hk-filter-chip:hover {
  background: rgba(0, 113, 227, 0.06);
  border-color: var(--brand-blue);
}

.hk-filter-chip--active,
.hk-filter-chip.active {
  background: var(--brand-blue);
  color: #fff;
  border-color: var(--brand-blue);
}

.hk-filter-chip--active:hover,
.hk-filter-chip.active:hover {
  background: #005bb5;
}

/* Range slider ——————————————————————————————————————————————————————————— */

.hk-range-slider {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.hk-range-slider__track {
  position: relative;
  flex: 1;
  min-width: 100px;
  height: 4px;
  border-radius: 2px;
  background: var(--hk-border);
}

.hk-range-slider__fill {
  position: absolute;
  height: 100%;
  border-radius: 2px;
  background: var(--brand-blue);
}

.hk-range-slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  width: 100%;
  height: 4px;
  background: transparent;
  pointer-events: none;
  margin: 0;
  top: 0;
  left: 0;
}

.hk-range-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--brand-blue);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  pointer-events: auto;
  transition: box-shadow 0.2s;
}

.hk-range-slider input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 6px rgba(0, 113, 227, 0.12);
}

.hk-range-slider__value {
  min-width: 36px;
  text-align: center;
  font-weight: 600;
  color: var(--text-color);
}

/* Product grid ——————————————————————————————————————————————————————————— */

.hk-product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--hk-gap);
}

/* Product card ——————————————————————————————————————————————————————————— */

.hk-product-card {
  background: var(--card-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--hk-border);
  border-radius: var(--hk-radius);
  padding: var(--hk-gap);
  display: flex;
  flex-direction: column;
  gap: var(--hk-gap-sm);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease,
    background 0.25s ease;
}

.hk-product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow);
  background: var(--hk-card-hover);
}

.hk-product-card__header {
  display: flex;
  align-items: center;
  gap: var(--hk-gap-sm);
}

.hk-product-card__logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--hk-border);
  flex-shrink: 0;
}

.hk-product-card__name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-color);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.hk-product-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hk-product-card__metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}

.hk-product-card__metric {
  font-size: 12px;
  color: var(--text-secondary);
}

.hk-product-card__metric-value {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-color);
  margin-top: 1px;
}

.hk-product-card__fulfillment {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.hk-product-card__fulfillment-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.hk-product-card__fulfillment-dot--high {
  background: var(--hk-accent-green);
}

.hk-product-card__fulfillment-dot--medium {
  background: var(--hk-accent-yellow);
}

.hk-product-card__fulfillment-dot--low {
  background: var(--hk-accent-red);
}

/* Product table ——————————————————————————————————————————————————————————— */

.hk-product-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--hk-border);
  border-radius: var(--hk-radius);
  overflow: hidden;
}

.hk-product-table th,
.hk-product-table td {
  padding: 12px 16px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid var(--hk-border);
}

.hk-product-table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--hk-input-bg);
  white-space: nowrap;
}

.hk-product-table tbody tr {
  transition: background 0.2s;
  cursor: pointer;
}

.hk-product-table tbody tr:hover {
  background: var(--hk-card-hover);
}

.hk-product-table tbody tr:last-child td {
  border-bottom: none;
}

/* Sort bar ———————————————————————————————————————————————————————————————— */

.hk-sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hk-gap-sm);
  margin-bottom: var(--hk-gap);
  flex-wrap: wrap;
}

.hk-sort-bar__label {
  font-size: 14px;
  color: var(--text-secondary);
}

.hk-sort-bar__select {
  font-size: 14px;
  padding: 6px 12px;
  border-radius: var(--hk-radius-sm);
  border: 1px solid var(--hk-border);
  background: var(--hk-input-bg);
  color: var(--text-color);
  cursor: pointer;
}

/* Pagination ————————————————————————————————————————————————————————————— */

.hk-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: var(--hk-gap-lg);
}

.hk-pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--hk-radius-sm);
  border: 1px solid var(--hk-border);
  background: transparent;
  color: var(--text-color);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.hk-pagination__btn:hover {
  background: rgba(0, 113, 227, 0.06);
  border-color: var(--brand-blue);
}

.hk-pagination__btn--active,
.hk-pagination__btn.active {
  background: var(--brand-blue);
  color: #fff;
  border-color: var(--brand-blue);
}

.hk-pagination__btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.hk-pagination__ellipsis {
  color: var(--text-secondary);
  padding: 0 4px;
  user-select: none;
}


/* --------------------------------------------------------------------------
   5. Product Detail — Header / Stats / Tabs / Tables / Chart
   -------------------------------------------------------------------------- */

/* Detail header —————————————————————————————————————————————————————————— */

.hk-detail-header {
  display: flex;
  align-items: flex-start;
  gap: var(--hk-gap);
  margin-bottom: var(--hk-gap-lg);
  flex-wrap: wrap;
}

.hk-detail-header__logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--hk-border);
  flex-shrink: 0;
}

.hk-detail-header__info {
  flex: 1;
  min-width: 0;
}

.hk-detail-header__title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 6px;
  color: var(--text-color);
}

.hk-detail-header__insurer {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.hk-detail-header__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hk-detail-header__actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* Detail stats ——————————————————————————————————————————————————————————— */

.hk-detail-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--hk-gap);
  margin-bottom: var(--hk-gap-lg);
}

.hk-detail-stats .hk-stat-card {
  flex-direction: column;
  align-items: flex-start;
}

.hk-detail-stats .hk-stat-card__value {
  font-size: 24px;
}

/* Tabs ——————————————————————————————————————————————————————————————————— */

.hk-tabs {
  display: flex;
  border-bottom: 1px solid var(--hk-border);
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: var(--hk-gap);
}

.hk-tabs::-webkit-scrollbar {
  display: none;
}

.hk-tab {
  flex-shrink: 0;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}

.hk-tab:hover {
  color: var(--text-color);
}

.hk-tab--active,
.hk-tab.active {
  color: var(--brand-blue);
  border-bottom-color: var(--brand-blue);
}

/* Tab content ———————————————————————————————————————————————————————————— */

.hk-tab-content {
  animation: hk-fade-in 0.3s ease;
}

@keyframes hk-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hk-tab-content[hidden] {
  display: none;
}

/* Info table (key-value) ————————————————————————————————————————————————— */

.hk-info-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--hk-border);
  border-radius: var(--hk-radius);
  overflow: hidden;
}

.hk-info-table tr + tr {
  border-top: 1px solid var(--hk-border);
}

.hk-info-table th,
.hk-info-table td {
  padding: 14px 20px;
  font-size: 14px;
  text-align: left;
  vertical-align: top;
}

.hk-info-table th {
  width: 40%;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.hk-info-table td {
  color: var(--text-color);
  font-weight: 500;
}

/* Projection table ——————————————————————————————————————————————————————— */

.hk-projection-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--hk-border);
  border-radius: var(--hk-radius);
  overflow: hidden;
  font-size: 14px;
}

.hk-projection-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.hk-projection-table th {
  padding: 12px 14px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: var(--hk-input-bg);
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--hk-border);
}

.hk-projection-table th:first-child {
  text-align: center;
}

.hk-projection-table td {
  padding: 10px 14px;
  text-align: right;
  border-bottom: 1px solid var(--hk-border);
  font-variant-numeric: tabular-nums;
}

.hk-projection-table td:first-child {
  text-align: center;
  font-weight: 600;
  color: var(--text-secondary);
}

.hk-projection-table tbody tr:hover {
  background: var(--hk-card-hover);
}

.hk-projection-table tbody tr:last-child td {
  border-bottom: none;
}

/* Chart container ———————————————————————————————————————————————————————— */

.hk-chart-container {
  position: relative;
  background: var(--card-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--hk-border);
  border-radius: var(--hk-radius);
  padding: var(--hk-gap);
  margin-bottom: var(--hk-gap);
}

.hk-chart-container canvas {
  width: 100% !important;
  max-height: 380px;
}


/* --------------------------------------------------------------------------
   6. Compare — Selection / Table / Columns
   -------------------------------------------------------------------------- */

.hk-compare-select {
  display: flex;
  flex-wrap: wrap;
  gap: var(--hk-gap);
  margin-bottom: var(--hk-gap-lg);
}

.hk-compare-select__slot {
  flex: 1;
  min-width: 220px;
  background: var(--card-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 2px dashed var(--hk-border);
  border-radius: var(--hk-radius);
  padding: var(--hk-gap);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  cursor: pointer;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  transition: border-color 0.2s, background 0.2s;
}

.hk-compare-select__slot:hover {
  border-color: var(--brand-blue);
  background: rgba(0, 113, 227, 0.04);
}

.hk-compare-select__slot--filled {
  border-style: solid;
  justify-content: flex-start;
  gap: var(--hk-gap-sm);
}

.hk-compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--hk-border);
  border-radius: var(--hk-radius);
  overflow: hidden;
  table-layout: fixed;
}

.hk-compare-table th,
.hk-compare-table td {
  padding: 14px 16px;
  font-size: 14px;
  text-align: center;
  border-bottom: 1px solid var(--hk-border);
}

.hk-compare-table th:first-child,
.hk-compare-table td:first-child {
  text-align: left;
  font-weight: 500;
  color: var(--text-secondary);
  width: 180px;
}

.hk-compare-table th {
  font-weight: 600;
  color: var(--text-color);
  background: var(--hk-input-bg);
}

.hk-compare-table tbody tr:last-child td {
  border-bottom: none;
}

.hk-compare-table tbody tr:hover {
  background: var(--hk-card-hover);
}

.hk-compare-col {
  vertical-align: top;
}

.hk-compare-col__logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: contain;
  margin: 0 auto 8px;
  display: block;
}

.hk-compare-col__name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-color);
}


/* --------------------------------------------------------------------------
   7. Fulfillment — Table / Bar Visualization
   -------------------------------------------------------------------------- */

.hk-fulfillment-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--hk-border);
  border-radius: var(--hk-radius);
  overflow: hidden;
  font-size: 14px;
}

.hk-fulfillment-table th,
.hk-fulfillment-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--hk-border);
}

.hk-fulfillment-table th {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: var(--hk-input-bg);
}

.hk-fulfillment-table tbody tr:hover {
  background: var(--hk-card-hover);
}

.hk-fulfillment-table tbody tr:last-child td {
  border-bottom: none;
}

.hk-fulfillment-bar {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: var(--hk-border);
  overflow: hidden;
  min-width: 80px;
}

.hk-fulfillment-bar__fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.hk-fulfillment-bar__fill--high {
  background: var(--hk-accent-green);
}

.hk-fulfillment-bar__fill--medium {
  background: var(--hk-accent-yellow);
}

.hk-fulfillment-bar__fill--low {
  background: var(--hk-accent-red);
}


/* --------------------------------------------------------------------------
   8. Calculator — Layout / Form / Results
   -------------------------------------------------------------------------- */

.hk-calc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--hk-gap-lg);
  align-items: start;
}

.hk-calc-form {
  background: var(--card-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--hk-border);
  border-radius: var(--hk-radius);
  padding: var(--hk-gap);
  display: flex;
  flex-direction: column;
  gap: var(--hk-gap);
}

.hk-calc-input {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hk-calc-input label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.hk-calc-input input,
.hk-calc-input select {
  padding: 10px 14px;
  font-size: 15px;
  border-radius: var(--hk-radius-sm);
  border: 1px solid var(--hk-border);
  background: var(--hk-input-bg);
  color: var(--text-color);
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.hk-calc-input input:focus,
.hk-calc-input select:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.hk-calc-results {
  display: flex;
  flex-direction: column;
  gap: var(--hk-gap);
}

.hk-calc-results__summary {
  background: var(--card-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--hk-border);
  border-radius: var(--hk-radius);
  padding: var(--hk-gap);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--hk-gap-sm);
}

.hk-calc-results__chart {
  background: var(--card-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--hk-border);
  border-radius: var(--hk-radius);
  padding: var(--hk-gap);
}

.hk-calc-results__chart canvas {
  width: 100% !important;
  max-height: 300px;
}


/* --------------------------------------------------------------------------
   9. Insurers — Grid / Card
   -------------------------------------------------------------------------- */

.hk-insurer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--hk-gap);
}

.hk-insurer-card {
  background: var(--card-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--hk-border);
  border-radius: var(--hk-radius);
  padding: var(--hk-gap);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease,
    background 0.25s ease;
}

.hk-insurer-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow);
  background: var(--hk-card-hover);
}

.hk-insurer-card__logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--hk-border);
}

.hk-insurer-card__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-color);
  line-height: 1.3;
}

.hk-insurer-card__rating {
  font-size: 13px;
  color: var(--hk-accent-yellow);
}

.hk-insurer-card__count {
  font-size: 12px;
  color: var(--text-secondary);
}


/* --------------------------------------------------------------------------
   10. Badges — Status Pills & IRR Colors
   -------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--hk-radius-pill);
  line-height: 1.5;
  white-space: nowrap;
}

.badge-active {
  background: rgba(52, 199, 89, 0.12);
  color: var(--hk-accent-green);
}

.badge-discontinued {
  background: rgba(255, 59, 48, 0.12);
  color: var(--hk-accent-red);
}

.badge-limited {
  background: rgba(255, 159, 10, 0.12);
  color: var(--hk-accent-yellow);
}

.badge-new_launch {
  background: rgba(0, 113, 227, 0.12);
  color: var(--brand-blue);
}

/* IRR value colors ——————————————————————————————————————————————————————— */

.irr-high {
  color: var(--hk-accent-green);
}

.irr-medium {
  color: var(--hk-accent-yellow);
}

.irr-low {
  color: var(--hk-accent-red);
}

.irr-na {
  color: var(--text-secondary);
  font-style: italic;
}


/* --------------------------------------------------------------------------
   11. States — Loading / Empty / Error
   -------------------------------------------------------------------------- */

.hk-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--hk-gap-xl) 0;
  gap: 14px;
  color: var(--text-secondary);
  font-size: 14px;
}

.hk-loading__spinner,
.hk-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--hk-border);
  border-top-color: var(--brand-blue);
  border-radius: 50%;
  animation: hk-spin 0.75s linear infinite;
}

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

.hk-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--hk-gap-xl) var(--hk-gap);
  text-align: center;
  color: var(--text-secondary);
}

.hk-empty__icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.hk-empty__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 4px;
}

.hk-empty__text {
  font-size: 14px;
  max-width: 320px;
  line-height: 1.5;
}

.hk-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--hk-gap-xl) var(--hk-gap);
  text-align: center;
}

.hk-error__icon {
  font-size: 40px;
  margin-bottom: 12px;
  color: var(--hk-accent-red);
}

.hk-error__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 4px;
}

.hk-error__text {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 320px;
  line-height: 1.5;
  margin-bottom: 16px;
}


/* --------------------------------------------------------------------------
   12. Buttons
   -------------------------------------------------------------------------- */

.hk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--hk-radius-pill);
  border: none;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, transform 0.15s, opacity 0.2s;
  background: var(--brand-blue);
  color: #fff;
}

.hk-btn:hover {
  background: #005bb5;
}

.hk-btn:active {
  transform: scale(0.97);
}

.hk-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.hk-btn-outline {
  background: transparent;
  color: var(--brand-blue);
  border: 1.5px solid var(--brand-blue);
}

.hk-btn-outline:hover {
  background: rgba(0, 113, 227, 0.08);
}

.hk-btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}


/* --------------------------------------------------------------------------
   13. Form Controls — Search / Select / Switch
   -------------------------------------------------------------------------- */

.hk-search-input {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 180px;
}

.hk-search-input__icon {
  position: absolute;
  left: 12px;
  color: var(--text-secondary);
  pointer-events: none;
  font-size: 15px;
  opacity: 0.6;
}

.hk-search-input input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  font-size: 14px;
  font-family: inherit;
  border-radius: var(--hk-radius-sm);
  border: 1px solid var(--hk-border);
  background: var(--hk-input-bg);
  color: var(--text-color);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hk-search-input input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.hk-search-input input:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

/* Select ————————————————————————————————————————————————————————————————— */

.hk-select {
  padding: 10px 36px 10px 14px;
  font-size: 14px;
  font-family: inherit;
  border-radius: var(--hk-radius-sm);
  border: 1px solid var(--hk-border);
  background-color: var(--hk-input-bg);
  color: var(--text-color);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236e6e73' d='M6 8.5L1.5 4h9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hk-select:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

/* Toggle switch —————————————————————————————————————————————————————————— */

.hk-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-color);
  user-select: none;
}

.hk-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.hk-switch__track {
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--hk-border);
  position: relative;
  transition: background 0.25s;
  flex-shrink: 0;
}

.hk-switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.25s;
}

.hk-switch input:checked + .hk-switch__track {
  background: var(--brand-blue);
}

.hk-switch input:checked + .hk-switch__track::after {
  transform: translateX(18px);
}

.hk-switch input:focus-visible + .hk-switch__track {
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2);
}


/* --------------------------------------------------------------------------
   14. Responsive — Tablet (<=1024px)
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .hk-ins {
    padding: var(--hk-gap) var(--hk-gap-sm);
  }

  /* Stats: 2 columns */
  .hk-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Shortcuts: 2 columns */
  .hk-shortcuts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Products: 2 columns */
  .hk-product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Detail stats: 2 columns */
  .hk-detail-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Insurer grid: 3 columns */
  .hk-insurer-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Calculator: single column */
  .hk-calc-layout {
    grid-template-columns: 1fr;
  }

  /* Compare select: 2 slots per row */
  .hk-compare-select__slot {
    min-width: 180px;
  }
}


/* --------------------------------------------------------------------------
   15. Responsive — Mobile (<=768px)
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
  .hk-page-header__title {
    font-size: 24px;
  }

  /* Stats: 1 column */
  .hk-stats-grid {
    grid-template-columns: 1fr;
  }

  /* Shortcuts: 1 column */
  .hk-shortcuts-grid {
    grid-template-columns: 1fr;
  }

  /* Products: 1 column */
  .hk-product-grid {
    grid-template-columns: 1fr;
  }

  /* Detail header: stack */
  .hk-detail-header {
    flex-direction: column;
    align-items: stretch;
  }

  .hk-detail-header__logo {
    width: 56px;
    height: 56px;
  }

  .hk-detail-header__title {
    font-size: 22px;
  }

  .hk-detail-header__actions {
    flex-wrap: wrap;
  }

  /* Detail stats: 1 column */
  .hk-detail-stats {
    grid-template-columns: 1fr 1fr;
  }

  /* Tabs: scrollable */
  .hk-tabs {
    gap: 0;
    padding-bottom: 2px;
  }

  .hk-tab {
    padding: 10px 14px;
    font-size: 13px;
  }

  /* Info table: stacked on very small screens */
  .hk-info-table th,
  .hk-info-table td {
    display: block;
    width: 100%;
    padding: 10px 16px;
  }

  .hk-info-table th {
    padding-bottom: 2px;
  }

  .hk-info-table td {
    padding-top: 2px;
  }

  /* Projection table: horizontal scroll */
  .hk-projection-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Compare: stack vertically */
  .hk-compare-select {
    flex-direction: column;
  }

  .hk-compare-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Insurer grid: 2 columns */
  .hk-insurer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Filter bar: allow wrap */
  .hk-filter-bar {
    position: static;
    flex-direction: column;
    align-items: stretch;
  }

  /* Fulfillment table: horizontal scroll */
  .hk-fulfillment-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Pagination compact */
  .hk-pagination {
    gap: 2px;
  }

  .hk-pagination__btn {
    min-width: 32px;
    height: 32px;
    font-size: 13px;
  }
}


/* --------------------------------------------------------------------------
   16. Utility helpers (module-scoped)
   -------------------------------------------------------------------------- */

.hk-ins .hk-text-center { text-align: center; }
.hk-ins .hk-text-right  { text-align: right; }
.hk-ins .hk-mt-sm       { margin-top: var(--hk-gap-sm); }
.hk-ins .hk-mt-md       { margin-top: var(--hk-gap); }
.hk-ins .hk-mt-lg       { margin-top: var(--hk-gap-lg); }
.hk-ins .hk-mb-sm       { margin-bottom: var(--hk-gap-sm); }
.hk-ins .hk-mb-md       { margin-bottom: var(--hk-gap); }
.hk-ins .hk-mb-lg       { margin-bottom: var(--hk-gap-lg); }
.hk-ins .hk-flex        { display: flex; }
.hk-ins .hk-flex-center { display: flex; align-items: center; justify-content: center; }
.hk-ins .hk-flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hk-ins .hk-gap-sm      { gap: var(--hk-gap-sm); }
.hk-ins .hk-gap-md      { gap: var(--hk-gap); }
.hk-ins .hk-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}


/* ==========================================================================
   17. JS Template Classes — Flat naming used by app.js render functions
   ========================================================================== */

/* --------------------------------------------------------------------------
   17.1 Text helpers
   -------------------------------------------------------------------------- */

.hk-text-muted {
  color: var(--text-secondary);
  font-size: 14px;
}

.hk-text-danger {
  color: var(--hk-accent-red);
  font-size: 14px;
}

.hk-text-success {
  color: var(--hk-accent-green);
  font-size: 14px;
}


/* --------------------------------------------------------------------------
   17.2 Badges — pill-shaped inline labels
   -------------------------------------------------------------------------- */

.hk-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--hk-radius-pill);
  line-height: 1.5;
  white-space: nowrap;
  background: rgba(142, 142, 147, 0.12);
  color: var(--text-secondary);
}

.hk-badge-success {
  background: rgba(52, 199, 89, 0.12);
  color: var(--hk-accent-green);
}

.hk-badge-warning {
  background: rgba(255, 159, 10, 0.12);
  color: var(--hk-accent-yellow);
}

.hk-badge-info {
  background: rgba(0, 113, 227, 0.12);
  color: var(--brand-blue);
}

.hk-badge-muted {
  background: rgba(142, 142, 147, 0.12);
  color: var(--text-secondary);
}

.hk-badge-type {
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(0, 113, 227, 0.08);
  color: var(--brand-blue);
  border-radius: var(--hk-radius-pill);
}

.hk-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--hk-gap);
}


/* --------------------------------------------------------------------------
   17.3 Tags — small chip labels for currencies, terms
   -------------------------------------------------------------------------- */

.hk-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--hk-radius-pill);
  border: 1px solid var(--hk-border);
  background: var(--hk-input-bg);
  color: var(--text-secondary);
  white-space: nowrap;
}

.hk-tag-sm {
  padding: 2px 8px;
  font-size: 11px;
}


/* --------------------------------------------------------------------------
   17.4 Buttons — additional variants
   -------------------------------------------------------------------------- */

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

.hk-btn-primary:hover {
  background: #005bb5;
}

.hk-btn-lg {
  padding: 14px 32px;
  font-size: 16px;
}


/* --------------------------------------------------------------------------
   17.5 Tables — generic data table used across all tabs
   -------------------------------------------------------------------------- */

.hk-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--hk-border);
  border-radius: 12px;
  overflow: hidden;
  font-size: 14px;
}

.hk-table th,
.hk-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--hk-border);
}

.hk-table th {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: var(--hk-input-bg);
  white-space: nowrap;
}

.hk-table tbody tr {
  transition: background 0.2s ease;
}

.hk-table tbody tr:hover {
  background: var(--hk-card-hover);
}

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

.hk-table-section td {
  font-weight: 700;
  font-size: 13px;
  color: var(--brand-blue);
  background: var(--hk-input-bg);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 10px 16px;
}

.hk-clickable-row {
  cursor: pointer;
  transition: background 0.2s ease;
}

.hk-clickable-row:hover {
  background: var(--hk-card-hover);
}

.hk-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: var(--hk-gap-sm);
}

.hk-table-scroll .hk-table {
  min-width: 600px;
}


/* --------------------------------------------------------------------------
   17.6 Loading / Spinner — inline variant
   -------------------------------------------------------------------------- */

/* .hk-spinner is now aliased with .hk-loading__spinner in section 11 */

.hk-loading-inline {
  flex-direction: row;
  padding: var(--hk-gap) 0;
  gap: 10px;
}

.hk-loading-inline .hk-spinner {
  width: 20px;
  height: 20px;
  border-width: 2px;
}


/* --------------------------------------------------------------------------
   17.7 Toast notification
   -------------------------------------------------------------------------- */

/* When compare bar is visible, toast should appear above it */
.hk-toast {
  position: fixed;
  bottom: calc(32px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--card-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--hk-border);
  border-radius: var(--hk-radius-sm);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-color);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s ease, opacity 0.35s ease;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

.hk-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}


/* --------------------------------------------------------------------------
   17.8 Compare bar — fixed bottom bar
   -------------------------------------------------------------------------- */

.hk-compare-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--card-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--hk-border);
  padding: 12px var(--hk-gap);
}

.hk-compare-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--hk-gap-sm);
  font-size: 14px;
  color: var(--text-color);
}

.hk-compare-bar-inner span {
  flex: 1;
}

.hk-compare-check {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.hk-compare-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--hk-radius-pill);
  border: 1px solid var(--hk-border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.hk-compare-btn:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}

.hk-compare-btn.is-checked {
  background: var(--brand-blue);
  color: #fff;
  border-color: var(--brand-blue);
}


/* --------------------------------------------------------------------------
   17.9 Card grid & card sub-elements (flat naming)
   -------------------------------------------------------------------------- */

.hk-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--hk-gap);
}

.hk-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hk-gap-sm);
}

.hk-card-insurer {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hk-card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-color);
}

.hk-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hk-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: auto;
}

.hk-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.hk-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hk-metric-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-color);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hk-metric-label {
  font-size: 12px;
  color: var(--text-secondary);
}


/* --------------------------------------------------------------------------
   17.10 Dashboard — stat values/labels, quick cards
   -------------------------------------------------------------------------- */

.hk-dashboard h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--hk-gap);
  color: var(--text-color);
}

.hk-stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-color);
}

.hk-stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.hk-section {
  margin-bottom: var(--hk-gap-lg);
}

.hk-section h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: var(--hk-gap-sm);
  color: var(--text-color);
}

.hk-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--hk-gap);
}

.hk-quick-card {
  background: var(--card-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--hk-border);
  border-radius: 12px;
  padding: var(--hk-gap);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--hk-gap-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.hk-quick-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow);
  background: var(--hk-card-hover);
}

.hk-quick-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.hk-quick-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-color);
}


/* --------------------------------------------------------------------------
   17.11 Filter panel — expandable filter with chips, toggles, ranges
   -------------------------------------------------------------------------- */

.hk-filter-toggle-btn {
  margin-bottom: var(--hk-gap-sm);
}

.hk-filter-panel {
  display: none;
  background: var(--card-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--hk-border);
  border-radius: 12px;
  padding: var(--hk-gap);
  margin-bottom: var(--hk-gap);
}

.hk-filter-panel.is-open {
  display: block;
}

.hk-filter-section {
  display: flex;
  flex-direction: column;
  gap: var(--hk-gap);
}

.hk-filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hk-filter-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hk-filter-row {
  flex-direction: row;
  gap: var(--hk-gap);
  flex-wrap: wrap;
}

.hk-filter-row > div {
  flex: 1;
  min-width: 200px;
}

.hk-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.hk-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-color);
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
}

.hk-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hk-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--hk-radius-pill);
  border: 1px solid var(--hk-border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.hk-chip:hover {
  background: rgba(0, 113, 227, 0.06);
  border-color: var(--brand-blue);
}

.hk-chip.is-active {
  background: var(--brand-blue);
  color: #fff;
  border-color: var(--brand-blue);
}

.hk-range-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hk-range-inputs span {
  color: var(--text-secondary);
  font-size: 13px;
}

.hk-filter-toggles {
  flex-direction: row;
  gap: var(--hk-gap);
}

.hk-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-color);
  cursor: pointer;
  user-select: none;
}


/* --------------------------------------------------------------------------
   17.12 Form inputs
   -------------------------------------------------------------------------- */

.hk-input {
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  border-radius: var(--hk-radius-sm);
  border: 1px solid var(--hk-border);
  background: var(--hk-input-bg);
  color: var(--text-color);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hk-input:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.hk-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.hk-input-sm {
  padding: 6px 10px;
  font-size: 13px;
  width: 90px;
}


/* --------------------------------------------------------------------------
   17.13 Product list toolbar
   -------------------------------------------------------------------------- */

.hk-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hk-gap-sm);
  margin-bottom: var(--hk-gap);
  flex-wrap: wrap;
}

.hk-toolbar-left {
  display: flex;
  align-items: center;
  gap: var(--hk-gap-sm);
}

.hk-toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--hk-gap-sm);
}

.hk-result-count {
  font-size: 14px;
  color: var(--text-secondary);
}

.hk-view-toggle {
  display: inline-flex;
  gap: 4px;
}


/* --------------------------------------------------------------------------
   17.14 Tabs — tab-nav, tab-btn, tab-panel
   -------------------------------------------------------------------------- */

.hk-tab-nav {
  display: flex;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-bottom: 1px solid var(--hk-border);
  margin-bottom: var(--hk-gap);
}

.hk-tab-nav::-webkit-scrollbar {
  display: none;
}

.hk-tab-btn {
  flex-shrink: 0;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.hk-tab-btn:hover {
  color: var(--text-color);
}

.hk-tab-btn.is-active {
  color: var(--brand-blue);
  border-bottom-color: var(--brand-blue);
}

.hk-tab-panel {
  display: none;
  animation: hk-fade-in 0.3s ease;
}

.hk-tab-panel.is-active {
  display: block;
}


/* --------------------------------------------------------------------------
   17.15 Product detail — flat-named sub-elements
   -------------------------------------------------------------------------- */

.hk-detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--hk-gap);
  flex-wrap: wrap;
}

.hk-detail-insurer {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: block;
  margin-bottom: 4px;
}

.hk-detail-tagline {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 8px;
  margin-bottom: var(--hk-gap-sm);
}

.hk-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.hk-detail-currencies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--hk-gap-sm);
}

.hk-detail-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.hk-key-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--hk-gap);
  margin-bottom: var(--hk-gap-lg);
}

.hk-key-stat {
  background: var(--card-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--hk-border);
  border-radius: 12px;
  padding: var(--hk-gap);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hk-key-stat-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-color);
}

.hk-key-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
}


/* --------------------------------------------------------------------------
   17.16 Chart wrapper & scenario bar
   -------------------------------------------------------------------------- */

.hk-chart-wrap {
  background: var(--card-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--hk-border);
  border-radius: 12px;
  padding: var(--hk-gap);
}

.hk-chart-wrap canvas {
  width: 100% !important;
  max-height: 380px;
}

.hk-chart-wrap h3,
.hk-chart-wrap h4 {
  margin-bottom: var(--hk-gap-sm);
  color: var(--text-color);
}

.hk-scenario-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--hk-gap);
  font-size: 14px;
  color: var(--text-secondary);
}

.hk-scenario-bar .hk-btn.is-active {
  background: var(--brand-blue);
  color: #fff;
}


/* --------------------------------------------------------------------------
   17.17 Disclosure
   -------------------------------------------------------------------------- */

.hk-disclosure {
  background: var(--card-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--hk-border);
  border-radius: 12px;
  padding: var(--hk-gap);
}

.hk-disclosure h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: var(--hk-gap-sm);
  color: var(--text-color);
}

.hk-disclosure-note {
  background: var(--hk-input-bg);
  border-radius: var(--hk-radius-sm);
  padding: var(--hk-gap-sm) var(--hk-gap);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}


/* --------------------------------------------------------------------------
   17.18 Insurer cards & detail — flat-named sub-elements
   -------------------------------------------------------------------------- */

.hk-insurer-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--hk-border);
  flex-shrink: 0;
}

.hk-insurer-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hk-insurer-initial {
  font-size: 24px;
  font-weight: 700;
  color: var(--brand-blue);
}

.hk-insurer-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hk-insurer-info h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-color);
  line-height: 1.3;
}

.hk-insurer-rating {
  font-size: 14px;
  color: var(--hk-accent-yellow);
  letter-spacing: 1px;
}

.hk-insurer-detail-header {
  display: flex;
  align-items: center;
  gap: var(--hk-gap);
  flex-wrap: wrap;
}

.hk-insurer-logo-lg {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--hk-border);
  flex-shrink: 0;
}

.hk-insurer-logo-lg img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Dark mode overrides for insurer logos */
html.dark .hk-insurer-logo,
html[data-theme="dark"] .hk-insurer-logo {
  background: var(--card-bg, rgba(44,44,46,0.5));
}

html.dark .hk-insurer-logo-lg,
html[data-theme="dark"] .hk-insurer-logo-lg {
  background: var(--card-bg, rgba(44,44,46,0.5));
}

.hk-insurer-initial-lg {
  font-size: 32px;
  font-weight: 700;
  color: var(--brand-blue);
}


/* --------------------------------------------------------------------------
   17.19 Fulfillment bar visualization
   -------------------------------------------------------------------------- */

.hk-bar-viz {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: var(--hk-border);
  overflow: hidden;
  min-width: 80px;
}

.hk-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}


/* --------------------------------------------------------------------------
   17.20 Calculator form
   -------------------------------------------------------------------------- */

.hk-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--hk-gap);
}

.hk-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hk-form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.hk-form-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: var(--hk-gap-sm);
}


/* --------------------------------------------------------------------------
   17.21 Compare page — empty state
   -------------------------------------------------------------------------- */

.hk-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--hk-gap-xl) var(--hk-gap);
  text-align: center;
}

.hk-empty-state h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: var(--hk-gap-sm);
  color: var(--text-color);
}

.hk-empty-state p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: var(--hk-gap);
}


/* --------------------------------------------------------------------------
   17.22 Responsive overrides for JS-introduced classes
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .hk-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hk-quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hk-key-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .hk-form-grid {
    grid-template-columns: 1fr;
  }

  .hk-checkbox-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .hk-quick-grid {
    grid-template-columns: 1fr;
  }

  .hk-key-stats {
    grid-template-columns: 1fr 1fr;
  }

  .hk-card-metrics {
    grid-template-columns: repeat(3, 1fr);
  }

  .hk-list-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .hk-toolbar-right {
    flex-wrap: wrap;
  }

  .hk-detail-title-row {
    flex-direction: column;
  }

  .hk-insurer-detail-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hk-filter-row {
    flex-direction: column;
  }

  .hk-checkbox-grid {
    grid-template-columns: 1fr;
  }
}


/* --------------------------------------------------------------------------
   18. Active / press feedback states
   -------------------------------------------------------------------------- */

.hk-quick-card:active { transform: scale(0.97); }
.hk-chip:active { transform: scale(0.95); }
.hk-tab-btn:active { opacity: 0.7; }
.hk-compare-btn:active { transform: scale(0.95); }
.hk-clickable-row:active { background: var(--hk-card-hover, rgba(0,0,0,0.03)); }
.hk-insurer-card:active { transform: scale(0.98); }


/* --------------------------------------------------------------------------
   19. Missing page wrapper classes used by JS
   -------------------------------------------------------------------------- */

/* Page wrapper - provides consistent padding and max-width */
.hk-page {
  padding: 0 0 60px 0;
}

/* Error icon in renderError */
.hk-error-icon {
  font-size: 48px;
  margin-bottom: 16px;
  color: var(--hk-accent-yellow, #ff9500);
}

/* Dashboard page wrapper */
.hk-dashboard {
  /* inherits from .hk-page */
}

/* Products page wrapper */
.hk-products {
  /* inherits from .hk-page */
}

/* Product detail page wrapper */
.hk-product-detail {
  /* inherits from .hk-page */
}

/* Compare page wrapper */
.hk-compare {
  /* inherits from .hk-page */
}

/* Fulfillment page wrapper */
.hk-fulfillment {
  /* inherits from .hk-page */
}

/* Calculator page wrapper */
.hk-calculator {
  /* inherits from .hk-page */
}

/* Insurers page wrapper */
.hk-insurers {
  /* inherits from .hk-page */
}

/* Insurer detail page wrapper */
.hk-insurer-detail {
  /* inherits from .hk-page */
}

/* --------------------------------------------------------------------------
   20. Back button / page navigation bar
   -------------------------------------------------------------------------- */

.hk-page-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.hk-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--hk-border);
  border-radius: var(--hk-radius-sm, 8px);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
}

.hk-back-btn:hover {
  background: var(--hk-card-hover, rgba(0,0,0,0.04));
  color: var(--text-color);
}

.hk-back-btn:active {
  transform: scale(0.97);
}

.hk-back-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
}
