/* bank-invoice PWA — мобільний перш за все; від 900 px — бокова навігація і панель картки */
:root {
  --bg: #f6f5f1; --card: #fff; --ink: #1d2422; --muted: #6b726f; --line: #e4e1d9; --soft: #efede7;
  --brand: #1f6f5c; --brand-ink: #fff; --brand-soft: #e3f1ec;
  --green: #1d7a4a; --green-bg: #e3f4ea; --amber: #8a5a00; --amber-bg: #fdf1d8; --red: #b42318; --red-bg: #fde8e6;
  --blue: #1d4f91; --blue-bg: #e5eefb; --gray-bg: #eceae4;
  --radius: 12px; --tap: 44px; --nav-h: 64px; --side-w: 232px; --detail-w: 460px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 24px rgba(0,0,0,.06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.45; color: var(--ink); background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141716; --card: #1d2120; --ink: #e9ecea; --muted: #9aa3a0; --line: #2e3432; --soft: #252a29;
    --brand: #3aa58a; --brand-soft: #1f3a33; --green: #5ccf8f; --green-bg: #173326; --amber: #f2c46b; --amber-bg: #3a2e14;
    --red: #ff8a80; --red-bg: #3d1d1b; --blue: #8cb4ff; --blue-bg: #1b2a44; --gray-bg: #2a2f2d; --shadow: none; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 24px; margin: 8px 0; } h2 { font-size: 19px; margin: 18px 0 10px; } h3 { font-size: 15px; margin: 0; }
.muted { color: var(--muted); } .small { font-size: 13px; } .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; }
[hidden] { display: none !important; }
.boot { display: grid; place-items: center; height: 80vh; }

/* кнопки */
.btn { min-height: var(--tap); padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; text-decoration: none; white-space: nowrap; font-weight: 500; }
.btn:hover { border-color: #c9c5bb; } .btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.big { min-height: 52px; font-size: 17px; width: 100%; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.link { background: none; border: none; color: var(--brand); padding: 0 4px; min-height: 32px; }
.btn.light { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.3); }
.btn.danger-o { color: var(--red); border-color: var(--red-bg); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }

.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block;
  animation: sp .8s linear infinite; vertical-align: -2px; margin-right: 6px; opacity: .7; }
.spin.big { width: 32px; height: 32px; border-width: 3px; color: var(--brand); }
@keyframes sp { to { transform: rotate(360deg); } }

/* вхід */
body.login { padding: 0; display: grid; place-items: center; min-height: 100vh; }
.login-card { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 28px 22px; width: min(420px, 94vw); margin: 24px auto; }
.login-card label { display: block; margin: 14px 0; font-size: 14px; color: var(--muted); }
.login-card input { display: block; width: 100%; margin-top: 6px; }
.logo { margin-bottom: 6px; }
input, select, textarea { border: 1px solid var(--line); background: var(--card); border-radius: 10px; min-height: var(--tap); padding: 8px 12px; width: 100%; }
textarea { resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }

/* банери */
.bar { padding: 8px 16px; font-size: 14px; text-align: center; }
.bar.info { background: var(--blue-bg); color: var(--blue); } .bar.warn { background: var(--amber-bg); color: var(--amber); } .bar.danger { background: var(--red-bg); color: var(--red); }
.alert { border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: 14px; }
.alert.danger { background: var(--red-bg); color: var(--red); } .alert.warn { background: var(--amber-bg); color: var(--amber); } .alert.info { background: var(--blue-bg); color: var(--blue); }
.alert summary { cursor: pointer; font-weight: 600; }

/* шапка */
#side { display: none; }
#top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.org-wrap { flex: 1; min-width: 0; }
#orgSel { font-weight: 600; border: none; background: transparent; padding-left: 0; min-height: 36px; text-overflow: ellipsis; }
.org-wrap.single #orgSel { pointer-events: none; appearance: none; }
.up-ind { background: var(--blue-bg); color: var(--blue); border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 600; }
#main { padding: 12px 14px 120px; max-width: 980px; margin: 0 auto; }

