:root {
  --bg: #f5f5f5; --surface: #fff; --border: #ddd;
  --risk-high: #e74c3c; --risk-medium: #f39c12; --risk-low: #27ae60;
  --primary: #4A90D9; --primary-dark: #357ABD;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, sans-serif; background: var(--bg); color: #222; line-height: 1.5; }
#app { max-width: 1000px; margin: 0 auto; padding: 1rem; }
header { margin-bottom: 1.5rem; }
h1 { font-size: 1.4rem; color: var(--primary); }
h2 { font-size: 1.1rem; margin-bottom: 0.5rem; }
section { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }
input[type="file"] { display: block; margin-bottom: 0.5rem; }
button { background: var(--primary); color: #fff; border: none; padding: 0.4rem 1rem; border-radius: 4px; cursor: pointer; font-size: 0.9rem; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button:hover:not(:disabled) { background: var(--primary-dark); }
#etalon-status { margin-top: 0.5rem; font-size: 0.9rem; }
.contract-row { display: flex; align-items: center; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.contract-row:last-child { border-bottom: none; }
.contract-row:hover { background: #f0f4ff; }
.risk-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.8rem; font-weight: 600; color: #fff; }
.risk-high { background: var(--risk-high); }
.risk-medium { background: var(--risk-medium); }
.risk-low { background: var(--risk-low); }
.deviation { padding: 0.3rem 0; }
.deviation .type { font-weight: 600; }
.chat-input-row { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.chat-input-row input { flex: 1; padding: 0.4rem; border: 1px solid var(--border); border-radius: 4px; font-size: 0.9rem; }
#chat-messages { max-height: 300px; overflow-y: auto; margin-bottom: 0.5rem; }
.msg { margin: 0.3rem 0; padding: 0.4rem 0.6rem; border-radius: 6px; font-size: 0.9rem; }
.msg-user { background: #e3f2fd; text-align: right; }
.msg-assistant { background: #f5f5f5; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
