/**
 * My Account.
 *
 * Scoping note, because getting this wrong cost two rounds. Nothing here hangs
 * off a wrapper of ours: Elementor's My Account widget builds its own layout
 * and never loads my-account.php, so a .ed-account wrapper is not guaranteed
 * to exist. Every rule is anchored on what WooCommerce itself always renders,
 * .woocommerce-MyAccount-navigation and .woocommerce-MyAccount-content, or on
 * our own component classes.
 *
 * Brand: #145AE2 primary, #124CBF hover, #192A3D ink, #F2F5F7 ground.
 */

:root {
    --ed-blue: #145ae2;
    --ed-blue-dark: #124cbf;
    --ed-ink: #192a3d;
    --ed-ground: #f2f5f7;
    --ed-surface: #fff;
    --ed-border: #e3e8ef;
    --ed-muted: #5c6b7f;
    --ed-danger: #b3261e;
    --ed-radius: 12px;
    --ed-shadow: 0 1px 2px rgba(13, 46, 110, .05), 0 12px 28px -20px rgba(13, 46, 110, .35);
}

/* ---------- Hero ---------- */

/* First thing in the content column. */
.ed-account__hero {
    margin: 0 0 28px;
}

.ed-account__title {
    margin: 0 0 6px;
    font-size: 2.05rem;
    line-height: 1.15;
    font-weight: 700;
    color: var(--ed-ink);
    letter-spacing: -0.02em;
}

.ed-account__subtitle {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--ed-muted);
}

/* ---------- Layout ---------- */

/*
 * Two columns, put on whatever element happens to be the parent.
 *
 * When our my-account.php runs that is .ed-account__layout. When the page is
 * assembled by a builder it is a container we have no name for, so the second
 * selector finds it by what it holds. It has to hold *both* columns: match on
 * the navigation alone and a layout that wraps the sidebar in a column element
 * of its own turns that wrapper into the grid, which is how the sidebar ended
 * up 280px wide with its own contents overflowing out of it. Without :has()
 * the columns stack, which reads fine.
 */
