:root {
  --ink: #142432;
  --ink-soft: #435463;
  --navy: #12324a;
  --blue: #1e66d0;
  --blue-soft: #e8f1ff;
  --mint: #087f68;
  --mint-soft: #e2f5ef;
  --amber: #b86705;
  --amber-soft: #fff1d8;
  --red: #b6423b;
  --red-soft: #fff0ed;
  --paper: #f4f7f8;
  --white: #ffffff;
  --line: #d6e0e5;
  --line-dark: #aebdc6;
  --shadow: 0 22px 70px rgba(18, 50, 74, 0.12);
  --shadow-soft: 0 10px 34px rgba(18, 50, 74, 0.08);
  --radius-lg: 24px;
  --radius-md: 15px;
  --radius-sm: 9px;
  --font-body: "IBM Plex Sans KR", "Pretendard", "Noto Sans KR", system-ui, sans-serif;
  --font-display: "Gowun Batang", "Nanum Myeongjo", serif;
  --font-data: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--white);
  background: var(--navy);
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgba(30, 102, 208, 0.42);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 10px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  color: var(--white);
  background: rgba(13, 40, 59, 0.96);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  transform: rotate(45deg);
}

.brand-mark span {
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.08);
}

.brand-mark span:nth-child(2) {
  background: #68d0b7;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-copy strong {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand-copy small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.header-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.status-pill,
.source-badge,
.law-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-pill::before,
.source-badge::before {
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-pill--verified {
  color: #83e0c7;
  border-color: rgba(131, 224, 199, 0.35);
}

.hero {
  position: relative;
  display: grid;
  min-height: 680px;
  padding: 90px max(24px, calc((100vw - 1240px) / 2)) 100px;
  overflow: visible;
  grid-template-columns: minmax(0, 0.84fr) minmax(520px, 1.16fr);
  gap: clamp(44px, 7vw, 96px);
  align-items: center;
  color: var(--white);
  background: var(--navy);
}

.hero::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 11% 8%, rgba(58, 134, 224, 0.23), transparent 29%),
    linear-gradient(126deg, transparent 56%, rgba(104, 208, 183, 0.07) 56%, rgba(104, 208, 183, 0.07) 75%, transparent 75%);
  content: "";
}

.hero-grid {
  position: absolute;
  inset: 0 51% 0 0;
  opacity: 0.13;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.27) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.27) 1px, transparent 1px);
  background-size: 54px 54px;
  transform: skewX(-8deg) scale(1.2);
  transform-origin: bottom left;
}

.hero-copy,
.search-sheet {
  position: relative;
  z-index: 1;
}

.eyebrow,
.kicker {
  margin: 0 0 12px;
  color: var(--mint);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #83e0c7;
}

.hero h1 {
  max-width: 620px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(42px, 5vw, 68px);
  line-height: 1.17;
  letter-spacing: -0.06em;
}

.hero h1 em {
  position: relative;
  color: #a9e8d7;
  font-style: normal;
}

.hero h1 em::after {
  position: absolute;
  right: 0;
  bottom: -4px;
  left: 0;
  height: 5px;
  border-radius: 50%;
  background: rgba(104, 208, 183, 0.42);
  content: "";
  transform: rotate(-1deg);
}

.hero-lead {
  max-width: 570px;
  margin: 30px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 17px;
  line-height: 1.8;
  word-break: keep-all;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 18px;
  margin-top: 32px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
}

.trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.trust-row span::before {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #83e0c7;
  content: "";
}

