/**
 * Pathway Tracker CSS (v1.0)
 * Modern, responsive, accessible floating drawer & bottom-sheet for personal rights journeys.
 */

:root {
    /* Landing page / wizard palette (home-redesign.css --tv-*, style.css #wizardOverlay --wz-*) */
    --pw-primary: #163a63;
    --pw-primary-hover: #0f2942;
    --pw-primary-light: #eef4fb;
    --pw-accent: #2c6cb0;
    --pw-orange: #f58428;
    --pw-success: #00b894;
    --pw-success-light: #eefaf4;
    --pw-warning: #f59e0b;
    --pw-warning-light: #fffbeb;
    --pw-critical: #ef4444;
    --pw-critical-light: #fef2f2;
    --pw-text-main: #1e293b;
    --pw-text-muted: #64748b;
    --pw-text-dim: #94a3b8;
    --pw-border: #e2e8f0;
    --pw-border-light: #f1f5f9;
    --pw-bg: #ffffff;
    --pw-bg-subtle: #f8fafc;
    --pw-shadow-pill: 0 4px 18px rgba(15, 23, 42, 0.14), 0 2px 6px rgba(15, 23, 42, 0.08);
    --pw-shadow-drawer: 8px 0 32px rgba(15, 23, 42, 0.18);
    --pw-shadow-sheet: 0 -8px 32px rgba(15, 23, 42, 0.18);
    --pw-radius-pill: 9999px;
    --pw-radius-card: 16px;
    --pw-radius-inner: 12px;
    --pw-font: 'Rubik', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --pw-ring: 0 0 0 4px rgba(22, 58, 99, 0.16);
    --pw-transition: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   1. Floating Hill Pill (Gentle Parabolic Hill at Screen Edge)
   ========================================================================== */
#pathwayPill {
    position: fixed;
    top: 50%;
    z-index: 9980;
    width: 56px;
    height: 92px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    outline: none;
    overflow: visible;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--pw-font);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    filter: drop-shadow(0 4px 18px rgba(15, 41, 66, 0.35));
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
}

#pathwayPill:focus {
    outline: none;
}

#pathwayPill:focus-visible {
    outline: 2px solid var(--pw-orange);
    outline-offset: 2px;
}

#pathwayPill:active {
    opacity: 0.92;
}

/* Solid anchor bleed (same navy as the hill) behind the screen edge, so no white line shows on slide-out */
#pathwayPill::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    pointer-events: none;
    background: var(--pw-primary);
}

/* RTL Language (Hebrew, Arabic): Docked to RIGHT screen edge as a parabolic gentle hill */
html[dir="rtl"] #pathwayPill,
body[dir="rtl"] #pathwayPill,
[dir="rtl"] #pathwayPill {
    right: 0;
    left: auto;
    direction: rtl;
    transform: translateY(-50%);
}

html[dir="rtl"] #pathwayPill::after,
body[dir="rtl"] #pathwayPill::after,
[dir="rtl"] #pathwayPill::after {
    right: -40px;
    left: auto;
    width: 42px;
}

html[dir="rtl"] #pathwayPill:hover,
body[dir="rtl"] #pathwayPill:hover,
[dir="rtl"] #pathwayPill:hover {
    transform: translateY(-50%) translateX(-4px);
    filter: drop-shadow(0 6px 24px rgba(15, 41, 66, 0.5));
}

html[dir="rtl"].pw-drawer-open #pathwayPill,
body.pw-drawer-open[dir="rtl"] #pathwayPill,
[dir="rtl"] .pw-drawer-open #pathwayPill {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) translateX(100%);
}

/* LTR Language (Russian, English): Docked to LEFT screen edge as a parabolic gentle hill */
html[dir="ltr"] #pathwayPill,
body[dir="ltr"] #pathwayPill,
[dir="ltr"] #pathwayPill {
    left: 0;
    right: auto;
    direction: ltr;
    transform: translateY(-50%);
}

html[dir="ltr"] #pathwayPill::after,
body[dir="ltr"] #pathwayPill::after,
[dir="ltr"] #pathwayPill::after {
    left: -40px;
    right: auto;
    width: 42px;
}

html[dir="ltr"] #pathwayPill:hover,
body[dir="ltr"] #pathwayPill:hover,
[dir="ltr"] #pathwayPill:hover {
    transform: translateY(-50%) translateX(4px);
    filter: drop-shadow(0 6px 24px rgba(15, 41, 66, 0.5));
}