.ed-account__layout,
*:has(> .woocommerce-MyAccount-navigation):has(> .woocommerce-MyAccount-content) {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

/*
 * min-width is the important one. A grid or flex item defaults to min-width
 * auto, so it refuses to shrink below its widest unbreakable content - and the
 * customer's email address in the sidebar card is one long unbreakable word.
 * The sidebar then renders wider than its track and gets clipped, taking the
 * card's right edge and half the email with it.
 */
.woocommerce-MyAccount-navigation,
.woocommerce-MyAccount-content {
    float: none;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* ---------- Navigation ---------- */

.ed-nav__panel {
    background: var(--ed-surface);
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius);
    box-shadow: var(--ed-shadow);
    overflow: hidden;
}

.ed-nav__summary {
    display: block;
    padding: 20px 22px;
    cursor: default;
    list-style: none;
}

.ed-nav__summary::-webkit-details-marker { display: none; }
.ed-nav__summary::marker { content: ""; }

.ed-nav__identity {
    display: flex;
    align-items: center;
    gap: 13px;
}

.ed-nav__avatar {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #e7eefc;
    color: var(--ed-blue);
    font-size: .88rem;
    font-weight: 700;
}

.ed-nav__who {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.ed-nav__name {
    font-weight: 700;
    color: var(--ed-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ed-nav__email {
    font-size: .88rem;
    color: var(--ed-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ed-nav__toggle { display: none; }

.woocommerce-MyAccount-navigation .ed-nav__list {
    margin: 0;
    padding: 8px;
    list-style: none;
    border-top: 1px solid var(--ed-border);
}

.woocommerce-MyAccount-navigation .ed-nav__item {
    margin: 0;
    padding: 0;
    list-style: none;
    border: 0;
}

.woocommerce-MyAccount-navigation .ed-nav__link {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 11px 14px;
    border-radius: 8px;
    color: #1f2933;
    font-weight: 500;
    text-decoration: none;
    transition: background-color .12s ease, color .12s ease;
}

.woocommerce-MyAccount-navigation .ed-nav__link:hover {
    background: var(--ed-ground);
    color: var(--ed-ink);
}

.woocommerce-MyAccount-navigation .ed-nav__icon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    color: var(--ed-muted);
}

.woocommerce-MyAccount-navigation .ed-nav__label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.woocommerce-MyAccount-navigation .is-active > .ed-nav__link {
    background: var(--ed-blue);
    color: #fff;
    font-weight: 600;
}

/* The icon has to invert with the row, or it is grey on blue. */
.woocommerce-MyAccount-navigation .is-active > .ed-nav__link .ed-nav__icon {
    color: #fff;
}

/*
 * Blocksy paints its own icon per endpoint and falls back to a document for
 * anything it does not recognise, so its icon goes and ours takes over.
 */
.woocommerce-MyAccount-navigation li a::before,
.woocommerce-MyAccount-navigation li a::after {
    content: none !important;
    display: none !important;
    background-image: none !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
}

.woocommerce-MyAccount-navigation li a > svg:not(.ed-nav__icon),
.woocommerce-MyAccount-navigation li a > img,
.woocommerce-MyAccount-navigation li a > .ct-icon {
    display: none !important;
}

.woocommerce-MyAccount-navigation .ed-nav__item--logout {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--ed-border) !important;
}

.woocommerce-MyAccount-navigation .ed-nav__item--logout .ed-nav__link { color: var(--ed-muted); }

/* ---------- Status ---------- */

/*
 * Severity is carried by the left edge and the icon, not by a wash of colour
 * over the whole card. A page that turns red the moment anything is wrong
 * stops being read; a card that keeps the same shape as everything around it
 * and changes one edge stays legible next to the rest of the portal.
 */
.ed-status {
    display: grid;
    gap: 14px;
    margin-bottom: 24px;
}

.ed-status__card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    background: var(--ed-surface);
    border: 1px solid var(--ed-border);
    border-left: 4px solid var(--ed-blue);
    border-radius: var(--ed-radius);
    box-shadow: var(--ed-shadow);
}

.ed-status__icon {
    flex: 0 0 auto;
    display: inline-flex;
    margin-top: 1px;
    color: var(--ed-blue);
}

.ed-status__icon svg { width: 22px; height: 22px; display: block; }

.ed-status__body { flex: 1 1 auto; min-width: 0; }

.ed-status__title {
    display: block;
    margin-bottom: 3px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ed-ink);
}

.woocommerce-MyAccount-content .ed-status__text { margin: 0; color: #1f2933; }

.woocommerce-MyAccount-content .ed-status__meta {
    margin: 6px 0 0;
    font-size: .9rem;
    color: var(--ed-muted);
}

.ed-status__actions {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.woocommerce-MyAccount-content .ed-status__actions .button { white-space: nowrap; }

.woocommerce-MyAccount-content .ed-status__link {
    color: var(--ed-muted);
    font-size: .9rem;
    text-decoration: underline;
}

.woocommerce-MyAccount-content .ed-status__link:hover { color: var(--ed-ink); }

.ed-status__card--critical { border-left-color: var(--ed-danger); }
.ed-status__card--critical .ed-status__icon { color: var(--ed-danger); }

.ed-status__card--warning { border-left-color: #c98a00; }
.ed-status__card--warning .ed-status__icon { color: #c98a00; }

.ed-status__card--calm { border-left-color: #1e6b34; }
.ed-status__card--calm .ed-status__icon { color: #1e6b34; }

/* ---------- Content furniture ---------- */

.woocommerce-MyAccount-content { color: #1f2933; line-height: 1.6; }
.woocommerce-MyAccount-content > *:first-child { margin-top: 0; }

.ed-card {
    background: var(--ed-surface);
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius);
    box-shadow: var(--ed-shadow);
    padding: 26px 28px;
}

.ed-card + .ed-card,
.ed-card + .ed-grid,
.ed-grid + .ed-card { margin-top: 20px; }

.ed-card--flush { padding: 0; overflow: hidden; }

.ed-card__title {
    margin: 0 0 4px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--ed-ink);
}

.ed-card__title--inset { padding: 22px 26px 0; }

.ed-card__sub {
    margin: 0 0 20px;
    color: var(--ed-muted);
    font-size: .95rem;
}

.ed-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.ed-card__head .ed-card__title { margin: 0; }

.woocommerce-MyAccount-content .ed-card__head a {
    color: var(--ed-blue);
    font-weight: 600;
    text-decoration: none;
}

.ed-section-head { margin: 30px 0 16px; }
.ed-section-head .ed-card__title { margin-bottom: 4px; }
.ed-section-head .ed-card__sub { margin: 0; }

.ed-grid { display: grid; gap: 20px; margin-top: 20px; }
.ed-grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.ed-grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.ed-grid > .ed-card { margin-top: 0; }

.ed-empty { text-align: center; }
.ed-empty .ed-card__sub { margin-bottom: 20px; }

/* ---------- Connection card ---------- */

.ed-connection { padding: 0; overflow: hidden; }

.ed-connection__top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 26px 28px;
}

.ed-connection__plan {
    margin: 0 0 4px;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--ed-ink);
    letter-spacing: -0.01em;
}

.ed-connection__address { margin: 0; color: var(--ed-muted); }
.ed-connection__speed { text-align: right; }

.ed-connection__speed-label {
    display: block;
    font-size: .85rem;
    color: var(--ed-muted);
}

.ed-connection__speed-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ed-ink);
}

.ed-connection__strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 28px;
    border-top: 1px solid var(--ed-border);
    background: var(--ed-ground);
    color: var(--ed-muted);
}

.ed-connection__strip strong { color: var(--ed-ink); }

/* ---------- Quick actions ---------- */

.ed-quick__title {
    display: block;
    margin-bottom: 14px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ed-muted);
}

.woocommerce-MyAccount-content .ed-quick__list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.woocommerce-MyAccount-content .ed-quick__list li { margin: 0; padding: 0; list-style: none; }

/* Full width now, so the three actions sit side by side. */
.woocommerce-MyAccount-content .ed-quick__list--wide {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.woocommerce-MyAccount-content .ed-quick__list a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 16px;
    border: 1px solid var(--ed-border);
    border-radius: 8px;
    color: var(--ed-ink);
    font-weight: 600;
    text-decoration: none;
}

.woocommerce-MyAccount-content .ed-quick__list a:hover {
    border-color: var(--ed-blue);
    color: var(--ed-blue-dark);
}

.woocommerce-MyAccount-content .ed-quick__list .ed-icon {
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    color: var(--ed-blue);
}

/* ---------- Recent rows ---------- */

.woocommerce-MyAccount-content .ed-recent { margin: 0; padding: 0; list-style: none; }

.ed-recent__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--ed-border);
    list-style: none;
}

