/* Shared interaction and type rules. Native controls keep their platform pickers. */
:root {
  color-scheme: light;
  --paper: #f4f5f7;
  --ink: #20232b;
  --muted: #5b6472;
  --purple: #7658df;
  --purple-dark: #6041c4;
  --purple-light: #f2edff;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -.02em;
  -webkit-text-size-adjust: 100%;
}
body { overflow-wrap: break-word; }
button, input, select { font: inherit; }
button, summary { touch-action: manipulation; }
button { -webkit-appearance: none; appearance: none; }
button, a { -webkit-tap-highlight-color: #7658df24; }
:is(button, a, input, select, summary):focus-visible {
  outline: 3px solid #6041c4;
  outline-offset: 4px;
}
[hidden] { display: none !important; }
.skip-link {
  position: fixed; top: 12px; left: 16px; z-index: 100;
  padding: 12px 18px; background: #fff; color: #6041c4;
  border: 2px solid currentColor; border-radius: 12px;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }
.header-inner { min-height: 80px; }
.header-actions { flex-wrap: wrap; justify-content: flex-end; }
.save-pill { font-size: 13px; color: var(--muted); }
.step-nav { max-width: 740px; gap: 16px; }
.step-nav button { min-height: 48px; font-size: 14px; color: var(--muted); }
.step-nav button > span { width: 28px; height: 28px; font-size: 12px; }
.page-intro { padding-bottom: 28px; }
.page-intro h1 { font-size: 34px; font-weight: 750; letter-spacing: -.04em; line-height: 1.25; max-width: none; }
.page-intro .intro-description { font-size: 16px; line-height: 1.65; color: var(--muted); margin: 12px 0 0; }
.target-layout { grid-template-columns: minmax(0, 1.75fr) minmax(260px, 1fr); gap: 24px; align-items: start; }
.target-card { min-width: 0; padding: 32px; border: 1px solid #e1e4e9; border-radius: 24px; }
.target-aside { padding: 28px; border-radius: 24px; }
.target-rent-type legend, .target-field-heading h2 { font-size: 17px; line-height: 1.5; font-weight: 650; }
.field-number { min-width: 28px; height: 28px; font-size: 12px; }
.target-field-heading { margin: 28px 0 12px; padding-top: 28px; gap: 10px; border-top-color: #e1e4e9; }
.section-description { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.rent-buttons { margin-top: 18px; }
.rent-buttons label > span { min-height: 60px; padding: 16px; border-color: #8792a2; border-radius: 14px; }
.rent-buttons strong { font-size: 17px; }
.rent-buttons input:checked + span { border-width: 2px; padding: 15px; background: #f2edff; }
.target-money { margin-top: 22px; gap: 16px; }
.form-field, .target-card .form-field { margin-bottom: 18px; min-width: 0; }
.field-label, .target-card .field-label, .input-card .field-label {
  display: block; font-size: 15px; font-weight: 600; color: #333d4b; margin-bottom: 8px; line-height: 1.5;
}
.location-fields { display: grid; grid-template-columns: 1fr; gap: 0; }
.location-fields .city-field { max-width: 100%; }
body :is(.target-card, .input-card, .guide-dialog) select,
body :is(.target-card, .input-card, .guide-dialog) .input-wrap input {
  min-height: 52px; width: 100%; min-width: 0;
  padding: 13px 52px 13px 16px; border: 1px solid #8792a2; border-radius: 12px;
  background-color: #fff; color: var(--ink); font-size: 17px; line-height: 1.45;
}
body :is(.target-card, .input-card, .guide-dialog) select {
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%235b6472' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 8 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 20px;
  text-overflow: ellipsis;
}
body :is(.target-card, .input-card, .guide-dialog) select:disabled {
  background-color: #edf0f4; border-color: #c2c8d1; color: #596577; opacity: 1;
  -webkit-text-fill-color: #596577;
}
body :is(.target-card, .input-card, .guide-dialog) .input-wrap input[type="text"] { padding-right: 16px; }
body .input-wrap input::placeholder { color: #667181; font-size: 16px; opacity: 1; }
body :is(input, select)[aria-invalid="true"] { border: 2px solid #b42335; }
.input-unit, .loan-panel .input-unit { right: 16px; font-size: 14px; color: var(--muted); }
.amount-helper, .apartment-status, .data-note, .aside-note { font-size: 14px; color: var(--muted); line-height: 1.7; }
.amount-helper { margin-top: 8px; }
.apartment-status { margin: -4px 0 4px; }
.apartment-status.warn, .form-error { color: #a12838; }
.form-error { font-size: 15px; line-height: 1.65; margin-bottom: 16px; }
.primary-button { min-height: 52px; border-radius: 13px; font-size: 17px; font-weight: 650; line-height: 1.5; }
.zero-button { margin-top: 10px; justify-content: center; gap: 10px; }
body :is(.secondary-button, .text-button, .guide-button, .cancel-button, #install-button, .detail-button),
body .target-recap .target-change-button, body .rules-note #sources-button, body .storage-note #install-button {
  min-height: 44px; font-size: 14px; line-height: 1.5; padding: 10px 14px;
}
body .icon-button, body .record-controls .icon-button, body .bubble-heading .icon-button {
  min-width: 44px; width: 44px; min-height: 44px; height: 44px; border-radius: 12px; color: #5b6472;
}
body .icon-button .icon, body .record-controls .icon { width: 20px; height: 20px; }
.record-controls { gap: 4px; }
.record, .loan-panel .record { padding: 18px; }
.record-name { font-size: 17px; }
.record-sub, .loan-panel .record-sub, .record-amount .won-label { font-size: 14px; color: var(--muted); line-height: 1.6; }
.summary-content h2, .summary-breakdown, .summary-breakdown strong, .panel-total > span { font-size: 15px; }
.panel-heading h3 { font-size: 20px; }
.empty-state p { font-size: 16px; }
.target-recap { padding: 20px; font-size: 14px; line-height: 1.7; }
.target-recap strong { font-size: 17px; }
.add-entry-button { font-size: 16px; min-height: 50px; }
.input-card { padding: 22px; }
.form-heading h4 { font-size: 18px; }
.segmented-control span { font-size: 15px; min-height: 44px; }
.repayment-options label { min-height: 56px; padding: 12px; gap: 12px; }
.repayment-options input { width: 20px; height: 20px; }
.repayment-options strong { font-size: 15px; color: #704a2b; }
.repayment-options small { font-size: 14px; color: #765236; }
.insurance-toggle { flex-wrap: wrap; gap: 8px 20px; }
.insurance-toggle label, .assumption-check { min-height: 44px; font-size: 14px; line-height: 1.6; }
.insurance-toggle input, .assumption-check input { width: 20px; height: 20px; flex-shrink: 0; }
.insurance-info-button { width: 44px; height: 44px; flex-shrink: 0; color: #765236; }
.insurance-info-button .icon { width: 22px; height: 22px; }
.insurance-note, .score-rate-note, .record-insurance, .insurance-fields .field-label,
.info-bubble p, .info-bubble a, .rate-table { font-size: 14px; color: #765236; line-height: 1.7; }
.flow-note { font-size: 14px; line-height: 1.7; color: var(--muted); }
.result-intro h1 { font-size: 32px; }
.result-target p, .result-target strong, .cost-label { line-height: 1.6; }
.result-target strong { font-size: 18px; }
.result-target p { font-size: 14px; color: var(--muted); }
.result-hero { padding: 30px; }
.result-hero-label { font-size: 17px; }
.result-hero > p, .principal-option, .principal-amount { font-size: 14px; line-height: 1.7; color: #f1edff; }
.principal-option { min-height: 60px; gap: 16px; cursor: pointer; }
.principal-option input { flex-shrink: 0; }
.cost-heading h2 { font-size: 20px; }
.cost-heading > span, .cost-line .cost-hint { font-size: 14px; }
.cost-label { font-size: 16px; }
.cost-line strong { font-size: 17px; }
.cost-line .detail-button { min-width: 44px; }
.result-details, .result-details p, .result-details .cost-label, .result-details .cost-line strong,
.result-small-note, .summary-values, .tax-outcome .tax-summary, .tax-outcome .result-details ul,
.tax-prompt p, .funding-caption, .summary-values small { font-size: 14px; line-height: 1.7; color: var(--muted); }
.result-details summary { min-height: 44px; font-size: 15px; color: #46505f; }
.result-details summary > span, .funding-caption b { font-size: 14px; color: var(--muted); }
.tax-prompt strong { font-size: 16px; }
.guide-dialog { width: min(560px, calc(100% - 32px)); max-width: 560px; max-height: calc(100dvh - 32px); padding: 28px; border: 1px solid #e1e4e9; }
.guide-dialog h2 { font-size: 26px; line-height: 1.4; letter-spacing: -.03em; }
.guide-dialog .dialog-heading { margin-bottom: 8px; }
.guide-steps p, .dialog-copy, .install-guide p, .source-list p { font-size: 16px; line-height: 1.75; color: #46505f; }
.guide-steps strong, .source-list strong { font-size: 17px; color: var(--ink); }
.guide-footnote, .tax-question-description, .tax-form-note, .management-footnote { font-size: 14px; line-height: 1.75; color: var(--muted); }
.tax-question-title { font-size: 26px; }
.yesno label > span, .choice-list label > span {
  min-height: 48px; padding: 12px 16px; border-color: #8792a2;
  color: #46505f; font-size: 16px; line-height: 1.6;
}
.yesno input:checked + span, .choice-list input:checked + span {
  border: 2px solid #7658df; padding: 11px 15px; background: #f2edff; color: #6041c4;
}
.management-meta, .management-formula { font-size: 15px; color: #5b6472; line-height: 1.75; }
.management-formula strong { color: #6041c4; }
.management-toggle button { min-height: 44px; padding: 10px 14px; font-size: 14px; color: #46505f; border-color: #8792a2; }
.management-toggle button.active { color: #6041c4; background: #f2edff; border-color: #7658df; }
.management-chart text { fill: #5b6472; }
.source-list a, .management-footnote a, .info-bubble a { min-height: 44px; font-size: 14px; }
.tax-buttons { gap: 12px; }
.legal-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; font-size: 14px; color: var(--muted); }
.legal-footer a { display: inline-flex; align-items: center; min-height: 44px; }
.legal-footer > span { align-self: center; }
.toast { font-size: 15px; line-height: 1.6; max-width: calc(100% - 32px); }
@media (max-width: 760px) {
  .header-inner { min-height: 72px; }
  .target-layout { grid-template-columns: 1fr; gap: 16px; }
  .target-aside { padding: 20px 24px; }
  .target-art { display: none; }
  .target-card { padding: 26px; }
  .page-intro h1, .result-intro h1 { font-size: 30px; }
  .result-layout, .collection-grid { grid-template-columns: 1fr; }
  .result-target p > span { display: block; }
  .cost-label { font-size: 15px; }
  .result-hero > strong { font-size: clamp(34px, 8vw, 48px); overflow-wrap: anywhere; }
}
@media (max-width: 600px) {
  .header-inner { padding: 10px 20px; gap: 10px; }
  .brand { gap: 8px; }
  .save-pill { display: none; }
  main { padding: 0 20px; }
  .step-nav { gap: 6px; justify-content: space-between; margin-top: 16px; }
  .step-nav button { font-size: 13px; gap: 5px; }
  .step-nav button > span { width: 24px; height: 24px; font-size: 11px; }
  .step-line { min-width: 4px; }
  .page-intro { padding: 28px 0 22px; }
  .target-card { padding: 24px 20px; border-radius: 20px; }
  .target-rent-type legend, .target-field-heading h2 { font-size: 16px; }
  .target-money, .field-row { grid-template-columns: 1fr; }
  .target-money { gap: 0; }
  .rent-buttons { gap: 10px; }
  .rent-buttons label > span { padding: 14px; }
  .rent-buttons input:checked + span { padding: 13px; }
  .target-recap { flex-wrap: wrap; gap: 12px; }
  .target-recap > div { flex: 1; min-width: 150px; }
  .input-card { padding: 20px 16px; }
  .record { flex-wrap: wrap; gap: 10px; }
  .record-controls { margin-left: auto; }
  .launch-bar { flex-wrap: wrap; gap: 16px; }
  .launch-bar > div { width: 100%; }
  .fire-button { width: 100%; }
  .result-hero { padding: 26px 22px; }
  .principal-amount { display: block; margin-left: 0; }
  .cost-line { padding-left: 20px; padding-right: 20px; }
  .result-details { margin-left: 20px; margin-right: 20px; }
  .result-actions { position: static; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .result-actions .secondary-button, .result-actions .reduce-button { font-size: 15px; padding: 12px 16px; min-height: 52px; }
  .guide-dialog { padding: 22px; border-radius: 20px; }
  .guide-dialog h2 { font-size: 24px; }
  .tax-buttons { flex-wrap: wrap; }
  .tax-buttons .primary-button { flex: 1; min-width: 120px; }
}
@media (max-width: 380px) {
  main { padding: 0 14px; }
  .step-nav { gap: 4px; }
  .step-nav button { font-size: 12px; gap: 4px; }
  .step-nav button > span { width: 22px; height: 22px; }
  .target-card { padding: 22px 16px; }
  .cost-line strong { margin-left: auto; }
  .result-actions { flex-wrap: wrap; }
  .result-actions > button { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
