.embacpi {
  --embacpi-ink: #102033;
  --embacpi-muted: #5d6b7b;
  --embacpi-border: #d9e2ea;
  --embacpi-soft: #f5f8fb;
  --embacpi-green: #08785e;
  --embacpi-green-dark: #055b48;
  --embacpi-green-soft: #eaf8f3;
  --embacpi-blue: #2768b2;
  --embacpi-white: #ffffff;
  --embacpi-danger: #b42318;
  --embacpi-shadow: 0 16px 45px rgba(16, 32, 51, 0.10);
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 1120px;
  margin: 2rem auto;
  container-type: inline-size;
  container-name: embacpi-root;
  color: var(--embacpi-ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

.embacpi *,
.embacpi *::before,
.embacpi *::after {
  box-sizing: border-box;
}

.embacpi [hidden] {
  display: none !important;
}

.embacpi h2,
.embacpi h3,
.embacpi p {
  margin-top: 0;
}

.embacpi h2,
.embacpi h3 {
  color: var(--embacpi-ink);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.embacpi button,
.embacpi input,
.embacpi select {
  font: inherit;
}

.embacpi button {
  cursor: pointer;
}

.embacpi button:focus-visible,
.embacpi input:focus-visible,
.embacpi select:focus-visible,
.embacpi summary:focus-visible,
.embacpi a:focus-visible {
  outline: 3px solid rgba(39, 104, 178, 0.34);
  outline-offset: 2px;
}

.embacpi__hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(1.5rem, 4vw, 2.8rem);
  border: 1px solid #c9e7dd;
  border-radius: 24px 24px 0 0;
  background:
    radial-gradient(circle at 92% 10%, rgba(39, 104, 178, 0.14), transparent 34%),
    linear-gradient(135deg, #f3fffb 0%, #f7fbff 100%);
}

.embacpi__hero::after {
  content: "$";
  position: absolute;
  right: 3%;
  bottom: -78px;
  color: rgba(8, 120, 94, 0.055);
  font-size: 250px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.embacpi__hero-copy {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.embacpi__eyebrow {
  margin-bottom: 0.45rem;
  color: var(--embacpi-green-dark);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.embacpi__hero h2 {
  margin-bottom: 0.65rem;
  font-size: clamp(2rem, 4vw, 3.25rem);
}

.embacpi__hero-copy > p:last-child {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--embacpi-muted);
  font-size: 1.06rem;
}

.embacpi__status {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  min-width: 240px;
  padding: 0.95rem 1.1rem;
  border: 1px solid rgba(8, 120, 94, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 8px 20px rgba(16, 32, 51, 0.06);
  backdrop-filter: blur(6px);
}

.embacpi__status-dot {
  grid-row: 1 / span 3;
  width: 11px;
  height: 11px;
  margin-right: 0.7rem;
  border-radius: 50%;
  background: #11a879;
  box-shadow: 0 0 0 5px rgba(17, 168, 121, 0.12);
}

.embacpi__status strong {
  font-size: 0.9rem;
}

.embacpi__status span:last-child {
  color: var(--embacpi-muted);
  font-size: 0.78rem;
}

.embacpi__status .embacpi__status-rate {
  margin-top: 0.22rem;
  color: var(--embacpi-green-dark);
}

.embacpi__status-rate b {
  font-size: 0.94rem;
}

.embacpi__tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.55rem;
  border-right: 1px solid var(--embacpi-border);
  border-left: 1px solid var(--embacpi-border);
  background: #f3f6f9;
}

.embacpi__tab {
  flex: 1 1 0;
  padding: 0.8rem 1rem;
  border: 0;
  border-radius: 10px;
  color: var(--embacpi-muted);
  background: transparent;
  font-weight: 750;
  transition: color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.embacpi__tab:hover {
  color: var(--embacpi-ink);
  background: rgba(255, 255, 255, 0.68);
}

.embacpi__tab.is-active {
  color: var(--embacpi-green-dark);
  background: var(--embacpi-white);
  box-shadow: 0 3px 10px rgba(16, 32, 51, 0.09);
}

.embacpi__panel {
  min-width: 0;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--embacpi-border);
  border-top: 0;
  background: var(--embacpi-white);
  container-type: inline-size;
  container-name: embacpi-panel;
}

.embacpi__form {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.22fr) 48px minmax(0, 1.22fr);
  gap: clamp(0.6rem, 1.3vw, 1rem);
  align-items: end;
  width: 100%;
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--embacpi-border);
  border-radius: 18px;
  background: var(--embacpi-soft);
}

.embacpi__field,
.embacpi__date-group {
  min-width: 0;
}

.embacpi__form > *,
.embacpi__date-group > *,
.embacpi__money-input,
.embacpi__percent-input {
  min-width: 0;
  max-width: 100%;
}

.embacpi__field label,
.embacpi__date-group legend {
  display: block;
  margin-bottom: 0.4rem;
  color: #344456;
  font-size: 0.84rem;
  font-weight: 750;
}

.embacpi__field label span {
  color: var(--embacpi-muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.embacpi__date-group {
  display: grid;
  grid-template-columns: minmax(72px, 0.58fr) minmax(0, 1.42fr);
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.embacpi__date-group legend {
  grid-column: 1 / -1;
}

.embacpi__date-group label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.embacpi input,
.embacpi select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;
  min-height: 48px;
  padding: 0.72rem 0.8rem;
  border: 1px solid #bcc9d4;
  border-radius: 10px;
  color: var(--embacpi-ink);
  background: var(--embacpi-white);
  box-shadow: 0 1px 2px rgba(16, 32, 51, 0.03);
}

.embacpi input:hover,
.embacpi select:hover {
  border-color: #8da0b1;
}

.embacpi select {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.embacpi__money-input,
.embacpi__percent-input {
  position: relative;
}

.embacpi__money-input > span,
.embacpi__percent-input > span {
  position: absolute;
  top: 50%;
  color: var(--embacpi-muted);
  font-weight: 750;
  transform: translateY(-50%);
  pointer-events: none;
}

.embacpi__money-input > span {
  left: 0.85rem;
}

.embacpi__money-input input {
  padding-left: 1.7rem;
}

.embacpi__percent-input > span {
  right: 0.85rem;
}

.embacpi__percent-input input {
  padding-right: 1.8rem;
}

.embacpi__swap {
  display: inline-grid;
  place-items: center;
  align-self: end;
  justify-self: center;
  width: 46px;
  height: 46px;
  margin-bottom: 1px;
  border: 1px solid #bad8ce;
  border-radius: 50%;
  color: var(--embacpi-green-dark);
  background: var(--embacpi-green-soft);
  transition: transform 150ms ease, background-color 150ms ease;
}

.embacpi__swap:hover {
  background: #d8f2e8;
  transform: rotate(180deg);
}

.embacpi__primary {
  grid-column: 1 / -1;
  min-height: 50px;
  padding: 0.8rem 1.25rem;
  border: 0;
  border-radius: 11px;
  color: var(--embacpi-white);
  background: linear-gradient(135deg, var(--embacpi-green) 0%, var(--embacpi-green-dark) 100%);
  box-shadow: 0 8px 18px rgba(8, 120, 94, 0.20);
  font-weight: 800;
  letter-spacing: 0.01em;
  transition: filter 150ms ease, transform 150ms ease;
}

.embacpi__primary:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.embacpi__error {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0.65rem 0.8rem;
  border-left: 3px solid var(--embacpi-danger);
  color: var(--embacpi-danger);
  background: #fff2f0;
  font-size: 0.88rem;
}

.embacpi__presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0.9rem 0 1.25rem;
}

.embacpi__presets > span {
  margin-right: 0.15rem;
  color: var(--embacpi-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.embacpi__presets button,
.embacpi__result-actions button {
  padding: 0.45rem 0.7rem;
  border: 1px solid #cbd6df;
  border-radius: 999px;
  color: #35475a;
  background: var(--embacpi-white);
  font-size: 0.78rem;
  font-weight: 650;
}

.embacpi__presets button:hover,
.embacpi__result-actions button:hover {
  border-color: #80b7a5;
  color: var(--embacpi-green-dark);
  background: var(--embacpi-green-soft);
}

.embacpi__results {
  overflow: hidden;
  border: 1px solid #b9dfd2;
  border-radius: 20px;
  background: linear-gradient(145deg, #f0fff9 0%, #f7fbff 100%);
  box-shadow: var(--embacpi-shadow);
}

.embacpi__result-main {
  padding: clamp(1.35rem, 4vw, 2.4rem);
  text-align: center;
}

.embacpi__result-kicker {
  margin-bottom: 0.2rem;
  color: var(--embacpi-green-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.embacpi__result-number {
  margin-bottom: 0.35rem;
  overflow-wrap: anywhere;
  color: var(--embacpi-ink);
  font-size: clamp(2.5rem, 7vw, 4.8rem);
  font-weight: 850;
  letter-spacing: -0.055em;
  line-height: 1.05;
}

.embacpi__result-sentence {
  max-width: 720px;
  margin: 0 auto;
  color: var(--embacpi-muted);
  font-size: 0.95rem;
}

.embacpi__metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid rgba(8, 120, 94, 0.16);
  background: rgba(255, 255, 255, 0.72);
}

.embacpi__metrics > div {
  min-width: 0;
  padding: 1rem;
  text-align: center;
}

.embacpi__metrics > div + div {
  border-left: 1px solid rgba(8, 120, 94, 0.14);
}

.embacpi__metrics span {
  display: block;
  margin-bottom: 0.12rem;
  color: var(--embacpi-muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

.embacpi__metrics strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--embacpi-ink);
  font-size: 1.03rem;
}

.embacpi__result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid rgba(8, 120, 94, 0.13);
  background: rgba(255, 255, 255, 0.46);
}

.embacpi__action-status {
  min-width: 100px;
  color: var(--embacpi-green-dark);
  font-size: 0.76rem;
  font-weight: 700;
}

.embacpi__visuals {
  margin-top: 1.35rem;
}

.embacpi__chart-card {
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--embacpi-border);
  border-radius: 18px;
  background: var(--embacpi-white);
}

.embacpi__section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.embacpi__section-heading h3 {
  margin-bottom: 0;
  font-size: 1.25rem;
}

.embacpi__section-heading > span {
  flex: 0 0 auto;
  color: var(--embacpi-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.embacpi__chart {
  min-height: 260px;
  overflow: hidden;
  border: 1px solid #e1e8ee;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f9fb 100%);
}

.embacpi__chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.embacpi__grid-line {
  stroke: #dce5ec;
  stroke-width: 1;
}

.embacpi__axis-label {
  fill: #657587;
  font-family: inherit;
  font-size: 12px;
}

.embacpi__chart-area {
  fill: rgba(8, 120, 94, 0.10);
}

.embacpi__chart-line {
  fill: none;
  stroke: var(--embacpi-green);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.embacpi__chart-point {
  fill: var(--embacpi-white);
  stroke: var(--embacpi-green-dark);
  stroke-width: 3;
}

.embacpi__chart-empty {
  display: grid;
  min-height: 258px;
  margin: 0;
  place-items: center;
  color: var(--embacpi-muted);
}

.embacpi__chart-note {
  margin: 0.55rem 0 0;
  color: var(--embacpi-muted);
  font-size: 0.74rem;
}

.embacpi__table-details {
  margin-top: 0.8rem;
  border-top: 1px solid var(--embacpi-border);
}

.embacpi__table-details summary {
  padding: 0.85rem 0 0;
  color: var(--embacpi-green-dark);
  font-weight: 750;
  cursor: pointer;
}

.embacpi__table-wrap {
  max-height: 480px;
  margin-top: 0.75rem;
  overflow: auto;
  border: 1px solid var(--embacpi-border);
  border-radius: 10px;
}

.embacpi table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.embacpi th,
.embacpi td {
  padding: 0.62rem 0.75rem;
  border-bottom: 1px solid #e5ebf0;
  text-align: right;
  white-space: nowrap;
}

.embacpi th:first-child,
.embacpi td:first-child {
  text-align: left;
}

.embacpi thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #35475a;
  background: #eef3f7;
  font-size: 0.74rem;
  text-transform: uppercase;
}

.embacpi tbody tr:nth-child(even) {
  background: #f8fafc;
}

.embacpi__tool-intro {
  max-width: 760px;
  margin-bottom: 1rem;
}

.embacpi__tool-intro h3 {
  margin-bottom: 0.35rem;
  font-size: 1.45rem;
}

.embacpi__tool-intro p {
  margin-bottom: 0;
  color: var(--embacpi-muted);
}

.embacpi__form--salary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.embacpi__form--salary .embacpi__field:nth-child(2),
.embacpi__form--salary .embacpi__field:nth-child(3) {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 0.45rem;
}

.embacpi__form--salary .embacpi__field:nth-child(2) > label:first-child,
.embacpi__form--salary .embacpi__field:nth-child(3) > label:first-child {
  grid-column: 1 / -1;
}

.embacpi__form--future {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.embacpi__results--compact {
  margin-top: 1.25rem;
}

.embacpi__results--compact .embacpi__metrics {
  grid-template-columns: repeat(3, 1fr);
}

.embacpi__method-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--embacpi-border);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  color: var(--embacpi-muted);
  background: #f4f7f9;
  font-size: 0.78rem;
}

.embacpi__method-strip strong {
  color: var(--embacpi-ink);
}

.embacpi__method-strip a,
.embacpi__guide a {
  color: var(--embacpi-blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.embacpi__guide {
  max-width: 860px;
  margin: clamp(2.5rem, 7vw, 5rem) auto 0;
  color: #27384a;
}

.embacpi__guide h2 {
  margin: 2.3rem 0 0.75rem;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
}

.embacpi__guide h3 {
  margin-bottom: 0.45rem;
  font-size: 1.12rem;
}

.embacpi__guide p,
.embacpi__guide li {
  color: #405165;
}

.embacpi__guide li + li {
  margin-top: 0.42rem;
}

.embacpi__answer-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.embacpi__answer-cards > div {
  padding: 1.15rem;
  border: 1px solid #cde3db;
  border-radius: 14px;
  background: var(--embacpi-green-soft);
}

.embacpi__answer-cards p {
  margin-bottom: 0;
  font-size: 0.91rem;
}

.embacpi__faq {
  border-top: 1px solid var(--embacpi-border);
}

.embacpi__faq details {
  border-bottom: 1px solid var(--embacpi-border);
}

.embacpi__faq summary {
  padding: 1rem 2rem 1rem 0;
  color: var(--embacpi-ink);
  font-weight: 750;
  cursor: pointer;
}

.embacpi__faq p {
  padding: 0 0 1rem;
  margin-bottom: 0;
}

.embacpi__sources {
  margin-top: 1.5rem;
  padding: 1rem;
  border-left: 4px solid var(--embacpi-green);
  background: var(--embacpi-soft);
  font-size: 0.88rem;
}

.embacpi__noscript {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #e4b84c;
  border-radius: 10px;
  background: #fff9e8;
}

.embacpi__sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 900px) {
  .embacpi__hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .embacpi__status {
    min-width: min(100%, 320px);
  }

  .embacpi__form[data-form="dollar"] {
    grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
  }

  .embacpi__form[data-form="dollar"] .embacpi__field--amount {
    grid-column: 1 / -1;
  }

  .embacpi__form[data-form="dollar"] .embacpi__date-group--from {
    grid-column: 1;
    grid-row: 2;
  }

  .embacpi__form[data-form="dollar"] .embacpi__swap {
    grid-column: 2;
    grid-row: 2;
  }

  .embacpi__form[data-form="dollar"] .embacpi__date-group--to {
    grid-column: 3;
    grid-row: 2;
  }

  .embacpi__form--salary,
  .embacpi__form--future {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .embacpi__form--salary .embacpi__field--amount {
    grid-column: auto;
  }
}

@media (max-width: 680px) {
  .embacpi {
    margin: 1rem auto;
    font-size: 15px;
  }

  .embacpi__hero {
    border-radius: 18px 18px 0 0;
  }

  .embacpi__tabs {
    overflow-x: auto;
  }

  .embacpi__tab {
    flex: 0 0 auto;
    min-width: 145px;
  }

  .embacpi__form,
  .embacpi__form--salary,
  .embacpi__form--future {
    grid-template-columns: minmax(0, 1fr);
    padding: 1rem;
  }

  .embacpi__field--amount,
  .embacpi__form[data-form="dollar"] .embacpi__date-group--from,
  .embacpi__form[data-form="dollar"] .embacpi__date-group--to,
  .embacpi__form[data-form="dollar"] .embacpi__swap,
  .embacpi__primary,
  .embacpi__error {
    grid-column: 1;
    grid-row: auto;
  }

  .embacpi__swap {
    position: static;
    justify-self: center;
    margin: -0.35rem 0;
    transform: rotate(90deg);
  }

  .embacpi__swap:hover {
    transform: rotate(270deg);
  }

  .embacpi__metrics,
  .embacpi__results--compact .embacpi__metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .embacpi__metrics > div:nth-child(odd) {
    border-left: 0;
  }

  .embacpi__metrics > div:nth-child(n + 3) {
    border-top: 1px solid rgba(8, 120, 94, 0.14);
  }

  .embacpi__results--compact .embacpi__metrics > div:last-child {
    grid-column: 1 / -1;
    border-top: 1px solid rgba(8, 120, 94, 0.14);
    border-left: 0;
  }

  .embacpi__result-number {
    font-size: clamp(2.3rem, 15vw, 3.8rem);
  }

  .embacpi__chart {
    min-height: 190px;
    overflow-x: auto;
  }

  .embacpi__chart svg {
    min-width: 650px;
  }

  .embacpi__answer-cards {
    grid-template-columns: 1fr;
  }

  .embacpi__method-strip {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .embacpi__date-group {
    grid-template-columns: minmax(68px, 0.72fr) minmax(0, 1.28fr);
  }

  .embacpi__metrics,
  .embacpi__results--compact .embacpi__metrics {
    grid-template-columns: 1fr;
  }

  .embacpi__metrics > div + div,
  .embacpi__metrics > div:nth-child(n + 3),
  .embacpi__results--compact .embacpi__metrics > div:last-child {
    grid-column: auto;
    border-top: 1px solid rgba(8, 120, 94, 0.14);
    border-left: 0;
  }
}

/* Component-width breakpoints keep the layout correct inside themes with sidebars. */
@container embacpi-panel (max-width: 1040px) {
  .embacpi__form[data-form="dollar"] {
    grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
  }

  .embacpi__form[data-form="dollar"] .embacpi__field--amount {
    grid-column: 1 / -1;
  }

  .embacpi__form[data-form="dollar"] .embacpi__date-group--from {
    grid-column: 1;
    grid-row: 2;
  }

  .embacpi__form[data-form="dollar"] .embacpi__swap {
    grid-column: 2;
    grid-row: 2;
  }

  .embacpi__form[data-form="dollar"] .embacpi__date-group--to {
    grid-column: 3;
    grid-row: 2;
  }
}

@container embacpi-panel (max-width: 900px) {
  .embacpi__form--salary,
  .embacpi__form--future {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .embacpi__form--salary .embacpi__field--amount {
    grid-column: auto;
  }
}

@container embacpi-root (max-width: 900px) {
  .embacpi__hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .embacpi__status {
    min-width: min(100%, 320px);
  }

  .embacpi__tabs {
    overflow-x: auto;
  }

  .embacpi__tab {
    flex: 0 0 auto;
    min-width: 145px;
  }
}

@container embacpi-panel (max-width: 720px) {
  .embacpi__form,
  .embacpi__form--salary,
  .embacpi__form--future {
    grid-template-columns: minmax(0, 1fr);
    padding: 1rem;
  }

  .embacpi__field--amount,
  .embacpi__form[data-form="dollar"] .embacpi__date-group--from,
  .embacpi__form[data-form="dollar"] .embacpi__date-group--to,
  .embacpi__form[data-form="dollar"] .embacpi__swap,
  .embacpi__primary,
  .embacpi__error {
    grid-column: 1;
    grid-row: auto;
  }

  .embacpi__swap {
    position: static;
    justify-self: center;
    margin: -0.35rem 0;
    transform: rotate(90deg);
  }

  .embacpi__swap:hover {
    transform: rotate(270deg);
  }
}

@container embacpi-root (max-width: 680px) {
  .embacpi__hero {
    border-radius: 18px 18px 0 0;
  }

  .embacpi__metrics,
  .embacpi__results--compact .embacpi__metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .embacpi__metrics > div:nth-child(odd) {
    border-left: 0;
  }

  .embacpi__metrics > div:nth-child(n + 3) {
    border-top: 1px solid rgba(8, 120, 94, 0.14);
  }

  .embacpi__results--compact .embacpi__metrics > div:last-child {
    grid-column: 1 / -1;
    border-top: 1px solid rgba(8, 120, 94, 0.14);
    border-left: 0;
  }

  .embacpi__result-number {
    font-size: clamp(2.3rem, 15vw, 3.8rem);
  }

  .embacpi__chart {
    min-height: 190px;
    overflow-x: auto;
  }

  .embacpi__chart svg {
    min-width: 650px;
  }

  .embacpi__answer-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .embacpi__method-strip {
    align-items: flex-start;
    flex-direction: column;
  }
}

@container embacpi-root (max-width: 420px) {
  .embacpi__date-group {
    grid-template-columns: minmax(68px, 0.72fr) minmax(0, 1.28fr);
  }

  .embacpi__metrics,
  .embacpi__results--compact .embacpi__metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .embacpi__metrics > div + div,
  .embacpi__metrics > div:nth-child(n + 3),
  .embacpi__results--compact .embacpi__metrics > div:last-child {
    grid-column: auto;
    border-top: 1px solid rgba(8, 120, 94, 0.14);
    border-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .embacpi *,
  .embacpi *::before,
  .embacpi *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  .embacpi__tabs,
  .embacpi__form,
  .embacpi__presets,
  .embacpi__result-actions,
  .embacpi__method-strip,
  .embacpi__guide {
    display: none !important;
  }

  .embacpi,
  .embacpi__panel,
  .embacpi__results,
  .embacpi__chart-card {
    max-width: none;
    border-color: #999;
    box-shadow: none;
  }

  .embacpi__hero {
    border-radius: 0;
    background: #fff;
  }
}
