/* ===========================================================================
   Endurance Science — design system
   One token sheet for admin and athlete portal.
   Minimalist, scientific, bold.
   =========================================================================== */

@font-face {
    font-family: 'Source Sans 3';
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url('fonts/source-sans-3/source-sans-3-latin-400-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Source Sans 3';
    font-style: normal;
    font-display: swap;
    font-weight: 500;
    src: url('fonts/source-sans-3/source-sans-3-latin-500-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Source Sans 3';
    font-style: normal;
    font-display: swap;
    font-weight: 600;
    src: url('fonts/source-sans-3/source-sans-3-latin-600-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Source Sans 3';
    font-style: normal;
    font-display: swap;
    font-weight: 700;
    src: url('fonts/source-sans-3/source-sans-3-latin-700-normal.woff2') format('woff2');
}

:root {
    /* Color — aligned with admin athletes / admin-hrv-report */
    --es-bg: #f6f7f9;
    --es-surface: #ffffff;
    --es-ink: #1c2128;
    --es-ink-soft: #6b7280;
    --es-ink-faint: #9aa3ad;
    --es-line: #e5e7eb;
    --es-accent: #2563eb;
    --es-accent-ink: #ffffff;
    --es-accent-soft: #eff6ff;
    --es-top-chrome-bg: #f6f7f9;
    --es-pill-border: #aeb6bf;
    --es-pill-hover-border: #8bbcf0;
    --es-pill-hover-bg: var(--es-accent-soft);
    --es-focus-border: #2563eb;
    --es-focus-ring: #dbeafe;
    --es-danger: #dc2626;
    --es-ok: #16a34a;

    /* Chart palette (fixed, referenced by name in block settings) */
    --es-c-blue: #2563eb;
    --es-c-sky: #3b82f6;
    --es-c-teal: #0d9488;
    --es-c-amber: #d97706;
    --es-c-red: #dc2626;
    --es-c-violet: #7c3aed;
    --es-c-gray: #6b7280;
    --es-c-load-blue: #3b6fc7;
    --es-c-load-pink: #c0268a;
    --es-c-load-orange: #ea580c;

    /* Type */
    --es-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    --es-table-font: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    --es-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    /* Space / shape */
    --es-r: 12px;
    --es-r-sm: 6px;
    --es-shadow: 0 1px 2px rgba(16, 21, 27, 0.05), 0 4px 16px rgba(16, 21, 27, 0.05);
    --es-maxw: 1180px;
    --es-bottomnav-h: 52px;
    --es-bottomnav-offset: calc(var(--es-bottomnav-h) + env(safe-area-inset-bottom, 0px));
    --es-rpanel-w: 480px;
    --es-drawer-w: min(100vw, var(--es-rpanel-w));
    --es-drawer-shadow: -8px 0 24px rgba(16, 21, 27, 0.12);
}

* { box-sizing: border-box; }

/* Keep the interaction cursor stable when the pointer crosses an icon, SVG,
   or other child inside a control.  Some controls are rendered as links and
   others as buttons, so relying on browser defaults produces inconsistent
   cursor changes as hover styles and overlays settle. */
:where(a[href], button:not(:disabled), summary, label[for], [role="button"]:not([aria-disabled="true"])),
:where(a[href], button:not(:disabled), summary, label[for], [role="button"]:not([aria-disabled="true"])) * {
    cursor: pointer;
}

html { -webkit-text-size-adjust: 100%; }

body.es-has-sidebar {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

body.es-has-sidebar .es-shell {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

body.es-has-sidebar .es-content {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

body.es-has-sidebar .es-content-bar {
    flex: none;
}

body.es-has-sidebar .es-main {
    flex: 1 0 auto;
    overflow: visible;
}

body.es-has-sidebar .es-footer {
    flex: 0 0 auto;
    margin-top: auto;
}

body {
    margin: 0;
    background: var(--es-bg);
    color: var(--es-ink);
    font-family: var(--es-font);
    font-size: 14px;
    line-height: 1.5;
}

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }

p { margin: 0 0 1em; }
a { color: var(--es-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, .es-mono { font-family: var(--es-mono); font-size: .92em; }

/* --------------------------------------------------------------------------
   Layout: left sidebar shell
   -------------------------------------------------------------------------- */

/* SF Pro Heavy via system fonts (Apple) + local installs; no web embed. */
@font-face {
    font-family: 'SF Pro Display';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: local('SFProDisplay-Heavy'),
         local('SF Pro Display Heavy'),
         local('SFProDisplay-Black'),
         local('SF Pro Display Black'),
         local('.SF NS Display');
}

.es-logo,
.es-brand-mark {
    --es-brand-font: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    display: inline-block;
    margin: 0;
    padding: 8px 10px;
    background: #fff000;
    color: #000;
    font-family: var(--es-brand-font);
    font-weight: 800 !important;
    font-style: normal;
    font-size: 17px;
    letter-spacing: -0.02em;
    line-height: 1.15;
    text-decoration: none;
    white-space: nowrap;
    border-radius: 0;
    flex: none;
    -webkit-font-smoothing: antialiased;
}
.es-logo:hover,
.es-brand-mark:hover {
    text-decoration: none;
    color: #000;
    font-weight: 800 !important;
}
.es-logo .dot,
.es-brand-mark .dot {
    color: #000;
    font-weight: 800 !important;
}

.es-shell { display: flex; min-height: 100vh; }

.es-sidebar {
    width: 70px;
    flex: none;
    background: var(--es-surface);
    border-right: 1px solid #d5dae2;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: visible;
    z-index: 1400;
}
/* Settings submenu — fixed white rail beside the icon sidebar */
.es-settings-rail {
    width: 205px;
    flex: none;
    background: var(--es-surface);
    border-right: 1px solid #d5dae2;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 1350;
}
.es-settings-rail__inner {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 22px 0 18px;
    box-sizing: border-box;
}
.es-settings-rail__nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1 1 auto;
}
.es-settings-rail__nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 0;
    color: var(--es-ink);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
}
.es-settings-rail__nav a:hover,
.es-settings-rail__nav a:focus-visible {
    background: var(--es-accent-soft);
    color: var(--es-ink);
    text-decoration: none;
    outline: none;
}
.es-settings-rail__nav a.active {
    background: var(--es-accent-soft);
    color: var(--es-ink);
}
.es-settings-rail__nav span.is-disabled {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 0;
    color: var(--es-ink-faint);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    opacity: 0.55;
    cursor: default;
    user-select: none;
}
.es-settings-rail__foot {
    margin-top: auto;
    padding-top: 14px;
}
.es-settings-rail__foot .es-settings-logout {
    margin: 0;
}
.es-settings-rail__foot .es-settings-logout button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--es-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
}
.es-settings-rail__foot .es-settings-logout button:hover {
    background: var(--es-accent-soft);
    color: var(--es-ink);
}
.es-settings-menu__icon {
    width: 14px;
    height: 14px;
    flex: none;
    color: #000;
}
.es-settings-menu__icon--mark {
    display: block;
    box-sizing: border-box;
    width: 16px;
    height: 16px;
    margin-right: -2px;
    border: 1px solid #c8c8c8;
    border-radius: 50%;
    object-fit: cover;
    filter: grayscale(1) contrast(1.05);
}
.es-settings-menu__icon--empty {
    display: block;
}

body.es-has-settings-rail .es-content {
    background: var(--es-top-chrome-bg);
}
body.es-has-settings-rail .es-main,
body.es-has-settings-rail .es-main--settings {
    max-width: none;
    margin: 0;
    background: #fff;
    padding: 0;
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
    min-height: auto;
    overflow: visible;
}
body.es-has-settings-rail .es-main--narrow {
    max-width: none;
    margin: 0;
}
body.es-has-settings-rail .es-main--settings > .es-pagehead {
    margin: 0;
    padding: 24px 24px 20px;
    background: var(--es-top-chrome-bg);
    flex: none;
}
body.es-has-settings-rail .es-main--settings > .es-settings-tabs {
    margin: 0;
    padding: 0 24px 16px;
    background: var(--es-top-chrome-bg);
    flex: none;
}
body.es-has-settings-rail .es-main--settings > .es-settings-notices {
    margin: 0;
    padding: 0 24px 16px;
    background: var(--es-top-chrome-bg);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: none;
    box-sizing: border-box;
}
body.es-has-settings-rail .es-main--settings > .es-settings-notices:not(:has(.es-alert, .es-fit-jobs-stack:not([hidden]))) {
    display: none;
    padding: 0;
}
body.es-has-settings-rail .es-main--settings > .es-settings-notices > .es-alert,
body.es-has-settings-rail .es-main--settings > .es-settings-notices > .es-fit-jobs-stack {
    margin: 0;
}
.es-settings-canvas {
    background: #fff;
    margin: 0;
    padding: 0 0 104px;
    width: 100%;
    box-sizing: border-box;
    flex: 1 0 auto;
    min-height: 0;
    border-top: 0;
}
.es-settings-canvas .es-block {
    margin: 0;
    padding: 28px 48px 36px;
    border-top: 1px solid var(--es-line);
}
.es-settings-canvas .es-block-head {
    padding-top: 0;
}
.es-settings-canvas .es-field {
    margin-bottom: 4px;
}
.es-settings-canvas .es-fields-grid {
    gap: 4px 14px;
}
.es-settings-canvas .es-fields-grid > .es-field {
    margin-bottom: 0;
}
.es-settings-canvas .es-settings-section-title {
    margin: 14px 0 8px;
}
body.es-has-settings-rail .es-content-bar {
    background: var(--es-top-chrome-bg);
    border-bottom: 0;
}
body.es-has-settings-rail.es-has-sidebar .es-footer {
    margin-top: 0;
}
body.es-has-list-chrome .es-content {
    background: var(--es-top-chrome-bg);
}
body.es-has-list-chrome .es-main--list {
    max-width: none;
    margin: 0;
    background: #fff;
    padding: 0;
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
    min-height: auto;
    overflow: visible;
}
body.es-has-list-chrome .es-main--list > .es-pagehead {
    margin: 0;
    padding: 24px 24px 16px;
    background: var(--es-top-chrome-bg);
    flex: none;
}
body.es-has-list-chrome .es-main--list > .es-search {
    margin: 0 24px 16px;
    padding: 0;
    background: var(--es-top-chrome-bg);
    flex: none;
    box-sizing: border-box;
}
body.es-has-list-chrome .es-main--list > .es-athletes-top {
    margin: 0;
    padding: 24px 24px 10px;
    background: var(--es-top-chrome-bg);
    flex: none;
}
body.es-has-list-chrome .es-main--list > .es-athletes-top > .es-pagehead {
    margin: 0 0 22px;
    padding: 0;
    background: transparent;
}
body.es-has-list-chrome .es-main--list > .es-athletes-top .es-search {
    margin: 0;
    padding: 0;
    background: transparent;
    max-width: 340px;
    flex: 1 1 220px;
}
.es-athletes-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.es-athletes-toolbar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}
.es-athletes-toolbar__actions form {
    margin: 0;
}
.es-invite-dialog {
    width: min(560px, calc(100vw - 28px));
    max-height: calc(100vh - 40px);
    padding: 0;
    border: 0;
    border-radius: 18px;
    background: var(--es-surface, #fff);
    color: var(--es-ink);
    box-shadow: 0 24px 80px rgba(20, 35, 60, 0.28);
}
.es-invite-dialog::backdrop {
    background: rgba(15, 25, 45, 0.52);
}
.es-invite-dialog__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--es-line, #eaebef);
}
.es-invite-dialog__head h2 {
    margin: 0;
    font-size: 20px;
}
.es-invite-dialog__head p {
    margin: 6px 0 0;
    color: var(--es-ink-soft);
    font-size: 13px;
    line-height: 1.45;
}
.es-invite-dialog__head > button {
    border: 0;
    background: none;
    color: var(--es-ink-soft);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}
.es-invite-dialog__body {
    display: grid;
    gap: 14px;
    padding: 20px;
}
.es-invite-dialog__row {
    display: flex;
    gap: 8px;
}
.es-invite-dialog__row .es-input {
    flex: 1 1 auto;
    min-width: 0;
}
.es-invite-dialog__body .es-help {
    margin: 0;
}
.es-invite-dialog__body form {
    margin: 0;
}
body.es-has-list-chrome .es-content-bar {
    background: var(--es-top-chrome-bg);
    border-bottom: 0;
}
body.es-has-list-chrome.es-has-sidebar .es-footer {
    margin-top: 0;
}
.es-list-canvas {
    background: #fff;
    margin: 0;
    padding: 24px 24px 104px;
    width: 100%;
    box-sizing: border-box;
    flex: 1 0 auto;
    min-height: 0;
    border-top: 1px solid #eaebef;
}
.es-list-canvas > .es-block {
    margin: 0;
    border-top: 0;
    padding: 0;
}
.es-list-canvas > .es-block > .es-block-body--flush {
    padding: 0;
}

.es-sidenav { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none; }
.es-sidenav--top { flex: 1; }
.es-sidenav--bottom {
    margin-top: auto;
    padding-top: 10px;
}
.es-nav-icon {
    color: #566477;
    width: 46px;
    height: 46px;
    border: 1px solid transparent;
    border-radius: var(--es-r-sm);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font: inherit;
    padding: 0;
    position: relative;
    cursor: pointer;
    text-decoration: none;
}
.es-nav-icon svg {
    width: 22px;
    height: 22px;
    stroke-width: 2;
}
.es-nav-icon--avatar .es-avatar--nav {
    width: 34px;
    height: 34px;
    font-size: 12px;
    line-height: 1;
}
.es-nav-icon--avatar .es-avatar--placeholder {
    box-shadow: 0 2px 8px rgba(16, 21, 27, 0.1);
    letter-spacing: .02em;
}
.es-nav-icon > span {
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--es-ink);
    color: #fff;
    border-radius: var(--es-r-sm);
    padding: 5px 8px;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    z-index: 95;
}
.es-nav-icon:hover,
.es-nav-icon:focus-visible {
    background: var(--es-accent-soft);
    border-color: transparent;
    color: var(--es-accent);
    text-decoration: none;
    outline: none;
}
.es-nav-icon:hover span,
.es-nav-icon:focus-visible span {
    opacity: 1;
}
.es-nav-icon.active {
    background: var(--es-accent-soft);
    color: var(--es-accent);
}
.es-nav-icon--soon,
.es-bottomnav__item--soon {
    opacity: 0.45;
    cursor: default;
}
.es-settings-logout button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    color: #374151;
    padding: 9px 12px;
    border: 0;
    border-radius: var(--es-r-sm);
    background: transparent;
    font: inherit;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.3;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
.es-settings-logout button:hover {
    background: #eef1f5;
    color: var(--es-ink);
    text-decoration: none;
}
.es-settings-logout {
    margin: 0;
}
.es-settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: -6px 0 18px;
}
.es-settings-tabs a {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: var(--es-r-sm);
    border: 1px solid var(--es-line);
    color: var(--es-ink-soft);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    background: var(--es-surface);
}
.es-settings-tabs a:hover {
    color: var(--es-ink);
    background: var(--es-bg);
}
.es-settings-tabs a.active {
    border-color: transparent;
    background: var(--es-accent-soft);
    color: var(--es-accent);
}
.es-settings-section-title {
    margin: 18px 0 10px;
    font-size: 14px;
}
.es-input--static {
    display: flex;
    align-items: center;
    min-height: 38px;
    background: var(--es-bg);
    color: var(--es-ink);
    cursor: default;
}
.es-nav-form { margin: 0; }

/* Mobile bottom tab bar (hidden on desktop) */
.es-bottomnav {
    display: none;
}
.es-bottomnav > .es-bottomnav__item,
.es-bottomnav > .es-bottomnav__settings,
.es-bottomnav > .es-bottomnav__more {
    flex: 1 1 0;
    min-width: 0;
}
.es-bottomnav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px;
    border: 0;
    background: transparent;
    color: #4b5563;
    font: inherit;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.1;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.es-bottomnav__item:hover,
.es-bottomnav__item:focus,
.es-bottomnav__item:focus-visible,
.es-bottomnav__item:active {
    background: var(--es-accent-soft);
    color: var(--es-accent);
    text-decoration: none;
    outline: none;
}
.es-bottomnav__item svg {
    width: 22px;
    height: 22px;
    stroke-width: 2;
}
.es-bottomnav__ai-mark {
    flex: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.es-bottomnav__item--avatar .es-avatar--nav {
    width: 22px;
    height: 22px;
    font-size: 9px;
    line-height: 1;
}
.es-bottomnav__item--avatar .es-avatar--placeholder {
    box-shadow: 0 1px 4px rgba(16, 21, 27, 0.1);
    letter-spacing: .02em;
}
.es-bottomnav__item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.es-bottomnav__item.active,
.es-bottomnav__settings.active > .es-bottomnav__item,
.es-bottomnav__more.active > .es-bottomnav__item {
    color: var(--es-accent);
}
.es-bottomnav__settings,
.es-bottomnav__more {
    position: relative;
    display: flex;
}
.es-bottomnav__settings > .es-bottomnav__item,
.es-bottomnav__more > .es-bottomnav__item {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}
.es-content { flex: 1; min-width: 0; min-height: 100%; display: flex; flex-direction: column; position: relative; background: #fff; }

.es-nav-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 60;
    overflow: hidden;
    pointer-events: none;
    background: transparent;
}
.es-nav-progress[hidden] { display: none !important; }
.es-nav-progress__bar {
    height: 100%;
    width: 0;
    background: #fff000;
    transition: width 0.2s ease;
}
.es-nav-progress.is-complete .es-nav-progress__bar {
    transition: width 0.15s ease;
}

.es-content-bar {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 14px;
    margin: 0;
    padding: 0 24px 18px 20px;
    flex: none;
    background: var(--es-top-chrome-bg);
    border-bottom: 1px solid #eaebef;
}
.es-content-bar .es-brand-mark,
.es-content-bar .es-logo {
    align-self: flex-start;
    margin: 0 0 0 4px;
}
.es-breadcrumbs {
    min-width: 0;
    flex: none;
    padding-top: 9px;
}
.es-breadcrumbs__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    line-height: 1.4;
    color: var(--es-ink-soft);
}
.es-breadcrumbs__item {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
}
.es-breadcrumbs__item + .es-breadcrumbs__item::before {
    content: '/';
    margin: 0 9px;
    color: var(--es-ink-faint);
}
.es-breadcrumbs__item a {
    color: var(--es-ink-soft);
    text-decoration: none;
}
.es-breadcrumbs__item a:hover {
    color: var(--es-ink);
    text-decoration: underline;
}
.es-breadcrumbs__item--current {
    color: var(--es-ink-soft);
}
.es-breadcrumbs__icon {
    display: none;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 16px;
    height: 16px;
    color: var(--es-ink-soft);
}
.es-breadcrumbs__icon svg {
    display: block;
    width: 16px;
    height: 16px;
}
.es-breadcrumbs__label {
    min-width: 0;
}

.es-shell--bare {
    display: flex;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}
.es-shell--bare > .es-main {
    flex: 1;
    min-width: 0;
    max-width: none;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.es-main {
    width: 100%;
    max-width: var(--es-maxw);
    margin: 0 auto;
    padding: 52px 24px 104px;
    flex: 1 0 auto;
    background: #fff;
    transition: opacity 0.18s ease;
}
.es-main--hub {
    max-width: none;
    margin: 0;
    /* Grey only for the chrome above .es-canvas (pagehead / filters / controls). */
    background: var(--es-top-chrome-bg);
    padding: 40px 24px 0;
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
    min-height: 0;
}
.es-canvas {
    background: #fff;
    margin: 0 -24px;
    padding: 0 0 104px;
    width: calc(100% + 48px);
    box-sizing: border-box;
    border-top: 1px solid #eaebef;
    /* Fill remaining hub height so grey never shows below the content line. */
    flex: 1 0 auto;
}
/* Filters sit on the grey hub; the nested white canvas fills the rest. */
.es-main--hub > .es-workout-table-component {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
    min-height: 0;
}
.es-main--hub > .es-workout-table-component > .es-canvas {
    flex: 1 0 auto;
}
/* Empty hub pages (filters / message only): white fill below the header chrome. */
.es-main--hub:not(:has(.es-canvas)):not(:has(.es-calendar))::after {
    content: '';
    display: block;
    flex: 1 0 auto;
    margin: 0 -24px;
    width: calc(100% + 48px);
    box-sizing: border-box;
    background: #fff;
    border-top: 1px solid #eaebef;
}
body:has(.es-canvas) .es-content-bar,
body:has(.es-calendar) .es-content-bar {
    border-bottom: 0;
}
body.es-has-rpanel .es-main {
    margin-left: 0;
    margin-right: auto;
}
.es-main.is-loading {
    opacity: 0.55;
    pointer-events: none;
}
.es-main--narrow { max-width: 720px; }

.es-pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.es-pagehead h1 { margin: 0; }
.es-pagehead .sub { color: var(--es-ink-soft); margin-top: 4px; font-size: 13px; }
.es-pagehead-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* Icon + title: bottom-align SVG with the h1 line; shared left inset for all pageheads. */
.es-pagehead__title {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 10px;
    min-width: 0;
}
.es-pagehead__title > div {
    display: contents;
}
.es-pagehead__title > svg,
.es-pagehead__title > .es-settings-menu__icon {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    width: 24px;
    height: 24px;
    flex: none;
    color: #111;
    stroke-width: 2;
    margin: 0 0 0 5px;
}
.es-pagehead__title > .es-settings-menu__icon--mark {
    width: 30px;
    height: 30px;
    margin-left: 5px;
    margin-right: 0;
    stroke-width: initial;
}
.es-pagehead__title h1,
.es-pagehead__title .es-pagehead__heading-row {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    min-width: 0;
}
.es-pagehead__title .sub {
    grid-column: 2;
    grid-row: 2;
}

/* Shared hub pagehead inset (Workouts / Calendar / Analysis / Documents). */
.es-main--hub > .es-pagehead {
    margin-bottom: 16px;
    padding-left: 8px;
}

@media (max-width: 860px) {
    .es-main--hub > .es-pagehead {
        margin-bottom: 12px;
        padding-left: 0;
    }
}

/* App icon controls: match the ES Coach microphone interaction treatment. */
body :is(.es-dash-setup__close, .es-rpanel__close, .es-analysis-drawer__close) {
    background: transparent;
    color: #566477;
}
body :is(.es-dash-setup__close, .es-rpanel__close, .es-analysis-drawer__close):is(:hover, :focus-visible) {
    background: var(--es-accent-soft);
    color: var(--es-accent);
    outline: none;
}
button.es-bottomnav__item[aria-label$=" menu"]:is(:hover, :focus-visible) {
    background: var(--es-accent-soft);
    color: var(--es-accent);
    outline: none;
}

.es-footer {
    width: 100%;
    max-width: none;
    margin: 0;
    margin-top: auto;
    padding: 22px 24px;
    background: #eceef1;
    border-top: 1px solid #e2e4e8;
    color: var(--es-ink-faint);
    font-size: 13px;
    text-align: center;
    flex: 0 0 auto;
}
.es-footer__tagline {
    margin: 0;
}
.es-footer__nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0 8px;
    margin: 8px 0 0;
}
.es-footer__dot {
    color: var(--es-ink-faint);
    user-select: none;
}
.es-footer__link {
    color: var(--es-ink-soft);
    text-decoration: none;
}
a.es-footer__link:hover {
    color: var(--es-ink);
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Block chrome — top rule only on white canvas (admin keeps bordered cards)
   -------------------------------------------------------------------------- */

.es-block {
    background: transparent;
    border: 0;
    border-top: 1px solid var(--es-line);
    border-radius: 0;
    margin: 0 0 28px;
    padding: 0;
    overflow: visible;
    box-shadow: none;
}

.es-canvas .es-block {
    margin: 0;
    padding: 8px 48px 40px;
}
.es-canvas > .es-block:first-child {
    border-top: 0;
}

.es-block-head { padding: 18px 0 0; }
.es-canvas .es-block-head { padding: 24px 0 0; }
.es-block-title { font-size: 17px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; line-height: 1.35; }
.es-block-desc { color: var(--es-ink-soft); font-size: 13px; margin: 2px 0 0; line-height: 1.5; }
.es-block-head:has(.es-block-desc) + .es-block-body {
    padding-top: 18px;
}
.es-block-body { padding: 14px 0 8px; }
.es-canvas .es-block-body { padding: 16px 0 8px; }
.es-block.is-selected {
    outline: 2px solid var(--es-accent);
    outline-offset: 2px;
}
.es-block-help {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 0;
    background: transparent;
    color: #1C274C;
    line-height: 0;
    cursor: pointer;
    padding: 0;
    margin-top: 1px;
}
.es-block-help__icon {
    display: block;
    width: 100%;
    height: 100%;
}
.es-block-help:hover {
    color: var(--es-accent);
    background: transparent;
}
.es-block-help--lg {
    width: 28px;
    height: 28px;
    margin-top: 0;
    color: #1C274C;
}
.es-block-help--lg:hover {
    color: #111827;
    background: transparent;
}
.es-block-body--flush { padding: 12px 0 0; }
.es-canvas .es-block-body--flush { padding: 18px 0 0; }

tr.es-rowlink.is-selected td { background: var(--es-accent-soft); }

.es-workout-star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 1.15em;
    height: 1.15em;
    margin-right: 0.35em;
    vertical-align: -0.14em;
    color: #f5c518;
}
.es-workout-star[hidden] {
    display: none !important;
}
.es-workout-star svg {
    width: 100%;
    height: 100%;
    display: block;
    fill: currentColor;
}
.admin-aw-detail__title .es-workout-star {
    width: 18px;
    height: 18px;
    margin: 0;
    vertical-align: 0;
}
.admin-aw-detail__title {
    gap: 4px;
}
.admin-aw-detail__title-text {
    min-width: 0;
    line-height: 1.25;
}
.admin-aw-detail__title-star {
    flex: none;
    box-sizing: border-box;
    width: 22px;
    height: 22px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    color: #f5c518;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    -webkit-tap-highlight-color: transparent;
}
.admin-aw-detail__title-star svg {
    width: 18px;
    height: 18px;
    display: block;
}
.admin-aw-detail__title-star.is-starred svg {
    fill: currentColor;
    stroke: none;
}
.admin-aw-detail__title-star:not(.is-starred) {
    color: #f5c518;
    opacity: 0;
}
.admin-aw-detail__title-star:not(.is-starred) svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}
.admin-aw-detail__title:hover .admin-aw-detail__title-star:not(.is-starred),
.admin-aw-detail__title-star:not(.is-starred):focus-visible,
.admin-aw-detail__title-star:not(.is-starred):active {
    opacity: 1;
}
.admin-aw-detail__title-star:hover,
.admin-aw-detail__title-star:focus-visible,
.admin-aw-detail__title-star:active {
    background: transparent !important;
    outline: none;
}
@media (hover: none), (pointer: coarse) {
    .admin-aw-detail__title-star:not(.is-starred) {
        opacity: 0.55;
    }
    .admin-aw-detail__title-star:not(.is-starred):active {
        opacity: 1;
    }
}

