/* Tester shell: the welcome card, the feedback form, the site Menu, the short footer and
   the owner-only rule (js/beta.js, js/feedback.js). Loaded by every tester page, including
   the landing and the exam room, so every colour has a fallback for pages that do not load
   css/exam-env.css. Willis Worxs design language: 8px grid, 24px inset, 24px radius, Inter
   with Libre Baskerville for the card title, three sizes and three weights per component. */

/* Owner and developer controls. Shown on a local server or to an owner profile only. */
html:not(.or-owner) .owner-only { display: none !important; }

/* The Menu carries Sign Out, and on a phone Sign In too; the bare pills step aside. */
html.or-menu #btn-signout,
html.or-has-profile #btn-signin { display: none; }
@media (max-width: 720px) {
    html.or-menu #btn-signin { display: none; }
    /* The page links move into the Menu on a phone: one header row, nothing off-screen. */
    html.or-menu .site-header .site-nav { display: none; }
}
button.site-header-cta { background: transparent; font-family: inherit; cursor: pointer; }

html.or-modal-open, html.or-modal-open body { overflow: hidden; }

/* ---------- Sheet and card (welcome, feedback): 20 / 16 / 14, 400 / 500 / 700 ---------- */
.or-sheet {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(5, 7, 10, 0.78);
    font-family: var(--font-sans);
}
.or-card {
    box-sizing: border-box;
    width: 100%;
    max-width: 560px;
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: 0;
    padding: 24px;
    background: var(--bg-2, #1c2128);
    border: 1px solid var(--line, #3d4450);
    border-radius: var(--radius, 24px);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
    color: var(--text, #e8eaed);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
}
.fb-card { max-width: 480px; }
.or-card-title {
    margin: 0 0 8px;
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text, #e8eaed);
}
.or-card-note { margin: 0 0 16px; color: #c9cfd6; }
.or-card a { color: #8cb4d4; }
.or-card-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}
.or-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    border: 1px solid var(--line, #3d4450);
    border-radius: var(--radius, 24px);
    background: transparent;
    color: var(--text, #e8eaed);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.or-btn:hover { border-color: var(--gold, #c9a227); }
.or-btn-primary { background: var(--gold, #c9a227); border-color: var(--gold, #c9a227); color: #1a1500; }
.or-btn-primary:hover { background: #d9b437; }
.or-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.or-btn:focus-visible, .or-card input:focus-visible, .or-card textarea:focus-visible { outline: 2px solid var(--gold, #c9a227); outline-offset: 2px; }

/* Welcome */
.welcome-h { margin: 16px 0 8px; font-size: 14px; font-weight: 700; line-height: 1.5; letter-spacing: 0; text-transform: none; color: var(--text, #e8eaed); }
.welcome-steps, .welcome-data { margin: 0 0 16px; padding-left: 24px; color: #c9cfd6; }
.welcome-steps li, .welcome-data li { margin: 0 0 8px; }
.welcome-agree {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-top: 8px;
    padding: 16px 0 0;
    border-top: 1px solid var(--line, #3d4450);
    font-weight: 500;
    cursor: pointer;
}
.welcome-agree input, .fb-include input { flex: 0 0 auto; width: 24px; height: 24px; margin: 0; accent-color: var(--gold, #c9a227); }

/* Feedback form */
.fb-kinds { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.fb-kind { position: relative; cursor: pointer; }
.fb-kind input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fb-kind span {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 24px;
    border: 1px solid var(--line, #3d4450);
    border-radius: var(--pill, 999px);
    font-weight: 500;
    color: var(--muted, #9aa0a6);
}
.fb-kind input:checked + span { border-color: var(--gold, #c9a227); color: var(--gold, #c9a227); }
.fb-kind input:focus-visible + span { outline: 2px solid var(--gold, #c9a227); outline-offset: 2px; }
.fb-label { display: block; margin: 0 0 8px; font-weight: 700; }
.fb-message {
    box-sizing: border-box;
    display: block;
    width: 100%;
    min-height: 128px;
    padding: 16px;
    border: 1px solid var(--line, #3d4450);
    border-radius: var(--radius, 24px);
    background: var(--bg, #12151a);
    color: var(--text, #e8eaed);
    font: inherit;
    font-size: 16px;
    line-height: 1.5;
    resize: vertical;
}
.fb-include { display: flex; align-items: center; gap: 16px; margin-top: 16px; font-weight: 500; cursor: pointer; }
.fb-status { margin: 8px 0 0; color: var(--muted, #9aa0a6); }
.fb-status:empty { display: none; }
.fb-status.bad { color: #ff8a8a; }

@media (max-width: 720px) {
    /* A sheet from the bottom on a phone, with the thumb-side actions full width. */
    .or-sheet { align-items: flex-end; padding: 0; }
    .or-card {
        max-width: none;
        max-height: calc(100dvh - 16px);
        border-radius: var(--radius, 24px) var(--radius, 24px) 0 0;
        border-bottom: 0;
        padding: 24px 24px calc(24px + env(safe-area-inset-bottom, 0px));
    }
    .or-card-actions { flex-direction: column-reverse; }
    .or-card-actions .or-btn { width: 100%; }
}

/* ---------- Site Menu in the header: 14 / 12, 500 ---------- */
.acct-menu { position: relative; flex: 0 0 auto; }
.acct-menu > summary { list-style: none; cursor: pointer; user-select: none; }
.acct-menu > summary::-webkit-details-marker { display: none; }
.acct-menu > summary::marker { content: ''; }
.acct-menu[open] > summary { border-color: var(--gold, #c9a227); color: var(--gold, #c9a227); }
.acct-pop {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 60;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: 240px;
    max-width: calc(100vw - 32px);
    padding: 8px;
    background: rgba(13, 16, 20, 0.98);
    border: 1px solid var(--line, #3d4450);
    border-radius: var(--radius, 24px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
    font-family: var(--font-sans);
}
.acct-email {
    margin: 0;
    padding: 8px 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: var(--muted, #99a1ab);
}
.acct-item {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 16px;
    border: 0;
    border-radius: var(--pill, 999px);
    background: transparent;
    color: var(--text, #e8eaed);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.acct-item:hover, .acct-item:focus-visible { background: #252b33; outline: none; }
.acct-item[hidden], .acct-email[hidden] { display: none; }
.acct-item[aria-current="page"] { color: var(--gold, #c9a227); }
/* The page links inside the Menu show on a phone only, where the header hides them. */
.acct-nav { display: none; }
@media (max-width: 720px) {
    .acct-nav { display: flex; flex-direction: column; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--line, #3d4450); }
    .acct-menu { order: 0; }
}

/* ---------- Footer on pages without one: 14 / 12, 400 / 500 ---------- */
.or-foot {
    box-sizing: border-box;
    max-width: 1040px;
    margin: 0 auto;
    padding: 24px 24px 48px;
    border-top: 1px solid var(--line, #3d4450);
    font-family: var(--font-sans);
    font-size: 14px;
}
.or-foot-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0 24px; }
.or-foot-inner a, .or-foot-btn {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #8cb4d4;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}
.or-foot-inner a:hover, .or-foot-btn:hover { text-decoration: underline; }
.or-foot-note { margin: 8px 0 0; font-size: 12px; color: var(--muted, #9aa0a6); }
@media (max-width: 720px) {
    .or-foot { padding: 24px 16px 48px; }
}

/* ---------- Exam room: feedback inside the Leave sheet ---------- */
.leave-card .leave-link {
    align-self: center;
    min-height: 44px;
    padding: 0 16px;
    border: 0;
    background: transparent;
    color: var(--muted, #9aa0a6);
    font: inherit;
    font-size: var(--t-sm, 14px);
    font-weight: var(--w-medium, 500);
    cursor: pointer;
}
.leave-card .leave-link:hover { color: var(--text, #e8eaed); }

/* ---------- Document pages (privacy.html, help.html) ---------- */
.doc p, .doc li { max-width: 720px; color: #c9cfd6; }
.doc p { margin: 0 0 16px; }
.doc ul, .doc ol { margin: 0 0 16px; padding-left: 24px; }
.doc li { margin: 0 0 8px; }
.doc b { color: var(--text, #e8eaed); font-weight: 500; }
.doc a { color: #8cb4d4; }
.doc h3 { margin: 24px 0 8px; font-size: 16px; font-weight: 700; color: var(--text, #e8eaed); }
.doc code { font-family: var(--font-mono); font-size: 13px; padding: 0 4px; border-radius: 4px; background: var(--bg-2, #1c2128); overflow-wrap: anywhere; }
.doc h2[id] { scroll-margin-top: 104px; }
.doc-toc { display: flex; flex-wrap: wrap; gap: 0 24px; margin: 0 0 8px; }
.doc-toc a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 500; text-decoration: none; }
.doc-toc a:hover { text-decoration: underline; }

/* Login: the line under the form pointing at Privacy and Help. */
.auth-terms { max-width: 420px; margin: 8px 0 0; font-size: 14px; color: var(--muted, #9aa0a6); }
.auth-terms a { color: #8cb4d4; }
.auth-join { margin-top: 16px; }
