html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #f7f8fa;
    color: #17202a;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.login-surface {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 38.2vw) 1fr;
    background: #f7f8fa;
}

.login-panel {
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(2px);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    min-width: 280px;
    overflow-y: auto;
    padding: 2.5rem 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 1;
}

.auth-header-row {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
}

.login-panel-main {
    min-height: 0;
}

.login-brand-block {
    margin-bottom: 2.2rem;
}

.login-app-name {
    color: #FF7224;
    font-size: clamp(2rem, 3vw, 2.3rem);
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.1;
}

.login-slogan {
    color: #6c757d;
    font-size: 0.82rem;
    margin-top: 0.2rem;
}

.login-title-block {
    margin-bottom: 2.4rem;
}

.login-title {
    color: #1a1a2e;
    font-size: clamp(1.9rem, 3vw, 2.2rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 0.4rem;
}

.login-subtitle {
    color: #6c757d;
    font-size: 0.85rem;
}

.login-form .mud-input-control {
    margin-bottom: 0.41rem;
}

.login-form .mud-input-label {
    font-size: 0.69rem;
}

.login-form .mud-input-slot {
    font-size: 0.75rem;
    min-height: 1.95rem;
}

.login-form .mud-input-helper-text {
    font-size: 0.62rem;
    margin-top: 0.19rem;
}

.login-user-type {
    border: 1px solid #e9ecef;
    border-radius: 0.6rem;
    padding: 0.3rem 0.45rem;
}

.login-btn {
    border-radius: 0.45rem;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    min-height: 2.4rem;
    padding: 0.68rem;
}

.auth-link-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.login-language-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

.login-credits {
    color: #7f8c8d;
    font-size: 0.72rem;
    line-height: 1.6;
    margin-top: 2rem;
}

.login-credits-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e9ecef;
    border-radius: 0.6rem;
    padding: 0.85rem 1rem;
}

.login-credits-accent {
    background: #FF7224;
    border-radius: 999px;
    height: 3px;
    margin-bottom: 0.55rem;
}

.culture-switch {
    align-items: center;
    display: inline-flex;
    gap: 0.35rem;
}

.culture-link {
    border: 1px solid #dfe5ec;
    border-radius: 4px;
    color: #1A5276;
    display: inline-flex;
    font-size: 0.8rem;
    gap: 0.4rem;
    min-height: 28px;
    padding: 0 10px;
    text-decoration: none;
    align-items: center;
}

.culture-link:hover {
    background: rgba(26, 82, 118, 0.08);
    color: #1A5276;
}

