/* =============================================================================
   Shell.css : the page frame, the header, and the sign-in dialog
   =============================================================================
   The dialog's measurements are taken from the reference design and are exact on
   purpose: card sizes, spacing, type and colour are not approximations. Where the
   reference used an icon font for two glyphs, an inline SVG of the same shape is
   drawn instead, so the page loads no font it would use twice.

   Two rules here exist for reasons the markup does not show:
     ─ `overflow: hidden` on the root while the dialog is open stops the page behind
       from scrolling under the backdrop.
     ─ On the desktop the header IS the window's title bar, and `user-select: none`
       stops a drag that starts on a button and ends on the bar from selecting text.
*/

/* Both are variable fonts: one file covers every weight the design uses. Latin subset
   only, which is what the interface is written in. */
@font-face
{
    font-family: "DM Sans";
    font-style: normal;
    font-weight: 100 1000;
    font-display: swap;
    src: url("/Resources/Fonts/DMSans.woff2") format("woff2");
}

@font-face
{
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/Resources/Fonts/Inter.woff2") format("woff2");
}

*
{
    box-sizing: border-box;
}

html
{
    color-scheme: dark;

    /* One look for every list of choices: the header menu, the navigation panel and
       the context menu all read these, so they cannot drift apart. */
    --item-font:         "DM Sans", sans-serif;
    --item-font-size:    14px;
    --item-height:       40px;
    --item-padding-x:    10px;
    --item-gap:          12px;
    --item-radius:       10px;
    --item-spacing:      2px;
    --item-icon:         20px;
    --item-color:        #c4c4c4;
    --item-icon-color:   #a3a3a3;
    --item-hover-bg:     rgba(255, 255, 255, 0.06);
    --item-hover-color:  #f3f4f6;
    --item-active-bg:    rgba(124, 58, 237, 0.18);
    --item-active-color: #c4b5fd;
    --item-transition:   background-color 0.2s, color 0.2s;
}

