/* ============================================================================
   ePostcode / eSortcode Account Dashboard
   Modern shell over LinkListTabs - no data-layer changes
   ============================================================================ */

.ep-dash {
    --ep-dash-radius: 18px;
    --ep-dash-radius-sm: 12px;
    --ep-dash-border: #e6e8ee;
    --ep-dash-muted: #6b7280;
    --ep-dash-ink: #111827;
    --ep-dash-surface: #ffffff;
    --ep-dash-canvas: #f4f6f9;
    --ep-dash-shadow: 0 16px 40px rgba(17, 24, 39, 0.08);
    --ep-dash-shadow-sm: 0 4px 14px rgba(17, 24, 39, 0.05);
    --ep-dash-nav-width: 280px;
    --ep-dash-primary: var(--primary-color, #EC2E5E);
    --ep-dash-primary-muted: var(--primary-muted-color, #fce7ee);
    --ep-dash-accent: var(--primary-color, #EC2E5E);
    /* Portal sidebar / navigation greys */
    --ep-dash-nav: #394263;
    --ep-dash-nav-dark: #2a3149;
    --ep-dash-nav-deeper: #1f2538;
    --ep-dash-nav-mid: #46527a;
    --ep-dash-nav-light: #5a6690;
    font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--ep-dash-ink);
    /* Page shell padding from theme styles.css (--ep-page-pad-*) */
    margin: 0 0 var(--ep-page-margin-bottom, 32px);
    padding: var(--ep-page-pad-y, 20px) var(--ep-page-pad-x, 24px) var(--ep-page-pad-bottom, 32px);
}

.ep-dash-host {
    /* Padding lives on .ep-dash so host columns do not double it */
    margin: 0;
    padding: 0;
}

.ep-dash *,
.ep-dash *::before,
.ep-dash *::after {
    box-sizing: border-box;
}

/* ---------- Hero / banner (light, airy theme) ---------- */
.ep-dash__hero {
    position: relative;
    overflow: hidden;
    margin: 0 0 20px;
    padding: 0;
    border-radius: calc(var(--ep-dash-radius) + 4px);
    color: var(--ep-dash-ink);
    isolation: isolate;
    border: 1px solid rgba(230, 232, 238, 0.95);
    box-shadow:
        0 10px 28px rgba(17, 24, 39, 0.06),
        0 1px 0 rgba(255, 255, 255, 0.8) inset;
    background:
        linear-gradient(155deg,
            #ffffff 0%,
            #f8f9fc 42%,
            #f3f5f9 100%);
    min-height: 0;
}

.ep-dash__hero::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--ep-dash-primary) 0%, rgba(236, 46, 94, 0.25) 100%);
    z-index: 2;
}

.ep-dash__hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.4) 50%, transparent 90%);
    z-index: 2;
    pointer-events: none;
}

.ep-dash__hero-glow {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 90% at 0% 0%, rgba(236, 46, 94, 0.07), transparent 55%),
        radial-gradient(ellipse 55% 70% at 100% 100%, rgba(99, 120, 180, 0.08), transparent 58%),
        radial-gradient(ellipse 40% 50% at 70% 0%, rgba(255, 255, 255, 0.9), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.ep-dash__hero-grid {
    display: none;
}

.ep-dash__hero-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(4px);
    opacity: 0.7;
}

.ep-dash__hero-orb--1 {
    width: min(280px, 48vw);
    height: min(280px, 48vw);
    right: -56px;
    top: -80px;
    background: radial-gradient(circle, rgba(236, 46, 94, 0.12) 0%, rgba(236, 46, 94, 0) 70%);
}

.ep-dash__hero-orb--2 {
    width: min(220px, 40vw);
    height: min(220px, 40vw);
    right: 14%;
    bottom: -100px;
    background: radial-gradient(circle, rgba(120, 140, 190, 0.1) 0%, rgba(120, 140, 190, 0) 70%);
}

.ep-dash__hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(220px, 0.85fr);
    gap: clamp(14px, 2.5vw, 28px) clamp(16px, 3vw, 32px);
    align-items: center;
    padding: clamp(16px, 2.6vw, 28px) clamp(16px, 3vw, 36px);
}

.ep-dash__hero-copy {
    min-width: 0;
}

/* Organisation identity + clickable hero aside cards */
.ep-dash__hero-aside {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

a.ep-dash__hero-stat,
.ep-dash__hero-stat {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    margin: 0 !important;
    padding: 11px 13px !important;
    border: 1px solid var(--ep-dash-border) !important;
    border-radius: 12px !important;
    background: linear-gradient(180deg, #ffffff 0%, #fbfbfc 100%) !important;
    box-shadow: var(--ep-dash-shadow-sm) !important;
    text-decoration: none !important;
    color: inherit !important;
    text-align: left !important;
    width: 100%;
    box-sizing: border-box;
}

a.ep-dash__hero-stat--clickable,
.ep-dash__hero-stat--clickable {
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

a.ep-dash__hero-stat--clickable:hover,
.ep-dash__hero-stat--clickable:hover {
    border-color: rgba(236, 46, 94, 0.28) !important;
    box-shadow: 0 10px 22px rgba(17, 24, 39, 0.08) !important;
    transform: translateY(-1px);
    background: #fffafb !important;
    text-decoration: none !important;
    color: inherit !important;
}

a.ep-dash__hero-stat--clickable:focus-visible,
.ep-dash__hero-stat--clickable:focus-visible {
    outline: 2px solid rgba(236, 46, 94, 0.45);
    outline-offset: 2px;
}

/* Non-managers: keep the cards visible but not interactive */
a.ep-dash__hero-stat--static,
.ep-dash__hero-stat--static,
a.ep-dash__hero-stat.aspNetDisabled,
.ep-dash__hero-stat.aspNetDisabled {
    cursor: default !important;
    pointer-events: none;
    opacity: 1 !important;
    color: inherit !important;
    text-decoration: none !important;
    transform: none !important;
}

/* Organisation card sits first in the aside stack */
a.ep-dash__org.ep-dash__hero-stat,
.ep-dash__org.ep-dash__hero-stat {
    border-color: rgba(236, 46, 94, 0.18) !important;
    background:
        linear-gradient(165deg, #fff7f9 0%, #ffffff 55%, #fbfbfc 100%) !important;
}

.ep-dash__org-copy {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ep-dash__org-identity {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    min-width: 0;
}

.ep-dash__org-code {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(236, 46, 94, 0.22);
    background: #fff;
    color: #9f1239;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.03em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    line-height: 1.3;
}

.ep-dash__org-name {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.015em;
    color: #111827;
    word-break: break-word;
    line-height: 1.3;
}

.ep-dash__hero-stat-cta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    font-size: 11.5px;
    font-weight: 700;
    color: #be123c;
}

.ep-dash__hero-stat-cta i {
    font-size: 12px;
    line-height: 1;
}

.ep-dash__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ep-dash-muted);
    margin: 0 0 12px;
    padding: 7px 12px 7px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--ep-dash-border);
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

.ep-dash__eyebrow-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.2);
    animation: epDashPulse 2.2s ease-in-out infinite;
}

@keyframes epDashPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18); }
    50% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0.08); }
}

.ep-dash__title {
    margin: 0;
    font-size: clamp(22px, 4.2vw, 34px);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.12;
    text-wrap: balance;
    color: var(--ep-dash-ink);
}

.ep-dash__subtitle {
    margin: 8px 0 0;
    max-width: 54ch;
    font-size: clamp(13px, 2.2vw, 14.5px);
    line-height: 1.5;
    color: var(--ep-dash-muted);
    font-weight: 400;
    text-wrap: pretty;
}

.ep-dash__hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.ep-dash__help-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(236, 46, 94, 0.28);
    background: linear-gradient(180deg, #ffffff 0%, #fff7f9 100%);
    color: #9f1239 !important;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    box-shadow: var(--ep-dash-shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, background 0.15s ease;
    white-space: nowrap;
}

.ep-dash__help-link:hover {
    border-color: rgba(236, 46, 94, 0.5);
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.08);
    transform: translateY(-1px);
    color: #881337 !important;
    background: #fff;
}

.ep-dash__help-link i {
    color: #ec2e5e;
}

.ep-dash__chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--ep-dash-border);
    color: var(--ep-dash-ink);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.04);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.ep-dash__chip:hover {
    background: var(--ep-dash-primary-muted);
    border-color: rgba(236, 46, 94, 0.22);
    transform: translateY(-1px);
}

.ep-dash__chip i {
    color: var(--ep-dash-primary);
    opacity: 1;
}

.ep-dash__hero-aside {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.ep-dash__hero-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--ep-dash-border);
    box-shadow: 0 4px 14px rgba(17, 24, 39, 0.04);
    min-width: 0;
}

.ep-dash__hero-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    background: linear-gradient(145deg, rgba(236, 46, 94, 0.95), rgba(190, 18, 60, 0.9));
    color: #fff;
    font-size: 17px;
    box-shadow: 0 8px 18px rgba(236, 46, 94, 0.28);
}

.ep-dash__hero-stat-label {
    display: block;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ep-dash-muted);
    margin-bottom: 2px;
}

.ep-dash__hero-stat-value {
    display: block;
    font-size: 13.5px;
    font-weight: 650;
    color: var(--ep-dash-ink);
    line-height: 1.3;
}

