:root {
  --ink: #172235;
  --navy: #10243f;
  --teal: #0b7c86;
  --blue: #1769aa;
  --gold: #b78b2f;
  --paper: #ffffff;
  --soft: #f5f8fb;
  --line: #d9e4ec;
  --muted: #687789;
  --danger: #b84343;
  --success: #14725f;
  --shadow: 0 20px 50px rgba(16, 36, 63, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: linear-gradient(180deg, #fbfcfd 0%, #edf4f7 100%);
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  padding: 18px clamp(18px, 4vw, 52px) 34px;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(16, 36, 63, 0.95), rgba(11, 124, 134, 0.86)),
    url("assets/logo642insurance-white.png");
  background-size: auto, min(620px, 88vw);
  background-position: center, right 28px bottom 20px;
  background-repeat: no-repeat;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 38px;
}

.brand-row img {
  width: min(248px, 58vw);
  height: auto;
  display: block;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.brand-row nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.brand-row a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.92rem;
  font-weight: 800;
}

.hero {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: 28px;
}

.hero > *,
.layout > *,
.result-grid > *,
.difference-band > * {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 880px;
  margin-bottom: 16px;
  font-size: clamp(2.1rem, 5vw, 4.2rem);
  line-height: 1.08;
  font-weight: 950;
  overflow-wrap: anywhere;
  word-break: break-all;
}

h2 {
  margin-bottom: 0;
  color: var(--navy);
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  line-height: 1.22;
}

h3 {
  margin-bottom: 10px;
  color: var(--navy);
}

.hero-copy {
  max-width: 800px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.8;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.panel,
.product-card,
.lead-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.product-card span,
.difference-band span,
.lead-box span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

main {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 54px;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}

.panel {
  padding: 22px;
  box-shadow: var(--shadow);
}

.input-panel {
  position: static;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--navy);
  font-weight: 850;
}

.field span {
  min-height: 1.5em;
}

.field small {
  margin-top: -2px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.full-field {
  grid-column: 1 / -1;
}

.product-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
  overflow: visible;
}

.product-select-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  color: var(--navy);
}

.product-select-heading strong {
  font-size: 1.02rem;
}

.product-select-heading span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: right;
}

.setting-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbfd;
}

.setting-card:not(.is-unselected) {
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  order: -1;
  border-color: rgba(11, 124, 134, 0.42);
  background: #fff;
}

.setting-card.has-extra-setting {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.setting-card:not(.is-unselected) .product-toggle,
.setting-card.has-extra-setting .product-toggle {
  grid-column: 1 / -1;
}

.setting-card.is-unselected {
  background: #f6f8fa;
  opacity: 0.82;
}

.setting-card.is-unselected:hover {
  border-color: rgba(23, 105, 170, 0.28);
  background: #fff;
}

.setting-card.is-unselected .field {
  display: none;
  pointer-events: none;
}

.setting-card.is-unselected select {
  background: #eef2f5;
}

.product-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  align-self: center;
  min-height: 44px;
  color: var(--navy);
  cursor: pointer;
}

.product-toggle input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--teal);
}

.product-toggle span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.product-toggle small {
  color: var(--muted);
  font-weight: 800;
}

.setting-card:not(.is-unselected) .product-toggle small {
  color: var(--teal);
}

.setting-card strong,
.product-toggle strong {
  align-self: center;
  color: var(--navy);
  line-height: 1.35;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
}

input:focus,
select:focus,
button:focus {
  outline: 3px solid rgba(23, 105, 170, 0.18);
  border-color: var(--blue);
}

.divider {
  height: 1px;
  margin: 22px 0;
  background: var(--line);
}

.scenario-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.check-item {
  min-height: 58px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "box label"
    "box hint";
  align-items: center;
  column-gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--navy);
  background: #fff;
  font-weight: 900;
  cursor: pointer;
}

.check-item input {
  grid-area: box;
  width: 18px;
  min-height: 18px;
  accent-color: var(--teal);
}

.check-item span {
  grid-area: label;
}

