/* ============================================================
   BE Hub — TriSquad Athlete Dashboard
   ============================================================ */

/* --- Tokens ------------------------------------------------ */
/* Light palette (default). Dark overrides follow: an auto
   (OS-preference) block, plus explicit [data-beh-theme="dark"/"light"]
   blocks set by the on-page toggle, which always win over OS
   preference — see the "Theme toggle" section near the end of this
   file. */
:root {
    --beh-navy:        #16959e;
    --beh-navy-dark:   #0f7d85;
    --beh-navy-light:  #eaf7f7;
    --beh-orange:      #d97a46;
    --beh-orange-bg:   #fbefe6;
    --beh-green:       #4c9a6d;
    --beh-green-bg:    #ecf6ef;
    --beh-amber:       #c99a3a;
    --beh-amber-bg:    #faf3e1;
    --beh-red:         #dc2626;
    --beh-red-bg:      #fef2f2;
    --beh-bg:          #fafbfa;
    --beh-card:        #ffffff;
    --beh-border:      #e8ece9;
    --beh-text:        #24332f;
    --beh-muted:       #5c6e69;
    --beh-radius:      16px;
    --beh-radius-sm:   10px;
    --beh-shadow:      0 1px 2px rgba(36,51,47,.02), 0 6px 18px rgba(36,51,47,.03);
    --beh-shadow-hover:0 4px 10px rgba(22,149,158,.10), 0 10px 24px rgba(22,149,158,.08);
    --beh-font:        'Inter', system-ui, -apple-system, sans-serif;
    --beh-transition:  0.18s ease;
}

/* Dark palette — applied automatically when no explicit choice has been
   made yet (data-beh-theme unset or "auto") and the OS prefers dark. */
@media (prefers-color-scheme: dark) {
    :root:not([data-beh-theme="light"]):not([data-beh-theme="dark"]) {
        --beh-navy:        #55c2c9;
        --beh-navy-dark:   #7ed4da;
        --beh-navy-light:  rgba(85,194,201,.13);
        --beh-orange:      #e68f5c;
        --beh-orange-bg:   rgba(230,143,92,.14);
        --beh-green:       #6bc48d;
        --beh-green-bg:    rgba(107,196,141,.14);
        --beh-amber:       #ddb158;
        --beh-amber-bg:    rgba(221,177,88,.14);
        --beh-red:         #ef6b6b;
        --beh-red-bg:      rgba(239,107,107,.14);
        --beh-bg:          #12100d;
        --beh-card:        #1a2320;
        --beh-border:      #283330;
        --beh-text:        #e7edeb;
        --beh-muted:       #a6b5b1;
        --beh-shadow:      0 1px 2px rgba(0,0,0,.25), 0 8px 24px rgba(0,0,0,.3);
        --beh-shadow-hover:0 4px 14px rgba(0,0,0,.35), 0 12px 30px rgba(0,0,0,.4);
    }
}

