/* Sports Training Planner — public styles
   Brand palette: charcoal #252525 · accent orange #F97316 · light bg #F7F8FA
*/

/* ── Brand tokens ─────────────────────────────────────────────────────────── */

:root {
    --stp-dark:         #252525;   /* logo charcoal */
    --stp-dark-hover:   #3a3a3a;
    --stp-accent:       #F97316;   /* orange CTA */
    --stp-accent-hover: #EA6A0A;
    --stp-accent-light: #FEF3E8;   /* light orange tint */
    --stp-bg:           #F7F8FA;   /* page background */
    --stp-surface:      #FFFFFF;   /* card surface */
    --stp-border:       rgba(0,0,0,.1);
    --stp-border-mid:   rgba(0,0,0,.18);
    --stp-text:         #1A1A1A;
    --stp-text-2:       #555;
    --stp-text-3:       #888;
    --stp-green:        #16A34A;
    --stp-green-bg:     #DCFCE7;
    --stp-red:          #DC2626;
    --stp-red-bg:       #FEE2E2;
    --stp-blue:         #1D4ED8;
    --stp-blue-bg:      #DBEAFE;
    --stp-purple:       #7C3AED;
    --stp-purple-bg:    #EDE9FE;
}

/* ── Reset ────────────────────────────────────────────────────────────────── */

.stp-library *,
.stp-planner *,
.stp-generator * {
    box-sizing: border-box;
}

/* ── Outer containers ─────────────────────────────────────────────────────── */

.stp-library,
.stp-planner,
.stp-generator {
    font-family: inherit;
    color: inherit;
    line-height: 1.5;
}

/* ── Typography helpers ───────────────────────────────────────────────────── */

.stp-label {
    display: block;
    font-size: 12px;
    color: var(--stp-text-secondary, #666);
    margin-bottom: 5px;
}

.stp-section-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--stp-text-tertiary, #999);
    margin: 20px 0 8px;
}

.stp-heading {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
    color: inherit;
    line-height: 1.2;
}

.stp-subheading {
    font-size: 13px;
    color: #888;
    margin-bottom: 0;
}

.stp-hint {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.stp-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid var(--stp-border-mid);
    background: var(--stp-surface);
    color: var(--stp-text);
    cursor: pointer;
    text-decoration: none;
    transition: background .12s, border-color .12s, color .12s;
    white-space: nowrap;
    line-height: 1.4;
}
.stp-btn:hover {
    background: var(--stp-bg);
    border-color: rgba(0,0,0,.3);
    color: var(--stp-text);
    text-decoration: none;
}
.stp-btn:active { transform: scale(.98); }

/* Primary — charcoal (matches logo) */
.stp-btn--primary {
    background: var(--stp-dark);
    color: #fff;
    border-color: transparent;
}
.stp-btn--primary:hover {
    background: var(--stp-dark-hover);
    color: #fff;
}

/* Accent — orange CTA */
.stp-btn--accent {
    background: var(--stp-accent);
    color: #fff;
    border-color: transparent;
    font-weight: 600;
}
.stp-btn--accent:hover {
    background: var(--stp-accent-hover);
    color: #fff;
}

/* Ghost — visible outline on any background */
.stp-btn--ghost {
    background: transparent;
    border-color: var(--stp-border-mid);
    color: var(--stp-text-2);
}
.stp-btn--ghost:hover {
    background: var(--stp-bg);
    color: var(--stp-text);
    border-color: rgba(0,0,0,.3);
}

/* Danger */
.stp-btn--danger {
    background: transparent;
    color: var(--stp-red);
    border-color: rgba(220,38,38,.3);
}
.stp-btn--danger:hover {
    background: var(--stp-red-bg);
    border-color: rgba(220,38,38,.4);
}

/* ── Badges ──────────────────────────────────────────────────────────────── */

.stp-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: .01em;
}

.stp-badge--featured          { background: var(--stp-accent-light); color: var(--stp-accent-hover); }
.stp-badge--intensity-low     { background: var(--stp-green-bg);     color: var(--stp-green); }
.stp-badge--intensity-medium  { background: var(--stp-accent-light); color: var(--stp-accent-hover); }
.stp-badge--intensity-high    { background: var(--stp-red-bg);       color: var(--stp-red); }

.stp-badge--type-practice     { background: var(--stp-blue-bg);   color: var(--stp-blue); }
.stp-badge--type-match        { background: var(--stp-green-bg);  color: var(--stp-green); }
.stp-badge--type-conditioning { background: var(--stp-accent-light); color: var(--stp-accent-hover); }
.stp-badge--type-recovery     { background: var(--stp-purple-bg); color: var(--stp-purple); }
.stp-badge--type-other        { background: var(--stp-bg);        color: var(--stp-text-2); }

