/* =========================================================================
   DECKD SHARED MODAL + FLYOUT SYSTEM
   =========================================================================
   One visual language for every modal and dropdown on the site, modelled
   on the Collaborators / Board activity modals that originated in
   board_detail.html (.deckd-modal / .deckd-modal-card). Loaded after
   style.css on every page (see base.html <head>) so it wins the cascade
   without needing !important.

   Palette is intentionally white / black / grey only - no beige or tan.
   Loaded on every page via base.html, so these rules are NOT scoped to
   any one page's body class.
   ========================================================================= */

:root {
    --dm-bg: #ffffff;
    --dm-text: #1f1f1f;
    --dm-text-soft: #5c5c5c;
    --dm-text-faint: #9a9a9a;
    --dm-border: #e5e5e5;
    --dm-border-strong: #dddddd;
    --dm-surface: #f5f5f5;
    --dm-surface-strong: #f0f0f0;
    --dm-scrollbar-thumb: #c4c4c4;
    --dm-scrollbar-thumb-hover: #a8a8a8;
    --dm-backdrop: rgba(31, 31, 31, 0.32);
    --dm-shadow-card: 0 24px 60px rgba(31, 31, 31, 0.22);
    --dm-shadow-flyout: 0 18px 45px rgba(31, 31, 31, 0.14);
    --dm-danger: #b3392c;
    --dm-danger-strong: #952f24;
    --dm-success: #2f7a4f;
    --dm-radius-card: 24px;
    --dm-radius-modal: 14px;
    --dm-radius-pill: 999px;
    --dm-radius-md: 16px;
    --dm-radius-sm: 12px;
    --dm-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* -------------------------------------------------------------------
   Backdrop + card shell
   ------------------------------------------------------------------- */

.deckd-modal {
    display: none;
    position: fixed;
    /* The BACKDROP spans the full viewport (inset 0, not offset past
       the sidebar) so the dimmed overlay covers the sidebar too instead
       of leaving it looking undimmed/switched off while a modal's open.
       The CARD still centres on the area to the right of the sidebar,
       not the screen - done with padding-left instead of shifting the
       box itself, since flexbox centres within the padding box: extra
       left padding == .deckd-sidebar's own width (see style.css) plus
       the same 20px breathing room the other 3 sides get, so the
       centre point comes out identical to insetting the whole box.
       Kept in sync with the sidebar's own 56px mobile breakpoint below. */
    inset: 0;
    padding: 20px 20px 20px 84px;
    /* Some page-local UI (product card menus, the deck editor's
       presentation stage, drag-and-drop ghosts) climbs as high as
       999999 itself, and a couple of legacy ids were already pinned to
       near the true CSS max (2147483000) - sit above ALL of it,
       unconditionally, rather than guess at a value "high enough". */
    z-index: 2147483000;

    align-items: center;
    justify-content: center;

    background: rgba(31, 31, 31, 0);
    cursor: pointer;

    transition: background 0.22s var(--dm-ease);
}

@media (max-width: 700px) {
    .deckd-modal {
        padding-left: 76px;
    }
}

.deckd-modal.is-visible {
    display: flex;
}

.deckd-modal.is-open {
    background: var(--dm-backdrop);
}

/* Legacy per-id rules from the old modal system (e.g. "make sure this
   modal is above sticky search rows", "modal always wins") are still
   sitting in style.css with their own z-index !important, keyed to the
   same element ids this system reuses (the ids were kept on purpose so
   every onclick/JS reference kept working). A plain ".deckd-modal"
   class selector can never outrank an id selector, and !important on
   both sides only means specificity still decides - so those old rules
   silently win and cap real modals back down to 50000-90020 or
   whatever they said, regardless of what's declared above. Repeating
   the id (#id#id is valid CSS and doubles its specificity contribution)
   guarantees this beats ANY single-id legacy rule outright, no matter
   how many extra classes/elements it piles on. Add new ids here
   whenever a new modal is introduced. */
#loginModal#loginModal,
#signupModal#signupModal,
#boardsLoginPromptModal#boardsLoginPromptModal,
#saveLoginPromptModal#saveLoginPromptModal,
#navSectionLoginPromptModal#navSectionLoginPromptModal,
#navbarQuickAddAuthPrompt#navbarQuickAddAuthPrompt,
#navbarBoardOnlyModal#navbarBoardOnlyModal,
#navbarCreateDeckModal#navbarCreateDeckModal,
#deleteModal#deleteModal,
#saveProductModal#saveProductModal,
#editBoardModal#editBoardModal,
#budgetComboModal#budgetComboModal,
#collaboratorsModal#collaboratorsModal,
#confirmInviteModal#confirmInviteModal,
#boardActivityModal#boardActivityModal,
#profilePictureModal#profilePictureModal,
#accountDetailsModal#accountDetailsModal,
#changePasswordModal#changePasswordModal,
#deleteAccountModal#deleteAccountModal,
#unblockUserModal#unblockUserModal,
#createBoardModal#createBoardModal,
#recentLoginsModal#recentLoginsModal,
#deckSlideDeleteModal#deckSlideDeleteModal,
#deckDuplicateProductModal#deckDuplicateProductModal,
#deckProductPickerModal#deckProductPickerModal,
#boardDeleteModal#boardDeleteModal,
#deckDeleteModal#deckDeleteModal,
#editDeckModal#editDeckModal,
#filterModal#filterModal,
#addProductFinishModal#addProductFinishModal,
#editProductFinishModal#editProductFinishModal,
#createDeckModal#createDeckModal {
    z-index: 2147483000 !important;
}

/* The "view product" modal (see openProductDetailModal in base.html)
   can itself trigger a second modal on top of it - Save, the kebab
   menu's Delete, Create board from Save, etc. - all of which live in
   the fetched product_detail markup and share the same top-of-stack
   z-index as every other modal above. Tied z-index falls back to DOM
   order, and #productDetailModal sits later in base.html's markup than
   those page-level modals, so it would silently paint over them. Pin
   it one below the shared max instead, so anything opened on top of
   it always wins regardless of DOM order. */
#productDetailModal#productDetailModal {
    z-index: 2147482999 !important;
}

/* Centre in the area below the top navbar, not the true viewport centre -
   extra top padding (on top of the base .deckd-modal rule's flat 20px)
   pushes the flex-centred card down by exactly half the navbar's own
   height, landing it on the vertical centre of the space underneath the
   navbar instead of sitting too high. --deckd-navbar-height is measured
   live in base.html (updateDeckdNavbarHeightVar) since the navbar's actual
   height varies by breakpoint (it wraps to two rows on narrow widths);
   76px fallback matches its usual desktop height for the instant before
   that JS runs. */
/* Same idea at the bottom: on phones/tablets the sidebar is a floating pill
   along the bottom edge, so --deckd-bottom-bar-height (measured live in
   base.html, 0 on desktop) is added as bottom padding too, which centres the
   card between the navbar and that pill instead of letting it sit too low. */
#productDetailModal {
    padding-top: calc(20px + var(--deckd-navbar-height, 76px)) !important;
    padding-bottom: calc(20px + var(--deckd-bottom-bar-height, 0px)) !important;
}

/* Almost all of product_detail.html's own CSS is written as
   ".detail-page .detail-card ..." (ancestor-scoped), so
   openProductDetailModal keeps the .detail-page wrapper in the
   injected markup purely so that CSS still matches - it strips every
   other child out first, leaving only .detail-card inside it. What's
   left of .detail-page's OWN styling (min-height/max-width/margin/
   padding meant for a standalone page) is neutralised here so only
   the card itself shows, not a second "page" nested in the modal. */
#productDetailModalContent .detail-page {
    min-height: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* No modal chrome around the product card itself - the card already
   draws its own background/radius/shadow (see .detail-card in
   style.css), so the outer .deckd-modal-card here is stripped down to
   a plain, invisible sizing box: no padding (so there's no gap/
   whitespace between the modal edge and the card), no background/
   shadow of its own (would double up with the card's), radius matched
   to the card's so the two don't show a mismatched corner. */
/* overflow-y stays "auto" (inherited from the base .deckd-modal-card
   rule), not "hidden" - on a short/zoomed-in browser window, 80vh (the
   base rule's own max-height) can end up shorter than the card's own
   520px height, and "hidden" here silently sliced "View item" in half
   with no way to reach it. auto keeps the card's fixed size/proportions
   untouched and just lets the whole thing scroll a little in that
   edge case instead of clipping content unreachably. */
#productDetailModal .deckd-modal-card {
    padding: 0;
    background: transparent;
    box-shadow: none;
    border-radius: var(--dm-radius-modal);
}

#productDetailModalContent,
#productDetailModalContent .detail-page {
    height: 100%;
}