.check-item small {
  grid-area: hint;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.check-item:has(input:checked) {
  border-color: rgba(11, 124, 134, 0.4);
  background: rgba(11, 124, 134, 0.08);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.product-card {
  padding: 18px;
  display: grid;
  grid-template-rows: 22px minmax(5.1rem, auto) 1fr;
  align-items: start;
}

.product-card > span {
  display: flex;
  align-items: center;
  min-height: 22px;
  margin-bottom: 0;
}

.product-card h3 {
  display: flex;
  align-items: flex-start;
  min-height: 5.1rem;
  margin-bottom: 12px;
  font-size: clamp(1.18rem, 1.7vw, 1.5rem);
  line-height: 1.26;
}

.product-card dl {
  display: grid;
  grid-template-rows: repeat(5, minmax(46px, auto));
  gap: 0;
  width: 100%;
  margin: 0;
}

.product-card dl div {
  display: grid;
  grid-template-columns: minmax(76px, 0.76fr) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 46px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

dt {
  color: var(--muted);
  font-weight: 800;
}

dd {
  margin: 0;
  color: var(--navy);
  font-weight: 950;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.difference-band {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.difference-band div {
  min-height: 92px;
  padding: 18px;
  border-radius: 8px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.difference-band strong {
  color: var(--navy);
  font-size: clamp(1.35rem, 2.5vw, 2rem);
}

.lead-box {
  margin-top: 14px;
  padding: 18px;
  background: #fffaf0;
  border-color: rgba(183, 139, 47, 0.32);
}

.lead-box p {
  margin-bottom: 0;
  color: var(--navy);
  font-size: 1.08rem;
  font-weight: 850;
  line-height: 1.75;
}

.recommendation-box {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid rgba(11, 124, 134, 0.24);
  border-radius: 8px;
  background: rgba(11, 124, 134, 0.07);
}

.recommendation-box span {
  display: block;
  margin-bottom: 8px;
  color: var(--teal);
  font-size: 0.86rem;
  font-weight: 900;
}

.recommendation-box h3 {
  margin-bottom: 8px;
}

.recommendation-box p {
  margin-bottom: 0;
  color: var(--ink);
  font-weight: 760;
  line-height: 1.75;
}

.alert-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.alert-list li {
  padding: 12px 14px;
  border: 1px solid rgba(184, 67, 67, 0.22);
  border-radius: 8px;
  color: #7c3434;
  background: #fff5f5;
  font-weight: 800;
  line-height: 1.6;
}

.table-panel {
  margin-top: 20px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: top;
}

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

th {
  color: var(--navy);
  background: #edf5f7;
  font-size: 0.92rem;
}

td {
  color: var(--ink);
  font-weight: 750;
}

.table-wrap th:not(:first-child):not(:last-child),
.table-wrap td:not(:first-child):not(:last-child) {
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.total-row td {
  border-top: 2px solid var(--navy);
  color: var(--navy);
  background: #f8fbfd;
  font-size: 1.02rem;
  font-weight: 950;
}

.muted-cell {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.55;
}

.age-limited-cell,
.not-covered-cell {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.age-limited-cell {
  color: #8b3a3a;
  background: #fff2f0;
  border: 1px solid rgba(184, 67, 67, 0.22);
}

.not-covered-cell {
  color: var(--muted);
  background: #f4f7f9;
  border: 1px solid var(--line);
}

.download-panel {
  margin-top: 20px;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.download-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.download-card > span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.download-card h3 {
  min-height: 3.2rem;
  margin-bottom: 0;
  font-size: 1.08rem;
  line-height: 1.45;
}

.download-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.download-button {
  display: grid;
  gap: 4px;
  min-height: 74px;
  align-content: center;
  padding: 10px 12px;
  border: 1px solid rgba(23, 105, 170, 0.28);
  border-radius: 6px;
  color: var(--navy);
  background: #fff;
}

.download-button span {
  font-weight: 950;
}

.download-button small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.download-button:hover {
  border-color: rgba(11, 124, 134, 0.56);
  background: rgba(11, 124, 134, 0.06);
}

.positive {
  color: var(--success);
}

.negative {
  color: var(--danger);
}

.source-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.5fr);
  gap: 16px;
  margin-top: 20px;
  padding: 18px 0;
  color: var(--muted);
}

.source-panel strong {
  display: block;
  margin-bottom: 6px;
  color: var(--navy);
}

.source-panel p {
  margin-bottom: 0;
  line-height: 1.7;
}

@media (max-width: 1080px) {
  .hero,
  .layout,
  .source-panel {
    grid-template-columns: 1fr;
  }

  .input-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .site-header {
    padding-inline: 16px;
  }

  .brand-row,
  .brand-row nav,
  .result-grid,
  .download-actions,
  .difference-band,
  .form-grid,
  .setting-card,
  .scenario-checks {
    grid-template-columns: 1fr;
  }

  .brand-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-row nav {
    display: grid;
    width: 100%;
  }

  .brand-row a {
    justify-content: center;
  }

  .product-settings {
    grid-template-columns: 1fr;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .setting-card:not(.is-unselected) {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 18px;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(2rem, 10vw, 2.7rem);
    line-height: 1.14;
  }

  .product-card dl div {
    grid-template-columns: 1fr;
  }

  dd {
    text-align: left;
  }
}
