:root {
    --portal-purple: #6420b9;
    --portal-yellow: #ffbd00;
    --portal-orange: #ef5a00;
    --portal-blue: #123f91;
    --portal-green: #079b38;
    --portal-black: #050505;
    --portal-border: #e1e1e5;
    --portal-text: #111216;
    --portal-muted: #5f626b;
}

body {
    color: var(--portal-text);
    background: #fafafa;
}

.portal-shell {
    min-width: 320px;
    min-height: 100vh;
    border-top: 8px solid var(--portal-yellow);
    background:
        linear-gradient(180deg, rgba(248, 248, 250, 0.2), #fff 24rem),
        #fff;
}

.portal-header {
    color: white;
    background: var(--portal-black);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.24);
}

.portal-header-inner {
    width: min(1488px, calc(100% - 48px));
    min-height: 92px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 24px;
}

.portal-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 1.68rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    text-decoration: none;
}

.portal-brand > span > strong {
    font-size: 2.45rem;
    font-weight: 850;
}

.portal-brand > span > strong > span {
    color: var(--portal-yellow);
}

.brand-shield {
    width: 51px;
    height: 61px;
    overflow: visible;
    fill: none;
    stroke: var(--portal-yellow);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3.5;
}

.brand-shield path:first-child {
    fill: rgba(255, 189, 0, 0.08);
    stroke-width: 4.5;
}

.brand-shield path:not(:first-child),
.brand-shield circle {
    stroke: white;
    stroke-width: 2.5;
}

.portal-navigation {
    min-width: 0;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
}

.portal-navigation a {
    min-width: max-content;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-bottom: 4px solid transparent;
    color: #f7f7f7;
    font-size: 0.93rem;
    font-weight: 700;
    text-decoration: none;
}

.portal-navigation a > span {
    font-size: 1.55rem;
    font-weight: 400;
}

.portal-navigation a.active,
.portal-navigation a:hover {
    border-bottom-color: #8b2be2;
    color: #a63df2;
}

.portal-account {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 25px;
    white-space: nowrap;
}

.system-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
}

.system-status i {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #0bc83f;
    box-shadow: 0 0 10px rgba(11, 200, 63, 0.35);
}

.portal-account button {
    min-height: 50px;
    padding: 0 18px;
    border: 1px solid #3b3b42;
    border-radius: 8px;
    color: white;
    background: #0c0c0e;
    font-weight: 750;
}

.portal-main {
    width: min(1488px, calc(100% - 48px));
    min-height: calc(100vh - 160px);
    margin: 0 auto;
    padding: 22px 0 18px;
}

.dashboard-simulation-form {
    display: grid;
    gap: 12px;
}

.data-mode-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px 20px;
    border: 1px solid var(--portal-border);
    border-radius: 10px;
    background: #f8f6fc;
}

.data-mode-description { min-width: 0; }
.data-mode-description strong { font-size: 1rem; }
.data-mode-description p {
    margin: 5px 0 0;
    color: var(--portal-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.data-mode-switch {
    display: flex;
    flex-shrink: 0;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--portal-border);
    border-radius: 9px;
    background: #fff;
}

.data-mode-switch a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 16px;
    border-radius: 6px;
    color: var(--portal-text);
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
}

