/* ==========================================================================
   Curva.io stylesheet
   --------------------------------------------------------------------------
   Colours live in custom properties on :root. Every text/background pair the
   page uses is checked against WCAG 2.1 AA (4.5:1 normal text, 3:1 large
   text) by tests/test_accessibility.py, so a palette change cannot quietly
   make text unreadable again.

   No external fonts, images or stylesheets: everything is same-origin, which
   keeps the Content Security Policy strict and visitors' IPs private.
   ========================================================================== */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Brand */
    --navy-dark: #1e3a5f;
    --navy-medium: #2c5282;
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #2ecc71;
    --aqua: #4ecdc4;
    --mint: #72dfd0;
    --danger-color: #c0392b;

    /* Ink on light surfaces */
    --text-strong: #1f2933;
    --text-body: #3e4c59;
    --text-muted: #52606d;
    --link-color: #245c9e;

    /* Ink on dark surfaces (checked against --navy-dark and --navy-medium) */
    --on-dark-strong: #ffffff;
    --on-dark-body: #dfe8f3;
    --on-dark-muted: #c5d4e6;
    --on-dark-accent: #72dfd0;

    /* State colours: ink and its tinted background */
    --ok-ink: #17703c;
    --ok-surface: #e8f6ee;
    --warn-ink: #7a4f06;
    --warn-surface: #fdf3dc;
    --danger-ink: #a5281c;
    --danger-surface: #fdecea;
    --info-ink: #1d4f8c;
    --info-surface: #e8f1fb;

    /* Surfaces */
    --surface: #ffffff;
    --surface-soft: #f5f7fa;
    --surface-sunken: #eef2f6;
    --surface-border: #dfe3e8;
    --surface-border-strong: #c3ccd6;
    --page-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --brand-gradient: linear-gradient(135deg, var(--navy-dark), var(--navy-medium));
    --soft-gradient: linear-gradient(135deg, rgba(52, 152, 219, 0.07), rgba(46, 204, 113, 0.07));

    --border-radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.08);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --focus-ring: 0 0 0 3px rgba(52, 152, 219, 0.55);
    --header-height: 68px;
    /* The visitor's screen height. Embedded in curva.io, this frame is as tall
       as the whole page, so the site supplies the real value (embed.js). */
    --viewport-height: 100vh;

    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 12px);
}

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

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text-body);
    background: var(--page-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

[hidden] {
    display: none !important;
}

/* The inline icon sprite (templates/_icons.html). A class rather than a style
   attribute, so pages with a strict style-src policy hide it too. */
.svg-sprite {
    display: none;
}

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

code,
pre {
    font-family: var(--font-mono);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container--wide {
    max-width: 1480px;
}

.icon {
    width: 1em;
    height: 1em;
    fill: currentColor;
    flex: none;
    vertical-align: -0.125em;
}

.icon-flip {
    transform: scaleX(-1);
}

/* Visible to screen readers only. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    z-index: 10001;
    background: var(--navy-dark);
    color: var(--on-dark-strong);
    padding: 12px 20px;
    border-radius: 0 0 var(--border-radius) 0;
}

.skip-link:focus {
    left: 0;
}

:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: 6px;
}

main:focus {
    outline: none;
}

/* ===================== Header ===================== */

.header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(15, 23, 42, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-row {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: var(--header-height);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    /* The logo turns slowly and breathes, as on the original landing page.
       Reduced-motion users get it still (see the rule at the top). */
    animation: logo-turn 20s linear infinite;
}

.header .logo {
    animation: logo-pulse 2s ease-in-out infinite;
}

@keyframes logo-turn {
    to {
        transform: rotate(360deg);
    }
}

@keyframes logo-pulse {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.logo-text {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.02em;
}

.nav {
    display: flex;
    gap: 26px;
    margin-left: auto;
}

.nav-link {
    position: relative;
    color: var(--text-body);
    text-decoration: none;
    font-weight: 500;
    padding: 6px 0;
    white-space: nowrap;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
    width: 100%;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}

.lang-switch ul {
    display: flex;
    list-style: none;
    background: var(--surface-soft);
    border: 1px solid var(--surface-border);
    border-radius: 999px;
    padding: 3px;
}

.lang-switch a {
    display: block;
    padding: 4px 10px;
    border-radius: 999px;
    color: var(--text-body);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
}

.lang-switch a:hover {
    background: var(--surface);
    color: var(--text-strong);
}

.lang-switch a[aria-current="page"] {
    background: var(--navy-medium);
    color: var(--on-dark-strong);
}

/* The endonym is spoken; the two-letter code is what fits visually. */
.lang-switch .lang-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* ===================== Buttons ===================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-small {
    padding: 8px 14px;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
}

.btn-primary {
    background: var(--navy-medium);
    color: var(--on-dark-strong);
}

.btn-primary:hover:not(:disabled) {
    background: var(--navy-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

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

.btn-secondary:hover:not(:disabled) {
    background: var(--surface-sunken);
    border-color: var(--surface-border-strong);
}

.btn-ghost {
    background: transparent;
    color: var(--navy-medium);
    border-color: var(--surface-border-strong);
}

.btn-ghost:hover {
    background: var(--surface-soft);
}

.btn-danger-quiet {
    background: transparent;
    color: var(--danger-ink);
    border-color: transparent;
}

.btn-danger-quiet:hover:not(:disabled) {
    background: var(--danger-surface);
}

.btn-ai {
    width: 100%;
    background: var(--brand-gradient);
    color: var(--on-dark-strong);
    padding: 14px 24px;
    font-size: 1.05rem;
    box-shadow: 0 6px 18px rgba(30, 58, 95, 0.25);
}

.btn-ai:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(30, 58, 95, 0.32);
}

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.link-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 2px 4px;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--link-color);
    cursor: pointer;
    border-radius: 6px;
}

.link-button:hover {
    text-decoration: underline;
}

/* ===================== Hero ===================== */

.hero {
    position: relative;
    background: var(--surface);
    padding: 64px 0 108px;
    text-align: center;
    overflow: hidden;
}

.hero-inner {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: clamp(2.2rem, 6vw, 3.6rem);
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--text-strong);
    margin-bottom: 20px;
}

.hero-title .accent {
    display: block;
    color: var(--navy-medium);
}

.hero-title .subtitle {
    display: block;
    font-size: 0.62em;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 6px;
}

.hero-description {
    max-width: 760px;
    margin: 0 auto 28px;
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    color: var(--text-body);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-bottom: 30px;
}

.hero-badges {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-soft);
    border: 1px solid var(--surface-border);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-body);
}

