/* Несущий слой (nessloy.xyz) — расчет осадки ленточного фундамента (v2.0.0).
   Палитра сайта: фон #F0F4F8, карточки #FFF/#F7F9FB, рамки #D5E0E8/#B8C7D4,
   акцент #3E5463, угольный #2B343B; эпюра σzp — #B84A39.
   Все правила ограничены .ns-st; свойства элементов управления защищены от стилей темы. */

.ns-st {
	--st-bg: #F0F4F8; --st-card: #FFFFFF; --st-subtle: #F7F9FB;
	--st-accent: #3E5463; --st-accent-dark: #2C3E4B; --st-muted-accent: #5A7182; --st-soft: #E6EDF2;
	--st-ink: #2B343B; --st-body: #333333; --st-muted: #5C6B77;
	--st-line: #D5E0E8; --st-line2: #B8C7D4;
	--st-red: #B84A39; --st-red-soft: #FBEFEC;
	--st-ok: #2F6B4F; --st-ok-soft: #E7F2EC; --st-warn: #9A6A12; --st-warn-soft: #FBF3E2;
	--st-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--st-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

	position: relative; box-sizing: border-box;
	max-width: 1280px; margin: 8px auto 24px; padding: 0 0 20px;
	background: var(--st-bg); border: 1px solid var(--st-line); border-radius: 12px; overflow: hidden;
	font-family: var(--st-font); font-size: 15px; line-height: 1.5; color: var(--st-ink); text-align: left;
	-webkit-text-size-adjust: 100%;
}
.ns-st *, .ns-st *::before, .ns-st *::after { box-sizing: border-box; }
.ns-st p { margin: 0; }
.ns-st sub { font-size: .72em; line-height: 0; vertical-align: -.25em; }
.ns-st [hidden] { display: none !important; }
.ns-st-hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