html[dir="ltr"].pw-drawer-open #pathwayPill,
body.pw-drawer-open[dir="ltr"] #pathwayPill,
[dir="ltr"] .pw-drawer-open #pathwayPill {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) translateX(-100%);
}

/* Parabolic Hill SVG - solid navy with generous bleed past screen edge */
.pw-hill-svg {
    position: absolute;
    top: 0;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

html[dir="rtl"] .pw-hill-svg,
body[dir="rtl"] .pw-hill-svg,
[dir="rtl"] .pw-hill-svg {
    right: -30px;
    left: auto;
    width: 86px;
}

html[dir="ltr"] .pw-hill-svg,
body[dir="ltr"] .pw-hill-svg,
[dir="ltr"] .pw-hill-svg {
    left: -30px;
    right: auto;
    width: 86px;
}

.pw-hill-fill {
    fill: var(--pw-primary) !important;
    stroke: none !important;
}

.pw-hill-stroke {
    display: none !important;
}

/* Hill Text - Horizontal orientation ("מאוזנת") with only the word "מסלול" */
.pw-hill-text {
    position: relative;
    z-index: 2;
    font-size: 0.86rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.02em;
    line-height: 1;
    white-space: nowrap;
    writing-mode: horizontal-tb;
    text-shadow: 0 1px 2px rgba(15, 41, 66, 0.5);
}

html[dir="rtl"] .pw-hill-text {
    margin-right: 4px;
}

html[dir="ltr"] .pw-hill-text {
    margin-left: 4px;
}

/* ==========================================================================
   Periodic Attention Nudge Animation (Peeks & slides out every few minutes)
   Stops immediately once clicked or opened.
   ========================================================================== */

/* RTL Nudge: Hill slides out to the left towards the center, then smoothly retreats */
html[dir="rtl"] #pathwayPill.is-nudging,
body[dir="rtl"] #pathwayPill.is-nudging,
[dir="rtl"] #pathwayPill.is-nudging {
    animation: pwHillNudgeRtl 2.5s cubic-bezier(0.25, 1, 0.5, 1) both;
}

@keyframes pwHillNudgeRtl {
    0% {
        transform: translateY(-50%) translateX(0);
        filter: drop-shadow(0 4px 18px rgba(15, 41, 66, 0.35));
    }
    18% {
        transform: translateY(-50%) translateX(-12px);
        filter: drop-shadow(-6px 8px 28px rgba(15, 41, 66, 0.5));
    }
    34% {
        transform: translateY(-50%) translateX(-6px);
    }
    48% {
        transform: translateY(-50%) translateX(-12px);
        filter: drop-shadow(-6px 8px 28px rgba(15, 41, 66, 0.5));
    }
    68% {
        transform: translateY(-50%) translateX(-2px);
    }
    82%, 100% {
        transform: translateY(-50%) translateX(0);
        filter: drop-shadow(0 4px 18px rgba(15, 41, 66, 0.35));
    }
}

/* LTR Nudge: Hill slides out to the right towards the center, then smoothly retreats */
html[dir="ltr"] #pathwayPill.is-nudging,
body[dir="ltr"] #pathwayPill.is-nudging,
[dir="ltr"] #pathwayPill.is-nudging {
    animation: pwHillNudgeLtr 2.5s cubic-bezier(0.25, 1, 0.5, 1) both;
}

@keyframes pwHillNudgeLtr {
    0% {
        transform: translateY(-50%) translateX(0);
        filter: drop-shadow(0 4px 18px rgba(15, 41, 66, 0.35));
    }
    18% {
        transform: translateY(-50%) translateX(12px);
        filter: drop-shadow(6px 8px 28px rgba(15, 41, 66, 0.5));
    }
    34% {
        transform: translateY(-50%) translateX(6px);
    }
    48% {
        transform: translateY(-50%) translateX(12px);
        filter: drop-shadow(6px 8px 28px rgba(15, 41, 66, 0.5));
    }
    68% {
        transform: translateY(-50%) translateX(2px);
    }
    82%, 100% {
        transform: translateY(-50%) translateX(0);
        filter: drop-shadow(0 4px 18px rgba(15, 41, 66, 0.35));
    }
}

/* ==========================================================================
   2. Backdrop Overlay
   ========================================================================== */
#pathwayBackdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 9985;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--pw-transition), visibility var(--pw-transition);
}