.es-profile-header {
    margin: 0 0 16px;
    padding: 8px 0;
}
.es-profile-header .es-hub-bar,
.es-hub-bar-wrap .es-hub-bar {
    margin-top: 0;
    padding-top: 0;
}
.es-hub-bar-wrap {
    margin-top: 12px;
    padding-top: 10px;
}
.es-main--hub .es-profile-header {
    margin-bottom: 12px;
    padding: 10px 0;
}
.es-profile-header__main {
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 84px;
    padding-left: 10px;
}
.es-profile-header__photo,
.es-profile-header__photo.es-avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
}
.es-profile-header__placeholder {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: var(--es-accent-soft);
    color: var(--es-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: .02em;
}
.es-profile-header__photo,
.es-profile-header__placeholder {
    box-shadow: 0 2px 8px rgba(16, 21, 27, 0.1);
}
.es-profile-header__identity {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
}
.es-profile-header__name {
    font-size: 22px;
    line-height: 1.15;
    margin: 0;
}
.es-profile-header__role {
    margin: 0;
    color: var(--es-ink-faint);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.3;
}
.es-profile-header__role--edit {
    display: inline-block;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--es-ink-faint);
    text-align: left;
    cursor: pointer;
    text-decoration: none;
}
.es-profile-header__role--edit:hover {
    color: var(--es-ink-soft);
    text-decoration: underline;
    text-decoration-color: rgba(107, 114, 128, 0.7);
    text-underline-offset: 3px;
}

