:root {
    color-scheme: dark;
    --bg: #0c1116;
    --panel: #141b22;
    --panel-border: #202a33;
    --txt: #dde5ed;
    --muted: #8fa1b3;
    --accent: #2ecc71;
    --accent-2: #4aa3ff;
    --danger: #ff6b6b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: var(--txt);
    background: var(--bg);
}

a {
    color: #7cc4ff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: min(1200px, 100% - 2rem);
    margin: 0 auto;
}

.topbar {
    border-bottom: 1px solid var(--panel-border);
    background: #0f151c;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
}

.brand {
    font-weight: 700;
    font-size: 1rem;
    color: var(--txt);
}

.nav a {
    color: var(--muted);
    margin-left: 0.8rem;
}

.nav-form {
    display: inline;
    margin-left: 0.8rem;
}

.nav-link {
    display: inline;
    padding: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 400;
}

.page {
    padding: 1rem 0 2rem;
    display: grid;
    gap: 1rem;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 1rem;
}

.auth-panel {
    width: min(560px, 100%);
    margin-inline: auto;
}

.auth-links {
    margin: 1rem 0 0;
    text-align: center;
}

h1, h2 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
}

.muted {
    color: var(--muted);
    margin-top: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ai-analysis-loader {
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
}

.ai-analysis-loader[hidden] {
    display: none;
}

.ai-analysis-loader-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(560px, 100%);
}

.ai-analysis-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    min-height: 100dvh;
    padding: 1.25rem;
    overflow: auto;
    background:
        radial-gradient(circle at 50% 38%, rgba(74, 163, 255, 0.13), transparent 34%),
        rgba(5, 9, 13, 0.88);
    backdrop-filter: blur(9px);
}

.ai-analysis-overlay .ai-analysis-loader-card {
    padding: clamp(1.35rem, 4vw, 2.4rem);
    border: 1px solid rgba(111, 160, 202, 0.3);
    border-radius: 18px;
    background: linear-gradient(155deg, rgba(20, 29, 38, 0.98), rgba(10, 16, 22, 0.98));
    box-shadow:
        0 28px 80px rgba(0, 0, 0, 0.52),
        inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

body.ai-overlay-open {
    overflow: hidden;
}

.ai-analysis-loader h2 {
    margin: 0 0 0.65rem;
    font-size: clamp(1.2rem, 3vw, 1.65rem);
}

.ai-loader-mark {
    position: relative;
    width: 112px;
    height: 112px;
    display: grid;
    place-items: center;
    margin-bottom: 0.85rem;
}

.ai-loader-mark::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(74, 163, 255, 0.16);
    border-top-color: var(--accent-2);
    border-right-color: var(--accent);
    animation: ai-loader-spin 1.8s linear infinite;
}

.ai-loader-mark img {
    width: 96px;
    height: 96px;
    display: block;
}

.ai-loader-brand {
    margin: 0 0 0.4rem;
    color: var(--accent-2);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.ai-rule-speed {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: clamp(190px, 42vw, 230px);
    aspect-ratio: 1;
    margin: 0.85rem 0 1.15rem;
    border: 1px solid rgba(74, 163, 255, 0.34);
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 42%, rgba(46, 204, 113, 0.1), transparent 47%),
        #0d151d;
    box-shadow:
        0 0 42px rgba(74, 163, 255, 0.13),
        inset 0 0 30px rgba(74, 163, 255, 0.055);
}

.ai-rule-speed::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -7px;
    border: 2px solid rgba(74, 163, 255, 0.2);
    border-top-color: var(--accent);
    border-right-color: var(--accent-2);
    border-radius: 50%;
    animation: ai-speed-ring 4.8s linear infinite;
}

.ai-rule-speed-status {
    margin-bottom: 0.48rem;
    border: 1px solid rgba(46, 204, 113, 0.35);
    border-radius: 999px;
    padding: 0.24rem 0.5rem;
    color: #8ee3af;
    background: rgba(46, 204, 113, 0.08);
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.ai-rule-speed-label {
    color: #a9bbcd;
    font-size: 0.78rem;
}

.ai-rule-speed-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 0.12rem;
}

.ai-rule-speed-value strong {
    color: #f3f8fc;
    font-size: clamp(2.45rem, 8vw, 3.55rem);
    line-height: 1;
    letter-spacing: -0.045em;
    text-shadow: 0 0 24px rgba(46, 204, 113, 0.2);
}

