*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
body{background:#f9fafb;font-family:'DM Sans',system-ui,-apple-system,sans-serif;color:#374151;line-height:1.5;-webkit-font-smoothing:antialiased}
.font-display{font-family:'Instrument Serif',Georgia,serif}
.tabular-nums{font-variant-numeric:tabular-nums}
.font-mono{font-family:'SF Mono','Fira Code','Cascadia Code',monospace}

:root{--color-primary:#2563eb;--nav-bg:#0A1628;--card-bg:#ffffff;--card-border:#e5e7eb;--card-radius:12px;--text-primary:#111827;--text-secondary:#6b7280;--text-muted:#9ca3af;--bg-page:#f9fafb;--bg-subtle:#f8fafc}

a{color:var(--color-primary);text-decoration:none}
a:hover{text-decoration:underline}
button{cursor:pointer;font-family:inherit}
button:active:not(:disabled){transform:scale(0.97)}
*:focus-visible{outline:2px solid #3b82f6;outline-offset:2px;border-radius:4px}

.product-page{min-height:100vh;display:flex;flex-direction:column}
.product-topnav{background:var(--nav-bg);padding:0 24px;height:56px;display:flex;align-items:center;gap:16px;position:sticky;top:0;z-index:50}
.product-topnav .brand{display:flex;align-items:center;gap:10px;color:#fff;font-weight:700;font-size:15px;text-decoration:none}
.product-topnav .brand svg{width:28px;height:28px}
.product-topnav .nav-links{display:flex;align-items:center;gap:4px;margin-left:24px}
.product-topnav .nav-link{color:#94a3b8;font-size:13px;font-weight:500;padding:6px 12px;border-radius:6px;text-decoration:none;transition:color .15s,background .15s}
.product-topnav .nav-link:hover{color:#e2e8f0;background:rgba(255,255,255,.08);text-decoration:none}
.product-topnav .nav-link.active{color:#fff;background:rgba(255,255,255,.12)}
.product-topnav .right{margin-left:auto;display:flex;align-items:center;gap:12px}
.credit-counter{font-size:12px;color:#94a3b8;background:rgba(255,255,255,.06);padding:4px 10px;border-radius:6px}
.credit-counter.low{color:#fca5a5;background:rgba(239,68,68,.12)}

.back-link{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:500;color:var(--text-secondary);margin-bottom:16px;padding:4px 0}
.back-link:hover{color:var(--text-primary);text-decoration:none}

.page-body{flex:1;max-width:1120px;width:100%;margin:0 auto;padding:24px 24px 48px}
body.ds .page-body{padding-top:96px}

.product-header{display:flex;align-items:center;gap:16px;margin-bottom:24px;flex-wrap:wrap}
.product-badge{display:inline-flex;align-items:center;gap:8px;font-size:20px;font-weight:800;color:var(--text-primary)}
.product-badge .icon{width:36px;height:36px;border-radius:10px;display:flex;align-items:center;justify-content:center}
.product-badge .icon svg{width:20px;height:20px}
.product-subtitle{font-size:13px;color:var(--text-secondary);margin-top:2px}
.product-header .score-pill{margin-left:auto;display:flex;align-items:center;gap:6px;padding:6px 14px;border-radius:20px;font-size:14px;font-weight:700;background:#f1f5f9;color:var(--text-secondary)}

.card{background:var(--card-bg);border:1px solid var(--card-border);border-radius:var(--card-radius);overflow:hidden;box-shadow:0 1px 3px rgba(0,0,0,.04)}
.card-header{padding:16px 24px;border-bottom:1px solid #f1f5f9;display:flex;align-items:center;justify-content:space-between;gap:12px}
.card-header h3{font-size:15px;font-weight:700;color:var(--text-primary)}
.card-header p{font-size:12px;color:var(--text-secondary);margin-top:2px}
.card-body{padding:24px}

.form-group{margin-bottom:16px}
.form-label{display:block;font-size:12px;font-weight:600;color:var(--text-secondary);margin-bottom:6px;text-transform:uppercase;letter-spacing:.03em}
.form-input{width:100%;background:#fff;border:1px solid #d1d5db;border-radius:8px;padding:10px 14px;font-size:14px;color:var(--text-primary);transition:border-color .15s,box-shadow .15s;font-family:inherit}
.form-input:focus{outline:none;border-color:var(--product-color,#3b82f6);box-shadow:0 0 0 3px color-mix(in srgb,var(--product-color,#3b82f6) 15%,transparent)}
.form-input::placeholder{color:#9ca3af}
select.form-input{appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;padding-right:32px}
textarea.form-input{resize:vertical;min-height:80px}

.form-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media(max-width:640px){.form-row{grid-template-columns:1fr}}

.pill-group{display:flex;flex-wrap:wrap;gap:6px}
.pill-option{position:relative}
.pill-option input{position:absolute;opacity:0;width:0;height:0}
.pill-option label{display:inline-flex;align-items:center;gap:6px;padding:8px 16px;border-radius:8px;font-size:13px;font-weight:500;border:1px solid #d1d5db;background:#fff;color:var(--text-primary);cursor:pointer;transition:all .15s}
.pill-option input:checked+label{border-color:var(--product-color,#3b82f6);background:color-mix(in srgb,var(--product-color,#3b82f6) 8%,white);color:var(--product-color,#3b82f6);font-weight:600;box-shadow:0 0 0 1px var(--product-color,#3b82f6)}
.pill-option label:hover{border-color:#9ca3af}
.pill-option .pill-warning{display:none;font-size:10px;color:#ef4444;margin-top:2px}
.pill-option input:checked+label+.pill-warning{display:block}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:10px 20px;border-radius:8px;font-size:14px;font-weight:600;border:none;transition:all .15s;white-space:nowrap}
.btn-primary{color:#fff;background:var(--product-color,#3b82f6)}
.btn-primary:hover{filter:brightness(.9)}
.btn-primary:disabled{opacity:.5;cursor:not-allowed;transform:none}
.btn-full{width:100%}
.btn-secondary{color:var(--text-secondary);background:#f1f5f9;border:1px solid var(--card-border)}
.btn-secondary:hover{background:#e2e8f0}
.btn-sm{padding:6px 12px;font-size:12px;border-radius:6px}
.btn-icon{padding:6px 10px}

.spinner{width:16px;height:16px;border:2px solid rgba(255,255,255,.3);border-top-color:#fff;border-radius:50%;animation:spin .6s linear infinite;display:inline-block}
@keyframes spin{to{transform:rotate(360deg)}}

.tag-input-wrapper{display:flex;flex-wrap:wrap;gap:6px;padding:8px 12px;background:#fff;border:1px solid #d1d5db;border-radius:8px;min-height:42px;cursor:text;transition:border-color .15s,box-shadow .15s}
.tag-input-wrapper:focus-within{border-color:var(--product-color,#3b82f6);box-shadow:0 0 0 3px color-mix(in srgb,var(--product-color,#3b82f6) 15%,transparent)}
.tag-chip{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;background:#eff6ff;color:#1d4ed8;border-radius:4px;font-size:12px;font-weight:500}
.tag-chip .tag-remove{background:none;border:none;color:#93c5fd;cursor:pointer;padding:0 2px;font-size:14px;line-height:1}
.tag-chip .tag-remove:hover{color:#1d4ed8}
.tag-input{border:none;outline:none;font-size:13px;flex:1;min-width:80px;padding:2px 0;font-family:inherit;background:transparent}

@keyframes shimmer{0%{background-position:-400px 0}100%{background-position:400px 0}}
.skeleton{background:linear-gradient(90deg,#f1f5f9 25%,#e2e8f0 37%,#f1f5f9 63%);background-size:800px 100%;animation:shimmer 1.6s ease-in-out infinite;border-radius:6px}
.skeleton-card{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:20px;min-height:120px}
.skeleton-text{height:14px;margin-bottom:10px}
.skeleton-heading{height:28px;width:40%;margin-bottom:16px}
.skeleton-bar{height:24px;border-radius:6px}

.loading-overlay{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:48px;gap:12px}
.loading-overlay .spinner-lg{width:32px;height:32px;border-width:3px}
.loading-text{font-size:13px;color:var(--text-secondary)}
.loading-credit{font-size:11px;color:var(--text-muted);margin-top:4px}

.error-card{background:#fef2f2;border:1px solid #fecaca;border-radius:var(--card-radius);padding:24px;display:flex;align-items:flex-start;gap:12px}
.error-card .error-icon{width:36px;height:36px;border-radius:8px;background:#fee2e2;color:#dc2626;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.error-card .error-body{flex:1}
.error-card .error-title{font-size:14px;font-weight:600;color:#991b1b;margin-bottom:4px}
.error-card .error-msg{font-size:13px;color:#b91c1c}
.error-card .error-action{margin-top:12px}

.empty-state{display:flex;flex-direction:column;align-items:center;padding:48px 24px;text-align:center}
.empty-state .empty-icon{width:64px;height:64px;border-radius:16px;display:flex;align-items:center;justify-content:center;margin-bottom:16px}
.empty-state .empty-icon svg{width:32px;height:32px}
.empty-state h3{font-size:16px;font-weight:700;color:var(--text-primary);margin-bottom:6px}
.empty-state p{font-size:13px;color:var(--text-secondary);max-width:360px;margin-bottom:16px}
.empty-state ul{text-align:left;list-style:none;padding:0;margin-bottom:20px}
.empty-state ul li{font-size:13px;color:var(--text-secondary);padding:4px 0;display:flex;align-items:center;gap:8px}
.empty-state ul li::before{content:'';width:6px;height:6px;border-radius:50%;flex-shrink:0}
.empty-state .arrow-down{color:var(--text-muted);margin-top:8px;animation:bounce-arrow 1.5s ease-in-out infinite}
@keyframes bounce-arrow{0%,100%{transform:translateY(0)}50%{transform:translateY(6px)}}

.data-table{width:100%;text-align:left;font-size:13px;border-collapse:collapse}
.data-table thead th{padding:10px 16px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--text-secondary);background:var(--bg-subtle);border-bottom:2px solid var(--card-border);position:sticky;top:0;z-index:1}
.data-table tbody td{padding:12px 16px;border-bottom:1px solid #f1f5f9;color:var(--text-primary)}
.data-table tbody tr{transition:background .15s;border-left:3px solid transparent}
.data-table tbody tr:hover{background:var(--bg-subtle);border-left-color:var(--product-color,#3b82f6)}
.data-table .col-mono{font-family:'SF Mono','Fira Code',monospace;font-size:12px;color:#64748b}
.data-table .col-num{font-variant-numeric:tabular-nums;text-align:right}

.badge{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:4px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.03em}
.badge-green{background:#dcfce7;color:#166534}
.badge-amber{background:#fef3c7;color:#92400e}
.badge-red{background:#fee2e2;color:#991b1b}
.badge-blue{background:#dbeafe;color:#1e40af}
.badge-gray{background:#f1f5f9;color:#64748b}
.badge-purple{background:#f3e8ff;color:#6b21a8}
.badge-pink{background:#fce7f3;color:#9d174d}
.badge-sky{background:#e0f2fe;color:#075985}
.badge-orange{background:#ffedd5;color:#9a3412}

.score-circle{width:72px;height:72px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:24px;font-weight:800;flex-shrink:0}
.score-green{background:#dcfce7;color:#166534;border:3px solid #86efac}
.score-amber{background:#fef3c7;color:#92400e;border:3px solid #fcd34d}
.score-red{background:#fee2e2;color:#991b1b;border:3px solid #fca5a5}

.progress-bar{height:8px;background:#f1f5f9;border-radius:4px;overflow:hidden;position:relative}
.progress-fill{height:100%;border-radius:4px;transition:width .6s cubic-bezier(.16,1,.3,1)}

.metric-tile{background:var(--bg-subtle);border:1px solid var(--card-border);border-radius:10px;padding:16px;text-align:center}
.metric-tile .metric-value{font-size:28px;font-weight:800;line-height:1.2}
.metric-tile .metric-label{font-size:11px;color:var(--text-secondary);margin-top:4px;text-transform:uppercase;letter-spacing:.03em}
.metric-tile .metric-sub{font-size:11px;color:var(--text-muted);margin-top:6px}

.section-title{font-size:15px;font-weight:700;color:var(--text-primary);margin-bottom:12px;display:flex;align-items:center;gap:8px}

.timeline-bar{height:12px;border-radius:6px;display:flex;overflow:hidden;background:#f1f5f9}
.timeline-red{background:linear-gradient(90deg,#ef4444,#f87171)}
.timeline-green{background:linear-gradient(90deg,#22c55e,#4ade80)}

.tooltip-wrapper{position:relative}
.tooltip-content{display:none;position:absolute;bottom:calc(100% + 8px);left:50%;transform:translateX(-50%);background:#1e293b;color:#fff;padding:8px 12px;border-radius:6px;font-size:11px;white-space:nowrap;z-index:20;box-shadow:0 4px 12px rgba(0,0,0,.2)}
.tooltip-content::after{content:'';position:absolute;top:100%;left:50%;transform:translateX(-50%);border:5px solid transparent;border-top-color:#1e293b}
.tooltip-wrapper:hover .tooltip-content{display:block}

.framework-badges{display:flex;flex-wrap:wrap;gap:6px}
.framework-badge{display:inline-flex;align-items:center;gap:4px;padding:4px 10px;background:#f1f5f9;border:1px solid #e2e8f0;border-radius:6px;font-size:11px;font-weight:600;color:#475569;cursor:default}

.collapsible-header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;cursor:pointer;user-select:none;border-radius:8px;transition:background .15s}
.collapsible-header:hover{background:var(--bg-subtle)}
.collapsible-header .chevron{transition:transform .2s;color:var(--text-muted)}
.collapsible-header.open .chevron{transform:rotate(180deg)}
.collapsible-body{display:none;padding:0 16px 12px}
.collapsible-header.open+.collapsible-body{display:block}

.expandable-row{cursor:pointer}
.expandable-detail{display:none;background:#f8fafc;border-bottom:1px solid #f1f5f9}
.expandable-detail td{padding:12px 16px}

.history-section{margin-top:24px}
.history-section h3{font-size:14px;font-weight:700;color:var(--text-primary);margin-bottom:12px}

@keyframes pulse-ring{0%{box-shadow:0 0 0 0 rgba(239,68,68,.4)}70%{box-shadow:0 0 0 12px rgba(239,68,68,0)}100%{box-shadow:0 0 0 0 rgba(239,68,68,0)}}
.pulse-ring{animation:pulse-ring 1.5s ease infinite}

.halt-card{background:#1e293b;border:1px solid #334155;border-radius:10px;padding:20px;color:#e2e8f0;font-family:'SF Mono','Fira Code',monospace;font-size:12px}
.halt-card .factor-row{padding:10px 0;border-bottom:1px solid #334155}
.halt-card .factor-row:last-child{border-bottom:none}
.halt-card .cve-pill{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;background:#334155;border-radius:4px;font-size:11px;color:#f1f5f9}

.decision-banner{display:flex;align-items:center;gap:16px;padding:20px 24px;border-radius:10px;margin-bottom:16px}
.decision-icon{width:56px;height:56px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.decision-icon svg{width:28px;height:28px}
.decision-text{font-size:20px;font-weight:800;letter-spacing:.02em}
.decision-sub{font-size:13px;margin-top:4px}

.actions-bar{display:flex;gap:8px;flex-wrap:wrap;padding:16px 0;border-top:1px solid var(--card-border);margin-top:24px}

.change-row{background:#fff;border:1px solid var(--card-border);border-radius:10px;padding:16px;margin-bottom:12px;position:relative}
.change-row .remove-btn{position:absolute;top:8px;right:8px}

.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.grid-4{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
@media(max-width:768px){.grid-2,.grid-3,.grid-4{grid-template-columns:1fr}}
.gap-16{gap:16px}
.gap-24{gap:24px}
.space-y-16>*+*{margin-top:16px}
.space-y-24>*+*{margin-top:24px}
.mt-16{margin-top:16px}
.mt-24{margin-top:24px}
.hidden{display:none!important}

@keyframes toast-in{from{transform:translateX(100%);opacity:0}to{transform:translateX(0);opacity:1}}
@keyframes toast-out{from{transform:translateX(0);opacity:1}to{transform:translateX(100%);opacity:0}}
.toast-container{position:fixed;bottom:24px;right:24px;z-index:9999;display:flex;flex-direction:column;gap:8px;pointer-events:none}
.toast-item{pointer-events:auto;display:flex;align-items:flex-start;gap:10px;padding:14px 16px;border-radius:10px;background:#fff;border:1px solid #e5e7eb;box-shadow:0 8px 24px -4px rgba(0,0,0,.12),0 4px 8px -2px rgba(0,0,0,.06);min-width:320px;max-width:420px;font-size:13px;line-height:1.5;animation:toast-in .3s cubic-bezier(.16,1,.3,1) forwards}
.toast-item.toast-removing{animation:toast-out .25s ease forwards}
.toast-icon{flex-shrink:0;width:20px;height:20px;border-radius:50%;display:flex;align-items:center;justify-content:center;margin-top:1px}
.toast-success .toast-icon{background:#dcfce7;color:#16a34a}
.toast-error .toast-icon{background:#fee2e2;color:#dc2626}
.toast-info .toast-icon{background:#dbeafe;color:#2563eb}
.toast-success{border-left:3px solid #16a34a}
.toast-error{border-left:3px solid #dc2626}
.toast-info{border-left:3px solid #2563eb}
.toast-dismiss{flex-shrink:0;background:none;border:none;color:#9ca3af;cursor:pointer;padding:2px;margin-left:auto}
.toast-dismiss:hover{color:#6b7280}

.collision-grid{overflow-x:auto}
.collision-grid table{border-collapse:collapse;width:100%;min-width:400px}
.collision-grid th,.collision-grid td{border:1px solid #e5e7eb;padding:8px 10px;text-align:center;font-size:12px;min-width:100px}
.collision-grid th{background:#f8fafc;font-weight:600;color:var(--text-secondary)}
.collision-grid .cell-none{background:#f8fafc;color:#94a3b8}
.collision-grid .cell-time{background:#fef3c7;color:#92400e}
.collision-grid .cell-ci{background:#ffedd5;color:#9a3412}
.collision-grid .cell-combined{background:#fee2e2;color:#991b1b;font-weight:700}
.collision-grid .cell-self{background:#f1f5f9;color:#cbd5e1}

.gauge-container{position:relative;width:160px;height:90px;margin:0 auto}
.gauge-container svg{width:100%;height:100%}
.gauge-score{position:absolute;bottom:0;left:50%;transform:translateX(-50%);font-size:32px;font-weight:800;line-height:1}

.checklist-item{display:flex;align-items:flex-start;gap:10px;padding:8px 0}
.checklist-item input[type="checkbox"]{margin-top:3px;accent-color:var(--product-color,#3b82f6)}
.checklist-item.done .checklist-text{text-decoration:line-through;color:var(--text-muted)}

.finding-row{display:flex;align-items:flex-start;gap:8px;padding:4px 0;font-size:12px}
.finding-good{color:#166534}
.finding-warn{color:#92400e}
.finding-bad{color:#991b1b}

@media(prefers-reduced-motion:reduce){
  .skeleton{animation:none}
  .toast-item{animation:none}
  .pulse-ring{animation:none}
  .empty-state .arrow-down{animation:none}
  @keyframes spin{to{transform:rotate(360deg)}}
}