#pathwayBackdrop.is-open {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   3. Side Drawer (Desktop) - RTL on Right, LTR on Left
   ========================================================================== */
#pathwayDrawer {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 420px;
    max-width: 92vw;
    background: var(--pw-bg);
    z-index: 9990;
    display: flex;
    flex-direction: column;
    visibility: hidden;
    font-family: var(--pw-font);
    color: var(--pw-text-main);
    transition: transform var(--pw-transition);
}

/* RTL Drawer: Opens from Right */
html[dir="rtl"] #pathwayDrawer,
body[dir="rtl"] #pathwayDrawer,
[dir="rtl"] #pathwayDrawer {
    right: 0;
    left: auto;
    direction: rtl;
    text-align: right;
    transform: translateX(100%);
    box-shadow: -8px 0 32px rgba(15, 23, 42, 0.18);
}

html[dir="rtl"] #pathwayDrawer.is-open,
body[dir="rtl"] #pathwayDrawer.is-open,
[dir="rtl"] #pathwayDrawer.is-open {
    transform: translateX(0);
    visibility: visible;
}

/* LTR Drawer: Opens from Left */
html[dir="ltr"] #pathwayDrawer,
body[dir="ltr"] #pathwayDrawer,
[dir="ltr"] #pathwayDrawer {
    left: 0;
    right: auto;
    direction: ltr;
    text-align: left;
    transform: translateX(-100%);
    box-shadow: 8px 0 32px rgba(15, 23, 42, 0.18);
}

html[dir="ltr"] #pathwayDrawer.is-open,
body[dir="ltr"] #pathwayDrawer.is-open,
[dir="ltr"] #pathwayDrawer.is-open {
    transform: translateX(0);
    visibility: visible;
}

/* Drag handle indicator (only visible on mobile bottom-sheet) */
.pw-drag-handle-wrap {
    display: none;
    justify-content: center;
    padding: 0.6rem 0 0.2rem 0;
    cursor: grab;
}

.pw-drag-handle {
    width: 42px;
    height: 5px;
    background: #cbd5e1;
    border-radius: 999px;
}

/* ==========================================================================
   4. Drawer Header
   ========================================================================== */
.pw-header {
    padding: 1.15rem 1.25rem 1rem 1.25rem;
    background: linear-gradient(180deg, var(--pw-primary-light) 0%, #ffffff 100%);
    border-bottom: 1px solid var(--pw-border-light);
    position: relative;
    flex-shrink: 0;
}

.pw-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.pw-title-group {
    flex: 1;
    min-width: 0;
}

.pw-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--pw-primary);
    background: var(--pw-primary-light);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    margin-bottom: 0.3rem;
}

.pw-main-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--pw-primary);
    letter-spacing: -0.01em;
    margin: 0;
    line-height: 1.25;
}

.pw-header-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.pw-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    height: 34px;
    padding: 0 0.75rem;
    border: 1px solid var(--pw-border);
    border-radius: var(--pw-radius-pill);
    background: var(--pw-bg);
    color: var(--pw-primary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease;
}

.pw-switch-btn:hover {
    background: var(--pw-primary-light);
}

.pw-switch-btn:focus-visible {
    outline: 2px solid var(--pw-primary);
    outline-offset: 2px;
}

.pw-close-btn {
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--pw-border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pw-text-muted);
    font-size: 1.15rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

.pw-close-btn:hover {
    background: #f1f5f9;
    color: var(--pw-text-main);
}

.pw-close-btn:focus-visible {
    outline: 2px solid var(--pw-primary);
    outline-offset: 2px;
}

/* Progress bar container */
.pw-progress-container {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.pw-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--pw-text-muted);
    font-weight: 600;
}

.pw-progress-percent {
    color: var(--pw-primary);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.pw-progress-track {
    width: 100%;
    height: 7px;
    background: var(--pw-border-light);
    border-radius: 999px;
    overflow: hidden;
}

.pw-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--pw-primary) 0%, var(--pw-accent) 100%);
    border-radius: 999px;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   5. Content Body & Vertical Timeline
   ========================================================================== */