.es-main-sport__body {
    max-height: min(78vh, 560px);
    overflow: auto;
}
.es-main-sport__list {
    display: grid;
    gap: 4px;
}
.es-main-sport__option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 9px 10px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--es-ink);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
}
.es-main-sport__option:hover {
    background: var(--es-bg);
}
.es-main-sport__option:has(input:checked) {
    background: rgba(45, 180, 150, 0.12);
}
.es-main-sport__option input {
    flex: none;
    margin: 0;
    accent-color: #0f8f78;
}
.es-main-sport__other {
    display: block;
    margin-top: 12px;
}
.es-main-sport__other.is-hidden {
    display: none;
}
.es-main-sport__other .es-label {
    display: block;
    margin-bottom: 6px;
    margin-left: 8px;
}
.es-main-sport .es-dash-setup__actions {
    border-top: 0;
    background: transparent;
}
.es-main-sport .es-dash-setup__actions .es-btn {
    min-width: 0;
}
@media (max-width: 700px) {
    .es-main-sport .es-dash-setup__actions .es-btn {
        flex: none;
    }
}
.es-profile-header__stats {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    margin-left: auto;
    justify-content: flex-end;
    text-align: right;
}
.es-profile-header__side {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}
.es-profile-header__side .es-profile-header__stats {
    margin-left: 0;
}
.es-profile-header__stats div {
    min-width: 110px;
}
.es-profile-header__stats strong {
    display: block;
    font-family: var(--es-mono);
    font-size: 18px;
    line-height: 1.1;
}
.es-profile-header__stats span {
    display: block;
    color: var(--es-ink-faint);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .06em;
    margin-top: 5px;
    text-transform: uppercase;
}
@media (max-width: 760px) {
    .es-profile-header__main {
        align-items: center;
        flex-wrap: wrap;
    }
    .es-profile-header__side,
    .es-profile-header__stats {
        width: 100%;
        margin-left: 64px;
        align-items: flex-start;
        justify-content: flex-start;
        text-align: left;
    }
}

@media (max-width: 860px) {
    .es-profile-header__main {
        min-height: 0;
        gap: 12px;
        padding-left: 0;
        align-items: center;
    }
    .es-profile-header__photo,
    .es-profile-header__photo.es-avatar,
    .es-profile-header__placeholder {
        width: 60px;
        height: 60px;
        margin-left: 6px;
        flex: none;
    }
    .es-profile-header__placeholder {
        font-size: 20px;
    }
    .es-profile-header__identity {
        justify-content: center;
        align-self: center;
    }
    .es-profile-header__name {
        margin: 0;
        font-size: 20px;
        line-height: 1.15;
    }
    .es-profile-header__role,
    .es-profile-header__role--edit {
        margin: 0;
        line-height: 1.3;
    }
}

.es-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 99px;
    background: var(--es-accent-soft);
    color: var(--es-accent);
}
.es-chart { position: relative; width: 100%; height: 270px; margin-top: 4px; }
.es-chart > canvas { display: block; max-width: 100%; }
.es-chart--chronic { height: 270px; }

/* Floating chart tooltip (VO2max and future rich tips) */
.es-chart-tooltip {
    position: absolute;
    z-index: 2400;
    pointer-events: none;
    max-width: min(300px, calc(100vw - 24px));
    filter: drop-shadow(0 8px 20px rgba(16, 21, 27, 0.22));
}
.es-chart-tooltip[hidden] { display: none !important; }
.es-chart-tooltip__inner {
    background: rgba(28, 33, 40, 0.94);
    color: #fff;
    border-radius: 10px;
    padding: 11px 12px 10px;
    font-size: 12.5px;
    line-height: 1.45;
}
.es-chart-tooltip__head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}
.es-chart-tooltip__head[hidden] { display: none !important; }
.es-chart-tooltip__icon {
    flex: none;
    width: 36px;
    height: 36px;
    margin-top: 0;
    background-color: #fff;
    -webkit-mask-image: var(--tip-route);
    mask-image: var(--tip-route);
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
}
.es-chart-tooltip__icon[hidden] { display: none !important; }
.es-chart-tooltip__head-text {
    min-width: 0;
    flex: 1;
}
.es-chart-tooltip__name {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.01em;
    line-height: 1.25;
    color: #fff;
}
.es-chart-tooltip__meta {
    margin-top: 3px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.72);
}
.es-chart-tooltip__meta[hidden] { display: none !important; }
.es-chart-tooltip__when + .es-chart-tooltip__location {
    margin-top: 1px;
}
.es-chart-tooltip__body {
    color: rgba(255, 255, 255, 0.9);
}
.es-chart-tooltip__body[hidden] { display: none !important; }
.es-chart-tooltip__line + .es-chart-tooltip__line {
    margin-top: 1px;
}
.es-chart-tooltip--mean .es-chart-tooltip__body {
    color: rgba(255, 255, 255, 0.92);
}
.es-chart-tooltip--mean .es-chart-tooltip__line:first-child {
    font-weight: 650;
    color: #fff;
}
.es-chart-tooltip--workout .es-chart-tooltip__body {
    padding-top: 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.es-chart-tooltip__caret {
    position: absolute;
    bottom: -6px;
    width: 12px;
    height: 12px;
    margin-left: -6px;
    background: rgba(28, 33, 40, 0.94);
    transform: rotate(45deg);
    border-radius: 2px;
}
.es-chart-tooltip--below .es-chart-tooltip__caret {
    bottom: auto;
    top: -6px;
}

.es-map {
    width: 100%;
    height: 300px;
    border-radius: var(--es-r-sm);
    background: var(--es-bg);
    position: relative;
    overflow: hidden;
}

.es-map-host {
    position: relative;
}

.es-map-activate {
    position: absolute;
    inset: 0;
    z-index: 1100;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: inherit;
    background: rgba(248, 250, 252, 0.12);
    color: #0f172a;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.es-map-activate span {
    position: absolute;
    left: 16px;
    bottom: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: none;
    pointer-events: none;
}

.es-map-host.is-map-active > .es-map-activate,
.es-map-activate[hidden] {
    display: none;
}

.es-empty {
    padding: 34px 22px;
    text-align: center;
    color: var(--es-ink-faint);
    font-size: 14px;
}

/* Dashboard hub filter bar */
.es-hub-bar {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 16px 20px;
    flex-wrap: wrap;
}

/* Dashboard view filters (inline on hub bar) */
.es-dash-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 10px 12px;
}
.es-dash-filters--inline {
    margin: 0 0 0 auto;
    padding: 0;
    background: transparent;
    border: 0;
    flex: 1 1 auto;
    justify-content: flex-end;
}
.es-dash-filters__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 0 1 168px;
}
.es-dash-filters__field.is-hidden {
    display: none !important;
}
.es-dash-filters__label {
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--es-ink-faint);
}
.es-dash-filters .es-input {
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    height: 40px;
    padding: 0 36px 0 12px;
    font-size: 13.5px;
}
.es-dash-filters select.es-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 7.5 5 5 5-5' fill='none' stroke='%236b7280' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px 14px;
    appearance: none;
    -webkit-appearance: none;
}
.es-dash-filters input[type="date"].es-input {
    padding-right: 12px;
}

@media (max-width: 700px) {
    .es-hub-bar {
        align-items: stretch;
    }
    .es-dash-filters--inline {
        margin-left: 0;
        justify-content: stretch;
        width: 100%;
    }
    .es-dash-filters--inline .es-dash-filters__field {
        flex: 1 1 calc(50% - 6px);
    }
}

/* Shared dialog chrome (main sport picker, etc.) */
.es-dash-setup {
    width: min(440px, calc(100vw - 28px));
    max-width: none;
    margin: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--es-ink);
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(16, 21, 27, 0.24);
}
.es-dash-setup::backdrop {
    background: rgba(20, 27, 35, 0.56);
}
.es-dash-setup[open] {
    animation: es-confirm-in 160ms ease-out;
}
.es-dash-setup__surface {
    overflow: hidden;
    background: var(--es-surface);
    border: 1px solid rgba(28, 33, 40, 0.1);
    border-radius: 16px;
}
.es-dash-setup__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 22px 0;
}
.es-dash-setup__head h2 {
    margin: 0 0 6px;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.es-dash-setup__head p {
    margin: 0;
    color: var(--es-ink-soft);
    font-size: 13.5px;
    line-height: 1.4;
}
.es-dash-setup__close {
    flex: none;
    width: 32px;
    height: 32px;
    margin: -4px -6px 0 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--es-ink-soft);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.es-dash-setup__close:hover {
    background: var(--es-bg);
    color: var(--es-ink);
}
.es-dash-setup__body {
    padding: 18px 22px 8px;
}
.es-dash-setup__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 22px 20px;
}

/* KPI strip */
.es-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--es-line); border-top: 1px solid var(--es-line); }
.es-kpi { background: var(--es-surface); padding: 14px 18px; }
.es-kpi .v { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.es-kpi .l { font-size: 13px; color: var(--es-ink-soft); font-weight: 600; }
.es-kpi .d { font-size: 12px; color: var(--es-ink-soft); }

/* Chart + side KPIs (PMC / VO2max) */
.es-chart-with-kpis {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(120px, 156px);
    gap: 16px;
    align-items: stretch;
}
.es-chart-with-kpis__chart { min-width: 0; }
.es-chart-with-kpis__chart .es-chart { margin-top: 0; }
.es-chart-with-kpis__kpis { display: flex; min-height: 270px; }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.es-table-wrap {
    overflow-x: auto;
}
table.es-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
    font-family: var(--es-table-font);
}
table.es-table th,
table.es-table td {
    text-align: right;
    padding: 7px 10px;
    border-bottom: 1px solid var(--es-line);
    color: var(--es-ink);
    vertical-align: middle;
    font-family: inherit;
}
table.es-table th:first-child,
table.es-table td:first-child {
    text-align: left;
}
table.es-table thead th {
    color: var(--es-ink-soft);
    font-weight: 600;
    border-bottom: 2px solid var(--es-line);
    white-space: nowrap;
    background: var(--es-surface);
}
table.es-table td.num,
table.es-table th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
table.es-table tr:hover td { background: #f8f9fa; }
table.es-table tbody tr:last-child > * { border-bottom: 0; }

.es-inline-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}
.es-workout-row-table th:first-child,
.es-workout-row-table td:first-child {
    width: 240px;
}
.es-workout-row-table td {
    text-align: left;
    vertical-align: top;
}
.es-workout-row-table pre {
    margin: 8px 0 0;
    max-height: 420px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: var(--es-mono);
    font-size: 12px;
    line-height: 1.45;
}
.es-workout-row-details {
    border: 1px solid var(--es-line);
    border-radius: var(--es-r-sm);
    margin-bottom: 10px;
    overflow: hidden;
}
.es-workout-row-details summary {
    cursor: pointer;
    padding: 10px 12px;
    font-weight: 700;
    background: var(--es-bg);
}
.es-workout-row-details .es-table-wrap {
    border-top: 1px solid var(--es-line);
}

