:root {
  --bg:#ffffff;
  --ink:#111827;
  --muted:#6b7280;
  --line:#e5e7eb;
  --line-strong:#d1d5db;
  --brand:#0f766e;
  --danger:#dc2626;
  --bronze:#b87333;
  --lp-sticky-offset:0px;
}

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px 32px;
}

.compare-module {
  position: relative;
  width: 100%;
}

.sticky-controls {
  position: -webkit-sticky;
  position: sticky;
  top: var(--lp-sticky-offset, 0px);
  z-index: 20;
  background: rgba(255, 255, 255, 0.98);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
          backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 12px 0 0;
}

.input-section {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  -webkit-box-shadow: none;
          box-shadow: none;
  border-radius: 0;
}

.input-compact {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  gap: 16px;
  width: min(100%, 620px);
  margin: 0 auto;
}

.input-section h2 {
  -webkit-box-flex: 0;
      -ms-flex: 0 0 auto;
          flex: 0 0 auto;
  width: 112px;
  height: 64px;
  margin: 0 !important;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  padding: 0 14px 0 10px;
  clip-path: polygon(0 0, 84% 0, 100% 50%, 84% 100%, 0 100%);
  background: #cbd5e1;
  color: #111827;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
}

.inputs {
  -webkit-box-flex: 1;
      -ms-flex: 1 1 auto;
          flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  -webkit-box-align: end;
      -ms-flex-align: end;
          align-items: end;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  justify-items: center;
  min-width: 0;
}

label,
.total-box span:first-child {
  display: block;
  font-weight: 800;
  font-size: 13px;
  color: #000;
  text-align: center;
  white-space: nowrap;
}

.count-select {
  position: relative;
  width: min(100%, 84px);
  max-width: 100%;
}

.count-select__trigger {
  width: 100%;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 0 24px 0 6px;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  background: #fff;
  color: #000;
  cursor: pointer;
  position: relative;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-appearance: none;
  -moz-appearance: none;
       appearance: none;
}

.count-select__trigger:after {
  content: "";
  position: absolute;
  right: 9px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid #6b7280;
  border-bottom: 2px solid #6b7280;
  -webkit-transform: translateY(-70%) rotate(45deg);
      -ms-transform: translateY(-70%) rotate(45deg);
          transform: translateY(-70%) rotate(45deg);
  -webkit-transition: -webkit-transform 0.15s;
  transition: -webkit-transform 0.15s;
  transition: transform 0.15s;
  transition: transform 0.15s, -webkit-transform 0.15s;
}

.count-select.is-open .count-select__trigger {
  outline: 3px solid #99f6e4;
  border-color: var(--brand);
}

.count-select.is-open .count-select__trigger:after {
  -webkit-transform: translateY(-30%) rotate(225deg);
      -ms-transform: translateY(-30%) rotate(225deg);
          transform: translateY(-30%) rotate(225deg);
}

.count-select__list {
  position: absolute;
  z-index: 30;
  top: -webkit-calc(100% + 4px);
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 216px;
  overflow-y: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  -webkit-box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
          box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  display: none;
}

.count-select.is-open .count-select__list {
  display: block;
}

.count-select__option {
  padding: 7px 8px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  border-radius: 4px;
  cursor: pointer;
}

.count-select__option.is-active {
  background: #f0fdfa;
  color: var(--brand);
}

.count-select__option.is-selected {
  background: #ccfbf1;
  color: var(--brand);
}

.count-select__option.is-hidden {
  display: none;
}

.total-box {
  min-height: 34px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  justify-items: center;
  -webkit-box-align: end;
      -ms-flex-align: end;
          align-items: end;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #000;
}

.total-box strong {
  min-height: 34px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #000;
  line-height: 1;
  white-space: nowrap;
}

.notice {
  margin: 10px auto 0;
  color: #000;
  font-size: 13px;
  line-height: 1.6;
  width: min(100%, 620px);
}

.down-marker {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  height: 18px;
  margin-top: 8px;
  margin-bottom: 10px;
  color: #000;
  font-size: 0;
  line-height: 1;
  font-weight: 900;
}

