/* trust.css — Trust review pane + License upgrade flow */

/* ── Trust grid layout ────────────────────────────────────────────────────── */
.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
    padding: 4px 0;
}

.trust-card { padding: 16px 18px; }

.trust-card-wide {
    grid-column: 1 / -1;
}

/* ── Trust card header ────────────────────────────────────────────────────── */
.trust-card-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 8px;
}

.trust-card-title {
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    color: var(--text);
}

.trust-card-count {
    font-family: var(--font-mono);
    font-size: var(--caption);
    color: var(--text-muted);
}

/* ── Trust table rows ─────────────────────────────────────────────────────── */
.trust-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
    gap: 8px;
    font-size: var(--text-sm);
}

.trust-row:last-child { border-bottom: none; }

.trust-row-k {
    color: var(--text-muted);
    flex-shrink: 0;
}

.trust-row-v {
    font-family: var(--font-mono);
    color: var(--text);
    text-align: right;
    word-break: break-all;
}

/* ── Trust event list ─────────────────────────────────────────────────────── */
.trust-event-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.trust-event-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
    gap: 8px;
    font-size: var(--text-sm);
}

.trust-event-row:last-child { border-bottom: none; }

.trust-event-main {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

.trust-event-type {
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trust-event-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.trust-posture-body {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── License wrapper ──────────────────────────────────────────────────────── */
.license-wrap {
    max-width: 860px;
    padding: 4px 0;
}

/* ── Step indicator ───────────────────────────────────────────────────────── */
.license-steps {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 24px;
    padding: 0 2px;
}

.license-step {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.license-step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--text-muted);
    transition: background .15s, color .15s, border-color .15s;
}

.license-step.active .license-step-dot {
    background: var(--accent);
    color: oklch(7% 0 0);
    border-color: var(--accent);
}

.license-step.done .license-step-dot {
    background: var(--ok);
    color: oklch(7% 0 0);
    border-color: var(--ok);
}

.license-step-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
    white-space: nowrap;
}

.license-step.active .license-step-label {
    color: var(--text);
    font-weight: var(--weight-semibold);
}

.license-step-connector {
    flex: 1;
    height: 1px;
    background: var(--border);
    margin: 0 8px;
    min-width: 20px;
}

/* ── License card ─────────────────────────────────────────────────────────── */
.license-card { padding: 20px 22px; }

.license-current-hd {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

.license-current-tier {
    font: var(--title);
    font-weight: var(--weight-semibold);
}

.license-price {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: var(--weight-semibold);
    color: var(--text);
    flex-shrink: 0;
}

/* ── Usage bars ───────────────────────────────────────────────────────────── */
.license-usage-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    padding: 14px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.license-usage-row { display: flex; flex-direction: column; gap: 4px; }

.license-usage-label {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.license-usage-bar-bg {
    height: 4px;
    background: var(--surface-2);
    border-radius: 2px;
    overflow: hidden;
}

.license-usage-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width .4s var(--ease);
}

/* ── Features list ─────────────────────────────────────────────────────────── */
.license-features {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.license-feature-row {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* ── Actions bar ───────────────────────────────────────────────────────────── */
.license-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.license-status-msg {
    font-size: var(--text-sm);
    margin-top: 8px;
    min-height: 18px;
}

/* ── Plan picker grid ───────────────────────────────────────────────────────── */
.license-picker { padding: 4px 0; }

.license-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.license-plan-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    position: relative;
    user-select: none;
}

.license-plan-card:hover {
    border-color: var(--accent);
    background: var(--surface-1);
}

.license-plan-card.selected {
    border-color: var(--accent);
    background: oklch(87% 0.19 152 / 0.08);
}

.license-plan-card.current {
    opacity: .6;
    cursor: default;
    pointer-events: none;
}

.license-plan-name {
    font-weight: var(--weight-semibold);
    font-size: var(--text-base);
    margin-bottom: 4px;
}

.license-plan-price {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: var(--weight-semibold);
    color: var(--text);
    margin-bottom: 2px;
}

.license-plan-period {
    font-size: var(--caption);
    color: var(--text-muted);
    margin-bottom: 10px;
}

.license-plan-features {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.license-plan-feature {
    font-size: var(--caption);
    color: var(--text-muted);
}

.license-plan-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: var(--caption);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1px 6px;
    color: var(--text-muted);
}

/* ── Activate step ────────────────────────────────────────────────────────── */
.license-activate-hd { margin-bottom: 14px; }

.license-activate-title {
    font: var(--title);
    font-weight: var(--weight-semibold);
    color: var(--text);
}

@media (max-width: 640px) {
    .trust-grid { grid-template-columns: 1fr; }
    .license-plan-grid { grid-template-columns: 1fr 1fr; }
    .license-steps { gap: 0; }
    .license-step-label { display: none; }
}