/* панель інструментів */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.seg { display: inline-flex; background: var(--soft); border-radius: 11px; padding: 3px; }
.seg button { border: none; background: none; padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 500; color: var(--muted); min-height: 38px; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.search { flex: 1; min-width: 180px; }
.list-head { display: flex; justify-content: space-between; align-items: center; min-height: 38px; font-size: 14px; padding: 0 2px; }
.list-head .chk { width: auto; gap: 8px; }

/* групи і рядки */
.group { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin: 10px 0 14px; overflow: hidden; }
.g-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; padding: 6px 12px 6px 4px; border-bottom: 1px solid var(--line); background: var(--soft); }
.g-head h3 { flex: 0 1 auto; } .g-meta { color: var(--muted); font-size: 13px; flex: 1; white-space: nowrap; }
.g-att .g-head { background: color-mix(in srgb, var(--amber-bg) 70%, var(--soft)); }
.day.short .g-head { background: var(--red-bg); } .day.short .g-head .g-meta { color: var(--red); font-weight: 600; }
.chk, .chk-sp { width: var(--tap); height: var(--tap); display: inline-flex; align-items: center; justify-content: center; flex: none; cursor: pointer; }
.chk input { width: 20px; height: 20px; min-height: 0; accent-color: var(--brand); cursor: pointer; }
.chk.off { opacity: .25; cursor: default; }
.row { display: flex; align-items: center; gap: 4px; padding: 8px 12px 8px 4px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; outline-offset: -3px; }
.row:last-child { border-bottom: none; }
.row:hover { background: color-mix(in srgb, var(--soft) 60%, transparent); }
.row.sel { background: var(--brand-soft); }
.row.open { box-shadow: inset 4px 0 0 var(--brand); }
.row.lvl-danger::before, .row.lvl-error::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--red); }
.row.queued { cursor: default; opacity: .8; }
.r-main { flex: 1; min-width: 0; }
.r-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.r-name { font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.r-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.r-sum { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.org-tag { font-size: 11px; vertical-align: 1px; background: var(--gray-bg); border-radius: 6px; padding: 1px 6px; color: var(--muted); white-space: nowrap; flex: none; }
.badge { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.badge.gray { background: var(--gray-bg); color: var(--muted); } .badge.green { background: var(--green-bg); color: var(--green); }
.badge.green-o { border: 1px solid var(--green); color: var(--green); } .badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.red { background: var(--red-bg); color: var(--red); } .badge.red.strong { background: var(--red); color: #fff; }
.badge.blue { background: var(--blue-bg); color: var(--blue); }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty.first { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); margin-top: 16px; color: var(--ink); }
.empty.first .btn.big { max-width: 320px; margin: 10px auto 4px; }
.empty-ico { font-size: 48px; }
.hint { background: var(--blue-bg); color: var(--blue); border-radius: var(--radius); padding: 10px 40px 10px 14px; margin-bottom: 10px; position: relative; font-size: 14px; }
.hint .muted { color: inherit; opacity: .85; display: block; }
.hint .x { position: absolute; right: 4px; top: 4px; border: none; background: none; width: 36px; height: 36px; cursor: pointer; color: inherit; }

/* нижня навігація */
#bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: var(--card); border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; align-items: center; }
#bottom button { border: none; background: none; display: flex; flex-direction: column; align-items: center; font-size: 12px; color: var(--muted); height: 100%; cursor: pointer; }
#bottom button .ico { font-size: 20px; line-height: 1.2; }
#bottom button.active { color: var(--brand); font-weight: 600; }
#bottom .fab { order: 0; }
#bottom .fab span { width: 62px; height: 62px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 26px;
  box-shadow: 0 6px 18px rgba(31,111,92,.35); margin-top: -26px; border: 4px solid var(--bg); }
#bottom button[data-view="list"] { order: -1; }
body.selecting #bottom { display: none; }

/* панель вибору */
#selbar { position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 35; background: var(--ink); color: var(--bg);
  border-radius: 16px; padding: 10px 10px 10px 16px; display: flex; align-items: center; gap: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.25); flex-wrap: wrap; }