#es-athletes-table th,
#es-athletes-table td,
#es-coaches-table th,
#es-coaches-table td {
    vertical-align: middle;
}
#es-athletes-table td,
#es-coaches-table td {
    padding-top: 10px;
    padding-bottom: 10px;
}
#es-athletes-table td:first-child,
#es-athletes-table td[data-col="pic"],
#es-coaches-table td:first-child,
#es-coaches-table td[data-col="pic"] {
    text-align: center;
}
#es-athletes-table.es-athletes-table--mine td:first-child,
#es-athletes-table.es-athletes-table--mine th:first-child {
    text-align: left;
    padding-left: 10px;
}
#es-athletes-table .es-avatar,
#es-coaches-table .es-avatar {
    margin: 0 auto;
}
#es-athletes-table.es-athletes-table--mine .es-avatar {
    margin: 0;
    flex: none;
}
.es-athletes-table--mine {
    font-size: 14px;
    font-weight: 400;
}
.es-athletes-table--mine thead th {
    font-size: 12px;
    font-weight: 600;
}
.es-athletes-table--mine td {
    font-weight: 400;
    font-size: 14px;
}
.es-athletes-name {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    min-width: 0;
}
.es-athletes-name__text {
    min-width: 0;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.3;
    text-align: left;
}
.es-athletes-last-workout-cell {
    min-width: 0;
}
.es-athletes-last-workout {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    white-space: nowrap;
}
.es-athletes-last-workout__date {
    flex: none;
    color: var(--es-ink-soft);
    font-variant-numeric: tabular-nums;
}
.es-athletes-last-workout__type {
    flex: none;
}
.es-athletes-last-workout__name {
    position: relative;
    flex: 0 1 220px;
    min-width: 120px;
    max-width: 240px;
    overflow: hidden;
}
.es-athletes-last-workout__name .admin-all-workouts-name-inner {
    padding-left: 42px;
    max-width: 100%;
}
.es-athletes-last-workout__name .admin-all-workouts-route {
    position: absolute;
    left: 0;
    top: 50%;
    bottom: auto;
    width: 36px;
    height: 36px;
    transform: translateY(-50%);
}
.es-athletes-last-workout__name .admin-all-workouts-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.es-athletes-last-workout__metric {
    flex: none;
    font-variant-numeric: tabular-nums;
}
.es-athletes-last-workout__intensity {
    flex: none;
    width: 80px;
}
.es-athletes-last-workout__zones {
    flex: none;
    width: 84px;
}
.es-athletes-last-workout__zones .admin-all-workouts-zones {
    width: 100%;
    height: 10px;
}
#es-athletes-table td.num,
#es-athletes-table th.num,
#es-coaches-table td.num,
#es-coaches-table th.num {
    text-align: right;
}
#es-athletes-table td.es-right,
#es-coaches-table td.es-right {
    text-align: right;
}
#es-athletes-table [data-col][hidden],
#es-coaches-table [data-col][hidden] {
    display: none !important;
}
.es-athletes-toolbar {
    position: relative;
    margin-bottom: 14px;
}
.es-athletes-toolbar .admin-all-workouts-filter-bar {
    margin: 0;
}
.es-athletes-toolbar .admin-all-workouts-shown {
    margin: 0;
    color: var(--es-ink-soft);
    font-size: 13px;
}
.es-athletes-toolbar .admin-all-workouts-filter-summary--columns {
    margin-left: auto;
}

/* --------------------------------------------------------------------------
   Forms & buttons
   -------------------------------------------------------------------------- */

.es-input, .es-select, .es-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #cfd4d9;
    border-radius: 999px;
    font: inherit;
    font-size: 14px;
    background: var(--es-surface);
    color: var(--es-ink);
}
.es-input:focus, .es-select:focus, .es-textarea:focus {
    outline: 2px solid var(--es-accent);
    outline-offset: -1px;
    border-color: var(--es-accent);
}
.es-textarea { min-height: 84px; resize: vertical; border-radius: 16px; }

.es-label { display: block; font-size: 12.5px; font-weight: 700; color: var(--es-ink-soft); margin: 0 0 4px 8px; }
/* Textareas are not fully rounded — keep their titles flush. */
.es-label:has(+ .es-textarea),
.es-field:has(> .es-textarea) > .es-label {
    margin-left: 0;
}
.es-help { font-size: 12px; color: var(--es-ink-faint); margin-top: 3px; }
.es-label--with-help {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.es-field-help-btn {
    appearance: none;
    box-sizing: border-box;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    background: #fff;
    color: #64748b;
    font: 700 10px/1 inherit;
    cursor: pointer;
    flex: 0 0 auto;
    vertical-align: middle;
}
.es-field-help-btn:hover,
.es-field-help-btn:focus-visible {
    border-color: #2563eb;
    color: #2563eb;
    outline: none;
}
#es-admin-field-help #es-admin-field-help-body {
    white-space: pre-wrap;
}
.es-autosave-status { min-height: 18px; color: var(--es-ink-faint); font-size: 12px; margin-top: 3px; margin-left: 8px; transition: color .45s ease, opacity .45s ease; opacity: 0; }
.es-autosave-status.is-saving { color: var(--es-accent); }
.es-autosave-status.is-saving,
.es-autosave-status.is-saved,
.es-autosave-status.is-error { opacity: 1; }
.es-autosave-status.is-saved { color: var(--es-ok); }
.es-autosave-status.is-error { color: var(--es-danger); }
.es-field { margin-bottom: 14px; }
.es-fields-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 18px; }
.es-fields-grid > .es-field { margin-bottom: 0; }

.es-check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.es-check input { width: 16px; height: 16px; accent-color: var(--es-accent); }

.es-toggle-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--es-line);
}
.es-toggle-row:last-child {
    border-bottom: 0;
}
.es-toggle-row input {
    width: 17px;
    height: 17px;
    margin-top: 2px;
    accent-color: var(--es-accent);
    flex: 0 0 auto;
}
.es-toggle-row span {
    display: grid;
    gap: 3px;
    min-width: 0;
}
.es-toggle-row strong {
    font-size: 14px;
    line-height: 1.3;
}
.es-toggle-row em {
    color: var(--es-ink-soft);
    font-size: 12.5px;
    font-style: normal;
    line-height: 1.45;
}
.es-form-actions {
    display: flex;
    justify-content: flex-end;
}

