:root {
    --bg: #060608;
    --panel: #0d0d12;
    --text: #f5f5f7;
    --dim: rgba(255, 255, 255, 0.64);
    --faint: rgba(255, 255, 255, 0.5);
    --line: rgba(255, 255, 255, 0.08);
    --accent: #60a5fa;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(90% 60% at 50% -10%, rgba(59, 130, 246, 0.12), transparent 60%),
        var(--bg);
    color: var(--text);
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--accent);
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 3px;
    border-radius: 5px;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 10;
    padding: 10px 14px;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 14px;
}

.page-header {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: -0.01em;
    font-size: 0.98rem;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border-radius: 7px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.3);
}

.brand-mark svg {
    width: 16px;
    height: 16px;
}

.back-link {
    color: var(--dim);
    text-decoration: none;
    font-size: 0.86rem;
    padding: 8px 11px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.back-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--line);
}

.header-nav {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 12px 24px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.header-nav a {
    padding: 7px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--dim);
    font-size: 0.84rem;
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.header-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--line);
}

.header-nav a[aria-current="page"] {
    color: #fff;
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.35);
}

.legal-main {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    padding: clamp(36px, 7vw, 72px) 24px 8px;
}

.eyebrow {
    margin: 0 0 12px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #93c5fd;
}

h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
    font-weight: 600;
    color: #fff;
}

.last-updated {
    margin: 14px 0 0;
    font-size: 0.84rem;
    color: var(--faint);
}

.legal-body {
    margin-top: 36px;
    font-size: 1.01rem;
    line-height: 1.85;
    color: var(--dim);
}

.legal-body p + p {
    margin-top: 16px;
}

.legal-body h2 {
    margin: 34px 0 10px;
    font-size: 1.3rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
    font-weight: 600;
    color: #fff;
}

.legal-body h3 {
    margin: 24px 0 8px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
}

.legal-body strong {
    color: #fff;
    font-weight: 600;
}

.legal-body ul,
.legal-body ol {
    margin: 16px 0;
    padding-left: 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legal-body a {
    color: #93c5fd;
    text-decoration: underline;
    text-decoration-color: rgba(147, 197, 253, 0.35);
    text-underline-offset: 3px;
}

.legal-body a:hover {
    color: #fff;
}

.legal-body code {
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.07);
    color: #bfdbfe;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.86em;
}

.legal-body blockquote {
    margin: 24px 0;
    padding: 16px 20px;
    border-left: 3px solid #3b82f6;
    border-radius: 0 12px 12px 0;
    background: rgba(59, 130, 246, 0.08);
    color: #dbeafe;
    font-style: italic;
}

.contact-form {
    margin: 28px 0 8px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.025);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.form-field > span {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #dbeafe;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(4, 4, 8, 0.75);
    color: var(--text);
    font: inherit;
    font-size: 0.92rem;
    line-height: 1.5;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: rgba(255, 255, 255, 0.32);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: rgba(96, 165, 250, 0.7);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
    background: rgba(4, 4, 8, 0.95);
}

.form-field textarea {
    resize: vertical;
    min-height: 150px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 2px;
}

.form-status {
    min-height: 1.4em;
    margin: 0;
    font-size: 0.86rem;
    color: #93c5fd;
}

.form-note {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--faint);
}

.legal-cta {
    margin-top: 44px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 11px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(37, 99, 235, 0.36);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: none;
}

.site-footer {
    width: 100%;
    max-width: 1080px;
    margin: clamp(44px, 7vw, 82px) auto 0;
    padding-top: 26px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 18px;
    text-align: left;
}

.site-footer .footer-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
    flex-wrap: wrap;
}

.site-footer .footer-brand strong {
    font-size: 0.98rem;
    font-weight: 600;
    color: #fff;
}

.site-footer .footer-brand p {
    margin-top: 7px;
    max-width: 38ch;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--faint);
}

.site-footer .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
    justify-content: flex-end;
}

.site-footer .footer-links a,
.site-footer .footer-links button {
    padding: 6px 9px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--faint);
    font-family: inherit;
    font-size: 0.8rem;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.site-footer .footer-links a:hover,
