/* ES Pole Embedment v1.2.3 — every rule scoped to .es-pe (root, guide portal and modal portal) */
.es-pe {
	--navy: #1F3864;
	--amber: #C9A21A;
	--amber-soft: #fbf0c6;
	--ink: #1d2433;
	--muted: #5d6677;
	--line: #dfe3ea;
	--bg: #f6f7fa;
	--ok: #1f7a4a;
	--warn: #a86b00;
	--bad: #b3261e;
	--es-pe-sticky-top: 0px;
	--es-pe-bar-h: 56px;
	font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
	color: var(--ink);
	font-size: 15px;
	line-height: 1.5;
	box-sizing: border-box;
	text-align: left;
}
.es-pe *, .es-pe *::before, .es-pe *::after { box-sizing: border-box; }
.es-pe [hidden] { display: none !important; }
.es-pe h3, .es-pe h4, .es-pe h5, .es-pe p { margin-top: 0; }

/* ---------- toolbar ---------- */
.es-pe-bar {
	position: sticky; top: var(--es-pe-sticky-top); z-index: 40;
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
	background: var(--navy); color: #fff; border-radius: 10px; padding: 9px 14px; margin-bottom: 16px;
	box-shadow: 0 2px 8px rgba(31, 56, 100, .18);
}
.es-pe-bar-t { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.es-pe-bar-t strong { font-size: 1rem; }
.es-pe-bar-t span { font-size: .75rem; color: #c9d3e6; }
.es-pe-bar-a { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.es-pe-bar .es-pe-example { width: auto; min-width: 150px; padding: 6px 8px; font-size: .85rem; }
.es-pe .es-pe-bar .es-pe-btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
.es-pe .es-pe-bar .es-pe-btn-ghost:hover { background: rgba(255, 255, 255, .1); }
.es-pe-guide-btn { display: none; }
.es-pe.is-sheet .es-pe-guide-btn { display: inline-block; }

/* ---------- layout ---------- */
.es-pe-grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 28%, 400px); gap: 18px; align-items: start; }
.es-pe.is-sheet .es-pe-grid { grid-template-columns: minmax(0, 1fr); }
.es-pe-main { min-width: 0; }
.es-pe-aside {
	position: sticky; top: calc(var(--es-pe-sticky-top) + var(--es-pe-bar-h) + 16px);
	max-height: calc(100vh - var(--es-pe-sticky-top) - var(--es-pe-bar-h) - 32px); overflow: auto;
	background: #fff; border: 1px solid var(--line); border-radius: 10px;
}
.es-pe-aside-in { padding: 16px 18px; position: relative; }
.es-pe.is-sheet > .es-pe-grid > .es-pe-aside { display: none; }
.es-pe-sheet-x { display: none; }

.es-pe-lede { color: var(--muted); font-size: .92rem; margin: 0 0 14px; }
.es-pe-card {
	background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin: 0 0 16px;
	box-shadow: 0 1px 2px rgba(31, 56, 100, .05);
}
.es-pe-h {
	font-size: 1.02rem; font-weight: 700; color: var(--navy); margin: 0 0 14px; padding-bottom: 5px;
	border-bottom: 2px solid var(--amber); display: inline-block;
}
.es-pe-note { color: var(--muted); font-size: .82rem; margin: 6px 0 10px; }
.es-pe-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; margin-top: 12px; }
.es-pe-row:first-child { margin-top: 0; }

.es-pe-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 40%); gap: 18px; align-items: start; }
.es-pe-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 14px; align-content: start; min-width: 0; }
.es-pe-fields > .es-pe-row, .es-pe-fields > .es-pe-tablewrap, .es-pe-fields > .es-pe-note { grid-column: 1 / -1; margin-top: 0; }
.es-pe-fig {
	margin: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px;
	position: sticky; top: calc(var(--es-pe-sticky-top) + var(--es-pe-bar-h) + 16px);
}
.es-pe-fig svg { display: block; width: 100%; height: auto; }
.es-pe.is-mid .es-pe-split { grid-template-columns: minmax(0, 1fr); }
.es-pe.is-mid .es-pe-fig { position: static; max-width: 460px; }
.es-pe-figmsg { margin: 10px 0 0; color: var(--bad); font-size: .85rem; font-weight: 600; }