.es-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: var(--es-accent);
    color: var(--es-accent-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.es-btn:hover { filter: brightness(1.08); text-decoration: none; }
.es-btn--ghost { background: var(--es-surface); color: var(--es-ink); border-color: #cfd4d9; }
.es-btn--ghost:hover { background: var(--es-bg); filter: none; }
.es-btn--danger { background: var(--es-surface); color: var(--es-danger); border-color: #e5c2c8; }
.es-btn--danger:hover { background: #fdf3f4; filter: none; }
.es-btn--sm { padding: 5px 10px; font-size: 12.5px; }
.es-btn--small { padding: 5px 10px; font-size: 12.5px; }

.es-alert { padding: 12px 16px; border-radius: var(--es-r-sm); font-size: 14px; margin-bottom: 16px; }
.es-alert--err { background: #fdf1f3; color: var(--es-danger); border: 1px solid #f2ccd3; }
.es-alert--ok { background: #eefaf1; color: var(--es-ok); border: 1px solid #c9ecd4; }
.es-alert--info { background: var(--es-accent-soft); color: var(--es-accent); border: 1px solid #c9d8f0; }
.es-alert--warn { background: #fff2d7; color: #7a4e12; border: 1px solid #efd79d; }
.es-alert--hiding {
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .28s ease, transform .28s ease;
    pointer-events: none;
}

/* Site-wide confirmation dialog */
.es-confirm-dialog {
    width: min(460px, calc(100vw - 32px));
    max-width: none;
    margin: auto;
    padding: 0;
    color: var(--es-ink);
    background: transparent;
    border: 0;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(16, 21, 27, 0.24);
    overflow: visible;
}
.es-confirm-dialog::backdrop { background: rgba(20, 27, 35, 0.56); }
.es-confirm-dialog[open] { animation: es-confirm-in 160ms ease-out; }
.es-confirm-dialog__surface {
    overflow: hidden;
    background: var(--es-surface);
    border: 1px solid rgba(28, 33, 40, 0.1);
    border-radius: 16px;
}
.es-confirm-dialog__content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 26px 26px 22px;
}
.es-confirm-dialog__icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    color: var(--es-accent);
    background: var(--es-accent-soft);
    border-radius: 50%;
    font-size: 21px;
    font-weight: 800;
    line-height: 1;
}
.es-confirm-dialog--danger .es-confirm-dialog__icon {
    color: var(--es-danger);
    background: #fdf1f3;
}
.es-confirm-dialog__copy { min-width: 0; }
.es-confirm-dialog__copy h2 {
    margin: 1px 0 8px;
    color: var(--es-ink);
    font-size: 19px;
    font-weight: 750;
    letter-spacing: -0.015em;
}
.es-confirm-dialog__copy p {
    margin: 0;
    color: var(--es-ink-soft);
    font-size: 14px;
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-line;
}
.es-confirm-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 26px;
    background: #fafbfc;
    border-top: 1px solid var(--es-line);
}
.es-confirm-dialog__actions .es-btn {
    justify-content: center;
    min-width: 96px;
}
.es-confirm-dialog--alert .es-confirm-dialog__actions [data-es-confirm-cancel] {
    display: none !important;
}
.es-confirm-dialog__danger-action {
    background: var(--es-danger);
    color: #fff;
}
.es-confirm-dialog__actions--triple{flex-wrap:wrap}
.es-confirm-dialog__actions--triple .es-btn{min-width:0}
@media(max-width:520px){
    .es-confirm-dialog__actions--triple{flex-direction:column-reverse}
    .es-confirm-dialog__actions--triple .es-btn{width:100%}
}
.es-confirm-dialog--fallback {
    position: fixed;
    inset: 0;
    z-index: 13000;
}
@keyframes es-confirm-in {
    from { opacity: 0; transform: translateY(8px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 520px) {
    .es-confirm-dialog { width: calc(100vw - 24px); }
    .es-confirm-dialog__content { gap: 12px; padding: 22px 20px 20px; }
    .es-confirm-dialog__icon { flex-basis: 36px; width: 36px; height: 36px; font-size: 18px; }
    .es-confirm-dialog__copy h2 { font-size: 18px; }
    .es-confirm-dialog__actions { padding: 14px 20px; }
    .es-confirm-dialog__actions .es-btn { flex: 1 1 0; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .es-confirm-dialog[open] { animation: none; }
}

/* Profile photo crop dialog */
.es-photo-crop {
    width: min(440px, calc(100vw - 24px));
    max-width: none;
    margin: auto;
    padding: 0;
    color: var(--es-ink);
    background: transparent;
    border: 0;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(16, 21, 27, 0.28);
    overflow: visible;
}
.es-photo-crop::backdrop { background: rgba(12, 18, 24, 0.72); }
.es-photo-crop[open] { animation: es-confirm-in 160ms ease-out; }
.es-photo-crop__surface {
    overflow: hidden;
    background: var(--es-surface);
    border: 1px solid rgba(28, 33, 40, 0.1);
    border-radius: 16px;
}
.es-photo-crop__header {
    padding: 22px 24px 8px;
}
.es-photo-crop__header h2 {
    margin: 0 0 6px;
    font-size: 19px;
    font-weight: 750;
    letter-spacing: -0.015em;
}
.es-photo-crop__header p {
    margin: 0;
    color: var(--es-ink-soft);
    font-size: 13.5px;
    line-height: 1.45;
}
.es-photo-crop__stage-wrap {
    display: flex;
    justify-content: center;
    padding: 12px 24px 8px;
}
.es-photo-crop__stage {
    position: relative;
    width: min(280px, calc(100vw - 88px));
    height: min(280px, calc(100vw - 88px));
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 50%;
    background: #1c2128;
    cursor: grab;
    touch-action: none;
    user-select: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.es-photo-crop__stage.is-dragging { cursor: grabbing; }
.es-photo-crop__img {
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: none;
    pointer-events: none;
    transform: translate(-50%, -50%);
    will-change: transform, width, height;
}
.es-photo-crop__mask {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 999px rgba(12, 18, 24, 0.35);
    pointer-events: none;
}
.es-photo-crop__controls {
    padding: 8px 24px 4px;
}
.es-photo-crop__zoom {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 12px;
    color: var(--es-ink-soft);
    font-size: 13px;
    font-weight: 600;
}
.es-photo-crop__zoom input[type="range"] {
    width: 100%;
    accent-color: var(--es-accent);
}
.es-photo-crop__error {
    margin: 10px 0 0;
    color: var(--es-danger);
    font-size: 13px;
}
.es-photo-crop__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    background: #fafbfc;
    border-top: 1px solid var(--es-line);
}
.es-photo-crop__actions .es-btn {
    justify-content: center;
    min-width: 96px;
}
.es-photo-crop--fallback {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    background: rgba(12, 18, 24, 0.72);
}
@media (max-width: 520px) {
    .es-photo-crop { width: calc(100vw - 16px); }
    .es-photo-crop__header { padding: 18px 18px 6px; }
    .es-photo-crop__stage-wrap { padding: 10px 18px 6px; }
    .es-photo-crop__controls { padding: 6px 18px 2px; }
    .es-photo-crop__actions { padding: 14px 18px; }
    .es-photo-crop__actions .es-btn { flex: 1 1 0; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .es-photo-crop[open] { animation: none; }
}

.es-wearables {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}
.es-wearables--single {
    grid-template-columns: minmax(0, 1fr);
}
.es-wearable-card {
    min-height: 88px;
    border: 1px solid var(--es-line);
    border-radius: 12px;
    background: var(--es-surface);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.es-wearable-logo {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 11px;
    overflow: hidden;
    background: var(--es-bg);
    border: 1px solid var(--es-line);
    display: flex;
    align-items: center;
    justify-content: center;
}
.es-wearable-logo img {
    width: 40px;
    height: 40px;
    display: block;
    object-fit: contain;
}
.es-wearable-logo--brand {
    border-color: transparent;
    background: transparent;
}
.es-wearable-logo--brand img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
}
.es-wearable-logo--apple img,
.es-wearable-logo--samsung img {
    border-radius: 0;
}
.es-wearable-logo--apple,
.es-wearable-logo--samsung {
    overflow: visible;
}
.es-wearable-logo--google {
    border-color: var(--es-line);
    background: #fff;
}
.es-wearable-logo--google img {
    width: 34px;
    height: 34px;
    border-radius: 0;
}
.es-wearable-card__main {
    flex: 1;
    min-width: 0;
}
.es-wearable-card__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.es-wearable-dot {
    flex: none;
    border-radius: 50%;
    background: #9ca3af;
}
.es-wearable-dot--idle {
    width: 9px;
    height: 9px;
    background: #c5cad1;
}
.es-wearable-dot--active {
    width: 13px;
    height: 13px;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}
.es-wearable-dot--error {
    width: 10px;
    height: 10px;
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14);
}
.es-wearable-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--es-ink);
    line-height: 1.2;
}
.es-wearable-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    color: var(--es-ink-soft);
    font-size: 12px;
    line-height: 1.4;
}
.es-wearable-meta__status {
    font-weight: 600;
    color: var(--es-ink-muted, #4b5563);
}
.es-wearable-card--idle .es-wearable-meta__status {
    color: var(--es-ink-faint, #9aa3b2);
    font-weight: 500;
}
.es-wearable-card--active .es-wearable-meta__status {
    color: #15803d;
}
.es-wearable-card--error .es-wearable-meta__status {
    color: #b91c1c;
}
.es-wearable-meta__sep {
    color: var(--es-ink-faint);
}
.es-wearable-meta__error {
    flex: 0 0 100%;
    margin-top: 2px;
    color: #b91c1c;
    font-size: 11px;
}
.es-wearable-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
    margin-left: 4px;
}
.es-wearable-actions form {
    margin: 0;
}
@media (max-width: 520px) {
    .es-wearables--single .es-wearable-card {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr);
        align-items: center;
    }
    .es-wearables--single .es-wearable-actions {
        grid-column: 2;
        margin-left: 0;
    }
}
.es-wearables-sync {
    margin-top: 16px;
    padding-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.es-wearables-sync form {
    margin: 0;
}
.es-canvas > .es-fit-jobs-stack {
    margin: 14px 24px 0;
}
.es-dashboard-onboard > .es-fit-jobs-stack {
    margin: 0;
}
@media (max-width: 640px) {
    .es-canvas > .es-fit-jobs-stack {
        margin-left: 10px;
        margin-right: 10px;
    }
}

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */

.es-login {
    width: 100%;
    max-width: 400px;
    background: var(--es-surface);
    border: 1px solid var(--es-line);
    border-radius: var(--es-r);
    box-shadow: var(--es-shadow);
    padding: 34px 32px;
}
.es-login .es-logo,
.es-login .es-brand-mark {
    font-size: 18px;
    display: inline-block;
    margin: 0 0 18px;
    font-weight: 800 !important;
}
.es-login h1 { font-size: 22px; }
.es-login .lead { color: var(--es-ink-soft); font-size: 14px; }

/* --------------------------------------------------------------------------
   Athletes list
   -------------------------------------------------------------------------- */

.es-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--es-accent-soft);
    color: var(--es-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex: none;
}
.es-avatar--sm { width: 34px; height: 34px; font-size: 13px; }
.es-avatar--nav {
    width: 34px;
    height: 34px;
    font-size: 12px;
}
.es-avatar--placeholder {
    background: var(--es-accent-soft);
    color: var(--es-accent);
    box-shadow: 0 2px 8px rgba(16, 21, 27, 0.1);
    letter-spacing: .02em;
}

.es-search { position: relative; max-width: 340px; margin-bottom: 16px; }
.es-search input { padding-left: 34px; }
.es-search::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 50%;
    width: 14px;
    height: 14px;
    transform: translateY(-50%);
    background: no-repeat center / contain
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%239aa3ad' stroke-width='2.4' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
}

.es-timezone-picker {
    position: relative;
}
.es-timezone-picker__results {
    position: absolute;
    z-index: 40;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 240px;
    overflow: auto;
    border: 1px solid var(--es-border);
    border-radius: var(--es-r-sm);
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.es-timezone-picker__option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--es-border);
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.es-timezone-picker__option:last-child {
    border-bottom: 0;
}
.es-timezone-picker__option:hover,
.es-timezone-picker__option:focus-visible {
    background: var(--es-accent-soft);
    outline: none;
}
.es-timezone-picker__option-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--es-ink);
}
.es-timezone-picker__option-tz {
    font-size: 11px;
    color: var(--es-ink-soft);
}
.es-timezone-picker__empty {
    padding: 12px;
    color: var(--es-ink-soft);
    font-size: 12px;
}

tr.es-rowlink { cursor: pointer; }
tr.es-rowlink:hover td { background: var(--es-accent-soft); }

/* --------------------------------------------------------------------------
   Right panel (AI · help · workout details)
   -------------------------------------------------------------------------- */

.es-rpanel {
    width: var(--es-rpanel-w);
    max-width: 100vw;
    flex: 0 0 var(--es-rpanel-w);
    background: var(--es-surface);
    border-left: 1px solid var(--es-line);
    box-shadow: var(--es-drawer-shadow);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow: hidden;
    z-index: 40;
    transition:
        flex-basis 0.22s ease,
        width 0.22s ease,
        opacity 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease;
}
body.es-has-sidebar .es-rpanel {
    height: 100vh;
    top: 0;
}
body.es-rpanel-ai-blank #es-rpanel-ai {
    display: none !important;
}
body.es-ai-consent-required #es-rpanel-ai {
    display: none !important;
}
.es-rpanel__view {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
#es-rpanel-ai {
    position: absolute;
    inset: 0;
    background: var(--es-surface);
    transform: translateX(0);
    transition: transform 0.22s ease;
    z-index: 2;
}
body.es-rpanel-closed #es-rpanel-ai {
    transform: translateX(100%);
    pointer-events: none;
}
.es-rpanel__view[hidden] { display: none !important; }
.es-rpanel-empty {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px;
    background: var(--es-surface);
}
.es-rpanel-empty__btn {
    width: auto;
    max-width: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--es-ink-soft);
    font: inherit;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    box-shadow: none;
    text-decoration: none;
}
.es-rpanel-empty__btn:hover {
    color: var(--es-ink);
    text-decoration: underline;
}
.es-rpanel-empty__btn--primary {
    margin-bottom: 18px;
    padding: 14px 28px;
    border-radius: var(--es-r-sm);
    background: #fff000;
    color: #000;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}
.es-rpanel-empty__btn--primary:hover {
    background: #fff000;
    color: #000;
    filter: brightness(1.06);
    text-decoration: none;
}
.es-rpanel-empty__links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0 8px;
}
.es-rpanel-empty__sep {
    color: var(--es-ink-faint);
    font-size: 13px;
    line-height: 1;
    user-select: none;
}
.es-ai-consent-prompt {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
    background: var(--es-surface);
}
.es-ai-consent-prompt[hidden] {
    display: none !important;
}
.es-ai-consent-prompt__card {
    width: 100%;
    max-width: 390px;
    padding: 20px;
    border: 1px solid var(--es-line);
    border-radius: var(--es-r);
    background: var(--es-surface);
    box-shadow: 0 12px 32px rgba(16, 21, 27, 0.08);
}
.es-ai-consent-prompt__card h2 {
    margin: 0 0 8px;
    font-size: 18px;
}
.es-ai-consent-prompt__card > p {
    margin: 0 0 16px;
    color: var(--es-ink-soft);
    font-size: 13px;
    line-height: 1.5;
}
.es-ai-consent-prompt__check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--es-ink);
    font-size: 13px;
    line-height: 1.5;
    cursor: pointer;
}
.es-ai-consent-prompt__check input {
    flex: none;
    width: 17px;
    height: 17px;
    margin: 2px 0 0;
    accent-color: var(--es-accent);
}
.es-ai-consent-prompt__actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}
.es-ai-consent-prompt__settings {
    display: inline-block;
    margin-top: 14px;
    color: var(--es-ink-soft);
    font-size: 12px;
}
.es-rpanel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--es-line);
    flex: none;
}
.es-rpanel__title {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    font-size: 17px;
    font-weight: 700;
    margin: 0;
}
.es-rpanel__title-mark {
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.es-rpanel-help-title {
    color: #111;
    font-size: 22px;
}
.es-rpanel__body.es-rpanel__body--help {
    padding: 18px 32px 26px;
}
.es-rpanel__close {
    background: none;
    border: 0;
    font-size: 22px;
    line-height: 1;
    color: var(--es-ink-faint);
    cursor: pointer;
    padding: 0 4px;
}
.es-rpanel__close:hover { color: var(--es-ink); }
#es-rpanel-ai .es-rpanel__head {
    padding: 14px 18px 14px 32px;
    border-bottom: 0;
}
#es-rpanel-ai .es-rpanel__title {
    font-size: 22px;
}
#es-rpanel-ai .es-rpanel__close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
    color: #566477;
}
#es-rpanel-ai .es-rpanel__close:hover {
    background: #f1f5f9;
}
.es-rpanel__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 14px 18px;
}
.es-rpanel-help-text {
    font-size: 15px;
    line-height: 1.6;
    color: #111;
    white-space: pre-line;
}
.es-rpanel-help-article { font-size: 15px; line-height: 1.62; color: #111; }
.es-rpanel-help-article h2,
.es-rpanel-help-article h3 {
    margin: 0 0 13px;
    font-size: inherit;
    line-height: inherit;
}
.es-rpanel-help-article p { margin: 0 0 13px; }
.es-rpanel-help-article ul,
.es-rpanel-help-article ol { margin: 0 0 13px; padding-left: 22px; }
.es-rpanel-help-article > :last-child { margin-bottom: 0; }
.es-rpanel-help-summary { font-size: inherit; font-weight: 650; }
.es-rpanel-help-more { margin: 0 0 13px; }
.es-rpanel-help-more a { color: #111; font-weight: 700; text-underline-offset: 3px; }
.es-rpanel-help-loading { color: var(--es-ink-faint); }
.es-rpanel-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: var(--es-ink-soft);
    font-size: 13px;
    line-height: 1.5;
}
.es-rpanel-card p {
    margin: 0;
}
.es-feedback-form__body {
    display: flex;
    flex-direction: column;
    padding-bottom: 14px;
}
.es-feedback-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 8px;
}
.es-feedback-form__intro {
    margin: 0 0 4px;
    color: var(--es-ink-soft);
    font-size: 13px;
    line-height: 1.5;
}
.es-feedback-form__message {
    flex: 1 1 auto;
    min-height: 160px;
    resize: vertical;
}
.es-feedback-form__foot {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
    flex: none;
}
.es-feedback-form__hint {
    margin: 0;
}
.es-feedback-form__status {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.4;
}
.es-feedback-form__status.is-ok {
    color: var(--es-ok);
}
.es-feedback-form__status.is-error {
    color: var(--es-danger);
}
.es-feedback-form__submit {
    width: 100%;
    justify-content: center;
}
.es-feedback-form__submit:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: none;
}
.es-feedback-page {
    max-width: 720px;
}
.es-feedback-page__card {
    padding: 24px;
}
.es-feedback-page__form {
    min-height: 0;
    gap: 10px;
}
.es-feedback-page__message {
    min-height: 220px;
    flex: none;
}
.es-feedback-page__footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 6px;
}
.es-feedback-page__footer .es-feedback-form__submit {
    width: auto;
    min-width: 150px;
}
@media (max-width: 640px) {
    .es-feedback-page__card { padding: 18px; }
    .es-feedback-page__footer { align-items: stretch; flex-direction: column; }
    .es-feedback-page__footer .es-feedback-form__submit { width: 100%; }
}
.es-rpanel__workout-head { flex: none; }
.es-wd-drawer .admin-aw-detail__head.es-rpanel__workout-head,
.es-hd-drawer .admin-aw-detail__head.es-rpanel__workout-head,
.es-rpanel .admin-aw-detail__head.es-rpanel__workout-head {
    padding-left: 32px;
    padding-right: 18px;
}
.es-hd-drawer .admin-aw-detail__head.es-rpanel__workout-head {
    padding-left: 32px;
}
/* Workout details: full-bleed rules between sections (like hub blocks) */
.es-wd-drawer .admin-aw-detail__body,
.es-rpanel .admin-aw-detail__body {
    padding: 0 0 24px;
}
.es-wd-drawer .admin-aw-detail__body > .es-workout-deep-analysis-wrap,
.es-rpanel .admin-aw-detail__body > .es-workout-deep-analysis-wrap {
    margin: 0;
    padding: 14px 32px 12px;
}
.es-wd-drawer .admin-aw-detail__body > .es-workout-edit-wrap,
.es-rpanel .admin-aw-detail__body > .es-workout-edit-wrap {
    margin: 0;
    padding: 6px 32px 20px;
}
.es-wd-drawer .admin-aw-detail__body > .admin-aw-detail__route,
.es-rpanel .admin-aw-detail__body > .admin-aw-detail__route {
    margin: 0;
    padding: 4px 32px 28px;
}
.es-wd-drawer .admin-aw-detail__section,
.es-rpanel .admin-aw-detail__section {
    box-sizing: border-box;
    background: transparent;
    border: 0;
    border-top: 1px solid var(--es-line);
    border-radius: 0;
    margin: 0;
    padding: 28px 32px 32px;
    box-shadow: none;
}
.es-wd-drawer .admin-aw-detail__comments,
.es-rpanel .admin-aw-detail__comments {
    box-sizing: border-box;
    margin: 0;
    padding: 20px 32px 24px;
    border-top: 1px solid var(--es-line);
}
.es-rpanel .admin-aw-detail__action.btn svg {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
}
.es-rpanel .admin-aw-detail__sparkline-svg,
.es-rpanel .admin-aw-detail__pace-svg,
.es-rpanel .admin-aw-detail__hr-sparkline-svg,
.es-rpanel .admin-aw-detail__elevation-svg,
.es-rpanel .admin-aw-detail__ef-svg,
.es-rpanel .admin-aw-detail__vo2max-svg {
    max-width: 100%;
}