/* Explicit choice from the theme toggle always wins over OS preference. */
:root[data-beh-theme="dark"] {
    --beh-navy:        #55c2c9;
    --beh-navy-dark:   #7ed4da;
    --beh-navy-light:  rgba(85,194,201,.13);
    --beh-orange:      #e68f5c;
    --beh-orange-bg:   rgba(230,143,92,.14);
    --beh-green:       #6bc48d;
    --beh-green-bg:    rgba(107,196,141,.14);
    --beh-amber:       #ddb158;
    --beh-amber-bg:    rgba(221,177,88,.14);
    --beh-red:         #ef6b6b;
    --beh-red-bg:      rgba(239,107,107,.14);
    --beh-bg:          #12100d;
    --beh-card:        #1a2320;
    --beh-border:      #283330;
    --beh-text:        #e7edeb;
    --beh-muted:       #a6b5b1;
    --beh-shadow:      0 1px 2px rgba(0,0,0,.25), 0 8px 24px rgba(0,0,0,.3);
    --beh-shadow-hover:0 4px 14px rgba(0,0,0,.35), 0 12px 30px rgba(0,0,0,.4);
}
:root[data-beh-theme="light"] {
    --beh-navy:        #16959e;
    --beh-navy-dark:   #0f7d85;
    --beh-navy-light:  #eaf7f7;
    --beh-orange:      #d97a46;
    --beh-orange-bg:   #fbefe6;
    --beh-green:       #4c9a6d;
    --beh-green-bg:    #ecf6ef;
    --beh-amber:       #c99a3a;
    --beh-amber-bg:    #faf3e1;
    --beh-red:         #dc2626;
    --beh-red-bg:      #fef2f2;
    --beh-bg:          #fafbfa;
    --beh-card:        #ffffff;
    --beh-border:      #e8ece9;
    --beh-text:        #24332f;
    --beh-muted:       #5c6e69;
    --beh-shadow:      0 1px 2px rgba(36,51,47,.02), 0 6px 18px rgba(36,51,47,.03);
    --beh-shadow-hover:0 4px 10px rgba(22,149,158,.10), 0 10px 24px rgba(22,149,158,.08);
}

/* --- Outer wrapper ----------------------------------------- */
.beh-login-prompt {
    padding: 48px 24px;
    text-align: center;
    color: var(--beh-muted);
    font-size: 16px;
}
.beh-login-prompt a { color: var(--beh-navy); font-weight: 600; }

/* Full-bleed page background — the tinted background must fill the
   viewport, not just the centered content column, or the theme's
   plain white body shows through on either side at wide viewports. */
body.beh-distraction-free {
    background: var(--beh-bg);
}

.beh-hub-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 26px clamp(16px, 3vw, 32px) 90px;
    font-family: var(--beh-font);
    color: var(--beh-text);
    background: var(--beh-bg);
}

.beh-hub {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}
@media (max-width: 880px) {
    .beh-hub { grid-template-columns: 1fr; }
    .beh-hub__sidebar { order: -1; }
}

.beh-hub__main    { display: flex; flex-direction: column; gap: 24px; }
.beh-hub__sidebar { display: flex; flex-direction: column; gap: 24px; }

/* --- Masthead (bib bar) ------------------------------------ */
.beh-masthead {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 26px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--beh-border);
    flex-wrap: wrap;
}
.beh-masthead__eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--beh-navy-dark);
    margin: 0 0 9px;
}
.beh-masthead__name {
    font-size: clamp(26px, 3.4vw, 34px);
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.05;
    margin: 0;
    color: var(--beh-text);
}
.beh-masthead__meta { margin-top: 10px; }
.beh-plan-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--beh-navy-light);
    color: var(--beh-navy-dark);
    font-weight: 700;
    font-size: 12.5px;
    padding: 4px 12px;
    border-radius: 99px;
}
.beh-masthead__right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}
.beh-masthead__week {
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    color: var(--beh-muted);
}
.beh-streak-chip {
    display: inline-flex;
    align-items: center;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--beh-green);
    background: var(--beh-green-bg);
    padding: 4px 12px;
    border-radius: 99px;
}
@media (max-width: 480px) {
    .beh-masthead { align-items: flex-start; }
    .beh-masthead__right { align-items: flex-start; text-align: left; }
}

/* --- Base card --------------------------------------------- */
.beh-widget {
    background: var(--beh-card);
    border-radius: var(--beh-radius);
    padding: 28px;
    box-shadow: var(--beh-shadow);
    border: 1px solid var(--beh-border);
}

.beh-widget__title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--beh-muted);
    margin: 0 0 18px;
}

/* --- Focus for the Week (hero card) ----------------------- */
.beh-widget--focus {
    background: linear-gradient(160deg, var(--beh-navy-light) 0%, var(--beh-card) 65%);
    border-color: var(--beh-border);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    padding: clamp(30px, 4vw, 48px) clamp(26px, 4vw, 48px);
}
.beh-widget--focus::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 220px; height: 220px;
    background: var(--beh-navy-light);
    opacity: .5;
    border-radius: 50%;
    pointer-events: none;
}
.beh-focus-contour {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: .55;
    pointer-events: none;
}
.beh-focus-inner { position: relative; z-index: 1; }
.beh-widget--focus .beh-widget__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.beh-widget--focus .beh-widget__title {
    color: var(--beh-navy-dark);
    margin: 0;
    font-size: 11px;
    letter-spacing: .12em;
}

