:root {
  --bg: #f6f7fb; --surface: #ffffff; --surface-2: #f0f2f8; --border: #e3e6ef; --text: #1a1f2e;
  --muted: #6b7285; --primary: #2f5bea; --primary-600: #2349c9; --primary-soft: #e8eeff;
  --danger: #d93b3b; --danger-soft: #fdecec; --success: #1f9d61; --success-soft: #e5f6ee; --warn: #c98a00;
  --shadow: 0 1px 2px rgba(20,30,60,.06), 0 8px 24px rgba(20,30,60,.08);
  --radius: 12px; --radius-sm: 8px;
  --hero-grad: linear-gradient(135deg, #2f5bea 0%, #6a3de8 55%, #c23dd8 100%);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f1218; --surface: #171b24; --surface-2: #1f2430; --border: #2a303d; --text: #e7eaf2;
  --muted: #9097a8; --primary: #5b80ff; --primary-600: #4a6ef0; --primary-soft: #1d2744;
  --danger: #f06363; --danger-soft: #3a1c1f; --success: #3cc987; --success-soft: #16301f;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  --hero-grad: linear-gradient(135deg, #1b2d7a 0%, #3b1f86 55%, #6b1f78 100%);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; }
input, select, textarea, button { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); padding: 9px 16px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s; text-decoration: none !important; color: var(--text); }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-600); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.icon { padding: 8px; }
.btn.lg { padding: 13px 22px; font-size: 16px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); padding: 10px 12px; outline: none; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea.input { resize: vertical; min-height: 70px; }
label.field { display: block; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
label.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.seg { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 10px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; cursor: pointer; font-weight: 500; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 24px; }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-weight: 600; }
.badge.blue { background: var(--primary-soft); color: var(--primary); }
.badge.green { background: var(--success-soft); color: var(--success); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.announce { background: var(--primary); color: #fff; text-align: center; padding: 8px 16px; font-size: 14px; }

/* Public header */
.pub-header { display: flex; align-items: center; gap: 16px; padding: 16px 28px; position: relative; z-index: 2; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: inherit; text-decoration: none !important; }
.logo .mark { width: 34px; height: 34px; border-radius: 10px; background: var(--hero-grad); display: grid; place-items: center; color: #fff; }
.logo .mark svg { width: 20px; height: 20px; stroke: #fff; }
.hero-wrap { min-height: 100vh; background: var(--hero-grad); color: #fff; display: flex; flex-direction: column; }
.hero-wrap .pub-header .btn.ghost { color: #fff; }
.hero-wrap .pub-header .btn.ghost:hover { background: rgba(255,255,255,.14); }
.hero-wrap .logo .mark { background: rgba(255,255,255,.2); }
.hero { flex: 1; display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; max-width: 1180px; margin: 0 auto; padding: 24px 28px 60px; width: 100%; }
.hero h1 { font-size: clamp(32px, 4.5vw, 54px); letter-spacing: -.02em; }
.hero p.lead { font-size: 19px; opacity: .9; max-width: 520px; }
.hero ul.points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.hero ul.points li { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.hero ul.points svg { background: rgba(255,255,255,.18); border-radius: 50%; padding: 5px; width: 28px; height: 28px; }
.tcard { color: var(--text); padding: 22px; width: 100%; max-width: 430px; justify-self: end; }
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 22px; text-align: center; cursor: pointer; transition: all .15s; background: var(--surface-2); }
.dropzone.over, .dropzone:hover { border-color: var(--primary); background: var(--primary-soft); }
.dropzone .big { width: 52px; height: 52px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; margin: 0 auto 10px; }
.dropzone .big svg { width: 26px; height: 26px; }
.flist { max-height: 170px; overflow: auto; margin: 10px 0; }
.flist .it { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--border); font-size: 14px; }
.flist .it .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--primary); width: 0; transition: width .2s; }
.ring { width: 150px; height: 150px; margin: 10px auto; position: relative; }
.ring svg { width: 150px; height: 150px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .bgc { stroke: var(--surface-2); }
.ring .fg { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset .2s; }
.ring .pct { position: absolute; inset: 0; display: grid; place-items: center; font-size: 32px; font-weight: 800; }
.linkbox { display: flex; gap: 8px; }
.linkbox input { flex: 1; }
.footer { text-align: center; padding: 20px; font-size: 13px; opacity: .75; }

/* Centered page (auth, public share) */
.center-page { min-height: 100vh; display: flex; flex-direction: column; }
.center-page main { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 30px 16px 60px; }
.auth-card { width: 100%; max-width: 400px; }
.pub-card { width: 100%; max-width: 760px; }

/* App layout */
.app { display: grid; grid-template-columns: 250px 1fr; grid-template-rows: 60px 1fr; height: 100vh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding: 0 18px; border-bottom: 1px solid var(--border); background: var(--surface); }
.topbar .search { flex: 1; max-width: 620px; position: relative; }
.topbar .search input { padding-left: 38px; background: var(--surface-2); border-color: transparent; }
.topbar .search svg { position: absolute; left: 12px; top: 11px; color: var(--muted); }
.sidebar { border-right: 1px solid var(--border); background: var(--surface); padding: 14px 10px; overflow: auto; display: flex; flex-direction: column; }
.sidebar .newbtn { margin: 4px 6px 14px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: var(--text); font-weight: 500; text-decoration: none; }
.nav a:hover { background: var(--surface-2); }
.nav a.on { background: var(--primary-soft); color: var(--primary); }
.quota { margin: auto 8px 4px; padding-top: 14px; font-size: 13px; }
.quota .progress { margin: 6px 0; height: 6px; }
.main { overflow: auto; padding: 18px 26px 80px; position: relative; }
.main.dragover::after { content: attr(data-drop); position: absolute; inset: 10px; border: 3px dashed var(--primary); border-radius: 16px; background: color-mix(in srgb, var(--primary-soft) 85%, transparent); display: grid; place-items: center; font-size: 22px; font-weight: 700; color: var(--primary); pointer-events: none; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; min-height: 42px; }
.crumbs { display: flex; align-items: center; gap: 4px; font-size: 20px; font-weight: 600; flex-wrap: wrap; }
.crumbs a { color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.crumbs a:last-child { color: var(--text); }
.crumbs .sep { color: var(--muted); }
.bulkbar { display: flex; gap: 8px; align-items: center; background: var(--primary-soft); padding: 8px 12px; border-radius: 10px; margin-bottom: 12px; }

/* Listing */
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); }
table.list td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.list tr.item { cursor: default; }
table.list tr.item:hover td { background: var(--surface-2); }
table.list tr.item.sel td { background: var(--primary-soft); }
table.list td.nm { display: flex; align-items: center; gap: 12px; min-width: 0; }
table.list td.nm .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; cursor: pointer; }
table.list td.nm .t:hover { color: var(--primary); }
table.list .act { text-align: right; white-space: nowrap; width: 1%; }
table.list .col-s, table.list .col-d { white-space: nowrap; color: var(--muted); font-size: 14px; width: 1%; }
.ficon { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff; flex: none; overflow: hidden; text-transform: uppercase; }
.ficon img { width: 100%; height: 100%; object-fit: cover; }
.ficon.folder { background: #f5b83d; }
.ficon svg { width: 20px; height: 20px; stroke: #fff; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; position: relative; }
.tile:hover { border-color: var(--primary); }
.tile.sel { outline: 2px solid var(--primary); }
.tile .thumb { height: 120px; display: grid; place-items: center; background: var(--surface-2); }
.tile .thumb .ficon { width: 56px; height: 56px; font-size: 13px; border-radius: 12px; }
.tile .thumb .ficon svg { width: 28px; height: 28px; }
.tile .thumb img.full { width: 100%; height: 100%; object-fit: cover; }
.tile .meta { padding: 10px 12px; display: flex; align-items: center; gap: 6px; }
.tile .meta .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; font-size: 14px; }
.tile .more { position: absolute; top: 6px; right: 6px; background: var(--surface); border-radius: 8px; opacity: 0; }
.tile:hover .more { opacity: 1; }
.tag-shared { color: var(--primary); }
.star-on { color: #f5b83d; }
.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty .ico { width: 80px; height: 80px; margin: 0 auto 14px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; }
.empty .ico svg { width: 36px; height: 36px; }

/* Menu, modal, toast */
.menu { position: fixed; z-index: 60; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; min-width: 200px; }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: transparent; padding: 8px 10px; border-radius: 7px; cursor: pointer; text-align: left; }
.menu button:hover { background: var(--surface-2); }
.menu button.danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 0; }
.overlay { position: fixed; inset: 0; background: rgba(10,14,25,.55); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto; padding: 22px; }
.modal.wide { max-width: 760px; }
.modal h3 { font-size: 18px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.viewer { position: fixed; inset: 0; z-index: 55; background: rgba(8,10,16,.92); display: flex; flex-direction: column; color: #fff; }
.viewer .vh { display: flex; align-items: center; gap: 12px; padding: 12px 18px; }
.viewer .vh .t { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer .vh .btn { background: rgba(255,255,255,.1); border-color: transparent; color: #fff; }
.viewer .vb { flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 60px 30px; min-height: 0; position: relative; }
.viewer .vb img, .viewer .vb video { max-width: 100%; max-height: 100%; border-radius: 6px; }
.viewer .vb iframe { width: 100%; height: 100%; border: 0; background: #fff; border-radius: 6px; }
.viewer .vb pre { background: #fff; color: #111; width: 100%; height: 100%; overflow: auto; margin: 0; padding: 20px; border-radius: 6px; white-space: pre-wrap; }
.viewer .nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.12); border: 0; color: #fff; border-radius: 50%; width: 44px; height: 44px; cursor: pointer; display: grid; place-items: center; }
.viewer .nav-btn.l { left: 8px; } .viewer .nav-btn.r { right: 8px; }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #1d2230; color: #fff; padding: 11px 18px; border-radius: 10px; box-shadow: var(--shadow); font-size: 14px; }
.toast.err { background: var(--danger); }
.upq { position: fixed; right: 20px; bottom: 20px; width: 360px; z-index: 45; overflow: hidden; }
.upq .h { display: flex; align-items: center; padding: 12px 14px; background: var(--surface-2); font-weight: 600; gap: 8px; }
.upq .b { max-height: 260px; overflow: auto; }
.upq .u { padding: 9px 14px; border-top: 1px solid var(--border); font-size: 13px; }
.upq .u .n { display: flex; gap: 8px; margin-bottom: 5px; }
.upq .u .n span:first-child { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upq .progress { height: 5px; }

/* Tree picker */
.tree { max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 6px; }
.tree div.n { padding: 7px 10px; border-radius: 6px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.tree div.n:hover { background: var(--surface-2); }
.tree div.n.on { background: var(--primary-soft); color: var(--primary); }

/* Plans, admin */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.plan { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.plan.cur { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft), var(--shadow); }
.plan .price { font-size: 32px; font-weight: 800; }
.plan ul { padding-left: 18px; margin: 4px 0 10px; color: var(--muted); flex: 1; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { padding: 16px 18px; }
.stat .v { font-size: 26px; font-weight: 800; margin-top: 4px; }
.stat .l { color: var(--muted); font-size: 13px; font-weight: 500; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--primary); border-color: var(--primary); }
.tablewrap { overflow-x: auto; }
table.adm { width: 100%; border-collapse: collapse; font-size: 14px; }
table.adm th, table.adm td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
table.adm th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
table.adm select, table.adm input { padding: 5px 8px; width: auto; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.mobile-only { display: none; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 0; }
  .tcard { justify-self: center; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 60px; bottom: 0; left: 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .mobile-only { display: inline-flex; }
  .main { padding: 14px 14px 80px; }
  table.list .col-d, table.list .col-s { display: none; }
  .upq { left: 12px; right: 12px; width: auto; }
  .pub-header { padding: 12px 16px; }
  .topbar .logo span.txt { display: none; }
}
@media (max-width: 600px) { .hide-sm { display: none; } }
@media (max-width: 600px) {
  .pub-header { gap: 2px; padding: 10px 12px; }
  .pub-header .logo .txt { display: none; }
  .pub-header .btn { padding: 8px 10px; }
  .pub-header .plans-link { display: none; }
  .hero { padding: 8px 16px 40px; gap: 28px; }
  .tcard { padding: 16px; }
  .topbar { gap: 6px; padding: 0 10px; }
  .topbar .logo { display: none; }
}
.tile .thumb { overflow: hidden; }
.tile .thumb img.full { height: 120px; display: block; }
.topbar .search { min-width: 0; }
@media (max-width: 600px) { .topbar .spacer { display: none; } }

/* ---------- Планер ---------- */
:root { --c-inc: #2f5bea; --c-exp: #d9730d; --c-ev: #8b3fd6; --c-task: #6b7285; --c-obl: #c2410c; }
:root[data-theme="dark"] { --c-inc: #5b80ff; --c-exp: #d9730d; --c-ev: #a66bf0; --c-task: #9097a8; --c-obl: #ea6a2a; }
.tabs a.tabbtn { padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.tabs a.tabbtn.on { color: var(--primary); border-color: var(--primary); }
.pl-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; align-items: start; }
.pl-grid h3 { font-size: 16px; display: flex; align-items: center; gap: 6px; }
.pl-row { display: flex; align-items: center; gap: 12px; padding: 9px 6px; border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 8px; }
.pl-row:last-child { border-bottom: 0; }
.pl-row:hover { background: var(--surface-2); }
.pl-row.is-done .pl-title { text-decoration: line-through; color: var(--muted); }
.pl-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; }
.pl-ico svg { stroke: #fff; width: 17px; height: 17px; }
.k-income { background: var(--c-inc); } .k-expense { background: var(--c-exp); } .k-event { background: var(--c-ev); }
.k-task { background: var(--c-task); } .k-obligation { background: var(--c-obl); }
.pl-main { flex: 1; min-width: 0; }
.pl-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-amt { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pl-amt.inc { color: var(--text); } .pl-amt.exp { color: var(--text); }
.badge.orange { background: #fdf0e1; color: #9a4f00; }
:root[data-theme="dark"] .badge.orange { background: #3a2a16; color: #f2b066; }
.stat .v.neg { color: var(--danger); }
.chip { border: 1px solid var(--border); background: var(--surface); border-radius: 99px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.chip:hover { border-color: var(--primary); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.seg.wrap { flex-wrap: wrap; }
.field .flabel { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.sw { display: inline-block; width: 11px; height: 11px; border-radius: 3px; }
.sw.inc { background: var(--c-inc); } .sw.exp { background: var(--c-exp); }
.pl-chart { width: 100%; height: auto; }
.pl-chart .axis { stroke: var(--border); stroke-width: 1; }
.pl-chart .bar.inc { fill: var(--c-inc); } .pl-chart .bar.exp { fill: var(--c-exp); }
.pl-chart .bar:hover { opacity: .8; }
.pl-chart .lbl { fill: var(--muted); font-size: 12px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.cal-h { background: var(--surface-2); padding: 8px; font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; }
.cal-cell { background: var(--surface); min-height: 104px; padding: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-cell:hover { background: var(--surface-2); }
.cal-cell.other { opacity: .45; }
.cal-cell.today .cal-d { background: var(--primary); color: #fff; }
.cal-d { font-size: 13px; font-weight: 600; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.cal-it { font-size: 12px; color: #fff; border-radius: 5px; padding: 1px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-it.is-done { opacity: .5; text-decoration: line-through; }
.bell { position: relative; }
.bell-badge { position: absolute; top: 2px; right: 2px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; border-radius: 99px; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 4px; }
.notif { padding: 8px 10px; border-radius: 8px; }
.notif.unread { background: var(--primary-soft); }
@media (max-width: 900px) {
  .pl-grid { grid-template-columns: 1fr; }
  .cal-cell { min-height: 64px; padding: 3px; }
  .cal-it { font-size: 0; height: 6px; padding: 0; }
}
@media (max-width: 600px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat .v { font-size: 20px; }
  .pl-row { flex-wrap: wrap; }
  .pl-row .pl-main { flex-basis: calc(100% - 50px); }
  .pl-row .pl-amt, .pl-row .badge { margin-left: 46px; }
  .pl-row .badge + .btn, .pl-row .pl-amt + .btn { margin-left: auto; }
}
.target-field { background: var(--primary-soft); padding: 10px 12px; border-radius: 10px; }
.target-field > span { color: var(--primary) !important; font-weight: 700 !important; }
.colorpick { width: 22px; height: 22px; border: 0; padding: 0; background: none; cursor: pointer; }

.powered { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: inherit; opacity: .8; text-decoration: none !important; margin-top: 6px; }
.powered:hover { opacity: 1; }
.powered .pb-logo { height: 18px; width: auto; border-radius: 3px; }
.powered.side { margin: 10px 8px 2px; color: var(--muted); }
.sidebar .quota { margin-top: auto; }

.plans .card .btn { white-space: normal; text-align: left; }

/* ---------- допълнителни функции ---------- */
.note { background: var(--primary-soft); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: 14px; }
.note.warn { background: #fff4d6; color: #6b4e00; }
[data-theme="dark"] .note.warn { background: #3a2f10; color: #f3d98b; }
.note .i { vertical-align: -4px; }
.legal { width: 100%; max-width: 820px; line-height: 1.6; }
.legal h1 { margin-top: 0; }
.legal-links a { color: inherit; text-decoration: underline; }
.qr { background: #fff; padding: 8px; border-radius: 10px; width: max-content; margin: auto; }
.qr svg { display: block; width: 190px; height: 190px; }
pre.codes { background: var(--surface-2); padding: 12px 16px; border-radius: 10px; font-size: 16px; letter-spacing: 1px; columns: 2; margin: 0; }
.chip.tiny { font-size: 11px; padding: 1px 7px; margin-left: 4px; text-decoration: none; }
.snippet { font-weight: 400; white-space: normal; }
.comment { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; }
.brand-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand-logo img { height: 36px; border-radius: 6px; }
.brand-logo small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.photos .ph-month { grid-column: 1 / -1; margin: 14px 0 4px; text-transform: capitalize; font-size: 16px; }
.photos .ph { aspect-ratio: 1; background: var(--surface-2); border-radius: 8px; overflow: hidden; cursor: pointer; display: grid; place-items: center; }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos .ph-vid { width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; }
.oo-wrap { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.oo-bar { display: flex; align-items: center; gap: 12px; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.oo-body { flex: 1; min-height: 0; }
.inv-wrap { max-width: 820px; margin: 24px auto; padding: 0 16px; }
.invoice { background: #fff; color: #111; border: 1px solid #ddd; border-radius: 8px; padding: 36px; }
.invoice .muted { color: #666; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 28px 0; }
.inv-party { border: 1px solid #ddd; border-radius: 8px; padding: 14px; line-height: 1.5; }
.inv-party strong { display: block; font-size: 16px; }
.inv-table { width: 100%; border-collapse: collapse; }
.inv-table th, .inv-table td { border: 1px solid #ddd; padding: 8px 10px; text-align: left; }
.inv-table th { background: #f3f4f7; }
.inv-sum { margin: 18px 0 18px auto; width: 300px; max-width: 100%; }
.inv-sum div { display: flex; justify-content: space-between; padding: 5px 0; }
.inv-sum .tot { border-top: 2px solid #111; font-weight: 700; font-size: 17px; margin-top: 4px; padding-top: 8px; }
@media (max-width: 600px) { .inv-parties { grid-template-columns: 1fr; } .invoice { padding: 18px; } }
@media print { .no-print, .toasts { display: none !important; } body { background: #fff; } .invoice { border: 0; padding: 0; } .inv-wrap { margin: 0; max-width: none; } }
.pinlock { position: fixed; inset: 0; z-index: 9999; background: var(--bg); display: grid; place-items: center; }