@media (max-width: 900px) {
    .ep-dash__hero-inner {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .ep-dash__hero-aside {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    a.ep-dash__hero-stat,
    .ep-dash__hero-stat {
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
        padding: 12px 14px !important;
        height: auto;
    }

    .ep-dash__hero-stat-icon {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
        font-size: 15px;
        border-radius: 10px;
    }
}

@media (min-width: 901px) and (max-width: 1100px) {
    .ep-dash__hero-aside {
        gap: 8px;
    }
}

@media (max-width: 640px) {
    .ep-dash {
        /* Uses shared --ep-page-pad-* from styles.css */
        padding: var(--ep-page-pad-y, 12px) var(--ep-page-pad-x, 12px) var(--ep-page-pad-bottom, 24px);
    }

    .ep-dash__hero {
        margin-bottom: 12px;
        border-radius: 14px;
        box-shadow:
            0 6px 16px rgba(17, 24, 39, 0.045),
            0 1px 0 rgba(255, 255, 255, 0.85) inset;
    }

    .ep-dash__hero::before {
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        width: auto;
        height: 3px;
        background: linear-gradient(90deg, var(--ep-dash-primary) 0%, rgba(236, 46, 94, 0.28) 55%, transparent 100%);
    }

    .ep-dash__hero-orb {
        opacity: 0.28;
    }

    .ep-dash__hero-inner {
        padding: 12px 12px 12px;
        gap: 10px;
    }

    .ep-dash__eyebrow {
        font-size: 10px;
        letter-spacing: 0.1em;
        margin-bottom: 6px;
        padding: 5px 9px 5px 7px;
    }

    .ep-dash__title {
        font-size: clamp(20px, 6.2vw, 24px);
        line-height: 1.15;
    }

    .ep-dash__subtitle {
        margin-top: 6px;
        font-size: 12.5px;
        line-height: 1.45;
        max-width: none;
        /* Keep one compact line of context on small screens */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .ep-dash__hero-actions {
        margin-top: 10px;
        gap: 6px;
    }

    /* Hide decorative chips on mobile to reduce banner depth */
    .ep-dash__chip--desktop {
        display: none !important;
    }

    .ep-dash__help-link {
        width: 100%;
        justify-content: center;
        min-height: 40px;
        padding: 8px 12px;
        font-size: 12.5px;
    }

    .ep-dash__hero-aside {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    a.ep-dash__hero-stat,
    .ep-dash__hero-stat {
        padding: 10px 12px !important;
        gap: 10px;
        border-radius: 11px !important;
    }

    .ep-dash__hero-stat-icon {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
        font-size: 14px;
        border-radius: 9px;
    }

    .ep-dash__hero-stat-value {
        font-size: 12px;
    }

    .ep-dash__org-name {
        font-size: 13px;
    }

    .ep-dash__hero-stat-cta {
        font-size: 11px;
        margin-top: 2px;
    }
}

@media (max-width: 380px) {
    .ep-dash__hero-aside {
        grid-template-columns: 1fr;
    }

    .ep-dash__hero-stat {
        flex-direction: row;
        align-items: center;
    }

    .ep-dash__chip span,
    .ep-dash__chip {
        /* keep chips compact; allow wrap without overflow */
        max-width: 100%;
    }
}

/* ---------- Workspace shell ---------- */
.ep-dash__workspace {
    display: block;
    position: relative;
}

.ep-dash__nav-toggle {
    display: none;
}

/* Mobile-only dashboard section dropdown */
.ep-dash__mobile-nav {
    display: none;
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid var(--ep-dash-border);
    border-radius: var(--ep-dash-radius-sm);
    background: linear-gradient(180deg, #ffffff 0%, #fbfbfc 100%);
    box-shadow: var(--ep-dash-shadow-sm);
}

.ep-dash__mobile-nav-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7280;
}

.ep-dash__mobile-nav-label i {
    color: var(--ep-dash-primary, #be123c);
}

.ep-dash__mobile-nav-control {
    position: relative;
}

.ep-dash__mobile-nav-select {
    display: block;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-sizing: border-box;
    margin: 0;
    padding: 12px 40px 12px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #111827;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
}

.ep-dash__mobile-nav-select:focus {
    outline: none;
    border-color: rgba(236, 46, 94, 0.45);
    box-shadow: 0 0 0 3px rgba(236, 46, 94, 0.12);
}

.ep-dash__mobile-nav-chevron {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    pointer-events: none;
    font-size: 12px;
}

.ep-dash__mobile-nav-current {
    margin: 8px 0 0;
    font-size: 12.5px;
    color: #6b7280;
}

.ep-dash__mobile-nav-current strong {
    color: #111827;
    font-weight: 700;
}

/* Override platform LinkListTabs inside our shell */
.ep-dash .linkedlist-tabs {
    display: grid;
    grid-template-columns: var(--ep-dash-nav-width) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    background: transparent;
}

.ep-dash .linkedlist-tabs > ul,
.ep-dash .linkedlist-tabs > ul > li {
    margin: 0;
    padding: 0;
    list-style: none;
    position: relative;
    z-index: 2;
    float: none !important;
    width: auto !important;
}

.ep-dash .linkedlist-tabs > ul {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100% !important;
    float: none !important;
    padding: 10px;
    border-radius: var(--ep-dash-radius);
    background: var(--ep-dash-surface);
    border: 1px solid var(--ep-dash-border);
    box-shadow: var(--ep-dash-shadow-sm);
    position: sticky;
    top: 12px;
    /* Grow with items so the nav does not introduce its own scrollbar by default */
    max-height: none;
    overflow: visible;
}

.ep-dash .linkedlist-tabs > ul > li > a,
.ep-dash .linkedlist-tabs__content > a {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 9px 11px !important;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    background: transparent !important;
    color: #374151 !important;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.3;
    box-shadow: none !important;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.ep-dash .linkedlist-tabs > ul > li > a:hover {
    background: #f3f4f6 !important;
    color: var(--ep-dash-ink) !important;
    transform: translateX(2px);
}

.ep-dash .linkedlist-tabs > ul > li.selected > a {
    background: linear-gradient(135deg, rgba(236, 46, 94, 0.12), rgba(236, 46, 94, 0.05)) !important;
    border-color: rgba(236, 46, 94, 0.22) !important;
    color: #9f1239 !important;
    box-shadow: none !important;
}

.ep-dash .linkedlist-tabs--vertical > ul > li.selected > a,
.ep-dash .linkedlist-tabs--horizontal > ul > li.selected > a {
    border-right-color: transparent !important;
    border-bottom-color: transparent !important;
    box-shadow: none !important;
}

.ep-dash .linkedlist-tabs--vertical .linkedlist-tabs__content,
.ep-dash .linkedlist-tabs--horizontal .linkedlist-tabs__content {
    left: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    border: 1px solid var(--ep-dash-border) !important;
    border-radius: var(--ep-dash-radius) !important;
    background: var(--ep-dash-surface) !important;
    box-shadow: var(--ep-dash-shadow-sm);
    min-height: 420px;
    padding: 0 !important;
}

.ep-dash .linkedlist-tabs__content.p10,
.ep-dash .linkedlist-tabs__content.ep-dash__content-inner {
    padding: 0 !important;
}

/* Nav group labels (injected by JS) */
.ep-dash__nav-group {
    list-style: none;
    margin: 10px 4px 4px;
    padding: 10px 8px 4px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #9ca3af;
    pointer-events: none;
}

.ep-dash__nav-group:first-child {
    margin-top: 0;
    padding-top: 2px;
}

.ep-dash__nav-icon {
    display: inline-flex;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 13px;
}

.ep-dash .linkedlist-tabs > ul > li.selected .ep-dash__nav-icon {
    background: rgba(236, 46, 94, 0.14);
    color: #be123c;
}

.ep-dash__nav-label {
    min-width: 0;
}

/* ---------- Content panels ---------- */
.ep-panel {
    padding: 20px 22px 24px;
    animation: epDashIn 0.28s ease both;
}

@keyframes epDashIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.ep-panel__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 18px;
    margin: 0 0 18px;
    padding: 0 0 16px;
    border-bottom: 1px solid var(--ep-dash-border);
}

.ep-panel__kicker {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #be123c;
}

.ep-panel__title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ep-dash-ink);
}

.ep-panel__desc {
    margin: 6px 0 0;
    max-width: 70ch;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--ep-dash-muted);
}

.ep-panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.ep-panel__body {
    min-width: 0;
}

.ep-callout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px 14px;
    padding: 14px 16px;
    margin: 0 0 18px;
    border-radius: var(--ep-dash-radius-sm);
    background: linear-gradient(180deg, #fff7f9, #fff);
    border: 1px solid rgba(236, 46, 94, 0.16);
    color: #4b5563;
    font-size: 13px;
    line-height: 1.55;
}

.ep-callout__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(236, 46, 94, 0.1);
    color: #be123c;
    font-size: 16px;
}

.ep-callout strong {
    color: var(--ep-dash-ink);
}

.ep-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.ep-split--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 900px) {
    .ep-split--2 {
        grid-template-columns: 1fr;
    }
}

.ep-card {
    border: 1px solid var(--ep-dash-border);
    border-radius: var(--ep-dash-radius-sm);
    background: #fff;
    box-shadow: var(--ep-dash-shadow-sm);
    padding: 16px;
}

.ep-card__title {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 700;
}

/* ---------- Overview / licence cards ---------- */
.ep-overview {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Organisation summary at top of Overview (shared across all licences) */
.ep-overview__org {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 14px;
    padding: 14px 16px;
    border: 1px solid rgba(236, 46, 94, 0.16);
    border-radius: 14px;
    background:
        linear-gradient(165deg, #fff7f9 0%, #ffffff 55%, #fbfbfc 100%);
    box-shadow: var(--ep-dash-shadow-sm, 0 4px 14px rgba(17, 24, 39, 0.05));
}

.ep-overview__org-icon {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(236, 46, 94, 0.14), rgba(236, 46, 94, 0.05));
    color: #be123c;
    font-size: 18px;
}

.ep-overview__org-copy {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ep-overview__org-label {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
}

.ep-overview__org-name {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #111827;
    word-break: break-word;
    line-height: 1.3;
}

a.ep-overview__org-view,
.ep-overview__org-view {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 0 0 auto;
    min-height: 42px;
    margin: 0 !important;
    padding: 9px 14px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: #1d4ed8 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

a.ep-overview__org-view:hover,
.ep-overview__org-view:hover {
    background: #eff6ff !important;
    border-color: rgba(37, 99, 235, 0.35) !important;
    color: #1d4ed8 !important;
    text-decoration: none !important;
    transform: translateY(-1px);
}

a.ep-overview__org-view:focus-visible,
.ep-overview__org-view:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.45);
    outline-offset: 2px;
}

.ep-overview__org-view i {
    font-size: 14px;
    line-height: 1;
}

@media (max-width: 640px) {
    .ep-overview__org {
        padding: 12px;
    }

    .ep-overview__org-name {
        font-size: 15.5px;
    }

    a.ep-overview__org-view,
    .ep-overview__org-view {
        width: 100%;
        min-height: 44px;
    }
}

.ep-overview__top {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
}

@media (max-width: 860px) {
    .ep-overview__top {
        grid-template-columns: 1fr;
    }
}

.ep-overview__account {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ep-overview__account .dashboard-value {
    width: 100% !important;
    max-width: none;
}

.ep-overview__transfer {
    border: 1px dashed rgba(236, 46, 94, 0.28);
    border-radius: var(--ep-dash-radius-sm);
    background: #fffafb;
    padding: 12px;
}

.ep-overview__section-title {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px 16px;
    margin: 4px 0 12px;
}

.ep-overview__section-title h4 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 800;
    color: var(--ep-dash-ink);
}

.ep-overview__section-title p {
    margin: 0;
    font-size: 12.5px;
    color: var(--ep-dash-muted);
    max-width: 56ch;
}

.ep-overview__section-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---------- How our licencing works modal (portal-wide overlay) ---------- */
/* Modal is reparented to document.body so fixed covers full portal chrome. */
html.ep-modal-open,
body.ep-modal-open {
    overflow: hidden !important;
}

.ep-help-modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    z-index: 10000000; /* above mmenu / portal chrome */
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-sizing: border-box;
}

.ep-help-modal.is-open {
    display: flex;
}

.ep-help-modal__dialog {
    width: min(720px, 100%);
    max-height: min(90vh, 860px);
    overflow: auto;
    background: #fff;
    border-radius: 18px;
    border: 1px solid #e6e8ee;
    box-shadow: 0 24px 64px rgba(17, 24, 39, 0.28);
}

.ep-help-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px 12px;
    border-bottom: 1px solid #eef2f7;
}

.ep-help-modal__kicker {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
}

.ep-help-modal__title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #111827;
}

.ep-help-modal__close {
    width: 36px;
    height: 36px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    color: #374151;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ep-help-modal__close:hover {
    background: #f3f4f6;
    color: #111827;
}

.ep-help-modal__body {
    padding: 18px 22px 8px;
}

.ep-help-modal__lead {
    margin: 0 0 16px;
    font-size: 14.5px;
    line-height: 1.6;
    color: #374151;
}

.ep-help-modal__cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0 0 16px;
}

.ep-help-card {
    padding: 14px 16px;
    border: 1px solid #e6e8ee;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfbfc 100%);
}