.sb-info { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 120px; } .sb-info span { opacity: .8; font-size: 14px; }
.sb-x { order: 1; }
.sb-act { display: grid; grid-template-columns: 1fr auto 1.6fr; gap: 6px; width: 100%; order: 2; }
@media (min-width: 640px) { .sb-act { display: flex; width: auto; order: 1; } .sb-x { order: 2; } }
#selbar .btn { background: rgba(255,255,255,.12); color: inherit; border-color: transparent; }
#selbar .btn.primary { background: #3fbf98; color: #0c2a22; }
@media (prefers-color-scheme: dark) { #selbar { background: #e9ecea; color: #141716; } #selbar .btn { background: rgba(0,0,0,.08); } }

/* шторка */
#sheetWrap { position: fixed; inset: 0; z-index: 60; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.35); opacity: 0; transition: opacity .18s; }
#sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--card); border-radius: 18px 18px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  max-height: 88vh; overflow: auto; transform: translateY(100%); transition: transform .2s ease; }
#sheetWrap.show .sheet-bg { opacity: 1; } #sheetWrap.show #sheet { transform: none; }
#sheet h2 { margin-top: 0; }
.sheet-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.sheet-btns .btn { flex: 1; max-width: 240px; }
.sum-org { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.so-name { font-weight: 600; margin-bottom: 4px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 14px; }
.kv span { color: var(--muted); } .kv b { font-weight: 600; text-align: right; } .neg { color: var(--red); } .okc { color: var(--green); } .badc { color: var(--red); }
.mini { margin: 6px 0 0 18px; padding: 0; font-size: 14px; } .mini li { margin: 2px 0; } .mini li.other { color: var(--red); }
.radio { display: flex; align-items: center; gap: 8px; margin: 6px 0; } .radio input { width: 18px; min-height: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip { border: 1px solid var(--line); background: var(--soft); border-radius: 999px; padding: 8px 14px; cursor: pointer; min-height: 40px; }
#sheet label { display: block; font-size: 14px; color: var(--muted); margin: 10px 0; } #sheet label input { margin-top: 4px; }
.menu { display: flex; flex-direction: column; }
.mi { text-align: left; border: none; background: none; padding: 14px 6px; border-bottom: 1px solid var(--line); cursor: pointer; text-decoration: none; color: inherit; font-size: 16px; }
.mi.danger { color: var(--red); }
.pair-code { font-size: 34px; font-weight: 700; letter-spacing: .12em; text-align: center; padding: 14px; background: var(--soft); border-radius: 12px; font-family: ui-monospace, Menlo, monospace; }

/* картка рахунку — мобільний: на весь екран */
#detail { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; }
.d-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--card); }
.d-title { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-save { white-space: nowrap; }
.d-scroll { flex: 1; overflow: auto; padding: 0 0 16px; -webkit-overflow-scrolling: touch; }
.d-loading { display: grid; place-items: center; height: 60vh; }
.photo { background: #2b2f2e; height: 36vh; min-height: 200px; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.photo img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; }
.photo iframe { width: 100%; height: 100%; border: none; background: #fff; }
.photo .btn { position: absolute; right: 10px; bottom: 10px; }
.ph-miss { color: #ccc; font-size: 14px; padding: 20px; text-align: center; }
.status { margin: 12px 14px 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.status.ok { background: var(--green-bg); color: var(--green); } .status.danger { background: var(--red-bg); color: var(--red); } .status.info { background: var(--blue-bg); color: var(--blue); }
.checks { margin: 12px 14px 0; display: flex; flex-direction: column; gap: 6px; }
.chk-item { display: flex; gap: 10px; padding: 9px 12px; border-radius: 10px; font-size: 14px; align-items: flex-start; }
.chk-item .ci { flex: none; width: 20px; text-align: center; }
.chk-item.error { background: var(--red-bg); color: var(--red); }
.chk-item.danger { background: var(--red); color: #fff; font-size: 15px; padding: 12px; }
.chk-item.warning { background: var(--amber-bg); color: var(--amber); }
.chk-item.info { background: var(--soft); color: var(--muted); }
.chk-item.ok { background: var(--green-bg); color: var(--green); }
.hist { margin: 10px 14px 0; font-size: 14px; background: var(--card); border-radius: 10px; padding: 8px 12px; } .hist summary { cursor: pointer; color: var(--muted); }
.form { padding: 4px 14px 0; }
.form.disabled { opacity: .5; pointer-events: none; }
.f { display: block; margin: 12px 0 0; font-size: 13px; color: var(--muted); position: relative; }
.f input, .f textarea { margin-top: 4px; font-size: 16px; color: var(--ink); }
.f.unclear input { background: var(--amber-bg); border-color: #e6b44a; }
.f small { color: var(--amber); display: block; margin-top: 2px; }
.f .cnt { float: right; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.items { margin: 12px 0; font-size: 14px; } .items summary { cursor: pointer; color: var(--muted); }
.d-foot { display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--card); }
.d-foot .btn { flex: none; padding: 0 14px; } .d-foot .btn.primary { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.only-w { display: none; }
body.detail-open { overflow: hidden; }

/* календар */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 6px 0 14px; }
.tile { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; display: flex; flex-direction: column; }
.tile span { color: var(--muted); font-size: 13px; } .tile b { font-size: 22px; font-variant-numeric: tabular-nums; } .tile small { color: var(--muted); font-size: 12px; }
.tile.bad { background: var(--red-bg); } .tile.bad span, .tile.bad b, .tile.bad small { color: var(--red); }
.tile.good b { color: var(--green); }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 150px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 10px 4px; }
.bar-c { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; border: none; background: none; cursor: pointer; padding: 0; min-width: 0; }
.bar-c .bar { width: 100%; max-width: 26px; background: #5dcaa5; border-radius: 4px 4px 0 0; }
.bar-c .bar.neg { background: #f09595; }
.bar-c .dot { color: #7f77dd; font-size: 10px; height: 14px; }
.bar-c .lbl { font-size: 11px; color: var(--muted); }

/* «Ще» */
.more .card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; }
.c-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; gap: 8px; }
.more .btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.more .card > .btn { margin-top: 10px; }
.steps { margin: 0 0 8px 18px; padding: 0; } .steps li { margin: 4px 0; }

/* камера */
#camera { position: fixed; inset: 0; z-index: 70; background: #000; color: #fff; display: flex; flex-direction: column; }
.cam-top { display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) 10px 8px; }
.cam-org { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .cam-cnt { font-size: 14px; opacity: .85; }
.cam-view { flex: 1; position: relative; overflow: hidden; display: grid; place-items: center; }
.cam-view video { width: 100%; height: 100%; object-fit: cover; }
.frame { position: absolute; inset: 6% 9%; border: 2px dashed rgba(255,255,255,.55); border-radius: 12px; pointer-events: none; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flash.go { animation: fl .25s ease-out; } @keyframes fl { from { opacity: .8; } to { opacity: 0; } }
.cam-msg { position: absolute; text-align: center; padding: 20px; max-width: 320px; }
.cam-msg .btn { margin-top: 12px; }
.cam-bottom { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 14px 16px 6px; gap: 10px; }
.cam-bottom .btn { justify-self: end; }
.thumbs { display: flex; gap: 4px; } .thumbs img { width: 44px; height: 56px; object-fit: cover; border-radius: 6px; border: 2px solid #fff; }
.shutter { width: 78px; height: 78px; border-radius: 50%; border: 4px solid #fff; background: transparent; padding: 5px; cursor: pointer; }
.shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; transition: transform .1s; }
.shutter:active span { transform: scale(.9); } .shutter:disabled { opacity: .4; }
.gal { margin: 0 auto calc(10px + env(safe-area-inset-bottom)); }

/* toast, zoom, drop */
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 80;
  background: #222826; color: #fff; padding: 10px 14px; border-radius: 12px; display: flex; gap: 12px; align-items: center; opacity: 0; pointer-events: none;
  transition: all .2s; max-width: 92vw; box-shadow: 0 8px 24px rgba(0,0,0,.25); font-size: 15px; }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; } #toast.danger { background: var(--red); }
body.selecting #toast { bottom: 96px; }
.zoom { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.92); overflow: auto; }
.zoom .zx { position: fixed; top: 12px; right: 12px; z-index: 2; }
.zoom .zi { min-height: 100%; display: grid; place-items: center; }
.zoom img { max-width: 100vw; max-height: 100vh; cursor: zoom-in; } .zoom img.big { max-width: none; max-height: none; width: 220vw; cursor: zoom-out; }
body.dropping::after { content: "Відпустіть, щоб завантажити рахунки"; position: fixed; inset: 12px; border: 3px dashed var(--brand); border-radius: 18px;
  background: color-mix(in srgb, var(--brand-soft) 85%, transparent); display: grid; place-items: center; font-size: 22px; font-weight: 600; color: var(--brand); z-index: 100; }
.pad { padding: 16px; }

/* ПК */
@media (min-width: 900px) {
  body { padding: 0 0 0 var(--side-w); }
  #bottom { display: none; }
  #side { display: flex; flex-direction: column; gap: 6px; position: fixed; left: 0; top: 0; bottom: 0; width: var(--side-w); padding: 16px 12px;
    background: var(--card); border-right: 1px solid var(--line); z-index: 25; }
  .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; padding: 4px 8px 14px; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; }
  .side-nav button { border: none; background: none; text-align: left; padding: 10px 12px; border-radius: 10px; cursor: pointer; font-size: 15px; display: flex; gap: 10px; color: var(--muted); }
  .side-nav button.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
  .side-nav .ico { width: 20px; text-align: center; }
  .side-upload { margin-top: 14px; } .side-hint { padding: 0 8px; }
  #main { padding: 16px 24px 120px; }
  body.has-detail #body { margin-right: var(--detail-w); }
  #detail { left: auto; width: var(--detail-w); border-left: 1px solid var(--line); box-shadow: -8px 0 30px rgba(0,0,0,.05); z-index: 40; }
  body.detail-open { overflow: auto; }
  .only-m { display: none; } .only-w { display: inline-flex; }
  .d-nav { display: flex; }
  .photo { height: 38vh; }
  #selbar { left: calc(var(--side-w) + 24px); right: 24px; bottom: 18px; max-width: 900px; }
  body.has-detail #selbar { right: calc(var(--detail-w) + 24px); }
  #sheet { left: 50%; right: auto; top: 50%; bottom: auto; width: min(520px, 92vw); border-radius: 18px; transform: translate(-50%, -46%) scale(.98); opacity: 0;
    transition: all .18s ease; max-height: 86vh; }
  #sheetWrap.show #sheet { transform: translate(-50%, -50%); opacity: 1; }
  #toast { bottom: 24px; }
}

/* Кілька рахунків організації */
.f select { margin-top: 4px; font-size: 16px; color: var(--ink); }
.f.unclear select { background: var(--amber-bg); border-color: #e6b44a; }
.kv.payer { margin-top: 12px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.acc-tag { color: var(--brand); white-space: nowrap; }
.cal-acc { width: auto; max-width: 100%; min-height: 36px; padding: 4px 10px; font-size: 14px; }
.accs { margin: 8px 0; border-top: 1px solid var(--line); }
.acc { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.acc small, .acc-mi small { display: block; color: var(--muted); font-size: 12px; }
.acc .r, .acc-mi .r { text-align: right; flex: none; }
.acc-mi { display: flex; justify-content: space-between; gap: 10px; align-items: center; width: 100%; }
.acc-mi:disabled { opacity: .5; cursor: default; }