/* Slide-in right drawers (help · workout · filters · metrics · feedback · …) */
.es-slide-drawer,
.es-wf-drawer,
.es-wd-drawer,
.es-hd-drawer,
.es-feedback-drawer,
.es-bug-drawer,
.es-dashboard-drawer,
.es-md-drawer {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: flex-end;
    pointer-events: none;
    z-index: 1640;
}
.es-hd-drawer { z-index: 1630; }
.es-wd-drawer { z-index: 1640; }
.es-wf-drawer,
.es-md-drawer,
.es-dashboard-drawer { z-index: 1650; }
.es-feedback-drawer { z-index: 1660; }
.es-bug-drawer { z-index: 1665; }

.es-slide-drawer.is-open,
.es-wf-drawer.is-open,
.es-wd-drawer.is-open,
.es-hd-drawer.is-open,
.es-feedback-drawer.is-open,
.es-bug-drawer.is-open,
.es-dashboard-drawer.is-open,
.es-md-drawer.is-open {
    pointer-events: auto;
}

.es-slide-drawer__backdrop,
.es-wd-drawer__backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(16, 21, 27, 0.45);
    opacity: 0;
    transition: opacity 0.22s ease;
    cursor: pointer;
    pointer-events: none;
    appearance: none;
    -webkit-appearance: none;
}
.es-slide-drawer.is-open > .es-slide-drawer__backdrop,
.es-slide-drawer.is-open > .es-wd-drawer__backdrop,
.es-wf-drawer.is-open > .es-slide-drawer__backdrop,
.es-wd-drawer.is-open > .es-slide-drawer__backdrop,
.es-wd-drawer.is-open > .es-wd-drawer__backdrop,
.es-hd-drawer.is-open > .es-slide-drawer__backdrop,
.es-feedback-drawer.is-open > .es-slide-drawer__backdrop,
.es-bug-drawer.is-open > .es-slide-drawer__backdrop,
.es-dashboard-drawer.is-open > .es-slide-drawer__backdrop,
.es-md-drawer.is-open > .es-slide-drawer__backdrop {
    opacity: 1;
    pointer-events: auto;
}

.es-slide-drawer[hidden],
.es-wf-drawer[hidden],
.es-wd-drawer[hidden],
.es-hd-drawer[hidden],
.es-feedback-drawer[hidden],
.es-bug-drawer[hidden],
.es-dashboard-drawer[hidden],
.es-md-drawer[hidden] {
    display: none !important;
}
.es-slide-drawer__panel,
.es-wf-drawer__panel,
.es-wd-drawer__panel,
.es-hd-drawer__panel,
.es-feedback-drawer__panel,
.es-bug-drawer__panel,
.es-dashboard-drawer__panel,
.es-md-drawer__panel {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    flex: 0 0 var(--es-drawer-w);
    width: var(--es-drawer-w);
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    background: var(--es-surface);
    border-left: 1px solid var(--es-line);
    box-shadow: var(--es-drawer-shadow);
    transform: translateX(100%);
    transition: transform 0.22s ease;
    display: flex;
    flex-direction: column;
    pointer-events: none;
    overflow: hidden;
}
.es-slide-drawer.is-open > .es-slide-drawer__panel,
.es-slide-drawer.is-open > .es-wf-drawer__panel,
.es-slide-drawer.is-open > .es-wd-drawer__panel,
.es-slide-drawer.is-open > .es-hd-drawer__panel,
.es-slide-drawer.is-open > .es-feedback-drawer__panel,
.es-slide-drawer.is-open > .es-bug-drawer__panel,
.es-slide-drawer.is-open > .es-dashboard-drawer__panel,
.es-slide-drawer.is-open > .es-md-drawer__panel,
.es-wf-drawer.is-open > .es-slide-drawer__panel,
.es-wf-drawer.is-open > .es-wf-drawer__panel,
.es-wd-drawer.is-open > .es-slide-drawer__panel,
.es-wd-drawer.is-open > .es-wd-drawer__panel,
.es-hd-drawer.is-open > .es-slide-drawer__panel,
.es-hd-drawer.is-open > .es-hd-drawer__panel,
.es-feedback-drawer.is-open > .es-slide-drawer__panel,
.es-feedback-drawer.is-open > .es-feedback-drawer__panel,
.es-bug-drawer.is-open > .es-slide-drawer__panel,
.es-bug-drawer.is-open > .es-bug-drawer__panel,
.es-dashboard-drawer.is-open > .es-slide-drawer__panel,
.es-dashboard-drawer.is-open > .es-dashboard-drawer__panel,
.es-md-drawer.is-open > .es-slide-drawer__panel,
.es-md-drawer.is-open > .es-md-drawer__panel {
    transform: translateX(0);
    pointer-events: auto;
}
.es-wd-drawer__panel.es-rpanel__view,
.es-hd-drawer__panel.es-rpanel__view,
.es-feedback-drawer__panel.es-rpanel__view,
.es-bug-drawer__panel.es-rpanel__view {
    flex: 0 0 var(--es-drawer-w);
    width: var(--es-drawer-w);
    max-width: 100%;
    min-height: 0;
    overflow: hidden;
}
.es-wd-drawer .es-wd-drawer__panel.es-rpanel__view {
    flex: 0 0 var(--es-drawer-w);
    width: var(--es-drawer-w);
    max-width: 100%;
}
.es-wd-drawer__progress.es-nav-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 80;
}

.es-rpanel-empty {
    display: none !important;
}

@media (min-width: 1025px) {
    /* Keep the center column fluid when the dock is restored after being
       collapsed. Its zero basis makes the coach column consume real flex
       space instead of painting over the dashboard's expanded width. */
    .es-shell > .es-content {
        width: 0;
        flex: 1 1 0;
    }

    /* Closed docked panel: fully collapse so main expands; FAB reopens ES Coach. */
    body.es-rpanel-closed.es-has-rpanel .es-rpanel {
        flex-basis: 0;
        width: 0;
        border-left-width: 0;
        box-shadow: none;
        pointer-events: none;
    }
    .es-rpanel > .es-slide-drawer__backdrop {
        display: none !important;
    }

    /*
     * Docked ES Coach open: other drawers slide over the coach column without
     * dimming the page, without shadow, and without a clickable backdrop.
     */
    body.es-rpanel-open .es-slide-drawer.is-open,
    body.es-rpanel-open .es-wf-drawer.is-open,
    body.es-rpanel-open .es-wd-drawer.is-open,
    body.es-rpanel-open .es-hd-drawer.is-open,
    body.es-rpanel-open .es-feedback-drawer.is-open,
    body.es-rpanel-open .es-bug-drawer.is-open,
    body.es-rpanel-open .es-dashboard-drawer.is-open,
    body.es-rpanel-open .es-md-drawer.is-open {
        pointer-events: none;
    }
    body.es-rpanel-open .es-slide-drawer.is-open > .es-slide-drawer__backdrop,
    body.es-rpanel-open .es-slide-drawer.is-open > .es-wd-drawer__backdrop,
    body.es-rpanel-open .es-wf-drawer.is-open > .es-slide-drawer__backdrop,
    body.es-rpanel-open .es-wd-drawer.is-open > .es-slide-drawer__backdrop,
    body.es-rpanel-open .es-wd-drawer.is-open > .es-wd-drawer__backdrop,
    body.es-rpanel-open .es-hd-drawer.is-open > .es-slide-drawer__backdrop,
    body.es-rpanel-open .es-feedback-drawer.is-open > .es-slide-drawer__backdrop,
    body.es-rpanel-open .es-bug-drawer.is-open > .es-slide-drawer__backdrop,
    body.es-rpanel-open .es-dashboard-drawer.is-open > .es-slide-drawer__backdrop,
    body.es-rpanel-open .es-md-drawer.is-open > .es-slide-drawer__backdrop {
        opacity: 0 !important;
        pointer-events: none !important;
    }
    body.es-rpanel-open .es-slide-drawer.is-open > .es-slide-drawer__panel,
    body.es-rpanel-open .es-slide-drawer.is-open > .es-wf-drawer__panel,
    body.es-rpanel-open .es-slide-drawer.is-open > .es-wd-drawer__panel,
    body.es-rpanel-open .es-slide-drawer.is-open > .es-hd-drawer__panel,
    body.es-rpanel-open .es-slide-drawer.is-open > .es-feedback-drawer__panel,
    body.es-rpanel-open .es-slide-drawer.is-open > .es-bug-drawer__panel,
    body.es-rpanel-open .es-slide-drawer.is-open > .es-dashboard-drawer__panel,
    body.es-rpanel-open .es-slide-drawer.is-open > .es-md-drawer__panel,
    body.es-rpanel-open .es-wf-drawer.is-open > .es-slide-drawer__panel,
    body.es-rpanel-open .es-wf-drawer.is-open > .es-wf-drawer__panel,
    body.es-rpanel-open .es-wd-drawer.is-open > .es-slide-drawer__panel,
    body.es-rpanel-open .es-wd-drawer.is-open > .es-wd-drawer__panel,
    body.es-rpanel-open .es-hd-drawer.is-open > .es-slide-drawer__panel,
    body.es-rpanel-open .es-hd-drawer.is-open > .es-hd-drawer__panel,
    body.es-rpanel-open .es-feedback-drawer.is-open > .es-slide-drawer__panel,
    body.es-rpanel-open .es-feedback-drawer.is-open > .es-feedback-drawer__panel,
    body.es-rpanel-open .es-bug-drawer.is-open > .es-slide-drawer__panel,
    body.es-rpanel-open .es-bug-drawer.is-open > .es-bug-drawer__panel,
    body.es-rpanel-open .es-dashboard-drawer.is-open > .es-slide-drawer__panel,
    body.es-rpanel-open .es-dashboard-drawer.is-open > .es-dashboard-drawer__panel,
    body.es-rpanel-open .es-md-drawer.is-open > .es-slide-drawer__panel,
    body.es-rpanel-open .es-md-drawer.is-open > .es-md-drawer__panel {
        pointer-events: auto;
        box-shadow: none;
    }
}

.es-rpanel-ai-open {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 45;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 14px 20px 14px 14px;
    border: 0;
    /* Chat bubble: rounded, sharp bottom-right corner. */
    border-radius: 18px 18px 4px 18px;
    background: #fff;
    box-shadow:
        0 2px 6px rgba(16, 21, 27, 0.06),
        0 10px 28px rgba(16, 21, 27, 0.14);
    color: #111;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}
.es-rpanel-ai-open[hidden] {
    display: none !important;
}
.es-rpanel-ai-open:hover {
    box-shadow:
        0 2px 8px rgba(16, 21, 27, 0.08),
        0 14px 32px rgba(16, 21, 27, 0.16);
    color: #111;
}
.es-rpanel-ai-open:focus-visible {
    outline: 2px solid var(--es-accent, #2563eb);
    outline-offset: 3px;
}
.es-rpanel-ai-open__mark {
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 0;
}
@media (max-width: 1024px) {
    .es-rpanel-ai-open {
        display: none !important;
    }
}

@media (max-width: 1024px) {
    :root {
        --es-drawer-shadow: none;
    }
    /* ES Coach: same full-bleed overlay + dim as other slide drawers. */
    .es-has-rpanel .es-rpanel {
        position: fixed;
        inset: 0;
        width: auto;
        max-width: none;
        height: auto;
        border: 0;
        background: transparent;
        box-shadow: none;
        transform: none;
        pointer-events: none;
        overflow: hidden;
        z-index: 1620;
        transition: none;
    }
    body.es-rpanel-open.es-has-rpanel .es-rpanel,
    body.es-rpanel-open .es-rpanel {
        pointer-events: auto;
    }
    .es-rpanel > .es-slide-drawer__backdrop {
        display: block;
    }
    body.es-rpanel-open .es-rpanel > .es-slide-drawer__backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    .es-has-rpanel .es-rpanel > #es-rpanel-ai {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: auto;
        width: var(--es-drawer-w);
        max-width: 100%;
        height: auto;
        border-left: 1px solid var(--es-line);
        box-shadow: none;
        transform: translateX(100%);
        transition: transform 0.22s ease;
        pointer-events: none;
        z-index: 1;
    }
    body.es-rpanel-open .es-has-rpanel .es-rpanel > #es-rpanel-ai,
    body.es-rpanel-open .es-rpanel > #es-rpanel-ai {
        transform: translateX(0);
        pointer-events: auto;
    }
    body.es-rpanel-closed .es-rpanel > #es-rpanel-ai {
        transform: translateX(100%);
        pointer-events: none;
    }
    .es-slide-drawer__panel,
    .es-wf-drawer__panel,
    .es-wd-drawer__panel,
    .es-hd-drawer__panel,
    .es-feedback-drawer__panel,
    .es-bug-drawer__panel,
    .es-dashboard-drawer__panel,
    .es-md-drawer__panel,
    .es-analysis-drawer__panel {
        box-shadow: none;
    }
}

