:root {
    --navy: #041a3a;
    --navy2: #082a5b;
    --blue: #126bee;
    --light: #f3f6fa;
    --border: #d8e0ea;
    --text: #172033;
    --muted: #64748b;
    --white: #ffffff;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: var(--light); color: var(--text); }
a { color: var(--blue); }
.topbar { background: linear-gradient(120deg, var(--navy), var(--navy2)); color: var(--white); padding: 22px 32px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.brand { font-size: 22px; font-weight: 700; }
.tagline { margin-top: 5px; color: #dbeafe; font-size: 13px; }
.topbar nav { display: flex; gap: 18px; flex-wrap: wrap; }
.topbar nav a { color: var(--white); text-decoration: none; font-weight: 700; font-size: 14px; }
.container { max-width: 1380px; margin: 0 auto; padding: 28px; }
.page-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
h1 { margin: 0; font-size: 28px; }
h2 { margin-top: 0; font-size: 20px; }
.cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.card { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 18px; box-shadow: 0 4px 14px rgba(15, 23, 42, .05); }
.metric-label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.metric-value { font-size: 28px; font-weight: 800; margin-top: 8px; color: var(--navy2); }
.panel { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 20px; box-shadow: 0 4px 14px rgba(15, 23, 42, .05); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--border); padding: 12px 10px; text-align: left; vertical-align: top; font-size: 14px; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:hover td { background: #f8fafc; }
.badge { display: inline-block; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.priority { background: #dcfce7; color: #166534; }
.badge.strong { background: #dbeafe; color: #1d4ed8; }
.badge.research { background: #fef3c7; color: #92400e; }
.badge.watch { background: #fee2e2; color: #991b1b; }
.btn { display: inline-block; border: 0; border-radius: 8px; padding: 11px 15px; background: var(--blue); color: var(--white); text-decoration: none; font-weight: 700; cursor: pointer; }
.btn.secondary { background: var(--navy2); }
.btn.light { background: #e2e8f0; color: var(--text); }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
label { font-size: 13px; font-weight: 700; color: #334155; }
input, select, textarea { width: 100%; padding: 10px 11px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; background: var(--white); }
textarea { min-height: 130px; resize: vertical; }
.help { color: var(--muted); font-size: 12px; line-height: 1.5; }
.alert { padding: 13px 15px; border-radius: 8px; margin-bottom: 18px; }
.alert.success { background: #dcfce7; color: #166534; }
.alert.warning { background: #fef3c7; color: #92400e; }
.details-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.detail { border: 1px solid var(--border); border-radius: 8px; padding: 12px; background: #f8fafc; }
.detail .label { color: var(--muted); font-size: 11px; text-transform: uppercase; font-weight: 700; }
.detail .value { margin-top: 5px; font-weight: 700; line-height: 1.35; }
.section-title { margin: 28px 0 12px; font-size: 18px; }
.raw { white-space: pre-wrap; line-height: 1.55; background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 16px; font-size: 13px; }
.footer { padding: 24px; text-align: center; color: var(--muted); font-size: 12px; }
@media (max-width: 1050px) {
    .cards { grid-template-columns: repeat(2, 1fr); }
    .form-grid, .form-grid.two, .details-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
    .topbar { align-items: flex-start; flex-direction: column; }
    .container { padding: 18px; }
    .cards, .form-grid, .form-grid.two, .details-grid { grid-template-columns: 1fr; }
}
.record-actions, .table-actions, .form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.light-raw {
    background: #f8fafc;
    color: #172033;
    border: 1px solid #d8e0ea;
}
@media (max-width: 700px) {
    .page-title { align-items: flex-start; flex-direction: column; gap: 12px; }
}
.btn.danger { background: #b91c1c; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.inline-form .btn { padding: 9px 11px; }
.record-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.record-tabs a { padding: 7px 10px; border-radius: 999px; background: #e2e8f0; color: #334155; text-decoration: none; font-size: 13px; font-weight: 700; }
.record-tabs a.active { background: var(--navy2); color: var(--white); }
.compact-title { margin-bottom: 16px; }
.comparison-old { background: #fff7ed; max-width: 360px; white-space: pre-wrap; }
.comparison-new { background: #ecfdf5; max-width: 360px; white-space: pre-wrap; }
.audit-value { max-width: 380px; white-space: pre-wrap; word-break: break-word; }

/* v0.3.0 assessment research */
.cards { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.assessment-cards { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.source-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.research-hero { display: flex; justify-content: space-between; gap: 18px; align-items: center; }
.check-row { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; }
.check-row input { width: auto; margin-top: 2px; }
.status-pill { display: inline-block; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-not_started { background: #e2e8f0; color: #475569; }
.status-in_progress { background: #dbeafe; color: #1d4ed8; }
.status-needs_review { background: #fef3c7; color: #92400e; }
.status-verified { background: #dcfce7; color: #166534; }
.link-stack { display: flex; flex-direction: column; gap: 5px; }
@media (max-width: 700px) { .research-hero { align-items: flex-start; flex-direction: column; } }
