:root {
  --bg: #f3f4f6; --panel: #ffffff; --panel2: #f8f9fb; --line: #dde1e7; --line2: #c9cfd8;
  --text: #15191f; --muted: #66707d; --accent: #e8590c; --accent2: #c94a06; --accentbg: #fff1e8;
  --ok: #1f8a4c; --okbg: #e6f5ec; --warn: #a86500; --warnbg: #fff6e0; --bad: #c62828; --badbg: #fdecec;
  --info: #1d5fbf; --infobg: #e8f0fc; --steel: #2c3440;
  --r: 10px; --sh: 0 1px 2px rgba(15, 20, 30, .06), 0 2px 8px rgba(15, 20, 30, .05);
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101317; --panel: #181c22; --panel2: #1e232a; --line: #2a3039; --line2: #3a424e;
    --text: #e8ebef; --muted: #8e98a5; --accent: #ff7a2e; --accent2: #ff9150; --accentbg: #2d1d12;
    --ok: #4cc27f; --okbg: #13281c; --warn: #f0b04a; --warnbg: #2b2213; --bad: #ff6b6b; --badbg: #2e1617;
    --info: #6aa5ff; --infobg: #16233a; --steel: #0c0f13;
    --sh: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0 0 14px; letter-spacing: -.01em; }
h2 { font-size: 18px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.boot { padding: 40px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.topbar { align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.sp { flex: 1; }
.stack > * + * { margin-top: 12px; }
.hide { display: none !important; }

/* поля */
input, select, textarea, button { font: inherit; color: inherit; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=tel],
input[type=search], input:not([type]), select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel);
  font-size: 16px; min-height: 40px; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: -1px; border-color: var(--accent); }
label.f { display: block; }
label.f > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 700px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.chk { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; padding: 3px 0; }
.chk input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 15px; min-height: 40px;
  border-radius: 8px; border: 1px solid var(--line2); background: var(--panel); cursor: pointer; font-weight: 500;
  white-space: nowrap; text-decoration: none !important; color: var(--text); }
.btn:hover { border-color: var(--muted); }
.btn.pri { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.pri:hover { background: var(--accent2); border-color: var(--accent2); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 5px 10px; min-height: 32px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }

/* оболочка */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--steel); color: #fff; padding-top: var(--sat); }
.topbar .in { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 6px; padding: 0 16px; height: 56px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 700; color: #fff !important; font-size: 17px;
  margin-right: 14px; text-decoration: none !important; }
.logo i { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); display: grid; place-items: center;
  font-style: normal; font-size: 15px; }
.topbar nav a { color: #c8ced6; padding: 8px 11px; border-radius: 8px; font-size: 14.5px; text-decoration: none; position: relative; }
.topbar nav a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.topbar nav a.on { color: #fff; background: rgba(255, 255, 255, .12); }
.badge { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent);
  color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; vertical-align: 1px; }
.topbar .btn { min-height: 34px; padding: 6px 12px; }
.topbar .btn.pri { margin-left: 6px; }
.bell { color: #c8ced6 !important; font-size: 18px; padding: 6px 9px !important; }
.page { max-width: 1200px; margin: 0 auto; padding: 22px 16px 60px; }
.page.narrow { max-width: 820px; }
.bottom { display: none; }
@media (max-width: 760px) {
  .topbar nav, .topbar .desk { display: none; }
  .page { padding: 16px 12px calc(84px + var(--sab)); }
  .bottom { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--panel); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + var(--sab)); }
  .bottom a { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11px; color: var(--muted);
    padding: 5px 0; text-decoration: none; position: relative; }
  .bottom a b { font-size: 20px; line-height: 24px; font-weight: 400; }
  .bottom a.on { color: var(--accent); }
  .bottom a .badge { position: absolute; top: 0; left: 55%; }
  .bottom a.plus b { width: 40px; height: 32px; border-radius: 10px; background: var(--accent); color: #fff;
    display: grid; place-items: center; }
  h1 { font-size: 21px; }
}

/* карточки */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--sh); }
.card + .card { margin-top: 12px; }
.card.flat { box-shadow: none; }
.card h2 { display: flex; align-items: center; gap: 8px; }
.list > .item { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 13px 15px; color: var(--text); text-decoration: none !important; box-shadow: var(--sh); }
.list > .item + .item { margin-top: 8px; }
.list > .item:hover { border-color: var(--line2); }
.item .t { font-weight: 600; font-size: 15.5px; }
.item.new { border-left: 3px solid var(--accent); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: 12.5px;
  font-weight: 500; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.open { background: var(--okbg); color: var(--ok); border-color: transparent; }
.pill.closed { background: var(--warnbg); color: var(--warn); border-color: transparent; }
.pill.done { background: var(--infobg); color: var(--info); border-color: transparent; }
.pill.cancelled, .pill.withdrawn, .pill.lost { background: var(--panel2); color: var(--muted); }
.pill.won { background: var(--okbg); color: var(--ok); border-color: transparent; }
.pill.acc { background: var(--accentbg); color: var(--accent); border-color: transparent; }
.prev { font-size: 13.5px; margin-top: 6px; color: var(--text); opacity: .85; }
.prev div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 9px 13px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap;
  text-decoration: none !important; font-weight: 500; }
