:root {
  --navy: #213343;
  --navy-2: #2d3e50;
  --ink: #33475b;
  --ink-2: #516f90;
  --muted: #7c98b6;
  --line: #cbd6e2;
  --line-2: #dfe3eb;
  --bg: #f5f8fa;
  --panel: #ffffff;
  --orange: #ff5c35;
  --orange-2: #e8471f;
  --teal: #0091ae;
  --teal-bg: #e5f5f8;
  --green: #00a4bd;
  --ok: #00875a;
  --ok-bg: #e3f6ee;
  --warn: #b36b00;
  --warn-bg: #fef3e0;
  --bad: #d93f4c;
  --bad-bg: #fde8ea;
  --shadow: 0 1px 3px rgba(45, 62, 80, .12);
  --radius: 4px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Lexend Deca', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', system-ui, sans-serif; font-weight: 300; font-size: 14px; color: var(--ink); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--teal); text-decoration: none; font-weight: 400; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-weight: 500; margin: 0; color: var(--ink); }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
.muted { color: var(--ink-2); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }

/* ---------- buttons and inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 3px; border: 1px solid var(--line); background: #eaf0f6; color: var(--ink-2); font-weight: 400; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: #dfe8f1; }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.primary:hover { background: var(--orange-2); border-color: var(--orange-2); }
.btn.secondary { background: #fff; border-color: var(--orange); color: var(--orange); }
.btn.secondary:hover { background: #fff1ee; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--teal); padding: 0 8px; }
.btn.small { height: 30px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 3px; background: #f5f8fa; width: 100%; transition: border-color .15s, box-shadow .15s, background .15s; }
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); background: #fff; box-shadow: 0 0 4px 1px rgba(0, 208, 228, .3); }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 400; font-size: 13px; margin-bottom: 6px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 480px) 1fr; background: #fff; }
.login-form { padding: 56px 48px; display: flex; flex-direction: column; justify-content: center; }
.login-form .brand { margin-bottom: 40px; }
.login-form h1 { font-size: 28px; margin-bottom: 8px; }
.login-form p { margin: 0 0 28px; color: var(--ink-2); }
.login-form .btn { width: 100%; height: 42px; margin-top: 6px; }
.login-form .err { color: var(--bad); min-height: 22px; margin-top: 10px; }
.login-photo { position: relative; background: #d9dee3 url(img/bess.jpg) center / cover no-repeat; overflow: hidden; }
.login-photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(33, 51, 67, 0) 45%, rgba(33, 51, 67, .82)); }
.login-photo .cap { position: absolute; left: 48px; right: 48px; bottom: 44px; color: #fff; z-index: 1; animation: rise .9s ease both .15s; }
.login-photo .cap b { display: block; font-size: 30px; font-weight: 500; line-height: 1.25; margin-bottom: 10px; max-width: 620px; }
.login-photo .credit { position: absolute; right: 12px; top: 10px; font-size: 11px; color: rgba(255, 255, 255, .8); z-index: 1; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; letter-spacing: .2px; color: var(--navy); }
.brand .mark { width: 30px; height: 30px; border-radius: 7px; background: var(--navy); display: grid; place-items: center; }
.brand .mark svg { width: 18px; height: 18px; }
.brand small { font-weight: 300; color: var(--ink-2); font-size: 13px; }

/* ---------- shell ---------- */
.top { position: sticky; top: 0; z-index: 20; height: 56px; background: var(--navy); color: #fff; display: flex; align-items: center; padding: 0 20px; gap: 26px; box-shadow: 0 1px 0 rgba(0,0,0,.2); }
.top .brand { color: #fff; font-size: 15px; }
.top .brand .mark { background: #fff; }
.top nav { display: flex; gap: 2px; height: 100%; overflow-x: auto; scrollbar-width: none; }
.top nav a { color: #fff; font-weight: 400; display: flex; align-items: center; padding: 0 14px; height: 100%; border-bottom: 3px solid transparent; opacity: .85; white-space: nowrap; }
.top nav a:hover { text-decoration: none; background: rgba(255,255,255,.06); opacity: 1; }
.top nav a.on { border-bottom-color: var(--orange); opacity: 1; }
.top .right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.top .right a.n8n { color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 3px; padding: 5px 12px; font-size: 13px; white-space: nowrap; }
.top .right a.n8n:hover { background: rgba(255,255,255,.1); text-decoration: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; font-weight: 500; font-size: 13px; cursor: pointer; border: 0; }
.menu { position: absolute; right: 16px; top: 52px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 4px 16px rgba(45,62,80,.18); min-width: 220px; padding: 8px 0; display: none; }
.menu.open { display: block; }
.menu div { padding: 8px 16px; }
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 16px; cursor: pointer; }
.menu button:hover { background: var(--bg); }
main { max-width: 1440px; margin: 0 auto; padding: 24px 24px 64px; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.pagehead p { margin: 4px 0 0; color: var(--ink-2); }
.panel { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel > header { padding: 14px 18px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel > .body { padding: 16px 18px; }
.grid { display: grid; gap: 20px; }
.fade { animation: fadein .35s ease both; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi { padding: 18px; }
.kpi .label { color: var(--ink-2); font-size: 13px; }
.kpi .num { font-size: 32px; font-weight: 500; color: var(--navy); line-height: 1.2; margin-top: 4px; }
.kpi .sub { font-size: 12px; color: var(--muted); }
.kpi a { display: block; color: inherit; }
.kpi a:hover { text-decoration: none; }
.kpi:hover { border-color: var(--line); }
.dash { grid-template-columns: 2fr 1fr; align-items: start; }
.dash > .grid { align-content: start; }
.funnel { display: grid; gap: 10px; }
.funnel .row { display: grid; grid-template-columns: 120px 1fr 44px; align-items: center; gap: 12px; }
.funnel .bar { height: 26px; background: #eaf0f6; border-radius: 3px; overflow: hidden; }
.funnel .bar i { display: block; height: 100%; background: linear-gradient(90deg, #ff8f73, var(--orange)); width: 0; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.funnel .row.dim .bar i { background: #b0c1d4; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 10px 0; border-bottom: 1px solid var(--line-2); display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; }
.feed li:last-child { border-bottom: 0; }
.feed .who { font-weight: 400; }
.split3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 12px; background: #eaf0f6; font-size: 12px; }
.chip b { font-weight: 500; }

/* ---------- tables ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line-2); align-items: center; }
.toolbar input[type=search] { max-width: 280px; }
.toolbar select { width: auto; min-width: 130px; }
/* "volume customers only": a switch next to the type filter */
.volsw { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 3px; background: #fff; font-size: 13px; cursor: pointer; white-space: nowrap; }
.volsw input { width: auto; margin: 0; }
.volsw.on { border-color: var(--teal); color: var(--teal); background: #e5f5f8; }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink); background: #f5f8fa; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr.click { cursor: pointer; transition: background .12s; }
tr.click:hover td { background: #f5f8fa; }
.co { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.co b { font-weight: 500; color: var(--teal); }
.logo { width: 36px; height: 36px; border-radius: 4px; border: 1px solid var(--line-2); background: #fff; display: grid; place-items: center; overflow: hidden; flex: none; font-weight: 500; color: #fff; font-size: 13px; }
.logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.logo.big { width: 64px; height: 64px; font-size: 22px; border-radius: 6px; }
.tier { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 600; font-size: 12px; }
.tier.A { background: #ffe1d9; color: #b3290a; }
.tier.B { background: var(--teal-bg); color: #00657a; }
.tier.C { background: #eaf0f6; color: var(--ink-2); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 3px; font-size: 12px; font-weight: 400; white-space: nowrap; background: #eaf0f6; color: var(--ink-2); }
.tag.draft_ready { background: var(--ok-bg); color: var(--ok); }
.tag.needs_review { background: var(--warn-bg); color: var(--warn); }
.tag.approved { background: var(--teal-bg); color: #00657a; }
.tag.sent, .tag.replied { background: #ede7fb; color: #5c3fb5; }
.tag.qualified { background: #ffe1d9; color: #b3290a; }
.tag.disqualified { background: #f1f1f1; color: #888; }
.tag.rewriting, .tag.running { background: #fff7d6; color: #8a6d00; }
.tag.finished { background: var(--ok-bg); color: var(--ok); }
.tag.failed { background: var(--bad-bg); color: var(--bad); }
.score { font-variant-numeric: tabular-nums; }
.empty { padding: 48px 20px; text-align: center; color: var(--ink-2); }

/* ---------- record page ---------- */
.record { display: grid; grid-template-columns: 300px minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.side .panel + .panel { margin-top: 16px; }
.idcard { padding: 20px 18px; text-align: center; }
.idcard .logo { margin: 0 auto 12px; }
.idcard h1 { font-size: 20px; line-height: 1.3; }
.idcard .dom { margin-top: 4px; }
.idcard .row { display: flex; justify-content: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.props { padding: 6px 18px 14px; }
.prop { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.prop:last-child { border-bottom: 0; }
.prop .k { font-size: 12px; color: var(--ink-2); }
.prop .v { font-weight: 400; word-break: break-word; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); padding: 0 12px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 14px 14px 11px; cursor: pointer; font-weight: 400; color: var(--ink-2); white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }
.tabbody { padding: 18px; }
.subject { font-weight: 500; }
.emailmeta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.checks li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: start; font-size: 13px; }
.checks .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--ok); }
.checks li.no .dot { background: var(--bad); }
.checks li.no .d { color: var(--bad); }
.checks .n { font-weight: 400; }
.checks .d { color: var(--ink-2); font-size: 12px; display: block; }
.facts { margin: 0; padding: 0 0 0 18px; }
.facts li { margin-bottom: 6px; }
.fitbars .r { display: grid; grid-template-columns: 1fr 40px; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line-2); }
.trace { list-style: none; margin: 0; padding: 0; position: relative; }
.trace li { position: relative; padding: 0 0 16px 26px; }
.trace li::before { content: ''; position: absolute; left: 6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--teal); }
.trace li::after { content: ''; position: absolute; left: 10px; top: 18px; bottom: 0; width: 2px; background: var(--line-2); }
.trace li:last-child::after { display: none; }
.trace .nd { font-weight: 500; }
.attempt { border: 1px solid var(--line-2); border-radius: 4px; margin-top: 12px; }
.attempt > summary { padding: 10px 14px; cursor: pointer; font-weight: 400; }
.attempt pre, .mailbody { white-space: pre-wrap; font-family: inherit; margin: 0; padding: 12px 14px; background: #fbfcfd; border-top: 1px solid var(--line-2); font-size: 13px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 12px 0 12px 16px; border-left: 2px solid var(--line-2); margin-left: 6px; position: relative; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 17px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--muted); }
.timeline li.note::before { border-color: var(--orange); }
.timeline li.email::before { border-color: var(--teal); }
.timeline .when { font-size: 12px; color: var(--muted); }
.card { padding: 14px 18px; }
.card + .card { border-top: 1px solid var(--line-2); }
.card .t { font-weight: 500; }
.stage-select { width: auto; height: 32px; }
.banner { padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; background: var(--warn-bg); color: #6b4200; border: 1px solid #f5d9a8; }
.banner.info { background: var(--teal-bg); color: #00566a; border-color: #b0e0ea; }

/* ---------- pipeline board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(160px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 12px; }
.col { background: #eaf0f6; border-radius: 4px; display: flex; flex-direction: column; min-height: 400px; }
.col > h3 { padding: 12px 14px; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; display: flex; justify-content: space-between; }
.col .cards { padding: 0 10px 12px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.col.over { outline: 2px dashed var(--teal); outline-offset: -4px; }
.dcard { background: #fff; border: 1px solid var(--line-2); border-radius: 4px; padding: 12px; cursor: grab; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.dcard:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(45,62,80,.14); }
.dcard.dragging { opacity: .5; }
.dcard .co { min-width: 0; gap: 8px; }
.dcard .co b { font-size: 13px; line-height: 1.3; display: block; overflow-wrap: anywhere; }
.dcard .logo { width: 30px; height: 30px; }
.col > h3 { font-size: 12px; }
.dcard .meta { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12px; color: var(--ink-2); }

/* ---------- settings ---------- */
.seg-opts, .crm-opts { display: flex; flex-wrap: wrap; gap: 10px; }
.opt { border: 1px solid var(--line); border-radius: 4px; padding: 10px 14px; display: flex; gap: 10px; align-items: flex-start; cursor: pointer; background: #fff; min-width: 180px; flex: 1; }
.opt input { margin-top: 4px; accent-color: var(--orange); }
.opt.on { border-color: var(--orange); background: #fff8f6; }
.opt b { font-weight: 500; display: block; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: #eaf0f6; padding: 1px 5px; border-radius: 3px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 4px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 50; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.bad { background: var(--bad); }
.spin { width: 16px; height: 16px; border: 2px solid rgba(0,0,0,.15); border-top-color: var(--orange); border-radius: 50%; animation: sp 0.8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes sp { to { transform: rotate(360deg); } }
.skeleton { height: 14px; background: linear-gradient(90deg, #eef2f6, #f8fafc, #eef2f6); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 3px; margin: 10px 0; }
@keyframes sk { to { background-position: -200% 0; } }

@media (max-width: 1560px) {
  .record { grid-template-columns: 280px minmax(0, 1fr); }
  .record > .side.right { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
  .record > .side.right .panel + .panel { margin-top: 0; }
}
@media (max-width: 1200px) {
  .record { grid-template-columns: 280px minmax(0, 1fr); }
  .record > .side.right { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
  .record > .side.right .panel + .panel { margin-top: 0; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-photo { min-height: 220px; order: -1; }
  .login-photo .cap { left: 20px; right: 20px; bottom: 18px; }
  .login-photo .cap b { font-size: 20px; }
  .login-form { padding: 32px 16px; }
  main { padding: 16px 16px 48px; }
  .top { padding: 0 12px; gap: 12px; }
  .top .brand span.t { display: none; }
  .top .right a.n8n { display: none; }
  .dash, .split3, .record { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .checks { grid-template-columns: 1fr; }
  .funnel .row { grid-template-columns: 96px 1fr 36px; }
  .toolbar input[type=search] { max-width: none; }
}

/* ---------- prospect desk 2 ---------- */
.linesw { height: 30px; width: auto; max-width: 190px; background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.35); font-size: 13px; padding: 0 8px; }
.linesw option { color: var(--ink); background: #fff; }
.linesw:focus { background: rgba(255,255,255,.14); }
.split2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.split2 > *, .split3 > *, .grid > *, .dash > * { min-width: 0; }
.top nav a { padding: 0 11px; font-size: 13.5px; }
@media (max-width: 1520px) { .top .brand span.t { display: none; } .top { gap: 16px; } }
tr.dim td { opacity: .55; }
.vs { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; white-space: nowrap; background: #eaf0f6; color: var(--ink-2); }
.vs.verified { background: var(--ok-bg); color: var(--ok); }
.vs.risky { background: var(--warn-bg); color: var(--warn); }
.vs.invalid { background: var(--bad-bg); color: var(--bad); }
.mail { overflow-wrap: anywhere; }
.why { margin: 6px 0 0; padding-left: 16px; font-size: 12px; color: var(--ink-2); }
.why li { margin-bottom: 2px; }
.card.best { background: #fbfdfe; box-shadow: inset 3px 0 0 var(--teal); }
.bestmark { color: var(--teal); font-weight: 400; }
.idcard .ctl { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 8px; margin-top: 10px; text-align: left; }
.idcard .ctl select { height: 32px; }
.checks li.warn .dot { background: #f5a623; }
.checks li.na .dot { background: #b0c1d4; }
.checks.rules { margin-bottom: 4px; }
.chip.cat, .tag.cat { border: 0; cursor: pointer; }
.cat.interested { background: #ffe1d9; color: #b3290a; }
.cat.question { background: var(--teal-bg); color: #00657a; }
.cat.not_now, .cat.out_of_office { background: #eaf0f6; color: var(--ink-2); }
.cat.wrong_person { background: #ede7fb; color: #5c3fb5; }
.cat.unsubscribe, .cat.bounce { background: var(--bad-bg); color: var(--bad); }
.cat.sorting { background: #fff7d6; color: #8a6d00; }
a.chip:hover { text-decoration: none; filter: brightness(.97); }
.replylist { padding: 6px 12px 12px; }
.reply { border: 1px solid var(--line-2); border-radius: 4px; margin-top: 10px; background: #fff; }
.reply > summary { list-style: none; cursor: pointer; padding: 12px 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.reply > summary::-webkit-details-marker { display: none; }
.reply .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply .rbody { padding: 0 14px 14px; border-top: 1px solid var(--line-2); }
.reply .mailbody { border: 1px solid var(--line-2); border-radius: 4px; margin-top: 10px; max-height: 260px; overflow: auto; }
.subnav { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.subnav a { padding: 7px 14px; border-radius: 16px; background: #eaf0f6; color: var(--ink-2); }
.subnav a.on { background: var(--navy); color: #fff; }
.subnav a:hover { text-decoration: none; }
.lines { display: grid; gap: 12px; }
.line > summary { list-style: none; cursor: pointer; padding: 14px 18px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.line > summary::-webkit-details-marker { display: none; }
.line > summary b { font-weight: 500; font-size: 15px; }
.line.off > summary { opacity: .6; }
.line[open] > summary { border-bottom: 1px solid var(--line-2); }
.picks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.picks .opt { min-width: 0; flex: none; padding: 6px 10px; }
tr.edit td { background: #fbfcfd; }
.cpick { margin-top: 14px; border-top: 1px solid var(--line-2); padding-top: 12px; }
.cpick [hidden] { display: none !important; }
.cph { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cph .csearch { max-width: 240px; padding: 6px 10px; }
.chint { margin: 6px 0 4px; }
.cgrp { margin-top: 10px; }
.cgh { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.cl { display: flex; flex-wrap: wrap; gap: 6px; }
.copt { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 4px; background: #fff; font-size: 13px; cursor: pointer; }
.copt input { accent-color: var(--orange); margin: 0; }
.copt.on { border-color: var(--orange); background: #fff8f6; }
.copt.taken { background: #f3f5f7; color: #8a99a8; cursor: not-allowed; }
.copt .taken { font-style: normal; font-size: 11px; color: #8a99a8; }
.copt .taken:empty { display: none; }
.modal { position: fixed; inset: 0; background: rgba(33,51,67,.45); display: flex; align-items: flex-start; justify-content: center; z-index: 50; overflow-y: auto; padding: 60px 16px; }
.mbox { background: #fff; border-radius: 8px; padding: 22px 24px; width: min(620px, 100%); box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.mbox h2 { margin: 0 0 8px; font-size: 18px; }
.mbox .field { margin-top: 10px; }
.mbox textarea { width: 100%; }
.mbox .field input[name=next_owner], .mbox .field input[name=evidence_link], .mbox .field input[name=source], .mbox .field input[name=other], .mbox .field input[inputmode=numeric] { width: 100%; }
.mbox .actions { margin-top: 16px; }
.sboard .cards .more { display: block; text-align: center; padding: 8px 0 2px; }
.ssteps { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.sstep { border: 1px solid var(--line-2); border-radius: 4px; padding: 6px 6px; background: #fff; text-align: center; font-size: 11.5px; color: var(--ink-2); }
.sstep b { display: block; font-size: 13px; color: var(--ink); }
.sstep.done { background: #eef7f2; border-color: #b9e0c9; }
.sstep.on { background: #fff1ee; border-color: var(--orange); }
@media (max-width: 900px) { .ssteps { grid-template-columns: repeat(4, 1fr); } }
.cmrow { display: grid; grid-template-columns: 140px 1fr 280px; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-2); }
.cmrow .picks { margin-top: 0; }
#cmrows { margin-top: 14px; }
@media (max-width: 900px) { .cmrow { grid-template-columns: 1fr; } }
.mapgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 16px; }
.calc { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.calcout { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 4px 0 10px; }
.calcout > div { background: #f5f8fa; border-radius: 4px; padding: 14px 16px; }
.calcout .big { display: block; font-size: 30px; font-weight: 500; color: var(--navy); line-height: 1.2; }
table.warm td, table.warm th { text-align: center; }
table.warm td:first-child, table.warm th:first-child { text-align: left; }
.mblist { display: grid; gap: 0; }
.mb { padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.mbhead { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.mbctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mbctl select { height: 30px; }
@media (max-width: 860px) {
  .split2, .calc, .calcout { grid-template-columns: 1fr; }
  .linesw { max-width: 120px; }
  .reply > summary { grid-template-columns: 1fr; }
}

/* ---------- combined layout: left sidebar like the ZVEPOW workspace ---------- */
.layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.layout > main { max-width: 1400px; width: 100%; margin: 0; padding: 24px 28px 64px; }
.side-nav { background: #fff; border-right: 1px solid var(--line-2); padding: 12px 10px 40px; position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: var(--ink); font-size: 13.5px; font-weight: 400; line-height: 1.3; }
.side-nav a svg { width: 18px; height: 18px; flex: none; color: var(--ink-2); }
.side-nav a:hover { background: var(--bg); text-decoration: none; }
.side-nav a.on { background: #fff1ee; color: var(--orange-2); font-weight: 500; }
.side-nav a.on svg { color: var(--orange); }
.side-nav .sgrp { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 16px 10px 6px; }
.side-nav .sind { font-size: 12px; color: var(--ink-2); margin: 4px 10px 2px; font-weight: 500; }
.side-nav a.ws { padding: 6px 10px 6px 18px; font-size: 13px; }
.side-nav .sindg > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-radius: 6px; border: 1px solid #ffd2c4; background: #fff8f6; color: var(--orange-2); margin: 4px 0 2px; }
.side-nav .sindg > summary::-webkit-details-marker { display: none; }
.side-nav .sindg > summary::after { content: '▾'; margin-left: 6px; color: var(--muted); }
.side-nav .sindg:not([open]) > summary::after { content: '▸'; }
.side-nav .sindg .cnt { margin-left: auto; font-size: 11px; background: #fff; border-radius: 9px; padding: 0 7px; color: var(--ink-2); }
.side-nav .sempty { font-size: 12px; color: var(--muted); padding: 4px 18px; }
.side-nav .sreserve { margin: 10px 2px 0; border: 1px dashed #b0c1d4; border-radius: 6px; padding: 8px 10px; display: grid; gap: 4px; }
.side-nav .sreserve .small { line-height: 1.4; }
.side-nav a.sadd { padding: 2px 0; font-size: 12.5px; color: var(--teal); }
.sbtn { display: none; background: none; border: 0; color: #fff; font-size: 20px; cursor: pointer; padding: 0 6px; }
.tag.st-live { background: var(--ok-bg); color: var(--ok); }
.tag.st-p1 { background: #eaf0f6; color: #516f90; }
.tag.st-p2 { background: #fff2dc; color: #8a5300; }
.tag.st-bad { background: var(--bad-bg); color: var(--bad); }
.v40sum { display: flex; gap: 16px; flex-wrap: wrap; align-items: baseline; padding: 10px 14px; margin-bottom: 10px; background: #f5f8fa; border: 1px solid #e5ebf0; border-radius: 4px; font-size: 13px; }
.v40sum b { font-size: 16px; margin-right: 3px; }
table.v40 { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
table.v40 td { padding: 8px 8px 8px 0; border-bottom: 1px solid #eef2f5; vertical-align: top; overflow-wrap: anywhere; }
table.v40 td.fk { width: 30%; color: #516f90; }
table.v40 td.fv { width: 34%; }
table.v40 td.fe { width: 28%; }
table.v40 td.fx { width: 8%; text-align: right; padding-right: 0; }
table.v40 .no { display: inline-block; min-width: 22px; color: #99acc2; font-size: 11px; }
.tag.req { background: #fff2dc; color: #8a5300; font-size: 11px; padding: 0 5px; }
.tag.fs-official { background: var(--ok-bg); color: var(--ok); }
.tag.fs-cross { background: var(--teal-bg); color: #00566a; }
.tag.fs-pending { background: #fff2dc; color: #8a5300; }
.tag.fs-conflict { background: var(--bad-bg); color: var(--bad); }
@media (max-width: 700px) { table.v40 td.fk, table.v40 td.fv, table.v40 td.fe, table.v40 td.fx { display: block; width: auto; border: 0; padding: 2px 0; } table.v40 tr { display: block; border-bottom: 1px solid #eef2f5; padding: 6px 0; } }
.dcard .nx { margin-top: 6px; font-size: 12px; color: var(--muted, #516f90); }
.dcard .nx.late { color: var(--bad); }
/* the opportunity board fits one screen: each column scrolls on its own, cards are compact */
.sboard { grid-auto-columns: minmax(138px, 1fr); align-items: stretch; overflow-y: hidden; }
.sboard .col { min-height: 0; }
.sboard .col > h3 { padding: 10px 10px; }
.sboard .col .cards { overflow-y: auto; min-height: 0; gap: 6px; padding: 0 6px 8px; }
.sboard .dcard { padding: 8px; }
.sboard .dcard .logo { display: none; } /* the name needs the width more than the logo does */
.sboard .dcard .co { align-items: flex-start; }
.sboard .dcard .co > div { min-width: 0; flex: 1; }
.sboard .dcard .co b { font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sboard .dcard .meta { margin-top: 4px; font-size: 11px; align-items: center; gap: 4px; }
.sboard .dcard .ctry { display: flex; justify-content: space-between; align-items: center; gap: 4px; margin-top: 2px; }
.sboard .dcard .meta span { overflow-wrap: anywhere; }
.sboard .dcard .nx { font-size: 11px; margin-top: 4px; }
.grade { display: inline-block; flex: none; padding: 0 6px; border-radius: 9px; font-size: 11px; font-weight: 600; line-height: 18px; }
.grade.gA { background: var(--ok-bg); color: var(--ok); }
.grade.gB { background: var(--teal-bg); color: #00566a; }
.grade.gC { background: #fff2dc; color: #8a5300; }
.snav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 10px; }
.snav select, .snav input[type=search] { width: auto; min-width: 120px; padding: 6px 8px; font-size: 13px; }
.snav input[type=search] { min-width: 180px; }
.gchips { display: flex; gap: 6px; flex-wrap: wrap; margin-right: 6px; }
.gchips a { padding: 5px 12px; border-radius: 16px; background: #eaf0f6; color: var(--ink-2); font-size: 13px; }
.gchips a b { font-weight: 600; }
.gchips a.on { background: var(--navy); color: #fff; }
.gchips a:hover { text-decoration: none; }
table.cgrades td.num, table.cgrades th.num { text-align: right; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line-2); }
.pager .pages { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
/* on a phone the email-quality table becomes one card per company, so addresses are not squeezed into a thin column */
@media (max-width: 700px) {
  table.mcards { min-width: 0; }
  table.mcards thead { display: none; }
  table.mcards, table.mcards tbody, table.mcards tr, table.mcards td { display: block; width: auto; }
  table.mcards tr { padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
  table.mcards td { border: 0; padding: 2px 0; overflow-wrap: anywhere; word-break: break-word; }
  table.mcards td.mc-type { display: inline; font-size: 12px; font-weight: 500; }
  table.mcards td.mc-type + td.mc-line::before { content: ' · '; }
  table.mcards td.mc-line { display: inline; color: var(--ink-2); font-size: 12px; }
  table.mcards td.mc-owner { display: inline; color: var(--ink-2); font-size: 12px; }
  table.mcards td.mc-owner:not(:empty)::before { content: ' · '; }
  table.mcards td.mail { margin-top: 6px; overflow-wrap: anywhere; word-break: normal; }
}
table.cgrades tr.sum td { background: #f5f8fa; }
.sboard-sum { display: flex; gap: 18px; flex-wrap: wrap; margin: 0 0 12px; font-size: 13px; }
.sboard-sum b { font-size: 15px; }
.modal .sgroup { margin: 14px 0 4px; font-size: 13px; font-weight: 600; }
.modal .kinds { display: flex; gap: 18px; flex-wrap: wrap; margin: 6px 0 12px; }
.modal .kinds label { display: flex; gap: 6px; align-items: flex-start; max-width: 260px; font-size: 13px; }
.agents { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.agent { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; border-top: 3px solid var(--line); }
.agent.live { border-top-color: var(--ok); } .agent.p1 { border-top-color: #7c98b6; } .agent.p2 { border-top-color: #e8a33d; }
.agent .ah, .region .ah { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.agent .ano { font-size: 11px; letter-spacing: .5px; color: var(--muted); }
.agent h3 { font-size: 16px; }
.agent p { margin: 0; }
.aout { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: var(--bg); border-radius: 4px; padding: 8px 10px; }
.aout b { display: block; font-weight: 500; font-size: 15px; }
.regions { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.region { padding: 16px 18px; display: grid; gap: 10px; }
.region.ru { border: 1px dashed #b0c1d4; } .region.ru.off { opacity: .7; }
.bilingual { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 6px; }
.bl-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.zhtag { background: #fff2dc; color: #8a5300; }
.zhbox { white-space: pre-wrap; border: 1px dashed #e8c48a; background: #fffaf2; border-radius: 3px; padding: 10px 12px; font-size: 14px; line-height: 1.7; min-height: 360px; max-height: 470px; overflow: auto; }
.indh { margin: 22px 0 10px; font-size: 18px; }
@media (max-width: 1100px) { .bilingual { grid-template-columns: 1fr; } .zhbox { min-height: 0; } }
@media (max-width: 860px) {
  /* the content never grows wider than the phone screen (1fr alone grows to the widest item and the edge was cut off) */
  .layout { grid-template-columns: minmax(0, 1fr); }
  .split2 { grid-template-columns: 1fr; }
  .btn { white-space: normal; max-width: 100%; height: auto; min-height: 32px; }
  .side-nav { position: fixed; top: 56px; left: 0; bottom: 0; width: 260px; z-index: 30; transform: translateX(-100%); transition: transform .2s; height: auto; box-shadow: 0 4px 16px rgba(45,62,80,.18); }
  .side-nav.open { transform: none; }
  .sbtn { display: block; }
  .layout > main { padding: 16px 16px 48px; }
  .aout { grid-template-columns: 1fr; }
}

.fu { display: inline-block; padding: 2px 9px; border-radius: 3px; font-size: 12px; white-space: nowrap; background: #eaf0f6; color: var(--ink-2); }
.fu.approve, .fu.tosend { background: var(--teal-bg); color: #00657a; }
.fu.review, .fu.noemail, .fu.writing { background: var(--warn-bg); color: var(--warn); }
.fu.waiting { background: #ede7fb; color: #5c3fb5; }
.fu.replied, .fu.won { background: #ffe1d9; color: #b3290a; }
.fu.excluded { background: #f1f1f1; color: #888; }
.btype { font-weight: 400; white-space: nowrap; }

.sched { margin-top: 18px; border: 1px solid var(--line-2); border-radius: 6px; padding: 14px 16px; background: #fbfdfe; }
.sched .sh { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.reviewbox { margin-top: 18px; border: 1px solid #ffb9a6; border-radius: 6px; padding: 14px 16px; background: #fff8f6; }
.reviewbox .sh { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.reviewbox h3 { margin: 0; }
.reviewbox textarea { width: 100%; }
.sgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 10px; }
.sgrid > div { display: grid; gap: 2px; background: #fff; border: 1px solid var(--line-2); border-radius: 4px; padding: 10px 12px; }
.sgrid b { font-size: 16px; font-weight: 500; color: var(--navy); }
.profile-zh { border-top: 3px solid #e8a33d; }
.profile-zh .chips { gap: 6px; }
.profile-zh .chip { background: #fff2dc; color: #6b4200; }
@media (max-width: 860px) { .sgrid { grid-template-columns: 1fr; } }

.clegend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.wreg { padding: 12px 0; border-top: 1px solid var(--line-2); }
.wreg .wh { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.wc { display: flex; flex-wrap: wrap; gap: 6px; }
.cchip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 12px; font-size: 12.5px; background: #eaf0f6; color: var(--ink); border: 1px solid transparent; }
.cchip b { font-weight: 600; font-size: 11px; background: #fff; border-radius: 8px; padding: 0 5px; color: var(--teal); }
.cchip.first { background: #fff1ee; border-color: #ffb9a6; color: #b3290a; }
.cchip.base { background: #f1f1f1; color: #888; }
.cchip.sanc { background: #fff; color: #aaa; border-color: #ddd; text-decoration: line-through; }
.cchip.ru { background: #fff; border: 1px dashed #b0c1d4; color: var(--ink-2); }
.cchip.ru.open { border-color: #7c98b6; color: var(--ink); }

.sentn { font-size: 16px; color: var(--navy); } .sentn.zero { color: var(--muted); }
.prodgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.prod.off { opacity: .6; }
.pk { font-size: 12px; color: var(--ink-2); margin: 10px 0 4px; }
.prod .pk:first-child { margin-top: 0; }

.side-nav a.rsv { color: var(--ink-2); }
.side-nav a.rsv em { margin-left: auto; font-style: normal; font-size: 10.5px; border: 1px dashed #b0c1d4; border-radius: 8px; padding: 0 6px; color: var(--muted); }
.flowline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.fstep { background: #eaf0f6; border-radius: 4px; padding: 6px 10px; font-size: 13px; }
.farr { color: var(--muted); }

.provgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; }
.prov > header { align-items: flex-start; }
.prov.acc-not_allowed { opacity: .75; }
.pbadges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tag.acc.allowed { background: var(--ok-bg); color: var(--ok); }
.tag.acc.needs_entity, .tag.acc.to_confirm, .tag.acc.legal_check { background: var(--warn-bg); color: var(--warn); }
.tag.acc.not_allowed { background: var(--bad-bg); color: var(--bad); }
.tag.mtier { background: #eef2f8; color: var(--ink-2); font-size: 11px; padding: 1px 7px; }
.tag.arena { background: #fff4e0; color: #8a5a00; font-size: 11px; padding: 1px 7px; }
.mlist { display: grid; gap: 0; }
.mrow { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed var(--line-2); }
.mrow:last-child { border-bottom: 0; }
.mrow code { white-space: nowrap; }
.keyform { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.keyform input { max-width: 280px; height: 32px; }
@media (max-width: 860px) { .provgrid { grid-template-columns: 1fr; } .mrow { flex-direction: column; } }

/* ---------- language switch ---------- */
#langsw { display: inline-flex; border: 1px solid rgba(255,255,255,.35); border-radius: 3px; overflow: hidden; background: transparent; padding: 0; cursor: pointer; font-size: 12px; height: 30px; flex: none; }
#langsw span { padding: 0 10px; display: grid; place-items: center; color: #fff; opacity: .7; transition: background .15s, opacity .15s; }
html:not([data-lang="zh"]) #langsw [data-l="en"], html[data-lang="zh"] #langsw [data-l="zh"] { background: rgba(255,255,255,.18); opacity: 1; font-weight: 500; }
.login-form .brand #langsw { order: 2; margin-left: auto; border-color: var(--line); }
.login-form .brand #langsw span { color: var(--ink-2); }
.login-form .brand html:not([data-lang="zh"]) #langsw [data-l="en"] { background: #eaf0f6; }
html:not([data-lang="zh"]) .login-form #langsw [data-l="en"], html[data-lang="zh"] .login-form #langsw [data-l="zh"] { background: #eaf0f6; color: var(--ink); }
@media (max-width: 860px) { .top #langsw span { padding: 0 7px; } }