.data-mode-switch a.selected { color: #fff; background: var(--portal-purple); }
.data-mode-switch a:not(.selected):hover { background: #f0e9fa; }
.data-mode-switch a:focus-visible { outline: 3px solid var(--portal-blue); outline-offset: 3px; }

@media (max-width: 620px) {
    .data-mode-bar { align-items: stretch; flex-direction: column; padding: 14px; }
    .data-mode-switch a { flex: 1; padding-inline: 10px; }
}

.dashboard-card-grid {
    display: grid;
    grid-template-columns: 370px repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.connections-card,
.package-card,
.tier-structure,
.totals-card,
.cumulative-kickback,
.simulation-disclaimer,
.portal-error {
    border: 1px solid var(--portal-border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 9px rgba(30, 31, 38, 0.035);
}

.connections-card,
.package-card {
    min-width: 0;
    min-height: 607px;
    padding: 21px 20px 12px;
}

.card-title-row,
.package-heading,
.package-heading > div,
.month-control,
.sold-overview,
.package-stat,
.package-kickback,
.kickback-summary,
.tier-title,
.tier-definition,
.totals-card,
.total-kickback,
.cumulative-kickback,
.simulation-disclaimer {
    display: flex;
    align-items: center;
}

.card-title-row {
    gap: 15px;
}

.card-title-row h1,
.package-heading h2 {
    margin: 0;
    color: #0b0b0d;
    font-size: 1.33rem;
    letter-spacing: -0.025em;
}

.connections-icon {
    position: relative;
    width: 35px;
    height: 35px;
}

.connections-icon::before,
.connections-icon::after {
    content: "";
    position: absolute;
    border-top: 2px solid var(--portal-purple);
    transform-origin: left;
}

.connections-icon::before {
    width: 22px;
    left: 7px;
    top: 18px;
    transform: rotate(-59deg);
}

.connections-icon::after {
    width: 22px;
    left: 16px;
    top: 10px;
    transform: rotate(59deg);
}

.connections-icon i {
    position: absolute;
    z-index: 1;
    width: 10px;
    height: 10px;
    border: 2px solid var(--portal-purple);
    border-radius: 50%;
    background: white;
}

.connections-icon i:nth-child(1) { left: 13px; top: 0; }
.connections-icon i:nth-child(2) { left: 0; bottom: 2px; }
.connections-icon i:nth-child(3) { right: 0; bottom: 2px; }

.month-control {
    gap: 5px;
    margin-top: 15px;
    font-size: 0.88rem;
}

.month-control strong {
    font-weight: 500;
}

.calendar-glyph {
    margin-left: 4px;
    font-size: 1rem;
}

.sold-overview {
    align-items: flex-end;
    justify-content: space-between;
    margin-top: 10px;
}

.sold-overview > div > span,
.sold-overview > div > small,
.sold-overview strong,
.sold-overview a small {
    display: block;
}

.sold-overview > div > span {
    font-size: 0.83rem;
    font-weight: 800;
}

.sold-overview strong {
    margin: 4px 0 2px;
    color: var(--portal-purple);
    font-size: 2.7rem;
    line-height: 1;
    letter-spacing: -0.045em;
}

.sold-overview > div > small {
    font-size: 0.8rem;
}

.sold-overview a {
    color: var(--portal-text);
    text-align: right;
    text-decoration: none;
}

.trend-glyph {
    width: 63px;
    height: 57px;
    margin: 0 0 11px auto;
    display: grid;
    place-items: center;
    border: 1px solid #d8d9de;
    border-radius: 7px;
    font-size: 2.4rem;
    font-weight: 800;
}

.sold-overview a small {
    font-size: 0.72rem;
}

.card-divider {
    margin: 18px 0 15px;
    border-top: 1px solid var(--portal-border);
}

.connections-card > h2 {
    margin: 0;
    font-size: 0.84rem;
}

.distribution-block {
    min-height: 182px;
    display: grid;
    grid-template-columns: 180px 1fr;
    align-items: center;
    gap: 17px;
}

.donut {
    width: 172px;
    height: 172px;
    display: grid;
    place-items: center;
    border-radius: 50%;
}

.donut svg {
    grid-area: 1 / 1;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.donut circle {
    fill: none;
    stroke-width: 6;
}

.donut-track {
    stroke: #e5e5e8;
}

.donut-segment {
    stroke: var(--accent);
}

.donut > div {
    z-index: 1;
    grid-area: 1 / 1;
    text-align: center;
}

.donut strong,
.donut span {
    display: block;
}

.donut strong {
    font-size: 2rem;
    letter-spacing: -0.04em;
}

.donut span {
    margin-top: 2px;
    font-size: 0.77rem;
    font-weight: 700;
}

.distribution-legend {
    display: grid;
    gap: 13px;
}

.distribution-legend > div {
    display: grid;
    grid-template-columns: 14px 1fr;
    gap: 11px;
    align-items: start;
}

.legend-dot {
    width: 14px;
    height: 14px;
    margin-top: 3px;
    border-radius: 50%;
    background: var(--accent);
}

.legend-dot.package-two,
.donut-segment.package-two {
    --accent: #ffb600;
}

.legend-dot.package-three,
.donut-segment.package-three {
    --accent: #292a2e;
}

.distribution-legend strong,
.distribution-legend small {
    display: block;
    font-size: 0.79rem;
}

.distribution-legend small {
    margin-top: 2px;
    font-weight: 500;
}

.package-one { --accent: var(--portal-purple); --tint: #f4edfb; --soft-line: #d8c5ed; }
.package-two { --accent: var(--portal-orange); --tint: #fff5e8; --soft-line: #f2d5ae; }
.package-three { --accent: var(--portal-blue); --tint: #edf3fc; --soft-line: #c9d7eb; }
.package-default { --accent: #444; --tint: #f3f3f3; --soft-line: #ddd; }

.kickback-summary {
    align-items: flex-start;
    gap: 11px;
    margin-top: 3px;
    padding: 12px 13px;
    border: 1px solid #d8c5ed;
    border-radius: 7px;
    background: #f7f1fc;
}

.percent-icon,
.euro-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-weight: 850;
}

.percent-icon {
    width: 35px;
    height: 35px;
    color: white;
    background: var(--portal-purple);
    font-size: 1.15rem;
}

.kickback-summary > div {
    flex: 1;
}

.kickback-summary > div > strong,
.kickback-summary > div > span,
.kickback-summary > div > small {
    display: block;
}

.kickback-summary > div > strong {
    margin-bottom: 4px;
    font-size: 0.78rem;
}

.kickback-summary > div > span {
    position: relative;
    padding-right: 46px;
    font-size: 0.7rem;
    line-height: 1.75;
}

.kickback-summary > div > span b {
    position: absolute;
    right: 0;
    color: var(--portal-purple);
    font-size: 1.05rem;
}

.kickback-summary > div > small {
    margin-top: 3px;
    font-size: 0.67rem;
}

.outline-action {
    width: 100%;
    min-height: 44px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    color: var(--accent);
    background: white;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 800;
    text-decoration: none;
}

.outline-action span {
    position: absolute;
    margin-left: min(250px, 20vw);
    font-size: 1.45rem;
}

.outline-action:hover {
    color: white;
    background: var(--accent);
}

.outline-action.purple {
    --accent: var(--portal-purple);
}

.package-card {
    display: flex;
    flex-direction: column;
    background: linear-gradient(145deg, var(--tint), #fff 43%);
}

.package-heading {
    justify-content: space-between;
}

.package-heading > div {
    gap: 12px;
}

.package-shield {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: white;
    background: var(--accent);
}

.package-shield svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.active-badge {
    padding: 10px 12px;
    border-radius: 7px;
    color: var(--portal-green);
    background: white;
    font-size: 0.74rem;
    font-weight: 800;
}

.package-price {
    padding: 22px 0 21px;
    text-align: center;
}

.package-price span,
.package-price strong {
    display: block;
}

.package-price span {
    font-size: 0.84rem;
}

.package-price strong {
    margin-top: 10px;
    color: var(--accent);
    font-size: 2.8rem;
    line-height: 1;
    letter-spacing: -0.035em;
}

.package-stat {
    min-height: 51px;
    justify-content: space-between;
    gap: 15px;
    border-top: 1px solid var(--portal-border);
    font-size: 0.75rem;
}

.package-stat > span {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.package-stat i {
    min-width: 20px;
    color: #050505;
    font-size: 1.15rem;
    font-style: normal;
    text-align: center;
}

.package-stat strong,
.package-stat input {
    font-size: 0.88rem;
    font-weight: 850;
}

.package-stat input {
    width: 88px;
    padding: 5px 7px;
    border: 1px solid var(--soft-line);
    border-radius: 6px;
    color: var(--accent);
    background: white;
    text-align: right;
}

.package-stat .development {
    color: var(--accent);
}

.revenue-stat {
    min-height: 65px;
}

.revenue-stat > strong {
    text-align: right;
}

.revenue-stat small,
.package-kickback strong small {
    display: block;
    margin-top: 3px;
    color: var(--portal-text);
    font-size: 0.65rem;
    font-weight: 500;
}

.package-kickback {
    gap: 10px;
    margin-top: 8px;
    padding: 13px 12px;
    border: 1px solid var(--soft-line);
    border-radius: 7px;
    background: var(--tint);
    font-size: 0.74rem;
}

.euro-icon {
    width: 38px;
    height: 38px;
    border: 1px solid var(--soft-line);
    color: var(--accent);
    background: white;
    font-size: 1.35rem;
}

.package-kickback > strong {
    margin-left: auto;
    color: var(--accent);
    font-size: 1.27rem;
    text-align: right;
}

.package-card > .outline-action {
    margin-top: auto;
}

.tier-structure {
    min-height: 112px;
    padding: 10px 20px 12px;
    display: grid;
    grid-template-columns: 300px 1fr 1fr;
    grid-template-rows: 64px 25px;
    column-gap: 18px;
    overflow: hidden;
}

.tier-title {
    align-self: center;
    gap: 14px;
}

.tier-title span {
    color: #2f2e3a;
    font-size: 2rem;
}

.tier-title h2 {
    font-size: 0.95rem;
}

.tier-definition {
    align-self: stretch;
    justify-content: space-between;
    gap: 18px;
    padding: 9px 22px;
    border-radius: 8px;
}

.tier-definition > span > strong,
.tier-definition > span > small {
    display: block;
}

.tier-definition > span > strong {
    margin-bottom: 2px;
    font-size: 0.93rem;
}

.tier-definition > span > small,
.tier-definition > small {
    color: var(--portal-text);
    font-size: 0.64rem;
    line-height: 1.25;
}

.tier-definition > b {
    margin-left: auto;
    font-size: 2.65rem;
    line-height: 1;
}

.tier-one {
    color: var(--portal-purple);
    background: #f2eafb;
}

.tier-two {
    color: #f07b00;
    background: #fff4dd;
}

.tier-ruler {
    grid-column: 2 / 4;
    display: grid;
    grid-template-columns: auto 1fr auto 1fr auto;
    align-items: center;
    gap: 10px;
    font-size: 0.68rem;
}

.tier-ruler i {
    height: 7px;
    border-radius: 99px;
}

.tier-line-one { background: linear-gradient(90deg, #5d159f, #7d1bd3); }
.tier-line-two { background: linear-gradient(90deg, #f3a300, #ffc000); }

.totals-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 12px;
}

.totals-card,
.cumulative-kickback {
    min-height: 90px;
    padding: 13px 20px;
}

.gift-icon {
    margin-right: 18px;
    font-size: 2.4rem;
}

.totals-card > div > span,
.total-kickback > div > span {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
}

.totals-card > div > strong,
.total-kickback > div > strong {
    display: block;
    margin-top: 5px;
    font-size: 1.55rem;
}

.totals-card strong small {
    font-size: 0.67rem;
    font-weight: 500;
}

.total-kickback {
    align-self: stretch;
    gap: 14px;
    margin-left: auto;
    padding-left: 34px;
    border-left: 1px solid var(--portal-border);
}

.total-kickback .euro-icon,
.cumulative-kickback .euro-icon {
    width: 51px;
    height: 51px;
    color: var(--portal-purple);
    border-color: #cdaeed;
    font-size: 1.8rem;
}

.total-kickback > div > strong {
    color: var(--portal-purple);
}

.cumulative-kickback {
    gap: 17px;
    border-color: #eadff3;
    background: linear-gradient(100deg, #fff, #f1e8f7);
}

.cumulative-kickback h2 {
    margin: 0;
    font-size: 0.85rem;
}

.cumulative-kickback strong {
    display: block;
    margin-top: 5px;
    color: var(--portal-purple);
    font-size: 1.55rem;
}

.cumulative-kickback p {
    margin: 5px 0 0;
    font-size: 0.75rem;
    line-height: 1.45;
}

.cumulative-kickback small {
    font-size: 0.67rem;
    font-weight: 500;
}

.simulation-disclaimer {
    justify-content: center;
    gap: 16px;
    padding: 10px 18px;
    color: #5b4300;
    border-color: #f0d57a;
    background: #fff9df;
    font-size: 0.69rem;
}

.simulation-disclaimer strong {
    white-space: nowrap;
}

.local-simulation-tool {
    position: fixed;
    right: 22px;
    bottom: 70px;
    z-index: 30;
    color: var(--portal-text);
}

.local-simulation-tool > summary {
    width: max-content;
    min-height: 36px;
    margin-left: auto;
    padding: 0 13px;
    display: flex;
    align-items: center;
    gap: 7px;
    border: 1px solid #38383e;
    border-radius: 999px;
    color: white;
    background: var(--portal-black);
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 800;
    list-style: none;
    user-select: none;
}

.local-simulation-tool > summary::-webkit-details-marker {
    display: none;
}

.local-simulation-tool > summary > span {
    color: #b04bf4;
    font-size: 0.95rem;
}

.local-simulation-tool[open] > summary,
.local-simulation-tool > summary:hover {
    border-color: var(--portal-purple);
}

.local-simulation-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    width: min(590px, calc(100vw - 32px));
    max-height: calc(100dvh - 160px);
    overflow-y: auto;
    padding: 17px;
    border: 1px solid #d9c5ea;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 14px 38px rgba(16, 10, 23, 0.2);
}

.local-simulation-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.local-simulation-heading > div > span {
    display: block;
    color: var(--portal-purple);
    font-size: 0.62rem;
    font-weight: 850;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.local-simulation-heading h2 {
    margin: 2px 0 0;
    font-size: 1.02rem;
}

.local-only-badge {
    padding: 5px 7px;
    border-radius: 5px;
    color: #694800;
    background: #fff2c3;
    font-size: 0.56rem;
    font-weight: 800;
    white-space: nowrap;
}

.local-simulation-panel > p {
    margin: 11px 0 13px;
    color: #63636b;
    font-size: 0.68rem;
    line-height: 1.4;
}

.local-simulation-form,
.local-simulation-form label {
    display: grid;
    gap: 5px;
}

.local-simulation-form label > span {
    font-size: 0.64rem;
    font-weight: 800;
}

.local-simulation-form input {
    min-width: 0;
    height: 35px;
    padding: 5px 8px;
    border: 1px solid #d7d7de;
    border-radius: 6px;
    color: var(--portal-text);
    background: #fff;
    font: inherit;
    font-size: 0.75rem;
}

.local-simulation-form input:focus {
    border-color: var(--portal-purple);
    outline: 3px solid rgba(104, 22, 176, 0.12);
}

.local-package-inputs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.local-simulation-actions {
    margin-top: 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.local-simulation-actions a {
    color: #696970;
    font-size: 0.64rem;
}

.local-simulation-actions button {
    min-height: 34px;
    padding: 0 13px;
    border: 0;
    border-radius: 6px;
    color: white;
    background: var(--portal-purple);
    cursor: pointer;
    font-size: 0.69rem;
    font-weight: 800;
}

.local-simulation-panel > small {
    margin-top: 12px;
    padding-top: 10px;
    display: block;
    border-top: 1px solid var(--portal-border);
    color: #777780;
    font-size: 0.59rem;
    line-height: 1.45;
}

.portal-footer {
    min-height: 54px;
    padding: 0 max(24px, calc((100% - 1488px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-top: 3px solid var(--portal-yellow);
    color: white;
    background: var(--portal-black);
    font-size: 0.7rem;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
}

.footer-brand svg {
    width: 30px;
    height: 37px;
    fill: none;
    stroke: var(--portal-yellow);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.footer-brand svg path:not(:first-child),
.footer-brand svg circle {
    stroke: white;
}

.portal-error {
    padding: 72px 30px;
    text-align: center;
}

.portal-error p {
    color: var(--portal-purple);
    font-weight: 800;
    text-transform: uppercase;
}

.portal-error h1 {
    font-size: 1.5rem;
}

.portal-error a {
    display: inline-block;
    margin-top: 14px;
    padding: 11px 16px;
    border-radius: 7px;
    color: white;
    background: var(--portal-purple);
    text-decoration: none;
    font-weight: 750;
}

@media (max-width: 1320px) {
    .portal-header-inner {
        grid-template-columns: 265px 1fr auto;
    }

    .portal-brand > span > strong {
        font-size: 2rem;
    }

    .portal-brand {
        font-size: 1.35rem;
    }

    .portal-navigation a {
        min-width: auto;
        padding: 0 12px;
        font-size: 0.8rem;
    }

    .dashboard-card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .connections-card {
        grid-column: 1 / -1;
        min-height: 0;
    }

    .connections-card .distribution-block {
        grid-template-columns: 180px 1fr;
        max-width: 600px;
    }

    .tier-structure {
        grid-template-columns: 220px 1fr 1fr;
    }
}

@media (min-width: 1121px) and (max-width: 1450px) {
    .portal-header-inner {
        grid-template-columns: 1fr auto;
    }

    .portal-navigation {
        grid-column: 1 / -1;
        grid-row: 2;
        min-height: 52px;
        overflow-x: auto;
    }
}

@media (max-width: 1120px) {
    .portal-header-inner {
        width: min(100% - 28px, 1488px);
        grid-template-columns: 1fr auto;
    }

    .portal-navigation {
        grid-column: 1 / -1;
        grid-row: 2;
        min-height: 52px;
        overflow-x: auto;
    }

    .portal-account .system-status {
        display: none;
    }

    .portal-main {
        width: min(100% - 28px, 1488px);
    }

    .dashboard-card-grid {
        grid-template-columns: 1fr;
    }

    .connections-card {
        grid-column: auto;
    }

    .package-card {
        min-height: 570px;
    }

    .tier-structure {
        padding: 16px;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
    }

    .tier-title {
        grid-column: 1 / -1;
        padding: 5px 0 12px;
    }

    .tier-ruler {
        grid-column: 1 / -1;
    }

    .totals-row {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 981px) and (max-width: 1120px) {
    .dashboard-card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .connections-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .portal-shell {
        border-top-width: 5px;
    }

    .portal-header-inner {
        min-height: 76px;
        gap: 8px;
    }

    .portal-brand {
        gap: 7px;
        font-size: 1rem;
    }

    .portal-brand > span > strong {
        font-size: 1.45rem;
    }

    .brand-shield {
        width: 37px;
        height: 45px;
    }

    .portal-account button {
        min-height: 42px;
        padding: 0 12px;
        font-size: 0.72rem;
    }

    .portal-navigation a {
        padding: 0 10px;
        font-size: 0.72rem;
        white-space: nowrap;
    }

    .portal-main {
        padding-top: 14px;
    }

    .connections-card,
    .package-card {
        min-height: 0;
        padding: 18px 15px 12px;
    }

    .distribution-block {
        grid-template-columns: 145px 1fr;
        gap: 10px;
    }

    .donut {
        width: 140px;
        height: 140px;
    }

    .package-price strong {
        font-size: 2.35rem;
    }

    .tier-structure {
        grid-template-columns: 1fr;
    }

    .tier-title,
    .tier-ruler {
        grid-column: 1;
    }

    .tier-definition {
        min-height: 72px;
        padding: 10px 13px;
    }

    .tier-definition > b {
        font-size: 2rem;
    }

    .tier-definition > small {
        display: none;
    }

    .totals-card {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .total-kickback {
        width: 100%;
        margin-left: 0;
        padding: 14px 0 0;
        border-top: 1px solid var(--portal-border);
        border-left: 0;
    }

    .cumulative-kickback,
    .simulation-disclaimer {
        align-items: flex-start;
    }

    .simulation-disclaimer {
        flex-direction: column;
        gap: 4px;
    }

    .portal-footer {
        align-items: flex-start;
        flex-direction: column;
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .local-simulation-tool {
        right: 14px;
        bottom: 14px;
    }
}

/* Saved multi-month simulation and the shared monthly trend. */
.simulation-period-note { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 8px 12px; border-radius: 7px; background: #fff7d4; color: #594519; font-size: .76rem; }
.month-control { flex-wrap: wrap; }
.month-control select { min-width: 0; flex: 1; padding: 6px; border: 1px solid #ded6e7; border-radius: 5px; background: #fff; font: inherit; }
.month-control button { padding: 7px 9px; border: 0; border-radius: 5px; background: var(--portal-purple); color: #fff; cursor: pointer; font: inherit; }
.simulation-input-scroll { overflow-x: auto; }
.simulation-input-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.simulation-input-table th, .simulation-input-table td { padding: 7px 4px; text-align: left; border-bottom: 1px solid #eee8f3; }
.simulation-input-table th { font-size: .7rem; }
.simulation-input-table thead th { color: var(--portal-purple); }
.simulation-input-table th:first-child { width: 27%; white-space: normal; }
.simulation-input-table input { width: 100%; }
.local-simulation-actions > span { font-size: .68rem; color: #63636b; }
.local-simulation-panel .simulation-input-error { padding: 9px; background: #fff0ef; color: #941e19; border-radius: 5px; }
.simulation-trend { min-width: 0; border: 1px solid var(--portal-border); border-radius: 10px; background: #fff; scroll-margin-top: 15px; }
.simulation-trend > summary { padding: 17px 20px; cursor: pointer; color: var(--portal-purple); font-size: 1rem; font-weight: 800; }
.simulation-trend > summary span { margin-left: 15px; font-size: .76rem; font-weight: 500; color: #63636b; }
.trend-content { padding: 0 20px 18px; }
.trend-legend { display: flex; flex-wrap: wrap; gap: 24px; font-size: .8rem; }
.trend-legend span::before { content: ''; display: inline-block; width: 25px; margin: 0 8px 3px 0; border-top: 3px solid var(--portal-purple); }
.trend-legend .trend-new-key::before { width: 14px; height: 14px; margin-bottom: -2px; border: 0; background: #b85e00; }
.trend-chart-scroll, .trend-table-scroll { overflow-x: auto; }
.sales-trend-chart { display: block; min-width: 100%; height: 340px; }
.sales-trend-chart text { fill: #65616e; font-size: 13px; }
.trend-grid { stroke: #ebe7ef; stroke-width: 1; }
.trend-line { fill: none; stroke-width: 3; stroke-linejoin: round; }
.trend-active-line { stroke: var(--portal-purple); }
.trend-partial-line { stroke-dasharray: 7 5; }
.trend-new-bar { fill: #b85e00; }
.trend-active-point { fill: var(--portal-purple); }
.trend-selection { fill: #7834aa; fill-opacity: .08; }
.trend-hit-area { fill: transparent; }
.sales-trend-chart a:hover .trend-hit-area, .sales-trend-chart a:focus .trend-hit-area { stroke: var(--portal-purple); stroke-width: 2; }
.sales-trend-chart a[aria-current] .trend-month-label { fill: var(--portal-purple); font-weight: 800; }
.trend-period { margin: 0 0 14px; font-size: .84rem; color: #57515f; }
.trend-help, .trend-empty { font-size: .78rem; color: #57515f; }
.trend-current-month { display: block; font-weight: 400; color: #57515f; }
.trend-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.trend-table caption { padding: 8px 0; text-align: left; color: #63636b; font-size: .72rem; }
.trend-table td, .trend-table th { padding: 11px 12px; text-align: right; border-bottom: 1px solid #eee8f3; white-space: nowrap; }
.trend-table th:first-child { text-align: left; }
.trend-table a { color: var(--portal-purple); }
.trend-table .selected-month { background: #f6effc; }
.trend-assumption { margin: 14px 0 0; color: #63636b; font-size: .73rem; }
@media (max-width: 620px) {
    .simulation-trend > summary span { display: block; margin: 6px 0 0 17px; }
    .trend-content { padding: 0 12px 14px; }
    .local-simulation-panel { padding: 13px; max-height: calc(100dvh - 85px); }
    .simulation-input-table th { font-size: .63rem; }
    .simulation-input-table td { padding: 7px 2px; }
    .local-simulation-form input { padding: 5px; }
}