.pw-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.pw-body::-webkit-scrollbar {
    width: 5px;
}
.pw-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.pw-timeline {
    position: relative;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* The vertical connecting line */
.pw-timeline::before {
    content: '';
    position: absolute;
    top: 20px;
    bottom: 20px;
    right: 17px;
    width: 2px;
    background: #e2e8f0;
    z-index: 1;
}

/* Timeline Step Item */
.pw-step-item {
    position: relative;
    padding-right: 46px;
    padding-bottom: 1.5rem;
    z-index: 2;
}

.pw-step-item:last-child {
    padding-bottom: 0.5rem;
}

/* Node indicator */
.pw-step-node {
    position: absolute;
    right: 3px;
    top: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--pw-text-muted);
    transition: all 0.2s ease;
    z-index: 3;
}

/* Node Completed */
.pw-step-item.is-completed .pw-step-node {
    background: var(--pw-success);
    border-color: var(--pw-success);
    color: #ffffff;
}

/* Node Active */
.pw-step-item.is-active .pw-step-node {
    background: var(--pw-primary);
    border-color: var(--pw-primary);
    color: #ffffff;
    box-shadow: var(--pw-ring);
}

/* Step Header / Trigger */
.pw-step-header {
    background: transparent;
    border: none;
    padding: 0;
    width: 100%;
    text-align: right;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.pw-step-header:focus-visible {
    outline: 2px solid var(--pw-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

.pw-step-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--pw-text-main);
    margin: 0;
    line-height: 1.3;
}

.pw-step-item.is-completed .pw-step-title {
    color: var(--pw-text-muted);
}

.pw-step-item.is-upcoming .pw-step-title {
    color: var(--pw-text-dim);
}

.pw-step-toggle-icon {
    font-size: 0.75rem;
    color: var(--pw-text-dim);
    transition: transform 0.2s ease;
}

.pw-step-item.is-open .pw-step-toggle-icon {
    transform: rotate(180deg);
}

.pw-step-short-desc {
    font-size: 0.8rem;
    color: var(--pw-text-muted);
    margin: 0.25rem 0 0 0;
    line-height: 1.35;
}

.pw-step-item.is-upcoming .pw-step-short-desc {
    color: var(--pw-text-dim);
}

/* Step Content Card */
.pw-step-card {
    margin-top: 0.75rem;
    padding: 0.9rem;
    background: var(--pw-bg-subtle);
    border: 1px solid var(--pw-border);
    border-radius: var(--pw-radius-card);
    transition: all 0.2s ease;
}

.pw-step-item.is-active .pw-step-card {
    background: #ffffff;
    border-color: #c7d7ea;
    box-shadow: 0 8px 20px -8px rgba(22, 58, 99, 0.25);
}

/* Checklist */
.pw-checklist {
    list-style: none;
    padding: 0;
    margin: 0 0 0.85rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.pw-check-label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.84rem;
    color: var(--pw-text-main);
    cursor: pointer;
    line-height: 1.35;
    user-select: none;
}

.pw-check-input {
    appearance: none;
    -webkit-appearance: none;
    width: 17px;
    height: 17px;
    border: 1.5px solid #cbd5e1;
    border-radius: 5px;
    margin-top: 2px;
    background: #ffffff;
    cursor: pointer;
    flex-shrink: 0;
    display: grid;
    place-content: center;
    transition: all 0.15s ease;
}

.pw-check-input:checked {
    background: var(--pw-primary);
    border-color: var(--pw-primary);
}

.pw-check-input:checked::before {
    content: '✓';
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
}

.pw-check-input:focus-visible {
    outline: 2px solid var(--pw-primary);
    outline-offset: 2px;
}

.pw-check-label.is-checked .pw-check-text {
    text-decoration: line-through;
    color: var(--pw-text-dim);
}

/* Smart Insight Box */
/* Official forms needed at a step */
.pw-forms {
    margin-bottom: 0.85rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--pw-border);
    border-radius: var(--pw-radius-inner);
    background: var(--pw-bg-subtle);
}

.pw-forms-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.pw-forms-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--pw-text-main);
}

.pw-forms-print {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.65rem;
    min-height: 2rem;
    border: 1px solid var(--pw-border);
    border-radius: var(--pw-radius-pill);
    background: var(--pw-bg);
    color: var(--pw-primary);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.pw-forms-print:hover {
    background: var(--pw-primary-light);
}

.pw-forms-print:focus-visible,
.pw-form-link:focus-visible {
    outline: none;
    box-shadow: var(--pw-ring);
}

.pw-forms-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.pw-form-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--pw-border-light);
    border-radius: 10px;
    background: var(--pw-bg);
}

.pw-form-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.pw-form-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--pw-text-main);
    line-height: 1.35;
}