/* =========================================================
   PRODUCT MODAL — visual redesign
   Reuses this file's own tokens/scale wherever there's a direct
   equivalent elsewhere on the site, so the card reads as part of the
   same system instead of its own one-off design:
     - title weight/size matches .deckd-modal-header h2 (800 / 22px)
     - brand label matches .deckd-field label (12px/700/uppercase/soft)
     - notes matches .deckd-modal-subtitle (14px/soft)
     - "View item" matches .deckd-btn-primary (pill, 700/14px, black)
     - kebab/save match the 34px circular icon buttons used for
       notifications/account in the top navbar
   Every piece keeps a fixed position regardless of title length: the
   title is line-clamped, the action row lives outside the scrolling
   info column entirely, and the "View item" button is pinned to the
   column's bottom edge via margin-top:auto rather than following
   whatever content happens to be above it.
   ========================================================= */

/* Fixed card height, independent of the title/notes length - the
   image fills that height completely (height:100%, not the fixed px
   value style.css normally gives it) and the info column scrolls
   internally instead of growing the card if its content doesn't fit.
   grid-template-rows is the part that actually enforces this: .detail-card
   is a grid with no explicit row track, so by default the row still
   auto-sizes to whatever its tallest child's content needs regardless
   of the height set above - card and children overflow past the
   height silently (clipped by .detail-card's own overflow:hidden,
   which is how "View item" ended up invisible below the fold rather
   than visibly cut off). Locking the row itself to 100% forces every
   child to actually stretch/clip to the fixed height instead. */
/* Modal itself is a bit wider than the shared .deckd-modal-card-xwide
   default (800px) - the image column needs the extra width so a
   roughly-square product photo isn't cropped down to a narrow sliver
   (see the image-column ratio below). */
#productDetailModal .deckd-modal-card {
    max-width: 860px;
}

#productDetailModalContent .detail-card {
    /* min() instead of a flat 520px - .deckd-modal-card's own
       max-height:80vh means a short or zoomed-in browser window can
       give the card less than 520px of room to begin with; without
       this it just overflowed that shorter box (the overflow:auto
       fallback above means it's scrollable now rather than clipped,
       but shrinking to fit first means the common case never needs
       scrolling to see "View item" at all). */
    height: min(
        520px,
        74vh,
        calc(100vh - var(--deckd-navbar-height, 76px) - var(--deckd-bottom-bar-height, 0px) - 40px)
    ) !important;
    /* Something else in this cascade computes .detail-card's display to
       flex inside the modal specifically (the base .detail-card rule in
       style.css says grid, with no !important, and no rule found by
       searching either stylesheet's selectors sets flex on it directly -
       whatever's winning isn't a plain class-selector match) - forcing it
       back to grid here, at this rule's own !important + id-scoped
       specificity, is what actually makes the column sizing below take
       effect at all. Confirmed by testing: without this line the image
       silently stretches to the full card width (flex's default
       behaviour) regardless of the grid-template-columns/aspect-ratio
       setup, even though DevTools reports the rule as "winning". */
    display: grid !important;
    /* Image column is sized to its own content (auto) instead of a
       fixed fraction of the card's width (was 1.2fr/0.8fr, which
       floated free of the row height above and landed on a ~516x520
       box - not quite square, and increasingly less square the more
       74vh shrunk it - so object-fit:cover cropped more than the full
       product_detail.html page does for the exact same photo). The
       <img> below is height:100% + aspect-ratio:1/1 with width:auto,
       so it always resolves to an exact square derived from whatever
       height min(520px, 74vh) computes to, and this auto column just
       matches that. That mirrors the ~1:1 canvas
       add_product.html/edit_product.html actually bake the saved
       photo out to (see outputWidth/outputHeight there, sized off the
       ~460x460 edit panel) - the same reason the full page's own
       image box (.detail-page .detail-card > img in style.css)
       resolves to ~460x460 and barely needs to crop anything either. */
    /* Explicit square column (same size as the card's height), capped at
       60% of the card, rather than "auto" - an auto column is sized from
       the <img>'s content, and Safari/iPad resolves that from the photo's
       natural width for some photos (large or wide ones), blowing the
       column out so the info column was pushed off the card and clipped,
       leaving only the photo. */
    grid-template-columns: minmax(0, min(520px, 74vh, 60%, calc(100vh - var(--deckd-navbar-height, 76px) - var(--deckd-bottom-bar-height, 0px) - 40px))) minmax(0, 1fr) !important;
    grid-template-rows: 100% !important;
    border-radius: var(--dm-radius-modal) !important;
    box-shadow: none !important;
    background: #ffffff !important;
}

#productDetailModalContent .detail-card > img {
    height: 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    max-height: none !important;
    object-fit: cover !important;
    border-radius: var(--dm-radius-modal) 0 0 var(--dm-radius-modal) !important;
}

/* Action row: back/close pill floats on the photo (frosted glass,
   matching the notifications/currency dropdowns' own frosted look);
   kebab + save align with the info column's right padding instead of
   floating over the image, so they read as part of the card's content
   rather than a page-chrome overlay. Fixed top/left/right - never
   affected by title length since it isn't part of the info column at
   all. */
/* Right inset matches the left (18px each) so the save button sits the
   same distance from the modal's right edge as the back pill does from
   the left - there's no longer a separate X button on the right to
   clear (the back pill doubles as close now), so the old wider 32px
   inset that used to make room for it is gone too. */
#productDetailModalContent .detail-card-button-row {
    top: 18px !important;
    left: 18px !important;
    right: 18px !important;
}

/* Back pill restored to its original icon+label look (just resized to
   the same 34px visual height as the kebab/save circles beside it,
   instead of its old, taller inset). Still doubles as the modal's
   close button (see handleProductDetailBackClick in base.html). */
#productDetailModalContent .detail-back,
#productDetailModalContent a.product-detail-back-link {
    height: 34px !important;
    min-height: 34px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 0 14px !important;
    margin: 0 !important;
    gap: 6px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(16px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
    border-radius: 999px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14) !important;

    color: #1f1f1f !important;
}

#productDetailModalContent .detail-back:hover,
#productDetailModalContent a.product-detail-back-link:hover {
    background: rgba(255, 255, 255, 0.92) !important;
    color: #1f1f1f !important;
}

#productDetailModalContent .detail-back svg,
#productDetailModalContent a.product-detail-back-link svg {
    width: 15px !important;
    height: 15px !important;
    flex: 0 0 auto !important;
}

#productDetailModalContent .product-detail-back-label {
    display: block !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

#productDetailModalContent .detail-top-actions {
    gap: 8px !important;
}

#productDetailModalContent button.detail-menu-button {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    background: #f5f5f5 !important;
    border: none !important;
    border-radius: 50% !important;
    box-shadow: none !important;

    color: #1f1f1f !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
}

#productDetailModalContent button.detail-menu-button:hover {
    background: #eeeeee !important;
}

#productDetailModalContent .detail-save-button {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    background: #f5f5f5 !important;
    border: none !important;
    border-radius: 50% !important;
    box-shadow: none !important;

    /* Hides the "Save"/"Saved" text node so only the icon shows,
       without touching the markup - the button keeps its accessible
       name via aria-label below. position:relative + the icon's own
       absolute centring (below) keeps the icon dead-centre regardless
       of that now-invisible text node's box, which line-height/
       font-size:0 alone didn't fully neutralise. */
    position: relative !important;
    font-size: 0 !important;
    line-height: 0 !important;
}

#productDetailModalContent .detail-save-button:hover {
    background: #eeeeee !important;
    transform: none !important;
}

#productDetailModalContent .detail-save-button-icon {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;

    width: 16px !important;
    height: 16px !important;
    /* Dark grey (matches --dm-text-soft, this file's own "secondary
       text" tone), not black - visually a step lighter than the
       kebab/back buttons beside it. */
    color: var(--dm-text-soft) !important;
    stroke: var(--dm-text-soft) !important;
}

#productDetailModalContent .detail-save-button.saved-label {
    background: #1f1f1f !important;
}

#productDetailModalContent .detail-save-button.saved-label .detail-save-button-icon {
    color: #ffffff !important;
    stroke: #ffffff !important;
    fill: #ffffff !important;
}

/* Info column: fixed height, top-anchored (not vertically centred) so
   a tall title/notes block grows downward from underneath the action
   row instead of centring and pushing "View item" out of view -
   overflow-y:auto lets it scroll internally on the rare product where
   everything still doesn't fit, rather than clipping invisibly. */
#productDetailModalContent .detail-info {
    height: 100%;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    padding: 72px 32px 32px !important;
    overflow-y: auto;
    box-sizing: border-box;
}

/* Title: same weight/size as every modal's own h2 (.deckd-modal-header
   h2), just left-aligned instead of centred - clamped to 3 lines so a
   long title can never grow the card or push the rest of the column
   down, matching "locked in place regardless of title length". */