.beh-focus-subject {
    font-size: clamp(24px, 3.2vw, 32px);
    font-weight: 700;
    color: var(--beh-text);
    letter-spacing: -.01em;
    margin: 0 0 14px;
    line-height: 1.22;
}

.beh-focus-body {
    color: var(--beh-muted);
    font-size: 15.5px;
    line-height: 1.7;
}
.beh-focus-body p:last-child { margin-bottom: 0; }

.beh-widget--focus .beh-btn {
    background: var(--beh-navy);
    border: 1px solid transparent;
    color: #ffffff !important;
    margin-top: 20px;
}
.beh-widget--focus .beh-btn:hover {
    background: var(--beh-navy-dark);
}

/* Empty state variant */
.beh-widget--focus.beh-widget--empty {
    background: var(--beh-navy-light);
    border-color: var(--beh-border);
}
.beh-widget--focus.beh-widget--empty .beh-widget__title { color: var(--beh-muted); }
.beh-widget--focus.beh-widget--empty p { color: var(--beh-muted); }

/* Staleness badges */
.beh-current-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 700; letter-spacing: .04em;
    background: var(--beh-card); color: var(--beh-navy-dark);
    padding: 3px 10px; border-radius: 20px;
    border: 1px solid var(--beh-border);
}
.beh-stale-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 600;
    background: var(--beh-amber-bg); color: var(--beh-amber);
    padding: 3px 10px; border-radius: 20px;
    border: 1px solid var(--beh-amber);
}

/* --- Continue Learning ------------------------------------ */
.beh-widget--progress {}

.beh-progress-bar {
    height: 10px;
    background: var(--beh-navy-light);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 10px;
}
.beh-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--beh-navy), var(--beh-navy-dark));
    border-radius: 99px;
    transition: width .6s ease;
    min-width: 4px;
}
.beh-progress-label {
    font-size: 13px;
    color: var(--beh-muted);
    margin-bottom: 18px;
}

/* --- Check-in widget -------------------------------------- */
.beh-checkin-sub {
    font-size: 13px;
    color: var(--beh-muted);
    margin: -10px 0 20px;
}

.beh-field { margin-bottom: 22px; }

.beh-field label,
.bec-form .bec-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--beh-text);
    margin-bottom: 10px;
}

/* Star rating */
.beh-stars {
    display: flex;
    flex-direction: row;
    gap: 6px;
}
.beh-star-label { cursor: pointer; line-height: 1; }
.beh-star-label input { position: absolute; opacity: 0; width: 0; height: 0; }
.beh-star {
    font-size: 36px;
    color: #d1d5db;
    transition: color var(--beh-transition), transform var(--beh-transition);
    display: block;
}
.beh-star-label:hover .beh-star { color: #f59e0b; transform: scale(1.15); }

/* JS will handle lit state via CSS class */
.beh-star-label.is-lit .beh-star { color: #f59e0b; }

/* Pill radio group */
.beh-radio-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.beh-radio-group label {
    margin: 0;
    font-weight: 500;
}
.beh-radio-group label input { position: absolute; opacity: 0; width: 0; }
.beh-radio-group label span,
.beh-radio-group > label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: 2px solid var(--beh-border);
    border-radius: 99px;
    font-size: 14px;
    font-weight: 500;
    color: var(--beh-text);
    cursor: pointer;
    transition: border-color var(--beh-transition), background var(--beh-transition), color var(--beh-transition);
    user-select: none;
}
.beh-radio-group > label:has(input:checked) {
    border-color: var(--beh-navy);
    background: var(--beh-navy);
    color: #fff;
}
.beh-radio-group > label:hover:not(:has(input:checked)) {
    border-color: var(--beh-navy);
    background: var(--beh-navy-light);
}

/* Textareas + selects inside a .beh-field */
.beh-field textarea,
.beh-field select,
.bec-form textarea {
    width: 100%;
    border: 2px solid var(--beh-border);
    border-radius: var(--beh-radius-sm);
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--beh-text);
    background: var(--beh-bg);
    font-family: var(--beh-font);
    transition: border-color var(--beh-transition), box-shadow var(--beh-transition);
    box-sizing: border-box;
}
.beh-field textarea { resize: vertical; }
.beh-field textarea:focus,
.beh-field select:focus,
.bec-form textarea:focus {
    outline: none;
    border-color: var(--beh-navy);
    box-shadow: 0 0 0 3px var(--beh-navy-light);
    background: var(--beh-card);
}