.ai-rule-speed-value small {
    color: #8fa1b3;
    font-size: 0.8rem;
    font-weight: 600;
}

.ai-analysis-loader.has-rule-speed .ai-loader-mark {
    display: none;
}

.ai-loader-detail {
    max-width: 540px;
    margin-bottom: 0.8rem;
    line-height: 1.5;
}

.ai-loader-progress {
    position: relative;
    width: min(360px, 88%);
    height: 2px;
    margin: 0.15rem 0 0.8rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(143, 161, 179, 0.16);
}

.ai-loader-progress span {
    position: absolute;
    inset: 0 auto 0 -42%;
    width: 42%;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, var(--accent-2), var(--accent));
    animation: ai-loader-progress 1.8s ease-in-out infinite;
}

.ai-loader-dots {
    display: flex;
    gap: 0.38rem;
    min-height: 0.55rem;
}

.ai-loader-dots span {
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 50%;
    background: var(--accent);
    animation: ai-loader-pulse 1.2s ease-in-out infinite;
}

.ai-loader-dots span:nth-child(2) {
    animation-delay: 0.16s;
}

.ai-loader-dots span:nth-child(3) {
    animation-delay: 0.32s;
}

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

@keyframes ai-loader-pulse {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-3px); }
}

@keyframes ai-loader-progress {
    0% { transform: translateX(0); }
    100% { transform: translateX(340%); }
}

@keyframes ai-speed-ring {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .ai-loader-mark::before,
    .ai-loader-dots span,
    .ai-loader-progress span,
    .ai-rule-speed::before {
        animation: none;
    }
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.8rem;
    align-items: end;
}

label span {
    display: block;
    color: var(--muted);
    margin-bottom: 0.25rem;
    font-size: 0.86rem;
}

input[type="text"],
input[type="password"],
input[type="file"],
textarea,
select {
    width: 100%;
    background: #10171f;
    border: 1px solid #273544;
    color: var(--txt);
    border-radius: 6px;
    padding: 0.55rem 0.65rem;
}

textarea {
    min-height: 5rem;
    resize: vertical;
    font: inherit;
}

.full-row,
.feedback-meta {
    grid-column: 1 / -1;
}

button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #08110b;
    border: 0;
    border-radius: 6px;
    font-weight: 600;
    padding: 0.6rem 0.9rem;
    cursor: pointer;
}

.btn.secondary {
    background: #263646;
    color: var(--txt);
}

.btn.danger {
    background: var(--danger);
    color: #1b0f0f;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: center;
    flex-wrap: wrap;
}

