/**
 * Energhx Demo Simulator — frontend styles v2.0.3
 * Implements the Energhx CleanTech Design System v2.0 (merged spec × live site):
 * Aldrich display · Plus Jakarta Sans UI · Outfit body · brand #2dad00 ·
 * section gray #f4f6f8 · pill buttons · sector/result cards.
 * Everything is scoped to .egds-* / #egds-modal to be Elementor/theme safe.
 */

.egds-launch-btn,
#egds-modal {
  --egds-brand: #2dad00;
  --egds-brand-hover: #239600;
  --egds-primary: #16a34a;
  --egds-primary-dark: #15803d;
  --egds-subtle: #f0fdf4;
  --egds-mint: #ecfdf5;
  --egds-mint-strong: #e9fcef;
  --egds-mint-border: #bbf7d0;
  --egds-section: #f4f6f8;
  --egds-soft: #fafbfc;
  --egds-text: #090d16;
  --egds-lead: #334155;
  --egds-body: #475569;
  --egds-muted: #64748b;
  --egds-border: #e2e8f0;
  --egds-border-card: #e8edf2;
  --egds-font-display: 'Aldrich', 'Plus Jakarta Sans', system-ui, sans-serif;
  --egds-font-ui: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --egds-font-body: 'Outfit', 'Plus Jakarta Sans', system-ui, sans-serif;
}

