/* --- Program cards -------------------------------------------------------------------- */

.cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 1000px) {
    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

.card-program {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem 1.5rem;
}

.orgmark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #112c4b, #0b3a5b);
    color: var(--cyan);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.03em;
}

.card-program h3 {
    margin: 0;
}

.card-program .org-type {
    font-size: 0.8125rem;
    color: var(--muted);
    margin: 0;
}

.card-program .description {
    margin: 0;
    color: var(--muted);
    flex: 1;
}

.payline {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.card-program .btn {
    align-self: flex-start;
}

/* --- Misc page pieces ---------------------------------------------------------------------------------- */

.page-header {
    margin-bottom: 1.25rem;
}

.error-page {
    text-align: center;
    padding: 3rem 1rem;
}

.error-reason {
    color: var(--muted);
    max-width: 60ch;
    margin: 0.5rem auto 1.25rem;
}

.error-who {
    font-size: 0.875rem;
    color: var(--muted);
}

.report-text {
    white-space: pre-wrap;
}

.reward-amount {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.token-raw {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    word-break: break-all;
    background: var(--wash);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.notification-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.notification-list li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--line);
}

.notification-list li:last-child {
    border-bottom: none;
}

.notification-unread {
    font-weight: 600;
}

.wizard-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.wizard-steps .step {
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: var(--wash);
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 600;
}

.wizard-steps .step.active {
    background: var(--brand);
    color: #fff;
}

/* Каркас публичного портала (task D4, docs/07-design.md) */
.pubbar {
    background: var(--nav);
    border-bottom: 1px solid #1c3350;
}
/* Fluid portal shell: full width, clamp side padding, capped at 1600px.
   These rules intentionally override the fixed-width .container (1100px)
   so the portal is rubbery; .container stays untouched for allauth pages. */
.pubbar-inner {
    display: flex; align-items: center; gap: 12px;
    min-height: 60px; flex-wrap: wrap;
    width: 100%; max-width: 1600px; margin: 0 auto;
    padding-left: clamp(16px, 3vw, 40px);
    padding-right: clamp(16px, 3vw, 40px);
}
.pubbar .brand {
    display: flex; align-items: center; gap: 10px;
    color: #fff; font-weight: 700; font-size: 1rem;
    text-decoration: none;
}
.pubnav {
    display: flex; gap: 2px; flex: 1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.pubnav a {
    color: var(--navmuted); text-decoration: none;
    padding: 0.45rem 0.7rem; border-radius: var(--radius-sm);
    white-space: nowrap; font-size: 0.9rem; font-weight: 500;
}
.pubnav a:hover { background: #1b3c57; color: var(--paper); }
/* >= 700px: the menu must never scroll horizontally — it wraps instead.
   The right-hand actions (languages, Войти/Кабинет, theme) stay on the
   same bar and wrap under the menu when there is no room. Below 700px the
   base rule above keeps the horizontally scrollable row (docs/07-design.md). */
@media (min-width: 700px) {
    .pubnav {
        flex-wrap: wrap;
        overflow: visible;
    }
}
.pubmain {
    padding-top: 1.5rem; padding-bottom: 3rem;
    padding-left: clamp(16px, 3vw, 40px);
    padding-right: clamp(16px, 3vw, 40px);
    display: block;
    width: 100%; max-width: 1600px; margin: 0 auto;
}
.pubfoot {
    background: var(--wash);
    border-top: 1px solid var(--line);
    padding: 22px 0 26px;
    color: var(--muted);
    font-size: 0.85rem;
}
/* Fluid footer content: the band stays full width, the inner content
   follows the same clamp/1600px rhythm as .pubbar-inner and .pubmain. */
.pubfoot .container {
    max-width: 1600px;
    padding-left: clamp(16px, 3vw, 40px);
    padding-right: clamp(16px, 3vw, 40px);
}
.pubfoot-links { display: flex; gap: 18px; margin-bottom: 8px; }
.pubfoot-links a { color: var(--muted); text-decoration: none; }
.pubfoot-links a:hover { color: var(--ink); text-decoration: underline; }
.pubfoot-note { margin: 0; }

/* --- Portal statistics (PUB-06): severity meters + CSS bar chart ------------ */

.severity-meters {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.severity-row {
    display: grid;
    grid-template-columns: 92px 1fr 56px;
    align-items: center;
    gap: 0.75rem;
}

.severity-count {
    font-variant-numeric: tabular-nums;
    text-align: right;
    font-weight: 600;
}

.meter-fill[data-color=risk-low] { background: #1e5e40; }
.meter-fill[data-color=risk-medium] { background: #75500e; }
.meter-fill[data-color=risk-high] { background: #8f3322; }
.meter-fill[data-color=risk-critical] { background: #962840; }

.chart {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 6px;
    align-items: end;
    height: 170px;
    margin-bottom: 0.75rem;
}

.chart-col {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chart-bars {
    flex: 1;
    display: flex;
    gap: 3px;
    align-items: flex-end;
}

.chart-bar {
    flex: 1;
    border-radius: 3px 3px 0 0;
    min-height: 2px;
}

.chart-bar-confirmed { background: var(--brand); }
.chart-bar-verified { background: #125d79; }

.chart-label {
    font-size: 0.68rem;
    color: var(--muted);
    text-align: center;
    margin-top: 4px;
    white-space: nowrap;
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0 0 1rem;
}

.chart-key {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 3px;
    margin-left: 0.75rem;
}

.chart-key-confirmed { background: var(--brand); }
.chart-key-verified { background: #125d79; }

/* Chart bar heights are class-based (CSP forbids inline styles). */
.h-0 { height: 0%; }
.h-5 { height: 5%; }
.h-10 { height: 10%; }
.h-15 { height: 15%; }
.h-20 { height: 20%; }
.h-25 { height: 25%; }
.h-30 { height: 30%; }
.h-35 { height: 35%; }
.h-40 { height: 40%; }
.h-45 { height: 45%; }
.h-50 { height: 50%; }
.h-55 { height: 55%; }
.h-60 { height: 60%; }
.h-65 { height: 65%; }
.h-70 { height: 70%; }
.h-75 { height: 75%; }
.h-80 { height: 80%; }
.h-85 { height: 85%; }
.h-90 { height: 90%; }
.h-95 { height: 95%; }
.h-100 { height: 100%; }

@media (max-width: 700px) {
    .chart {
        height: 130px;
        gap: 3px;
    }
    .chart-label {
        font-size: 0.55rem;
    }
    .severity-row {
        grid-template-columns: 80px 1fr 44px;
    }
}

