:root {
  --navy-950: #07101f;
  --navy-900: #0b1220;
  --navy-800: #101c30;
  --navy-700: #1b2b45;
  --ink-950: #101828;
  --ink-800: #1d2939;
  --ink-700: #344054;
  --ink-600: #475467;
  --ink-500: #667085;
  --ink-400: #98a2b3;
  --line: #e4e7ec;
  --line-soft: #eef1f5;
  --surface: #ffffff;
  --canvas: #f5f7fa;
  --blue: #1677ff;
  --blue-dark: #095ccc;
  --cyan: #13b8d6;
  --green: #079455;
  --green-bg: #ecfdf3;
  --amber: #b54708;
  --amber-bg: #fffaeb;
  --red: #d92d20;
  --red-bg: #fef3f2;
  --purple: #6938ef;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 18px 48px rgba(16, 24, 40, .18);
  --radius: 12px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink-950);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.boot-screen,
.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 20% 15%, rgba(22, 119, 255, .18), transparent 32%),
    radial-gradient(circle at 85% 80%, rgba(19, 184, 214, .12), transparent 30%),
    var(--navy-950);
}

.boot-screen { align-content: center; gap: 12px; color: #c8d3e5; }
.boot-screen p { margin: 0; }
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(145deg, var(--blue), var(--cyan));
  box-shadow: 0 9px 26px rgba(22, 119, 255, .32);
}
.brand-mark.large { width: 52px; height: 52px; border-radius: 15px; font-size: 20px; }

