:root {
  --ink: #13211f;
  --muted: #5f6f6b;
  --line: #d6dfdc;
  --panel: #ffffff;
  --wash: #f5f7f3;
  --green: #0f6b50;
  --green-dark: #0a4436;
  --red: #b73535;
  --red-dark: #7f2427;
  --gold: #d7ad57;
  --sky: #2f6f8f;
  --shadow: 0 18px 42px rgba(16, 30, 27, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: var(--wash);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    linear-gradient(180deg, rgba(14, 30, 25, 0.14), rgba(245, 247, 243, 0.82) 46%, var(--wash) 100%),
    url("assets/italy-hero.jpg") center top / cover no-repeat;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  min-height: 78px;
  padding: 10px clamp(20px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(19, 33, 31, 0.12);
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(16, 30, 27, 0.08);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand-logo {
  width: clamp(230px, 28vw, 360px);
  max-width: 60vw;
  height: auto;
  display: block;
}

.brand-slogan {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(215, 173, 87, 0.62);
  border-radius: 6px;
  background: rgba(15, 107, 80, 0.06);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

main {
  width: min(1360px, calc(100% - 40px));
  margin: 0 auto 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: end;
  min-height: 430px;
  padding: 64px 0 32px;
  color: #fff;
}

.hero-content {
  max-width: 820px;
  padding: 28px;
  border-left: 6px solid var(--gold);
  background: linear-gradient(90deg, rgba(9, 28, 23, 0.78), rgba(9, 28, 23, 0.32));
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0;
  color: #fff0b9;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}

h1,
h2,
p {
  letter-spacing: 0;
}

p,
small,
dd,
.formula {
  text-wrap: pretty;
}

h1,
h2,
.dashboard-grid article strong,
.breakdown-summary article strong,
.scenario-card strong,
.imprint-card strong {
  text-wrap: balance;
}

#dashboardNarrative,
#dashboardCommissionFormula,
#dashboardTravelFundText,
#dashboardPartnerBody,
#averageCaseHint,
#breakdownNarrative,
#breakdownAverageDetail,
#breakdownConversionDetail,
#breakdownMotivationBody {
  white-space: pre-line;
}

h1 {
  margin: 8px 0 0;
  font-size: 48px;
  line-height: 1.12;
}

.hero-title span {
  display: block;
}

.hero-title span:nth-child(2) {
  margin: 2px 0;
  color: #ffe8a6;
}

.hero-copy {
  max-width: 760px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 20px;
  line-height: 1.7;
}

.countdown-banner {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(127, 36, 39, 0.96), rgba(183, 53, 53, 0.9));
  color: #fff;
}

.countdown-banner span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 800;
}

.countdown-banner strong {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  color: #fff;
  font-size: 32px;
  line-height: 1;
}

.countdown-banner b {
  font: inherit;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.hero-actions span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.landmark-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-width: 720px;
  margin-top: 14px;
}

.landmark-row figure {
  display: grid;
  place-items: center;
  gap: 4px;
  min-width: 0;
  margin: 0;
  padding: 9px 6px 7px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.landmark-row svg {
  display: block;
  width: 76px;
  max-width: 100%;
  height: 52px;
  overflow: visible;
}

.landmark-row figcaption {
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.landmark-row .ground,
.landmark-row .stone-line,
.landmark-row .bridge-line,
.landmark-row .tower-line,
.landmark-row .dome-line,
.landmark-row .arch,
.landmark-row .tiny,
.landmark-row .water,
.landmark-row .gondola,
.landmark-row .spark {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.landmark-row .ground {
  stroke: #f4ddb3;
  stroke-width: 5;
}

.landmark-row .stone-fill,
.landmark-row .tower-fill,
.landmark-row .dome-fill,
.landmark-row .bridge-fill {
  fill: #fff1cf;
}

.landmark-row .stone-line,
.landmark-row .bridge-line,
.landmark-row .tower-line,
.landmark-row .dome-line,
.landmark-row .arch {
  stroke: #74443a;
  stroke-width: 4;
}

.landmark-row .tiny {
  stroke: #b73535;
  stroke-width: 4;
}

.landmark-row .water {
  stroke: #6fd0e3;
  stroke-width: 5;
}

.landmark-row .gondola {
  stroke: #243c39;
  stroke-width: 5;
}

.landmark-row .spark {
  fill: #ffe08a;
  stroke: #d7ad57;
  stroke-width: 3;
}

.hero-card {
  display: grid;
  gap: 10px;
}

.hero-card div {
  min-height: 118px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.hero-card span,
.hero-card-label,
.summary span,
.field label:first-child {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

.hero-card strong {
  display: block;
  margin-top: 8px;
  color: var(--red-dark);
  font-size: 30px;
  line-height: 1.1;
}

.hero-saving-select {
  height: 48px;
  margin-top: 8px;
  color: var(--red-dark);
  font-size: 22px;
  font-weight: 900;
}

.hero-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.action-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 18px;
}

.action-strip article {
  min-height: 128px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 26px rgba(19, 33, 31, 0.08);
}

.action-strip span {
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
}

.action-strip h2 {
  margin: 7px 0 0;
  color: var(--green-dark);
  font-size: 22px;
  line-height: 1.25;
}

.action-strip p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.tool-tabs {
  display: inline-flex;
  gap: 8px;
  margin: 0 0 14px;
  padding: 6px;
  border: 1px solid rgba(173, 195, 190, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 26px rgba(19, 33, 31, 0.08);
}

.tool-tabs button {
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--green-dark);
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.tool-tabs button.active {
  background: var(--green);
  color: #fff;
}

.tool-panel {
  display: none;
  scroll-margin-top: 92px;
}

.tool-panel.active {
  display: block;
}

.control-panel,
.summary,
.table-tools,
.results,
.dashboard-panel,
.breakdown-panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.control-panel {
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  gap: 16px;
  padding: 18px;
  border-radius: 8px;
}

.wide {
  grid-column: 1 / -1;
}

.control-panel > .wide {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
  align-items: end;
  gap: 8px 16px;
  padding: 14px;
  border: 1px solid rgba(183, 53, 53, 0.24);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 246, 243, 0.96), rgba(241, 247, 243, 0.96));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.control-panel > .wide label {
  grid-column: 1 / -1;
  color: var(--red-dark);
}

.control-panel > .field:not(.wide, .product-field, .switches) {
  grid-column: span 2;
}

.product-field {
  grid-column: span 6;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

select,
input[type="search"],
input[type="text"] {
  width: 100%;
  height: 44px;
  border: 1px solid #b9c9c5;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  padding: 0 12px;
}

input[readonly] {
  background: #f6faf8;
  cursor: default;
}

#targetSelect {
  min-height: 58px;
  padding: 0 56px 0 18px;
  border: 2px solid var(--red);
  border-radius: 8px;
  appearance: none;
  -webkit-appearance: none;
  background-color: #fff;
  background-image:
    url("data:image/svg+xml,%3Csvg width='22' height='22' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9L12 15L18 9' stroke='%23B73535' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
    linear-gradient(135deg, #fff 0%, #fff7ea 100%);
  background-repeat: no-repeat;
  background-position: right 18px center, center;
  background-size: 22px 22px, auto;
  color: var(--red-dark);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 12px 24px rgba(183, 53, 53, 0.16);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  animation: targetSelectNudge 2.8s ease-in-out infinite;
}

#targetSelect:hover {
  border-color: var(--red-dark);
  box-shadow: 0 14px 30px rgba(183, 53, 53, 0.22);
  transform: translateY(-1px);
  animation-play-state: paused;
}

#targetSelect:focus {
  border-color: var(--red-dark);
  box-shadow: 0 0 0 4px rgba(183, 53, 53, 0.16), 0 14px 30px rgba(183, 53, 53, 0.22);
  animation-play-state: paused;
}

@keyframes targetSelectNudge {
  0%,
  58%,
  100% {
    background-position: right 18px center, center;
    box-shadow: 0 12px 24px rgba(183, 53, 53, 0.16);
    transform: translateY(0) scale(1);
  }

  64% {
    background-position: right 16px center, center;
    box-shadow: 0 0 0 0 rgba(183, 53, 53, 0.18), 0 15px 28px rgba(183, 53, 53, 0.2);
    transform: translateY(-2px) scale(1.012);
  }

  72% {
    background-position: right 20px center, center;
    box-shadow: 0 0 0 8px rgba(183, 53, 53, 0), 0 12px 24px rgba(183, 53, 53, 0.16);
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  #targetSelect {
    animation: none;
  }
}

.field-hint {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

#targetSelectHint {
  align-self: stretch;
  display: flex;
  align-items: center;
  min-height: 58px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid rgba(183, 53, 53, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--green-dark);
}

select:focus,
input[type="search"]:focus,
input[type="text"]:focus,
.table-tools button:focus,
.tool-tabs button:focus {
  outline: 3px solid rgba(47, 111, 143, 0.22);
  outline-offset: 2px;
}

.table-tools button {
  min-height: 44px;
  border: 1px solid #adc3be;
  border-radius: 6px;
  background: #fff;
  color: var(--green-dark);
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.table-tools button:hover {
  border-color: var(--green);
  background: #eef7f2;
}

.switches {
  grid-column: span 4;
  gap: 7px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 25px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.3;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.summary {
  display: grid;
  grid-template-columns: 1.05fr 0.85fr 1fr 1.3fr;
  gap: 0;
  margin-top: 16px;
  border-radius: 8px;
  overflow: hidden;
}

.summary div {
  min-height: 96px;
  padding: 17px 18px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.summary div:first-child {
  background: #f1f7f3;
}

.summary div:nth-child(3) {
  background: #fff6f3;
}

.summary div:last-child {
  border-right: 0;
}

.summary strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.15;
}

.summary .formula {
  color: var(--green-dark);
  font-size: 17px;
  line-height: 1.35;
}

.table-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
}

.results {
  margin-top: 16px;
  border-radius: 8px;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 14px;
}

thead {
  background: #edf4f1;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #324845;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.3;
  white-space: nowrap;
}

tbody tr:hover {
  background: #fbf6ec;
}

td.number,
th.number {
  text-align: right;
}

.rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #edf4f1;
  color: var(--green-dark);
  font-weight: 900;
}

.product-code {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bonus-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #eaf4f0;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  white-space: nowrap;
}

.pill.special {
  background: #fff0ef;
  color: var(--red-dark);
}

.pill.long {
  background: #fff8e8;
  color: #7f5a14;
}

.premium {
  color: var(--red);
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
}

.empty {
  padding: 36px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.dashboard-panel,
.breakdown-panel {
  padding: 18px;
  border-radius: 8px;
}

.dashboard-hero,
.breakdown-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  align-items: stretch;
  padding: 22px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(15, 107, 80, 0.94), rgba(47, 111, 143, 0.82)),
    url("assets/italy-hero.jpg") center / cover no-repeat;
  color: #fff;
}

.eyebrow.dark {
  color: #fff0b9;
}

.dashboard-hero h2,
.breakdown-hero h2 {
  margin: 6px 0 0;
  font-size: 32px;
  line-height: 1.2;
}

.dashboard-hero p,
.breakdown-hero p {
  max-width: 760px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 17px;
  line-height: 1.65;
}

.dashboard-badge,
.breakdown-target {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-height: 150px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
}

.dashboard-badge span,
.dashboard-badge small,
.breakdown-target span,
.breakdown-target small {
  color: rgba(255, 255, 255, 0.84);
  font-weight: 800;
}

.dashboard-badge strong,
.breakdown-target strong {
  font-size: 34px;
  line-height: 1.05;
}

.dashboard-controls,
.breakdown-settings {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.breakdown-settings {
  grid-template-columns: minmax(220px, 1.15fr) repeat(3, minmax(150px, 0.95fr));
  gap: 10px;
}

.dashboard-controls label,
.breakdown-settings label {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.dashboard-controls span,
.breakdown-settings span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.input-with-unit {
  position: relative;
}

.input-with-unit input {
  padding-right: 46px;
  color: var(--green-dark);
  font-weight: 900;
}

.input-with-unit em {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.25fr repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.dashboard-grid article,
.scenario-card,
.imprint-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.dashboard-grid article span,
.scenario-card span,
.imprint-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.3;
}

.dashboard-grid article strong,
.scenario-card strong,
.imprint-card strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 25px;
  line-height: 1.18;
}

.dashboard-grid article p,
.imprint-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.dashboard-main-card {
  grid-row: span 2;
  background: linear-gradient(180deg, #fffaf1, #ffffff) !important;
}

.dashboard-main-card strong {
  color: var(--red-dark) !important;
  font-size: 36px !important;
}

.progress-track {
  height: 12px;
  margin-top: 16px;
  border-radius: 999px;
  background: #e9efeb;
  overflow: hidden;
}

.progress-track div {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--gold));
}

.dashboard-main-card small {
  display: block;
  margin-top: 8px;
  color: var(--green-dark);
  font-weight: 900;
}

.dashboard-detail {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
  margin-top: 16px;
}

.scenario-card dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0 0;
}

.scenario-card div {
  padding: 10px;
  border-radius: 6px;
  background: #f5f7f3;
}

.scenario-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.scenario-card dd {
  margin: 5px 0 0;
  color: var(--green-dark);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
}

.imprint-card {
  background: #f1f7f3;
}

.imprint-card strong {
  color: var(--green-dark);
}

.breakdown-summary {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.breakdown-summary article,
.funnel-stage {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.breakdown-summary article span,
.funnel-stage span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.breakdown-summary article strong,
.funnel-stage strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.12;
}

.breakdown-summary article p,
.funnel-stage small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.breakdown-main-card {
  background: linear-gradient(180deg, #fffaf1, #fff) !important;
}

.breakdown-main-card strong {
  color: var(--red-dark) !important;
  font-size: 38px !important;
}

.funnel-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.funnel-stage {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 158px;
}

.funnel-stage::after {
  position: absolute;
  right: -22px;
  bottom: -22px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: rgba(15, 107, 80, 0.08);
  content: "";
}

.funnel-stage.names {
  background: #fff8e8;
}

.funnel-stage.appointments {
  background: #f1f7f3;
}

.funnel-stage.proposals {
  background: #fff6f3;
}

.funnel-stage.deals {
  background: #edf4f1;
}

.funnel-stage.deals strong {
  color: var(--red-dark);
}

.breakdown-detail {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
  margin-top: 16px;
}

@media (max-width: 1180px) {
  main {
    width: min(1040px, calc(100% - 32px));
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 300px;
    min-height: 408px;
    gap: 18px;
    padding-top: 44px;
  }

  .hero-content {
    padding: 24px;
  }

  h1 {
    font-size: 42px;
  }

  .hero-copy {
    font-size: 18px;
  }

  .control-panel {
    grid-template-columns: 1fr 1fr;
  }

  .control-panel > .field:not(.wide, .product-field, .switches) {
    grid-column: auto;
  }

  .control-panel > .product-field,
  .control-panel > .wide,
  .control-panel > .switches {
    grid-column: 1 / -1;
  }

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

  .dashboard-controls,
  .dashboard-grid,
  .breakdown-summary,
  .funnel-panel {
    grid-template-columns: repeat(2, 1fr);
  }

  .breakdown-settings {
    grid-template-columns: minmax(190px, 1.15fr) repeat(3, minmax(125px, 0.95fr));
  }

  .dashboard-main-card {
    grid-row: auto;
    grid-column: span 2;
  }

  .dashboard-detail,
  .breakdown-detail,
  .scenario-card dl {
    grid-template-columns: 1fr;
  }

  .summary div:nth-child(2) {
    border-right: 0;
  }

  .results {
    overflow-x: auto;
  }

  table {
    min-width: 1220px;
  }
}

@media (max-width: 860px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    min-height: auto;
  }

  .brand-slogan {
    white-space: normal;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 28px 0 18px;
  }

  .hero-content {
    padding: 20px;
    background: rgba(9, 28, 23, 0.78);
  }

  h1 {
    font-size: 34px;
  }

  .breakdown-settings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .action-strip {
    grid-template-columns: 1fr;
  }

  .dashboard-hero,
  .breakdown-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  main {
    width: calc(100% - 24px);
  }

  .brand {
    align-items: flex-start;
  }

  .brand-logo {
    width: min(260px, 72vw);
    max-width: 100%;
  }

  .brand-mark {
    white-space: normal;
  }

  h1 {
    font-size: 30px;
  }

  .hero-copy {
    font-size: 16px;
  }

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

  .countdown-banner {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

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

  .hero-card,
  .control-panel,
  .summary,
  .table-tools,
  .dashboard-controls,
  .breakdown-settings,
  .dashboard-grid,
  .breakdown-summary,
  .funnel-panel {
    grid-template-columns: 1fr;
  }

  .tool-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }

  .tool-tabs button {
    padding: 8px 8px;
    font-size: 14px;
  }

  .dashboard-main-card {
    grid-column: auto;
  }

  .dashboard-hero h2,
  .breakdown-hero h2 {
    font-size: 26px;
  }

  .breakdown-main-card strong {
    font-size: 34px !important;
  }

  .control-panel > .field {
    grid-column: 1 / -1;
  }

  .control-panel > .wide {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  #targetSelect {
    min-height: 54px;
    font-size: 22px;
  }

  #targetSelectHint {
    min-height: auto;
  }

  .summary div {
    border-right: 0;
  }
}
