.machuca-account-dashboard {
    --mh-account-orange: #b9663d;
    --mh-account-purple: #7956b3;
    --mh-account-red: #b94b4b;
    --mh-account-green: #2f7a62;
    --mh-account-blue: #426b8c;
    --mh-account-neutral: #6b6b6b;
    --mh-account-surface: var(--wp--preset--color--surface, #fff);
    --mh-account-background: var(--wp--preset--color--background, #faf7f1);
    --mh-account-text: var(--wp--preset--color--text, #1f1f1f);
    --mh-account-muted: var(--wp--preset--color--text-muted, #6b6b6b);
    --mh-account-border: var(--wp--preset--color--border, #e6e0d7);
    max-width: 1040px;
    margin: 0 auto;
    padding: 69px 16px 56px;
    color: var(--mh-account-text);
}

.machuca-account-dashboard--logged-out {
    max-width: 560px;
    text-align: center;
}

.machuca-account-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 24px;
    border-radius: 999px;
    background: var(--wp--preset--color--primary, #013b28);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.machuca-account-status {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 24px;
    padding: 20px;
    border: 1px solid var(--mh-account-border);
    border-radius: 16px;
    background: var(--mh-account-surface);
    box-shadow: 0 1px 2px rgba(31,31,31,0.04), 0 2px 8px rgba(31,31,31,0.04);
}

.machuca-account-status__icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--mh-account-red) 12%, #fff);
    color: var(--mh-account-red);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mh-account-red) 16%, transparent);
}

.machuca-account-status__icon svg {
    width: 25px;
    height: 25px;
}

.machuca-account-status h1,
.machuca-account-status h2 {
    margin: 0 0 8px;
    font-family: var(--wp--preset--font-family--serif, serif);
    line-height: 1.1;
}

.machuca-account-status h1 {
    font-size: clamp(28px, 4vw, 40px);
}

.machuca-account-status h2 {
    font-size: 24px;
}

.machuca-account-status p {
    margin: 8px 0 0;
    color: var(--mh-account-muted);
    line-height: 1.55;
}

.machuca-account-status a {
    color: var(--wp--preset--color--primary, #013b28);
}

.machuca-account-status--blocked {
    border-color: color-mix(in srgb, var(--mh-account-red) 24%, var(--mh-account-border));
    background: color-mix(in srgb, var(--mh-account-red) 6%, #fff);
}

.machuca-account-status--profile {
    border-color: color-mix(in srgb, var(--mh-account-blue) 20%, var(--mh-account-border));
    background: color-mix(in srgb, var(--mh-account-blue) 6%, #fff);
}

.machuca-account-guidance {
    max-width: none;
    margin: -8px auto 0;
    color: var(--mh-account-muted);
    font-size: 15px;
    line-height: 1.55;
    text-align: center;
}

.machuca-account-guidance + .machuca-account-section {
    margin-top: 18px;
}

.machuca-account-onboarding-grid {
    margin: 30px 0 60px;
}

.machuca-account-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 20px;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid var(--mh-account-border);
    border-radius: 16px;
    background: var(--mh-account-surface);
    box-shadow: 0 1px 2px rgba(31,31,31,0.04), 0 2px 8px rgba(31,31,31,0.04);
}

.machuca-account-summary__avatar img {
    display: block;
    width: 72px;
    height: 72px;
    border-radius: 999px;
}

.machuca-account-summary__eyebrow {
    margin: 0 0 4px;
    color: var(--wp--preset--color--primary, #013b28);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.machuca-account-summary h1 {
    margin: 0;
    font-family: var(--wp--preset--font-family--serif, serif);
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.08;
}

.machuca-account-summary__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 10px;
    color: var(--mh-account-muted);
    font-size: 14px;
}

.machuca-account-summary__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.machuca-account-summary__actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--mh-account-border);
    border-radius: 999px;
    color: var(--mh-account-text);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.machuca-account-summary__actions a:hover,
.machuca-account-summary__actions a:focus {
    border-color: var(--wp--preset--color--primary, #013b28);
    color: var(--wp--preset--color--primary, #013b28);
}

/* Quiet settings links under View profile — deliberately not pills. Settings
   are low-frequency, text-hunted destinations; visible text beats a kebab
   while there are only two of them. */
.machuca-account-summary__settings {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--mh-account-muted, #6b6b6b);
}

.machuca-account-summary__actions .machuca-account-summary__settings a {
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--mh-account-muted, #6b6b6b);
}

.machuca-account-summary__actions .machuca-account-summary__settings a:hover,
.machuca-account-summary__actions .machuca-account-summary__settings a:focus {
    color: var(--wp--preset--color--primary, #013b28);
    text-decoration: underline;
}

.machuca-account-attention {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    margin-bottom: 24px;
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--wp--preset--color--primary-faint, #edf6f1);
    border: 1px solid rgba(1, 59, 40, 0.12);
}

.machuca-account-attention h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
}

.machuca-account-attention__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.machuca-account-attention__list a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--mh-account-surface);
    color: var(--wp--preset--color--primary, #013b28);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.machuca-account-section + .machuca-account-section {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--mh-account-border);
}

.machuca-account-onboarding-grid + .machuca-account-section--utility,
.machuca-account-guidance + .machuca-account-section--utility {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--mh-account-border);
}

.machuca-account-dashboard--blocked .machuca-account-section--utility {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--mh-account-border);
}

.machuca-account-section__title {
    margin: 0 0 14px;
    color: var(--mh-account-muted);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-transform: uppercase;
}

.machuca-account-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.machuca-account-grid--utility .machuca-account-tile,
.machuca-account-grid--secondary .machuca-account-tile {
    min-height: 166px;
}

.machuca-account-grid--secondary .machuca-account-tile:only-child {
    grid-column: 1 / -1;
}

.machuca-account-tile {
    --tile-color: var(--mh-account-neutral);
    position: relative;
    display: flex;
    min-height: 210px;
    flex-direction: column;
    padding: 20px;
    border: 1px solid color-mix(in srgb, var(--tile-color) 22%, transparent);
    border-radius: 16px;
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--tile-color) 12%, #fff) 0%, #fff 68%),
        var(--mh-account-surface);
    color: var(--mh-account-text);
    text-decoration: none;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.76),
        inset 0 -18px 28px rgba(31,31,31,0.025),
        0 1px 2px rgba(31,31,31,0.04),
        0 6px 18px rgba(31,31,31,0.06);
    transition: transform 200ms ease-out, box-shadow 200ms ease-out, border-color 180ms ease-out;
}