.ed-recent__row:last-child { border-bottom: 0; padding-bottom: 0; }
.ed-recent__name { flex: 1 1 auto; font-weight: 600; color: var(--ed-ink); }
.ed-recent__date { color: var(--ed-muted); }
.woocommerce-MyAccount-content .ed-recent__row .button { padding: 8px 16px; font-size: .9rem; }

/* ---------- Subscription ---------- */

.ed-sub__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.ed-sub__number { margin: 0 0 2px; font-size: 1.6rem; font-weight: 700; color: var(--ed-ink); }
.ed-sub__lede { margin: 0; color: var(--ed-muted); }
.ed-sub__actions { display: flex; align-items: center; gap: 14px; }
.woocommerce-MyAccount-content .ed-sub__actions .button { padding: 10px 20px; }

/* ---------- Fact tables ---------- */

.woocommerce-MyAccount-content .ed-facts {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.woocommerce-MyAccount-content .ed-facts thead th {
    padding: 14px 26px;
    background: var(--ed-ground);
    border-bottom: 1px solid var(--ed-border);
    text-align: left;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--ed-muted);
}

.woocommerce-MyAccount-content .ed-facts tbody th {
    width: 40%;
    padding: 15px 26px;
    text-align: left;
    font-weight: 400;
    color: var(--ed-muted);
    vertical-align: top;
}

.woocommerce-MyAccount-content .ed-facts tbody td {
    padding: 15px 26px;
    font-weight: 600;
    color: var(--ed-ink);
    vertical-align: top;
}

