/* UI v2 — общий визуальный слой инструментов. Математика и печатные формы — в исходных модулях. */
:root {
  --bg: #f2f1eb;
  --panel: #faf9f5;
  --border: #d8d7d0;
  --border-strong: #92928b;
  --text: #181914;
  --muted: #65665f;
  --accent: #1d39f5;
  --accent-soft: #edf0ff;
  --radius: 8px;
  --shadow: none;
  --glass: #faf9f5;
  --glass-border: #d8d7d0;
  --glass-blur: none;
}
body { background: var(--bg); background-attachment: initial; }
.site-head {
  max-width: 1200px; padding: 26px 32px 22px; margin: auto;
  align-items: center; justify-content: space-between; gap: 24px;
  border-bottom: 1px solid var(--border); flex-wrap: nowrap;
}
.identity { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; flex: none; }
.identity svg { width: 38px; height: 38px; }
.identity-text { display: grid; gap: 1px; }
.identity .brand { font-size: 19px; font-weight: 730; letter-spacing: -.05em; line-height: 1.2; }
.identity .brand span { color: var(--accent); }
.identity-sub { color: var(--muted); font-size: 10px; letter-spacing: .04em; }
.tool-nav { display: flex; gap: 5px; flex-wrap: wrap; }
.tool-nav a { color: var(--muted); font-size: 12px; font-weight: 550; text-decoration: none; padding: 10px 12px; border-radius: 5px; white-space: nowrap; }
.tool-nav a:hover { color: var(--accent); background: #e8e7e1; }
.tool-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.page-hero { max-width: 1200px; margin: auto; padding: 38px 32px 30px; display: flex; justify-content: space-between; align-items: flex-end; gap: 36px; }
.eyebrow { font: 10px ui-monospace, 'Cascadia Mono', Consolas, monospace; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; margin: 0 0 13px; }
.page-hero h1 { font-size: clamp(32px, 4vw, 49px); line-height: 1.08; font-weight: 660; letter-spacing: -.055em; margin: 0 0 12px; }
.page-hero h1 span { color: var(--accent); }
.hero-intro { font-size: 14px; line-height: 1.6; color: var(--muted); max-width: 63ch; margin: 0; }
.hero-law { flex: none; width: 332px; padding: 4px 0 4px 18px; border-left: 2px solid var(--accent); margin-bottom: 4px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.hero-law strong { display: block; font-size: 13px; color: var(--text); font-weight: 550; margin-bottom: 2px; }
.layout { max-width: 1200px; padding: 0 32px 54px; grid-template-columns: minmax(0, 1fr) 332px; gap: 32px; }
#calcForm { min-width: 0; counter-reset: step; }
#calcForm > .card:not([hidden]) { counter-increment: step; }
#calcForm > .card { border: 0; background: transparent; padding: 0 0 25px; margin: 0 0 24px; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; backdrop-filter: none; }
.card-title { text-transform: none; letter-spacing: -.025em; color: var(--text); font-size: 17px; font-weight: 610; display: flex; align-items: baseline; gap: 11px; margin-bottom: 15px; }
#calcForm > .card .card-title::before { font: 11px ui-monospace, 'Cascadia Mono', Consolas, monospace; color: var(--accent); letter-spacing: -.03em; }
#calcForm > .card .card-title::before { content: counter(step, decimal-leading-zero); }
.segmented { background: #e8e7e0; border-color: transparent; border-radius: 6px; padding: 4px; }
.seg-ind { top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--segs, 2)); background: #faf9f5; border-radius: 4px; box-shadow: 0 1px 3px #18191410; }
.segmented span { font-size: 12px; padding: 10px 7px; font-weight: 550; border-radius: 4px; }
.segmented input:checked + span { color: var(--accent); }
.types { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.type-btn { position: relative; min-height: 94px; padding: 13px 22px 13px 15px; border-radius: 6px; background: #f9f8f3; border-color: var(--border); box-shadow: none; transition: border-color .15s, background .15s; }
.type-btn .t { font-size: 14px; font-weight: 600; line-height: 1.35; letter-spacing: -.02em; }
.type-btn .h { color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 5px; }
.type-btn:hover { border-color: #9da8f6; background: #fdfcf8; }
.type-btn[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 .5px var(--accent); background: var(--accent-soft); }
.type-btn[aria-pressed="true"] .t { color: var(--accent); }
.type-btn[aria-pressed="true"]::after { content: '✓'; position: absolute; top: 12px; right: 11px; font-size: 12px; color: var(--accent); }
.amount-wrap input { font-size: 37px; font-weight: 580; letter-spacing: -.045em; padding-block: 3px 12px; }
.amount-wrap input::placeholder { color: #787970; }
.amount-wrap .cur { color: var(--text); font-size: 23px; }
.hint { font-size: 11.5px; line-height: 1.6; }
.hint code { border-color: var(--border); background: #e8e7e0; font-size: 10.5px; }
.chk { padding: 10px 12px; border-radius: 5px; }
.chk .lbl { font-size: 13px; }
.chk .sub { font-size: 11.5px; }
.chk:has(input:checked) { border-color: #c7cffc; }
.result-col { top: 22px; min-width: 0; }
.result { padding: 0; border: 1px solid #c9c9c0; border-radius: 8px; overflow: hidden; background: #faf9f5; box-shadow: 0 4px 18px #18191405; backdrop-filter: none; }
.result-total { background: var(--accent); color: white; padding: 25px 23px 27px; position: relative; }
.fee-label { color: #e7eaff; font-size: 11px; text-transform: none; letter-spacing: 0; font-weight: 450; padding-right: 28px; }
.fee { font-size: 47px; letter-spacing: -.055em; font-weight: 560; margin-top: 11px; color: #fff; }
.result-body { padding: 5px 21px 20px; }
.steps { gap: 8px; padding-left: 18px; margin-top: 16px; }
.steps li { color: var(--text); font-size: 12px; line-height: 1.55; }
.steps li::marker { color: var(--accent); }
.notes { gap: 7px; }
.note { font-size: 11.5px; line-height: 1.6; padding: 10px 11px; background: #ecf0e6; border-color: #d6dfce; border-radius: 5px; }
.order-line { background: #eae9e3; color: var(--text); border-radius: 5px; font-size: 12px; }
.court { border-radius: 5px; padding: 11px; font-size: 12px; line-height: 1.6; }
.court::before { content: ''; }
.blocked { border-radius: 5px; font-size: 12px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 19px; }
.btn { background: transparent; border: 1px solid var(--border); border-radius: 5px; box-shadow: none; backdrop-filter: none; font-size: 11px; font-weight: 550; padding: 10px 8px; text-align: center; line-height: 1.45; }
.btn:hover { background: #edece5; border-color: #aead9f; box-shadow: none; }
.btn.primary { border-color: var(--text); background: var(--text); color: #fff; box-shadow: none; }
.btn.primary:hover { background: #33342d; }
.btn:disabled { opacity: .42; cursor: default; }
#printBtn { grid-column: 1 / -1; grid-row: 1; font-size: 12px; padding-block: 12px; }
#copyCalc { grid-column: 1 / -1; }
#copyLink { grid-row: 3; grid-column: 1; }
#copySum { grid-row: 3; grid-column: 2; }
#payFns { grid-column: 1 / -1; font-size: 12px; padding-block: 8px; margin-top: 2px; }
.private-note { color: var(--muted); text-align: center; font-size: 10px; line-height: 1.6; margin: 12px 16px 0; }
.related-tool { display: block; margin-top: 20px; border-top: 1px solid var(--border); padding-top: 15px; color: var(--text); text-decoration: none; font-size: 12px; line-height: 1.6; }
.related-tool .tag { display: block; font: 9px ui-monospace, Consolas, monospace; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.related-tool strong { font-weight: 550; }
.related-tool .arrow { color: var(--accent); float: right; font-size: 17px; }
.related-tool:hover strong { color: var(--accent); }
.article { max-width: 850px; padding: 24px 32px 56px; color: var(--text); }
.article > h2:first-child { font-size: 30px; letter-spacing: -.045em; }
.article h2 { font-weight: 600; }
.article .law-text { border-left-color: var(--accent); }
.article .formula, .faq details { border-radius: 5px; background: #faf9f5; }
.faq details { border-width: 0 0 1px; border-radius: 0; background: transparent; padding-inline: 0; }
.faq summary { font-size: 13px; font-weight: 550; }
.faq summary::before { color: var(--accent); }
.site-foot { max-width: 1200px; padding: 35px 32px 45px; }
.site-foot .brand { font-size: 21px; letter-spacing: -.045em; }
.foot-col h3 { color: var(--muted); }
.design-label { margin-top: 26px; font: 10px ui-monospace, Consolas, monospace; color: var(--muted); }
@media (max-width: 1050px) {
  .site-head { flex-wrap: wrap; gap: 17px; }
  .tool-nav { width: 100%; }
  .tool-nav a { padding: 8px 12px; }
  .tool-nav a:first-child { margin-left: -12px; }
  .layout { grid-template-columns: minmax(0, 1fr) 305px; gap: 24px; }
  .hero-law { width: 305px; }
  .types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .type-btn { min-height: 84px; }
}
@media (max-width: 850px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .result-col { position: static; }
  .hero-law { display: none; }
  .page-hero h1 { font-size: 42px; }
  .result-total { padding-block: 23px; }
}
@media (max-width: 520px) {
  .site-head { padding: 21px 20px 15px; gap: 17px; }
  .identity svg { width: 34px; height: 34px; }
  .tool-nav { display: grid; grid-template-columns: max-content max-content; gap: 2px 12px; }
  .tool-nav a { padding: 8px 9px; font-size: 11px; }
  .tool-nav a { min-height: 44px; display: flex; align-items: center; }
  .tool-nav a:first-child { margin-left: 0; }
  .page-hero { padding: 28px 20px 25px; }
  .page-hero h1 { font-size: 35px; max-width: 11ch; line-height: 1.05; }
  .hero-intro { font-size: 12px; max-width: 37ch; }
  .eyebrow { font-size: 9px; letter-spacing: .06em; }
  .layout { padding-inline: 20px; padding-bottom: 22px; }
  #calcForm > .card { margin-bottom: 19px; padding-bottom: 21px; }
  .card-title { font-size: 16px; gap: 9px; }
  .segmented span { font-size: 10.5px; padding: 10px 4px; }
  .segmented span { min-height: 44px; display: grid; place-items: center; }
  .btn, .chk { min-height: 44px; }
  .types { gap: 7px; }
  .type-btn { padding: 12px 14px 12px 11px; min-height: 88px; }
  .type-btn .t { font-size: 12px; line-height: 1.4; }
  .type-btn .h { font-size: 11px; line-height: 1.5; }
  .type-btn[aria-pressed="true"]::after { top: 4px; right: 5px; font-size: 9px; }
  .amount-wrap input { font-size: 33px; }
  .result { background: #faf9f5; }
  .article { padding-inline: 20px; }
  .article > h2:first-child { font-size: 26px; }
  .site-foot { padding-inline: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  body { background: #fff; }
  .private-note, .related-tool { display: none; }
}

/* Подстройка общих правил под даты, оплаты и широкую помесячную таблицу. */
.card { background: var(--panel); box-shadow: none; backdrop-filter: none; }
.layout > form { min-width: 0; }
.p395 .layout { grid-template-columns: minmax(0, 1fr) 420px; }
.p395 .hero-law { width: 420px; }
.p395 .fee { font-size: clamp(33px, 3.4vw, 47px); }
.p395 .seg-table { font-size: 11.5px; }
.p395 .seg-table td, .p395 .seg-table th { padding: 8px 5px; }
.dates input[type=date], .pay-row input, .pv-select, .text-in { background: #faf9f5; border-radius: 5px; border-color: var(--border); box-shadow: none; backdrop-filter: none; min-height: 44px; }
.date-field input[type=date] { width: 100%; min-width: 0; background: #faf9f5; border-radius: 5px; }
.df-label, .field-label, .cell-label { text-transform: none; letter-spacing: 0; font-weight: 550; }
.df-sub { font-size: 11px; line-height: 1.55; }
.pay-del, .row-del { width: 36px; min-height: 44px; border-radius: 5px; }
.pay-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; }
.pay-row input { width: 100%; }
#todayBtn { margin-top: 13px; }
.p395 .actions { grid-template-columns: 1fr 1fr; }
#print402Btn { grid-column: 1 / -1; grid-row: 4; }
.btn.link.cross { font-size: 12px; margin-top: 15px; white-space: normal; overflow-wrap: anywhere; }
.palimony main.layout { max-width: 1000px; grid-template-columns: minmax(0,1fr); }
.palimony .page-hero { max-width: 1000px; }
.palimony .hero-law { display: none; }
#peniForm > .card, #vozvratForm > .card { border: 0; background: transparent; padding: 0 0 27px; margin: 0 0 26px; border-bottom: 1px solid var(--border); border-radius: 0; }
#peniForm > .peni-result { padding: 24px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.peni-result .result-total { border-radius: 5px; margin-block: 16px; }
.peni-result .fee { font-size: 42px; }
.radio-tile { border-radius: 6px; background: #faf9f5; }
.radio-tile:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.radio-tile input { accent-color: var(--accent); }
.row-line { grid-template-columns: minmax(0,1fr) minmax(0,1.1fr) minmax(0,1.2fr) 36px; }
.pay-line { grid-template-columns: minmax(0,1fr) minmax(0,1.1fr) minmax(0,1.5fr) 36px; }
.row-line > div, .pay-line > div { min-width: 0; }
.text-in, .pv-select { min-width: 0; }
.fee-note { border-radius: 5px; background: var(--accent-soft); }
.fee-note a, .link-btn { color: var(--accent); }
.warn-note, .way, .doc-preview { border-radius: 5px; }
.link-btn { min-height: 44px; padding: 7px 0; }
.peni-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.peni-actions .btn { min-height: 44px; padding: 11px 17px; font-size: 12px; }
#btnPrint { order: -1; }
.palimony .m-result, .pvozvrat .m-result { background: var(--accent); color: #fff; border-color: var(--accent); border-radius: 6px; box-shadow: none; backdrop-filter: none; }
.palimony .m-result .m-label, .pvozvrat .m-result .m-label { color: #e7eaff; text-transform: none; letter-spacing: 0; }
.calc-table th, .pv-table th { text-transform: none; letter-spacing: 0; }
.calc-table { font-size: 13px; }
.calc-table tr.month-sum { background: #edf0e8; }
.way { background: #faf9f5; }
.pvozvrat .actions { display: flex; flex-direction: column; }
.pvozvrat .actions .btn { font-size: 12px; }
.pvozvrat .pv-table .n { white-space: normal; }
.pvozvrat .field-label { margin-top: 21px; }
.pvozvrat .pv-select { font-size: 13px; }
.ui-skip { position: absolute; top: -100px; left: 20px; z-index: 100; padding: 10px 14px; background: #fff; color: var(--accent); border: 1px solid var(--accent); border-radius: 5px; }
.ui-skip:focus { top: 10px; }
.table-scroll { max-width: 100%; }
.fee { overflow-wrap: anywhere; }
@media (min-width: 851px) and (max-width: 1050px) {
  .p395 .layout { grid-template-columns: minmax(0,1fr) 365px; }
  .p395 .hero-law { width: 365px; }
}
@media (max-width: 850px) {
  .p395 .layout { grid-template-columns: minmax(0,1fr); }
  .p395 .hero-law { display: none; }
  .pvozvrat .m-result { display: block; }
  .p395 .fee { font-size: 43px; }
}
@media (max-width: 920px) {
  /* Мобильная плашка уже показывает сумму; сохраняем один видимый итог. */
  .palimony .peni-result .result-total { display: none; }
}
@media (min-width: 851px) {
  .pvozvrat .m-result { display: none; }
}
@media (max-width: 640px) {
  .row-line, .pay-line { grid-template-columns: minmax(0,1fr); }
  .row-del { justify-self: end; }
  .pay-row { grid-template-columns: minmax(0,1fr) 36px; }
  .pay-row input[type=date] { grid-column: 1 / -1; }
  #peniForm > .peni-result { padding: 17px 14px; }
  .peni-result .fee { font-size: 37px; }
  .peni-result .result-total { padding: 20px 15px; }
  .peni-actions { flex-direction: column; }
  .peni-actions .btn { width: 100%; }
  .palimony .page-hero h1 { max-width: 16ch; }
  .desktop-break { display: none; }
  .pvozvrat .pv-select { font-size: 12px; }
}
@media print {
  .fee { color: #000; }
  body > *:not(#printSheet) { display: none !important; }
  #printSheet { background: #fff; }
}
