/* Medicantology calculators. Self-contained: works with any theme. */
.mdc-scope {
	--mdc-bg: #FFFFFF;
	--mdc-surface: #F5F7FC;
	--mdc-seg: #EEF1FF;
	--mdc-line: #D6DCEB;
	--mdc-field: #FFFFFF;
	--mdc-text: #0C1428;
	--mdc-muted: #55617D;
	--mdc-accent: #4054E0;
	--mdc-accent-ink: #FFFFFF;
	--mdc-good: #1F7A4D; --mdc-good-bg: #E6F4EC;
	--mdc-warn: #8A5300; --mdc-warn-bg: #FFF3DC;
	--mdc-bad: #B42318;  --mdc-bad-bg: #FDECEA;
	--mdc-low: #1F5FA8;  --mdc-low-bg: #E6F0FB;
	--mdc-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
	--mdc-display: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
	color: var(--mdc-text);
	font-family: inherit;
	line-height: 1.5;
	box-sizing: border-box;
}
.mdc-scope.mdc-theme-dark {
	--mdc-bg: #131E38;
	--mdc-surface: #0C1428;
	--mdc-seg: #0C1428;
	--mdc-line: #2E3D60;
	--mdc-field: #0C1428;
	--mdc-text: #FFFFFF;
	--mdc-muted: #B5C0D9;
	--mdc-accent: #8EA2FF;
	--mdc-accent-ink: #0C1428;
	--mdc-good: #5FD39A; --mdc-good-bg: rgba(95, 211, 154, .14);
	--mdc-warn: #FFB547; --mdc-warn-bg: rgba(255, 181, 71, .14);
	--mdc-bad: #FF8A7A;  --mdc-bad-bg: rgba(255, 138, 122, .14);
	--mdc-low: #7CC4FF;  --mdc-low-bg: rgba(124, 196, 255, .14);
	color-scheme: dark;
}
.mdc-scope *, .mdc-scope *::before, .mdc-scope *::after { box-sizing: border-box; }

.mdc-scope.mdc-card { background: var(--mdc-bg); border: 1px solid var(--mdc-line); border-radius: 20px; padding: clamp(18px, 3vw, 28px); margin: 1.6em 0; }
.mdc-scope.mdc-tabs { background: var(--mdc-bg); border: 1px solid var(--mdc-line); border-radius: 22px; padding: 8px; }
.mdc-scope.mdc-theme-dark.mdc-tabs { box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .7); }
.mdc-scope .mdc-tabs__list { display: flex; gap: 6px; padding: 6px; background: var(--mdc-seg); border-radius: 16px; overflow-x: auto; }
.mdc-scope .mdc-tabs__list [role="tab"] { flex: 1 0 auto; min-height: 44px; padding: 0 14px; border: 0; border-radius: 11px; background: transparent; color: var(--mdc-muted); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.mdc-scope .mdc-tabs__list [role="tab"]:hover { color: var(--mdc-text); }
.mdc-scope .mdc-tabs__list [aria-selected="true"] { background: var(--mdc-accent); color: var(--mdc-accent-ink); }
.mdc-scope .mdc-tabs__panel { padding: 20px 14px 14px; }

.mdc-scope .mdc-tool { display: flex; flex-direction: column; gap: 18px; margin: 0; }
.mdc-scope .mdc-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mdc-scope .mdc-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mdc-scope .mdc-row[hidden], .mdc-scope [hidden] { display: none !important; }
@media (max-width: 380px) { .mdc-scope .mdc-row { grid-template-columns: minmax(0, 1fr); } .mdc-scope .mdc-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mdc-scope .mdc-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; }
.mdc-scope .mdc-field label { font-size: 13px; font-weight: 600; color: var(--mdc-muted); margin: 0; }
.mdc-scope .mdc-field input, .mdc-scope .mdc-field select {
	width: 100%; min-height: 52px; margin: 0; padding: 0 14px;
	border: 1px solid var(--mdc-line); border-radius: 12px;
	background: var(--mdc-field); color: var(--mdc-text);
	font-family: var(--mdc-mono); font-size: 17px; line-height: 1.2;
	box-shadow: none; appearance: auto;
}
.mdc-scope .mdc-field select { font-family: inherit; font-size: 15px; }
.mdc-scope .mdc-field input:focus, .mdc-scope .mdc-field select:focus { outline: 2px solid var(--mdc-accent); outline-offset: 1px; border-color: var(--mdc-accent); }

.mdc-scope .mdc-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin: 0; border: 0; border-radius: 12px; background: var(--mdc-seg); align-self: flex-start; min-width: 0; }
.mdc-scope .mdc-seg label { position: relative; display: inline-flex; margin: 0; cursor: pointer; }
.mdc-scope .mdc-seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.mdc-scope .mdc-seg span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--mdc-muted); }
.mdc-scope .mdc-seg input:checked + span { background: var(--mdc-accent); color: var(--mdc-accent-ink); }
.mdc-scope .mdc-seg input:focus-visible + span { outline: 2px solid var(--mdc-accent); outline-offset: 2px; }