.woocommerce-MyAccount-content .ed-facts tbody tr { border-bottom: 1px solid var(--ed-border); }
.woocommerce-MyAccount-content .ed-facts tbody tr:last-child { border-bottom: 0; }

.ed-facts__aside { margin-left: 8px; font-weight: 400; color: var(--ed-muted); }

.woocommerce-MyAccount-content .ed-facts--money td:last-child,
.woocommerce-MyAccount-content .ed-facts--money th:last-child { text-align: right; }

.woocommerce-MyAccount-content .ed-facts__total td {
    border-top: 1px solid var(--ed-border);
    font-size: 1.05rem;
}

/* ---------- Add-ons ---------- */

.ed-addon { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.ed-addon__title { margin: 0; font-size: 1.15rem; font-weight: 700; color: var(--ed-ink); }
.ed-addon__body { margin: 0; color: var(--ed-muted); font-size: .95rem; }
.ed-addon__from { margin: 0; color: var(--ed-muted); font-size: .9rem; }
.woocommerce-MyAccount-content .ed-addon .button { margin-top: auto; padding: 10px 18px; font-size: .92rem; }

/* ---------- Help banner ---------- */

.ed-help {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 20px;
    padding: 26px 28px;
    border-radius: var(--ed-radius);
    background: #10233f;
    color: #fff;
}

.ed-help strong { display: block; margin-bottom: 4px; font-size: 1.15rem; }
.ed-help p { margin: 0; color: rgba(255, 255, 255, .75); }

.woocommerce-MyAccount-content .ed-help__button {
    flex: 0 0 auto;
    padding: 12px 22px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}

.woocommerce-MyAccount-content .ed-help__button:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* ---------- Forms ---------- */

.woocommerce-MyAccount-content form .form-row,
.woocommerce-MyAccount-content .woocommerce-form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 0 18px;
    padding: 0;
    width: auto;
    float: none;
}

.woocommerce-MyAccount-content form label {
    font-size: .92rem;
    font-weight: 600;
    color: var(--ed-ink);
}

.woocommerce-MyAccount-content form .input-text,
.woocommerce-MyAccount-content form input[type="text"],
.woocommerce-MyAccount-content form input[type="email"],
.woocommerce-MyAccount-content form input[type="tel"],
.woocommerce-MyAccount-content form input[type="password"],
.woocommerce-MyAccount-content form select,
.woocommerce-MyAccount-content form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--ed-border);
    border-radius: 8px;
    background: var(--ed-surface);
    font: inherit;
    font-size: 1rem;
    color: #1f2933;
    transition: border-color .12s ease, box-shadow .12s ease;
}

.woocommerce-MyAccount-content form .input-text:focus,
.woocommerce-MyAccount-content form input:focus,
.woocommerce-MyAccount-content form select:focus,
.woocommerce-MyAccount-content form textarea:focus {
    outline: none;
    border-color: var(--ed-blue);
    box-shadow: 0 0 0 3px rgba(20, 90, 226, .12);
}

.woocommerce-MyAccount-content form .description,
.woocommerce-MyAccount-content form em,
.woocommerce-MyAccount-content form small {
    font-size: .87rem;
    font-style: normal;
    color: var(--ed-muted);
}

/*
 * Account details is one card holding the whole form.
 *
 * It was a card per row, which is where the clipped-looking borders came from:
 * a fieldset draws its own border and WooCommerce's own first/last rows are
 * floated halves, so boxing every child produced borders that started and
 * stopped in the middle of nothing.
 */
.woocommerce-EditAccountForm {
    background: var(--ed-surface);
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius);
    box-shadow: var(--ed-shadow);
    padding: 28px 30px;
    margin: 0;
}

.woocommerce-EditAccountForm > fieldset {
    margin: 26px 0 0;
    padding: 26px 0 0;
    border: 0;
    border-top: 1px solid var(--ed-border);
}

.woocommerce-EditAccountForm legend {
    width: auto;
    margin: 0 0 4px;
    padding: 0;
    border: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--ed-ink);
}

.woocommerce-EditAccountForm > p:last-child,
.woocommerce-EditAccountForm > fieldset > p:last-child { margin-bottom: 0; }

/* The save button and its nonce sit in a bare <p>, which needs the gap back. */
.woocommerce-EditAccountForm > p:last-child { margin-top: 26px; }

