/* Studio console app styles. TOKENED (AUDIT/studio UX-STUDIO-05/07/13/UX-12 — this sheet used to
   carry the Blazor default-template palette (#0071c1/#1b6ec2/#258cfb) and a hand-picked
   Tailwind-slate island (#2563eb/#dbeafe/#f8fafc/…) as a THIRD accent beside the brand violet.
   Every color now resolves through the --v-* tokens in vahary.css, which also makes the editor +
   onboarding surfaces follow light/dark with the rest of the console. The literals that remain
   are physical, not palette: the phone bezel (a bezel is black in any theme) and the boot spinner
   fallbacks (drawn before any user preference can matter). */

html, body {
    /* The tokens are the same faces every other product uses; the literal stack stays as the
       fallback for the moment before vahary.css applies. */
    font-family: var(--v-font-body, 'Work Sans'), 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--v-color-surface-base, #F2F3F1);
    color: var(--v-color-text-primary, #181E24);
}

h1:focus {
    outline: none;
}

.content {
    padding-top: 1.1rem;
}

/* Blazor form validation states, in the estate's status vocabulary. */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--v-color-status-healthy);
}

.invalid {
    outline: 1px solid var(--v-color-status-critical);
}

.validation-message {
    color: var(--v-color-status-critical);
}

#blazor-error-ui {
    color-scheme: light only;
    background: var(--v-color-status-attention-subtle, lightyellow);
    color: var(--v-color-status-attention-on, #92400E);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: var(--v-color-status-critical);
    padding: 1rem;
    color: var(--v-color-text-inverse);
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* Boot spinner: the FIRST paint of the product is brand, not template blue. Literal fallbacks
   only guard the instant before vahary.css parses. */
.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: var(--v-color-border-hairline, #C6CCCE);
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--v-color-interactive-accent, #5B21B6);
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: var(--v-color-interactive-accent-text);
    font-family: var(--v-font-data);
}

/* ---- No-code builder (three-pane editor) ---- */
.pf-editor { display: grid; grid-template-columns: 260px 1fr 340px; gap: 12px; height: calc(100vh - 60px); padding: 12px; box-sizing: border-box; }
.pf-editor__left, .pf-editor__right { overflow-y: auto; background: var(--v-color-surface-sunken); border: 1px solid var(--v-color-border-hairline); border-radius: 8px; padding: 10px; }
.pf-editor__center { display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; }
.pf-editor__tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.pf-editor__tabs button { flex: 1; padding: 6px; border: 1px solid var(--v-color-border-hairline); background: var(--v-color-surface-raised); color: var(--v-color-text-primary); border-radius: 6px; cursor: pointer; font-size: 12px; }
.pf-editor__tabs button.is-active { background: var(--v-color-interactive-accent); color: var(--v-color-text-on-accent); border-color: var(--v-color-interactive-accent); }
.pf-tree__header { display: flex; justify-content: space-between; font-weight: 600; margin: 8px 0 4px; }
.pf-tree__screens li, .pf-block { list-style: none; padding: 4px 6px; border-radius: 4px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.pf-tree__screens li.is-selected, .pf-block.is-selected { background: var(--v-color-interactive-accent-subtle); }
.pf-tree__screens, .pf-tree__blocks { padding-left: 0; margin: 0; }
.pf-block__controls button { border: none; background: transparent; color: inherit; cursor: pointer; font-size: 11px; padding: 0 2px; }
.pf-palette { margin-top: 12px; }
.pf-palette__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.pf-palette__item { font-size: 11px; padding: 4px; border: 1px solid var(--v-color-border-hairline); background: var(--v-color-surface-raised); color: var(--v-color-text-primary); border-radius: 4px; cursor: pointer; }
.pf-palette__target { font-size: 10px; color: var(--v-color-interactive-accent-text); margin-left: 6px; }
/* The bezel is a physical object — black glass in any theme — so its ink is a literal by design. */
.pf-device__bezel { width: 320px; border: 10px solid #111827; border-radius: 36px; background: #111827; padding: 0; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
/* The "glass" behind the rendered app follows the renderer's surface token, so a dark-mode app no
   longer floats on a stuck-white screen (UX-STUDIO-13). */
.pf-device__screen { background: var(--v-color-surface-base); border-radius: 26px; height: 600px; overflow-y: auto; }
.pf-device__caption { text-align: center; font-size: 12px; color: var(--v-color-text-secondary); margin-top: 8px; }
.pf-field { display: flex; flex-direction: column; font-size: 12px; gap: 2px; margin-bottom: 8px; }
.pf-field select, .pf-field input { padding: 4px; border: 1px solid var(--v-color-border-hairline); border-radius: 4px; background: var(--v-color-surface-raised); color: var(--v-color-text-primary); }
.pf-slot-type { color: var(--v-color-interactive-accent-text); font-style: normal; font-size: 10px; margin-left: 4px; background: var(--v-color-interactive-accent-subtle); padding: 0 4px; border-radius: 3px; }
.pf-muted { color: var(--v-color-text-secondary); font-size: 12px; }
.pf-ok { color: var(--v-color-status-healthy); } .pf-warn { color: var(--v-color-status-attention); } .pf-error { color: var(--v-color-status-critical); }
.pf-publish__findings li.is-warn { color: var(--v-color-status-attention-on); } .pf-publish__findings li.is-error { color: var(--v-color-status-critical-on); }
.pf-publish__actions { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.pf-publish__actions button { font-size: 11px; padding: 4px 6px; border: 1px solid var(--v-color-border-hairline); border-radius: 4px; background: var(--v-color-surface-raised); color: var(--v-color-text-primary); cursor: pointer; }
.pf-qr__code svg { border: 1px solid var(--v-color-border-hairline); border-radius: 6px; }
.pf-filter-row { display: flex; gap: 4px; margin-bottom: 4px; }

/* ---- Onboarding first-run flow ---- */
.pf-onboard { max-width: 720px; margin: 24px auto; padding: 0 16px; }
.pf-onboard__steps { display: flex; gap: 8px; list-style: none; padding: 0; margin-bottom: 20px; }
.pf-onboard__steps li { flex: 1; text-align: center; padding: 6px; border-bottom: 3px solid var(--v-color-border-hairline); font-size: 12px; color: var(--v-color-text-secondary); }
.pf-onboard__steps li.is-active { border-color: var(--v-color-interactive-accent); color: var(--v-color-interactive-accent-text); font-weight: 600; }
.pf-onboard__steps li.is-done { border-color: var(--v-color-status-healthy); color: var(--v-color-status-healthy); }
.pf-onboard__goals { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pf-onboard__goals button, .pf-onboard__card { padding: 12px; border: 1px solid var(--v-color-border-hairline); border-radius: 8px; background: var(--v-color-surface-raised); color: var(--v-color-text-primary); cursor: pointer; text-align: left; }
.pf-onboard__goals button.is-selected, .pf-onboard__card.is-selected { border-color: var(--v-color-interactive-accent); box-shadow: 0 0 0 2px var(--v-color-interactive-accent-subtle); }
.pf-onboard__back { margin-top: 12px; border: none; background: transparent; color: var(--v-color-text-link); cursor: pointer; font-size: 12px; padding: 4px 0; }
.pf-onboard__gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pf-onboard__card { display: flex; flex-direction: column; gap: 4px; }
.pf-onboard__card span { font-size: 12px; color: var(--v-color-text-secondary); }
.pf-field--check { flex-direction: row; align-items: center; gap: 8px; }
