:root {
    --bg: #08111f;
    --bg-2: #0d1728;
    --panel: rgba(14, 24, 38, 0.94);
    --panel-2: rgba(18, 31, 50, 0.96);
    --panel-3: rgba(25, 40, 63, 0.98);
    --text: #f3f8ff;
    --muted: #9cb1cb;
    --line: rgba(147, 167, 191, 0.14);
    --line-strong: rgba(147, 167, 191, 0.22);
    --shadow: 0 18px 48px rgba(2, 8, 23, 0.42);
    --cyan: #38bdf8;
    --green: #34d399;
    --amber: #fbbf24;
    --violet: #a78bfa;
    --magenta: #f472b6;
    --red: #fb7185;
    --white-soft: rgba(255,255,255,0.05);
    --white-softer: rgba(255,255,255,0.03);
    --ok-bg: rgba(52, 211, 153, 0.12);
    --warn-bg: rgba(251, 191, 36, 0.13);
    --danger-bg: rgba(251, 113, 133, 0.13);
    --info-bg: rgba(56, 189, 248, 0.12);
    --radius: 22px;
    --radius-sm: 16px;
    --radius-xs: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.10), transparent 26%),
        radial-gradient(circle at top right, rgba(167, 139, 250, 0.10), transparent 24%),
        linear-gradient(180deg, #07101c 0%, #09111f 55%, #0b1423 100%);
}

a { color: #d7efff; text-decoration: none; }
a:hover { color: #fff; }
img { max-width: 100%; }
strong { font-weight: 780; }
code, .mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    color: #d7efff;
}

.app-shell {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 18px;
    border-right: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(7, 13, 23, 0.94), rgba(8, 14, 24, 0.98));
    overflow-y: auto;
}

.brand-card,
.side-card {
    background: linear-gradient(180deg, rgba(17, 28, 44, 0.96), rgba(12, 22, 36, 0.96));
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    padding: 18px;
}

.brand-card {
    position: relative;
    overflow: hidden;
}

.brand-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, rgba(255,255,255,0), var(--cyan), rgba(255,255,255,0));
}

.brand-title {
    margin: 0;
    font-size: 22px;
    letter-spacing: -0.03em;
}

.brand-copy,
.side-copy,
.section-copy,
.hero-note,
.muted,
.page-title p,
.guide-copy,
.guide-list,
.chart-meta p,
.alert-card p,
.term-card p,
.small {
    color: var(--muted);
}

.brand-copy,
.side-copy,
.page-title p,
.guide-copy,
.alert-card p {
    line-height: 1.55;
}

.eyebrow,
.label,
.guide-eyebrow,
.nav-group-label,
.kicker {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    font-weight: 760;
    color: var(--muted);
}

.project-pill,
.header-chip,
.chip,
.metric-compact,
.pill-link,
.badge,
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 32px;
    border-radius: 999px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 760;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
    color: var(--text);
}

.project-pill { margin-top: 12px; background: rgba(56, 189, 248, 0.12); border-color: rgba(56, 189, 248, 0.18); }
.nav-badge { min-width: 26px; padding: 0 8px; background: rgba(251, 113, 133, 0.16); border-color: rgba(251, 113, 133, 0.2); color: #ffdce3; }
.chip.ok, .badge.ok { background: rgba(52, 211, 153, 0.14); border-color: rgba(52, 211, 153, 0.18); }
.chip.warn, .badge.warn { background: rgba(251, 191, 36, 0.14); border-color: rgba(251, 191, 36, 0.20); }
.chip.danger, .badge.danger { background: rgba(251, 113, 133, 0.14); border-color: rgba(251, 113, 133, 0.20); }
.chip.info, .badge.info { background: rgba(56, 189, 248, 0.12); border-color: rgba(56, 189, 248, 0.18); }
.badge { font-size: 11px; min-height: 28px; }

.sidebar-section { margin-top: 18px; }
.nav-group-label { margin: 0 0 10px 10px; }
.nav-list { display: grid; gap: 8px; }
.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    color: #d2e5fa;
    border: 1px solid transparent;
    background: transparent;
    transition: all 0.18s ease;
}
.nav-link:hover { background: rgba(255,255,255,0.04); border-color: var(--line); transform: translateY(-1px); }
.nav-link.active {
    background: linear-gradient(180deg, rgba(28, 52, 83, 0.95), rgba(18, 34, 56, 0.96));
    border-color: rgba(56, 189, 248, 0.22);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.06);
}
.nav-link-main { display: flex; gap: 12px; align-items: center; }
.nav-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 760;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    color: #e8f5ff;
}
.nav-copy strong { display: block; font-size: 14px; }
.nav-copy span { font-size: 12px; color: var(--muted); }

