* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0a0a12;
  --panel: #111118;
  --panel-2: #1a1a26;
  --line: rgba(255, 255, 255, 0.09);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --faint: #64748b;
  --purple: #c084fc;
  --blue: #60a5fa;
  --green: #4ade80;
  --pink: #f472b6;
  --amber: #fbbf24;
  --red: #f87171;
  --radius: 14px;
}
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--bg) 0%, #111118 50%, #0f0f1a 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  font-size: 15px;
}
[hidden] { display: none !important; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ── Login ── */
.login { max-width: 380px; margin: 14vh auto 0; padding: 32px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; }
.login h1 { font-size: 1.5em; margin-bottom: 4px; }
.login p { color: var(--muted); margin-bottom: 20px; font-size: 0.95em; }

/* ── Shell ── */
.shell { max-width: 1280px; margin: 0 auto; padding: 18px 16px 60px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.top h1 { font-size: 1.45em; letter-spacing: 0.3px; }
.top h1 span { color: var(--muted); font-weight: 300; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pill { font-size: 0.78em; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.ok { color: var(--green); border-color: rgba(74, 222, 128, 0.35); }
.pill.warn { color: var(--amber); border-color: rgba(251, 191, 36, 0.35); }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 20px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 600; font-size: 0.95em; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-bottom-color: var(--purple); }
.tabs .count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--pink); color: #1a0010; font-size: 0.75em; text-align: center; }

/* ── Building blocks ── */
.grid { display: grid; gap: 16px; }
.grid.auto { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.card h2 { font-size: 0.82em; text-transform: uppercase; letter-spacing: 1.4px; color: var(--muted); font-weight: 600; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.card h3 { font-size: 1.05em; margin-bottom: 6px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .n { font-size: 1.9em; font-weight: 700; line-height: 1.1; }
.kpi .n small { font-size: 0.5em; color: var(--muted); font-weight: 400; }
.kpi .l { color: var(--muted); font-size: 0.85em; }
.banner { border: 1px solid rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.06); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner.ok { border-color: rgba(74, 222, 128, 0.35); background: rgba(74, 222, 128, 0.05); }
.list { display: flex; flex-direction: column; }
.row { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.row:first-child { border-top: 0; padding-top: 0; }
.row:hover .title { color: var(--purple); }
.row .main { min-width: 0; flex: 1; }
.row .title { font-weight: 600; overflow-wrap: anywhere; }
.row .sub { color: var(--muted); font-size: 0.88em; overflow-wrap: anywhere; }
.row .side { color: var(--faint); font-size: 0.8em; white-space: nowrap; text-align: right; display: flex; gap: 6px; align-items: center; }
.empty { color: var(--faint); font-size: 0.92em; padding: 6px 0; }
.chip { display: inline-block; font-size: 0.72em; font-weight: 700; letter-spacing: 0.3px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); color: var(--muted); white-space: nowrap; vertical-align: middle; }
.chip.interview_request, .chip.ScheduleInterview, .chip.InterviewScheduled { background: rgba(192, 132, 252, 0.18); color: var(--purple); }
.chip.scheduling, .chip.Assessment, .chip.AwaitingDecision { background: rgba(96, 165, 250, 0.18); color: var(--blue); }
.chip.assessment, .chip.NeedsAnswer, .chip.NeedsApproval, .chip.NeedsYou, .chip.Ready { background: rgba(251, 191, 36, 0.16); color: var(--amber); }
.chip.offer, .chip.Offer, .chip.Submitted { background: rgba(74, 222, 128, 0.2); color: var(--green); }
.chip.recruiter_outreach, .chip.Applying, .chip.Running { background: rgba(244, 114, 182, 0.18); color: var(--pink); }
.chip.rejection, .chip.Denied, .chip.Failed { background: rgba(248, 113, 113, 0.14); color: var(--red); }
.chip.Applied, .chip.Queued, .chip.Preparing { background: rgba(96, 165, 250, 0.12); color: #93c5fd; }
.chip.NoResponse, .chip.Withdrawn, .chip.Cancelled { background: rgba(148, 163, 184, 0.16); color: var(--muted); }
.chip.PracticeDone { background: rgba(192, 132, 252, 0.12); color: var(--purple); }
.chip.reply { background: var(--pink); color: #1a0010; }
.score { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 24px; padding: 0 6px; border-radius: 8px; font-weight: 800; font-size: 0.85em; background: rgba(255, 255, 255, 0.08); }
.score.hi { background: rgba(74, 222, 128, 0.2); color: var(--green); }
.score.mid { background: rgba(251, 191, 36, 0.18); color: var(--amber); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; font-weight: 600; font-size: 0.9em; white-space: nowrap; color: var(--text); }
.btn:hover { border-color: rgba(255, 255, 255, 0.25); text-decoration: none; }
.btn.primary { background: linear-gradient(135deg, #7c3aed, #a855f7); border-color: transparent; color: #fff; }
.btn.good { background: rgba(74, 222, 128, 0.16); border-color: rgba(74, 222, 128, 0.35); color: var(--green); }
.btn.danger { color: var(--red); }
.btn.small { padding: 5px 10px; font-size: 0.82em; border-radius: 8px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

label { display: block; font-size: 0.82em; color: var(--muted); margin: 12px 0 5px; font-weight: 600; }
label.inline { display: inline-flex; gap: 8px; align-items: center; margin: 4px 14px 4px 0; color: var(--text); font-weight: 400; font-size: 0.92em; cursor: pointer; }
input[type='text'], input[type='url'], input[type='email'], input[type='tel'], input[type='password'], input[type='number'], input[type='date'], input[type='time'], select, textarea {
  width: 100%; padding: 9px 11px; background: #0c0c14; border: 1px solid var(--line); border-radius: 10px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: rgba(192, 132, 252, 0.6); }
textarea { resize: vertical; min-height: 80px; line-height: 1.45; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 12px; }
.hint { color: var(--faint); font-size: 0.82em; margin-top: 4px; }
.error { color: var(--red); font-size: 0.9em; margin-top: 10px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.chipbtn { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 0.85em; color: var(--muted); }
.chipbtn.on { color: var(--text); border-color: var(--purple); background: rgba(192, 132, 252, 0.12); }

/* ── Needs you ── */
.ask { border: 1px solid rgba(251, 191, 36, 0.3); background: rgba(251, 191, 36, 0.04); border-radius: 12px; padding: 14px; }
.ask + .ask { margin-top: 12px; }
.ask .head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; margin-bottom: 4px; }
.ask .head strong { font-size: 1.02em; }
.ask .q { margin-top: 12px; }
.ask .q > .qlabel { font-weight: 600; font-size: 0.95em; }
.ask .note { color: var(--muted); font-size: 0.88em; margin-top: 4px; }
.ask .opts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }

/* ── Runs ── */
.timeline { list-style: none; }
.timeline li { padding: 8px 0 8px 14px; border-left: 2px solid var(--line); position: relative; font-size: 0.9em; }
.timeline li::before { content: ''; position: absolute; left: -5px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.timeline li.step::before { background: var(--purple); }
.timeline li.warn::before { background: var(--amber); }
.timeline li.error::before { background: var(--red); }
.timeline .when { color: var(--faint); font-size: 0.8em; margin-right: 6px; }
.thumb { display: block; margin-top: 6px; width: 100%; max-width: 420px; height: 220px; object-fit: cover; object-position: top; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }
.kv { width: 100%; border-collapse: collapse; font-size: 0.86em; }
.kv td { padding: 6px; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.kv td:first-child { color: var(--muted); width: 45%; }

/* ── Tailor ── */
.tailor-result { margin-top: 18px; }
.previews { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.preview { background: #2a2a35; border-radius: 10px; overflow: hidden; position: relative; }
.preview iframe { border: 0; width: 816px; height: 1056px; transform-origin: 0 0; background: #fff; display: block; }
.flags { border: 1px solid rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.07); border-radius: 12px; padding: 14px; margin-bottom: 16px; }
.flags.clear { border-color: rgba(74, 222, 128, 0.35); background: rgba(74, 222, 128, 0.06); }
.flags li { margin: 6px 0 0 18px; font-size: 0.92em; }
.flags .ctx { color: var(--muted); }
.answers .qa { padding: 10px 0; border-top: 1px solid var(--line); }
.answers .qa:first-child { border-top: 0; }
.notes ul { margin-left: 18px; font-size: 0.92em; }
.notes h4 { font-size: 0.8em; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 10px 0 4px; }
.busy { display: flex; gap: 10px; align-items: center; color: var(--muted); margin-top: 14px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.15); border-top-color: var(--purple); animation: spin 0.9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Drawer ── */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--panel); border-left: 1px solid var(--line); z-index: 50; overflow-y: auto; padding: 20px 18px 40px; }
.drawer .close { float: right; }
.drawer h2 { font-size: 1.25em; margin: 4px 40px 2px 0; overflow-wrap: anywhere; }
.drawer .sub { color: var(--muted); margin-bottom: 12px; overflow-wrap: anywhere; }
.drawer section { margin-top: 18px; }
.drawer section > h3 { font-size: 0.8em; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); margin-bottom: 8px; }
.pre { white-space: pre-wrap; font-size: 0.9em; color: var(--text); background: #0c0c14; border: 1px solid var(--line); border-radius: 10px; padding: 12px; max-height: 360px; overflow-y: auto; overflow-wrap: anywhere; }

table { width: 100%; border-collapse: collapse; font-size: 0.88em; }
th, td { text-align: left; padding: 7px 6px; border-top: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; border-top: 0; }
.table-wrap { overflow-x: auto; }

.devicecode, .token { font-size: 1.15em; font-weight: 800; letter-spacing: 1px; color: var(--purple); margin: 6px 0; overflow-wrap: anywhere; }
.devicecode { font-size: 1.6em; letter-spacing: 3px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #1f1f2e; border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; z-index: 60; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.toast.bad { border-color: rgba(248, 113, 113, 0.5); color: #fecaca; }

@media (max-width: 760px) { .grid.two, .grid.auto { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  body { font-size: 14px; }
  .shell { padding: 12px 16px 50px; }
  .card { padding: 14px; }
  .kpi .n { font-size: 1.5em; }
  .row { flex-wrap: wrap; }
  .row .side { text-align: left; }
}