.machuca-account-tile:hover,
.machuca-account-tile:focus {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--tile-color) 46%, transparent);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.8),
        inset 0 -18px 28px rgba(31,31,31,0.025),
        0 2px 4px rgba(31,31,31,0.05),
        0 10px 26px rgba(31,31,31,0.09);
}

.machuca-account-tile:focus-visible {
    outline: 2px solid var(--wp--preset--color--accent, #b9663d);
    outline-offset: 4px;
}

.machuca-account-tile--orange { --tile-color: var(--mh-account-orange); }
.machuca-account-tile--purple { --tile-color: var(--mh-account-purple); }
.machuca-account-tile--red { --tile-color: var(--mh-account-red); }
.machuca-account-tile--green { --tile-color: var(--mh-account-green); }
.machuca-account-tile--blue { --tile-color: var(--mh-account-blue); }
.machuca-account-tile--neutral { --tile-color: var(--mh-account-neutral); }
.machuca-account-tile--quiet {
    --tile-color: var(--mh-account-neutral);
    min-height: 132px;
    opacity: 0.9;
}

.machuca-account-tile__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
}

.machuca-account-tile__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--tile-color) 14%, #fff);
    color: var(--tile-color);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tile-color) 16%, transparent);
}

.machuca-account-tile__icon svg {
    width: 25px;
    height: 25px;
}

.machuca-account-tile__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--tile-color);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.machuca-account-tile__title {
    display: block;
    margin-bottom: 6px;
    font-family: var(--wp--preset--font-family--serif, serif);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.08;
}