.side-stat-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr 1fr;
    margin-top: 14px;
}
.side-stat {
    background: var(--white-softer);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 12px;
}
.side-stat-value { font-size: 18px; font-weight: 800; margin-top: 6px; letter-spacing: -0.03em; }

.sidebar-footer {
    margin-top: 18px;
    display: grid;
    gap: 10px;
}
.logout-form { margin: 0; }

.content-shell {
    min-width: 0;
    display: grid;
    grid-template-rows: auto auto 1fr;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 24px 16px;
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
    background: rgba(8, 14, 24, 0.78);
}
.topbar-title { font-size: 24px; font-weight: 820; letter-spacing: -0.03em; }
.topbar-subtitle { margin-top: 4px; color: var(--muted); font-size: 13px; }
.topbar-right { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }

.messages-wrap {
    padding: 0 24px;
}
.flash-stack { display: grid; gap: 10px; margin-top: 18px; }
.flash {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
    box-shadow: var(--shadow);
}
.flash.info { background: rgba(56, 189, 248, 0.12); border-color: rgba(56, 189, 248, 0.18); }
.flash.success, .flash.ok { background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.18); }
.flash.warning { background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.18); }
.flash.error { background: rgba(251, 113, 133, 0.12); border-color: rgba(251, 113, 133, 0.18); }

.guide-wrap { padding: 18px 24px 0; }
.guide-card {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.85fr);
    padding: 20px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(17, 31, 49, 0.96), rgba(11, 22, 35, 0.98));
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.guide-title { margin: 6px 0 0; font-size: 26px; letter-spacing: -0.03em; }
.guide-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; margin-top: 14px; }
.guide-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.guide-aside {
    display: grid;
    gap: 12px;
    align-content: start;
}
.guide-box,
.term-card {
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.03);
    border-radius: 18px;
    padding: 16px;
}
.guide-box.warn { background: rgba(251, 191, 36, 0.10); }
.guide-box.info { background: rgba(56, 189, 248, 0.10); }
.term-grid { display: grid; gap: 10px; }
.term-card h4 { margin: 0 0 6px; font-size: 15px; }
.term-card p { margin: 0; font-size: 13px; line-height: 1.55; }

.page-main { padding: 22px 24px 36px; }
.page-title { margin-bottom: 18px; }
.page-title h1, .page-title h2 { margin: 0; font-size: clamp(28px, 3vw, 34px); letter-spacing: -0.04em; }
.page-title p { margin: 8px 0 0; max-width: 980px; }

.grid { display: grid; gap: 16px; }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid.columns-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid.columns-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.hero-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.insight-grid, .alert-grid, .mini-kpi-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
    position: relative;
    min-width: 0;
    background: linear-gradient(180deg, rgba(15, 26, 41, 0.96), rgba(11, 20, 32, 0.98));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}
