html, body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    margin: 0;
    min-height: 100vh;
    background-color: #05070f;
    color: #f5f8ff;
}

html {
    scrollbar-gutter: stable;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #37d3b5;
    text-decoration: none;
}

a:hover, .btn-link:hover {
    color: #8be8dc;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    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: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42N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Zlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #37d3b5;
    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: #37d3b5;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: #9fb4d7;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    color: #c9d7ef;
}

::selection {
    background: rgba(55, 211, 181, 0.4);
    color: #05070f;
}

input, button, select, textarea {
    font-family: inherit;
}

/* --- Light/WPF-style overrides --- */
:root{
  --bs-body-bg:#ffffff; --bs-body-color:#111111;
  --panel-bg:#ffffff; --panel-border:#d9d9d9;
  --muted:#666666; --accent:#0d6efd;
  --ops-font-size:16px; --ops-line-height:1.45;
  --ops-title-size:1.25rem; --ops-muted:#5f7187;
}
html,body{ background:#fff; color:#111; }
a{ color:var(--accent); }
.card,.dashboard__card,.editor-panel,.run-panel{
  background:var(--panel-bg);
  border:1px solid var(--panel-border);
}
.toolbar, .run-toolbar{
  position:sticky; top:0; z-index:5;
  background:#fff; border-bottom:1px solid var(--panel-border);
}
.editor-heading{
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.editor-heading .path{
  display:inline-block; max-width:70%;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.editor-actions{ float:right; display:flex; gap:.5rem; }
.editor-actions .btn{ white-space:nowrap; }

/* Give the left column full height and scroll */
.classic-layout{
  display:grid; grid-template-columns: 1fr 2fr 1fr; gap:12px; height:100vh;
}
.classic-left, .classic-center, .classic-right{ overflow:auto; }

/* --- Light theme override (global) --- */
html, body { background:#ffffff !important; color:#111 !important; }
.navbar, .toolbar, .run-toolbar { background:#fff !important; border-color:#d9d9d9 !important; }
.card, .classic-left, .classic-center, .classic-right,
.editor-panel, .run-panel { background:#fff !important; border:1px solid #d9d9d9 !important; }
a { color:#0d6efd; }
/* keep editor actions visible & headings readable */
.editor-actions { position:sticky; top:0; z-index:5; background:#fff; padding:6px 0; }
.editor-heading { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.editor-heading .path { display:inline-block; max-width:70%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.classic-layout { display:grid; grid-template-columns: 1fr 2fr 1fr; gap:12px; height:100vh; }
.classic-left, .classic-center, .classic-right { overflow:auto; }
/* Empty layout canvas */
.app-shell {
    box-sizing: border-box;
    min-height: 100vh;
    padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    background: #0c1018;
}

.app-blank {
    background: #fff;
    color: #111;
}

.app-shell__main {
    padding: 1rem 0;
}

.ops-surface {
    font-size: var(--ops-font-size);
    line-height: var(--ops-line-height);
}

.ops-muted {
    color: var(--ops-muted);
}

:root {
    --app-header-height: 56px;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: var(--app-header-height);
    padding: 0.5rem 1rem;
    line-height: 1.2;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 900;
    flex-wrap: wrap;
}

.app-header__left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1 1 420px;
}

.app-header__logo {
    max-height: 44px;
    width: auto;
    object-fit: contain;
    display: block;
}

.app-header__right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    text-align: right;
    min-width: 0;
    flex: 0 0 auto;
    flex-wrap: wrap;
}

.app-header__titleblock {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.app-header__title {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 0.4rem;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.1;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-header__title-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-header__build {
    font-size: 0.85rem;
    font-weight: 600;
    color: #5f7187;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.app-header__meta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: #5f7187;
}

.app-header__meta select {
    max-width: 160px;
}

.app-header__nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.app-header__session-expired {
    font-size: 0.82rem;
    color: #8a2c0d;
    background: #fff4e8;
    border: 1px solid #f7c89b;
    border-radius: 8px;
    padding: 0.35rem 0.6rem;
}

.app-header__session-expired a {
    color: inherit;
    font-weight: 700;
}

@media (max-width: 720px) {
    .app-header {
        align-items: flex-start;
    }

    .app-header__left {
        flex: 1 1 100%;
    }

    .app-header__right {
        width: 100%;
        justify-content: space-between;
    }

    .app-header__meta {
        font-size: 0.78rem;
    }

    .app-header__nav .button {
        padding: 0.35rem 0.6rem;
        font-size: 0.82rem;
    }
}

.button {
    padding: 0.5rem 0.95rem;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #111827;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.button--primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.button--ghost {
    background: #f8fafc;
    border-color: #d6dde6;
    color: #1f2937;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.spinner {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid #e5e7eb;
    border-top-color: #2563eb;
    animation: spinner-rotate 0.9s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* Keep toolbar buttons fixed on the right, title truncates with ellipsis */
.pane__toolbar {
    position: sticky; /* you already had this */
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    overflow: hidden; /* prevent horizontal jiggle */
}

.pane__title {
    flex: 1 1 auto; /* take remaining space */
    min-width: 0; /* *required* for ellipsis in flex layouts */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* long filenames won't push buttons */
}

.pane__actions {
    flex: 0 0 auto; /* keep width to content */
    display: flex;
    gap: .5rem;
    white-space: nowrap; /* never wrap buttons */
    flex-wrap: nowrap;
}

/* --- Toolbar pinning override (keeps buttons always visible) --- */
.pane__toolbar {
    display: grid !important;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: .5rem;
}

    .pane__toolbar .pane__title {
        min-width: 0; /* allow column to shrink */
        white-space: nowrap; /* single line */
        overflow: hidden; /* clip overflow */
        text-overflow: ellipsis; /* show … when clipped */
    }

    .pane__toolbar .pane__actions {
        display: flex;
        gap: .5rem;
        flex-wrap: nowrap; /* keep buttons on one line */
    }

.services-page__header {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.25rem;
    align-items: flex-start;
    width: 100%;
    justify-content: flex-start;
}

.services-page__header-left {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.services-page__title {
    flex: 1 1 260px;
    min-width: 0;
}

.services-page__eyebrow {
    margin: 0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #5f7187;
}

.services-page__actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    flex: 0 0 auto;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .services-page__actions {
        white-space: normal;
    }
}