.ep-help-card__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(236, 46, 94, 0.12), rgba(236, 46, 94, 0.04));
    color: #be123c;
    margin: 0 0 10px;
}

.ep-help-card__title {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 800;
    color: #111827;
}

.ep-help-card p {
    margin: 0 0 10px;
    font-size: 13.5px;
    line-height: 1.55;
    color: #4b5563;
}

.ep-help-card ul {
    margin: 0;
    padding: 0 0 0 18px;
    color: #4b5563;
    font-size: 13px;
    line-height: 1.5;
}

.ep-help-card li {
    margin: 0 0 4px;
}

.ep-help-modal__flow {
    display: grid;
    gap: 8px;
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
}

.ep-help-flow-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13.5px;
    line-height: 1.45;
    color: #374151;
}

.ep-help-flow-step__num {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #ec2e5e, #be123c);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.ep-help-modal__note {
    margin: 0 0 8px;
    font-size: 13px;
    line-height: 1.5;
    color: #6b7280;
}

.ep-help-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 22px 18px;
    border-top: 1px solid #eef2f7;
}

@media (max-width: 720px) {
    .ep-help-modal__cards {
        grid-template-columns: 1fr;
    }

    .ep-overview__section-title {
        align-items: flex-start;
    }

    .ep-dash__help-link {
        width: 100%;
        justify-content: center;
    }
}

/* Licence row cards inside RadGrid */
.ep-dash .RadGrid,
.ep-dash .RadGrid .rgMasterTable,
.ep-dash .RadGrid .rgDetailTable {
    border: none !important;
    background: transparent !important;
}

.ep-dash .RadGrid .rgHeader,
.ep-dash .RadGrid .rgHeaderDiv,
.ep-dash .RadGrid th.rgHeader {
    display: none !important;
}

.ep-dash .RadGrid td,
.ep-dash .RadGrid .rgRow > td,
.ep-dash .RadGrid .rgAltRow > td,
.ep-dash .RadGrid .rgRow td,
.ep-dash .RadGrid .rgAltRow td {
    border: none !important;
    background: transparent !important;
    padding: 0 0 12px !important;
}

.ep-dash .RadGrid .rgRow,
.ep-dash .RadGrid .rgAltRow {
    background: transparent !important;
}

.ep-dash .RadGrid .rgPager {
    border: none !important;
    background: transparent !important;
    padding: 8px 0 !important;
}

.ep-licence-card {
    display: grid;
    /* Identity + Credits | API keys | Auto renewal | Last usage on one row */
    grid-template-columns: minmax(180px, 1.15fr) repeat(4, minmax(0, 1fr));
    gap: 12px 12px;
    padding: 16px 18px;
    border: 1px solid var(--ep-dash-border);
    border-radius: var(--ep-dash-radius-sm);
    background:
        linear-gradient(180deg, #ffffff 0%, #fbfbfc 100%);
    box-shadow: var(--ep-dash-shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

/* Legacy full-width metric (kept for any remaining uses) */
.ep-licence-card > .ep-metric--wide {
    grid-column: 1 / -1;
}

/* Below ~1200px, stack identity above a 4-up metric row so tiles stay readable */
@media (max-width: 1200px) {
    .ep-licence-card {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .ep-licence-card__identity {
        grid-column: 1 / -1;
    }
}

/* Clickable metric tiles on Overview licence cards */
a.ep-metric--clickable,
.ep-metric--clickable {
    position: relative;
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 6px;
    min-height: 104px;
    padding: 12px 12px 10px !important;
    margin: 0 !important;
    border: 1px solid #e8eaef !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: none !important;
    text-decoration: none !important;
    color: inherit !important;
    text-align: left !important;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

a.ep-metric--clickable:hover,
.ep-metric--clickable:hover {
    border-color: rgba(236, 46, 94, 0.35) !important;
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.07) !important;
    transform: translateY(-1px);
    background: #fffafb !important;
    color: inherit !important;
    text-decoration: none !important;
}

a.ep-metric--clickable:focus-visible,
.ep-metric--clickable:focus-visible {
    outline: 2px solid rgba(236, 46, 94, 0.45);
    outline-offset: 2px;
}

a.ep-metric--clickable:active,
.ep-metric--clickable:active {
    transform: translateY(0);
}

.ep-metric__head {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.ep-metric__icon {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    background: #f3f4f6;
    color: #6b7280;
}

.ep-metric--credits .ep-metric__icon {
    background: linear-gradient(145deg, rgba(236, 46, 94, 0.14), rgba(236, 46, 94, 0.05));
    color: #be123c;
}

/* Credits available - traffic-light emphasis */
.ep-metric__value--credits {
    font-size: 28px !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em;
    line-height: 1.1 !important;
    font-variant-numeric: tabular-nums;
}

.ep-metric.ep-credits--high,
a.ep-metric.ep-credits--high {
    border-color: rgba(16, 185, 129, 0.4) !important;
    background:
        linear-gradient(165deg, rgba(236, 253, 245, 0.95) 0%, #ffffff 58%) !important;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.08), 0 8px 18px rgba(16, 185, 129, 0.08) !important;
}

.ep-metric.ep-credits--high .ep-metric__icon {
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.08));
    color: #059669;
}

.ep-metric.ep-credits--high .ep-metric__value--credits,
.ep-metric__value--credits.ep-credits--high {
    color: #047857 !important;
}

.ep-metric.ep-credits--low,
a.ep-metric.ep-credits--low {
    border-color: rgba(245, 158, 11, 0.45) !important;
    background:
        linear-gradient(165deg, rgba(255, 251, 235, 0.98) 0%, #ffffff 58%) !important;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.1), 0 8px 18px rgba(245, 158, 11, 0.1) !important;
}

.ep-metric.ep-credits--low .ep-metric__icon {
    background: linear-gradient(145deg, rgba(245, 158, 11, 0.22), rgba(245, 158, 11, 0.08));
    color: #d97706;
}

.ep-metric.ep-credits--low .ep-metric__value--credits,
.ep-metric__value--credits.ep-credits--low {
    color: #b45309 !important;
}

.ep-metric.ep-credits--zero,
a.ep-metric.ep-credits--zero {
    border-color: rgba(239, 68, 68, 0.42) !important;
    background:
        linear-gradient(165deg, rgba(254, 242, 242, 0.98) 0%, #ffffff 58%) !important;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.1), 0 8px 18px rgba(239, 68, 68, 0.1) !important;
}

.ep-metric.ep-credits--zero .ep-metric__icon {
    background: linear-gradient(145deg, rgba(239, 68, 68, 0.18), rgba(239, 68, 68, 0.08));
    color: #dc2626;
}

.ep-metric.ep-credits--zero .ep-metric__value--credits,
.ep-metric__value--credits.ep-credits--zero {
    color: #b91c1c !important;
}

.ep-licence-card--disabled .ep-metric.ep-credits--high,
.ep-licence-card--disabled .ep-metric.ep-credits--low,
.ep-licence-card--disabled .ep-metric.ep-credits--zero {
    opacity: 0.92;
}

.ep-metric--renewal .ep-metric__icon {
    background: linear-gradient(145deg, rgba(14, 165, 233, 0.16), rgba(14, 165, 233, 0.05));
    color: #0284c7;
}

.ep-metric--usage .ep-metric__icon {
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.16), rgba(16, 185, 129, 0.05));
    color: #059669;
}

.ep-metric--api .ep-metric__icon {
    background: linear-gradient(145deg, rgba(124, 58, 237, 0.14), rgba(124, 58, 237, 0.05));
    color: #7c3aed;
}

.ep-metric--clickable .ep-metric__label {
    width: auto;
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
}

.ep-metric--clickable .ep-metric__value {
    width: 100%;
}

.ep-metric__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 4px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #be123c;
    opacity: 0.92;
}

.ep-metric--api .ep-metric__value {
    word-break: normal;
}

.ep-metric--api .ep-metric__value--lg {
    color: #5b21b6;
}

/* ---------- Auto-renewal status (live automation) ---------- */
.ep-auto-status {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.ep-auto-status__live-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ep-auto-status__pulse {
    position: relative;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55);
    animation: ep-auto-pulse 1.6s ease-out infinite;
    flex: 0 0 auto;
}

.ep-auto-status__pulse::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(16, 185, 129, 0.35);
    animation: ep-auto-ring 1.6s ease-out infinite;
}

.ep-auto-status__badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.ep-auto-status__badge--muted {
    background: #f3f4f6;
    color: #4b5563;
    border-color: #e5e7eb;
}

.ep-auto-status__badge--off {
    background: #f3f4f6;
    color: #6b7280;
    border-color: #e5e7eb;
}

.ep-auto-status__badge--danger {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.ep-auto-status__detail {
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.35;
    color: #374151;
}

.ep-metric--auto-live {
    border-color: rgba(16, 185, 129, 0.4) !important;
    background:
        linear-gradient(165deg, rgba(236, 253, 245, 0.95) 0%, #ffffff 55%) !important;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.08), 0 8px 20px rgba(16, 185, 129, 0.08) !important;
}

.ep-metric--auto-live .ep-metric__icon {
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.08));
    color: #059669;
    animation: ep-auto-spin-soft 3.2s linear infinite;
}

.ep-metric--auto-live::before {
    content: "";
    position: absolute;
    top: 0;
    left: -40%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.08), transparent);
    animation: ep-auto-sheen 2.8s ease-in-out infinite;
    pointer-events: none;
}

.ep-metric--auto-on {
    border-color: rgba(14, 165, 233, 0.28) !important;
    background: linear-gradient(165deg, rgba(240, 249, 255, 0.9) 0%, #ffffff 60%) !important;
}

.ep-metric--auto-off {
    /* default tile look */
}

@keyframes ep-auto-pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes ep-auto-ring {
    0% { transform: scale(0.7); opacity: 0.9; }
    100% { transform: scale(1.55); opacity: 0; }
}

@keyframes ep-auto-spin-soft {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes ep-auto-sheen {
    0% { left: -45%; }
    55% { left: 110%; }
    100% { left: 110%; }
}

@media (prefers-reduced-motion: reduce) {
    .ep-auto-status__pulse,
    .ep-auto-status__pulse::after,
    .ep-metric--auto-live .ep-metric__icon,
    .ep-metric--auto-live::before {
        animation: none !important;
    }
}

/* ---------- API keys form (aligned with licence manager) ---------- */
.ep-api-form .ep-lm-form__title {
    font-size: 18px;
}

.ep-api-form__header-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
}

.ep-api-form__meta-sep {
    color: #9ca3af;
}

.ep-api-key-card__account {
    font-weight: 700;
    color: #374151;
}

.ep-api-form__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 18px;
}

.ep-api-form__hosts {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ep-api-host {
    padding: 18px 20px 20px;
    border: 1px solid #e6e8ee;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfbfc 100%);
    box-shadow: var(--ep-dash-shadow-sm, 0 4px 14px rgba(17, 24, 39, 0.05));
}

.ep-api-host__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin: 0 0 16px;
    padding: 0 0 14px;
    border-bottom: 1px solid #eef2f7;
}

.ep-api-host__key-wrap {
    min-width: 0;
    flex: 1 1 auto;
}

.ep-api-host__key-label {
    display: block;
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #6b7280;
}

