/* The private chooser uses the same SSR markup for native and modal navigation. */
.saved-list-dialog,
.saved-list-selection {
    color-scheme: light;
    --ak-canvas: #fff;
    --ak-surface: #fff;
    --ak-surface-raised: #f5f5f5;
    --ak-border: #e0e0e0;
    --ak-border-strong: #bcbcbc;
    --ak-text: #222;
    --ak-muted: #666;
    --ak-brand: #3858c9;
    --ak-brand-soft: #3858c9;
    color: var(--ak-text);
    background: var(--ak-canvas);
    font-family: Inter, Arial, ui-sans-serif, system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.saved-list-dialog {
    width: min(640px, calc(100% - 32px));
    max-width: none;
    max-height: calc(100vh - 32px);
    max-height: calc(100svh - 32px);
    margin: auto;
    padding: 0;
    overflow: hidden;
    overscroll-behavior: contain;
    border: 0;
    border-radius: var(--ak-radius-sm);
    box-shadow: 0 8px 32px rgb(0 0 0 / 25%);
}

.saved-list-dialog::backdrop { background: rgb(0 0 0 / 80%); }
.saved-assets-dialog-open { overflow: hidden; }

.saved-list-selection {
    display: flex;
    max-height: calc(100svh - 32px);
    min-height: 0;
    flex-direction: column;
    width: min(640px, calc(100% - 32px));
    margin: 32px auto;
    padding: 40px;
    border-radius: var(--ak-radius-sm);
}

.saved-list-dialog .saved-list-selection { width: 100%; margin: 0; }
.saved-list-selection [hidden],
.saved-list-selection [data-saved-list-chooser-view][hidden] { display: none; }
.saved-list-selection [data-saved-list-chooser-view] { display: flex; min-height: 0; flex: 1 1 auto; flex-direction: column; }
.saved-list-selection__header { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.saved-list-selection #saved-list-selection-title { margin: 0; color: var(--ak-text); font-size: 24px; font-weight: 700; line-height: 1.3; letter-spacing: normal; }

.saved-list-selection__close {
    display: grid;
    width: 42px;
    min-height: 42px;
    flex: 0 0 auto;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: var(--ak-radius-sm);
    color: var(--ak-text);
    background: transparent;
    font-size: 28px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.saved-list-selection__close:hover { background: var(--ak-surface-raised); }
.saved-list-selection > p { margin: 0 0 16px; font-size: 14px; }
.saved-list-selection__tabs { flex: 0 0 auto; border-bottom: 1px solid var(--ak-border); }
.saved-list-selection__tab { width: max-content; margin: 0; padding: 0 0 12px; border-bottom: 2px solid var(--ak-brand); color: var(--ak-text); font-size: 16px; font-weight: 600; }
.saved-list-selection form[data-saved-membership-form] { display: flex; min-height: 0; flex: 1 1 auto; margin: 0; }
.saved-list-selection__rows { max-height: min(360px, max(0px, calc(100svh - 250px))); min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; border-bottom: 1px solid var(--ak-border); }
.saved-list-selection__row { display: flex; align-items: center; gap: 16px; min-height: 84px; padding: 10px 0; cursor: pointer; }
.saved-list-selection__row + .saved-list-selection__row { border-top: 1px solid var(--ak-border); }
.saved-list-selection__row:hover { background: var(--ak-surface-raised); }
.saved-list-selection__thumbnail { position: relative; display: grid; width: 64px; height: 64px; flex: 0 0 auto; overflow: hidden; place-items: center; border-radius: var(--ak-radius-sm); background: #eee; }
.saved-list-selection__thumbnail img { width: 64px; height: 64px; object-fit: cover; }
.saved-list-selection__thumbnail .saved-list-selection__checkbox { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.saved-list-selection__row:has(input:focus-visible) { outline: 2px solid var(--ak-brand); outline-offset: -2px; }
.saved-list-selection__placeholder { width: 28px; height: 28px; fill: none; stroke: #666; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.saved-list-selection__selected { position: absolute; display: grid; inset: 0; place-items: center; color: #fff; background: rgb(56 88 201 / 85%); opacity: 0; pointer-events: none; }
.saved-list-selection__selected svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.saved-list-selection__thumbnail:has(input:checked) .saved-list-selection__selected { opacity: 1; }
.saved-list-selection__info { display: grid; min-width: 0; gap: 4px; overflow-wrap: anywhere; }
.saved-list-selection__info strong { font-size: 16px; font-weight: 600; line-height: 1.5; }
.saved-list-selection__info small { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--ak-muted); font-size: 14px; line-height: 1.5; }
.saved-list-selection__info small svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.saved-list-selection__footer { display: flex; flex: 0 0 auto; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; }
.saved-list-selection__create-toggle { flex: 0 1 auto; width: fit-content; min-width: 0; max-width: 100%; min-height: var(--ak-button-min-height); padding: var(--ak-button-padding); border: 0; color: var(--ak-brand); background: transparent; font-size: 14px; font-weight: 600; line-height: 1.5; cursor: pointer; }

.saved-list-selection__save {
    position: relative;
    display: flex;
    width: fit-content;
    min-width: 0;
    max-width: 100%;
    height: auto;
    min-height: var(--ak-button-min-height);
    margin: 0 0 0 auto;
    padding: var(--ak-button-padding);
    border: 1px solid var(--ak-brand);
    border-radius: var(--ak-radius-sm);
    color: #fff;
    background: var(--ak-brand);
    box-shadow: none;
    font-size: 14px;
}
.saved-list-selection__save::before { position: absolute; inset: -1px; content: ""; }

.saved-list-selection__save:hover:not(:disabled) { background: #2c46a5; }
.saved-list-selection [data-saved-list-feedback] { margin: 16px 0 0; font-size: 14px; }
.saved-list-selection [data-saved-list-feedback]:empty { display: none; }
.saved-list-selection [data-saved-list-feedback][role="alert"] { color: #b3293e; }
.saved-list-selection__create { margin-top: 16px; }
.saved-list-selection__create summary { min-height: 42px; padding-block: 10px; color: var(--ak-brand); font-size: 14px; cursor: pointer; }
.saved-list-selection[data-saved-list-enhanced="true"] > .saved-list-selection__create > summary { display: none; }
.saved-list-selection[data-saved-list-enhanced="true"] > .saved-list-selection__create { margin: 0; }
.saved-list-dialog[data-saved-list-creating="true"] { width: min(600px, calc(100% - 32px)); }
.saved-list-create-view { padding-top: 16px; }
.saved-list-selection[data-saved-list-enhanced="true"] .saved-list-create-view { padding-top: 0; }
.saved-list-create-view__header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.saved-list-selection #saved-list-create-title { margin: 0; color: var(--ak-text); font-size: 24px; font-weight: 700; line-height: 1.3; }
.saved-list-create-view form { display: grid; gap: 16px; margin: 0; }
.saved-list-create-view label { display: grid; gap: 8px; color: var(--ak-text); font-size: 14px; font-weight: 600; }
.saved-list-create-view input { width: 100%; min-height: 41px; padding: 8px 12px; border: 1px solid var(--ak-border-strong); border-radius: var(--ak-radius-sm); color: var(--ak-text); background: #fff; font-size: 16px; }
.saved-list-create-view__note { margin: 0; color: var(--ak-muted); font-size: 14px; }
.saved-list-create-view__actions { display: flex; flex-wrap: wrap; gap: 16px; }
.saved-list-create-view__actions .button { width: fit-content; min-height: var(--ak-button-min-height); padding: var(--ak-button-padding); border-radius: var(--ak-radius-sm); font-size: 14px; }
.saved-list-create-view__actions .button--secondary { border-color: var(--ak-border-strong); color: var(--ak-text); background: transparent; }
.saved-list-create-view__actions .button--primary { border-color: var(--ak-brand); color: #fff; background: var(--ak-brand); box-shadow: none; }
.saved-list-selection button:disabled { opacity: 0.5; cursor: not-allowed; }
.saved-list-dialog :focus-visible,
.saved-list-selection :focus-visible { outline: 2px solid var(--ak-brand); outline-offset: 3px; }
.saved-list-notice { display: flex; align-items: center; gap: 16px; width: min(440px, calc(100vw - 32px)); padding: 16px; border: 1px solid #146d49; border-radius: var(--ak-radius-sm); color: #222; background: #fff; font-size: 14px; }
.saved-list-notice[role="alert"] { border-color: #b3293e; }
.saved-list-notice p { margin: 0; line-height: 1.5; }
.saved-list-notice button { min-width: 42px; min-height: 42px; flex: 0 0 auto; padding: 0; border: 0; color: #222; background: transparent; font-size: 24px; cursor: pointer; }

@media (max-width: 480px) {
    .saved-list-selection { padding: 24px 16px; }
    .saved-list-selection__header,
    .saved-list-create-view__header { margin-bottom: 20px; }
    .saved-list-selection__row { gap: 12px; }
}

@media (max-height: 480px) {
    .saved-list-selection { padding-block: 24px; }
}

.saved-assets-workspace { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; }
.saved-assets-workspace > * { min-width: 0; }
.saved-assets-navigation { display: flex; flex-direction: column; gap: 8px; }
.saved-assets-workspace h2 { margin: 0 0 16px; font-size: 20px; line-height: 1.4; }
.saved-assets-navigation > a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; padding: 10px 12px; border-radius: var(--ak-radius-sm); font-size: 14px; }
.saved-assets-navigation > a span:first-child { overflow-wrap: anywhere; }
.saved-assets-navigation > a[aria-current="page"] { background: #eef1ff; color: #3858c9; }
.saved-assets-navigation summary,
.saved-assets-management summary { min-height: 42px; padding-block: 10px; font-size: 14px; cursor: pointer; }
.saved-assets-navigation form,
.saved-assets-management form { display: grid; gap: 16px; padding-block: 16px; }
.saved-assets-navigation label,
.saved-assets-management label { display: grid; gap: 8px; font-size: 14px; }
.saved-assets-navigation input,
.saved-assets-management input { min-width: 0; width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid #bcbcbc; border-radius: var(--ak-radius-sm); font: inherit; }
.saved-assets-management { margin-bottom: 16px; border-block: 1px solid #e0e0e0; }
.saved-assets-management p { margin: 0; font-size: 14px; }

@media (max-width: 767px) {
    .saved-assets-workspace { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .saved-assets-navigation { padding-bottom: 16px; border-bottom: 1px solid #e0e0e0; }
}