.badge .icon {
    color: var(--navy-medium);
}

.hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    line-height: 0;
    transform: rotate(180deg);
}

.hero-wave svg {
    width: 100%;
    height: 90px;
}

/* ===================== Workspace ===================== */

.workspace-section {
    display: block;
    padding: 36px 0 64px;
}

.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    min-width: 0;
}

.card-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 22px 24px 16px;
}

.card-head h2 {
    font-size: 1.35rem;
    line-height: 1.25;
    color: var(--text-strong);
    letter-spacing: -0.01em;
}

.card-sub {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.card-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--brand-gradient);
    color: var(--on-dark-strong);
    font-size: 1.25rem;
}

.card-head--brand {
    background: var(--brand-gradient);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding-bottom: 20px;
}

.card-head--brand h2 {
    color: var(--on-dark-strong);
}

.card-head--brand .card-sub {
    color: var(--on-dark-body);
}

.card-head--brand .card-icon {
    background: rgba(255, 255, 255, 0.14);
    color: var(--on-dark-accent);
}

.block-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-strong);
    letter-spacing: 0.01em;
}

/* --- Shared upload --- */

.intake {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 22px;
}

.dropzone {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 340px);
    gap: 18px;
    align-items: center;
}

.dropzone-button {
    display: flex;
    align-items: center;
    gap: 18px;
    width: 100%;
    padding: 22px 26px;
    border: 2px dashed var(--secondary-color);
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.06), rgba(46, 204, 113, 0.06));
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.dropzone-button:hover,
.dropzone-button:focus-visible,
.dropzone.is-dragover .dropzone-button {
    border-color: #1f9e6a;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.14), rgba(46, 204, 113, 0.14));
}