/* Check-in submitted state */
.beh-widget--submitted { border-left: 4px solid var(--beh-green); }
.beh-checkin-submitted-msg { color: var(--beh-green); font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.beh-checkin-summary {
    display: flex; gap: 18px; flex-wrap: wrap;
    font-size: 14px; color: var(--beh-text);
    padding: 14px; background: var(--beh-navy-light);
    border-radius: var(--beh-radius-sm); margin-top: 4px;
}
.beh-checkin-summary span strong { color: var(--beh-navy); }

/* --- Buttons ---------------------------------------------- */
.beh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 22px;
    background: var(--beh-navy);
    color: #ffffff !important;
    border: 2px solid transparent;
    border-radius: var(--beh-radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--beh-font);
    text-decoration: none !important;
    cursor: pointer;
    transition: background var(--beh-transition), transform var(--beh-transition), box-shadow var(--beh-transition);
    line-height: 1;
    margin-top: 14px;
}
.beh-btn:hover {
    background: var(--beh-navy-dark);
    transform: translateY(-1px);
    box-shadow: var(--beh-shadow-hover);
}
.beh-btn:active { transform: translateY(0); }

.beh-btn--secondary {
    background: var(--beh-navy-light);
    color: var(--beh-navy) !important;
    border-color: var(--beh-border);
}
.beh-btn--secondary:hover {
    background: color-mix(in srgb, var(--beh-navy-light), var(--beh-navy) 22%);
    box-shadow: var(--beh-shadow-hover);
}

.beh-btn--full { width: 100%; justify-content: center; }

/* --- Quick Links ------------------------------------------ */
.beh-widget--links { padding: 20px; }
.beh-widget--links .beh-widget__title { margin-bottom: 14px; }

.beh-links-grid { display: flex; flex-direction: column; gap: 8px; }

.beh-link-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    background: var(--beh-bg);
    border: 1px solid var(--beh-border);
    border-radius: var(--beh-radius-sm);
    text-decoration: none !important;
    color: var(--beh-text) !important;
    font-size: 14px;
    font-weight: 600;
    transition: background var(--beh-transition), border-color var(--beh-transition), transform var(--beh-transition);
}
.beh-link-tile:hover {
    background: var(--beh-navy-light);
    border-color: var(--beh-navy);
    transform: translateX(2px);
}
.beh-link-icon {
    font-size: 18px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

/* --- Empty / loading states ------------------------------- */
.beh-widget--empty .beh-widget__title { opacity: .7; }
.beh-widget--empty p { color: var(--beh-muted); font-size: 14px; margin: 0; }

/* --- Accessibility ---------------------------------------- */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* --- Disabled button state -------------------------------- */
.beh-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============================================================
   Habits widget
   ============================================================ */

/* Widget header with edit button */
.beh-widget--habits .beh-widget__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.beh-widget--habits .beh-widget__title { margin: 0; }

.beh-habits-edit-btn {
    font-size: 12px;
    font-weight: 600;
    color: var(--beh-navy);
    background: var(--beh-navy-light);
    border: 1px solid var(--beh-border);
    border-radius: var(--beh-radius-sm);
    padding: 5px 12px;
    cursor: pointer;
    transition: background var(--beh-transition);
}
.beh-habits-edit-btn:hover { background: color-mix(in srgb, var(--beh-navy-light), var(--beh-navy) 22%); }

.beh-habits-intro {
    font-size: 14px;
    color: var(--beh-muted);
    margin: 0 0 20px;
    line-height: 1.6;
}

/* Mastery notice */
.beh-mastery-notice {
    background: var(--beh-amber-bg);
    border: 1px solid var(--beh-amber);
    border-radius: var(--beh-radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--beh-text);
    margin-bottom: 16px;
}

/* --- Check-off grid --------------------------------------- */
.beh-habit-grid {
    display: grid;
    grid-template-columns: 1fr repeat(7, 36px);
    gap: 4px;
    align-items: center;
}

.beh-habit-grid__spacer { /* empty top-left corner */ }

.beh-habit-grid__day {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--beh-muted);
    letter-spacing: .03em;
    line-height: 1;
    padding: 2px 0 6px;
}
.beh-habit-grid__day.is-today { color: var(--beh-navy); }