.card.subtle { background: linear-gradient(180deg, rgba(16, 27, 42, 0.78), rgba(12, 20, 31, 0.82)); }
.card.flat { box-shadow: none; }
.hero-card { overflow: hidden; }
.hero-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, rgba(255,255,255,0), var(--cyan), rgba(255,255,255,0));
}
.hero-card[data-tone="green"]::before { background: linear-gradient(90deg, rgba(255,255,255,0), var(--green), rgba(255,255,255,0)); }
.hero-card[data-tone="amber"]::before { background: linear-gradient(90deg, rgba(255,255,255,0), var(--amber), rgba(255,255,255,0)); }
.hero-card[data-tone="magenta"]::before { background: linear-gradient(90deg, rgba(255,255,255,0), var(--magenta), rgba(255,255,255,0)); }
.hero-card[data-tone="violet"]::before { background: linear-gradient(90deg, rgba(255,255,255,0), var(--violet), rgba(255,255,255,0)); }
.kpi-value, .mini-kpi .value, .alert-amount {
    font-size: clamp(30px, 3vw, 40px);
    font-weight: 830;
    letter-spacing: -0.05em;
    line-height: 1.03;
    margin-top: 10px;
}
.hero-footer {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.metric-compact { background: rgba(255,255,255,0.03); color: var(--muted); }
.metric-compact strong { color: var(--text); }

.progress-track {
    margin-top: 14px;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.06);
}
.progress-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--cyan), var(--green));
}

.insight, .mini-kpi {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.03);
}
.insight h4 { margin: 0 0 8px; font-size: 16px; }
.insight p { margin: 0; line-height: 1.55; font-size: 14px; }
.insight.ok { background: var(--ok-bg); }
.insight.warn { background: var(--warn-bg); }
.insight.danger { background: var(--danger-bg); }
.insight.info { background: var(--info-bg); }
.mini-kpi .value { font-size: 28px; margin-top: 8px; }

.section-title {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.section-title h3, .section-title h4 { margin: 0; }
.section-copy { font-size: 13px; line-height: 1.5; }

.callout {
    display: grid;
    gap: 8px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
}
.callout.ok { background: var(--ok-bg); }
.callout.warn { background: var(--warn-bg); }
.callout.danger { background: var(--danger-bg); }
.callout.info { background: var(--info-bg); }

.stack { display: grid; gap: 10px; }
.stat-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
}
.stat-line strong { font-size: 15px; }

.button-link,
button,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border-radius: 14px;
    padding: 0 16px;
    border: 1px solid rgba(56, 189, 248, 0.18);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.96), rgba(167, 139, 250, 0.96));
    color: #06101b;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    text-decoration: none;
}
.button-link:hover,
button:hover,
input[type="submit"]:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(56, 189, 248, 0.14); }
.button-link.secondary,
button.secondary {
    background: rgba(255,255,255,0.04);
    color: var(--text);
    border-color: var(--line);
}
.button-link.ghost,
button.ghost,
.pill-link {
    background: transparent;
    color: #d9ecff;
    border-color: var(--line);
}
.inline-link { color: #9fddff; font-weight: 700; }
.inline-link:hover { color: #fff; }
.alert-link { color: #dff5ff; font-weight: 780; }
.alert-link:hover { color: #fff; }

form { margin: 0; }
label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; font-weight: 650; }
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.04);
    color: var(--text);
    padding: 12px 14px;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: rgba(56, 189, 248, 0.30); box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.10); }
input::placeholder, textarea::placeholder { color: rgba(156, 177, 203, 0.7); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--cyan); }
.form-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.table-wrap {
    overflow: auto;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.06);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
    background: rgba(255,255,255,0.02);
}

thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(9, 18, 30, 0.96);
    backdrop-filter: blur(10px);
    color: #dfeefe;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

th, td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    text-align: left;
    vertical-align: top;
}