.dropzone-icon {
    font-size: 2.4rem;
    color: var(--secondary-color);
}

.dropzone-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.dropzone-text strong {
    font-size: 1.15rem;
    color: var(--text-strong);
}

.dropzone-text span {
    color: var(--text-muted);
}

.file-types {
    flex: none;
    background: var(--surface-soft);
    border: 1px solid var(--surface-border);
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.dropzone-side {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.dropzone-note {
    display: flex;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.dropzone-note .icon {
    margin-top: 2px;
    color: var(--ok-ink);
}

.filebar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px 18px;
    padding: 4px 6px;
}

.filebar-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--info-surface);
    color: var(--info-ink);
    font-size: 1.2rem;
}

.filebar-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 220px;
}

.filebar-text strong {
    color: var(--text-strong);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filebar-text span {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.filebar-memory {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.85rem;
    color: var(--ok-ink);
    background: var(--ok-surface);
    padding: 5px 12px;
    border-radius: 999px;
}

.filebar-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.warnings {
    list-style: none;
    margin-top: 12px;
    display: grid;
    gap: 6px;
}

.warnings li {
    display: flex;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--warn-ink);
    background: var(--warn-surface);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}

/* --- Two panels --- */

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
    gap: 22px;
    align-items: start;
}

/* ===================== Studio ===================== */

.gallery {
    padding: 0 24px 18px;
    border-bottom: 1px solid var(--surface-border);
}

.gallery-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-bottom: 8px;
}

.family-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--text-body);
    border-radius: 999px;
    padding: 4px 12px;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.chip:hover {
    border-color: var(--surface-border-strong);
    background: var(--surface-soft);
}

.chip[aria-pressed="true"] {
    background: var(--navy-medium);
    border-color: var(--navy-medium);
    color: var(--on-dark-strong);
}

.gallery-hint {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.chart-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 8px;
    max-height: 274px;
    overflow-y: auto;
    padding: 2px 2px 6px;
    scrollbar-width: thin;
    /* A soft fade tells people the list scrolls. */
    mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
}

.chart-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    height: 100%;
    min-height: 84px;
    padding: 11px 6px 9px;
    border: 1px solid var(--surface-border);
    border-radius: var(--border-radius);
    background: var(--surface);
    color: var(--text-strong);
    font: inherit;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.chart-card:hover {
    border-color: var(--secondary-color);
    box-shadow: var(--shadow-sm);
}

.chart-card[aria-pressed="true"] {
    border-color: var(--navy-medium);
    background: var(--info-surface);
    box-shadow: inset 0 0 0 1px var(--navy-medium);
}

.chart-card[aria-pressed="true"]::after {
    content: "";
    position: absolute;
    top: 7px;
    right: 7px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--navy-medium);
}

.chart-card[aria-disabled="true"] {
    cursor: not-allowed;
    color: var(--text-muted);
    background: var(--surface-soft);
}

.chart-card[aria-disabled="true"] .chart-glyph {
    opacity: 0.45;
}

.chart-card[aria-disabled="true"]:hover {
    border-color: var(--surface-border);
    box-shadow: none;
}

.chart-card.is-suggested:not([aria-pressed="true"]) {
    border-color: #1f9e6a;
}

.chart-glyph {
    width: 30px;
    height: 30px;
    color: var(--navy-medium);
}

.chart-name {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.25;
}

/* The purpose is read by screen readers and shown as the inspector's lead. */
.chart-purpose {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.chart-reason {
    font-size: 0.72rem;
    line-height: 1.25;
    color: var(--text-muted);
}

.studio-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 0;
}

.canvas-column {
    min-width: 0;
    padding: 18px 20px 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.canvas {
    position: relative;
    min-height: clamp(360px, calc(var(--viewport-height) * 0.54), 600px);
    border-radius: var(--border-radius);
    background: var(--surface);
    border: 1px solid var(--surface-border);
    overflow: hidden;
}

.canvas-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 24px;
    text-align: center;
    background: var(--soft-gradient);
    color: var(--text-muted);
}