.actions {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.actions > .btn,
.actions > .inline-form > .btn,
.actions > .settings-menu > summary.btn {
    height: 2.5rem;
    min-height: 2.5rem;
    padding-top: 0;
    padding-bottom: 0;
    line-height: 1;
}

.actions > .inline-form {
    display: inline-flex;
}

.settings-menu {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    height: 2.5rem;
    overflow: visible;
}

.settings-menu[open] {
    z-index: 100;
}

.settings-menu > summary {
    list-style: none;
    white-space: nowrap;
    box-sizing: border-box;
}

.settings-menu > summary::-webkit-details-marker {
    display: none;
}

.settings-menu[open] > summary {
    background: #31465a;
}

.settings-actions {
    position: absolute;
    left: 0;
    top: calc(100% + 0.35rem);
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 210px;
    padding: 0.4rem;
    background: #0f151c;
    border: 1px solid #314254;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgb(0 0 0 / 0.35);
}

.settings-option {
    display: flex;
    align-items: center;
    min-height: 2.25rem;
    width: 100%;
    padding: 0.55rem 0.65rem;
    color: var(--txt);
    border-radius: 7px;
    justify-content: flex-start;
    font-weight: 600;
}

.settings-option:hover {
    background: #1b2a38;
    text-decoration: none;
}

.settings-option.active {
    background: #263646;
    color: var(--txt);
    outline: 1px solid #4aa3ff;
}

.report-actions .btn {
    background: #263646;
    color: var(--txt);
}

.report-actions .btn.danger {
    background: var(--danger);
    color: #1b0f0f;
}

.inline-form {
    margin: 0;
}

.table-wrap {
    width: 100%;
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid #22303d;
    padding: 0.55rem 0.45rem;
    text-align: left;
    font-size: 0.87rem;
    vertical-align: top;
}

th {
    color: #a9bbcd;
    font-weight: 600;
}

.flash {
    border-radius: 6px;
    padding: 0.6rem 0.7rem;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
}

.flash.success {
    background: rgba(46, 204, 113, 0.12);
    border: 1px solid rgba(46, 204, 113, 0.5);
}

.flash.error {
    background: rgba(255, 107, 107, 0.12);
    border: 1px solid rgba(255, 107, 107, 0.5);
}

.flash.warn {
    background: rgba(241, 196, 15, 0.12);
    border: 1px solid rgba(241, 196, 15, 0.55);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chip {
    display: inline-flex;
    background: #19232d;
    border: 1px solid #293847;
    border-radius: 999px;
    padding: 0.3rem 0.65rem;
    color: #c4d3e1;
    font-size: 0.84rem;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.75rem;
}

.meta-grid div {
    background: #0f151d;
    border: 1px solid #22303d;
    border-radius: 6px;
    padding: 0.55rem 0.65rem;
}

.expert-report-overview {
    display: grid;
    grid-template-columns: minmax(300px, 0.82fr) minmax(430px, 1.18fr);
    gap: 0.75rem;
    align-items: stretch;
}

.expert-overview-primary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.expert-identity-grid,
.expert-context-card,
.expert-feedback-card,
.expert-jump-facts {
    min-width: 0;
    border: 1px solid #22303d;
    border-radius: 8px;
    background: #0f151d;
}

.expert-identity-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.expert-identity-grid > div,
.expert-context-card,
.expert-feedback-card {
    padding: 0.65rem 0.75rem;
}

.expert-identity-grid > div + div {
    border-left: 1px solid #22303d;
}

.expert-context-card,
.expert-feedback-card {
    grid-column: 1 / -1;
}

.expert-feedback-form {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.expert-feedback-form textarea {
    min-height: 3.4rem;
    resize: vertical;
}

.expert-jump-facts {
    padding: 0.65rem 0.75rem;
}

.expert-jump-facts-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.45rem;
}

.expert-jump-facts-head .label {
    margin: 0;
}

.expert-validity {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 0.2rem 0.48rem;
    font-size: 0.7rem;
    line-height: 1;
    border: 1px solid #344454;
    color: #bdcbd8;
    background: #18222c;
}

.expert-validity.is-valid {
    color: #8be0ad;
    border-color: rgba(46, 204, 113, 0.36);
    background: rgba(46, 204, 113, 0.09);
}

.expert-validity.is-invalid {
    color: #ff9b9b;
    border-color: rgba(255, 107, 107, 0.4);
    background: rgba(255, 107, 107, 0.09);
}

.expert-facts-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    border-top: 1px solid #202c37;
}

.expert-facts-list > div {
    min-width: 0;
    padding: 0.36rem 0.45rem 0.36rem 0;
    border-bottom: 1px solid #202c37;
}

.expert-facts-list > div:nth-child(even):not(.expert-fact-wide) {
    padding-left: 0.6rem;
    border-left: 1px solid #202c37;
}

.expert-facts-list .expert-fact-wide {
    grid-column: 1 / -1;
}

.expert-facts-list dt,
.expert-facts-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.expert-facts-list dt {
    margin-bottom: 0.08rem;
    color: var(--muted);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.035em;
}

.expert-facts-list dd {
    color: #d8e2eb;
    font-size: 0.78rem;
    line-height: 1.32;
}

.expert-fact-detail {
    display: block;
    color: #8fa1b3;
    font-size: 0.7rem;
}

.dropzone-editor {
    margin-top: 0.55rem;
}

.dropzone-editor summary {
    list-style: none;
    width: fit-content;
    min-height: auto;
    padding: 0.38rem 0.62rem;
    cursor: pointer;
    user-select: none;
}

.dropzone-editor summary::-webkit-details-marker {
    display: none;
}

.dropzone-editor[open] summary {
    margin-bottom: 0.5rem;
}

.dropzone-editor-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.45rem;
    align-items: center;
    padding-top: 0.55rem;
    border-top: 1px solid #22303d;
}

.dropzone-editor-form select {
    min-width: 0;
}

.dropzone-editor-form .meta-note {
    grid-column: 1 / -1;
    margin: 0;
}

.context-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.4rem;
    align-items: center;
}

.context-form select {
    min-width: 0;
}

.context-form .btn {
    min-height: 2.3rem;
    padding: 0.45rem 0.7rem;
}

.feedback-form {
    display: grid;
    gap: 0.5rem;
}

.feedback-form .btn {
    justify-self: start;
}

.meta-note {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    margin-top: 0.35rem;
}