.ep-api-host__key-meta {
    display: block;
    margin: 0 0 8px;
    font-size: 12.5px;
    color: #6b7280;
    font-weight: 600;
}

.ep-api-host__key-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ep-api-host__key {
    display: block;
    margin: 0;
    padding: 12px 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    word-break: break-all;
    line-height: 1.45;
    min-width: 0;
    flex: 1 1 auto;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-sizing: border-box;
}

.ep-api-host__copy,
.ep-api-host__delete {
    flex: 0 0 auto;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 11px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    box-shadow: none !important;
    line-height: 1 !important;
    font-size: 0 !important; /* hide text node; icon via :before */
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease, color 0.15s ease;
}

.ep-api-host__copy {
    border: 1px solid #e5e7eb !important;
    background: #f9fafb !important;
    color: #374151 !important;
}

.ep-api-host__copy:before {
    content: "\f0c5"; /* fa-copy / fa-files-o */
    font-family: FontAwesome;
    font-size: 15px;
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    display: block;
    speak: none;
}

.ep-api-host__copy:hover {
    background: #eef2ff !important;
    border-color: #c7d2fe !important;
    color: #4338ca !important;
    transform: translateY(-1px);
}

.ep-api-host__copy.is-copied {
    background: #ecfdf5 !important;
    border-color: #a7f3d0 !important;
    color: #047857 !important;
}

.ep-api-host__copy.is-copied:before {
    content: "\f00c"; /* fa-check */
}

.ep-api-host__copy.is-copy-failed {
    background: #fef2f2 !important;
    border-color: #fecaca !important;
    color: #b91c1c !important;
}

.ep-api-host__copy:focus-visible {
    outline: 2px solid rgba(67, 56, 202, 0.4);
    outline-offset: 2px;
}

.ep-api-host__delete {
    border: 1px solid #fecaca !important;
    background: #fff5f5 !important;
    color: #be123c !important;
}

.ep-api-host__delete:before {
    content: "\f1f8"; /* fa-trash */
    font-family: FontAwesome;
    font-size: 16px;
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    display: block;
    speak: none;
}

.ep-api-host__delete:hover {
    background: #fee2e2 !important;
    border-color: #fca5a5 !important;
    color: #9f1239 !important;
    transform: translateY(-1px);
}

.ep-api-host__delete:focus-visible {
    outline: 2px solid rgba(190, 18, 60, 0.4);
    outline-offset: 2px;
}

.ep-api-host__fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(140px, 200px);
    gap: 14px 18px;
}

.ep-api-host__fields .ep-lm-field--full {
    grid-column: 1 / -1;
}

.ep-api-host__input {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 11px 13px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    color: #111827;
    background: #fff;
    min-height: 44px;
}

.ep-api-host__input:focus {
    outline: none;
    border-color: rgba(236, 46, 94, 0.45);
    box-shadow: 0 0 0 3px rgba(236, 46, 94, 0.12);
}

.ep-api-host__input--narrow {
    max-width: 160px;
}

.ep-api-host-empty {
    padding: 16px;
    border: 1px dashed #e5e7eb;
    border-radius: 12px;
    background: #f8fafc;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

.ep-api-key-card {
    margin: 0 0 14px;
}

.ep-api-key-card__head {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ep-dash-border);
}

.ep-api-key-card__master-name {
    display: block;
    font-size: 17px;
    font-weight: 800;
    color: #9f1239;
    margin: 0 0 4px;
}

.ep-api-key-card__master-meta {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7280;
    margin: 0 0 8px;
}

.ep-api-key-card__master-key {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    color: #111827;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 6px 8px;
    margin: 0 8px 0 0;
    word-break: break-all;
}

.ep-api-key-card__master-credits {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

@media (max-width: 720px) {
    .ep-api-host__fields {
        grid-template-columns: 1fr;
    }

    .ep-api-host__input--narrow {
        max-width: 100%;
    }

    .ep-api-form__toolbar .button {
        flex: 1 1 auto;
        text-align: center;
    }
}

.ep-api-keys__list,
.ep-licence-manager__list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ep-licence-manager__intro {
    margin: 0 0 4px;
}

.ep-licence-manager__heading {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ep-dash-ink, #111827);
}

/* ---------- Licence manager form card ---------- */
.ep-lm-form {
    margin: 0;
    border: 1px solid var(--ep-dash-border, #e6e8ee);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(17, 24, 39, 0.06);
    overflow: hidden;
}

.ep-lm-form__header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid #eef2f7;
    background:
        linear-gradient(135deg, rgba(236, 46, 94, 0.06) 0%, rgba(255, 255, 255, 0.95) 55%, #f8fafc 100%);
}

.ep-lm-form__header-icon {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(236, 46, 94, 0.14), rgba(236, 46, 94, 0.05));
    color: #be123c;
    font-size: 18px;
}

.ep-lm-form__header-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.ep-lm-form__eyebrow {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
}

.ep-lm-form__title {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #111827;
    word-break: break-all;
    line-height: 1.35;
}

.ep-lm-form__subtitle {
    margin: 6px 0 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}

.ep-lm-form__subtitle:empty {
    display: none;
}

.ep-lm-form__body {
    padding: 8px 20px 4px;
}

.ep-lm-section {
    padding: 16px 0;
    border-bottom: 1px solid #f1f5f9;
}

.ep-lm-section:last-child {
    border-bottom: none;
}

.ep-lm-section__head {
    margin: 0 0 14px;
}

.ep-lm-section__title {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 800;
    color: #111827;
}

.ep-lm-section__desc {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.45;
    color: #6b7280;
    max-width: 62ch;
}

.ep-lm-section__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ep-lm-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
}

.ep-lm-field {
    min-width: 0;
}

.ep-lm-field--full {
    grid-column: 1 / -1;
}

.ep-lm-field__label {
    display: block;
    margin: 0 0 4px;
    font-size: 12.5px;
    font-weight: 700;
    color: #374151;
}

.ep-lm-field__hint {
    margin: 0 0 8px;
    font-size: 12px;
    line-height: 1.45;
    color: #6b7280;
}

.ep-lm-field__value {
    margin-top: 2px;
}

.ep-lm-field__control {
    max-width: 100%;
}

.ep-lm-field__control--narrow {
    max-width: 160px;
}

.ep-lm-field__control--wide {
    max-width: 100%;
}

.ep-lm-field__control--date {
    max-width: 240px;
}

.ep-lm-form .ep-lm-field__control--date .RadDatePicker,
.ep-lm-form .ep-lm-field__control--date .RadPicker {
    width: 100% !important;
    max-width: 100%;
}

.ep-lm-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #111827;
    font-size: 12.5px;
    font-weight: 700;
}

.ep-lm-toggle-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid #e6e8ee;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfbfc 100%);
}

.ep-lm-toggle-card__copy {
    min-width: 0;
    flex: 1 1 auto;
}

.ep-lm-toggle-card__title {
    margin: 0 0 4px;
    font-size: 13.5px;
    font-weight: 700;
    color: #111827;
}

.ep-lm-toggle-card__hint {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.45;
    color: #6b7280;
}

.ep-lm-subpanel {
    margin-top: 4px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid #eef2f7;
    background: #f8fafc;
}

.ep-lm-subpanel--muted {
    background: #fafbfc;
}

.ep-lm-subpanel__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
    margin: 0 0 14px;
}

.ep-lm-subpanel__kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #9f1239;
}

.ep-lm-subpanel__note {
    font-size: 12px;
    color: #6b7280;
}

.ep-lm-form__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px 18px;
    border-top: 1px solid #eef2f7;
    background: #fcfcfd;
}

.ep-lm-form__footer-note {
    font-size: 12.5px;
    color: #6b7280;
}

.ep-lm-form__save {
    min-width: 140px;
    text-align: center;
}

.ep-lm-pay-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    margin: 4px 0 12px;
}

.ep-lm-pay-brand {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin-left: auto;
    flex: 0 0 auto;
    width: max-content;
}

.ep-lm-pay-brand__label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9ca3af;
    white-space: nowrap;
}

.ep-dash .ep-lm-pay-brand__logo,
.ep-lm-pay-brand img.ep-lm-pay-brand__logo,
.ep-lm-pay-brand__logo {
    display: block !important;
    width: 1px !important;
    min-width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
}

.ep-lm-sla-offer {
    margin-top: 4px;
}

.ep-lm-sla-offer .ep-service-offer {
    flex-direction: row;
    align-items: center;
    gap: 16px;
}

.ep-lm-sla-offer .ep-service-offer__copy {
    flex: 1 1 auto;
    min-width: 0;
}

.ep-lm-sla-offer .ep-service-offer__action {
    margin-top: 0;
    padding-top: 0;
    flex: 0 0 auto;
}

.ep-lm-sla-offer .ep-service-offer__button {
    width: auto;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .ep-lm-sla-offer .ep-service-offer {
        flex-direction: column;
        align-items: stretch;
    }

    .ep-lm-sla-offer .ep-service-offer__button {
        width: 100%;
        min-height: 44px;
    }

    .ep-lm-pay-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .ep-lm-pay-choices {
        width: 100%;
        flex-direction: column;
    }

    .ep-lm-pay-choice {
        width: 100%;
        min-height: 44px;
        padding: 10px 12px !important;
    }

    .ep-lm-pay-choice__text {
        white-space: normal;
    }

    .ep-lm-pay-brand {
        display: none !important;
    }
}

.ep-lm-pay-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
}

.ep-lm-pay-choice {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    margin: 0 !important;
    padding: 8px 12px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: #111827 !important;
    text-decoration: none !important;
    box-sizing: border-box;
    cursor: pointer;
}

.ep-lm-pay-choice input[type="radio"] {
    margin: 0 !important;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    accent-color: #ec2e5e;
}

.ep-lm-pay-choice__text {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
}

.ep-dash .ep-lm-pay-choice__logo,
.ep-lm-pay-choice img.ep-lm-pay-choice__logo,
.ep-lm-pay-choice__logo {
    display: block !important;
    height: 14px !important;
    width: auto !important;
    max-height: 14px !important;
    max-width: 78px !important;
    object-fit: contain !important;
    flex: 0 0 auto !important;
}

.ep-lm-pay-choice__badge {
    flex: 0 0 auto;
    padding: 2px 7px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ep-lm-pay-choice:hover {
    border-color: #d1d5db !important;
}

.ep-lm-pay-choice--selected {
    border-color: rgba(236, 46, 94, 0.45) !important;
    background: #fff7f9 !important;
    box-shadow: 0 0 0 3px rgba(236, 46, 94, 0.1);
}

.ep-lm-pay-choice--disabled,
.ep-lm-pay-choice--disabled:hover {
    opacity: 0.65;
    cursor: not-allowed !important;
    background: #f8fafc !important;
    box-shadow: none;
}

.ep-lm-payment-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin: 4px 0 8px;
}

.ep-lm-payment-options label,
.ep-lm-payment-options td {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    margin: 0 !important;
    padding: 10px 14px !important;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    cursor: pointer;
}

.ep-lm-payment-options input[type="radio"] {
    margin: 0 !important;
}

.ep-lm-payment-options input[type="radio"]:checked + label,
.ep-lm-payment-options label:has(input:checked) {
    border-color: rgba(236, 46, 94, 0.45);
    background: #fff7f9;
    box-shadow: 0 0 0 3px rgba(236, 46, 94, 0.1);
}