.canvas-illustration {
    width: min(240px, 70%);
    height: auto;
    margin-bottom: 10px;
    color: var(--text-muted);
}

.canvas-empty-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-strong);
}

.canvas-empty-body {
    max-width: 420px;
}

.chart-surface {
    width: 100%;
    height: clamp(360px, calc(var(--viewport-height) * 0.54), 600px);
}

.canvas-busy {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--text-strong);
    font-weight: 600;
    backdrop-filter: blur(2px);
}

.notes {
    background: var(--warn-surface);
    border-radius: var(--border-radius);
    padding: 12px 16px;
}

.notes .block-title {
    color: var(--warn-ink);
    margin-bottom: 6px;
}

.notes ul,
.quality-list {
    list-style: none;
    display: grid;
    gap: 4px;
}

.notes li,
.quality-list li {
    position: relative;
    padding-left: 16px;
    font-size: 0.9rem;
    color: var(--text-body);
}

.notes li::before,
.quality-list li::before {
    content: "•";
    position: absolute;
    left: 2px;
    color: var(--warn-ink);
}

.export-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.export-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    background: var(--surface-soft);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-strong);
    transition: var(--transition);
}

.export-btn:hover:not(:disabled) {
    border-color: var(--secondary-color);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.export-btn:disabled {
    opacity: 0.6;
    cursor: progress;
}

.data-panel {
    border: 1px solid var(--surface-border);
    border-radius: var(--border-radius);
    padding: 12px 16px;
}

.data-panel summary {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--navy-dark);
    cursor: pointer;
}

.table-scroll {
    overflow-x: auto;
    margin-top: 12px;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
}

.table-scroll table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.85rem;
}

.table-scroll caption {
    caption-side: bottom;
    text-align: left;
    padding: 8px 10px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.table-scroll th,
.table-scroll td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--surface-border);
    text-align: left;
    white-space: nowrap;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-scroll th {
    background: var(--surface-soft);
    color: var(--text-strong);
    font-weight: 600;
    vertical-align: bottom;
}

.table-scroll td {
    color: var(--text-body);
}

.column-kind {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.quality-title {
    margin: 14px 0 6px;
    font-size: 0.9rem;
    color: var(--text-strong);
}

.quality-list li.is-ok::before {
    content: "✓";
    color: var(--ok-ink);
}

/* --- Inspector --- */

.inspector {
    min-width: 0;
    border-left: 1px solid var(--surface-border);
    padding: 18px 20px 22px;
    background: linear-gradient(180deg, var(--surface-soft), var(--surface) 240px);
    border-radius: 0 0 var(--radius-lg) 0;
}

.inspector-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.inspector-chart {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.inspector-chart strong {
    display: block;
    color: var(--text-strong);
    font-size: 1rem;
}

.inspector-form {
    display: grid;
    gap: 14px;
}

/* Fieldsets group controls for assistive technology; they carry no frame. */
.inspector fieldset {
    border: none;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.opt-group {
    border: none;
    display: grid;
    gap: 12px;
}

.opt-group > legend,
.opt-group > summary {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

details.opt-group > summary {
    cursor: pointer;
    margin-bottom: 0;
}

details.opt-group[open] > summary {
    margin-bottom: 10px;
}

.control {
    display: grid;
    gap: 5px;
}

.control > label,
.control > .control-label,
.control legend {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-strong);
}

.control-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.select-input,
.text-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--surface-border-strong);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 0.9rem;
    color: var(--text-strong);
    background: var(--surface);
    transition: var(--transition);
}

.select-input:focus,
.text-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: var(--focus-ring);
}

.checks {
    border: none;
    display: grid;
    gap: 2px;
    max-height: 190px;
    overflow-y: auto;
    padding: 6px 8px;
    border: 1px solid var(--surface-border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    padding: 3px 2px;
    cursor: pointer;
    color: var(--text-body);
}

.check input {
    accent-color: var(--navy-medium);
    width: 16px;
    height: 16px;
}

.check input:disabled + span {
    color: #8794a2;
}

.segmented {
    display: inline-flex;
    flex-wrap: wrap;
    border: 1px solid var(--surface-border-strong);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface);
}

