/* ==========================================================================
   Stacq Sites: design system and styles
   Copied from the portal's static/css/style.css (portal commit 684f4ff,
   2026-09-27) so the two halves of the platform look the same: tokens, base,
   navigation, flash messages, auth card, cards, forms and buttons. Changes
   from the portal: no inline styles anywhere (the CSP forbids them), and the
   sign-out control is a POST form styled as a nav link.
   Primary: #eb7b57 | Border radius: 10px | Fonts: Poppins, Inter
   A white-label brand overrides the tokens in :root (branding.py).
   ========================================================================== */

/* ----- Reset & base ----- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #eb7b57;
    --primary-dark: #d4653e;
    --primary-light: #f5a689;
    --primary-bg: #fef3ef;
    --dark: #1a1a2e;
    --dark-2: #2d2d44;
    --gray-900: #111827;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
    --white: #ffffff;
    --green: #10b981;
    --green-bg: #ecfdf5;
    --red: #ef4444;
    --red-bg: #fef2f2;
    --yellow: #f59e0b;
    --yellow-bg: #fffbeb;
    --blue: #3b82f6;
    --blue-bg: #eff6ff;
    --radius: 10px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: 0.2s ease;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #fafcfa;
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

.material-symbols-outlined {
    font-size: inherit;
    vertical-align: middle;
    line-height: 1;
}

/* ----- Navigation ----- */
.main-nav {
    background: #fafcfa;
    border-bottom: 2px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nav-logo {
    height: 52px;
    width: auto;
    vertical-align: middle;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--gray-900);
    font-weight: 700;
    font-size: 1.25rem;
}