/* ============ Launch button (widget output) ============ */
.egds-launch-wrap--block { display: block; }
.egds-launch-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 46px; padding: 13px 28px; border: 1px solid transparent; border-radius: 9999px;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  background: var(--egds-brand); color: #fff; cursor: pointer;
  font-family: var(--egds-font-display); font-weight: 700; font-size: 14px; line-height: 1.2; letter-spacing: .01em;
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.egds-launch-btn:hover, .egds-launch-btn:focus-visible { background: var(--egds-brand-hover) !important; color: #fff; }
.egds-launch-btn:active { transform: translateY(1px); }
.egds-launch-btn:focus-visible, .egds-btn:focus-visible, #egds-modal button:focus-visible,
#egds-modal input:focus-visible, #egds-modal summary:focus-visible { outline: 2px solid var(--egds-primary); outline-offset: 2px; }
.egds-launch-wrap--block .egds-launch-btn { display: flex; width: 100%; }
.egds-launch-icon { display: inline-flex; } .egds-launch-icon svg { width: 16px; height: 16px; fill: currentColor; }

/* ============ Modal shell ============ */
#egds-modal[hidden] { display: none !important; }
#egds-modal {
  position: fixed; inset: 0; z-index: 999999;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--egds-font-body); color: var(--egds-body);
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
#egds-modal, #egds-modal * , #egds-modal *::before, #egds-modal *::after { box-sizing: border-box; }
.egds-overlay { position: absolute; inset: 0; background: rgba(9, 13, 22, .55); backdrop-filter: blur(3px); }
.egds-dialog {
  position: relative; display: flex; flex-direction: column;
  width: min(920px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  max-height: calc(100dvh - 32px);
  max-height: calc(var(--egds-vh, 1vh) * 100 - 32px);
  margin: 0; background: #fff; border: 1px solid var(--egds-border-card);
  border-radius: 24px; box-shadow: 0 24px 70px rgba(9, 13, 22, .28); overflow: hidden;
  animation: egds-in .24s ease;
}
@keyframes egds-in { from { opacity: 0; transform: translateY(14px) scale(.99); } to { opacity: 1; transform: none; } }
body.egds-locked { overflow: hidden !important; }
body.admin-bar #egds-modal { top: 32px; }
@media (max-width: 782px) { body.admin-bar #egds-modal { top: 46px; } }

/* Header */
.egds-head {
  flex: none; display: flex; gap: 16px; align-items: flex-start;
  padding: 22px 26px 18px; border-bottom: 1px solid var(--egds-border-card);
  background: linear-gradient(180deg, #fbfefc, #fff);
}
.egds-head-icon {
  flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; border: 1px solid;
}
.egds-head-icon svg { width: 23px; height: 23px; }
.egds-head-txt { flex: 1; min-width: 0; }
.egds-badge {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; margin-bottom: 8px;
  border-radius: 9999px; background: var(--egds-subtle); border: 1px solid var(--egds-mint-border);
  color: var(--egds-primary-dark); font-family: var(--egds-font-display); font-weight: 700; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase;
}
.egds-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--egds-brand); }
.egds-head h2 {
  margin: 0; font-family: var(--egds-font-display); font-weight: 700;
  font-size: clamp(22px, 3.4vw, 31px); line-height: 1.12; color: var(--egds-text); text-wrap: balance;
}
.egds-head p { margin: 7px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--egds-muted); max-width: 58ch; }
.egds-x {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--egds-border);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  background: #fff; color: var(--egds-lead); font-size: 17px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; transition: background-color .2s, border-color .2s, color .2s;
  box-shadow: none; text-transform: none;
}
.egds-x:hover, .egds-x:focus-visible { background: #fff1f2; border-color: #fda4af; color: #e11d48; }
.egds-x:active { background: #ffe4e6; }

/* Body / footer */
.egds-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 20px 26px 24px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.egds-foot {
  flex: none; position: relative; z-index: 3;
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
  padding: 15px 26px calc(15px + env(safe-area-inset-bottom, 0px));
  background: #fff; border-top: 1px solid var(--egds-border-card);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, .04);
}
.egds-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 12px 24px; border-radius: 9999px; border: 1px solid transparent; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none;
  box-shadow: none; text-transform: none; letter-spacing: normal;
  font-family: var(--egds-font-display); font-weight: 700; font-size: 13px; line-height: 1; text-decoration: none;
  transition: background .2s, border-color .2s, color .2s, opacity .2s;
}
.egds-btn--primary { background: var(--egds-brand); color: #fff; }
.egds-btn--primary:hover:not(:disabled), .egds-btn--primary:focus-visible { background: var(--egds-brand-hover); }
.egds-btn--primary:active:not(:disabled) { background: var(--egds-primary-dark); }
.egds-btn--ghost { background: #fff; border-color: var(--egds-border); color: var(--egds-text); }
.egds-btn--ghost:hover, .egds-btn--ghost:focus-visible { background: var(--egds-subtle); border-color: var(--egds-primary); color: var(--egds-primary-dark); }
.egds-btn--ghost:active { background: var(--egds-mint); }
.egds-btn--slate { background: #64748b; color: #fff; }
.egds-btn--slate:hover, .egds-btn--slate:focus-visible { background: #475569; }
.egds-btn--slate:active { background: #334155; }
.egds-btn:disabled { opacity: .65; cursor: wait; }

/* Theme-proof state styles: many themes paint every button:hover with their
   own brand colour. These ID-scoped rules (backgrounds !important) guarantee
   the popup's buttons always keep the Energhx state colours:
   primary green, slate, mint-tinted ghost (Back), soft-rose close (x). */
#egds-modal .egds-btn--primary:hover:not(:disabled),
#egds-modal .egds-btn--primary:focus-visible, #egds-modal .egds-btn--primary:focus { background: var(--egds-brand-hover) !important; color: #fff; }
#egds-modal .egds-btn--primary:active:not(:disabled) { background: var(--egds-primary-dark) !important; }
#egds-modal .egds-btn--slate:hover, #egds-modal .egds-btn--slate:focus-visible, #egds-modal .egds-btn--slate:focus { background: #475569 !important; color: #fff; }
#egds-modal .egds-btn--slate:active { background: #334155 !important; }
#egds-modal .egds-btn--ghost:hover, #egds-modal .egds-btn--ghost:focus-visible, #egds-modal .egds-btn--ghost:focus { background: var(--egds-subtle) !important; border-color: var(--egds-primary); color: var(--egds-primary-dark); }
#egds-modal .egds-btn--ghost:active { background: var(--egds-mint) !important; }
#egds-modal .egds-x:hover, #egds-modal .egds-x:focus-visible, #egds-modal .egds-x:focus { background: #fff1f2 !important; border-color: #fda4af; color: #e11d48; }
#egds-modal .egds-x:active { background: #ffe4e6 !important; }
.egds-spinner { width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: egds-spin .7s linear infinite; }
@keyframes egds-spin { to { transform: rotate(360deg); } }

/* Alerts / loading */
.egds-alert { border-radius: 14px; padding: 14px 16px; font-size: 13.5px; margin: 0 0 16px; }
.egds-alert--error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.egds-alert--warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.egds-alert ul { margin: 8px 0 0 18px; padding: 0; }
.egds-loading { text-align: center; padding: 42px 10px; color: var(--egds-muted); font-size: 13.5px; }
.egds-loading .egds-spinner { width: 34px; height: 34px; margin: 0 auto 14px; border-color: #bbf7d0; border-top-color: var(--egds-brand); border-width: 3px; }
.egds-view-note { font-size: 12px; color: var(--egds-muted); margin: -4px 0 16px; font-family: var(--egds-font-ui); }

/* ============ Form: sector cards (screenshot layout) ============ */
.egds-sector {
  border: 1px solid var(--egds-border-card); border-radius: 16px; background: #fff;
  padding: 20px; margin: 0 0 16px; box-shadow: 0 1px 3px rgba(15, 23, 42, .03);
}
.egds-sector > h3 {
  margin: 0 0 16px; font-family: var(--egds-font-ui); font-weight: 700;
  font-size: 15px; color: var(--egds-text);
}
.egds-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 18px; }
.egds-field label { display: block; font-family: var(--egds-font-ui); font-size: 11.5px; font-weight: 500; color: var(--egds-muted); margin-bottom: 6px; }
.egds-field input, .egds-field select {
  width: 100%; height: 44px; padding: 8px 12px; border: 1px solid var(--egds-border); border-radius: 8px;
  background: #fff; color: var(--egds-text); font-family: var(--egds-font-body); font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.egds-field input:hover, .egds-field select:hover { border-color: #cbd5e1; }
.egds-field input:focus, .egds-field select:focus { border-color: var(--egds-primary); box-shadow: 0 0 0 3px rgba(45, 173, 0, .14); outline: none; }
.egds-field input.egds-invalid { border-color: #f43f5e; box-shadow: 0 0 0 3px rgba(244, 63, 94, .12); }
.egds-field .egds-help { display: block; margin-top: 5px; font-size: 11px; color: #94a3b8; }
.egds-field .egds-err { display: block; margin-top: 5px; font-size: 11px; color: #e11d48; }

/* Assumptions (read-only sector) */
.egds-assump { border: 1px dashed #cbd5e1; border-radius: 16px; background: var(--egds-soft); padding: 4px 20px; margin: 0 0 4px; }
.egds-assump summary { cursor: pointer; padding: 13px 0; font-family: var(--egds-font-ui); font-weight: 600; font-size: 13px; color: var(--egds-lead); }
.egds-assump summary small { display: block; font-weight: 400; color: #94a3b8; margin-top: 2px; font-size: 11.5px; }
.egds-assump-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 22px; padding: 2px 0 16px; }
.egds-assump-grid div { display: flex; justify-content: space-between; gap: 14px; font-size: 12.5px; border-bottom: 1px solid #eef2f5; padding-bottom: 7px; }
.egds-assump-grid dt { color: var(--egds-muted); } .egds-assump-grid dd { margin: 0; color: var(--egds-lead); font-weight: 500; font-family: var(--egds-font-ui); text-align: right; }

/* ============ Results ============ */
.egds-kpi-strip {
  border: 1px solid #fed7aa; background: linear-gradient(180deg, #fffaf3, #fff7ed);
  border-radius: 18px; padding: 18px; margin: 0 0 16px;
}
.egds-kpi-strip > h3, .egds-rcard > h3 {
  margin: 0 0 14px; font-family: var(--egds-font-ui); font-weight: 700; font-size: 15px; color: var(--egds-text);
}
.egds-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.egds-kpi { text-align: center; padding: 14px 8px 10px; border-radius: 14px; background: rgba(255,255,255,.66); }
.egds-kpi-icon { width: 42px; height: 42px; margin: 0 auto 9px; border-radius: 12px; display: grid; place-items: center; border: 1px solid; }
.egds-kpi-icon svg { width: 20px; height: 20px; }
.egds-kpi small { display: block; font-family: var(--egds-font-ui); font-size: 10.5px; color: var(--egds-muted); }
.egds-kpi strong { display: block; margin: 4px 0 2px; font-family: var(--egds-font-ui); font-weight: 800; font-size: 19px; color: var(--egds-text); overflow-wrap: anywhere; }
.egds-kpi em { font-style: normal; font-size: 11px; color: var(--egds-muted); overflow-wrap: anywhere; }
.egds-kpi strong.egds-neg { color: #e11d48; }

/* Category chip colors (shared by header + KPI icons) */
.egds-cat-green { background: #f0fdf4; border-color: #bbf7d0 !important; color: #16a34a; }
.egds-cat-sky { background: #f0f9ff; border-color: #bae6fd !important; color: #0284c7; }
.egds-cat-violet { background: #f5f3ff; border-color: #ddd6fe !important; color: #7c3aed; }
.egds-cat-Amber { background: #fffbeb; border-color: #fde68a !important; color: #d97706; }
.egds-cat-rose { background: #fef2f2; border-color: #fecaca !important; color: #dc2626; }
.egds-cat-teal { background: #ecfdf5; border-color: #a7f3d0 !important; color: #059669; }

.egds-rgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; grid-auto-flow: dense; }
#egds-modal input:focus-visible { outline: none; /* focus ring comes from the input box-shadow */ }
.egds-rcard { border: 1px solid var(--egds-border-card); border-radius: 18px; background: #fff; padding: 20px; margin: 0 0 14px; box-shadow: 0 1px 3px rgba(15,23,42,.03); }
.egds-rcard--mint { background: linear-gradient(160deg, var(--egds-mint-strong), var(--egds-mint)); border-color: var(--egds-mint-border); }
.egds-rcard .egds-rcard { padding: 0; border: 0; box-shadow: none; margin: 0 0 14px; }
.egds-spec { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.egds-spec td { padding: 7.5px 2px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.egds-spec tr:last-child td { border-bottom: 0; }
.egds-spec td:first-child { color: var(--egds-muted); padding-right: 14px; }
.egds-spec td:last-child { text-align: right; color: var(--egds-text); font-weight: 600; font-family: var(--egds-font-ui); overflow-wrap: anywhere; }
.egds-spec td.egds-neg { color: #e11d48; } .egds-spec td.egds-pos { color: var(--egds-primary); }
.egds-env-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; text-align: center; }
.egds-env-kpis small { font-size: 11px; color: var(--egds-muted); font-family: var(--egds-font-ui); }
.egds-env-kpis strong { display: block; margin: 3px 0; font-family: var(--egds-font-ui); font-size: 20px; font-weight: 800; color: var(--egds-primary); }
.egds-env-kpis em { font-style: normal; font-size: 11px; color: var(--egds-muted); }

/* Suitability bars */
.egds-bar-row { margin: 0 0 13px; }
.egds-bar-head { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; margin-bottom: 6px; }
.egds-bar-head span:first-child { color: var(--egds-lead); font-family: var(--egds-font-ui); }
.egds-bar-head span:last-child { color: var(--egds-primary-dark); font-weight: 600; font-family: var(--egds-font-ui); text-align: right; }
.egds-bar { height: 7px; border-radius: 99px; background: #e8edf2; overflow: hidden; }
.egds-bar i { display: block; height: 100%; border-radius: 99px; background: var(--egds-brand); transition: width .6s ease; }

/* Charts */
.egds-chart { padding-top: 6px; }
.egds-chart-scroll { overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.egds-chart-plot { position: relative; height: 168px; border-bottom: 1px solid var(--egds-border); margin: 10px 0 8px; }
.egds-chart-inner { position: relative; height: 100%; min-width: 100%; }
.egds-chart-group { position: absolute; top: 0; bottom: 0; display: flex; align-items: stretch; justify-content: center; }
.egds-chart-bar { position: relative; flex: none; width: 13px; margin: 0 1.5px; }
.egds-chart-bar i { position: absolute; left: 0; right: 0; border-radius: 3px 3px 0 0; }
.egds-chart-zero { position: absolute; left: 0; right: 0; border-top: 1px dashed #cbd5e1; }
.egds-chart-x { position: relative; height: 22px; font-size: 10px; color: #94a3b8; font-family: var(--egds-font-ui); overflow: hidden; }
.egds-chart-x span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.egds-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11px; color: var(--egds-muted); font-family: var(--egds-font-ui); margin-top: 7px; }
.egds-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.egds-chart-totals { margin-top: 12px; }
.egds-more { font-size: 11px; color: #94a3b8; margin-top: 6px; }

/* Stacked distribution */
.egds-stack { display: flex; height: 20px; border-radius: 99px; overflow: hidden; border: 1px solid var(--egds-border-card); margin: 6px 0 4px; }
.egds-stack i { display: block; height: 100%; }

/* Equipment & recommendation cards */
.egds-item { border: 1px solid var(--egds-border-card); border-radius: 14px; padding: 15px 16px; margin: 0 0 11px; background: var(--egds-soft); }
.egds-item h4 { margin: 0 0 5px; font-family: var(--egds-font-ui); font-size: 13.5px; font-weight: 700; color: var(--egds-text); }
.egds-item p { margin: 0; font-size: 12.5px; }
.egds-item .egds-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.egds-chip { font-family: var(--egds-font-ui); font-size: 10.5px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: #eef2f5; color: var(--egds-lead); }
.egds-chip--green { background: var(--egds-subtle); color: var(--egds-primary-dark); border: 1px solid var(--egds-mint-border); }
.egds-chip--warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.egds-plain-list { margin: 0; padding-left: 18px; font-size: 12.5px; display: grid; gap: 6px; }
.egds-caption { font-size: 11.5px; color: #94a3b8; margin: -6px 0 12px; line-height: 1.55; }
.egds-params { margin: 0 0 16px; }
.egds-params summary { cursor: pointer; font-family: var(--egds-font-ui); font-size: 12px; font-weight: 600; color: var(--egds-muted); }

/* ============ Responsive ============ */
/* Coarse pointers (touch laptops/tablets/phones): bigger hit areas everywhere */
@media (hover: none) and (pointer: coarse) {
  .egds-btn { min-height: 48px; padding-left: 26px; padding-right: 26px; }
  .egds-x { width: 48px; height: 48px; }
  .egds-field input, .egds-field select { height: 48px; }
  .egds-launch-btn { min-height: 50px; }
  .egds-assump summary, .egds-params summary { padding-top: 15px; padding-bottom: 15px; }
}

/* Tablet (portrait & small landscape, incl. iPad) */
@media (min-width: 721px) and (max-width: 1080px) {
  .egds-dialog { width: min(840px, calc(100% - 40px)); }
  .egds-head { padding: 20px 22px 16px; }
  .egds-body { padding: 18px 22px 20px; }
  .egds-foot { padding-left: 22px; padding-right: 22px; }
  .egds-kpis { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
  .egds-sector { padding: 18px; }
}

/* Phone: dialog becomes a full-screen sheet; footer buttons stack full-width,
   primary action last (closest to the thumb) and always visible. */
@media (max-width: 720px) {
  #egds-modal { align-items: stretch; justify-content: stretch; }
  .egds-dialog {
    width: 100%; border: 0; border-radius: 0;
    height: 100%; height: 100dvh; height: calc(var(--egds-vh, 1vh) * 100); max-height: none;
  }
  .egds-head { flex-wrap: wrap; align-items: center; column-gap: 10px; row-gap: 6px; padding: 12px 16px 11px; }
  .egds-head-txt { display: contents; }
  .egds-head-icon { order: 1; width: 40px; height: 40px; }
  .egds-badge { order: 2; margin: 0; }
  .egds-x { order: 3; margin-left: auto; }
  .egds-head h2 { order: 4; flex: 1 1 100%; font-size: clamp(19px, 5.4vw, 22px); line-height: 1.14; }
  .egds-head p {
    order: 5; flex: 1 1 100%; margin: 0; font-size: 12.5px; line-height: 1.38; max-width: none;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .egds-body { padding: 14px 14px 18px; }
  .egds-sector { padding: 16px 14px; border-radius: 14px; margin-bottom: 12px; }
  .egds-rcard { padding: 16px 14px; border-radius: 14px; }
  .egds-fields, .egds-rgrid, .egds-assump-grid { grid-template-columns: 1fr; }
  .egds-field input, .egds-field select { height: 48px; font-size: 16px; /* 16px stops iOS focus auto-zoom */ }
  .egds-foot {
    flex-direction: column; flex-wrap: nowrap; gap: 9px;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .egds-foot .egds-btn { width: 100%; min-height: 50px; font-size: 14px; }
  .egds-kpis { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .egds-kpi { padding: 12px 6px 9px; }
  .egds-kpi strong { font-size: 17px; }
  .egds-kpi-strip { padding: 14px; border-radius: 14px; }
  .egds-env-kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .egds-spec { font-size: 12px; }
  .egds-chart-plot { height: 148px; }
  .egds-assump { padding: 4px 14px; }
  .egds-item { padding: 13px 14px; }
}

/* Very small phones */
@media (max-width: 374px) {
  .egds-kpi strong { font-size: 15px; }
  .egds-kpi-icon { width: 36px; height: 36px; }
  .egds-head { padding: 10px 14px 9px; row-gap: 5px; }
  .egds-head h2 { font-size: 19px; }
  .egds-head p { font-size: 12px; }
  .egds-badge { font-size: 8.5px; }
}

/* Short viewports (landscape phones, small laptop windows): compact header so
   the scroll area and footer buttons always keep usable room. */
@media (max-height: 520px) {
  .egds-dialog { max-height: calc(100% - 12px); max-height: calc(100dvh - 12px); max-height: calc(var(--egds-vh, 1vh) * 100 - 12px); }
  .egds-head { padding: 11px 18px 9px; gap: 11px; }
  .egds-head-icon { width: 36px; height: 36px; }
  .egds-badge { margin-bottom: 4px; }
  .egds-head h2 { font-size: 18px; }
  .egds-head p { display: none; }
  .egds-body { padding-top: 12px; }
}
@media (max-width: 720px) and (max-height: 520px) {
  .egds-dialog { height: 100%; height: 100dvh; height: calc(var(--egds-vh, 1vh) * 100); max-height: none; }
  .egds-foot { flex-direction: row; }
  .egds-foot .egds-btn { width: auto; flex: 1; min-height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  .egds-dialog { animation: none; } .egds-bar i { transition: none; }
}