.flag {
    border: 1px solid rgba(26, 82, 118, 0.18);
    border-radius: 2px;
    display: inline-block;
    flex: 0 0 auto;
    height: 12px;
    overflow: hidden;
    width: 18px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.flag-cn {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 12'%3E%3Crect width='18' height='12' fill='%23de2910'/%3E%3Cpolygon points='4.2,1.3 4.7,2.8 6.2,2.8 5,3.7 5.5,5.1 4.2,4.2 3,5.1 3.5,3.7 2.2,2.8 3.8,2.8' fill='%23ffde00'/%3E%3C/svg%3E");
}

.flag-gb {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 12'%3E%3Crect width='18' height='12' fill='%23012169'/%3E%3Cpath d='M0 0l18 12M18 0L0 12' stroke='%23fff' stroke-width='3'/%3E%3Cpath d='M0 0l18 12M18 0L0 12' stroke='%23c8102e' stroke-width='1.6'/%3E%3Cpath d='M9 0v12M0 6h18' stroke='%23fff' stroke-width='4'/%3E%3Cpath d='M9 0v12M0 6h18' stroke='%23c8102e' stroke-width='2.2'/%3E%3C/svg%3E");
}

.login-panel .mud-tabs {
    min-width: 0;
}

.login-panel .mud-tab {
    min-width: 0;
}

.login-panel .mud-input-control {
    margin-top: 0;
}

.login-context {
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        linear-gradient(rgba(12, 28, 45, 0.46), rgba(12, 28, 45, 0.46)),
        var(--login-bg-image, linear-gradient(135deg, #1A5276 0%, #2471A3 100%));
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    padding: clamp(2rem, 6vw, 5rem);
    width: 100%;
}

.home-surface {
    background:
        linear-gradient(180deg, rgba(8, 22, 38, 0.48) 0%, rgba(8, 22, 38, 0.36) 48%, rgba(8, 22, 38, 0.54) 100%),
        var(--home-bg-image, linear-gradient(135deg, #1A5276 0%, #2471A3 100%));
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    color: #ffffff;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

.home-nav {
    align-items: center;
    display: flex;
    justify-content: flex-end;
    left: 0;
    padding: clamp(1rem, 3vw, 2rem);
    position: absolute;
    right: 0;
    top: 0;
    z-index: 1;
}

.home-login-button {
    background: #ffffff !important;
    border-radius: 4px;
    box-shadow: 0 12px 28px rgba(8, 22, 38, 0.28);
    color: #163d58 !important;
    font-weight: 700;
    min-height: 38px;
    padding: 0 1.25rem;
}

.home-login-button:hover {
    background: rgba(255, 255, 255, 0.92) !important;
}

.home-brand {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    inset: 0;
    justify-content: center;
    margin: auto;
    max-width: min(44rem, calc(100vw - 2.5rem));
    padding: clamp(1.25rem, 4vw, 3rem);
    position: absolute;
    text-align: center;
}

.home-actions {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.home-divider {
    background: rgba(255, 255, 255, 0.62);
    height: 1px;
    width: min(20rem, 72vw);
}

.home-locale-selector {
    justify-content: center;
}

.home-culture-link {
    background: transparent;
    border-color: transparent;
    color: rgba(255, 255, 255, 0.9);
    min-height: auto;
    padding: 0;
}

.home-culture-link:hover {
    background: transparent;
    color: #ffffff;
    text-decoration: underline;
}

.home-culture-divider {
    color: rgba(255, 255, 255, 0.56);
    font-size: 0.8rem;
}

.home-brand h1 {
    font-size: clamp(2.4rem, 7vw, 5.5rem);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 0.95;
    margin: 0;
}

.home-brand h1:focus {
    outline: none;
}

.home-brand p {
    color: rgba(255, 255, 255, 0.86);
    font-size: clamp(1rem, 2vw, 1.35rem);
    letter-spacing: 0;
    line-height: 1.3;
    margin: 1rem 0 0;
}

.data-workspace {
    --data-border: #dfe5ec;
    --data-muted: #637381;
    --data-panel: #ffffff;
    --data-soft: #f6f8fb;
}

.auth-workspace {
    --data-border: #dfe5ec;
    --data-panel: #ffffff;
    --data-soft: #f6f8fb;
    --data-muted: #637381;
}

.auth-panel {
    background: var(--data-panel);
    border: 1px solid var(--data-border);
    border-radius: 6px;
    min-height: calc(100vh - 13rem);
    overflow: auto;
    padding: 1rem;
}

.auth-panel--compact {
    min-height: auto;
}

.auth-panel code {
    background: #f6f8fb;
    border: 1px solid #dfe5ec;
    border-radius: 4px;
    color: #17202a;
    display: block;
    margin-top: 0.4rem;
    overflow-wrap: anywhere;
    padding: 0.45rem 0.55rem;
}

.auth-inline-code {
    display: inline-block !important;
    margin-top: 0 !important;
    max-width: 100%;
    white-space: nowrap;
}

.dashboard-workspace {
    --data-border: #dfe5ec;
    --data-panel: #ffffff;
    --data-soft: #f6f8fb;
    --data-muted: #637381;
}

.dashboard-panel,
.dashboard-section-panel {
    background: var(--data-panel);
    border: 1px solid var(--data-border);
    border-radius: 6px;
    padding: 1rem;
}

.dashboard-panel-heading {
    margin-bottom: 0.75rem;
}

.dashboard-panel-title {
    color: #17202a;
    font-weight: 700;
    line-height: 1.2;
}

.dashboard-summary-strip {
    margin-bottom: 0;
}

.dashboard-section-panel {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.dashboard-section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.data-page-header {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.data-page-title {
    color: #17202a;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.15;
    margin-bottom: 0.2rem;
}

.data-summary-strip {
    background: var(--data-panel);
    border: 1px solid var(--data-border);
    border-radius: 6px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.data-summary-item {
    border-right: 1px solid var(--data-border);
    min-width: 0;
    padding: 0.75rem 1rem;
}

.data-summary-item:last-child {
    border-right: 0;
}

.data-summary-item span {
    color: var(--data-muted);
    display: block;
    font-size: 0.75rem;
    line-height: 1.1;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.data-summary-item strong {
    color: #1A5276;
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-panel {
    height: calc(100vh - 8.5rem);
    overflow: auto;
    border-radius: 6px;
}

.data-selector-panel,
.data-main-panel {
    background: var(--data-panel);
    border: 1px solid var(--data-border);
    padding: 0.9rem;
}

.data-main-panel {
    padding: 1rem;
}

.data-create-panel {
    background: var(--data-panel);
    border: 1px solid var(--data-border);
    border-radius: 6px;
    min-height: 100%;
    padding: 1rem;
}

.data-selector-panel-wide {
    height: auto;
    max-height: none;
}

.data-selector-panel-wide .data-point-list {
    max-height: 15rem;
}

.data-selector-panel-wide .selected-series-list {
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.data-section-heading {
    align-items: baseline;
    border-top: 1px solid var(--data-border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 0.8rem;
}

.resource-context {
    background: #f6f8fb;
    border: 1px solid #dfe5ec;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    margin-bottom: 0.45rem;
    min-width: 0;
    padding: 0.55rem 0.65rem;
}

.resource-context span,
.resource-context small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resource-context span {
    color: #17202a;
    font-weight: 700;
}

.resource-context small {
    color: #637381;
    font-size: 0.72rem;
}

.data-point-list {
    border: 1px solid #edf1f5;
    border-radius: 6px;
    max-height: 38vh;
    overflow: auto;
    padding: 0.25rem;
}

.selected-series-list {
    border-top: 1px solid #dfe5ec;
    display: grid;
    gap: 0.35rem;
    margin-top: 0.8rem;
    padding-top: 0.7rem;
}

.selector-action-row {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.selector-action-row .mud-button-root {
    width: 100%;
}

.selected-series-item {
    align-items: center;
    background: #f6f8fb;
    border: 1px solid #edf1f5;
    border-radius: 4px;
    display: grid;
    gap: 0.3rem;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 30px;
    padding: 0.25rem 0.35rem 0.25rem 0.55rem;
}

.selected-series-item span {
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selected-series-item button {
    align-items: center;
    background: transparent;
    border: 0;
    color: #637381;
    display: inline-flex;
    height: 24px;
    justify-content: center;
    width: 24px;
}

.selected-series-item button:hover {
    color: #D32F2F;
}

.selected-list-row {
    background: rgba(26, 82, 118, 0.12);
    border-radius: 4px;
}

.series-picker-row {
    align-items: center;
    border-radius: 4px;
    display: grid;
    gap: 0.25rem;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 30px;
    padding: 0.05rem 0.25rem;
}

.series-picker-row:hover {
    background: rgba(26, 82, 118, 0.06);
}

.selected-picker-row {
    background: rgba(26, 82, 118, 0.12);
}

.series-picker-button {
    align-items: flex-start;
    background: transparent;
    border: 0;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-self: start;
    line-height: 1.05;
    min-width: 0;
    padding: 0;
    text-align: left;
    width: 100%;
}

.series-picker-button span,
.series-picker-button small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.series-picker-button small {
    color: #637381;
    font-size: 0.7rem;
}

.json-editor {
    border: 1px solid #dfe5ec;
    border-radius: 8px;
    overflow: hidden;
}

.json-editor-host {
    min-height: 26rem;
}

.json-editor .jsoneditor {
    border: 0;
}

.json-editor .jsoneditor-menu {
    background: #1a5276;
    border-bottom: 1px solid #164562;
}

.json-editor .ace-jsoneditor .ace_gutter {
    background: #f6f8fb;
}

.data-value-cell {
    display: block;
    line-height: 1.25;
    max-height: 8rem;
    max-width: min(56rem, 100%);
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.data-table {
    border: 1px solid var(--data-border);
    border-radius: 6px;
    overflow: hidden;
}

.steam-meter {
    background: #f6f8fb;
    border: 1px solid #dfe5ec;
    border-radius: 6px;
    margin-bottom: 0.9rem;
    padding: 0.75rem;
}

.steam-meter-head,
.steam-meter-scale {
    align-items: baseline;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.steam-meter-head {
    margin-bottom: 0.55rem;
}

.steam-meter-head span,
.steam-meter-scale {
    color: #637381;
    font-size: 0.78rem;
}

.steam-meter-head strong {
    color: #17202a;
    font-size: 1.35rem;
    line-height: 1;
}

.steam-meter-scale {
    margin-top: 0.4rem;
}

.usage-table-toolbar {
    align-items: center;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(14rem, 26rem) auto;
    margin: 0.75rem 0;
}

.usage-table-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.accounting-detail-grid {
    display: grid;
    gap: 0.35rem 0.75rem;
    grid-template-columns: minmax(8rem, 1fr) auto;
}

.accounting-detail-grid span {
    color: #637381;
    font-size: 0.78rem;
    min-width: 0;
}

.accounting-detail-grid strong {
    color: #17202a;
    font-size: 0.86rem;
    font-weight: 700;
    text-align: right;
}

.accounting-metric-row {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    margin-bottom: 0.5rem;
}

.accounting-metric-row div {
    background: #f6f8fb;
    border: 1px solid #dfe5ec;
    border-radius: 6px;
    min-width: 0;
    padding: 0.55rem 0.65rem;
}

.accounting-metric-row span {
    color: #637381;
    display: block;
    font-size: 0.72rem;
    line-height: 1.1;
    margin-bottom: 0.2rem;
}

.accounting-metric-row strong {
    color: #17202a;
    display: block;
    font-size: 1rem;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.accounting-tabs .mud-tabs-panels {
    padding-top: 0.6rem;
}

.computing-workspace {
    --data-border: #dfe5ec;
    --data-panel: #ffffff;
    --data-soft: #f6f8fb;
    --data-muted: #637381;
}

.computing-panel {
    min-height: calc(100vh - 13rem);
}

.computing-billing-row {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.computing-file-box {
    background: #f6f8fb;
    border: 1px dashed #cbd5df;
    border-radius: 6px;
    display: grid;
    gap: 0.45rem;
    padding: 0.75rem;
}

.computing-file-box input[type="file"] {
    font-size: 0.82rem;
}

.computing-attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.computing-code-field textarea {
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 0.82rem;
    line-height: 1.35;
}

.computing-image-output {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.computing-image-output-item {
    border: 1px solid var(--data-border);
    border-radius: 6px;
    display: grid;
    gap: 0.5rem;
    overflow: hidden;
    padding: 0.5rem;
}

.computing-image-output-item img {
    background: var(--data-soft);
    border-radius: 4px;
    display: block;
    max-height: 28rem;
    object-fit: contain;
    width: 100%;
}

.latest-data-table {
    margin-bottom: 0.25rem;
}

.data-chart-scatter circle {
    r: 2px;
}

.data-workspace .mud-table-cell {
    line-height: 1.2;
    padding: 0.35rem 0.75rem;
    text-align: left;
}

.data-workspace .mud-table-head .mud-table-cell {
    background: var(--data-soft);
    color: #34495e;
    font-weight: 700;
}

.data-workspace .mud-input-control {
    margin-top: 0;
}

.data-workspace .mud-expand-panel {
    border-bottom: 1px solid #edf1f5;
}

.data-workspace .mud-expand-panel-header {
    min-height: 36px;
    padding: 0.25rem 0.5rem;
}

.data-workspace .mud-expand-panel-content {
    padding: 0.1rem 0.25rem 0.4rem;
}

.export-method-panel,
.export-task-panel {
    background: #f6f8fb;
    border: 1px solid #dfe5ec;
    border-radius: 6px;
    padding: 0.75rem;
}

.export-method-grid {
    display: grid;
    gap: 0.15rem 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
}

.mud-button {
    text-transform: none;
}

.download-link {
    align-items: center;
    border: 1px solid #1A5276;
    border-radius: 4px;
    color: #1A5276;
    display: inline-flex;
    font-size: 0.875rem;
    font-weight: 500;
    gap: 0.45rem;
    min-height: 36px;
    padding: 0 16px;
    text-decoration: none;
}

.download-link:hover {
    background: rgba(26, 82, 118, 0.08);
    color: #1A5276;
}

.download-icon {
    font-size: 1.1rem;
    line-height: 1;
}

#blazor-error-ui {
    display: none;
}

@media (max-width: 900px) {
    .login-surface {
        grid-template-columns: 1fr;
    }

    .login-context {
        display: none;
    }

    .workspace-panel {
        height: auto;
        max-height: 70vh;
    }

    .data-summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .data-summary-item:nth-child(2) {
        border-right: 0;
    }

    .usage-table-toolbar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .data-summary-strip {
        grid-template-columns: 1fr;
    }

    .data-summary-item {
        border-right: 0;
        border-bottom: 1px solid var(--data-border);
    }

    .data-summary-item:last-child {
        border-bottom: 0;
    }
}