.stp-tag {
    display: inline-block;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--stp-bg);
    border: 1px solid var(--stp-border);
    color: var(--stp-text-2);
    white-space: nowrap;
    font-weight: 500;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */

.stp-plan-card {
    background: var(--stp-surface);
    border: 1px solid var(--stp-border);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, transform .15s;
    display: flex;
    flex-direction: column;
}
.stp-plan-card:hover {
    border-color: var(--stp-accent);
    box-shadow: 0 4px 16px rgba(249,115,22,.12);
    transform: translateY(-1px);
}

.stp-plan-card__sport {
    font-size: 11px;
    color: #888;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stp-plan-card__title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    word-break: break-word;     /* FIXED: allow long plan names to wrap naturally */
    line-height: 1.3;
}

.stp-plan-card__meta {
    font-size: 11px;
    color: #888;
    margin-bottom: 12px;
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.stp-plan-card__footer {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;            /* FIXED: allow buttons to wrap on narrow cards */
    margin-top: auto;
    padding-top: 10px;
    border-top: 0.5px solid rgba(0,0,0,.06);
}

.stp-plan-card__footer .stp-btn {
    flex: 1;
    justify-content: center;
    min-width: 72px;
}

/* ── Grid ────────────────────────────────────────────────────────────────── */

.stp-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* FIXED: 220px min (was 180px) */
    gap: 12px;
    margin-bottom: 20px;
}

/* ── Planner layout — FIXED: was grid-template-columns:1fr 1fr ───────────── */

.stp-planner {
    display: flex;
    flex-direction: column;     /* FIXED: single column, no more 2-col grid split */
}

.stp-planner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 0.5px solid rgba(0,0,0,.08);
}
.stp-planner-header h2,
.stp-planner-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 2px;
}

/* ── Library ─────────────────────────────────────────────────────────────── */

.stp-library__filters,
.stp-lib-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.stp-filter {
    padding: 7px 10px;
    font-size: 12px;
    border-radius: 8px;
    border: 0.5px solid rgba(0,0,0,.2);
    background: #fff;
}

.stp-upgrade-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--stp-accent-light);
    border: 1px solid rgba(249,115,22,.3);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--stp-accent-hover);
    flex-wrap: wrap;
    font-weight: 500;
}

/* ── Form card ───────────────────────────────────────────────────────────── */

.stp-form-card {
    background: var(--stp-surface);
    border: 1px solid var(--stp-border);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 12px;
}

.stp-form-card:last-child {
    margin-bottom: 0;
}

/* ── Form elements ───────────────────────────────────────────────────────── */

.stp-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.stp-form-row {
    margin-bottom: 12px;
}
.stp-form-row:last-child {
    margin-bottom: 0;
}

.stp-input {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    border: 0.5px solid rgba(0,0,0,.2);
    border-radius: 8px;
    background: #fff;
    color: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.stp-input:focus {
    outline: none;
    border-color: var(--stp-accent);
    box-shadow: 0 0 0 3px rgba(249,115,22,.12);
}

textarea.stp-input {
    resize: vertical;
    min-height: 64px;
}

/* ── Header actions (planner list header button group) ───────────────────── */

.stp-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .stp-header-actions {
        width: 100%;
        flex-direction: column;
    }
    .stp-header-actions .stp-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ── Button row ──────────────────────────────────────────────────────────── */

.stp-btn-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

/* ── Block strip ─────────────────────────────────────────────────────────── */

.stp-block-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 4px;
}

.stp-block {
    border-radius: 10px;
    padding: 10px 12px;
    border: 1px solid transparent;
    min-width: 0;
}
.stp-block--warm_up,
.stp-block--cool_down     { background: var(--stp-green-bg);  border-color: rgba(22,163,74,.15); }
.stp-block--drills        { background: var(--stp-accent-light); border-color: rgba(249,115,22,.15); }
.stp-block--main_activity { background: var(--stp-blue-bg);   border-color: rgba(29,78,216,.15); }

