/* Maitronics RC Time Constant Calculator. All rules are scoped to .mtrc. */
.mtrc{
	--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;
}
.mtrc *,.mtrc *::before,.mtrc *::after{box-sizing:border-box}
.mtrc p{margin:0}
.mtrc b{font-weight:600}
.mtrc sup{font-size:.72em;line-height:0;white-space:nowrap}
.mtrc [hidden]{display:none !important}

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

/* buttons: every property set, so theme button styles cannot leak in */
.mtrc 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}
.mtrc .mtrc-seg{display:inline-flex;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:rgba(0,13,28,.6)}
.mtrc .mtrc-seg--wide{display:flex}
.mtrc .mtrc-seg--wide button{flex:1}
.mtrc .mtrc-seg button{background:transparent;color:var(--ink2);border:0;border-radius:0;padding:8px 14px;font-size:14px;font-weight:500;white-space:nowrap}
.mtrc .mtrc-seg button + button{border-left:1px solid var(--line)}
.mtrc .mtrc-seg button:hover{background:rgba(255,255,255,.06);color:#fff}
.mtrc .mtrc-seg button.is-on{background:var(--b);color:#fff}
.mtrc button.mtrc-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}
.mtrc button.mtrc-btn:hover{border-color:#fff;background:transparent;color:#fff}
.mtrc button.mtrc-btn--main{background:var(--bb);border-color:var(--bb);color:#001328}
.mtrc button.mtrc-btn--main:hover{background:#4cc2fb;border-color:#4cc2fb;color:#001328}
.mtrc button.mtrc-btn--small{padding:6px 12px;font-size:13px}
.mtrc button.mtrc-btn:disabled{opacity:.4;cursor:default}
.mtrc button.mtrc-fs{display:inline-flex;align-items:center;gap:8px;padding:8px 14px;white-space:nowrap}
.mtrc button.mtrc-link{background:none;border:0;padding:0;color:var(--bb);font-size:13.5px;font-weight:600}
.mtrc button.mtrc-link:hover{background:none;color:#fff}
.mtrc button:focus-visible,.mtrc input:focus-visible,.mtrc select:focus-visible{outline:2px solid #fff;outline-offset:2px}

/* layout */
.mtrc .mtrc-pane{display:grid;grid-template-columns:minmax(0,1fr);gap:16px}
@container (min-width:820px){
	.mtrc .mtrc-pane{grid-template-columns:minmax(0,5fr) minmax(0,6fr)}
	.mtrc .mtrc-col,.mtrc .mtrc-steps{grid-column:1 / -1}
}
.mtrc .mtrc-col{display:flex;flex-direction:column;gap:16px;min-width:0}
.mtrc .mtrc-panel{background:rgba(0,13,28,.72);border:1px solid var(--line);border-radius:12px;padding:16px 18px 18px;min-width:0}
.mtrc .mtrc-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}
.mtrc .mtrc-panel__head > span:first-child{color:#fff;font-weight:600;font-size:14px}

/* inputs */
.mtrc label{display:block;font-size:13px;color:var(--ink2);margin:0 0 6px;font-weight:500}
.mtrc .mtrc-f{margin-bottom:12px}
.mtrc .mtrc-field{display:flex;border:1.5px solid #2a5a94;border-radius:8px;background:#00101f;overflow:hidden}
.mtrc .mtrc-field:focus-within{border-color:var(--bb)}
.mtrc .mtrc-field input,.mtrc .mtrc-field select{font-family:inherit;font-size:16px;color:#fff;background:transparent;border:0;border-radius:0;margin:0;height:40px;line-height:1.2;box-shadow:none;outline:0;min-width:0}
.mtrc .mtrc-field input{flex:1 1 auto;width:100%;padding:0 12px;font-variant-numeric:tabular-nums}
.mtrc .mtrc-field select{flex:none;width:78px;padding:0 8px;border-left:1.5px solid #2a5a94;background:#04203f;cursor:pointer;font-weight:600}
.mtrc .mtrc-field select option{color:#14213a;background:#fff}
.mtrc .mtrc-unit{flex:none;width:78px;display:flex;align-items:center;padding:0 12px;border-left:1.5px solid #2a5a94;background:#04203f;font-weight:600;font-size:16px}
.mtrc .mtrc-field.is-bad{border-color:var(--warn)}
.mtrc .mtrc-tip{font-size:13px;color:var(--mute);margin-top:6px}
.mtrc .mtrc-tip b{color:var(--ink2)}
.mtrc .mtrc-target{margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}
.mtrc .mtrc-target__out{margin-top:8px;min-height:44px}
.mtrc .mtrc-target__out b{display:block;font-size:24px;font-weight:800;color:var(--bb);line-height:1.2;font-variant-numeric:tabular-nums}
.mtrc .mtrc-target__out span{display:block;font-size:13px;color:var(--ink2)}

/* result */
.mtrc .mtrc-result__label{display:block;font-size:13px;color:var(--mute)}
.mtrc .mtrc-result__row{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.mtrc .mtrc-result__value{font-size:44px;font-weight:800;letter-spacing:-.02em;line-height:1.15;color:var(--bb);font-variant-numeric:tabular-nums}
.mtrc .mtrc-result__sub{display:block;font-size:13px;color:var(--ink2);margin-top:2px;font-variant-numeric:tabular-nums}
.mtrc .mtrc-tiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:14px}
.mtrc .mtrc-tile,.mtrc .mtrc-livebox{background:rgba(23,175,249,.08);border:1px solid var(--line);border-radius:10px;padding:8px 12px;min-width:0}
.mtrc .mtrc-tile span,.mtrc .mtrc-livebox span{display:block;font-size:12px;color:var(--mute);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mtrc .mtrc-tile b,.mtrc .mtrc-livebox b{display:block;font-size:17px;font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mtrc .mtrc-schem{margin-top:14px;border-top:1px solid var(--line);padding-top:12px}
.mtrc .mtrc-schem svg{display:block;width:100%;height:auto;margin:0 auto}
.mtrc .mtrc-sl{font:600 12px Inter,system-ui,sans-serif;fill:#fff}
.mtrc .mtrc-sv{font:500 11.5px Inter,system-ui,sans-serif;fill:#b9c6dc}
.mtrc .mtrc-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 */
.mtrc .mtrc-chart{position:relative;height:300px}
.mtrc .mtrc-chart canvas{position:absolute;inset:0;width:100%;height:100%;display:block;cursor:crosshair}
.mtrc .mtrc-live{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:10px}
@container (min-width:620px){.mtrc .mtrc-live{grid-template-columns:repeat(4,minmax(0,1fr))}}
.mtrc .mtrc-run{display:flex;align-items:center;gap:14px;margin-top:12px}
.mtrc .mtrc-run button{flex:none;min-width:96px}
.mtrc input.mtrc-range{-webkit-appearance:none;appearance:none;flex:1 1 auto;display:block;width:100%;height:4px;margin:0;padding:0;border:0;border-radius:4px;background:#1e3559;cursor:pointer}
.mtrc input.mtrc-range::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:18px;height:18px;border-radius:50%;background:#fff;border:3px solid var(--bb)}
.mtrc input.mtrc-range::-moz-range-thumb{width:12px;height:12px;border-radius:50%;background:#fff;border:3px solid var(--bb)}
.mtrc input.mtrc-range:disabled{opacity:.4;cursor:default}

/* tables */
.mtrc .mtrc-tablepanel{padding-top:8px;padding-bottom:8px}
.mtrc .mtrc-tablewrap{overflow-x:auto}
.mtrc .mtrc-panel table{width:100%;border-collapse:collapse;margin:0;border:0;font-size:14px;font-variant-numeric:tabular-nums;background:none}
.mtrc .mtrc-panel table th,.mtrc .mtrc-panel table td{border:0;border-bottom:1px solid var(--line);padding:7px 14px 7px 0;text-align:left;white-space:nowrap;background:none;color:#fff;font-size:14px;vertical-align:middle}
.mtrc .mtrc-panel table th{color:var(--mute);font-weight:500;font-size:12px}
.mtrc .mtrc-panel table tr:last-child td{border-bottom:0}

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

/* find R or C */
.mtrc .mtrc-box{padding:12px 0;border-bottom:1px solid var(--line)}
.mtrc .mtrc-box:first-child{padding-top:0}
.mtrc .mtrc-box:last-child{border-bottom:0;padding-bottom:0}
.mtrc .mtrc-box > b{display:block;font-size:14px;margin-bottom:4px}
.mtrc .mtrc-box p{color:var(--ink2);font-size:14.5px;margin-bottom:4px}
.mtrc .mtrc-box p b{color:#fff}
.mtrc .mtrc-box p.mtrc-big{font-size:34px;font-weight:800;color:var(--bb);line-height:1.2;font-variant-numeric:tabular-nums}

/* full screen */
.mtrc.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:18px max(22px,calc((100vw - 1800px)/2))}
html.mtrc-lock,html.mtrc-lock body{overflow:hidden}
/* On a laptop or desktop screen everything fits one screen without scrolling:
   inputs | result and circuit | chart and table. The chart takes the height that is left. */
@media (min-width:1100px) and (min-height:560px){
	.mtrc.is-full{overflow:hidden}
	.mtrc.is-full .mtrc-screen{height:100%;display:flex;flex-direction:column;min-height:0}
	.mtrc.is-full .mtrc-top{flex:none;margin-bottom:12px}
	.mtrc.is-full .mtrc-pane{flex:1 1 auto;min-height:0;gap:14px}
	.mtrc.is-full [data-pane="sim"]{grid-template-columns:minmax(0,3.3fr) minmax(0,4.3fr) minmax(0,6fr);grid-template-rows:minmax(0,1fr)}
	.mtrc.is-full [data-pane="sim"] > .mtrc-panel{overflow:auto;padding:14px 16px}
	.mtrc.is-full .mtrc-col{grid-column:auto;min-height:0;gap:14px}
	.mtrc.is-full .mtrc-steps{display:none}
	.mtrc.is-full .mtrc-chartpanel{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;padding:14px 16px}
	.mtrc.is-full .mtrc-chartpanel > *{flex:none}
	.mtrc.is-full .mtrc-chartpanel .mtrc-chart{flex:1 1 auto;height:auto;min-height:110px}
	.mtrc.is-full .mtrc-tablepanel{flex:none}
	.mtrc.is-full .mtrc-pane--find{grid-template-columns:minmax(0,5fr) minmax(0,7fr);grid-template-rows:minmax(0,1fr)}
	.mtrc.is-full .mtrc-pane--find > .mtrc-panel{overflow:auto}
	.mtrc.is-full .mtrc-f{margin-bottom:10px}
}
@media (min-width:1100px) and (min-height:560px) and (max-height:740px){
	.mtrc.is-full .mtrc-tablepanel{display:none}
	.mtrc.is-full .mtrc-result__value{font-size:36px}
	.mtrc.is-full .mtrc-note{display:none}
	.mtrc.is-full .mtrc-tip{display:none}
}

@container (max-width:520px){
	.mtrc .mtrc-result__value{font-size:34px}
	.mtrc .mtrc-topright{width:100%}
	.mtrc .mtrc-topright .mtrc-seg{flex:1}
	.mtrc .mtrc-topright .mtrc-seg button{flex:1;padding-left:6px;padding-right:6px}
	.mtrc .mtrc-tiles{grid-template-columns:repeat(2,minmax(0,1fr))}
	.mtrc .mtrc-chart{height:250px}
	.mtrc .mtrc-tablepanel th:nth-child(5),.mtrc .mtrc-tablepanel td:nth-child(5){display:none}
	.mtrc .mtrc-panel table th,.mtrc .mtrc-panel table td{padding-right:10px}
	.mtrc .mtrc-seg--wide button{padding-left:6px;padding-right:6px;font-size:13px}
}
@media (max-width:600px){.mtrc{padding:16px;border-radius:12px}.mtrc .mtrc-panel{padding:14px}}