.ep-lm-payment-note {
    margin: 0 0 6px;
    font-size: 12.5px;
    color: #9f1239;
}

.ep-lm-payment-note--info {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #fdba74;
    background: #fff7ed;
    color: #9a3412;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.45;
}

.ep-lm-payment-note--info strong {
    color: #7c2d12;
    font-weight: 800;
}

.ep-lm-card-panel {
    margin-top: 4px;
    padding: 14px 16px;
    border: 1px solid #e6e8ee;
    border-radius: 12px;
    background: #fff;
}

.ep-lm-card-panel__body {
    margin-top: 10px;
}

/* Card manager list polish inside licence manager */
.ep-lm-card-panel .ep-card-mgr__item {
    border-radius: 10px;
}

.ep-lm-card-panel .ep-card-mgr__add {
    margin-top: 4px;
}

/* Organisation payment cards tab */
.ep-org-cards__panel {
    margin-top: 4px;
    padding: 16px 18px;
    border: 1px solid var(--ep-dash-border, #e6e8ee);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--ep-dash-shadow-sm, 0 4px 14px rgba(17, 24, 39, 0.05));
}

/* Telerik inputs fill their control wrappers cleanly */
.ep-lm-form .RadInput,
.ep-lm-form .RadInput_Bootstrap,
.ep-lm-form .riSingle,
.ep-lm-form .RadComboBox,
.ep-lm-form .RadComboBox_Bootstrap {
    width: 100% !important;
    max-width: 100%;
}

.ep-lm-form .RadInput .riTextBox,
.ep-lm-form .RadInput_Bootstrap .riTextBox {
    width: 100% !important;
    box-sizing: border-box;
    border-radius: 8px !important;
    min-height: 38px;
    padding: 8px 11px !important;
    border-color: #e5e7eb !important;
    color: #111827 !important;
}

.ep-lm-form .RadInput .riTextBox:focus,
.ep-lm-form .RadInput_Bootstrap .riTextBox:focus {
    border-color: rgba(236, 46, 94, 0.45) !important;
    box-shadow: 0 0 0 3px rgba(236, 46, 94, 0.12);
}

.ep-lm-form .RadComboBox .rcbInputCell,
.ep-lm-form .RadComboBox_Bootstrap .rcbInputCell {
    border-radius: 8px 0 0 8px;
}

.ep-lm-form .RadComboBox .rcbArrowCell,
.ep-lm-form .RadComboBox_Bootstrap .rcbArrowCell {
    border-radius: 0 8px 8px 0;
}

@media (max-width: 720px) {
    .ep-lm-grid {
        grid-template-columns: 1fr;
    }

    .ep-lm-toggle-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .ep-lm-field__control--narrow {
        max-width: 100%;
    }

    .ep-lm-form__footer {
        flex-direction: column;
        align-items: stretch;
    }

    .ep-lm-form__save {
        width: 100%;
    }
}

/* Master key selector on API Keys / Licence Manager */
.ep-api-keys__selector {
    margin: 0 0 18px;
    padding: 16px 18px;
    border: 1px solid var(--ep-dash-border);
    border-radius: var(--ep-dash-radius-sm);
    background: linear-gradient(180deg, #ffffff 0%, #fbfbfc 100%);
    box-shadow: var(--ep-dash-shadow-sm);
}

.ep-api-keys__selector-head {
    margin: 0 0 12px;
}

.ep-api-keys__selector-label {
    display: block;
    font-size: 14px;
    font-weight: 800;
    color: var(--ep-dash-ink);
}

.ep-api-keys__selector-hint {
    margin: 4px 0 0;
    font-size: 12.5px;
    color: var(--ep-dash-muted);
}

.ep-api-keys__selector-body {
    display: block;
}

.ep-api-keys__dropdown {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--ep-dash-border);
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    color: var(--ep-dash-ink);
    box-sizing: border-box;
}

.ep-api-keys__dropdown:focus {
    outline: none;
    border-color: rgba(236, 46, 94, 0.45);
    box-shadow: 0 0 0 3px rgba(236, 46, 94, 0.12);
}

/* ---------- Licence Manager: highly visible master-licence switcher ---------- */
.ep-master-selector {
    position: relative;
    overflow: hidden;
    padding: 0;
    border: 2px solid rgba(236, 46, 94, 0.28);
    border-radius: 16px;
    background:
        linear-gradient(165deg, #fff7f9 0%, #ffffff 48%, #fbfbfc 100%);
    box-shadow:
        0 0 0 1px rgba(236, 46, 94, 0.06),
        0 10px 28px rgba(236, 46, 94, 0.08),
        var(--ep-dash-shadow-sm, 0 4px 14px rgba(17, 24, 39, 0.05));
}

.ep-master-selector__banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: linear-gradient(90deg, rgba(236, 46, 94, 0.12), rgba(236, 46, 94, 0.04));
    border-bottom: 1px solid rgba(236, 46, 94, 0.14);
    color: #9f1239;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ep-master-selector__banner-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(236, 46, 94, 0.18), rgba(236, 46, 94, 0.08));
    color: #be123c;
    font-size: 13px;
}

.ep-master-selector__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px 16px;
    margin: 0;
    padding: 14px 16px 8px;
}

.ep-master-selector__label {
    font-size: 15px;
    color: #9f1239;
}

.ep-master-selector__hint {
    max-width: 48ch;
    font-size: 13px;
    line-height: 1.45;
    color: #4b5563;
}

.ep-master-selector__body {
    padding: 4px 16px 16px;
}

.ep-master-selector__control {
    position: relative;
    display: block;
}

.ep-master-selector__control-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(236, 46, 94, 0.14), rgba(236, 46, 94, 0.05));
    color: #be123c;
    font-size: 14px;
    pointer-events: none;
}

.ep-master-selector__chevron {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #fff7f9, #ffe4ec);
    border: 1px solid rgba(236, 46, 94, 0.22);
    color: #be123c;
    font-size: 12px;
    pointer-events: none;
    box-shadow: 0 1px 2px rgba(190, 18, 60, 0.08);
}