.segmented label {
    position: relative;
    flex: 1 1 auto;
}

.segmented input {
    position: absolute;
    opacity: 0;
    inset: 0;
    cursor: pointer;
}

.segmented span {
    display: block;
    padding: 6px 10px;
    font-size: 0.84rem;
    font-weight: 500;
    text-align: center;
    color: var(--text-body);
    border-right: 1px solid var(--surface-border);
}

.segmented label:last-child span {
    border-right: none;
}

.segmented input:checked + span {
    background: var(--navy-medium);
    color: var(--on-dark-strong);
}

.segmented input:focus-visible + span {
    box-shadow: inset 0 0 0 3px rgba(52, 152, 219, 0.55);
}

.switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-strong);
    cursor: pointer;
}

.switch input {
    appearance: none;
    flex: none;
    position: relative;
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: #aab4bf;
    cursor: pointer;
    transition: var(--transition);
}

.switch input::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: var(--transition);
}

.switch input:checked {
    background: var(--navy-medium);
}

.switch input:checked::after {
    left: 19px;
}

/* ===================== Private AI panel ===================== */

.assistant {
    position: sticky;
    top: calc(var(--header-height) + 14px);
    max-height: calc(var(--viewport-height) - var(--header-height) - 28px);
    overflow-y: auto;
    scrollbar-width: thin;
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 20px 0;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    background: var(--surface-soft);
    color: var(--text-body);
}

.ai-status--inline {
    margin: 0;
    display: inline-flex;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #8794a2;
    flex: none;
}

.ai-status[data-state="ready"] {
    background: var(--ok-surface);
    color: var(--ok-ink);
}

.ai-status[data-state="ready"] .status-dot {
    background: #1f9e6a;
    box-shadow: 0 0 0 3px rgba(31, 158, 106, 0.2);
    animation: pulse 2.4s ease-in-out infinite;
}

.ai-status[data-state="unavailable"] {
    background: var(--warn-surface);
    color: var(--warn-ink);
}

.ai-status[data-state="unavailable"] .status-dot {
    background: #d68a0c;
}

.ai-status[data-state="disabled"] .status-dot {
    background: #8794a2;
}

@keyframes pulse {
    50% {
        box-shadow: 0 0 0 6px rgba(31, 158, 106, 0.05);
    }
}

.ai-status-link {
    margin-left: auto;
    font-size: 0.82rem;
    font-weight: 600;
    color: inherit;
}

.trust-chips {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 20px 0;
}

.trust-chips li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--info-ink);
    background: var(--info-surface);
}

.ai-form {
    display: grid;
    gap: 14px;
    padding: 16px 20px 6px;
}

.field {
    display: grid;
    gap: 6px;
}

.field-label {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-strong);
}

.required-badge {
    background: var(--danger-surface);
    color: var(--danger-ink);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.field-input {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--surface-border-strong);
    border-radius: var(--border-radius);
    font: inherit;
    font-size: 0.95rem;
    color: var(--text-strong);
    background: var(--surface);
    resize: vertical;
    min-height: 76px;
    transition: var(--transition);
}

.field-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: var(--focus-ring);
}

.field-input[aria-invalid="true"] {
    border-color: var(--danger-color);
}

.field-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.ai-preview,
.ai-sent {
    font-size: 0.88rem;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    background: var(--surface-soft);
}

.ai-preview summary,
.ai-sent summary {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
    color: var(--navy-dark);
}

.ai-preview p {
    margin: 8px 0;
    color: var(--text-body);
}

.payload {
    max-height: 260px;
    overflow: auto;
    padding: 10px;
    margin-top: 8px;
    border-radius: var(--radius-sm);
    background: #14273f;
    color: #e3ecf7;
    font-size: 0.76rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.ai-hint {
    font-size: 0.84rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: -4px;
}

.ai-progress {
    margin: 10px 20px 0;
    padding: 14px 16px;
    border-radius: var(--border-radius);
    background: var(--info-surface);
}

.progress-steps {
    list-style: none;
    display: grid;
    gap: 8px;
}

.progress-steps li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #8794a2;
    flex: none;
}