/*
 * One checkbox row, whoever printed it. Ours sits directly beneath the one
 * WooCommerce Subscriptions adds, so both are keyed on WooCommerce's own
 * classes rather than styled apart.
 */
.woocommerce-MyAccount-content form .woocommerce-form__label-for-checkbox,
.woocommerce-MyAccount-content form label.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: .95rem;
    font-weight: 400;
    line-height: 1.5;
    color: #1f2933;
    cursor: pointer;
}

.woocommerce-MyAccount-content form .woocommerce-form__input-checkbox,
.woocommerce-MyAccount-content form label.checkbox input[type="checkbox"] {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin: 3px 0 0;
    accent-color: var(--ed-blue);
}

/* ---------- Buttons ---------- */

/*
 * a.button is spelled out alongside .button because that is how WooCommerce's
 * own stylesheet and every theme built on it write the rule; a bare class
 * loses the tie and the buttons come out looking like plain links.
 */
.woocommerce-MyAccount-content .button,
.woocommerce-MyAccount-content a.button,
.woocommerce-MyAccount-content button.button,
.woocommerce-MyAccount-content button[type="submit"],
.woocommerce-MyAccount-content input[type="submit"] {
    display: inline-block;
    width: auto;
    padding: 13px 26px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--ed-blue);
    color: #fff;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}

.woocommerce-MyAccount-content .button:hover,
.woocommerce-MyAccount-content a.button:hover,
.woocommerce-MyAccount-content button.button:hover,
.woocommerce-MyAccount-content button[type="submit"]:hover,
.woocommerce-MyAccount-content input[type="submit"]:hover {
    background: var(--ed-blue-dark);
    color: #fff;
}

/* Secondary: white with a hairline, for anything that is not the main action. */
.woocommerce-MyAccount-content a.button--ghost,
.woocommerce-MyAccount-content button.button--ghost,
.woocommerce-MyAccount-content button[type="submit"].button--ghost,
.woocommerce-MyAccount-content .button--ghost,
.woocommerce-MyAccount-content a.edit,
.woocommerce-MyAccount-content .woocommerce-Button--previous {
    background: var(--ed-surface);
    border: 1px solid var(--ed-border);
    color: var(--ed-ink);
    font-weight: 600;
}

.woocommerce-MyAccount-content .button--ghost:hover,
.woocommerce-MyAccount-content button[type="submit"].button--ghost:hover,
.woocommerce-MyAccount-content a.edit:hover {
    background: var(--ed-ground);
    border-color: #cfd8e3;
    color: var(--ed-ink);
}

/*
 * a.edit is WooCommerce's own class on the address links and carries no
 * .button, so it picks up none of the sizing above.
 */
.woocommerce-MyAccount-content a.edit {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 8px;
    line-height: 1.2;
    text-decoration: none;
}

/*
 * An icon sitting inside a button.
 *
 * display carries !important because WooCommerce and every theme built on it
 * write `a.button { display: inline-block }`, which ties with anything we can
 * write here and wins whenever their stylesheet loads after ours. Losing that
 * tie does not just misalign the icon, it stacks it above the label.
 */
.woocommerce-MyAccount-content a.button--icon,
.woocommerce-MyAccount-content button.button--icon,
.woocommerce-MyAccount-content .button--icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/*
 * Sized, and centred on the text rather than sat on its baseline. Left inline
 * on purpose: display:block here would put the icon on its own line in any
 * button whose flex display did not survive.
 */
.woocommerce-MyAccount-content .ed-icon {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    vertical-align: middle;
}

/*
 * Two links here are WooCommerce's own markup with no room for an icon in it:
 * Edit on the addresses and Add payment method. Their icons are masks on a
 * pseudo-element instead, which takes its colour from the link.
 *
 * Add payment method is found by where it points. It was addressed by position
 * before - a direct child of the content column on the payment methods screen
 * - and that never matched, because the builder puts a wrapper in between.
 * The href is the one thing about that link that cannot move.
 *
 * The pseudo-element is inline-block rather than a bare flex child: width and
 * height do nothing on a plain inline box, so a button whose flex display did
 * not survive would show no icon at all.
 */
