[hidden] { display: none !important; }

:root {
  --brand: #00bebd;
  --brand-hover: #00a5a4;
  --danger: #ff4b4b;
  --page: #f4f5f6;
  --text: #222;
  --secondary: #666;
  --aux: #999;
  --line: #dcdfe6;
  --tag-bg: #e8f8f8;
  color-scheme: light;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--page); }
h1, h2, h3, p, ul, ol, blockquote { margin: 0; }
ul, ol { padding: 0; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
.muted { color: var(--secondary); }
.hint { font-size: 12px; color: var(--aux); margin: 4px 0 14px; }

.topbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 32px; padding: 12px 24px; background: #fff; border-bottom: 1px solid #eee; }
.brand h1 { font-size: 20px; font-weight: 700; color: var(--brand); }
.subtitle { font-size: 12px; color: var(--aux); }
.status { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-left: auto; }
.headline { color: var(--secondary); }
.headline strong { font-size: 28px; color: var(--brand); margin: 0 2px; }
.sub { font-size: 12px; color: var(--aux); }
.login { display: flex; align-items: center; gap: 8px; }
.login label { color: var(--secondary); }

.tabs { display: flex; padding: 0 16px; background: #fff; border-bottom: 1px solid #e5e6eb; }
.tab { display: flex; align-items: center; gap: 6px; padding: 10px 16px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--secondary); cursor: pointer; }
.tab:hover { color: var(--brand); }
.tab.current { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.badge { min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
#message { min-height: 20px; padding: 8px 24px 0; color: var(--secondary); }
#message.error { color: var(--danger); }
#message.ok { color: #27ae60; }

main { max-width: 1200px; margin: 0 auto; padding: 16px 24px 48px; }
.panel { display: grid; gap: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
#pending.cards { grid-template-columns: 1fr; }
.card { padding: 16px; background: #fff; border-radius: 8px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.empty { grid-column: 1 / -1; padding: 48px 16px; text-align: center; color: var(--aux); background: #fff; border-radius: 8px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }

input, select, textarea, button { font: inherit; color: inherit; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  min-height: 36px; padding: 7px 10px; background: #fff; border: 1px solid var(--line); border-radius: 4px;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: 0; }
textarea { width: 100%; min-height: 76px; resize: vertical; }
.btn { min-height: 34px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 4px; background: #fff; cursor: pointer; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn-outline { border-color: var(--brand); color: var(--brand); }
.btn-outline:hover:not(:disabled) { border-color: var(--brand-hover); color: var(--brand-hover); }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-danger:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); background: #fff1f1; }
.btn-sm { min-height: 26px; padding: 2px 10px; font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.form .fields { display: flex; flex-wrap: wrap; gap: 8px; }
.form .fields input { min-width: 300px; }
.form .fields .btn { margin-left: auto; }

.position-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.position-head h3 { display: flex; align-items: center; gap: 8px; }
.funnel { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 0; list-style: none; margin: 12px 0; }
.funnel li { display: flex; align-items: center; }
.funnel li + li::before { content: '→'; margin: 0 10px; color: var(--aux); }
.funnel .step { display: grid; justify-items: center; }
.funnel strong { font-size: 20px; color: var(--brand); }
.funnel span, .funnel small { font-size: 12px; color: var(--secondary); }
.funnel small { font-size: 11px; color: var(--aux); }
.greeting summary { font-size: 12px; color: var(--secondary); cursor: pointer; }
.greeting textarea { min-height: 60px; margin: 8px 0; }

.feed-item { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 8px 0; border-top: 1px solid #f0f1f2; font-size: 13px; }
.feed-item time { margin-left: auto; font-size: 12px; color: var(--aux); }

.position-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.position-tab { padding: 6px 14px; background: #fff; border: 1px solid var(--line); border-radius: 4px; color: var(--secondary); cursor: pointer; }
.position-tab:hover { border-color: var(--brand); color: var(--brand); }
.position-tab.current { background: var(--brand); border-color: var(--brand); color: #fff; }
.actionbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.actionbar .muted { margin-right: auto; }

.candidate { position: relative; display: grid; grid-template-columns: 20px 1fr; gap: 12px; padding-right: 104px; }
.pick { display: flex; align-items: flex-start; padding-top: 4px; }
.pick input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 0; }
.line + .line { margin-top: 4px; }
.line > :not(:first-child)::before { content: '|'; margin: 0 8px; color: #e5e6eb; }
.candidate .name { font-size: 16px; font-weight: 700; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { padding: 1px 8px; border-radius: 3px; background: var(--tag-bg); color: var(--brand); font-size: 12px; white-space: nowrap; }
.quote { margin-top: 8px; padding: 6px 10px; border-left: 3px solid #e5e6eb; border-radius: 0 4px 4px 0; background: #f7f8fa; color: var(--secondary); font-size: 12px; overflow-wrap: anywhere; }
.contact { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.contact strong { font-size: 20px; font-weight: 700; letter-spacing: .5px; color: var(--brand); }
/* The status pill sits top-right, the two small actions bottom-right, over a reserved strip of the card. */
.side { position: absolute; top: 12px; right: 12px; bottom: 12px; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 8px; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 10px; background: #f0f1f2; color: var(--secondary); font-size: 12px; white-space: nowrap; }
.pill-found { color: #8a9099; }
.pill-greeted { background: #e8f1ff; color: #2b6cd4; }
.pill-replied, .pill-pending_review, .pill-pending { background: #fff3e0; color: #e67e22; }
.pill-contacted { background: #e8f8f8; color: var(--brand); font-weight: 700; }
.pill-interviewed, .pill-succeeded { background: #e9f8ee; color: #27ae60; }
.pill-declined, .pill-rejected { background: #eee; color: var(--aux); }
.pill-queued, .pill-running { background: #e8f1ff; color: #2b6cd4; }
.pill-failed { background: #ffeeee; color: var(--danger); }

.pending { display: flex; align-items: stretch; justify-content: space-between; gap: 16px; }
.pending-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.pending-head time { font-size: 12px; color: var(--aux); }
.names { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.names:empty { display: none; }
.names .name { padding: 2px 8px; border-radius: 3px; background: var(--page); color: var(--secondary); }
.preview { padding: 10px 12px; border-left: 3px solid #e5e6eb; border-radius: 0 4px 4px 0; background: #f7f8fa; color: #444; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.pending-actions { display: flex; flex-direction: column; justify-content: center; gap: 8px; }

.accounts { list-style: none; display: grid; gap: 12px; }
.account { display: flex; align-items: center; gap: 12px; }
.avatar { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--tag-bg); color: var(--brand); font-weight: 700; }
.account-body { display: grid; gap: 2px; }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 50%; background: #bbb; }
.dot.on { background: #27ae60; }
.account .actions { margin-left: auto; }
.issued { display: grid; gap: 8px; border: 1px solid var(--brand); }
.issued input { font-family: ui-monospace, Menlo, Consolas, monospace; }
.issued .hint { margin: 0; }

#audits { list-style: none; padding: 0; background: #fff; border-radius: 8px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.audit { display: grid; grid-template-columns: 128px 150px 120px 1fr 56px; gap: 12px; padding: 9px 16px; border-top: 1px solid #f0f1f2; font-size: 13px; overflow-wrap: anywhere; }
.audit:first-child { border-top: 0; }
.audit time { color: var(--aux); font-size: 12px; }
.audit .result { color: #27ae60; }
.audit .result.rejected { color: var(--danger); }

.dialog { width: min(560px, 92vw); padding: 20px 24px; border: 0; border-radius: 8px; box-shadow: 0 8px 30px rgba(0, 0, 0, .18); }
.dialog::backdrop { background: rgba(0, 0, 0, .35); }
.dialog h3 { margin-bottom: 4px; }
.dialog label { color: var(--secondary); }
.dialog textarea { min-height: 110px; margin: 6px 0 10px; }
.dialog .actions { justify-content: flex-end; margin-top: 12px; }
.radios { display: flex; gap: 16px; margin: 8px 0 12px; }
.radios label { display: flex; align-items: center; gap: 6px; color: var(--text); cursor: pointer; }
.radios input { accent-color: var(--brand); }