.progress-steps li.is-active {
    color: var(--info-ink);
    font-weight: 600;
}

.progress-steps li.is-active .step-dot {
    border-color: var(--info-ink);
    background: radial-gradient(circle, var(--info-ink) 40%, transparent 45%);
}

.progress-steps li.is-done {
    color: var(--ok-ink);
}

.progress-steps li.is-done .step-dot {
    border-color: var(--ok-ink);
    background: var(--ok-ink);
}

.progress-elapsed {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    color: var(--info-ink);
}

.ai-result {
    margin: 14px 20px 0;
    padding-top: 14px;
    border-top: 1px solid var(--surface-border);
    display: grid;
    gap: 8px;
}

.ai-result h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-top: 6px;
}

.ai-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.source-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    background: var(--navy-medium);
    color: var(--on-dark-strong);
}

.source-tag[data-source="rules"] {
    background: var(--text-muted);
}

.ai-notice {
    font-size: 0.88rem;
    color: var(--warn-ink);
    background: var(--warn-surface);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}

.ai-applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--ok-ink);
    background: var(--ok-surface);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}

.ai-insights {
    padding-left: 18px;
    display: grid;
    gap: 4px;
    font-size: 0.93rem;
}

.ai-reflection p + p {
    margin-top: 10px;
}

.ai-reflection,
#aiReasoning {
    font-size: 0.95rem;
}

.ai-notes {
    list-style: none;
    font-size: 0.85rem;
    color: var(--warn-ink);
}

.ai-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.ai-learn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 14px 20px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.ai-learn:hover {
    text-decoration: underline;
}

/* ===================== Privacy section ===================== */

.privacy-section {
    padding: 76px 0;
    background: var(--surface-soft);
}

.eyebrow {
    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ok-ink);
    margin-bottom: 8px;
}

.section-title {
    text-align: center;
    font-size: clamp(1.7rem, 4vw, 2.4rem);
    margin-bottom: 16px;
    color: var(--text-strong);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.section-lead {
    max-width: 780px;
    margin: 0 auto 40px;
    text-align: center;
    font-size: 1.08rem;
    color: var(--text-body);
}

.flow {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    counter-reset: flow;
    margin-bottom: 30px;
}

.flow-step {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--border-radius);
    padding: 22px 20px;
    counter-increment: flow;
}

.flow-step::before {
    content: counter(flow);
    position: absolute;
    top: 16px;
    right: 18px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
}

.flow-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -14px;
    width: 10px;
    height: 10px;
    border-top: 2px solid var(--surface-border-strong);
    border-right: 2px solid var(--surface-border-strong);
    transform: translateY(-50%) rotate(45deg);
}

.flow-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: var(--on-dark-accent);
    font-size: 1.3rem;
    margin-bottom: 14px;
}

.flow-step h3 {
    font-size: 1.05rem;
    color: var(--text-strong);
    margin-bottom: 8px;
}

.flow-step p {
    font-size: 0.93rem;
}

.privacy-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.compare-card,
.attest-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--border-radius);
    padding: 22px;
}

.compare-card h3,
.attest-card h3 {
    font-size: 1.1rem;
    color: var(--text-strong);
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 0.9rem;
}

.compare-table th,
.compare-table td {
    padding: 10px 8px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--surface-border);
}

.compare-table thead th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.compare-table tbody th {
    color: var(--text-strong);
    font-weight: 600;
    width: 28%;
}

.compare-table td {
    color: var(--text-body);
}

.compare-table td.is-good {
    color: var(--ok-ink);
    font-weight: 600;
}

.attest-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

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

.attest-grid .attest-wide {
    grid-column: 1 / -1;
}

.attest-grid dt {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
}

.attest-grid dd {
    color: var(--text-strong);
    font-size: 0.92rem;
    overflow-wrap: anywhere;
}