.site-footer .footer-links button:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.site-footer .footer-links a[aria-current="page"] {
    color: #fff;
}

/* Same desktop copyright guarantee as the app pages. */
@media (min-width: 981px) {
    .site-footer .footer-top {
        flex-wrap: nowrap;
    }
    .site-footer .footer-brand {
        flex: 0 0 auto;
        min-width: max-content;
    }
    .site-footer .footer-brand p {
        max-width: none;
        white-space: nowrap;
    }
    .site-footer .footer-links {
        flex: 0 1 auto;
        min-width: 0;
    }
}

@media (max-width: 980px) {
    .site-footer .footer-top {
        flex-direction: column;
    }
    .site-footer .footer-links {
        justify-content: flex-start;
    }
    .consent-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding: 16px;
    }
    .consent-actions {
        width: 100%;
        justify-content: stretch;
    }
    .consent-actions .btn-primary,
    .consent-actions .btn-ghost {
        flex: 1;
    }
}

/* Consent banner (wired by site-chrome.js on these pages). */
.consent-banner {
    position: fixed;
    left: 50%;
    bottom: max(18px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 140;
    width: min(920px, calc(100vw - 32px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
    padding: 18px 20px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(12, 13, 20, 0.96);
    backdrop-filter: blur(20px);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.72), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.consent-banner[hidden] {
    display: none;
}

.consent-copy {
    flex: 1;
    min-width: 0;
    max-width: none;
}

.consent-copy strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.98rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: #fff;
}

.consent-copy p {
    margin: 0;
    max-width: none;
    font-size: 0.8rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.6);
}

.consent-copy a {
    color: #93c5fd;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.consent-copy a:hover {
    color: #bfdbfe;
}

.consent-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.consent-actions .btn-primary,
.consent-actions .btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.consent-actions .btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    border-color: rgba(96, 165, 250, 0.55);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.34);
}

.consent-actions .btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.82);
    border-color: rgba(255, 255, 255, 0.14);
}

.consent-actions .btn-ghost:hover {
    color: #fff;
    border-color: rgba(59, 130, 246, 0.38);
    background: rgba(59, 130, 246, 0.08);
}

@media (max-width: 620px) {
    .page-header {
        padding: 16px 18px;
        align-items: flex-start;
    }

    .header-nav {
        padding: 10px 18px 0;
    }

    .legal-main {
        padding: 32px 18px 8px;
    }

    .legal-body {
        font-size: 0.98rem;
    }

    .legal-body h2 {
        font-size: 1.2rem;
    }

    .contact-form {
        padding: 18px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
    }
}

/* ============================================================
   ABOUT — WIDE WORKBENCH LAYOUT
   Scoped to about.html so the legal pages keep their narrow column.
   ============================================================ */
.about-page .page-header,
.about-page .header-nav,
.about-page .site-footer {
    max-width: 1240px;
}

.about-main {
    max-width: 1240px;
}

.about-head {
    max-width: 820px;
}

.about-lede {
    margin: 18px 0 0;
    max-width: 70ch;
    font-size: 1.02rem;
    color: var(--dim);
}

.about-intro {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
    gap: 16px;
    margin-top: 40px;
}

.about-panel {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(160deg, rgba(20, 21, 28, 0.82), rgba(9, 9, 13, 0.92));
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
}

.about-panel h2 {
    margin: 0 0 12px;
    font-size: 1.2rem;
    line-height: 1.3;
    color: #fff;
}

.about-panel p {
    margin: 0;
    color: var(--dim);
}

.about-panel p + p {
    margin-top: 12px;
}

.about-panel a {
    color: #93c5fd;
    text-decoration-color: rgba(147, 197, 253, 0.35);
    text-underline-offset: 3px;
}

.about-section {
    margin-top: 52px;
}

.about-section-head {
    margin-bottom: 18px;
    max-width: 760px;
}

.about-section-head h2 {
    margin: 0;
    font-size: clamp(1.45rem, 3vw, 1.9rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #fff;
}

.about-section-head p {
    margin: 10px 0 0;
    color: var(--dim);
}

.about-tool-grid,
.about-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.about-tool-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(23, 24, 30, 0.9), rgba(11, 11, 15, 0.95));
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
    color: inherit;
    text-decoration: none;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.about-tool-card:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}