.label {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    margin-bottom: 0.2rem;
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.8rem;
}

.catalog-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.8rem;
    margin-top: 0.9rem;
}

.catalog-version,
.status-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border: 1px solid #314254;
    border-radius: 999px;
    padding: 0.28rem 0.58rem;
    color: #c7d6e5;
    background: #19232d;
    font-size: 0.78rem;
    white-space: nowrap;
}

.status-trusted,
.status-verified {
    color: #a9f3c7;
    border-color: rgba(46, 204, 113, 0.55);
    background: rgba(46, 204, 113, 0.1);
}

.status-candidate {
    color: #f7dd8b;
    border-color: rgba(241, 196, 15, 0.55);
    background: rgba(241, 196, 15, 0.1);
}

.status-inactive {
    color: #a9b5c1;
    border-color: #3a4652;
    background: #202831;
}

.catalog-filter {
    display: grid;
    grid-template-columns: minmax(240px, 2fr) minmax(140px, 0.7fr) minmax(170px, 0.9fr) auto;
    gap: 0.8rem;
    align-items: end;
}

.catalog-filter-actions {
    display: flex;
    gap: 0.45rem;
}

.result-count {
    margin: 0;
}

.breadcrumb {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    color: var(--muted);
    font-size: 0.82rem;
    margin-bottom: 0.75rem;
}

.catalog-detail-head {
    margin-bottom: 0.9rem;
}

.catalog-meta-grid > div {
    min-height: 4.15rem;
}

.catalog-subtable {
    margin-top: 1rem;
}

.source-ref {
    display: block;
    margin-top: 0.25rem;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.empty-state {
    margin-bottom: 0;
}

@media (max-width: 820px) {
    .catalog-filter {
        grid-template-columns: 1fr;
    }
}

.vertical-grid {
    grid-template-columns: 1fr;
}

.score-box {
    border: 1px solid #22303d;
    border-radius: 6px;
    padding: 0.7rem;
    background: #0f151d;
}

.score-box .k {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
}

.score-box .v {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.score-box .m {
    display: block;
    margin-top: 0.25rem;
    color: #9fb2c4;
    font-size: 0.82rem;
}

.expert-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.expert-kpi-card {
    position: relative;
    display: grid;
    grid-template-columns: 2.2rem minmax(0, 1fr);
    gap: 0.55rem;
    align-items: center;
    min-width: 0;
    min-height: 4.7rem;
    border: 1px solid #273645;
    border-radius: 9px;
    padding: 0.58rem 0.62rem;
    overflow: hidden;
    background: linear-gradient(145deg, #111a23, #0e141b);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.expert-kpi-card::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 2px;
    background: linear-gradient(90deg, rgba(74, 163, 255, 0.7), rgba(86, 207, 225, 0.08));
}

.expert-kpi-primary::after {
    background: linear-gradient(90deg, rgba(46, 204, 113, 0.85), rgba(74, 163, 255, 0.15));
}

.expert-kpi-icon,
.expert-timing-icon {
    display: grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    border: 1px solid rgba(74, 163, 255, 0.25);
    border-radius: 8px;
    color: #69b5f7;
    background: rgba(74, 163, 255, 0.09);
}

.expert-kpi-primary .expert-kpi-icon {
    border-color: rgba(46, 204, 113, 0.27);
    color: #63d893;
    background: rgba(46, 204, 113, 0.09);
}

.expert-kpi-icon svg,
.expert-timing-icon svg {
    width: 1.28rem;
    height: 1.28rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.expert-kpi-content {
    min-width: 0;
}

.expert-kpi-card .k {
    display: block;
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1.18;
}

.expert-kpi-card .v {
    display: block;
    margin-top: 0.2rem;
    font-size: 1rem;
    line-height: 1.1;
    font-weight: 700;
    overflow-wrap: anywhere;
    white-space: nowrap;
}

.expert-kpi-card .v small {
    color: #9fb2c4;
    font-size: 0.67em;
    font-weight: 500;
}

.expert-kpi-values {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.55rem;
    margin-top: 0.22rem;
    color: #9fb2c4;
    font-size: 0.67rem;
}

.expert-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    flex-wrap: wrap;
    margin-bottom: 0.65rem;
}

.expert-section-heading h2 {
    margin: 0;
}

.expert-window-badge,
.expert-section-note {
    border: 1px solid #293847;
    border-radius: 999px;
    padding: 0.26rem 0.55rem;
    color: #a9bbcd;
    background: #111922;
    font-size: 0.72rem;
}

.expert-fixpoint-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 0.55rem;
}

.expert-fixpoint-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.6rem;
    align-items: start;
    min-width: 0;
    padding: 0.58rem;
    border: 1px solid #253341;
    border-radius: 8px;
    background: #0f151d;
}

.expert-fixpoint-time {
    min-width: 2.65rem;
    padding: 0.35rem 0.25rem;
    border-radius: 7px;
    color: #7cc4ff;
    background: rgba(74, 163, 255, 0.09);
    text-align: center;
    font-size: 0.92rem;
    font-weight: 700;
}

.expert-fixpoint-time small,
.expert-fixpoint-card dd small {
    color: #8fa1b3;
    font-size: 0.7em;
    font-weight: 500;
}

.expert-fixpoint-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.28rem 0.5rem;
    margin: 0;
}

