/* Standalone Alpha Matrix. All styles scoped; no font, image or network imports. */
.alpha-matrix {
    --am-bg: var(--bg-panel, #0a0a0c);
    --am-surface: var(--bg-elevated, #111116);
    --am-input: var(--bg-input, #0c0c10);
    --am-text: var(--text-main, #f0f2f5);
    --am-muted: var(--text-muted, #98a4b3);
    --am-accent: var(--primary-neon, #00e6cf);
    --am-border: rgba(130, 166, 177, 0.23);
    color: var(--am-text);
    background: var(--am-bg);
    border: 1px solid var(--am-border);
    border-radius: 14px;
    padding: clamp(12px, 2vw, 24px);
    font: 13px/1.55 Inter, system-ui, sans-serif;
    min-width: 0;
    width: 100%;
    overflow-wrap: anywhere;
    container: alpha-matrix / inline-size;
}

.alpha-matrix *,
.alpha-matrix *::before,
.alpha-matrix *::after { box-sizing: border-box; }
.alpha-matrix { box-sizing: border-box; }
.alpha-matrix [hidden] { display: none !important; }
.alpha-matrix :is(h2, h3, p, dl, dd) { margin: 0; }
.alpha-matrix .am-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--am-border);
}
.alpha-matrix .am-heading { flex: 1 1 260px; min-width: 0; }
.alpha-matrix .am-eyebrow {
    color: var(--am-accent);
    font-size: 10px;
    letter-spacing: 0.14em;
    font-weight: 700;
    margin-bottom: 5px;
}
.alpha-matrix .am-title {
    font: 600 clamp(24px, 3vw, 34px)/1.2 Outfit, Inter, system-ui, sans-serif;
    letter-spacing: -0.03em;
    color: var(--am-text);
}
.alpha-matrix .am-subtitle { margin-top: 8px; color: var(--am-muted); max-width: 65ch; }
.alpha-matrix :is(.am-header-actions, .am-badges) { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.alpha-matrix .am-header-actions { flex: 0 1 390px; justify-content: flex-end; }
.alpha-matrix .am-badges { flex-basis: 100%; justify-content: flex-end; }
.alpha-matrix :is(.am-badge, .am-status) {
    display: inline-block;
    max-width: 100%;
    border: 1px solid var(--am-border);
    border-radius: 5px;
    padding: 3px 7px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.035em;
    color: var(--am-muted);
    line-height: 1.6;
}
.alpha-matrix .am-badge--manual { color: var(--am-accent); border-color: var(--am-accent); }
.alpha-matrix .am-button {
    appearance: none;
    font: inherit;
    font-weight: 600;
    color: var(--am-text);
    background: var(--am-surface);
    border: 1px solid var(--am-border);
    border-radius: 7px;
    padding: 8px 12px;
    min-height: 38px;
    max-width: 100%;
    white-space: normal;
    cursor: pointer;
    text-align: center;
}
.alpha-matrix .am-button:hover:not(:disabled) { border-color: var(--am-accent); color: var(--am-accent); }
.alpha-matrix .am-button--primary { border-color: var(--am-accent); color: var(--am-accent); background: var(--primary-subtle, #092422); }
.alpha-matrix .am-button:disabled { opacity: 0.55; cursor: not-allowed; }
.alpha-matrix :is(button, input, select, a, summary, textarea):focus-visible { outline: 2px solid var(--am-accent); outline-offset: 3px; }
.alpha-matrix .am-safety {
    margin-top: 14px;
    border-left: 2px solid var(--am-accent);
    padding: 5px 10px;
    color: var(--am-muted);
    font-size: 12px;
}
.alpha-matrix .am-shadow {
    display: grid;
    gap: 10px;
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--am-border);
    border-radius: 8px;
    background: var(--am-surface);
}
.alpha-matrix .am-currency-group { color: var(--am-accent); font-size: 11px; font-weight: 700; }
.alpha-matrix .am-source { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin-top: 15px; }
.alpha-matrix :is(.am-label, .am-muted, .am-age, .am-count, .am-job) { color: var(--am-muted); }
.alpha-matrix .am-label { font-size: 11px; font-weight: 600; }
.alpha-matrix .am-generated { font-variant-numeric: tabular-nums; }
.alpha-matrix .am-age { font-size: 12px; }
.alpha-matrix .am-message { border: 1px solid var(--am-border); border-radius: 7px; padding: 10px 12px; margin-top: 12px; background: var(--am-surface); }
.alpha-matrix .am-message--error { border-color: var(--danger-neon, #ff3b5c); color: var(--text-main, #ffd3dc); }
.alpha-matrix .am-job { margin-top: 8px; font-size: 12px; }
.alpha-matrix .am-summary { margin-top: 10px; border-bottom: 1px solid var(--am-border); padding-bottom: 12px; }
.alpha-matrix summary { cursor: pointer; padding: 6px 0; color: var(--am-muted); }
.alpha-matrix .am-summary-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; margin-top: 8px; }
.alpha-matrix .am-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 18px 0 12px; }
.alpha-matrix .am-field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 120px; min-width: 0; margin: 0; }
.alpha-matrix .am-field:first-child { flex: 2 1 230px; }
.alpha-matrix :is(.am-search, .am-select, .am-copy-text) {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border: 1px solid var(--am-border);
    border-radius: 7px;
    background: var(--am-input);
    color: var(--am-text);
    font: inherit;
    padding: 9px 10px;
    min-height: 40px;
}
.alpha-matrix .am-search::placeholder { color: var(--am-muted); opacity: 1; }
.alpha-matrix .am-count { margin-bottom: 8px; font-size: 12px; }
.alpha-matrix .am-table-wrap { max-width: 100%; min-width: 0; }
.alpha-matrix .am-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.alpha-matrix .am-table th { text-align: left; color: var(--am-muted); font-size: 11px; padding: 7px 8px; border-bottom: 1px solid var(--am-border); vertical-align: bottom; }
.alpha-matrix .am-table th:first-child { width: 21%; }
.alpha-matrix .am-table th:nth-child(2) { width: 15%; }
.alpha-matrix .am-table th:nth-child(3) { width: 8%; }
.alpha-matrix .am-table th:last-child { width: 13%; }
.alpha-matrix .am-sort { background: transparent; border: 0; color: inherit; text-align: left; padding: 3px 0; font-size: inherit; }
.alpha-matrix th[aria-sort="ascending"] .am-sort::after { content: " ↑"; color: var(--am-accent); }
.alpha-matrix th[aria-sort="descending"] .am-sort::after { content: " ↓"; color: var(--am-accent); }
.alpha-matrix .am-cell { padding: 14px 8px; border-bottom: 1px solid var(--am-border); vertical-align: top; min-width: 0; }
.alpha-matrix .am-plan-row:hover { background: var(--surface-glass-hover, rgba(255, 255, 255, 0.025)); }
.alpha-matrix :is(.am-identity, .am-plan-actions) { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; }
.alpha-matrix .am-identity strong { color: var(--am-text); font-size: 15px; }
.alpha-matrix :is(.am-product, .am-number, .am-generated, .am-expiry) { font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.alpha-matrix :is(.am-number, .am-expiry) { display: block; margin-top: 3px; }
.alpha-matrix .am-product { color: var(--am-accent); font-size: 11px; word-break: break-word; }
.alpha-matrix .am-expiry { font-size: 10px; color: var(--am-muted); }
.alpha-matrix .am-setup-stage { display: block; margin-top: 5px; color: var(--am-muted); font-size: 10px; }
.alpha-matrix .am-direction { text-transform: uppercase; font-weight: 600; }
.alpha-matrix .am-plan-actions .am-button { font-size: 11px; padding: 5px 8px; min-height: 32px; }
.alpha-matrix .am-chart { display: inline-block; padding: 5px 2px; color: var(--am-accent); text-decoration: underline; text-underline-offset: 3px; }
.alpha-matrix .am-status[data-status="READY"] { color: var(--success-neon, #00e68a); border-color: currentColor; }
.alpha-matrix .am-status[data-status="ACTIVE"] { color: var(--am-accent); border-color: currentColor; }
.alpha-matrix .am-status[data-status="WATCH"] { color: #9ec7ff; }
.alpha-matrix :is(.am-status[data-status="UNCALIBRATED"], .am-status[data-status="FUNDING_REQUIRED"], .am-warning) { color: var(--warning-neon, #f5a623); }
.alpha-matrix .am-status[data-status="BLOCKED"] { color: var(--danger-neon, #ff3b5c); border-color: currentColor; }
.alpha-matrix .am-status[data-status="EXPIRED"] { color: var(--am-muted); border-style: dashed; }
.alpha-matrix .am-detail-row > td { padding: 12px; border-bottom: 1px solid var(--am-border); background: var(--am-surface); }
.alpha-matrix .am-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 16px; }
.alpha-matrix .am-detail-section { min-width: 0; }
.alpha-matrix .am-detail-section h3 { font-size: 12px; font-weight: 600; color: var(--am-accent); margin-bottom: 8px; }
.alpha-matrix .am-values { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 6px 10px; }
.alpha-matrix .am-values dt { color: var(--am-muted); }
.alpha-matrix .am-values dd { min-width: 0; white-space: pre-wrap; }
.alpha-matrix :is(.am-value-list, .am-manual-steps ol) { margin: 4px 0; padding-left: 22px; }
.alpha-matrix :is(.am-value-list li, .am-manual-steps li) { margin-bottom: 6px; white-space: pre-wrap; }
.alpha-matrix .am-manual-steps li::marker { color: var(--am-accent); font-weight: 700; }
.alpha-matrix .am-empty { border: 1px dashed var(--am-border); border-radius: 9px; color: var(--am-muted); padding: 32px 16px; text-align: center; }
.alpha-matrix .am-copy-box { margin-top: 16px; padding: 12px; border: 1px solid var(--am-accent); border-radius: 8px; }
.alpha-matrix .am-copy-text { display: block; min-height: 240px; margin: 10px 0; resize: vertical; font-family: ui-monospace, monospace; }
.alpha-matrix .am-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Container query handles an Agency pane narrower than the browser viewport. */
@container alpha-matrix (max-width: 1050px) {
    .alpha-matrix .am-table { display: block; }
    .alpha-matrix .am-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .alpha-matrix .am-plan { display: block; border: 1px solid var(--am-border); border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
    .alpha-matrix .am-plan-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .alpha-matrix .am-cell { display: block; padding: 10px 12px; }
    .alpha-matrix .am-cell::before { content: attr(data-label); display: block; color: var(--am-muted); font-size: 10px; margin-bottom: 6px; }
    .alpha-matrix .am-cell:first-child { grid-column: 1 / -1; }
    .alpha-matrix .am-plan-actions { flex-direction: row; flex-wrap: wrap; }
    .alpha-matrix .am-detail-row, .alpha-matrix .am-detail-row > td { display: block; }
}

/* Viewport fallback for engines without container-query support. */
@media (max-width: 800px) {
    .alpha-matrix .am-header-actions, .alpha-matrix .am-badges { justify-content: flex-start; }
    .alpha-matrix .am-header-actions { flex-basis: 100%; }
    .alpha-matrix .am-table { display: block; }
    .alpha-matrix .am-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .alpha-matrix .am-plan { display: block; border: 1px solid var(--am-border); border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
    .alpha-matrix .am-plan-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .alpha-matrix .am-cell { display: block; padding: 10px; }
    .alpha-matrix .am-cell::before { content: attr(data-label); display: block; color: var(--am-muted); font-size: 10px; margin-bottom: 6px; }
    .alpha-matrix .am-cell:first-child { grid-column: 1 / -1; }
    .alpha-matrix .am-plan-actions { flex-direction: row; flex-wrap: wrap; }
    .alpha-matrix .am-detail-row, .alpha-matrix .am-detail-row > td { display: block; }
}
@media (max-width: 420px) {
    .alpha-matrix .am-plan-row { grid-template-columns: minmax(0, 1fr); }
    .alpha-matrix .am-values { grid-template-columns: minmax(0, 1fr); }
    .alpha-matrix .am-values dd { padding-left: 8px; }
}