#productDetailModalContent .detail-info h1 {
    /* 40px below the title, as on the full item page (18px padding + 22px
       margin there): the price and brand sit at least this far under the
       last line, so a three-line title never crowds them. */
    margin: 0 0 40px !important;
    /* The whole title always shows - never cut short with "..." - and the
       price and brand simply sit lower for a longer one (the column
       scrolls if it ever outgrows the card; "View item" stays pinned at
       the bottom). The pop-up keeps the full page's .detail-page wrapper,
       whose h1 rules add 18px of bottom padding, so that's undone here. */
    display: block !important;
    -webkit-line-clamp: unset !important;
    padding-bottom: 0 !important;
    overflow: visible !important;
    font-family: var(--card-title-font) !important;
    font-size: 24px !important;
    font-weight: 400 !important;
    line-height: 1.3 !important;
    letter-spacing: normal !important;
    color: var(--dm-text) !important;
}

#productDetailModalContent .detail-price {
    margin: 0 0 14px !important;
    font-size: 19px !important;
    font-weight: 800 !important;
    color: var(--dm-text) !important;
}

/* Brand label: identical scale to .deckd-field label elsewhere in
   this file (12px/700/uppercase/soft), so "brand" reads exactly like
   every other field label on the site. */
#productDetailModalContent .detail-meta {
    margin: 0 0 16px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
}

#productDetailModalContent .detail-meta span {
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    color: var(--dm-text-faint) !important;
}

#productDetailModalContent .detail-meta strong {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--dm-text) !important;
}

#productDetailModalContent .detail-notes {
    margin: 0 0 20px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: var(--dm-text-soft) !important;
}

/* "View item": same pill/700/14px look as .deckd-btn-primary used by
   every modal's own primary action - margin-top:auto pins it to the
   bottom of the column regardless of how much (or little) content sits
   above it, so it never drifts with title length. */
#productDetailModalContent .shop-button {
    margin-top: auto !important;
    align-self: flex-start !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;

    height: 40px !important;
    padding: 0 24px !important;
    border-radius: var(--dm-radius-pill) !important;

    background: var(--dm-text) !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;

    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    text-decoration: none !important;

    transition: background 0.15s ease !important;
}

#productDetailModalContent .shop-button:hover {
    background: #333333 !important;
}

.deckd-modal-card {
    position: relative;

    width: 100%;
    max-width: 440px;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    box-sizing: border-box;

    /* Symmetric on purpose - centred headers/buttons/text need the left
       and right padding to actually match, or everything reads as
       shifted a few px off the card's true centre. (An earlier version
       reserved extra space on the right for scrollbar-gutter: stable;
       that's gone now - worth a few px of reflow on the rare modal that
       actually scrolls, in exchange for correct centring everywhere.) */
    padding: 28px 32px;

    background: var(--dm-bg);
    border-radius: var(--dm-radius-modal);
    box-shadow: var(--dm-shadow-card);

    cursor: default;

    opacity: 0;
    transform: translateY(16px) scale(0.96);
    transition: opacity 0.22s var(--dm-ease), transform 0.22s var(--dm-ease);

    scrollbar-width: thin;
    scrollbar-color: var(--dm-scrollbar-thumb) transparent;
}

.deckd-modal.is-open .deckd-modal-card {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.deckd-modal-card::-webkit-scrollbar { width: 6px; }
.deckd-modal-card::-webkit-scrollbar-track { background: transparent; }
.deckd-modal-card::-webkit-scrollbar-thumb { background: var(--dm-scrollbar-thumb); border-radius: 8px; }
.deckd-modal-card::-webkit-scrollbar-thumb:hover { background: var(--dm-scrollbar-thumb-hover); }

/* Size variants - pick the smallest that comfortably fits the content */
.deckd-modal-card-narrow { max-width: 360px; }
.deckd-modal-card-wide { max-width: 620px; }
.deckd-modal-card-xwide { max-width: 800px; }

/* -------------------------------------------------------------------
   Header: title + floating circular close button
   ------------------------------------------------------------------- */

.deckd-modal-header {
    /* Centred on the CARD'S full width, not just the space left over
       after the close button - the button is taken out of flow
       (position: absolute below) so it never actually competes for
       room here; reserving padding-right for it just skewed the
       centre point left for no reason. */
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
}

.deckd-modal-header h1,
.deckd-modal-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: var(--dm-text);
    line-height: 1.25;
    text-align: center;
}

.deckd-modal-close {
    /* Pinned to the card's own top-right corner, independent of
       everything else in the card - it's position: absolute against
       .deckd-modal-card (the nearest positioned ancestor), not a flex
       child of .deckd-modal-header, so nothing that centres the
       header/buttons/labels can ever move it. Equal top/right inset now
       that the card's padding is symmetric (see .deckd-modal-card) -
       there's no longer a lopsided scrollbar-gutter reservation to
       compensate for on one side only. */
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;

    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;

    background: var(--dm-surface-strong);
    border: none;
    border-radius: 50%;

    color: var(--dm-text);
    cursor: pointer;
    transition: background 0.15s ease;
}

.deckd-modal-close:hover {
    background: var(--dm-border-strong);
}

.deckd-modal-close svg {
    width: 15px;
    height: 15px;
}

.deckd-modal-subtitle {
    margin: 6px 0 20px;
    font-size: 14px;
    color: var(--dm-text-soft);
    line-height: 1.45;
    text-align: center;
}

.deckd-modal-subtitle:last-child { margin-bottom: 4px; }

/* "You need to log in to see your X" / "...before using Quick Access"
   prompts (navSectionLoginPromptModal, navbarQuickAddAuthPrompt,
   boardsLoginPromptModal, saveLoginPromptModal) - smaller and lighter
   than a regular modal subtitle so it reads as a quiet explainer under
   the title rather than competing with it. */
.deckd-modal-subtitle-prompt {
    font-size: 12.5px;
    font-weight: 400;
}

/* Edit details (account.html): field labels (Username, Email, First
   name, Last name) sit left-aligned above their inputs rather than
   centred like a normal modal field label - same treatment as
   #filterModal's own field labels below. */
#accountDetailsModal .deckd-field label {
    text-align: left;
}

.deckd-modal-card .message {
    margin: 0 0 16px;
    text-align: center;
}

/* -------------------------------------------------------------------
   Generic scroll utility - drop on any inner list/panel that scrolls
   independently of the card itself (search results, activity tables,
   product pickers, etc.) for the same thumb styling everywhere.
   ------------------------------------------------------------------- */

.deckd-scroll {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--dm-scrollbar-thumb) transparent;
}
.deckd-scroll::-webkit-scrollbar { width: 6px; }
.deckd-scroll::-webkit-scrollbar-track { background: transparent; }
.deckd-scroll::-webkit-scrollbar-thumb { background: var(--dm-scrollbar-thumb); border-radius: 8px; }
.deckd-scroll::-webkit-scrollbar-thumb:hover { background: var(--dm-scrollbar-thumb-hover); }

/* -------------------------------------------------------------------
   Form fields (label + input + helper text)
   ------------------------------------------------------------------- */

.deckd-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.deckd-field:last-of-type { margin-bottom: 0; }

.deckd-field label {
    font-size: 12px;
    font-weight: 700;
    color: var(--dm-text-soft);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: center;
}

.deckd-field input,
.deckd-field select,
.deckd-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;

    background: var(--dm-surface);
    border: 1px solid var(--dm-border-strong);
    border-radius: 14px;

    color: var(--dm-text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;

    transition: border-color 0.15s ease, background 0.15s ease;
}

.deckd-field textarea { resize: vertical; min-height: 80px; }

.deckd-field input:focus,
.deckd-field select:focus,
.deckd-field textarea:focus {
    outline: none;
    border-color: var(--dm-text);
    background: var(--dm-bg);
}

.deckd-field input::placeholder,
.deckd-field textarea::placeholder {
    color: var(--dm-text-faint);
}

.deckd-field-hint {
    margin: 0;
    font-size: 12px;
    color: var(--dm-text-faint);
    line-height: 1.4;
    text-align: center;
}

.deckd-field-hint.is-error { color: var(--dm-danger); }
.deckd-field-hint.is-success { color: var(--dm-success); }

/* Sits directly under the password input it belongs to (a child of
   that field's own .deckd-field, not a separate row) - align-self
   pulls it to the right edge of the field without stretching to the
   input's full width like a normal flex child would. */
.deckd-forgot-password-link {
    align-self: flex-end;
    margin-top: -2px;
    padding: 0;

    background: none;
    border: none;

    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--dm-text-soft);

    cursor: pointer;
}

.deckd-forgot-password-link:hover {
    color: var(--dm-text);
    text-decoration: underline;
}

/* -------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------- */

.deckd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 12px 20px;
    border-radius: var(--dm-radius-pill);
    border: 1px solid transparent;

    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;

    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.deckd-btn:active { transform: scale(0.97); }