/* ---------- fields ---------- */
.es-pe .field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.es-pe .field.is-off { display: none; }
.es-pe .lab { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.es-pe .lab label { font-size: .8rem; font-weight: 600; color: var(--navy); line-height: 1.25; }
.es-pe .es-pe-q {
	flex: none; width: 19px; height: 19px; border-radius: 50%; border: 1px solid #c3cad6; background: #fff;
	color: var(--muted); font-size: .72rem; font-weight: 700; line-height: 1; cursor: pointer; padding: 0;
}
.es-pe .es-pe-q:hover, .es-pe .es-pe-q.is-active { background: var(--amber); border-color: var(--amber); color: #fff; }
.es-pe .in { position: relative; display: flex; align-items: center; }
.es-pe input[type=number], .es-pe input[type=text], .es-pe select {
	font: inherit; font-size: .9rem; width: 100%; min-width: 0; padding: 7px 9px; margin: 0;
	border: 1px solid #c6cdd8; border-radius: 6px; background: #fff; color: var(--ink); height: auto;
}
.es-pe input[type=number] { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: .86rem; }
.es-pe .in em {
	position: absolute; right: 9px; font-style: normal; font-size: .76rem; color: var(--muted); pointer-events: none;
}
.es-pe .in input[type=number] { padding-right: 46px; }
.es-pe input:focus, .es-pe select:focus { outline: 2px solid rgba(201, 162, 26, .5); outline-offset: 0; border-color: var(--amber); }
.es-pe input:disabled { background: var(--bg); color: var(--muted); }
.es-pe .field.is-active input, .es-pe .field.is-active select, .es-pe .es-pe-lrow.is-active input { background: var(--amber-soft); }
.es-pe input.is-flash, .es-pe select.is-flash { animation: es-pe-flash 1s ease-out; }
@keyframes es-pe-flash { 0% { background: var(--amber); } 100% { background: var(--amber-soft); } }
.es-pe-chk { display: inline-flex; align-items: center; gap: 7px; font-size: .85rem; color: var(--ink); cursor: pointer; }
.es-pe-chk input { width: auto; margin: 0; }
.es-pe .field-chk .in { gap: 8px; padding-top: 18px; }

.es-pe-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--navy); border-radius: 8px; overflow: hidden; }
.es-pe-seg label { margin: 0; cursor: pointer; }
.es-pe-seg input { position: absolute; opacity: 0; pointer-events: none; }
.es-pe-seg span { display: block; padding: 7px 16px; font-size: .88rem; font-weight: 600; color: var(--navy); background: #fff; }
.es-pe-seg input:checked + span { background: var(--navy); color: #fff; }
.es-pe-seg input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: -2px; }

/* ---------- layer table ---------- */
.es-pe-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.es-pe-ltab { width: 100%; border-collapse: collapse; }
.es-pe-ltab th { font-size: .74rem; font-weight: 600; color: var(--navy); text-align: left; padding: 4px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.es-pe-ltab th em, .es-pe-tbl th em { font-style: normal; font-weight: 400; color: var(--muted); }
.es-pe-ltab td { padding: 3px; }
.es-pe-ltab td input { min-width: 62px; padding: 6px 6px !important; }
.es-pe-lrow.is-off { display: none; }
.es-pe-lrow.is-active td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.es-pe-badge {
	display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%;
	background: var(--navy); color: #fff; font-size: .74rem; font-weight: 700; font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* ---------- buttons, loading ---------- */
.es-pe .es-pe-btn { font: inherit; font-size: .88rem; font-weight: 600; border-radius: 7px; padding: 7px 15px; cursor: pointer; border: 1px solid var(--navy); line-height: 1.3; }
.es-pe .es-pe-btn-amber { background: var(--amber); border-color: var(--amber); color: #1d2433; }
.es-pe .es-pe-btn-amber:hover { background: #b8920f; }
.es-pe .es-pe-btn-ghost { background: #fff; color: var(--navy); }
.es-pe .es-pe-btn-ghost:hover { background: var(--bg); }
.es-pe-go { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 4px 0 10px; }
.es-pe-loading { visibility: hidden; min-height: 24px; display: flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--muted); }
.es-pe.is-loading .es-pe-loading { visibility: visible; }
.es-pe-spin { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--amber); border-radius: 50%; animation: es-pe-spin .8s linear infinite; }
@keyframes es-pe-spin { to { transform: rotate(360deg); } }
.es-pe-error { background: #fbeceb; color: var(--bad); border: 1px solid #f0c6c3; border-radius: 8px; padding: 10px 14px; font-size: .9rem; margin-bottom: 14px; }

/* ---------- results ---------- */
.es-pe-hero { border-left: 4px solid var(--amber); }
.es-pe-hero.is-bad { border-color: var(--bad); border-left-color: var(--bad); }
.es-pe-hero-l { font-size: .82rem; font-weight: 600; color: var(--muted); }
.es-pe-hero-v { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.es-pe-hero-n { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: 2.3rem; font-weight: 600; color: var(--navy); line-height: 1.15; }
.es-pe-hero-u { font-size: 1rem; color: var(--muted); font-weight: 600; }
.es-pe-hero-s { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: .86rem; color: var(--ink); margin-top: 2px; }
.es-pe-hero-c { font-size: .84rem; color: var(--muted); margin-top: 6px; }
.es-pe-hero-h { font-size: .88rem; color: var(--bad); font-weight: 600; margin-top: 6px; }
.es-pe-hero-h:empty { display: none; }
.es-pe-hero-link { display: inline-block; margin-top: 8px; font-size: .84rem; color: var(--navy); font-weight: 600; text-decoration: none; }
.es-pe-hero-link:hover { text-decoration: underline; }

.es-pe-tag { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 2px 8px; border-radius: 99px; font-family: 'IBM Plex Sans', sans-serif; }
.es-pe-tag.ok { background: #e3f3ea; color: var(--ok); }
.es-pe-tag.warn { background: #fdf1d8; color: var(--warn); }
.es-pe-tag.bad { background: #fbeceb; color: var(--bad); }
.es-pe-warnings .w { background: #fdf6e3; border: 1px solid #f0dca5; border-left: 4px solid var(--warn); color: #5c4300; border-radius: 8px; padding: 9px 13px; font-size: .86rem; margin: 0 0 10px; }

.es-pe-tbl { width: 100%; border-collapse: collapse; font-size: .84rem; }
.es-pe-tbl th { text-align: left; font-size: .74rem; font-weight: 600; color: var(--navy); padding: 6px 7px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.es-pe-tbl td { padding: 6px 7px; border-bottom: 1px solid #eef1f5; white-space: nowrap; }
.es-pe-tbl td.n { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: .8rem; text-align: right; }
.es-pe-tbl td.t { white-space: normal; min-width: 180px; }
.es-pe-tbl tr.is-gov td { background: var(--amber-soft); }
.es-pe-tbl tr.is-dim td { color: #9aa2b1; }
.es-pe-sizing-a { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 10px; }
.es-pe-showall { font-size: .84rem; color: var(--navy); font-weight: 600; }

.es-pe-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0 18px; }
.es-pe-kv div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid #eef1f5; font-size: .84rem; }
.es-pe-kv span { color: var(--muted); }
.es-pe-kv b { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; font-weight: 500; color: var(--ink); white-space: nowrap; }
.es-pe-kv i { font-style: normal; color: var(--muted); font-size: .76rem; margin-left: 4px; }

.es-pe-stepscard { display: none; }
.es-pe.es-pe-show-steps .es-pe-stepscard { display: block; }
.es-pe-steps h5 { font-size: .88rem; color: var(--navy); margin: 14px 0 6px; }
.es-pe-steps h5:first-child { margin-top: 0; }
.es-pe-steps p { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: .77rem; margin: 0 0 5px; padding-left: 10px; border-left: 2px solid var(--line); overflow-wrap: anywhere; }
.es-pe-disc { font-size: .78rem; color: var(--muted); }

/* ---------- guide panel ---------- */
.es-pe-topic h3 { font-size: 1.02rem; color: var(--navy); margin: 4px 0 2px; }
.es-pe-ref { font-size: .76rem; color: var(--muted); font-style: italic; margin: 0 0 10px; }
.es-pe-topic p, .es-pe-topic li { font-size: .86rem; }
.es-pe-topic ol { padding-left: 20px; margin: 0 0 10px; }
.es-pe-topic table { border-collapse: collapse; width: 100%; font-size: .8rem; margin: 0 0 10px; }
.es-pe-topic th, .es-pe-topic td { border-bottom: 1px solid var(--line); padding: 4px 6px; text-align: left; }
.es-pe-topic th { color: var(--navy); }
.es-pe-back { font-size: .8rem; color: var(--navy); font-weight: 600; text-decoration: none; }
.es-pe-chiphead { font-size: .76rem !important; font-weight: 700; color: var(--navy); text-transform: uppercase; letter-spacing: .04em; margin: 12px 0 6px; }
.es-pe-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.es-pe .es-pe-chip { font: inherit; font-size: .78rem; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--amber); background: #fff; color: var(--ink); cursor: pointer; }
.es-pe .es-pe-chip:hover { background: var(--amber-soft); }
.es-pe-target { font-size: .78rem; color: var(--muted); margin: -4px 0 8px; }

/* ---------- portals: bottom sheet + modal ---------- */
.es-pe-portal { position: fixed; inset: 0; z-index: 100000; pointer-events: none; }
.es-pe-portal.is-open { pointer-events: auto; }
.es-pe-scrim { position: absolute; inset: 0; background: rgba(15, 24, 40, .4); opacity: 0; transition: opacity .2s; }
.es-pe-portal.is-open .es-pe-scrim { opacity: 1; }
.es-pe-portal .es-pe-aside {
	position: absolute; left: 0; right: 0; bottom: 0; top: auto; max-height: 78vh; border-radius: 14px 14px 0 0;
	transform: translateY(100%); transition: transform .22s ease-out; box-shadow: 0 -6px 24px rgba(0, 0, 0, .18);
}
.es-pe-portal.is-open .es-pe-aside { transform: none; }
.es-pe-portal .es-pe-sheet-x {
	display: block; position: sticky; top: 0; float: right; margin: -6px -6px 0 0; z-index: 2;
	width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 1.2rem; cursor: pointer; color: var(--muted);
}
.es-pe-mportal { position: fixed; inset: 0; z-index: 100001; }
.es-pe-modal { position: absolute; inset: 0; background: rgba(15, 24, 40, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.es-pe-modal-box { background: #fff; border-radius: 10px; padding: 20px; width: 100%; max-width: 430px; display: flex; flex-direction: column; gap: 12px; }
.es-pe-modal-box h4 { margin: 0; color: var(--navy); font-size: 1.05rem; }

/* ---------- small ---------- */
.es-pe.is-small .es-pe-fields { grid-template-columns: minmax(0, 1fr); }
.es-pe.is-small .es-pe-card { padding: 14px; }
.es-pe.is-small .es-pe-hero-n { font-size: 1.9rem; }
.es-pe.is-small .es-pe-bar { padding: 8px 10px; }
.es-pe.is-small .es-pe-bar-a { width: 100%; }
.es-pe.is-small .es-pe-bar .es-pe-example { flex: 1 1 100%; min-width: 0; }
.es-pe.is-small .es-pe-bar .es-pe-btn { flex: 1; }
.es-pe .es-pe-ltab td select { min-width: 128px; padding: 6px 6px; font-size: .84rem; }
.es-pe [data-show].is-off { display: none; }
.es-pe .is-missing input, .es-pe td.is-missing input { border-color: var(--bad); background: #fdf1f0; }
.es-pe .is-missing .lab label { color: var(--bad); }