.down-marker:before {
  content: "";
  display: block;
  width: 12px;
  height: 12px;
  border-right: 3px solid #000;
  border-bottom: 3px solid #000;
  -webkit-transform: rotate(45deg);
      -ms-transform: rotate(45deg);
          transform: rotate(45deg);
}

.table-head-wrap {
  width: 100%;
  border-top: 1px solid var(--line-strong);
  overflow: visible;
}

.result-section {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  -webkit-box-shadow: none;
          box-shadow: none;
  border-radius: 0;
}

.table-wrap {
  width: 100%;
  overflow: visible;
  -webkit-overflow-scrolling: auto;
}

table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 0;
  background: #fff;
}

col.metric-col {
  width: 28%;
}

col.service-col {
  width: 24%;
}

th, td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-break: normal;
}

th:first-child, td:first-child {
  text-align: left;
}

thead th {
  background: #f9fafb;
  font-size: 15px;
  color: #374151;
  font-weight: 800;
  line-height: 1.35;
  padding: 10px 0;
  text-align: center;
}

tbody td,
tbody th {
  padding: 10px 0;
}

tbody td {
  border-bottom: 1px solid var(--line);
  text-align: center;
}

tbody tr:hover {
  background: #f9fafb;
}

.metric-cell {
  min-width: 0;
}

.metric-cell.indent {
  padding-left: 16px;
}

.metric-cell.indent .metric {
  position: relative;
  font-weight: 700;
  color: #374151;
}

.metric-cell.indent .metric:before {
  content: "";
  position: absolute;
  left: -13px;
  top: 0.72em;
  width: 8px;
  height: 1px;
  background: #9ca3af;
}

.metric {
  font-size: 17px;
  font-weight: 800;
  color: #111827;
  white-space: normal;
}

.metric small {
  font-size: 0.65em;
  vertical-align: super;
  line-height: 0;
}

.table-note {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.metric-sub {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--muted);
  margin-top: 2px;
}

.svc-short {
  display: none;
}

.cell-content {
  display: -webkit-inline-box;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: end;
      -ms-flex-pack: end;
          justify-content: flex-end;
  -ms-flex-wrap: wrap;
      flex-wrap: wrap;
}

.value-cell {
  font-size: 18px;
  font-weight: 400;
  white-space: normal;
  line-height: 1.45;
}

.value-cell .value {
  font-size: 18px;
  font-weight: 400;
  color: #6b7280;
  white-space: nowrap;
}

.value-cell.rank-cheapest .value,
.value-cell.rank-most .value {
  color: var(--danger);
  font-weight: 800;
}

.value-cell.rank-second .value {
  color: var(--bronze);
  font-weight: 800;
}

.value-cell.rank-third .value {
  color: #6b7280;
  font-weight: 400;
}

.badge {
  display: inline-block;
  margin-right: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  vertical-align: middle;
  white-space: nowrap;
}

.badge.cheapest, .badge.most {
  background: #fee2e2;
  color: var(--danger);
}

.diff {
  display: inline-block;
  margin-right: 5px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 400;
  white-space: nowrap;
}

.unavailable {
  font-size: 18px;
  color: #9ca3af;
  font-weight: 400;
  white-space: normal;
  line-height: 1.45;
}