@media (max-width: 640px) {
    .es-has-rpanel .es-rpanel > #es-rpanel-ai,
    body.es-rpanel-open .es-rpanel > #es-rpanel-ai {
        width: var(--es-drawer-w);
        max-width: 100vw;
        right: 0;
        top: 0;
        height: 100svh;
        max-height: 100svh;
        border-radius: 0;
    }
    body.es-has-bottomnav .es-has-rpanel .es-rpanel > #es-rpanel-ai,
    body.es-has-bottomnav.es-rpanel-open .es-rpanel > #es-rpanel-ai,
    body.es-has-bottomnav .es-rpanel > #es-rpanel-ai {
        bottom: var(--es-bottomnav-offset);
        height: auto;
        max-height: none;
    }
    .es-rpanel__head {
        padding: 10px 12px;
    }
    #es-rpanel-ai .es-rpanel__head {
        padding: 14px 12px 14px 24px;
    }
    .es-wd-drawer .admin-aw-detail__head.es-rpanel__workout-head,
    .es-hd-drawer .admin-aw-detail__head.es-rpanel__workout-head,
    .es-rpanel .admin-aw-detail__head.es-rpanel__workout-head {
        padding-left: 24px;
        padding-right: 12px;
    }
    .es-rpanel__body {
        padding: 14px 18px 24px;
    }
    .es-rpanel__body.es-rpanel__body--help {
        padding: 14px 24px 24px;
    }
    .es-hd-drawer .admin-aw-detail__head.es-rpanel__workout-head {
        padding-left: 24px;
    }
    .es-wd-drawer .admin-aw-detail__body,
    .es-rpanel .admin-aw-detail__body {
        padding: 0 0 24px;
    }
    .es-wd-drawer .admin-aw-detail__section,
    .es-rpanel .admin-aw-detail__section {
        padding: 22px 24px 26px;
    }
    .es-wd-drawer .admin-aw-detail__comments,
    .es-rpanel .admin-aw-detail__comments {
        padding: 16px 24px 20px;
    }
    .es-wd-drawer .admin-aw-detail__body > .es-workout-deep-analysis-wrap,
    .es-rpanel .admin-aw-detail__body > .es-workout-deep-analysis-wrap {
        padding: 12px 24px 10px;
    }
    .es-wd-drawer .admin-aw-detail__body > .es-workout-edit-wrap,
    .es-rpanel .admin-aw-detail__body > .es-workout-edit-wrap {
        padding: 4px 24px 18px;
    }
    .es-wd-drawer .admin-aw-detail__body > .admin-aw-detail__route,
    .es-rpanel .admin-aw-detail__body > .admin-aw-detail__route {
        padding: 4px 24px 22px;
    }
}

@supports (height: 100dvh) {
    @media (max-width: 640px) {
        .es-has-rpanel .es-rpanel > #es-rpanel-ai,
        body.es-rpanel-open .es-rpanel > #es-rpanel-ai {
            height: 100dvh;
            max-height: 100dvh;
        }
        body.es-has-bottomnav .es-has-rpanel .es-rpanel > #es-rpanel-ai,
        body.es-has-bottomnav.es-rpanel-open .es-rpanel > #es-rpanel-ai,
        body.es-has-bottomnav .es-rpanel > #es-rpanel-ai {
            bottom: 0;
            height: auto;
            max-height: none;
        }
    }
}

/* Clickable chart hint */
canvas.es-clickable { cursor: pointer; }

/* Dropzone */
.es-dropzone {
    border: 2px dashed #cfd4d9;
    border-radius: var(--es-r);
    padding: 12px 14px;
    text-align: center;
    color: var(--es-ink-soft);
    font-size: 14px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.es-dropzone:hover, .es-dropzone.drag {
    border-color: var(--es-accent);
    background: var(--es-accent-soft);
}
.es-dropzone .hint { font-size: 12px; color: var(--es-ink-faint); margin-top: 4px; }
.es-dropzone.has-progress .hint { display: none; }
.es-photo-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}
.es-photo-current {
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.es-photo-current__img {
    width: 84px;
    height: 84px;
}
.es-dropzone--photo {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    max-width: none;
    padding: 10px 12px;
    font-size: 13px;
}
.es-photo-remove {
    padding: 0;
    border: 0;
    background: none;
    color: var(--es-ink-faint);
    font: inherit;
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
}
.es-photo-remove:hover { color: var(--es-ink); }
.es-dropzone.is-uploading {
    border-color: var(--es-accent);
    background: var(--es-accent-soft);
    cursor: default;
}
.es-dropzone.is-done {
    border-color: #3d9970;
    background: #f0faf5;
}
.es-dropzone.is-error {
    border-color: var(--es-danger);
    background: #fef5f5;
}
.es-upload-progress {
    margin-top: 10px;
    text-align: left;
}
.es-upload-progress__track {
    position: relative;
    height: 7px;
    border-radius: 99px;
    overflow: hidden;
    background: rgba(0, 0, 0, .08);
}
.es-upload-progress__bar {
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: var(--es-accent);
    transition: width .25s ease;
}
.es-dropzone.is-done .es-upload-progress__bar { background: #3d9970; }
.es-dropzone.is-error .es-upload-progress__bar { background: var(--es-danger); }
.es-upload-progress__bar--indeterminate {
    position: absolute;
    left: 0;
    top: 0;
    width: 38% !important;
    animation: es-upload-indeterminate 1.15s ease-in-out infinite;
}
@keyframes es-upload-indeterminate {
    0% { transform: translateX(-110%); }
    100% { transform: translateX(290%); }
}
.es-upload-progress__meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 7px;
    font-size: 12px;
    color: var(--es-ink-soft);
}
.es-upload-progress__pct {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--es-ink);
}
.es-upload-progress__detail {
    margin-top: 4px;
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--es-ink-faint);
}

.es-fit-jobs-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 16px;
}
.es-fit-jobs-stack[hidden] { display: none !important; }
.es-fit-jobs-stack--inline {
    /* retained for JS marker + existing selectors */
}
#es-fit-jobs[hidden] {
    /* config host only — progress cards live in #es-import-progress */
    display: none !important;
}
.es-fit-job {
    display: flex;
    align-items: stretch;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--es-line);
    border-radius: var(--es-r);
    background: var(--es-surface);
    color: var(--es-ink);
    box-shadow: var(--es-shadow);
}
.es-fit-job.is-active .es-fit-job__bar {
    min-width: 8%;
}
.es-fit-job__main { flex: 1; min-width: 0; }
.es-fit-job__status {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}
.es-fit-job__detail {
    margin-top: 2px;
    font-size: 12px;
    color: var(--es-ink-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.es-fit-job__track {
    margin-top: 8px;
    height: 6px;
    border-radius: 99px;
    overflow: hidden;
    background: var(--es-line);
}
.es-fit-job__bar {
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: #6ea8ff;
    transition: width .3s ease;
}
.es-fit-job.is-complete .es-fit-job__bar { background: #3d9970; }
.es-fit-job.is-cancelled .es-fit-job__bar,
.es-fit-job.is-failed .es-fit-job__bar { background: #f07178; }
.es-fit-job__cancel {
    flex: none;
    align-self: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: var(--es-bg);
    color: var(--es-ink-soft);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.es-fit-job__cancel:hover {
    background: var(--es-line);
    color: var(--es-ink);
}
.es-fit-job__cancel[hidden] { display: none !important; }

.es-data-counts {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: stretch;
    margin: 8px 0 12px;
    max-width: 100%;
}
.es-data-counts__item {
    flex: 0 1 auto;
    min-width: 0;
    padding: 2px 10px;
    border: 0;
    border-left: 1px solid var(--es-line);
    border-radius: 0;
    background: transparent;
    text-align: center;
}
.es-data-counts__item:first-child {
    padding-left: 0;
    border-left: 0;
}
.es-data-counts__item:last-child {
    padding-right: 0;
}
.es-data-counts__item strong {
    display: block;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}
.es-data-counts__item span {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.2;
    color: var(--es-ink-soft);
    white-space: nowrap;
}
.es-data-erase {
  margin: 0;
  text-align: left;
}
.es-settings-coach {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
}
.es-settings-coach__avatar {
    width: 52px;
    height: 52px;
    font-size: 17px;
}
.es-settings-coach__meta {
    flex: 1 1 auto;
    min-width: 0;
}
.es-settings-coach__name {
    font-size: 18px;
    font-weight: 750;
    line-height: 1.25;
    color: var(--es-ink, #10151b);
}
.es-settings-coach__detach {
    margin: 0 0 0 auto;
    flex: none;
}
.es-settings-canvas > .es-data-erase {
  margin: 8px 48px 0;
}
.es-data-erase__link {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  color: var(--es-muted, #888);
  text-decoration: none;
  cursor: pointer;
}
.es-data-erase__link:hover:not(:disabled) {
  color: var(--es-text, #333);
}
.es-data-erase__link:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.es-data-erase .hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--es-ink-faint);
}
.es-btn.es-btn--ghost.es-btn--danger {
    color: var(--es-danger);
    border-color: #e5c2c8;
}

/* --------------------------------------------------------------------------
   Misc
   -------------------------------------------------------------------------- */

.es-muted { color: var(--es-ink-faint); }
.es-right { text-align: right; }
.is-hidden { display: none !important; }

[data-physiology-recalc] [hidden] { display: none !important; }

.es-physiology-recalc-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin: 14px 0 0;
    padding: 10px 14px;
    border-radius: var(--es-r);
    border: 1px solid #efd79d;
    background: #fff2d7;
    color: #7a4e12;
}
.es-physiology-recalc-banner:not(.is-outdated) {
    border-color: #efd79d;
    background: #fff8e8;
    opacity: 0.92;
}
.es-physiology-recalc-banner__copy {
    display: grid;
    gap: 2px;
    min-width: 0;
    flex: 1 1 220px;
}
.es-physiology-recalc-banner__copy strong {
    font-size: 13px;
    font-weight: 650;
    letter-spacing: 0.01em;
}
.es-physiology-recalc-banner__copy > span {
    font-size: 13px;
    line-height: 1.35;
}
.es-physiology-recalc-banner__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.es-physiology-recalc-banner .es-btn--ghost {
    border-color: #e2c68a;
    color: #7a4e12;
    background: rgba(255, 255, 255, 0.55);
}
.es-physiology-recalc-banner .es-btn--ghost:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.85);
}
.es-physiology-recalc-banner .es-btn--ghost:disabled {
    opacity: 0.45;
}
.es-physiology-recalc-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 12px;
}
.es-physiology-recalc-progress progress {
    width: min(180px, 40vw);
    height: 8px;
}

/* Analysis drawer (mobile) */
.es-analysis-drawer {
    position: fixed;
    inset: 0;
    /* More and Settings are global navigation submenus. Keep them above the
       coach and every content drawer, while staying below modal dialogs. */
    z-index: 12990;
    display: flex;
    pointer-events: none;
}
.es-analysis-drawer[hidden] {
    display: none !important;
}
.es-analysis-drawer.is-open {
    pointer-events: auto;
}
.es-analysis-drawer__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(16, 21, 27, 0.35);
    opacity: 0;
    transition: opacity .2s ease;
}
.es-analysis-drawer.is-open .es-analysis-drawer__backdrop {
    opacity: 1;
}
.es-analysis-drawer__panel {
    position: relative;
    z-index: 1;
    width: min(88vw, 300px);
    max-width: 100%;
    height: 100%;
    background: var(--es-surface);
    border-right: 1px solid var(--es-line);
    box-shadow: 8px 0 24px rgba(16, 21, 27, 0.12);
    transform: translateX(-100%);
    transition: transform .22s ease;
    display: flex;
    flex-direction: column;
}
.es-analysis-drawer.is-open .es-analysis-drawer__panel {
    transform: translateX(0);
}
.es-analysis-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--es-line);
}
.es-analysis-drawer__head h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}
.es-analysis-drawer__close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: var(--es-r-sm);
    background: transparent;
    font-size: 22px;
    line-height: 1;
    color: var(--es-ink-soft);
}
.es-analysis-drawer__nav {
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    gap: 0;
}
.es-analysis-drawer__nav a,
.es-analysis-drawer__nav .es-settings-logout button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--es-ink);
    font: inherit;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.es-analysis-drawer__nav a:hover,
.es-analysis-drawer__nav a.active,
.es-analysis-drawer__nav .es-settings-logout button:hover {
    background: var(--es-accent-soft);
    color: var(--es-ink);
}
.es-analysis-drawer__nav .es-settings-menu__icon {
    color: #000;
}