.mdc-scope .mdc-result { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }
.mdc-scope .mdc-result__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.mdc-scope .mdc-result__value { min-width: 0; }
.mdc-scope .mdc-label { display: block; margin: 0; font-size: 13px; font-weight: 600; color: var(--mdc-muted); }
.mdc-scope .mdc-big { display: block; font-family: var(--mdc-mono); font-variant-numeric: tabular-nums; font-size: clamp(38px, 6vw, 56px); font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; color: var(--mdc-text); }
.mdc-scope .mdc-big--date { font-family: var(--mdc-display); font-size: clamp(24px, 3.2vw, 32px); line-height: 1.15; letter-spacing: -0.02em; }
.mdc-scope .mdc-unit { font-size: 14px; font-weight: 600; color: var(--mdc-muted); }
.mdc-scope .mdc-pill { display: inline-flex; align-items: center; min-height: 34px; padding: 4px 14px; border-radius: 999px; font-family: var(--mdc-display); font-size: 17px; font-weight: 700; background: var(--mdc-surface); color: var(--mdc-muted); }
.mdc-scope .mdc-pill:empty { display: none; }
.mdc-scope .mdc-pill[data-level="good"] { background: var(--mdc-good-bg); color: var(--mdc-good); }
.mdc-scope .mdc-pill[data-level="warn"] { background: var(--mdc-warn-bg); color: var(--mdc-warn); }
.mdc-scope .mdc-pill[data-level="bad"] { background: var(--mdc-bad-bg); color: var(--mdc-bad); }
.mdc-scope .mdc-pill[data-level="low"] { background: var(--mdc-low-bg); color: var(--mdc-low); }
.mdc-scope .mdc-pill[data-level="crisis"] { background: #B42318; color: #FFFFFF; }

.mdc-scope .mdc-scale { position: relative; height: 14px; margin-top: 4px; }
.mdc-scope .mdc-scale__bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; }
.mdc-scope .mdc-scale__bar .is-low { background: #7CC4FF; }
.mdc-scope .mdc-scale__bar .is-good { background: #5FD39A; }
.mdc-scope .mdc-scale__bar .is-warn { background: #FFB547; }
.mdc-scope .mdc-scale__bar .is-bad { background: #FF8A7A; }
.mdc-scope .mdc-scale__marker { position: absolute; top: -5px; left: 0; width: 6px; height: 24px; margin-left: -3px; border-radius: 3px; background: var(--mdc-text); box-shadow: 0 0 0 3px var(--mdc-bg); transition: left .2s ease; }
.mdc-scope .mdc-scale__labels { position: relative; height: 16px; font-family: var(--mdc-mono); font-size: 11px; color: var(--mdc-muted); }
.mdc-scope .mdc-scale__labels span { position: absolute; top: 0; transform: translateX(-50%); }
.mdc-scope .mdc-scale__labels span:first-child, .mdc-scope .mdc-scale__labels span:last-child { transform: none; }

.mdc-scope .mdc-facts { margin: 0; padding: 0; display: grid; gap: 8px; }
.mdc-scope .mdc-facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: var(--mdc-surface); font-size: 14px; }
.mdc-scope .mdc-facts dt { margin: 0; color: var(--mdc-muted); font-weight: 400; }
.mdc-scope .mdc-facts dd { margin: 0; font-family: var(--mdc-mono); font-weight: 700; color: var(--mdc-text); text-align: right; }
.mdc-scope .mdc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mdc-scope .mdc-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--mdc-surface); font-size: 14px; color: var(--mdc-muted); }
.mdc-scope .mdc-list li strong { font-family: var(--mdc-mono); color: var(--mdc-text); }
.mdc-scope .mdc-list li[data-level="warn"] strong { color: var(--mdc-warn); }

.mdc-scope .mdc-note, .mdc-scope .mdc-advice { margin: 0; font-size: 15px; line-height: 1.55; color: var(--mdc-text); }
.mdc-scope .mdc-note:empty, .mdc-scope .mdc-advice:empty { display: none; }
.mdc-scope .mdc-alert { padding: 14px 16px; border-radius: 12px; background: #FDECEA; color: #6E1A0F; border: 1px solid #F6CFC6; font-size: 14.5px; line-height: 1.5; }
.mdc-scope .mdc-fine { margin: 0; font-size: 13px; line-height: 1.5; color: var(--mdc-muted); }
.mdc-sr, .mdc-scope .mdc-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* [mdc_tools_list] */
ul.mdc-toollist { list-style: none; margin: 1.6em 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
ul.mdc-toollist li { margin: 0; padding: 0; }
ul.mdc-toollist li a { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px 20px; border-radius: 14px; border: 1px solid #D6DCEB; background: #FFFFFF; color: #0C1428; text-decoration: none; }
ul.mdc-toollist li a:hover { border-color: #4054E0; color: #0C1428; }
ul.mdc-toollist li strong { font-family: "Space Grotesk", "Inter", system-ui, sans-serif; font-size: 18px; }
ul.mdc-toollist li span { font-size: 14px; line-height: 1.5; color: #55617D; }

/* [mdc_contact_form] */
.mdc-contact { display: grid; gap: 16px; margin: 1.6em 0; padding: clamp(18px, 3vw, 28px); background: #FFFFFF; border: 1px solid #D6DCEB; border-radius: 20px; }
.mdc-contact .mdc-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .mdc-contact .mdc-row { grid-template-columns: minmax(0, 1fr); } }
.mdc-contact .mdc-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mdc-contact .mdc-field label { font-size: 14px; font-weight: 600; color: #3B4763; }
.mdc-contact .mdc-field input, .mdc-contact .mdc-field select, .mdc-contact .mdc-field textarea { width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid #D6DCEB; border-radius: 12px; background: #FFFFFF; color: #0C1428; font: inherit; font-size: 16px; box-sizing: border-box; }
.mdc-contact .mdc-field textarea { min-height: 160px; resize: vertical; }
.mdc-contact .mdc-field input:focus, .mdc-contact .mdc-field select:focus, .mdc-contact .mdc-field textarea:focus { outline: 2px solid #4054E0; outline-offset: 1px; border-color: #4054E0; }
.mdc-contact .mdc-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.mdc-contact button[type="submit"] { justify-self: start; min-height: 50px; padding: 0 26px; border: 0; border-radius: 10px; background: #4054E0; color: #FFFFFF; font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; }
.mdc-contact button[type="submit"]:hover { background: #2B3BB8; }
.mdc-contact .mdc-fine { margin: 0; font-size: 13px; line-height: 1.5; color: #55617D; }
.mdc-msg { margin: 1.2em 0; padding: 14px 16px; border-radius: 12px; font-size: 15px; }
.mdc-msg--ok { background: #E6F4EC; color: #14532F; border: 1px solid #BFE3CE; }
.mdc-msg--err { background: #FDECEA; color: #6E1A0F; border: 1px solid #F6CFC6; }
.mdc-msg ul { margin: 6px 0 0; padding-left: 1.2em; }

@media (prefers-reduced-motion: reduce) { .mdc-scope .mdc-scale__marker { transition: none; } }