.nav-product {
    color: var(--gray-500);
    font-size: 0.95rem;
    font-weight: 600;
    padding-left: 0.75rem;
    border-left: 2px solid var(--gray-200);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-right form {
    display: flex;
}

.nav-user {
    color: var(--gray-600);
    font-size: 0.875rem;
}

.nav-link {
    color: var(--gray-600);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all var(--transition);
}

.nav-link:hover {
    color: var(--primary);
    background: rgba(235, 123, 87, 0.08);
}

.nav-logout {
    color: var(--primary);
}

/* ----- Flash messages ----- */
.flash-container {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 1.5rem;
}

.flash-container--auth {
    max-width: 440px;
    padding: 0;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.flash-success {
    background: var(--green-bg);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.flash-error {
    background: var(--red-bg);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.flash-info {
    background: var(--blue-bg);
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.flash-warning {
    background: var(--yellow-bg);
    color: #92400e;
    border: 1px solid #fde68a;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ----- Main content ----- */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

/* ----- Auth pages ----- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: #fafcfa;
}

.auth-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
    animation: fadeUp 0.4s ease;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.auth-logo {
    height: 40px;
    width: auto;
}

.auth-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.02em;
}

.auth-subtitle {
    color: var(--gray-500);
    font-size: 0.95rem;
}

.auth-card--center .auth-header {
    margin-bottom: 1.5rem;
}

.auth-card--center {
    text-align: center;
}

.error-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
    color: var(--yellow);
}

.error-icon--404 {
    color: var(--blue);
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ----- Dashboard ----- */
.dashboard {
    padding: 2rem 0;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.dashboard-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.02em;
}

.dashboard-subtitle {
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* ----- Cards ----- */
.card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    animation: fadeUp 0.4s ease;
    border: 1px solid var(--gray-200);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.empty-state {
    text-align: center;
    color: var(--gray-500);
    padding: 3rem 1.5rem;
}

.empty-state .material-symbols-outlined {
    font-size: 2.5rem;
    color: var(--gray-400);
    display: block;
    margin-bottom: 0.5rem;
}

/* ----- Forms ----- */
.form-group {
    margin-bottom: 1rem;
    overflow: hidden;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.35rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--gray-900);
    background: var(--white);
    transition: all var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(235, 123, 87, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--gray-400);
}

/* ----- Buttons ----- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: var(--white);
    color: var(--gray-700);
    border: 1.5px solid var(--gray-300);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
}

.btn-ghost {
    background: none;
    color: var(--gray-600);
    padding: 0.4rem 0.75rem;
}

.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
}

.btn-full {
    width: 100%;
}

.btn-lg {
    padding: 0.8rem 1.25rem;
    font-size: 0.95rem;
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
    .main-content {
        padding: 0 1rem 2rem;
    }

    .dashboard-header {
        flex-direction: column;
    }

    .auth-wrapper {
        justify-content: flex-start;
        min-height: auto;
        padding: 1.5rem 1rem;
    }

    .auth-card {
        padding: 1.5rem;
    }

    .nav-inner {
        padding: 14px 16px;
    }

    .nav-logo {
        height: 30px;
    }

    .nav-right {
        gap: 0.5rem;
    }

    .nav-user,
    .nav-product {
        display: none;
    }
}

/* ----- Sign-in code page -----
   From the portal's templates/verify_2fa.html (inline styles there, moved
   here because this app's CSP allows no inline styles). */
.verify-card {
    max-width: 460px;
    text-align: center;
}

.verify-card .auth-brand {
    margin-bottom: 1.5rem;
}

.verify-icon {
    font-size: 48px;
    color: #059669;
    display: block;
    margin-bottom: 1rem;
}

.verify-title {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px 0;
}

.verify-subtitle {
    font-size: 15px;
    color: #64748b;
    margin: 0 0 24px 0;
    line-height: 1.6;
}

.verify-subtitle strong {
    color: #1e293b;
}

.code-inputs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
}

.code-inputs input {
    width: 52px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s;
    font-family: 'Inter', sans-serif;
    color: #1e293b;
    background: #f8fafc;
}

.code-inputs input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(235, 123, 87, 0.15);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.resend-section {
    margin-top: 24px;
    font-size: 14px;
    color: #94a3b8;
}

.resend-line {
    margin-top: 0.75rem;
}

.inline-form {
    display: inline;
}

.link-button {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    text-decoration: underline;
    font-family: inherit;
    padding: 0;
}

.link-button:hover {
    color: #fa702e;
}

.timer {
    display: inline-block;
    color: #64748b;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.verify-note {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-top: 20px;
    padding: 12px 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    text-align: left;
    font-size: 13px;
    color: #1e40af;
    line-height: 1.5;
}

.verify-note .material-symbols-outlined {
    font-size: 18px;
    margin-top: 1px;
}

.verify-note--staging {
    margin: 0 0 20px 0;
    background: var(--yellow-bg);
    border-color: #fde68a;
    color: #92400e;
}

.nowrap {
    white-space: nowrap;
}

.back-to-login {
    margin-top: 20px;
    font-size: 13px;
}

.back-to-login a {
    font-weight: 500;
}

@media (max-width: 480px) {
    .verify-title {
        font-size: 20px;
    }

    .code-inputs {
        gap: 6px;
    }

    .code-inputs input {
        width: 42px;
        height: 50px;
        font-size: 20px;
        border-radius: 10px;
    }
}

/* ----- Tables, badges and status pills -----
   From the portal's style.css (portal commit 684f4ff, 2026-09-27). */
.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
}

.data-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
    white-space: nowrap;
}

.data-table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.data-table td.wrap {
    white-space: normal;
}

.status-pill {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    text-transform: capitalize;
}

.status-live,
.status-published,
.status-done {
    background: var(--green-bg);
    color: #065f46;
}

.status-draft,
.status-queued {
    background: var(--gray-100);
    color: var(--gray-600);
}

.status-publishing,
.status-running {
    background: var(--blue-bg);
    color: #1d4ed8;
}

.status-offline {
    background: var(--yellow-bg);
    color: #92400e;
}

.status-failed {
    background: var(--red-bg);
    color: #991b1b;
}

/* ----- Admin pages ----- */
.header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.header-actions form {
    display: inline;
}

.btn .material-symbols-outlined,
.card-title .material-symbols-outlined {
    font-size: 1.15em;
}

.muted {
    color: var(--gray-500);
}

.small {
    font-size: 0.8rem;
}

.site-address {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.admin-grid > .card {
    margin-bottom: 0;
}

.stack > * + * {
    margin-top: 1.5rem;
}

.inline-fields {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.inline-fields .form-group {
    flex: 1 1 200px;
    margin-bottom: 0;
}

.form-card {
    max-width: 560px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.35rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

@media (max-width: 900px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.back-link:hover {
    color: var(--primary);
}

/* Grid and flex children default to their content's width, so a wide table
   pushed the whole page sideways on a phone. Let them shrink; the table
   scrolls inside its card (.table-wrap). */
.admin-grid > *,
.stack > *,
.card {
    min-width: 0;
}

/* Respect a device's reduce-motion setting (accessibility). */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* Buttons beside an input line up with it. */
.inline-fields .btn {
    min-height: 42px;
}

/* Preview links on a site's page */
.preview-row {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--gray-200);
}

.preview-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.preview-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0.5rem 0;
}

.preview-links form {
    display: inline;
}

.preview-url {
    color: var(--gray-500);
    word-break: break-all;
    margin-bottom: 0.75rem;
}

/* Pages on a site's page, "See all" links and the pager */
.page-depth-1 { padding-left: 1.25rem; }
.page-depth-2 { padding-left: 2.5rem; }
.page-depth-3 { padding-left: 3.75rem; }

.row-actions {
    white-space: nowrap;
    text-align: right;
}

.see-all {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.see-all:hover { text-decoration: underline; }

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* Template choices on the New Site form */
.template-choices { border: 0; padding: 0; margin: 0 0 1.25rem; }
.template-choices legend { font-weight: 600; margin-bottom: 0.5rem; color: var(--gray-700); }
.template-choices .template-choice {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius, 10px);
    margin-bottom: 0.5rem;
    cursor: pointer;
}
.template-choice:has(input:checked) { border-color: var(--primary); background: var(--primary-bg); }
.template-choice input[type="radio"] { width: auto; flex: none; margin: 0.2rem 0 0; padding: 0; }
.template-choice strong { display: block; color: var(--gray-900); }
.template-choice small { display: block; color: var(--gray-500); line-height: 1.4; }

.export-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0 0;
}

.redirect-form .form-group { flex: 1 1 180px; }

/* Form messages */
.submission { margin-bottom: 0.75rem; }
.submission-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.submission-head form { margin-left: auto; }
.submission-fields { display: grid; grid-template-columns: minmax(90px, max-content) 1fr; gap: 0.35rem 1rem; margin: 0.75rem 0 0; }
.submission-fields dt { font-weight: 600; color: var(--gray-700); font-size: 0.875rem; }
.submission-fields dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
@media (max-width: 480px) { .submission-fields { grid-template-columns: 1fr; } .submission-fields dd { margin-bottom: 0.5rem; } }

/* Custom domains */
.domain-setup { margin: 0.25rem 0 1.25rem; padding: 0.75rem 1rem; border-left: 3px solid var(--gray-200); }
.domain-setup .inline-fields { margin-top: 0.5rem; }
.dns-records code { font-size: 0.8rem; word-break: break-all; }
.error-text { color: #b91c1c; }

.portal-form .form-group { flex: 1 1 200px; }

/* The header keeps each link on one line; on phones the name gives way. */
.nav-link { white-space: nowrap; }
@media (max-width: 480px) {
    .nav-user { display: none; }
    .nav-right { gap: 0.25rem; }
    /* Six links in the admin (Issue Reports made the sixth) fit a 390px phone beside the logo. */
    .nav-link { padding: 0.4rem 0.3rem; }
}

/* Wide tables scroll sideways on phones rather than squeezing a column. */
#events .data-table { min-width: 860px; }
#redirects .data-table { min-width: 560px; }

/* AI jobs */
.filter-tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-bottom: 1rem; }
.filter-tab { padding: 0.4rem 0.9rem; border-radius: 999px; color: var(--gray-600); text-decoration: none; font-size: 0.875rem; font-weight: 500; }
.filter-tab.active, .filter-tab:hover { background: var(--primary-bg, #fef3ef); color: var(--primary); }
.status-job-queued, .status-job-claimed, .status-job-running { background: #eff6ff; color: #1d4ed8; }
.status-job-needs_review { background: #fffbeb; color: #b45309; }
.status-job-approved { background: #ecfdf5; color: #047857; }
.status-job-rejected, .status-job-cancelled { background: var(--gray-100); color: var(--gray-600); }
.status-job-failed { background: #fef2f2; color: #b91c1c; }
.job-list { list-style: none; margin: 1rem 0 0.5rem; padding: 0; display: grid; gap: 0.4rem; }
.job-list li { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
/* Wide enough that "Faithful: match the old site" shows whole (they wrap sooner). */
.new-job .inline-fields .form-group { flex: 1 1 260px; }
.review-actions { display: grid; gap: 1rem; margin-top: 1rem; }
.review-actions .send-back { display: grid; gap: 0.5rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0; }
.facts dt { font-weight: 600; color: var(--gray-700); }
.facts dd { margin: 0; }
.facts + .table-wrap { margin-top: 1rem; }
.qa-facts { margin-top: 0.75rem; }
/* On phones a finding's severity and state move under its title, so nothing hides off to the side. */
.finding-meta { display: none; }
@media (max-width: 767px) {
  .findings-table th:nth-child(n+3), .findings-table td:nth-child(n+3) { display: none; }
  .finding-meta { display: block; margin-top: 0.25rem; font-size: 0.8rem; color: var(--gray-600); }
}
.plain-list { margin: 0; padding-left: 1.25rem; }
.plain-list li { margin: 0 0 0.5rem; line-height: 1.5; }
#job-redirects form { margin-top: 1rem; }
.pre-wrap { white-space: pre-wrap; word-break: break-word; }
.check-row { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.check-row input { width: auto; }
/* A client's business details (client_details.py, templates/client/details.html). */
.auth-card.details-card { max-width: 560px; }
.details-intro { margin: 0 0 1.25rem; color: #475569; line-height: 1.6; }
.details-sent { display: flex; gap: 0.75rem; align-items: flex-start; margin: 0 0 1.25rem; padding: 0.875rem 1rem; border-radius: 12px; background: #ecfdf5; color: #065f46; }
.details-sent p { margin: 0; line-height: 1.5; }
.details-social { margin: 0 0 1rem; padding: 0; border: 0; }
.details-social legend { margin-bottom: 0.5rem; font-weight: 600; }
.details-list { list-style: none; margin: 0.75rem 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
#details-onboarding-note { margin-top: 0.5rem; }
.details-item { border: 1px solid #e5e7eb; border-radius: 12px; padding: 0.875rem 1rem; }
.details-answers { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.25rem 0.875rem; margin: 0.5rem 0; }
.details-answers dt { font-weight: 600; color: #334155; }
.details-answers dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* The site page's Staff Emails card (staff_alerts.py). */
.staff-alerts-list { display: flex; flex-direction: column; gap: 0.25rem; margin: 0.75rem 0; }
.staff-alert-row { margin-bottom: 0; overflow-wrap: anywhere; }
.token-display { display: block; padding: 0.75rem; border-radius: 8px; background: var(--gray-100); word-break: break-all; font-size: 0.9rem; }

/* Header links: words on wider screens, icons on phones. */
.nav-link { display: inline-flex; align-items: center; gap: 0.3rem; }
.nav-icon { display: none; font-size: 22px; }
@media (max-width: 560px) {
    .nav-icon { display: inline; }
    .nav-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ----- Client editors (client_editing_plan.md, 10a) ----- */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.block { display: block; }
.status-invited { background: var(--blue-bg); color: #1d4ed8; margin-left: 0.4rem; }
.status-off { background: var(--gray-100); color: var(--gray-600); margin-left: 0.4rem; }
.inline-select { display: flex; gap: 0.5rem; align-items: center; }
.inline-select select { min-width: 0; max-width: 16rem; }
.editors-table td { vertical-align: middle; }
.invite-form { margin-top: 1rem; }
.auth-footer { margin: 1.25rem 0 0; text-align: center; font-size: 0.9rem; }
.client-sites { display: grid; gap: 1rem; }
.client-site { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.client-site-name { margin: 0 0 0.25rem; font-size: 1.15rem; }
.client-site-main p { margin: 0 0 0.25rem; }
@media (max-width: 480px) {
  .client-site .btn { width: 100%; justify-content: center; }
  .inline-select { flex-wrap: wrap; }
}
.publish-request { padding: 0.75rem 0; border-top: 1px solid var(--gray-200); }
.publish-request p { margin: 0 0 0.5rem; }
.request-note { background: var(--gray-50); border-radius: 8px; padding: 0.6rem 0.8rem; }
.decline-form { display: flex; gap: 0.5rem; align-items: flex-start; }
.decline-form .form-group { flex: 1; min-width: 0; margin: 0; }
@media (max-width: 480px) { .decline-form { flex-direction: column; align-items: stretch; } }
#publish-requests > form { margin-top: 0.75rem; }
.comment-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.comment-list li { padding: 0.75rem 0; border-top: 1px solid var(--gray-200); }
.comment-list p { margin: 0.35rem 0 0.5rem; }
.comment-head a { word-break: break-all; }
/* A white-label agency with no logo shows its name (templates/_brand_logo.html). */
.brand-name { display: inline-block; font-family: 'Poppins', sans-serif; font-weight: 700; color: var(--gray-900); line-height: 1.2; }
.auth-logo.brand-name { font-size: 1.6rem; }
.nav-logo.brand-name { font-size: 1.15rem; }
.agency-logo-preview img { max-width: 200px; max-height: 80px; border: 1px solid var(--gray-200); border-radius: 8px; padding: 8px; background: #fff; }
.client-site-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.client-changes { flex-basis: 100%; border-top: 1px solid var(--gray-200); padding-top: 0.75rem; }
.client-changes-title { margin: 0 0 0.5rem; font-size: 0.95rem; }
.client-changes .status-pill { text-transform: none; }
.change-text { font-size: 0.9rem; color: var(--gray-700); }
.approve-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
@media (max-width: 480px) { .client-site-actions { width: 100%; } .client-site-actions .btn { flex: 1 1 100%; justify-content: center; } }

/* Form Messages search (templates/client/messages.html, admin/site_submissions.html). */
.messages-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; margin-bottom: 16px; }
.messages-search input[type="search"] { flex: 1 1 220px; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid #d1d5db; border-radius: 10px; font: 14px 'Inter', sans-serif; }
.messages-search input[type="search"]:focus { outline: none; border-color: #eb7b57; }
/* The Editors card (templates/admin/site_detail.html; permissions.py). */
.editor-list { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.editor-item { border: 1px solid var(--border, #e5e7eb); border-radius: 12px; padding: 0.75rem 1rem; }
.editor-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.5rem 1rem; }
.editor-who { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.editor-access { flex: 1 1 220px; min-width: 0; }
.editor-head .row-actions { flex: 0 0 auto; }
.access-edit { margin-top: 0.5rem; }
.access-edit > summary { list-style: none; display: inline-flex; cursor: pointer; }
.access-edit > summary::-webkit-details-marker { display: none; }
.access-edit[open] > summary { margin-bottom: 0.75rem; }
.access-list { border: 0; margin: 0 0 0.75rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.5rem 1.25rem; }
.access-list legend { padding: 0; margin-bottom: 0.5rem; }
.access-list .check-row { align-items: flex-start; }
.access-list input:disabled + span { opacity: 0.55; }
.invite-form .inline-fields { margin-bottom: 0.5rem; }
.editor-head .row-actions { display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.details-code { display: block; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; background: var(--gray-50, #f9fafb); padding: 6px 8px; border-radius: 6px; }

/* ----- Admin QA fixes (2026-09-29) ----- */
/* The confirmation before a button that takes something away (static/js/confirm.js).
   Looks like the portal's modals (templates/partials/_partner_qr_modal.html:
   white card, 16px corners, 32px padding, a dark overlay). */
.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover { background: #dc2626; color: var(--white); transform: translateY(-1px); }
.confirm-dialog {
    border: none;
    border-radius: 16px;
    padding: 32px;
    width: 90%;
    max-width: 420px;
    margin: auto;
    background: var(--white);
    color: var(--gray-900);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}
.confirm-dialog::backdrop { background: rgba(0, 0, 0, 0.5); }
.confirm-message { margin: 0 0 1.5rem; font-size: 1rem; line-height: 1.55; color: #0f172a; overflow-wrap: anywhere; }
.confirm-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 0.75rem; }
@media (max-width: 480px) {
    .confirm-dialog { padding: 24px; }
    .confirm-actions .btn { flex: 1 1 auto; }
}

/* Error pages whose heading is words, not a number (429). */
.error-title { font-size: 1.6rem; }

/* The Addresses card: one block per address, apart from the next. */
.host-row + .host-row { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--gray-200); }
.host-head { margin-bottom: 0.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; }
#add-domain-form { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--gray-200); }

/* A select beside its button (the site page's Agency card) looks like the form selects. */
.inline-select select {
    padding: 0.55rem 0.85rem;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--gray-900);
    background: var(--white);
}
.inline-select select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(235, 123, 87, 0.15); }
.inline-select .btn { min-height: 40px; }

/* The Editors card: the set's note, and the Access line of the add form. */
.access-note { margin: -0.5rem 0 0.75rem; }
.access-summary { white-space: normal; text-align: left; }

/* The job page's review: both approve buttons the same height; Send Back its own width. */
.approve-actions .btn { min-height: 42px; }
.review-actions .send-back .btn { justify-self: start; }

/* Sites list: the search's count, and on phones and tablets the other columns fold under the name. */
.sites-found { margin: 0 0 0.75rem; }
.site-meta { display: none; }
@media (max-width: 800px) {
    #sites-table th:nth-child(n+2), #sites-table td:nth-child(n+2) { display: none; }
    #sites-table td.site-cell { white-space: normal; }
    .site-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; margin-top: 0.25rem; }
    .site-meta-host { flex-basis: 100%; font-size: 0.8rem; color: var(--gray-600); overflow-wrap: anywhere; }
}

/* Targets at least 24px tall (WCAG 2.5.8): short links and native tick boxes. */
.auth-footer a, .jobs-table td a, .job-list a { display: inline-block; min-height: 24px; line-height: 24px; }
.jobs-table td:first-child a { min-width: 24px; }
.check-row input[type="checkbox"] { width: 18px; height: 18px; flex: none; }

/* The portal sign-in test page sits in the page like the others. */
#sign-in-link { margin-top: 2rem; max-width: 560px; }
#sign-in-link form { margin: 1rem 0; }
/* A tick box's label that wraps keeps the box beside its first line. */
.check-row { align-items: flex-start; }
.check-row input[type="checkbox"] { margin-top: 3px; }
.host-ready { margin-bottom: 1rem; }
.host-ready .check-row { margin-bottom: 0; }
.host-ready .form-hint { margin-left: calc(18px + 0.5rem); }
.host-ready .check-row span { font-size: 0.875rem; font-weight: 600; color: var(--gray-700); }
/* Revisions and Backups on phones: times wrap and cells tighten, so Restore stays in view. */
.when-cell { min-width: 7rem; }
@media (max-width: 480px) {
    #revisions .data-table th, #revisions .data-table td,
    #backups .data-table th, #backups .data-table td { padding: 0.6rem 0.45rem; }
    /* A backup's revision is in its Restore question; a revision's source waits for a wider screen. */
    #backups .data-table th:nth-child(2), #backups .data-table td:nth-child(2),
    #revisions .data-table th:nth-child(2), #revisions .data-table td:nth-child(2) { display: none; }
}
/* The sites list: long names and addresses wrap rather than push the last column out of the card. */
#sites-table td:nth-child(-n+2) { white-space: normal; min-width: 10rem; }
#sites-table td .site-address { overflow-wrap: anywhere; }
