:root {
  --eg-ink: #203b35;
  --eg-muted: #667b75;
  --eg-line: #d7e5e1;
  --eg-green: #07866b;
  --eg-mint: #10b981;
  --eg-soft: #f1f8f6;
  --eg-shadow: 0 18px 46px rgba(23, 70, 60, 0.12);
}

.mf-tabs.eg-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mf-tabs.eg-tabs .mf-tab { min-width: 0; }
.mf-tabs.eg-tabs .eg-tab.is-active {
  border-color: #087b64;
  color: #fff;
  background: linear-gradient(135deg, #087862, #10b981);
  box-shadow: 0 8px 18px rgba(5, 150, 105, 0.2);
}

main.eg-mode > :not(.mf-root) { display: none !important; }
main.eg-mode .mf-tab-hint { display: none !important; }

.eg-panel {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin-top: 16px;
  overflow: hidden;
  color: var(--eg-ink);
  font-family: inherit;
}

.eg-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 19px 21px;
  overflow: hidden;
  border: 1px solid rgba(8, 134, 107, 0.18);
  border-radius: 20px;
  background:
    radial-gradient(circle at 88% -60%, rgba(255, 255, 255, 0.4), transparent 18rem),
    linear-gradient(122deg, #075d4f, #07866b 58%, #10b981);
  box-shadow: 0 18px 44px rgba(5, 115, 90, 0.18);
}

.eg-hero-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 15px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  font-size: 20px;
}