.expert-fixpoint-card dt,
.expert-fixpoint-card dd {
    margin: 0;
}

.expert-fixpoint-card dt {
    color: var(--muted);
    font-size: 0.65rem;
}

.expert-fixpoint-card dd {
    margin-top: 0.03rem;
    font-size: 0.76rem;
    font-weight: 650;
    white-space: nowrap;
}

.expert-timing-strip {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.65rem;
    align-items: center;
    margin-bottom: 0.65rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid rgba(86, 207, 225, 0.22);
    border-radius: 8px;
    background: rgba(86, 207, 225, 0.045);
}

.expert-timing-strip div {
    display: flex;
    gap: 0.2rem 0.65rem;
    align-items: baseline;
    flex-wrap: wrap;
    min-width: 0;
    font-size: 0.76rem;
}

.expert-timing-strip strong {
    color: #7fd4e1;
}

.expert-timing-strip span:not(.expert-timing-icon) {
    color: #9fb2c4;
}

.expert-reference-note {
    margin-bottom: 0.55rem;
    font-size: 0.75rem;
}

.expert-phase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 0.55rem;
}

.expert-phase-card {
    min-width: 0;
    padding: 0.65rem;
    border: 1px solid #253341;
    border-radius: 8px;
    background: #0f151d;
}

.expert-phase-card header {
    display: flex;
    justify-content: space-between;
    gap: 0.55rem;
    align-items: flex-start;
    margin-bottom: 0.55rem;
}

.expert-phase-card h3 {
    margin: 0;
    font-size: 0.86rem;
}

.expert-phase-card header div > span {
    display: block;
    margin-top: 0.08rem;
    color: var(--muted);
    font-size: 0.68rem;
}

.expert-phase-card .chip {
    padding: 0.2rem 0.45rem;
    font-size: 0.67rem;
}

.expert-phase-values {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid #202c37;
    border-radius: 6px;
    overflow: hidden;
}

.expert-phase-values > span {
    min-width: 0;
    padding: 0.38rem;
}

.expert-phase-values > span + span {
    border-left: 1px solid #202c37;
}

.expert-phase-values small,
.expert-phase-values strong,
.expert-phase-values em {
    display: block;
    overflow-wrap: anywhere;
}

.expert-phase-values small {
    color: var(--muted);
    font-size: 0.62rem;
}

.expert-phase-values strong {
    margin-top: 0.1rem;
    font-size: 0.82rem;
}

.expert-phase-values em {
    margin-top: 0.08rem;
    color: #8fa1b3;
    font-size: 0.61rem;
    font-style: normal;
}

.expert-phase-detail {
    display: flex;
    justify-content: space-between;
    gap: 0.65rem;
    margin-top: 0.36rem;
    color: #9fb2c4;
    font-size: 0.7rem;
}

.expert-phase-detail strong {
    color: #d4dee7;
    text-align: right;
}

.expert-phase-card p {
    margin: 0.48rem 0 0;
    padding-top: 0.45rem;
    border-top: 1px solid #202c37;
    color: #9fb2c4;
    font-size: 0.7rem;
    line-height: 1.35;
}

.expert-coaching-story p {
    width: 100%;
    max-width: none;
    line-height: 1.62;
}

@media (min-width: 1050px) {
    .expert-kpi-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .expert-kpi-reserve {
        grid-column: span 2;
    }

    .simple-kpi-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .simple-kpi-grid .expert-kpi-reserve {
        grid-column: auto;
    }
}