@media (max-width: 860px) {
    body.es-has-bottomnav {
        display: flex;
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
    }
    body.es-has-bottomnav .es-shell {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        min-height: 0;
        height: auto;
        overflow: hidden;
    }
    body.es-has-bottomnav .es-content {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
    }
    body.es-has-bottomnav .es-main {
        flex: 1 0 auto;
        overflow: visible;
    }
    body.es-has-bottomnav .es-footer {
        display: none;
    }
    /* Drawers sit above the bottom menu — never tuck under it. */
    body.es-has-bottomnav .es-has-rpanel .es-rpanel,
    body.es-has-bottomnav.es-rpanel-open .es-rpanel,
    body.es-has-bottomnav .es-rpanel {
        top: 0;
        bottom: var(--es-bottomnav-offset);
        height: auto;
        max-height: none;
    }
    body.es-has-bottomnav .es-slide-drawer,
    body.es-has-bottomnav .es-wf-drawer,
    body.es-has-bottomnav .es-wd-drawer,
    body.es-has-bottomnav .es-hd-drawer,
    body.es-has-bottomnav .es-feedback-drawer,
    body.es-has-bottomnav .es-bug-drawer,
    body.es-has-bottomnav .es-dashboard-drawer,
    body.es-has-bottomnav .es-md-drawer,
    body.es-has-bottomnav .es-analysis-drawer {
        top: 0;
        bottom: var(--es-bottomnav-offset);
    }
    body.es-has-bottomnav .es-slide-drawer__panel,
    body.es-has-bottomnav .es-wf-drawer__panel,
    body.es-has-bottomnav .es-wd-drawer__panel,
    body.es-has-bottomnav .es-hd-drawer__panel,
    body.es-has-bottomnav .es-feedback-drawer__panel,
    body.es-has-bottomnav .es-bug-drawer__panel,
    body.es-has-bottomnav .es-dashboard-drawer__panel {
        height: 100%;
        max-height: 100%;
    }
    .es-shell { flex-direction: column; }
    .es-shell { height: auto; min-height: 0; }
    .es-main {
        padding: 18px 14px 72px;
    }
    .es-main--hub {
        padding: 22px 14px 0;
    }
    .es-content-bar {
        padding: 0 14px 0 12px;
        gap: 12px;
        margin-bottom: 0;
    }
    body.es-has-settings-rail .es-main,
    body.es-has-settings-rail .es-main--settings {
        padding: 0;
    }
    body.es-has-settings-rail .es-main--settings > .es-pagehead {
        padding: 22px 14px 16px;
    }
    body.es-has-settings-rail .es-main--settings > .es-settings-tabs {
        padding: 0 14px 12px;
    }
    body.es-has-settings-rail .es-main--settings > .es-settings-notices {
        padding: 0 14px 12px;
    }
    body.es-has-list-chrome .es-main--list {
        padding: 0;
    }
    body.es-has-list-chrome .es-main--list > .es-pagehead {
        padding: 22px 14px 12px;
    }
    body.es-has-list-chrome .es-main--list > .es-search {
        margin: 0 14px 12px;
        padding: 0;
    }
    body.es-has-list-chrome .es-main--list > .es-athletes-top {
        padding: 22px 14px 8px;
    }
    body.es-has-list-chrome .es-main--list > .es-athletes-top > .es-pagehead {
        margin-bottom: 18px;
    }
    .es-content-bar .es-brand-mark,
    .es-content-bar .es-logo {
        margin-left: 4px;
    }
    .es-content-bar .es-brand-mark,
    .es-content-bar .es-logo,
    .es-brand-mark,
    .es-logo {
        padding: 9px 13px;
        font-size: 16px;
    }
    .es-breadcrumbs__list {
        font-size: 12px;
        flex-wrap: nowrap;
    }
    /* Impersonation: section crumbs only on mobile (Dashboard, Workouts, …). */
    .es-breadcrumbs__item[data-es-view-as-name] {
        display: none !important;
    }
    .es-breadcrumbs__item[data-es-view-as-name] + .es-breadcrumbs__item::before {
        content: none;
        margin: 0;
    }
    /* 2+ crumbs: icon / second only — never show 3rd+. */
    .es-breadcrumbs__item--m-hide {
        display: none !important;
    }
    .es-breadcrumbs__item--has-icon .es-breadcrumbs__icon {
        display: inline-flex;
    }
    .es-breadcrumbs__item--has-icon a {
        display: inline-flex;
        align-items: center;
    }
    .es-breadcrumbs__item--has-icon .es-breadcrumbs__label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    .es-breadcrumbs__item--has-icon + .es-breadcrumbs__item::before {
        margin: 0 7px;
    }
    .es-sidebar {
        display: none;
    }
    .es-settings-rail {
        display: none;
    }
    body.es-has-settings-rail .es-content {
        background: var(--es-bg);
    }
    .es-bottomnav {
        display: flex;
        align-items: stretch;
        justify-content: space-between;
        position: sticky;
        bottom: 0;
        flex: none;
        width: 100%;
        /* Above drawers so the top rule stays visible and isn’t covered. */
        z-index: 10000;
        background: var(--es-surface);
        border-top: 1px solid var(--es-line);
        padding: 4px 2px calc(4px + env(safe-area-inset-bottom, 0px));
        min-height: calc(var(--es-bottomnav-h) + env(safe-area-inset-bottom, 0px));
        box-shadow: none;
        gap: 0;
    }
    .es-bottomnav__item {
        padding: 6px 1px;
        font-size: 9px;
    }
}

@media (max-width: 760px) {
    .es-chart,
    .es-chart--chronic { height: 220px; }
}

@media (max-width: 640px) {
    h1 { font-size: 24px; }
    .es-main { padding: 18px 14px 72px; }
    .es-main--hub { padding: 22px 14px 0; }
    body.es-has-settings-rail .es-main,
    body.es-has-settings-rail .es-main--settings {
        padding: 0;
    }
    body.es-has-settings-rail .es-main--settings > .es-pagehead {
        padding: 22px 14px 16px;
    }
    body.es-has-settings-rail .es-main--settings > .es-settings-tabs {
        padding: 0 14px 12px;
    }
    body.es-has-settings-rail .es-main--settings > .es-settings-notices {
        padding: 0 14px 12px;
    }
    body.es-has-list-chrome .es-main--list {
        padding: 0;
    }
    body.es-has-list-chrome .es-main--list > .es-pagehead {
        padding: 22px 14px 12px;
    }
    body.es-has-list-chrome .es-main--list > .es-search {
        margin: 0 14px 12px;
        padding: 0;
    }
    body.es-has-list-chrome .es-main--list > .es-athletes-top {
        padding: 22px 14px 8px;
    }
    body.es-has-list-chrome .es-main--list > .es-athletes-top > .es-pagehead {
        margin-bottom: 18px;
    }
    .es-athletes-table--mine thead {
        display: none;
    }
    .es-athletes-table--mine .es-athletes-last-workout-cell {
        display: none;
    }
    .es-list-canvas:has(.es-athletes-table--mine) {
        padding-left: 0;
        padding-right: 0;
        padding-bottom: var(--es-bottomnav-offset);
    }
    #es-athletes-table.es-athletes-table--mine,
    .es-athletes-table--mine {
        width: 100%;
    }
    #es-athletes-table.es-athletes-table--mine td:first-child {
        padding-left: 14px;
        padding-right: 14px;
    }
    .es-athletes-table--mine tbody tr:last-child td {
        border-bottom: 0;
    }
    .es-athletes-toolbar {
        flex-wrap: nowrap;
        gap: 8px;
        margin-bottom: 0;
    }
    body.es-has-list-chrome .es-main--list > .es-athletes-top .es-search {
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
    }
    .es-athletes-toolbar__actions {
        flex: none;
        flex-wrap: nowrap;
        margin-left: 0;
    }
    .es-canvas {
        margin: 0 -14px;
        padding: 0 0 72px;
        width: calc(100% + 28px);
    }
    .es-main--hub:not(:has(.es-canvas)):not(:has(.es-calendar))::after {
        margin: 0 -14px;
        width: calc(100% + 28px);
    }
    .es-settings-canvas {
        margin: 0;
        padding: 0 0 72px;
        width: 100%;
    }
    .es-list-canvas {
        margin: 0;
        padding: 16px 14px 72px;
        width: 100%;
    }
    .es-block {
        padding: 0;
    }
    .es-canvas .es-block {
        padding: 6px 24px 32px;
    }
    .es-settings-canvas .es-block {
        padding: 22px 24px 28px;
    }
    .es-settings-canvas > .es-data-erase {
        margin: 8px 24px 0;
    }
    .es-block-head { padding: 16px 0 0; }
    .es-canvas .es-block-head { padding: 18px 0 0; }
    .es-block-body { padding: 12px 0 4px; }
    .es-canvas .es-block-body { padding: 14px 0 6px; }
    .es-kpi .v { font-size: 17px; }
    .es-chart-with-kpis {
        grid-template-columns: 1fr;
    }
    .es-chart-with-kpis__kpis {
        min-height: 0;
    }
}

@media print {
    .es-content-bar, .es-sidebar, .es-bottomnav, .es-pagehead-actions, .es-footer, .es-rpanel { display: none; }
    body { background: #fff; }
    .es-block { box-shadow: none; break-inside: avoid; }
}

/* --------------------------------------------------------------------------
   Subscription plans (Settings → Subscription)
   -------------------------------------------------------------------------- */

.es-plan-billing {
    display: grid;
    gap: 22px;
}
.es-plan-switch {
    display: inline-flex;
    margin: 0 auto;
    padding: 4px;
    border-radius: 999px;
    background: var(--es-bg);
    border: 1px solid var(--es-line);
    gap: 2px;
}
.es-plan-switch__btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--es-ink-soft);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 999px;
    cursor: pointer;
}
.es-plan-switch__btn.is-active {
    background: #fff;
    color: var(--es-ink);
    box-shadow: 0 1px 2px rgba(28, 33, 40, 0.08);
}
.es-plan-grid {
    --es-plan-feat-count: 6;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}
.es-plan-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 22px 20px 12px;
    border: 1px solid var(--es-line);
    border-radius: 16px;
    background: #fff;
    min-width: 0;
}
.es-plan-card.is-featured {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2), 0 12px 28px rgba(37, 99, 235, 0.08);
}
.es-plan-card.is-current:not([data-es-plan-card="free"]) {
    border-color: rgba(37, 99, 235, 0.55);
    background: linear-gradient(180deg, #f8fbff 0%, #fff 42%);
}
.es-plan-card__badge {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--es-accent-soft);
    color: var(--es-accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.es-plan-card__name {
    margin: 0;
    padding-right: 64px;
    min-height: 1.2em;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}
.es-plan-card__price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
    min-height: 44px;
}
.es-plan-card__was {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--es-ink-soft);
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
}
.es-plan-card__was[hidden] {
    display: none !important;
}
.es-plan-card__amount {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
}
.es-plan-card__per {
    color: var(--es-ink-soft);
    font-size: 13px;
    line-height: 1.3;
}
.es-plan-card__currency {
    display: block;
    font-weight: 600;
}
.es-plan-card__billing-note {
    margin: 4px 0 0;
    min-height: 1.2em;
    color: var(--es-ink-soft);
    font-size: 12px;
    line-height: 1.2;
    visibility: hidden;
}
.es-plan-billing.is-yearly .es-plan-card__billing-note.has-copy {
    visibility: visible;
}
.es-plan-card__amount[hidden] {
    display: none !important;
}
.es-plan-card__tagline {
    margin: 8px 0 0;
    min-height: 2.9em;
    color: var(--es-ink);
    font-size: 14px;
    line-height: 1.45;
}
.es-plan-cta-form {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 16px 0 0;
    padding-bottom: 4px;
    text-align: center;
}
.es-plan-cta {
    width: auto;
    min-width: 0;
    justify-content: center;
    min-height: 42px;
    box-sizing: border-box;
}
.es-plan-cta.is-current,
.es-plan-cta:disabled {
    opacity: 0.72;
    cursor: default;
}
.es-plan-cta.is-current:hover,
.es-plan-cta:disabled:hover {
    background: var(--es-surface);
    filter: none;
}
.es-plan-feat {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    display: grid;
    gap: 0;
}
.es-plan-feat li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    padding: 0 2px;
    border-top: 0;
    font-size: 13px;
    line-height: 1.35;
}
.es-plan-feat__label {
    color: var(--es-ink-soft);
    min-width: 0;
}
.es-plan-feat__val {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex: none;
    min-width: 4.5rem;
    text-align: right;
}
.es-plan-feat__val.is-text {
    font-weight: 600;
    color: var(--es-ink);
}
.es-plan-feat__val.is-on {
    color: var(--es-accent);
}
.es-plan-feat__val.is-off {
    color: #c0c5ce;
}
.es-plan-check,
.es-plan-cross {
    width: 18px;
    height: 18px;
}
.es-plan-meters {
    display: grid;
    gap: 18px;
}
.es-plan-meter__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
}
.es-plan-meter__label {
    font-weight: 600;
    color: var(--es-ink);
}
.es-plan-meter__used {
    color: var(--es-ink-soft);
}
.es-plan-meter.is-warn .es-document-storage__bar span {
    background: #f59e0b;
}
.es-plan-meter.is-danger .es-document-storage__bar span {
    background: #dc2626;
}
.es-plan-meter.is-unlimited .es-document-storage__bar {
    opacity: 0.35;
}
.es-plan-admin-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}
.es-plan-admin-fields {
    display: grid;
    gap: 12px;
}

@supports (grid-template-rows: subgrid) {
    .es-plan-grid {
        grid-template-rows: auto auto auto auto auto repeat(var(--es-plan-feat-count), auto);
    }
    .es-plan-card {
        display: grid;
        grid-template-rows: subgrid;
        grid-row: span calc(5 + var(--es-plan-feat-count));
        gap: 0;
    }
    .es-plan-card__price {
        margin-top: 10px;
    }
    .es-plan-card__billing-note {
        margin-top: 4px;
    }
    .es-plan-card__tagline {
        margin-top: 8px;
    }
    .es-plan-cta-form {
        margin-top: 16px;
        padding-bottom: 4px;
        align-self: center;
        justify-self: center;
        width: 100%;
    }
    .es-plan-feat {
        display: contents;
    }
    .es-plan-feat li {
        margin: 0;
    }
}

@media (max-width: 1100px) {
    .es-plan-grid,
    .es-plan-admin-grid {
        grid-template-columns: 1fr;
    }
    @supports (grid-template-rows: subgrid) {
        .es-plan-grid {
            grid-template-rows: none;
        }
        .es-plan-card {
            display: flex;
            flex-direction: column;
            grid-row: auto;
        }
        .es-plan-feat {
            display: grid;
        }
    }
}


/* Pill corners for fields + buttons */
button.es-btn,
a.es-btn,
.es-btn {
    border-radius: 999px;
}
input.es-input,
select.es-input,
select.es-select,
.es-select,
input[type="text"],
input[type="search"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="tel"],
input[type="url"],
input[type="datetime-local"] {
    border-radius: 999px;
}

/* Mobile: 2px less vertical padding on shared pill buttons + fields. */
@media (max-width: 860px) {
    button.es-btn,
    a.es-btn,
    .es-btn {
        padding-top: 7px;
        padding-bottom: 7px;
    }
    .es-btn.es-btn--sm,
    .es-btn.es-btn--small,
    .es-btn--sm,
    .es-btn--small {
        padding-top: 3px;
        padding-bottom: 3px;
    }
    .es-input,
    .es-select,
    input.es-input,
    select.es-input,
    select.es-select {
        padding-top: 7px;
        padding-bottom: 7px;
    }
    .es-input--static {
        min-height: 34px;
    }
    .es-dash-filters .es-input {
        height: 36px;
        padding-top: 0;
        padding-bottom: 0;
    }
}