.machuca-account-tile__summary {
    display: block;
    margin-bottom: 12px;
    color: color-mix(in srgb, var(--tile-color) 82%, #1f1f1f);
    font-size: 15px;
    font-weight: 800;
}

.machuca-account-tile__detail {
    display: block;
    color: var(--mh-account-muted);
    font-size: 15px;
    line-height: 1.45;
}

.machuca-account-tile__action {
    display: inline-flex;
    margin-top: auto;
    padding-top: 22px;
    color: var(--tile-color);
    font-size: 14px;
    font-weight: 800;
}

@media (max-width: 760px) {
    .machuca-account-dashboard {
        padding: 36px 12px 40px;
    }

    .machuca-account-tile {
        min-height: 176px;
        padding: 18px;
    }

    .machuca-account-tile__title {
        font-size: 24px;
    }

    .machuca-account-tile__detail {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .machuca-account-dashboard {
        padding: 28px 12px 40px;
    }

    .machuca-account-status {
        flex-direction: column;
    }

    .machuca-account-summary {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 14px;
        padding: 16px;
    }

    .machuca-account-summary__actions {
        grid-column: 1 / -1;
        flex-direction: column;
        align-items: flex-start;
    }

    .machuca-account-summary__actions a {
        flex: initial;
    }

    .machuca-account-attention {
        gap: 10px;
    }

    .machuca-account-grid {
        gap: 10px;
    }

    .machuca-account-section + .machuca-account-section {
        margin-top: 24px;
        padding-top: 20px;
    }

    .machuca-account-grid--utility .machuca-account-tile,
    .machuca-account-grid--secondary .machuca-account-tile,
    .machuca-account-tile {
        min-height: 154px;
        padding: 14px;
    }

    .machuca-account-tile__top {
        margin-bottom: 12px;
    }

    .machuca-account-tile__icon {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .machuca-account-tile__icon svg {
        width: 21px;
        height: 21px;
    }

    .machuca-account-tile__badge {
        min-width: 26px;
        height: 26px;
        padding: 0 8px;
        font-size: 12px;
    }

    .machuca-account-tile__title {
        font-size: 20px;
    }

    .machuca-account-tile__summary {
        margin-bottom: 8px;
        font-size: 13px;
        line-height: 1.25;
    }

    .machuca-account-tile__detail {
        display: -webkit-box;
        overflow: hidden;
        font-size: 12px;
        line-height: 1.35;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .machuca-account-tile__action {
        padding-top: 14px;
        font-size: 12px;
    }

    .machuca-account-tile--quiet {
        min-height: 118px;
    }
}

@media (max-width: 359px) {
    .machuca-account-grid {
        grid-template-columns: 1fr;
    }
}

/* Account chrome
   -------------------------------------------------------------------------
   These screens exist to be acted on, so the work starts as close to the top
   as the page's own header allows: the template stacks a margin above the main
   region and a padding above the title, and here each of them is half of what
   a reading page gets. Both are inline styles in the template, hence the
   !important - this overrides markup, not another rule. */
body.machuca-account-page main.wp-block-group {
    margin-top: var(--wp--preset--spacing--40) !important;
}

body.machuca-account-page main.wp-block-group > .wp-block-group {
    padding-top: var(--wp--preset--spacing--40) !important;
}

/* A screen that has to supply its own H1 says nothing about how it looks: the
   theme's h1 is the one every other account title already uses, so inheriting
   it is what keeps them the same. Only the spacing is this screen's business. */
.machuca-account-title {
    margin: 0 0 6px;
}

/* Nothing sits above the title on these screens, and the line under it belongs
   to it rather than floating between the two. */
body.machuca-account-page .wp-block-post-title,
body.machuca-account-page .machuca-account-title {
    margin-bottom: 6px;
    margin-top: 0;
}

/* The line under the title: a description of the screen, not a second title.
   Small, quiet and always ranged left - some of these screens centre their own
   content, and this line must not follow them there. One size on every account
   screen, so a screen is recognisable as one of these before its words are
   read. */
/* No width of its own, and no fight with the centring: the post content block
   is full-width on these templates, so a narrower box pinned to the left lands
   on the edge of the window rather than under the title. The line takes the
   same box as everything else in the column - what makes it a description is
   its size and colour, and text-align because one of these screens centres its
   own content. */
.machuca-account-subtitle {
    color: var(--wp--preset--color--text-muted, #6f665d);
    font-size: var(--wp--preset--font-size--sm, 0.875rem);
    line-height: 1.5;
    margin: 0 0 20px;
    text-align: left;
}

@media (max-width: 900px) {
    .machuca-account-subtitle {
        margin-bottom: 18px;
    }
}