tbody tr:hover { background: rgba(255,255,255,0.03); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.small { font-size: 12px; }

.pos { color: #7ff3c6; }
.neg { color: #ff95a3; }
.pending { color: #ffd873; }

.alert-card {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.03);
}
.alert-card.critical { background: linear-gradient(180deg, rgba(79, 18, 31, 0.40), rgba(14, 21, 33, 0.96)); border-color: rgba(251, 113, 133, 0.22); }
.alert-card.warn { background: linear-gradient(180deg, rgba(74, 48, 7, 0.28), rgba(14, 21, 33, 0.96)); border-color: rgba(251, 191, 36, 0.20); }
.alert-card.info { background: linear-gradient(180deg, rgba(12, 59, 88, 0.22), rgba(14, 21, 33, 0.96)); border-color: rgba(56, 189, 248, 0.20); }
.alert-card.ok { background: linear-gradient(180deg, rgba(17, 71, 57, 0.22), rgba(14, 21, 33, 0.96)); border-color: rgba(52, 211, 153, 0.20); }
.alert-meta, .alert-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.chart-card { padding: 18px; }
.chart-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.chart-meta h3, .chart-meta h4 { margin: 0; }
.chart-shell {
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
    padding: 12px;
}
.chart { min-height: 280px; width: 100%; }
.chart svg { width: 100%; height: 100%; display: block; }
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}
.chart-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.05);
    color: var(--muted);
    font-size: 12px;
}
.chart-legend-item strong { color: var(--text); }
.chart-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.code-block {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(5, 11, 19, 0.72);
    overflow: auto;
}

.empty-state {
    padding: 22px;
    border-radius: 18px;
    border: 1px dashed rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.02);
    color: var(--muted);
}

.rule-suggestion-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.rule-suggestion-card {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(56, 189, 248, 0.16);
    background: linear-gradient(180deg, rgba(15, 31, 50, 0.96), rgba(12, 22, 35, 0.98));
}
.rule-support,
.rule-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.pill-soft {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--muted);
    font-size: 12px;
}
.rule-outcome-list { display: grid; gap: 8px; }
.rule-outcome-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
}
.details-block {
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 18px;
    background: rgba(255,255,255,0.02);
    overflow: hidden;
}
.details-block + .details-block { margin-top: 12px; }
.details-block summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
}
.details-block summary::-webkit-details-marker { display: none; }
.details-body { padding: 0 18px 18px; }

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.auth-shell {
    width: min(1140px, 100%);
    display: grid;
    grid-template-columns: minmax(320px, 1.1fr) minmax(320px, 0.9fr);
    gap: 18px;
}
.auth-panel {
    background: linear-gradient(180deg, rgba(15, 28, 45, 0.96), rgba(10, 20, 32, 0.98));
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 28px;
    box-shadow: var(--shadow);
}
.auth-title { margin: 0; font-size: clamp(30px, 4vw, 44px); letter-spacing: -0.05em; }
.auth-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-top: 18px; }
.auth-stat { padding: 14px 16px; border-radius: 18px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.05); }
.auth-stat strong { display: block; font-size: 20px; margin-top: 6px; }

@media (max-width: 1180px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: relative;
        height: auto;
        padding-bottom: 14px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .guide-card { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .topbar, .guide-wrap, .messages-wrap, .page-main { padding-left: 16px; padding-right: 16px; }
    .topbar { align-items: flex-start; }
    .guide-grid, .auth-shell { grid-template-columns: 1fr; }
    .grid.columns-2, .grid.columns-3, .hero-grid, .insight-grid, .alert-grid, .mini-kpi-grid, .rule-suggestion-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    table { min-width: 640px; }
}

/* Step 11 guided UX */
.onboarding-side-card {
    background: linear-gradient(180deg, rgba(14, 43, 64, 0.92), rgba(12, 25, 39, 0.98));
}

.decision-ribbon,
.monthly-hero {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
    align-items: start;
    padding: 22px;
    border-radius: 24px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    background: linear-gradient(180deg, rgba(17, 29, 46, 0.96), rgba(12, 21, 34, 0.98));
}
.decision-ribbon.ok,
.monthly-hero.ok { background: linear-gradient(180deg, rgba(12, 58, 45, 0.34), rgba(12, 21, 34, 0.98)); }
.decision-ribbon.warn,
.monthly-hero.warn { background: linear-gradient(180deg, rgba(73, 48, 7, 0.28), rgba(12, 21, 34, 0.98)); }
.decision-ribbon.info,
.monthly-hero.info { background: linear-gradient(180deg, rgba(9, 55, 85, 0.26), rgba(12, 21, 34, 0.98)); }
.decision-ribbon.danger,
.monthly-hero.danger { background: linear-gradient(180deg, rgba(81, 17, 32, 0.32), rgba(12, 21, 34, 0.98)); }
.decision-ribbon h3,
.monthly-hero h2 { margin: 0; letter-spacing: -0.03em; }
.decision-actions,
.task-actions,
.step-actions,
.story-chips,
.secondary-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.monthly-hero-side {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.monthly-hero-side .mini-kpi { min-height: 124px; }
.monthly-hero-side .mini-kpi .value { font-size: 24px; }

.progress-meter {
    width: 100%;
    height: 14px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.06);
}
.progress-meter-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--cyan), var(--violet), var(--green));
}