.search-sheet {
  position: relative;
  padding: clamp(28px, 4vw, 46px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px 4px 28px 4px;
  color: var(--ink);
  background: var(--white);
  box-shadow: 22px 22px 0 rgba(4, 24, 38, 0.28), var(--shadow);
}

.search-sheet::after {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 52px;
  height: 52px;
  border-right: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
  content: "";
}

.sheet-index {
  position: absolute;
  top: 0;
  right: 0;
  padding: 8px 13px;
  color: var(--white);
  background: var(--blue);
  font-family: var(--font-data);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.sheet-heading,
.card-title-row,
.workspace-header,
.result-masthead,
.result-card-head,
.timeline-head,
.strategy-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.sheet-heading h2,
.workspace-header h2,
.result-masthead h2,
.strategy-heading h3,
.timeline-head h3 {
  margin: 0;
  letter-spacing: -0.04em;
}

.sheet-heading h2 {
  font-size: clamp(22px, 2.6vw, 31px);
}

.kicker {
  margin-bottom: 6px;
  color: var(--blue);
  letter-spacing: 0.09em;
}

.step-time,
.required-note,
.optional-note {
  flex: none;
  padding: 5px 9px;
  border-radius: 6px;
  color: var(--ink-soft);
  background: #edf2f5;
  font-size: 11px;
  font-weight: 600;
}

.required-note {
  color: var(--red);
  background: var(--red-soft);
}

.optional-note {
  color: var(--mint);
  background: var(--mint-soft);
}

.search-form {
  margin-top: 32px;
}

.search-form > label,
.field > span:first-child,
.field > .field-label,
.choice-field legend,
.quick-label {
  display: block;
  margin-bottom: 9px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.search-control {
  display: grid;
  min-height: 64px;
  border: 2px solid var(--navy);
  border-radius: 12px;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-control:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 5px rgba(30, 102, 208, 0.11);
}

.search-control svg {
  width: 22px;
  margin-left: 17px;
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1.8;
}

.search-control input {
  min-width: 0;
  height: 100%;
  padding: 0 12px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 16px;
}

.search-control input::placeholder {
  color: #8a99a3;
}

.search-control button {
  align-self: stretch;
  min-width: 88px;
  border: 0;
  color: var(--white);
  background: var(--navy);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}

.search-control button:hover {
  background: var(--blue);
}

.field-help,
.field small,
.data-caution,
.submit-note,
.result-caption {
  display: block;
  margin: 8px 0 0;
  color: #70818d;
  font-size: 12px;
  line-height: 1.55;
}

.demo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  color: var(--ink-soft);
  font-size: 12px;
}

.api-connection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.api-connection-copy {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.api-connection-copy > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.api-connection-copy strong {
  color: var(--ink);
  font-size: 12px;
}

.api-connection-copy small {
  color: var(--ink-soft);
  font-size: 11px;
}

.live-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(17, 137, 110, 0.12);
}

.api-connection.needs-key .live-dot {
  background: var(--orange);
  box-shadow: 0 0 0 5px rgba(220, 128, 30, 0.12);
}

.api-key-form {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #cbd8df;
  border-radius: 10px;
  background: #f6fafc;
}

.api-key-form[hidden] {
  display: none;
}

.api-key-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.api-key-form > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.api-key-form input {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #b8c9d2;
  border-radius: 8px;
  outline: 0;
  background: var(--white);
}

.api-key-form input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(30, 102, 208, 0.1);
}

.api-key-form button {
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  color: var(--white);
  background: var(--navy);
  font-weight: 700;
  cursor: pointer;
}

.api-key-form p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.text-button,
.small-link {
  padding: 0;
  border: 0;
  color: var(--blue);
  background: none;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.inline-feedback {
  min-height: 20px;
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 12px;
}

.inline-feedback.is-error {
  color: var(--red);
}

.search-results {
  position: absolute;
  z-index: 10;
  right: clamp(28px, 4vw, 46px);
  left: clamp(28px, 4vw, 46px);
  display: grid;
  max-height: min(72vh, 560px);
  margin-top: 5px;
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  background: var(--white);
  box-shadow: var(--shadow-soft);
  grid-template-rows: auto auto minmax(0, 1fr);
}

.search-results-head {
  display: flex;
  min-height: 52px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfc;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.search-results-head div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.search-results-head strong {
  color: var(--navy);
  font-family: var(--font-data);
  font-size: 15px;
}

.search-results-head span,
.search-results-head small {
  color: var(--ink-soft);
  font-size: 11px;
}

.search-results-head small {
  max-width: 230px;
  text-align: right;
}

.search-region-filters {
  display: flex;
  padding: 10px 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  gap: 7px;
  scrollbar-width: thin;
}

.search-region-chip {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--white);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.search-region-chip:hover,
.search-region-chip:focus-visible {
  border-color: var(--blue);
  color: var(--blue);
}

.search-region-chip.is-active {
  border-color: var(--navy);
  color: var(--white);
  background: var(--navy);
}

.search-result-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.search-region-group + .search-region-group {
  border-top: 6px solid var(--paper);
}

.search-region-heading {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  padding: 8px 15px;
  border-bottom: 1px solid var(--line);
  color: var(--navy);
  background: #eef4f6;
  align-items: center;
  justify-content: space-between;
}

.search-region-heading strong {
  font-size: 11px;
  letter-spacing: -0.02em;
}

.search-region-heading span {
  font-family: var(--font-data);
  font-size: 10px;
}

.search-result-item {
  display: grid;
  width: 100%;
  padding: 15px 17px;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  background: var(--white);
  cursor: pointer;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
}

.search-result-item:last-child {
  border-bottom: 0;
}

.search-result-item:hover,
.search-result-item:focus-visible {
  background: var(--blue-soft);
}

.search-result-item.is-loading,
.search-result-item:disabled {
  color: var(--navy);
  background: var(--blue-soft);
  cursor: wait;
  opacity: 1;
}

.search-result-item strong {
  font-size: 15px;
}

.search-result-item span {
  color: var(--ink-soft);
  font-size: 12px;
}

.search-result-item em {
  align-self: center;
  padding: 3px 6px;
  border-radius: 4px;
  color: var(--amber);
  background: var(--amber-soft);
  font-size: 10px;
  font-style: normal;
  grid-row: 1 / span 2;
  grid-column: 2;
}

.search-result-item.is-loading em {
  color: var(--blue);
  background: #e9f2ff;
}

.calculation-dirty {
  display: flex;
  margin: 20px 0 -12px;
  padding: 14px 16px;
  border: 1px solid #edc171;
  border-left: 4px solid var(--amber);
  border-radius: 9px;
  color: #6f4307;
  background: var(--amber-soft);
  align-items: baseline;
  gap: 9px;
}

.calculation-dirty strong {
  font-size: 13px;
}

.calculation-dirty span {
  font-size: 12px;
}

.workspace,
.result-section {
  max-width: 1240px;
  margin: 0 auto;
  padding: 84px 24px 110px;
}

.workspace-header {
  margin-bottom: 34px;
  align-items: flex-end;
}

.workspace-header h2,
.result-masthead h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 45px);
}

.muted {
  margin: 8px 0 0;
  color: var(--ink-soft);
}

.ghost-button,
.secondary-button,
.primary-button {
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid var(--line-dark);
  border-radius: 9px;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.ghost-button:hover,
.secondary-button:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-soft);
}

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

.input-column {
  min-width: 0;
}

.form-card {
  position: relative;
  margin-bottom: 22px;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.form-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue) 0 18%, var(--mint) 18% 24%, transparent 24%);
  content: "";
}

.card-number {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 34px;
  height: 34px;
  color: var(--white);
  background: var(--navy);
  font-family: var(--font-data);
  font-size: 12px;
  place-items: center;
}

.card-title-row {
  padding-left: 18px;
  align-items: center;
}

.card-title-row h3,
.result-card-head h3 {
  margin: 0;
  font-size: clamp(20px, 2.5vw, 27px);
  letter-spacing: -0.04em;
}