.attest-hash {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.attest-hash code {
    font-size: 0.8rem;
    background: var(--surface-soft);
    border: 1px solid var(--surface-border);
    border-radius: 6px;
    padding: 2px 6px;
    overflow-wrap: anywhere;
}

.attest-explain {
    margin-top: 14px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.privacy-more {
    text-align: center;
    margin-top: 30px;
}

/* ===================== Features ===================== */

.features-section {
    padding: 72px 0;
    background: var(--surface);
}

.features-section .section-title {
    margin-bottom: 42px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
}

.feature-card {
    text-align: center;
    padding: 28px 24px;
    border-radius: var(--border-radius);
    background: var(--surface-soft);
    border: 1px solid var(--surface-border);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    background: var(--surface);
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    background: var(--brand-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--on-dark-strong);
}

.feature-card h3 {
    margin-bottom: 10px;
    color: var(--text-strong);
    font-size: 1.12rem;
}

.feature-card p {
    color: var(--text-body);
}

/* ===================== About =====================
   This section used to sit on the page's purple gradient behind a 5% veil,
   so the grey copy and the gradient-filled numbers were unreadable. It has
   its own navy brand surface and light ink; every pair is checked in
   tests/test_accessibility.py. */

.about-section {
    padding: 76px 0;
    background: var(--brand-gradient);
}

.about-content {
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
}

.about-content h2 {
    font-size: clamp(1.7rem, 4vw, 2.4rem);
    margin-bottom: 22px;
    color: var(--on-dark-strong);
    letter-spacing: -0.02em;
}

.about-text {
    font-size: 1.12rem;
    color: var(--on-dark-body);
    margin-bottom: 44px;
    line-height: 1.8;
}

.stats {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 56px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-number {
    font-size: clamp(2.2rem, 6vw, 3rem);
    font-weight: 700;
    line-height: 1;
    color: var(--on-dark-accent);
}

.stat-label {
    color: var(--on-dark-muted);
    font-size: 0.98rem;
}

/* ===================== Footer ===================== */

.footer {
    background: var(--primary-color);
    color: var(--on-dark-body);
    padding: 40px 0 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 26px;
    flex-wrap: wrap;
    gap: 26px;
}

.footer-brand .logo-text {
    color: var(--on-dark-strong);
}

.footer-brand p {
    margin-top: 8px;
    color: var(--on-dark-muted);
}

.footer-trust {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.footer-trust .icon {
    color: var(--on-dark-accent);
}

.footer-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
}

.footer-links {
    display: flex;
    gap: 26px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--on-dark-body);
    text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus-visible {
    color: var(--on-dark-strong);
    text-decoration: underline;
}

.lang-switch--footer {
    color: var(--on-dark-muted);
}

.lang-switch--footer ul {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
}

.lang-switch--footer a {
    color: var(--on-dark-body);
}

.lang-switch--footer a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--on-dark-strong);
}

.lang-switch--footer a[aria-current="page"] {
    background: var(--on-dark-strong);
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--on-dark-muted);
    font-size: 0.9rem;
}

/* ===================== Feedback ===================== */

.spinner {
    display: inline-block;
    width: 26px;
    height: 26px;
    border: 3px solid rgba(44, 82, 130, 0.2);
    border-top-color: var(--navy-medium);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.spinner--small {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.toast-container {
    position: fixed;
    top: calc(var(--header-height) + 10px);
    right: 18px;
    z-index: 10000;
    display: grid;
    gap: 10px;
    max-width: min(420px, calc(100vw - 36px));
}

.toast {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 12px 14px 12px 16px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--text-strong);
    font-size: 0.93rem;
    animation: slide-in 0.25s ease;
    border-left: 4px solid var(--secondary-color);
}

.toast p {
    flex: 1;
}

.toast .icon {
    margin-top: 3px;
}

.toast.success {
    border-left-color: var(--accent-color);
}

.toast.success .icon {
    color: var(--ok-ink);
}

.toast.error {
    border-left-color: var(--danger-color);
}

.toast.error .icon {
    color: var(--danger-ink);
}

.toast.info .icon {
    color: var(--info-ink);
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    border-radius: 4px;
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
}

/* ===================== Privacy policy page ===================== */

.policy-section {
    display: block;
    padding: 40px 0 64px;
}

.policy {
    max-width: 860px;
    margin: 0 auto;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: clamp(24px, 5vw, 56px);
}

.policy-back {
    margin-bottom: 18px;
}

.policy-back a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    text-decoration: none;
}