.stp-block__label {
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.stp-block--warm_up .stp-block__label,
.stp-block--cool_down .stp-block__label { color: var(--stp-green); }
.stp-block--drills .stp-block__label    { color: var(--stp-accent-hover); }
.stp-block--main_activity .stp-block__label { color: var(--stp-blue); }

.stp-block__detail {
    font-size: 11px;
    color: var(--stp-text-2);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Drill rows ──────────────────────────────────────────────────────────── */

.stp-drill-list {
    background: #fff;
    border: 0.5px solid rgba(0,0,0,.12);
    border-radius: 12px;
    padding: 0 16px;
    margin-bottom: 4px;
}

.stp-drill-row {
    display: flex;
    align-items: flex-start;    /* FIXED: use flex-start so long content aligns to top */
    justify-content: space-between;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 0.5px solid rgba(0,0,0,.07);
    flex-wrap: wrap;            /* FIXED: allow wrapping on narrow viewports */
}
.stp-drill-row:last-child { border-bottom: none; }

.stp-drill-main {
    flex: 1;
    min-width: 0;               /* FIXED: required for text-overflow to work */
}

.stp-drill-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stp-drill-desc {
    font-size: 11px;
    color: #888;
    margin-top: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;      /* FIXED: limit instructions to 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.stp-drill-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.stp-drill-inline-edit {
    width: 100%;
    border-top: 0.5px solid rgba(0,0,0,.08);
    margin-top: 10px;
    padding-top: 12px;
}

/* ── Equipment ───────────────────────────────────────────────────────────── */

.stp-equip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.stp-equip-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

/* ── Progress stepper ────────────────────────────────────────────────────── */

.stp-progress {
    display: flex;
    align-items: flex-start;
    margin-bottom: 28px;
}

.stp-progress__pip-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.stp-progress__pip {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    border: 0.5px solid rgba(0,0,0,.25);
    color: #888;
    background: #fff;
}
.stp-progress__pip.done   { background: var(--stp-dark); color: #fff; border-color: transparent; }
.stp-progress__pip.active { border: 1.5px solid var(--stp-accent); color: var(--stp-accent); }

.stp-progress__line {
    flex: 1;
    height: 0.5px;
    background: rgba(0,0,0,.15);
    margin-top: 14px;
}
.stp-progress__line.done { background: var(--stp-dark); }

.stp-progress__label {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
    white-space: nowrap;
    text-align: center;
}

/* ── Step ────────────────────────────────────────────────────────────────── */

.stp-step h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.2;
}
.stp-step__sub { font-size: 13px; color: #888; margin-bottom: 20px; }

/* ── Sport grid ──────────────────────────────────────────────────────────── */

.stp-sport-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 24px;
}
@media (min-width: 480px) {
    .stp-sport-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.stp-sport-btn {
    padding: 14px 8px;
    border-radius: 12px;
    border: 1px solid var(--stp-border);
    background: var(--stp-surface);
    color: var(--stp-text);          /* explicit — prevents theme overriding with white */
    cursor: pointer;
    text-align: center;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.stp-sport-btn:hover {
    border-color: var(--stp-accent);
    background: var(--stp-accent-light);
    color: var(--stp-text);          /* prevent theme overriding to white on hover */
}
.stp-sport-btn.selected {
    border: 2px solid var(--stp-accent);
    background: var(--stp-accent-light);
    color: var(--stp-text);
    box-shadow: 0 0 0 3px rgba(249,115,22,.1);
}
.stp-sport-btn__name { font-size: 12px; font-weight: 600; margin-top: 4px; color: var(--stp-text); }

/* ── Focus grid ──────────────────────────────────────────────────────────── */

.stp-focus-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 20px;
}

.stp-focus-btn {
    padding: 9px 8px;
    border-radius: 8px;
    border: 0.5px solid rgba(0,0,0,.18);
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all .15s;
    text-align: center;
}
.stp-focus-btn:hover { border-color: rgba(0,0,0,.35); color: #111; }
.stp-focus-btn.selected {
    border: 1.5px solid var(--stp-accent);
    color: var(--stp-accent-hover);
    background: var(--stp-accent-light);
    font-weight: 500;
}

/* ── Loading / spinner ───────────────────────────────────────────────────── */

.stp-loading {
    padding: 32px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

.stp-step--loading { text-align: center; padding: 32px 0; }

.stp-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(249,115,22,.15);
    border-top-color: var(--stp-accent);
    border-radius: 50%;
    animation: stp-spin .8s linear infinite;
    margin: 0 auto 12px;
}
@keyframes stp-spin { to { transform: rotate(360deg); } }

.stp-loading-label { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.stp-loading-meta  { font-size: 12px; color: #888; }

/* ── States ──────────────────────────────────────────────────────────────── */

.stp-notice {
    background: #EEEDFE;
    border: 0.5px solid #AFA9EC;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    color: #3C3489;
    margin-bottom: 16px;
}
.stp-notice--success { background: #EAF3DE; border-color: #97C459; color: #27500A; }

.stp-error   { font-size: 13px; color: #A32D2D; margin-top: 8px; padding: 8px 12px; background: #FCEBEB; border-radius: 6px; }
.stp-success { font-size: 13px; color: #3B6D11; margin-bottom: 16px; }
.stp-empty   { font-size: 13px; color: #888; padding: 12px 0; }

/* ── Empty state ─────────────────────────────────────────────────────────── */

.stp-empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #888;
    font-size: 14px;
    background: #fafafa;
    border: 0.5px dashed rgba(0,0,0,.15);
    border-radius: 12px;
    margin-bottom: 16px;
}
.stp-empty-state p { margin-bottom: 16px; color: #666; }

/* ── Gate screens ────────────────────────────────────────────────────────── */

.stp-gate {
    text-align: center;
    padding: 56px 32px;
    border: 0.5px solid rgba(0,0,0,.1);
    border-radius: 12px;
    background: var(--stp-bg);
}
.stp-gate h3 { font-size: 20px; font-weight: 600; margin-bottom: 10px; }
.stp-gate p  { font-size: 14px; color: #666; margin-bottom: 24px; max-width: 380px; margin-left: auto; margin-right: auto; }

/* ── Upgrade / pricing card ──────────────────────────────────────────────── */

.stp-upgrade-card {
    max-width: 460px;
    margin: 32px auto;
    background: var(--stp-surface);
    border: 1px solid var(--stp-border);
    border-radius: 16px;
    padding: 36px 32px 28px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,.06);
    position: relative;
}

.stp-upgrade-card__badge {
    display: inline-block;
    background: var(--stp-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 3px 12px;
    border-radius: 20px;
    margin-bottom: 18px;
}

.stp-upgrade-card__icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    background: var(--stp-accent-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--stp-accent);
}
.stp-upgrade-card__icon svg {
    width: 26px;
    height: 26px;
}

.stp-upgrade-card__title {
    font-size: 22px;
    font-weight: 700;
    color: var(--stp-text);
    margin-bottom: 8px;
    line-height: 1.2;
}

.stp-upgrade-card__sub {
    font-size: 14px;
    color: var(--stp-text-2);
    margin-bottom: 24px;
    line-height: 1.5;
}

.stp-upgrade-card__features {
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stp-upgrade-card__features li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--stp-text);
    line-height: 1.4;
}

.stp-upgrade-card__check {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background: var(--stp-green-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    color: var(--stp-green);
}
.stp-upgrade-card__check svg {
    width: 12px;
    height: 12px;
}

.stp-upgrade-card__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    background: var(--stp-accent);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    border-radius: 10px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background .15s, transform .1s, box-shadow .15s;
    box-shadow: 0 4px 16px rgba(249,115,22,.25);
    margin-bottom: 14px;
}
.stp-upgrade-card__cta svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.stp-upgrade-card__cta:hover {
    background: var(--stp-accent-hover);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(249,115,22,.35);
    transform: translateY(-1px);
}
.stp-upgrade-card__cta:active {
    transform: translateY(0) scale(.98);
    box-shadow: 0 2px 8px rgba(249,115,22,.2);
}

.stp-upgrade-card__reassure {
    font-size: 12px;
    color: var(--stp-text-3);
    margin: 0;
}

/* ── SWPM payment form — hidden, triggered by our branded button ──────────── */

.stp-upgrade-card__payment--hidden {
    display: none !important;
}

@media (max-width: 480px) {
    .stp-upgrade-card {
        padding: 28px 20px 24px;
        margin: 16px auto;
    }
    .stp-upgrade-card__title { font-size: 19px; }
}

/* ── Preview header ──────────────────────────────────────────────────────── */

.stp-preview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.stp-preview-title { font-size: 15px; font-weight: 600; }
.stp-preview-meta  { font-size: 12px; color: #888; margin-top: 3px; }

/* ── Modal ───────────────────────────────────────────────────────────────── */

.stp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
}

.stp-modal {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 560px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

.stp-modal__close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #888;
    line-height: 1;
    padding: 4px;
}
.stp-modal__close:hover { color: #111; }

/* ── Session cards ───────────────────────────────────────────────────────── */

.stp-session-card {
    background: #fff;
    border: 0.5px solid rgba(0,0,0,.12);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 8px;
}
.stp-session-card__title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.stp-session-card__meta  { font-size: 12px; color: #888; margin-bottom: 6px; }

/* ── Pagination ──────────────────────────────────────────────────────────── */

.stp-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 13px;
    color: #888;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 0.5px solid rgba(0,0,0,.08);
}

/* ── Toast notifications ─────────────────────────────────────────────────── */

.stp-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    background: var(--stp-dark);
    color: #fff;
    z-index: 99999;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .25s, transform .25s;
    pointer-events: none;
    max-width: calc(100vw - 48px);
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.stp-toast--show    { opacity: 1; transform: translateY(0); }
.stp-toast--error   { background: #A32D2D; }
.stp-toast--success { background: #27500A; }

/* ── Header button (site-wide login) ─────────────────────────────────────── */

.stp-wrap {
    display: flex;
    flex-direction: column;
}

.stp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    margin-bottom: 20px;
    background: #fff;
    border: 0.5px solid rgba(0,0,0,.1);
    border-radius: 12px;
    gap: 12px;
}

.stp-header__brand {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: #111;
    letter-spacing: -.01em;
    white-space: nowrap;
}

.stp-header__logo {
    width: 18px;
    height: 18px;
    color: #111;
    flex-shrink: 0;
}

.stp-header__right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.stp-btn--login {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 500;
    border-radius: 8px;
    border: 0.5px solid transparent;
    background: var(--stp-dark);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, transform .1s;
    white-space: nowrap;
}
.stp-btn--login svg { width: 14px; height: 14px; flex-shrink: 0; }
.stp-btn--login:hover  { background: var(--stp-dark-hover); color: #fff; text-decoration: none; }
.stp-btn--login:active { transform: scale(.97); }

/* ── User menu ───────────────────────────────────────────────────────────── */

.stp-user-menu { position: relative; }

.stp-user-menu__trigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px 5px 5px;
    font-size: 12.5px;
    font-weight: 500;
    color: #111;
    background: transparent;
    border: 0.5px solid rgba(0,0,0,.15);
    border-radius: 100px;
    cursor: pointer;
    transition: background .12s, border-color .12s;
    white-space: nowrap;
    line-height: 1;
}
.stp-user-menu__trigger:hover {
    background: rgba(0,0,0,.04);
    border-color: rgba(0,0,0,.25);
}

.stp-user-menu__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--stp-dark);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
}

.stp-user-menu__name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stp-user-menu__chevron {
    width: 14px;
    height: 14px;
    color: #888;
    transition: transform .18s ease;
    flex-shrink: 0;
}
.stp-user-menu--open .stp-user-menu__chevron { transform: rotate(180deg); }

.stp-user-menu__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 160px;
    background: #fff;
    border: 0.5px solid rgba(0,0,0,.12);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,.1);
    padding: 4px;
    z-index: 9999;
    animation: stpDropIn .14s ease;
}
.stp-user-menu--open .stp-user-menu__dropdown { display: block; }

@keyframes stpDropIn {
    from { opacity: 0; transform: translateY(-4px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.stp-user-menu__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 400;
    color: #333;
    border-radius: 7px;
    text-decoration: none;
    transition: background .1s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    white-space: nowrap;
}
.stp-user-menu__item svg { width: 14px; height: 14px; flex-shrink: 0; color: #888; }
.stp-user-menu__item:hover { background: rgba(0,0,0,.05); text-decoration: none; color: #111; }
.stp-user-menu__item--logout { color: #A32D2D; }
.stp-user-menu__item--logout svg { color: #A32D2D; }
.stp-user-menu__item--logout:hover { background: #FCEBEB; color: #A32D2D; }

.stp-user-menu__divider {
    height: 0.5px;
    background: rgba(0,0,0,.08);
    margin: 4px 0;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .stp-form-grid        { grid-template-columns: 1fr; }
    .stp-block-strip      { grid-template-columns: repeat(2, 1fr); }
    .stp-focus-grid       { grid-template-columns: repeat(2, 1fr); }
    .stp-upgrade-bar      { flex-direction: column; text-align: center; }
    .stp-plan-grid        { grid-template-columns: repeat(2, 1fr); }

    .stp-planner-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .stp-planner-header .stp-btn--primary {
        align-self: stretch;
        justify-content: center;
    }

    .stp-drill-row        { flex-direction: column; gap: 8px; }
    .stp-drill-actions    { width: 100%; justify-content: flex-end; }

    .stp-btn-row          { flex-direction: column; }
    .stp-btn-row .stp-btn { width: 100%; justify-content: center; }
}

@media (max-width: 420px) {
    .stp-plan-grid        { grid-template-columns: 1fr; }
    .stp-block-strip      { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .stp-header           { padding: 8px 12px; }
    .stp-user-menu__name  { display: none; }
    .stp-btn--login span  { display: none; }
    .stp-toast            { bottom: 12px; right: 12px; left: 12px; max-width: none; }
}