.deckd-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.deckd-btn-primary {
    background: var(--dm-text);
    color: #ffffff;
}
.deckd-btn-primary:hover { background: #333333; }

.deckd-btn-secondary {
    background: transparent;
    border-color: var(--dm-border-strong);
    color: var(--dm-text-soft);
}
.deckd-btn-secondary:hover {
    background: var(--dm-surface-strong);
    border-color: var(--dm-text);
    color: var(--dm-text);
}

.deckd-btn-danger {
    background: var(--dm-danger);
    color: #ffffff;
}
.deckd-btn-danger:hover { background: var(--dm-danger-strong); }

.deckd-btn-block { width: 100%; }

.deckd-modal-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.deckd-modal-actions-row {
    flex-direction: row;
}

/* Lighter-weight action for a secondary path that shouldn't visually
   compete with the modal's real primary button (e.g. "Save to a new
   board" sitting under "Save to board") - a plain text link rather than
   a second full pill button, so the hierarchy between "the action" and
   "the alternate path" stays obvious at a glance. */
.deckd-btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    width: 100%;
    padding: 4px;
    background: none;
    border: none;

    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--dm-text-soft);

    cursor: pointer;
    transition: color 0.15s ease;
}

.deckd-btn-link:hover {
    color: var(--dm-text);
    text-decoration: underline;
}

/* =========================================================================
   DIALOG LAYER - quiet, Claude-style modals
   =========================================================================
   Restyles every .deckd-modal on top of the base rules above, in the
   same calm language as the account dropdown and auth modals:

     - left-aligned 18px/600 title, one scale for every modal (the old
       per-modal 16px/18px/22px title overrides were removed)
     - ghost close button, left-aligned grey subtitle
     - sentence-case labels, white inputs with a soft focus ring
     - compact 8px-radius buttons in a centred row, main action on the
       right ([Cancel] [Save]); stacked full-width on phones

   Every modal's markup lists its primary button FIRST, then the
   secondary/cancel one, so row-reverse gives the Cancel-then-action
   order without touching any template.

   Buttons and fields are scoped to .deckd-modal because .deckd-btn /
   .deckd-field are also used for page-level buttons (home, friends,
   editor toolbars) that keep their pill look. */

.deckd-modal.is-open {
    background: rgba(20, 20, 20, 0.36);
}

.deckd-modal-card {
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 20px 50px rgba(0, 0, 0, 0.18);
    transform: translateY(8px) scale(0.98);
}

.deckd-modal-card-narrow {
    max-width: 400px;
}

/* Header: left-aligned title, room on the right for the close button */
.deckd-modal-header {
    align-items: center;
    justify-content: flex-start;
    min-height: 28px;
    margin-bottom: 20px;
    padding-right: 36px;
}

.deckd-modal-header h1,
.deckd-modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
    text-align: left;
}

/* A subtitle sits tight under the title, then the full gap before the
   body - modals without one keep the header's own 20px gap instead. */
.deckd-modal-header + .deckd-modal-subtitle {
    margin-top: -14px;
}

.deckd-modal-close {
    top: 22px;
    right: 20px;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: transparent;
    color: var(--dm-text-faint);
    transition: background 0.12s ease, color 0.12s ease;
}

.deckd-modal-close:hover {
    background: var(--dm-surface);
    color: var(--dm-text);
}

.deckd-modal-close svg {
    width: 16px;
    height: 16px;
}

.deckd-modal-subtitle,
.deckd-modal-subtitle-prompt {
    margin: 0 0 20px;
    color: var(--dm-text-soft);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
}

.deckd-modal-subtitle:last-child {
    margin-bottom: 0;
}

.deckd-modal-card .message {
    margin: 0 0 16px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--dm-surface);
    font-size: 13px;
    text-align: left;
}

/* Fields */
.deckd-modal .deckd-field {
    gap: 6px;
    margin-bottom: 16px;
}

.deckd-modal .deckd-field label {
    color: var(--dm-text);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    text-align: left;
    text-transform: none;
}

.deckd-modal .deckd-field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
.deckd-modal .deckd-field select,
.deckd-modal .deckd-field textarea {
    min-height: 40px;
    padding: 9px 12px;
    background: var(--dm-bg);
    border: 1px solid #d9d9d9;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 400;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.deckd-modal .deckd-field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):hover,
.deckd-modal .deckd-field select:hover,
.deckd-modal .deckd-field textarea:hover {
    border-color: #c2c2c2;
}

.deckd-modal .deckd-field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):focus,
.deckd-modal .deckd-field select:focus,
.deckd-modal .deckd-field textarea:focus {
    background: var(--dm-bg);
    border-color: var(--dm-text);
    box-shadow: 0 0 0 3px rgba(31, 31, 31, 0.07);
}

.deckd-modal .deckd-field-hint {
    text-align: left;
}

.deckd-modal .deckd-forgot-password-link {
    color: var(--dm-text-faint);
    font-size: 12.5px;
    font-weight: 500;
}

/* Buttons */
.deckd-modal .deckd-btn {
    min-height: 36px;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.deckd-modal .deckd-btn:active {
    transform: scale(0.98);
}

.deckd-modal .deckd-btn-primary {
    background: var(--dm-text);
    border-color: transparent;
    color: #ffffff;
}

.deckd-modal .deckd-btn-primary:hover {
    background: #333333;
}

.deckd-modal .deckd-btn-secondary {
    background: var(--dm-bg);
    border-color: #d9d9d9;
    color: var(--dm-text);
}

.deckd-modal .deckd-btn-secondary:hover {
    background: var(--dm-surface);
    border-color: #c2c2c2;
    color: var(--dm-text);
}

.deckd-modal .deckd-btn-link {
    font-weight: 500;
}

/* Action row: centred, [secondary] [primary] */
.deckd-modal .deckd-modal-actions {
    flex-direction: row-reverse;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.deckd-modal .deckd-modal-actions .deckd-btn-block {
    width: auto;
}

@media (max-width: 480px) {
    .deckd-modal-card {
        padding: 20px;
    }

    .deckd-modal-close {
        top: 18px;
        right: 16px;
    }

    .deckd-modal .deckd-modal-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .deckd-modal .deckd-modal-actions .deckd-btn-block {
        width: 100%;
    }

    .deckd-modal .deckd-modal-actions .deckd-btn {
        min-height: 40px;
    }
}

/* =========================================================
   SAVE ITEM MODAL
   Card sizing/layout matches the Create-a-deck modal (see the
   "Create-deck modal: board picker" section in style.css) - its board
   picker is now the same visual grid, just without a "start blank"
   option, so the two modals should read as the same component. The
   picker's own scroll area sits inside .deckd-scroll (style.css); the
   old overflow:visible here was for the dropdown flyout the picker
   used to be, no longer needed now that it's an inline grid.
   ========================================================= */
#saveProductModal .deckd-modal-card {
    max-width: 400px;
    max-height: calc(100vh - 48px);
    padding: 32px;

    display: flex;
    flex-direction: column;

    overflow: hidden;
    text-align: left;
}

#saveProductModal #saveProductFormFields {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* style.css's "#saveProductFormFields button { width: 100% }" is meant
   for the board picker's option rows - keep the Save button itself
   compact and right-aligned like every other modal's action row. The
   picker shrinks to its own content (still capped at 320px and
   scrolling) instead of always reserving the full 320px, which left a
   big empty gap above the button with only a board or two. */
#saveProductFormFields .deckd-modal-actions .deckd-btn {
    width: auto;
}

#saveProductModal .deck-board-picker {
    flex: 0 1 auto;
}

@media (max-width: 480px) {
    #saveProductFormFields .deckd-modal-actions .deckd-btn {
        width: 100%;
    }
}

/* =========================================================
   EDIT ITEM "Finish item" MODAL
   ========================================================= */
#editProductFinishModal .deckd-modal-card {
    overflow: visible;
}

/* Quieter "Category" field label to match the toned-down title above.
   style.css's "html body .add-product-template-page label" sets 13px/800
   with !important, so this needs !important + the same html/body prefix
   to win. Scoped to the modal so the page's other field labels are
   untouched. */
html body #addProductFinishModal .deckd-field label,
html body #editProductFinishModal .deckd-field label {
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px !important;
}

/* Smaller "Show on Explore" row to sit level with the trimmed title and
   category label - style.css sizes both the row (14px/700) and its
   custom tickbox (20px) with !important. */
html body #addProductFinishModal .add-product-public-choice,
html body #editProductFinishModal .add-product-public-choice {
    font-size: 12px !important;
    font-weight: 600 !important;
    gap: 8px !important;
}

html body #addProductFinishModal .add-product-public-choice input[type="checkbox"],
html body #editProductFinishModal .add-product-public-choice input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    border-radius: 5px !important;
}

html body #addProductFinishModal .add-product-public-choice input[type="checkbox"]:checked::after,
html body #editProductFinishModal .add-product-public-choice input[type="checkbox"]:checked::after {
    width: 4px !important;
    height: 7px !important;
}

