/* Фонд обміну — стилі за прототипом Claude Design («Fund Prototype»). */
:root {
  --bg: #F3F6FA; --surface: #FFFFFF; --surface-2: #F7F9FC; --surface-3: #EDF1F6; --chip: #E8EEF7;
  --border: #E2E7EF; --border-strong: #D3DAE5; --border-hover: #AEB9CB; --divider: #EDF1F6;
  --text: #1C2430; --text-2: #4A5568; --muted: #6B7689;
  --accent: #4169E1; --accent-hover: #3278C8; --accent-weak: #EAF0FD;
  --brand-1: #00CBC9; --brand-2: #00A9A7; --teal-weak: #E0F7F6; --teal: #007F7D;
  --ok-bg: #E4F3EA; --ok: #1B7A47; --warn-bg: #FBEFD9; --warn: #94570A; --warn-2: #B26A00;
  --plan-bg: #ECEAFB; --plan: #4B45B8; --grey-bg: #EEF1F5; --grey: #6B6D72; --none-bg: #F1F4F8;
  --danger-bg: #FBE6E3; --danger: #B42E22; --count: #E2513F; --violet-bg: #EFEAFB; --violet: #5B3DB5;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --shadow-pop: 0 20px 60px rgba(0,0,0,.2);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1319; --surface: #171C24; --surface-2: #1C222C; --surface-3: #252C38; --chip: #252C38;
    --border: #262E3A; --border-strong: #343D4C; --border-hover: #4A5568; --divider: #222935;
    --text: #E6EAF1; --text-2: #BFC7D4; --muted: #8E98A9;
    --accent: #7D9CFF; --accent-hover: #97B0FF; --accent-weak: #1F2A47;
    --teal-weak: #12302F; --teal: #4FD6D2;
    --ok-bg: #16301F; --ok: #6FD296; --warn-bg: #352A12; --warn: #F0B65C; --warn-2: #F0B65C;
    --plan-bg: #262447; --plan: #ABA6FF; --grey-bg: #222833; --grey: #9AA1AD; --none-bg: #1E242E;
    --danger-bg: #3A1D1B; --danger: #FF8E82; --violet-bg: #2A2240; --violet: #BBA2FF;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font-family: inherit; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.r { text-align: right; }
.c { text-align: center; }
code, .code { font-family: var(--mono); font-size: 12px; }

/* ---------- верхня панель ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 0 32px; height: 60px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; white-space: nowrap; color: var(--text); }
.brand:hover { text-decoration: none; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(145deg, var(--brand-1), #00C2C2 46%, var(--brand-2)); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.brand .t1 { font-weight: 600; font-size: 15px; line-height: 1.15; }
.brand .t2 { font-size: 11px; color: var(--muted); line-height: 1.15; }
.nav { display: flex; gap: 4px; flex: none; }
.nav a { height: 34px; padding: 0 14px; border-radius: 9px; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; color: var(--text-2); white-space: nowrap; }
.nav a:hover { text-decoration: none; background: var(--surface-2); }
.nav a.active { background: var(--accent-weak); color: var(--accent); }
.count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--count); color: #fff; font-size: 11.5px; font-weight: 600; display: grid; place-items: center; }
.spacer { flex: 1; }
.search-btn { height: 34px; flex: 0 1 240px; min-width: 150px; overflow: hidden; border-radius: 9px; border: 1px solid var(--border); background: var(--bg); color: var(--muted);
  display: flex; align-items: center; gap: 8px; padding: 0 12px; font-size: 13.5px; white-space: nowrap; }
.search-btn:hover { border-color: var(--border-hover); }
.search-btn:focus-within { border-color: var(--accent, var(--border-hover)); background: var(--surface, var(--bg)); }
.search-btn input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; height: 100%; padding: 0; }
.search-btn input::placeholder { color: var(--muted); }
.sync-ind { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); white-space: nowrap; flex: none; }
.sync-ind button { border: 0; background: transparent; color: var(--muted); padding: 4px; border-radius: 6px; cursor: pointer; display: inline-flex; }
.sync-ind button:hover { background: var(--surface-2); color: var(--text); }
.sync-ind button:disabled { cursor: default; opacity: .5; }
.sync-ind button.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; display: inline-block; }
.dot.warn { background: #C98A1B; } .dot.error { background: var(--danger); } .dot.none { background: var(--border-strong); }
.dot.running { background: var(--accent); animation: pulse 1s infinite alternate; } .dot.info { background: var(--accent); }
@keyframes pulse { from { opacity: .35; } to { opacity: 1; } }
.me { flex: none; position: relative; }
.me details summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.me details summary::-webkit-details-marker { display: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(145deg, var(--brand-1), var(--brand-2)); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 12.5px; flex: none; }
.me .n1 { font-size: 13px; font-weight: 500; line-height: 1.2; }
.me .n2 { font-size: 11.5px; color: var(--muted); line-height: 1.2; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.menu-pop { position: absolute; right: 0; top: 44px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(28,36,48,.12);
  padding: 6px; min-width: 230px; display: grid; gap: 2px; z-index: 40; }
.menu-pop .lbl { font-size: 11.5px; color: var(--muted); padding: 6px 10px 2px; }
.menu-pop button, .menu-pop a { width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; color: var(--text); cursor: pointer; display: block; }
.menu-pop button:hover, .menu-pop a:hover { background: var(--surface-2); text-decoration: none; }
.menu-pop .on { color: var(--accent); font-weight: 500; }
.menu-pop hr { border: 0; border-top: 1px solid var(--divider); margin: 4px 0; }

/* ---------- сторінка ---------- */
.page { max-width: 1280px; margin: 0 auto; padding: 32px 32px 80px; }
.eyebrow { font-size: 13px; color: var(--muted); }
h1, .h1 { font-size: 34px; line-height: 1.15; font-weight: 600; letter-spacing: -.02em; margin: 6px 0 8px; text-wrap: pretty; }
h1.flush { margin-top: 0; }
.lead { color: var(--text-2); margin: 0 0 32px; max-width: 640px; font-size: 15px; text-wrap: pretty; }
h2 { font-size: 18px; font-weight: 600; margin: 0; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 10px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13.5px; margin-bottom: 16px; }
.with-aside { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 36px; align-items: start; }
.with-aside.wide { grid-template-columns: minmax(0,1fr) 340px; }
.aside { display: grid; gap: 14px; position: sticky; top: 92px; }
.section { margin-bottom: 36px; }
.section:last-child { margin-bottom: 0; }
.section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.section-head .n { color: var(--muted); }
.section-head .right { margin-left: auto; font-size: 13px; color: var(--muted); }
.flash { padding: 11px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 13.5px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--danger-bg); color: var(--danger); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.card.click { cursor: pointer; display: block; color: inherit; }
.card.click:hover { border-color: var(--border-hover); text-decoration: none; }
.card .cap { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.empty-box { padding: 18px 20px; border: 1px dashed var(--border-strong); border-radius: 14px; color: var(--muted); }
.list { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.list > .row { display: grid; gap: 16px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--divider); color: inherit; }
.list > .row:last-child { border-bottom: 0; }
.list > a.row:hover, .list > .row.hover:hover { background: var(--surface-2); text-decoration: none; }
.list > .head { padding: 10px 20px; font-size: 12px; color: var(--muted); background: var(--surface-2); }
.list .empty { padding: 18px 20px; color: var(--muted); }
.t-title { font-weight: 500; color: var(--text); }
.t-title.big { font-size: 15px; font-weight: 600; line-height: 1.35; text-wrap: pretty; }
.t-sub { font-size: 12.5px; color: var(--muted); }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* кнопки й поля */
.btn, button.btn { height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: 13.5px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.btn:hover { background: var(--bg); text-decoration: none; }
.btn-primary, button.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-sm { height: 28px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; }
.btn-md { height: 34px; padding: 0 14px; border-radius: 9px; font-size: 13px; }
.btn-danger { color: var(--danger); }
.btn-block { width: 100%; }
.link-btn { border: 0; background: transparent; color: var(--accent); cursor: pointer; font-size: 13px; padding: 0; }
input, select, textarea { color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 9px; padding: 0 12px; height: 36px; font-size: 13.5px; outline: none; max-width: 100%; }
textarea { height: auto; min-height: 80px; padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
label { display: block; font-size: 13px; font-weight: 500; margin: 14px 0 6px; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 10px 0; font-size: 13.5px; }
label.check input { height: auto; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.form-actions { margin-top: 20px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline { display: inline; }

/* мітки й статуси */
.pill { display: inline-flex; align-items: center; font-size: 12px; font-weight: 500; border-radius: 999px; padding: 2px 9px; white-space: nowrap; line-height: 1.45; }
.tag { display: inline-flex; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 0 7px; line-height: 18px; white-space: nowrap; }
.tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.st-installed, .st-author { background: var(--ok-bg); color: var(--ok); }
.st-outdated { background: var(--warn-bg); color: var(--warn); }
.st-in-progress { background: var(--accent-weak); color: var(--accent); }
.st-planned { background: var(--plan-bg); color: var(--plan); }
.st-rejected, .st-superseded { background: var(--grey-bg); color: var(--grey); }
.st-none { background: var(--none-bg); color: var(--grey); }
.st-hang { background: var(--danger-bg); color: var(--danger); }
.tg-mandatory { background: var(--danger-bg); color: var(--danger); }
.tg-ps { background: var(--violet-bg); color: var(--violet); }
.tg-client { background: var(--grey-bg); color: var(--text-2); }
.tg-desc { background: var(--grey-bg); color: var(--grey); }
.tg-pkg { background: var(--ok-bg); color: var(--ok); }
.tg-draft { background: var(--warn-bg); color: var(--warn); }
.price-ps { color: var(--violet); }
.price-ask { color: var(--muted); }
.days-hi { color: var(--danger); } .days-mid { color: var(--warn-2); } .days-lo { color: var(--text-2); }

/* ---------- головна клієнта ---------- */
.upd { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; display: flex; flex-wrap: wrap; gap: 16px 20px; align-items: flex-start; }
.upd .main { min-width: 0; flex: 1 1 360px; }
.ver-pill { font-family: var(--mono); font-size: 12px; background: var(--warn-bg); color: var(--warn); border-radius: 6px; padding: 1px 7px; }
.upd .title { font-size: 16px; font-weight: 600; color: var(--text); display: inline-block; margin: 4px 0 10px; }
.upd .vline { display: flex; gap: 10px; align-items: baseline; font-size: 13.5px; color: var(--text-2); }
.upd .vline .v { font-family: var(--mono); font-size: 12px; color: var(--text); flex: none; }
.kind { font-size: 11.5px; font-weight: 500; flex: none; }
.kind-fix { color: var(--warn); } .kind-feature { color: var(--accent); } .kind-initial { color: var(--grey); }
.offers { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.offer { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 10px; color: inherit; }
.offer:hover { border-color: var(--border-hover); text-decoration: none; }
.offer .t { font-weight: 600; font-size: 15px; line-height: 1.35; text-wrap: pretty; }
.offer .foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--divider); }
.offer .price { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.offer .note { font-size: 12.5px; color: var(--violet); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; }
.stat-grid b { display: block; font-size: 26px; font-weight: 600; line-height: 1; }
.stat-grid span { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.work { display: grid; gap: 12px; }
.work a { color: inherit; display: block; }
.work a:hover { text-decoration: none; }
.work a:hover .t-title { color: var(--accent); }
.howto-note { padding: 4px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.howto-note code { color: var(--text); }

/* ---------- ПМ і адмін ---------- */
.cards-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-bottom: 36px; }
.pm-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.pm-card .top { display: flex; justify-content: space-between; align-items: center; }
.pm-card .name { font-size: 18px; font-weight: 600; }
.pm-card .bar-line { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.pm-card .counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid var(--divider); padding-top: 14px; }
.pm-card .counts b { display: block; font-size: 20px; font-weight: 600; }
.pm-card .counts span { font-size: 12px; color: var(--muted); }
.bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.bar.thin { height: 5px; }
.bar i { display: block; height: 100%; background: var(--ok); }
.strip { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 36px; }
.strip > div { background: var(--surface); padding: 16px 18px; }
.strip b { display: block; font-size: 24px; font-weight: 600; line-height: 1.1; }
.strip span { font-size: 12.5px; color: var(--muted); }
.state-card .lbl { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.state-card .big { font-size: 18px; font-weight: 600; margin: 8px 0 2px; }
.state-card .sub { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.two-col { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; }

/* ---------- обов'язкові ---------- */
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; box-shadow: inset 0 0 0 1px currentColor; }
.seg { display: flex; background: var(--chip); border-radius: 10px; padding: 3px; }
.seg a { height: 30px; padding: 0 14px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text); display: flex; align-items: center; }
.seg a:hover { text-decoration: none; }
.seg a.on { background: var(--surface); }
.tbl { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow-x: auto; }
.tbl table { border-collapse: collapse; width: 100%; }
.tbl th { text-align: left; padding: 12px; font-size: 12px; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--divider); background: var(--surface-2); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { padding-left: 20px; }
.tbl th.col { font-weight: 600; color: var(--text); text-align: center; min-width: 96px; padding: 12px 6px; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.cellwrap { padding: 5px; text-align: center; }
.mcell { border-radius: 8px; padding: 7px 4px; line-height: 1.25; display: block; width: 100%; border: 0; font: inherit; text-align: center; }
button.mcell { cursor: pointer; }
button.mcell:hover { box-shadow: inset 0 0 0 1px currentColor; }
.mcell b { display: block; font-size: 12px; font-weight: 600; }
.mcell small { display: block; font-size: 11px; opacity: .85; }

/* ---------- каталог ---------- */
.big-search { position: relative; margin-bottom: 14px; }
.big-search svg { position: absolute; left: 18px; top: 17px; width: 20px; height: 20px; color: var(--muted); }
.big-search input { width: 100%; height: 54px; border-radius: 14px; padding: 0 18px 0 50px; font-size: 16px; }
.cat-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; align-items: center; }
.cat-pills a { height: 32px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 500; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.cat-pills a span { opacity: .6; }
.cat-pills a:hover { text-decoration: none; border-color: var(--border-hover); }
.cat-pills a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.catalog { display: grid; grid-template-columns: 230px minmax(0,1fr); gap: 28px; align-items: start; }
.facets { display: grid; gap: 24px; position: sticky; top: 92px; }
.facets .ttl { font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.facets .opts { display: grid; gap: 1px; }
.facets a { display: flex; justify-content: space-between; align-items: center; height: 32px; padding: 0 10px; border-radius: 8px; font-size: 13.5px; color: var(--text-2); }
.facets a span { font-size: 12px; opacity: .6; }
.facets a:hover { text-decoration: none; background: var(--surface-2); }
.facets a.on { background: var(--chip); color: var(--text); }
.result-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 13px; color: var(--muted); gap: 10px; flex-wrap: wrap; }
.list > .row.res { grid-template-columns: minmax(0,1fr) 130px 150px; gap: 20px; padding: 16px 20px; }
.res .meta { display: flex; gap: 8px; align-items: center; margin-bottom: 3px; flex-wrap: wrap; }
.dots { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.dots span { font-size: 10.5px; font-weight: 600; border-radius: 6px; padding: 2px 5px; }
.pager { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 14px; font-size: 13px; color: var(--muted); }

/* ---------- задача ---------- */
.task-meta { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.task-title { font-size: 30px; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; margin: 0 0 12px; text-wrap: pretty; }
.ttabs { display: flex; gap: 24px; border-bottom: 1px solid var(--border); margin: 24px 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.ttabs a { padding: 0 0 12px; font-size: 14px; font-weight: 500; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); white-space: nowrap; }
.ttabs a:hover { text-decoration: none; color: var(--text); }
.ttabs a.on { border-bottom-color: var(--accent); color: var(--accent); }
.prose { font-size: 16px; line-height: 1.6; max-width: 680px; text-wrap: pretty; margin-bottom: 20px; }
.worth { background: var(--teal-weak); border-radius: 12px; padding: 16px 18px; max-width: 680px; margin-bottom: 28px; font-size: 14.5px; line-height: 1.55; }
.dep { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; color: inherit; }
.dep:hover { border-color: var(--border-hover); text-decoration: none; }
.deps { display: grid; gap: 8px; max-width: 680px; margin-bottom: 28px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips a { height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; color: var(--text); display: inline-flex; align-items: center; }
.chips a:hover { border-color: var(--accent); text-decoration: none; }
details.full { max-width: 680px; margin-top: 28px; }
details.full summary { cursor: pointer; color: var(--accent); font-size: 13.5px; }
details.full .body { font-size: 14px; line-height: 1.55; margin-top: 12px; color: var(--text-2); }
/* опис картки — Markdown з card.md */
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md blockquote, .md pre, .md .md-table { margin: 0 0 12px; }
.md ul, .md ol { padding-left: 22px; }
.md li { margin-bottom: 4px; }
.md li > ul, .md li > ol { margin: 4px 0 0; }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 { font-size: 15px; line-height: 1.4; margin: 20px 0 8px; color: var(--text); }
.md h1, .md h2 { font-size: 16px; }
.md code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.md pre { background: var(--surface-2); padding: 12px 14px; border-radius: 10px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { border-left: 3px solid var(--border-strong); padding-left: 12px; color: var(--text-2); }
.md img { display: block; max-width: 100%; height: auto; margin: 8px 0; border: 1px solid var(--border); border-radius: 8px; cursor: zoom-in; }
.md .md-table { overflow-x: auto; }
.md table { border-collapse: collapse; font-size: 13px; min-width: 50%; }
.md th, .md td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
.md th { background: var(--surface-2); font-weight: 600; }
.md hr { border: 0; border-top: 1px solid var(--divider); margin: 16px 0; }
.worth.md > b + p { display: inline; }
.vrow { display: grid; grid-template-columns: 80px minmax(0,1fr); gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--divider); max-width: 680px; }
.list > .row.who-row { grid-template-columns: 150px 130px 80px minmax(0,1fr) auto; gap: 14px; padding: 12px 18px; }
.kv { display: grid; grid-template-columns: 170px minmax(0,1fr); gap: 12px 16px; max-width: 680px; font-size: 14px; }
.kv > div:nth-child(odd) { color: var(--muted); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
#cell-dialog { width: 500px; }
#cell-dialog .kv { grid-template-columns: 120px minmax(0,1fr); gap: 8px 12px; font-size: 13.5px; }
#cell-dialog .kv dt:empty { display: none; }
#cell-dialog .kv dt:empty + dd { grid-column: 1 / -1; color: var(--text-2); }
.kv.small { grid-template-columns: 100px minmax(0,1fr); gap: 8px 12px; font-size: 13px; }
.my-card .row1 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 10px; }
.my-card .price { font-size: 20px; font-weight: 600; }
.steps { border-top: 1px solid var(--divider); padding-top: 16px; display: grid; gap: 12px; }
.step { display: grid; grid-template-columns: 22px minmax(0,1fr); gap: 10px; }
.step .num { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 600; display: grid; place-items: center; }
.cmd { margin-top: 6px; font-family: var(--mono); font-size: 12px; background: var(--bg); border-radius: 8px; padding: 7px 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px;
  border: 0; width: 100%; color: var(--text); text-align: left; }
.cmd:hover { background: var(--chip); }
.cmd svg { width: 14px; height: 14px; color: var(--muted); }
.staff-list { display: grid; gap: 8px; }
.staff-list div { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 500; }

/* ---------- налаштування ---------- */
.settings { display: grid; grid-template-columns: 200px minmax(0,1fr); gap: 32px; align-items: start; }
.snav { display: grid; gap: 2px; position: sticky; top: 92px; }
.snav a { display: flex; justify-content: space-between; align-items: center; height: 36px; padding: 0 12px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--text-2); }
.snav a:hover { text-decoration: none; background: var(--surface-2); }
.snav a.on { background: var(--chip); color: var(--text); }
.snav .b { font-size: 11.5px; font-weight: 600; color: var(--warn); background: var(--warn-bg); border-radius: 999px; padding: 0 7px; }
.s-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.s-head .grow { flex: 1; }
.s-desc { font-size: 13px; color: var(--muted); margin: 4px 0 14px; }
.ini { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-weight: 600; font-size: 12px; color: var(--text-2); }
.role-client { background: var(--grey-bg); color: var(--text-2); } .role-pm { background: var(--accent-weak); color: var(--accent); } .role-admin { background: var(--teal-weak); color: var(--teal); }
.price-in { width: 64px; height: 32px; border-radius: 8px; border: 1px solid var(--border); text-align: center; font-size: 13px; padding: 0 4px; }
.price-in.free { background: var(--teal-weak); }
.qcard { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 16px; align-items: start; }
.qcard .where { font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: right; max-width: 340px; }
pre.mail { white-space: pre-wrap; background: var(--surface-2); padding: 14px; border-radius: 10px; font-size: 12.5px; margin: 0; font-family: var(--font); }

/* ---------- вікно, підказка ---------- */
dialog.modal { border: 0; border-radius: 16px; padding: 24px; width: 420px; max-width: calc(100vw - 32px); box-shadow: var(--shadow-pop); background: var(--surface); color: var(--text); }
dialog.modal::backdrop { background: rgba(28,36,48,.35); }
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 18px; }
.opt-grid label { margin: 0; position: relative; }
.opt-grid input { position: absolute; opacity: 0; pointer-events: none; }
.opt-grid span { height: 38px; border-radius: 10px; font-size: 13px; font-weight: 500; border: 1px solid var(--border); display: grid; place-items: center; cursor: pointer; color: var(--text-2); background: var(--surface); }
.opt-grid input:checked + span { border-color: currentColor; }
.opt-grid input:checked + .st-installed { background: var(--ok-bg); color: var(--ok); }
.opt-grid input:checked + .st-in-progress { background: var(--accent-weak); color: var(--accent); }
.opt-grid input:checked + .st-planned { background: var(--plan-bg); color: var(--plan); }
.opt-grid input:checked + .st-rejected { background: var(--grey-bg); color: var(--grey); }
.opt-grid input:checked + .st-none { background: var(--danger-bg); color: var(--danger); }
.opt-grid input:focus-visible + span { outline: 2px solid var(--accent); }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 60; background: #1C2430; color: #fff; border-radius: 12px; padding: 12px 16px; font-size: 13.5px; box-shadow: 0 10px 30px rgba(0,0,0,.2);
  opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: none; }

/* ---------- вхід ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 34px 28px; text-align: center; }
.login-card .logo { width: 48px; height: 48px; border-radius: 12px; font-size: 17px; margin: 0 auto 16px; }
.login-card h1 { font-size: 24px; margin: 0 0 6px; }
.login-card p { color: var(--muted); margin: 0 0 24px; }
.login-card .note { margin-top: 18px; font-size: 12px; color: var(--muted); }
.login-card details { margin-top: 14px; text-align: left; font-size: 12.5px; color: var(--muted); }
.login-card details form { display: flex; gap: 6px; margin-top: 8px; }
.login-card details input { flex: 1; min-width: 0; }

/* ---------- адаптив ---------- */
/* адмінське меню довше — на ноутбуці 1280px текст «оновлено …» не вміщується, лишається індикатор */
@media (max-width: 1360px) {
  .sync-ind .txt { display: none; }
}
@media (max-width: 1100px) {
  .with-aside, .with-aside.wide { grid-template-columns: 1fr; }
  .aside { position: static; }
  .strip { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .cards-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .me .who { display: none; }
}
@media (max-width: 860px) {
  .topbar-inner { padding: 8px 16px; gap: 12px; height: auto; min-height: 56px; flex-wrap: wrap; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .search-btn { flex: 1 1 auto; }
  .sync-ind .txt { display: none; }
  .page { padding: 20px 16px 60px; }
  h1, .h1 { font-size: 26px; }
  .catalog, .settings, .two-col { grid-template-columns: 1fr; }
  .facets, .snav { position: static; }
  .cards-3 { grid-template-columns: 1fr; }
  .strip { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .list > .row.res { grid-template-columns: minmax(0,1fr) auto; }
  .list > .row.res > :nth-child(3) { grid-column: 1 / -1; text-align: left; }
  .list > .row.res .dots { justify-content: flex-start; }
}

/* роль розробника, позначка пошуку за змістом */
.role-developer { background: var(--plan-bg); color: var(--plan); }
.tg-ai { background: var(--teal-weak); color: var(--teal); }
.price-row { display: grid; grid-template-columns: minmax(140px, 1fr) 140px minmax(0, 2fr); gap: 12px; align-items: center; padding: 10px 18px; }

/* ---------- ітерація UX 1 ---------- */
/* рядок «назва · статус/ціна · дата» на головній клієнта */
.list > .row.r3 { grid-template-columns: minmax(0,1fr) 130px 90px; }
/* заголовки колонок над списком */
.list > .row.head.res { padding-top: 9px; padding-bottom: 9px; }
.welcome { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 16px 24px; align-items: center; background: var(--accent-weak);
  border-radius: 14px; padding: 18px 20px; margin: -12px 0 32px; }
.welcome b { display: block; font-size: 15px; margin-bottom: 4px; }
.welcome ol { margin: 6px 0 0; padding-left: 18px; color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.welcome .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.price-line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 0 0 12px; margin-bottom: 12px; border-bottom: 1px solid var(--divider); font-size: 13.5px; }
.price-line .v { font-weight: 600; font-size: 16px; }
a.stat-link { color: inherit; display: block; border-radius: 10px; }
a.stat-link:hover { text-decoration: none; background: var(--surface-2); }
.error-page { max-width: 640px; padding: 40px 0; }
.big-search button.go { position: absolute; right: 10px; top: 10px; flex: none; height: 34px; border-radius: 9px; border: 0; background: var(--accent); color: #fff; padding: 0 14px; font-weight: 500; cursor: pointer; }
.big-search button.go:hover { background: var(--accent-hover); }
details.tech-err summary { cursor: pointer; color: var(--muted); font-size: 12px; }
details.tech-err pre { white-space: pre-wrap; font-size: 11.5px; margin: 6px 0 0; color: var(--muted); font-family: var(--mono); }
input::placeholder { color: var(--muted); opacity: 1; }
/* матриця: назва задачі не зникає при горизонтальному прокручуванні */
.tbl th:first-child, .tbl td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
/* блок «Для вашої компанії»: на вузькому екрані — копія під заголовком задачі, у бічній колонці ховаємо */
.narrow-only { display: none; }
@media (max-width: 1100px) {
  .narrow-only { display: block; margin: 16px 0 0; }
  .aside .wide-only { display: none; }
}
.facets-wrap > summary { display: none; }
@media (max-width: 860px) {
  .topbar-inner { row-gap: 6px; }
  .brand { order: 1; }
  .brand .t2 { display: none; }
  .search-btn { order: 2; flex: 1 1 0; }
  .sync-ind { order: 2; }
  .me { order: 2; }
  .spacer { display: none; }
  .nav { order: 3; }
  .list > .row.r3 { grid-template-columns: minmax(0,1fr) auto; }
  .list > .row.r3 > :nth-child(3) { display: none; }
  .list > .row.head.res { display: none; }
  .welcome { grid-template-columns: 1fr; }
  .section-head { flex-wrap: wrap; }
  .section-head .right { display: none; }
  .facets-wrap > summary { display: flex; justify-content: space-between; align-items: center; height: 40px; padding: 0 14px; border: 1px solid var(--border);
    border-radius: 10px; background: var(--surface); cursor: pointer; font-weight: 500; list-style: none; }
  .facets-wrap > summary::-webkit-details-marker { display: none; }
  .facets-wrap[open] > summary { margin-bottom: 14px; }
}
.big-search input { padding-right: 96px; }
.tbl th:first-child { background: var(--surface-2); z-index: 2; }
@media (max-width: 860px) { .tbl td:first-child { min-width: 200px !important; max-width: 220px; } }
.welcome[hidden] { display: none; }
.strip > a.stat-link { background: var(--surface); padding: 16px 18px; border-radius: 0; color: var(--text); }
.strip > a.stat-link:hover { background: var(--surface-2); }
.facets-wrap { position: sticky; top: 92px; align-self: start; }
.facets-wrap > .facets { position: static; }
@media (max-width: 860px) { .facets-wrap { position: static; } }
mark { background: #FFF1B8; color: inherit; border-radius: 3px; padding: 0 1px; }
@media (prefers-color-scheme: dark) { mark { background: #5A4A12; } }
.snippet { font-size: 13px; color: var(--text-2); margin-top: 4px; line-height: 1.45; }
.list > .row.sem-head { display: block; padding: 10px 20px; font-size: 12.5px; color: var(--muted); background: var(--surface-2); border-top: 1px solid var(--border); }
.list > .row.sem-head b { color: var(--teal); font-weight: 600; }
.list.similar { max-width: 680px; }
.list.similar > .row { padding: 11px 18px; }
/* ---------- «Про Фонд» ---------- */
.settings.info { grid-template-columns: 240px minmax(0,1fr); }
.snav .b.staff { color: var(--teal); background: var(--teal-weak); }
.doc { max-width: 800px; font-size: 15px; line-height: 1.65; }
.doc-title { font-size: 26px; margin-bottom: 8px; }
.doc > .lead { max-width: 70ch; }
/* текст — до ~70 знаків у рядку; таблиці й код можуть бути ширшими */
.doc p, .doc li, .doc blockquote { max-width: 70ch; text-wrap: pretty; }
.doc h2 { font-size: 19px; line-height: 1.35; margin: 36px 0 12px; padding-top: 20px; border-top: 1px solid var(--divider); scroll-margin-top: 92px; }
.doc h3 { font-size: 16px; line-height: 1.4; margin: 26px 0 8px; }
.doc h2 + h3 { margin-top: 12px; }
.doc h2.doc-title { margin: 0 0 8px; padding-top: 0; border-top: 0; font-size: 26px; }
.doc p, .doc ul, .doc ol { margin: 0 0 12px; }
.doc ul, .doc ol { padding-left: 24px; }
.doc li { margin-bottom: 6px; }
.doc li > ul, .doc li > ol { margin: 6px 0 0; }
.doc li > p { margin-bottom: 6px; }
.doc strong { font-weight: 600; color: var(--text); }
.doc hr { border: 0; border-top: 1px solid var(--divider); margin: 28px 0; }
.doc blockquote { margin: 0 0 20px; padding: 14px 18px; background: var(--accent-weak); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; color: var(--text); }
.doc blockquote > :last-child { margin-bottom: 0; }
.doc blockquote table { background: var(--surface); }
.doc code { background: var(--surface-3); border-radius: 5px; padding: 1px 5px; font-family: var(--mono); font-size: .86em; }
.doc pre { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; overflow-x: auto; font-size: 12.5px; line-height: 1.45; }
.doc pre code { background: none; padding: 0; font-size: inherit; }
.doc table { border-collapse: collapse; max-width: 100%; margin: 4px 0 18px; font-size: 13.5px; line-height: 1.5; display: block; overflow-x: auto; }
.doc th, .doc td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; vertical-align: top; }
.doc th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
.doc td:first-child { min-width: 110px; }
.doc .doc-toc { margin: 4px 0 8px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; max-width: 70ch; }
.doc .doc-toc-cap { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.doc .doc-toc ul { list-style: none; padding: 0; margin: 0; columns: 2 260px; column-gap: 24px; }
.doc .doc-toc li { margin: 0; padding: 3px 0; font-size: 14px; break-inside: avoid; }
.doc .doc-toc + h2 { border-top: 0; }
@media (max-width: 860px) { .settings.info { grid-template-columns: 1fr; } }
details.qcard.q2 { display: block; }
details.qcard.q2 > summary { cursor: pointer; list-style: none; }
details.qcard.q2 > summary::-webkit-details-marker { display: none; }
.qrows { margin-top: 12px; border-top: 1px solid var(--divider); }
.qrow { display: grid; grid-template-columns: 90px minmax(0,1fr) minmax(0,220px) 140px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--divider); font-size: 13px; }
.qrow:last-child { border-bottom: 0; }
@media (max-width: 860px) { .qrow { grid-template-columns: 80px minmax(0,1fr); } .qrow > :nth-child(n+3) { grid-column: 2; } }
.stat-grid a.stat-link { padding: 4px 6px; margin: -4px -6px; }
.import-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 16px; align-items: center; margin-bottom: 16px; padding: 16px 18px; }
@media (max-width: 860px) { .import-card { grid-template-columns: 1fr; } }
/* ---------- історія картки ---------- */
.hist { border-bottom: 1px solid var(--divider); padding: 12px 0; max-width: 760px; }

/* видимий фокус з клавіатури */
:is(a, button, summary, input, select, textarea):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* таблиці-списки з фіксованими колонками: на телефоні — назва й остання колонка в рядок, решта під ними */
@media (max-width: 860px) {
  .list > .row[style*="grid-template-columns"]:not(.head), .who-row { grid-template-columns: minmax(0,1fr) auto !important; gap: 4px 12px !important; }
  .list > .row[style*="grid-template-columns"]:not(.head) > :nth-child(n+3), .who-row > :nth-child(n+3) { grid-column: 1 / -1; }
  .list > .row.head[style*="grid-template-columns"] { display: none; }
  .section-head .right.keep { display: inline; }
}

/* [hidden] має перемагати display: … компонентів (.btn тощо) */
[hidden] { display: none !important; }

/* баланс PROFITs */
.balance-hero { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 20px 48px; margin: 6px 0 22px; }
.balance-num { font-size: 56px; line-height: 1.05; font-weight: 600; letter-spacing: -0.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.balance-num.neg { color: var(--danger); }
.balance-split { display: grid; gap: 8px; padding-bottom: 6px; }
.balance-split > div { display: flex; gap: 10px; align-items: baseline; }
.balance-split b { font-variant-numeric: tabular-nums; min-width: 64px; }
.bal-row { display: grid; grid-template-columns: 96px minmax(0,1fr) 110px; gap: 16px; align-items: center; }
.bals-row { display: grid; grid-template-columns: minmax(0,1fr) 120px 80px 120px; gap: 16px; align-items: center; color: inherit; }
.bal-amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.bal-amt.plus { color: var(--ok); }
.bal-amt.minus { color: var(--danger); }
.wallet { margin-top: 8px; color: var(--text-2); line-height: 1.45; }
.short { color: var(--danger); }
@media (max-width: 640px) {
  .balance-num { font-size: 44px; }
  .bal-row { grid-template-columns: minmax(0,1fr) auto; }
  .bal-row > :first-child { grid-column: 1 / -1; }
  .bals-row { grid-template-columns: minmax(0,1fr) auto; }
  .bals-row > :nth-child(3), .bals-row > :nth-child(4) { display: none; }
  .list > .row.head.bals-row { display: none; }
}
.balance-split .cap { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.balance-split.prev { padding-left: 32px; border-left: 1px solid var(--border); }
@media (max-width: 640px) { .balance-split.prev { padding-left: 0; border-left: 0; } }