.step-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.step-card {
    display: grid;
    gap: 14px;
    padding: 20px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(16, 27, 42, 0.96), rgba(11, 20, 32, 0.98));
    box-shadow: var(--shadow);
}
.step-card.next { border-color: rgba(56, 189, 248, 0.28); box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.10), var(--shadow); }
.step-card.done { border-color: rgba(52, 211, 153, 0.22); }
.step-topline {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}
.step-index {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 820;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}
.step-card h3 { margin: 0; }
.step-card p { margin: 0; color: var(--muted); line-height: 1.55; }

.quick-task-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.quick-task-grid.compact { grid-template-columns: 1fr; }
.quick-task-card {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.03);
}
.quick-task-card h4 { margin: 0; }
.quick-task-card p { margin: 0; color: var(--muted); line-height: 1.55; }
.quick-task-card.info { background: linear-gradient(180deg, rgba(12, 59, 88, 0.20), rgba(14, 21, 33, 0.96)); border-color: rgba(56, 189, 248, 0.20); }
.quick-task-card.warn { background: linear-gradient(180deg, rgba(74, 48, 7, 0.24), rgba(14, 21, 33, 0.96)); border-color: rgba(251, 191, 36, 0.20); }
.quick-task-card.danger { background: linear-gradient(180deg, rgba(79, 18, 31, 0.34), rgba(14, 21, 33, 0.96)); border-color: rgba(251, 113, 133, 0.22); }
.quick-task-card.ok { background: linear-gradient(180deg, rgba(17, 71, 57, 0.22), rgba(14, 21, 33, 0.96)); border-color: rgba(52, 211, 153, 0.20); }
.quick-task-card.violet { background: linear-gradient(180deg, rgba(54, 39, 102, 0.28), rgba(14, 21, 33, 0.96)); border-color: rgba(167, 139, 250, 0.22); }

.story-list {
    margin: 0;
    padding-left: 20px;
    display: grid;
    gap: 12px;
    color: var(--muted);
    line-height: 1.6;
}
.story-list li::marker { color: var(--cyan); }

.monthly-hero .pill-link,
.decision-ribbon .pill-link { background: rgba(255,255,255,0.05); }

.secondary-actions form,
.task-actions form,
.decision-actions form,
.step-actions form { margin: 0; }
.secondary-actions button.ghost,
.task-actions button.ghost {
    min-height: 36px;
    padding: 0 12px;
}

@media (max-width: 1120px) {
    .decision-ribbon,
    .monthly-hero,
    .guide-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--line);
    }
    .topbar {
        position: static;
        padding-top: 16px;
    }
    .monthly-hero-side { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
    .page-main,
    .guide-wrap,
    .messages-wrap,
    .topbar { padding-left: 16px; padding-right: 16px; }
    .monthly-hero-side { grid-template-columns: 1fr; }
}