/* =========================================================
   COMPACT DROPDOWN
   Opt-in variant of the site's shared .custom-select pill/flyout
   component (see add_product.html) - the component's own default
   sizing (style.css) is tuned for a standalone page form (54px pill,
   big rounded corners), which reads as oversized inside a modal's much
   smaller card. Add this class alongside .custom-select wherever a
   board/category picker lives inside a modal instead (currently: the
   Add/Edit Item "Finish item" modals' category - and, for Add, board -
   pickers; the Save Item modal's own board picker used to be one of
   these too, before it switched to the visual board-picker grid it
   now shares with the Create-a-deck modal, see "Create-deck modal:
   board picker" in style.css) to match that card's own scale
   (.deckd-field inputs, .deckd-btn) instead.

   Needs to out-specificity style.css's own "html body .custom-select-*"
   !important rules, hence the repeated ancestor selector + !important
   here too.

   The component's option list is an absolutely-positioned overlay -
   .deckd-modal-card clips overflow by default (see the base rule
   above), which would silently cut the flyout off for any modal whose
   content is always short/fixed-size and never genuinely needs to
   scroll internally (see the per-modal overflow:visible rules above/
   below - opted in per modal rather than assumed here, since a couple
   of modals using this class, namely Add Item's own finish modal, have
   enough other content that they legitimately might need to scroll).
   ========================================================= */
html body .deckd-compact-select .custom-select-button {
    height: 42px !important;
    padding: 0 38px 0 14px !important;
    border-radius: 12px !important;
    background-color: var(--dm-surface) !important;
    font-size: 14px !important;
    font-weight: 700 !important;

    /* Real chevron icon (same path as .menu-export-chevron elsewhere on
       the site) instead of the shared component's Unicode "⌄" glyph -
       that glyph's own font metrics sit a few px above true centre and
       vary by platform font, which read as "floating" rather than
       centred in this button's now-shorter 42px height. A background
       image is immune to both problems and needs no markup change. */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235c5c5c' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 12px 12px !important;
}

/* The shared component draws its arrow via ::after content - suppress
   it here so it doesn't double up with the background-image chevron
   above. */
html body .deckd-compact-select .custom-select-button::after {
    content: none !important;
}

html body .deckd-compact-select.custom-select.is-open .custom-select-button {
    background-color: #ffffff !important;
    /* Points up while the list is open, same visual cue as any other
       expand/collapse chevron on the site. */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f1f1f' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 15l6-6 6 6'%3E%3C/path%3E%3C/svg%3E") !important;

    /* style.css's own ".custom-select.is-open .custom-select-button" rule
       (3 classes) sets "background: #ffffff" as a shorthand, which resets
       repeat/position/size to their defaults (tiled, top-left, auto) -
       at higher specificity than this file's non-open background-repeat/
       position/size rule (2 classes) for those specific sub-properties,
       even though this rule's own higher specificity (4 classes) wins
       for background-image/color above. Left unset, the open state's
       chevron tiled across the whole button instead of sitting once on
       the right - restating all three here (matching the closed-state
       values) is what actually keeps it a single icon while open. */
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 12px 12px !important;
}

/* Capped to exactly 4 options tall (4 × the 36px row height below, plus
   this list's own 6px top/bottom padding) instead of growing to fit
   every option - a 9-option list (category) would otherwise stretch
   well past the card/viewport. Scrolls internally past that instead. */
html body .deckd-compact-select .custom-select-list {
    top: calc(100% + 6px) !important;
    padding: 6px !important;
    border-radius: 14px !important;

    max-height: 156px !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    scrollbar-width: thin !important;
    scrollbar-color: var(--dm-scrollbar-thumb) transparent !important;
}

html body .deckd-compact-select .custom-select-list::-webkit-scrollbar {
    width: 6px !important;
}

html body .deckd-compact-select .custom-select-list::-webkit-scrollbar-track {
    background: transparent !important;
}

html body .deckd-compact-select .custom-select-list::-webkit-scrollbar-thumb {
    background: var(--dm-scrollbar-thumb) !important;
    border-radius: 8px !important;
}

html body .deckd-compact-select .custom-select-list button {
    height: 36px !important;
    padding: 0 12px !important;
    border-radius: 9px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

/* -------------------------------------------------------------------
   Dropdown / flyout entrance animation - additive only. These elements
   already show/hide via a class toggle (.open / .is-open / .is-visible),
   this just gives that transition a subtle fade + lift instead of a
   hard cut. Exit is intentionally instant (matches how lightweight
   menus behave almost everywhere) - only real modals get a full
   animated close, via .deckd-modal above.
   ------------------------------------------------------------------- */

@keyframes deckdFlyIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Same fade-and-lift as deckdFlyIn above, but with a translateY(-50%)
   baseline baked into both ends - .deckd-sidebar-dropdown centres
   itself on its button's vertical midpoint (see style.css) rather
   than hanging from its top edge, and the plain deckdFlyIn keyframe
   would overwrite that transform for the animation's duration and
   then leave it un-centred once "to" finishes (fill: both keeps the
   keyframe's own final transform, not the element's own static one). */
@keyframes deckdFlyInCentered {
    from { opacity: 0; transform: translateY(-50%) translateY(-6px) scale(0.98); }
    to { opacity: 1; transform: translateY(-50%) scale(1); }
}

/* product_detail.html normally carries its own tiny inline <style> for
   this (display:none -> block on .is-open) alongside the rest of its
   page content - the "view product" modal (openProductDetailModal in
   base.html) only injects .detail-page itself, not that sibling
   <style> tag, so the same rule is repeated here once, globally, to
   cover the modal case too. */
.detail-menu-wrapper.is-open .detail-menu {
    display: block;
}

.nav-quick-add-menu.open .nav-quick-add-dropdown,
.nav-currency-menu.open .nav-currency-dropdown,
.nav-notifications-menu.open .nav-notifications-dropdown,
.account-dropdown-open .nav-account-dropdown,
.board-tools-dropdown.is-open .board-tools-dropdown-menu,
.boards-owner-sort-dropdown.is-open .boards-owner-sort-menu,
.boards-owner-new-dropdown.is-open .boards-owner-new-menu,
.boards-owner-export-dropdown.is-open .boards-owner-export-menu,
.decks-owner-sort-dropdown.is-open .decks-owner-sort-menu,
.ribbon-dropdown.is-open .ribbon-dropdown-menu,
.ribbon-dropdown-menu.is-open,
.custom-select.is-open .custom-select-list,
.account-currency-menu.open .account-currency-dropdown,
.detail-menu-wrapper.is-open .detail-menu,
.board-menu.is-open,
.deck-menu.is-open,
.deckd-collaborator-search-results.is-visible,
.share-profile-search-results.is-visible,
.budget-saved-dropdown.is-open {
    animation: deckdFlyIn 0.16s var(--dm-ease) both;
}

.deckd-sidebar-quickadd.open .deckd-sidebar-dropdown {
    animation: deckdFlyInCentered 0.16s var(--dm-ease) both;
}

/* =========================================================================
   BOARD "..." MENU > PRIVACY MODAL (#boardPrivacyModal)
   =========================================================================
   Shared by board_detail.html (a single board already on the page) and
   boards.html (opened generically per-tile from _board_tile.html's own
   "..." menu) - identical markup/behaviour in both, so it lives here
   once instead of two near-identical copies.
   ========================================================================= */

/* Three selectable rows (All / Just friends / Only me), same selected/
   unselected checkmark treatment as a radio group but built from plain
   buttons (matches the rest of the site's modal option lists, e.g. the
   collage template picker). */
.board-privacy-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.board-privacy-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;

    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;

    text-align: left;
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease;
}

.board-privacy-option:hover {
    background: #f5f5f5;
}

.board-privacy-option.is-selected {
    background: #f5f5f5;
    border-color: #1f1f1f;
}

.board-privacy-option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.board-privacy-option-text strong {
    font-size: 14px;
    font-weight: 700;
    color: #1f1f1f;
}

.board-privacy-option-text small {
    font-size: 12px;
    color: #9a9a9a;
}

.board-privacy-option-check {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: #1f1f1f;

    opacity: 0;
}

.board-privacy-option.is-selected .board-privacy-option-check {
    opacity: 1;
}

.board-privacy-message {
    min-height: 18px;
    margin: 10px 2px 0;

    font-size: 12px;
    font-weight: 600;
    color: #5c5c5c;
}

/* =========================================================================
   SHARE MODALS (username search + copy-link)
   =========================================================================
   Originally public_profile.html's own #shareProfileModal styling
   (moved here once board_detail.html/boards.html grew an identical
   "share this board" modal - #boardShareModal in each). Class names
   stayed .share-profile-* rather than being renamed to something board-
   neutral, since they're still primarily "share profile" in spirit and
   a rename would touch every call site for no behavioural gain.
   ========================================================================= */

.share-profile-search-wrap {
    position: relative;
}

