/* Life Note pickers (static/js/ln_picker.js; flag web_pickers, born dark).
   The sheet reuses the shipped Custom mix modal's values (settings.html
   .journal-response-modal*); the compact list reuses #inspiration-menu's
   dropdown tokens. Theme comes from skin.js variables, so light and dark
   follow the app. No italics anywhere. */

.lnp-native { display: none !important; }
html.lnp-lock, html.lnp-lock body { overflow: hidden; }
.lnp-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[class^="lnp-"], [class*=" lnp-"] { font-style: normal; }

/* ---------- Triggers ---------- */
.lnp-mrow {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .8rem 1rem;
    border-radius: .75rem;
    background: var(--input-bg, #FFFFFF);
    border: 2px solid var(--input-border, #e5e7eb);
    color: var(--text-color, #333333);
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.lnp-mrow:hover:not(:disabled) { border-color: rgba(139, 92, 246, .45); }
.lnp-mrow:focus-visible, .lnp-mrow[aria-expanded="true"] { outline: none; border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139, 92, 246, .12); }
.lnp-mrow:disabled { opacity: .55; cursor: default; }
.lnp-mrow .lnp-face { width: 44px; height: 44px; }
.lnp-mrow .lnp-cp { flex: 1; min-width: 0; }
.lnp-mrow .lnp-nm { display: block; font-weight: 600; font-size: 1rem; line-height: 1.25; }
.lnp-mrow .lnp-tl { display: block; font-size: .8rem; opacity: .68; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lnp-mrow.is-empty .lnp-nm { font-weight: 500; opacity: .7; }
.lnp-go { width: 18px; height: 18px; opacity: .55; flex: none; }

.lnp-face { border-radius: 999px; object-fit: cover; object-position: 50% 22%; flex: none; display: block; }
.lnp-face-blank { display: inline-flex; align-items: center; justify-content: center; background: rgba(139, 92, 246, .12); color: #8b5cf6; font-weight: 700; }

/* A list or date trigger takes the native control's own classes (copyLook),
   so it keeps today's box; these only add the layout a <button> lacks. */
/* :where() keeps these at zero specificity: the copied class always wins. */
:where(.lnp-field) {
    display: flex;
    align-items: center;
    gap: .6rem;
    text-align: left;
    font: inherit;
    cursor: pointer;
    min-height: 2.25rem;
}
.lnp-field.settings-form-input { display: flex; align-items: center; gap: .6rem; text-align: left; cursor: pointer; padding-right: 1rem; }
.lnp-field:disabled { opacity: .55; cursor: default; }
.lnp-field .lnp-val { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lnp-field .lnp-val.is-ph { opacity: .55; }
.lnp-field[aria-expanded="true"], .lnp-field.is-editing { border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139, 92, 246, .1); }
.lnp-chev { width: 16px; height: 16px; opacity: .55; flex: none; margin-left: auto; }
.lnp-flag { width: 21px; height: 14px; border-radius: 2px; flex: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
.lnp-flag-none { display: inline-block; box-shadow: none; }

/* Journal toolbar: the date input's box at the same size. */
.lnp-field.journal-date-input { display: flex; align-items: center; min-width: 120px; max-width: 160px; gap: .35rem; min-height: 0; cursor: pointer; }
.lnp-field.journal-date-input .lnp-chev { width: 12px; height: 12px; }
/* Readable export: rx-date inputs are styled by their element selector. */
.rx-date .lnp-field { width: 100%; min-height: 44px; padding: 8px; border: 1px solid var(--card-border); border-radius: 8px; background: var(--input-bg); color: var(--text-color); }
/* Gift page: same box as its select (gifts.css .gift-language select). */
#life-note-gift .gift-language .lnp-field { background: var(--ln-control); color: var(--ln-text); border: 1px solid var(--ln-line); padding: 9px 10px; border-radius: 5px; font: 12px/1.4 Arial, sans-serif; max-width: 160px; min-height: 0; }
/* Highlights: the mentor filter keeps a steady width as names change. */
.lnp-field[data-lnp-for="mentor-filter"] { min-width: 200px; }
/* First-run reminder card: an invisible button over the pill, as the select was. */
.lnp-overlay-trigger { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; border: 0; background: none; }

/* ---------- Sheet (mentor) ---------- */
.lnp-sheet-wrap { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.lnp-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.lnp-sheet {
    position: relative;
    z-index: 1;
    width: min(100%, 37.5rem);
    max-height: min(88vh, 820px);
    display: flex;
    flex-direction: column;
    border-radius: 1rem;
    background: var(--card-bg, #FFFFFF);
    border: 1px solid var(--card-border, rgba(0, 0, 0, .08));
    box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
    color: var(--text-color, #333333);
    overflow: hidden;
    text-align: left;
}
.lnp-sh-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem; border-bottom: 1px solid var(--input-border, #e5e7eb); flex: none; }
.lnp-sh-heading { flex: 1; min-width: 0; }
.lnp-sh-title { font-size: 1rem; font-weight: 700; line-height: 1.3; margin: 0; padding: 0; }
.lnp-sh-help { margin: .22rem 0 0; font-size: .82rem; line-height: 1.4; opacity: .72; }
.lnp-sh-x { width: 2rem; height: 2rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; color: inherit; background: transparent; border: 0; cursor: pointer; flex: none; }
.lnp-sh-x:hover, .lnp-sh-x:focus-visible { background: rgba(139, 92, 246, .1); outline: none; }
.lnp-sh-x svg { width: 16px; height: 16px; }
.lnp-sh-search { padding: .85rem 1.1rem .75rem; border-bottom: 1px solid var(--input-border, #e5e7eb); flex: none; }
.lnp-srch { position: relative; }
.lnp-srch svg { position: absolute; left: .82rem; top: 50%; width: .9rem; height: .9rem; transform: translateY(-50%); opacity: .5; pointer-events: none; }
.lnp-srch-in { width: 100%; padding: .62rem .85rem .62rem 2.2rem; border: 1px solid var(--input-border, #e5e7eb); border-radius: .75rem; background: var(--input-bg, #FFFFFF); color: var(--text-color, #333333); font-size: .86rem; outline: none; }
.lnp-srch-in:focus { border-color: rgba(139, 92, 246, .65); box-shadow: 0 0 0 3px rgba(139, 92, 246, .12); }
.lnp-sh-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.lnp-listbox { list-style: none; margin: 0; padding: 0; }
.lnp-opt { display: flex; align-items: center; gap: .75rem; padding: .78rem 1.1rem; border-bottom: 1px solid var(--input-border, #e5e7eb); cursor: pointer; }
.lnp-opt:last-child { border-bottom: 0; }
.lnp-opt .lnp-face { width: 2.5rem; height: 2.5rem; }
.lnp-opt .lnp-cp { min-width: 0; flex: 1; }
.lnp-opt .lnp-nm { display: block; font-weight: 600; line-height: 1.25; }
.lnp-opt .lnp-tl { display: block; font-size: .78rem; opacity: .68; margin-top: .15rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lnp-opt.is-selected { background: rgba(139, 92, 246, .08); }
.lnp-opt.is-active { box-shadow: inset 3px 0 0 #8b5cf6; background: rgba(139, 92, 246, .13); }
.lnp-opt[aria-disabled="true"] { opacity: .5; cursor: default; }
.lnp-chk { width: 1.25rem; height: 1.25rem; border-radius: 999px; border: 2px solid var(--input-border, #d1d5db); flex: none; position: relative; }
.lnp-opt.is-selected .lnp-chk { border-color: #8b5cf6; background: #8b5cf6; }
.lnp-opt.is-selected .lnp-chk::after { content: ''; position: absolute; left: .36rem; top: .18rem; width: .35rem; height: .62rem; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.lnp-sh-empty { padding: 2.2rem 1rem; text-align: center; font-size: .84rem; line-height: 1.45; opacity: .72; margin: 0; }
.lnp-sh-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1.1rem; border-top: 1px solid var(--input-border, #e5e7eb); flex: none; }
.lnp-lnk { font-weight: 600; font-size: .9rem; color: var(--dropdown-follow-more-text, #8B5CF6); display: inline-flex; align-items: center; gap: .3rem; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.lnp-lnk:hover { text-decoration: underline; }
.lnp-lnk:disabled { opacity: .4; cursor: default; text-decoration: none; }
.lnp-lnk svg { width: 15px; height: 15px; }

@media (max-width: 639.98px) {
    .lnp-sheet-wrap { padding: 0; align-items: stretch; }
    .lnp-sheet { width: 100%; height: 100%; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
    .lnp-sh-head { padding-top: calc(1rem + env(safe-area-inset-top, 0px)); }
    .lnp-sh-foot { padding-bottom: calc(.85rem + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- Compact list + calendar (anchored popover) ---------- */
.lnp-pop-skin {
    --lnp-bg: var(--dropdown-menu-bg, #FFFFFF);
    --lnp-line: var(--dropdown-menu-border, rgba(139, 92, 246, .15));
    --lnp-text: var(--dropdown-option-text, var(--text-color, #374151));
    --lnp-hover: var(--dropdown-option-hover-bg, rgba(139, 92, 246, .08));
    --lnp-shadow: var(--dropdown-menu-shadow, 0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .04));
    color: var(--lnp-text);
    text-align: left;
}
.ln-night .lnp-pop-skin { --lnp-bg: #1b1726; --lnp-line: var(--ln-line, rgba(255, 255, 255, .16)); --lnp-text: var(--ln-text, #F3EEE6); --lnp-hover: rgba(255, 255, 255, .08); --lnp-shadow: 0 20px 40px rgba(0, 0, 0, .5); }
.lnp-pop { position: fixed; background: var(--lnp-bg); border: 1px solid var(--lnp-line); border-radius: 16px; box-shadow: var(--lnp-shadow); overflow: hidden; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.lnp-plist { max-height: min(360px, 60vh); overflow-y: auto; overscroll-behavior: contain; padding: .35rem .5rem .5rem; outline: none; }
.lnp-popt { display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; margin: .1rem 0; border-radius: 10px; font-size: .92rem; font-weight: 500; cursor: pointer; }
.lnp-popt.is-active { background: var(--lnp-hover); }
.lnp-plist:focus-visible .lnp-popt.is-active { box-shadow: inset 0 0 0 2px rgba(139, 92, 246, .55); }
.lnp-popt.is-selected { font-weight: 650; }
.lnp-popt[aria-disabled="true"] { opacity: .45; cursor: default; }
.lnp-popt .lnp-grow { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; }
.lnp-popt .lnp-ck { width: 16px; height: 16px; color: #8b5cf6; flex: none; }
.lnp-pface { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; object-position: 50% 22%; flex: none; }
.lnp-pface.lnp-face-blank { display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; }

/* Phone: bottom sheet */
.lnp-bwrap { position: fixed; inset: 0; }
.lnp-bsheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--card-bg, var(--lnp-bg)); border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .3); padding: .5rem 0 calc(1rem + env(safe-area-inset-bottom, 0px)); max-height: 80vh; display: flex; flex-direction: column; }
.ln-night .lnp-bsheet { background: var(--lnp-bg); }
.lnp-grab { width: 38px; height: 5px; border-radius: 3px; background: var(--input-border, rgba(127, 127, 127, .4)); margin: 0 auto .6rem; flex: none; }
.lnp-btitle { margin: 0 1.1rem .5rem; font-size: 1rem; font-weight: 700; flex: none; }
.lnp-bsheet .lnp-plist { max-height: none; flex: 1 1 auto; min-height: 0; }
.lnp-bsheet .lnp-cal { margin: 0 auto; }

/* Calendar */
.lnp-cal { width: 300px; padding: .85rem .9rem .9rem; }
.lnp-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .55rem; }
.lnp-cal-title { font-weight: 650; font-size: .95rem; margin: 0; }
.lnp-cal-jump { display: inline-flex; align-items: center; gap: .3rem; margin: 0; padding: .3rem .55rem; border-radius: 8px; background: none; border: 0; color: inherit; cursor: pointer; font: inherit; font-style: normal; }
.lnp-cal-jump:hover, .lnp-cal-jump:focus-visible, .lnp-cal-jump[aria-expanded="true"] { background: var(--lnp-hover); outline: none; }
.lnp-cal-jump:focus-visible { box-shadow: inset 0 0 0 2px rgba(139, 92, 246, .55); }
.lnp-cal-jump .lnp-chev { width: 14px; height: 14px; opacity: .6; flex: none; margin-left: 0; }
.lnp-cal-jump[aria-expanded="true"] .lnp-chev { transform: rotate(180deg); }
.lnp-cal-pick { display: grid; gap: 4px; max-height: 252px; overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
.lnp-cal-pick[hidden], .lnp-cal-grid[hidden] { display: none; }
.lnp-cal-pick.is-year { grid-template-columns: repeat(4, 1fr); }
.lnp-cal-pick.is-month { grid-template-columns: repeat(3, 1fr); }
.lnp-pk { height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 10px; font-size: .88rem; font-variant-numeric: tabular-nums; background: none; border: 0; color: inherit; cursor: pointer; font-family: inherit; font-style: normal; }
.lnp-pk:hover:not(.is-off) { background: var(--lnp-hover); }
.lnp-pk:focus-visible { outline: 2px solid rgba(139, 92, 246, .7); outline-offset: -2px; }
.lnp-pk.is-today { box-shadow: inset 0 0 0 1.5px #8b5cf6; }
.lnp-pk.is-sel { background: #8b5cf6; color: #fff; font-weight: 650; box-shadow: none; }
.lnp-pk.is-off { opacity: .28; cursor: default; }
.lnp-cal-ar { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; opacity: .75; background: none; border: 0; color: inherit; cursor: pointer; }
.lnp-cal-ar:hover:not(:disabled), .lnp-cal-ar:focus-visible { background: var(--lnp-hover); opacity: 1; outline: none; }
.lnp-cal-ar:disabled { opacity: .25; cursor: default; }
.lnp-cal-ar svg { width: 15px; height: 15px; }
.lnp-cal-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px 0; text-align: center; }
.lnp-cal-wd { font-size: .7rem; font-weight: 700; opacity: .5; padding: 4px 0; }
.lnp-day { width: 100%; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 10px; font-size: .82rem; font-variant-numeric: tabular-nums; background: none; border: 0; color: inherit; cursor: pointer; font-family: inherit; }
.lnp-day:hover:not(.is-off) { background: var(--lnp-hover); }
.lnp-day:focus-visible { outline: 2px solid rgba(139, 92, 246, .7); outline-offset: -2px; }
.lnp-day.is-out { opacity: .3; }
.lnp-day.is-today { box-shadow: inset 0 0 0 1.5px #8b5cf6; }
.lnp-day.is-range { background: rgba(139, 92, 246, .14); border-radius: 0; }
.lnp-day.is-sel { background: #8b5cf6; color: #fff; font-weight: 650; box-shadow: none; }
.lnp-day.is-off { opacity: .28; cursor: default; }
.lnp-cal-foot { display: flex; justify-content: space-between; margin-top: .6rem; font-size: .85rem; }
.lnp-cal-foot .lnp-lnk { font-size: .85rem; }

/* ---------- Chips ---------- */
.lnp-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lnp-chip { height: 34px; padding: 0 13px; border-radius: 999px; border: 1.5px solid var(--input-border, var(--card-border, #d1d5db)); background: transparent; color: var(--text-color, inherit); display: inline-flex; align-items: center; font-size: .85rem; font-weight: 500; white-space: nowrap; cursor: pointer; font-family: inherit; }
.lnp-chip[aria-checked="true"] { border-color: var(--button-bg, #8B5CF6); background: rgba(139, 92, 246, .14); }
.lnp-chip:focus-visible { outline: 2px solid rgba(139, 92, 246, .6); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    .lnp-mrow { transition: none; }
}