/* ---------- Шапка ---------- */
.ns-st-head {
	display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
	padding: 20px 24px; margin: 0 0 20px;
	background: linear-gradient(135deg, #2B343B 0%, #34414B 100%); border-bottom: 3px solid var(--st-accent);
}
.ns-st-head__main { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1 1 480px; }
.ns-st-badge {
	flex: none; display: inline-flex; align-items: center; justify-content: center;
	width: 52px; height: 52px; border-radius: 8px; background: var(--st-accent); border: 1px solid rgba(255,255,255,.18);
	color: #fff; font: italic 700 24px/1 Georgia, "Times New Roman", serif;
}
.ns-st .ns-st-title {
	margin: 0 0 4px !important; padding: 0 !important; border: 0 !important; background: none !important;
	font: 700 21px/1.3 var(--st-font) !important; letter-spacing: 0 !important; text-transform: none !important;
	color: #fff !important; -webkit-text-fill-color: #fff !important; text-shadow: none !important;
}
.ns-st .ns-st-sub { font-size: 13.5px; color: #C9D4DC !important; -webkit-text-fill-color: #C9D4DC !important; }
.ns-st-status {
	display: inline-flex; align-items: center; gap: 8px; flex: none; white-space: nowrap;
	padding: 7px 14px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
	color: #fff; font-size: 13px; font-weight: 600;
}
.ns-st-status__dot { width: 9px; height: 9px; border-radius: 50%; background: #9AABB8; }
.ns-st-status[data-state="ok"] .ns-st-status__dot { background: #6FCF97; box-shadow: 0 0 0 3px rgba(111,207,151,.25); }
.ns-st-status[data-state="busy"] .ns-st-status__dot { background: #E6C27A; animation: ns-st-pulse 1s infinite; }
.ns-st-status[data-state="warn"] .ns-st-status__dot { background: #E6C27A; }
.ns-st-status[data-state="error"] .ns-st-status__dot { background: #E58B8B; }
@keyframes ns-st-pulse { 50% { opacity: .35; } }

/* ---------- Сетка ---------- */
.ns-st-grid { display: grid; grid-template-columns: minmax(340px, 430px) minmax(0, 1fr); gap: 20px; align-items: start; padding: 0 20px; }
.ns-st-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; margin: 0; }

.ns-st-card {
	background: var(--st-card); border: 1px solid var(--st-line); border-radius: 10px; padding: 18px;
	box-shadow: 0 1px 2px rgba(43,52,59,.04), 0 6px 18px rgba(43,52,59,.06); min-width: 0;
}
.ns-st-card__head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--st-line); }
.ns-st-num { flex: none; padding: 3px 8px; border-radius: 4px; background: var(--st-accent); color: #fff; font: 700 12px/1.4 var(--st-mono); }
.ns-st .ns-st-card__title {
	margin: 0 !important; padding: 0 !important; border: 0 !important; background: none !important;
	font: 700 15.5px/1.35 var(--st-font) !important; letter-spacing: 0 !important; text-transform: none !important;
	color: var(--st-ink) !important; -webkit-text-fill-color: var(--st-ink) !important;
}
.ns-st-thick { margin-left: auto; padding: 2px 9px; border-radius: 999px; background: var(--st-soft); color: var(--st-accent); font: 600 12px/1.6 var(--st-mono); white-space: nowrap; }

/* ---------- Поля ---------- */
.ns-st-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ns-st-field { display: flex; flex-direction: column; min-width: 0; }
.ns-st-field--wide, .ns-st-field[data-field="eeRatio"] { grid-column: 1 / -1; }
.ns-st .ns-st-field label { display: block; margin: 0 0 5px; padding: 0; font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--st-ink); }
.ns-st-input {
	display: flex; align-items: stretch; min-height: 42px; background: #fff;
	border: 1px solid var(--st-line2); border-radius: 6px; overflow: hidden;
	transition: border-color .15s, box-shadow .15s;
}
.ns-st-input:hover { border-color: #93A7B6; }
.ns-st-input:focus-within { border-color: var(--st-accent); box-shadow: 0 0 0 3px rgba(62,84,99,.16); }
.ns-st .ns-st-input input, .ns-st .ns-st-layer__name {
	flex: 1 1 auto; min-width: 0; width: 100% !important; height: auto !important; max-width: none !important;
	margin: 0 !important; padding: 8px 10px !important; border: 0 !important; border-radius: 0 !important;
	background: transparent !important; box-shadow: none !important; outline: none !important;
	font: 600 15px/1.2 var(--st-font) !important; font-variant-numeric: tabular-nums;
	color: var(--st-ink) !important; -webkit-text-fill-color: var(--st-ink) !important; -webkit-appearance: none; appearance: none;
}
.ns-st-unit {
	display: flex; align-items: center; justify-content: center; flex: none; min-width: 44px; padding: 0 9px;
	background: var(--st-subtle); border-left: 1px solid var(--st-line);
	font-size: 12px; font-weight: 600; color: var(--st-muted); white-space: nowrap;
}
.ns-st-unit:empty { display: none; }
.ns-st-hint { display: block; margin-top: 4px; font-size: 11.5px; line-height: 1.35; color: var(--st-muted); }
.ns-st-hint:empty { display: none; }
.ns-st-err { display: none; margin-top: 4px; font-size: 11.5px; font-weight: 600; line-height: 1.35; color: #8A2E2E; }
.ns-st-field.has-error .ns-st-err { display: block; }
.ns-st-field.has-error .ns-st-hint { display: none; }
.ns-st-field.has-error .ns-st-input { border-color: #C87A7A; background: #FDF2F2; box-shadow: 0 0 0 3px rgba(200,122,122,.15); }

.ns-st-select { position: relative; }
.ns-st .ns-st-select select {
	width: 100% !important; height: 42px !important; margin: 0 !important; padding: 0 34px 0 10px !important;
	border: 1px solid var(--st-line2) !important; border-radius: 6px !important; background: #fff !important; box-shadow: none !important;
	font: 500 14px/1 var(--st-font) !important; color: var(--st-ink) !important; -webkit-appearance: none; appearance: none; cursor: pointer;
}
.ns-st .ns-st-select select:focus { border-color: var(--st-accent) !important; box-shadow: 0 0 0 3px rgba(62,84,99,.16) !important; outline: none !important; }
.ns-st-select::after { content: ""; position: absolute; right: 13px; top: 50%; width: 7px; height: 7px; margin-top: -5px; border-right: 2px solid var(--st-muted-accent); border-bottom: 2px solid var(--st-muted-accent); transform: rotate(45deg); pointer-events: none; }

.ns-st .ns-st-check { position: relative; display: flex; align-items: center; gap: 10px; margin: 2px 0 0; cursor: pointer; font-size: 13px; color: var(--st-body); }
.ns-st-check input { position: absolute; left: 0; top: 0; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.ns-st-check__box { flex: none; width: 18px; height: 18px; border: 1.5px solid var(--st-line2); border-radius: 4px; background: #fff; display: grid; place-items: center; transition: background .15s, border-color .15s; }
.ns-st-check input:checked + .ns-st-check__box { background: var(--st-accent); border-color: var(--st-accent); }
.ns-st-check input:checked + .ns-st-check__box::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.ns-st-check input:focus-visible + .ns-st-check__box { box-shadow: 0 0 0 3px rgba(62,84,99,.25); }

/* ---------- Слои ---------- */
.ns-st-layers { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.ns-st-layer { padding: 10px 12px 10px; background: var(--st-subtle); border: 1px solid var(--st-line); border-left: 4px solid var(--st-muted-accent); border-radius: 8px; }
.ns-st-layer:nth-child(2n) { border-left-color: #8C6239; }
.ns-st-layer__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ns-st-layer__tag { flex: none; padding: 2px 8px; border-radius: 4px; background: var(--st-ink); color: #fff; font: 700 11.5px/1.5 var(--st-mono); }
.ns-st .ns-st-layer__name { padding: 6px 8px !important; font-size: 14px !important; font-weight: 600 !important; border: 1px solid transparent !important; border-radius: 5px !important; }
.ns-st .ns-st-layer__name:hover { border-color: var(--st-line2) !important; background: #fff !important; }
.ns-st .ns-st-layer__name:focus { border-color: var(--st-accent) !important; background: #fff !important; }
.ns-st .ns-st-layer__del, .ns-st .ns-st-layer__del:focus {
	flex: none; width: 32px !important; height: 32px !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important;
	border: 1px solid transparent !important; border-radius: 6px !important; background: transparent !important; box-shadow: none !important;
	color: #99A6B2 !important; font: 400 20px/1 var(--st-font) !important; text-transform: none !important; text-decoration: none !important; cursor: pointer;
}
.ns-st .ns-st-layer__del:hover { background: var(--st-red-soft) !important; border-color: #EBC7BF !important; color: var(--st-red) !important; }
.ns-st .ns-st-layer__del:disabled { opacity: .35 !important; cursor: not-allowed; background: transparent !important; color: #99A6B2 !important; }
.ns-st-layer__row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ns-st-field--layer label { font-size: 11.5px !important; font-weight: 600 !important; color: var(--st-muted) !important; }
.ns-st-field--layer .ns-st-input { min-height: 38px; }
.ns-st-field--layer .ns-st-unit { min-width: 0; padding: 0 6px; font-size: 11px; }
.ns-st-field--layer .ns-st-input input { padding: 6px 7px !important; font-size: 14px !important; }
.ns-st-layer__depth { margin-top: 6px; font: 500 11.5px/1.4 var(--st-mono); color: var(--st-muted-accent); }
.ns-st-note { margin-top: 10px !important; font-size: 12px; color: var(--st-muted); }

/* ---------- Кнопки ---------- */
.ns-st .ns-st-btn, .ns-st .ns-st-btn:focus {
	display: inline-flex !important; align-items: center !important; justify-content: center !important; gap: 6px;
	min-height: 40px !important; height: auto !important; margin: 0 !important; padding: 8px 14px !important;
	border-radius: 7px !important; font: 600 14px/1.2 var(--st-font) !important; letter-spacing: 0 !important;
	text-transform: none !important; text-decoration: none !important; text-shadow: none !important; cursor: pointer;
	transition: background .15s, border-color .15s, color .15s;
}
.ns-st .ns-st-btn--ghost, .ns-st .ns-st-btn--ghost:focus { background: #fff !important; border: 1px dashed var(--st-line2) !important; color: var(--st-accent) !important; -webkit-text-fill-color: var(--st-accent) !important; box-shadow: none !important; }
.ns-st .ns-st-btn--ghost:hover, .ns-st .ns-st-btn--ghost:active { background: var(--st-soft) !important; border-color: var(--st-accent) !important; color: var(--st-ink) !important; -webkit-text-fill-color: var(--st-ink) !important; }
.ns-st .ns-st-btn--block { width: 100% !important; }
.ns-st .ns-st-btn--sm { min-height: 32px !important; padding: 5px 12px !important; font-size: 13px !important; border-style: solid !important; }
.ns-st .ns-st-btn:focus-visible { outline: 3px solid rgba(62,84,99,.35) !important; outline-offset: 2px !important; }

/* ---------- Результаты ---------- */
.ns-st.is-stale .ns-st-results .ns-st-kpis,
.ns-st.is-stale .ns-st-results .ns-st-split,
.ns-st.is-stale .ns-st-results canvas { opacity: .5; transition: opacity .2s; }
.ns-st-alerts:empty { display: none; }
.ns-st-alerts { display: grid; gap: 6px; margin-bottom: 12px; }
.ns-st-alert { padding: 9px 12px; border-radius: 6px; background: var(--st-warn-soft); border: 1px solid #EAD5A8; border-left: 4px solid #D4A443; color: #6B4A0E; font-size: 13px; line-height: 1.4; }
.ns-st-alert--bad { background: #FDF2F2; border-color: #E3B4B4; border-left-color: #C87A7A; color: #8A2E2E; font-weight: 600; }

.ns-st-kpis { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; }
.ns-st-kpi { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--st-line); border-radius: 8px; background: #fff; overflow: hidden; min-width: 0; }
.ns-st-kpi::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--st-muted-accent); }
.ns-st-kpi--main { background: linear-gradient(180deg, #F2F6FA, #fff); }
.ns-st-kpi--main::before { background: var(--st-accent); }
.ns-st-kpi--main.is-bad::before { background: var(--st-red); }
.ns-st-kpi__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--st-muted); line-height: 1.35; }
.ns-st-kpi__top b { color: var(--st-ink); }
.ns-st-kpi__val { display: flex; align-items: baseline; gap: 6px; font-size: 28px; font-weight: 750; line-height: 1.1; color: var(--st-ink); font-variant-numeric: tabular-nums; }
.ns-st-kpi--main .ns-st-kpi__val { font-size: 34px; color: var(--st-accent-dark); }
.ns-st-kpi__val small { font-size: 14px; font-weight: 600; color: var(--st-muted); }
.ns-st-kpi__sub { font-size: 12px; line-height: 1.4; color: var(--st-muted); }
.ns-st-pill { flex: none; padding: 2px 8px; border-radius: 999px; font: 700 11px/1.6 var(--st-font); white-space: nowrap; background: var(--st-soft); color: var(--st-accent); }
.ns-st-pill.is-ok { background: var(--st-ok-soft); color: var(--st-ok); }
.ns-st-pill.is-bad { background: var(--st-red-soft); color: var(--st-red); }
.ns-st-meter { height: 7px; border-radius: 999px; background: #E2EAF0; overflow: hidden; margin: 4px 0 2px; }
.ns-st-meter span { display: block; height: 100%; width: 0; border-radius: 999px; background: #4E8A6B; transition: width .4s ease; }
.ns-st-meter span.is-warn { background: #D4A443; }
.ns-st-meter span.is-bad { background: var(--st-red); }

.ns-st-split { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 12px; background: var(--st-subtle); border: 1px solid var(--st-line); border-radius: 8px; }
.ns-st-split > div { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; min-width: 0; font-size: 12px; color: var(--st-muted); }
.ns-st-split > div + div { border-left: 1px solid var(--st-line); }
.ns-st-split b { font-size: 15px; color: var(--st-ink); font-variant-numeric: tabular-nums; }

.ns-st-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; font-size: 12.5px; color: var(--st-body); }
.ns-st-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ns-st-sw { display: inline-block; width: 16px; height: 4px; border-radius: 2px; }
.ns-st-sw--g { background: var(--st-accent); }
.ns-st-sw--g2 { background: repeating-linear-gradient(90deg, #7C93A4 0 4px, transparent 4px 7px); }
.ns-st-sw--p { background: var(--st-red); }
.ns-st-canvas { width: 100%; border: 1px solid var(--st-line); border-radius: 6px; background: #fff; overflow: hidden; }
.ns-st-canvas canvas { display: block; width: 100% !important; max-width: 100%; }

/* ---------- Таблица и детали ---------- */
.ns-st-details > summary { list-style: none; cursor: pointer; display: flex !important; align-items: center; justify-content: space-between; }
.ns-st-details > summary::-webkit-details-marker { display: none; }
.ns-st-details > summary::after { content: ""; flex: none; width: 8px; height: 8px; margin-left: 12px; border-right: 2px solid var(--st-muted-accent); border-bottom: 2px solid var(--st-muted-accent); transform: rotate(45deg); transition: transform .2s; }
.ns-st-details[open] > summary { margin-bottom: 12px !important; padding-bottom: 10px !important; border-bottom: 1px solid var(--st-line) !important; }
.ns-st-details[open] > summary::after { transform: rotate(225deg); }
.ns-st-table-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; font-size: 12px; color: var(--st-muted); }
.ns-st-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--st-line); border-radius: 6px; max-height: 460px; overflow-y: auto; }
.ns-st .ns-st-table { width: 100%; min-width: 640px; margin: 0; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ns-st .ns-st-table th, .ns-st .ns-st-table td { padding: 6px 8px; border: 0; border-bottom: 1px solid #E8EEF3; text-align: right; white-space: nowrap; color: var(--st-body); background: transparent; }
.ns-st .ns-st-table th { position: sticky; top: 0; z-index: 1; background: var(--st-subtle); color: var(--st-ink); font-weight: 700; font-size: 12px; border-bottom: 1px solid var(--st-line); }
.ns-st .ns-st-table th:first-child, .ns-st .ns-st-table td:first-child { text-align: left; color: var(--st-muted); }
.ns-st .ns-st-table tr.is-newlayer td { border-top: 2px solid var(--st-line2); }
.ns-st .ns-st-table tr.is-total td { background: var(--st-soft); font-weight: 700; color: var(--st-ink); text-align: right; }
.ns-st .ns-st-table tr.is-total td:first-child { text-align: left; color: var(--st-ink); white-space: normal; }
.ns-st-method p { margin: 0 0 10px !important; font-size: 13px; line-height: 1.55; color: var(--st-body); }
.ns-st-method p:last-child { margin-bottom: 0 !important; }

/* ---------- Адаптивность ---------- */
@media (max-width: 1080px) {
	.ns-st-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
	.ns-st-kpis { grid-template-columns: 1fr 1fr; }
	.ns-st-kpi--main { grid-column: 1 / -1; }
	.ns-st-split { grid-template-columns: 1fr; }
	.ns-st-split > div { flex-direction: row; justify-content: space-between; align-items: baseline; gap: 10px; }
	.ns-st-split > div + div { border-left: 0; border-top: 1px solid var(--st-line); }
	.ns-st-split b { white-space: nowrap; }
}
@media (max-width: 640px) {
	.ns-st { margin: 8px 0 20px; border-radius: 10px; font-size: 14px; }
	.ns-st-head { padding: 16px; margin-bottom: 14px; }
	.ns-st-badge { display: none; }
	.ns-st .ns-st-title { font-size: 18px !important; }
	.ns-st .ns-st-sub { font-size: 12.5px; }
	.ns-st-grid { padding: 0 12px; gap: 14px; }
	.ns-st-card { padding: 14px; }
	.ns-st .ns-st-input input, .ns-st .ns-st-layer__name, .ns-st .ns-st-select select { font-size: 16px !important; } /* без авто-зума iOS */
	.ns-st-field--layer .ns-st-input input { font-size: 16px !important; }
}
@media (max-width: 420px) {
	.ns-st-fields { grid-template-columns: 1fr; }
	.ns-st-kpis { grid-template-columns: 1fr; }
	.ns-st-layer__row { grid-template-columns: 1fr 1fr; }
	.ns-st-layer__row .ns-st-field:last-child { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { .ns-st * { transition: none !important; animation: none !important; } }
@media print {
	.ns-st { border: 0; background: #fff; }
	.ns-st-head { background: #fff; border-bottom: 2px solid #2B343B; }
	.ns-st .ns-st-title { color: #000 !important; -webkit-text-fill-color: #000 !important; }
	.ns-st .ns-st-sub { color: #333 !important; -webkit-text-fill-color: #333 !important; }
	.ns-st-status, .ns-st-btn, .ns-st-layer__del { display: none !important; }
	.ns-st-grid { grid-template-columns: 1fr; }
	.ns-st-card { box-shadow: none; break-inside: avoid; }
	.ns-st-table-scroll { max-height: none; overflow: visible; }
}