.share-profile-search-wrap input {
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;

    background: #ffffff;
    border: 1px solid #d9d9d9;
    border-radius: 10px;

    font-family: inherit;
    font-size: 14px;

    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.share-profile-search-wrap input:focus {
    outline: none;
    border-color: #1f1f1f;
    box-shadow: 0 0 0 3px rgba(31, 31, 31, 0.07);
}

/* Mini dropdown card that appears in-flow below the input, exactly
   like the board Collaborators modal's own username search
   (.deckd-collaborator-search-results in board_detail.html) - hidden
   until there's a query, capped height with internal scrolling rather
   than growing the modal card itself. */
.share-profile-search-results {
    display: none;

    margin-top: 6px;

    max-height: 220px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px 10px 6px 6px;
    box-sizing: border-box;

    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(31, 31, 31, 0.08);

    scrollbar-width: thin;
    scrollbar-color: #c4c4c4 #f0f0f0;
}

.share-profile-search-results::-webkit-scrollbar {
    width: 6px;
}

.share-profile-search-results::-webkit-scrollbar-track {
    background: transparent;
}

.share-profile-search-results::-webkit-scrollbar-thumb {
    background: #c4c4c4;
    border-radius: 8px;
}

.share-profile-search-results.is-visible {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.share-profile-result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    padding: 8px;
    border-radius: 10px;
}

/* Same darken-the-whole-row hover as the board Collaborators modal's
   own username search (.deckd-collaborator-search-result). */
.share-profile-result-row:hover {
    background: #f0f0f0;
}

.share-profile-result-person {
    display: flex;
    align-items: center;
    gap: 10px;

    font-weight: 600;
    font-size: 14px;
    color: #1f1f1f;
}

.share-profile-result-avatar {
    width: 32px;
    height: 32px;
    flex: none;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e5e1d8;
    box-sizing: border-box;
    overflow: hidden;

    color: #1f1f1f;
    font-size: 13px;
    font-weight: 700;
}

.share-profile-result-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.share-profile-empty {
    margin: 4px;
    font-size: 13px;
    color: #8a8378;
}

.share-profile-result-row .deckd-btn,
.share-profile-copy-button {
    padding: 6px 14px !important;
    min-height: 0 !important;
    font-size: 12.5px !important;
}

/* White with black text, same as the board Collaborators modal's own
   "add" button (.deckd-collaborator-search-result-invite) - and
   hidden until you're hovering (or keyboard-focused on) this specific
   row, rather than shown on every row all the time. */
.share-profile-result-row .deckd-btn {
    background: #ffffff;
    border: 1px solid #dddddd;
    color: #1f1f1f;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease;
}

.share-profile-result-row:hover .deckd-btn,
.share-profile-result-row .deckd-btn:focus-visible {
    opacity: 1;
    pointer-events: auto;
}

.share-profile-result-row .deckd-btn:hover {
    background: #f0f0f0;
}

/* Separates "search a username" from "copy a link" as two distinct
   ways to share, rather than implying the link row is a continuation
   of the search above it. */
.share-profile-divider {
    display: flex;
    align-items: center;
    gap: 12px;

    margin: 18px 0;

    font-size: 12px;
    font-weight: 500;
    color: #9a9a9a;
}

.share-profile-divider::before,
.share-profile-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #ececea;
}

.share-profile-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: none;

    /* Only load-bearing for anonymous visitors, who never see the
       search section (and its .share-profile-divider) above - keeps
       this row from sitting flush under the modal header for them. */
    margin-top: 8px;
}

.share-profile-link-text {
    flex: 1;
    min-width: 0;

    font-size: 13px;
    color: #6b6459;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Deck editor "Add product slide" picker (deck_detail.html): style.css's
   own .deck-product-picker-modal-card sets width: fit-content so the card
   shrinks to wrap exactly its fixed-width 3-column grid - but this file
   loads after style.css, and the shared .deckd-modal-card base rule above
   sets width: 100% at the same specificity, so it was winning instead and
   stretching the card to fill the whole modal area (leaving the fixed-
   width grid stranded in one corner instead of the card hugging it). */
#deckProductPickerModal .deck-product-picker-modal-card {
    width: fit-content !important;
}

/* =========================================================================
   VIEWER EYE POPOVER CONTENT + "HOW DO YOU WANT TO SHARE THIS?" MINI MODAL
   =========================================================================
   Shared by board_detail.html's Viewer Eye (.viewer-eye-menu popover +
   #viewerIntentVisibilityModal) and product_detail.html's own
   self-contained copy of the same feature (.detail-eye-menu popover +
   #productDetailEyeVisibilityModal - see show_viewer_eye in views.py and
   .detail-eye-wrapper in product_detail.html) - both build the exact
   same popover/mini-modal content under these class names, so it's
   defined once here rather than twice per-template. Each popover's own
   position/frosted-glass shell (.viewer-eye-menu vs product_detail.html's
   reuse of .detail-menu) stays defined locally, since those genuinely
   differ per page layout.
   ========================================================================= */
.viewer-eye-menu-loading {
    margin: 0;
    padding: 8px 6px;
    font-size: 13px;
    color: #8a8378;
}

.viewer-eye-others-heading {
    margin: 10px 6px 6px;
    padding-top: 8px;
    border-top: 1px solid #efebe4;

    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #8a8378;
}

.viewer-eye-others-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 6px;
}

.viewer-eye-avatar {
    position: relative;

    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    background: #f6f2ec;
    overflow: hidden;

    font-size: 12px;
    font-weight: 700;
    color: #6b6459;
    text-decoration: none;
}

.viewer-eye-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Small green "bought" check badge. */
.viewer-eye-avatar-bought::after {
    content: '';
    position: absolute;
    right: -2px;
    bottom: -2px;

    width: 11px;
    height: 11px;

    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #3f9142;
}

/* "How do you want to share this?" mini confirmation - three stacked
   option cards, full-width buttons since there's no icon/visual slot
   to fill here. */
.viewer-intent-visibility-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.viewer-intent-visibility-option {
    display: block;
    width: 100%;

    padding: 12px 14px;

    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: #ffffff;

    text-align: left;
    font-family: inherit;
    cursor: pointer;

    transition: background 0.12s ease, border-color 0.12s ease;
}

.viewer-intent-visibility-option:hover {
    background: #f3f3f2;
    border-color: #d4d4d1;
}

.viewer-intent-visibility-option strong {
    display: block;
    margin-bottom: 2px;

    font-size: 14px;
    font-weight: 700;
    color: #1f1f1f;
}

.viewer-intent-visibility-option small {
    display: block;
    font-size: 12.5px;
    color: #8a8378;
}

/* The confirm step's visibility note (set by viewerIntentVisibilityNote /
   pdViewerIntentVisibilityNote) reads as a sub-clause of the subtitle
   right above it, not a separate paragraph - pull it up tight against
   that line instead of sitting a full subtitle's gap below it. */
#viewerIntentConfirmModal .deckd-modal-subtitle-prompt,
#productDetailEyeConfirmModal .deckd-modal-subtitle-prompt {
    margin-top: -12px;
}

/* product_detail.html's own Viewer Eye button/popover (see
   .detail-eye-wrapper there) - reuses .detail-menu-button for the
   button's circular chrome (already defined above/in style.css) and
   .detail-menu for the popover's card chrome, so only the bits unique
   to this button (its icon size, and the toggle itself, since it uses
   its own wrapper class rather than .detail-menu-wrapper to avoid
   colliding with the kebab menu's own toggleDetailMenu() when both
   are on the page at once) need defining. Kept here rather than in
   product_detail.html's own inline <style> block since that block
   doesn't survive being fetched into #productDetailModalContent (see
   openProductDetailModal in base.html) - only .detail-page's own
   content does, so anything needed in the modal case has to live in a
   globally-loaded stylesheet instead. */
.detail-eye-wrapper {
    position: relative;
}

.detail-eye-wrapper.is-open .detail-eye-menu {
    display: block;
}

.detail-eye-button svg {
    width: 18px;
    height: 18px;
}

/* ---------- Report this item (product card) ---------- */

.detail-report-button svg {
    width: 17px;
    height: 17px;
}

/* Already reported by you: the flag fills in, quietly. */
.detail-report-button.is-reported svg {
    fill: currentColor;
}

html body .detail-page button.detail-report-button.is-reported,
#productDetailModalContent button.detail-report-button.is-reported {
    color: var(--dm-danger) !important;
}

.report-product-reasons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 4px 0 18px;
}