.eg-hero p { margin: 0 0 3px; color: rgba(255, 255, 255, 0.68); font-size: 10px; font-weight: 850; letter-spacing: 0.12em; text-transform: uppercase; }
.eg-hero h2 { margin: 0; color: #fff; font-size: 23px; font-weight: 880; letter-spacing: -0.025em; }
.eg-hero > div > span { display: block; margin-top: 4px; color: rgba(255, 255, 255, 0.76); font-size: 12px; line-height: 1.45; }
.eg-price-date { display: inline-flex; align-items: center; gap: 7px; padding: 9px 11px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 999px; color: rgba(255, 255, 255, 0.8); background: rgba(255, 255, 255, 0.1); font-size: 11px; white-space: nowrap; }
.eg-price-date strong { color: #fff; }

.eg-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin: 13px 0;
  padding: 7px;
  border: 1px solid var(--eg-line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 28px rgba(28, 69, 60, 0.06);
}

.eg-preset {
  display: flex;
  min-width: 0;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #60756f;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 780;
  cursor: pointer;
  transition: 170ms ease;
}

.eg-preset:hover { color: #08745e; background: #f0faf6; }
.eg-preset.is-active { border-color: rgba(16, 185, 129, 0.24); color: #056a57; background: #eafbf4; box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.05); }
.eg-preset i { font-size: 17px; }

.eg-layout { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(340px, 0.78fr); align-items: start; gap: 14px; }
.eg-config-card, .eg-result-column > section, .eg-warnings, .eg-mono-summary {
  border: 1px solid var(--eg-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--eg-shadow);
}
.eg-config-card { padding: 20px; }

.eg-section-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 17px; }
.eg-section-heading > span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; color: #047857; background: #dcfce7; font-size: 11px; font-weight: 900; }
.eg-section-heading h3 { margin: 0; color: var(--eg-ink); font-size: 17px; font-weight: 850; }
.eg-section-heading p { margin: 2px 0 0; color: var(--eg-muted); font-size: 10.5px; }

.eg-fields { display: grid; gap: 11px; }
.eg-fields-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.eg-field { display: block; min-width: 0; }
.eg-field > span { display: block; margin-bottom: 6px; color: #52655f; font-size: 11px; font-weight: 780; }
.eg-field > small { display: block; margin-top: 5px; color: #83938e; font-size: 9.5px; line-height: 1.4; }
.eg-input, .eg-select { position: relative; display: flex; min-height: 45px; align-items: center; overflow: hidden; border: 1px solid #cadbd6; border-radius: 12px; background: #fff; transition: 160ms ease; }
.eg-input:focus-within, .eg-select:focus-within { border-color: var(--eg-mint); box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12); }
.eg-input input, .eg-select select { width: 100%; min-width: 0; height: 43px; padding: 0 12px; border: 0; outline: 0; color: #243c36; background: transparent; font: inherit; font-size: 13px; font-weight: 730; }
.eg-input input { text-align: right; }
.eg-input b { align-self: stretch; display: flex; min-width: 45px; align-items: center; justify-content: center; border-left: 1px solid #dbe7e3; color: #6b7f79; background: #f5f9f8; font-size: 11px; }
.eg-select select { padding-right: 35px; appearance: none; }
.eg-select > i { position: absolute; right: 12px; color: #7b918a; font-size: 10px; pointer-events: none; }

.eg-subsection { margin: 21px 0 10px; padding-top: 17px; border-top: 1px solid #e5eeeb; }
.eg-subsection h4 { margin: 0; color: #29453e; font-size: 13px; font-weight: 850; }
.eg-subsection p { margin: 3px 0 0; color: var(--eg-muted); font-size: 10px; }

.eg-toggle { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; min-height: 50px; padding: 10px 11px; border: 1px solid #d7e5e1; border-radius: 12px; background: #fbfefd; cursor: pointer; }
.eg-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.eg-toggle-mark { position: relative; width: 38px; height: 22px; border-radius: 999px; background: #cbd8d4; transition: 170ms ease; }
.eg-toggle-mark::after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(29, 58, 51, 0.25); content: ""; transition: 170ms ease; }
.eg-toggle input:checked + .eg-toggle-mark { background: linear-gradient(90deg, #07866b, #10b981); }
.eg-toggle input:checked + .eg-toggle-mark::after { transform: translateX(16px); }
.eg-toggle strong { display: block; color: #2d4841; font-size: 11.5px; font-weight: 800; }
.eg-toggle small { display: block; margin-top: 2px; color: #7a8d87; font-size: 9.5px; line-height: 1.35; }

.eg-frame-note { display: flex; min-height: 69px; align-items: center; gap: 11px; padding: 10px 12px; border: 1px dashed #a8c9bf; border-radius: 12px; color: #42645b; background: #f1faf7; }
.eg-frame-note > i { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: #047857; background: #dcfce7; }
.eg-frame-note strong, .eg-frame-note small { display: block; }
.eg-frame-note strong { font-size: 11px; }
.eg-frame-note small { margin-top: 2px; color: #71857f; font-size: 9px; }

.eg-monolith { margin-top: 21px; padding: 12px; border: 1px solid #d7e5e1; border-radius: 16px; background: linear-gradient(145deg, #f7fbfa, #eef8f4); }
.eg-monolith.is-open { border-color: rgba(16, 185, 129, 0.35); }
.eg-monolith-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 11px; padding-top: 11px; border-top: 1px solid #dbe8e4; }
.eg-monolith-note { grid-column: 1 / -1; display: flex; align-items: flex-start; gap: 9px; padding: 10px 11px; border-radius: 11px; color: #536d65; background: #fff; font-size: 9.5px; line-height: 1.45; }
.eg-monolith-note i { margin-top: 2px; color: #07866b; }

.eg-result-column { position: sticky; top: 92px; display: grid; gap: 11px; }
.eg-total-card { overflow: hidden; padding: 18px; color: #fff; background: radial-gradient(circle at 90% -25%, rgba(255,255,255,.25), transparent 15rem), linear-gradient(125deg, #075f50, #07866b 55%, #10b981) !important; }
.eg-total-head { display: flex; align-items: center; justify-content: space-between; color: rgba(255,255,255,.76); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.eg-total-card > strong { display: block; margin: 9px 0 14px; color: #fff; font-size: 29px; font-weight: 900; letter-spacing: -.035em; }
.eg-total-breakdown { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.eg-total-breakdown span { padding: 8px; border: 1px solid rgba(255,255,255,.13); border-radius: 10px; color: rgba(255,255,255,.7); background: rgba(255,255,255,.08); font-size: 9px; }
.eg-total-breakdown b { display: block; margin-top: 3px; color: #fff; font-size: 10px; }

.eg-result-details { overflow: hidden; background: #fff !important; box-shadow: 0 12px 32px rgba(26, 67, 58, 0.08) !important; }
.eg-result-group { border-bottom: 1px solid #e7efed; }
.eg-result-group:last-child { border-bottom: 0; }
.eg-result-group summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; color: #345047; font-size: 11px; font-weight: 850; cursor: pointer; list-style: none; }
.eg-result-group summary::-webkit-details-marker { display: none; }
.eg-result-group summary span { color: #08745f; }
.eg-result-group > div { padding: 0 14px 10px; }
.eg-result-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; padding: 8px 0; border-top: 1px dashed #e1eae7; }
.eg-result-line strong { display: block; color: #3e554f; font-size: 9.5px; font-weight: 730; line-height: 1.35; }
.eg-result-line small { display: block; margin-top: 2px; color: #82918d; font-size: 8.5px; }
.eg-result-line > b { align-self: center; color: #203c35; font-size: 10px; white-space: nowrap; }
.eg-empty { margin: 0; color: #97a5a1; font-size: 10px; }

.eg-warnings { padding: 11px 13px; border-color: #f1d994; background: #fffaf0; box-shadow: none; }
.eg-warnings p { display: flex; align-items: flex-start; gap: 7px; margin: 0; color: #805b18; font-size: 9.5px; line-height: 1.45; }
.eg-warnings p + p { margin-top: 5px; }
.eg-warnings i { margin-top: 2px; }
.eg-mono-summary { display: grid; gap: 3px; padding: 12px 13px; border-color: #c6ddd6; background: #f1faf7; box-shadow: none; }
.eg-mono-summary strong { color: #285147; font-size: 11px; }
.eg-mono-summary span { color: #567069; font-size: 9.5px; }
.eg-mono-summary small { color: #7a8c87; font-size: 8.5px; }

.eg-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.eg-actions button { min-height: 46px; border-radius: 13px; font: inherit; font-size: 11px; font-weight: 850; cursor: pointer; }
.eg-primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #047857; color: #fff; background: linear-gradient(135deg, #087862, #10b981); box-shadow: 0 10px 23px rgba(5, 150, 105, 0.22); }
.eg-secondary { padding: 0 13px; border: 1px solid #cfddd9; color: #536a64; background: #fff; }
.eg-actions button:hover { transform: translateY(-1px); }
.eg-message { margin: 0; padding: 10px 12px; border-radius: 11px; color: #166534; background: #ecfdf5; font-size: 10px; font-weight: 750; }
.eg-price-help { display: flex; align-items: center; gap: 7px; margin: 0; color: #7b8d88; font-size: 9.5px; }
.eg-price-help i { color: #07866b; }

@media (max-width: 1100px) {
  .eg-layout { grid-template-columns: 1fr; }
  .eg-result-column { position: static; }
  .eg-result-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .eg-result-group { border-right: 1px solid #e7efed; border-bottom: 0; }
  .eg-result-group:last-child { border-right: 0; }
}

@media (max-width: 760px) {
  .mf-root { min-width: 0; max-width: 100%; overflow: hidden; }
  .mf-switcher { min-width: 0; max-width: 100%; }
  .mf-tabs.eg-tabs { box-sizing: border-box; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; max-width: 100%; }
  .mf-tabs.eg-tabs .mf-tab { min-height: 47px; padding-right: 4px; padding-left: 4px; font-size: 9.5px; line-height: 1.15; white-space: normal; }
  .mf-tabs.eg-tabs .mf-tab span { display: block; max-width: 100%; overflow: visible; text-overflow: clip; text-align: center; white-space: normal; }
  .eg-hero { grid-template-columns: auto minmax(0, 1fr); padding: 15px; border-radius: 17px; }
  .eg-hero > div { min-width: 0; }
  .eg-hero h2 { font-size: 20px; }
  .eg-hero > div > span { font-size: 10px; }
  .eg-price-date { grid-column: 1 / -1; justify-self: start; }
  .eg-presets { box-sizing: border-box; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; max-width: 100%; }
  .eg-preset { min-height: 49px; font-size: 10.5px; }
  .eg-config-card { padding: 15px; border-radius: 17px; }
  .eg-fields-2, .eg-monolith-body { grid-template-columns: 1fr; }
  .eg-result-details { display: block; }
  .eg-result-group { border-right: 0; border-bottom: 1px solid #e7efed; }
  .eg-total-card > strong { font-size: 25px; }
  .eg-actions { grid-template-columns: 1fr; }
  .eg-secondary { min-height: 42px !important; }
}

@media (max-width: 430px) {
  .mf-tabs.eg-tabs .mf-tab i { display: none; }
  .mf-tabs.eg-tabs .mf-tab { font-size: 9px; }
  .eg-hero-icon { width: 42px; height: 42px; }
  .eg-presets { gap: 5px; padding: 5px; }
  .eg-preset { flex-direction: column; gap: 4px; min-height: 58px; text-align: center; }
  .eg-total-breakdown { grid-template-columns: 1fr; }
  .eg-total-breakdown span { display: flex; align-items: center; justify-content: space-between; }
  .eg-total-breakdown b { display: inline; margin: 0; }
}

@media print {
  .eg-panel { display: none !important; }
}
