:root {
    color: #172033;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

html,
body,
#app,
main {
    height: 100%;
    margin: 0;
    min-height: 100%;
}

body {
    background: #edf0f3;
}

.app-header {
    align-items: center;
    background: #fff;
    border-bottom: 1px solid #cbd2db;
    display: flex;
    height: 72px;
    justify-content: space-between;
    padding: 10px 24px;
}

.app-header h1 {
    font-size: 24px;
    letter-spacing: 0;
    line-height: 1.1;
    margin: 2px 0 0;
}

.product-name {
    color: #536174;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    margin: 0;
    text-transform: uppercase;
}

.mode-badge {
    background: #e5f3ed;
    border: 1px solid #9ec9b8;
    color: #14543c;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 9px;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    height: calc(100vh - 72px);
}

.controls {
    background: #f8f9fb;
    border-right: 1px solid #cbd2db;
    overflow: auto;
    padding: 22px;
}

.file-control label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
}

.file-control input[type="file"] {
    background: #fff;
    border: 1px solid #8996a8;
    font: inherit;
    max-width: 100%;
    padding: 8px;
    width: 100%;
}

.file-control input[type="file"]:focus-visible {
    outline: 3px solid #4e83bd;
    outline-offset: 2px;
}

.sample-button {
    background: #fff;
    border: 1px solid #27679d;
    color: #1c527e;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    margin-top: 10px;
    padding: 8px 10px;
    width: 100%;
}

.sample-button:hover:not(:disabled) {
    background: #eaf2f8;
}

.sample-button:focus-visible {
    outline: 3px solid #4e83bd;
    outline-offset: 2px;
}

.sample-button:disabled {
    cursor: wait;
    opacity: 0.6;
}

.privacy-note,
.status {
    color: #536174;
    font-size: 13px;
    line-height: 1.45;
    margin: 9px 0 18px;
}

.status.error {
    color: #9a2727;
}

.metrics {
    border-bottom: 1px solid #d7dce3;
    border-top: 1px solid #d7dce3;
    display: grid;
    gap: 9px;
    margin: 18px 0;
    padding: 14px 0;
}

.metrics div {
    display: grid;
    gap: 8px;
    grid-template-columns: 96px minmax(0, 1fr);
}

.metrics dt {
    color: #536174;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.metrics dd {
    margin: 0;
    overflow-wrap: anywhere;
}

details {
    border-top: 1px solid #d7dce3;
    padding: 12px 0;
}

summary {
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
}

details ul {
    font-size: 13px;
    line-height: 1.45;
    padding-left: 20px;
}

.diagnostics code {
    color: #7a2c13;
    font-size: 12px;
}

.preview-shell {
    min-width: 0;
    overflow: hidden;
    position: relative;
}

.preview-shell iframe {
    background: #fff;
    border: 0;
    height: 100%;
    width: 100%;
}

.empty-state {
    left: 50%;
    position: absolute;
    text-align: center;
    top: 45%;
    transform: translate(-50%, -50%);
    width: min(420px, calc(100% - 40px));
}

.empty-state h2 {
    font-size: 20px;
    letter-spacing: 0;
    margin: 0 0 8px;
}

.empty-state p {
    color: #657386;
    margin: 0;
}

#blazor-error-ui {
    background: #fff4cf;
    bottom: 0;
    box-shadow: 0 -1px 4px rgb(0 0 0 / 18%);
    display: none;
    left: 0;
    padding: 10px 48px 10px 18px;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 16px;
}

.loading-progress {
    display: block;
    inset: 30vh 0 auto;
    margin: auto;
    position: absolute;
    width: 64px;
}

.loading-progress circle {
    fill: none;
    stroke: #a9b4c2;
    stroke-width: 0.5rem;
}

.loading-progress circle:last-child {
    stroke: #27679d;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
}

.loading-progress-text {
    inset: calc(30vh + 72px) 0 auto;
    position: absolute;
    text-align: center;
}

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

@media (max-width: 760px) {
    .app-header {
        padding-inline: 16px;
    }

    .workspace {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(520px, 1fr);
        height: auto;
        min-height: calc(100vh - 72px);
    }

    .controls {
        border-bottom: 1px solid #cbd2db;
        border-right: 0;
        padding: 16px;
    }

    .preview-shell {
        min-height: 520px;
    }
}