.report-product-reason {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border: 1px solid var(--dm-border);
    border-radius: var(--dm-radius-sm);
    color: var(--dm-text);
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.report-product-reason:hover {
    background: var(--dm-surface);
}

.report-product-reason:has(input:checked) {
    border-color: var(--dm-text);
    box-shadow: 0 0 0 1px var(--dm-text);
}

.report-product-reason input {
    accent-color: var(--dm-text);
    margin: 0;
}

.report-product-optional {
    color: var(--dm-text-faint);
    font-weight: 400;
}

.report-product-error {
    min-height: 0;
    margin: 0;
    color: var(--dm-danger);
    font-size: 13px;
}

.report-product-error:not(:empty) {
    margin: -4px 0 10px;
}

/* Fine-print good-faith line above the Report modal's Send button. */
/* The feedback pop-up's honeypot field (_feedback_modal.html) - kept
   off-screen rather than display:none, which some bots skip. */
.feedback-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.report-product-good-faith {
    margin: 0 0 12px;
    color: var(--dm-text-faint);
    font-size: 12px;
    line-height: 1.45;
}

/* =========================================================================
   FREEHAND MULTI-CLIP IMAGE-CUTOUT TOOL ("clipping station")
   =========================================================================
   Shared by the deck editor's #deckImageCutoutModal and the blank-collage
   canvas's #collageImageCutoutModal — both carry the .deckd-cutout-tool-modal
   class as their CSS hook so this only has to live in one place. No
   dark-mode variant here on purpose, since no other modal in this app has
   one either (single consistent light appearance throughout). */
.deckd-cutout-tool-modal .deckd-modal-card {
    text-align: left;
}

.deckd-cutout-station {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin: 4px 0 10px;
}

.deckd-cutout-stage {
    flex: 1 1 380px;
    min-width: 300px;
}

.deckd-cutout-sidebar {
    flex: 0 0 240px;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (max-width: 700px) {
    .deckd-cutout-station {
        flex-direction: column;
    }

    .deckd-cutout-sidebar {
        flex: 1 1 auto;
        width: 100%;
    }
}

/* Toolbar - a single full-width bar above .deckd-cutout-station (not
   nested inside .deckd-cutout-stage) specifically so Save/Cancel can
   sit on it too, at the far right (.deckd-cutout-toolbar-spacer), and
   so the stage/sidebar columns below it both start from the same top
   edge - previously the stage alone carried this toolbar internally,
   pushing its own canvas down below where the sidebar's preview box
   started, which read as misaligned. */
.deckd-cutout-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 14px;
}

.deckd-cutout-toolbar .deckd-btn {
    padding: 6px 14px;
    font-size: 13px;
}

.deckd-cutout-toolbar-spacer {
    flex: 1 1 auto;
}

.deckd-cutout-toolbar-divider {
    width: 1px;
    height: 22px;
    background: var(--dm-border);
}

/* "Save to favourites" checkbox next to the toolbar's own Save cutout
   button (see saveImageCutout/saveCollageImageCutout) - a plain
   label+checkbox row, styled off this modal's own --dm-* theme vars
   rather than .ribbon-effects-toggle-row's hardcoded colours, since that
   class is tuned for the (always light) ribbon dropdown, not this modal. */
.deckd-cutout-favourite-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;

    border: none;
    border-radius: 7px;
    background: transparent;

    color: var(--dm-text-soft);
    cursor: pointer;
}

.deckd-cutout-favourite-toggle:hover {
    background: var(--dm-bg);
    color: var(--dm-text);
}

.deckd-cutout-favourite-toggle svg {
    width: 16px;
    height: 16px;
}

/* Filled/red once toggled on - same "liked" look the selection overlay's
   own heart button (.slide-favourite-button in style.css) uses when
   flashed, so both read as the same affordance. */
.deckd-cutout-favourite-toggle.is-active {
    color: #e0245e;
}

.deckd-cutout-favourite-toggle.is-active svg {
    fill: currentColor;
}

.deckd-cutout-tool-toggle,
.deckd-cutout-zoom-group {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: var(--dm-surface);
    border-radius: 10px;
}

.deckd-cutout-tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    border-radius: 7px;
    color: var(--dm-text-soft);
    cursor: pointer;
}

.deckd-cutout-tool-btn svg {
    width: 16px;
    height: 16px;
}

.deckd-cutout-tool-btn.is-active {
    background: var(--dm-bg);
    color: var(--dm-text);
    box-shadow: 0 1px 3px rgba(31, 31, 31, 0.15);
}

.deckd-cutout-icon-btn {
    border: none;
    background: transparent;
    min-width: 28px;
    height: 26px;
    padding: 0 8px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--dm-text-soft);
    cursor: pointer;
}

.deckd-cutout-icon-btn:hover {
    background: var(--dm-bg);
    color: var(--dm-text);
}

/* Cutting-plate viewport — a fixed-size clipping window; zoom/pan move the
   canvas element inside it via CSS transform, the canvas's own pixel
   buffer never changes size mid-session (see applyCutoutView in the JS). */
.deckd-cutout-viewport {
    position: relative;
    overflow: hidden;
    height: min(42vh, 400px);
    border-radius: 10px;
    background: repeating-conic-gradient(#e4e4e4 0% 25%, #f4f4f4 0% 50%) 50% / 16px 16px;
    touch-action: none;
    cursor: crosshair;
}

.deckd-cutout-viewport.is-pan-tool {
    cursor: grab;
}

.deckd-cutout-viewport.is-panning {
    cursor: grabbing;
}

#deckCutoutCanvas,
#collageCutoutCanvas {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    touch-action: none;
    display: block;
}

/* =========================================================================
   FREEHAND DRAWING TOOL (pencil/glow/spray) — ribbon controls
   =========================================================================
   Drawing itself happens directly on the slide/collage canvas (see
   #deckDrawCanvas in style.css and #collageDrawCanvas in the collage's own
   stylesheet section), not in a modal — this file only supplies the size
   slider's look, reusing --dm-* theme vars since they're defined on :root
   (available everywhere, not just inside .deckd-modal). */
.deckd-draw-size-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    color: var(--dm-text-soft);
    font-size: 13px;
    font-weight: 600;
}

.deckd-draw-size-control input[type="range"] {
    width: 90px;
    accent-color: var(--dm-text);
}

.deckd-draw-size-control span {
    min-width: 34px;
    color: var(--dm-text);
    font-weight: 700;
    text-align: right;
}

/* Sidebar: live preview + layer manager */

.deckd-cutout-preview-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 160px;
    background: var(--dm-surface);
    border-radius: var(--dm-radius-md);
    padding: 8px;
}

#deckCutoutPreviewCanvas,
#collageCutoutPreviewCanvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.deckd-cutout-preview-empty {
    position: absolute;
    inset: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 12px;
    color: var(--dm-text-faint);
    padding: 0 12px;
}

.deckd-cutout-clip-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    /* Exactly 2 clip rows (40px each + 6px gap, measured) before this
       scrolls instead of growing the card taller. */
    max-height: 86px;
    overflow-y: auto;
    padding-right: 2px;
}

.deckd-cutout-empty-hint {
    font-size: 13px;
    color: var(--dm-text-faint);
    text-align: center;
    padding: 18px 8px;
    margin: 0;
    border: 1px dashed var(--dm-border);
    border-radius: var(--dm-radius-sm);
}

.deckd-cutout-clip-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid var(--dm-border);
    border-radius: var(--dm-radius-sm);
    cursor: pointer;
}

.deckd-cutout-clip-row:hover {
    background: var(--dm-surface);
}

.deckd-cutout-clip-row.is-selected {
    border-color: var(--dm-border-strong);
    background: var(--dm-surface-strong);
}

.deckd-cutout-clip-label {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--dm-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deckd-cutout-clip-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: var(--dm-text-faint);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.deckd-cutout-clip-delete:hover {
    background: rgba(179, 57, 44, 0.12);
    color: var(--dm-danger);
}

/* Inside/outside segmented toggle — used as a per-row control in the clip
   list (one per finished clip). */
.deckd-cutout-mode-toggle {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    background: var(--dm-bg);
    border: 1px solid var(--dm-border);
    border-radius: 999px;
}

.deckd-cutout-mode-btn {
    border: none;
    background: transparent;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    color: var(--dm-text-soft);
}

.deckd-cutout-mode-btn.is-active {
    background: var(--dm-text);
    color: var(--dm-bg);
}

.deckd-cutout-mode-btn.is-active.is-outside {
    background: var(--dm-danger);
}


/* =========================================================================
   EXPLORE FILTER MODAL (#filterModal on explore.html)
   =========================================================================
   Wider than the default 440px card so the 3-across category grid and the
   price slider both fit without the card scrolling internally, and the
   two field labels ("Category", "Max price") sit left-aligned above their
   controls rather than centred like a normal modal field label.
   ========================================================================= */
#filterModal .deckd-modal-card {
    max-width: 560px;

    /* Content is short enough (3-row category grid, one slider, two
       buttons) that it never needs the shared card's internal scroll -
       let it size to content instead of capping + scrolling. */
    max-height: min(92vh, 720px);
}

#filterModal .deckd-field label {
    text-align: left;
}

/* The category checkboxes were picking up ".deckd-field input" (width:
   100%, 12px padding, a border + fill) meant for text fields, which blew
   each one up into a ~44px bordered box. Put them back to a plain small
   checkbox that sits snug against its label text. */
#filterModal .category-options input {
    width: auto;
    flex: 0 0 auto;

    margin: 0;
    padding: 0;

    border: none;
    background: none;

    accent-color: #1f1f1f;
}

/* Three across needs the card's full desktop width - drop to two on a
   phone-width card so the third column isn't clipped by the card edge. */