.about-tool-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.22);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0.06));
    color: #93c5fd;
}

.about-tool-icon svg {
    width: 21px;
    height: 21px;
}

.about-tool-card h3 {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 600;
    color: #fff;
}

.about-tool-card p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--dim);
    line-height: 1.6;
}

.about-tool-card .about-card-link {
    margin-top: auto;
    font-size: 0.8rem;
    color: #93c5fd;
}

.about-feature h3 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    color: #fff;
}

.about-feature p {
    font-size: 0.88rem;
}

.about-contact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px;
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 16px;
    background: linear-gradient(120deg, rgba(59, 130, 246, 0.1), rgba(9, 9, 13, 0.92) 60%);
}

.about-contact h2 {
    margin: 0 0 8px;
    font-size: 1.35rem;
    color: #fff;
}

.about-contact p {
    margin: 0;
    color: var(--dim);
}

.about-contact p a {
    color: #93c5fd;
}

.about-contact p + p {
    margin-top: 10px;
}

.about-contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
}

@media (max-width: 980px) {
    .about-intro {
        grid-template-columns: 1fr;
    }

    .about-tool-grid,
    .about-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .about-tool-grid,
    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-panel {
        padding: 18px;
    }

    .about-contact {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================================
   TERMS — WIDE WORKBENCH LAYOUT
   Shares the workbench cards with the About page, scoped to terms.html.
   ============================================================ */
.terms-page .page-header,
.terms-page .header-nav,
.terms-page .site-footer {
    max-width: 1240px;
}

.terms-main {
    max-width: 1240px;
}

.terms-lede {
    margin: 18px 0 0;
    max-width: 70ch;
    font-size: 1.02rem;
    color: var(--dim);
}

.terms-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.terms-panel h2 {
    margin: 0 0 10px;
    font-size: 1.05rem;
    line-height: 1.3;
    color: #fff;
}

.terms-panel ul {
    margin: 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--dim);
}

.terms-panel li {
    font-size: 0.88rem;
    line-height: 1.6;
}

@media (max-width: 980px) {
    .terms-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

/* ============================================================
   COOKIES — WIDE WORKBENCH LAYOUT
   Shares the workbench cards with the About and Terms pages.
   ============================================================ */
.cookies-page .page-header,
.cookies-page .header-nav,
.cookies-page .site-footer {
    max-width: 1240px;
}

.cookies-main {
    max-width: 1240px;
}

.cookies-lede {
    margin: 18px 0 0;
    max-width: 70ch;
    font-size: 1.02rem;
    color: var(--dim);
}

.cookies-panel h3 {
    margin: 0 0 10px;
    font-size: 1.02rem;
    line-height: 1.3;
    color: #fff;
}

.cookies-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cookies-main code {
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.07);
    color: #bfdbfe;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
}

@media (max-width: 980px) {
    .cookies-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

/* ============================================================
   CONTACT — WIDE WORKBENCH LAYOUT
   Expands the app-shell contact panel to the shared workbench width.
   ============================================================ */
body.contact-page .tab-panels {
    max-width: 1240px;
}

body.contact-page .tab-panel[data-panel="contact"] .panel-content {
    justify-content: flex-start;
    align-items: stretch;
    min-height: 0;
    padding: 0;
    text-align: left;
}

body.contact-page .legal-main {
    max-width: 1240px;
    padding-top: clamp(20px, 3vw, 40px);
}

body.contact-page .site-footer {
    max-width: 1240px;
}

body.contact-page .contact-panel h3 {
    margin: 0 0 10px;
    font-size: 1rem;
    line-height: 1.3;
    color: #fff;
}

body.contact-page .contact-form-panel {
    padding: clamp(18px, 3vw, 30px);
}

body.contact-page .contact-form-panel .contact-form {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

/* Override the app-shell :has() width rule for the contact panel. */
body.contact-page .tab-panels:has(.tab-panel.active[data-panel="contact"]) {
    max-width: 1240px;
}