html, body
{
    margin: 0;
    padding: 0;
    height: 100%;
    background: rgba(18, 18, 18, 255);
    color: #f3f4f6;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

html.auth-open
{
    overflow: hidden;
}

#root
{
    height: 100%;
}

button
{
    font: inherit;
}

:focus-visible
{
    outline: 2px solid #625df6;
    outline-offset: 2px;
}



/* === Frame ============================================================== */

.app
{
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.app-body
{
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
}

.content
{
    flex: 1 1 auto;
    min-width: 0;
}

/* A page with its own panes (the dashboard) fills the window below the header and
   scrolls inside them, instead of the document growing. */
.app:has(.navpanel-layout)
{
    height: 100%;
}

.content:has(> .dashboard)
{
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.content > .dashboard
{
    flex: 1 1 auto;
}

.content-message
{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    text-align: center;
}

.content-message h1
{
    margin: 0 0 8px;
    font-family: "DM Sans", sans-serif;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.1px;
}

.content-message p
{
    margin: 0;
    color: #9ca3af;
}

.content-signin
{
    margin-top: 20px;
    height: 42px;
    padding: 0 24px;
    background: #ffffff;
    border: 1px solid #ffffff;
    border-radius: 9999px;
    color: #000000;
    font-weight: 600;
    cursor: pointer;
}



/* === Header ============================================================= */

/* Scrolls away with the page. z-index keeps the account menu, which drops below the
   bar, above the content it overlaps. */
.header
{
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    height: 72px;
    padding: 0 24px;
    background: rgba(0, 0, 0, 0);
    border-bottom: 1px solid #262626;
    user-select: none;
}

.header-brand
{
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: "DM Sans", sans-serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: #ffffff;
    text-decoration: none;
}

/* A fixed size, so the link's width is right before the image loads: the desktop's drag
   regions are measured then. */
.header-brand-logo
{
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
}

.header-actions
{
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* 40px round, #555 stroke, as the reference's account button. */
.header-icon-button
{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 50px;
    color: #b3b3b3;
    cursor: pointer;
    transition: background-color 0.2s;
}

.header-icon-button:hover
{
    background: rgba(255, 255, 255, 0.08);
}

.header-icon-button-active
{
    color: #f3f4f6;
}

/* 32px inside the 40px button, so its hover ring still shows around it. */
.header-avatar
{
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.header-avatar-initial
{
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-family: "DM Sans", sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
}

/* The reference's .util-link. */
.header-link
{
    padding: 8px 14px;
    border-radius: 50px;
    color: #b3b3b3;
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.5s, background 0.5s, transform 0.5s;
}

.header-link:hover
{
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: translateY(-1px);
    transition: color 0.3s, background 0.3s, transform 0.3s;
}

.header-link-active
{
    color: #ffffff;
}

.header-account
{
    position: relative;
}

/* The reference's .dd-menu.user-menu: drops 8px and grows from 96% out of the top-right
   corner, then each item slides in on a staggered delay. */
.header-menu
{
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: var(--item-spacing);
    min-width: 200px;
    padding: 6px;
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 10px 20px -2px rgba(0, 0, 0, 0.5);
    color: #e5e5e5;
    font-family: "DM Sans", sans-serif;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.96);
    transform-origin: top right;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-menu-open
{
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.header-menu-item
{
    display: flex;
    align-items: center;
    gap: var(--item-gap);
    width: 100%;
    height: var(--item-height);
    padding: 0 var(--item-padding-x);
    background: transparent;
    border: 0;
    border-radius: var(--item-radius);
    color: var(--item-color);
    font-family: var(--item-font);
    font-size: var(--item-font-size);
    font-weight: 400;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.2s, transform 0.2s, var(--item-transition);
}

.header-menu-item svg
{
    flex-shrink: 0;
    width: var(--item-icon);
    height: var(--item-icon);
    color: var(--item-icon-color);
    transition: color 0.2s;
}

.header-menu-open .header-menu-item
{
    opacity: 1;
    transform: translateY(0);
}

/* The stagger delays only the entrance, never the hover tint. */
/* Delays opacity and transform only; the hover background and colour stay immediate. */
.header-menu-open .header-menu-item:nth-child(1) { transition-delay: 0.05s, 0.05s, 0s, 0s; }
.header-menu-open .header-menu-item:nth-child(2) { transition-delay: 0.08s, 0.08s, 0s, 0s; }
.header-menu-open .header-menu-item:nth-child(3) { transition-delay: 0.11s, 0.11s, 0s, 0s; }
.header-menu-open .header-menu-item:nth-child(4) { transition-delay: 0.14s, 0.14s, 0s, 0s; }

.header-menu-label
{
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-menu-open .header-menu-item:hover
{
    background: var(--item-hover-bg);
    color: var(--item-hover-color);
}

.header-menu-item:hover svg
{
    color: var(--item-hover-color);
}

/* The page you are on, as the navigation panel marks its current section. */
.header-menu-item[aria-current="page"],
.header-menu-open .header-menu-item[aria-current="page"]:hover
{
    background: var(--item-active-bg);
    color: var(--item-active-color);
}

.header-menu-item[aria-current="page"] svg
{
    color: var(--item-active-color);
}

.header-menu-divider
{
    flex: 0 0 auto;
    height: 1px;
    margin: 4px 0;
    background: #2e2e2e;
}

/* Only rendered in the desktop app, where the header is the window's title bar. */
.header-window-buttons
{
    display: flex;
    margin-left: 8px;
    margin-right: -24px;
    align-self: stretch;
}

.header-window-button
{
    width: 46px;
    background: transparent;
    border: 0;
    color: #b3b3b3;
    font-size: 12px;
    cursor: default;
}

.header-window-button:hover
{
    background: rgba(255, 255, 255, 0.08);
}

.header-window-close:hover
{
    background: #c42b1c;
    color: #ffffff;
}



/* === Navigator ========================================================== */

.navigator
{
    flex: 0 0 220px;
    padding: 16px 12px;
    border-right: 1px solid #262626;
}

.navigator-group + .navigator-group
{
    margin-top: 16px;
}

.navigator-group-title
{
    padding: 4px 10px;
    color: #9ca3af;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.navigator-item
{
    display: block;
    padding: 7px 10px;
    border-radius: 6px;
    color: #e5e7eb;
    text-decoration: none;
}

.navigator-item:hover
{
    background: rgba(255, 255, 255, 0.06);
}

.navigator-item-active
{
    background: rgba(255, 255, 255, 0.1);
    font-weight: 600;
}



/* === Update notice ====================================================== */

.update-notice
{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 10px 16px;
    background: #111827;
    color: #ffffff;
    font-size: 13px;
}

.update-notice-reload
{
    height: 28px;
    padding: 0 14px;
    background: #ffffff;
    border: 0;
    border-radius: 9999px;
    color: #111827;
    font-weight: 600;
    cursor: pointer;
}

.update-notice-dismiss
{
    background: transparent;
    border: 0;
    color: #9ca3af;
    cursor: pointer;
}



/* === Dialog ============================================================= */

/* Fixed, 40% black, the card centred both ways; scrollable when the viewport is
   shorter than the card. */
.auth-dialog
{
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    overflow-y: auto;
}

.auth-dialog::backdrop
{
    background: rgba(0, 0, 0, 0.4);
}

/* Auto margins centre the card when it fits and collapse to zero when it does not,
   so a card taller than the window starts at the top and scrolls rather than being
   cut off, as align-items: center would do. */
.auth-frame
{
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    min-height: 100%;
    padding: 40px 0;
}

.auth-frame > .auth-card
{
    margin: auto;
}

/* The card stays white, so it keeps dark text rather than inheriting the page's. */
.auth-card
{
    position: relative;
    background: #ffffff;
    color: #111827;
    border-radius: 10px;
    animation: auth-modal-show 0.4s ease;
}

/* The reference's modalShow / modalHide. Its backdrop appears at once and fades out
   over 400ms (jQuery fadeOut, "swing" easing). Like the reference, this plays even
   when the OS asks for reduced motion. */
.auth-dialog-closing
{
    pointer-events: none;
}

.auth-dialog-closing .auth-card
{
    animation: auth-modal-hide 0.4s ease forwards;
}

.auth-dialog-closing::backdrop
{
    animation: auth-backdrop-fade 0.4s cubic-bezier(0.37, 0, 0.63, 1) forwards;
}

@keyframes auth-backdrop-fade
{
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes auth-modal-show
{
    0%     { opacity: 0; transform: scale(0.8); visibility: hidden; }
    65.5%  { transform: scale(1.03); }
    100%   { opacity: 1; transform: scale(1); visibility: visible; }
}

@keyframes auth-modal-hide
{
    0%   { opacity: 1; transform: scale(1);   visibility: visible; }
    25%  { opacity: 0; transform: scale(0.8); visibility: hidden; }
    50%  { opacity: 0; transform: scale(0.6); visibility: hidden; }
    75%  { opacity: 0; transform: scale(0.4); visibility: hidden; }
    100% { opacity: 0; transform: scale(0.2); visibility: hidden; }
}

/* === Log in: 820 x 650, 400px form column + 420px image === */

.auth-card-login
{
    display: flex;
    width: 820px;
    height: 650px;
}

.auth-left
{
    display: flex;
    flex-direction: column;
    width: 400px;
    padding-left: 30px;
}

.auth-left > *
{
    width: 330px;
}

.auth-right
{
    width: 420px;
    height: 650px;
}

.auth-right img
{
    display: block;
    width: 420px;
    height: 650px;
    object-fit: cover;
    border-radius: 0 10px 10px 0;
}

.auth-title
{
    margin: 50px 0 40px;
    font-family: "DM Sans", sans-serif;
    font-size: 40px;
    font-weight: 600;
    line-height: 52px;
    letter-spacing: -0.1px;
    color: #000000;
}

/* === Google === */

.auth-google
{
    height: 40px;
    margin: 0 0 25px;
}

.auth-google-host
{
    height: 40px;
}

.auth-google-fallback
{
    color: #6b7280;
    font-size: 12px;
}

/* === Fields === */

.auth-form
{
    display: flex;
    flex-direction: column;
}

.auth-row
{
    position: relative;
}

/* Log in: the email sits directly under the Google button's 25px margin, and the
   password 20px below it. */
.auth-card-login .auth-row + .auth-row
{
    margin-top: 20px;
}

.auth-input
{
    display: block;
    width: 100%;
    height: 42px;
    margin: 0;
    padding: 0 20px;
    background: #f1f1f1;
    border: 0;
    border-radius: 30px;
    outline: none;
    color: #111827;
    font-family: "Inter", sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 21px;
    letter-spacing: -0.1px;
}

.auth-input::placeholder
{
    color: #6d6d6d;
    opacity: 1;
}

.auth-input:focus-visible
{
    outline: 2px solid #625df6;
    outline-offset: 0;
}

.auth-row:has(.auth-eye) .auth-input
{
    padding-right: 50px;
}

.auth-eye
{
    position: absolute;
    right: 15px;
    bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 22px;
    padding: 0;
    background: transparent;
    border: 0;
    color: #6d6d6d;
    cursor: pointer;
}

.auth-inline-error
{
    position: absolute;
    top: -20px;
    right: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #ca0047;
    font-family: "Inter", sans-serif;
    font-size: 12px;
    line-height: 20px;
}

.auth-error-message,
.auth-notice
{
    margin: -10px 0 10px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 19px;
}

.auth-error-message
{
    background: #fdecf2;
    color: #ca0047;
}

.auth-notice
{
    background: #efeefe;
    color: #3d3a9e;
}

/* === Remember me + forgot === */

.auth-bottom
{
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 10px;
}

.auth-remember
{
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

/* The native box is visually hidden but still the thing that is focused and toggled,
   so the keyboard and a screen reader get a real checkbox. */
.auth-remember input
{
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
}

/* An open circle, which fills pink with a check when ticked — the reference's
   circle / check-circle pair. */
.auth-remember-mark
{
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    border: 1.5px solid #111827;
    border-radius: 50%;
    transition: background-color 0.15s, border-color 0.15s;
}

.auth-remember input:checked + .auth-remember-mark
{
    border-color: #ff92c8;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.5 12.5l3.5 3.5 7.5-8' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat,
        #ff92c8;
}

.auth-remember input:focus-visible + .auth-remember-mark
{
    outline: 2px solid #625df6;
    outline-offset: 2px;
}

.auth-remember-label
{
    font-family: "DM Sans", sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 21.6px;
    letter-spacing: -0.1px;
    color: #111827;
}

.auth-forgot
{
    padding: 0;
    background: transparent;
    border: 0;
    font-family: "DM Sans", sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
    letter-spacing: -0.1px;
    color: #625df6;
    cursor: pointer;
}

/* === Log In === */

/* 62px tall, not the button's 42: the reference reserves the extra 20px below it, and
   the "Don't have an account" line is placed from there. */
.auth-submit-row
{
    height: 62px;
    margin-top: 25px;
}

.auth-submit
{
    width: 130px;
    height: 42px;
    padding: 12px 18px;
    background: #000000;
    border: 1px solid #000000;
    border-radius: 9999px;
    color: #ffffff;
    font-family: "Inter", sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 14px;
    cursor: pointer;
    transition: background 0.45s, color 0.45s, border-color 0.45s;
}

.auth-submit:disabled
{
    opacity: 0.6;
    cursor: progress;
    width: auto;
    min-width: 130px;
}

/* === Switch between the two views === */

.auth-switch
{
    margin-top: 50px;
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    line-height: 25.2px;
    letter-spacing: -0.1px;
    color: #111827;
}

.auth-switch span
{
    font-weight: 500;
}

.auth-switch-link
{
    padding: 0;
    background: transparent;
    border: 0;
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 25.2px;
    letter-spacing: -0.1px;
    color: #111827;
    cursor: pointer;
}

.auth-switch-link:hover
{
    text-decoration: underline;
}

/* === Create your account: 580 wide, one centered 478px column === */

/* The reference opens with a 178x125 illustration 35px down. There is none here, and
   keeping its space would leave a blank band above the title, so the title sits where
   the illustration would have started. */
.auth-card-signup
{
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 580px;
    padding: 50px 51px 0;
}

.auth-title-signup
{
    margin: 0 0 40px;
    font-size: 32px;
    line-height: 41.6px;
    text-align: center;
}

.auth-signup-google
{
    display: flex;
    justify-content: center;
    width: 330px;
    height: 65px;
}

.auth-error-signup
{
    width: 478px;
    margin: 0 0 10px;
}

.auth-form-signup
{
    width: 478px;
}

.auth-divider
{
    position: relative;
    margin: 0;
    font-family: "DM Sans", sans-serif;
    font-size: 22px;
    font-weight: 600;
    line-height: 39.6px;
    letter-spacing: -0.1px;
    color: #000000;
    text-align: center;
}

.auth-divider::before
{
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 1px solid #dfdfdf;
}

.auth-divider span
{
    position: relative;
    padding: 0 15px;
    background: #ffffff;
    font-size: 14px;
    font-weight: 500;
}

.auth-name-row
{
    display: flex;
    gap: 24px;
    margin-top: 10px;
}

.auth-name-row .auth-row
{
    flex: 1 1 0;
    min-width: 0;
    margin-top: 10px;
}

.auth-name-row .auth-input
{
    margin-top: 20px;
}

.auth-signup-email .auth-row
{
    margin-top: 25px;
}

.auth-signup-password .auth-row
{
    margin-top: 20px;
}

.auth-signup-password .auth-input
{
    margin-top: 5px;
}

.auth-signup-password .auth-eye
{
    bottom: 10px;
}

.auth-rules
{
    display: flex;
    gap: 16px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.auth-rule
{
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 5px 0;
    font-family: "DM Sans", sans-serif;
    font-size: 11px;
    font-weight: 500;
    line-height: 19.8px;
    letter-spacing: -0.1px;
    color: #111827;
}

.auth-rule-icon
{
    flex: 0 0 auto;
    color: #9ca3af;
    transition: color 0.2s;
}

.auth-rule-met .auth-rule-icon
{
    color: #16a34a;
}

/* The reference places a line of terms text between the rules and the button; there
   is no terms page yet, so its 21px is kept as spacing to preserve the layout. */
.auth-create-row
{
    display: flex;
    justify-content: center;
    margin-top: 41px;
}

.auth-create
{
    width: 300px;
    height: 42px;
    margin-top: 20px;
    padding: 5px 30px;
    background: #000000;
    border: 0;
    border-radius: 30px;
    color: #ffffff;
    font-family: "DM Sans", sans-serif;
    font-size: 15px;
    font-weight: 600;
    line-height: 27px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.auth-create:disabled
{
    opacity: 0.3;
    cursor: not-allowed;
}

.auth-switch-signup
{
    margin: 30px 0;
    font-family: "Inter", sans-serif;
    text-align: center;
}

.auth-switch-signup span
{
    font-family: "DM Sans", sans-serif;
    margin-right: 5px;
}



/* === Small cards: reset, email-link results, confirmations ============== */

.auth-card-small
{
    display: flex;
    flex-direction: column;
    width: 440px;
    padding: 44px 40px 32px;
}

.auth-title-small
{
    margin: 0 0 12px;
    font-size: 28px;
    line-height: 36px;
}

.auth-lead
{
    margin: 0 0 20px;
    color: #374151;
    font-size: 14px;
    line-height: 22px;
}

.auth-lead-muted
{
    color: #6b7280;
    font-size: 13px;
}

.auth-card-small .auth-rules
{
    flex-wrap: wrap;
    gap: 2px 14px;
}

.auth-card-small .auth-submit-row
{
    height: auto;
    margin-top: 20px;
}

.auth-submit-wide
{
    width: 100%;
}

/* Outranks .auth-submit:disabled's width: auto, which would shrink the button to its
   label until the form becomes valid. */
.auth-submit:disabled.auth-submit-wide
{
    width: 100%;
    cursor: not-allowed;
}

.auth-switch-small
{
    margin-top: 20px;
    text-align: center;
}

/* The X in a card's top-right corner. */
.modal-close
{
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 50%;
    color: #6b7280;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.modal-close:hover
{
    background: #f1f1f1;
    color: #111827;
}

.notice-card
{
    align-items: center;
    text-align: center;
}

.notice-icon
{
    margin-bottom: 18px;
}

.notice-icon-ok
{
    color: #16a34a;
}

.notice-icon-error
{
    color: #ca0047;
}

.notice-actions
{
    width: 100%;
    margin-top: 8px;
}



/* === Security check (Turnstile) ========================================= */

/* Reserves the widget's 65px before it loads, so the button below does not jump. */
.auth-challenge
{
    min-height: 65px;
    margin-top: 16px;
    line-height: 0;
}

.auth-challenge-login
{
    margin-top: 14px;
}

.auth-challenge-small
{
    margin-top: 18px;
}

/* The widget's content cannot be padded: it lives in Cloudflare's frame. So the frame
   sits in a pill of the same colour, with the button's side spacing, and the pill
   draws the rounded edge. Cloudflare already insets its content 9px, so 21px here
   makes the button's 30px. */
.turnstile-pill
{
    padding: 0 21px;
    border-radius: 30px;
    background: var(--turnstile-surface, #fafafa);
    line-height: 0;
}

/* The desktop app force-darkens every page, the widget with it; the pill has to follow. */
html[data-host="desktop"] .turnstile-pill
{
    --turnstile-surface: #202020;
}

/* line-height 0 drops the 3px baseline gap under the inline frame. The grey border is
   drawn inside Cloudflare's own frame, which no CSS here can reach, so its outer 2px
   are clipped off. */
.turnstile-host
{
    min-height: 65px;
    line-height: 0;
    clip-path: inset(2px);
}

.turnstile-error
{
    padding: 10px 14px;
    border-radius: 10px;
    background: #fdecf2;
    color: #ca0047;
    font-size: 13px;
    line-height: 19px;
}

/* Sign-up: the same 20px of visible space above and below the widget. The rules' own
   margin and line-height already leave 9px under their text, and the button's 20px
   margin is the gap below, so the row adds none. */
.auth-card-signup .auth-challenge
{
    margin-top: 11px;
}

.auth-card-signup .auth-create-row
{
    margin-top: 0;
}



/* === Verify banner ====================================================== */

.verify-banner
{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 10px 16px;
    background: rgba(98, 93, 246, 0.16);
    border-bottom: 1px solid rgba(98, 93, 246, 0.3);
    color: #e0e7ff;
    font-size: 13px;
}

.verify-banner-button
{
    height: 28px;
    padding: 0 14px;
    background: #ffffff;
    border: 0;
    border-radius: 9999px;
    color: #111827;
    font-weight: 600;
    cursor: pointer;
}

.verify-banner-button:disabled
{
    opacity: 0.6;
    cursor: progress;
}



/* === Navigation panel =================================================== */

/* The panel and its content share one grid; the dock only swaps the areas, so the
   panel element is never remounted. --navpanel-size is the panel's width on a side
   and its height at the bottom. */
.navpanel-layout
{
    --navpanel-size: 240px;
    --navpanel-icon: 20px;
    --navpanel-ease: cubic-bezier(0.2, 0, 0, 1);

    display: grid;
    height: 100%;
    min-height: 0;
}

.navpanel-layout[data-dock="left"]
{
    grid-template-columns: var(--navpanel-size) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "panel content";
}

.navpanel-layout[data-dock="right"]
{
    grid-template-columns: minmax(0, 1fr) var(--navpanel-size);
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "content panel";
}

.navpanel-layout[data-dock="bottom"]
{
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) var(--navpanel-size);
    grid-template-areas: "content" "panel";
}

.navpanel-animated
{
    transition: grid-template-columns var(--navpanel-duration, 0.32s) var(--navpanel-ease),
                grid-template-rows var(--navpanel-duration, 0.32s) var(--navpanel-ease);
}

.navpanel-content
{
    grid-area: content;
    min-width: 0;
    min-height: 0;
    overflow: auto;
}

/* While the panel moves or resizes, the in-between sizes must not summon scrollbars.
   The content is clipped instead; the gutter is kept when a vertical bar was already
   showing, so the text does not shift sideways when it returns. */
.navpanel-moving,
.navpanel-resizing
{
    overflow: hidden;
}

.navpanel-moving .navpanel-content,
.navpanel-resizing .navpanel-content,
.navpanel-moving .navpanel-list,
.navpanel-resizing .navpanel-list
{
    overflow: hidden;
}

.navpanel-layout[data-gutter] .navpanel-content
{
    scrollbar-gutter: stable;
}

/* A move closes the track to 0 and opens it on the other side. The panel keeps its
   resting width meanwhile and is clipped by the closing track, pinned to its own edge,
   so it reads as sliding shut rather than squashing. */
.navpanel-docking
{
    --navpanel-duration: 0.26s;
}

.navpanel-docking .navpanel
{
    overflow: hidden;
}

.navpanel-docking .navpanel-header,
.navpanel-docking .navpanel-list
{
    flex-shrink: 0;
}

.navpanel-docking .navpanel-handle
{
    visibility: hidden;
}

.navpanel-layout[data-dock="left"].navpanel-docking .navpanel,
.navpanel-layout[data-dock="right"].navpanel-docking .navpanel
{
    min-width: 0;
}

.navpanel-layout[data-dock="left"].navpanel-docking .navpanel > *,
.navpanel-layout[data-dock="right"].navpanel-docking .navpanel > *
{
    width: var(--navpanel-resting);
}

.navpanel-layout[data-dock="right"].navpanel-docking .navpanel
{
    align-items: flex-start;
}

.navpanel-layout[data-dock="bottom"].navpanel-docking .navpanel
{
    align-items: flex-start;
}

.navpanel-layout[data-dock="bottom"].navpanel-docking .navpanel > *
{
    height: var(--navpanel-resting);
}

.navpanel-docking .navpanel-label,
.navpanel-docking .navpanel-title
{
    transition: none;
}

.navpanel
{
    grid-area: panel;
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: #141414;
    font-family: "DM Sans", sans-serif;
}

.navpanel-layout[data-dock="left"] .navpanel   { border-right: 1px solid #262626; }
.navpanel-layout[data-dock="right"] .navpanel  { border-left: 1px solid #262626; }
.navpanel-layout[data-dock="bottom"] .navpanel { flex-direction: row; border-top: 1px solid #262626; }

/* --- Header --- */

.navpanel-header
{
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    height: 48px;
    padding: 0 8px 0 10px;
    border-bottom: 1px solid #1f1f1f;
    color: #9ca3af;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.navpanel-header-dragging
{
    cursor: grabbing;
}

.navpanel-grip
{
    display: flex;
    flex: 0 0 auto;
    color: #4b4b4b;
}

.navpanel-title
{
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: #9ca3af;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: opacity 0.2s;
}

.navpanel-header-buttons
{
    display: flex;
    flex: 0 0 auto;
    gap: 2px;
}

.navpanel-button
{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: #a3a3a3;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.navpanel-button:hover
{
    background: rgba(255, 255, 255, 0.08);
    color: #f3f4f6;
}

.navpanel-button[aria-disabled="true"]
{
    color: #4b4b4b;
    cursor: not-allowed;
}

.navpanel-button[aria-disabled="true"]:hover
{
    background: transparent;
}

.navpanel-button[aria-expanded="true"][aria-haspopup]
{
    background: rgba(255, 255, 255, 0.1);
    color: #f3f4f6;
}

/* Collapsed on a side: the header stacks its two buttons above the list. */
.navpanel[data-mode="collapsed"] .navpanel-header
{
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    height: auto;
    padding: 10px 0;
}

.navpanel[data-mode="collapsed"] .navpanel-title,
.navpanel[data-mode="collapsed"] .navpanel-grip
{
    display: none;
}

.navpanel[data-mode="collapsed"] .navpanel-header-buttons
{
    flex-direction: column;
    gap: 4px;
}

/* Bottom: the header is a narrow segment at the left end of the bar. */
.navpanel[data-mode="bottom"] .navpanel-header
{
    height: auto;
    padding: 0 6px 0 10px;
    border-bottom: 0;
    border-right: 1px solid #1f1f1f;
}

.navpanel[data-mode="bottom"] .navpanel-title
{
    display: none;
}

/* --- Items --- */

.navpanel-list
{
    display: flex;
    flex-direction: column;
    gap: var(--item-spacing);
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    padding: 10px 8px;
    overflow-x: hidden;
    overflow-y: auto;
    list-style: none;
}

.navpanel[data-mode="bottom"] .navpanel-list
{
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 0 10px;
    overflow-x: auto;
    overflow-y: hidden;
}

.navpanel-item
{
    display: flex;
    align-items: center;
    gap: var(--item-gap);
    height: var(--item-height);
    padding: 0 var(--item-padding-x);
    border-radius: var(--item-radius);
    color: var(--item-color);
    font-family: var(--item-font);
    font-size: var(--item-font-size);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    transition: var(--item-transition);
}

.navpanel-item:hover
{
    background: var(--item-hover-bg);
    color: var(--item-hover-color);
}

.navpanel-item-active,
.navpanel-item-active:hover
{
    background: var(--item-active-bg);
    color: var(--item-active-color);
}

.navpanel-icon
{
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: var(--navpanel-icon);
    height: var(--navpanel-icon);
}

.navpanel-icon svg
{
    width: 100%;
    height: 100%;
}

.navpanel-label
{
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s 0.08s;
}

/* Icons only: the label stays in the DOM, faded, so the width animation reveals it. */
.navpanel[data-mode="collapsed"] .navpanel-item,
.navpanel[data-mode="bottom"] .navpanel-item
{
    justify-content: center;
    gap: 0;
    height: auto;
    padding: 8px;
}

.navpanel[data-mode="collapsed"] .navpanel-label,
.navpanel[data-mode="bottom"] .navpanel-label
{
    width: 0;
    opacity: 0;
    transition: opacity 0.1s;
}

/* --- Resize handle --- */

/* A wide invisible hit area over the border, so it is easy to grab. */
.navpanel-handle
{
    position: absolute;
    z-index: 2;
    touch-action: none;
}

.navpanel-handle::after
{
    content: "";
    position: absolute;
    background: transparent;
    transition: background-color 0.15s;
}

.navpanel-handle:hover::after,
.navpanel-handle:focus-visible::after,
.navpanel-resizing .navpanel-handle::after
{
    background: #7c3aed;
}

.navpanel-handle:focus-visible
{
    outline: none;
}

.navpanel-layout[data-dock="left"] .navpanel-handle,
.navpanel-layout[data-dock="right"] .navpanel-handle
{
    top: 0;
    bottom: 0;
    width: 9px;
    cursor: col-resize;
}

.navpanel-layout[data-dock="left"] .navpanel-handle  { right: -5px; }
.navpanel-layout[data-dock="right"] .navpanel-handle { left: -5px; }

.navpanel-layout[data-dock="left"] .navpanel-handle::after,
.navpanel-layout[data-dock="right"] .navpanel-handle::after
{
    top: 0;
    bottom: 0;
    left: 3px;
    width: 3px;
}

.navpanel-layout[data-dock="bottom"] .navpanel-handle
{
    top: -5px;
    left: 0;
    right: 0;
    height: 9px;
    cursor: row-resize;
}

.navpanel-layout[data-dock="bottom"] .navpanel-handle::after
{
    left: 0;
    right: 0;
    top: 3px;
    height: 3px;
}

/* Lock Size: the edge stays hoverable but only the cursor changes. The padlock is drawn
   white with a dark outline so it reads on any background; 12 12 is its hotspot. */
.navpanel-layout[data-dock] .navpanel-handle.navpanel-handle-locked
{
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cg stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3' fill='none' stroke='%23000' stroke-width='4.5'/%3E%3Crect x='5' y='11' width='14' height='10' rx='2' fill='%23000' stroke='%23000' stroke-width='2.5'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3' fill='none' stroke='%23fff' stroke-width='2'/%3E%3Crect x='5' y='11' width='14' height='10' rx='2' fill='%23fff'/%3E%3Ccircle cx='12' cy='16' r='1.5' fill='%23000'/%3E%3C/g%3E%3C/svg%3E") 12 12, not-allowed;
}

.navpanel-handle-locked:hover::after
{
    background: transparent;
}

/* Held for the whole drag, so the cursor does not flicker over other elements. */
html.resizing-columns,
html.resizing-columns *
{
    cursor: col-resize !important;
    user-select: none !important;
}

html.resizing-rows,
html.resizing-rows *
{
    cursor: row-resize !important;
    user-select: none !important;
}



/* === Menu =============================================================== */

.menu
{
    position: fixed;
    z-index: 1000;
    min-width: 200px;
    padding: 6px;
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 10px 20px -2px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: var(--item-spacing);
    color: var(--item-color);
    font-family: var(--item-font);
    font-size: var(--item-font-size);
    animation: menu-in 0.16s cubic-bezier(0.2, 0, 0, 1);
    user-select: none;
}

.menu:focus-visible
{
    outline: none;
}

@keyframes menu-in
{
    from { opacity: 0; transform: scale(0.97); }
    to   { opacity: 1; transform: none; }
}

/* Same space on both ends: padding, mark, gap, label, then the same gap and padding
   again on the right, whether or not a help mark or arrow sits there. */
.menu-item
{
    --menu-inset: 10px;
    --menu-gap:   10px;

    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: var(--menu-gap);
    height: var(--item-height);
    padding: 0 var(--menu-inset);
    border-radius: var(--item-radius);
    white-space: nowrap;
    cursor: pointer;
    outline: none;
    transition: var(--item-transition);
}

/* Hover moves focus onto the item, so :focus is the hover look as well. */
.menu-item:focus-visible,
.menu-item:focus,
.menu-item-open
{
    background: var(--item-hover-bg);
    color: var(--item-hover-color);
}

.menu-item[aria-disabled="true"]
{
    color: #5b5b5b;
    cursor: default;
}

.menu-item[aria-disabled="true"]:focus
{
    background: transparent;
}

.menu-item-mark
{
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: var(--item-icon);
    height: var(--item-icon);
    color: var(--item-active-color);
}

.menu-item-label
{
    flex: 1 1 auto;
    padding-right: var(--menu-gap);
}

.menu-item-arrow
{
    display: flex;
    color: #8a8a8a;
}

/* Keeps its space while hidden, so revealing it on hover does not shift the row. */
.menu-item-help
{
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-left: calc(var(--menu-gap) * -1);
    border-radius: 50%;
    color: #8a8a8a;
    opacity: 0;
    cursor: help;
    transition: opacity 0.15s, color 0.15s;
}

.menu-item:hover .menu-item-help,
.menu-item:focus .menu-item-help,
.menu-item:focus-visible .menu-item-help
{
    opacity: 1;
}

.menu-item-help:hover
{
    color: var(--item-hover-color);
}

.menu-item:focus .menu-item-arrow,
.menu-item-open .menu-item-arrow
{
    color: inherit;
}

.menu-separator
{
    height: 1px;
    margin: 4px 0;
    background: #2e2e2e;
}



/* === Tooltip ============================================================ */

.tooltip
{
    position: fixed;
    z-index: 1100;
    padding: 6px 10px;
    background: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    color: #f3f4f6;
    font-family: "DM Sans", sans-serif;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    animation: tooltip-in 0.12s ease-out;
}

/* A fixed width, never shrink-to-fit: placed near the right edge, a fixed element with
   left set would otherwise wrap to whatever sliver of space remains. */
.tooltip-wide
{
    width: max-content;
    max-width: min(260px, calc(100vw - 16px));
    padding: 8px 12px;
    color: #d4d4d4;
    line-height: 1.45;
    white-space: normal;
}

@keyframes tooltip-in
{
    from { opacity: 0; }
    to   { opacity: 1; }
}



/* === Drop zones ========================================================= */

.drop-zones
{
    position: fixed;
    inset: 0;
    z-index: 900;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.drop-zones-active
{
    opacity: 1;
}

/* A marching dashed outline: four gradients, each sliding along its own edge. */
.drop-zone
{
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background:
        linear-gradient(90deg, #8b5cf6 50%, transparent 50%) repeat-x top    left / 16px 2px,
        linear-gradient(90deg, #8b5cf6 50%, transparent 50%) repeat-x bottom left / 16px 2px,
        linear-gradient(0deg,  #8b5cf6 50%, transparent 50%) repeat-y top    left / 2px 16px,
        linear-gradient(0deg,  #8b5cf6 50%, transparent 50%) repeat-y top    right / 2px 16px,
        rgba(124, 58, 237, 0.04);
    animation: drop-zone-march 0.8s linear infinite;
    transition: background-color 0.2s, transform 0.25s var(--navpanel-ease, ease);
    transform: scale(0.985);
}

.drop-zones-active .drop-zone
{
    transform: scale(1);
}

@keyframes drop-zone-march
{
    to
    {
        background-position: 16px 0, -16px 100%, 0 -16px, 100% 16px, 0 0;
    }
}

.drop-zone-current
{
    opacity: 0.35;
}

.drop-zone-hovered
{
    background-color: rgba(124, 58, 237, 0.1);
}

.drop-zone-label
{
    padding: 6px 12px;
    background: rgba(20, 20, 20, 0.85);
    border-radius: 9999px;
    color: #c4b5fd;
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    font-weight: 500;
}

.drop-zone-preview
{
    position: fixed;
    border-radius: 6px;
    background: rgba(124, 58, 237, 0.22);
    box-shadow: inset 0 0 0 2px #8b5cf6;
    transition: left 0.18s var(--navpanel-ease, ease), top 0.18s var(--navpanel-ease, ease),
                width 0.18s var(--navpanel-ease, ease), height 0.18s var(--navpanel-ease, ease);
}

html.dragging-to-zone,
html.dragging-to-zone *
{
    cursor: grabbing !important;
    user-select: none !important;
}

.visually-hidden
{
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* === Narrow viewports ================================================== */

/* The fixed 820px card cannot fit a phone, so below it the illustration is dropped
   and both views become a single full-width column. */
@media (max-width: 860px)
{
    .auth-frame
    {
        padding: 24px 12px;
    }

    .auth-card-login,
    .auth-card-signup
    {
        width: 100%;
        max-width: 520px;
        height: auto;
        padding: 0 20px 20px;
    }

    .auth-right
    {
        display: none;
    }

    .auth-left
    {
        width: 100%;
        padding-left: 0;
    }

    .auth-left > *,
    .auth-form-signup,
    .auth-error-signup
    {
        width: 100%;
    }

    .auth-title
    {
        margin: 30px 0 30px;
        font-size: 32px;
        line-height: 42px;
    }

    .auth-rules
    {
        flex-wrap: wrap;
        gap: 4px 16px;
    }

    .navigator
    {
        display: none;
    }
}
