:root {
  --bg: #f4f6f9; --card: #ffffff; --text: #111827; --muted: #6b7280; --line: #e5e7eb;
  --brand: #0b63ce; --brand-2: #0a4fa3; --ok: #15803d; --warn: #b45309; --bad: #b91c1c;
  --radius: 12px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.top { background: #0f172a; color: #e5e7eb; }
.top .in { max-width: 1280px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.top .logo { font-weight: 700; color: #fff; letter-spacing: .2px; }
.top .logo span { color: #60a5fa; }
.top nav { display: flex; gap: 14px; flex: 1; flex-wrap: wrap; }
.top nav a { color: #cbd5e1; }
.top nav a.on, .top nav a:hover { color: #fff; text-decoration: none; }
.top form { margin: 0; }
.top .who { color: #94a3b8; font-size: 13px; }

main { max-width: 1280px; margin: 0 auto; padding: 20px 16px 60px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 8px 14px; border-radius: 9px; font: inherit; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f9fafb; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.sm { padding: 4px 10px; font-size: 13px; }

input[type=text], input[type=password], input[type=number], select, textarea {
  font: inherit; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; width: 100%; }
label { display: block; font-weight: 600; margin: 10px 0 4px; }
.row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }
.row > .btn { flex: 0; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: #f9fafb; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f8fafc; }
.tablewrap { overflow-x: auto; }

.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid rgba(0,0,0,.08); white-space: nowrap; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #eef2ff; color: #3730a3; font-size: 12px; }
.alert { padding: 10px 14px; border-radius: 9px; background: #fef3c7; color: #92400e; margin-bottom: 14px; }
.alert.ok { background: #dcfce7; color: #166534; }
.alert.err { background: #fee2e2; color: #991b1b; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 1000px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .steps { grid-template-columns: 1fr; } }
.step { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; }
.step .n { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: #e5e7eb; color: #374151;
  align-items: center; justify-content: center; font-size: 12px; font-weight: 700; margin-right: 6px; }
.step.done .n { background: #16a34a; color: #fff; }
.step.active { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11,99,206,.12); }
.step.active .n { background: var(--brand); color: #fff; }
.step h3 { font-size: 14px; margin: 0 0 8px; display: flex; align-items: center; }
.bar { height: 8px; background: #e5e7eb; border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.bar > i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .4s; }

.bm { display: inline-block; padding: 8px 14px; border-radius: 9px; background: #fef9c3; border: 1px dashed #ca8a04; color: #713f12; font-weight: 700; cursor: grab; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; align-items: center; }
.filters .chip { cursor: pointer; opacity: .55; }
.filters .chip.on { opacity: 1; outline: 2px solid rgba(0,0,0,.25); }

.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: none; align-items: flex-start; justify-content: center; z-index: 50; overflow-y: auto; padding: 30px 12px; }
.modal-bg.show { display: flex; }
.modal { background: #fff; border-radius: 14px; width: min(1100px, 100%); padding: 20px; position: relative; }
.modal .x { position: absolute; right: 14px; top: 10px; font-size: 22px; cursor: pointer; color: var(--muted); }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumbs a img { height: 150px; border-radius: 8px; border: 1px solid var(--line); background: #f3f4f6; }
.ai-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
@media (max-width: 800px) { .ai-cols { grid-template-columns: 1fr; } }
.ai-cols .card { margin: 0; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 3px 10px; font-size: 13px; }
.kv b { font-weight: 600; color: #374151; }
.yes { color: var(--ok); font-weight: 600; } .no { color: var(--bad); font-weight: 600; } .unk { color: var(--muted); }

.login { max-width: 360px; margin: 10vh auto; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