.auth-card {
  width: min(430px, 100%);
  padding: 32px;
  background: rgba(255, 255, 255, .98);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.auth-brand strong { display: block; font-size: 18px; }
.auth-brand span { display: block; margin-top: 3px; color: var(--ink-500); font-size: 13px; }
.auth-card h1 { margin: 0 0 8px; font-size: 25px; letter-spacing: -.025em; }
.auth-card > p { margin: 0 0 24px; color: var(--ink-600); line-height: 1.55; }
.auth-card .btn { width: 100%; margin-top: 8px; }
.auth-note { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line-soft); color: var(--ink-500); font-size: 12px; line-height: 1.5; }
.auth-error { display: none; margin: 0 0 16px; padding: 10px 12px; border-radius: 9px; color: #b42318; background: var(--red-bg); font-size: 13px; }
.auth-error.show { display: block; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: 248px;
  display: flex;
  flex-direction: column;
  color: #d7e0ee;
  background: var(--navy-950);
  border-right: 1px solid rgba(255, 255, 255, .06);
}
.side-brand { height: 76px; display: flex; align-items: center; gap: 12px; padding: 0 22px; border-bottom: 1px solid rgba(255,255,255,.07); }
.side-brand strong { display: block; color: #fff; font-size: 15px; }
.side-brand span { display: block; margin-top: 2px; color: #7f91aa; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.side-nav { display: grid; gap: 5px; padding: 18px 12px; overflow: auto; }
.side-label { padding: 13px 11px 5px; color: #64748b; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 11px; border: 0; border-radius: 8px; color: #9eb0c8; background: transparent; text-decoration: none; font-size: 13px; font-weight: 600; transition: .15s ease; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-link.active { color: #fff; background: linear-gradient(90deg, rgba(22,119,255,.24), rgba(22,119,255,.08)); box-shadow: inset 3px 0 var(--blue); }
.nav-icon { width: 18px; color: #7890ae; text-align: center; font-size: 16px; }
.nav-link.active .nav-icon { color: #5ea2ff; }
.side-footer { margin-top: auto; padding: 16px 14px; border-top: 1px solid rgba(255,255,255,.07); }
.admin-chip { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 9px; border-radius: 9px; background: rgba(255,255,255,.045); }
.avatar { width: 31px; height: 31px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #274366; font-weight: 700; font-size: 12px; }
.admin-chip div { min-width: 0; }
.admin-chip strong, .admin-chip span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-chip strong { color: #eaf0f8; font-size: 12px; }
.admin-chip span { margin-top: 2px; color: #8293aa; font-size: 10px; }

.main-column { grid-column: 2; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 30px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar h1 { margin: 0; font-size: 19px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eyebrow { margin: 0 0 3px; color: var(--ink-500); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; }
.page { max-width: 1500px; margin: 0 auto; padding: 28px 30px 50px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head h2 { margin: 0; font-size: 23px; letter-spacing: -.03em; }
.page-head p { margin: 7px 0 0; color: var(--ink-600); font-size: 13px; line-height: 1.5; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.btn { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-700); background: #fff; box-shadow: var(--shadow-sm); cursor: pointer; font-weight: 650; font-size: 12px; text-decoration: none; transition: .15s ease; }
.btn:hover { border-color: #c9d0da; background: #fafbfc; }
.btn:disabled { opacity: .55; cursor: wait; }
.btn-primary { color: #fff; border-color: var(--blue); background: var(--blue); }
.btn-primary:hover { border-color: var(--blue-dark); background: var(--blue-dark); }
.btn-danger { color: var(--red); border-color: #fecdca; background: #fff; }
.btn-ghost { box-shadow: none; background: transparent; }
.btn-sm { min-height: 31px; padding: 5px 9px; font-size: 11px; }
.icon-btn { width: 38px; padding: 0; }

.stats-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-label { color: var(--ink-500); font-size: 11px; font-weight: 650; }
.stat-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; color: var(--blue); background: #eff8ff; }
.stat-value { display: block; margin-top: 14px; font-size: 25px; line-height: 1; letter-spacing: -.035em; }
.stat-sub { display: block; margin-top: 8px; color: var(--ink-500); font-size: 10px; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .65fr); gap: 16px; }
.content-grid > .panel + .panel { margin-top: 0; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.panel + .panel { margin-top: 16px; }
.panel-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 17px; border-bottom: 1px solid var(--line-soft); }
.panel-head h3 { margin: 0; font-size: 14px; }
.panel-head p { margin: 3px 0 0; color: var(--ink-500); font-size: 11px; }
.panel-body { padding: 17px; }
.panel-flush { padding: 0; }

.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 10px 13px; color: var(--ink-500); background: #f9fafb; border-bottom: 1px solid var(--line); text-align: left; font-size: 10px; font-weight: 750; letter-spacing: .035em; text-transform: uppercase; white-space: nowrap; }
td { padding: 12px 13px; color: var(--ink-700); border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: #f9fbff; }
.cell-title { display: block; color: var(--ink-950); font-weight: 700; }
.cell-sub { display: block; margin-top: 3px; color: var(--ink-500); font-size: 10px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.nowrap { white-space: nowrap; }
.muted { color: var(--ink-500); }
.text-danger { color: var(--red); }
.text-success { color: var(--green); }

.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 23px; padding: 3px 8px; border-radius: 999px; color: var(--ink-600); background: #f2f4f7; font-size: 10px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.active, .badge.healthy { color: var(--green); background: var(--green-bg); }
.badge.trialing { color: var(--purple); background: #f4f3ff; }
.badge.past_due, .badge.warning { color: var(--amber); background: var(--amber-bg); }
.badge.suspended, .badge.cancelled, .badge.danger { color: var(--red); background: var(--red-bg); }
.badge.archived { color: var(--ink-600); background: #eaecf0; }
.badge.deletion_pending { color: var(--red); background: var(--red-bg); }
.badge.planning, .badge.on { color: var(--purple); background: #f4f3ff; }
.badge.complete { color: var(--green); background: var(--green-bg); }
.badge.legacy { color: var(--ink-600); background: #f2f4f7; }
.badge.demo { color: #026aa2; background: #f0f9ff; }

.filters { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding: 13px 16px; border-bottom: 1px solid var(--line-soft); }
.search { position: relative; min-width: 220px; flex: 1; }
.search input { padding-left: 34px; }
.search::before { content: "⌕"; position: absolute; left: 12px; top: 50%; transform: translateY(-53%); color: var(--ink-400); font-size: 17px; }
.input, input, select, textarea { width: 100%; min-height: 39px; padding: 8px 11px; border: 1px solid #d0d5dd; border-radius: 8px; color: var(--ink-950); background: #fff; outline: none; font-size: 12px; transition: .15s ease; }
input:focus, select:focus, textarea:focus { border-color: #84adff; box-shadow: 0 0 0 3px rgba(22,119,255,.1); }
textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
label.field { display: grid; gap: 6px; color: var(--ink-700); font-size: 11px; font-weight: 650; }
.field small { color: var(--ink-500); font-weight: 400; line-height: 1.35; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.check-line { min-height: 39px; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-700); font-size: 12px; }
.check-line input { width: 15px; min-height: 15px; padding: 0; }

.attention-list, .audit-list { display: grid; }
.attention-item, .audit-item { display: flex; align-items: flex-start; gap: 11px; padding: 13px 17px; border-bottom: 1px solid var(--line-soft); }
.attention-item:last-child, .audit-item:last-child { border-bottom: 0; }
.attention-dot { width: 8px; height: 8px; flex: 0 0 auto; margin-top: 4px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px var(--amber-bg); }
.attention-item strong, .audit-item strong { display: block; font-size: 12px; }
.attention-item span, .audit-item span { display: block; margin-top: 4px; color: var(--ink-500); font-size: 10px; line-height: 1.45; }
.empty { padding: 36px 20px; color: var(--ink-500); text-align: center; font-size: 12px; }
.empty strong { display: block; margin-bottom: 5px; color: var(--ink-700); font-size: 13px; }

.usage-cell { min-width: 150px; }
.usage-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; color: var(--ink-500); font-size: 10px; }
.progress { height: 6px; overflow: hidden; border-radius: 999px; background: #edf0f4; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.progress.warning > span { background: #f79009; }
.progress.danger > span { background: var(--red); }

.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.plan-card { position: relative; min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.plan-card.inactive { opacity: .68; }
.plan-card h3 { margin: 0; font-size: 16px; }
.plan-code { margin-top: 5px; color: var(--ink-500); font-size: 10px; font-family: ui-monospace, monospace; }
.plan-price { margin: 20px 0 4px; font-size: 27px; font-weight: 800; letter-spacing: -.04em; }
.plan-price span { color: var(--ink-500); font-size: 11px; font-weight: 500; letter-spacing: 0; }
.plan-desc { min-height: 38px; color: var(--ink-600); font-size: 11px; line-height: 1.5; }
.plan-facts { display: grid; gap: 9px; margin: 17px 0; padding: 14px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.plan-fact { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; }
.plan-fact span { color: var(--ink-500); }
.plan-actions { display: flex; gap: 8px; }

.health-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.health-card { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.health-card span { display: block; color: var(--ink-500); font-size: 10px; }
.health-card strong { display: block; margin-top: 7px; font-size: 13px; overflow-wrap: anywhere; }
.danger-zone { margin-top: 18px; border-color: #fecdca; }
.danger-zone .panel-head { background: #fffafa; }

.skeleton { position: relative; overflow: hidden; min-height: 90px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(22,119,255,.06), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.loading-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(7,16,31,.64); backdrop-filter: blur(3px); }
.modal { width: min(690px, 100%); max-height: min(880px, calc(100vh - 40px)); overflow: auto; border-radius: 15px; background: #fff; box-shadow: var(--shadow-lg); }
.modal.wide { width: min(940px, 100%); }
.modal.extra-wide { width: min(1220px, 100%); }
.modal-head { position: sticky; top: 0; z-index: 2; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 19px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-head p { margin: 4px 0 0; color: var(--ink-500); font-size: 10px; }
.modal-body { padding: 19px; }
.modal-foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 9px; padding: 13px 19px; border-top: 1px solid var(--line); background: #fff; }
.tabs { display: flex; gap: 4px; margin: -3px 0 18px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); overflow: auto; }
.tab { padding: 7px 10px; border: 0; border-radius: 7px; color: var(--ink-500); background: transparent; cursor: pointer; font-size: 11px; font-weight: 700; white-space: nowrap; }
.tab.active { color: var(--blue-dark); background: #eff6ff; }
.detail-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.mini-stat { padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #fafbfc; }
.mini-stat span { display: block; color: var(--ink-500); font-size: 9px; text-transform: uppercase; }
.mini-stat strong { display: block; margin-top: 7px; font-size: 15px; }
.mini-stat small { display: block; margin-top: 5px; color: var(--ink-500); font-size: 10px; }
.detail-summary.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.detail-summary.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 14px 0; }
.ai-balance-admin { overflow: hidden; border-color: #b2ddff; }
.topup-form { display: grid; grid-template-columns: 1fr 1fr 1.5fr auto; align-items: end; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); background: #f8fbff; }
.topup-form .btn { min-height: 39px; }
.ledger-table { max-height: 260px; overflow: auto; }
.control-section { margin-top: 16px; overflow: hidden; }
.control-section + .control-section { margin-top: 16px; }
.table-input { min-width: 135px; min-height: 34px; padding: 6px 8px; }
.row-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.modal-foot.spread { justify-content: space-between; }
.membership-chips { display: flex; gap: 7px; flex-wrap: wrap; padding-top: 4px; }
.mfa-qr { display: grid; place-items: center; margin: 16px 0; }
.mfa-qr img { width: min(240px, 100%); border: 10px solid #fff; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.mfa-modal .auth-brand { margin-bottom: 18px; }
.mfa-modal h1 { margin: 0 0 8px; font-size: 20px; }
.mfa-modal > p { color: var(--ink-600); font-size: 12px; line-height: 1.5; }
.lifecycle-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding: 12px 14px; border: 1px solid #fecdca; border-radius: 10px; color: #b42318; background: var(--red-bg); font-size: 12px; }
.lifecycle-banner.archived { color: var(--ink-700); border-color: var(--line); background: #f9fafb; }
.lifecycle-banner span { color: inherit; opacity: .82; }
.lifecycle-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.provider-errors { margin-bottom: 16px; border-color: #fedf89; }
.cloud-grid { grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr); }
.health-list { display: grid; max-height: 430px; overflow: auto; }
.health-list.health-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; }
.health-list.health-columns .health-line:nth-child(odd) { border-right: 1px solid var(--line-soft); }
.health-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 15px; border-bottom: 1px solid var(--line-soft); font-size: 11px; }
.health-line:last-child { border-bottom: 0; }
.health-line > span { color: var(--ink-600); text-transform: capitalize; }
.health-line > strong { max-width: 64%; overflow-wrap: anywhere; text-align: right; }
.public-plan-editor { padding: 14px; border: 1px solid #b2ddff; border-radius: 10px; background: #f8fbff; }
.public-plan-editor > span { color: var(--ink-800); font-size: 12px; font-weight: 750; }
.compact-grid { margin-top: 10px; }

.toast-region { position: fixed; z-index: 120; right: 18px; bottom: 18px; display: grid; gap: 8px; width: min(360px, calc(100vw - 36px)); }
.toast { padding: 12px 14px; border: 1px solid #b2ddff; border-radius: 9px; color: #1849a9; background: #eff8ff; box-shadow: var(--shadow-lg); font-size: 12px; animation: toast-in .2s ease; }
.toast.error { color: #b42318; border-color: #fecdca; background: var(--red-bg); }
.toast.success { color: #067647; border-color: #abefc6; background: var(--green-bg); }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } }

@media (max-width: 1220px) {
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main-column { grid-column: 1; }
  .menu-btn { display: inline-flex; }
  .content-grid { grid-template-columns: 1fr; }
  .health-grid { grid-template-columns: repeat(2, 1fr); }
  .topup-form { grid-template-columns: 1fr 1fr; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 35; display: none; background: rgba(7,16,31,.45); }
  .sidebar-scrim.show { display: block; }
}

@media (max-width: 640px) {
  .topbar { height: 66px; padding: 0 15px; }
  .topbar .eyebrow { display: none; }
  .top-actions .customer-link { display: none; }
  .page { padding: 20px 14px 38px; }
  .page-head { align-items: stretch; flex-direction: column; }
  .page-actions { justify-content: flex-start; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 21px; }
  .plan-grid, .health-grid, .loading-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .detail-summary { grid-template-columns: repeat(2, 1fr); }
  .detail-summary.compact, .topup-form { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal, .modal.wide { width: 100%; max-height: 94vh; border-radius: 15px 15px 0 0; }
  .modal.extra-wide { width: 100%; max-height: 94vh; border-radius: 15px 15px 0 0; }
  .filters { align-items: stretch; flex-direction: column; }
  .search { min-width: 0; }
  .detail-summary.five { grid-template-columns: repeat(2, 1fr); }
  .lifecycle-banner, .modal-foot.spread { align-items: flex-start; flex-direction: column; }
  .health-list.health-columns { grid-template-columns: 1fr; }
  .health-list.health-columns .health-line:nth-child(odd) { border-right: 0; }
}

.feature-check-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 8px; }
.feature-check-grid .check-line { border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; background: #f8fafc; }
.badge.risk-critical { background: #fee2e2; color: #991b1b; }
.badge.risk-high { background: #ffedd5; color: #9a3412; }
.badge.risk-medium { background: #fef3c7; color: #92400e; }
.badge.risk-low { background: #e0f2fe; color: #075985; }
.badge.risk-none, .badge.risk-info { background: #e2e8f0; color: #334155; }
.badge.review_required { background: #fff7ed; color: #9a3412; }
.badge.running { background: #eff6ff; color: #1d4ed8; }
.badge.failed { background: #fee2e2; color: #991b1b; }
.agent-summary { margin: 16px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; font-size: 14px; line-height: 1.55; }
.finding-list { display: grid; gap: 12px; }
.finding-card { padding: 16px; border: 1px solid var(--line); border-left: 4px solid #94a3b8; border-radius: 12px; background: #fff; }
.finding-card.critical { border-left-color: #dc2626; }
.finding-card.high { border-left-color: #ea580c; }
.finding-card.medium { border-left-color: #d97706; }
.finding-card h3 { margin: 11px 0 6px; font-size: 15px; }
.finding-card p { margin: 0; color: var(--ink-500); font-size: 13px; line-height: 1.55; }
.finding-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--ink-500); font-size: 11px; }
.resolution-note { margin-top: 12px; padding: 10px 12px; border-radius: 9px; background: #f0fdf4; color: #166534; font-size: 12px; }
.text-danger { color: #b91c1c !important; }

@media (max-width: 640px) {
  .feature-check-grid { grid-template-columns: 1fr; }
}