.pw-form-note {
    font-size: 0.74rem;
    color: var(--pw-text-muted);
    line-height: 1.35;
}

.pw-form-link {
    flex-shrink: 0;
    padding: 0.35rem 0.6rem;
    min-height: 2rem;
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
    background: var(--pw-primary);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.pw-form-link:hover {
    background: var(--pw-primary-hover);
}

/* Narrow drawer (bottom sheet on phones): name above its button instead of squeezed beside it. */
@media (max-width: 480px) {
    .pw-form-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
    }

    .pw-form-link {
        justify-content: center;
    }
}

.pw-insight-box {
    padding: 0.75rem 0.85rem;
    border-radius: var(--pw-radius-inner);
    margin-bottom: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.82rem;
    line-height: 1.4;
}

.pw-insight-box.is-critical {
    background: var(--pw-critical-light);
    border: 1px solid #fecaca;
    color: #991b1b;
}

.pw-insight-box.is-warning {
    background: var(--pw-warning-light);
    border: 1px solid #fde68a;
    color: #92400e;
}

.pw-insight-box.is-tip {
    background: var(--pw-success-light);
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.pw-insight-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    font-size: 0.84rem;
}

.pw-insight-content {
    margin: 0;
    color: inherit;
    opacity: 0.95;
}

/* Step Action Button */
.pw-step-action-btn {
    width: 100%;
    padding: 0.65rem 1rem;
    background: var(--pw-primary);
    color: #ffffff;
    border: none;
    border-radius: var(--pw-radius-inner);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    min-height: 2.6rem;
    box-shadow: 0 6px 16px -6px rgba(22, 58, 99, 0.55);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.15s ease, transform 0.1s ease;
}

.pw-step-action-btn:hover {
    background: var(--pw-primary-hover);
}

.pw-step-action-btn:active {
    transform: scale(0.99);
}

.pw-step-action-btn:focus-visible {
    outline: 2px solid var(--pw-primary);
    outline-offset: 2px;
}

/* Completed Celebration Badge */
.pw-complete-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    background: var(--pw-success-light);
    border: 1px solid #b8ecdc;
    border-radius: var(--pw-radius-inner);
    color: #047857;
    font-weight: 700;
    font-size: 0.85rem;
}

/* ==========================================================================
   6. Small text button (e.g. "פתח מחדש" on a completed step)
   ========================================================================== */
.pw-footer-link {
    color: var(--pw-text-muted);
    text-decoration: none;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: inherit;
    transition: color 0.15s ease, background 0.15s ease;
}

.pw-footer-link:hover {
    color: var(--pw-text-main);
    background: #e2e8f0;
}

.pw-footer-link:focus-visible {
    outline: 2px solid var(--pw-primary);
}

/* ==========================================================================
   7. Pathway Switcher Modal
   ========================================================================== */
.pw-switcher-modal {
    display: none;
    position: absolute;
    inset: 0;
    background: var(--pw-bg);
    z-index: 10;
    padding: 1.25rem;
    flex-direction: column;
}

.pw-switcher-modal[hidden] {
    display: none !important;
}

.pw-switcher-modal:not([hidden]) {
    display: flex;
    animation: pwFadeIn 0.2s ease;
}

@keyframes pwFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.pw-switcher-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.pw-switcher-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0;
}

.pw-switcher-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
}

.pw-pathway-card {
    padding: 0.9rem;
    border: 1px solid var(--pw-border);
    border-radius: var(--pw-radius-card);
    background: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-family: inherit;
    width: 100%;
}

.pw-pathway-card:hover {
    border-color: var(--pw-primary);
    background: var(--pw-primary-light);
}

.pw-pathway-card.is-selected {
    border-color: var(--pw-primary);
    background: var(--pw-primary-light);
    box-shadow: 0 0 0 1px var(--pw-primary);
}

.pw-pathway-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--pw-text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pw-pathway-card-desc {
    font-size: 0.8rem;
    color: var(--pw-text-muted);
    line-height: 1.35;
}

/* ==========================================================================
   8. Mobile Adaptations (Bottom Sheet)
   ========================================================================== */