.woocommerce-MyAccount-content a.edit::before,
.woocommerce-MyAccount-content a.button[href*="add-payment-method"]::before {
    content: "";
    display: inline-block;
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    vertical-align: middle;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.woocommerce-MyAccount-content a.edit::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4z'/%3E%3C/svg%3E");
}

.woocommerce-MyAccount-content a.button[href*="add-payment-method"] {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
}

.woocommerce-MyAccount-content a.button[href*="add-payment-method"]::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
}

/* ---------- Address ---------- */

.woocommerce-MyAccount-content .woocommerce-Addresses {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 0;
}

.woocommerce-MyAccount-content .woocommerce-Address {
    width: auto;
    float: none;
    padding: 26px 28px;
    background: var(--ed-surface);
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius);
    box-shadow: var(--ed-shadow);
}

.woocommerce-MyAccount-content .woocommerce-Address-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.woocommerce-MyAccount-content .woocommerce-Address-title h2,
.woocommerce-MyAccount-content .woocommerce-Address-title h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--ed-ink);
}

.woocommerce-MyAccount-content .woocommerce-Address address {
    font-style: normal;
    line-height: 1.7;
    color: #1f2933;
}

/* ---------- Tables: payment methods and documents ---------- */

/*
 * The element is in these selectors on purpose. Both tables also carry
 * shop_table, which themes style as `table.shop_table` - one class and one
 * element. Without the element here that rule wins on every property it sets.
 */
.woocommerce-MyAccount-content table.woocommerce-MyAccount-paymentMethods,
.woocommerce-MyAccount-content table.ed-isp-documents {
    width: 100%;
    margin: 0;
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius);
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    background: var(--ed-surface);
    box-shadow: var(--ed-shadow);
}

.woocommerce-MyAccount-content table.woocommerce-MyAccount-paymentMethods th,
.woocommerce-MyAccount-content table.ed-isp-documents th {
    padding: 14px 20px;
    background: var(--ed-ground);
    border-bottom: 1px solid var(--ed-border);
    text-align: left;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--ed-muted);
}

.woocommerce-MyAccount-content table.woocommerce-MyAccount-paymentMethods td,
.woocommerce-MyAccount-content table.ed-isp-documents td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--ed-border);
    vertical-align: middle;
}

.woocommerce-MyAccount-content table.woocommerce-MyAccount-paymentMethods tr:last-child td,
.woocommerce-MyAccount-content table.ed-isp-documents tr:last-child td { border-bottom: 0; }

/* ---------- Payment methods ---------- */

.woocommerce-MyAccount-content .payment-method-actions {
    text-align: right;
    white-space: nowrap;
    vertical-align: middle;
}

/*
 * Deleting a saved card is not something to invite, so it reads as a word
 * rather than a button. The .button class comes from WooCommerce, hence the
 * unwinding of everything the button rules set.
 */
/*
 * These are text, not buttons, so they are laid out as text: the same font,
 * the same line box and the same baseline as the card number in the cell
 * beside them. An inline-block with a line-height of its own does not line up
 * with that, whatever vertical-align it is given.
 */
.woocommerce-MyAccount-content .payment-method-actions .button,
.woocommerce-MyAccount-content .payment-method-actions .delete {
    display: inline;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--ed-danger);
    font-size: inherit;
    font-weight: 600;
    line-height: inherit;
    vertical-align: baseline;
}

.woocommerce-MyAccount-content .payment-method-actions .button:hover,
.woocommerce-MyAccount-content .payment-method-actions .delete:hover {
    background: none;
    color: #8c1d17;
    text-decoration: underline;
}

/* Making a card the default is an ordinary action, so it stays a link. */
.woocommerce-MyAccount-content .payment-method-actions .default {
    color: var(--ed-blue);
    margin-right: 18px;
}

.woocommerce-MyAccount-content .payment-method-actions .default:hover { color: var(--ed-blue-dark); }

/* Add payment method sits straight under the table otherwise. */
.woocommerce-MyAccount-content a.button[href*="add-payment-method"] { margin-top: 24px; }

.ed-isp-documents__number { font-weight: 600; color: var(--ed-ink); }
.ed-isp-documents__amount,
.ed-isp-documents__type { white-space: nowrap; }
.ed-isp-documents__download { text-align: right; }

