/* W&T Studio · planner: components only. Colours, fonts, radii and shadows come from tokens.css
   (the copy of wt-hub/public/css/tokens.css made by wt-hub/tools/sync-tokens.sh), linked before this file. */
:root {
  --rail-w: 236px;
  --series-1: #d95926; /* charts: orange — validated on the dark surface */
  --series-2: #3987e5; /* charts: blue */
}
:root[data-theme="light"] {
  --series-1: #eb6834;
  --series-2: #2a78d6;
}

* { box-sizing: border-box; }
html { height: 100%; }
body { margin: 0; min-height: 100%; }   /* not height: 100% — the room under the studio's tab bar (body padding) has to come after content that is taller than the screen */
body {
  background: var(--bg); color: var(--text);
  font: 400 14px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
::selection { background: var(--accent); color: var(--accent-ink); }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 3px solid var(--bg); }
.muted { color: var(--muted); }
.ico { width: 18px; height: 18px; flex: none; display: block; }
kbd { font: 500 11px/1 var(--sans); padding: 3px 5px; border-radius: 5px; border: 1px solid currentColor; opacity: .55; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- logo ---------- */
.logo-mask {
  display: block; width: 46px; aspect-ratio: 158 / 70; background: var(--text);
  -webkit-mask: url(../img/wt-logo-mask.png) center / contain no-repeat;
  mask: url(../img/wt-logo-mask.png) center / contain no-repeat;
}

/* ---------- buttons & fields (2.4: 34px, radius 8; one light primary per screen, no gold buttons) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 34px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: transparent; color: var(--text);
  cursor: pointer; white-space: nowrap; font: 500 13px var(--sans); text-decoration: none;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease), opacity var(--t);
}
.btn:hover { background: var(--raised); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary, .btn.gold { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 600; }
.btn.primary:hover, .btn.gold:hover { background: var(--primary); opacity: .9; }
.btn.primary kbd, .btn.gold kbd { border-color: currentColor; }
.btn.quiet { border-color: transparent; color: var(--muted); }
.btn.quiet:hover { background: var(--raised); color: var(--text); }
.btn.danger { color: var(--st-error); }
.btn.danger:hover { border-color: color-mix(in srgb, var(--st-error) 45%, transparent); }
.btn.block { width: 100%; height: 40px; font-size: 14px; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.icon-btn { width: 34px; padding: 0; }
.icon-btn.sm { width: 28px; height: 28px; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; color: var(--muted); letter-spacing: .01em; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), textarea, select {
  width: 100%; height: 38px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--sunken); color: var(--text);
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
input:hover, textarea:hover, select:hover { border-color: var(--line-strong); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 2px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:disabled, textarea:disabled { opacity: .6; }
.form-error { color: var(--st-error); min-height: 1.2em; margin: 0; font-size: 13px; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--sunken); border: 1px solid var(--line); }
.seg button { height: 28px; padding: 0 12px; border-radius: 6px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font: 500 13px var(--sans); display: inline-flex; align-items: center; gap: 6px; transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--raised); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / .25); }
.seg.wide { display: flex; }
.seg.wide button { flex: 1; justify-content: center; height: 34px; }

.pill { --st: var(--st-draft); display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; font: 500 12px var(--sans); white-space: nowrap; color: var(--st); background: color-mix(in srgb, var(--st) 14%, transparent); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--st); }
.st-draft { --st: var(--st-draft); } .st-ready { --st: var(--st-ready); } .st-scheduled { --st: var(--st-scheduled); }
.st-publishing { --st: var(--st-publishing); } .st-published { --st: var(--st-published); } .st-error { --st: var(--st-error); }

.ava { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; display: block; background: var(--raised); }
.ava-letter { display: grid; place-items: center; font: 600 13px var(--sans); color: var(--text); border: 1px solid var(--line-strong); }

/* ---------- sign-in ---------- */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(120% 70% at 50% 0%, var(--panel), var(--bg) 70%); }
.auth-card { width: min(380px, 100%); display: grid; gap: 16px; padding: 36px 32px 30px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.auth-logo { width: 64px; margin: 0 auto 4px; }
.auth-card h1 { font: 600 22px/1.2 var(--sans); text-align: center; margin: 0; letter-spacing: -.015em; }
/* 2.3: no italic accent in the planner — headings read straight, in their own colour (the hub greeting is the only italic). */
em { font-style: normal; }
.auth-card p.muted { text-align: center; margin: -6px 0 6px; font-size: 13px; }

/* ---------- shell ---------- */
.apps-btn { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel); color: var(--text); font: 600 14px var(--sans); cursor: pointer; white-space: nowrap; transition: border-color var(--t) var(--ease), background var(--t) var(--ease); }
.apps-btn:hover, .apps-btn[aria-expanded="true"] { border-color: var(--line-strong); background: var(--raised); }
.apps-btn .apps-ico { width: 24px; height: 24px; padding: 5px; border-radius: 6px; background: var(--raised); color: var(--text); }
.apps-btn .apps-chev { width: 14px; height: 14px; color: var(--muted); margin-left: auto; }
.apps-menu { position: fixed; z-index: 85; min-width: 224px; padding: 6px; border-radius: var(--r-lg); border: 1px solid var(--line-strong); background: var(--raised); box-shadow: var(--shadow); }
.apps-menu .menu-item { min-height: 40px; padding: 0 10px; text-decoration: none; }
.apps-menu .menu-item.on { background: var(--sunken); }
.apps-menu .menu-check { margin-left: auto; color: var(--text); }
.apps-menu .menu-item:focus-visible { background: var(--sunken); outline: none; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; text-align: left; color: var(--text); }
.menu-item:hover { background: var(--sunken); }
.menu-item.dim { color: var(--muted); cursor: default; }
.menu-item.dim:hover { background: transparent; }
.menu-item .ico { color: var(--muted); }
.menu-item .check { margin-left: auto; color: var(--accent); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }

/* 4.7: exactly one active item — the active one carries the surface; hover only changes the colour */

.main { min-width: 0; display: flex; flex-direction: column; }
.bar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bar-actions:empty { display: none; }
.view { flex: 1; padding: 28px 32px 48px; outline: none; }

/* ---------- calendar ---------- */
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.cal-wrap.side-folded { grid-template-columns: minmax(0, 1fr) 40px; }
.cal { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head > div { padding: 12px 14px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--line); }
.cal-head > div.is-today { color: var(--accent); }
.day { position: relative; min-height: 132px; padding: 10px; display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background var(--t) var(--ease); }
.cal-grid > .day:nth-child(7n) { border-right: 0; }
.cal-grid > .day:nth-last-child(-n+7) { border-bottom: 0; }
.day.out { background: var(--sunken); }
.day.out .dnum { opacity: .45; }
.day.past:not(.out) { background: color-mix(in srgb, var(--sunken) 55%, var(--panel)); }
.dnum { font-size: 13px; font-weight: 600; color: var(--muted); height: 24px; min-width: 24px; display: inline-grid; place-items: center; align-self: flex-start; border-radius: 12px; font-variant-numeric: tabular-nums; }
.day.today { box-shadow: inset 0 2px 0 var(--accent); }
.day.today .dnum { color: var(--accent-ink); background: var(--accent); padding: 0 6px; }
.day-add { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--muted); display: grid; place-items: center; cursor: pointer; opacity: 0; transform: scale(.9); transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), background var(--t); }
.day-add .ico { width: 15px; height: 15px; }
.day:hover .day-add, .day-add:focus-visible { opacity: 1; transform: none; }
.day-add:hover { background: var(--raised); color: var(--text); }
.day.drop-over, .undated.drop-over { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }

.pc { position: relative; display: flex; align-items: center; gap: 8px; padding: 5px 8px 5px 5px; border-radius: 9px; background: var(--raised); border: 1px solid var(--line); cursor: grab; min-width: 0; overflow: hidden; transition: border-color var(--t) var(--ease), transform var(--t) var(--ease), box-shadow var(--t) var(--ease), opacity var(--t); }
.pc::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--st); }
.pc:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.pc.locked { cursor: pointer; }
.pc.dragging { opacity: .35; }
.pc .th { width: 34px; height: 42px; border-radius: 5px; object-fit: cover; flex: none; background: var(--sunken); display: grid; place-items: center; color: var(--faint); }
.pc .th .ico { width: 15px; height: 15px; }
.pc-body { min-width: 0; display: grid; gap: 1px; }
.pc-meta { display: flex; align-items: center; gap: 6px; }
.pc-time { font-weight: 600; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pc-meta .ico { width: 14px; height: 14px; color: var(--muted); }
.pc-cap { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* ---------- week (4.2, planner-week.png): day columns, vertical cards with a 92px cover, today marked in gold ---------- */
.cal.week .cal-head { display: none; }
.cal.week .cal-grid { min-height: calc(100vh - 170px); }
.cal.week .day { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; min-height: 0; padding: 0; gap: 0; border-bottom: 0; }
.cal.week .cal-grid > .day:nth-last-child(-n+7) { border-bottom: 0; }
.cal.week .day.past:not(.out), .cal.week .day.out { background: var(--panel); }
.cal.week .day-head { height: 44px; flex: none; padding: 0 12px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.cal.week .day-head b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.cal.week .day.today { box-shadow: inset 0 2px 0 var(--accent); }
.cal.week .day.today .day-head { color: var(--accent); font-weight: 500; }
.cal.week .day.today .day-head b { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.cal.week .day-head .today-lbl { color: var(--muted); font-weight: 400; }
.cal.week .day-body { flex: 1; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.cal.week .day.empty .day-body { background: var(--sunken); }
.cal.week .day-add { display: none; }
.day-add-wide { height: 36px; flex: none; border-radius: var(--r-sm); border: 1px dashed var(--line-strong); background: transparent; color: var(--muted); font: 500 13px var(--sans); cursor: pointer; opacity: 0; transition: opacity var(--t) var(--ease), color var(--t) var(--ease); }
.cal.week .day:hover .day-add-wide, .day-add-wide:focus-visible, .cal.week .day.drop-over .day-add-wide { opacity: 1; }
.day-add-wide:hover { color: var(--text); border-color: var(--text); }
.week-label { display: none; }

.side-col { min-width: 0; }
.side-head { display: flex; align-items: center; gap: 8px; margin: 2px 0 6px; }
.side-col h3 { font: 600 15px/1.3 var(--sans); margin: 0; flex: 1; }
.side-fold { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.side-fold:hover { background: var(--raised); color: var(--text); }
.side-fold .ico { width: 16px; height: 16px; }
.side-col p { margin: 0 0 14px; font-size: 12.5px; color: var(--muted); }
.side-folded .side-col > *:not(.side-head), .side-folded .side-col h3 { display: none; }
.side-folded .side-head { justify-content: center; }
.side-folded .side-fold .ico { transform: rotate(180deg); }
.undated { display: grid; gap: 8px; min-height: 120px; padding: 8px; border-radius: var(--r); border: 1px dashed var(--line-strong); transition: background var(--t), box-shadow var(--t); }
.undated-empty { margin: auto; text-align: center; color: var(--faint); font-size: 12.5px; padding: 14px 8px; line-height: 1.5; }

.agenda { display: none; }
.day-dots { display: none; }

/* ---------- empty / skeleton / soon ---------- */
.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 56px 24px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.empty h2 { margin: 6px 0 0; font: 600 20px/1.25 var(--sans); }
.empty p { margin: 0; max-width: 46ch; color: var(--muted); }
.empty .btn { margin-top: 8px; }
.empty-art { width: 120px; height: 84px; position: relative; }
.empty-art i { position: absolute; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--raised); }
.empty-art i:nth-child(1) { inset: 10px 52px 6px 8px; transform: rotate(-6deg); }
.empty-art i:nth-child(2) { inset: 4px 30px 12px 30px; z-index: 1; border-color: var(--line-strong); background: var(--raised); }
.empty-art i:nth-child(3) { inset: 10px 8px 6px 52px; transform: rotate(6deg); }
.skel { background: linear-gradient(100deg, var(--sunken) 30%, var(--raised) 50%, var(--sunken) 70%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; border-radius: 8px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }

/* ---------- feed ---------- */
.feed { max-width: 640px; margin: 0 auto; }
.profile { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; padding: 8px 4px 26px; }
.profile .ava { width: 88px; height: 88px; padding: 3px; border: 1px solid var(--accent-line); background: var(--panel); }
.profile .ava-letter { font-size: 30px; }
.profile h2 { margin: 0 0 8px; font: 500 24px/1.1 var(--sans); letter-spacing: -.01em; }
.profile-stats { display: flex; gap: 22px; color: var(--muted); }
.profile-stats b { color: var(--text); font-weight: 600; }
.feed-note { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.feed-note .legend { display: flex; gap: 14px; align-items: center; white-space: nowrap; flex: none; }
.feed-note .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.tile { position: relative; aspect-ratio: 3 / 4; background: var(--sunken); overflow: hidden; cursor: pointer; display: block; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 400ms var(--ease), filter var(--t); }
.tile:hover img { transform: scale(1.03); }
.tile .badge { position: absolute; top: 8px; right: 8px; color: #fff; filter: drop-shadow(0 1px 2px rgb(0 0 0 / .6)); }
.tile .badge .ico { width: 18px; height: 18px; }
.tile.planned { cursor: grab; }
.tile.planned::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; box-shadow: inset 0 0 0 2px var(--bg), inset 0 0 0 4px var(--st); }
.tile .when, .tile .badge { z-index: 2; }
.tile.planned.st-scheduled .when { background: linear-gradient(transparent, color-mix(in srgb, var(--st-scheduled) 55%, rgb(0 0 0 / .7))); }
.tile.planned.st-draft::after, .tile.planned.st-ready::after, .tile.planned.st-error::after { box-shadow: none; }
.tile.planned.st-draft, .tile.planned.st-ready, .tile.planned.st-error { outline: 1.5px dashed color-mix(in srgb, var(--st) 85%, transparent); outline-offset: -5px; }
.tile .when { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 8px 7px; color: #fff; font-size: 11.5px; font-weight: 500; background: linear-gradient(transparent, rgb(0 0 0 / .72)); display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.tile .when .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--st); box-shadow: 0 0 0 2px rgb(0 0 0 / .3); }
.tile .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); }
.tile.drop-over { outline: 2px solid var(--accent); outline-offset: -2px; }
.tile.drop-over img { filter: brightness(.6); }
.tile.dragging { opacity: .35; }
.grid-sep { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 18px 0 10px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.grid-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- publications ---------- */
.counters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--line); margin-bottom: 20px; }
.counter { display: grid; gap: 4px; padding: 16px 20px; background: var(--panel); border: 0; text-align: left; cursor: pointer; transition: background var(--t); }
.counter:hover { background: var(--raised); }
.counter.on { background: var(--raised); box-shadow: inset 0 -2px 0 var(--st); }
.counter span { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.counter span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--st); }
.counter b { font: 600 30px/1 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .search { position: relative; flex: 1 1 240px; }
.filters .search .ico { position: absolute; left: 12px; top: 11px; color: var(--faint); }
.filters .search input:not([type=checkbox]) { padding-left: 38px; }
.filters select { width: auto; min-width: 150px; }
.table { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; }
.trow { display: grid; grid-template-columns: 52px minmax(0, 1fr) 120px 170px 140px 36px; align-items: center; gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background var(--t); }
.trow:last-child { border-bottom: 0; }
.trow:hover { background: var(--raised); }
.trow.head { cursor: default; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding-top: 12px; padding-bottom: 12px; background: var(--sunken); }
.trow.head:hover { background: var(--sunken); }
.trow .th { width: 52px; height: 64px; border-radius: 7px; object-fit: cover; background: var(--sunken); display: grid; place-items: center; color: var(--faint); }
.trow .cap { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.trow .cap.none { color: var(--faint); }
.trow .err { color: var(--st-error); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .fmt { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.trow .go { color: var(--faint); }
.trow .mobile-meta { display: none; }
.no-results { padding: 40px 16px; text-align: center; color: var(--muted); }

/* ---------- media library ---------- */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.mtile { position: relative; border-radius: var(--r-sm); overflow: hidden; background: var(--panel); border: 1px solid var(--line); cursor: pointer; transition: border-color var(--t), transform var(--t) var(--ease), box-shadow var(--t); }
.mtile:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.mtile .img { aspect-ratio: 4 / 5; background: var(--sunken); position: relative; }
.mtile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mtile .meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 8px 10px; font-size: 12px; color: var(--muted); }
.mtile .meta .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtile .tag { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 12px; font-size: 11px; font-weight: 500; color: #fff; background: rgb(0 0 0 / .55); backdrop-filter: blur(6px); }
.mtile .tag .ico { width: 12px; height: 12px; }
.mtile .used { position: absolute; right: 8px; top: 8px; }
.mtile .used .pill { background: rgb(14 14 13 / .72); backdrop-filter: blur(6px); }
.mtile .tick { position: absolute; left: 8px; top: 8px; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid rgb(255 255 255 / .85); background: rgb(0 0 0 / .25); display: grid; place-items: center; color: transparent; transition: background var(--t), border-color var(--t), color var(--t); }
.mtile .tick .ico { width: 14px; height: 14px; }
.mtile.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.mtile.sel .tick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.mtile.taken { cursor: default; }
.mtile.taken .tick { display: none; }
.dropveil { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: var(--scrim); backdrop-filter: blur(4px); pointer-events: none; opacity: 0; transition: opacity var(--t); }
.dropveil.on { opacity: 1; }
.dropveil div { display: grid; justify-items: center; gap: 10px; padding: 40px 56px; border-radius: 20px; border: 1.5px dashed var(--accent); background: var(--panel); color: var(--text); font: 600 20px var(--sans); }
.dropveil .ico { width: 32px; height: 32px; color: var(--accent); }
.upbar { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; margin-bottom: 14px; }
.upbar span { display: block; height: 100%; width: 0; background: var(--accent); }

/* ---------- settings ---------- */
.settings { max-width: 760px; display: grid; gap: 22px; }
.set-sec { padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.set-sec h2 { margin: 0 0 4px; font: 600 17px/1.3 var(--sans); }
.set-sec > p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.set-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.set-row:first-of-type { border-top: 0; }
.set-row .label { flex: 1; display: grid; gap: 2px; }
.set-row .label small { color: var(--muted); }
.nf-prefs { display: grid; gap: 12px; }
#notify-box .set-row .btn { flex: none; }
.acct-card { display: flex; align-items: center; gap: 16px; }
.acct-card .ava { width: 56px; height: 56px; }
.acct-card .info { flex: 1; display: grid; gap: 2px; }
.acct-card .info b { font-weight: 600; font-size: 15px; }
.ok-dot { display: inline-flex; align-items: center; gap: 6px; color: var(--st-published); font-size: 12.5px; }
.ok-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ok-dot.bad { color: var(--st-error); }
.pw-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }

/* ---------- editor panel ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); opacity: 0; transition: opacity 240ms var(--ease); }
.scrim.on { opacity: 1; }
.editor { position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(980px, calc(100vw - 72px)); display: grid; grid-template-columns: minmax(0, 1fr) 380px; background: var(--bg); border-left: 1px solid var(--line); box-shadow: var(--shadow); transform: translateX(102%); transition: transform 280ms var(--ease); }
.editor.open { transform: none; }
.ed-main { display: flex; flex-direction: column; min-height: 0; }
.ed-head { display: flex; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.ed-head h2 { margin: 0; font: 600 20px/1.2 var(--sans); }
.ed-head .saved { font-size: 12px; color: var(--faint); display: inline-flex; align-items: center; gap: 6px; }
.ed-head .saved .ico { width: 14px; height: 14px; }
.ed-head .spacer { flex: 1; }
.ed-body { flex: 1; overflow: auto; padding: 22px 24px 28px; display: grid; gap: 22px; align-content: start; }
.ed-sec { display: grid; gap: 10px; }
.ed-sec > .lbl { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); letter-spacing: .01em; }
.counter-txt { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.counter-txt.over { color: var(--st-error); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.thumbs:empty { display: none; }
.mthumb { position: relative; aspect-ratio: 4 / 5; border-radius: 9px; overflow: hidden; background: var(--sunken); border: 1px solid var(--line); }
.mthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mthumb .n { position: absolute; top: 6px; left: 6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff; background: rgb(0 0 0 / .55); }
.mthumb .tools { position: absolute; inset: auto 0 0; display: flex; justify-content: space-between; padding: 5px; background: linear-gradient(transparent, rgb(0 0 0 / .65)); opacity: 0; transition: opacity var(--t); }
.mthumb:hover .tools, .mthumb:focus-within .tools { opacity: 1; }
.mthumb .tools button { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; border: 0; background: rgb(255 255 255 / .16); color: #fff; cursor: pointer; padding: 0; }
.mthumb .tools button:hover { background: rgb(255 255 255 / .3); }
.mthumb .tools button:disabled { opacity: .3; cursor: default; }
.mthumb .tools .ico { width: 14px; height: 14px; }
.drop { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; min-height: 84px; padding: 16px; border-radius: var(--r-sm); border: 1px dashed var(--line-strong); color: var(--muted); text-align: center; cursor: pointer; overflow: hidden; transition: border-color var(--t), background var(--t), color var(--t); }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.drop .ico { color: var(--accent); }
.drop .bar-p { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--accent); }
.drop-row { display: flex; gap: 10px; }
.drop-row .drop { flex: 1; }
.ed-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.problems { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--sunken); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.problems b { color: var(--text); font-weight: 500; }
.problems ul { margin: 0; padding-left: 18px; display: grid; gap: 2px; }
.err-box { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-sm); color: var(--st-error); background: color-mix(in srgb, var(--st-error) 10%, transparent); border: 1px solid color-mix(in srgb, var(--st-error) 28%, transparent); font-size: 13px; white-space: pre-wrap; }
.ed-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--panel); }
.ed-foot .spacer { flex: 1; }
.picker { display: grid; gap: 10px; padding: 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel); }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; max-height: 260px; overflow: auto; }
.picker-grid button { position: relative; aspect-ratio: 4 / 5; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; padding: 0; cursor: pointer; background: var(--sunken); }
.picker-grid button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.picker-grid button.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.picker-grid button.sel::after { content: ""; position: absolute; inset: 0; background: var(--accent-soft); }

.ed-preview { overflow: auto; padding: 26px 24px; background: var(--panel); border-left: 1px solid var(--line); display: grid; justify-items: center; align-content: start; gap: 14px; }
.ed-preview .cap-lbl { font-size: 12.5px; color: var(--muted); }
.phone { width: 316px; border-radius: 44px; padding: 10px; background: #0A0A09; border: 1px solid #2E2D29; box-shadow: var(--shadow), inset 0 0 0 1px #1d1c19; }
.phone-screen { position: relative; border-radius: 35px; overflow: hidden; background: #fff; color: #0c0c0c; height: 610px; display: flex; flex-direction: column; font: 13px/1.38 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.phone-status { display: flex; justify-content: space-between; align-items: center; padding: 12px 22px 4px; font-size: 12px; font-weight: 600; }
.phone-island { position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 92px; height: 26px; border-radius: 14px; background: #0A0A09; }
.phone-app { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px 6px; border-bottom: 1px solid #efefef; }
.phone-app b { font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.phone-scroll { flex: 1; overflow: auto; scrollbar-width: none; }
.phone-scroll::-webkit-scrollbar { display: none; }
.ig-head { display: flex; align-items: center; gap: 9px; padding: 9px 11px; }
.ig-ring { width: 32px; height: 32px; border-radius: 50%; padding: 2px; background: conic-gradient(from 200deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5, #feda75); }
.ig-ring > * { width: 100%; height: 100%; border-radius: 50%; border: 2px solid #fff; object-fit: cover; display: grid; place-items: center; background: #eee; font-size: 11px; font-weight: 700; color: #555; }
.ig-head b { font-size: 13px; }
.ig-head small { display: block; font-size: 11px; color: #737373; font-weight: 400; }
.ig-head .ico { margin-left: auto; width: 18px; height: 18px; }
.ig-media { position: relative; background: #f2f2f2; }
.ig-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; height: 100%; scrollbar-width: none; overscroll-behavior-x: contain; }
.ig-track::-webkit-scrollbar { display: none; }
.ig-track > * { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: center; display: block; background: #000; }
.ig-empty { height: 100%; display: grid; place-items: center; align-content: center; gap: 8px; color: #9b9b9b; font-size: 12px; text-align: center; }
.ig-empty .ico { width: 30px; height: 30px; margin: 0 auto; }
.ig-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgb(255 255 255 / .9); color: #222; display: grid; place-items: center; cursor: pointer; box-shadow: 0 1px 3px rgb(0 0 0 / .25); padding: 0; }
.ig-arrow .ico { width: 14px; height: 14px; }
.ig-arrow.l { left: 8px; } .ig-arrow.r { right: 8px; }
.ig-count { position: absolute; top: 9px; right: 9px; padding: 2px 8px; border-radius: 12px; background: rgb(0 0 0 / .62); color: #fff; font-size: 11px; font-weight: 500; }
.ig-actions { position: relative; display: flex; align-items: center; gap: 14px; padding: 9px 11px 5px; }
.ig-actions .ico { width: 23px; height: 23px; stroke-width: 1.7; }
.ig-actions .save { margin-left: auto; }
.ig-dots { position: absolute; left: 50%; top: 17px; transform: translateX(-50%); display: flex; gap: 4px; }
.ig-dots i { width: 6px; height: 6px; border-radius: 50%; background: #c8c8c8; transition: background var(--t); }
.ig-dots i.on { background: #0095f6; }
.ig-text { padding: 3px 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ig-text .more { color: #737373; cursor: pointer; }
.ig-text .tag { color: #00376b; }
.ig-text .ph { color: #a8a8a8; }
.ig-comments { padding: 2px 11px; color: #737373; }
.ig-comment { padding: 2px 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ig-date { padding: 6px 11px 14px; color: #737373; font-size: 10.5px; text-transform: uppercase; letter-spacing: .02em; }
.phone-tabs { display: flex; justify-content: space-around; padding: 9px 0 16px; border-top: 1px solid #efefef; color: #0c0c0c; }
.phone-tabs .ico { width: 21px; height: 21px; }

/* ---------- toasts & sheet ---------- */
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 90; display: grid; gap: 10px; justify-items: end; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: min(420px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--text); opacity: 0; transform: translateY(8px); transition: opacity var(--t) var(--ease), transform var(--t) var(--ease); }
.toast.in { opacity: 1; transform: none; }
.toast .ico { color: var(--st-published); }
.toast.err .ico { color: var(--st-error); }
.toast.err { border-color: color-mix(in srgb, var(--st-error) 40%, var(--line)); }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .cal-wrap { grid-template-columns: minmax(0, 1fr); }
  .side-col { order: 2; }
  .undated { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); min-height: 72px; }
  .trow { grid-template-columns: 52px minmax(0, 1fr) 110px 150px 130px 28px; gap: 12px; }
}
@media (max-width: 1100px) {
  .editor { grid-template-columns: minmax(0, 1fr) 340px; }
  .phone { width: 300px; }
}
@media (max-width: 900px) {
  .editor { width: 100vw; display: block; overflow-y: auto; overscroll-behavior: contain; border-left: 0; }
  .ed-main { display: block; }
  .ed-body { overflow: visible; }
  .ed-head { position: sticky; top: 0; z-index: 2; background: var(--bg); }
  .ed-foot { position: sticky; bottom: 0; z-index: 2; }
  .ed-preview { overflow: visible; border-left: 0; border-top: 1px solid var(--line); }
  .trow { grid-template-columns: 52px minmax(0, 1fr) auto; }
  .trow .fmt, .trow .when-col, .trow.head { display: none; }
  .trow .st { grid-column: 3; }
  .trow .mobile-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
  .trow .mobile-meta .ico { width: 13px; height: 13px; }
  .trow .go { display: none; }
  .pw-form { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  body { font-size: 15px; }
  #new-post { display: none; }
  .bar-actions { width: 100%; flex-wrap: nowrap; }
  .bar-actions .seg { flex: 1; }
  .bar-actions .seg button { flex: 1; justify-content: center; padding: 0 6px; }
  .pf-bar { width: 100%; margin-left: 0; justify-content: space-between; }
  .pf-btn { flex: 1; }
  .view { padding: 16px 16px 32px; }
  .toasts { left: 16px; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); justify-items: stretch; }
  .toast { max-width: none; }

  .cal-head > div { padding: 8px 0; text-align: center; font-size: 10px; letter-spacing: .04em; }
  .day { min-height: 58px; padding: 5px 3px; gap: 3px; align-items: center; cursor: pointer; }
  .day .dnum { align-self: center; font-size: 12.5px; }
  .day-add { display: none; }
  .cal.month .pc { display: none; }
  .day-dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; max-width: 34px; }
  .day-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--st); }
  .day.picked { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
  .agenda { display: grid; gap: 10px; margin-top: 18px; }
  .agenda h3 { margin: 0; display: flex; justify-content: space-between; align-items: center; font: 600 17px var(--sans); }
  .agenda h3 .btn { font: 500 13px var(--sans); }
  .agenda .pc { padding: 8px; }
  .agenda .pc .th { width: 46px; height: 56px; }
  .agenda .pc-cap { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .agenda-empty { padding: 18px; border-radius: var(--r-sm); border: 1px dashed var(--line-strong); color: var(--muted); text-align: center; font-size: 13.5px; }
  .side-col h3 { font-size: 20px; }
  .undated { grid-template-columns: 1fr; }

  .profile { grid-template-columns: auto 1fr; gap: 18px; padding-top: 0; }
  .profile .ava { width: 72px; height: 72px; }
  .profile h2 { font-size: 19px; }
  .profile-stats { gap: 14px; font-size: 13px; }
  .feed-note { flex-direction: column; align-items: flex-start; }
  .pgrid { gap: 2px; margin: 0 -16px; }
  .pgrid .grid-sep { padding-inline: 16px; }
  .tile .when { font-size: 10px; padding: 16px 5px 5px; }

  .counters { grid-template-columns: repeat(2, 1fr); }
  .counter { padding: 12px 14px; }
  .counter b { font-size: 26px; }
  .filters select { flex: 1 1 40%; min-width: 0; }
  .lib-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .set-sec { padding: 18px 16px; }
  .set-row { flex-wrap: wrap; }

  .ed-head { padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
  .ed-head h2 { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .ed-body { padding: 16px; }
  .ed-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .ed-foot .btn { flex: 1; }
  .ed-foot .spacer { display: none; }
  .ed-row { grid-template-columns: 1fr 1fr; }
  .ed-row .btn { grid-column: 1 / -1; }
  .mthumb .tools { opacity: 1; }
  .ed-preview { padding: 22px 0 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}

/* ---------- platforms ---------- */
.st-uploaded { --st: var(--st-publishing); }
.ico.big { width: 26px; height: 26px; }
.ico.tiny { width: 12px; height: 12px; }
.pf-badges { display: inline-flex; gap: 3px; align-items: center; }
.pf-badge { --st: var(--st-draft); display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; color: var(--st); background: color-mix(in srgb, var(--st) 18%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--st) 35%, transparent); }
.pf-badge .ico { width: 13px; height: 13px; stroke-width: 1.9; }
.pf-ava { display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line-strong); background: var(--sunken); }
.pf-ava .ico { width: 17px; height: 17px; }
.pf-ava.pf-all { grid-template-columns: 1fr 1fr; gap: 0; padding: 5px; place-items: center; }
.pf-ava.pf-all .ico { width: 10px; height: 10px; stroke-width: 2; }
.ava.sm { width: 28px; height: 28px; }
.menu-item .mi-text { display: grid; line-height: 1.25; min-width: 0; }
.menu-item .mi-text small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* editor tabs */
.ed-tabs { display: flex; gap: 2px; padding: 0 20px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.ed-tabs::-webkit-scrollbar { display: none; }
.ed-tab { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 9px; font-size: 13.5px; border: 0; background: transparent; color: var(--muted); font-weight: 500; cursor: pointer; white-space: nowrap; transition: color var(--t) var(--ease); }
.ed-tab:hover { color: var(--text); }
.ed-tab.on { color: var(--text); }
.ed-tab.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.ed-tab.on .ico { color: var(--accent); }
.ed-tab .dot { --st: var(--st-draft); width: 7px; height: 7px; border-radius: 50%; background: var(--st); }
.ed-tab .dot.warn { box-shadow: 0 0 0 2px color-mix(in srgb, var(--st-error) 35%, transparent); }
.pf-chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.pf-chip { position: relative; display: grid; justify-items: start; gap: 4px; padding: 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--sunken); color: var(--muted); cursor: pointer; text-align: left; font-weight: 500; transition: border-color var(--t), background var(--t), color var(--t); }
.pf-chip:hover { border-color: var(--line-strong); color: var(--text); }
.pf-chip.on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }
.pf-chip.on > .ico:first-child { color: var(--accent); }
.pf-chip small { font-size: 11px; color: var(--faint); font-weight: 400; }
.pf-chip .tick { position: absolute; top: 10px; right: 10px; width: 15px; height: 15px; color: var(--accent); }
.pf-chip:disabled { opacity: .6; cursor: default; }
.ed-summary { gap: 6px; }
.sum-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; text-align: left; transition: border-color var(--t); }
.sum-row:hover { border-color: var(--line-strong); }
.sum-row .sum-name { font-weight: 500; min-width: 92px; }
.sum-row .sum-meta { flex: 1; color: var(--muted); font-size: 12.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sum-row > .ico:last-child { color: var(--faint); width: 16px; height: 16px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { position: relative; width: 30px; height: 18px; border-radius: 10px; background: var(--line-strong); transition: background var(--t) var(--ease); flex: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text); transition: transform var(--t) var(--ease); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(12px); background: var(--accent-ink); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + span { opacity: .5; }
.inherit { padding: 12px 14px; border-radius: var(--r-sm); border: 1px dashed var(--line-strong); color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 180px; overflow: auto; font-size: 13.5px; }
.inherit-thumbs .mthumb { opacity: .75; }
.t-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.t-head > .ico { color: var(--muted); }
.t-head > div { display: grid; gap: 3px; }
.t-head b { font: 600 17px/1.2 var(--sans); }
.t-head .spacer { flex: 1; }
.note-box { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--accent-line); background: var(--accent-soft); font-size: 13px; }
.note-box .ico { color: var(--accent); }
.btn-rows { display: grid; gap: 8px; }
.btn-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; align-items: center; }
.ed-row.two { grid-template-columns: 1fr 1fr; }
.pv-switch { align-self: center; }
.pv-switch button { padding: 0 10px; }
.pv-switch .ico { width: 16px; height: 16px; }
.pv-empty { height: 100%; display: grid; place-items: center; color: #999; }
.phone-status.dark, .pv-dark .phone-status { color: #fff; }

/* telegram preview */
.phone-screen.pv-telegram { background: #0f1720; color: #e8eef4; }
.tg-top { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #17212b; color: #fff; }
.tg-top .ico { width: 18px; height: 18px; color: #8aa4bd; }
.tg-top .ico:last-child { margin-left: auto; }
.tg-ava, .vk-ava { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 600 11px var(--sans); background: #2b2a25; color: #C4A97D; flex: none; overflow: hidden; }
.vk-ava > * { width: 100%; height: 100%; object-fit: cover; }
.tg-title { display: grid; line-height: 1.2; }
.tg-title small { color: #8aa4bd; font-size: 11px; }
.tg-chat { padding: 10px 10px 14px; background: radial-gradient(circle at 20% 10%, #1a2a38, #0e1621 70%); }
.tg-day { text-align: center; margin: 4px 0 10px; }
.tg-day::before { content: attr(data-x); }
.tg-day { font-size: 11px; color: #cfd8e1; }
.tg-bubble { background: #182533; border-radius: 14px; overflow: hidden; max-width: 100%; box-shadow: 0 1px 1px rgb(0 0 0 / .3); }
.tg-media { position: relative; background: #000; }
.tg-media.one img, .tg-media.one video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tg-media.grid { display: grid; gap: 2px; aspect-ratio: 1; }
.tg-media.grid.n2 { grid-template-columns: 1fr 1fr; aspect-ratio: 2 / 1.2; }
.tg-media.grid.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.tg-media.grid.n3 span:first-child { grid-row: span 2; }
.tg-media.grid.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.tg-media.grid span, .vk-media.grid span { position: relative; overflow: hidden; }
.tg-media.grid img, .vk-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tg-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgb(0 0 0 / .45); color: #fff; }
.tg-play .ico { width: 18px; height: 18px; fill: #fff; }
.tg-play.sm { width: 26px; height: 26px; }
.tg-play.sm .ico { width: 12px; height: 12px; }
.more-n { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(0 0 0 / .45); color: #fff; font-size: 18px; }
.tg-text { padding: 8px 11px 2px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.38; }
.tg-text .tag { color: #6ab3f3; }
.tg-text.ph { color: #6e8396; }
.tg-meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; padding: 2px 10px 6px; font-size: 10.5px; color: #6e8396; }
.tg-buttons { display: grid; gap: 4px; margin-top: 4px; }
.tg-buttons span { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 8px; border-radius: 10px; background: rgb(43 82 120 / .65); color: #fff; font-size: 12.5px; font-weight: 500; }
.tg-bottom { padding: 12px; text-align: center; color: #6ab3f3; background: #17212b; font-size: 13px; font-weight: 500; }

/* vk preview */
.phone-screen.pv-vk { background: #ebedf0; }
.phone-screen.pv-threads { background: #fff; color: #000; }
.th-top { display: grid; place-items: center; padding: 6px 0 8px; color: #000; }
.th-top svg { width: 26px; height: 26px; stroke-width: 1.8; }
.th-feed { padding: 4px 0 60px; }
.th-post { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 12px 14px; border-bottom: 1px solid #e6e6e6; }
.th-ava .x { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; font-size: 13px; }
.th-ava img { width: 100%; height: 100%; object-fit: cover; }
.th-body { display: grid; gap: 6px; min-width: 0; font: 400 13.5px/1.4 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.th-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.th-head b { font-weight: 600; }
.th-head small { color: #999; }
.th-head svg:last-child { margin-left: auto; width: 16px; height: 16px; color: #999; }
.th-topic { display: inline-flex; align-items: center; gap: 2px; color: #777; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-topic svg { width: 10px; height: 10px; }
.th-text { white-space: pre-line; overflow-wrap: anywhere; }
.th-text.ph { color: #aaa; }
.th-text .tag { color: #0a66c2; }
.th-text .more { color: #999; cursor: pointer; }
.th-media { position: relative; }
.th-media.one { border-radius: 10px; overflow: hidden; border: 1px solid #eee; max-height: 340px; }
.th-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.th-media.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 62%; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.th-media.strip > span { position: relative; aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; border: 1px solid #eee; }
.th-actions { display: flex; gap: 16px; color: #333; font-size: 12px; padding-top: 2px; }
.th-actions span { display: inline-flex; align-items: center; gap: 4px; }
.th-actions svg { width: 18px; height: 18px; }
.vk-top { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: #fff; border-bottom: 1px solid #e1e3e6; }
.vk-top .ico { width: 18px; height: 18px; color: #2688eb; }
.vk-feed { padding: 8px 0; }
.vk-post { background: #fff; padding: 10px 0 6px; }
.vk-head { display: flex; align-items: center; gap: 10px; padding: 0 12px 8px; }
.vk-head > span:nth-child(2) { display: grid; line-height: 1.25; }
.vk-head b { font-size: 13px; color: #2c2d2e; }
.vk-head small { color: #818c99; font-size: 11.5px; }
.vk-head .ico { margin-left: auto; width: 18px; height: 18px; color: #99a2ad; }
.vk-text { padding: 0 12px 8px; white-space: pre-wrap; overflow-wrap: anywhere; color: #000; }
.vk-text .tag, .vk-text .more { color: #2a5885; }
.vk-text.ph { color: #99a2ad; }
.vk-media { position: relative; background: #f2f3f5; }
.vk-media.one { aspect-ratio: 1; }
.vk-media.one img { width: 100%; height: 100%; object-fit: cover; }
.vk-media.grid { display: grid; gap: 2px; aspect-ratio: 1; }
.vk-media.grid.n2 { grid-template-columns: 1fr 1fr; aspect-ratio: 2 / 1.3; }
.vk-media.grid.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.vk-media.grid.n3 span:first-child { grid-row: span 2; }
.vk-media.grid.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.vk-actions { display: flex; gap: 8px; padding: 8px 12px 2px; color: #818c99; font-size: 12.5px; }
.vk-actions span { display: inline-flex; align-items: center; gap: 4px; padding: 5px 9px; border-radius: 14px; background: #f2f3f5; }
.vk-actions .ico { width: 16px; height: 16px; }
.vk-actions .views { margin-left: auto; background: none; }

/* youtube preview */
.phone-screen.pv-ytwatch .phone-status { background: #000; color: #fff; }
.yt-player { position: relative; flex: none; aspect-ratio: 16 / 9; background: #000; }
.yt-player img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.yt-player .ig-empty { color: #8a8a8a; }
.yt-player .ig-empty .ico { color: #f00; }
.yt-dur, .tg-dur { position: absolute; right: 7px; bottom: 7px; padding: 1px 5px; border-radius: 4px; background: rgb(0 0 0 / .72); color: #fff; font-size: 10.5px; font-weight: 500; }
.yt-info { padding: 10px 12px 6px; display: grid; gap: 4px; }
.yt-info b { font-size: 15px; line-height: 1.3; }
.yt-info small { color: #606060; font-size: 11.5px; }
.yt-more { color: #0f0f0f; font-weight: 600; }
.yt-channel { display: flex; align-items: center; gap: 8px; padding: 6px 12px; }
.yt-channel small { color: #606060; font-size: 11.5px; }
.yt-channel .yt-sub { margin-left: auto; padding: 6px 12px; border-radius: 16px; background: #0f0f0f; color: #fff; font-size: 12px; font-weight: 500; }
.yt-chips { display: flex; gap: 6px; padding: 6px 12px; overflow: hidden; }
.yt-chips > span { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 6px 11px; border-radius: 16px; background: #f2f2f2; font-size: 12px; font-weight: 500; }
.yt-chips .ico { width: 16px; height: 16px; }
.yt-like i { width: 1px; height: 16px; background: #ccc; margin: 0 3px; }
.yt-box { margin: 8px 12px; padding: 10px; border-radius: 10px; background: #f2f2f2; display: grid; gap: 7px; font-size: 12.5px; }
.yt-box small { color: #606060; font-weight: 400; margin-left: 4px; }
.yt-box > span { display: flex; align-items: center; gap: 8px; color: #606060; }
.yt-box .vk-ava { width: 22px; height: 22px; }
.yt-desc { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }

/* full-screen vertical player: Instagram Reels and YouTube Shorts */
.phone-screen.pv-full { background: #000; color: #fff; }
.pv-full .phone-status { position: relative; z-index: 3; color: #fff; }
.pv-full .phone-island { z-index: 4; }
.rl { position: absolute; inset: 0 0 48px; overflow: hidden; background: #161616; }
.rl > video, .rl > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.rl > .ig-empty { position: absolute; inset: 0; color: #8a8a8a; }
.ig-empty small { font-size: 11px; opacity: .8; }
.rl-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(rgb(0 0 0 / .4), transparent 16%, transparent 52%, rgb(0 0 0 / .62)); }
.rl-top { position: absolute; top: 38px; left: 14px; right: 12px; z-index: 2; display: flex; align-items: center; gap: 14px; }
.rl-top b { margin-right: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.rl-top .ico { width: 22px; height: 22px; }
.rl-chip { padding: 2px 8px; border-radius: 10px; background: rgb(255 255 255 / .2); font-size: 11px; font-weight: 600; letter-spacing: 0; }
.rl-side { position: absolute; right: 6px; bottom: 14px; z-index: 2; width: 52px; display: grid; justify-items: center; gap: 2px; font-size: 10.5px; font-weight: 500; text-align: center; text-shadow: 0 1px 2px rgb(0 0 0 / .45); }
.rl-side .ico { width: 25px; height: 25px; margin-top: 12px; filter: drop-shadow(0 1px 2px rgb(0 0 0 / .4)); }
.rl-disc { margin-top: 14px; width: 28px; height: 28px; border-radius: 7px; border: 2px solid #fff; overflow: hidden; }
.rl-disc > *, .rl-ava > * { width: 100%; height: 100%; object-fit: cover; display: grid; place-items: center; background: #3a3a3a; color: #fff; font-size: 11px; font-weight: 700; }
.rl-meta { position: absolute; left: 12px; right: 60px; bottom: 14px; z-index: 2; display: grid; gap: 8px; font-size: 13px; text-shadow: 0 1px 2px rgb(0 0 0 / .4); }
.rl-user { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rl-user b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rl-ava { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; flex: none; }
.rl-follow { flex: none; padding: 4px 10px; border: 1px solid rgb(255 255 255 / .75); border-radius: 8px; font-size: 12px; font-weight: 600; text-shadow: none; }
.yt-sh .rl-follow { background: #fff; color: #0f0f0f; border-color: #fff; border-radius: 16px; }
.rl-cap { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.35; }
.rl-cap.open { max-height: 200px; overflow: auto; scrollbar-width: none; }
.rl-cap .more { color: rgb(255 255 255 / .72); cursor: pointer; }
.rl-cap .tag { font-weight: 600; }
.rl-cap.ph { color: rgb(255 255 255 / .6); }
.rl-music { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; }
.rl-music .ico { width: 13px; height: 13px; flex: none; }
.rl-music span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phone-tabs.dark { position: absolute; left: 0; right: 0; bottom: 0; height: 48px; box-sizing: border-box; padding: 8px 0 0; align-items: flex-start; background: #000; color: #fff; border-top: 1px solid #262626; }

/* telegram: views + forward button beside the post */
.tg-row { display: flex; align-items: flex-end; gap: 6px; }
.tg-post { flex: 1; min-width: 0; }
.tg-fwd { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgb(0 0 0 / .3); color: #fff; }
.tg-fwd .ico { width: 15px; height: 15px; }

@media (max-width: 700px) {
  .pf-chips { grid-template-columns: 1fr 1fr; }
  .ed-tabs { padding: 0 8px; }
  .ed-tab span { display: none; }
  .ed-tab { padding: 0 14px; }
  .btn-row { grid-template-columns: 1fr; }
  .sum-row .sum-meta { display: none; }
}

/* formatting toolbar + telegram formatting */
.fmt-bar { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; margin-bottom: -4px; }
.fmt-bar button { min-width: 30px; height: 28px; padding: 0 7px; border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; display: inline-grid; place-items: center; }
.fmt-bar button:hover { background: var(--sunken); color: var(--text); border-color: var(--line); }
.fmt-bar button .ico { width: 14px; height: 14px; }
.fmt-hint { margin-left: 8px; font-size: 11.5px; color: var(--faint); }
.hint { margin: 0; font-size: 12.5px; color: var(--muted); }
.tg-text b { font-weight: 600; }
.tg-text a { color: #6ab3f3; text-decoration: none; }
.tg-text code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: #e9c46a; }
.tg-text blockquote { margin: 4px 0; padding: 2px 8px; border-left: 2px solid #6ab3f3; background: rgb(106 179 243 / .1); border-radius: 4px; white-space: pre-wrap; }
.tg-text .spoiler { background: #5d6f80; color: transparent; border-radius: 3px; }
.inherit b { font-weight: 600; } .inherit blockquote { margin: 2px 0; padding-left: 8px; border-left: 2px solid var(--line-strong); }
.inherit .spoiler { background: var(--line-strong); color: transparent; border-radius: 3px; }
@media (max-width: 700px) { .fmt-hint { display: none; } }

/* ---------- trial reels ---------- */
.trial-tag { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; margin-left: 3px; border-radius: 5px; font-size: 10.5px; font-weight: 500; letter-spacing: .02em; color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); white-space: nowrap; }
.pc-meta .trial-tag { display: none; } /* calendar cards show it at the start of the caption line */
.pc-cap .trial-tag { height: 16px; margin: 0 5px 0 0; padding: 0 5px; font-size: 10px; vertical-align: 1px; }
.tile-trial { position: absolute; z-index: 2; top: 8px; left: 8px; }
.tile-trial .trial-tag { margin: 0; color: #fff; background: rgb(14 14 13 / .62); box-shadow: none; backdrop-filter: blur(6px); }
.trial-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.trial-opt { display: grid; gap: 4px; align-content: start; padding: 12px 14px; text-align: left; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; transition: border-color var(--t) var(--ease), background var(--t) var(--ease); }
.trial-opt b { font-weight: 500; }
.trial-opt span { font-size: 12.5px; color: var(--muted); }
.trial-opt:hover { border-color: var(--line-strong); }
.trial-opt.on { border-color: var(--accent-line); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.trial-opt:disabled { cursor: default; opacity: .6; }
.trial-sec .btn { justify-self: start; }
.err-box .btn { margin-top: 10px; color: var(--text); }

/* ---------- statistics ---------- */
.counter.static { cursor: default; }
.counter.static:hover { background: var(--panel); }
.counter small { font-size: 12px; color: var(--faint); }
.stats-sec { display: grid; gap: 12px; margin-top: 8px; }
.stats-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stats-head h2 { margin: 0; font: 600 20px/1.25 var(--sans); }
.stats-note { max-width: 80ch; }
.empty.compact { padding: 36px 24px; }
.trow.trial-row { grid-template-columns: 52px minmax(0, 1fr) 100px 150px 100px 36px; }
.trial-row .trial-meta { display: block; font-size: 12px; margin-top: 3px; }
.trial-row .tnum small { color: var(--faint); font-size: 12px; }
.trial-row .nf { color: var(--accent); }
.trial-row .go { display: grid; place-items: center; }
@media (max-width: 900px) {
  .trow.trial-row { grid-template-columns: 52px minmax(0, 1fr); row-gap: 6px; }
  .trial-row > .tnum { grid-column: 2; display: flex; justify-content: space-between; font-size: 13px; }
  .trial-row > .tnum::before { content: attr(data-label); color: var(--muted); }
  .trial-row > .go { display: none; }
}
@media (max-width: 700px) {
  .trial-opts { grid-template-columns: 1fr; }
}

/* ---------- platform connections ---------- */
.pf-extra { display: grid; gap: 8px; padding: 0 0 12px 52px; }
.pf-extra:empty { display: none; }
.pf-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
@media (max-width: 700px) { .pf-extra { padding-left: 0; } }
.vk-media.carousel { display: flex; gap: 4px; overflow: hidden; aspect-ratio: 1 / 1.05; padding-right: 18%; }
.vk-media.carousel > span { position: relative; flex: 0 0 100%; overflow: hidden; border-radius: 6px; }
.vk-media.carousel > span img { width: 100%; height: 100%; object-fit: cover; }
.vk-media .vk-count { position: absolute; top: 8px; right: calc(18% + 8px); padding: 2px 7px; border-radius: 10px; font-size: 11px; font-weight: 500; color: #fff; background: rgb(0 0 0 / .55); }
.stats-pf { margin-top: 32px; }
.stats-pf .stats-head h2 { display: inline-flex; align-items: center; gap: 10px; }
.stats-head h2 .ico { width: 22px; height: 22px; color: var(--muted); }
.trow.vk-row { grid-template-columns: 52px minmax(0, 1fr) 100px 80px 80px 100px 36px; }
.stats-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; margin-bottom: 12px; }
.from-planner { font-weight: 500; color: var(--accent); }
.vk-row .go { display: grid; place-items: center; }
.trow.tt-row { grid-template-columns: 44px minmax(0, 1fr) 96px 90px 76px 76px 76px 36px; }
.tt-row .th { aspect-ratio: 3 / 4; height: auto; }
.tt-row .gain { color: var(--st-published); font-size: 12px; font-weight: 500; }
.tt-row .gain.none { color: var(--faint); }
@media (max-width: 900px) {
  .trow.vk-row, .trow.tt-row { grid-template-columns: 52px minmax(0, 1fr); row-gap: 6px; }
  .vk-row > .tnum, .tt-row > .tnum { grid-column: 2; display: flex; justify-content: space-between; font-size: 13px; }
  .vk-row > .tnum::before, .tt-row > .tnum::before { content: attr(data-label); color: var(--muted); }
  .vk-row > .go, .tt-row > .go { display: none; }
}
.pf-actions a.btn { text-decoration: none; }

/* ---------- Instagram statistics ---------- */
.stats-pf.first { margin-top: 0; }
.stats-head .seg { margin-left: auto; }
.kpi small { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; }
.delta { font-size: 12px; font-weight: 500; white-space: nowrap; }
.delta.up { color: var(--st-published); }
.delta.down { color: var(--st-error); }
.delta.flat { color: var(--muted); font-weight: 400; }
.mini-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--line); margin-bottom: 20px; }
.mini { display: grid; gap: 2px; padding: 12px 16px; background: var(--panel); }
.mini span { font-size: 12px; color: var(--muted); }
.mini b { font: 600 20px/1.1 var(--sans); font-variant-numeric: tabular-nums; }
.mini .delta { font-size: 11.5px; }
.chart-grid, .split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.chart { margin: 0; padding: 14px 16px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); display: grid; gap: 8px; }
.chart figcaption { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.chart figcaption span { color: var(--muted); font-size: 12px; }
.chart-plot { position: relative; padding-bottom: 18px; touch-action: pan-y; }
.chart-plot svg { display: block; width: 100%; height: 150px; }
.chart .bars path { fill: var(--series-1); transition: opacity var(--t); }
.chart-plot:hover .bars path { opacity: .55; }
.chart-plot:hover .bars path.on { opacity: 1; }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.chart .axis { stroke: var(--line-strong); vector-effect: non-scaling-stroke; }
.chart-max { position: absolute; top: 0; left: 0; font-size: 11px; color: var(--faint); transform: translateY(-2px); }
.chart-x { position: absolute; left: 0; right: 0; bottom: 0; height: 16px; font-size: 11px; color: var(--faint); }
.chart-x span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.chart-x span:first-child { transform: none; } .chart-x span:last-child:not(:first-child) { transform: translateX(-100%); }
.chart-tip { position: absolute; top: -6px; transform: translate(-50%, -100%); padding: 6px 9px; border-radius: 8px; background: var(--raised); border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm); font-size: 12px; white-space: nowrap; pointer-events: none; display: grid; gap: 1px; z-index: 3; }
.chart-tip span { color: var(--muted); font-size: 11px; }
.chart-table summary { cursor: pointer; font-size: 12px; color: var(--muted); width: max-content; }
.chart-table table { margin-top: 6px; font-size: 12px; border-collapse: collapse; }
.chart-table td { padding: 2px 12px 2px 0; font-variant-numeric: tabular-nums; }
.empty-chart { color: var(--muted); font-size: 13px; }
.split { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); display: grid; gap: 10px; }
.split-head { display: flex; justify-content: space-between; font-size: 13px; }
.split-bar { display: flex; gap: 2px; height: 14px; }
.split-bar i { display: block; height: 100%; min-width: 2px; }
.split-bar i:first-child { border-radius: 4px 0 0 4px; } .split-bar i:last-child { border-radius: 0 4px 4px 0; }
.s1 { background: var(--series-1); } .s2 { background: var(--series-2); }
.split-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--muted); }
.split-legend span { display: inline-flex; align-items: center; gap: 6px; }
.split-legend b { color: var(--text); font-weight: 500; }
.split-legend i { width: 10px; height: 10px; border-radius: 3px; }
.aud-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 8px; }
.hb { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); display: grid; gap: 7px; align-content: start; }
.hb-title { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.hb-row { display: grid; grid-template-columns: minmax(0, 92px) 1fr 38px; gap: 8px; align-items: center; font-size: 12.5px; }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.hb-track { height: 8px; }
.hb-track i { display: block; height: 100%; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--series-1); }
.hb-val { text-align: right; font-variant-numeric: tabular-nums; }
.sort-sel { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.sort-sel select { width: auto; height: 34px; }
.avg-line b { color: var(--text); font-weight: 500; }
a.trow { color: inherit; text-decoration: none; }
.trow.ig-row { grid-template-columns: 52px minmax(0, 1fr) 80px 90px 64px 56px 56px 70px 60px 24px; gap: 12px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 13.5px; }
.back-link:hover { color: var(--text); }
.back-link .ico { width: 16px; height: 16px; }
.pd-head { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 20px; margin: 16px 0 12px; }
.pd-thumb { width: 160px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; background: var(--sunken); display: grid; place-items: center; color: var(--faint); }
.pd-info { display: grid; gap: 10px; align-content: start; }
.pd-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.pd-caption { margin: 0; white-space: pre-wrap; max-height: 9.5em; overflow: auto; font-size: 14px; line-height: 1.45; }
.pd-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pd-compare { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.pd-compare table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.pd-compare th { text-align: right; font-weight: 400; font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding-bottom: 6px; }
.pd-compare td { padding: 5px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; text-align: right; }
.pd-compare td:first-child { text-align: left; color: var(--muted); }
@media (max-width: 1100px) {
  .mini-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .aud-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .trow.ig-row { grid-template-columns: 52px minmax(0, 1fr); row-gap: 6px; }
  .ig-row > .tnum { grid-column: 2; display: flex; justify-content: space-between; font-size: 13px; }
  .ig-row > .tnum::before { content: attr(data-label); color: var(--muted); }
  .ig-row > .go { display: none; }
  .chart-grid, .split-grid, .pd-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .mini-row { grid-template-columns: 1fr 1fr; }
  .aud-grid { grid-template-columns: 1fr; }
  .pd-head { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; }
  .pd-thumb { width: 96px; }
  .stats-head .seg { margin-left: 0; }
}

/* ---------- Reels cover ---------- */
.cover-wrap { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; align-items: start; }
.cover-prev { margin: 0; display: grid; gap: 6px; }
.cover-prev figcaption { font-size: 11px; color: var(--faint); line-height: 1.3; }
.cover-916 { position: relative; aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; background: var(--sunken); border: 1px solid var(--line); }
.cover-916 img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 3:4 crop of a 9:16 frame: full width, height = width·4/3 = 75% of the frame height, centred */
.cover-grid { position: absolute; left: 0; right: 0; top: 12.5%; height: 75%; box-shadow: 0 0 0 999px rgb(0 0 0 / .45); outline: 1.5px dashed rgb(255 255 255 / .85); outline-offset: -1.5px; pointer-events: none; }
.cover-tools { display: grid; gap: 10px; align-content: start; }
.cover-video { width: 100%; max-height: 220px; border-radius: 8px; background: #000; object-fit: contain; }
.cover-range { width: 100%; accent-color: var(--accent); }
.cover-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cover-upload { justify-self: start; cursor: pointer; }
.cover-tools .btn.quiet { justify-self: start; }
.warn-hint { display: flex; gap: 6px; align-items: center; color: var(--st-publishing); }
.warn-hint .ico { width: 14px; height: 14px; flex: none; }
@media (max-width: 700px) { .cover-wrap { grid-template-columns: 110px minmax(0, 1fr); gap: 12px; } }
code.cmd { display: block; padding: 10px 12px; border-radius: var(--r-sm); background: var(--sunken); border: 1px solid var(--line); font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-all; user-select: all; }
.chart.line .ln { fill: none; stroke: var(--series-1); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.chart-min { position: absolute; left: 0; bottom: 20px; font-size: 11px; color: var(--faint); }
.chart-grid.one { grid-template-columns: 1fr; }
.stats-head.sub { margin-top: 12px; }
.stats-head.sub h3 { margin: 0; font: 600 16px/1.25 var(--sans); }
.stats-head .sort-sel { margin-left: auto; }
.trow.tg-row { grid-template-columns: minmax(0, 1fr) 100px 90px 80px 70px 64px 24px; }
.tg-row .go { display: grid; place-items: center; }
@media (max-width: 900px) {
  .trow.tg-row { grid-template-columns: 1fr; row-gap: 6px; }
  .tg-row > .tnum { display: flex; justify-content: space-between; font-size: 13px; }
  .tg-row > .tnum::before { content: attr(data-label); color: var(--muted); }
  .tg-row > .go { display: none; }
}

/* ---------- statistics: platform tabs and sections ---------- */
.pf-tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.pf-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px 12px; color: var(--muted); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.pf-tabs a:hover { color: var(--text); }
.pf-tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.pf-tabs .ico { width: 18px; height: 18px; }
.stats-pf { margin-top: 0; }
.pf-head { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 16px; }
.pf-head > div:first-child { display: grid; gap: 2px; margin-right: auto; }
.pf-head h2 { margin: 0; display: inline-flex; align-items: center; gap: 10px; font: 600 20px/1.25 var(--sans); }
.pf-head h2 .ico { width: 22px; height: 22px; color: var(--muted); }
.subtabs { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--sunken); border: 1px solid var(--line); overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.subtabs button { height: 30px; padding: 0 14px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); font-weight: 500; cursor: pointer; white-space: nowrap; }
.subtabs button:hover { color: var(--text); }
.subtabs button.on { background: var(--raised); color: var(--text); box-shadow: var(--shadow-sm); }
.trow.tg-row { grid-template-columns: 52px minmax(0, 1fr) 100px 90px 80px 70px 64px 24px; }
.trow.tg-row.pub { grid-template-columns: 52px minmax(0, 1fr) 110px 90px 70px 24px; }
#tg-note { margin-bottom: 14px; }
#tg-note:empty { display: none; }
@media (max-width: 900px) {
  .trow.tg-row, .trow.tg-row.pub { grid-template-columns: 52px minmax(0, 1fr); }
  .tg-row > .tnum { grid-column: 2; }
}
@media (max-width: 700px) {
  .pf-head { gap: 10px; }
  .subtabs { width: 100%; }
  .subtabs button { flex: 1; padding: 0 10px; }
}

/* ---------- platform buttons (top bar) ---------- */
.pf-bar { margin-left: auto; display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--sunken); border: 1px solid var(--line); }
.pf-btn { width: 30px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--faint); display: grid; place-items: center; cursor: pointer; transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.pf-btn:hover { color: var(--text); }
.pf-btn.on { background: var(--raised); color: var(--text); }
.pf-btn.all { width: auto; padding: 0 10px; font: 500 13px var(--sans); }
.pf-btn .ico { width: 16px; height: 16px; }
.pf-btn.off { opacity: .55; }

/* ---------- messages ---------- */
.menu-item .count.new { margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; font-size: 11px; background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }
.inbox { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 24px; align-items: start; }
.ib-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.ib-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-grid; place-items: center; font-size: 11px; background: var(--accent); color: var(--accent-ink); }
.ib-notes { display: grid; gap: 8px; margin-bottom: 12px; }
.ib-notes:empty { display: none; }
.ib-note { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel); font-size: 13px; color: var(--muted); }
.ib-note .ico { flex: none; width: 18px; height: 18px; color: var(--text); }
.ib-note p { margin: 0; flex: 1; }
.ib-note .btn { flex: none; text-decoration: none; }
.ib-threads { display: grid; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; }
.ib-threads > .empty { border: 0; }
.ib-loading { padding: 20px 16px; }
.ib-threads > .btn.block { border-radius: 0; border: 0; border-top: 1px solid var(--line); }
.ib-row { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr) 44px; gap: 12px; align-items: start; padding: 14px 16px 14px 18px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); transition: background var(--t) var(--ease); }
.ib-row:last-child { border-bottom: 0; }
.ib-row:hover { background: var(--raised); }
.ib-row.on { background: var(--raised); box-shadow: inset 2px 0 0 var(--accent); }
.ib-row.unread::before { content: ""; position: absolute; left: 7px; top: 29px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.ib-ava { position: relative; width: 36px; height: 36px; font-size: 14px; }
.ib-ava.sm { width: 24px; height: 24px; font-size: 11px; }
.ib-pf { position: absolute; right: -5px; bottom: -4px; width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.ib-pf .ico { width: 12px; height: 12px; }
.ib-main { display: grid; gap: 3px; min-width: 0; }
.ib-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.ib-top b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-top time { margin-left: auto; flex: none; font-size: 12px; color: var(--faint); }
.ib-text { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ib-meta { font-size: 12px; color: var(--faint); }
.ib-row.unread .ib-top b { font-weight: 600; }
.ib-row.unread .ib-text { color: var(--text); }
.ib-thumb { width: 44px; height: 55px; border-radius: 7px; object-fit: cover; background: var(--sunken); }
.ib-thumb.blank { background: transparent; }
.ib-detail { position: sticky; top: 100px; height: calc(100dvh - 128px); min-height: 420px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; }
.ib-empty { flex: 1; display: grid; justify-items: center; align-content: center; gap: 10px; padding: 48px 24px; text-align: center; color: var(--muted); }
.ib-empty p { margin: 0; max-width: 40ch; }
.ib-empty .ring { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-strong); background: var(--raised); color: var(--muted); }
.ib-empty .ring .ico { width: 22px; height: 22px; }
.ib-thread { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ib-post { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ib-post > img, .ib-post-ico { flex: none; width: 40px; height: 50px; border-radius: 7px; object-fit: cover; display: grid; place-items: center; background: var(--sunken); color: var(--muted); }
.ib-post-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ib-post-text small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--faint); }
.ib-post-text small .ico { width: 13px; height: 13px; }
.ib-post-text p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-post-acts { flex: none; display: flex; gap: 4px; }
.ib-back { display: none; }
.ib-msgs { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 12px; padding: 20px 20px 12px; }
.ib-msg { max-width: 640px; display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg); transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.ib-msg.reply { margin-left: 32px; }
.ib-msg.mine { background: var(--raised); }
.ib-msg.target { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.ib-msg-head { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.ib-msg-head b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-msg-head time { flex: none; font-size: 12px; color: var(--faint); }
.ib-likes { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--faint); }
.ib-likes .ico { width: 12px; height: 12px; }
.ib-flag { font-size: 11px; color: var(--st-error); }
.ib-msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ib-answer { justify-self: start; padding: 0; border: 0; background: none; color: var(--muted); font-size: 12.5px; cursor: pointer; transition: color var(--t) var(--ease); }
.ib-answer:hover { color: var(--text); }
.ib-compose { display: grid; gap: 8px; padding: 12px 16px 14px; border-top: 1px solid var(--line); background: var(--panel); }
.ib-to { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-to:empty { display: none; }
.ib-to b { color: var(--text); font-weight: 500; }
.ib-compose textarea { min-height: 64px; max-height: 40vh; }
.ib-compose-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
@media (max-width: 1100px) {
  .ib-post-acts .btn span { display: none; }
}
@media (max-width: 900px) {
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .ib-detail { display: none; position: static; height: auto; min-height: 0; overflow: visible; }
  .inbox.reading .ib-list { display: none; }
  .inbox.reading .ib-detail { display: flex; }
  .ib-back { display: inline-flex; margin-left: -6px; }
  .ib-msgs { overflow: visible; padding: 16px 14px 12px; }
  .ib-msg.reply { margin-left: 18px; }
  .ib-compose { position: sticky; bottom: 0; border-radius: 0 0 var(--r) var(--r); }
  .ib-post { flex-wrap: wrap; }
  .ib-post-acts { width: 100%; justify-content: flex-end; }
}
@media (max-width: 700px) {
  .ib-compose { bottom: calc(68px + env(safe-area-inset-bottom)); }
  .ib-compose-foot .hint { font-size: 11.5px; }
  .ib-head .btn span { display: none; }
}

/* ---------- automation ---------- */
.au { max-width: 920px; }
.au-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.au-head p { margin: 0; max-width: 60ch; color: var(--muted); font-size: 13.5px; }
.au-head .btn { flex: none; }
.au-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.au-card { display: grid; gap: 10px; align-content: start; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); transition: opacity var(--t) var(--ease); }
.au-card.off { opacity: .7; }
.au-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.au-card-head b { font: 600 16px/1.3 var(--sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.au-stat { font-size: 12.5px; color: var(--muted); }
.au-stat b { color: var(--text); font-weight: 500; }
.bad { color: var(--st-error); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--sunken); font-size: 12.5px; }
.chip.soft { height: 20px; padding: 0 8px; margin-left: 8px; font-size: 11px; color: var(--muted); border-color: var(--line); }
.empty .ring-ico { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-strong); background: var(--raised); color: var(--muted); }
.au-sec { margin-top: 28px; }
.au-sec h3 { margin: 0 0 12px; font: 600 17px/1.3 var(--sans); }
.au-list { display: grid; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; }
.au-hit { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.au-hit:last-child { border-bottom: 0; }
.au-hit img, .au-hit-blank { width: 36px; height: 45px; border-radius: 6px; object-fit: cover; background: var(--sunken); }
.au-hit > div { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-hit b { font-weight: 500; }
.au-hit small { display: block; font-size: 12px; color: var(--faint); }
.au-hit small.bad { color: var(--st-error); }

.au-form { max-width: 680px; display: grid; gap: 18px; }
.au-form h2 { margin: -6px 0 0; font: 600 22px/1.2 var(--sans); }
.au-form .field small.hint { margin-top: 2px; }
.au-back { display: inline-flex; align-items: center; gap: 6px; justify-self: start; color: var(--muted); text-decoration: none; font-size: 13px; }
.au-back:hover { color: var(--text); }
.au-back .ico { width: 16px; height: 16px; }
.au-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.au-actions .danger { margin-left: auto; }
.au a.btn { text-decoration: none; }
.au-form .seg { flex-wrap: wrap; justify-self: start; }
.au-form .field > .btn, .au-form > .switch { justify-self: start; }
.au-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 10px; }
.au-post { position: relative; display: grid; gap: 4px; padding: 0; border: 0; background: none; color: var(--muted); text-align: left; cursor: pointer; font-size: 11.5px; }
.au-post img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 8px; background: var(--sunken); outline: 1px solid var(--line); transition: outline-color var(--t) var(--ease), opacity var(--t) var(--ease); opacity: .7; }
.au-post span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-post i { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; display: none; place-items: center; background: var(--accent); color: var(--accent-ink); }
.au-post i .ico { width: 14px; height: 14px; stroke-width: 2; }
.au-post.on img { outline: 2px solid var(--accent); opacity: 1; }
.au-post.on i { display: grid; }
.au-post.on span { color: var(--text); }
.au-replies { display: grid; gap: 8px; }
.au-reply { display: flex; gap: 6px; align-items: flex-start; }
.au-gate { display: grid; gap: 10px; padding: 12px; border-radius: 10px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.au-gate[hidden] { display: none; }
.au-gate .warn-hint { align-items: flex-start; margin: 0; }
.au-under-switch { margin-top: -8px; }
.au-btn-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.au-btn-add select { width: auto; max-width: 100%; }
.au-fieldset { margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-sm); display: grid; gap: 14px; background: var(--panel); }
.au-gate { display: grid; gap: 14px; }
.au-steps { display: grid; gap: 12px; }
.au-step { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); }
.au-step-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.au-step-head b { font-weight: 500; }
.au-step-head .btn { margin-left: auto; }
.au-delay { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.au-delay input { flex: none; width: 64px; height: 30px; padding: 0 8px; }
.au-delay select { width: auto; height: 30px; padding: 0 26px 0 8px; background-position: calc(100% - 15px) 13px, calc(100% - 10px) 13px; }
.au-file { display: flex; align-items: center; gap: 8px; }
.au-file > .ico { flex: none; color: var(--muted); }
.au-file select { height: 34px; flex: 1; min-width: 0; }
.au-add-btn { justify-self: start; }
.au-link-preview code, .au-link code { font-size: 12px; overflow-wrap: anywhere; }

.au-bot { display: grid; gap: 14px; margin-bottom: 16px; }
.au-bot-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.au-bot-head .ava { width: 40px; height: 40px; font-size: 16px; }
.au-bot-name { flex: 1; min-width: 0; display: grid; }
.au-bot-name b { font: 600 17px/1.25 var(--sans); }
.au-bot-name a { color: var(--muted); font-size: 13px; text-decoration: none; }
.au-bot-name a:hover { color: var(--text); }
.au-bot-leads { font-size: 13px; color: var(--muted); }
.au-bot-leads b { color: var(--text); font-weight: 500; }
.au-flows { display: grid; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.au-none { padding: 14px 16px; }
.au-flow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--bg); }
.au-flow:last-child { border-bottom: 0; }
.au-flow.off { opacity: .7; }
.au-flow-main { min-width: 0; display: grid; gap: 4px; }
.au-flow-title { display: flex; align-items: center; flex-wrap: wrap; row-gap: 4px; }
.au-flow-name { font-weight: 500; color: var(--text); text-decoration: none; }
.au-flow-name:hover { text-decoration: underline; }
.au-link { display: flex; align-items: center; gap: 4px; min-width: 0; color: var(--muted); }
.au-link code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-flow-stats { display: grid; justify-items: end; line-height: 1.2; }
.au-flow-stats b { font: 600 22px/1 var(--sans); font-variant-numeric: tabular-nums; }
.au-flow-stats small { font-size: 11.5px; color: var(--muted); }
.au-more { margin-top: 8px; }
.au-more summary { cursor: pointer; color: var(--muted); font-size: 13.5px; padding: 8px 0; }
.au-more summary:hover { color: var(--text); }
.au-connect { display: grid; gap: 10px; }
.au-connect-row { display: flex; gap: 8px; }
.au-connect-row .btn { flex: none; height: 40px; }
.au-steps-howto { margin: 0 0 6px; padding-left: 20px; display: grid; gap: 6px; color: var(--muted); font-size: 13.5px; }
.au-steps-howto a { color: var(--text); }

.au-leads-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.au-leads-head select { width: auto; max-width: 260px; }
.au-count { margin-left: auto; color: var(--muted); font-size: 13px; }
.au-count b { color: var(--text); font-weight: 500; }
.au-table .trow { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) 150px; cursor: default; }
.au-table .trow.blocked { opacity: .65; }
.au-lead { display: grid; min-width: 0; }
.au-lead b { font-weight: 500; }
.au-lead a { color: var(--muted); font-size: 12.5px; text-decoration: none; }
.au-lead small { font-size: 12px; }
@media (max-width: 700px) {
  .au-head { flex-direction: column; }
  .au-flow { grid-template-columns: minmax(0, 1fr) auto; }
  .au-flow > .btn { grid-column: 1 / -1; justify-self: start; }
  .au-table .trow { grid-template-columns: minmax(0, 1fr) auto; }
  .au-table .trow > :nth-child(2), .au-table .trow > :nth-child(3) { display: none; }
  .au-delay { width: 100%; }
}

/* ---------- Instagram Direct ---------- */
.pf-tabs .ib-n { margin-left: 2px; }
.dm .ib-row { grid-template-columns: 36px minmax(0, 1fr) 0; }
.dm-msgs { gap: 8px; }
.dm-msg { justify-self: start; max-width: min(78%, 520px); display: grid; gap: 6px; padding: 9px 13px; border-radius: 16px 16px 16px 6px; background: var(--bg); border: 1px solid var(--line); }
.dm-msg.mine { justify-self: end; border-radius: 16px 16px 6px 16px; background: var(--raised); border-color: var(--line-strong); }
.dm-msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.dm-msg time { font-size: 11px; color: var(--faint); justify-self: end; }
.dm-img img { display: block; max-width: 240px; max-height: 300px; border-radius: 10px; object-fit: cover; background: var(--sunken); }
.dm-att { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); text-decoration: none; }
.dm-att .ico { width: 14px; height: 14px; }
a.dm-att:hover { color: var(--text); }
.ib-compose textarea:disabled { cursor: not-allowed; }
.ib-compose-foot .hint.bad { color: var(--st-error); }

.au-src { margin-bottom: 14px; }
.au-src .ico { width: 15px; height: 15px; }

/* ---------- comments: inline threads ---------- */
.cm { max-width: 880px; }
.cm .ib-row { cursor: pointer; }
.cm .ib-row.on { background: var(--raised); box-shadow: inset 2px 0 0 var(--accent); border-bottom-color: transparent; }
.ib-x { display: grid; gap: 10px; padding: 4px 16px 16px 66px; background: var(--raised); border-bottom: 1px solid var(--line); box-shadow: inset 2px 0 0 var(--accent); }
.ib-x-post { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ib-x-post small { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-x-post small .ico { flex: none; width: 13px; height: 13px; }
.ib-x-acts { flex: none; display: flex; gap: 12px; }
.ib-link { padding: 0; border: 0; background: none; color: var(--muted); font-size: 12.5px; cursor: pointer; text-decoration: none; transition: color var(--t) var(--ease); }
.ib-link:hover { color: var(--text); }
.ib-x-items { display: grid; gap: 8px; }
.ib-x-item { display: grid; gap: 3px; padding: 8px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg); font-size: 13.5px; }
.ib-x-item.mine { background: var(--panel); }
.ib-x-item.target { border-color: var(--accent-line); }
.ib-x-item b { font-weight: 500; }
.ib-x-item time { color: var(--faint); font-size: 12px; margin-left: 6px; }
.ib-x-item p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ib-x-item .ib-link { justify-self: start; }
.ib-x-compose { display: grid; gap: 6px; }
.ib-x-compose .hint b { color: var(--text); font-weight: 500; }
.ib-x-row { display: flex; gap: 8px; align-items: flex-end; }
.ib-x-row textarea { min-height: 44px; max-height: 30vh; resize: vertical; }
.ib-x-row .btn { flex: none; height: 40px; }
@media (max-width: 700px) {
  .ib-x { padding: 4px 12px 14px; }
  .ib-x-post { flex-wrap: wrap; }
  .ib-x-row .btn span { display: none; }
}

.au-phrases ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; color: var(--muted); font-size: 13px; }
.au-phrases details { margin-top: 6px; }
.au-phrases summary { list-style: none; }

/* ---------- confirm / prompt dialog ---------- */
.ask { width: min(400px, calc(100vw - 32px)); max-width: none; padding: 0; margin: auto; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.ask[open] { animation: ask-in 240ms var(--ease); }
.ask.out { animation: ask-out 150ms ease-in forwards; }
.ask::backdrop { background: var(--scrim); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: ask-fade 240ms var(--ease); }
.ask.out::backdrop { animation: ask-fade 150ms ease-in reverse forwards; }
.ask form { display: grid; gap: 8px; padding: 26px 24px 18px; }
.ask-ico { width: 40px; height: 40px; margin-bottom: 6px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.ask.danger .ask-ico { background: color-mix(in srgb, var(--st-error) 14%, transparent); color: var(--st-error); }
.ask-ico .ico { width: 20px; height: 20px; }
.ask h3 { margin: 0; font: 600 19px/1.3 var(--sans); text-wrap: balance; }
.ask p { margin: 0; color: var(--muted); line-height: 1.5; text-wrap: pretty; }
.ask input { margin-top: 8px; }
.ask .form-error { min-height: 0; color: var(--st-error); font-size: 12.5px; }
.ask-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.ask-actions .btn { min-width: 96px; }
.btn.danger-fill { background: var(--st-error); border-color: var(--st-error); color: #fff; }
.btn.danger-fill:hover { background: color-mix(in srgb, var(--st-error) 86%, #fff); border-color: transparent; }
.ask .btn:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
@keyframes ask-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes ask-out { to { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes ask-fade { from { opacity: 0; } }
@media (max-width: 520px) {
  .ask-actions { flex-direction: column-reverse; }
  .ask-actions .btn { width: 100%; height: 42px; }
}
@media (prefers-reduced-motion: reduce) { .ask, .ask::backdrop, .ask.out, .ask.out::backdrop { animation: none !important; } }

/* ---------- vidIQ checks (YouTube variant) ---------- */
.vq-sec .btn small { margin-left: 6px; font-size: 11px; font-weight: 500; opacity: .62; }
.vq-sec .ed-row .btn { flex: none; height: 40px; }
.vq-score { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--sunken); }
.vq-score > b { width: 52px; height: 52px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 600 20px/1 var(--sans); font-variant-numeric: tabular-nums; border: 2px solid currentColor; }
.vq-score > span { display: grid; gap: 2px; min-width: 0; }
.vq-score i { font-style: normal; font-weight: 500; }
.vq-score small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.vq-score.good > b, .vq-n.good { color: var(--st-published); }
.vq-score.mid > b, .vq-n.mid { color: var(--st-scheduled); }
.vq-score.low > b, .vq-n.low { color: var(--st-error); }
.vq-kw { display: grid; gap: 8px; }
.vq-kw > p:first-child { margin: 0; font-size: 13px; color: var(--muted); }
.vq-kw > p:first-child b { color: var(--text); font-weight: 500; }
.vq-n { font-weight: 600; font-style: normal; font-variant-numeric: tabular-nums; }
.vq-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.vq-chip { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 6px 0 11px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 12.5px; cursor: pointer; transition: border-color var(--t) var(--ease), background var(--t) var(--ease); }
.vq-chip em { font-style: normal; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 9px; background: var(--sunken); color: var(--muted); font-variant-numeric: tabular-nums; }
.vq-chip:hover { border-color: var(--line-strong); }
.vq-chip.on { border-color: var(--accent-line); background: var(--accent-soft); }
.vq-chip.on em { background: var(--accent); color: var(--accent-ink); }
.vq-ideas { display: grid; gap: 8px; justify-items: start; }
.vq-titles { display: grid; gap: 6px; width: 100%; }
.vq-title { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel); color: var(--text); text-align: left; cursor: pointer; transition: border-color var(--t) var(--ease), background var(--t) var(--ease); }
.vq-title span { flex: 1; min-width: 0; }
.vq-title:hover { border-color: var(--line-strong); background: var(--raised); }
.vq-title.on { border-color: var(--accent-line); background: var(--accent-soft); }
.vq-sec .ed-row { grid-template-columns: 1fr auto; align-items: center; }
.tt-test { display: grid; gap: 8px; max-width: 480px; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--sunken); }

/* ---------- TikTok variant ---------- */
.tt-creator { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.tt-creator img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; }
.tt-creator span { display: grid; line-height: 1.25; }
.tt-creator small { color: var(--muted); font-size: 12px; }
.tt-allow { display: grid; gap: 8px; }
.tt-consent a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* TikTok phone preview (For You screen) */
.tk-top { position: absolute; top: 38px; left: 0; right: 0; z-index: 2; display: flex; justify-content: center; align-items: center; gap: 16px; font-size: 14px; font-weight: 600; text-shadow: 0 1px 2px rgb(0 0 0 / .4); }
.tk-top span { opacity: .65; }
.tk-top b { position: relative; }
.tk-top b::after { content: ""; position: absolute; left: 25%; right: 25%; bottom: -5px; height: 2px; border-radius: 1px; background: #fff; }
.tk-top .ico { position: absolute; right: 12px; width: 21px; height: 21px; }
.tk-ava { position: relative; width: 40px; height: 40px; margin-bottom: 8px; }
.tk-ava > :first-child { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid #fff; overflow: hidden; display: grid; }
.tk-ava > :first-child > * { width: 100%; height: 100%; object-fit: cover; display: grid; place-items: center; background: #3a3a3a; color: #fff; font-size: 12px; font-weight: 700; }
.tk-ava i { position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); width: 18px; height: 18px; border-radius: 50%; background: #fe2c55; color: #fff; display: grid; place-items: center; font-style: normal; font-size: 14px; font-weight: 700; line-height: 1; }
.tk-dots { position: absolute; left: 0; right: 0; bottom: 6px; z-index: 2; display: flex; justify-content: center; gap: 4px; }
.tk-dots i { width: 5px; height: 5px; border-radius: 50%; background: rgb(255 255 255 / .45); }
.tk-dots i.on { background: #fff; }
.tk-chip { display: inline-flex; align-self: start; justify-self: start; padding: 2px 7px; border-radius: 4px; background: rgb(255 255 255 / .2); font-size: 11px; font-weight: 600; }
.phone-tabs.dark.tk-tabs .tk-plus { width: 34px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: #fff; color: #000; box-shadow: -2px 0 0 #25f4ee, 2px 0 0 #fe2c55; }
.phone-tabs.dark.tk-tabs .tk-plus .ico { width: 16px; height: 16px; }

/* ---------- feeds of other platforms ---------- */
#feed-refresh.spinning .ico { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.feed-tabs { max-width: 640px; margin: 0 auto 18px; gap: 2px; justify-content: space-between; }
.feed-tabs a { padding: 10px 9px 12px; gap: 6px; font-size: 13.5px; }
.feed-tabs .ico { width: 16px; height: 16px; }
.feed .profile h2 small { font: 400 14px/1 var(--sans); }
.profile img.ava { object-fit: cover; border-radius: 50%; }
.feed-err { margin: 0 0 12px; align-items: flex-start; }
.feed-empty { padding: 18px 0; text-align: center; }
.tile .views { position: absolute; z-index: 2; left: 8px; bottom: 7px; display: inline-flex; align-items: center; gap: 4px; color: #fff; font-size: 12px; font-weight: 600; text-shadow: 0 1px 2px rgb(0 0 0 / .6); }
.tile .views .ico { width: 13px; height: 13px; fill: #fff; }
.pgrid.shorts .tile { aspect-ratio: 9 / 16; }
.yt-tabs { margin: 0 0 12px; }
.frows { display: grid; gap: 8px; }
.frow { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel); color: var(--text); text-decoration: none; cursor: pointer; transition: border-color var(--t) var(--ease), background var(--t) var(--ease); }
.frow:hover { border-color: var(--line-strong); background: var(--raised); }
.frow.yt { grid-template-columns: 168px minmax(0, 1fr); align-items: start; }
.fr-thumb { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--sunken); display: grid; place-items: center; color: var(--faint); }
.frow.yt .fr-thumb { aspect-ratio: 16 / 9; }
.fr-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fr-thumb em { position: absolute; right: 5px; bottom: 5px; padding: 1px 5px; border-radius: 4px; background: rgb(0 0 0 / .72); color: #fff; font: 500 10.5px/1.4 var(--sans); font-style: normal; }
.fr-body { display: grid; gap: 4px; min-width: 0; }
.fr-body b { font-weight: 500; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.fr-body small { color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.frow.planned { --st: var(--st-draft); border-style: dashed; border-color: color-mix(in srgb, var(--st) 70%, transparent); }
.frow.planned.st-scheduled { --st: var(--st-scheduled); border-style: solid; background: color-mix(in srgb, var(--st-scheduled) 8%, var(--panel)); }
.frow.planned.st-ready { --st: var(--st-ready); } .frow.planned.st-error { --st: var(--st-error); } .frow.planned.st-uploaded { --st: var(--st-publishing); }
.frow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--st); }
@media (max-width: 520px) { .frow.yt { grid-template-columns: 120px minmax(0, 1fr); } }
/* VK wall / Telegram channel: whole posts — type, full text, every photo and video */
.fposts { display: grid; gap: 10px; }
.fpost { display: grid; gap: 10px; padding: 14px 16px 16px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel); min-width: 0; }
.fpost.planned { --st: var(--st-draft); border-style: dashed; border-color: color-mix(in srgb, var(--st) 70%, transparent); cursor: pointer; }
.fpost.planned.st-scheduled { --st: var(--st-scheduled); border-style: solid; background: color-mix(in srgb, var(--st-scheduled) 8%, var(--panel)); }
.fpost.planned.st-ready { --st: var(--st-ready); } .fpost.planned.st-error { --st: var(--st-error); } .fpost.planned.st-uploaded { --st: var(--st-publishing); }
.fpost.planned:hover { border-color: var(--st); }
.fp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); min-width: 0; }
.fp-type { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 7px; border-radius: 999px; background: var(--sunken); border: 1px solid var(--line); color: var(--text); font-weight: 500; white-space: nowrap; }
.fp-type svg { width: 14px; height: 14px; color: var(--accent); }
.fp-fw { color: var(--faint); }
.fp-when { display: inline-flex; align-items: center; gap: 6px; }
.fp-when .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--st); }
.fp-stats { display: inline-flex; gap: 12px; margin-left: auto; }
.fp-stats span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fp-stats svg { width: 13px; height: 13px; color: var(--faint); }
.fp-open { display: grid; place-items: center; width: 26px; height: 26px; margin: -4px -6px -4px 0; border-radius: 7px; color: var(--faint); }
.fp-stats + .fp-open { margin-left: 0; } .fp-when + .fp-open { margin-left: auto; }
.fp-open:hover { color: var(--text); background: var(--raised); }
.fp-open svg { width: 14px; height: 14px; }
.fp-col { display: grid; gap: 10px; min-width: 0; align-content: start; }
.fp-content { min-width: 0; }
.fpost.side .fp-content { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.fpost.side.tall .fp-content { grid-template-columns: 128px minmax(0, 1fr); }
.fp-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.5; max-height: calc(1.5em * 7); overflow: hidden; }
.fp-text.cut { -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.fp-text.open { max-height: none; }
.fp-text.none { color: var(--muted); }
.fp-more { justify-self: start; margin-top: -8px; padding: 0; border: 0; background: none; color: var(--accent); font: 500 12.5px/1.4 var(--sans); cursor: pointer; }
.fp-more:hover { text-decoration: underline; }
.fp-media { display: grid; grid-auto-flow: column; grid-auto-columns: 112px; justify-content: start; gap: 4px; overflow-x: auto; scrollbar-width: thin; overscroll-behavior-x: contain; color: inherit; }
.fp-media:not(.one) .fp-m { border-radius: 6px; }
.fp-media.one { grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); overflow: visible; max-width: 100%; }
.fp-m { position: relative; display: grid; place-items: center; background: var(--sunken); color: var(--faint); overflow: hidden; min-width: 0; }
.fp-media.one .fp-m { width: 100%; border-radius: 10px; }
.fp-src .fp-media.one { max-width: 200px; }
.fp-media.one .fp-m.round { border-radius: 50%; }
.fp-m.round .fp-play { left: 50%; transform: translateX(-50%); }
.fp-m img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fp-m > i svg { width: 22px; height: 22px; }
.fp-play { position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px 2px 5px; border-radius: 6px; background: rgb(0 0 0 / .66); color: #fff; font: 500 11px/1.5 var(--sans); }
.fp-play svg { width: 12px; height: 12px; }
a.fp-media:hover .fp-m img { opacity: .9; }
.fp-link { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--sunken); color: var(--text); text-decoration: none; }
.fp-link:hover { border-color: var(--line-strong); }
.fp-link img, .fp-link > i { width: 64px; height: 48px; border-radius: 6px; object-fit: cover; display: grid; place-items: center; background: var(--raised); color: var(--faint); }
.fp-link span { display: grid; gap: 2px; min-width: 0; }
.fp-link small { color: var(--muted); font-size: 11.5px; }
.fp-link b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-poll { display: grid; gap: 6px; padding: 10px 12px; border-radius: 10px; background: var(--sunken); }
.fp-poll b { font-weight: 500; }
.fp-poll > span { position: relative; display: flex; justify-content: space-between; gap: 10px; padding: 5px 9px; border-radius: 6px; overflow: hidden; font-size: 13px; }
.fp-poll > span i { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); }
.fp-poll > span em, .fp-poll > span small { position: relative; font-style: normal; }
.fp-poll > span small { color: var(--muted); }
.fp-doc { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--sunken); font-size: 13px; min-width: 0; }
.fp-doc svg { width: 16px; height: 16px; flex: none; color: var(--faint); }
.fp-doc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-doc small { margin-left: auto; color: var(--muted); text-transform: uppercase; }
.fp-src { display: grid; gap: 8px; padding-left: 12px; border-left: 2px solid var(--line-strong); }
.fp-src > small { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.fp-src > small svg { width: 13px; height: 13px; }
@media (max-width: 520px) {
  .fpost { padding: 12px; }
  .fp-stats { margin-left: 0; order: 3; width: 100%; }
  .fpost .fp-open { margin-left: auto; }
  .fp-media { grid-auto-columns: 92px; }
  .fpost.side .fp-content { grid-template-columns: 112px minmax(0, 1fr); gap: 12px; }
  .fpost.side.tall .fp-content { grid-template-columns: 96px minmax(0, 1fr); }
}


/* media library: types and carousels */
#lib-type button small { margin-left: 6px; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
#lib-type button.on small { color: var(--muted); }

/* ---------- Articles: long reads for Dzen and VK ---------- */
.ar-list { display: grid; gap: 10px; max-width: 860px; }
.ar-card { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); color: var(--text); text-decoration: none; transition: border-color var(--t) var(--ease); }
.ar-card:hover { border-color: var(--line-strong); }
.ar-card-cover { width: 120px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; background: var(--sunken); display: grid; place-items: center; color: var(--faint); }
.ar-card-body { display: grid; gap: 4px; min-width: 0; }
.ar-card-body b { font: 600 15px/1.3 var(--sans); }
.ar-card-body > .muted { font-size: 13px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ar-card-body small { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.ar-pub { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--faint); }
.ar-pub.on { color: var(--st-published); border-color: color-mix(in srgb, var(--st-published) 50%, transparent); }
.ar-pub .ico { width: 12px; height: 12px; }

.ar { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; max-width: 1180px; }
.ar-main { display: grid; gap: 12px; min-width: 0; max-width: 760px; }
.ar-cover { display: grid; justify-items: start; }
.ar-cover img { width: 100%; max-height: 300px; object-fit: cover; border-radius: var(--r-sm); }
.ar-cover-tools { display: flex; gap: 6px; margin-top: 8px; }
.ar-title { width: 100%; resize: none; overflow: hidden; border: 0; background: none; padding: 0; color: var(--text); font: 600 26px/1.2 var(--sans); letter-spacing: -.01em; }
.ar-title:focus { outline: none; }
.ar-toolbar { position: sticky; top: 8px; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(8px); }
.ar-toolbar button { min-width: 32px; height: 30px; padding: 0 8px; border: 0; border-radius: 7px; background: none; color: var(--muted); font: 600 13px var(--sans); cursor: pointer; display: inline-grid; place-items: center; }
.ar-toolbar button:hover { background: var(--raised); color: var(--text); }
.ar-toolbar button .ico { width: 15px; height: 15px; }
.ar-toolbar > i { width: 1px; height: 18px; margin: 0 4px; background: var(--line); }
.ar-body { min-height: 50vh; padding: 4px 2px 40px; font: 400 16.5px/1.7 var(--sans); color: var(--text); outline: none; overflow-wrap: anywhere; }
.ar-body { position: relative; }
.ar-body.is-empty::before { content: attr(data-ph); position: absolute; left: 2px; right: 2px; top: 4px; color: var(--faint); pointer-events: none; }
.ar-body p { margin: 0 0 14px; }
.ar-body h2 { margin: 28px 0 10px; font: 600 24px/1.25 var(--sans); }
.ar-body h3 { margin: 22px 0 8px; font: 600 19px/1.3 var(--sans); }
.ar-body ul, .ar-body ol { margin: 0 0 14px; padding-left: 24px; }
.ar-body li { margin: 4px 0; }
.ar-body blockquote { margin: 18px 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--accent); color: var(--muted); font-style: italic; }
.ar-body a { color: var(--accent); }
.ar-body hr { border: 0; border-top: 1px solid var(--line-strong); margin: 26px 0; }
.ar-body figure { margin: 18px 0; }
.ar-body img { display: block; max-width: 100%; border-radius: 8px; }
.ar-body figcaption { margin-top: 6px; text-align: center; color: var(--muted); font-size: 13.5px; }
.ar-body figcaption:empty::before { content: 'Подпись к картинке (необязательно)'; color: var(--faint); }
.ar-foot { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }
.ar-side { position: sticky; top: 12px; display: grid; gap: 14px; }
.ar-pf { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); }
.ar-pf h3 { margin: 0; font: 600 15px/1.3 var(--sans); }
.ar-pf .hint { margin: 0; }
.ar-pf-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.ar-url { display: flex; gap: 6px; }
.ar-url input { flex: 1; min-width: 0; }
.ar-imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ar-img { position: relative; display: block; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--sunken); color: #fff; }
.ar-img img { width: 100%; height: 100%; object-fit: cover; }
.ar-img span { position: absolute; left: 4px; bottom: 4px; padding: 0 5px; border-radius: 4px; background: rgb(0 0 0 / .6); font-size: 10.5px; }
.ar-img .ico { position: absolute; right: 4px; top: 4px; width: 16px; height: 16px; padding: 2px; border-radius: 4px; background: rgb(0 0 0 / .55); opacity: 0; transition: opacity var(--t); }
.ar-img:hover .ico { opacity: 1; }
.ar-pick { width: min(720px, 92vw); border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); color: var(--text); padding: 0; }
.ar-pick::backdrop { background: rgb(0 0 0 / .5); }
.ar-pick header { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ar-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; padding: 12px; max-height: 60vh; overflow: auto; }
.ar-pick-grid button { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; aspect-ratio: 1; cursor: pointer; background: var(--sunken); }
.ar-pick-grid button:hover { border-color: var(--accent); }
.ar-pick-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 1000px) { .ar { grid-template-columns: minmax(0, 1fr); } .ar-side { position: static; } }
@media (max-width: 520px) { .ar-card { grid-template-columns: 84px minmax(0, 1fr); gap: 10px; } .ar-card-cover { width: 84px; } .ar-title { font-size: 27px; } }

/* Instagram stories preview: a frame full-screen, a bar per frame, tap zones */
/* the story frame of the preview (not .st: that is the status column of the posts list) */
.st-frame { position: absolute; inset: 0; background: #000; }
.st-frame > img, .st-frame > video { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-shade { position: absolute; inset: 0 0 auto; height: 120px; background: linear-gradient(rgb(0 0 0 / .45), transparent); pointer-events: none; }
.st-bars { position: absolute; top: 36px; left: 8px; right: 8px; display: flex; gap: 3px; z-index: 2; }
.st-bars i { flex: 1; height: 2.5px; border-radius: 2px; background: rgb(255 255 255 / .35); }
.st-bars i.done, .st-bars i.now { background: #fff; }
.st-user { position: absolute; top: 46px; left: 10px; right: 10px; display: flex; align-items: center; gap: 7px; color: #fff; font: 600 12.5px var(--sans); z-index: 2; }
.st-user .rl-ava { width: 26px; height: 26px; }
.st-user small { font-weight: 400; opacity: .8; }
.st-n { margin-left: auto; padding: 1px 7px; border-radius: 999px; background: rgb(0 0 0 / .35); font-weight: 500; font-size: 11px; }
.st-tap { position: absolute; top: 80px; bottom: 60px; width: 40%; border: 0; background: none; cursor: pointer; z-index: 2; }
.st-tap.prev { left: 0; } .st-tap.next { right: 0; }
.st-tap[hidden] { display: none; }
.st-reply { position: absolute; left: 10px; right: 10px; bottom: 14px; display: flex; align-items: center; gap: 12px; color: #fff; z-index: 2; }
.st-reply span { flex: 1; padding: 8px 14px; border: 1px solid rgb(255 255 255 / .6); border-radius: 999px; font-size: 12px; }
.st-reply svg { width: 22px; height: 22px; }
.st-frame .ig-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: rgb(255 255 255 / .75); text-align: center; }

/* ---------- studio sign-in (studio.wt-studio.org) ---------- */
.auth-card .studio-login { text-decoration: none; }
.auth-or { margin: -4px 0 -2px; text-align: center; font-size: 12px; color: var(--faint); display: flex; align-items: center; gap: 10px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#studio-link { text-decoration: none; }

/* The app switcher in the phone bar (the rail is hidden there): 44px target, compact label. */
@media (max-width: 700px) { .bar .apps-btn { min-height: 44px; } .apps-menu .menu-item { min-height: 44px; } }
/* Keyboard hints (N, ⌘K) mean nothing on a touch screen (2.5). */
@media (hover: none) { kbd { display: none !important; } }
/* List states (2.5): an error with «Повторить». */
.state-error { display: grid; justify-items: center; gap: 10px; padding: 24px 16px; border: 1px dashed var(--line-strong); border-radius: var(--r); color: var(--muted); text-align: center; font-size: 13.5px; }

/* Comments: platform tabs under the filter (with «Все» on top), so Instagram and Telegram don't mix */
.ib-src { display: flex; width: 100%; overflow-x: auto; margin: 0 0 12px; scrollbar-width: none; }
.ib-src::-webkit-scrollbar { display: none; }
.ib-src[hidden] { display: none; }
.ib-src button { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex: 0 0 auto; }
.ib-src button svg { width: 14px; height: 14px; }

/* ---------- stage 2 (ТЗ 1.2, раздел 4) ---------- */
/* one primary per screen: a view's own primary sits before «Новый пост», which then steps back to a secondary */
.view-primary:empty { display: none; }
.view-primary { display: inline-flex; }

/* Входящие (4.6): list 360px on the left, the thread on the right; on a phone the thread unfolds under its row */
.inbox.ib2 { grid-template-columns: 360px minmax(0, 1fr); gap: 0; margin: -28px -32px -48px; min-height: calc(100vh - 118px); }
.ib2 .ib-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 100%; }
.ib2 .ib-notes { padding: 12px 16px 0; margin: 0; }
.ib2 .ib-threads { border: 0; border-radius: 0; background: transparent; flex: 1; align-content: start; }
.ib2 .ib-row { grid-template-columns: 34px minmax(0, 1fr) 14px; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.ib2 .ib-row.on { background: var(--raised); box-shadow: inset 2px 0 0 var(--text); }
.ib2 .ib-row.unread::before { left: auto; right: 18px; top: 20px; width: 8px; height: 8px; }
.ib2 .ib-ava { width: 34px; height: 34px; font-size: 13px; }
.ib2 .ib-top b { font-size: 13px; }
.ib2 .ib-text { font-size: 13.5px; line-height: 1.4; }
.ib2 .ib-row.unread .ib-text { color: var(--text); }
.ib-keys { margin: auto 0 0; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--faint); }
.ib2 .ib-detail { position: sticky; top: 118px; height: calc(100vh - 118px); min-height: 0; border: 0; border-radius: 0; background: transparent; }
.ib2 .ib-post { padding: 18px 28px; }
.ib2 .ib-post-text p { font: 600 15px/1.3 var(--sans); white-space: normal; }
.ib2 .ib-msgs { padding: 22px 28px; }
.ib2 .ib-msg { border: 0; background: transparent; padding: 0; max-width: 620px; }
.ib2 .ib-msg.reply { margin-left: 46px; }
.ib2 .ib-msg.mine { background: transparent; }
.ib2 .ib-msg.target { box-shadow: none; }
.ib2 .ib-msg p { font-size: 15px; line-height: 1.5; padding-left: 34px; }
.ib2 .ib-msg .ib-answer { margin-left: 34px; }
.ib2 .ib-compose { padding: 16px 28px 20px; background: transparent; }
.ib2 .ib-compose textarea { min-height: 76px; border-radius: 10px; background: var(--panel); }
.ib-type { width: auto; height: 34px; padding: 0 32px 0 12px; font-size: 13px; background-position: calc(100% - 15px) 14px, calc(100% - 10px) 14px; }
.ib-n.hot { background: var(--accent-soft); color: var(--accent); }
.ib-n { background: var(--sunken); color: var(--faint); font-variant-numeric: tabular-nums; }
.seg button.on .ib-n { color: var(--text); }
.ib-inline { grid-column: 1 / -1; border-bottom: 1px solid var(--line); background: var(--raised); }
.ib-inline .ib-thread { min-height: 0; }
.ib-inline .ib-post { padding: 14px 16px; }
.ib-inline .ib-msgs { padding: 14px 16px; overflow: visible; }
.ib-inline .ib-compose { padding: 12px 16px 16px; position: static; }
@media (max-width: 1100px) { .inbox.ib2 { grid-template-columns: 320px minmax(0, 1fr); } }
@media (max-width: 900px) {
  .inbox.ib2 { grid-template-columns: minmax(0, 1fr); margin: -16px -16px -32px; min-height: 0; }
  .ib2 .ib-list { border-right: 0; }
  .ib2 .ib-detail, .inbox.ib2.reading .ib-detail { display: none; }
  .inbox.ib2.reading .ib-list { display: flex; }
  .ib2 .ib-back { display: none; }
  .ib-keys { display: none; }
  .ib2 .ib-row.on { box-shadow: none; border-bottom-color: transparent; }
  .ib2 .ib-msg p { padding-left: 0; }
  .ib2 .ib-msg.reply { margin-left: 18px; }
  .ib2 .ib-msg .ib-answer { margin-left: 0; }
}

/* editor (4.4): platforms 3×2, «Когда» as quick picks, problems by their fields, one primary with a «⋯» menu */
.pf-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pf-chip { height: 42px; border-radius: 9px; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); display: flex; align-items: center; gap: 10px; padding: 0 12px; font: 500 13px var(--sans); cursor: pointer; transition: border-color var(--t) var(--ease), color var(--t) var(--ease), background var(--t) var(--ease); }
.pf-chip:hover { color: var(--text); }
.pf-chip.on { border-color: var(--text); background: var(--raised); color: var(--text); }
.pf-chip .ico { width: 16px; height: 16px; flex: none; }
.pf-chip small { font-size: 11px; color: var(--faint); margin-left: auto; }
.pf-chip .tick { position: static; margin-left: auto; width: 14px; height: 14px; stroke-width: 2.2; color: var(--text); }
.pf-chip.on small { margin-left: 0; }
.when-picks { display: flex; gap: 8px; flex-wrap: wrap; }
.when-picks .btn.on { border-color: var(--text); background: var(--raised); }
.when-picks .btn.dashed { border-style: dashed; color: var(--muted); }
.when-picks .btn.dashed.on { border-style: solid; color: var(--text); }
.when-picks .btn .tnum { color: var(--muted); font-weight: 500; }
.when-picks .btn.on .tnum { color: var(--text); }
.when-custom { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 360px; }
.field-problem { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 13px; color: var(--st-error); }
.field-problem .ico { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.ed-foot { min-height: 68px; flex-wrap: nowrap; gap: 10px; }
.ed-count { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--st-error); cursor: pointer; }
.ed-count b { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--st-error) 16%, transparent); font-size: 11px; font-weight: 600; }
.ed-primary { height: 40px; padding: 0 18px; font-size: 14px; }
.ed-more { position: relative; }
.ed-menu { position: absolute; right: 0; bottom: calc(100% + 6px); min-width: 220px; padding: 6px; border-radius: var(--r-lg); border: 1px solid var(--line-strong); background: var(--raised); box-shadow: var(--shadow); z-index: 60; }
.ed-menu .menu-item { min-height: 36px; text-decoration: none; }
.ed-menu .menu-item.danger { color: var(--st-error); }
.ed-menu .menu-item.danger .ico { color: var(--st-error); }
.phone-status, .phone-island { display: none; }
.phone-screen { padding-top: 8px; }
@media (max-width: 700px) {
  .pf-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .when-custom { max-width: none; }
  .ed-foot .btn { flex: none; }
  .ed-foot .ed-primary { flex: 1; }
}

/* publications (4.3): the status row is the filter; the error reads inside its row */
.seg.counts button b { font-weight: 600; font-variant-numeric: tabular-nums; margin-left: 2px; }
.seg.counts button b.st-draft { color: var(--st-draft); } .seg.counts button b.st-ready { color: var(--st-ready); } .seg.counts button b.st-scheduled { color: var(--st-scheduled); }
.seg.counts button b.st-published { color: var(--st-published); } .seg.counts button b.st-error { color: var(--st-error); } .seg.counts button b.st-all { color: var(--muted); }
.bar-actions .search { position: relative; width: 240px; }
.bar-actions .search .ico { position: absolute; left: 11px; top: 9px; width: 16px; height: 16px; color: var(--faint); }
.bar-actions .search input:not([type=checkbox]) { height: 34px; padding-left: 34px; font-size: 13px; }
.bar-actions select { width: auto; height: 34px; padding: 0 30px 0 12px; font-size: 13px; background-position: calc(100% - 15px) 14px, calc(100% - 10px) 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.table.posts .trow { grid-template-columns: 36px minmax(0, 1fr) 120px 150px 130px 34px; gap: 14px; padding: 10px 14px; }
.table.posts .trow.head { font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--muted); background: transparent; padding: 10px 14px; }
.table.posts .trow .th { width: 36px; height: 45px; border-radius: 5px; }
.table.posts .cell-main { display: grid; gap: 6px; min-width: 0; }
.table.posts .trow .cap { font-size: 14px; line-height: 1.4; }
.table.posts .when-col { font-size: 13.5px; }
.row-err { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.row-err-text { color: var(--st-error); }
.row-err .btn.sm { height: 28px; }
.row-more { display: flex; justify-content: flex-end; }
.row-menu { position: absolute; z-index: 85; min-width: 220px; padding: 6px; border-radius: var(--r-lg); border: 1px solid var(--line-strong); background: var(--raised); box-shadow: var(--shadow); }
.row-menu .menu-item { min-height: 36px; }
.row-menu .menu-item.danger, .row-menu .menu-item.danger .ico { color: var(--st-error); }
@media (max-width: 900px) {
  .table.posts .trow { grid-template-columns: 36px minmax(0, 1fr) 34px; }
  .table.posts .trow .st { grid-column: 2; }
  .bar-actions .search { width: 100%; }
  .seg.counts { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
}

/* ---------- stage 2: calendar month + list (4.2) ---------- */
.toast .toast-act { margin-left: 6px; border: 0; background: transparent; color: var(--accent); font: 600 13px var(--sans); cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.toast .toast-act:hover { background: var(--accent-soft); }
/* the month chip: 20px cover, time, 12px platform icons, a 2px status bar at the left; no caption */
.cal.month .pc.compact { padding: 4px 6px 4px 7px; gap: 6px; border-radius: 7px; }
.cal.month .pc.compact::before { content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 2px; border-radius: 2px; background: var(--muted); }
.cal.month .pc.compact.st-scheduled::before { background: var(--st-scheduled); }
.cal.month .pc.compact.st-published::before { background: var(--st-published); }
.cal.month .pc.compact.st-error::before { background: var(--st-error); }
.cal.month .pc.compact.st-draft::before { background: var(--line-strong); }
.cal.month .pc.compact.st-ready::before { background: var(--st-ready, var(--accent)); }
.cal.month .pc.compact .th { width: 20px; height: 20px; border-radius: 4px; }
.cal.month .pc.compact .th .ico { width: 11px; height: 11px; }
.cal.month .pc.compact .pc-body { display: flex; align-items: center; min-width: 0; }
.cal.month .pc.compact .pc-meta { gap: 6px; }
.cal.month .pc.compact .pc-time { font: 600 12px var(--sans); font-variant-numeric: tabular-nums; color: var(--text); }
.cal.month .pc.compact .pc-meta .ico { width: 12px; height: 12px; }
.cal.month .pc.compact .pf-badges { gap: 2px; }
/* «+ пост на среду» on a hovered day — text, not a square */
.cal.month .day-add { width: auto; height: 24px; padding: 0 8px; font: 500 12px var(--sans); color: var(--muted); border-color: var(--line); background: var(--panel); }
.cal.month .day-add .ico { display: none; }
.cal.month .day:not(.past) { cursor: cell; }
.idea-btn { width: 100%; justify-content: center; margin-top: 8px; border-style: dashed; border-color: var(--line-strong); color: var(--muted); }
.idea-btn:hover { color: var(--text); }
/* the hover card over a chip */
.pc-hover { position: absolute; z-index: 60; width: 280px; display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 10px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--panel); box-shadow: var(--shadow); animation: fade .12s var(--ease); }
.pc-hover > img { width: 64px; height: 80px; object-fit: cover; border-radius: 6px; background: var(--sunken); }
.pc-hover-body { min-width: 0; display: grid; gap: 6px; align-content: start; }
.pc-hover-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; }
.pc-hover-body p { margin: 0; font-size: 13px; line-height: 1.4; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-hover-err { color: var(--st-error) !important; font-size: 12px !important; }
.pc-hover-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.pc-hover:has(> img:not([src])) { grid-template-columns: 1fr; }
/* the list view: an agenda for 14 days, empty days folded into one line */
.agenda-list { display: grid; gap: 14px; max-width: 760px; }
.ag-day h3 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 6px; font: 600 14px var(--sans); }
.ag-day h3 span { color: var(--muted); font-weight: 400; font-size: 13px; }
.ag-day.today h3 b { color: var(--accent); }
.ag-day.drop-over { background: var(--accent-soft); border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--accent-line); }
.ag-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel); cursor: pointer; min-height: 56px; transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.ag-row + .ag-row { margin-top: 6px; }
.ag-row:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.ag-row.next { border-color: var(--accent-line); }
.ag-row .th { width: 36px; height: 45px; border-radius: 5px; object-fit: cover; flex: none; background: var(--sunken); display: grid; place-items: center; color: var(--faint); }
.ag-body { min-width: 0; display: grid; gap: 3px; }
.ag-top { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.ag-top b { font-weight: 600; }
.ag-cap { font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-gap { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; color: var(--faint); font-size: 13px; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.ag-gap .ib-link { color: var(--muted); }
.ag-gap .ib-link:hover { color: var(--text); }
.empty.compact { padding: 32px 16px; }
@media (max-width: 700px) {
  .agenda-list { gap: 10px; }
  .ag-row { min-height: 60px; }
  .ag-gap { padding: 8px 4px; }
  .pc-hover { display: none; }
}

/* ---------- stage 2: statistics (4.5) ---------- */
.stats-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.stats-top .pf-tabs { margin-bottom: 0; border-bottom: 0; }
.stats-top .st-seg:empty { display: none; }
.stats-pf { margin-top: 0; }
.counter.static span::before { display: none; }
.counter.static span { font-size: 13px; }
.counter.static b { font-size: 28px; }
.mini .mini-hint { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; }
.chart .bars path { fill: var(--line-strong); }
.chart .bars path.today { fill: var(--accent); }
.chart-plot:hover .bars path { opacity: 1; fill: var(--line); }
.chart-plot:hover .bars path.on { fill: var(--muted); }
.chart-plot:hover .bars path.today { fill: var(--accent); opacity: .6; }
.chart-plot:hover .bars path.today.on { opacity: 1; }
.chart-max, .chart-min, .chart-x { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart figcaption b { font-size: 14px; }
.chart.line .ln { stroke: var(--muted); }
.hb-track i { background: var(--line-strong); }
.s1 { background: var(--muted); } .s2 { background: var(--line-strong); }
@media (max-width: 700px) {
  .stats-top { flex-direction: column; align-items: stretch; }
  .stats-top .st-seg { margin-bottom: 10px; overflow-x: auto; }
}

/* ---------- stage 2: feed (4.8) ---------- */
.tile { aspect-ratio: 4 / 5; }
.tile.planned::after { box-shadow: inset 0 0 0 2px var(--accent); }
.tile.planned.st-draft, .tile.planned.st-ready, .tile.planned.st-error { outline: 1.5px dashed var(--line-strong); outline-offset: -2px; }
.tile.planned.st-draft img, .tile.planned.st-ready img { filter: brightness(.7); }
.tile.planned.st-error { outline-color: var(--st-error); }
.tile .when { position: absolute; left: 8px; top: 8px; right: auto; bottom: auto; padding: 0 8px; height: 22px; display: inline-flex; align-items: center; border-radius: 6px; font: 500 11.5px var(--sans); font-variant-numeric: tabular-nums; color: #fff; background: rgb(0 0 0 / .62); backdrop-filter: blur(6px); max-width: calc(100% - 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.planned.st-scheduled .when { background: color-mix(in srgb, var(--accent) 82%, #000); color: var(--accent-ink, #141210); }
.tile .badge { top: auto; bottom: 8px; }
.feed-note { padding: 10px 0 12px; border-top: 0; }
.feed-note .legend i.lg-plan { border: 2px solid var(--accent); background: transparent; }
.feed-note .legend i.lg-draft { border: 1.5px dashed var(--line-strong); background: transparent; }
.feed .profile { padding: 14px 4px 10px; gap: 20px; }
.feed .profile .ava { width: 72px; height: 72px; }
.feed .profile h2 { font-size: 20px; margin-bottom: 6px; }

/* ---------- stage 2: library (4.9) ---------- */
.lib-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px 14px; }
.mtile .meta { padding: 6px 2px 0; }
.mtile { border: 0; background: transparent; border-radius: 0; overflow: visible; }
.mtile .img { border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); }
.mtile:hover { box-shadow: none; }
.mtile:hover .img { border-color: var(--line-strong); }
.mtile.sel { box-shadow: none; }
.mtile.sel .img { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.mtile .tag { border-radius: 6px; height: 20px; padding: 0 7px; }
.mtile .used .pill { background: rgb(14 14 13 / .72); color: #fff; }
.mtile.dropzone { display: grid; place-content: center; justify-items: center; gap: 4px; aspect-ratio: 4 / 5; border-radius: var(--r-sm); border: 1px dashed var(--line-strong); color: var(--muted); text-align: center; padding: 12px; cursor: pointer; transition: border-color var(--t), background var(--t); }
.mtile.dropzone .ico { width: 18px; height: 18px; margin-bottom: 6px; }
.mtile.dropzone b { font-weight: 500; font-size: 13px; color: var(--text); }
.mtile.dropzone small { font-size: 12px; color: var(--faint); }
.mtile.dropzone:hover, .mtile.dropzone.over, .mtile.dropzone:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 700px) {
  .lib-grid { grid-template-columns: repeat(3, 1fr); gap: 10px 8px; }
  .mtile.dropzone b { font-size: 12px; }
}

/* ---------- stage 2: automation (4.10) ---------- */
.au { max-width: none; }
.au .pf-tabs { margin-bottom: 18px; }
.au-two { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.au-two .au-sec { margin-top: 0; }
.au-two .au-sec h3 { font: 600 14px var(--sans); color: var(--muted); margin-bottom: 10px; }
.au-rule { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; transition: background var(--t); }
.au-rule:last-child { border-bottom: 0; }
.au-rule:hover { background: var(--raised); }
.au-rule.off .au-rule-body { opacity: .6; }
.au-rule-body { display: grid; gap: 6px; min-width: 0; }
.au-rule-body b { font: 600 15px/1.3 var(--sans); }
.au-rule-body small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.au-rule-stat { display: grid; gap: 2px; justify-items: end; text-align: right; font-size: 12.5px; white-space: nowrap; }
.au-rule-stat b { font-weight: 500; }
.au-rule-stat small { color: var(--faint); }
.au-rule .switch { padding-top: 2px; }
.au-recent .au-hit { grid-template-columns: 36px minmax(0, 1fr) auto; }
.au-recent .au-hit > .pill { align-self: center; }
.au-hit small { color: var(--muted); }
@media (max-width: 900px) { .au-two { grid-template-columns: 1fr; } .au-rule { grid-template-columns: auto minmax(0, 1fr); } .au-rule-stat { grid-column: 2; justify-items: start; text-align: left; } }

/* ---------- stage 2: settings (4.11) ---------- */
.settings.two { max-width: 980px; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; }
.set-nav { position: sticky; top: 84px; display: grid; gap: 2px; }
.set-nav a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14px; }
.set-nav a:hover { color: var(--text); background: var(--raised); }
.set-nav a.on { color: var(--text); background: var(--raised); }
.set-body { min-width: 0; }
.set-sec[hidden] { display: none; }
.pf-list { display: grid; }
.pf-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line); }
.pf-row:first-child { border-top: 0; }
.pf-row .ava { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--sunken); border: 1px solid var(--line); color: var(--muted); }
.pf-row .ava .ico { width: 18px; height: 18px; }
.pf-row-main { display: grid; gap: 4px; min-width: 0; }
.pf-row-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pf-row-title b { font-weight: 600; font-size: 15px; }
.pf-row small { font-size: 13px; line-height: 1.4; }
.pf-row-acts { display: flex; align-items: center; gap: 6px; }
.pf-problem { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; padding: 10px 12px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--st-error) 10%, transparent); border: 1px solid color-mix(in srgb, var(--st-error) 30%, transparent); font-size: 13px; }
.pf-problem .ico { width: 16px; height: 16px; color: var(--st-error); flex: none; }
.pf-problem span { flex: 1; min-width: 180px; }
.tt-test { display: grid; gap: 10px; margin-top: 8px; padding: 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--sunken); }
.pf-row [data-tt-open] { justify-self: start; margin-top: 4px; }
@media (max-width: 700px) {
  .settings.two { grid-template-columns: 1fr; gap: 14px; }
  .set-nav { position: static; display: flex; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); gap: 4px; }
  .set-nav a { white-space: nowrap; border-radius: 8px 8px 0 0; min-height: 44px; display: grid; place-items: center; }
  .pf-row { grid-template-columns: 36px minmax(0, 1fr) auto; }
}

/* ---------- stage 2: articles (4.12) ---------- */
.table.posts.articles .trow { grid-template-columns: 36px minmax(0, 1fr) 150px 130px 110px 34px; color: var(--text); text-decoration: none; }
.table.posts.articles .row-more { color: var(--faint); display: grid; place-items: center; }
@media (max-width: 700px) {
  .table.posts.articles .trow { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .table.posts.articles .trow > :nth-child(n+3):not(.row-more) { display: none; }
}
/* stage 2: toolbar fit + chips that never spill out of a narrow day */
.bar-actions .search { flex: 1 1 140px; min-width: 120px; max-width: 240px; }
.bar-actions .search input { min-width: 0; width: 100%; }
.bar-actions select { max-width: 150px; }
.cal.month .pc.compact { max-width: 100%; }
.cal.month .pc.compact .pc-body, .cal.month .pc.compact .pc-meta { min-width: 0; overflow: hidden; flex-wrap: nowrap; }
.cal.month .pc.compact .pf-badges { min-width: 0; overflow: hidden; flex-wrap: nowrap; }
.cal.month .pc.compact .pf-badge { flex: none; }

/* stage 2: phone fixes — publications toolbar and the library grid */
@media (max-width: 700px) {
  .bar-actions:has(.seg.counts) { flex-wrap: wrap; }
  .bar-actions .seg.counts { flex: 1 1 100%; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
  .bar-actions .seg.counts button { flex: none; white-space: nowrap; min-height: 44px; }
  .bar-actions:has(.seg.counts) .search { flex: 1 1 100%; max-width: none; width: 100%; }
  .bar-actions:has(.seg.counts) select { flex: 1 1 40%; max-width: none; min-height: 44px; }
  .lib-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mtile .meta { flex-direction: column; align-items: flex-start; gap: 0; }
  .mtile .meta .name { max-width: 100%; }
}
/* stage 2: the publications toolbar stays on one row at 1440 */
@media (min-width: 701px) {
  .bar-actions .search { flex: 0 1 130px; min-width: 100px; }
  .bar-actions select { max-width: 150px; padding-left: 10px; }
  .bar-actions .seg.counts button { padding: 0 10px; }
}

/* ======================================================================================================
   Планнер v3.1 · этап A — каркас: верхняя строка 72 px, заголовок в странице, поиск, меню аватара,
   нижнее меню студии на телефоне, четыре статуса. Всё из токенов студии; золото не используется.
   ====================================================================================================== */
.shell { min-height: 100%; display: flex; flex-direction: column; }
.main { flex: 1; }

/* the top bar: logo · switcher · sections · [errors · search · «Новый пост» · avatar]. It scrolls away with the page. */
.topbar { position: relative; z-index: 12; display: flex; align-items: center; gap: 14px; height: 72px; padding: 0 40px; background: var(--bg); }
.tb-logo { display: block; flex: none; border-radius: 8px; }
.tb-logo .logo-mask { width: 54px; }
.topbar .apps-btn { height: 40px; padding: 0 10px 0 12px; gap: 8px; border: 0; border-radius: 12px; background: var(--raised); font-size: 14.5px; }
.topbar .apps-btn:hover, .topbar .apps-btn[aria-expanded="true"] { background: color-mix(in srgb, var(--raised) 80%, var(--text) 8%); }
.topbar .apps-btn .apps-ico { width: 18px; height: 18px; padding: 0; border-radius: 0; background: transparent; }
.topbar .apps-btn .apps-chev { margin-left: 2px; }
.tb-nav { display: flex; align-items: center; gap: 2px; min-width: 0; margin-left: 6px; }
.tb-tab { position: relative; isolation: isolate; flex: none; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 10px; color: var(--muted); font: 500 14px var(--sans); white-space: nowrap; text-decoration: none; transition: color var(--t) var(--ease), background var(--t) var(--ease); }
.tb-tab:hover { color: var(--text); }
.tb-tab.on { color: var(--text); background: var(--raised); }
.tb-tab:focus-visible, .tb-ic:focus-visible, .tb-ava:focus-visible, .err-badge:focus-visible, .apps-btn:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.tb-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; font: 600 11px/20px var(--sans); font-variant-numeric: tabular-nums; background: color-mix(in srgb, var(--text) 14%, transparent); color: var(--text); }
.tb-count[hidden] { display: none; }
.tb-end { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.err-badge { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 11px; border-radius: 20px; font: 700 14px var(--sans); font-variant-numeric: tabular-nums; text-decoration: none; color: var(--st-error); background: color-mix(in srgb, var(--st-error) 14%, transparent); }
.err-badge .ico { width: 18px; height: 18px; stroke-width: 2; }
.err-badge:hover { background: color-mix(in srgb, var(--st-error) 22%, transparent); }
.err-badge[hidden] { display: none; }
.tb-ic { width: 40px; height: 40px; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; background: var(--raised); color: var(--text); }
.tb-ic:hover { background: color-mix(in srgb, var(--raised) 80%, var(--text) 8%); }
.topbar #new-post { height: 40px; padding: 0 18px; border-radius: 20px; font-weight: 600; font-size: 14px; }
.tb-ava { width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; background: transparent; display: grid; place-items: center; }
.tb-ava .ava { width: 40px; height: 40px; background: var(--raised); border: 0; }
.tb-ava .ava-letter { font-size: 14px; }
.ava-menu { min-width: 232px; }
.ava-menu .menu-who { display: grid; gap: 2px; padding: 8px 10px 4px; }
.ava-menu .menu-who b { font-weight: 600; }
.ava-menu .menu-who small { color: var(--muted); font-size: 12px; }
.menu-item[href] { text-decoration: none; }

/* the page head: «Следующая публикация», the title in the page (28 / 600) with its caption, the page's own controls */
.page-head { padding: 0 40px; }
.next-line { display: flex; align-items: center; gap: 8px; margin-top: 4px; width: max-content; max-width: 100%; color: var(--muted); font-size: 14px; text-decoration: none; cursor: pointer; border-radius: 8px; }
.next-line[hidden] { display: none; }
.next-line .ico { width: 15px; height: 15px; flex: none; }
.next-line .nl-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-line .nl-title { color: var(--text); font-weight: 500; }
.next-line .nl-short { display: none; }
.next-line .nl-open { flex: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.next-line:hover .nl-open { color: var(--text); }
.next-line:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 3px; }
.ph-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding-top: 18px; }
.ph-title { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; }
.ph-title h1 { margin: 0; font: 600 28px/1.2 var(--sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ph-sub { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.ph-sub:empty { display: none; }
.ph-end { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.ph-end .pf-bar { margin-left: 0; }
.page-head[data-view="more"] .ph-title, .page-head[data-view="more"] .pf-bar, .page-head[data-view="errors"] .pf-bar { display: none; }
.page-head[data-view="more"] .ph-row { padding-top: 0; }
.page-head[data-view="errors"] .ph-sub { color: var(--st-error); font-weight: 500; }
.view { padding: 20px 40px 56px; }

/* «Ещё»: a menu at the left, one page at the right */
.more { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 40px; align-items: start; }
.more-nav { position: sticky; top: 16px; display: grid; gap: 2px; }
.more-cap { padding: 0 12px 8px; font: 500 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.more-nav a { display: block; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-size: 15px; text-decoration: none; }
.more-nav a:hover { color: var(--text); }
.more-nav a.on { color: var(--text); background: var(--raised); }
.more-nav a:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.more-narrow { display: none !important; }
.more-body { min-width: 0; }
.more-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; margin-bottom: 14px; }
.more-head h1 { margin: 0; font: 600 28px/1.2 var(--sans); letter-spacing: -.02em; }
.more-head:has(#more-title:empty) { display: none; }

/* search: ⌘K */
.search-ov { position: fixed; inset: 0; z-index: 120; display: grid; justify-items: center; align-content: start; padding: 12vh 16px 16px; background: var(--scrim); }
.search-ov[hidden] { display: none; }
.search-box { width: min(640px, 100%); max-height: 76vh; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--raised); box-shadow: var(--shadow); }
.search-field { display: flex; align-items: center; gap: 10px; height: 58px; padding: 0 12px 0 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-field .ico { width: 20px; height: 20px; }
.search-field input:not([type=checkbox]):not([type=radio]):not([type=file]) { flex: 1; min-width: 0; height: 56px; padding: 0; border: 0; border-radius: 0; background: transparent; font-size: 17px; color: var(--text); box-shadow: none; -webkit-appearance: none; appearance: none; }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-field input:focus { outline: none; box-shadow: none; }
.search-x { flex: none; }
.search-list { overflow-y: auto; overscroll-behavior: contain; padding: 6px; }
.search-list:empty { display: none; }
.search-note { padding: 22px 14px; color: var(--muted); text-align: center; }
.search-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.search-row.on { background: var(--sunken); }
.search-row:focus-visible { outline: 2px solid var(--accent-line); outline-offset: -2px; }
.search-row img, .sr-blank { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--sunken); display: block; }
.sr-main { display: grid; gap: 1px; min-width: 0; }
.sr-main b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-main small { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.sr-st { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.sr-st .ico { width: 14px; height: 14px; }
.sr-st.st-scheduled { color: var(--text); }
.sr-st.st-error { color: var(--st-error); }
.search-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; }
.search-foot:empty { display: none; }
.search-foot kbd { margin-right: 4px; }

/* the four statuses (6): icon and a word; only «Ошибка» is red, «Запланирован» reads in the text colour */
.pill.stp { height: 22px; padding: 0; border-radius: 0; background: none; color: var(--muted); gap: 6px; font: 500 12.5px var(--sans); }
.pill.stp::before { display: none; }
.pill.stp .ico { width: 14px; height: 14px; }
.pill.stp.st-scheduled { color: var(--text); }
.pill.stp.st-error { color: var(--st-error); }
.mtile .used .pill.stp { padding: 0 8px; color: #F4F3EF; }
.mtile .used .pill.stp.st-error { color: #FF9C88; }
.st-ready { --st: var(--st-draft); }
.st-publishing, .st-uploaded { --st: var(--st-scheduled); }
.pf-badge[class*="st-"] { color: var(--muted); background: transparent; box-shadow: none; }
.pf-badge.st-error { color: var(--st-error); }
.seg.counts button b.st-draft, .seg.counts button b.st-ready, .seg.counts button b.st-scheduled, .seg.counts button b.st-published { color: var(--muted); }
.seg.counts button.on b.st-draft, .seg.counts button.on b.st-scheduled, .seg.counts button.on b.st-published { color: var(--text); }
.seg.counts button b.st-error { color: var(--st-error); }

/* errors (7.3): a card per post, then «Исправлено за 30 дней» */
.er-wrap { max-width: 960px; }
.page-head[data-view="errors"] .ph-sub { color: var(--st-error); font-weight: 500; }
.er-list { display: grid; gap: 14px; }
.er-card { display: grid; grid-template-columns: 120px minmax(0, 1fr); grid-template-areas: "cover head" "cover pf" "cover body" "cover act"; column-gap: 20px; row-gap: 10px; align-content: start; padding: 16px; border: 1px solid var(--line); border-left: 4px solid var(--st-error); border-radius: var(--r-lg); background: var(--panel); }
.er-card.retrying { border-left-color: var(--line-strong); }
.er-cover { grid-area: cover; width: 120px; height: 150px; border-radius: 12px; object-fit: cover; background: var(--sunken); display: grid; place-items: center; color: var(--faint); }
.er-head { grid-area: head; min-width: 0; display: grid; gap: 2px; }
.er-cover[data-open], .er-head[data-open] { cursor: pointer; }
.er-when { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.er-head h2 { margin: 0; font: 600 22px/1.25 var(--sans); letter-spacing: -.01em; overflow-wrap: anywhere; }
.er-pf { grid-area: pf; display: flex; flex-wrap: wrap; gap: 6px; }
.er-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px; border-radius: 13px; background: var(--sunken); color: var(--muted); font-size: 12.5px; }
.er-chip .ico { width: 14px; height: 14px; flex: none; }
.er-chip.bad { color: var(--st-error); background: color-mix(in srgb, var(--st-error) 14%, transparent); }
.er-body { grid-area: body; display: grid; gap: 6px; max-width: 640px; }
.er-body:empty { display: none; }
.er-text { margin: 0; color: var(--text); font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.er-text.er-sub { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.er-text .ico, .er-retrying .ico { width: 15px; height: 15px; flex: none; }
.er-actions { grid-area: act; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.er-actions .btn { height: 40px; padding: 0 16px; border-radius: 20px; }
.er-skips { margin-left: auto; display: flex; flex-wrap: wrap; gap: 4px; }
.er-retrying { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.er-h2 { margin: 34px 4px 10px; font: 600 16px/1.3 var(--sans); }
.er-fixed { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); overflow: hidden; }
.er-fixed li + li { border-top: 1px solid var(--line); }
.er-fx { width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 20px; border: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; font: inherit; min-height: 44px; }
.er-fx:hover { background: var(--raised); }
.er-fx-ico { color: var(--muted); display: grid; flex: none; }
.er-fx-ico .ico { width: 17px; height: 17px; }
.er-fx-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.er-fx-main b { font-weight: 500; font-size: 15px; overflow-wrap: anywhere; }
.er-fx-main small { color: var(--muted); font-size: 13px; }
.er-fx-mark { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.er-fx-mark .ico { width: 14px; height: 14px; }
.er-fx-date { color: var(--muted); font-size: 13px; min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.er-empty { padding: 28px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
.er-empty h2 { margin: 0; font: 500 18px/1.4 var(--sans); }

/* the studio's tab bar covers the editor's own foot on the phone: it steps aside while the editor is open */
body:has(.editor.open) .st-tabbar { display: none; }

/* 1024–1280: the row is tight — «Статистика» and «Автоматизация» step into «Ещё» */
@media (min-width: 1024px) and (max-width: 1280px) {
  .topbar { padding: 0 24px; gap: 10px; }
  .page-head { padding: 0 24px; }
  .view { padding-left: 24px; padding-right: 24px; }
  .tb-tab { padding: 0 11px; }
  .tb-tab.narrow-hide { display: none; }
  .more-narrow { display: block !important; }
}
/* below 1024: the logo goes, the sections become a second row that scrolls sideways */
@media (max-width: 1023px) {
  .topbar { flex-wrap: wrap; height: auto; gap: 0 8px; padding: calc(10px + env(safe-area-inset-top)) 16px 0; }
  .tb-logo { display: none; }
  .tb-nav { order: 3; flex: 1 0 100%; margin: 6px -16px 0; padding: 0 16px; overflow-x: auto; scrollbar-width: none; scroll-padding: 0 16px; }
  .tb-nav::-webkit-scrollbar { display: none; }
  .tb-tab { height: 44px; background: transparent !important; padding: 0 14px; }
  .tb-tab::before { content: ""; position: absolute; inset: 6px 0; z-index: -1; border-radius: 10px; }
  .tb-tab.on::before { background: var(--raised); }
  .topbar .apps-btn { min-height: 44px; }
  .tb-ic, .tb-ava, .tb-ava .ava { width: 44px; height: 44px; }
  .err-badge { height: 44px; border-radius: 22px; }
  .tb-end { gap: 8px; }
  .topbar #new-post { height: 44px; }
  .page-head { padding: 0 20px; }
  .view { padding: 20px 20px 48px; }
  .more { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .more-nav { position: static; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
  .more-nav a { flex: none; min-height: 40px; display: inline-flex; align-items: center; }
  .more-cap { display: none; }
  .more-narrow { display: none !important; }
}
/* the phone: the studio's bottom bar has the «＋» */
@media (max-width: 760px) {
  .topbar #new-post { display: none; }
  .topbar { padding-left: 16px; padding-right: 16px; }
  .page-head { padding: 0 16px; }
  .view { padding: 16px 16px 32px; }
  .next-line .nl-lead, .next-line .nl-open { display: none; }
  .next-line .nl-short { display: inline; }
  .next-line { margin-top: 10px; }
  .ph-row { padding-top: 14px; }
  .ph-title h1 { font-size: 24px; }
  .ph-end { width: 100%; margin-left: 0; justify-content: stretch; }
  .ph-end .bar-actions { flex: 1 1 100%; }
  .ph-end .pf-bar { flex: 1 1 100%; }
  .search-ov { padding-top: calc(10px + env(safe-area-inset-top)); }
  .search-row { min-height: 60px; }
  .er-card { grid-template-columns: 84px minmax(0, 1fr); grid-template-areas: "cover head" "pf pf" "body body" "act act"; column-gap: 14px; row-gap: 12px; padding: 14px; }
  .er-cover { width: 84px; height: 105px; }
  .er-head h2 { font-size: 18px; }
  .er-chip .nm, .er-open-q { display: none; }
  .er-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .er-actions .btn { height: 48px; border-radius: 24px; justify-content: center; }
  .er-actions > .btn.primary, .er-actions > a.btn { grid-column: 1 / -1; }
  .er-actions > .btn.primary + .btn { grid-column: auto; }
  .er-skips { margin: 0; display: contents; }
  .er-fx { padding: 14px 16px; gap: 12px; flex-wrap: wrap; }
  .er-fx-mark span, .er-fx-date { font-size: 12px; }
  .er-fx-mark { display: none; }
}


/* ======================================================================================================
   Планнер v3.1 · этап B — неделя (компактно / крупно), обложка, полоса «Из контент-плана».
   ====================================================================================================== */
/* platform colours (7.12): the editor, publications, statistics and settings use them; the week keeps its icons in --muted */
:root { --pf-instagram: #B58BF2; --pf-telegram: #6DB3F0; --pf-vk: #7FA4F5; --pf-youtube: #F07A6E; --pf-tiktok: #5ED6CF; --pf-threads: #E6E4DF; }
:root[data-theme="light"] { --pf-instagram: #8A3FD1; --pf-telegram: #1F7BC4; --pf-vk: #2B5BD7; --pf-youtube: #D2342A; --pf-tiktok: #0E8F87; --pf-threads: #181715; }

/* the period row: «Без даты N» sits next to the platform filter, the size switch next to the view switch */
.size-seg button { padding: 0 16px; }
.undated-btn { height: 40px; padding: 0 14px; border-radius: 12px; border-color: var(--line); gap: 8px; }
.undated-btn b { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; font: 600 11px/20px var(--sans); background: color-mix(in srgb, var(--text) 14%, transparent); }
.undated-btn.on { background: var(--raised); border-color: var(--line-strong); }
.page-head[data-view="week"] .ph-end .seg, .page-head[data-view="week"] .ph-end .pf-bar { height: 40px; align-items: center; border-radius: 12px; }
.page-head[data-view="week"] .ph-end .seg button { height: 32px; border-radius: 9px; }
.page-head[data-view="week"] .ph-end .btn.icon-btn, .page-head[data-view="week"] .ph-end .btn[data-nav="0"] { height: 40px; border-radius: 20px; }
.page-head[data-view="week"] .ph-end .btn.icon-btn { width: 40px; }
.page-head[data-view="week"] .ph-end .btn[data-nav="0"] { padding: 0 18px; font-weight: 600; }
.cal-wrap.side-off { grid-template-columns: minmax(0, 1fr); }
.cal-wrap.side-off .side-col { display: none; }
.cal-wrap.side-off .side-col, .cal-wrap:not(.side-off) .side-col { transition: none; }

/* the seven columns in a 16 px frame; today keeps its gold line and the gold circle */
.cal.week { border-radius: 16px; background: var(--panel); }
.cal.week .cal-grid { min-height: 380px; }
.cal.week .day-head { height: 52px; padding: 0 14px; gap: 6px; align-items: baseline; padding-top: 14px; border-bottom: 0; }
.cal.week .day-head .dh-wd { font-size: 13px; }
.cal.week .day-head b { font: 600 20px/1 var(--sans); }
.cal.week .day.today .day-head { align-items: center; padding-top: 0; }
.cal.week .day.today .day-head b { width: 30px; height: 30px; font-size: 17px; }
.cal.week .day-body { padding: 0 10px 12px; gap: 8px; }
.cal.week .day.empty .day-body { background: transparent; }
.cal.week .day.empty { background: color-mix(in srgb, var(--sunken) 60%, var(--panel)); }
.cal.week .day.empty.today { background: var(--panel); }
.free-lbl { color: var(--muted); font-size: 13px; padding: 0 4px 6px; }
.day-add-wide { height: 38px; flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 12px; border: 1px dashed var(--line-strong); background: transparent; color: var(--muted); font: 500 13px var(--sans); cursor: pointer; opacity: 0; transition: opacity var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t) var(--ease); }
.day-add-wide .ico { width: 14px; height: 14px; }
.day-add-wide.free { opacity: 1; }
.cal.week .day:hover .day-add-wide, .day-add-wide:focus-visible { opacity: 1; }
.day-add-wide:hover { color: var(--text); border-color: var(--text); }
.cal.week .day.drop-over { background: var(--accent-soft); box-shadow: none; outline: 1.5px dashed var(--accent-line); outline-offset: -8px; border-radius: 14px; }
.cal.week .day.drop-over .day-add-wide { display: none; }
.cal.week .day.drop-over .free-lbl { display: none; }
.drop-hint { display: grid; gap: 14px; justify-items: center; padding: 8px 6px 14px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.4; }
.drop-hint .dh-ghost { width: 100%; padding: 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); color: var(--text); font-weight: 500; text-align: left; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* the card of the week */
.wc { position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); cursor: grab; transition: border-color var(--t) var(--ease), opacity var(--t); }
.wc:hover { border-color: var(--line-strong); }
.wc:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.wc.locked { cursor: pointer; }
.wc.dragging { opacity: .35; }
.wc.next { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.wc-row { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.wc-th { flex: none; width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: var(--sunken); display: block; }
.wc-th-i { display: grid; place-items: center; color: var(--muted); }
.wc-th-i .ico { width: 16px; height: 16px; }
.wc-main { min-width: 0; display: grid; gap: 3px; align-content: start; flex: 1; }
.wc-meta { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wc-time { font: 600 15px/1.2 var(--sans); font-variant-numeric: tabular-nums; }
.wc-meta .pf-badges { display: inline-flex; gap: 6px; min-width: 0; overflow: hidden; }
.wc-meta .pf-badge { width: 14px; height: 14px; display: grid; place-items: center; background: transparent; box-shadow: none; color: var(--muted); }
.wc-meta .pf-badge .ico { width: 12px; height: 12px; }
.wc-meta .pf-badge.st-error { color: var(--muted); }
.wc-cap { color: var(--text); font-size: 14px; font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.wc-foot { display: flex; align-items: center; gap: 8px; min-height: 22px; padding-left: 1px; }
.wc-foot .btn { margin-left: auto; height: 26px; padding: 0 8px; }
.wc.st-draft { border-color: var(--line); }
/* big: a square cover, then the time and the title */
.wc.big { padding: 0; gap: 10px; border: 0; background: transparent; }
.wc.big:hover { border: 0; }
.wc-sq { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--sunken); }
.wc-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.wc.st-draft .wc-cover { opacity: .75; }
.wc-noimg { position: absolute; inset: 0; padding: 12px; display: flex; flex-direction: column; justify-content: space-between; color: var(--muted); }
.wc-noimg .ico { width: 16px; height: 16px; }
.wc-ncap { color: var(--text); font: 500 15px/1.35 var(--sans); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.wc.big .wc-body { display: grid; gap: 6px; padding: 0 2px; }
.wc.big.next .wc-sq { outline: 1.5px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.cal-grid.big .day-body { gap: 14px; }

/* ---------- «Из контент-плана» ---------- */
.cp-host { margin-bottom: 14px; }
.cp-host.off { display: none; }
.cp-strip { display: flex; align-items: center; gap: 18px; padding: 14px 16px 14px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.cp-head { flex: none; display: flex; align-items: center; gap: 12px; min-width: 190px; }
.cp-ico { width: 18px; height: 18px; color: var(--muted); }
.cp-titles { display: grid; gap: 1px; }
.cp-titles b { font: 600 15px/1.3 var(--sans); }
.cp-sub, .cp-sub-fold { color: var(--muted); font-size: 12.5px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-sub-fold { display: none; }
.cp-cards { flex: 1; min-width: 0; display: flex; gap: 12px; }
.cp-card { flex: 0 1 290px; min-width: 0; height: 64px; padding: 0 14px; display: grid; align-content: center; gap: 6px; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); color: var(--text); text-decoration: none; cursor: grab; font: inherit; transition: border-color var(--t) var(--ease); }
.cp-card:hover { border-color: var(--line-strong); }
.cp-card.static { cursor: pointer; }
.cp-card:focus-visible, .cp-fold:focus-visible, .cp-plan:focus-visible, .cp-assign:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.cp-card.dragging { background: transparent; border: 1px dashed var(--line-strong); }
.cp-card.dragging > * { visibility: hidden; }
.cp-title { font-size: 14px; font-weight: 500; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cp-meta { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.cp-kind { height: 20px; padding: 0 9px; border-radius: 10px; border: 1px solid var(--line-strong); display: inline-flex; align-items: center; font-size: 12px; }
.cp-st { display: inline-flex; align-items: center; gap: 6px; }
.cp-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.cp-circ { width: 12px; height: 12px; }
.cp-when { margin-left: auto; }
.cp-end { flex: none; display: flex; align-items: center; gap: 16px; }
.cp-plan { color: var(--muted); font-size: 14px; text-decoration: none; }
.cp-plan:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.cp-fold { width: 36px; height: 36px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--raised); color: var(--text); cursor: pointer; }
.cp-fold:hover { background: color-mix(in srgb, var(--raised) 80%, var(--text) 10%); }
.cp-chev { width: 16px; height: 16px; transform: rotate(180deg); transition: transform var(--t) var(--ease); }
.cp-strip.folded { padding-top: 8px; padding-bottom: 8px; }
.cp-strip.folded .cp-cards, .cp-strip.folded .cp-plan, .cp-strip.folded .cp-sub { display: none; }
.cp-strip.folded .cp-titles { display: flex; align-items: baseline; gap: 8px; }
.cp-strip.folded .cp-sub-fold { display: inline; }
.cp-strip.folded .cp-end { margin-left: auto; }
.cp-strip.folded .cp-chev { transform: none; }
.cp-m { display: none; }
@media (max-width: 1100px) { .cp-cards .cp-card:nth-child(3) { display: none; } }

/* the sheet «Назначить дату»: a small window on the computer, a bottom sheet on the phone */
.cp-ov { position: fixed; inset: 0; z-index: 95; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--scrim); opacity: 0; transition: opacity var(--t) var(--ease); }
.cp-ov.in { opacity: 1; }
.cp-sheet { width: min(460px, 100%); display: grid; gap: 10px; padding: 22px; border: 1px solid var(--line-strong); border-radius: 20px; background: var(--panel); box-shadow: var(--shadow); }
.cp-grab { display: none; width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); justify-self: center; margin-bottom: 6px; }
.cp-lead { color: var(--muted); font-size: 13px; }
.cp-sheet h2 { margin: 0; font: 600 22px/1.25 var(--sans); letter-spacing: -.01em; overflow-wrap: anywhere; }
.cp-note { margin: 0 0 6px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.cp-opts { display: flex; flex-wrap: wrap; gap: 10px; }
.cp-opt { min-height: 48px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 12px; background: transparent; color: var(--text); font: 500 14px var(--sans); cursor: pointer; }
.cp-opt:hover { background: var(--raised); }
.cp-opt.on { border: 2px solid var(--text); padding: 0 17px; }
.cp-opt:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.cp-other { display: block; }
.cp-other input { height: 48px; border-radius: 12px; }
.cp-go.btn.block { height: 54px; margin-top: 6px; border-radius: 14px; font-size: 16px; }
.cp-link { min-height: 44px; border: 0; background: transparent; color: var(--muted); font: 500 14px var(--sans); cursor: pointer; border-radius: 10px; }
.cp-link:hover { color: var(--text); }
.cp-link:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }

/* ---------- the cover of «Крупно» (260 px under the top bar) and the thin row it folds into (64 px) ---------- */
.shell { position: relative; isolation: isolate; }
.wk-cover { position: absolute; z-index: -1; top: 0; left: 0; right: 0; height: 268px; overflow: hidden; color: #fff; background: #1a1a18; }
.wk-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 45%; display: block; }
.wk-cover::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgb(0 0 0 / .62) 0, rgb(0 0 0 / .1) 38%, rgb(0 0 0 / .55) 78%, var(--bg) 100%); }
.wk-in { position: absolute; z-index: 2; left: 40px; right: 40px; bottom: 54px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.wk-text { min-width: 0; display: grid; gap: 6px; }
.wk-k { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: rgb(255 255 255 / .86); }
.wk-k .ico { width: 15px; height: 15px; }
.wk-text h2 { margin: 0; font: 500 34px/1.15 var(--sans); letter-spacing: -.015em; text-shadow: 0 1px 14px rgb(0 0 0 / .45); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-acts { flex: none; display: flex; gap: 10px; }
.wk-acts .btn { height: 44px; padding: 0 22px; border-radius: 22px; font-size: 15px; font-weight: 600; border: 0; }
.wk-open { background: #fff; color: #0F0F0E; }
.wk-open:hover { background: #fff; opacity: .92; }
.wk-move { background: rgb(20 20 18 / .55); color: #fff; backdrop-filter: blur(10px); }
.wk-move:hover { background: rgb(20 20 18 / .7); }
body.has-cover .main { margin-top: 164px; }
body.has-cover .topbar { background: transparent; --text: #fff; --muted: rgb(255 255 255 / .8); --raised: rgb(15 15 14 / .5); --primary: #fff; --primary-ink: #0F0F0E; }
body.has-cover .topbar .tb-tab.on, body.has-cover .topbar .apps-btn, body.has-cover .topbar .tb-ic { backdrop-filter: blur(10px); }
body.has-cover .topbar .err-badge { background: rgb(15 15 14 / .5); backdrop-filter: blur(10px); }
:root[data-theme="light"] body.has-cover .topbar .err-badge { background: var(--st-error); color: #fff; }
body.has-cover .next-line { display: none; }
body.has-cover .page-head .ph-title h1 { text-shadow: none; }
.wk-fold { position: fixed; z-index: 40; top: 0; left: 0; right: 0; height: 64px; display: none; align-items: center; gap: 14px; padding: 0 40px; background: var(--bg); border-bottom: 1px solid var(--line); }
body.cover-folded .wk-fold { display: flex; }
.wk-fold .tb-logo .logo-mask { width: 46px; }
.wk-fold .apps-btn { height: 40px; padding: 0 10px 0 12px; gap: 8px; border: 0; border-radius: 12px; background: var(--raised); font-size: 14.5px; }
.wk-fold .apps-btn .apps-ico { width: 18px; height: 18px; padding: 0; background: transparent; }
.wf-th { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; flex: none; margin-left: 6px; }
.wf-text { min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.wf-text small { color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.wf-text b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-open { border: 0; background: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: 500 14px var(--sans); padding: 8px; border-radius: 8px; flex: none; }
.wf-open:hover { color: var(--text); }
.wf-end { margin-left: auto; display: flex; align-items: center; gap: 16px; flex: none; }
.wf-period { font: 600 16px var(--sans); }
.wk-fold .btn.primary { height: 40px; border-radius: 20px; padding: 0 18px; }
.wk-fold button:focus-visible, .wk-fold a:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
@media (max-width: 1280px) { .wk-in, .wk-fold { padding-left: 24px; padding-right: 24px; } .wk-in { left: 24px; right: 24px; padding: 0; } }
@media (max-width: 1023px) { .wk-cover, .wk-fold { display: none !important; } body.has-cover .main { margin-top: 0; } }

/* ---------- the phone: the week as days one under the other, free days as a dashed row (P4-Phone) ---------- */
@media (max-width: 700px) {
  .size-seg, .undated-btn { display: none !important; }
  .cp-host { margin-bottom: 4px; }
  .cp-strip { display: none; }
  .cp-m { display: block; margin-top: 18px; }
  .cp-m h2 { margin: 0 0 10px; font: 600 18px/1.3 var(--sans); display: flex; align-items: baseline; gap: 10px; }
  .cp-m h2 small { color: var(--muted); font: 400 14px var(--sans); }
  .cp-rows { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); overflow: hidden; }
  .cp-row { display: flex; align-items: center; gap: 12px; padding: 14px; }
  .cp-row + .cp-row { border-top: 1px solid var(--line); }
  .cp-row-main { flex: 1; min-width: 0; display: grid; gap: 8px; }
  .cp-row .cp-title { font-size: 16px; }
  .cp-assign.btn { flex: none; height: 44px; padding: 0 18px; border-radius: 22px; border: 0; background: var(--raised); font-size: 14px; }
  .cp-ov { align-items: flex-end; padding: 0; }
  .cp-sheet { width: 100%; border-radius: 20px 20px 0 0; border-bottom: 0; padding: 12px 20px calc(18px + env(safe-area-inset-bottom)); }
  .cp-grab { display: block; }

  .cal.week { border: 0; background: transparent; overflow: visible; border-radius: 0; }
  .cal.week .cal-grid { grid-template-columns: 1fr; gap: 4px; min-height: 0; }
  .cal.week .day, .cal.week .day.empty, .cal.week .day.empty.today { border: 0 !important; border-radius: 0; background: transparent; box-shadow: none; padding: 0; }
  .cal.week .day.today { box-shadow: none; }
  .cal.week .day-head { height: auto; padding: 16px 2px 8px; gap: 6px; align-items: baseline; font: 600 17px var(--sans); color: var(--text); }
  .cal.week .day-head .dh-wd { font-size: 17px; color: var(--text); }
  .cal.week .day-head .dh-wd::after { content: ","; }
  .cal.week .day-head b { width: auto; height: auto; background: none; color: inherit; font: 600 17px var(--sans); border-radius: 0; display: inline; }
  .cal.week .day.today .day-head, .cal.week .day.today .day-head b { color: var(--accent); background: none; width: auto; height: auto; font-size: 17px; }
  .cal.week .day.today .day-head { align-items: baseline; padding-top: 16px; }
  .cal.week .day.today .day-head .today-lbl { display: none; }
  .cal.week .day-body { padding: 0; gap: 10px; }
  .cal.week .day.empty { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 14px !important; border: 1px dashed var(--line-strong) !important; border-radius: 14px; }
  .cal.week .day.empty .day-head { padding: 0; font-weight: 500; font-size: 15px; color: var(--muted); }
  .cal.week .day.empty .day-head .dh-wd, .cal.week .day.empty .day-head b { font: 500 15px var(--sans); color: var(--muted); }
  .cal.week .day.empty .day-head .today-lbl { display: none; }
  .cal.week .day.empty .day-body { display: flex; flex: 1; flex-direction: row; align-items: center; justify-content: space-between; min-width: 0; }
  .cal.week .day.empty .free-lbl { padding: 0; font-size: 15px; text-transform: lowercase; }
  .cal.week .day.empty .free-lbl::before { content: "— "; }
  .cal.week .day-add-wide { opacity: 1; height: 44px; border: 0; background: transparent; padding: 0 4px; font-size: 14px; }
  .cal.week .day-add-wide .ico { display: none; }
  .cal.week .day-add-wide span { text-transform: lowercase; }
  .cal.week .day-add-wide span::before { content: "+ "; }
  .cal.week .day-body > .day-add-wide:not(.free) { border: 1px dashed var(--line-strong); height: 44px; }
  .cal.week .day:not(.empty) .day-add-wide span::before { content: "+ "; }
  /* a card: a 80 px picture, the time with the icons, the title, the status */
  .wc, .wc.big { display: grid; grid-template-columns: 80px minmax(0, 1fr); column-gap: 14px; row-gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
  .wc-row { display: contents; }
  .wc-th { grid-row: 1 / span 2; width: 80px; height: 80px; border-radius: 12px; align-self: start; }
  .wc-th-i .ico { width: 22px; height: 22px; }
  .wc-main { grid-column: 2; gap: 4px; align-self: start; }
  .wc-foot { grid-column: 2; align-self: end; padding: 0; }
  .wc-cap { font-size: 16px; -webkit-line-clamp: 2; }
  .wc-time { font-size: 16px; }
  .wc-meta .pf-badge { width: 16px; height: 16px; } .wc-meta .pf-badge .ico { width: 14px; height: 14px; }
  .drop-hint { display: none; }
}
.cal.week .day-body > .free-lbl { align-self: flex-start; text-align: left; }
.cp-meta { gap: 8px; }
@media (max-width: 700px) { .cal.week .day.empty { flex-direction: row; } .cal.week .day.empty .day-head { flex: none; } }
@media (max-width: 700px) { .cal.week .day.empty .day-body > .free-lbl { align-self: center; } .cal.week .day:not(.empty) .day-add-wide { display: none; } }

/* ---------- editor (planner v3.1, stage D, 7.4): one screen — where, when, media, text, settings of the platforms ---------- */
.editor { width: min(1100px, calc(100vw - 72px)); grid-template-columns: minmax(0, 1fr) 360px; }
.ed-head { padding: 20px 28px 18px; gap: 12px; }
.ed-head h2 { font: 600 24px/1.2 var(--sans); letter-spacing: -.01em; }
.ed-head .stp { font-size: 13px; }
.ed-src { display: inline-flex; align-items: center; gap: 8px; max-width: 52%; height: 32px; padding: 0 14px; border-radius: 16px; border: 1px solid var(--line-strong); background: var(--sunken); color: var(--text); font: 500 12.5px var(--sans); text-decoration: none; }
.ed-src[hidden] { display: none; }
.ed-src span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-src:hover { border-color: var(--muted); }
.ed-src .ico { width: 15px; height: 15px; flex: none; }
.ed-head #ed-close { width: 40px; height: 40px; border-radius: 50%; background: var(--sunken); }
.ed-body { padding: 24px 28px 30px; gap: 26px; }
.ed-sec > .lbl.h { font-size: 12.5px; color: var(--faint); align-items: center; }
.ed-sec > .lbl.h .h-main { display: inline-flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.ed-sec > .lbl.h .h-main b { font: 600 15px var(--sans); color: var(--text); }
.ed-sec > .lbl.h .h-main small { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.link { border: 0; background: transparent; padding: 2px 0; color: var(--muted); font: 500 12.5px var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; white-space: nowrap; }
.link:hover { color: var(--text); }
.link[hidden] { display: none; }

/* where: a button per platform, the chosen one in the platform's own colour */
.pf-picks { display: flex; flex-wrap: wrap; gap: 10px; }
.pf-pick { --pfc: var(--text); position: relative; min-height: 40px; padding: 0 14px 0 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); display: inline-flex; align-items: center; gap: 9px; font: 500 14px var(--sans); cursor: pointer; transition: border-color var(--t) var(--ease), background var(--t) var(--ease), color var(--t) var(--ease); }
.pf-pick:hover { color: var(--text); border-color: var(--muted); }
.pf-pick:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.pf-pick > .ico { width: 17px; height: 17px; flex: none; }
.pf-pick .pf-pick-name { display: grid; line-height: 1.2; text-align: left; }
.pf-pick .pf-pick-name small { font: 400 11px var(--sans); color: var(--faint); }
.pf-pick.on { color: var(--text); border-color: color-mix(in srgb, var(--pfc) 65%, transparent); background: color-mix(in srgb, var(--pfc) 14%, transparent); }
.pf-pick.on > .ico { color: var(--pfc); }
.pf-pick .pf-tick { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--pfc); color: var(--bg); flex: none; }
.pf-pick .pf-tick .ico { width: 11px; height: 11px; stroke-width: 2.6; }
.pf-pick:disabled { opacity: .6; cursor: default; }

/* when */
.when-picks { gap: 10px; }
.pick { min-height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-strong); background: transparent; color: var(--text); display: inline-flex; align-items: center; gap: 8px; font: 500 14px var(--sans); cursor: pointer; font-variant-numeric: tabular-nums; transition: border-color var(--t) var(--ease), background var(--t) var(--ease); }
.pick:hover { border-color: var(--muted); }
.pick:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.pick.on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); background: var(--raised); }
.pick.dashed { border-style: dashed; color: var(--muted); }
.pick.dashed.on { border-style: solid; color: var(--text); }
.pick:disabled { opacity: .55; cursor: default; }
.pick .ico { width: 15px; height: 15px; }

/* media: tiles 84×104 */
.mtiles { display: flex; flex-wrap: wrap; gap: 8px; border-radius: 12px; }
.mtiles.over { outline: 2px dashed var(--muted); outline-offset: 4px; }
.mtiles .mthumb { width: 84px; height: 104px; aspect-ratio: auto; border-radius: 10px; cursor: grab; }
.mtiles .mthumb.dragging { opacity: .4; }
.mtiles .mthumb.drop-at { box-shadow: -3px 0 0 var(--text); }
.mtiles .mthumb .n { top: 6px; left: 6px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10.5px; }
.mtiles .mthumb .n .ico { width: 10px; height: 10px; }
.mtile-add { width: 84px; height: 104px; border-radius: 10px; border: 1px dashed var(--line-strong); color: var(--muted); display: grid; place-items: center; align-content: center; gap: 6px; cursor: pointer; text-align: center; transition: border-color var(--t) var(--ease), color var(--t) var(--ease); }
.mtile-add:hover, .mtile-add:focus-within { border-color: var(--muted); color: var(--text); }
.mtile-add .ico { width: 20px; height: 20px; }
.mtile-add span { font-size: 11.5px; line-height: 1.3; padding: 0 8px; }
.mtile-add:has(span) { width: 100%; height: 88px; grid-auto-flow: column; justify-content: center; gap: 12px; }
.mtile-add:has(span) span { font-size: 13.5px; padding: 0; }
.drop-line { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); }
.drop-line[hidden] { display: none; }
.drop-line .bar-p { display: block; height: 3px; width: 0; border-radius: 2px; background: var(--text); transition: width 200ms var(--ease); }
.set-list { display: grid; gap: 8px; }
.set-card { display: flex; align-items: center; gap: 14px; padding: 8px 12px 8px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--sunken); color: var(--text); cursor: pointer; text-align: left; }
.set-card:hover { border-color: var(--muted); }
.set-strip { display: flex; flex: none; }
.set-strip img { width: 40px; height: 50px; object-fit: cover; border-radius: 6px; border: 2px solid var(--panel); margin-left: -10px; background: var(--sunken); }
.set-strip img:first-child { margin-left: 0; }
.set-name { display: grid; gap: 2px; min-width: 0; }
.set-name small { color: var(--muted); font-size: 12px; }
.picker .seg { justify-self: start; }

/* text */
.ed-sec > .lbl.h.text-head { flex-wrap: wrap; gap: 12px; justify-content: flex-start; }
.text-head .spacer { flex: 1; }
.text-head .seg { background: var(--sunken); }
.text-head .seg button { height: 30px; gap: 7px; }
.pdot { width: 7px; height: 7px; border-radius: 50%; background: var(--pfc, var(--muted)); flex: none; display: inline-block; }
.text-head .counter-txt { font-size: 12.5px; color: var(--muted); }
.text-head .counter-txt.over { color: var(--st-error); }
#ed-common-caption, #ed-pt-caption { min-height: 168px; padding: 14px 16px; border-radius: 14px; font-size: 15px; line-height: 1.55; background: var(--bg); }
.fmt-bar { margin-bottom: 0; }
.fmt-ins { margin-left: auto; position: relative; display: inline-flex; gap: 2px; }
.fmt-bar .fmt-txt { padding: 0 10px; gap: 6px; font: 500 12.5px var(--sans); display: inline-flex; align-items: center; }
.fmt-bar .fmt-txt .hash { font-weight: 600; }
.ins-pop { position: fixed; z-index: 70; max-height: 320px; overflow: auto; padding: 6px; border-radius: var(--r-lg); border: 1px solid var(--line-strong); background: var(--raised); box-shadow: var(--shadow); display: grid; gap: 2px; }
.ins-pop .menu-item.two { display: grid; gap: 2px; height: auto; align-items: start; }
.ins-pop .menu-item.two small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ins-pop .menu-item.save { border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; color: var(--muted); }
.ins-pop .menu-item:disabled { opacity: .5; cursor: default; }
.ins-empty { margin: 4px 8px 8px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.ed-hints { display: flex; flex-wrap: wrap; gap: 8px; }
.hint-chip { --pfc: var(--muted); display: inline-flex; align-items: center; gap: 8px; min-height: 28px; padding: 3px 12px 3px 9px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--pfc) 38%, var(--line)); background: color-mix(in srgb, var(--pfc) 8%, transparent); font-size: 12.5px; }
.hint-chip .ico { width: 14px; height: 14px; color: var(--pfc); flex: none; }
.ed-hints .fmt-hint { margin: 0; align-self: center; }

/* settings of the platforms */
.ed-summary { gap: 8px; }
.sum-row { min-height: 52px; padding: 8px 14px; border-radius: 12px; gap: 12px; }
.sum-row .sum-ico { --pfc: var(--text); width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--pfc) 14%, transparent); color: var(--pfc); flex: none; }
.sum-row .sum-ico .ico { width: 17px; height: 17px; }
.sum-row .sum-name { min-width: 110px; }
.ed-back { justify-self: start; display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px 0 6px; margin: -6px 0 -6px -6px; border: 0; border-radius: 16px; background: transparent; color: var(--muted); font: 500 13.5px var(--sans); cursor: pointer; }
.ed-back:hover { background: var(--raised); color: var(--text); }
.ed-back .ico { width: 16px; height: 16px; }

/* footer: where it goes, then the actions */
.ed-foot { padding: 16px 28px; }
.ed-goes { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; }
.goes-ico { --pfc: var(--text); display: inline-grid; color: var(--pfc); }
.goes-ico .ico { width: 16px; height: 16px; }
.ed-count { border: 0; background: transparent; padding: 4px 6px; border-radius: 8px; }
.ed-count:hover { background: color-mix(in srgb, var(--st-error) 10%, transparent); }
.ed-count[hidden] { display: none; }
.ed-foot .btn.quiet { color: var(--muted); }
.ed-primary:disabled { opacity: .4; }

/* preview: the platforms as a segment with their dots */
.ed-preview { padding-top: 28px; }
.pv-switch { background: var(--sunken); padding: 4px; border-radius: 12px; }
.pv-switch button { height: 30px; padding: 0 12px; gap: 7px; }

@media (max-width: 1100px) { .editor { grid-template-columns: minmax(0, 1fr) 340px; } }
@media (max-width: 900px) {
  .editor { width: 100vw; }
}
@media (max-width: 700px) {
  .ed-head { padding: calc(12px + env(safe-area-inset-top)) 16px 12px; flex-wrap: wrap; row-gap: 8px; }
  .ed-head h2 { font-size: 22px; }
  .ed-src { order: 5; max-width: 100%; flex-basis: 100%; }
  .ed-body { padding: 18px 16px 24px; gap: 22px; }
  .pf-picks { gap: 8px; }
  .pick { padding: 0 13px; min-height: 44px; }
  .pf-pick { min-height: 44px; }
  .sum-row .sum-meta { display: none; }
  .mtiles .mthumb, .mtile-add { width: 76px; height: 95px; }
  .mtile-add:has(span) { width: 100%; height: 76px; }
  .ed-foot { flex-wrap: wrap; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); row-gap: 10px; }
  .ed-goes { flex: 1 1 100%; }
  .ed-foot .spacer { display: none; }
  .ed-count { flex: 1 1 100%; order: -1; justify-content: flex-start; }
  .ed-foot .btn { flex: 1 1 auto; }
  .ed-foot .btn.icon-btn, .ed-foot .ed-more { flex: none; }
  .ed-foot .ed-primary { flex: 1 1 100%; order: 9; }
  .text-head .counter-txt { margin-left: auto; }
}
.set-row.df-sign { flex-direction: column; align-items: stretch; gap: 8px; }
.set-row.df-sign textarea { width: 100%; min-height: 84px; }
@media (max-width: 700px) {
  .ed-head h2 { flex: 1 1 auto; font-size: 20px; }
  .ed-head .saved { display: none; }
  .ed-head #ed-close { width: 36px; height: 36px; margin-left: auto; }
}


/* ======================================================================================================
   Планнер v3.1 · этап E — Публикации, Входящие, Лента.
   ====================================================================================================== */
.pfc-instagram { --pfc: var(--pf-instagram); color: var(--pf-instagram); }
.pfc-telegram { --pfc: var(--pf-telegram); color: var(--pf-telegram); }
.pfc-vk { --pfc: var(--pf-vk); color: var(--pf-vk); }
.pfc-youtube { --pfc: var(--pf-youtube); color: var(--pf-youtube); }
.pfc-tiktok { --pfc: var(--pf-tiktok); color: var(--pf-tiktok); }
.pfc-threads { --pfc: var(--pf-threads); color: var(--pf-threads); }
.menu-cap { padding: 8px 10px 4px; font: 500 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.menu-item .tick { margin-left: auto; color: var(--text); }

/* ---- Публикации (7.5) ---- */
.page-head[data-view="posts"] .ph-title { display: grid; gap: 4px; flex: 1 1 100%; }
.page-head[data-view="posts"] .ph-end { flex: 1 1 100%; margin-left: 0; justify-content: flex-start; flex-wrap: nowrap; gap: 12px; padding-top: 6px; }
.page-head[data-view="posts"] .bar-actions { flex: 1 1 auto; flex-wrap: nowrap; min-width: 0; gap: 12px; }
.page-head[data-view="posts"] .pf-bar { order: 2; margin-left: 0; height: 44px; align-items: center; border-radius: 22px; background: transparent; border: 0; padding: 0; gap: 4px; }
.page-head[data-view="posts"] .pf-btn { width: 36px; height: 36px; border-radius: 18px; }
.page-head[data-view="posts"] .pf-btn.all { width: auto; padding: 0 14px; font-weight: 500; color: var(--muted); }
.page-head[data-view="posts"] .pf-btn.on { background: var(--raised); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
.page-head[data-view="posts"] .pf-btn[data-pf="instagram"] { color: var(--pf-instagram); }
.page-head[data-view="posts"] .pf-btn[data-pf="telegram"] { color: var(--pf-telegram); }
.page-head[data-view="posts"] .pf-btn[data-pf="vk"] { color: var(--pf-vk); }
.page-head[data-view="posts"] .pf-btn[data-pf="youtube"] { color: var(--pf-youtube); }
.page-head[data-view="posts"] .pf-btn[data-pf="tiktok"] { color: var(--pf-tiktok); }
.page-head[data-view="posts"] .pf-btn[data-pf="threads"] { color: var(--pf-threads); }
.page-head[data-view="posts"] .pf-btn.off { opacity: .5; }
.page-head[data-view="posts"] .view-primary { order: 3; }
.posts-search { position: relative; flex: 0 0 300px; width: 300px; max-width: 100%; }
.bar-actions .posts-search .ico { top: 14px; left: 16px; width: 17px; height: 17px; }
.bar-actions .posts-search input:not([type=checkbox]) { height: 44px; padding-left: 44px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); font-size: 14.5px; width: 100%; }
.page-head[data-view="posts"] .seg.counts { background: transparent; border: 0; padding: 0; gap: 8px; border-radius: 0; flex-wrap: nowrap; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.page-head[data-view="posts"] .seg.counts::-webkit-scrollbar { display: none; }
.page-head[data-view="posts"] .seg.counts button { flex: none; height: 40px; padding: 0 16px; border-radius: 20px; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); font-size: 14px; box-shadow: none; }
.page-head[data-view="posts"] .seg.counts button:hover { color: var(--text); }
.page-head[data-view="posts"] .seg.counts button.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.page-head[data-view="posts"] .seg.counts button.on b { color: inherit; }
.page-head[data-view="posts"] .seg.counts button b { font-weight: 500; margin-left: 4px; }
.filter-btn { position: relative; height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line-strong); gap: 8px; }
.filter-btn .dot { position: absolute; top: 9px; left: 29px; width: 8px; height: 8px; border-radius: 50%; background: var(--text); border: 2px solid var(--bg); box-sizing: content-box; }
.filter-btn.on { background: var(--raised); }
.filter-pop { min-width: 260px; padding: 14px; display: grid; gap: 12px; }
.filter-pop label { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); }
.filter-pop select { height: 40px; }
.filter-pop .btn { justify-self: start; }

.table.posts2 { border-radius: 24px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.posts2 .trow { grid-template-columns: 40px minmax(0, 1fr) 150px 190px 150px 100px 36px; gap: 20px; padding: 10px 24px 10px 18px; min-height: 71px; }
.posts2 .trow.head { min-height: 44px; padding-top: 0; padding-bottom: 0; background: transparent; font: 400 13px var(--sans); letter-spacing: 0; text-transform: none; color: var(--muted); border-bottom: 1px solid var(--line); }
.posts2 .trow.head:hover { background: transparent; }
.posts2 .trow .th { width: 40px; height: 50px; border-radius: 6px; }
.posts2 .trow span.th { background: var(--sunken); }
.posts2 .trow span.th .ico { width: 18px; height: 18px; }
.posts2 .cell-main { display: grid; gap: 6px; min-width: 0; }
.posts2 .trow .cap { font-size: 15px; line-height: 1.35; -webkit-line-clamp: 1; }
.posts2 .when-col { font-size: 14px; color: var(--text); }
.posts2 .num { text-align: right; font-variant-numeric: tabular-nums; }
.posts2 .reach { font-size: 15px; color: var(--text); }
.posts2 .th-sort { justify-self: start; padding: 0; border: 0; background: none; color: var(--muted); font: 400 13px var(--sans); cursor: pointer; }
.posts2 .th-sort:hover { color: var(--text); }
.posts2 .trow.head .num { color: var(--muted); }
.posts2 .pf-color { display: inline-flex; align-items: center; gap: 8px; }
.posts2 .pf-color .pf-badge { display: inline-grid; place-items: center; background: none; box-shadow: none; padding: 0; }
.posts2 .pf-color .ico { width: 16px; height: 16px; }
.posts2 .row-err { margin-top: 2px; }
.posts2 .row-more .btn { color: var(--muted); }
@media (max-width: 1100px) {
  .posts2 .trow { grid-template-columns: 40px minmax(0, 1fr) 110px 160px 130px 80px 32px; gap: 14px; }
}
@media (max-width: 900px) {
  .page-head[data-view="posts"] .ph-end { flex-wrap: wrap; }
  .page-head[data-view="posts"] .bar-actions { flex: 1 1 100%; flex-wrap: wrap; }
  .posts-search { flex: 1 1 100%; width: auto; }
  .page-head[data-view="posts"] .seg.counts { flex: 1 1 100%; margin: 0 -16px; padding: 0 16px; }
  .page-head[data-view="posts"] .pf-bar { order: 2; flex: 1 1 auto; overflow-x: auto; min-width: 0; }
  .posts2 .trow { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; padding: 12px 14px; }
  .posts2 .trow .fmt, .posts2 .trow .when-col, .posts2 .trow.head, .posts2 .trow .reach { display: none; }
  .posts2 .trow .st { grid-column: 3; }
  .posts2 .trow .row-more { display: none; }
  .posts2 .trow .mobile-meta { display: flex; align-items: center; gap: 10px; margin-top: 0; font-size: 13px; }
  .posts2 .trow .mobile-meta .pf-color { gap: 6px; }
  .filter-btn { height: 44px; }
}

/* ---- Входящие (7.6) ---- */
.page-head[data-view="inbox"], .page-head[data-view="feed"] { display: none; }
.view:has(> .inbox.ib2) { padding: 0; }
.inbox.ib2 { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 0; margin: 0; height: calc(100dvh - 72px); min-height: 520px; align-items: stretch; }
.ib2 .ib-list { display: flex; flex-direction: column; min-height: 0; padding-top: 18px; border-right: 1px solid var(--line); }
.ib-h { margin: 0 16px 14px; font: 600 28px/1.2 var(--sans); letter-spacing: -.02em; }
.ib-tools { display: flex; align-items: center; gap: 8px; padding: 0 16px 14px; }
.ib-tools .seg { flex: 1; height: 48px; padding: 4px; gap: 0; border-radius: 16px; background: var(--sunken); border: 0; }
.ib-tools .seg button { flex: 1; height: 40px; justify-content: center; border-radius: 12px; padding: 0 6px; font-size: 14px; white-space: nowrap; }
.ib-tools .seg button.on { background: var(--raised); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / .14); }
.ib-tools .seg button:disabled { opacity: .4; cursor: default; }
.ib-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-grid; place-items: center; font-size: 11px; background: color-mix(in srgb, var(--text) 14%, transparent); color: var(--text); }
.ib-fbtn { position: relative; width: 48px; height: 48px; border-radius: 16px; border: 0; background: var(--sunken); color: var(--muted); flex: none; }
.ib-fbtn .dot { position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--text); }
.ib-fbtn.on { color: var(--text); }
.ib2 .ib-notes { padding: 0 16px 12px; }
.ib2 .ib-threads { flex: 1; min-height: 0; overflow-y: auto; display: block; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.ib2 .ib-row { grid-template-columns: 38px minmax(0, 1fr) 10px; gap: 12px; padding: 14px 16px; align-items: center; border-bottom: 1px solid var(--line); }
.ib2 .ib-row:hover { background: color-mix(in srgb, var(--raised) 60%, transparent); }
.ib2 .ib-row.on { background: var(--raised); box-shadow: none; }
.ib2 .ib-row.unread::before { display: none; }
.ib2 .ib-ava { width: 38px; height: 38px; font-size: 14px; background: var(--raised); color: var(--text); }
.ib2 .ib-row.on .ib-ava { background: var(--sunken); }
.ib2 .ib-pf { right: -4px; bottom: -3px; width: 16px; height: 16px; border: 0; background: var(--bg); color: var(--muted); }
.ib2 .ib-pf .ico { width: 11px; height: 11px; }
.ib2 .ib-main { gap: 2px; }
.ib2 .ib-top { gap: 8px; align-items: baseline; }
.ib2 .ib-top b { font-size: 15px; font-weight: 600; flex: 0 1 auto; }
.ib-kind { font-style: normal; font-size: 13px; color: var(--muted); white-space: nowrap; }
.ib2 .ib-top time { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ib2 .ib-text { font-size: 14px; color: var(--muted); -webkit-line-clamp: 1; line-height: 1.4; }
.ib2 .ib-row.unread .ib-text { color: var(--text); }
.ib2 .ib-meta.wait { color: var(--st-error); font-size: 12px; }
.ib-dot { width: 8px; height: 8px; border-radius: 50%; }
.ib2 .ib-row.unread .ib-dot { background: var(--st-error); }
.ib-keys { margin: 0; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--faint); }
.ib2 .ib-detail { position: static; height: auto; min-height: 0; display: flex; flex-direction: column; border: 0; border-radius: 0; background: transparent; overflow: hidden; }
.ib2 .ib-post { gap: 14px; padding: 14px 24px; min-height: 73px; border-bottom: 1px solid var(--line); }
.ib2 .ib-post > img, .ib2 .ib-post-ico { width: 40px; height: 48px; border-radius: 6px; }
.ib2 .ib-post-ico .ava { width: 40px; height: 40px; }
.ib2 .ib-post-text { gap: 3px; }
.ib2 .ib-post-text small { font-size: 13px; color: var(--muted); gap: 6px; }
.ib2 .ib-post-text small .ico { width: 14px; height: 14px; }
.ib2 .ib-post-text p { font: 500 17px/1.3 var(--sans); white-space: nowrap; }
.ib2 .ib-post-acts { align-items: center; gap: 8px; }
.ib2 .ib-post-acts .btn { height: 40px; padding: 0 18px; border-radius: 20px; border-color: var(--line-strong); gap: 8px; white-space: nowrap; }
.ib2 .ib-post-acts .btn.icon-btn { width: 40px; padding: 0; border-color: transparent; }
.ib2 .ib-post-acts .btn .ico { width: 16px; height: 16px; }
.ib2 .ib-msgs { padding: 24px; gap: 12px; }
.ib2 .ib-msg { max-width: min(680px, 80%); justify-self: start; display: grid; gap: 4px; padding: 12px 16px 8px; border: 0; border-radius: 20px; background: var(--raised); color: var(--text); }
.ib2 .ib-msg.reply { margin-left: 0; }
.ib2 .ib-msg.mine { justify-self: end; background: var(--primary); color: var(--primary-ink); }
.ib2 .ib-msg.target:not(.mine) { box-shadow: 0 0 0 1.5px var(--line-strong); }
.ib2 .ib-msg.draft { opacity: .82; outline: 1.5px dashed color-mix(in srgb, var(--primary-ink) 45%, transparent); outline-offset: -5px; }
.ib2 .ib-msg-head { font-size: 13px; }
.ib2 .ib-msg-head b { font-weight: 600; }
.ib2 .ib-msg p { font-size: 15px; line-height: 1.45; padding: 0; }
.ib2 .ib-msg-foot { display: flex; align-items: baseline; justify-content: flex-end; gap: 14px; font-size: 12px; color: var(--muted); }
.ib2 .ib-msg.mine .ib-msg-foot { color: color-mix(in srgb, var(--primary-ink) 60%, transparent); }
.ib2 .ib-msg-foot time { font-variant-numeric: tabular-nums; }
.ib2 .ib-msg .ib-answer { margin: 0 auto 0 0; font-size: 12.5px; color: var(--muted); }
.ib2 .ib-msg .ib-answer:hover { color: var(--text); }
.ib2 .dm-msg { max-width: min(680px, 80%); justify-self: start; display: grid; gap: 4px; padding: 12px 16px 8px; border-radius: 20px; background: var(--raised); }
.ib2 .dm-msg p { margin: 0; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.ib2 .dm-msg time { justify-self: end; font-size: 12px; color: var(--muted); }
.ib2 .dm-msg.mine { justify-self: end; background: var(--primary); color: var(--primary-ink); }
.ib2 .dm-msg.mine time { color: color-mix(in srgb, var(--primary-ink) 60%, transparent); }
.ib2 .dm-msg.draft { opacity: .82; outline: 1.5px dashed color-mix(in srgb, var(--primary-ink) 45%, transparent); outline-offset: -5px; }
.ib2 .ib-compose { gap: 12px; padding: 16px 24px 20px; border-top: 1px solid var(--line); background: transparent; }
.ib2 .ib-to { font-size: 12.5px; color: var(--muted); }
.ib-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.ib-quick:empty { display: none; }
.qr-wrap { position: relative; display: inline-flex; }
.qr { height: 36px; max-width: 280px; padding: 0 16px; border-radius: 18px; border: 1px solid var(--line-strong); background: transparent; color: var(--text); font: 400 13.5px var(--sans); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; gap: 6px; }
.qr:hover { background: var(--raised); }
.qr:disabled { opacity: .45; cursor: default; }
.qr.add { width: 36px; padding: 0; justify-content: center; color: var(--muted); }
.qr.add.wide { width: auto; padding: 0 16px; }
.qr.add .ico { width: 15px; height: 15px; }
.qr-x { position: absolute; top: -7px; right: -5px; width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--raised); color: var(--muted); display: none; place-items: center; cursor: pointer; }
.qr-x .ico { width: 11px; height: 11px; }
.qr-wrap:hover .qr-x, .qr-wrap:focus-within .qr-x { display: grid; }
@media (hover: none) { .qr-x { display: none !important; } }
.ib-field { display: flex; align-items: flex-end; gap: 12px; }
.ib2 .ib-field textarea { flex: 1; min-height: 48px; max-height: 132px; padding: 13px 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line-strong); resize: none; line-height: 1.4; }
.ib-send { height: 48px; padding: 0 22px; border-radius: 24px; gap: 8px; flex: none; }
.ib-send .ico { width: 17px; height: 17px; }
.ib-hint { font-size: 12.5px; color: var(--muted); }
.ib-hint.bad { color: var(--st-error); }
.ib2 .ib-empty { padding: 48px 24px; }
@media (max-width: 1100px) { .inbox.ib2 { grid-template-columns: 340px minmax(0, 1fr); } }
@media (max-width: 900px) {
  .inbox.ib2 { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
  .ib2 .ib-list { border-right: 0; padding-top: 14px; }
  .ib2 .ib-threads { overflow: visible; }
  .ib2 .ib-detail, .inbox.ib2.reading .ib-detail { display: none; }
  .ib2 .ib-post { padding: 12px 16px; flex-wrap: wrap; }
  .ib2 .ib-post-acts { flex: 1 1 100%; justify-content: flex-end; }
  .ib2 .ib-post-text p { white-space: normal; font-size: 16px; }
  .ib2 .ib-msgs { padding: 14px 16px; overflow: visible; }
  .ib2 .ib-msg, .ib2 .dm-msg { max-width: 92%; }
  .ib2 .ib-compose { padding: 12px 16px 16px; }
  .ib-inline { background: var(--panel); }
  .ib-h { font-size: 24px; }
}

/* ---- Лента (7.7) ---- */
.feed2 { display: grid; grid-template-columns: 380px minmax(0, 620px); grid-template-areas: "phone side"; gap: 60px; align-items: start; justify-content: start; padding-top: 4px; }
.feed2:not([data-pf="instagram"]):not([data-pf="tiktok"]) { grid-template-columns: minmax(380px, 560px) minmax(0, 560px); }
.feed-phone { grid-area: phone; min-width: 0; border: 1px solid var(--line); border-radius: 32px; overflow: hidden; background: var(--panel); }
.feed-phone .feed { max-width: none; margin: 0; }
.feed-side { grid-area: side; min-width: 0; padding-top: 6px; }
.fs-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fs-titles h1 { margin: 0; font: 600 28px/1.2 var(--sans); letter-spacing: -.02em; }
.fs-sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.feed-tabs2 { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 18px; }
.feed-tabs2 a { height: 40px; padding: 0 16px; border-radius: 20px; border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; text-decoration: none; white-space: nowrap; }
.feed-tabs2 a:hover { color: var(--text); }
.feed-tabs2 a.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.feed-tabs2 .ico { width: 16px; height: 16px; }
.fs-card { margin: 0 0 14px; padding: 22px 24px; border-radius: 24px; background: var(--panel); border: 1px solid var(--line); list-style: none; }
.fs-notes { display: grid; gap: 14px; }
.fs-notes li { display: flex; align-items: center; gap: 14px; font-size: 15px; }
.fs-notes .ico { width: 18px; height: 18px; color: var(--muted); margin: 0 3px; }
.fs-dash { flex: none; width: 24px; height: 24px; border-radius: 6px; border: 2px dashed var(--text); }
.fs-hint h2 { margin: 0 0 8px; font: 600 16px/1.3 var(--sans); }
.fs-hint p { margin: 0 0 16px; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.fs-hint .btn { height: 40px; padding: 0 18px; border-radius: 20px; }
.fr-profile { padding: 18px 18px 14px; display: grid; gap: 8px; }
.fr-top { display: flex; align-items: center; gap: 18px; }
.fr-top .ava, .fr-ava { flex: none; width: 64px; height: 64px; padding: 0; border: 0; border-radius: 50%; object-fit: cover; font-size: 24px; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; }
.fr-ava.skel { background: var(--sunken); }
.fr-top .pf-ava .ico { width: 26px; height: 26px; }
.fr-stats { flex: 1; display: flex; justify-content: space-around; gap: 8px; text-align: center; }
.fr-stats span { display: grid; gap: 2px; }
.fr-stats b { font: 600 17px/1.2 var(--sans); font-variant-numeric: tabular-nums; }
.fr-stats small { font-size: 12.5px; color: var(--muted); }
.fr-name { font-size: 14px; font-weight: 600; }
.fr-name small { font-weight: 400; color: var(--muted); font-size: 13px; }
.fr-bio { margin: 0; color: var(--muted); font-size: 13.5px; white-space: pre-line; }
.fr-note { margin: 0; color: var(--muted); font-size: 12.5px; }
.feed-phone .feed > .pgrid, .feed-phone .feed > .empty { border-top: 1px solid var(--line); }
.feed-phone .pgrid { gap: 2px; }
.feed-phone .tile { aspect-ratio: 4 / 5; }
.feed-phone .tile.planned { cursor: grab; outline: 0; }
.feed-phone .tile.planned::after, .feed-phone .tile.planned.st-draft::after, .feed-phone .tile.planned.st-ready::after, .feed-phone .tile.planned.st-error::after { inset: 4px; border: 1.5px dashed rgb(255 255 255 / .9); box-shadow: 0 0 0 1px rgb(0 0 0 / .25); border-radius: 0; }
.feed-phone .tile.planned.st-draft, .feed-phone .tile.planned.st-ready, .feed-phone .tile.planned.st-error { outline: 0; }
.feed-phone .tile .when { position: absolute; left: 8px; top: 8px; right: auto; bottom: auto; width: auto; padding: 3px 8px; border-radius: 7px; background: rgb(0 0 0 / .66); color: #fff; font-size: 11.5px; font-weight: 500; gap: 4px; justify-content: flex-start; }
.feed-phone .tile.planned.st-scheduled .when { background: rgb(0 0 0 / .66); color: #fff; }
.feed-phone .tile.planned.st-draft img, .feed-phone .tile.planned.st-ready img { filter: none; }
.feed-phone .tile .when .ico { width: 11px; height: 11px; }
.feed-phone .tile .badge { top: 8px; right: 8px; }
.feed-phone .tile .tile-trial { top: 34px; }
.feed-phone .fposts, .feed-phone .frows { padding: 10px; }
.feed-phone .yt-tabs { margin: 10px; }
@media (max-width: 1100px) { .feed2 { gap: 32px; grid-template-columns: 340px minmax(0, 1fr); } .feed2:not([data-pf="instagram"]):not([data-pf="tiktok"]) { grid-template-columns: minmax(340px, 480px) minmax(0, 1fr); } }
@media (max-width: 900px) {
  .feed2, .feed2:not([data-pf="instagram"]):not([data-pf="tiktok"]) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "side" "phone"; gap: 16px; }
  .feed-tabs2 { flex-wrap: nowrap; overflow-x: auto; margin: 16px -16px 14px; padding: 0 16px; scrollbar-width: none; }
  .feed-tabs2::-webkit-scrollbar { display: none; }
  .feed-tabs2 a { flex: none; height: 44px; }
  .fs-titles h1 { font-size: 24px; }
  .fs-notes { padding: 0; border: 0; background: transparent; gap: 8px; margin-bottom: 0; }
  .fs-notes li:nth-child(n+2) { display: none; }
  .fs-notes li { font-size: 13.5px; color: var(--muted); }
  .feed-phone { border-radius: 28px; }
}

/* ---------- Медиатека (7.8): папки · плитки · панель выбранного ---------- */
.page-head[data-view="library"] { display: none; }
.view:has(> .lib2) { padding: 0; }
.lib2 { display: grid; grid-template-columns: 232px minmax(0, 1fr) 380px; height: calc(100dvh - 72px); min-height: 520px; }
.lib-side { padding: 24px 16px; border-right: 1px solid var(--line); overflow-y: auto; }
.lib-folders { display: grid; gap: 4px; }
.lib-folders button { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font: 500 15px var(--sans); cursor: pointer; text-align: left; }
.lib-folders button .ico { width: 18px; height: 18px; flex: none; }
.lib-folders button small { margin-left: auto; font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.lib-folders button:hover { color: var(--text); background: color-mix(in srgb, var(--raised) 60%, transparent); }
.lib-folders button.on { background: var(--raised); color: var(--text); }
.lib-main { min-width: 0; padding: 24px 28px 40px; overflow-y: auto; }
.lib-head { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.lib-title { flex: 1; min-width: 0; }
.lib-title h1 { margin: 0 0 4px; font: 600 32px/1.15 var(--sans); letter-spacing: -.02em; }
.lib-title p { margin: 0; font-size: 14.5px; color: var(--muted); max-width: 60ch; }
.lib-upgrp { display: inline-flex; flex: none; }
.lib-upbtn { height: 44px; padding: 0 22px; border-radius: 22px; gap: 8px; }
.lib-upgrp .lib-upbtn:not(:only-child) { border-radius: 22px 0 0 22px; padding-right: 16px; }
.lib-upmore { height: 44px; width: 40px; padding: 0; border-radius: 0 22px 22px 0; border-left: 1px solid color-mix(in srgb, var(--primary-ink) 22%, transparent); justify-content: center; }
.lib-upmore .ico { width: 16px; height: 16px; }
.lib-chips { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.lib-chips-in { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 0; }
.lib-chips-in button { height: 36px; padding: 0 16px; border-radius: 18px; border: 1px solid var(--line-strong); background: transparent; color: var(--text); font: 400 14px var(--sans); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.lib-chips-in button small { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.lib-chips-in button:hover { background: var(--raised); }
.lib-chips-in button.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 600; }
.lib-chips-in button.on small { color: inherit; opacity: .7; }
.lib-sortbtn { flex: none; color: var(--muted); gap: 4px; }
.lib2 .lib-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 16px; }
.lib2 .mtile { isolation: isolate; }
.lib2 .mtile .img { margin: 8px 8px 0 0; border-radius: 12px; border: 0; overflow: visible; }
.lib2 .mtile .img img { border-radius: 12px; }
.lib2 .mtile .img.skel { aspect-ratio: 4 / 5; }
.lib2 .mtile.cgroup .img::before, .lib2 .mtile.cgroup .img::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 12px; background: var(--raised); border: 1px solid var(--line); }
.lib2 .mtile.cgroup .img::before { transform: translate(8px, -8px); }
.lib2 .mtile.cgroup .img::after { transform: translate(4px, -4px); background: color-mix(in srgb, var(--raised) 70%, var(--bg)); }
.lib2 .mtile:hover .img { box-shadow: none; }
.lib2 .mtile.sel .img { outline: 2px solid var(--text); outline-offset: 2px; box-shadow: none; border-color: transparent; }
.lib2 .mtile:focus-visible { outline: none; }
.lib2 .mtile:focus-visible .img { outline: 2px solid var(--text); outline-offset: 2px; }
.lib2 .mtile.taken .img img { opacity: .72; }
.lib2 .mtile .tag { left: auto; right: 8px; top: 8px; bottom: auto; height: 24px; border-radius: 12px; padding: 0 9px; font-variant-numeric: tabular-nums; }
.lib2 .mtile .tag .ico { width: 13px; height: 13px; }
.lib2 .mtile:not(.cgroup) .tag { top: auto; bottom: 8px; right: 8px; }
.lib2 .mtile .tick { opacity: 0; }
.lib2 .mtile:hover .tick, .lib2 .mtile:focus-visible .tick, .lib2 .mtile.sel .tick { opacity: 1; }
@media (hover: none) { .lib2 .mtile .tick { opacity: 1; } }
.lib2 .mtile.sel .tick { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.lib2 .mtile .meta { display: grid; gap: 2px; padding: 8px 8px 0 0; }
.lib2 .mtile .meta .name { font: 500 14px/1.3 var(--sans); color: var(--text); }
.lib2 .mtile .meta .sub { font-size: 12.5px; color: var(--muted); }
.lib2 .mtile.dropzone { margin: 8px 8px 0 0; border-radius: 12px; }
.lib2 .mtile.dropzone:hover, .lib2 .mtile.dropzone.over, .lib2 .mtile.dropzone:focus-visible { border-color: var(--text); background: var(--raised); }
.lib-none-wrap { grid-column: 2 / -1; align-self: center; display: grid; gap: 12px; justify-items: start; }
.lib-none { margin: 0; max-width: 46ch; }
.lib-panel { border-left: 1px solid var(--line); padding: 24px 22px 32px; overflow-y: auto; position: relative; display: flex; flex-direction: column; gap: 0; }
.lp-close { display: none; }
.lp-empty { color: var(--text); font-size: 14.5px; }
.lp-empty p { margin: 0 0 8px; }
.lp-kicker { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.lp-kicker .ico { width: 14px; height: 14px; }
.lp-head { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 14px; }
.lp-head h2 { margin: 0; flex: 1; min-width: 0; font: 600 22px/1.25 var(--sans); letter-spacing: -.01em; overflow-wrap: anywhere; }
.lp-name { all: unset; cursor: text; border-radius: 6px; }
.lp-name:hover { background: var(--raised); box-shadow: 0 0 0 4px var(--raised); }
.lp-name:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.lp-slides { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.lp-slides.small { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.lp-sl { position: relative; aspect-ratio: 4 / 5; border-radius: 9px; overflow: hidden; background: var(--sunken); cursor: grab; border: 2px solid transparent; }
.lp-sl img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lp-sl .n { position: absolute; left: 6px; top: 6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; display: grid; place-items: center; font: 600 11.5px var(--sans); color: #fff; background: rgb(0 0 0 / .6); font-variant-numeric: tabular-nums; }
.lp-sl.used img { opacity: .5; }
.lp-sl.drag { opacity: .4; }
.lp-sl.over { border-color: var(--text); }
.lp-sl:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.lp-sl .sl-mv { position: absolute; left: 0; right: 0; bottom: 0; display: none; justify-content: space-between; padding: 4px; background: linear-gradient(transparent, rgb(0 0 0 / .55)); }
.lp-sl:hover .sl-mv, .lp-sl:focus-within .sl-mv { display: flex; }
@media (hover: none) { .lp-sl .sl-mv { display: flex; } }
.lp-sl .sl-mv button { width: 28px; height: 28px; border: 0; border-radius: 14px; background: rgb(0 0 0 / .55); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.lp-sl .sl-mv button:disabled { opacity: .3; cursor: default; }
.lp-sl .sl-mv button:focus-visible { outline: 2px solid #fff; }
.lp-sl .sl-mv .ico { width: 14px; height: 14px; }
.lp-hint { margin: 0 0 12px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.lp-main { height: 48px; border-radius: 24px; justify-content: center; gap: 8px; margin-top: 6px; }
.lp-second { height: 44px; border-radius: 22px; justify-content: center; gap: 8px; margin-top: 10px; }
.lp-second.quiet { border-color: transparent; }
.lp-note { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.5; color: var(--muted); }
.lp-prev { border-radius: 12px; overflow: hidden; background: var(--sunken); margin-bottom: 12px; }
.lp-prev img, .lp-prev video { display: block; width: 100%; max-height: 380px; object-fit: contain; }
.lp-fname { font-size: 18px; }
.lp-meta { margin: 0 0 6px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lp-where { margin: 0 0 14px; font-size: 14px; }
.lp-link { all: unset; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; color: var(--text); }
.lp-link:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 3px; }
.btn.quiet.danger { color: var(--st-error); }
.menu-item.danger { color: var(--st-error); }
.menu-item.danger .ico { color: inherit; }
/* a small modal: the draft list and Диск */
.lib-dlg { width: min(520px, calc(100vw - 32px)); max-height: min(80dvh, 720px); padding: 0; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--panel); color: var(--text); box-shadow: var(--shadow); flex-direction: column; overflow: hidden; }
.lib-dlg[open] { display: flex; animation: ask-in 240ms var(--ease); }
.lib-dlg.out { animation: ask-out 150ms ease-in forwards; }
.lib-dlg.wide { width: min(860px, calc(100vw - 32px)); }
.lib-dlg::backdrop { background: var(--scrim); backdrop-filter: blur(4px); }
.lib-dlg-head { display: flex; align-items: center; gap: 8px; padding: 16px 18px 12px 22px; }
.lib-dlg-head h3 { margin: 0; flex: 1; font: 600 18px var(--sans); }
.lib-dlg-body { padding: 0 22px 18px; overflow-y: auto; flex: 1; min-height: 120px; display: grid; gap: 12px; align-content: start; }
.lib-dlg-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--line); }
.lib-dlg-sub { margin: 0; }
.dr-list { display: grid; gap: 8px; }
.dr-row { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.dr-row:hover { background: var(--raised); }
.dr-row:disabled { opacity: .5; }
.dr-row img, .dr-none { width: 44px; height: 55px; border-radius: 7px; object-fit: cover; flex: none; background: var(--sunken); display: grid; place-items: center; color: var(--muted); }
.dr-t { display: grid; gap: 2px; min-width: 0; }
.dr-t b { font-weight: 500; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dr-t small { color: var(--muted); font-size: 12.5px; }
.dv-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 14px; color: var(--muted); }
.dv-crumbs button { all: unset; cursor: pointer; padding: 2px 4px; border-radius: 4px; color: var(--text); }
.dv-crumbs button:hover { background: var(--raised); }
.dv-crumbs button:focus-visible { outline: 2px solid var(--text); }
.dv-folders { display: grid; gap: 6px; }
.dv-folder { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--text); cursor: pointer; text-align: left; }
.dv-folder:hover { background: var(--raised); }
.dv-folder > span { display: grid; gap: 1px; flex: 1; min-width: 0; }
.dv-folder b { font-weight: 500; font-size: 14.5px; }
.dv-folder small { color: var(--muted); font-size: 12.5px; }
.dv-folder .ico:last-child { color: var(--faint); }
.dv-tools { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.dv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.dv-ph { aspect-ratio: 1; border-radius: 10px; }
.dv-img { position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--sunken); cursor: pointer; }
.dv-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dv-img .tick { position: absolute; left: 6px; top: 6px; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid rgb(255 255 255 / .85); background: rgb(0 0 0 / .25); display: grid; place-items: center; color: transparent; }
.dv-img .tick .ico { width: 13px; height: 13px; }
.dv-img.sel { outline: 2px solid var(--text); outline-offset: -2px; }
.dv-img.sel .tick { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.dv-img:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.dv-n { position: absolute; right: 6px; bottom: 6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; display: grid; place-items: center; font: 600 11.5px var(--sans); color: #fff; background: rgb(0 0 0 / .6); }
.dv-img.done { cursor: default; }
.dv-img.done img { opacity: .4; }
.dv-img.done .tick { display: none; }
.dv-in { position: absolute; left: 4px; right: 4px; bottom: 4px; padding: 2px 4px; border-radius: 6px; font-size: 11px; text-align: center; color: #fff; background: rgb(0 0 0 / .65); }
.dv-none { margin: 0; padding: 20px 0; }
.dv-off { display: grid; gap: 8px; justify-items: start; padding: 20px 0; }
.dv-off p { margin: 0; color: var(--muted); max-width: 44ch; }
body.lib-sheet-open { overflow: hidden; }
@media (max-width: 1100px) { .lib2 { grid-template-columns: 200px minmax(0, 1fr) 340px; } .lib-title h1 { font-size: 28px; } }
@media (max-width: 900px) {
  .lib2 { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
  .lib-side { border-right: 0; padding: 12px 16px 0; overflow: visible; }
  .lib-folders { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .lib-folders button { flex: none; height: 40px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 20px; }
  .lib-folders button.on { border-color: var(--raised); }
  .lib-folders button small { margin-left: 4px; }
  .lib-main { padding: 14px 16px 90px; overflow: visible; }
  .lib-head { flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
  .lib-title h1 { font-size: 24px; }
  .lib-title p { font-size: 13.5px; }
  .lib-up { flex: 1 1 100%; }
  .lib-upgrp { width: 100%; }
  .lib-upbtn { flex: 1; justify-content: center; }
  .lib-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .lib-chips-in { flex-wrap: nowrap; flex: none; }
  .lib-chips-in button, .lib-sortbtn { height: 44px; }
  .lib2 .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
  .lib-none-wrap { grid-column: 1 / -1; }
  .lib-panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-height: 82dvh; border: 0; border-top: 1px solid var(--line-strong); border-radius: 20px 20px 0 0; background: var(--panel); box-shadow: 0 -16px 48px rgb(0 0 0 / .35); transform: translateY(105%); visibility: hidden; transition: transform 240ms var(--ease), visibility 0s linear 240ms; padding: 18px 18px calc(100px + env(safe-area-inset-bottom)); }
  .lib-panel.on { transform: none; visibility: visible; transition: transform 240ms var(--ease); }
  .lp-close { display: grid; position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; }
  .lp-kicker { padding-right: 44px; }
  .lp-head { padding-right: 44px; }
  .lp-main, .lp-second { height: 48px; }
  .lp-slides { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lib-dlg, .lib-dlg.wide { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; }
  .dv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lib-dlg-head .icon-btn, .dv-crumbs button { min-height: 44px; min-width: 44px; }
  .dv-folder, .dr-row { min-height: 56px; }
}
@media (prefers-reduced-motion: reduce) { .lib-panel { transition: none; } }
.lp-head .icon-btn { flex: none; width: 36px; height: 36px; border-radius: 18px; border-color: transparent; color: var(--muted); }
.lp-close.icon-btn { border-color: transparent; border-radius: 22px; }
.lib-dlg-head .icon-btn { width: 36px; height: 36px; border-radius: 18px; border-color: transparent; }


/* ======================================================================================================
   Планнер v3.1 · этап G — Статистика (7.9): «Все площадки» и верх страницы площадки.
   ====================================================================================================== */
.page-head[data-view="stats"] .pf-bar { display: none; }
.page-head[data-view="stats"] .st-period { height: 40px; align-items: center; background: transparent; border: 0; padding: 0; gap: 4px; }
.page-head[data-view="stats"] .st-period button { height: 36px; padding: 0 14px; border-radius: 18px; font-size: 14px; }
.page-head[data-view="stats"] .st-period button.on { background: var(--raised); box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
.st2 [data-pf="instagram"] { --pfc: var(--pf-instagram); } .st2 [data-pf="telegram"] { --pfc: var(--pf-telegram); } .st2 [data-pf="vk"] { --pfc: var(--pf-vk); }
.st2 [data-pf="youtube"] { --pfc: var(--pf-youtube); } .st2 [data-pf="tiktok"] { --pfc: var(--pf-tiktok); } .st2 [data-pf="threads"] { --pfc: var(--pf-threads); }

.st-pills { display: flex; gap: 8px; margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.st-pills::-webkit-scrollbar { display: none; }
.st-pill { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 20px; border: 1px solid var(--line-strong); color: var(--muted); font-size: 14px; text-decoration: none; transition: background var(--t), color var(--t); }
.st-pill .ico { width: 16px; height: 16px; color: var(--pfc); }
.st-pill:hover { color: var(--text); background: var(--raised); }
.st-pill.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 500; }
.st-pill.on .ico { color: currentColor; }
.st-pill:focus-visible, .st-pf:focus-visible, .st-row:focus-visible, .ml-plot:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 3px; }

.st-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.st-card, .st-pf { display: grid; gap: 4px; align-content: start; padding: 20px 24px 22px; border-radius: 24px; border: 1px solid var(--line); background: var(--panel); color: var(--text); text-decoration: none; }
.st-card.pf-top, .st-pf { border-top: 3px solid var(--pfc, var(--line)); }
.st-l { font-size: 13.5px; color: var(--muted); }
.st-v { font: 600 36px/1.15 var(--sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.st-s { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 1.3em; }
.st-s .gain { color: var(--st-published); }
.st-lim, .st-note { font-size: 12.5px; color: var(--muted); }
.st-note { margin: 10px 4px 0; }
.st-h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 28px 0 12px; }
.st-h h2 { margin: 0; font: 600 17px/1.3 var(--sans); }
.st-h span { color: var(--muted); font-size: 13.5px; }
.st-pfs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.st-pf { padding: 16px 20px 18px; transition: background var(--t); }
.st-pf:hover { background: var(--raised); }
.st-pf-n { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.st-pf-n .ico { width: 16px; height: 16px; color: var(--pfc); }
.st-pf .st-v { font-size: 30px; }

.st-two { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; margin: 16px 0; align-items: stretch; }
.st-two > div { min-width: 0; display: grid; }
.st2 .chart { padding: 20px 24px 14px; border-radius: 24px; gap: 12px; }
.st2 .chart figcaption b { font: 600 17px/1.3 var(--sans); }
.st2 .empty-chart { min-height: 120px; align-content: center; }
.st-chart-wrap { margin-top: 16px; }
.st-cards + .st-note + .st-chart-wrap, .st-cards + .st-chart-wrap { margin-top: 16px; }

.st-best, .st-posts, .st-fmt { border: 1px solid var(--line); border-radius: 24px; background: var(--panel); }
.st-best { padding: 20px 24px 24px; display: grid; align-content: start; gap: 8px; }
.st-best h2, .st-posts h2, .st-fmt h2 { margin: 0; font: 600 17px/1.3 var(--sans); }
.st-muted { margin: 0; color: var(--muted); font-size: 14px; }
.st-when { margin: 14px 0 0; font: 600 24px/1.25 var(--sans); letter-spacing: -.01em; }
.st-none { margin: 8px 0 0; color: var(--muted); font-size: 14.5px; }
.st-set { justify-self: start; margin-top: 12px; height: 42px; padding: 0 18px; border-radius: 21px; background: var(--raised); border-color: transparent; gap: 8px; }
.st-set .ico { width: 16px; height: 16px; color: var(--st-published); }
.st-set.done { border-color: var(--line-strong); }

.st-posts { margin-top: 16px; overflow: hidden; }
.st-posts h2 { padding: 20px 24px 14px; }
.st-rows { display: grid; }
.st-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) 40px 110px 110px 96px; gap: 16px; align-items: center; padding: 10px 24px; min-height: 64px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--text); text-decoration: none; font: inherit; text-align: left; cursor: pointer; width: 100%; transition: background var(--t); }
a.st-row:hover, button.st-row:hover { background: var(--raised); }
.st-row.head { min-height: 40px; padding-top: 0; padding-bottom: 0; color: var(--muted); font-size: 13px; cursor: default; }
.st-row.head:hover { background: none; }
.st-row.head span:nth-child(n+4) { text-align: right; }
.st-row .th { width: 36px; height: 44px; border-radius: 6px; object-fit: cover; background: var(--sunken); display: grid; place-items: center; }
.st-row .th .ico { width: 16px; height: 16px; color: var(--muted); }
.st-t { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-t.none { color: var(--muted); }
.st-ic { display: grid; place-items: center; }
.st-ic .ico { width: 17px; height: 17px; color: var(--pfc, var(--muted)); }
.st-row .tnum { text-align: right; font-variant-numeric: tabular-nums; }

/* a platform's page */
.st-chart-wrap .chart.line.pf .ln { stroke: var(--lc, var(--muted)); stroke-width: 2.2; }
.chart.tall .chart-plot svg { height: 240px; }
.chart-plot .ln-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--lc, var(--text)); border: 2px solid var(--panel); box-sizing: content-box; transform: translate(-50%, -50%); top: calc((100% - 18px) * var(--y)); pointer-events: none; }
.chart-plot .ln-note { position: absolute; transform: translate(-50%, -34px); top: calc((100% - 18px) * var(--y)); font-size: 13px; color: var(--text); white-space: nowrap; pointer-events: none; text-shadow: 0 0 6px var(--panel), 0 0 6px var(--panel); }
.st-fmt { width: min(100%, 620px); margin-top: 16px; padding: 20px 24px 8px; }
.st-frow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(64px, auto); gap: 16px; align-items: center; min-height: 48px; border-top: 1px solid var(--line); margin-top: 0; font-size: 15px; }
.st-fmt h2 { margin-bottom: 10px; }
.st-frow .tnum, .st-frow .st-dash { text-align: right; font-variant-numeric: tabular-nums; }
.st-frow .st-share { text-align: right; color: var(--muted); font-size: 14px; white-space: nowrap; }
.st2 .stats-top { margin-top: 28px; }
.st-oldperiod:empty { display: none; }
.st-oldperiod { margin-bottom: 12px; }

/* several lines (Охват по дням) */
.chart.ml figcaption { align-items: center; }
.ml-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text) !important; }
.ml-legend span { display: inline-flex; align-items: center; gap: 7px; }
.ml-legend i { width: 14px; height: 3px; border-radius: 2px; }
.ml-plot { position: relative; height: 260px; margin: 8px 96px 26px 44px; border-radius: 4px; }
.ml-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.ml-ln { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ml-y, .ml-x { position: absolute; font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; pointer-events: none; }
.ml-y { left: -44px; transform: translateY(-50%); }
.ml-x { top: 100%; margin-top: 8px; transform: translateX(-50%); }
.ml-x:first-of-type { transform: translateX(-12px); }
.ml-end { position: absolute; transform: translate(-3px, -50%); display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); white-space: nowrap; pointer-events: none; }
.ml-end i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.ml-cursor { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--muted); pointer-events: none; }
.chart-tip.ml-tip { top: 6px; transform: translateX(-50%); min-width: 190px; gap: 7px; padding: 10px 12px; white-space: normal; }
.ml-date { font-size: 13px; }
.ml-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 13px; color: var(--text); }
.ml-row i { width: 12px; height: 3px; border-radius: 2px; }
.ml-row b { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.ml-ev { color: var(--muted); font-size: 12.5px; }
.chart.ml .chart-table th { text-align: left; font-weight: 500; color: var(--muted); padding: 2px 12px 2px 0; font-size: 12px; }

@media (max-width: 1100px) {
  .st-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-two { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .page-head[data-view="stats"] .ph-end { flex: 1 1 100%; justify-content: flex-start; margin-left: 0; }
  .page-head[data-view="stats"] .bar-actions { flex: 1 1 100%; }
  .page-head[data-view="stats"] .st-period { overflow-x: auto; max-width: 100%; }
  .st-cards { gap: 10px; }
  .st-card, .st-pf { padding: 14px 16px 16px; border-radius: 20px; }
  .st-v { font-size: 28px; }
  .st-pf .st-v { font-size: 24px; }
  .st-pfs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .st-h { margin-top: 22px; }
  .st2 .chart { padding: 16px 14px 12px; border-radius: 20px; }
  .ml-plot { height: 200px; margin: 6px 56px 24px 36px; }
  .ml-y { left: -36px; }
  .ml-end b { font-size: 11.5px; }
  .ml-end { gap: 4px; }
  .st-best, .st-posts, .st-fmt { border-radius: 20px; }
  .st-best { padding: 16px 16px 18px; }
  .st-posts h2 { padding: 16px 16px 10px; }
  .st-row { grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 24px; grid-template-rows: auto auto; gap: 2px 8px; padding: 10px 16px; align-items: center; }
  .st-row.head { display: none; }
  .st-row .th { grid-row: 1 / 3; width: 40px; height: 48px; }
  .st-row .st-t { grid-column: 2 / 5; }
  .st-row .st-ic { grid-column: 5; grid-row: 1; }
  .st-row .tnum { grid-row: 2; text-align: left; font-size: 13px; color: var(--muted); }
  .st-row .tnum::before { content: attr(data-label) " "; font-size: 11.5px; color: var(--faint); display: block; }
  .st-fmt { padding: 16px 16px 6px; }
  .chart-plot .ln-note { font-size: 12px; white-space: normal; width: 150px; text-align: center; transform: translate(-50%, -48px); }
}

/* ---------- stage H (planner v3.1, 7.10 and 7.11): Автоматизация, Настройки, Шаблоны, Хэштеги, Корзина ---------- */
/* a switch that is not a signal: the text colour, not the gold (the gold is only «today» and «next») */
.switch.mono input:checked + span { background: var(--text); }
.switch.mono input:checked + span::after { background: var(--bg); }
.switch.mono span { width: 44px; height: 26px; border-radius: 13px; }
.switch.mono span::after { top: 3px; left: 3px; width: 20px; height: 20px; }
.switch.mono input:checked + span::after { transform: translateX(18px); }
.switch.mono { gap: 10px; color: var(--text); font-size: 14px; }

.ar-seg { display: inline-flex; gap: 4px; margin: 0 0 18px; }
.ar-seg a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 10px; color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: none; }
.ar-seg a:hover { color: var(--text); }
.ar-seg a.on { color: var(--text); background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); }
.ar-seg a:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.au { max-width: none; }
.ar-two { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.ar-col { min-width: 0; display: grid; gap: 14px; }
.ar-list { display: grid; gap: 12px; }
.ar-card { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 16px 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); }
.ar-card.off .ar-main b, .ar-card.off .ar-then { color: var(--muted); }
.ar-card.off .ar-ico { opacity: .6; }
.ar-ico { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--raised); border: 1px solid var(--line); color: var(--muted); }
.ar-ico .ico { width: 20px; height: 20px; }
.ar-main { display: grid; gap: 3px; min-width: 0; padding: 4px 0; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; font: inherit; border-radius: 8px; }
.ar-main:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 4px; }
.ar-main b { font: 600 16px/1.35 var(--sans); overflow-wrap: anywhere; }
.ar-then { display: flex; align-items: flex-start; gap: 6px; color: var(--text); font-size: 14px; line-height: 1.4; }
.ar-then .ico { flex: none; width: 14px; height: 14px; margin-top: 3px; color: var(--muted); }
.ar-main small { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ar-note { margin: 0; }
.ar-side { padding-top: 6px; display: grid; gap: 10px; align-content: start; }
.ar-side h3 { margin: 0; font: 600 16px/1.3 var(--sans); }
.ar-side > p { margin: -6px 0 4px; color: var(--muted); font-size: 13px; }
.ar-preset { display: grid; gap: 2px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); color: var(--text); text-align: left; cursor: pointer; font: inherit; min-height: 44px; }
.ar-preset:hover { border-color: var(--line-strong); background: var(--raised); }
.ar-preset:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.ar-preset b { font: 600 15px/1.3 var(--sans); }
.ar-preset small { color: var(--muted); font-size: 13px; }

/* the panel of a rule / a template / a hashtag set: at the right on a computer, a sheet from below on a phone */
.ar-scrim { position: fixed; inset: 0; z-index: 70; background: var(--scrim, rgb(0 0 0 / .5)); }
.ar-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 71; width: min(440px, 100vw); display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line-strong); box-shadow: var(--shadow); animation: ar-in 220ms var(--ease, ease-out); }
@keyframes ar-in { from { transform: translateX(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ar-panel { animation: none; } }
.ar-panel form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.ar-panel header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 8px; }
.ar-panel h2 { margin: 0; font: 600 20px/1.2 var(--sans); }
.ar-fields { flex: 0 1 auto; overflow-y: auto; display: grid; gap: 16px; align-content: start; padding: 10px 22px 16px; }
.ar-panel .seg { margin: 4px 22px 0; flex-wrap: wrap; align-self: flex-start; }
.ar-panel .form-error { margin: 0; padding: 0 22px; }
.ar-panel footer { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 22px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.ar-panel footer .ar-del { margin-left: auto; }
.ar-panel .ar-on { padding: 4px 22px 14px; }
.ar-panel textarea { min-height: 120px; }
.ar-fs { margin: 0; padding: 0; border: 0; display: grid; gap: 8px; }
.ar-fs legend { padding: 0; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.ar-pfs { display: flex; flex-wrap: wrap; gap: 8px; }
.ar-pf { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 10px; border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; font-size: 14px; }
.ar-pf input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.ar-pf .ico { width: 18px; height: 18px; display: block; }
.ar-pf.on { background: var(--raised); border-color: var(--text); }
.ar-pf:focus-within { outline: 2px solid var(--accent-line); outline-offset: 2px; }
body.ar-open { overflow: hidden; }

/* lists of «Шаблоны» and «Хэштеги» */
.ls { display: grid; gap: 12px; max-width: 860px; }
.ls-card { display: grid; gap: 6px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.ls-card:hover { border-color: var(--line-strong); background: var(--raised); }
.ls-card:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.ls-card b { font: 600 16px/1.3 var(--sans); }
.ls-text { color: var(--muted); font-size: 14px; line-height: 1.45; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ls-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ls-card small { color: var(--muted); font-size: 12.5px; }

/* the trash */
.tr { display: grid; gap: 14px; max-width: 860px; }
.tr-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tr-top:empty { display: none; }
.tr-top .hint { margin: 0; }
.tr-rows { display: grid; gap: 10px; }
.tr-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.tr-row img, .tr-blank { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--sunken); display: block; }
.tr-main { display: grid; gap: 3px; min-width: 0; }
.tr-main b { font: 600 15px/1.35 var(--sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-main small { color: var(--muted); font-size: 13px; }
.tr-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

/* «Настройки»: one page, «Соцсети» first (the mockup PL-Settings) */
.settings { max-width: 900px; }
.settings .set-body { display: grid; gap: 28px; }
.sn-sec h2 { margin: 0 0 12px; font: 600 18px/1.3 var(--sans); }
.sn-card { border: 1px solid var(--line); border-radius: 22px; background: var(--panel); padding: 4px 22px; }
.sn-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.sn-row:first-child { border-top: 0; }
.sn-head { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; color: var(--text); text-align: left; font: inherit; cursor: pointer; border-radius: 10px; }
.sn-head[tabindex="-1"] { cursor: default; }
.sn-head:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 3px; }
.sn-ava { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; color: var(--pf); background: color-mix(in srgb, var(--pf) 14%, transparent); }
.sn-ava .ico { width: 19px; height: 19px; }
.pf-bg-instagram { --pf: var(--pf-instagram); } .pf-bg-telegram { --pf: var(--pf-telegram); } .pf-bg-vk { --pf: var(--pf-vk); }
.pf-bg-youtube { --pf: var(--pf-youtube); } .pf-bg-tiktok { --pf: var(--pf-tiktok); } .pf-bg-threads { --pf: var(--pf-threads); }
.sn-name { display: grid; gap: 1px; min-width: 0; }
.sn-name b { font: 600 15px/1.3 var(--sans); }
.sn-name small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sn-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.sn-ok, .sn-state { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.sn-ok .ico { width: 14px; height: 14px; }
.sn-bad { display: inline-flex; align-items: center; gap: 6px; color: var(--st-error); font-size: 13px; font-weight: 500; text-align: right; }
.sn-bad .ico { width: 14px; height: 14px; flex: none; }
.sn-detail { grid-column: 1 / -1; display: grid; gap: 8px; padding: 6px 0 2px 54px; }
.sn-detail[hidden] { display: none; }
.sn-line { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.sn-line:first-child { border-top: 0; }
.sn-line .label { flex: 1; display: grid; gap: 2px; min-width: 0; }
.sn-line .label span { font-size: 15px; }
.sn-line .label small { color: var(--muted); font-size: 12.5px; }
.sn-line #df-time { width: 132px; flex: none; }
.sn-line.df-sign { align-items: flex-start; }
.sn-line #df-sign { width: min(420px, 55%); min-height: 64px; flex: none; }
.sn-card .form-error { margin: 0 0 12px; }
.sn-card .form-error:empty { display: none; }

@media (max-width: 1023px) {
  .ar-two { grid-template-columns: 1fr; }
  .ar-side { order: 2; }
}
@media (max-width: 700px) {
  .ar-card { grid-template-columns: 40px minmax(0, 1fr) auto; padding: 14px; gap: 10px 12px; }
  .ar-card .ar-ico { width: 40px; height: 40px; }
  .ar-card > .icon-btn { grid-column: 3; grid-row: 2; justify-self: end; }
  .ar-card > .switch { grid-column: 3; grid-row: 1; }
  .ar-card .ar-main { grid-column: 2; grid-row: 1 / span 2; }
  .ar-seg { display: flex; overflow-x: auto; scrollbar-width: none; }
  .ar-seg a { flex: none; min-height: 44px; }
  .ar-panel { top: auto; width: 100vw; max-height: 92dvh; border-left: 0; border-top: 1px solid var(--line-strong); border-radius: 22px 22px 0 0; animation-name: ar-up; }
  @keyframes ar-up { from { transform: translateY(24px); opacity: 0; } }
  .ar-panel footer .btn, .ar-pf { min-height: 44px; }
  .tr-row { grid-template-columns: 48px minmax(0, 1fr); }
  .tr-row img, .tr-blank { width: 48px; height: 48px; }
  .tr-acts { grid-column: 1 / -1; justify-content: stretch; }
  .tr-acts .btn { flex: 1; min-height: 44px; justify-content: center; }
  .sn-card { padding: 2px 16px; border-radius: 18px; }
  .sn-row { grid-template-columns: 1fr; }
  .sn-right { justify-content: space-between; padding-left: 54px; }
  .sn-detail { padding-left: 54px; }
  .sn-line { flex-wrap: wrap; }
  .sn-line #df-sign { width: 100%; }
  .sn-line #df-time { min-height: 44px; }
  .switch.mono, .ar-card .switch { min-height: 44px; }
}
.ar-ico[class*="pfc-"] { color: var(--pfc); }
.page-head[data-view="auto"] .pf-bar { display: none; }

/* the phone: panes that fill the screen stop above the studio's tab bar (and its safe area) instead of under it */
@media (max-width: 760px) {
  .inbox.ib2, .lib2 { height: calc(100dvh - 72px - 76px - env(safe-area-inset-bottom)); }
  .cal.week .cal-grid { min-height: calc(100dvh - 170px - 76px); }
}

.lib-grid { align-items: start; }
.lib-fmt { margin: 2px 0 6px; font-size: 13px; }

/* the feed: a draft is dimmed and carries a white pencil badge, a planned post a dark clock badge, a failed one a red one (no dashed frame); tiles are 3:4 */
.tile.planned.st-draft, .tile.planned.st-ready, .tile.planned.st-error { outline: 0; }
.tile.planned.st-draft img, .tile.planned.st-ready img { opacity: .72; filter: saturate(.55); }
.tile.planned::after { box-shadow: none !important; }
.tile .tchip { position: absolute; left: 6px; bottom: 6px; z-index: 2; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px 0 7px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; max-width: calc(100% - 12px); }
.tile .tchip .ico { width: 13px; height: 13px; }
.tile .tchip.draft { background: #fff; color: #181715; }
.tile .tchip.plan { background: rgb(15 15 14 / .72); color: #fff; backdrop-filter: blur(6px); }
.tile .tchip.err { background: #C23A26; color: #fff; }
.pgrid .tile { aspect-ratio: 3 / 4; }
.feed-chips { display: flex; gap: 8px; padding: 0 0 12px; overflow-x: auto; scrollbar-width: none; }
.feed-chips button { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line-strong); background: transparent; color: var(--text); font: 500 14px var(--sans); white-space: nowrap; cursor: pointer; }
.feed-chips button .ico { width: 14px; height: 14px; }
.feed-chips button.on { background: var(--raised); border-color: var(--line-strong); font-weight: 600; }

/* the installed app draws under the clock: the page starts below it, and a strip of the page colour keeps scrolled content from showing through */
body { padding-top: var(--safe-top); }
body::before { content: ""; position: fixed; z-index: 96; top: 0; left: 0; right: 0; height: var(--safe-top); background: var(--bg); pointer-events: none; }
.topbar, .page-head { top: var(--safe-top); }
@media (max-width: 760px) { .editor, .ar-panel { padding-top: var(--safe-top); } }

/* ---------- month on the phone (T-14): the cover of the first post in the cell, the day's posts under the month ---------- */
.day-cover { display: none; }
.seg-link { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 6px; color: var(--muted); font: 500 13px var(--sans); text-decoration: none; }
@media (max-width: 700px) {
  .cal.month .day { min-height: 86px; padding: 6px 0 5px; gap: 4px; border-radius: 0; }
  .cal.month .day-dots { display: none; }
  .cal.month .day.out .dnum { color: var(--faint); opacity: .6; }
  .cal.month .day .dnum { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font: 600 15px var(--sans); }
  .cal.month .day.today .dnum { background: var(--st-error); color: #fff; }
  .cal.month .day.picked { background: transparent; box-shadow: none; }
  .cal.month .day.picked:not(.today) .dnum { background: var(--text); color: var(--bg); }
  .cal.month .day-cover { position: relative; display: block; width: 44px; aspect-ratio: 4 / 5; border-radius: 7px; background: var(--raised); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
  .cal.month .day-cover > img, .cal.month .day-cover .dc-ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: grid; place-items: center; color: var(--faint); }
  .cal.month .day-cover .dc-ph .ico { width: 18px; height: 18px; }
  .cal.month .day-cover.st-scheduled { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
  .cal.month .day-cover.draft > img, .cal.month .day-cover.draft .dc-ph { opacity: .5; filter: saturate(.55); }
  .cal.month .day-cover.err { box-shadow: inset 0 0 0 2px var(--st-error); }
  .cal.month .day-cover i { position: absolute; display: grid; place-items: center; font-style: normal; }
  .cal.month .dc-fmt { top: 3px; right: 3px; width: 16px; height: 16px; color: #fff; filter: drop-shadow(0 0 2px rgb(0 0 0 / .6)); }
  .cal.month .dc-fmt .ico { width: 13px; height: 13px; }
  .cal.month .dc-pen { top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; color: #181715; }
  .cal.month .dc-pen .ico { width: 10px; height: 10px; }
  .cal.month .dc-bad { top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: var(--st-error); color: #fff; font: 700 11px/1 var(--sans); }
  .cal.month .dc-more { position: absolute; right: 3px; bottom: 3px; min-width: 18px; height: 16px; padding: 0 4px; border-radius: 8px; background: rgb(0 0 0 / .55); color: #fff; font: 600 10.5px/16px var(--sans); text-align: center; }
  .agenda { margin-top: 14px; gap: 0; }
  .agenda h3 { padding-bottom: 8px; border-bottom: 1px solid var(--line); gap: 8px; justify-content: flex-start; } .agenda h3 small { color: var(--muted); font: 400 13px var(--sans); } .agenda h3 .btn { margin-left: auto; }
  .mrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
  .mr-th { width: 40px; height: 50px; flex: none; border-radius: 6px; background: var(--raised); overflow: hidden; display: grid; place-items: center; color: var(--faint); } .mr-th img { width: 100%; height: 100%; object-fit: cover; }
  .mrow.st-draft .mr-th img { opacity: .55; filter: saturate(.55); }
  .mr-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .mr-m { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); } .mr-m b { color: var(--text); font-size: 14px; }
  .mr-t { font: 600 15px/1.3 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .agenda-empty { border: 0; padding: 22px 0; text-align: left; color: var(--muted); }
}

.pc-fmt { font-size: 11.5px; color: var(--muted); }
@media (max-width: 700px) {
  :root { --today: #D7261E; } :root:not([data-theme="light"]) { --today: #E5533F; }
  .cal.month .day.today .dnum { background: var(--today); }
  .cal.month .cal-grid, .cal.month { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .cal.month .day { border-left: 0; border-right: 0; background: transparent; }
  .cal.month .day.out { background: transparent; }
  .cal.month .cal-head { border-bottom: 1px solid var(--line); }
  .cal.month .cal-head > div { border-bottom: 0; font: 500 13px var(--sans); letter-spacing: 0; text-transform: none; color: var(--muted); }
}

/* the period row of the month on the phone (T-14): the title and the arrows on one line, the segment under them */
@media (max-width: 700px) {
  .ph-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 8px 8px; }
  .ph-end, .bar-actions { display: contents; }
  .ph-title { grid-column: 1; grid-row: 1; display: flex; align-items: baseline; gap: 10px; min-width: 0; }
  .bar-actions [data-nav="0"] { grid-column: 2; grid-row: 1; border: 0; background: none; color: var(--today); font-weight: 600; padding: 0 4px; }
  .bar-actions [data-nav="-1"] { grid-column: 3; grid-row: 1; }
  .bar-actions [data-nav="1"] { grid-column: 4; grid-row: 1; }
  .bar-actions .seg[role="tablist"] { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  .bar-actions .seg[role="tablist"] button, .bar-actions .seg[role="tablist"] a { flex: 1; justify-content: center; height: 34px; }
  .bar-actions .size-seg, .bar-actions .undated-btn { display: none; }
  .pf-bar { grid-column: 1 / -1; grid-row: 3; }
}
@media (max-width: 700px) { .ph-title h1 { flex: none; } .ph-sub { white-space: nowrap; font-size: 14px; } .ph-title { flex-wrap: nowrap; } }


/* ---------- fix-2 · the phone's frame: the head, the row «‹ 19–25 октября ›», the view switch and the platform filter stand; only the list of days scrolls ---------- */
@media (max-width: 760px) {
  html { overscroll-behavior: none; }
  body:has(#page-head[data-view="week"]) { padding: 0 !important; overflow: hidden; overscroll-behavior: none; }
  body:has(#page-head[data-view="week"]) .shell { position: fixed; z-index: 1; top: 0; left: 0; right: 0; bottom: 0; min-height: 0; height: auto; overflow: hidden; }
  body:has(#page-head[data-view="week"]) .main { flex: 1; min-height: 0; }
  body:has(#page-head[data-view="week"]) .topbar, body:has(#page-head[data-view="week"]) .page-head { flex: none; top: 0; }
  body:has(#page-head[data-view="week"]) .view { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; overflow-anchor: none; scrollbar-width: none; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  body:has(#page-head[data-view="week"]) .view::-webkit-scrollbar { display: none; }

  /* P3: the sections that are not in the view switch; the studio's apps are in the tab bar */
  .topbar .apps-btn { display: none; }
  .tb-tab[data-view="week"], .tb-tab[data-view="feed"] { display: none; }
  .topbar { flex-wrap: nowrap; align-items: center; padding-top: calc(8px + var(--safe-top, env(safe-area-inset-top))); padding-bottom: 4px; }
  .topbar .tb-nav { order: 1; flex: 1 1 0; min-width: 0; margin: 0 0 0 -16px; padding: 0 28px 0 16px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .topbar .tb-end { order: 2; margin-left: 0; gap: 4px; }
  .tb-tab { padding: 0 12px; }

  /* P4: the caption under the title, the arrows to the right of it; today is a red number as in the calendar */
  .ph-row { padding-top: 8px; row-gap: 8px; }
  .ph-title { display: flex; flex-direction: column; align-items: flex-start; gap: 0; }
  .ph-title h1 { font-size: 24px; line-height: 1.2; }
  .ph-sub { white-space: normal; font-size: 13px; color: var(--muted); line-height: 1.3; }
  .cal.week .day.today .day-head, .cal.week .day.today .day-head b, .cal.week .day.today .day-head .dh-wd { color: var(--now, #D7261E); }
  .ag-day.today h3 b { color: var(--now, #D7261E); }
}