.policy h1 {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    color: var(--text-strong);
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.policy .policy-updated {
    color: var(--text-muted);
    margin-bottom: 26px;
}

.policy .policy-summary {
    background: var(--ok-surface);
    border-radius: var(--border-radius);
    padding: 18px 22px;
    margin-bottom: 28px;
}

.policy .policy-summary h2 {
    margin-top: 0;
    color: var(--ok-ink);
}

.policy h2 {
    font-size: 1.3rem;
    color: var(--navy-dark);
    margin: 30px 0 10px;
}

.policy h3 {
    font-size: 1.05rem;
    color: var(--text-strong);
    margin: 18px 0 6px;
}

.policy p,
.policy li {
    color: var(--text-body);
}

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

.policy ul,
.policy ol {
    padding-left: 22px;
    margin: 8px 0;
    display: grid;
    gap: 6px;
}

.policy table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 0.93rem;
}

.policy th,
.policy td {
    text-align: left;
    vertical-align: top;
    padding: 9px 10px;
    border-bottom: 1px solid var(--surface-border);
}

.policy th {
    background: var(--surface-soft);
    color: var(--text-strong);
}

/* ===================== Responsive ===================== */

@media (min-width: 1100px) {
    .lang-switch .lang-name {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip: auto;
    }

    .lang-switch .lang-code {
        display: none;
    }
}

@media (max-width: 1240px) {
    .studio-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .inspector {
        border-left: none;
        border-top: 1px solid var(--surface-border);
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        background: var(--surface-soft);
    }

    .inspector-form {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        align-items: start;
    }
}

@media (max-width: 1000px) {
    .workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .assistant {
        position: static;
        max-height: none;
        overflow: visible;
    }

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

    .flow-step:nth-child(2)::after {
        display: none;
    }

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

@media (max-width: 860px) {
    .header-row {
        flex-wrap: wrap;
        gap: 6px 16px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .nav {
        order: 3;
        width: 100%;
        margin-left: 0;
        gap: 20px;
        overflow-x: auto;
        scrollbar-width: none;
        padding-bottom: 2px;
        padding-right: 28px;
        /* The fade says "there is more": the row scrolls sideways. */
        mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent);
    }

    .lang-switch {
        margin-left: auto;
    }

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

@media (max-width: 600px) {
    .hero {
        padding: 44px 0 90px;
    }

    .dropzone-button {
        flex-direction: column;
        text-align: center;
    }

    .dropzone-text {
        align-items: center;
    }

    .card-head,
    .gallery,
    .canvas-column {
        padding-left: 16px;
        padding-right: 16px;
    }

    .inspector {
        padding: 16px;
    }

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

    .flow-step::after {
        display: none;
    }

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

    .filebar-actions {
        margin-left: 0;
        width: 100%;
    }

    .stats {
        gap: 32px;
    }

    .footer-side {
        align-items: flex-start;
    }
}

/* ===================== Embedded in curva.io ===================== */
/* The public site shows this page in an iframe as tall as the page, under its
   own header and footer (?embed=1). Nothing here may depend on this frame's
   own viewport, which is the whole page tall, or stay put on screen: the site
   tells embed.js which slice of the page is visible instead. The page is
   transparent, so the site's background shows through. */
html.is-embedded {
    --header-height: 0px;
    --viewport-height: 720px; /* until the site reports the real one */
    overflow: hidden;
    background: transparent;
    scroll-padding-top: 0;
}

html.is-embedded body {
    min-height: 0;
    background: transparent;
}

html.is-embedded .assistant {
    position: static;
    max-height: none;
    overflow: visible;
}

html.is-embedded .toast-container {
    position: absolute; /* embed.js keeps it at the top of the visible slice */
}