.beh-habit-grid__name {
    font-size: 13px;
    font-weight: 500;
    color: var(--beh-text);
    padding-right: 8px;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 4px;
}
.beh-habit-grid__name.is-mastery { color: var(--beh-navy); font-weight: 600; }
.beh-mastery-star { font-size: 13px; }

.beh-habit-cell {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 2px solid var(--beh-border);
    background: var(--beh-bg);
    cursor: pointer;
    font-size: 16px;
    color: var(--beh-navy-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--beh-transition), border-color var(--beh-transition), transform var(--beh-transition);
    padding: 0;
}
.beh-habit-cell:hover:not(.is-checked) {
    border-color: var(--beh-navy);
    background: var(--beh-navy-light);
    transform: scale(1.08);
}
.beh-habit-cell.is-checked {
    background: var(--beh-navy-light);
    border-color: var(--beh-navy);
    transform: scale(1.05);
}
.beh-habit-cell.is-today {
    box-shadow: 0 0 0 2px var(--beh-navy-light);
}
.beh-habit-cell.is-loading { opacity: .5; pointer-events: none; }

@media (max-width: 600px) {
    .beh-habit-grid { grid-template-columns: 1fr repeat(7, 30px); gap: 3px; }
    .beh-habit-cell { width: 30px; height: 30px; font-size: 13px; }
}

/* --- Habit setup / edit panel ----------------------------- */
.beh-habit-cat { margin-bottom: 20px; }
.beh-habit-cat__label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--beh-muted);
    margin: 0 0 10px;
}

.beh-habit-options { display: flex; flex-direction: column; gap: 6px; }

.beh-habit-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border: 2px solid var(--beh-border);
    border-radius: var(--beh-radius-sm);
    cursor: pointer;
    transition: border-color var(--beh-transition), background var(--beh-transition);
    background: var(--beh-bg);
}
.beh-habit-option:hover { border-color: var(--beh-navy); background: var(--beh-navy-light); }
.beh-habit-option.is-selected {
    border-color: var(--beh-navy);
    background: var(--beh-navy-light);
}
.beh-habit-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.beh-habit-option__text { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.beh-habit-option__name { font-size: 14px; font-weight: 600; color: var(--beh-text); }
.beh-habit-option__desc { font-size: 12px; color: var(--beh-muted); line-height: 1.4; }

/* Suggested habits section */
.beh-habits-suggested { margin-bottom: 20px; }

.beh-habit-badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    background: var(--beh-navy);
    color: #fff;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
    align-self: flex-start;
    margin-top: 2px;
}

/* Browse categories — collapsed accordions */
.beh-habit-browse {
    border-top: 1px solid var(--beh-border);
    padding-top: 14px;
    margin-top: 4px;
}
.beh-habit-browse-hint {
    font-size: 12px;
    color: var(--beh-muted);
    margin: 0 0 10px;
}

