:root {
    --bg: #f3f6fb;
    --bg-accent: #e8eef9;
    --surface: #ffffff;
    --surface-soft: #f8fbff;
    --border: #dbe4f0;
    --text: #162031;
    --muted: #5f6f86;
    --accent: #2458d3;
    --accent-soft: #edf3ff;
    --good: #137a4b;
    --good-soft: #e8f7ef;
    --warn: #9f6900;
    --warn-soft: #fff6df;
    --bad: #c23b32;
    --bad-soft: #ffeae7;
    --shadow: 0 16px 40px rgba(17, 31, 55, 0.08);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --sans: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: var(--sans);
    background:
        radial-gradient(circle at top right, rgba(36, 88, 211, 0.08), transparent 28%),
        linear-gradient(180deg, #f6f9fd 0%, #eef3fa 100%);
}

code,
pre,
.mono {
    font-family: var(--mono);
}

.app-shell {
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(14px);
    background: rgba(243, 246, 251, 0.9);
    border-bottom: 1px solid rgba(219, 228, 240, 0.9);
}

.topbar__inner,
.page,
.footer__inner {
    max-width: 1240px;
    margin: 0 auto;
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 18px;
}

.brand-block__eyebrow,
.section-label,
.mini-label {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 11px;
    font-weight: 700;
}

.brand-block__title {
    margin: 6px 0 8px;
    font-size: 34px;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.brand-block__subtitle,
.card__subtitle,
.muted-text {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.trust-badge {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0;
}

.page {
    padding: 24px 18px 34px;
}

.goal-banner {
    margin-bottom: 18px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff, var(--surface-soft));
    box-shadow: var(--shadow);
}

.layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.sidebar,
.content {
    display: grid;
    gap: 18px;
}

.card {
    background: linear-gradient(180deg, #ffffff, #fbfdff);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 22px;
    box-shadow: var(--shadow);
}

.card--summary {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.98)),
        linear-gradient(135deg, rgba(36, 88, 211, 0.04), transparent 55%);
}

.card__title {
    margin: 8px 0 8px;
    font-size: 28px;
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.notice-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.fault-banner {
    margin-top: 18px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.reviewer-verdict {
    margin-top: 18px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.reviewer-verdict--good {
    background: linear-gradient(180deg, #f5fff9, var(--good-soft));
    border-color: #bde4ce;
}

.reviewer-verdict--warn {
    background: linear-gradient(180deg, #fffaf1, var(--warn-soft));
    border-color: #ebd6a0;
}

.reviewer-verdict--bad {
    background: linear-gradient(180deg, #fff5f3, var(--bad-soft));
    border-color: #efbbb5;
}

.reviewer-verdict__title {
    margin: 8px 0 6px;
    font-size: 21px;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.reviewer-verdict__impact {
    margin: 0;
    font-size: 14px;
    line-height: 1.65;
    color: var(--muted);
}

.reviewer-verdict__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.review-workspace {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.form-field {
    display: grid;
    gap: 8px;
}

.form-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.textarea {
    min-height: 110px;
    resize: vertical;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.action-button {
    appearance: none;
    border: 1px solid #c9d8ff;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
    padding: 11px 14px;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.action-button:hover,
.action-button:focus-visible {
    background: #eef3ff;
    box-shadow: 0 0 0 3px rgba(62, 101, 228, 0.12);
    outline: none;
    transform: translateY(-1px);
}

.action-button--secondary {
    background: #fff;
    color: #40526a;
    border-color: var(--border);
}

.workspace-status {
    min-height: 24px;
}

.fault-banner--critical {
    background: linear-gradient(180deg, #fff5f3, var(--bad-soft));
    border-color: #efbbb5;
}

.fault-banner--warning {
    background: linear-gradient(180deg, #fffaf1, var(--warn-soft));
    border-color: #ebd6a0;
}

.fault-banner__title {
    margin: 8px 0 6px;
    font-size: 22px;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.fault-banner__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.notice-pill,
.status-pill,
.meta-pill,
.timeline-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.notice-pill {
    color: var(--muted);
    background: var(--surface-soft);
}

.status-pill--good {
    color: var(--good);
    background: var(--good-soft);
    border-color: #bde4ce;
}

.status-pill--warn {
    color: var(--warn);
    background: var(--warn-soft);
    border-color: #ebd6a0;
}

.status-pill--bad {
    color: var(--bad);
    background: var(--bad-soft);
    border-color: #efbbb5;
}

.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.kpi-card,
.detail-card,
.timeline-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #fff;
}

.kpi-card,
.detail-card {
    padding: 14px;
}

.kpi-label,
.detail-label {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 11px;
    font-weight: 700;
}

.kpi-value,
.detail-value,
.mini-value {
    margin-top: 8px;
    color: var(--text);
    font-size: 16px;
    line-height: 1.55;
    font-weight: 600;
    word-break: break-word;
}

.kpi-value {
    font-size: 22px;
    letter-spacing: -0.03em;
}

.card-stack {
    display: grid;
    gap: 12px;
}

.detail-card--good {
    background: var(--good-soft);
    border-color: #bde4ce;
}

.detail-card--warn {
    background: var(--warn-soft);
    border-color: #ebd6a0;
}

.detail-card--bad {
    background: var(--bad-soft);
    border-color: #efbbb5;
}

.control-step-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.control-step-link {
    appearance: none;
    border: 1px solid #c9d8ff;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    padding: 8px 12px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.control-step-link:hover,
.control-step-link:focus-visible {
    background: #eef3ff;
    box-shadow: 0 0 0 3px rgba(62, 101, 228, 0.12);
    outline: none;
    transform: translateY(-1px);
}

.timeline-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.timeline-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.input {
    min-width: 180px;
    width: 100%;
    padding: 11px 14px;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    font: inherit;
}

.meta-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.meta-pill {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: #c9d8ff;
}

.meta-pill__label {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 10px;
    font-weight: 700;
}

.timeline-list {
    display: grid;
    gap: 12px;
}

.timeline-item {
    padding: 16px;
}

.timeline-item--fault {
    background: linear-gradient(180deg, #fff7f6, var(--bad-soft));
    border-color: #efbbb5;
}

.timeline-item--secondary {
    background: linear-gradient(180deg, #fffaf1, var(--warn-soft));
    border-color: #ebd6a0;
}

.timeline-item--focus {
    box-shadow: 0 0 0 3px rgba(62, 101, 228, 0.18);
    border-color: #8ca8ff;
    scroll-margin-top: 24px;
}

.timeline-item__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.timeline-item__left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.timeline-item__time {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.timeline-badge {
    font-size: 11px;
}

.timeline-badge--step {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: #c9d8ff;
}

.timeline-badge--kind {
    color: #40526a;
    background: #f2f5f9;
}

.timeline-badge--fault {
    color: var(--bad);
    background: var(--bad-soft);
    border-color: #efbbb5;
}

.timeline-badge--warn {
    color: var(--warn);
    background: var(--warn-soft);
    border-color: #ebd6a0;
}

.timeline-item__summary {
    margin: 12px 0 0;
    font-size: 15px;
    line-height: 1.7;
}

.timeline-item__details {
    margin-top: 12px;
}

.timeline-item details {
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.timeline-item summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 600;
    list-style: none;
}

.timeline-item summary::-webkit-details-marker {
    display: none;
}

.timeline-item pre {
    margin: 10px 0 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f7faff;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: auto;
}

.footer {
    padding: 0 18px 26px;
}

.footer__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
}

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

@media (max-width: 720px) {
    .topbar__inner,
    .timeline-head,
    .timeline-item__top {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar__inner,
    .page,
    .footer {
        padding-left: 14px;
        padding-right: 14px;
    }

    .card {
        padding: 18px;
    }

    .brand-block__title {
        font-size: 30px;
    }
}
