
/* Accessible confirmation dialog (js/confirm-dialog.js) — replaces native
   confirm() on destructive actions, which cannot be styled and is suppressed
   entirely once a user ticks "prevent additional dialogs". */
.confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.confirm-backdrop[hidden] {
    display: none;
}

.confirm-dialog {
    width: 100%;
    max-width: 26rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: var(--space-5);
}

.confirm-title {
    margin: 0 0 var(--space-2);
    font-size: var(--title);
    color: var(--text-primary);
}

.confirm-message {
    margin: 0 0 var(--space-5);
    color: var(--text-muted);
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
}

/* ===== "Track a novel" dialog =====

   Opened by the mobile FAB and by the command palette's Track action, so it is
   not a mobile-only control despite the `fab-` prefix its markup carries.

   It could not be opened at all. `responsive.css` sets `.fab-modal {
   display: none }` at every width, five places add or remove `fab-modal-open`
   (command-palette.js, _shell/scripts.html, dashboard.html, library.html), and
   no rule ever defined that class. Tapping + did nothing; so did choosing
   Track in the palette. Tracking a novel is the product's primary action.

   The look comes from the `.mobile-more-*` bottom sheet that used to live in
   mobile-nav.css. Redesign §2.5 replaced that popover with this dialog, the
   template was rewritten to `fab-modal-*`, and the stylesheet was not — so the
   design existed the whole time under names nothing rendered. Those rules are
   deleted there and adapted here rather than written afresh.

   `.fab-modal.fab-modal-open` rather than `.fab-modal-open` alone: two classes
   beat the single-class `display: none` in responsive.css on specificity, so
   this does not depend on stylesheet order. */
.fab-modal.fab-modal-open {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: block;
}

.fab-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.fab-modal-content {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 901;
    max-height: 80vh;
    overflow-y: auto;
    padding: var(--space-4) var(--space-4)
             calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
    background: var(--bg-surface, #0F1319);
    border-top: 1px solid var(--border, rgba(255, 255, 255, 0.06));
    border-radius: var(--radius-xl, 16px) var(--radius-xl, 16px) 0 0;
}

/* On a wide screen a sheet welded to the bottom edge reads as a mobile
   artefact, so above the FAB's breakpoint it becomes a centred dialog. */
@media (min-width: 600px) {
    .fab-modal-content {
        left: 50%;
        right: auto;
        bottom: auto;
        top: 15vh;
        width: min(28rem, calc(100vw - 2 * var(--space-4)));
        transform: translateX(-50%);
        border: 1px solid var(--border, rgba(255, 255, 255, 0.06));
        border-radius: var(--radius-xl, 16px);
        box-shadow: var(--shadow-lg);
    }
}

.fab-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
    font-weight: var(--weight-semibold, 600);
    color: var(--text-primary, #EEF0F4);
}

.fab-modal-header h3 {
    margin: 0;
    font-size: var(--h3, 1.125rem);
}

.fab-modal-input {
    display: block;
    width: 100%;
    margin-bottom: var(--space-3);
    padding: var(--space-3);
    color: var(--text-primary, #EEF0F4);
    background: var(--bg-input, #090A0E);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.06));
    border-radius: var(--radius-md, 8px);
    font: inherit;
    font-size: var(--body, 0.9375rem);
}

.fab-modal-input:focus-visible {
    outline: 2px solid var(--accent-primary, #4F8FE0);
    outline-offset: 1px;
}
