:root {
  --bg: #f6f4f0; --surface: #ffffff; --text: #1f1d1a; --muted: #75706a; --line: #e4dfd7;
  --accent: #1f5f5b; --accent-ink: #ffffff; --danger: #b3402e; --ok: #2e7d4f; --warn: #a86b00;
  --star: #e0a100; --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161514; --surface: #201f1d; --text: #ece8e2; --muted: #a39d95; --line: #34312d;
    --accent: #5fb3aa; --accent-ink: #0d1f1d; --danger: #e0715f; --ok: #6cc28f; --warn: #e3a94a;
  }
}
:root[data-theme="dark"] {
  --bg: #161514; --surface: #201f1d; --text: #ece8e2; --muted: #a39d95; --line: #34312d;
  --accent: #5fb3aa; --accent-ink: #0d1f1d; --danger: #e0715f; --ok: #6cc28f; --warn: #e3a94a;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--accent); }
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar { padding: 20px 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; color: var(--text); text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { padding: 8px 12px; border-radius: 8px; color: var(--text); text-decoration: none; }
.sidebar nav a.active, .sidebar nav a:hover { background: var(--surface); color: var(--accent); }
.user { margin-top: auto; font-size: 12px; color: var(--muted); word-break: break-all; }
.content { padding: 24px 32px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
h1 { font-size: 28px; margin: 0 0 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.object { margin-bottom: 14px; }
.object-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.object-head details { flex: 1; min-width: 200px; }
.object-head summary { cursor: pointer; font-size: 17px; }
.folder { color: var(--muted); font-weight: 600; margin: 22px 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.cards { width: 100%; border-collapse: collapse; }
.cards td { padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.inline input { flex: 1; min-width: 160px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; }
input, textarea, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; }
.btn { font: inherit; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 8px 14px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-danger { color: var(--danger); }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text);
  width: min(560px, calc(100vw - 32px)); padding: 20px; }
dialog::backdrop { background: rgba(0,0,0,.35); }
.muted { color: var(--muted); }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; border: 1px solid var(--line); background: var(--surface); }
.msg-error { border-color: var(--danger); color: var(--danger); }
.msg-ok { border-color: var(--ok); color: var(--ok); }
.status { font-size: 13px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap; }
.st-ok { color: var(--ok); border-color: var(--ok); }
.st-failed { color: var(--danger); border-color: var(--danger); }
.st-pending, .st-running { color: var(--warn); border-color: var(--warn); }
.err { color: var(--danger); font-size: 13px; margin-top: 4px; }
.pf { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 6px;
  font-size: 11px; font-weight: 700; color: #fff; background: #777; vertical-align: middle; }
.pf-yandex { background: #d9442f; } .pf-2gis { background: #2f9e44; } .pf-google { background: #3b6fd8; }
.pf-otzovik { background: #c2410c; } .pf-irecommend { background: #9333ea; } .pf-yell { background: #b8860b; }
.pf-zoon { background: #0e7490; } .pf-tbank { background: #c9a400; color: #222; }
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 16px; flex-wrap: wrap; }
  .sidebar nav { flex-direction: row; }
  .user { display: none; }
  .content { padding: 16px; }
  .cards td { display: block; border-top: 0; padding: 4px 0; }
  .cards tr { display: block; border-top: 1px solid var(--line); padding: 8px 0; }
  .actions { justify-content: flex-start; }
}
/* feed */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters .search { flex: 1 1 260px; }
.filters .chk, .filters .period { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.dd { position: relative; }
.dd summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--bg); }
.dd[open] .dd-body { position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; min-width: 180px; }
.summary-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.views { display: flex; gap: 4px; }
.feed { display: grid; gap: 12px; }
.feed.view-tiles { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.feed.view-rows .photos, .feed.view-rows .answer { display: none; }
.feed.view-rows .review { padding: 10px 14px; }
.review { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rv-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.rv-date { margin-left: auto; }
.rv-link { text-decoration: none; }
.rv-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stars span { color: var(--line); } .stars span.on { color: var(--star); }
.rv-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.rv-text summary { list-style: none; cursor: pointer; }
.rv-text summary .more { color: var(--accent); white-space: nowrap; }
.rv-text[open] summary .preview, .rv-text[open] summary .more { display: none; }
.rv-text p { margin: 0; }
.photos { display: flex; gap: 6px; flex-wrap: wrap; }
.photos img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.answer { background: var(--bg); border-radius: 8px; padding: 8px 10px; font-size: 14px; white-space: pre-line; }
.dup { font-size: 13px; color: var(--warn); }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 18px 0; }
.summary-row .total { font-weight: 600; }
/* analytics */
.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
.chart-card h2 { font-size: 16px; margin: 0 0 10px; }
.chart-box { position: relative; height: 240px; }
.chart-card details { margin-top: 10px; font-size: 14px; }
table.data { border-collapse: collapse; margin-top: 6px; width: 100%; }
table.data th, table.data td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--line); }
@media (max-width: 760px) { .charts { grid-template-columns: 1fr; } }
/* analytics v2 */
:root { --st5: #2a78d6; --st4: #86b6ef; --st3: #c9c7c1; --st2: #f0a09f; --st1: #e34948; --bad: #c0362c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --st5: #3987e5; --st4: #1c5cab; --st3: #6b6964; --st2: #8f3b3a; --st1: #e66767; --bad: #ef8a80; } }
:root[data-theme="dark"] { --st5: #3987e5; --st4: #1c5cab; --st3: #6b6964; --st2: #8f3b3a; --st1: #e66767; --bad: #ef8a80; }
.an-block { margin-bottom: 14px; }
.an-block h2 { font-size: 17px; margin: 0 0 14px; }
.an-block h3 { font-size: 14px; color: var(--muted); margin: 14px 0 6px; font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); }
.tile { padding: 4px 18px; border-left: 1px solid var(--line); }
.tile:first-child { border-left: 0; padding-left: 0; }
.tile-label { color: var(--muted); font-size: 14px; }
.tile-value { font-size: 34px; font-weight: 700; line-height: 1.2; }
.tile-value small { font-size: 15px; color: var(--muted); font-weight: 500; }
.tile-note { font-size: 13px; color: var(--muted); }
.bad { color: var(--bad); }
.table-wrap { overflow-x: auto; }
.an-table th { color: var(--muted); font-weight: 500; font-size: 14px; }
.an-table td, .an-table th { padding: 10px 8px; }
.an-table .r, #tbl-periods .r { text-align: right; }
.an-table tr.total td { font-weight: 700; background: var(--bg); }
.num { display: inline-block; min-width: 2.5em; }
.minibar { display: inline-block; width: 72px; height: 6px; border-radius: 3px; background: var(--line); margin-left: 8px; vertical-align: middle; }
.minibar span { display: block; height: 100%; border-radius: 3px; background: var(--st5); }
.note { font-size: 13px; margin: 10px 0 0; }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 40px 1fr 110px; align-items: center; gap: 10px; }
.bar-label { color: var(--muted); }
.bar-track { height: 14px; background: var(--bg); border-radius: 7px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 7px; }
.bar-fill.st5 { background: var(--st5); } .bar-fill.st4 { background: var(--st4); } .bar-fill.st3 { background: var(--st3); }
.bar-fill.st2 { background: var(--st2); } .bar-fill.st1 { background: var(--st1); }
.bar-value { text-align: right; white-space: nowrap; font-size: 14px; }
@media (max-width: 760px) {
  .tiles { grid-template-columns: 1fr 1fr; gap: 12px; }
  .tile { border-left: 0; padding: 0; }
}
[hidden] { display: none !important; }
/* analytics layout */
.an-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.an-grid .an-block { margin-bottom: 0; min-width: 0; }
.an-grid .w-full { grid-column: 1 / -1; }
.bar-label.wide { white-space: nowrap; }
.bars + .table-wrap { margin-top: 14px; }
.an-table.small td, .an-table.small th { padding: 6px 8px; font-size: 14px; }
.layout-dialog { width: min(640px, calc(100vw - 32px)); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog-head h2 { margin: 0; }
.layout-list { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-direction: column; }
.layout-row { display: grid; grid-template-columns: 1fr auto 36px 36px; align-items: center; gap: 8px; padding: 8px 0;
  border-bottom: 1px solid var(--line); }
.layout-row.off .layout-name { color: var(--muted); }
.layout-row.off .seg, .layout-row.off .mv { opacity: .45; }
.layout-name { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.layout-name input { width: 18px; height: 18px; accent-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { font: inherit; font-size: 13px; border: 0; background: var(--surface); color: var(--muted); padding: 4px 10px; cursor: pointer; }
.seg button.on { background: var(--bg); color: var(--accent); font-weight: 700; }
.seg-placeholder { width: 1px; }
.mv:disabled { visibility: hidden; }
@media (max-width: 760px) { .an-grid { grid-template-columns: 1fr; } .layout-row { grid-template-columns: 1fr auto 32px 32px; } }
.bar-row:has(.bar-label.wide) { grid-template-columns: 90px 1fr 130px; }
.seg button { font-size: 16px; padding: 3px 12px; letter-spacing: -2px; }
/* icons */
.icon { flex: none; vertical-align: middle; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; }
.sidebar nav a .icon { color: var(--muted); }
.sidebar nav a.active .icon, .sidebar nav a:hover .icon { color: var(--accent); }
.btn .icon { width: 18px; height: 18px; margin: -2px 4px 0 -2px; }
@media (max-width: 760px) { .sidebar nav a { gap: 6px; padding: 8px 10px; } }
/* compact tiles */
.feed.view-tiles { align-items: start; }
.feed.view-tiles .review, .feed.view-rows .review { gap: 6px; padding: 12px 14px; }
.feed.view-tiles .rv-text p, .feed.view-tiles .rv-text:not(details) {
  display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.feed.view-tiles .rv-text[open] p { display: block; -webkit-line-clamp: unset; }
details.answer { background: var(--bg); border-radius: 8px; padding: 6px 10px; font-size: 14px; }
details.answer summary { cursor: pointer; color: var(--muted); list-style: none; }
details.answer summary::after { content: " ▸"; }
details.answer[open] summary::after { content: " ▾"; }
details.answer .answer-text { white-space: pre-line; margin-top: 6px; max-height: 320px; overflow: auto; }
.feed.view-rows details.answer { display: none; }
/* platform logos */
.pf-logo { width: 22px; height: 22px; border-radius: 6px; vertical-align: middle; object-fit: contain;
  background: #fff; border: 1px solid var(--line); padding: 1px; flex: none; }
/* rating menu, period picker, open button */
.dd-menu .dd-body label { padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.dd-menu .dd-body label.on { color: var(--accent); font-weight: 700; }
.dd-menu .dd-body input[type=radio] { display: none; }
.dd-menu .dd-body label:hover { background: var(--bg); }
.dd summary { display: flex; align-items: center; gap: 6px; }
.period-dd[open] .period-body { flex-direction: row; padding: 0; min-width: 560px; gap: 0; }
.period-presets { display: flex; flex-direction: column; padding: 10px; border-right: 1px solid var(--line); min-width: 150px; }
.period-presets button { font: inherit; text-align: left; background: none; border: 0; color: var(--text); padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.period-presets button:hover { background: var(--bg); color: var(--accent); }
.period-cal { padding: 12px; flex: 1; }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-wd { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal-day { font: inherit; border: 0; background: none; color: var(--text); padding: 8px 0; border-radius: 6px; cursor: pointer; }
.cal-day:hover:not(:disabled) { background: var(--bg); }
.cal-day:disabled { color: var(--line); cursor: default; }
.cal-day.in { background: color-mix(in srgb, var(--accent) 18%, transparent); border-radius: 0; }
.cal-day.edge { background: var(--accent); color: var(--accent-ink); border-radius: 6px; }
.cal-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 10px; }
.rv-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.rv-foot .dup { flex: 1; }
.open-btn { position: relative; margin-left: auto; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  color: var(--accent); background: var(--bg); text-decoration: none; }
.open-btn:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.open-btn::after { content: attr(data-tip); position: absolute; right: 0; bottom: calc(100% + 8px); white-space: nowrap;
  background: var(--text); color: var(--bg); font-size: 13px; padding: 5px 9px; border-radius: 6px; opacity: 0; pointer-events: none;
  transform: translateY(4px); transition: opacity .12s, transform .12s; z-index: 10; }
.open-btn:hover::after, .open-btn:focus-visible::after { opacity: 1; transform: none; }
@media (max-width: 760px) { .period-dd[open] .period-body { flex-direction: column; min-width: 0; width: calc(100vw - 48px); }
  .period-presets { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); } }
/* objects page v2 */
.head-actions { display: flex; gap: 8px; }
.obj-toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.obj-toolbar #obj-search { flex: 1 1 260px; }
.obj-row { padding: 0; margin-bottom: 10px; }
.obj-row > summary { list-style: none; cursor: pointer; }
.obj-row > summary::-webkit-details-marker { display: none; }
.obj-summary { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.obj-caret { color: var(--muted); transition: transform .15s; width: 12px; }
.obj-row[open] .obj-caret { transform: rotate(90deg); }
.obj-name { font-size: 17px; min-width: 120px; }
.obj-logos { display: flex; gap: 6px; flex: 1; justify-content: center; flex-wrap: wrap; }
.obj-logo { position: relative; display: inline-flex; }
.obj-logo .pf-logo, .obj-logo .pf { width: 30px; height: 30px; border-radius: 8px; }
.obj-logo::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%;
  border: 2px solid var(--surface); display: none; }
.st-dot-failed::after { display: block; background: var(--danger); }
.st-dot-pending::after, .st-dot-running::after { display: block; background: var(--warn); }
.st-dot-paused::after, .st-dot-unsupported::after { display: block; background: var(--muted); }
.obj-count { white-space: nowrap; }
.inline-form { display: inline; margin: 0; }
.icon-btn { font: inherit; display: inline-grid; place-items: center; min-width: 34px; height: 34px; border-radius: 8px;
  border: 0; background: none; color: var(--muted); cursor: pointer; list-style: none; font-size: 18px; }
.icon-btn:hover:not(:disabled) { background: var(--bg); color: var(--accent); }
.icon-btn:disabled { opacity: .4; cursor: default; }
.obj-summary .icon-btn svg { color: var(--ok); }
.menu { position: relative; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 190px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.menu-body > *, .menu-body form > button { font: inherit; text-align: left; padding: 8px 10px; border-radius: 6px; border: 0;
  background: none; color: var(--text); text-decoration: none; cursor: pointer; width: 100%; }
.menu-body > *:hover, .menu-body form > button:hover { background: var(--bg); }
.menu-body .danger, .link-btn.danger { color: var(--danger); }
.obj-row > table.cards { margin: 0 16px 12px; width: calc(100% - 32px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog-head h2 { margin: 0; }
.stack-label { font-weight: 600; }
.edit-dialog { width: min(680px, calc(100vw - 32px)); }
.link-list { list-style: none; margin: 0; padding: 4px 10px; border: 1px solid var(--line); border-radius: 10px; }
.link-row { display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.link-row:last-child { border-bottom: 0; }
.link-row input, .link-row textarea { width: 100%; resize: vertical; }
.link-row .pf-logo, .link-row .pf { width: 30px; height: 30px; }
.pf-add { background: var(--bg) !important; color: var(--muted) !important; font-size: 18px; }
.edit-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.edit-foot .spacer { flex: 1; }
.link-btn { font: inherit; border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; text-decoration: none; }
.folder-dialog { width: min(640px, calc(100vw - 32px)); }
.pick { border: 1px solid var(--line); border-radius: 10px; }
.pick-head { display: flex; gap: 10px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pick-search { flex: 1 1 200px; }
.pick-list { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow: auto; }
.pick-list li { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.pick-list label { display: flex; gap: 10px; align-items: center; cursor: pointer; font-weight: 400; }
.pick-foot { padding: 8px 12px; }
@media (max-width: 760px) {
  .obj-summary { flex-wrap: wrap; gap: 8px; }
  .obj-logos { order: 5; flex-basis: 100%; justify-content: flex-start; padding-left: 24px; }
  .head-actions { width: 100%; }
}
.cal-day.edge, .cal-day.edge:hover:not(:disabled) { background: var(--accent); color: var(--accent-ink); border-radius: 6px; }
/* period picker as fixed popover */
.dd-btn { font: inherit; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--bg); }
.dd-btn[aria-expanded="true"] { border-color: var(--accent); }
.popover { position: fixed; z-index: 1000; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.28); }
.period-body.popover { display: flex; flex-direction: row; width: min(580px, calc(100vw - 16px)); }
.period-body.popover[hidden] { display: none; }
@media (max-width: 760px) { .period-body.popover { flex-direction: column; } }
/* folders as groups */
.folder-group { padding: 0; margin-bottom: 12px; overflow: visible; }
.folder-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 60%, var(--surface));
  border-radius: var(--radius) var(--radius) 0 0; }
.folder-group:has(.folder-items[hidden]) .folder-row { border-radius: var(--radius); }
.folder-icon { color: #e8b84a; flex: none; }
.folder-name { font-size: 17px; }
.folder-meta { flex: 1; text-align: center; }
.folder-toggle { font-size: 14px; }
.folder-items > .obj-row { border: 0; border-top: 1px solid var(--line); border-radius: 0; margin: 0; background: none; }
.folder-items > .obj-row .obj-summary { padding-left: 40px; }
.folder-items > .obj-row:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.folder-empty { padding: 12px 16px 14px 56px; margin: 0; border-top: 1px solid var(--line); font-size: 14px; }
.loose-items > .obj-row { margin-bottom: 10px; }
.muted-link { color: var(--muted); white-space: nowrap; }
.muted-link:hover { color: var(--accent); }
@media (max-width: 760px) { .folder-meta { display: none; } .folder-items > .obj-row .obj-summary { padding-left: 20px; } }
/* filters: одна высота у всех полей, ширина по строке, перенос при нехватке места */
.filters { --ctl-h: 42px; gap: 10px; }
.filters > select, .filters > .dd, .filters > .period-dd, .filters > .chk { flex: 1 1 auto; }
.filters > select, .filters .dd > summary, .filters .dd-btn, .filters > .search, .filters > .btn, .filters > .chk {
  height: var(--ctl-h); box-sizing: border-box; margin: 0; }
.filters > select { -webkit-appearance: none; appearance: none; padding: 0 34px 0 12px; min-width: 0;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5-5 5 5M7 14l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center;
  cursor: pointer; }
.filters .dd > summary, .filters .dd-btn { width: 100%; padding: 0 12px; justify-content: flex-start; white-space: nowrap; }
.filters > .chk { border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: var(--bg); cursor: pointer; white-space: nowrap; }
.filters > .btn { display: inline-flex; align-items: center; justify-content: center; }
.filters > .search { padding: 0 12px; }
.filters .f-break { flex-basis: 100%; height: 0; }
.filters > .period { flex: 0 1 auto; }
.filters .period input, .filters .period .btn { height: var(--ctl-h); box-sizing: border-box; }
/* «Свернуть» у развёрнутого отзыва */
.rv-text .less { display: none; font: inherit; background: none; border: 0; padding: 0; margin-top: 4px; color: var(--accent); cursor: pointer; }
.rv-text[open] .less { display: inline; }
.photos a { display: block; cursor: zoom-in; }
/* модалка с фото */
dialog.lightbox { width: auto; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); padding: 0; background: #111;
  border: 0; overflow: visible; }
dialog.lightbox::backdrop { background: rgba(0,0,0,.8); }
.lightbox img { display: block; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); object-fit: contain; border-radius: var(--radius); }
.lb-close, .lb-nav { position: absolute; font: inherit; border: 0; cursor: pointer; color: #fff; background: rgba(0,0,0,.55);
  border-radius: 999px; width: 40px; height: 40px; font-size: 22px; line-height: 40px; text-align: center; }
.lb-close { top: 8px; right: 8px; font-size: 18px; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 8px; } .lb-next { right: 8px; }
.lb-close:hover, .lb-nav:hover { background: rgba(0,0,0,.8); }
.lb-count { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); color: #fff; background: rgba(0,0,0,.55);
  padding: 2px 10px; border-radius: 999px; font-size: 13px; }
.lb-count:empty { display: none; }
/* селект не берёт ширину самого длинного варианта — иначе «Сортировка» уходит на отдельную строку */
.filters > select { flex: 1 1 150px; width: 150px; min-width: 140px; text-overflow: ellipsis; }
.filters > select[name=sort] { flex-basis: 190px; min-width: 180px; }
dialog.lightbox { width: fit-content; height: fit-content; }
.lightbox img { min-width: 240px; min-height: 160px; }
.lb-close:focus:not(:focus-visible) { outline: none; }
.filters > select[name=sort] { flex: 0 1 200px; }
.filters > .search { flex: 1 1 260px; }
.filters input[type=checkbox] { accent-color: var(--accent); }
.filters > .search { flex-basis: 160px; min-width: 0; }
.filters > select[name=sort] { flex-basis: 175px; min-width: 150px; }
.filters .f-break { margin-top: -10px; }
/* боковая колонка: высотой с окно и не прокручивается вместе со страницей; аккаунт и тема — внизу колонки */
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand-logo { width: 32px; height: 32px; border-radius: 8px; flex: none; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.sidebar-foot .user { margin-top: 0; padding: 0 4px; }
.theme-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); }
.theme-switch button { font: inherit; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 7px; padding: 6px 4px; background: none; color: var(--muted); cursor: pointer; }
.theme-switch button:hover { color: var(--text); }
.theme-switch button[aria-pressed="true"] { background: var(--bg); color: var(--accent); font-weight: 600; }
@media (max-width: 760px) {
  .sidebar { position: static; height: auto; overflow: visible; }
  .sidebar-foot { margin: 0 0 0 auto; }
  .theme-switch button span { display: none; }
}
/* метка «Моя организация» */
:root { --mine-bg: #e3f3f1; --mine-ink: #14302d; --mine-icon: #2f8f84; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --mine-bg: #1d3532; --mine-ink: #e3f1ef; --mine-icon: #6cc2b7; } }
:root[data-theme="dark"] { --mine-bg: #1d3532; --mine-ink: #e3f1ef; --mine-icon: #6cc2b7; }
.mine-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 8px; border-radius: 999px;
  background: var(--mine-bg); color: var(--mine-ink); font-size: 13px; font-weight: 600; white-space: nowrap; }
.mine-badge .icon { width: 18px; height: 18px; color: var(--mine-icon); }
.mine-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; }
.mine-btn .icon { width: 16px; height: 16px; }
.mine-btn:hover { color: var(--mine-icon); }
@media (max-width: 760px) { .mine-btn { font-size: 0; gap: 0; padding: 4px 8px; } .mine-btn .icon { width: 18px; height: 18px; } }
/* страница входа */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 32px 28px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.login-logo { width: 72px; height: 72px; border-radius: 18px; }
.login-card h1 { margin: 0; font-size: 28px; }
.login-lead { margin: -8px 0 6px; }
.login-error { width: 100%; text-align: left; border-color: var(--danger); color: var(--danger); }
.login-way { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tg-widget { min-height: 40px; display: flex; justify-content: center; }
.login-note { margin: 0; font-size: 13px; }
.login-sep { width: 100%; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.login-sep::before, .login-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-kc { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; }
.login-kc.is-off { opacity: .5; cursor: not-allowed; }
.user-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; }
.user-row .user { padding: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; word-break: normal; }
.logout-btn { font-size: 12px; color: var(--muted); flex: none; }
.logout-btn:hover { color: var(--accent); }
.ro-badge { display: block; font-size: 11px; color: var(--muted); }
/* настройки */
.settings { display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { padding: 8px 12px; border-radius: 8px; color: var(--text); text-decoration: none; }
.settings-nav a.active, .settings-nav a:hover { background: var(--surface); color: var(--accent); }
.settings-nav a.active { box-shadow: inset 3px 0 0 var(--accent); }
.settings-body h2 { margin: 0 0 8px; } .settings-body h3 { margin: 20px 0 8px; font-size: 16px; }
.copy-row { display: flex; gap: 0; }
.copy-row input { flex: 1; min-width: 0; border-radius: 8px 0 0 8px; font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
.copy-row .btn { border-radius: 0 8px 8px 0; white-space: nowrap; }
.token-new { border: 1px solid var(--accent); border-radius: 10px; padding: 12px; margin: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.token-create { margin-top: 14px; }
.token-create > summary { list-style: none; display: inline-block; }
.token-create > summary::-webkit-details-marker { display: none; }
.token-form { max-width: 420px; margin-top: 12px; }
.tokens-table td, .tokens-table th { vertical-align: top; }
@media (max-width: 760px) { .settings { grid-template-columns: 1fr; } .settings-nav { flex-direction: row; } }
.token-new { border-color: var(--ok); }
.token-new p { margin: 0; }
.token-new pre { margin: 0; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  white-space: pre-wrap; word-break: break-all; font-size: 13px; }
.client-howto { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.client-howto pre { align-self: stretch; }
.token-client { display: flex; flex-direction: column; gap: 4px; font-weight: 600; max-width: 320px; }
.token-new > .btn-primary { align-self: flex-start; }
.field-error { color: var(--danger); font-size: 13px; font-weight: 400; }
.token-form select, .token-client select { -webkit-appearance: none; appearance: none; height: 42px; padding: 0 34px 0 12px;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5-5 5 5M7 14l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center; font-weight: 400; }
.token-form input { height: 42px; font-weight: 400; }
/* меню «что смотреть» (объекты, папки) */
.obj-picker .dd-body { max-height: min(70vh, 520px); overflow-y: auto; min-width: 260px; }
.obj-picker summary { gap: 6px; }
.obj-picker summary .pick-label { overflow: hidden; text-overflow: ellipsis; }
.obj-picker label { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.obj-picker .pick-obj { padding-left: 32px; }
.obj-picker .pick-folder { font-weight: 600; }
.obj-picker .folder-icon { color: #e8b84a; flex: none; }
.pick-mine { display: inline-flex; color: var(--mine-icon); }
.pick-mine .icon { width: 18px; height: 18px; }
.pick-sep { height: 1px; background: var(--line); margin: 4px 0; }
.pick-caption { font-size: 12px; color: var(--muted); padding: 2px 10px; }
.obj-picker .dd-body label.pick-obj { padding-left: 34px; }
/* «Настройки» внизу колонки — как пункты меню */
.side-link { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; color: var(--text); text-decoration: none; }
.side-link .icon { color: var(--muted); }
.side-link.active, .side-link:hover { background: var(--surface); color: var(--accent); }
.side-link.active .icon, .side-link:hover .icon { color: var(--accent); }
@media (max-width: 760px) { .side-link span { display: none; } .side-link { padding: 6px 8px; } }