.beh-habit-cat-details {
    border: 1px solid var(--beh-border);
    border-radius: var(--beh-radius-sm);
    margin-bottom: 6px;
    overflow: hidden;
}
.beh-habit-cat-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--beh-text);
    list-style: none;
    background: var(--beh-bg);
    transition: background var(--beh-transition);
    user-select: none;
}
.beh-habit-cat-summary::-webkit-details-marker { display: none; }
.beh-habit-cat-summary::after {
    content: '+';
    font-size: 18px;
    font-weight: 300;
    color: var(--beh-muted);
    line-height: 1;
}
details[open] .beh-habit-cat-summary::after { content: '−'; }
.beh-habit-cat-summary:hover { background: var(--beh-navy-light); }

.beh-habit-cat-count {
    font-size: 11px;
    font-weight: 600;
    background: var(--beh-border);
    color: var(--beh-muted);
    padding: 1px 7px;
    border-radius: 20px;
    margin-right: 8px;
}

.beh-habit-options--in-details {
    padding: 10px 14px 14px;
    gap: 6px;
    background: var(--beh-card);
    border-top: 1px solid var(--beh-border);
}
.beh-habit-options--in-details .beh-habit-option {
    padding: 8px 12px;
}

.beh-habits-setup-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--beh-border);
    flex-wrap: wrap;
    gap: 12px;
}
.beh-habit-sel-msg { font-size: 13px; color: var(--beh-muted); }
.beh-habits-setup-footer .beh-btn { margin-top: 0; }

/* Edit panel (slide-down) */
.beh-habits-edit-wrap {
    margin-top: 20px;
    border-top: 2px solid var(--beh-border);
    padding-top: 20px;
}
.beh-edit-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.beh-edit-panel-header h3 { margin: 0; font-size: 16px; color: var(--beh-navy); }
.beh-edit-panel-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--beh-muted);
    line-height: 1;
    padding: 0;
}

/* --- Training plan + block request widgets ----------------- */
.beh-plan-current { font-size: 15px; margin: 0 0 4px; }
.beh-plan-current--unset { color: var(--beh-muted); font-style: italic; }
.beh-plan-pending,
.beh-block-request-pending {
    font-size: 13px;
    color: var(--beh-navy);
    background: var(--beh-navy-light);
    border-radius: var(--beh-radius-sm);
    padding: 10px 12px;
    margin-top: 8px;
}
.beh-block-request-sub { font-size: 13px; color: var(--beh-muted); margin: -8px 0 14px; }
.beh-plan-change-details { margin-top: 10px; }
.beh-plan-change-details summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--beh-navy); }
.beh-plan-change-form { margin-top: 12px; }
.beh-radio-group label.is-disabled { opacity: .45; cursor: not-allowed; }
.beh-widget--empty .beh-block-request-sub { display: none; }
.beh-edit-panel-close:hover { color: var(--beh-text); }

/* --- Theme toggle -------------------------------------------
   Fixed control on the distraction-free hub page. Cycles
   Auto -> Light -> Dark. The actual attribute switch and
   localStorage persistence live in a small inline script in
   templates/page-distraction-free.php, run early enough to avoid
   a flash of the wrong theme. */
.beh-theme-toggle {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 40;
    display: inline-flex;
    align-items: center;
    background: var(--beh-card);
    border: 1px solid var(--beh-border);
    color: var(--beh-muted);
    font-family: var(--beh-font);
    font-size: 12.5px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 99px;
    box-shadow: var(--beh-shadow);
    cursor: pointer;
    transition: border-color var(--beh-transition), color var(--beh-transition);
}
.beh-theme-toggle:hover { border-color: var(--beh-navy); color: var(--beh-navy-dark); }
.beh-theme-toggle:focus-visible { outline: 2px solid var(--beh-navy); outline-offset: 2px; }
@media (max-width: 480px) {
    .beh-theme-toggle { bottom: 10px; right: 10px; padding: 6px 12px; font-size: 11.5px; }
}