.ep-master-selector__dropdown,
select.ep-master-selector__dropdown {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 52px !important;
    padding: 12px 52px 12px 52px !important;
    border: 2px solid rgba(236, 46, 94, 0.35) !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: #111827 !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    cursor: pointer;
    box-shadow:
        0 1px 2px rgba(17, 24, 39, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.ep-master-selector__dropdown:hover {
    border-color: rgba(236, 46, 94, 0.55) !important;
    background: #fffafb !important;
}

.ep-master-selector__dropdown:focus {
    outline: none !important;
    border-color: #ec2e5e !important;
    box-shadow:
        0 0 0 4px rgba(236, 46, 94, 0.16),
        0 1px 2px rgba(17, 24, 39, 0.04) !important;
}

/* Hide IE/Edge native select arrow so our chevron is the only one */
.ep-master-selector__dropdown::-ms-expand {
    display: none;
}

.ep-master-selector__footnote {
    margin: 10px 2px 0;
    font-size: 12px;
    line-height: 1.45;
    color: #6b7280;
}

.ep-master-selector__footnote::before {
    content: "\f05a"; /* fa-info-circle */
    font-family: FontAwesome;
    margin-right: 6px;
    color: #be123c;
}

@media (max-width: 640px) {
    .ep-master-selector__head {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 12px 6px;
    }

    .ep-master-selector__body {
        padding: 2px 12px 14px;
    }

    .ep-master-selector__dropdown,
    select.ep-master-selector__dropdown {
        min-height: 48px !important;
        font-size: 16px !important; /* avoid iOS zoom */
    }
}

.ep-licence-card:hover {
    border-color: rgba(236, 46, 94, 0.28);
    box-shadow: 0 12px 28px rgba(17, 24, 39, 0.08);
}

.ep-licence-card__identity {
    min-width: 0;
}

/* Prominent licence type chip on Overview cards */
.ep-licence-card__type {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin: 0 0 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: linear-gradient(145deg, #f8fafc 0%, #f3f4f6 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
    max-width: 100%;
}

.ep-licence-card__type-kicker {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
}

.ep-licence-card__type-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    width: 100%;
}

.ep-licence-card__type-icon {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: #e5e7eb;
    color: #374151;
}

.ep-licence-card__type-name {
    min-width: 0;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.25;
    color: #111827;
    word-break: break-word;
}

.ep-licence-card__type--cop {
    border-color: rgba(16, 185, 129, 0.28);
    background: linear-gradient(145deg, #ecfdf5 0%, #f0fdf4 100%);
}
.ep-licence-card__type--cop .ep-licence-card__type-icon {
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.08));
    color: #059669;
}
.ep-licence-card__type--cop .ep-licence-card__type-name { color: #065f46; }
.ep-licence-card__type--cop .ep-licence-card__type-kicker { color: #047857; }

.ep-licence-card__type--sla {
    border-color: rgba(14, 165, 233, 0.28);
    background: linear-gradient(145deg, #f0f9ff 0%, #e0f2fe 100%);
}
.ep-licence-card__type--sla .ep-licence-card__type-icon {
    background: linear-gradient(145deg, rgba(14, 165, 233, 0.2), rgba(14, 165, 233, 0.08));
    color: #0284c7;
}
.ep-licence-card__type--sla .ep-licence-card__type-name { color: #0c4a6e; }
.ep-licence-card__type--sla .ep-licence-card__type-kicker { color: #0369a1; }

.ep-licence-card__type--downloads {
    border-color: rgba(124, 58, 237, 0.25);
    background: linear-gradient(145deg, #f5f3ff 0%, #ede9fe 100%);
}
.ep-licence-card__type--downloads .ep-licence-card__type-icon {
    background: linear-gradient(145deg, rgba(124, 58, 237, 0.18), rgba(124, 58, 237, 0.08));
    color: #7c3aed;
}
.ep-licence-card__type--downloads .ep-licence-card__type-name { color: #5b21b6; }
.ep-licence-card__type--downloads .ep-licence-card__type-kicker { color: #6d28d9; }

.ep-licence-card__type--modulus,
.ep-licence-card__type--postcode,
.ep-licence-card__type--credits {
    border-color: rgba(236, 46, 94, 0.24);
    background: linear-gradient(145deg, #fff7f9 0%, #fff1f4 100%);
}
.ep-licence-card__type--modulus .ep-licence-card__type-icon,
.ep-licence-card__type--postcode .ep-licence-card__type-icon,
.ep-licence-card__type--credits .ep-licence-card__type-icon {
    background: linear-gradient(145deg, rgba(236, 46, 94, 0.16), rgba(236, 46, 94, 0.06));
    color: #be123c;
}
.ep-licence-card__type--modulus .ep-licence-card__type-name,
.ep-licence-card__type--postcode .ep-licence-card__type-name,
.ep-licence-card__type--credits .ep-licence-card__type-name { color: #9f1239; }
.ep-licence-card__type--modulus .ep-licence-card__type-kicker,
.ep-licence-card__type--postcode .ep-licence-card__type-kicker,
.ep-licence-card__type--credits .ep-licence-card__type-kicker { color: #be123c; }

.ep-licence-card--disabled .ep-licence-card__type {
    opacity: 0.92;
    filter: grayscale(0.15);
}

.ep-licence-card__title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin: 0 0 6px;
}

.ep-licence-card__name {
    font-size: 16px;
    font-weight: 700;
    color: #9f1239;
    margin: 0;
    word-break: break-word;
    flex: 1 1 auto;
    min-width: 0;
}

/* Edit pencil → Licence Manager with this key selected */
a.ep-licence-card__edit,
.ep-licence-card__edit {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: #374151 !important;
    text-decoration: none !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

a.ep-licence-card__edit:hover,
.ep-licence-card__edit:hover {
    background: #fff7f9 !important;
    border-color: rgba(236, 46, 94, 0.35) !important;
    color: #be123c !important;
    text-decoration: none !important;
    transform: translateY(-1px);
}

a.ep-licence-card__edit:focus-visible,
.ep-licence-card__edit:focus-visible {
    outline: 2px solid rgba(236, 46, 94, 0.45);
    outline-offset: 2px;
}

.ep-licence-card__edit i {
    font-size: 14px;
    line-height: 1;
}

.ep-licence-card__edit-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ep-licence-card--disabled .ep-licence-card__edit {
    color: #6b7280 !important;
    background: #f9fafb !important;
}

.ep-licence-card__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.2;
    border: 1px solid transparent;
}

.ep-licence-card__status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
}

.ep-licence-card__status--enabled {
    color: #065f46;
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border-color: rgba(16, 185, 129, 0.35);
}

.ep-licence-card__status--disabled {
    color: #6b7280;
    background: #f3f4f6;
    border-color: #e5e7eb;
}

.ep-licence-card--enabled {
    border-color: rgba(16, 185, 129, 0.28);
    box-shadow:
        0 0 0 1px rgba(16, 185, 129, 0.06),
        var(--ep-dash-shadow-sm, 0 4px 14px rgba(17, 24, 39, 0.05));
    background:
        linear-gradient(180deg, #f0fdf8 0%, #ffffff 42%, #fbfbfc 100%);
}

.ep-licence-card--enabled::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: linear-gradient(180deg, #10b981, #059669);
    pointer-events: none;
}

.ep-licence-card--disabled {
    border-color: #e5e7eb;
    background:
        linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
    box-shadow: none;
    opacity: 0.96;
}

.ep-licence-card--disabled::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: #9ca3af;
    pointer-events: none;
}

.ep-licence-card--disabled .ep-licence-card__name {
    color: #4b5563;
}

.ep-licence-card--disabled .ep-metric--clickable {
    background: #fafafa !important;
    border-color: #e8eaef !important;
}

.ep-licence-card--disabled .ep-metric__value--lg {
    color: #6b7280;
}

/* Position accent bar */
.ep-licence-card {
    position: relative;
    padding-left: 20px;
}

.ep-licence-card__key {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    color: #374151;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 6px 8px;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ep-licence-card__account {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    margin-top: 8px;
    min-width: 0;
}

.ep-licence-card__account-label {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #6b7280;
}

.ep-licence-card__account-name {
    font-size: 13.5px;
    font-weight: 700;
    color: #111827;
    word-break: break-word;
    min-width: 0;
}

.ep-licence-card--disabled .ep-licence-card__account-name {
    color: #4b5563;
}

/* Organisation + account with view → Account Details */
.ep-licence-card__party {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #eef2f7;
    background: #fafbfc;
    min-width: 0;
}

.ep-licence-card__party-rows {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ep-licence-card__party-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
}

.ep-licence-card__party-label {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #6b7280;
}

.ep-licence-card__party-value {
    font-size: 13.5px;
    font-weight: 700;
    color: #111827;
    word-break: break-word;
    line-height: 1.3;
}

.ep-licence-card--disabled .ep-licence-card__party-value {
    color: #4b5563;
}

a.ep-licence-card__view,
.ep-licence-card__view {
    position: relative;
    display: inline-flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 0 0 auto;
    align-self: center;
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    margin: 0 !important;
    padding: 6px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: #374151 !important;
    text-decoration: none !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

a.ep-licence-card__view:hover,
.ep-licence-card__view:hover {
    background: #eff6ff !important;
    border-color: rgba(37, 99, 235, 0.35) !important;
    color: #1d4ed8 !important;
    text-decoration: none !important;
    transform: translateY(-1px);
}

a.ep-licence-card__view:focus-visible,
.ep-licence-card__view:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.45);
    outline-offset: 2px;
}

.ep-licence-card__view i {
    font-size: 15px;
    line-height: 1;
}

.ep-licence-card__view-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ep-licence-card--disabled .ep-licence-card__view {
    color: #6b7280 !important;
    background: #f9fafb !important;
}

.ep-licence-card__meta {
    margin-top: 8px;
    font-size: 12px;
    color: var(--ep-dash-muted);
    font-style: italic;
}

.ep-metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
}

.ep-metric__label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7280;
}

.ep-metric__value {
    font-size: 18px;
    font-weight: 700;
    color: var(--ep-dash-ink);
    line-height: 1.25;
    word-break: break-word;
}

.ep-metric__value--lg {
    font-size: 24px;
    color: #9f1239;
}

.ep-metric__value--sm {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.ep-licence-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ---------- Available services (missing licence types) ---------- */
.ep-available-services {
    margin: 0 0 22px;
}

.ep-service-offer-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.ep-service-offer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 16px 14px;
    border: 1px dashed rgba(236, 46, 94, 0.28);
    border-radius: 14px;
    background:
        linear-gradient(165deg, #fffafb 0%, #ffffff 48%, #fbfbfc 100%);
    box-shadow: var(--ep-dash-shadow-sm, 0 4px 14px rgba(17, 24, 39, 0.05));
    min-height: 100%;
}

.ep-service-offer__icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: linear-gradient(145deg, rgba(236, 46, 94, 0.14), rgba(236, 46, 94, 0.05));
    color: #be123c;
}

.ep-service-offer--cop .ep-service-offer__icon {
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.16), rgba(16, 185, 129, 0.05));
    color: #059669;
}

.ep-service-offer--sla .ep-service-offer__icon {
    background: linear-gradient(145deg, rgba(14, 165, 233, 0.16), rgba(14, 165, 233, 0.05));
    color: #0284c7;
}

.ep-service-offer--downloads .ep-service-offer__icon {
    background: linear-gradient(145deg, rgba(124, 58, 237, 0.14), rgba(124, 58, 237, 0.05));
    color: #7c3aed;
}

.ep-service-offer--modulus .ep-service-offer__icon,
.ep-service-offer--postcode .ep-service-offer__icon {
    background: linear-gradient(145deg, rgba(236, 46, 94, 0.14), rgba(236, 46, 94, 0.05));
    color: #be123c;
}

.ep-service-offer__title {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.01em;
}

.ep-service-offer__desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #4b5563;
}

.ep-service-offer__action {
    margin-top: auto;
    padding-top: 4px;
}

.ep-service-offer__button {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
}

@media (max-width: 640px) {
    .ep-service-offer-list {
        grid-template-columns: 1fr;
    }
}

.ep-detail-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ep-detail-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 12px 14px;
    margin: 0;
    border-radius: 10px;
    background: #fafbfc;
    border: 1px solid #eef2f7;
}

.ep-credit-transfers__history {
    margin-top: 8px;
}

.ep-credit-transfers__summary {
    margin: 0 0 20px;
}

.ep-licence-card--compact {
    grid-template-columns: minmax(0, 1.6fr) minmax(140px, 0.6fr);
}

.ep-callout--subtle {
    background: #f8fafc;
    border-style: dashed;
}

/* ---------- Licence manager toggle switches ---------- */
.ep-switch-row {
    margin: 0 0 16px;
}

.ep-switch-row__label {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ep-dash-ink, #111827);
}

.ep-switch-field {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.ep-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

/* ASP.NET CheckBox with CssClass wraps the input in a span.
   Stretch the real input over the slider so AutoPostBack still works. */
.ep-switch__input {
    position: absolute !important;
    left: 0 !important;
    top: 50% !important;
    transform: translateY(-50%);
    width: 48px !important;
    height: 28px !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 2;
    overflow: hidden;
}

.ep-switch__input input[type="checkbox"] {
    position: absolute;
    left: 0;
    top: 0;
    width: 48px;
    height: 28px;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 3;
}

.ep-switch__slider {
    position: relative;
    flex: 0 0 auto;
    width: 48px;
    height: 28px;
    border-radius: 999px;
    background: #d1d5db;
    border: 1px solid #c4c9d2;
    box-shadow: inset 0 1px 2px rgba(17, 24, 39, 0.08);
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    pointer-events: none;
}

.ep-switch__slider::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(17, 24, 39, 0.22);
    transition: transform 0.18s ease;
}

/* When checkbox is checked, style the following slider (input is inside .ep-switch__input span) */
.ep-switch__input:has(input:checked) + .ep-switch__slider,
.ep-switch:has(input:checked) .ep-switch__slider {
    background: linear-gradient(145deg, #ec2e5e, #be123c);
    border-color: rgba(190, 18, 60, 0.55);
    box-shadow: 0 0 0 3px rgba(236, 46, 94, 0.12);
}

.ep-switch__input:has(input:checked) + .ep-switch__slider::after,
.ep-switch:has(input:checked) .ep-switch__slider::after {
    transform: translateX(20px);
}

.ep-switch:has(input:focus-visible) .ep-switch__slider {
    outline: 2px solid rgba(236, 46, 94, 0.45);
    outline-offset: 2px;
}

.ep-switch__state {
    min-width: 4.5rem;
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
}

.ep-switch__state-on {
    display: none;
    color: #9f1239;
}

.ep-switch__state-off {
    display: inline;
}

.ep-switch:has(input:checked) .ep-switch__state-on {
    display: inline;
}

.ep-switch:has(input:checked) .ep-switch__state-off {
    display: none;
}

.ep-switch-row__hint {
    margin: 0;
    max-width: 52ch;
    font-size: 12.5px;
    line-height: 1.45;
    color: #6b7280;
    font-style: italic;
}

.ep-switch:hover .ep-switch__slider {
    border-color: #9ca3af;
}

.ep-switch:has(input:checked):hover .ep-switch__slider {
    border-color: rgba(190, 18, 60, 0.7);
}

@media (max-width: 980px) {
    .ep-licence-card {
        grid-template-columns: 1fr 1fr;
    }

    .ep-licence-card__identity,
    .ep-licence-card > .ep-metric--wide {
        grid-column: 1 / -1;
    }

    /* Keep Credits | API keys on first metric row, Auto renewal | Last usage on second */
    .ep-detail-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .ep-licence-card {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 14px 14px 14px 18px;
    }

    a.ep-metric--clickable,
    .ep-metric--clickable {
        min-height: 76px;
        padding: 14px !important;
        width: 100%;
        box-sizing: border-box;
    }

    .ep-metric__cta {
        font-size: 12px;
    }

    .ep-licence-card__key {
        font-size: 12px;
        word-break: break-all;
        white-space: normal;
    }
}

/* Nested expand affordance */
.ep-dash .RadGrid .rgExpandCol {
    width: 36px !important;
    padding: 18px 0 0 8px !important;
    vertical-align: top !important;
}

.ep-dash .RadGrid .rgDetailTable {
    margin: 0 0 8px 36px !important;
}

/* ---------- Buttons polish inside dashboard ---------- */
.ep-dash .button,
.ep-dash .button:visited {
    border-radius: 10px !important;
    padding: 9px 14px !important;
    font-weight: 600 !important;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.ep-dash .button:hover {
    transform: translateY(-1px);
}

.ep-dash .button--primary {
    box-shadow: 0 6px 16px rgba(236, 46, 94, 0.22);
}

.ep-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}

/* ---------- Forms / account details ---------- */
.ep-account-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    max-width: 720px;
}

.ep-account-layout .button {
    margin-right: 8px;
}

/* Panel footer actions (Account Details, etc.) - bottom-aligned like Licence Manager */
.ep-panel__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--ep-dash-border, #e6e8ee);
}

.ep-panel__footer .button {
    min-height: 42px;
}

/* Organisation Enabled toggle inside ManageOrganisation on dashboard */
.ep-dash .ep-org-enabled-row label:not(.ep-switch) {
    display: none;
}

.ep-dash .ep-org-enabled-row .ep-lm-toggle-card {
    width: 100%;
    max-width: 100%;
}

@media (max-width: 640px) {
    .ep-panel__footer {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .ep-panel__footer .button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

/* ---------- Mobile / tablet navigation ---------- */
@media (max-width: 980px) {
    .ep-dash .linkedlist-tabs {
        grid-template-columns: 1fr;
    }

    /* Show mobile dropdown; hide the full vertical nav list */
    .ep-dash__mobile-nav {
        display: block;
    }

    .ep-dash .linkedlist-tabs > ul {
        display: none !important;
    }

    .ep-dash .linkedlist-tabs--vertical .linkedlist-tabs__content,
    .ep-dash .linkedlist-tabs--horizontal .linkedlist-tabs__content {
        min-height: 0;
        width: 100% !important;
    }
}

@media (max-width: 640px) {
    .ep-panel {
        padding: 16px;
    }

    .ep-dash {
        padding: 16px 12px 24px;
    }

    .ep-dash__mobile-nav {
        margin-bottom: 12px;
        padding: 12px;
    }

    .ep-dash__mobile-nav-select {
        font-size: 16px; /* avoids iOS zoom on focus */
        min-height: 48px;
    }
}

/* Soften platform panels inside content */
.ep-dash .e-panel {
    border-radius: var(--ep-dash-radius-sm) !important;
    box-shadow: var(--ep-dash-shadow-sm);
}

.ep-dash .overflow-auto {
    overflow: visible;
}

/* ============================================================================
   PortalV2 / ePostcode compatibility
   Keep dashboard controls insulated from global portal link/button rules
   ============================================================================ */
.ep-dash a,
.ep-dash a:hover,
.ep-dash a:focus,
.ep-dash a:visited {
    text-decoration: none;
}

.ep-dash a.ep-metric--clickable,
.ep-dash a.ep-metric--clickable:hover,
.ep-dash a.ep-metric--clickable:focus,
.ep-dash a.ep-metric--clickable:visited,
.ep-dash a.ep-metric--clickable:active {
    color: inherit !important;
    text-decoration: none !important;
    background-image: none !important;
}

/* LinkList tab chrome can bleed floating/padding rules into cards */
.ep-dash .linkedlist-tabs__content,
.ep-dash .ep-dash__content-inner,
.ep-dash .ep-panel__body {
    min-width: 0;
    max-width: 100%;
}

.ep-dash .ep-licence-list,
.ep-dash .ep-licence-card,
.ep-dash .ep-overview {
    box-sizing: border-box;
    max-width: 100%;
}

/* Ensure metric tiles remain full-width click targets on tablets/phones */
.ep-dash .ep-metric--clickable {
    width: 100%;
    box-sizing: border-box;
}

/* PortalV2 sometimes forces button link colours; keep CTA readable */
.ep-dash .ep-metric__cta,
.ep-dash .ep-metric__cta i {
    color: var(--ep-dash-primary, #be123c) !important;
}

/* Font Awesome icons inside tiles */
.ep-dash .ep-metric__icon i,
.ep-dash .ep-metric__head i {
    line-height: 1;
}

/* Help / card modals must sit above PortalV2 chrome */
.ep-help-modal,
.ep-card-modal {
    z-index: 10000010 !important;
}

/* Prevent page content overflow wrappers clipping fixed modals when not reparented yet */
.ep-dash,
.ep-dash .linkedlist-tabs,
.ep-dash .linkedlist-tabs__content {
    overflow: visible;
}

/* Identity row truncation on narrow portal layouts */
.ep-dash .ep-licence-card__key {
    max-width: 100%;
    white-space: normal;
    word-break: break-all;
}

/* ============================================================================
   Comprehensive mobile / tablet optimisation
   All dashboard sections, tags, chips, badges, forms, toolbars
   ============================================================================ */

/* Guard against horizontal page scroll from long keys / tables */
.ep-dash,
.ep-dash .ep-panel,
.ep-dash .ep-panel__body,
.ep-dash .ep-overview,
.ep-dash .ep-licence-list,
.ep-dash .ep-api-keys__list,
.ep-dash .ep-licence-manager__list,
.ep-dash .ep-credit-transfers,
.ep-dash .ep-org-cards,
.ep-dash .ep-account-layout,
.ep-dash .ep-lm-form,
.ep-dash .ep-api-form,
.ep-dash .ep-card,
.ep-dash .ep-service-offer-list {
    max-width: 100%;
    min-width: 0;
}

/* Tags / chips / badges wrap cleanly everywhere */
.ep-dash__chip,
.ep-lm-badge,
.ep-auto-status__badge {
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
}

.ep-dash__hero-actions {
    flex-wrap: wrap;
}

/* Commerce / org tables: allow horizontal scroll instead of page blow-out */
.ep-dash .ep-panel__body > .RadGrid,
.ep-dash .ep-panel__body > div > .RadGrid,
.ep-dash .ep-account-layout .RadGrid,
.ep-dash .ep-org-cards .RadGrid {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 980px) {
    .ep-dash .linkedlist-tabs--vertical .linkedlist-tabs__content,
    .ep-dash .linkedlist-tabs--horizontal .linkedlist-tabs__content {
        min-height: 0;
    }

    .ep-licence-card--compact {
        grid-template-columns: 1fr;
    }

    .ep-overview__section-title {
        flex-direction: column;
        align-items: stretch;
    }

    .ep-overview__section-actions,
    .ep-panel__actions,
    .ep-toolbar,
    .ep-api-form__toolbar {
        width: 100%;
    }

    .ep-overview__section-actions .button,
    .ep-panel__actions .button,
    .ep-toolbar .button {
        flex: 1 1 auto;
        text-align: center;
        justify-content: center;
    }

    .ep-service-offer-list {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    /* Metric labels / CTAs stay readable on tablet */
    .ep-metric__label,
    .ep-metric--clickable .ep-metric__label {
        font-size: 11.5px;
    }
}

@media (max-width: 720px) {
    .ep-panel {
        padding: 16px 14px 18px;
    }

    .ep-panel__header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 14px;
        padding-bottom: 12px;
    }

    .ep-panel__title {
        font-size: 18px;
    }

    .ep-panel__desc {
        font-size: 13px;
        max-width: none;
    }

    .ep-panel__actions {
        width: 100%;
    }

    .ep-panel__actions .button {
        flex: 1 1 calc(50% - 4px);
        text-align: center;
        min-height: 44px;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }

    .ep-callout {
        gap: 10px 12px;
        padding: 12px 14px;
        margin-bottom: 14px;
    }

    .ep-callout__icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    /* Licence manager + API forms */
    .ep-lm-form__header {
        gap: 12px;
        padding: 14px 14px;
    }

    .ep-lm-form__header-icon {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        font-size: 16px;
    }

    .ep-lm-form__body {
        padding: 4px 14px 2px;
    }

    .ep-lm-form__footer {
        padding: 12px 14px 14px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .ep-lm-form__footer-note {
        order: 2;
        text-align: center;
    }

    .ep-lm-form__save {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        order: 1;
    }

    .ep-lm-section {
        padding: 12px 0;
    }

    .ep-lm-subpanel,
    .ep-lm-card-panel,
    .ep-org-cards__panel {
        padding: 12px;
    }

    .ep-lm-subpanel__head {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .ep-lm-payment-options {
        flex-direction: column;
        gap: 8px;
    }

    .ep-lm-payment-options label,
    .ep-lm-payment-options td {
        width: 100%;
        box-sizing: border-box;
        justify-content: flex-start;
        min-height: 44px;
    }

    .ep-lm-toggle-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px 14px;
    }

    .ep-lm-badge {
        max-width: 100%;
    }

    /* Payment method radios often render as table from ASP.NET RadioButtonList */
    .ep-lm-payment-options table,
    .ep-lm-payment-options tbody,
    .ep-lm-payment-options tr,
    .ep-lm-payment-options td {
        display: block !important;
        width: 100% !important;
    }

    .ep-lm-payment-options tr + tr {
        margin-top: 8px;
    }

    /* API host cards */
    .ep-api-host {
        padding: 12px;
    }

    .ep-api-host__head {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .ep-api-host__key-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .ep-api-host__key {
        flex: 1 1 100%;
        font-size: 13px;
    }

    .ep-api-host__copy,
    .ep-api-host__delete {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px;
    }

    .ep-api-form__toolbar {
        flex-direction: column;
    }

    .ep-api-form__toolbar .button {
        width: 100%;
        min-height: 44px;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }

    .ep-api-keys__selector {
        padding: 12px 14px;
    }

    .ep-api-key-card__master-key {
        display: block;
        margin: 0 0 8px;
        max-width: 100%;
    }

    /* Help modal */
    .ep-help-modal {
        padding: 12px;
        align-items: flex-end;
    }

    .ep-help-modal__dialog {
        max-height: min(92dvh, 100%);
        border-radius: 16px 16px 0 0;
        width: 100%;
    }

    .ep-help-modal__header {
        padding: 16px 16px 10px;
    }

    .ep-help-modal__title {
        font-size: 18px;
    }

    .ep-help-modal__body {
        padding: 14px 16px 6px;
    }

    .ep-help-modal__footer {
        padding: 10px 16px max(14px, env(safe-area-inset-bottom));
        flex-wrap: wrap;
    }

    .ep-help-modal__footer .button {
        flex: 1 1 auto;
        min-height: 44px;
        text-align: center;
    }

    .ep-help-card {
        padding: 12px 14px;
    }

    /* Detail / transfer rows already single-col at 980; tighten */
    .ep-detail-row {
        gap: 8px;
        padding: 10px 12px;
    }

    .ep-card {
        padding: 14px;
    }

    /* Card manager add CTA full width */
    .ep-lm-card-panel .ep-card-mgr__add,
    .ep-org-cards .ep-card-mgr__add,
    .ep-dash .ep-card-mgr__add {
        width: 100%;
        justify-content: center;
        min-height: 44px;
        box-sizing: border-box;
    }

    .ep-dash .ep-card-mgr__item {
        display: flex !important;
        flex-wrap: wrap;
        gap: 8px 12px;
        padding: 12px !important;
    }

    /* Switches: comfortable touch */
    .ep-switch {
        min-height: 44px;
        padding: 4px 0;
    }

    .ep-switch__input,
    .ep-switch__input input[type="checkbox"] {
        width: 52px !important;
        height: 32px !important;
    }

    .ep-switch__slider {
        width: 52px;
        height: 32px;
    }

    .ep-switch__slider::after {
        width: 26px;
        height: 26px;
    }

    .ep-switch__input:has(input:checked) + .ep-switch__slider::after,
    .ep-switch:has(input:checked) .ep-switch__slider::after {
        transform: translateX(22px);
    }

    /* Account details full width */
    .ep-account-layout {
        max-width: none;
        gap: 12px;
    }

    .ep-account-layout .button {
        margin-right: 0;
        margin-bottom: 8px;
        width: 100%;
        text-align: center;
        min-height: 44px;
    }

    /* Auto-renewal status tags wrap */
    .ep-auto-status {
        gap: 6px;
        width: 100%;
    }

    .ep-auto-status__live-row {
        flex-wrap: wrap;
    }

    .ep-auto-status__detail {
        word-break: break-word;
    }
}

@media (max-width: 640px) {
    .ep-dash-host {
        padding: 4px 0 16px;
    }

    .ep-dash {
        padding: 12px 8px 20px;
        margin-bottom: 16px;
    }

    .ep-panel {
        padding: 14px 12px 16px;
        border-radius: 14px;
    }

    .ep-panel__kicker {
        font-size: 10px;
    }

    .ep-panel__title {
        font-size: 17px;
        letter-spacing: -0.015em;
    }

    .ep-panel__desc {
        font-size: 12.5px;
        line-height: 1.5;
    }

    .ep-panel__actions .button {
        flex: 1 1 100%;
    }

    /* Hero chips + help link stack cleanly */
    .ep-dash__hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .ep-dash__chip,
    .ep-dash__help-link {
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
        text-align: center;
    }

    .ep-dash__help-link {
        min-height: 44px;
    }

    /* Overview section titles */
    .ep-overview__section-title h4 {
        font-size: 14.5px;
    }

    .ep-overview__section-title p {
        font-size: 12px;
        max-width: none;
    }

    .ep-overview__section-actions {
        flex-direction: column;
    }

    .ep-overview__section-actions .button {
        width: 100%;
        min-height: 44px;
    }

    .ep-overview__transfer {
        padding: 10px;
    }

    /* Licence cards: single column with comfy metric tiles */
    .ep-licence-card {
        gap: 8px;
        padding: 12px 12px 12px 18px;
        border-radius: 12px;
    }

    .ep-licence-card__title-row {
        align-items: flex-start;
    }

    .ep-licence-card__name {
        font-size: 15px;
    }

    a.ep-licence-card__edit,
    .ep-licence-card__edit {
        width: 44px;
        height: 44px;
    }

    .ep-licence-card__account {
        margin-top: 6px;
    }

    .ep-licence-card__account-name {
        font-size: 13px;
    }

    .ep-licence-card__party {
        margin-top: 8px;
        padding: 10px;
    }

    .ep-licence-card__party-value {
        font-size: 13px;
    }

    a.ep-licence-card__view,
    .ep-licence-card__view {
        width: 44px;
        min-width: 44px;
        min-height: 44px;
    }

    .ep-licence-card__key {
        font-size: 11.5px;
        padding: 6px 8px;
        white-space: normal;
        word-break: break-all;
        display: block;
    }

    .ep-licence-card__meta {
        font-size: 11.5px;
        line-height: 1.4;
    }

    a.ep-metric--clickable,
    .ep-metric--clickable {
        min-height: 72px;
        padding: 12px !important;
        border-radius: 10px !important;
    }

    .ep-metric__value--lg {
        font-size: 22px;
    }

    .ep-metric__value--sm {
        font-size: 12.5px;
    }

    .ep-metric__cta {
        font-size: 12px;
    }

    /* Available service offers */
    .ep-service-offer {
        padding: 14px 12px 12px;
    }

    .ep-service-offer__title {
        font-size: 14.5px;
    }

    .ep-service-offer__desc {
        font-size: 12.5px;
    }

    .ep-service-offer__button {
        min-height: 44px;
    }

    /* LM form denser on phone */
    .ep-lm-form {
        border-radius: 12px;
    }

    .ep-lm-form__title,
    .ep-api-form .ep-lm-form__title {
        font-size: 14.5px;
    }

    .ep-lm-form__eyebrow {
        font-size: 10px;
    }

    .ep-lm-section__title {
        font-size: 13.5px;
    }

    .ep-lm-section__desc,
    .ep-lm-field__hint,
    .ep-lm-toggle-card__hint {
        font-size: 12px;
        max-width: none;
    }

    .ep-lm-field__control--narrow {
        max-width: 100%;
    }

    .ep-lm-form .RadInput .riTextBox,
    .ep-lm-form .RadInput_Bootstrap .riTextBox,
    .ep-api-host__input,
    .ep-api-keys__dropdown {
        font-size: 16px !important; /* prevent iOS zoom */
        min-height: 44px;
    }

    .ep-api-keys__dropdown {
        font-size: 16px;
    }

    /* Detail rows as stacked metrics */
    .ep-detail-row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 10px;
    }

    .ep-detail-row .ep-metric {
        padding: 10px;
    }

    /* Callouts: stack icon above text when very narrow content */
    .ep-callout {
        grid-template-columns: auto 1fr;
        font-size: 12.5px;
    }

    /* Toolbar / export buttons */
    .ep-toolbar {
        flex-direction: column;
    }

    .ep-toolbar .button,
    .ep-dash .button {
        min-height: 42px;
    }

    /* Org payment cards panel */
    .ep-org-cards__panel {
        padding: 12px;
        border-radius: 12px;
    }

    /* Mobile nav already shown; keep current label readable */
    .ep-dash__mobile-nav-current {
        line-height: 1.4;
        word-break: break-word;
    }

    /* Badge / status tags */
    .ep-lm-badge,
    .ep-auto-status__badge {
        font-size: 11.5px;
        padding: 5px 9px;
        line-height: 1.3;
    }

    /* Nested grid expand padding */
    .ep-dash .RadGrid .rgDetailTable {
        margin-left: 12px !important;
    }

    .ep-dash .RadGrid .rgExpandCol {
        width: 28px !important;
        padding: 12px 0 0 4px !important;
    }

    /* Pager readable */
    .ep-dash .RadGrid .rgPager {
        font-size: 12.5px;
        overflow-x: auto;
    }

    /* Reduce hover transforms that feel laggy on touch */
    a.ep-metric--clickable:hover,
    .ep-metric--clickable:hover,
    .ep-licence-card:hover,
    .ep-dash .button:hover {
        transform: none;
    }
}

@media (max-width: 400px) {
    .ep-dash {
        padding: var(--ep-page-pad-y, 12px) var(--ep-page-pad-x, 12px) var(--ep-page-pad-bottom, 24px);
    }

    .ep-panel {
        padding: 12px 10px 14px;
    }

    .ep-dash__chip {
        font-size: 11px;
        padding: 6px 8px;
    }

    .ep-panel__title {
        font-size: 16px;
    }

    .ep-metric__value--lg {
        font-size: 20px;
    }

    .ep-lm-form__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ep-api-host__copy,
    .ep-api-host__delete {
        flex: 1 1 calc(50% - 4px);
        width: auto !important;
        min-width: 0;
    }
}

/* Safe-area for notched phones - still respects shared page shell */
@supports (padding: max(0px)) {
    @media (max-width: 640px) {
        .ep-dash,
        .ep-account,
        .ep-buy,
        .ep-list,
        .ep-checkout {
            padding-left: max(var(--ep-page-pad-x, 12px), env(safe-area-inset-left));
            padding-right: max(var(--ep-page-pad-x, 12px), env(safe-area-inset-right));
            padding-bottom: max(var(--ep-page-pad-bottom, 24px), env(safe-area-inset-bottom));
        }
    }
}

/* Tablet and below (1024px) — all dashboard tabs */
@media (max-width: 1024px) {
    .ep-dash { padding: 14px 12px 24px; }
    .ep-dash__hero-inner { grid-template-columns: 1fr; gap: 14px; }
    .ep-dash__hero-aside { display: grid; grid-template-columns: 1fr; }
    .ep-dash .linkedlist-tabs { grid-template-columns: 1fr; gap: 12px; }
    .ep-dash__mobile-nav { display: block; }
    .ep-dash .linkedlist-tabs > ul { display: none !important; }
    .ep-dash .linkedlist-tabs--vertical .linkedlist-tabs__content,
    .ep-dash .linkedlist-tabs--horizontal .linkedlist-tabs__content {
        min-height: 0; width: 100% !important;
    }
    .ep-panel { padding: 16px 16px 18px; }
    .ep-panel__header { flex-direction: column; align-items: stretch; gap: 10px; }
    .ep-panel__desc { max-width: none; }
    .ep-panel__actions,
    .ep-toolbar,
    .ep-overview__section-actions,
    .ep-api-form__toolbar { width: 100%; }
    .ep-panel__actions .button,
    .ep-toolbar .button,
    .ep-overview__section-actions .button,
    .ep-panel__footer .button {
        min-height: 44px; justify-content: center; text-align: center;
    }
    .ep-split--2,
    .ep-overview__top,
    .ep-lm-grid,
    .ep-licence-card--compact { grid-template-columns: 1fr; }
    .ep-lm-field__control--narrow,
    .ep-lm-field__control,
    .ep-lm-field__control--wide { max-width: 100%; width: 100%; }
    .ep-lm-toggle-card { flex-wrap: wrap; align-items: flex-start; gap: 12px; }
    .ep-lm-form .RadComboBox,
    .ep-dash .RadComboBox,
    .ep-dash .RadDatePicker,
    .ep-dash select,
    .ep-api-keys__dropdown { width: 100% !important; max-width: 100% !important; box-sizing: border-box; }
    .ep-dash .RadInput .riTextBox,
    .ep-dash .ep-api-keys__dropdown,
    .ep-dash input[type="text"],
    .ep-dash input[type="search"],
    .ep-dash input[type="email"],
    .ep-dash input[type="number"],
    .ep-dash select,
    .ep-dash textarea { font-size: 16px !important; min-height: 42px; }
    .ep-licence-card__stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    a.ep-stat, .ep-stat { min-height: 84px; }
    .ep-service-offer-list { grid-template-columns: 1fr !important; }
    .ep-service-offer { flex-direction: column !important; align-items: stretch !important; }
    .ep-service-offer__button { width: 100% !important; min-height: 44px; }
    .ep-overview__org-view, a.ep-overview__org-view { width: 100%; min-height: 44px; justify-content: center; }
    .ep-lm-pay-choices { flex-direction: column; width: 100%; }
    .ep-lm-pay-choice { width: 100%; min-height: 44px; }
    .ep-card-mgr__item, .ep-lm-card-panel .ep-card-mgr__item { flex-wrap: wrap; gap: 10px; }
    .ep-dash .ep-panel__body,
    .ep-credit-transfers,
    .ep-org-cards,
    .ep-account-layout { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .ep-dash .ep-lm-form__title,
    .ep-dash .ep-licence-card__name,
    .ep-dash .ep-licence-card__key { word-break: break-word; overflow-wrap: anywhere; }
    .ep-dash .c50,
    .ep-dash .c33,
    .ep-dash .c25,
    .ep-dash .c50.m10 {
        width: 100% !important; max-width: 100% !important;
        float: none !important; margin-left: 0 !important; margin-right: 0 !important;
        box-sizing: border-box;
    }
}
