/*
    Paydays (Components/Shared/Payday): the pay calendar (PayCalendar), the Manage paydays button (PaydayManageButton)
    and the Your paydays dialog (PaydaySourcesDialog), plus the Recurring Forecast's Your paydays card. Shared by the
    Modern dashboard's Until payday and the Recurring area, so it reads the transaction popups' tokens (--tx-*) and,
    inside the Modern dashboard (.dx), the dashboard's own ink and inset tokens. Neutral surfaces and hairlines; color
    only where it means something: the couple's blue and amber dots, the green of what a payday brings, the amber NEXT,
    and one clean blue for the choice. No 1px borders on the rows, options or buttons: hover lays a slight neutral
    gradient over them, and the choice is a slight blue gradient fading to the background plus the check. Prefix: pd-.
*/

:root {
    --pd-ink: var(--tx-text);
    --pd-ink-2: var(--tx-muted);
    --pd-ink-3: var(--tx-light-text);
    --pd-surface: var(--tx-surface);
    --pd-line: var(--tx-border);
    --pd-line-strong: #C7CCDA;
    --pd-you: #2563EB;
    --pd-you-soft: rgba(37, 99, 235, .10);
    --pd-partner: #D97706;
    --pd-partner-soft: rgba(217, 119, 6, .12);
    --pd-amber-ink: #B45309;
    --pd-pos-ink: #15803D;
    --pd-accent: #2563EB;
    --pd-accent-soft: rgba(37, 99, 235, .08);
}

[data-bs-theme="dark"] {
    --pd-ink-2: #B1B6CB;
    --pd-line-strong: rgba(255, 255, 255, .26);
    --pd-you: #60A5FA;
    --pd-you-soft: rgba(96, 165, 250, .14);
    --pd-partner: #FBBF24;
    --pd-partner-soft: rgba(251, 191, 36, .14);
    --pd-amber-ink: #FBBF24;
    --pd-pos-ink: #4ADE80;
    --pd-accent: #60A5FA;
    --pd-accent-soft: rgba(96, 165, 250, .12);
}

/* Inside the Modern dashboard: its inks, its inset surface and hairline. */
.dx {
    --pd-ink: var(--dx-ink);
    --pd-ink-2: var(--dx-ink-2);
    --pd-ink-3: var(--dx-ink-3);
    --pd-surface: var(--dx-inset);
    --pd-line: var(--dx-line);
}

/* ------------------------------------------------------------------ The pay calendar */
.pd-cal { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.pd-cal-caption {
    margin: 0;
    font: 700 11px/1.2 var(--tx-font);
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--pd-ink-3);
}

.pd-cal-list {
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0 0 2px;
    list-style: none;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.pd-cal-list::-webkit-scrollbar { display: none; }

.pd-pay {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    padding: 8px 12px 9px;
    border-radius: 12px;
    background: var(--pd-surface);
    border: 1px solid var(--pd-line);
    scroll-snap-align: start;
}

.pd-pay-top { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.pd-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--pd-you); }
.pd-dot.is-partner { background: var(--pd-partner); }

.pd-pay-name {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    font: 650 12.5px/1.25 var(--tx-font);
    color: var(--pd-ink);
}

.pd-pay-amount { font: 700 12.5px/1.25 var(--tx-font); color: var(--pd-pos-ink); }

.pd-pay-when {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 14px;
    font-size: 11.5px;
    line-height: 1.3;
    color: var(--pd-ink-2);
    white-space: nowrap;
}

.pd-next {
    font: 800 10px/1 var(--tx-font);
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--pd-amber-ink);
}

/* The Recurring card lists every payday: wrap instead of scrolling. */
.pd-cal-card .pd-cal-list { flex-wrap: wrap; overflow: visible; }

/* ------------------------------------------------------------------ Manage paydays */
.pd-manage {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 13px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--pd-ink);
    font-family: var(--tx-font);
    text-align: left;
    cursor: pointer;
}

.pd-manage:focus-visible { outline: 2px solid var(--pd-accent); outline-offset: 2px; }

.pd-manage-glyph {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--ci-icon-pill);
    color: var(--pd-accent);
    font-size: 13px;
}

.pd-manage-copy { display: flex; flex: 1 1 auto; flex-direction: column; gap: 1px; min-width: 0; }
.pd-manage-title { font: 650 13.5px/1.25 var(--tx-font); color: var(--pd-ink); }

.pd-manage-text {
    overflow: hidden;
    font-size: 12px;
    line-height: 1.35;
    color: var(--pd-ink-2);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pd-manage-chevron { flex: 0 0 auto; font-size: 11px; color: var(--pd-ink-3); }

/* The compact header button (the mobile card's sliders): clear glass while automatic, the accent wash once picked. */
.pd-manage-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: color-mix(in srgb, var(--pd-ink) 5%, transparent);
    color: var(--pd-accent);
    font-size: 13px;
    cursor: pointer;
}

.pd-manage-icon:hover { background: linear-gradient(160deg, color-mix(in srgb, var(--pd-ink) 11%, transparent), color-mix(in srgb, var(--pd-ink) 4%, transparent)); }
.pd-manage-icon:focus-visible { outline: 2px solid var(--pd-accent); outline-offset: 2px; }
.pd-manage-icon.is-picked { background: var(--pd-accent-soft); }
.pd-manage-icon.is-picked:hover { background: linear-gradient(160deg, color-mix(in srgb, var(--pd-accent) 22%, transparent), color-mix(in srgb, var(--pd-accent) 9%, transparent)); }