@media (max-width: 768px) {
    #pathwayPill {
        top: auto;
        bottom: 5.5rem;
        transform: none;
        width: 50px;
        height: 82px;
    }

    html[dir="rtl"] #pathwayPill,
    body[dir="rtl"] #pathwayPill,
    [dir="rtl"] #pathwayPill {
        right: 0;
        left: auto;
        transform: none;
    }

    html[dir="ltr"] #pathwayPill,
    body[dir="ltr"] #pathwayPill,
    [dir="ltr"] #pathwayPill {
        left: 0;
        right: auto;
        transform: none;
    }

    html[dir="rtl"] #pathwayPill:hover,
    body[dir="rtl"] #pathwayPill:hover,
    [dir="rtl"] #pathwayPill:hover {
        transform: translateX(-3px);
    }

    html[dir="ltr"] #pathwayPill:hover,
    body[dir="ltr"] #pathwayPill:hover,
    [dir="ltr"] #pathwayPill:hover {
        transform: translateX(3px);
    }

    html[dir="rtl"] .pw-hill-svg,
    body[dir="rtl"] .pw-hill-svg,
    [dir="rtl"] .pw-hill-svg {
        right: -30px;
        left: auto;
        width: 80px;
    }

    html[dir="ltr"] .pw-hill-svg,
    body[dir="ltr"] .pw-hill-svg,
    [dir="ltr"] .pw-hill-svg {
        left: -30px;
        right: auto;
        width: 80px;
    }

    html[dir="rtl"] #pathwayPill::after,
    body[dir="rtl"] #pathwayPill::after,
    [dir="rtl"] #pathwayPill::after {
        right: -30px;
        left: auto;
        width: 32px;
    }

    html[dir="ltr"] #pathwayPill::after,
    body[dir="ltr"] #pathwayPill::after,
    [dir="ltr"] #pathwayPill::after {
        left: -30px;
        right: auto;
        width: 32px;
    }

    .pw-drawer-open #pathwayPill {
        opacity: 0;
        pointer-events: none;
        transform: translateY(20px) !important;
    }

    #pathwayDrawer {
        top: auto;
        bottom: 0;
        left: 0 !important;
        right: 0 !important;
        width: 100%;
        max-width: 100%;
        max-height: 82vh;
        border-radius: 20px 20px 0 0;
        box-shadow: var(--pw-shadow-sheet);
        transform: translateY(100%) !important;
    }

    #pathwayDrawer.is-open {
        transform: translateY(0) !important;
    }

    .pw-drag-handle-wrap {
        display: flex;
    }

    .pw-header {
        padding: 0.75rem 1.15rem 0.85rem 1.15rem;
    }

    .pw-body {
        padding: 1rem 1.15rem;
    }

    /* Mobile Nudge Keyframes (without translateY(-50%)) */
    html[dir="rtl"] #pathwayPill.is-nudging,
    body[dir="rtl"] #pathwayPill.is-nudging,
    [dir="rtl"] #pathwayPill.is-nudging {
        animation: pwHillNudgeRtlMobile 2.5s cubic-bezier(0.25, 1, 0.5, 1) both;
    }

    @keyframes pwHillNudgeRtlMobile {
        0% { transform: translateX(0); }
        18% { transform: translateX(-10px); }
        34% { transform: translateX(-5px); }
        48% { transform: translateX(-10px); }
        68% { transform: translateX(-2px); }
        82%, 100% { transform: translateX(0); }
    }

    html[dir="ltr"] #pathwayPill.is-nudging,
    body[dir="ltr"] #pathwayPill.is-nudging,
    [dir="ltr"] #pathwayPill.is-nudging {
        animation: pwHillNudgeLtrMobile 2.5s cubic-bezier(0.25, 1, 0.5, 1) both;
    }

    @keyframes pwHillNudgeLtrMobile {
        0% { transform: translateX(0); }
        18% { transform: translateX(10px); }
        34% { transform: translateX(5px); }
        48% { transform: translateX(10px); }
        68% { transform: translateX(2px); }
        82%, 100% { transform: translateX(0); }
    }
}

@media (prefers-reduced-motion: reduce) {
    #pathwayPill.is-nudging {
        animation: none !important;
    }
}

/* Journey sync (js/journey-pathway.js): track tag in the combined pathway, date notes, show-all */
.pw-step-track {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    margin-bottom: 0.2rem;
    background: var(--pw-primary-light);
    color: var(--pw-primary);
}
.pw-step-track.is-pension_disability {
    background: var(--pw-warning-light);
    color: #92400e;
}
.pw-step-date-note {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--pw-accent);
    margin: 0.2rem 0 0;
}
.pw-show-all {
    width: 100%;
    text-align: center;
    padding: 0.5rem;
}
