:root {
  color-scheme: light dark;
  --bg: #ffffff; --fg: #1a1a1a; --muted: #666; --border: #ddd;
  --accent: #2563eb; --ok: #16a34a; --partial: #ca8a04; --missing: #dc2626;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #16181d; --fg: #e6e6e6; --muted: #9aa0a6; --border: #333; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.5 -apple-system, system-ui, sans-serif; }
header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); }
h1 { font-size: 1.2rem; margin: 0; }
main { padding: 1.5rem; max-width: 1100px; margin: 0 auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--border); }
tbody tr { cursor: pointer; }
tbody tr:hover { background: rgba(37, 99, 235, .08); }
.upload-btn { background: var(--accent); color: #fff; padding: .5rem 1rem; border-radius: 6px; cursor: pointer; font-size: .9rem; }
.badge { display: inline-block; padding: .15rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge.new, .badge.processing { background: #e5e7eb; color: #374151; }
.badge.extracted { background: #dbeafe; color: #1e40af; }
.badge.analyzed { background: #dcfce7; color: #166534; }
.badge.failed { background: #fee2e2; color: #991b1b; }
.cov { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .4rem; }
.cov.var { background: var(--ok); }
.cov.kismi { background: var(--partial); }
.cov.yok { background: var(--missing); }
#backBtn, #reprocessBtn { background: none; border: 1px solid var(--border); color: var(--fg); padding: .4rem .8rem; border-radius: 6px; cursor: pointer; margin-bottom: 1rem; }
.product-block { border: 1px solid var(--border); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }
.product-block h3 { margin-top: 0; text-transform: uppercase; letter-spacing: .05em; font-size: .85rem; color: var(--muted); }
.req-item { padding: .5rem 0; border-bottom: 1px solid var(--border); }
.req-item:last-child { border-bottom: none; }
.req-note { color: var(--muted); font-size: .85rem; margin-top: .2rem; }
textarea { width: 100%; min-height: 4rem; background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: 6px; padding: .5rem; font: inherit; }
.doc-list { color: var(--muted); font-size: .85rem; }
.doc-details { border: 1px solid var(--border); border-radius: 8px; padding: .6rem .9rem; margin-bottom: .5rem; }
.doc-details summary { cursor: pointer; font-size: .9rem; }
.doc-text { white-space: pre-wrap; word-break: break-word; max-height: 500px; overflow-y: auto; font-size: .82rem; background: rgba(127,127,127,.08); padding: .8rem; border-radius: 6px; margin-top: .6rem; }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .5rem 1.5rem; margin-bottom: 1rem; }
.meta-grid dt { color: var(--muted); font-size: .78rem; text-transform: uppercase; }
.meta-grid dd { margin: 0; }