.tabs a.on { color: var(--text); border-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--panel); padding: 7px 12px; cursor: pointer; font-size: 14px; }
.seg button + button { border-left: 1px solid var(--line2); }
.seg button.on { background: var(--steel); color: #fff; }

.filters { display: grid; grid-template-columns: 2fr 1.3fr 1.3fr auto; gap: 8px; margin-bottom: 12px; }
@media (max-width: 760px) { .filters { grid-template-columns: 1fr 1fr; } .filters .q { grid-column: 1 / -1; } }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted); padding: 7px 8px;
  border-bottom: 1px solid var(--line); }
table.t td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
.tw { overflow-x: auto; }
table.items td input, table.items td select { min-height: 36px; padding: 6px 8px; }
.best { background: var(--okbg); font-weight: 600; }

.two { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
@media (max-width: 960px) { .two { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 14px; }
.kv > :nth-child(odd) { color: var(--muted); }
@media (max-width: 500px) { .kv { grid-template-columns: 1fr; } .kv > :nth-child(odd) { margin-top: 6px; } }

.files { display: flex; flex-direction: column; gap: 6px; }
.file { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel2); font-size: 14px; }
.file .ext { font-size: 11px; font-weight: 700; background: var(--steel); color: #fff; padding: 2px 5px; border-radius: 4px;
  text-transform: uppercase; }
.drop { border: 2px dashed var(--line2); border-radius: var(--r); padding: 16px; text-align: center; color: var(--muted); cursor: pointer; }
.drop.over { border-color: var(--accent); background: var(--accentbg); }

.offer { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; background: var(--panel); }
.offer + .offer { margin-top: 10px; }
.offer.win { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok); }
.offer .sum { font-size: 21px; font-weight: 700; }
.stars { color: #f5a623; letter-spacing: 1px; }
.stars.big { font-size: 26px; cursor: pointer; }

.chat { display: flex; flex-direction: column; height: min(70vh, 560px); }
.chat .msgs { flex: 1; overflow-y: auto; padding: 8px 2px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 82%; padding: 8px 11px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line);
  white-space: pre-wrap; word-wrap: break-word; font-size: 14.5px; }
.msg.me { align-self: flex-end; background: var(--accentbg); border-color: transparent; }
.msg small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.chat form { display: flex; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.chat textarea { min-height: 42px; height: 42px; }

.modal { position: fixed; inset: 0; background: rgba(10, 12, 16, .55); z-index: 50; display: flex; align-items: center;
  justify-content: center; padding: 16px; }
.modal .box { background: var(--panel); border-radius: 14px; width: 100%; max-width: 620px; max-height: 92vh; overflow-y: auto;
  padding: 18px; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
.modal .box.wide { max-width: 860px; }
.modal .head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.modal .head h2 { margin: 0; flex: 1; }
@media (max-width: 760px) {
  .modal { padding: 0; align-items: flex-end; }
  .modal .box { border-radius: 16px 16px 0 0; max-height: 94vh; padding-bottom: calc(18px + var(--sab)); }
}

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + var(--sab)); z-index: 60;
  background: var(--steel); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: 0 6px 24px rgba(0, 0, 0, .3);
  max-width: calc(100vw - 32px); font-size: 14.5px; }
.toast.err { background: var(--bad); }
.banner { padding: 11px 14px; border-radius: var(--r); margin-bottom: 14px; font-size: 14px; display: flex; gap: 10px;
  align-items: center; flex-wrap: wrap; }
.banner.warn { background: var(--warnbg); color: var(--warn); }
.banner.info { background: var(--infobg); color: var(--info); }
.banner.bad { background: var(--badbg); color: var(--bad); }
.banner.ok { background: var(--okbg); color: var(--ok); }
.empty { text-align: center; color: var(--muted); padding: 34px 16px; }
.empty b { display: block; font-size: 34px; margin-bottom: 6px; }

/* лендинг */
.hero { background: var(--steel); color: #fff; padding: calc(28px + var(--sat)) 16px 36px; }
.hero .in { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1.25fr 1fr; gap: 32px; align-items: start; }
.hero h1 { font-size: 38px; line-height: 1.12; margin: 18px 0 12px; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { color: #c3cad3; font-size: 17px; max-width: 560px; }
.hero .stats { display: flex; gap: 26px; margin-top: 22px; flex-wrap: wrap; }
.hero .stats div b { display: block; font-size: 26px; }
.hero .stats div { color: #9aa4b0; font-size: 13px; }
.hero .card { color: var(--text); }
@media (max-width: 860px) { .hero .in { grid-template-columns: 1fr; } .hero h1 { font-size: 29px; } }
.how { max-width: 1100px; margin: 0 auto; padding: 30px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.how ol { padding-left: 20px; margin: 0; }
.how li { margin: 6px 0; }
@media (max-width: 760px) { .how { grid-template-columns: 1fr; } }
.tariffs { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.tariff { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; background: var(--panel); }
.tariff.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tariff .p { font-size: 22px; font-weight: 700; margin: 4px 0 8px; }
.tariff ul { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--muted); }
.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 20px 16px 40px; }

.tree { max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.tree .grp { margin-bottom: 6px; }
.tree .grp > .chk { font-weight: 600; }
.tree .kids { padding-left: 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.counter { font-size: 13px; color: var(--muted); }
.counter.over { color: var(--bad); font-weight: 600; }
.notif { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--text);
  text-decoration: none !important; }
.notif.unread { background: var(--accentbg); }
.notif .ic { font-size: 18px; width: 24px; text-align: center; flex: none; }
.notif .b { font-size: 13.5px; color: var(--muted); white-space: pre-line; }
.hero .stats div b { color: #fff; }
.how > .card + .card { margin-top: 0; }
.pills .pill { white-space: normal; max-width: 100%; }
