/* Maitronics Voltage Divider Calculator. All rules are scoped to .mtvd. */
.mtvd{
	--b:#1f77c4; --bb:#17aff9; --navy:#001328; --line:#123a66;
	--ink:#fff; --ink2:#b9c6dc; --mute:#8ea3c4; --warn:#ff6b6b;
	container-type:inline-size;
	box-sizing:border-box;
	background:linear-gradient(135deg,var(--navy),#062a55);
	color:var(--ink);
	border-radius:16px;
	padding:24px;
	margin:24px 0;
	font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
	font-size:15px;
	line-height:1.5;
	letter-spacing:normal;
	text-align:left;
}
.mtvd *,.mtvd *::before,.mtvd *::after{box-sizing:border-box}
.mtvd p{margin:0}
.mtvd b{font-weight:600}
.mtvd i{font-style:normal;color:var(--mute);font-weight:400}
.mtvd [hidden]{display:none}

.mtvd .mtvd-top{display:flex;align-items:center;justify-content:space-between;gap:12px 20px;flex-wrap:wrap;margin-bottom:18px}
.mtvd .mtvd-title{font-size:22px;font-weight:800;letter-spacing:-.01em;line-height:1.2}
.mtvd .mtvd-topright{display:flex;align-items:center;gap:10px;flex-wrap:wrap}

/* buttons: every property set, so theme button styles cannot leak in */
.mtvd button{font-family:inherit;letter-spacing:normal;text-transform:none;box-shadow:none;margin:0;cursor:pointer;line-height:1.3;min-height:0;width:auto}
.mtvd .mtvd-seg{display:inline-flex;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:rgba(0,13,28,.6)}
.mtvd .mtvd-seg button{white-space:nowrap;background:transparent;color:var(--ink2);border:0;border-radius:0;padding:8px 16px;font-size:14px;font-weight:500}
.mtvd .mtvd-seg button + button{border-left:1px solid var(--line)}
.mtvd .mtvd-seg button:hover{background:rgba(255,255,255,.06);color:#fff}
.mtvd .mtvd-seg button.is-on{background:var(--b);color:#fff}

.mtvd button.mtvd-btn{background:transparent;color:#fff;border:1.5px solid rgba(255,255,255,.35);border-radius:8px;padding:9px 18px;font-size:14.5px;font-weight:600}
.mtvd button.mtvd-btn:hover{border-color:#fff;background:transparent;color:#fff}
.mtvd button.mtvd-btn--main{background:var(--bb);border-color:var(--bb);color:#001328}
.mtvd button.mtvd-btn--main:hover{background:#4cc2fb;border-color:#4cc2fb;color:#001328}
.mtvd button.mtvd-btn--small{padding:6px 12px;font-size:13px}
.mtvd button.mtvd-btn:disabled{opacity:.4;cursor:default}
.mtvd button.mtvd-fs{display:inline-flex;align-items:center;gap:8px;padding:8px 14px;white-space:nowrap}
.mtvd button.mtvd-link{background:none;border:0;padding:0;color:var(--bb);font-size:13.5px;font-weight:600}
.mtvd button.mtvd-link:hover{background:none;color:#fff}
.mtvd button:focus-visible,.mtvd input:focus-visible,.mtvd select:focus-visible{outline:2px solid #fff;outline-offset:2px}

/* layout */
.mtvd .mtvd-grid{display:grid;grid-template-columns:1fr;gap:16px}
.mtvd .mtvd-pane--find:not([hidden]){display:grid;grid-template-columns:1fr;gap:16px}
@container (min-width:800px){.mtvd .mtvd-grid,.mtvd .mtvd-pane--find:not([hidden]){grid-template-columns:minmax(0,5fr) minmax(0,6fr)}}
.mtvd .mtvd-panel{background:rgba(0,13,28,.72);border:1px solid var(--line);border-radius:12px;padding:16px 18px 18px;min-width:0}
.mtvd .mtvd-pane > .mtvd-panel{margin-top:16px}
.mtvd .mtvd-panel__head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:13px;color:var(--mute);margin-bottom:12px}
.mtvd .mtvd-panel__head > span:first-child{color:#fff;font-weight:600;font-size:14px}

/* inputs */
.mtvd label{display:block;font-size:13px;color:var(--ink2);margin:0;font-weight:500}
.mtvd .mtvd-rows{display:flex;flex-direction:column;gap:8px}
.mtvd .mtvd-row{display:grid;grid-template-columns:34px minmax(0,1fr) 34px;gap:8px;align-items:center}
.mtvd .mtvd-row label{font-weight:700;color:#fff;font-size:14.5px}
.mtvd .mtvd-field{display:flex;border:1.5px solid #2a5a94;border-radius:8px;background:#00101f;overflow:hidden}
.mtvd .mtvd-field:focus-within{border-color:var(--bb)}
.mtvd .mtvd-field input,.mtvd .mtvd-field select{font-family:inherit;font-size:16px;color:#fff;background:transparent;border:0;border-radius:0;margin:0;height:42px;line-height:1.2;box-shadow:none;outline:0;min-width:0}
.mtvd .mtvd-field input{flex:1 1 auto;width:100%;padding:0 12px;font-variant-numeric:tabular-nums}
.mtvd .mtvd-field input::placeholder{color:#5b6f8f}
.mtvd .mtvd-field select{flex:none;width:78px;padding:0 8px;border-left:1.5px solid #2a5a94;background:#04203f;cursor:pointer;font-weight:600}
.mtvd .mtvd-field select option{color:#14213a;background:#fff}
.mtvd .is-bad .mtvd-field,.mtvd .mtvd-field.is-bad{border-color:var(--warn)}
.mtvd button.mtvd-del{width:34px;height:34px;border-radius:8px;border:1px solid var(--line);background:transparent;color:var(--mute);font-size:20px;line-height:1;padding:0}
.mtvd button.mtvd-del:hover{border-color:var(--warn);color:var(--warn);background:transparent}
.mtvd button.mtvd-del:disabled{opacity:.3;cursor:default;border-color:var(--line);color:var(--mute)}
.mtvd .mtvd-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}
.mtvd .mtvd-tip{margin-top:12px;font-size:13px;color:var(--mute)}
.mtvd .mtvd-tip b{color:var(--ink2)}
.mtvd .mtvd-volt{margin-top:16px;padding-top:16px;border-top:1px solid var(--line)}
.mtvd .mtvd-volt label,.mtvd .mtvd-f label{margin-bottom:6px}
.mtvd .mtvd-f{margin-bottom:12px}
.mtvd .mtvd-seg--wide{display:flex}
.mtvd .mtvd-seg--wide button{flex:1;padding-left:6px;padding-right:6px}
.mtvd .mtvd-actions{display:inline-flex;gap:14px}
.mtvd .mtvd-inputs .mtvd-tip{margin-top:4px}

/* result */
.mtvd .mtvd-result__label{display:block;font-size:13px;color:var(--mute)}
.mtvd .mtvd-result__row{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.mtvd .mtvd-result__value{font-size:44px;font-weight:800;letter-spacing:-.02em;line-height:1.15;color:var(--bb);font-variant-numeric:tabular-nums}
.mtvd .mtvd-result__sub{display:block;font-size:13px;color:var(--ink2);margin-top:2px;font-variant-numeric:tabular-nums}
.mtvd .mtvd-tiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:14px}
.mtvd .mtvd-tile{background:rgba(23,175,249,.08);border:1px solid var(--line);border-radius:10px;padding:8px 12px;min-width:0}
.mtvd .mtvd-tile span{display:block;font-size:12px;line-height:1.3;color:var(--mute)}
.mtvd .mtvd-tile small{display:block;font-size:11.5px;color:var(--ink2);white-space:nowrap;font-variant-numeric:tabular-nums}
.mtvd .mtvd-tile b{display:block;font-size:19px;font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap}
.mtvd .mtvd-result__hint{display:block;font-size:12.5px;color:var(--mute);margin-top:6px}
.mtvd .mtvd-schem{margin-top:16px;border-top:1px solid var(--line);padding-top:12px;overflow-x:auto}
.mtvd .mtvd-schem svg{display:block;width:100%;height:auto;margin:0 auto}
.mtvd .mtvd-st{font:600 12px Inter,system-ui,sans-serif;fill:#fff}
.mtvd .mtvd-sl{font:600 12px Inter,system-ui,sans-serif;fill:#fff}
.mtvd .mtvd-sv{font:500 11.5px Inter,system-ui,sans-serif;fill:#b9c6dc}
.mtvd .mtvd-sv--hi{font-weight:700;fill:#17aff9;font-size:12.5px}
.mtvd .mtvd-note{margin-top:12px;padding:11px 14px;border-left:3px solid var(--bb);background:rgba(23,175,249,.10);border-radius:0 8px 8px 0;font-size:14.5px}

/* chart */
.mtvd .mtvd-chartpanel,.mtvd .mtvd-steps{margin-top:16px}
.mtvd .mtvd-chart{position:relative;height:280px}
.mtvd .mtvd-chart canvas{position:absolute;inset:0;width:100%;height:100%;display:block;cursor:crosshair}
.mtvd .mtvd-legend{display:flex;flex-wrap:wrap;gap:6px 16px;margin-top:8px;font-size:12px;color:var(--ink2)}
.mtvd .mtvd-legend span{display:inline-flex;align-items:center;gap:6px}
.mtvd .mtvd-k{display:inline-block;width:18px;height:0;border-top:3px solid var(--bb)}
.mtvd .mtvd-k--dash{border-top:2px dashed rgba(207,230,255,.7)}
.mtvd .mtvd-k--dot{width:11px;height:11px;border:2px solid #fff;border-radius:50%;background:var(--bb)}

/* tables */
.mtvd .mtvd-tablewrap{overflow-x:auto}
.mtvd .mtvd-panel table{width:100%;border-collapse:collapse;margin:0;border:0;font-size:14px;font-variant-numeric:tabular-nums;background:none}
.mtvd .mtvd-panel table th,.mtvd .mtvd-panel table td{border:0;border-bottom:1px solid var(--line);padding:8px 14px 8px 0;text-align:left;white-space:nowrap;background:none;color:#fff;font-size:14px;vertical-align:middle}
.mtvd .mtvd-panel table th{color:var(--mute);font-weight:500;font-size:12px}
.mtvd .mtvd-panel table tr:last-child td{border-bottom:0}
.mtvd .mtvd-panel table .mtvd-w{width:46%;min-width:190px}
.mtvd .mtvd-share{display:flex;align-items:center;gap:10px}
.mtvd .mtvd-bar{flex:1 1 auto;min-width:40px;height:8px;border-radius:4px;background:#0c2b52;overflow:hidden}
.mtvd .mtvd-share b{flex:none;width:64px;text-align:right;white-space:nowrap}
.mtvd .mtvd-bar i{display:block;height:100%;min-width:2px;border-radius:4px;background:var(--bb)}
.mtvd [data-col]{display:none}
.mtvd.has-v th[data-col],.mtvd.has-v td[data-col]{display:table-cell}

/* steps */
.mtvd .mtvd-eq{font-size:15px;color:var(--ink2);padding:3px 0;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.mtvd .mtvd-eq--res{color:#fff;font-size:17px;margin-top:4px}
.mtvd .mtvd-eq--res b{color:var(--bb)}
.mtvd .mtvd-eqnote{font-size:13px;color:var(--mute);margin-top:8px}

/* find values */
.mtvd .mtvd-box{padding:12px 0;border-bottom:1px solid var(--line)}
.mtvd .mtvd-box:first-child{padding-top:0}
.mtvd .mtvd-box:last-child{border-bottom:0;padding-bottom:0}
.mtvd .mtvd-box > b{display:block;font-size:14px;margin-bottom:4px}
.mtvd .mtvd-box p{color:var(--ink2);font-size:14.5px;margin-bottom:4px}
.mtvd .mtvd-box p b{color:#fff}

/* full screen */
.mtvd.is-full{position:fixed;top:0;left:0;right:0;bottom:0;width:100%;height:100%;z-index:2147483000;margin:0;border-radius:0;overflow:auto;padding:20px max(22px,calc((100vw - 1760px)/2))}
html.mtvd-lock,html.mtvd-lock body{overflow:hidden}
/* On a laptop or desktop screen everything fits one screen without scrolling:
   inputs | result and circuit | load-effect chart. */
@media (min-width:1100px) and (min-height:560px){
	.mtvd.is-full{overflow:hidden}
	.mtvd.is-full .mtvd-screen{height:100%;display:flex;flex-direction:column;min-height:0}
	.mtvd.is-full .mtvd-top{flex:none;margin-bottom:12px}
	.mtvd.is-full .mtvd-pane{flex:1 1 auto;min-height:0}
	.mtvd.is-full [data-pane="calc"]:not([hidden]){display:grid;grid-template-columns:minmax(0,3.3fr) minmax(0,4.3fr) minmax(0,6fr);grid-template-rows:minmax(0,1fr);gap:14px}
	.mtvd.is-full [data-pane="calc"] .mtvd-grid{display:contents}
	.mtvd.is-full [data-pane="calc"] .mtvd-panel{margin-top:0;overflow:auto;padding:14px 16px}
	.mtvd.is-full .mtvd-steps{display:none}
	.mtvd.is-full .mtvd-chartpanel{display:flex;flex-direction:column}
	.mtvd.is-full .mtvd-chartpanel > *{flex:none}
	.mtvd.is-full .mtvd-chartpanel .mtvd-chart{flex:1 1 auto;height:auto;min-height:140px}
	.mtvd.is-full .mtvd-pane--find:not([hidden]){display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);grid-template-rows:minmax(0,1fr);gap:14px}
	.mtvd.is-full .mtvd-pane--find .mtvd-grid{display:contents}
	.mtvd.is-full .mtvd-pane--find .mtvd-panel{overflow:auto}
	.mtvd.is-full .mtvd-result__value{font-size:46px}
	.mtvd.is-full .mtvd-schem svg{max-width:320px !important}
}
@media (min-width:1100px) and (min-height:560px) and (max-height:820px){
	.mtvd.is-full .mtvd-schem svg{max-width:265px !important}
	.mtvd.is-full .mtvd-tile{padding:6px 10px}
}
@media (min-width:1100px) and (min-height:560px) and (max-height:740px){
	.mtvd.is-full .mtvd-result__value{font-size:36px}
	.mtvd.is-full .mtvd-note{font-size:13.5px;padding:9px 12px}
	.mtvd.is-full .mtvd-tip{display:none}
	.mtvd.is-full .mtvd-schem{margin-top:10px;padding-top:8px}
	.mtvd.is-full .mtvd-schem svg{max-width:225px !important}
	.mtvd.is-full .mtvd-tiles{margin-top:10px;gap:6px}
	.mtvd.is-full .mtvd-tile{padding:6px 10px}
	.mtvd.is-full .mtvd-tile b{font-size:16px}
	.mtvd.is-full .mtvd-result__sub{font-size:12px}
	.mtvd.is-full .mtvd-note{margin-top:8px}
	.mtvd.is-full .mtvd-panel table th,.mtvd.is-full .mtvd-panel table td{padding-top:5px;padding-bottom:5px}
	.mtvd.is-full .mtvd-box{padding:8px 0}
	.mtvd.is-full .mtvd-eqnote{display:none}
}

@container (max-width:520px){
	.mtvd .mtvd-result__value{font-size:34px}
	.mtvd .mtvd-tile{padding:7px 9px}
	.mtvd .mtvd-tile b{font-size:15.5px}
	.mtvd .mtvd-tile span{font-size:11px}
	.mtvd .mtvd-topright{width:100%}
	.mtvd .mtvd-tabs{flex:1}
	.mtvd .mtvd-tabs button{flex:1;padding-left:6px;padding-right:6px;font-size:13px}
	.mtvd .mtvd-tiles{grid-template-columns:repeat(2,minmax(0,1fr))}
	.mtvd .mtvd-chart{height:240px}
}
@media (max-width:600px){.mtvd{padding:16px;border-radius:12px}.mtvd .mtvd-panel{padding:14px}}