@media (max-width: 520px) {
    #filterModal .category-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* iOS Safari auto-zooms the whole page when any text input under 16px
   is focused. Inside a fixed modal that zoom left the field looking
   clipped - typing an email past the visible width seemed to just stop,
   which read as a length limit on the reset-password/login/signup
   forms. 16px is the smallest size that avoids the zoom (same fix as
   the topbar search inputs in style.css). */
@media (max-width: 700px) {
    .deckd-field input,
    .deckd-field select,
    .deckd-field textarea {
        font-size: 16px;
    }
}

/* =========================================================================
   AUTH MODALS (login / signup / reset password / Google username)
   =========================================================================
   Built on the dialog layer above; only the differences live here: a
   centred wordmark + heading instead of the left-aligned title row, a
   full-width primary button, and a small text link at the bottom to
   switch between log in / sign up. */

.deckd-modal .deckd-auth-card {
    max-width: 400px;
    padding: 40px 32px 28px;
    border-radius: 20px;
}

.deckd-auth-head {
    margin-bottom: 26px;
    text-align: center;
}

.deckd-auth-wordmark {
    display: block;
    margin-bottom: 18px;
    color: var(--dm-text);
    font-family: 'Archivo Black', Arial, sans-serif;
    font-size: 22px;
    font-weight: 400;
    letter-spacing: -0.053em;
    line-height: 1;
}

.deckd-auth-head h2 {
    margin: 0;
    color: var(--dm-text);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.deckd-auth-head p {
    max-width: 300px;
    margin: 8px auto 0;
    color: var(--dm-text-soft);
    font-size: 13.5px;
    line-height: 1.45;
}

/* Google button + "or" divider */
.deckd-auth-card .google-signin-button {
    margin-bottom: 0;
}

/* Google's own button only offers a ~4px "rectangular" or a full "pill"
   shape, so the 10px corners (matching the Log in / Sign up button below)
   come from clipping Google's wrapper, which sits exactly over the button
   inside its iframe. That clip also trims Google's grey border at the
   corners, so ::after redraws it along the new curve. */
.deckd-auth-card .google-signin-button > div {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
}

.deckd-auth-card .google-signin-button > div::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid #dadce0;
    border-radius: inherit;
    pointer-events: none;
}

.deckd-auth-card .deckd-auth-divider {
    margin: 18px 0;
    color: var(--dm-text-faint);
    font-size: 12px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.deckd-auth-card .deckd-auth-divider::before,
.deckd-auth-card .deckd-auth-divider::after {
    background: #ececec;
}

.deckd-modal .deckd-auth-card .deckd-field {
    margin-bottom: 14px;
}

.deckd-auth-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.deckd-auth-card .deckd-forgot-password-link {
    align-self: auto;
    margin: 0;
}

/* Full-width primary button, unlike the right-aligned dialog row */
.deckd-modal .deckd-auth-card .deckd-modal-actions {
    margin-top: 22px;
}

.deckd-modal .deckd-auth-card .deckd-modal-actions .deckd-btn {
    width: 100%;
    min-height: 40px;
    border-radius: 10px;
    font-weight: 600;
}

/* "Don't have an account? Sign up" */
.deckd-auth-switch {
    margin: 22px 0 0;
    color: var(--dm-text-faint);
    font-size: 13px;
    text-align: center;
}

.deckd-auth-switch button {
    margin-left: 2px;
    padding: 0;
    background: none;
    border: none;
    color: var(--dm-text);
    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
}

.deckd-auth-switch button:hover {
    text-decoration: underline;
}

/* =========================================================================
   COVER PHOTO PICKER (Edit board - board_detail.html + boards.html)
   =========================================================================
   One quiet bordered row in place of the old "Edit cover photo" toggle +
   grey box: thumbnail (placeholder icon until a file is picked, then
   #board-cover-preview fills it), file name + hint, and a compact
   Choose image button. The file input itself stays hidden (style.css's
   global input[type="file"] rule); the label is what opens it. */

.deckd-modal .cover-picker {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 8px 8px 8px;
    border: 1px solid #d9d9d9;
    border-radius: 10px;
    background: #ffffff;
}

.deckd-modal .cover-picker-thumb {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 8px;
    background: var(--dm-surface);
    color: var(--dm-text-faint);
}

.deckd-modal .cover-picker-thumb svg {
    width: 18px;
    height: 18px;
}

/* Hidden until a file is chosen - the change handlers set display:block
   and the open handlers reset it to none. */
.deckd-modal .cover-picker-thumb img {
    position: absolute;
    inset: 0;
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.deckd-modal .cover-picker-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
}

.deckd-modal .cover-picker-name {
    overflow: hidden;
    color: var(--dm-text-soft);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deckd-modal .cover-picker-name.has-file {
    color: var(--dm-text);
    font-weight: 500;
}

.deckd-modal .cover-picker-text small {
    color: var(--dm-text-faint);
    font-size: 12px;
}

.deckd-modal .cover-picker-button {
    flex-shrink: 0;
    margin: 0;
    cursor: pointer;
}

.deckd-modal .cover-picker-remove {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    color: var(--dm-text-soft);
    font-size: 13px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
}

.deckd-modal .cover-picker-remove input {
    width: 15px;
    height: 15px;
    margin: 0;
    padding: 0;
    flex: none;
    accent-color: var(--dm-text);
}

/* -------------------------------------------------------------------
   Cover field: Photo | Items (_board_cover_field.html)
   ------------------------------------------------------------------- */

.deckd-modal .cover-field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Small segmented switch, Claude-style: grey track, white active pill */
.deckd-modal .cover-tabs {
    display: inline-flex;
    padding: 2px;
    border-radius: 8px;
    background: #f0f0f0;
}

.deckd-modal .cover-tab {
    min-width: 64px;
    padding: 4px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--dm-text-soft);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.deckd-modal .cover-tab:hover {
    color: var(--dm-text);
}

.deckd-modal .cover-tab.is-active {
    background: #ffffff;
    color: var(--dm-text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.deckd-modal .cover-pane {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.deckd-modal .cover-pane[hidden] {
    display: none !important;
}

/* Summary row: live mini cover + what it'll show + n / 3 */
.deckd-modal .cover-items-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border: 1px solid #d9d9d9;
    border-radius: 10px;
    background: #ffffff;
}

.deckd-modal .cover-items-preview.board-cover-collage {
    width: 64px;
    height: 48px;
    flex-shrink: 0;
    gap: 1px;
    border-radius: 6px;
    background: var(--dm-surface);
}

.deckd-modal .cover-items-summary-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
}

.deckd-modal .cover-items-summary-text strong {
    color: var(--dm-text);
    font-size: 14px;
    font-weight: 500;
}

.deckd-modal .cover-items-summary-text small {
    color: var(--dm-text-faint);
    font-size: 12px;
    line-height: 1.35;
}

.deckd-modal .cover-items-count {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f0f0f0;
    color: var(--dm-text-soft);
    font-size: 12px;
    font-weight: 500;
}

.deckd-modal .cover-items-count.is-full {
    animation: deckdCoverCountNudge 0.35s ease;
}

@keyframes deckdCoverCountNudge {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

/* Item grid: square thumbnails, numbered when picked */
.deckd-modal .cover-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 8px;
    max-height: 196px;
    padding: 2px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--dm-scrollbar-thumb) transparent;
}

.deckd-modal .cover-item {
    position: relative;
    aspect-ratio: 1 / 1;
    padding: 0;
    overflow: hidden;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: var(--dm-surface);
    cursor: pointer;
    transition: border-color 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.deckd-modal .cover-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.deckd-modal .cover-item-letter {
    color: var(--dm-text-faint);
    font-size: 16px;
    font-weight: 600;
}

.deckd-modal .cover-item:hover {
    border-color: #c2c2c2;
}

.deckd-modal .cover-item.is-selected {
    border-color: var(--dm-text);
    box-shadow: 0 0 0 1px var(--dm-text);
}

.deckd-modal .cover-item.is-disabled {
    opacity: 0.45;
}

.deckd-modal .cover-item:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(31, 31, 31, 0.15);
}

.deckd-modal .cover-item-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--dm-text);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 0 0 2px #ffffff;
}

.deckd-modal .cover-items-empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 18px 8px;
    color: var(--dm-text-faint);
    font-size: 13px;
    text-align: center;
}

.deckd-modal .cover-items-note {
    margin: 0;
    color: var(--dm-text-faint);
    font-size: 12px;
}

/* Sign-up's required "16 or over / agree to the Terms" tickbox (see
   _accept_terms_field.html) - lighter than the Add Item "Show on
   Explore" row whose tickbox styling it borrows, since it's fine print. */
html body .deckd-modal .deckd-accept-terms {
    align-items: flex-start !important;
    margin: 4px 0 14px !important;
    color: var(--dm-text) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.45 !important;
}

html body .deckd-modal .deckd-accept-terms input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    margin-top: 1px !important;
    border-radius: 5px !important;
}

html body .deckd-modal .deckd-accept-terms a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}