.source-badge,
.law-badge {
  color: var(--mint);
  border-color: #abd9ce;
  background: var(--mint-soft);
}

.source-badge.is-demo {
  color: var(--amber);
  border-color: #e9c27c;
  background: var(--amber-soft);
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.area-options {
  margin-top: 26px;
}

.choice-chip {
  display: inline-flex;
  min-height: 48px;
  padding: 10px 15px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: 0.18s ease;
}

.choice-chip:hover,
.choice-chip.is-selected,
.choice-chip:has(input:checked) {
  color: var(--white);
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 6px 16px rgba(30, 102, 208, 0.18);
}

.choice-chip--radio {
  padding: 0;
}

.choice-chip--radio input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.choice-chip--radio span {
  padding: 8px 13px;
}

.empty-state {
  margin-top: 24px;
  padding: 20px;
  border: 1px dashed var(--line-dark);
  border-radius: 10px;
  color: var(--ink-soft);
  background: #f7f9fa;
}

.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state span {
  margin-top: 5px;
  font-size: 13px;
}

.market-summary {
  display: grid;
  margin-top: 26px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  grid-template-columns: minmax(210px, 0.8fr) minmax(250px, 1.2fr);
  gap: 24px;
}

.price-stamp {
  display: flex;
  min-height: 146px;
  padding: 22px;
  border: 1px solid #a9c3df;
  border-radius: 2px 18px 2px 2px;
  background: var(--blue-soft);
  flex-direction: column;
  justify-content: center;
}

.price-stamp span,
.price-stamp small {
  color: var(--ink-soft);
  font-size: 11px;
}

.price-stamp strong {
  margin: 8px 0 4px;
  color: var(--navy);
  font-family: var(--font-data);
  font-size: clamp(30px, 5vw, 43px);
  letter-spacing: -0.05em;
}

.market-stats {
  display: grid;
  margin: 0;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
}

.market-stats div {
  padding: 15px;
  background: var(--white);
}

.market-stats dt {
  color: var(--ink-soft);
  font-size: 11px;
}

.market-stats dd {
  margin: 5px 0 0;
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 600;
}

.sparkline-wrap {
  min-height: 148px;
  padding: 14px 0 4px;
  grid-column: 1 / -1;
}

#market-sparkline {
  display: block;
  width: 100%;
  height: 138px;
  overflow: visible;
}

.sparkline-grid {
  stroke: #dfe7eb;
  stroke-dasharray: 4 5;
  stroke-width: 1;
}

