.er-page {
    width: min(1180px, calc(100% - 32px));
    margin: 20px auto 48px;
}

.er-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 20px;
    align-items: end;
    margin-bottom: 20px;
}

.er-intro h1 {
    margin: 0 0 10px;
    font-family: "title_font";
    font-size: 36px;
    font-weight: 400;
    color: var(--text);
}

.er-intro p {
    max-width: 760px;
    margin: 0;
    line-height: 1.5;
}

.er-note {
    border-left: 4px solid var(--clhigh);
    padding: 10px 12px;
    background: var(--client);
    line-height: 1.35;
}

.er-download {
    margin-bottom: 20px;
}

.er-download-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 20px;
    align-items: center;
}

.er-download-main p,
.er-download-details p {
    margin: 10px 0 0;
    line-height: 1.45;
}

.er-download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid var(--outline);
    border-radius: 8px;
    background: var(--clhigh);
    color: var(--cross);
    text-decoration: none;
    white-space: nowrap;
}

.er-download-button:focus-visible,
.er-download-button:hover {
    filter: brightness(1.05);
}

.er-download-details {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 0.95fr) minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.er-download-details > div {
    border: 1px solid var(--outline);
    border-radius: 8px;
    padding: 12px;
    background: var(--bg);
}

.er-download code {
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
}

.er-hash-panel code {
    display: block;
    margin-top: 10px;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.er-workspace {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.er-panel,
.er-result,
.er-download,
.er-tier-guide {
    border: 1px solid var(--outline);
    background: var(--client);
    border-radius: 8px;
    padding: 16px;
    font-family: "base_font";
}

.er-panel {
    display: grid;
    gap: 14px;
}

.er-heading {
    font-family: "base_font";
    font-size: 22px;
    color: var(--text);
    border-bottom: 1px solid var(--outline);
    padding-bottom: 8px;
}

.er-subheading {
    margin-top: 18px;
    font-size: 18px;
}

.er-field {
    display: grid;
    gap: 6px;
}

.er-field span,
.er-mini-label,
.er-tier-kicker {
    font-size: 13px;
    opacity: 0.78;
    text-transform: uppercase;
}

.er-field select {
    width: 100%;
}

.er-result {
    min-height: 430px;
}

.er-tier-row {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    margin-top: 10px;
}

.er-tier-number {
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    border-radius: 8px;
    border: 1px solid var(--outline);
    background: var(--clhigh);
    color: var(--cross);
    font-size: 46px;
    line-height: 1;
}

.er-tier-label {
    font-family: "title_font";
    font-size: 34px;
    color: var(--text);
}

.er-tier-summary {
    max-width: 680px;
    line-height: 1.45;
}

.er-meter {
    height: 14px;
    margin: 18px 0;
    border: 1px solid var(--outline);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg);
}

.er-meter-fill {
    width: 0%;
    height: 100%;
    background: var(--clhigh);
    transition: width 160ms ease;
}

.er-callout {
    border-left: 4px solid var(--titlebar);
    background: var(--bg);
    padding: 12px;
    line-height: 1.45;
}

.er-result-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.er-result-grid > div {
    border: 1px solid var(--outline);
    border-radius: 8px;
    padding: 10px;
    background: var(--bg);
    min-height: 70px;
}

.er-mini-value {
    margin-top: 6px;
    line-height: 1.3;
}

.er-reasons {
    margin: 10px 0 0;
    padding-left: 22px;
    line-height: 1.55;
}

.er-save-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--outline);
}

.er-save-button {
    min-height: 38px;
    padding: 7px 12px;
    border: 1px solid var(--outline);
    border-radius: 8px;
    background: var(--clhigh);
    color: var(--cross);
    cursor: pointer;
    font-family: "base_font";
}

.er-save-button:hover {
    filter: brightness(1.05);
}

.er-save-status {
    color: var(--text);
    opacity: .82;
    font-size: 13px;
}

.er-tier-guide {
    margin-top: 20px;
}

.er-tier-cards {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.er-tier-card {
    border: 1px solid var(--outline);
    border-radius: 8px;
    padding: 12px;
    background: var(--bg);
}

.er-tier-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
}

.er-tier-card-number {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: var(--clhigh);
    color: var(--cross);
}

.er-tier-card p {
    margin: 10px 0 0;
    line-height: 1.4;
}

.er-centered-div {
  position: fixed;   /* Keeps it relative to the viewport */
  top: 50%;          /* Move top edge to center */
  left: 50%;         /* Move left edge to center */
  transform: translate(-40%, -50%); /* Pull it back by half its own width/height */
  z-index: 9999;     /* Ensures it stays on top of other elements */
  
  /* Optional styling */
  padding: 20px;
  background: var(--bg);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

@media (max-width: 900px) {
    .er-intro,
    .er-workspace,
    .er-download-main,
    .er-download-details,
    .er-result-grid,
    .er-tier-cards {
        grid-template-columns: 1fr;
    }

    .er-download-button {
        width: 100%;
    }
}
