/* swiss_mortgage_calculator — tool design (form left, verdict right, financing split + monthly costs + amortisation below). Shared: nav, footer, sidebars, ads. */
body[data-tool="swiss_mortgage_calculator"] {
  --sm-red: #D52B1E; --sm-ink: #15171C; --sm-ink2: #464B55; --sm-mute: #80858F; --sm-line: #E4E1DB; --sm-soft: #F3F1EC;
  --sm-bg: #FAF9F6; --sm-card: #FFFFFF; --sm-pass: #17734A; --sm-pass-bg: #E8F4EC; --sm-fail: #C1271B; --sm-fail-bg: #FBEAE8;
  --sm-c: #2B2F38; --sm-k: #8C93A0; --sm-m1: #C9CDD4; --sm-m2: #D52B1E;
  --sm-sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--sm-bg); color: var(--sm-ink); font-family: var(--sm-sans);
}
body[data-tool="swiss_mortgage_calculator"] .dt-nav { background: var(--sm-bg); border-bottom: 1px solid var(--sm-line); }
body[data-tool="swiss_mortgage_calculator"] .dt-nav .navbar-brand { color: var(--sm-ink); }
.dt-bare { display: block; width: 100%; flex: 1; }
.smx { max-width: 1120px; margin: 0 auto; padding: 36px 20px 64px; }
.sm-hero h1 { font-size: 46px; line-height: 1.05; font-weight: 800; letter-spacing: -.03em; margin: 0; }
.sm-hero h1::before { content: ""; display: inline-block; width: .6em; height: .6em; margin-right: .28em; vertical-align: .03em; border-radius: 3px;
  background: linear-gradient(#fff, #fff) center/20% 62% no-repeat, linear-gradient(#fff, #fff) center/62% 20% no-repeat, var(--sm-red); }
.sm-hero p { margin: 12px 0 0; font-size: 18px; color: var(--sm-ink2); max-width: 64ch; line-height: 1.55; }

/* tool */
.sm { margin-top: 28px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.sm-form { background: var(--sm-card); border: 1px solid var(--sm-line); border-top: 4px solid var(--sm-red); border-radius: 16px; padding: 8px 24px 20px; margin: 0; }
.sm-form fieldset { border: 0; margin: 0; padding: 16px 0 6px; min-width: 0; }
.sm-form fieldset + fieldset { border-top: 1px solid var(--sm-soft); }
.sm-form legend { padding: 16px 0 0; float: left; width: 100%; font-size: 13px; font-weight: 700; color: var(--sm-ink); margin-bottom: 10px; }
.sm-row { clear: both; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.sm-row3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sm-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sm-f label { font-size: 12px; font-weight: 600; color: var(--sm-mute); letter-spacing: .01em; }
.sm-f small { font-size: 12px; color: var(--sm-mute); line-height: 1.35; }
.sm-in { display: flex; align-items: baseline; gap: 6px; border-bottom: 2px solid var(--sm-line); padding: 2px 0 3px; transition: border-color .15s; }
.sm-in:focus-within { border-bottom-color: var(--sm-red); }
.sm-in span { font-size: 13px; font-weight: 600; color: var(--sm-mute); }
.sm-in input { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; padding: 0; outline: none; font-family: var(--sm-sans); font-size: 22px; font-weight: 700; color: var(--sm-ink); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.sm-type { clear: both; display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 10px; background: var(--sm-soft); margin-bottom: 14px; }
.sm-type button { border: 0; border-radius: 7px; background: transparent; padding: 7px 12px; font: inherit; font-size: 14px; font-weight: 600; color: var(--sm-ink2); cursor: pointer; }
.sm-type button[aria-pressed="true"] { background: var(--sm-ink); color: #fff; }
.sm-type button:focus-visible, .sm-adv summary:focus-visible { outline: 2px solid var(--sm-red); outline-offset: 2px; }
.sm-adv { margin-top: 14px; border-top: 1px dashed var(--sm-line); padding-top: 10px; }
.sm-adv summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--sm-ink2); padding: 4px 0 10px; }
.sm-adv .sm-in input { font-size: 18px; }

/* verdict */
.sm-out { position: sticky; top: 16px; background: var(--sm-card); border: 1px solid var(--sm-line); border-radius: 16px; padding: 22px 24px 20px; overflow: hidden; }
.sm-out::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--sm-pass); }
.sm-out[data-state="fail"]::before { background: var(--sm-fail); }
.sm-out[data-state="none"]::before { background: var(--sm-line); }
.sm-big { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; }
.sm-big b { font-size: 76px; line-height: 1; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: var(--sm-pass); }
.sm-out[data-state="fail"] .sm-big b { color: var(--sm-fail); }
.sm-verdict { display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: 15px; font-weight: 700; background: var(--sm-pass-bg); color: var(--sm-pass); }
.sm-out[data-state="fail"] .sm-verdict { background: var(--sm-fail-bg); color: var(--sm-fail); }
.sm-sub { margin: 10px 0 0; font-size: 14px; color: var(--sm-ink2); line-height: 1.45; }
.sm-gauge { position: relative; height: 10px; border-radius: 99px; background: var(--sm-soft); margin: 14px 0 4px; }
.sm-gauge i { position: absolute; inset: 0 auto 0 0; width: var(--v); border-radius: 99px; background: var(--sm-pass); transition: width .2s; }
.sm-out[data-state="fail"] .sm-gauge i { background: var(--sm-fail); }
.sm-gauge em { position: absolute; top: -4px; bottom: -4px; left: var(--lim); width: 2px; background: var(--sm-ink); }
.sm-checks { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.sm-checks li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.sm-checks li > span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sm-checks b { font-weight: 700; }
.sm-checks .d { color: var(--sm-ink2); }
.sm-checks i { flex: none; width: 20px; height: 20px; border-radius: 50%; margin-top: 1px; position: relative; background: var(--sm-pass); }
.sm-checks i::after { content: ""; position: absolute; left: 7px; top: 3.5px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2.2px 2.2px 0; transform: rotate(45deg); }
.sm-checks li[data-ok="0"] i { background: var(--sm-fail); }
.sm-checks li[data-ok="0"] i::after { left: 5px; top: 9px; width: 10px; height: 0; border-width: 2.2px 0 0 0; transform: none; }
.sm-warn { margin: 12px 0 0; font-size: 13px; color: var(--sm-fail); line-height: 1.45; }
.sm-warn:empty { display: none; }
.sm-max { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--sm-soft); display: flex; flex-direction: column; gap: 2px; }
.sm-max span { font-size: 13px; color: var(--sm-mute); }
.sm-max b { font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sm-max small { font-size: 13px; color: var(--sm-ink2); }

/* detail */
.sm-detail { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.sm-detail > div { background: var(--sm-card); border: 1px solid var(--sm-line); border-radius: 16px; padding: 18px 22px; min-width: 0; }
.sm-detail h3 { margin: 0 0 14px; font-size: 15px; font-weight: 700; }
.sm-sched { grid-column: 1 / -1; }
.sm-bar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: var(--sm-soft); }
.sm-bar i { display: block; height: 100%; transition: width .2s; }
.sm-bar .c, .sm-legend .c { background: var(--sm-c); } .sm-bar .k, .sm-legend .k { background: var(--sm-k); }
.sm-bar .m1, .sm-legend .m1 { background: var(--sm-m1); } .sm-bar .m2, .sm-legend .m2 { background: var(--sm-m2); }
.sm-legend { margin: 14px 0 0; display: grid; gap: 6px; }
.sm-legend > div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.sm-legend dt { color: var(--sm-ink2); display: flex; align-items: center; gap: 8px; }
.sm-legend dt i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sm-legend dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.sm-legend .tot { border-top: 1px solid var(--sm-soft); padding-top: 6px; margin-top: 2px; }
.sm-legend .tot dt { color: var(--sm-ink); font-weight: 700; } .sm-legend .tot dd { font-weight: 800; }
.sm-tw { overflow-x: auto; }
.sm-tw table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.sm-tw th, .sm-tw td { padding: 8px 6px; text-align: right; border-bottom: 1px solid var(--sm-soft); }
.sm-tw th[scope="row"], .sm-tw thead th:first-child { text-align: left; font-weight: 500; color: var(--sm-ink2); padding-left: 0; }
.sm-tw thead th { font-size: 12px; font-weight: 600; color: var(--sm-mute); }
.sm-tw tfoot th, .sm-tw tfoot td { border-bottom: 0; font-weight: 800; color: var(--sm-ink); font-size: 15px; }
.sm-tw td:last-child, .sm-tw th:last-child { padding-right: 0; }
.sm-term { margin: 10px 0 0; font-size: 13px; color: var(--sm-ink2); }
.sm-term:empty { display: none; }
#smSched svg { width: 100%; height: auto; display: block; font-family: var(--sm-sans); font-size: 12px; }
#smSched text { fill: var(--sm-mute); }
#smSched .gl { stroke: var(--sm-soft); }
#smSched rect { fill: var(--sm-red); }
#smSched rect:hover { fill: var(--sm-ink); }
#smSchedNote { margin: 8px 0 0; font-size: 13px; color: var(--sm-ink2); }

/* article */
.sm-adwrap { margin: 44px 0 8px; }
.sm-article, .sm-faq, .sm-more { max-width: 740px; margin: 0 auto; }
.sm-article { margin-top: 48px; font-size: 17px; line-height: 1.72; color: var(--sm-ink2); }
.sm-article h2, .sm-faq h2, .sm-more h2 { font-size: 27px; line-height: 1.25; font-weight: 800; letter-spacing: -.02em; color: var(--sm-ink); margin: 50px 0 12px; }
.sm-article h2:first-child { margin-top: 0; }
.sm-article p { margin: 0 0 14px; } .sm-article b { color: var(--sm-ink); } .sm-article a { color: var(--sm-ink); }
.sm-article ul { padding-left: 1.2em; } .sm-article li { margin: 7px 0; }
.sm-eq { font-size: 15px; font-weight: 600; background: var(--sm-card); border: 1px solid var(--sm-line); border-left: 4px solid var(--sm-red); border-radius: 6px; padding: 12px 14px; color: var(--sm-ink); }
.sm-table { overflow-x: auto; margin: 16px 0 18px; border: 1px solid var(--sm-line); border-radius: 12px; background: var(--sm-card); }
.sm-table table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.sm-table th { text-align: left; padding: 11px 14px; font-size: 12px; font-weight: 600; color: var(--sm-mute); border-bottom: 1px solid var(--sm-line); }
.sm-table td { padding: 10px 14px; border-bottom: 1px solid var(--sm-soft); color: var(--sm-ink); white-space: nowrap; }
.sm-table tr:last-child td { border-bottom: 0; }
.sm-table .u { font-weight: 500; opacity: .75; }
.sm-src { font-size: 15px; } .sm-src a { word-break: break-word; }
.sm-q { border-bottom: 1px solid var(--sm-line); }
.sm-q summary { list-style: none; cursor: pointer; padding: 16px 32px 16px 0; position: relative; font-size: 18px; font-weight: 700; }
.sm-q summary::-webkit-details-marker { display: none; }
.sm-q summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 24px; font-weight: 400; color: var(--sm-mute); }
.sm-q[open] summary::after { content: "\2212"; }
.sm-q p { margin: 0 0 18px; font-size: 17px; line-height: 1.7; color: var(--sm-ink2); }
.sm-more > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sm-more a { display: block; text-decoration: none; padding: 14px 16px; border: 1px solid var(--sm-line); border-radius: 12px; background: var(--sm-card); color: var(--sm-ink); }
.sm-more a:hover { border-color: var(--sm-ink); }
.sm-more b { display: block; font-size: 15px; } .sm-more span { display: block; font-size: 13px; color: var(--sm-mute); margin-top: 2px; }

@media (max-width: 960px) {
  .sm { grid-template-columns: minmax(0, 1fr); }
  .sm-out { position: static; }
  .sm-detail { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .smx { padding: 24px 16px 48px; }
  .sm-hero h1 { font-size: 34px; }
  .sm-hero p { font-size: 16px; }
  .sm-form { padding: 4px 16px 16px; }
  .sm-row { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .sm-row3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .sm-row3 .sm-f label { min-height: 2.6em; }
  .sm-type { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; box-sizing: border-box; }
  .sm-type button { padding: 7px 4px; font-size: 13px; }
  .sm-out { padding: 20px 16px 16px; }
  .sm-big b { font-size: 60px; }
  .sm-detail > div { padding: 16px; }
  #smSched svg { font-size: 21px; }
  .sm-tw th, .sm-tw td { padding: 8px 3px; font-size: 13px; }
  .sm-article { font-size: 16px; }
  .sm-article h2, .sm-faq h2, .sm-more h2 { font-size: 23px; margin-top: 40px; }
  .sm-more > div { grid-template-columns: minmax(0, 1fr); }
  .sm-table th, .sm-table td { padding: 8px 5px; font-size: 12.5px; }
  .sm-table th:first-child, .sm-table td:first-child { padding-left: 10px; }
}