.sparkline-line {
  fill: none;
  stroke: var(--blue);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.sparkline-area {
  fill: rgba(30, 102, 208, 0.08);
}

.sparkline-dot {
  fill: var(--white);
  stroke: var(--blue);
  stroke-width: 2;
}

.sparkline-year-line {
  stroke: #d6e0e6;
  stroke-dasharray: 2 5;
  stroke-width: 1;
}

.sparkline-year-tick {
  stroke: #8da0ad;
  stroke-width: 1.25;
}

.sparkline-year {
  fill: #617481;
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 600;
  text-anchor: middle;
}

.recent-trades {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.recent-trades li {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafcfd;
}

.recent-trades b,
.recent-trades span,
.recent-trades small {
  display: block;
}

.recent-trades b {
  font-family: var(--font-data);
  font-size: 14px;
}

.recent-trades span,
.recent-trades small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 10px;
}

.data-caution {
  margin-bottom: 0;
  padding-left: 18px;
  grid-column: 1 / -1;
}

.data-caution::before {
  margin-left: -18px;
  margin-right: 7px;
  color: var(--amber);
  content: "※";
}

.field-grid {
  display: grid;
  margin-top: 28px;
  gap: 22px 18px;
}

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

.field {
  display: block;
  min-width: 0;
}

.field-label-row {
  display: flex;
  min-height: 44px;
  margin-bottom: 5px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.field-label-row .field-label {
  margin: 0;
}

.help-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 0;
  border: 1px solid #abc4d7;
  border-radius: 50%;
  color: var(--blue);
  background: #f1f7fc;
  font-family: var(--font-data);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  place-items: center;
  touch-action: manipulation;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.help-button:hover,
.help-button:focus-visible {
  color: var(--white);
  border-color: var(--blue);
  outline: 0;
  background: var(--blue);
  transform: translateY(-1px);
}

.birthdate-field {
  margin-top: 26px;
}

.birthdate-field > input[type="date"] {
  font-family: var(--font-data);
}

.field > span:first-child i,
.field > .field-label i {
  color: var(--mint);
  font-size: 10px;
  font-style: normal;
}

.field > input,
.field > select,
.money-input {
  display: flex;
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line-dark);
  border-radius: 9px;
  color: var(--ink);
  background: var(--white);
  align-items: center;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field > input,
.field > select {
  padding: 10px 13px;
}

.field > input:focus,
.field > select:focus,
.money-input:focus-within {
  border-color: var(--blue);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(30, 102, 208, 0.09);
}

.money-input input {
  min-width: 0;
  width: 100%;
  min-height: 46px;
  padding: 9px 4px 9px 13px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-family: var(--font-data);
}

.money-input b {
  flex: none;
  padding: 0 12px;
  color: var(--ink-soft);
  font-size: 12px;
}

.number-stepper {
  display: grid;
  min-height: 54px;
  padding: 0;
  grid-template-columns: 48px minmax(0, 1fr) auto 48px;
  overflow: hidden;
}

.number-stepper input {
  min-height: 52px;
  padding-right: 8px;
  text-align: right;
  appearance: textfield;
}

.number-stepper b {
  display: grid;
  min-height: 52px;
  align-items: center;
}

.number-stepper input::-webkit-inner-spin-button,
.number-stepper input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.stepper-button {
  min-width: 48px;
  min-height: 52px;
  padding: 0;
  border: 0;
  color: var(--blue);
  background: var(--blue-soft);
  font-family: var(--font-data);
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: color 0.16s ease, background 0.16s ease;
}

.stepper-button:first-child {
  border-right: 1px solid var(--line);
}

.stepper-button:last-child {
  border-left: 1px solid var(--line);
}

.stepper-button:hover {
  color: var(--white);
  background: var(--blue);
}

.stepper-button:active {
  background: var(--navy);
}

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

.acquisition-field > #acquisition-date {
  color: var(--navy);
  background: #f8fbff;
  font-family: var(--font-data);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.date-scroll-picker {
  margin-top: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f7fafc;
}

.scroll-picker-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.scroll-picker-heading strong,
.scroll-picker-heading .field-label,
.scroll-picker-heading .quick-label {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.scroll-picker-heading > span:last-child {
  color: #70818d;
  font-size: 11px;
  white-space: nowrap;
}

.scroll-picker-shell {
  display: grid;
  width: 100%;
  grid-template-columns: 46px minmax(0, 1fr) 46px;
  align-items: stretch;
  gap: 7px;
}

.scroll-arrow {
  display: grid;
  width: 46px;
  min-height: 50px;
  padding: 0;
  border: 1px solid var(--line-dark);
  border-radius: 11px;
  color: var(--navy);
  background: var(--white);
  box-shadow: 0 5px 12px rgba(18, 50, 74, 0.08);
  font-family: var(--font-data);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  place-items: center;
  touch-action: manipulation;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.scroll-arrow:hover {
  color: var(--white);
  border-color: var(--blue);
  background: var(--blue);
}

.period-scroller {
  display: flex;
  min-width: 0;
  padding: 2px 2px 9px;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-padding-inline: 8px;
  scroll-snap-type: inline proximity;
  scrollbar-color: var(--line-dark) transparent;
  scrollbar-width: thin;
}

.period-scroller::-webkit-scrollbar {
  height: 7px;
}

.period-scroller::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--line-dark);
}

.period-chip {
  min-width: 66px;
  flex: 0 0 auto;
  scroll-snap-align: center;
  touch-action: manipulation;
}

.period-chip[aria-pressed="true"] {
  color: var(--white);
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 6px 16px rgba(30, 102, 208, 0.18);
}

.segmented input:focus-visible + span,
.choice-chip--radio input:focus-visible + span,
.toggle-card:has(input:focus-visible) {
  outline: 3px solid rgba(30, 102, 208, 0.42);
  outline-offset: 3px;
}

.date-detail-row {
  display: grid;
  margin-top: 11px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.date-detail-row label {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.date-detail-row select {
  width: 100%;
  min-height: 46px;
  padding: 8px 11px;
  border: 1px solid var(--line-dark);
  border-radius: 9px;
  color: var(--ink);
  background: var(--white);
}

.residence-field {
  margin-top: 26px;
}

.quick-field,
.choice-field,
.toggle-grid,
.scenario-row {
  margin-top: 26px;
}

.choice-field {
  min-width: 0;
  padding: 0;
  border: 0;
}

.choice-field legend:has(.help-button) {
  display: flex;
  width: 100%;
  margin-bottom: 5px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.choice-field legend:has(.help-button) > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.choice-field legend b {
  color: var(--red);
  font-size: 10px;
}

.auto-status-line {
  display: flex;
  min-height: 28px;
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.55;
  align-items: flex-start;
  gap: 7px;
}

.auto-badge {
  flex: none;
  padding: 3px 6px;
  border-radius: 999px;
  color: #25645e;
  background: var(--mint-soft);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.auto-status-line[data-state="unknown"] .auto-badge {
  color: #79500e;
  background: var(--amber-soft);
}

.auto-status-line[data-state="manual"] .auto-badge {
  color: var(--ink-soft);
  background: #edf2f5;
}

.segmented {
  display: grid;
  padding: 3px;
  border: 1px solid var(--line-dark);
  border-radius: 11px;
  background: #edf2f4;
  gap: 3px;
}

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

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

.segmented label {
  position: relative;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented span {
  display: grid;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  place-items: center;
}

.segmented input:checked + span {
  color: var(--navy);
  background: var(--white);
  box-shadow: 0 3px 10px rgba(18, 50, 74, 0.1);
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.toggle-card {
  position: relative;
  display: grid;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafcfd;
  cursor: pointer;
  grid-template-columns: 38px 1fr;
  gap: 11px;
  align-items: start;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.toggle-help-wrap {
  position: relative;
  min-width: 0;
}

.toggle-help-wrap .toggle-card {
  height: 100%;
  padding-right: 54px;
}

.help-button--floating {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
}

.toggle-card:has(input:checked) {
  border-color: #8eb4dc;
  background: var(--blue-soft);
}

.toggle-card input {
  position: absolute;
  opacity: 0;
}

.toggle-ui {
  position: relative;
  width: 36px;
  height: 21px;
  margin-top: 1px;
  border-radius: 999px;
  background: #aebbc3;
  transition: 0.2s ease;
}

.toggle-ui::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  content: "";
  transition: transform 0.2s ease;
}

.toggle-card input:checked + .toggle-ui {
  background: var(--blue);
}

.toggle-card input:checked + .toggle-ui::after {
  transform: translateX(15px);
}

.toggle-card b,
.toggle-card small {
  display: block;
}

.toggle-card b {
  font-size: 12px;
}

.toggle-card small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.toggle-card--compact {
  min-height: 73px;
  align-self: end;
}

.callout {
  display: grid;
  margin-top: 24px;
  padding: 15px 17px;
  border: 1px solid;
  border-radius: 9px;
  font-size: 12px;
  grid-template-columns: auto 1fr;
  gap: 7px 14px;
}

.callout strong {
  white-space: nowrap;
}

.callout--info {
  color: #225172;
  border-color: #b7d1e4;
  background: #edf7fc;
}

.callout--warning {
  color: #79500e;
  border-color: #e7c177;
  background: var(--amber-soft);
}

.advanced-panel {
  margin-top: 24px;
  border-top: 1px dashed var(--line-dark);
}

.advanced-panel summary,
.calculation-detail summary {
  padding: 17px 0 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.advanced-body {
  margin-top: 18px;
}

.essential-life-grid {
  max-width: 540px;
  grid-template-columns: minmax(0, 1fr);
}

.optional-life-panel {
  margin-top: 14px;
}

.occupancy-choice {
  margin-top: 26px;
}

.occupancy-choice legend {
  margin-bottom: 9px;
}

.occupancy-segmented {
  max-width: 540px;
}

.lease-input-panel {
  position: relative;
  margin-top: 18px;
  padding: 22px;
  border: 1px solid #abd9ce;
  border-radius: 15px;
  background:
    linear-gradient(135deg, rgba(226, 245, 239, 0.82), rgba(244, 251, 249, 0.96)),
    var(--white);
  overflow: hidden;
}

.lease-input-panel::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 5px;
  background: var(--mint);
  content: "";
}

.lease-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.lease-panel-head h4 {
  margin: 2px 0 0;
  color: var(--navy);
  font-size: 19px;
  letter-spacing: -0.035em;
}

.lease-overline {
  margin: 0;
  color: var(--mint);
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lease-liability-chip {
  flex: none;
  padding: 7px 10px;
  border: 1px solid #a7d6cc;
  border-radius: 999px;
  color: #17685c;
  background: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 700;
}

.lease-ledger-note {
  display: grid;
  margin: 15px 0 0;
  padding: 12px 14px;
  border: 1px dashed #82bfb2;
  border-radius: 10px;
  color: #315e58;
  background: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  grid-template-columns: 24px 1fr;
  gap: 8px;
}

.lease-ledger-note::before {
  display: grid;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--white);
  background: var(--mint);
  content: "−";
  font-family: var(--font-data);
  font-size: 18px;
  font-weight: 700;
  place-items: center;
}

.lease-essential-grid {
  margin-top: 18px;
}

.lease-advanced-panel {
  margin-top: 15px;
  border-top: 1px dashed #8dbfb5;
}

.lease-advanced-panel summary {
  min-height: 46px;
  padding-top: 14px;
  color: #17685c;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.rental-tax-hint {
  margin-top: 16px;
  padding: 11px 13px;
  border-radius: 9px;
  color: #315e58;
  background: rgba(255, 255, 255, 0.76);
  font-size: 11px;
}

.rental-tax-hint strong {
  color: #17685c;
}

.loan-essential-grid {
  margin-top: 24px;
}

.optional-life-panel > summary {
  min-height: 48px;
  padding: 15px 0 10px;
  font-size: 13px;
}

.rental-result {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid #abd9ce;
  border-radius: 12px;
  background: var(--mint-soft);
}

.rental-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rental-result-head strong {
  color: #17685c;
  font-size: 13px;
}

.rental-result-head span {
  padding: 4px 8px;
  border-radius: 999px;
  color: #17685c;
  background: var(--white);
  font-size: 9px;
  font-weight: 700;
}

.rental-result dl {
  display: grid;
  margin: 13px 0 0;
  gap: 7px;
}

.rental-result dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 11px;
}

.rental-result dt {
  color: var(--ink-soft);
}

.rental-result dd {
  margin: 0;
  color: var(--navy);
  font-weight: 700;
  text-align: right;
}

.rental-result p {
  margin: 12px 0 0;
  color: #315e58;
  font-size: 10px;
  line-height: 1.55;
}

.help-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid #a9c3d6;
  border-radius: 18px;
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 26px 80px rgba(18, 50, 74, 0.28);
}

.help-dialog::backdrop {
  background: rgba(11, 34, 51, 0.55);
  backdrop-filter: blur(3px);
}

.help-dialog-head {
  display: grid;
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #f1f7fc, #f8fcfb);
  grid-template-columns: 46px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
}

.help-dialog-mark {
  display: grid;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--white);
  background: var(--blue);
  font-family: var(--font-data);
  font-size: 22px;
  font-weight: 700;
  place-items: center;
}

.help-dialog-head .kicker {
  margin: 0 0 2px;
  font-size: 10px;
}

.help-dialog-head h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.035em;
}

.help-dialog-close {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.78);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.help-dialog-close:hover,
.help-dialog-close:focus-visible {
  color: var(--white);
  outline: 0;
  background: var(--navy);
}

.help-dialog-body {
  padding: 22px;
  overflow: auto;
  color: #3e5361;
  font-size: 13px;
  line-height: 1.75;
}

.help-dialog-body p {
  margin: 0 0 12px;
}

.help-dialog-body ul {
  margin: 8px 0 14px;
  padding-left: 20px;
}

.help-dialog-body strong {
  color: var(--navy);
}

.help-dialog-body .help-example {
  padding: 12px 14px;
  border-left: 3px solid var(--mint);
  border-radius: 0 8px 8px 0;
  background: #f0f9f7;
}

.scenario-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.scenario-row .choice-field {
  margin: 0;
}

.growth-field > span:first-child {
  margin-bottom: 9px;
}

.inheritance-note {
  align-self: center;
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

.form-error {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid #e7aaa5;
  border-radius: 9px;
  color: var(--red);
  background: var(--red-soft);
  font-size: 13px;
}

.calculate-button {
  display: flex;
  width: 100%;
  min-height: 76px;
  margin-top: 34px;
  padding: 15px 24px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-radius: 16px;
  color: var(--white);
  background: var(--blue);
  box-shadow: 0 8px 0 #0c438f, 0 20px 42px rgba(30, 102, 208, 0.25);
  font-size: 21px;
  font-weight: 700;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.calculate-button:hover {
  background: #1659b7;
  box-shadow: 0 5px 0 #0c438f, 0 15px 30px rgba(30, 102, 208, 0.24);
  transform: translateY(3px);
}

.calculate-button:active {
  box-shadow: 0 2px 0 #0c438f, 0 9px 18px rgba(30, 102, 208, 0.2);
  transform: translateY(6px);
}

.calculate-button:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.calculate-button svg {
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: 50%;
  color: var(--blue);
  background: var(--white);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.submit-note {
  text-align: center;
}

.preview-sticky {
  position: sticky;
  top: 100px;
  padding: 25px;
  border: 1px solid var(--line-dark);
  border-radius: 2px 18px 2px 2px;
  background: #eaf0f3;
  box-shadow: 12px 12px 0 #dce5e9;
}

.preview-label {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-dark);
  color: var(--ink-soft);
  font-family: var(--font-data);
  font-size: 10px;
  letter-spacing: 0.09em;
}

.preview-price {
  padding: 22px 0;
}

.preview-price span {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
}

.preview-price strong {
  display: block;
  margin-top: 5px;
  color: var(--navy);
  font-family: var(--font-data);
  font-size: 31px;
}

.preview-equation {
  display: grid;
  gap: 10px;
}

.preview-equation div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.preview-equation span {
  color: var(--ink-soft);
}

.preview-equation b {
  text-align: right;
}

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

.preview-sticky p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.7;
}

.result-section {
  max-width: none;
  padding-right: max(24px, calc((100vw - 1240px) / 2));
  padding-left: max(24px, calc((100vw - 1240px) / 2));
  background: #eaf0f2;
}

.result-masthead {
  max-width: 1240px;
  margin: 0 auto 34px;
  align-items: flex-end;
}

.decision-board {
  position: relative;
  display: grid;
  max-width: 1240px;
  min-height: 330px;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 70px);
  border-radius: 4px 36px 4px 4px;
  color: var(--white);
  background: var(--navy);
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 54px;
  align-items: center;
}

.decision-board::before,
.decision-board::after {
  position: absolute;
  pointer-events: none;
  content: "";
}

.decision-board::before {
  inset: 0 48% 0 0;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.3) 1px, transparent 1px);
  background-size: 36px 36px;
}

.decision-board::after {
  right: 10%;
  bottom: -90px;
  width: 310px;
  height: 310px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  transform: rotate(45deg);
}

.decision-copy,
.decision-seal {
  position: relative;
  z-index: 1;
}

.decision-badge {
  display: inline-flex;
  padding: 6px 11px;
  border-radius: 999px;
  color: var(--navy);
  background: #a9e8d7;
  font-size: 11px;
  font-weight: 700;
}

.decision-copy h3 {
  max-width: 780px;
  margin: 18px 0 14px;
  font-family: var(--font-display);
  font-size: clamp(30px, 4.2vw, 52px);
  line-height: 1.25;
  letter-spacing: -0.05em;
}

.decision-copy > p {
  max-width: 750px;
  margin: 0;
  color: rgba(255, 255, 255, 0.66);
}

.reason-list {
  display: grid;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  gap: 8px;
}

.reason-list li {
  display: flex;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  gap: 9px;
}

.reason-list li::before {
  color: #83e0c7;
  content: "↳";
}

.decision-seal {
  display: flex;
  width: 166px;
  height: 166px;
  border: 2px solid rgba(169, 232, 215, 0.74);
  border-radius: 50%;
  color: #a9e8d7;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(-6deg);
}

.decision-seal::after {
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(169, 232, 215, 0.4);
  border-radius: 50%;
  content: "";
}

.decision-seal span,
.decision-seal small {
  font-size: 10px;
  letter-spacing: 0.12em;
}

.decision-seal strong {
  margin: 3px 0;
  font-family: var(--font-data);
  font-size: 43px;
}

.strategy-heading {
  max-width: 1240px;
  margin: 70px auto 22px;
  align-items: flex-end;
}

.strategy-heading h3,
.timeline-head h3 {
  font-size: 28px;
}

.strategy-heading > p,
.timeline-head > p {
  max-width: 460px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: right;
}

.strategy-grid {
  display: grid;
  max-width: 1240px;
  margin: 0 auto;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.strategy-card {
  position: relative;
  min-height: 230px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  overflow: hidden;
}

.strategy-card.is-winner {
  border: 2px solid var(--mint);
  box-shadow: 0 14px 30px rgba(8, 127, 104, 0.12);
}

.strategy-rank {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  font-family: var(--font-data);
  font-size: 10px;
}

.strategy-rank b {
  color: var(--mint);
  font-size: 12px;
}

.strategy-card h4 {
  margin: 15px 0 7px;
  font-size: 19px;
  letter-spacing: -0.04em;
}

.strategy-card > p {
  min-height: 54px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.strategy-metric {
  display: block;
  margin-top: 15px;
  font-family: var(--font-data);
  font-size: 17px;
}

.strategy-bar {
  height: 5px;
  margin-top: 15px;
  border-radius: 999px;
  background: #e6ecef;
  overflow: hidden;
}

.strategy-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.strategy-card.is-winner .strategy-bar span {
  background: var(--mint);
}

.strategy-condition {
  display: block;
  margin-top: 10px;
  color: #70818d;
  font-size: 10px;
}

.result-grid {
  display: grid;
  max-width: 1240px;
  margin: 56px auto 0;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

.result-card,
.timeline-card,
.future-sale-card,
.evidence-card {
  padding: clamp(25px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.result-card--primary {
  border-top: 4px solid var(--blue);
}

.result-card-head {
  align-items: center;
}

.law-badge {
  color: var(--mint);
}

.law-badge::before {
  content: none;
}

.net-amount,
.holding-total {
  margin-top: 30px;
  color: var(--navy);
  font-family: var(--font-data);
  font-size: clamp(37px, 5vw, 58px);
  font-weight: 600;
  letter-spacing: -0.06em;
}

.holding-total {
  font-size: clamp(32px, 4vw, 47px);
}

.waterfall {
  display: grid;
  margin-top: 28px;
  gap: 9px;
}

.settlement-proof {
  display: grid;
  margin-bottom: 12px;
  padding: 15px 16px;
  border: 1px solid #9ccfc3;
  border-left: 4px solid var(--mint);
  border-radius: 10px;
  background: var(--mint-soft);
  gap: 6px;
}

.settlement-proof > span {
  color: var(--mint);
  font-size: 11px;
  font-weight: 800;
}

.settlement-proof > div {
  display: flex;
  color: var(--navy);
  font-family: var(--font-data);
  font-size: 17px;
  align-items: center;
  gap: 9px;
}

.settlement-proof i {
  color: var(--mint);
  font-style: normal;
}

.settlement-proof small {
  color: var(--ink-soft);
  font-size: 11px;
}

.waterfall-row {
  display: grid;
  grid-template-columns: 112px 1fr auto;
  gap: 12px;
  align-items: center;
  font-size: 12px;
}

.waterfall-row > span:first-child {
  color: var(--ink-soft);
}

.waterfall-track {
  height: 9px;
  border-radius: 999px;
  background: #e8edef;
  overflow: hidden;
}

.waterfall-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.waterfall-row.is-tax .waterfall-track span {
  background: var(--red);
}

.detail-list {
  display: grid;
  margin: 20px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  grid-template-columns: 1fr auto;
  gap: 9px 18px;
}

.detail-list div {
  display: contents;
}

.detail-list dt {
  color: var(--ink-soft);
  font-size: 12px;
}

.detail-list dd {
  margin: 0;
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

.detail-list--plain {
  margin-top: 24px;
  padding: 0;
  border: 0;
}

.affordability-meter {
  margin-top: 27px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.meter-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
}

.meter-label span {
  color: var(--ink-soft);
}

.meter-track {
  height: 8px;
  margin-top: 9px;
  border-radius: 999px;
  background: #e7edef;
  overflow: hidden;
}

.meter-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--mint);
  transition: width 0.5s ease;
}

.timeline-card,
.future-sale-card {
  max-width: 1240px;
  margin: 16px auto 0;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--ink-soft);
  font-size: 10px;
}

.legend span::before {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 2px;
  content: "";
}

.legend-current::before {
  background: var(--mint);
}

.legend-video::before {
  background: var(--amber);
}

.holding-chart {
  display: grid;
  min-height: 300px;
  margin-top: 35px;
  padding: 0 18px;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(12px, 3vw, 42px);
  align-items: end;
  border-bottom: 1px solid var(--line-dark);
}

.chart-year {
  display: grid;
  height: 270px;
  grid-template-rows: 1fr auto;
  align-items: end;
}

.chart-bars {
  display: flex;
  height: 230px;
  justify-content: center;
  gap: 7px;
  align-items: end;
}

.chart-bar {
  position: relative;
  width: min(42px, 40%);
  min-height: 4px;
  border-radius: 5px 5px 0 0;
  background: var(--mint);
  transition: height 0.7s ease;
}

.chart-bar--video {
  background: repeating-linear-gradient(-45deg, var(--amber), var(--amber) 5px, #d58a2b 5px, #d58a2b 9px);
}

.chart-bar b {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  font-family: var(--font-data);
  font-size: 9px;
  white-space: nowrap;
  transform: translateX(-50%);
}

.chart-year > strong {
  display: block;
  padding: 12px 0;
  font-family: var(--font-data);
  font-size: 12px;
  text-align: center;
}

.timeline-card .callout {
  margin-top: 28px;
}

.table-wrap {
  margin-top: 26px;
  overflow-x: auto;
}

.future-table {
  width: 100%;
  min-width: 750px;
  border-collapse: collapse;
  font-size: 12px;
}

.future-table th,
.future-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

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

.future-table th {
  color: var(--ink-soft);
  background: #f3f6f7;
  font-size: 10px;
}

.future-table td {
  font-family: var(--font-data);
}

.future-table tr.is-best td {
  color: var(--mint);
  background: var(--mint-soft);
  font-weight: 700;
}

.evidence-grid {
  display: grid;
  max-width: 1240px;
  margin: 16px auto 0;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.evidence-card h3 {
  margin: 0;
  font-size: 18px;
}

.evidence-card ul {
  display: grid;
  margin: 18px 0 0;
  padding-left: 19px;
  color: var(--ink-soft);
  font-size: 11px;
  gap: 8px;
}

.evidence-card--caution {
  border-color: #e0c48f;
  background: #fffaf0;
}

.result-actions {
  display: flex;
  max-width: 1240px;
  margin: 28px auto 0;
  justify-content: flex-end;
  gap: 10px;
}

.primary-button {
  color: var(--white);
  border-color: var(--navy);
  background: var(--navy);
}

.primary-button:hover {
  border-color: var(--blue);
  background: var(--blue);
}

.site-footer {
  display: flex;
  padding: 50px max(24px, calc((100vw - 1240px) / 2));
  color: rgba(255, 255, 255, 0.68);
  background: #0d283b;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.site-footer strong {
  color: var(--white);
}

.site-footer p {
  margin: 8px 0 0;
  font-size: 12px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 17px;
  font-size: 11px;
}

.footer-links a:hover {
  color: var(--white);
}

.toast {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  max-width: 360px;
  padding: 14px 18px;
  border-radius: 10px;
  color: var(--white);
  background: var(--navy);
  box-shadow: var(--shadow);
  font-size: 13px;
}

@media (max-width: 1040px), (max-height: 760px) {
  .search-results {
    position: fixed;
    z-index: 130;
    inset: 72px 12px 12px;
    max-height: none;
    margin-top: 0;
    border-radius: 14px;
    box-shadow: 0 0 0 100vmax rgba(4, 24, 38, 0.6), var(--shadow);
  }
}

@media (max-width: 1040px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    max-width: 720px;
  }

  .workspace-layout {
    grid-template-columns: 1fr;
  }

  .preview-column {
    display: none;
  }

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

@media (max-width: 760px) {
  .site-header {
    min-height: 64px;
    padding: 9px 16px;
  }

  .brand-copy small,
  .header-status .status-pill:first-child {
    display: none;
  }

  .status-pill {
    min-height: 24px;
    padding: 3px 7px;
    font-size: 9px;
  }

  .hero {
    min-height: auto;
    padding: 64px 18px 80px;
    gap: 48px;
  }

  .hero h1 {
    font-size: 41px;
  }

  .hero-lead {
    font-size: 15px;
  }

  .search-sheet {
    padding: 27px 20px 30px;
    box-shadow: 10px 12px 0 rgba(4, 24, 38, 0.28);
  }

  .sheet-heading {
    display: block;
  }

  .step-time {
    display: none;
  }

  .search-control {
    min-height: 58px;
    grid-template-columns: 38px 1fr auto;
  }

  .search-control svg {
    width: 19px;
    margin-left: 13px;
  }

  .search-control input {
    padding: 0 6px;
    font-size: 14px;
  }

  .search-control button {
    min-width: 65px;
  }

  .demo-row,
  .api-connection {
    align-items: flex-start;
    flex-direction: column;
  }

  .api-key-form > div {
    grid-template-columns: 1fr;
  }

  .api-key-form button {
    min-height: 42px;
  }

  .number-stepper {
    grid-template-columns: 46px minmax(0, 1fr) auto 46px;
  }

  .stepper-button {
    min-width: 46px;
  }

  .scroll-picker-heading {
    align-items: flex-start;
  }

  .scroll-picker-shell {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 5px;
  }

  .scroll-arrow {
    width: 42px;
  }

  .period-chip {
    min-width: 62px;
  }

  .calculate-button {
    min-height: 72px;
    font-size: 20px;
  }

  .search-results-head {
    display: block;
  }

  .search-results-head small {
    display: block;
    max-width: none;
    margin-top: 4px;
    text-align: left;
  }

  .calculation-dirty {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .settlement-proof > div {
    flex-wrap: wrap;
    font-size: 15px;
  }

  .workspace,
  .result-section {
    padding: 60px 16px 80px;
  }

  .workspace-header,
  .result-masthead,
  .strategy-heading,
  .timeline-head {
    display: block;
  }

  .workspace-header .ghost-button,
  .result-masthead .ghost-button {
    margin-top: 18px;
  }

  .form-card,
  .result-card,
  .timeline-card,
  .future-sale-card,
  .evidence-card {
    padding: 25px 19px;
  }

  .card-title-row {
    padding-left: 12px;
  }

  .market-summary,
  .field-grid--2,
  .scenario-row,
  .result-grid,
  .evidence-grid {
    grid-template-columns: 1fr;
  }

  .market-stats {
    grid-column: 1;
  }

  .recent-trades {
    grid-template-columns: 1fr;
  }

  .toggle-grid,
  .strategy-grid {
    grid-template-columns: 1fr;
  }

  .callout {
    grid-template-columns: 1fr;
  }

  .callout strong {
    white-space: normal;
  }

  .lease-input-panel {
    padding: 20px 15px 18px 19px;
  }

  .lease-panel-head {
    display: block;
  }

  .lease-liability-chip {
    display: inline-flex;
    margin-top: 10px;
  }

  .lease-ledger-note {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .occupancy-segmented span {
    min-height: 48px;
    padding-inline: 6px;
    font-size: 12px;
    text-align: center;
  }

  .rental-result dl div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .decision-board {
    padding: 36px 24px;
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .decision-seal {
    width: 116px;
    height: 116px;
  }

  .decision-seal strong {
    font-size: 30px;
  }

  .strategy-heading > p,
  .timeline-head > p {
    margin-top: 8px;
    text-align: left;
  }

  .holding-chart {
    min-height: 235px;
    padding: 0 3px;
    gap: 8px;
  }

  .chart-year {
    height: 215px;
  }

  .chart-bars {
    height: 175px;
  }

  .chart-bar b {
    font-size: 8px;
  }

  .legend {
    margin-top: 15px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .hero,
  .workspace,
  .result-actions,
  .site-footer,
  .toast {
    display: none !important;
  }

  body,
  .result-section {
    color: #000;
    background: #fff;
  }

  .result-section {
    display: block !important;
    padding: 0;
  }

  .decision-board {
    color: #000;
    border: 2px solid #000;
    background: #fff;
  }

  .decision-copy > p,
  .reason-list li {
    color: #222;
  }

  .decision-seal {
    color: #000;
    border-color: #000;
  }

  .result-card,
  .timeline-card,
  .future-sale-card,
  .evidence-card,
  .strategy-card {
    break-inside: avoid;
    box-shadow: none;
  }
}