/* Same button as the one on the dashboard's recent documents list. */
.woocommerce-MyAccount-content a.ed-isp-documents__button,
.woocommerce-MyAccount-content .ed-isp-documents__button {
    padding: 8px 16px;
    font-size: .9rem;
}

/* ---------- Related orders ---------- */

/*
 * Belt and braces for the empty myaccount/related-orders.php override. That
 * override is the actual fix and these selectors then match nothing; they are
 * here because template overrides have not been reliable on this site and the
 * section is one a customer should not be shown at all.
 */
.ed-endpoint-view-subscription .woocommerce-MyAccount-content table.my_account_orders,
.ed-endpoint-view-subscription .woocommerce-MyAccount-content h2:has(+ table.my_account_orders) {
    display: none;
}

/* ---------- Status pills ---------- */

.ed-isp-status {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: .84rem;
    font-weight: 600;
    white-space: nowrap;
}

.ed-isp-status--paid,
.ed-isp-status--active { background: #e6f4ea; color: #1e6b34; }
.ed-isp-status--open,
.ed-isp-status--partial,
.ed-isp-status--on-hold,
.ed-isp-status--pending { background: #fdf3e2; color: #8a5a00; }
.ed-isp-status--credit { background: #eaf0fd; color: var(--ed-blue-dark); }
.ed-isp-status--reversed,
.ed-isp-status--cancelled,
.ed-isp-status--expired { background: #f1f1f1; color: #5c5c5c; }

/* ---------- Documents toolbar ---------- */

.ed-isp-documents__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.woocommerce-MyAccount-content .ed-isp-documents__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.woocommerce-MyAccount-content .ed-isp-documents__filters li { margin: 0; padding: 0; list-style: none; }

/*
 * The filters, the search field and the search button all sit on one line, so
 * they share a height. Set it on the box rather than through padding, or the
 * input's own line box makes it a few pixels taller than the pills.
 */
.ed-isp-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
    height: 42px;
    padding: 0 18px;
    border: 1px solid var(--ed-border);
    border-radius: 999px;
    font-size: .92rem;
    color: inherit;
    text-decoration: none;
}

.ed-isp-filter:hover { border-color: var(--ed-blue); text-decoration: none; }

.ed-isp-filter.is-active {
    background: var(--ed-blue);
    border-color: var(--ed-blue);
    color: #fff;
}

.ed-isp-filter__count { font-size: .85em; opacity: .75; }

.ed-isp-documents__search { display: flex; gap: 8px; align-items: center; }

.woocommerce-MyAccount-content .ed-isp-documents__search input[type="search"] {
    box-sizing: border-box;
    height: 42px;
    min-width: 15em;
    padding: 0 16px;
}

.woocommerce-MyAccount-content .ed-isp-documents__search .button {
    box-sizing: border-box;
    height: 42px;
    padding: 0 22px;
    font-size: .92rem;
}

/*
 * The hidden attribute only gets display:none from the browser stylesheet, and
 * any theme rule carrying a display property beats it.
 */
.ed-isp-documents[hidden],
.ed-isp-documents__row[hidden],
.ed-isp-documents__no-match[hidden] { display: none !important; }

/* ---------- Subscription notice ---------- */

.ed-isp-subscription-notice {
    padding: 18px 22px;
    margin: 20px 0;
    background: var(--ed-ground);
    border-left: 3px solid var(--ed-blue);
    border-radius: 8px;
}

.ed-isp-subscription-notice__inner { display: flex; align-items: center; gap: 12px; }
.ed-isp-subscription-notice__icon { width: 22px; height: 22px; color: var(--ed-blue); flex-shrink: 0; }
.ed-isp-subscription-notice strong { color: var(--ed-ink); }
.ed-isp-subscription-notice p { margin: 4px 0 0; color: var(--ed-muted); }
.ed-isp-subscription-notice a { color: var(--ed-blue); font-weight: 600; text-decoration: none; }

/* ---------- WooCommerce notices ---------- */

.woocommerce-MyAccount-content .woocommerce-message,
.woocommerce-MyAccount-content .woocommerce-info,
.woocommerce-MyAccount-content .woocommerce-error {
    padding: 15px 20px;
    margin: 0 0 22px;
    border: 1px solid var(--ed-border);
    border-left: 3px solid var(--ed-blue);
    border-radius: 8px;
    background: var(--ed-ground);
    list-style: none;
}

.woocommerce-MyAccount-content .woocommerce-message { border-left-color: #1e6b34; background: #eef7f1; }
.woocommerce-MyAccount-content .woocommerce-error { border-left-color: #a3272f; background: #fdefef; }

.woocommerce-MyAccount-content .woocommerce-message::before,
.woocommerce-MyAccount-content .woocommerce-info::before,
.woocommerce-MyAccount-content .woocommerce-error::before { content: none; }

/* ---------- Narrow screens ---------- */

@media screen and (max-width: 860px) {
    .ed-account__layout,
    *:has(> .woocommerce-MyAccount-navigation):has(> .woocommerce-MyAccount-content) {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }
    .ed-account__title { font-size: 1.7rem; }
    .ed-account__hero { margin-bottom: 20px; }

    /* The card becomes the Menu button: identity out, current page in. */
    .ed-nav__summary { padding: 16px 18px; cursor: pointer; }
    .ed-nav__identity { display: none; }
    .ed-nav__toggle { display: flex; align-items: center; gap: 12px; }
    .ed-nav__toggle-label { font-weight: 700; color: var(--ed-ink); }

    .ed-nav__toggle-current {
        flex: 1 1 auto;
        min-width: 0;
        padding-left: 12px;
        border-left: 1px solid var(--ed-border);
        color: var(--ed-muted);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ed-nav__chevron {
        flex: 0 0 auto;
        width: 20px;
        height: 20px;
        color: var(--ed-muted);
        transition: transform .15s ease;
    }

    .ed-nav__panel[open] .ed-nav__chevron { transform: rotate(180deg); }

    .woocommerce-MyAccount-content .woocommerce-Addresses { grid-template-columns: minmax(0, 1fr); }

    .woocommerce-MyAccount-content .button,
    .woocommerce-MyAccount-content button[type="submit"],
    .woocommerce-MyAccount-content input[type="submit"] { width: 100%; text-align: center; }

    .woocommerce-MyAccount-content .woocommerce-Address-title .button,
    .woocommerce-MyAccount-content .woocommerce-Address-title a.edit,
    .woocommerce-MyAccount-content .ed-recent__row .button { width: auto; }

    .ed-isp-documents__toolbar { flex-direction: column; align-items: stretch; }
    .ed-isp-documents__search { width: 100%; }
    .woocommerce-MyAccount-content .ed-isp-documents__search input[type="search"] { flex: 1 1 auto; min-width: 0; }

    .ed-connection__top { flex-direction: column; }
    .ed-connection__speed { text-align: left; }
    .ed-connection__strip { flex-direction: column; align-items: stretch; }

    .ed-sub__head { flex-direction: column; }
    .ed-sub__actions { width: 100%; justify-content: space-between; }

    /* Two columns on a phone leaves each side too narrow to read. */
    .woocommerce-MyAccount-content .ed-facts tbody th,
    .woocommerce-MyAccount-content .ed-facts tbody td { display: block; width: auto; }
    .woocommerce-MyAccount-content .ed-facts tbody th { padding: 14px 20px 0; }
    .woocommerce-MyAccount-content .ed-facts tbody td { padding: 2px 20px 14px; }
    .woocommerce-MyAccount-content .ed-facts thead th { padding: 12px 20px; }
    .woocommerce-MyAccount-content .ed-facts--money td:last-child { text-align: left; }
    .ed-card__title--inset { padding: 20px 20px 0; }

    .ed-status__card { flex-wrap: wrap; padding: 18px 20px; }
    .ed-status__actions { width: 100%; align-items: stretch; padding-left: 38px; }

    .ed-help { flex-direction: column; align-items: stretch; }
    .woocommerce-MyAccount-content .ed-help__button { text-align: center; }
    .ed-recent__row { align-items: flex-start; }

    .ed-grid--2, .ed-grid--3 { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    .ed-nav__chevron { transition: none; }
}