@media (max-width: 780px) {
  .container {
    padding: 0 12px 28px;
  }
  .sticky-controls {
    padding: 10px 0 0;
  }
  .input-compact {
    gap: 10px;
    width: min(100%, 560px);
  }
  .notice {
    width: min(100%, 560px);
  }
  .input-section h2 {
    width: 98px;
    height: 60px;
    font-size: 12px;
  }
  .inputs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }
  th, td {
    padding: 10px 7px;
  }
  thead th {
    font-size: 13.5px;
  }
  .value-cell .value {
    font-size: 16px;
  }
  .value-cell {
    font-size: 16px;
  }
  .metric {
    font-size: 14.5px;
  }
  .metric-sub {
    font-size: 12px;
  }
  .badge {
    font-size: 10px;
    padding: 2px 5px;
    margin-right: 3px;
  }
  .diff {
    font-size: 10.5px;
    margin-right: 3px;
    font-weight: 400;
  }
}
@media (max-width: 520px) {
  .container {
    padding: 0 8px 24px;
  }
  .svc-full {
    display: none;
  }
  .svc-short {
    display: inline;
  }
  thead th:not(:first-child) {
    text-align: center;
  }
  .value-cell, .unavailable {
    text-align: center;
  }
  .cell-content {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    gap: 2px;
  }
  .cell-content .badge, .cell-content .diff {
    -webkit-box-ordinal-group: 2;
        -ms-flex-order: 1;
            order: 1;
  }
  .cell-content .value {
    -webkit-box-ordinal-group: 3;
        -ms-flex-order: 2;
            order: 2;
  }
  .cell-content .badge {
    margin: 0 auto 2px;
  }
  .cell-content .diff {
    margin: 0 0 2px;
  }
  .input-compact {
    gap: 6px;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    width: 100%;
    max-width: none;
  }
  .notice {
    width: 100%;
  }
  .input-section h2 {
    width: 88px;
    height: 58px;
    font-size: 11px;
    padding: 0 12px 0 8px;
  }
  .inputs {
    gap: 5px;
  }
  label,
  .total-box span:first-child {
    font-size: 12px;
  }
  .count-select {
    width: 100%;
  }
  .count-select__trigger {
    height: 34px;
    padding: 0 20px 0 4px;
    font-size: 15px;
    border-radius: 5px;
  }
  .count-select__trigger:after {
    right: 7px;
    width: 6px;
    height: 6px;
  }
  .count-select__option {
    font-size: 14px;
    padding: 3px;
  }
  .total-box {
    min-height: 34px;
    gap: 6px;
  }
  .total-box strong {
    min-height: 34px;
    font-size: 15px;
  }
  .down-marker {
    height: 16px;
    margin-top: 6px;
    margin-bottom: 10px;
  }
  .down-marker:before {
    width: 10px;
    height: 10px;
    border-right-width: 2.5px;
    border-bottom-width: 2.5px;
  }
  col.metric-col {
    width: 26%;
  }
  col.service-col {
    width: 24.666%;
  }
  th, td {
    padding: 8px 4px;
  }
  thead th {
    font-size: 11.5px;
    line-height: 1.25;
  }
  .metric {
    font-size: 12.5px;
    line-height: 1.25;
  }
  .metric-sub {
    font-size: 10.8px;
    line-height: 1.2;
  }
  .metric-cell.indent {
    padding-left: 16px;
  }
  .metric-cell.indent .metric:before {
    left: -9px;
    width: 6px;
  }
  .value-cell,
  .value-cell .value {
    font-size: 13px;
    line-height: 1.35;
  }
  .badge {
    font-size: 9px;
    padding: 1px 4px;
    margin-right: 2px;
  }
  .diff {
    display: block;
    font-size: 9.5px;
    margin-right: 0;
    margin-bottom: 0;
    font-weight: 400;
  }
  .unavailable {
    font-size: 11px;
    line-height: 1.35;
  }
}
@media (max-width: 360px) {
  .container {
    padding: 0 6px 24px;
  }
  .input-compact {
    gap: 5px;
  }
  .input-section h2 {
    width: 74px;
    height: 56px;
    font-size: 10.5px;
    padding: 0 10px 0 7px;
  }
  .inputs {
    gap: 4px;
  }
  label,
  .total-box span:first-child {
    font-size: 11px;
  }
  .count-select__trigger {
    font-size: 14px;
    padding: 0 18px 0 3px;
  }
  .total-box strong {
    font-size: 14px;
  }
  th, td {
    padding: 8px 3px;
  }
  thead th {
    font-size: 11.2px;
  }
  .metric {
    font-size: 12.2px;
  }
  .metric-sub {
    font-size: 10.5px;
  }
  .value-cell,
  .value-cell .value {
    font-size: 12.6px;
  }
  .badge {
    font-size: 8.8px;
  }
  .diff {
    font-size: 9.3px;
  }
}
@media print {
  .sticky-controls {
    position: static;
    background: #fff;
    -webkit-backdrop-filter: none;
            backdrop-filter: none;
  }
  .container {
    max-width: none;
    padding: 0;
  }
}