@media (max-width: 900px) {
    .expert-report-overview {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .panel {
        min-width: 0;
    }

    .report-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
    }

    .report-actions > .btn,
    .report-actions > .inline-form,
    .report-actions > .settings-menu,
    .report-actions > .inline-form > .btn,
    .report-actions > .settings-menu > summary.btn {
        width: 100%;
        min-width: 0;
    }

    .report-actions .btn {
        height: auto;
        min-height: 2.5rem;
        padding-inline: 0.55rem;
        line-height: 1.2;
        text-align: center;
        white-space: normal;
    }

    .expert-overview-primary,
    .expert-identity-grid,
    .expert-facts-list,
    .dropzone-editor-form {
        grid-template-columns: 1fr;
    }

    .expert-identity-grid > div + div,
    .expert-facts-list > div:nth-child(even):not(.expert-fact-wide) {
        border-left: 0;
    }

    .expert-facts-list > div:nth-child(even):not(.expert-fact-wide) {
        padding-left: 0;
    }

    .expert-jump-facts-head {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .expert-facts-list .expert-fact-wide,
    .dropzone-editor-form .meta-note {
        grid-column: auto;
    }

    .expert-feedback-form {
        grid-template-columns: 1fr;
    }

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

    .context-form .btn {
        justify-self: start;
    }

    .expert-feedback-form .btn {
        justify-self: start;
    }

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

    .expert-kpi-card {
        grid-template-columns: 1.8rem minmax(0, 1fr);
        gap: 0.42rem;
        min-height: 4.3rem;
        padding: 0.5rem;
    }

    .expert-kpi-icon {
        width: 1.8rem;
        height: 1.8rem;
    }

    .expert-kpi-icon svg {
        width: 1.05rem;
        height: 1.05rem;
    }

    .expert-kpi-card .v {
        font-size: 0.88rem;
    }

    .expert-kpi-card .k,
    .expert-kpi-card .v,
    .expert-kpi-values,
    .expert-window-badge,
    .expert-section-note {
        overflow-wrap: anywhere;
    }

    .expert-fixpoint-grid,
    .expert-phase-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .report-actions,
    .context-form,
    .expert-kpi-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .report-actions,
    .expert-report-overview,
    .expert-overview-primary,
    .expert-context-card,
    .expert-feedback-card,
    .expert-jump-facts,
    .expert-kpi-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .context-form .btn {
        justify-self: start;
    }

    .expert-jump-facts,
    .expert-kpi-card {
        overflow: hidden;
    }
}

.scorecard-stack {
    display: grid;
    gap: 0.75rem;
}

.scorecard-item {
    border: 1px solid #22303d;
    border-radius: 6px;
    background: #0f151d;
    padding: 0.75rem;
}

.scorecard-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.45rem;
}

.scorecard-head h3 {
    margin: 0;
    font-size: 0.95rem;
}

.scorecard-meta {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    flex-direction: column;
    align-items: flex-start;
}

.tips {
    margin: 0;
    padding-left: 1.2rem;
}

.tips li {
    margin: 0.25rem 0;
    color: #d4e0ea;
}

.tips.compact {
    margin: 0;
    padding-left: 1rem;
}

.tips.compact li {
    margin: 0.15rem 0;
    font-size: 0.83rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 0.8rem;
}

.chart-card {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.chart-title {
    margin: 0;
    color: #a9bbcd;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.chart {
    min-height: 290px;
    border: 1px solid #22303d;
    border-radius: 6px;
}

.chart-error {
    min-height: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: var(--muted);
    text-align: center;
}

.charts-grid-compare {
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 1rem;
}

.charts-grid-compare .chart {
    min-height: 360px;
}

.best-row {
    background: rgba(255, 209, 102, 0.08);
}

.best-badge {
    display: inline-flex;
    padding: 0.18rem 0.52rem;
    border-radius: 999px;
    background: rgba(255, 209, 102, 0.2);
    border: 1px solid rgba(255, 209, 102, 0.55);
    color: #ffe1a1;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.status-dot.green {
    background: #2ecc71;
}

.status-dot.yellow {
    background: #f1c40f;
}

.status-dot.red {
    background: #e74c3c;
}

.compare-form {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    align-items: end;
}

.compare-form button {
    width: fit-content;
}

.glossary-term {
    border-bottom: 1px dotted #7aa2c6;
    cursor: help;
}

.glossary-term:focus {
    outline: 1px solid #7aa2c6;
    outline-offset: 2px;
}

@media (max-width: 760px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid-compare {
        grid-template-columns: 1fr;
    }
}