/* ------------------------------------------------------------------ Your paydays (dialog) */
.pd-chip { background: var(--pd-accent-soft); color: var(--pd-accent); }
.pd-body { display: flex; flex-direction: column; gap: 12px; padding-top: 6px; }

.pd-summary {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 11px 13px;
    border-radius: 12px;
    background: var(--pd-surface);
    font-size: 13px;
    line-height: 1.45;
    color: var(--pd-ink);
}

.pd-summary .tx-glyph { margin-top: 2px; color: var(--pd-accent); }

.pd-option,
.pd-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--pd-ink);
    font-family: var(--tx-font);
    text-align: left;
    cursor: pointer;
}

/* The chosen option or paycheck: a slight blue gradient fading into the background, and the check. No border. */
.pd-option.is-on,
.pd-row.is-on {
    background: linear-gradient(100deg, color-mix(in srgb, var(--pd-accent) 14%, transparent) 0%, color-mix(in srgb, var(--pd-accent) 5%, transparent) 55%, transparent 100%);
}

/* Hover: a slight neutral gradient laid over the row (on top of the choice's wash when it's picked), faded in.
   button.pd-row only: the public decks (public-skin.css) use their own div.pd-row. */
.pd-manage,
.pd-option,
button.pd-row { position: relative; isolation: isolate; }

.pd-manage::before,
.pd-option::before,
button.pd-row::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: linear-gradient(100deg, color-mix(in srgb, var(--pd-ink) 7%, transparent) 0%, color-mix(in srgb, var(--pd-ink) 2.5%, transparent) 60%, transparent 100%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}

.pd-manage:hover::before,
.pd-option:hover:not(:disabled)::before,
button.pd-row:hover:not(:disabled)::before { opacity: 1; }

.pd-option:focus-visible,
.pd-row:focus-visible { outline: 2px solid var(--pd-accent); outline-offset: 2px; }

.pd-option:disabled,
.pd-row:disabled { cursor: default; opacity: .55; }

.pd-check {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--pd-line-strong);
    border-radius: 50%;
    color: transparent;
    font-size: 10px;
}

.is-on > .pd-check { border-color: var(--pd-accent); background: var(--pd-accent); color: #FFFFFF; }

.pd-option-glyph,
.pd-row-glyph {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--pd-surface);
    color: var(--pd-ink-2);
    font-size: 13px;
}

.pd-row.is-you .pd-row-glyph { background: var(--pd-you-soft); color: var(--pd-you); }
.pd-row.is-partner .pd-row-glyph { background: var(--pd-partner-soft); color: var(--pd-partner); }

.pd-option-copy,
.pd-row-copy { display: flex; flex: 1 1 auto; flex-direction: column; gap: 2px; min-width: 0; }

.pd-option-title,
.pd-row-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font: 650 13.5px/1.3 var(--tx-font);
    color: var(--pd-ink);
}

.pd-row-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pd-option-text,
.pd-row-detail { font-size: 12px; line-height: 1.4; color: var(--pd-ink-2); }

.pd-pill {
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--pd-surface);
    color: var(--pd-ink-2);
    font: 650 10.5px/1.3 var(--tx-font);
    white-space: nowrap;
}

.pd-row.is-on .pd-pill { background: color-mix(in srgb, var(--pd-surface) 70%, transparent); }
.pd-pill.is-detected { background: var(--pd-accent-soft); color: var(--pd-accent); }
.pd-pill.is-missing { background: var(--pd-partner-soft); color: var(--pd-amber-ink); }

.pd-pick-head { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.pd-pick-title { margin: 0; font: 700 13px/1.3 var(--tx-font); color: var(--pd-ink); }
.pd-pick-hint { margin: 0; font-size: 12px; line-height: 1.45; color: var(--pd-ink-2); }

.pd-suggest {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border: 0;
    border-radius: 999px;
    background: var(--pd-accent-soft);
    color: var(--pd-accent);
    font: 650 12.5px/1.2 var(--tx-font);
    cursor: pointer;
}

.pd-suggest:hover:not(:disabled) { background: linear-gradient(100deg, color-mix(in srgb, var(--pd-accent) 20%, transparent), color-mix(in srgb, var(--pd-accent) 8%, transparent)); }
.pd-suggest:focus-visible { outline: 2px solid var(--pd-accent); outline-offset: 2px; }
.pd-suggest:disabled { cursor: default; opacity: .55; }

.pd-rows { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }

.pd-empty { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--pd-ink-2); }

.pd-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 8px;
    text-align: center;
    color: var(--pd-ink-2);
}

.pd-state p { margin: 0; font-size: 13px; line-height: 1.45; }
.pd-state.is-inline { flex-direction: row; flex-wrap: wrap; padding: 2px 0; text-align: left; }

.pd-skel { display: flex; flex-direction: column; gap: 10px; }
.pd-bone { height: 52px; border-radius: 12px; }
.pd-bone-tall { height: 44px; }
.pd-bone-short { width: 60%; height: 14px; }

.pd-selection { font: 650 12.5px/1.2 var(--tx-font); color: var(--pd-ink-2); }
.pd-save-error { flex: 1 1 100%; margin: 0; }

/* ------------------------------------------------------------------ Recurring: Your paydays card */
.pd-card { display: flex; flex-direction: column; gap: 14px; }
